CMS 3D CMS Logo

GEMNoiseModel.cc
Go to the documentation of this file.
6 #include "CLHEP/Random/RandFlat.h"
7 #include "CLHEP/Random/RandPoissonQ.h"
8 #include "CLHEP/Random/RandGaussQ.h"
9 #include <cmath>
10 #include <utility>
11 #include <map>
12 
15  averageNoiseRate_(config.getParameter<double>("averageNoiseRate")),
16  bxWidth_(config.getParameter<double>("bxWidth")),
17  minBunch_(config.getParameter<int>("minBunch")),
18  maxBunch_(config.getParameter<int>("maxBunch")) {}
19 
21 
23  const edm::PSimHitContainer&,
24  CLHEP::HepRandomEngine* engine,
25  Strips& strips_,
26  DetectorHitMap& detectorHitMap_) {
27  const GEMDetId& gemId(roll->id());
28  const int nstrips(roll->nstrips());
29  double trStripArea(0.0);
30  if (gemId.region() == 0) {
31  throw cms::Exception("Geometry") << "GEMNoiseModel::simulate() - this GEM id is from barrel, which cannot happen.";
32  }
33  const GEMStripTopology* top_(dynamic_cast<const GEMStripTopology*>(&(roll->topology())));
34  const float striplength(top_->stripLength());
35  trStripArea = (roll->pitch()) * striplength;
36  float trArea(trStripArea * nstrips);
37  const int nBxing(maxBunch_ - minBunch_ + 1);
38  //simulate intrinsic noise
39  const double aveIntrinsicNoise(averageNoiseRate_ * nBxing * trArea * bxWidth_);
40  CLHEP::RandPoissonQ randPoissonQ(*engine, aveIntrinsicNoise);
41  const int n_intrHits(randPoissonQ.fire());
42 
43  for (int k = 0; k < n_intrHits; k++) {
44  const int centralStrip(static_cast<int>(CLHEP::RandFlat::shoot(engine, 1, nstrips)));
45  const int time_hit(static_cast<int>(CLHEP::RandFlat::shoot(engine, nBxing)) + minBunch_);
46  strips_.emplace(centralStrip, time_hit);
47  }
48  //end simulate intrinsic noise
49 
50  return;
51 }
GEMNoiseModel::maxBunch_
int maxBunch_
Definition: GEMNoiseModel.h:36
GEMEtaPartition::nstrips
int nstrips() const
number of readout strips in partition
Definition: GEMEtaPartition.cc:24
GEMNoiseModel::GEMNoiseModel
GEMNoiseModel(const edm::ParameterSet &)
Definition: GEMNoiseModel.cc:13
GEMStripTopology.h
GEMEtaPartition
Definition: GEMEtaPartition.h:12
GEMDigiModel
Definition: GEMDigiModel.h:37
GEMStripTopology
Definition: GEMStripTopology.h:11
config
Definition: config.py:1
GEMNoiseModel::averageNoiseRate_
double averageNoiseRate_
Definition: GEMNoiseModel.h:33
GEMNoiseModel::minBunch_
int minBunch_
Definition: GEMNoiseModel.h:35
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Strips
std::set< std::pair< int, int > > Strips
Definition: GEMDigiModel.h:31
DetectorHitMap
std::multimap< std::pair< unsigned int, int >, const PSimHit *, std::less< std::pair< unsigned int, int > > > DetectorHitMap
Definition: GEMDigiModel.h:35
GEMEtaPartitionSpecs.h
edm::ParameterSet
Definition: ParameterSet.h:47
GEMNoiseModel::simulate
void simulate(const GEMEtaPartition *, const edm::PSimHitContainer &, CLHEP::HepRandomEngine *, Strips &, DetectorHitMap &) override
Definition: GEMNoiseModel.cc:22
GEMDetId
Definition: GEMDetId.h:18
GEMEtaPartition::topology
const Topology & topology() const override
Definition: GEMEtaPartition.cc:14
createfilelist.int
int
Definition: createfilelist.py:10
GEMEtaPartition::id
GEMDetId id() const
Definition: GEMEtaPartition.h:18
GEMNoiseModel::bxWidth_
double bxWidth_
Definition: GEMNoiseModel.h:34
GEMEtaPartition::pitch
float pitch() const
Definition: GEMEtaPartition.cc:41
GEMGeometry.h
Exception
Definition: hltDiff.cc:246
Exception.h
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
GEMNoiseModel.h
GEMNoiseModel::~GEMNoiseModel
~GEMNoiseModel() override
Definition: GEMNoiseModel.cc:20