9 #ifndef BSEMCMCDEPOSITTOTIMEBASEDWAVEFORMS_HH 10 #define BSEMCMCDEPOSITTOTIMEBASEDWAVEFORMS_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" 48 template <
class ParSet>
83 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms for " <<
fMCDepositBranchName <<
" has no Simulator set. Calling SetupSimulator!";
88 LOG(error) <<
"BSEmcMCDepositToTimebasedWaveforms for " <<
fMCDepositBranchName <<
" has no Simulator set. Aborting!";
93 FairRootManager *ioman = FairRootManager::Instance();
94 if (ioman ==
nullptr) {
95 LOG(error) <<
"BSEmcMCDepositToTimebasedWaveforms<ParSet>::Init: " 96 <<
"RootManager not instantiated!";
103 LOG(debug) <<
"Using BSEmcMultiWaveform in WaveformBuffer.";
115 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms: " << fDetectorName <<
" using photon statistic";
124 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms::Init() for " <<
fMCDepositBranchName <<
" done.";
139 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms<ParSet> " <<
fDetectorName <<
" Exec() ";
140 FairRootManager *ioman = FairRootManager::Instance();
148 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms<ParSet> " <<
fDetectorName <<
" Deposit array contains " << nDeposits <<
" deposits";
150 for (Int_t iDeposit = 0; iDeposit < nDeposits; iDeposit++) {
153 Double_t energy = theDeposit->
GetEnergy();
157 LOG(debug3) <<
"deposit energy : " << energy;
161 LOG(debug3) <<
"photonStatFactor: " << photonStatFactor;
162 energy *= photonStatFactor;
163 LOG(debug3) <<
"energy now: " << energy;
165 LOG(debug3) <<
"energy now in MeV: " << energy;
173 wfData.AddDeposit(linkToDeposit, ioman->GetEventTime() + theDeposit->
GetTime() * 1.0e9, energy);
175 wfData.AddDeposit(linkToDeposit, theDeposit->
GetTime() * 1.0e9, energy);
177 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms " <<
fDetectorName <<
" adding deposit with event time " << ioman->GetEventTime()
178 <<
" and deposit time: " << theDeposit->
GetTime() * 1.0e9 <<
" and energy: " << energy;
182 Double_t rtime = timer.RealTime();
183 Double_t ctime = timer.CpuTime();
184 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms, 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
virtual T const * GetConstElementPtr(Int_t t_index) const
Get the Element object at t_index.
const std::string fgMultiWaveformBranchName
void SetTCA(TClonesArray *t_tca)
Set the TClonesArray address.
Int_t GetDetectorID() const
friend F32vec4 sqrt(const F32vec4 &a)
Double_t GetRearCrystalSurfaceArea() const
represents the deposited energy of one emc crystal from simulation
void SetPersistency(Bool_t val=kTRUE)
static const std::string fgParameterName
virtual ssize_t GetSize() const final
Get the number of elements.
Double_t GetOverlapTime() const
const std::string fgWaveformDataBranchName
virtual Double_t GetTime() const
Double_t GetQuantumEfficiency() const
Double_t GetSensitiveArea() const
void SetBranchName(const TString &t_branchname)
Set the Branch Name.
virtual Double_t GetEnergy() const
Input and Output Container implementation of PndConstContainerI using an underlying TClonesArray...
const std::string fgMCDepositBranchName
Double_t GetDetectedPhotonsPerMeV() const
Double_t GetExcessNoiseFactor() const
Container for runtime parameters that are required for the transformation from BSEmcMCDeposits to BSE...