11#include "CLHEP/Random/RandFlat.h"
12#include "CLHEP/Random/RandGaussQ.h"
13#include "CLHEP/Random/RandPoissonQ.h"
14#include "GaudiKernel/MsgStream.h"
15#include "GaudiKernel/Bootstrap.h"
16#include "GaudiKernel/ITHistSvc.h"
52 double qdcChannelsPerPE,
54 double qdcFedNoiseFactor,
55 double tdcPmtNoiseFactor,
56 double tdcFedNoiseFactor,
62 double dynodeGammaFactor,
63 std::vector<double> pmtSmearing,
64 std::vector<double> pmtScaling,
65 std::vector<double> gasScaling,
66 std::vector<double> npeThreshold,
102 SmartIF<ITHistSvc> digitHistSvc{Gaudi::svcLocator()->service(
"THistSvc")};
103 if (!digitHistSvc) {
return StatusCode::FAILURE; }
105 m_tubeInfo =
new TTree(
"t",
"LUCID_LUMI_SUMMARY");
107 StatusCode
sc = digitHistSvc->regTree(
"/AANT/LUCID_LUMI_SUMMARY",
m_tubeInfo);
109 if (
sc.isFailure())
return StatusCode::FAILURE;
118 return StatusCode::SUCCESS;
124 assert(
x >= INT_MIN-0.5);
125 assert(
x <= INT_MAX+0.5);
127 if (
x >= 0)
return static_cast<int>(
x+0.5);
129 return static_cast<int>(
x-0.5);
137 double npeTot = npeGas + npePmt;
144 double tdcTotSmeared = 0;
148 tdcTotSmeared = (npeTot) ? tdcTotSmeared/npeTot : tdcTotSmeared;
149 tdcTotSmeared = (tdcTotSmeared < 0) ? 0 : tdcTotSmeared;
151 m_tdc =
static_cast<unsigned int>(tdcTotSmeared);
162 return StatusCode::SUCCESS;
180 if (
m_tubeID != (*hitIt)->GetTubeID())
continue;
182 if (!(*hitIt)->isDetected(rndEngine))
continue;
184 if ((*hitIt)->GetGenVolume() == 1)
m_npeGas++;
185 if ((*hitIt)->GetGenVolume() == 2)
m_npeGas++;
186 if ((*hitIt)->GetGenVolume() == 3)
m_npePmt++;
188 m_tdcTot += (*hitIt)->GetPreStepTime();
194 return StatusCode::SUCCESS;
211 for (; hitIt != hitItE; ++hitIt) {
213 if (
m_tubeID != (*hitIt).GetTubeID())
continue;
215 if (!(*hitIt).isDetected(rndEngine))
continue;
217 if ((*hitIt).GetGenVolume() == 1)
m_npeGas++;
218 if ((*hitIt).GetGenVolume() == 2)
m_npeGas++;
219 if ((*hitIt).GetGenVolume() == 3)
m_npePmt++;
221 m_tdcTot += (*hitIt).GetPreStepTime();
227 return StatusCode::SUCCESS;
244 double smearedQDC = 0;
262 if (npe < 20)
return CLHEP::RandPoissonQ::shoot(rndEngine, npe);
263 else return CLHEP::RandGaussQ::shoot (rndEngine, npe, std::sqrt(npe));
AtlasHitsVector< LUCID_SimHit > LUCID_SimHitCollection
the preferred mechanism to access information from the different event stores in a pileup job.
CONT::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
bool nextDetectorElement(const_iterator &b, const_iterator &e)
sets an iterator range with the hits of current detector element returns a bool when done
TimedVector::const_iterator const_iterator