9 #ifndef BSEMCMCHITTOTIMEBASEDWAVEFORMS_HH 10 #define BSEMCMCHITTOTIMEBASEDWAVEFORMS_HH 17 #include "TClonesArray.h" 20 #include "TStopwatch.h" 24 #include "FairLogger.h" 25 #include "FairRootManager.h" 27 #include "FairRunAna.h" 28 #include "FairRuntimeDb.h" 49 template <
class ParSet>
84 LOG(debug) <<
"BSEmcMCHitToTimebasedWaveforms for " <<
fHitBranchName <<
" has no Simulator set. Calling SetupSimulator!";
89 LOG(error) <<
"BSEmcMCHitToTimebasedWaveforms for " <<
fHitBranchName <<
" has no Simulator set. Aborting!";
94 FairRootManager *ioman = FairRootManager::Instance();
95 if (ioman ==
nullptr) {
96 LOG(error) <<
"BSEmcMCHitToTimebasedWaveforms<ParSet>::Init: " 97 <<
"RootManager not instantiated!";
103 LOG(debug) <<
"Using BSEmcMultiWaveform in WaveformBuffer.";
115 LOG(debug) <<
"BSEmcMCHitToTimebasedWaveforms: " << fDetectorName <<
" using photon statistic";
124 LOG(debug) <<
"BSEmcMCHitToTimebasedWaveforms::Init() for " <<
fHitBranchName <<
" done.";
139 LOG(debug) <<
"BSEmcMCHitToTimebasedWaveforms<ParSet> " <<
fDetectorName <<
" Exec() ";
140 FairRootManager *ioman = FairRootManager::Instance();
148 LOG(debug) <<
"BSEmcMCHitToTimebasedWaveforms<ParSet> " <<
fDetectorName <<
" Hit array contains " << nHits <<
" hits";
150 for (Int_t iHit = 0; iHit < nHits; iHit++) {
157 LOG(DEBUG3) <<
"hit energy : " << energy;
161 LOG(DEBUG3) <<
"photonStatFactor: " << photonStatFactor;
162 energy *= photonStatFactor;
163 LOG(DEBUG3) <<
"energy now: " << energy;
165 LOG(DEBUG3) <<
"energy now in MeV: " << energy;
171 FairLink linkToHit(-1, ioman->GetEntryNr(),
fHitBranchName, iHit, 1.0);
173 wfData.AddHit(linkToHit, ioman->GetEventTime() + theHit->
GetTime() * 1.0e9, energy);
175 wfData.AddHit(linkToHit, theHit->
GetTime() * 1.0e9, energy);
177 LOG(debug) <<
"BSEmcMCHitToTimebasedWaveforms " <<
fDetectorName <<
" adding hit with event time " << ioman->GetEventTime() <<
" and hit time: " << theHit->
GetTime() * 1.0e9
178 <<
" and energy: " << energy;
182 Double_t rtime = timer.RealTime();
183 Double_t ctime = timer.CpuTime();
184 LOG(debug) <<
"BSEmcMCHitToTimebasedWaveforms, Real time " << rtime <<
" s, CPU time " << ctime <<
" s";
202 FairRun *run = FairRun::Instance();
203 if (run ==
nullptr) {
204 Fatal(
"SetParContainers",
"No analysis run");
206 FairRuntimeDb *db = run->GetRuntimeDb();
208 Fatal(
"SetParContainers",
"No runtime database");
Int_t GetUseDigiEffectiveSmearingMode() const
const std::string fgMultiWaveformBranchName
Int_t GetDetectorID() const
friend F32vec4 sqrt(const F32vec4 &a)
Double_t GetRearCrystalSurfaceArea() const
void SetPersistency(Bool_t val=kTRUE)
static const std::string fgParameterName
Double_t GetOverlapTime() const
const std::string fgWaveformDataBranchName
Double_t GetQuantumEfficiency() const
Double_t GetSensitiveArea() const
virtual Double_t GetEnergy() const
const std::string fgMCHitBranchName
virtual Double_t GetTime() const
Double_t GetDetectedPhotonsPerMeV() const
represents the deposited energy of one emc crystal from simulation
Double_t GetExcessNoiseFactor() const
Container for runtime parameters that are required for the transformation from BSEmcMCHits to BSEmcDi...