27#include <FairRootManager.h>
30#include <TClonesArray.h>
31#include <TStopwatch.h>
57 std::map<Int_t, CbmEventStore*> eventMap;
60 UInt_t nDigisNoise = 0;
68 for (Int_t iDigi = 0; iDigi < nDigis; iDigi++) {
84 auto mapIt = eventMap.find(mcEventNr);
85 if (mapIt == eventMap.end()) {
87 mapIt = eventMap.find(mcEventNr);
89 assert(mapIt != eventMap.end());
140 nDigisNoise += nNoise;
144 for (
auto& entry : eventMap) {
146 UInt_t nEntry =
fEvents->GetEntriesFast();
151 LOG(debug) <<
event->ToString();
153 LOG(debug) <<
"Created " <<
fEvents->GetEntriesFast() <<
" events";
158 std::cout << std::endl;
159 LOG(info) <<
"+ " << setw(15) << GetName() <<
": Time-slice " << setw(3) << right <<
fNofEntries
160 <<
", events: " << setw(6) << nEvents <<
", digis: " << nDigisTot <<
", noise: " << nDigisNoise
161 <<
". Exec time " << fixed << setprecision(6) << timer.RealTime() <<
" s.";
173 FairRootManager* ioman = FairRootManager::Instance();
180 std::cout << std::endl;
181 LOG(info) <<
"==================================================";
182 LOG(info) << GetName() <<
": Initialising...";
193 LOG(fatal) << GetName() <<
": No match branch found!";
198 if (ioman->GetObject(
"CbmEventStore")) {
199 LOG(fatal) << GetName() <<
": Branch CbmEventStore already exists!";
210 fEvents =
new TClonesArray(
"CbmEventStore", 100);
211 ioman->Register(
"CbmEventStore",
"Events",
fEvents, kTRUE);
214 LOG(info) <<
"==================================================";
215 std::cout << std::endl;
ClassImp(CbmConverterManager)
@ kMvd
Micro-Vertex Detector.
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kPsd
Projectile spectator detector.
@ kSts
Silicon Tracking System.
@ kMuch
Muon detection system.
@ kFsd
Forward spectator detector.
@ kNofSystems
For loops over active systems.
@ kRich
Ring-Imaging Cherenkov Detector.
virtual void Exec(Option_t *opt)
virtual InitStatus Init()
CbmDigiManager * fDigiMan
virtual ~CbmBuildEventsIdealNew()
std::vector< ECbmModuleId > fSystems
Int_t fNofEntries
Event array.
static Int_t GetNofDigis(ECbmModuleId systemId)
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
static Bool_t IsMatchPresent(ECbmModuleId systemId)
Presence of a digi match branch.
InitStatus Init()
Initialisation.
const Digi * Get(Int_t index) const
Get a digi object.
static CbmDigiManager * Instance()
Static instance.
const CbmMatch * GetMatch(ECbmModuleId systemId, UInt_t index) const
Get a match object.
Storable event class for CBM.
Data class for FSD digital information.
const CbmLink & GetMatchedLink() const
static TString GetModuleNameCaps(ECbmModuleId moduleId)
Data class for PSD digital information.
Data class for a single-channel message in the STS.
Data class for expanded digital TOF information.