21 #ifndef BSEMCMCDEPOSITTOTIMEBASEDWAVEFORMS_HH 22 #define BSEMCMCDEPOSITTOTIMEBASEDWAVEFORMS_HH 29 #include "TClonesArray.h" 32 #include "TStopwatch.h" 36 #include "FairLogger.h" 37 #include "FairRootManager.h" 39 #include "FairRunAna.h" 40 #include "FairRuntimeDb.h" 60 template <
class ParSet>
97 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms for " <<
fMCDepositBranchName <<
" has no Simulator set. Calling SetupSimulator!";
102 LOG(error) <<
"BSEmcMCDepositToTimebasedWaveforms for " <<
fMCDepositBranchName <<
" has no Simulator set. Aborting!";
107 FairRootManager *ioman = FairRootManager::Instance();
108 if (ioman ==
nullptr) {
109 LOG(error) <<
"BSEmcMCDepositToTimebasedWaveforms<ParSet>::Init: " 110 <<
"RootManager not instantiated!";
117 LOG(debug) <<
"Using BSEmcMultiWaveform in WaveformBuffer.";
129 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms: " <<
fDetectorName <<
" using photon statistic";
138 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms::Init() for " <<
fMCDepositBranchName <<
" done.";
153 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms<ParSet> " <<
fDetectorName <<
" Exec() ";
154 FairRootManager *ioman = FairRootManager::Instance();
162 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms<ParSet> " <<
fDetectorName <<
" Deposit array contains " << nDeposits <<
" deposits";
164 for (Int_t iDeposit = 0; iDeposit < nDeposits; iDeposit++) {
167 Double_t energy = theDeposit->
GetEnergy();
171 LOG(debug3) <<
"deposit energy : " << energy;
175 LOG(debug3) <<
"photonStatFactor: " << photonStatFactor;
176 energy *= photonStatFactor;
177 LOG(debug3) <<
"energy now: " << energy;
179 LOG(debug3) <<
"energy now in MeV: " << energy;
187 wfData.AddDeposit(linkToDeposit, ioman->GetEventTime() + theDeposit->
GetTime() * 1.0e9, energy);
189 wfData.AddDeposit(linkToDeposit, theDeposit->
GetTime() * 1.0e9, energy);
191 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms " <<
fDetectorName <<
" adding deposit with event time " << ioman->GetEventTime()
192 <<
" and deposit time: " << theDeposit->
GetTime() * 1.0e9 <<
" and energy: " << energy;
196 Double_t rtime = timer.RealTime();
197 Double_t ctime = timer.CpuTime();
198 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms, Real time " << rtime <<
" s, CPU time " << ctime <<
" s";
217 FairRun *run = FairRun::Instance();
218 if (run ==
nullptr) {
219 Fatal(
"SetParContainers",
"No analysis run");
221 FairRuntimeDb *db = run->GetRuntimeDb();
223 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...