RootAddress Class Reference

Definition of a Root address, derived from IOpaqueAddress. More...

#include <RootAddress.h>

List of all members.

Public Member Functions

 RootAddress ()
 RootAddress (unsigned char svc, const CLID &clid, const std::string path="", const std::string treename="", const std::string branchname="", int entry=-1)
virtual ~RootAddress ()
std::string getTreename () const
virtual void setTreename (std::string treename)
std::string getBranchname (int i) const
std::string getPath () const
Int_t getEntryNr () const
Short_t getNrBranches () const
void setEntryNr (int entry)
void Print () const

Private Attributes

std::string m_treename
 name of TTree
std::string m_branchname
 name of TBranch
std::string m_path
 path in TDS
Int_t m_entrynr
 entry number
Short_t m_nrBranches
 nr of branches associated (m_branchname may contain cvoncatenation)


Detailed Description

Definition of a Root address, derived from IOpaqueAddress.

Based on SICb's Address class. Contains Root Treenames and branchnames and nr of entry to be able to retrieve the object. Based on the RootAddress of Glast.

Definition at line 21 of file RootAddress.h.


Constructor & Destructor Documentation

RootAddress::RootAddress (  )  [inline]

Definition at line 24 of file RootAddress.h.

00024 {;}

RootAddress::RootAddress ( unsigned char  svc,
const CLID &  clid,
const std::string  path = "",
const std::string  treename = "",
const std::string  branchname = "",
int  entry = -1 
)

Definition at line 7 of file RootAddress.cxx.

References m_branchname, m_entrynr, m_nrBranches, m_path, m_treename, RealDBUtil::npos, boss::pos, s, and boss::where().

00008   : GenericAddress(svc, clid, path, "", 0, 0) 
00009 {
00010   // parse branchname and store what has to be read
00011   m_branchname = branchname;
00012   int s=branchname.size();
00013   m_nrBranches=0;
00014   if (branchname.size()) {
00015     int pos=0,where=1;
00016     while (where!=std::string::npos) {
00017       m_nrBranches++;
00018       where=branchname.find(":",pos);
00019       pos=where+1;
00020     }
00021   }
00022 
00023   m_treename = treename;
00024   m_path=path; 
00025   m_entrynr=entry;
00026 }

virtual RootAddress::~RootAddress (  )  [inline, virtual]

Definition at line 26 of file RootAddress.h.

00026 {}


Member Function Documentation

std::string RootAddress::getBranchname ( int  i  )  const

Definition at line 31 of file RootAddress.cxx.

References genRecEmupikp::i, m_branchname, RealDBUtil::npos, boss::pos, and boss::where().

Referenced by RootEventBaseCnv::createObj().

00031                                                  {
00032   int pos,where=-1;
00033   int i=0;
00034   while (i<=nb) {
00035     pos=where+1;
00036     where=m_branchname.find(":",pos);
00037     i++;
00038   }
00039   if (where==std::string::npos) where=m_branchname.size();
00040  
00041   return m_branchname.substr(pos,where-pos);
00042 }

Int_t RootAddress::getEntryNr (  )  const [inline]

Definition at line 31 of file RootAddress.h.

References m_entrynr.

Referenced by RootEventBaseCnv::createObj().

00031 {return m_entrynr;}

Short_t RootAddress::getNrBranches (  )  const [inline]

Definition at line 32 of file RootAddress.h.

References m_nrBranches.

Referenced by RootEventBaseCnv::createObj().

00032 {return  m_nrBranches;}

std::string RootAddress::getPath (  )  const [inline]

Definition at line 30 of file RootAddress.h.

References m_path.

Referenced by RootEventBaseCnv::createObj().

00030 {return m_path;}

std::string RootAddress::getTreename (  )  const [inline]

Definition at line 27 of file RootAddress.h.

References m_treename.

Referenced by RootEventBaseCnv::createObj(), TrigCnv::DataObjectToTObject(), RecTrackCnv::DataObjectToTObject(), McCnv::DataObjectToTObject(), HltCnv::DataObjectToTObject(), EvtRecCnv::DataObjectToTObject(), EvtNavigatorCnv::DataObjectToTObject(), EvtHeaderCnv::DataObjectToTObject(), DstCnv::DataObjectToTObject(), and DigiCnv::DataObjectToTObject().

00027 {return m_treename;}

void RootAddress::Print (  )  const

Definition at line 27 of file RootAddress.cxx.

References m_branchname, m_entrynr, m_path, and m_treename.

00027                               {
00028   std::cout << "RootAddress: path "<<m_path<< ", treename "<<m_treename <<" branchname "<<m_branchname<<" entry "<<m_entrynr<<std::endl;
00029 }

void RootAddress::setEntryNr ( int  entry  )  [inline]

Definition at line 33 of file RootAddress.h.

References m_entrynr.

Referenced by RootEventBaseCnv::createObj().

00033 {m_entrynr=entry;}

virtual void RootAddress::setTreename ( std::string  treename  )  [inline, virtual]

Definition at line 28 of file RootAddress.h.

References m_treename.

00028 {m_treename=treename;}


Member Data Documentation

std::string RootAddress::m_branchname [private]

name of TBranch

Definition at line 40 of file RootAddress.h.

Referenced by getBranchname(), Print(), and RootAddress().

Int_t RootAddress::m_entrynr [private]

entry number

Definition at line 44 of file RootAddress.h.

Referenced by getEntryNr(), Print(), RootAddress(), and setEntryNr().

Short_t RootAddress::m_nrBranches [private]

nr of branches associated (m_branchname may contain cvoncatenation)

Definition at line 46 of file RootAddress.h.

Referenced by getNrBranches(), and RootAddress().

std::string RootAddress::m_path [private]

path in TDS

Definition at line 42 of file RootAddress.h.

Referenced by getPath(), Print(), and RootAddress().

std::string RootAddress::m_treename [private]

name of TTree

Definition at line 38 of file RootAddress.h.

Referenced by getTreename(), Print(), RootAddress(), and setTreename().


Generated on Tue Nov 29 23:21:00 2016 for BOSS_7.0.2 by  doxygen 1.4.7