CbmRoot
CbmMCDataObject.h
Go to the documentation of this file.
1 
5 #ifndef CBMMCDATAOBJECT_H
6 #define CBMMCDATAOBJECT_H
7 
8 #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
9 #include <RtypesCore.h> // for Int_t, Long64_t
10 #include <TString.h> // for TString
11 
12 #include <list> // for list
13 #include <map> // for map
14 #include <vector> // for vector
15 
16 #include "CbmLink.h" // for CbmLink
17 
18 class TChain;
19 class TObject;
20 
35  friend class CbmMCDataManager;
36 
37 public:
39  virtual ~CbmMCDataObject() {}
40 
41 
46  TObject* Get(const CbmLink* lnk) {
47  return Get(lnk->GetFile(), lnk->GetEntry());
48  }
49 
50 
55  TObject* Get(const CbmLink& lnk) {
56  return Get(lnk.GetFile(), lnk.GetEntry());
57  }
58 
59 
65  TObject* Get(Int_t fileNumber, Int_t eventNumber);
66 
67 private:
70  : fLegacy(0)
71  , fLegacyObject(nullptr)
72  , fBranchName()
73  , fSize(0)
74  , fChains()
75  , fTArr()
76  , fN(0)
77  , fArrays() {}
78 
83  CbmMCDataObject(const char* branchName,
84  const std::vector<std::list<TString>>& fileList);
85 
89  CbmMCDataObject(const char* branchName);
90 
91 
94 
95 
97  void Done();
98 
99 
101  void FinishEvent();
102 
107  void AddFriend(Int_t chainNum1, Int_t chainNum2);
108 
109 
115  TObject* LegacyGet(Int_t fileNumber, Int_t eventNumber);
116 
117 
118  //---- Private data members -------
119  Int_t fLegacy;
120  TObject* fLegacyObject;
121  TString fBranchName;
122  Int_t fSize;
123  std::vector<TChain*> fChains;
124  std::vector<TObject*>
126  std::vector<Long64_t> fN;
127 
131  std::vector<std::map<Int_t, TObject*>> fArrays;
132 
134 
136 };
137 
138 #endif
CbmMCDataObject::operator=
CbmMCDataObject & operator=(const CbmMCDataObject &)
CbmMCDataObject::ClassDef
ClassDef(CbmMCDataObject, 1)
CbmMCDataObject::AddFriend
void AddFriend(Int_t chainNum1, Int_t chainNum2)
Definition: CbmMCDataObject.cxx:54
CbmMCDataObject::CbmMCDataObject
CbmMCDataObject()
Definition: CbmMCDataObject.h:69
CbmMCDataObject::fChains
std::vector< TChain * > fChains
Number of input file lists (one per source)
Definition: CbmMCDataObject.h:123
CbmMCDataObject::LegacyGet
TObject * LegacyGet(Int_t fileNumber, Int_t eventNumber)
Definition: CbmMCDataObject.cxx:98
CbmMCDataObject::fSize
Int_t fSize
Name of the data branch.
Definition: CbmMCDataObject.h:122
CbmMCDataObject::fLegacyObject
TObject * fLegacyObject
If true, run in legacy mode.
Definition: CbmMCDataObject.h:120
CbmMCDataObject::CbmMCDataObject
CbmMCDataObject(const CbmMCDataObject &)
CbmMCDataObject::fBranchName
TString fBranchName
Pointer to TObject for legacy mode.
Definition: CbmMCDataObject.h:121
CbmMCDataObject::FinishEvent
void FinishEvent()
Definition: CbmMCDataObject.cxx:130
CbmMCDataManager
Task class creating and managing CbmMCDataArray objects.
Definition: CbmMCDataManager.h:27
CbmMCDataObject::fTArr
std::vector< TObject * > fTArr
Arrays of chains (one per input source)
Definition: CbmMCDataObject.h:125
CbmMCDataObject::~CbmMCDataObject
virtual ~CbmMCDataObject()
Definition: CbmMCDataObject.h:39
CbmMCDataObject
Access to a MC data branch for time-based analysis.
Definition: CbmMCDataObject.h:34
CbmMCDataObject::Done
void Done()
Definition: CbmMCDataObject.cxx:145
CbmMCDataObject::fArrays
std::vector< std::map< Int_t, TObject * > > fArrays
Number of entries in chains.
Definition: CbmMCDataObject.h:131
CbmMCDataObject::Get
TObject * Get(const CbmLink *lnk)
Definition: CbmMCDataObject.h:46
CbmMCDataObject::fLegacy
Int_t fLegacy
Definition: CbmMCDataObject.h:119
eventNumber
Int_t eventNumber
Definition: riplet/Lx.cxx:78
CbmMCDataObject::Get
TObject * Get(const CbmLink &lnk)
Definition: CbmMCDataObject.h:55
CbmMCDataObject::fN
std::vector< Long64_t > fN
Data objects from chains (one per input source)
Definition: CbmMCDataObject.h:126