CbmRoot
Loading...
Searching...
No Matches
CbmMCDataObject.h
Go to the documentation of this file.
1/* Copyright (C) 2017-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Mikhail Prokudin, Volker Friese [committer] */
4
9#ifndef CBMMCDATAOBJECT_H
10#define CBMMCDATAOBJECT_H
11
12#include "CbmLink.h" // for CbmLink
13
14#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
15#include <RtypesCore.h> // for Int_t, Long64_t
16#include <TString.h> // for TString
17
18#include <list> // for list
19#include <map> // for map
20#include <vector> // for vector
21
22class TChain;
23class TObject;
24
39 friend class CbmMCDataManager;
40
41public:
43 virtual ~CbmMCDataObject() {}
44
45
50 TObject* Get(const CbmLink* lnk) { return Get(lnk->GetFile(), lnk->GetEntry()); }
51
52
57 TObject* Get(const CbmLink& lnk) { return Get(lnk.GetFile(), lnk.GetEntry()); }
58
59
65 TObject* Get(Int_t fileNumber, Int_t eventNumber);
66
67private:
70 {
71 }
72
77 CbmMCDataObject(const char* branchName, const std::vector<std::list<TString>>& fileList);
78
82 CbmMCDataObject(const char* branchName);
83
84
87
88
90 void Done();
91
92
94 void FinishEvent();
95
100 void AddFriend(Int_t chainNum1, Int_t chainNum2);
101
102
108 TObject* LegacyGet(Int_t fileNumber, Int_t eventNumber);
109
110
111 //---- Private data members -------
112 Int_t fLegacy;
113 TObject* fLegacyObject;
114 TString fBranchName;
115 Int_t fSize;
116 std::vector<TChain*> fChains;
117 std::vector<TObject*> fTArr;
118 std::vector<Long64_t> fN;
119
123 std::vector<std::map<Int_t, TObject*>> fArrays;
124
126
128};
129
130#endif
Task class creating and managing CbmMCDataArray objects.
Access to a MC data branch for time-based analysis.
void AddFriend(Int_t chainNum1, Int_t chainNum2)
TObject * Get(const CbmLink *lnk)
TObject * LegacyGet(Int_t fileNumber, Int_t eventNumber)
std::vector< TObject * > fTArr
Arrays of chains (one per input source)
CbmMCDataObject & operator=(const CbmMCDataObject &)
TString fBranchName
Pointer to TObject for legacy mode.
std::vector< TChain * > fChains
Number of input file lists (one per source)
Int_t fSize
Name of the data branch.
std::vector< std::map< Int_t, TObject * > > fArrays
Number of entries in chains.
std::vector< Long64_t > fN
Data objects from chains (one per input source)
TObject * fLegacyObject
If true, run in legacy mode.
TObject * Get(const CbmLink &lnk)
CbmMCDataObject(const CbmMCDataObject &)
virtual ~CbmMCDataObject()
ClassDef(CbmMCDataObject, 1)