18#include "FairModule.h"
19#include "FairRootManager.h"
23#include "TClonesArray.h"
24#include "TGeoManager.h"
26#include "TStopwatch.h"
41using std::setprecision;
47 : FairTask(
"CbmMvdDigiToHit")
49 , fShowDebugHistos(kFALSE)
51 , fInputDigis(nullptr)
62 : FairTask(name, iVerbose)
64 , fShowDebugHistos(kFALSE)
66 , fInputDigis(nullptr)
69 , fBranchName(
"MvdDigi")
95 if (fVerbose) LOG(debug) <<
"//----------------------------------------//";
96 if (fVerbose) LOG(debug) <<
"Send Input";
98 if (fVerbose) LOG(debug) <<
"Execute HitPlugin Nr. " <<
fHitPluginNr;
100 if (fVerbose) LOG(debug) <<
"End Chain";
101 if (fVerbose) LOG(debug) <<
"Start writing Hit";
103 if (fVerbose) LOG(debug) <<
"Total of " <<
fHit->GetEntriesFast() <<
" Hit in this Event";
104 if (fVerbose) LOG(debug) <<
"//----------------------------------------//";
105 LOG(info) <<
"+ " << setw(20) << GetName() <<
": Created: " <<
fHit->GetEntriesFast() <<
" Hit in " << fixed
106 << setprecision(6) <<
fTimer.RealTime() <<
" s";
116 LOG(info) << GetName() <<
": Initialisation..." << endl;
119 FairRootManager* ioman = FairRootManager::Instance();
121 LOG(error) << GetName() <<
"::Init: No FairRootManager!";
126 fInputDigis = (TClonesArray*) ioman->GetObject(
"MvdDigi");
129 LOG(error) <<
"No MvdDigi branch found. There was no MVD in the "
130 "simulation. Switch this task off";
135 fHit =
new TClonesArray(
"CbmMvdHit", 10000);
136 ioman->Register(
"MvdHit",
"Mvd Hit",
fHit, IsOutputBranchPersistent(
"MvdHit"));
141 if (fVerbose) LOG(info) <<
"succesfully loaded Geometry from file";
144 LOG(fatal) <<
"Geometry couldn't be loaded from file. No MVD digitizer available.";
151 for (
auto itr = sensorMap.begin(); itr != sensorMap.end(); itr++) {
154 itr->second->AddPlugin(hitTask);
155 itr->second->SetHitPlugin(plugincount);
166 LOG(info) << GetName() <<
" initialised with parameters: ";
201 std::stringstream ss;
202 ss <<
"============================================================" << endl;
203 ss <<
"============== Parameters DigiToHit ====================" << endl;
204 ss <<
"============================================================" << endl;
205 ss <<
"=============== End Task ===================================" << endl;
ClassImp(CbmMvdDigiToHit)
Helper class to extract information from the GeoManager. Addapted from TrdGeoHandler byFlorian Uhlig ...
std::map< int, CbmMvdSensor * > & GetSensorMap()
Int_t GetPluginArraySize()
static CbmMvdDetector * Instance()
void SetSensorArrayFilled(Bool_t value=kTRUE)
void SetPluginCount(UInt_t count)
Int_t GetSensorArraySize()
virtual InitStatus Init()
TClonesArray * fInputDigis
void PrintParameters() const
virtual InitStatus ReInit()
std::string ParametersToString() const
CbmMvdDetector * fDetector
TStopwatch fTimer
ROOT timer.