47 const int nstrips(roll->
nstrips());
49 double trStripArea(0.0);
50 if (gemId.region() == 0) {
51 throw cms::Exception(
"Geometry") <<
"GEMBkgModel::simulate() - this GEM id is from barrel, which cannot happen.";
54 const float striplength(top_->stripLength());
55 trStripArea = (roll->
pitch()) * striplength;
56 trArea = trStripArea * nstrips;
58 const float rollRadius(
61 : top_->radius() + CLHEP::RandFlat::shoot(engine, -1. * top_->stripLength() / 2., top_->stripLength() / 2.));
64 double averageNeutralNoiseRatePerRoll = 0.;
65 double averageNoiseElectronRatePerRoll = 0.;
66 double averageNoiseRatePerRoll = 0.;
67 if (gemId.station() == 1) {
69 averageNeutralNoiseRatePerRoll =
73 averageNoiseElectronRatePerRoll =
77 averageNoiseRatePerRoll = averageNeutralNoiseRatePerRoll + averageNoiseElectronRatePerRoll;
79 }
else if (gemId.station() == 2) {
81 averageNeutralNoiseRatePerRoll =
85 averageNoiseElectronRatePerRoll =
89 averageNoiseRatePerRoll = averageNeutralNoiseRatePerRoll + averageNoiseElectronRatePerRoll;
94 const double averageNoise(averageNoiseRatePerRoll * nBxing * trArea *
bxWidth_);
95 CLHEP::RandPoissonQ randPoissonQ(*engine, averageNoise);
96 const int n_hits(randPoissonQ.fire());
97 for (
int i = 0;
i < n_hits; ++
i) {
98 const int centralStrip(static_cast<int>(CLHEP::RandFlat::shoot(engine, 1, nstrips)));
99 const int time_hit(static_cast<int>(CLHEP::RandFlat::shoot(engine, nBxing)) +
minBunch_);
101 std::vector<std::pair<int, int> > cluster_;
103 cluster_.emplace_back(centralStrip, time_hit);
104 int clusterSize((CLHEP::RandFlat::shoot(engine)) <=
clusterSizeCut ? 1 : 2);
105 if (clusterSize == 2) {
106 if (CLHEP::RandFlat::shoot(engine) < 0.5) {
108 cluster_.emplace_back(centralStrip - 1, time_hit);
110 if (CLHEP::RandFlat::shoot(engine) <
averageEfficiency_ && (centralStrip + 1 <= nstrips))
111 cluster_.emplace_back(centralStrip + 1, time_hit);
114 for (
const auto& digi : cluster_) {
115 strips_.emplace(digi);
119 strips_.emplace(centralStrip, time_hit);
double GE21ModNeuBkgParam1_
double GE21ElecBkgParam2_
const double clusterSizeCut
double GE11ModNeuBkgParam2_
bool simulateElectronBkg_
double GE11ModNeuBkgParam0_
double GE11ModNeuBkgParam1_
double GE21ModNeuBkgParam0_
double GE21ElecBkgParam0_
double GE21ModNeuBkgParam2_
const double referenceInstLumi_
double GE11ElecBkgParam2_
double GE11ElecBkgParam1_
double GE11ElecBkgParam0_
double GE21ElecBkgParam1_
double averageEfficiency_