CbmRoot
Loading...
Searching...
No Matches
CbmMCDataManager.h
Go to the documentation of this file.
1/* Copyright (C) 2015-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Mikhail Prokudin, Volker Friese [committer], Florian Uhlig */
4
10#ifndef CBMMCDATAMANAGER_H
11#define CBMMCDATAMANAGER_H 1
12
13#include <FairTask.h> // for FairTask, InitStatus
14
15#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
16#include <RtypesCore.h> // for Int_t, Option_t
17#include <TString.h> // for TString
18
19#include <list> // for list
20#include <map> // for map
21#include <vector> // for vector
22
23class CbmMCDataArray;
24class CbmMCDataObject;
25
31class CbmMCDataManager : public FairTask {
32
33public:
36
37
42 CbmMCDataManager(const char* name, Int_t legacy = 0);
43
44
47
48
55 Int_t AddFile(const char* fileName);
56
62 Int_t AddFileToChain(const char* fileName, Int_t chainNumber);
63
68 void AddFriend(Int_t chainNum1, Int_t chainNum2) { fFriends[chainNum1] = chainNum2; }
69
71 virtual void Exec(Option_t* /*option*/) {};
72
73
75 virtual void FinishEvent();
76
77
79 virtual InitStatus Init();
80
81
86 CbmMCDataArray* InitBranch(const char* name);
87
92 CbmMCDataObject* GetObject(const char* name);
93
94private:
95 Int_t fLegacy;
96
98 std::vector<std::list<TString>> fFileList;
99
101 std::map<TString, CbmMCDataArray*> fActive;
103 std::map<TString, CbmMCDataObject*> fActiveObj;
105 std::map<Int_t, Int_t> fFriends;
106
108};
109
110#endif
Access to a MC data branch for time-based analysis.
Task class creating and managing CbmMCDataArray objects.
std::vector< std::list< TString > > fFileList
std::map< TString, CbmMCDataArray * > fActive
Array of filename chains.
virtual void FinishEvent()
Int_t AddFileToChain(const char *fileName, Int_t chainNumber)
virtual InitStatus Init()
std::map< TString, CbmMCDataObject * > fActiveObj
ClassDef(CbmMCDataManager, 1)
Int_t fLegacy
If true, use FairRootManager in event-by-event mode.
std::map< Int_t, Int_t > fFriends
void AddFriend(Int_t chainNum1, Int_t chainNum2)
CbmMCDataObject * GetObject(const char *name)
CbmMCDataArray * InitBranch(const char *name)
Int_t AddFile(const char *fileName)
virtual void Exec(Option_t *)
Access to a MC data branch for time-based analysis.