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>
85 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms for " <<
fMCDepositBranchName <<
" has no Simulator set. Calling SetupSimulator!";
90 LOG(error) <<
"BSEmcMCDepositToTimebasedWaveforms for " <<
fMCDepositBranchName <<
" has no Simulator set. Aborting!";
95 FairRootManager *ioman = FairRootManager::Instance();
96 if (ioman ==
nullptr) {
97 LOG(error) <<
"BSEmcMCDepositToTimebasedWaveforms<ParSet>::Init: " 98 <<
"RootManager not instantiated!";
105 LOG(debug) <<
"Using BSEmcMultiWaveform in WaveformBuffer.";
117 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms: " <<
fDetectorName <<
" using photon statistic";
126 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms::Init() for " <<
fMCDepositBranchName <<
" done.";
141 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms<ParSet> " <<
fDetectorName <<
" Exec() ";
142 FairRootManager *ioman = FairRootManager::Instance();
150 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms<ParSet> " <<
fDetectorName <<
" Deposit array contains " << nDeposits <<
" deposits";
152 for (Int_t iDeposit = 0; iDeposit < nDeposits; iDeposit++) {
155 Double_t energy = theDeposit->
GetEnergy();
159 LOG(debug3) <<
"deposit energy : " << energy;
163 LOG(debug3) <<
"photonStatFactor: " << photonStatFactor;
164 energy *= photonStatFactor;
165 LOG(debug3) <<
"energy now: " << energy;
167 LOG(debug3) <<
"energy now in MeV: " << energy;
175 wfData.AddDeposit(linkToDeposit, ioman->GetEventTime() + theDeposit->
GetTime() * 1.0e9, energy);
177 wfData.AddDeposit(linkToDeposit, theDeposit->
GetTime() * 1.0e9, energy);
179 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms " <<
fDetectorName <<
" adding deposit with event time " << ioman->GetEventTime()
180 <<
" and deposit time: " << theDeposit->
GetTime() * 1.0e9 <<
" and energy: " << energy;
184 Double_t rtime = timer.RealTime();
185 Double_t ctime = timer.CpuTime();
186 LOG(debug) <<
"BSEmcMCDepositToTimebasedWaveforms, Real time " << rtime <<
" s, CPU time " << ctime <<
" s";
205 FairRun *run = FairRun::Instance();
206 if (run ==
nullptr) {
207 Fatal(
"SetParContainers",
"No analysis run");
209 FairRuntimeDb *db = run->GetRuntimeDb();
211 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...