CbmRoot
|
Access to a MC data branch for time-based analysis. More...
#include <CbmMCDataObject.h>
Public Member Functions | |
virtual | ~CbmMCDataObject () |
TObject * | Get (const CbmLink *lnk) |
TObject * | Get (const CbmLink &lnk) |
TObject * | Get (Int_t fileNumber, Int_t eventNumber) |
Private Member Functions | |
CbmMCDataObject () | |
CbmMCDataObject (const char *branchName, const std::vector< std::list< TString >> &fileList) | |
CbmMCDataObject (const char *branchName) | |
CbmMCDataObject (const CbmMCDataObject &) | |
void | Done () |
void | FinishEvent () |
void | AddFriend (Int_t chainNum1, Int_t chainNum2) |
TObject * | LegacyGet (Int_t fileNumber, Int_t eventNumber) |
CbmMCDataObject & | operator= (const CbmMCDataObject &) |
ClassDef (CbmMCDataObject, 1) | |
Private Attributes | |
Int_t | fLegacy |
TObject * | fLegacyObject |
If true, run in legacy mode. More... | |
TString | fBranchName |
Pointer to TObject for legacy mode. More... | |
Int_t | fSize |
Name of the data branch. More... | |
std::vector< TChain * > | fChains |
Number of input file lists (one per source) More... | |
std::vector< TObject * > | fTArr |
Arrays of chains (one per input source) More... | |
std::vector< Long64_t > | fN |
Data objects from chains (one per input source) More... | |
std::vector< std::map< Int_t, TObject * > > | fArrays |
Number of entries in chains. More... | |
Friends | |
class | CbmMCDataManager |
Access to a MC data branch for time-based analysis.
This class provides cached access to data for an event-by-event MC data branch, which is used when matching time-based reconstruction data to the input MC data. Data objects from already used events are cached, which allows switching between events without the performance deterioration induced by frequent calls to TTree::GetEntry(). In legacy mode, the data from the current event will be retrieved from FairRootManager.
Definition at line 34 of file CbmMCDataObject.h.
|
inlinevirtual |
Destructor
Definition at line 39 of file CbmMCDataObject.h.
|
inlineprivate |
Default constructor. Should be called from CbmMCDataManager.
Definition at line 69 of file CbmMCDataObject.h.
|
private |
Standard constructor. Should be called from CbmMCDataManager.
branchName | Name of data branch |
fileList | Vector of file list (one for each input source) |
Definition at line 16 of file CbmMCDataObject.cxx.
|
private |
Constructor in legacy mode. Gets the branch from FairRootManager.
branchName | Name of data branch |
Definition at line 75 of file CbmMCDataObject.cxx.
References fBranchName, and fLegacyObject.
|
private |
Copy constructor. Should not be called.
|
private |
Make TChain number chainNum2 friend of TChain number chainNum2
chainNum1 | a number of chain for which AddFriend is called |
chainNum2 | number of chain which became a friend |
Definition at line 54 of file CbmMCDataObject.cxx.
References fChains, and fLegacy.
Referenced by CbmMCDataManager::GetObject().
|
private |
|
private |
Done. Clear all arrays and delete file chain.
Definition at line 145 of file CbmMCDataObject.cxx.
References fChains, FinishEvent(), fLegacy, fSize, and i.
|
private |
|
inline |
Get an object by CbmLink reference
link | Reference to CbmLink object @value Pointer to linked object |
Definition at line 55 of file CbmMCDataObject.h.
References Get(), CbmLink::GetEntry(), and CbmLink::GetFile().
|
inline |
Get an object by CbmLink pointer
link | Pointer to CbmLink object @value Pointer to linked object |
Definition at line 46 of file CbmMCDataObject.h.
References CbmLink::GetEntry(), and CbmLink::GetFile().
Referenced by CbmTofAnaTestbeam::FillHistos(), and Get().
TObject * CbmMCDataObject::Get | ( | Int_t | fileNumber, |
Int_t | eventNumber | ||
) |
Get an object by file number and event number
fileNumber | Input file number |
eventNumber | Event number @value Pointer to referenced object |
Definition at line 109 of file CbmMCDataObject.cxx.
References eventNumber, fArrays, fChains, fLegacy, fN, fSize, fTArr, and LegacyGet().
|
private |
Get an object in legacy mode
fileNumber | Input number |
eventNumber | Event number @value Pointer to referenced object |
Definition at line 98 of file CbmMCDataObject.cxx.
References eventNumber, and fLegacyObject.
Referenced by Get().
|
private |
|
friend |
Definition at line 35 of file CbmMCDataObject.h.
|
private |
Number of entries in chains.
Cached data objects. The vector index is the input source number, the map index is the event number.
Definition at line 131 of file CbmMCDataObject.h.
Referenced by CbmMCDataObject(), FinishEvent(), and Get().
|
private |
Pointer to TObject for legacy mode.
Definition at line 121 of file CbmMCDataObject.h.
Referenced by CbmMCDataObject().
|
private |
Number of input file lists (one per source)
Definition at line 123 of file CbmMCDataObject.h.
Referenced by AddFriend(), CbmMCDataObject(), Done(), and Get().
|
private |
Definition at line 119 of file CbmMCDataObject.h.
Referenced by AddFriend(), Done(), FinishEvent(), and Get().
|
private |
If true, run in legacy mode.
Definition at line 120 of file CbmMCDataObject.h.
Referenced by CbmMCDataObject(), and LegacyGet().
|
private |
Data objects from chains (one per input source)
Definition at line 126 of file CbmMCDataObject.h.
Referenced by CbmMCDataObject(), and Get().
|
private |
Name of the data branch.
Definition at line 122 of file CbmMCDataObject.h.
Referenced by CbmMCDataObject(), Done(), FinishEvent(), and Get().
|
private |
Arrays of chains (one per input source)
Definition at line 125 of file CbmMCDataObject.h.
Referenced by CbmMCDataObject(), and Get().