12#include "CbmDaqBuffer.h"
18#include "FairModule.h"
19#include "FairRootManager.h"
23#include "TClonesArray.h"
24#include "TStopwatch.h"
39 : FairTask(name, iVerbose)
42 , fShowDebugHistos(kFALSE)
43 , fNoiseSensors(kFALSE)
45 , fInputPoints(nullptr)
53 , fBranchName(
"MvdPoint")
80 LOG(debug) <<
"Send Input";
82 LOG(debug) <<
"Execute DigitizerPlugin Nr. " <<
fDigiPluginNr;
84 LOG(debug) <<
"End Chain";
85 LOG(debug) <<
"Start writing Digis";
87 LOG(debug) <<
"Total of " <<
fDigis->GetEntriesFast() <<
" digis in this Event";
88 for (Int_t i = 0; i <
fDigis->GetEntriesFast(); ++i) {
90 CbmDaqBuffer::Instance()->InsertData(digi);
94 LOG(info) <<
"+ " << setw(20) << GetName() <<
": Event " << setw(6) << right <<
eventNumber <<
", real time " << fixed
95 << setprecision(6) <<
fTimer.RealTime() <<
" s, digis: " <<
fDigis->GetEntriesFast();
105 LOG(info) << GetName() <<
": Initialisation...";
110 FairRootManager* ioman = FairRootManager::Instance();
113 " << GetName() << " ::Init :
114 No FairRootManager !
";
118 // ********** Get input arrays
119 fInputPoints = (TClonesArray*) ioman->GetObject(fBranchName);
120 fTracks = (TClonesArray*) ioman->GetObject("MCTrack
");
123 LOG(error) << "No MvdPoint branch found. There was no MVD in the
"
124 "simulation. Switch
this task off
";
129 // ********** Register output array
130 fDigis = new TClonesArray("CbmMvdDigi", 10000);
131 // ioman->Register("MvdDigi
", "Mvd Digis
", fDigis, IsOutputBranchPersistent("MvdDigi
"));
133 fDigiMatch = new TClonesArray("CbmMatch", 100000);
134 //ioman->Register("MvdDigiMatch
", "Mvd DigiMatches
", fDigiMatch, IsOutputBranchPersistent("MvdDigiMatch
"));
136 fDetector = CbmMvdDetector::Instance();
138 // Add the digitizer plugin to all sensors
139 std::map<int, CbmMvdSensor*>& sensorMap = fDetector->GetSensorMap();
140 UInt_t plugincount = fDetector->GetPluginCount();
142 for (auto itr = sensorMap.begin(); itr != sensorMap.end(); itr++) {
143 CbmMvdSensorDigitizerTBTask* digiTask = new CbmMvdSensorDigitizerTBTask();
145 itr->second->AddPlugin(digiTask);
146 itr->second->SetDigiPlugin(plugincount);
148 fDetector->SetSensorArrayFilled(kTRUE);
149 fDetector->SetPluginCount(plugincount + 1);
150 fDigiPluginNr = (UInt_t)(fDetector->GetPluginArraySize());
155 LOG(info) << GetName() << " initialised with parameters:
";
162// ----- Virtual public method Reinit ----------------------------------
163InitStatus CbmMvdDigitizerTB::ReInit() { return kSUCCESS; }
164// -------------------------------------------------------------------------
167// ----- Virtual method Finish -----------------------------------------
168void CbmMvdDigitizerTB::Finish()
170 // LOG(debug) << "finishing
";
174// -------------------------------------------------------------------------
177// ----- Private method Reset ------------------------------------------
178void CbmMvdDigitizerTB::Reset() { fDigis->Delete(); }
179// -------------------------------------------------------------------------
181// ----- Private method GetMvdGeometry ---------------------------------
182void CbmMvdDigitizerTB::GetMvdGeometry() {}
183// -------------------------------------------------------------------------
185void CbmMvdDigitizerTB::PrintParameters() const { LOG(info) << ParametersToString(); }
187// ----- Private method PrintParameters --------------------------------
188void CbmMvdDigitizerTB::ParametersToString() const
191 std::stringstream ss;
192 ss.setf(std::ios_base::fixed, std::ios_base::floatfield);
193 ss << "============================================================
" << endl;
194 ss << "============== Parameters MvdDigitizer =====================
" << endl;
195 ss << "============================================================
" << endl;
196 ss << "=============== End Task ===================================
" << endl;
199// -------------------------------------------------------------------------
201ClassImp(CbmMvdDigitizerTB);
Helper class to extract information from the GeoManager. Addapted from TrdGeoHandler byFlorian Uhlig ...
CbmMvdDetector * fDetector
TClonesArray * fInputPoints
TStopwatch fTimer
ROOT timer.
virtual InitStatus Init()