6 #include "CLHEP/Random/RandFlat.h"
7 #include "CLHEP/Random/RandGaussQ.h"
8 #include "CLHEP/Random/RandPoissonQ.h"
16 , sigma_t(config.getParameter<double> (
"timeResolution"))
17 , sigma_u(config.getParameter<double> (
"phiResolution"))
18 , sigma_v(config.getParameter<double> (
"etaResolution"))
19 ,
corr(config.getParameter<bool> (
"useCorrelation"))
20 , etaproj(config.getParameter<bool> (
"useEtaProjectiveGEO"))
21 , digitizeOnlyMuons_(config.getParameter<bool> (
"digitizeOnlyMuons"))
22 , averageEfficiency_(config.getParameter<double> (
"averageEfficiency"))
23 , doBkgNoise_(config.getParameter<bool> (
"doBkgNoise"))
24 , simulateIntrinsicNoise_(config.getParameter<bool> (
"simulateIntrinsicNoise"))
25 , simulateElectronBkg_(config.getParameter<bool>(
"simulateElectronBkg"))
26 , averageNoiseRate_(config.getParameter<double> (
"averageNoiseRate"))
27 , bxwidth_(config.getParameter<int> (
"bxwidth"))
28 , minBunch_(config.getParameter<int> (
"minBunch"))
29 , maxBunch_(config.getParameter<int> (
"maxBunch"))
57 for (
const auto &
hit: simHits)
63 auto entry =
hit.entryPoint();
64 float x=CLHEP::RandGaussQ::shoot(engine, entry.x(),
sigma_u);
65 float y=CLHEP::RandGaussQ::shoot(engine, entry.y(),
sigma_v);
69 float tof=CLHEP::RandGaussQ::shoot(engine,
hit.timeOfFlight(),
sigma_t);
70 int pdgid =
hit.particleType();
79 const double cspeed = 299792458;
83 if (me0Id.region() == 0)
86 <<
"GEMSynchronizer::simulateNoise() - this GEM id is from barrel, which cannot happen.";
95 float myTanPhi = (semiTopEdge - semiBottomEdge) / (semiHeight * 2);
96 double rollRadius = top_->radius();
98 trArea = 2 * semiHeight * (semiTopEdge + semiBottomEdge);
104 double aveNeutrRateBotRoll = 0.;
105 double averageNoiseElectronRatePerRoll = 0.;
108 float myRand = CLHEP::RandFlat::shoot(engine);
109 float yy_rand = 2 * semiHeight * (myRand - 0.5);
111 double radius_rand = rollRadius + yy_rand;
119 +
ME0ModElecBkgParam5 * radius_rand * radius_rand * radius_rand * radius_rand * radius_rand
120 +
ME0ModElecBkgParam6 * radius_rand * radius_rand * radius_rand * radius_rand * radius_rand * radius_rand;
122 const double averageNoiseElec(averageNoiseElectronRatePerRoll * nBxing *
bxwidth_ * trArea * 1.0
e-9);
123 const int n_elechits(CLHEP::RandPoissonQ::shoot(engine, averageNoiseElec));
125 double xMax = semiTopEdge - (semiHeight - yy_rand) * myTanPhi;
126 for (
int i = 0;
i < n_elechits; ++
i)
129 float myRandX = CLHEP::RandFlat::shoot(engine);
130 float xx_rand = 2 * xMax * (myRandX - 0.5);
138 double stripRadius =
sqrt(pointDigiHit.
x() * pointDigiHit.
x() + pointDigiHit.
y() * pointDigiHit.
y()
139 + pointDigiHit.
z() * pointDigiHit.
z());
140 double timeCalibrationOffset_ = (stripRadius * 1
e+9) / (cspeed * 1
e+2);
141 float tof = CLHEP::RandGaussQ::shoot(engine, timeCalibrationOffset_,
sigma_t);
143 float myrand = CLHEP::RandFlat::shoot(engine);
158 +
ME0ModNeuBkgParam5 * radius_rand * radius_rand * radius_rand * radius_rand * radius_rand
159 +
ME0ModNeuBkgParam6 * radius_rand * radius_rand * radius_rand * radius_rand * radius_rand * radius_rand;
161 const double averageNoiseNeutral(aveNeutrRateBotRoll * nBxing *
bxwidth_ * trArea * 1.0
e-9);
162 const int n_hits(CLHEP::RandPoissonQ::shoot(engine, averageNoiseNeutral));
164 for (
int i = 0;
i < n_hits; ++
i)
167 float myRandX = CLHEP::RandFlat::shoot(engine);
168 float xx_rand = 2 * xMax * (myRandX - 0.5);
176 double stripRadius =
sqrt(pointDigiHit.
x() * pointDigiHit.
x() + pointDigiHit.
y() * pointDigiHit.
y()
177 + pointDigiHit.
z() * pointDigiHit.
z());
178 double timeCalibrationOffset_ = (stripRadius * 1
e+9) / (cspeed * 1
e+2);
179 float tof = CLHEP::RandGaussQ::shoot(engine, timeCalibrationOffset_,
sigma_t);
182 float myrand = CLHEP::RandFlat::shoot(engine);
const ME0EtaPartitionSpecs * specs() const
double averageEfficiency_
double ME0ModNeuBkgParam3
double ME0ModElecBkgParam1
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
double ME0ModNeuBkgParam1
double ME0ModElecBkgParam2
const ME0Specs & parameters() const
double ME0ModElecBkgParam4
double ME0ModElecBkgParam0
double ME0ModNeuBkgParam4
double ME0ModNeuBkgParam2
double ME0ModElecBkgParam3
Abs< T >::type abs(const T &t)
double ME0ModNeuBkgParam0
void simulateSignal(const ME0EtaPartition *, const edm::PSimHitContainer &, CLHEP::HepRandomEngine *) override
std::set< ME0DigiPreReco > digi_
void simulateNoise(const ME0EtaPartition *, CLHEP::HepRandomEngine *) override
double ME0ModElecBkgParam5
const Topology & topology() const
ME0PreRecoGaussianModel(const edm::ParameterSet &)
double ME0ModElecBkgParam6
double ME0ModNeuBkgParam5
std::vector< PSimHit > PSimHitContainer
bool simulateElectronBkg_
~ME0PreRecoGaussianModel()
double ME0ModNeuBkgParam6