19#include "FairModule.h"
20#include "FairRootManager.h"
24#include "TClonesArray.h"
25#include "TGeoManager.h"
36using std::setprecision;
45 : FairTask(name, iVerbose)
47 , fShowDebugHistos(kFALSE)
50 , fInputDigis(nullptr)
51 , fEventDigis(nullptr)
54 , fBranchName(
"MvdDigi")
79 Int_t nEvents =
fEvents->GetEntriesFast();
80 for (Int_t iEv = 0; iEv < nEvents; ++iEv) {
81 LOG(debug) <<
"Getting data from CbmEvent";
85 for (Int_t nDigi = 0; nDigi < nrOfDigis; ++nDigi) {
89 LOG(debug) <<
"//----------------------------------------//";
90 LOG(debug) << endl <<
"Send Input";
94 LOG(debug) <<
"End Chain";
95 LOG(debug) <<
"Start writing Hit";
97 LOG(debug) <<
"Total of " <<
fCluster->GetEntriesFast() <<
" Hit in this Event";
98 LOG(debug) <<
"//----------------------------------------//";
99 LOG(info) <<
"+ " << setw(20) << GetName() <<
": Created: " <<
fCluster->GetEntriesFast() <<
" hit in " << fixed
100 << setprecision(6) <<
fTimer.RealTime() <<
" s";
109 LOG(info) << GetName() <<
": Initialisation...";
112 FairRootManager* ioman = FairRootManager::Instance();
114 LOG(error) << GetName() <<
"::Init: No FairRootManager!";
119 fEvents =
dynamic_cast<TClonesArray*
>(ioman->GetObject(
"CbmEvent"));
121 fInputDigis = (TClonesArray*) ioman->GetObject(
"MvdDigi");
122 fEventDigis =
new TClonesArray(
"CbmMvdDigi", 10000);
124 LOG(error) <<
"No MvdDigi branch found. There was no MVD in the "
125 "simulation. Switch this task off";
130 fCluster =
new TClonesArray(
"CbmMvdHit", 10000);
131 ioman->Register(
"MvdHit",
"Mvd Hits",
fCluster, IsOutputBranchPersistent(
"MvdHit"));
136 LOG(debug) <<
"-I- succesfully loaded Geometry from file -I-";
139 LOG(fatal) <<
"Geometry couldn't be loaded from file. No MVD digitizer available.";
146 for (
auto itr = sensorMap.begin(); itr != sensorMap.end(); itr++) {
149 itr->second->AddPlugin(hitTask);
150 itr->second->SetHitPlugin(plugincount);
161 LOG(info) << GetName() <<
" initialised";
194 std::stringstream ss;
195 ss <<
"============================================================" << endl;
196 ss <<
"============== Parameters DigiToHit ====================" << endl;
197 ss <<
"============================================================" << endl;
198 ss <<
"=============== End Task ===================================" << endl;
ClassImp(CbmMvdDigiToHitTB)
Helper class to extract information from the GeoManager. Addapted from TrdGeoHandler byFlorian Uhlig ...
Class characterising one event by a collection of links (indices) to data objects,...
size_t GetNofData() const
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()
TStopwatch fTimer
ROOT timer.
std::string ParametersToString() const
TClonesArray * fEventDigis
CbmMvdDetector * fDetector
virtual InitStatus ReInit()
TClonesArray * fInputDigis
void PrintParameters() const
virtual InitStatus Init()