CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GEMBkgModel Class Reference

#include <GEMBkgModel.h>

Inheritance diagram for GEMBkgModel:
GEMDigiModel

Public Member Functions

 GEMBkgModel (const edm::ParameterSet &)
 
void simulate (const GEMEtaPartition *, const edm::PSimHitContainer &, CLHEP::HepRandomEngine *, Strips &, DetectorHitMap &) override
 
 ~GEMBkgModel () override
 
- Public Member Functions inherited from GEMDigiModel
void setGeometry (const GEMGeometry *geom)
 
virtual ~GEMDigiModel ()
 

Private Attributes

double averageEfficiency_
 
double bxWidth_
 
const double clusterSizeCut
 
bool digitizeOnlyMuons_
 
bool fixedRollRadius_
 
double GE11ElecBkgParam0_
 
double GE11ElecBkgParam1_
 
double GE11ElecBkgParam2_
 
double GE11ModNeuBkgParam0_
 
double GE11ModNeuBkgParam1_
 
double GE11ModNeuBkgParam2_
 
double GE21ElecBkgParam0_
 
double GE21ElecBkgParam1_
 
double GE21ElecBkgParam2_
 
double GE21ModNeuBkgParam0_
 
double GE21ModNeuBkgParam1_
 
double GE21ModNeuBkgParam2_
 
double instLumi_
 
int maxBunch_
 
int minBunch_
 
double rateFact_
 
const double referenceInstLumi_
 
double resolutionX_
 
bool simulateElectronBkg_
 
bool simulateNoiseCLS_
 

Additional Inherited Members

- Protected Member Functions inherited from GEMDigiModel
 GEMDigiModel (const edm::ParameterSet &)
 
- Protected Attributes inherited from GEMDigiModel
const GEMGeometrygeometry_
 

Detailed Description

Class for the GEM strip response to background simulation based on a very simple model Originally comes from GEMSimpleModel

Author
Sven Dildick by Roumyana Hadjiiska by Yechan Kang

Definition at line 23 of file GEMBkgModel.h.

Constructor & Destructor Documentation

◆ GEMBkgModel()

GEMBkgModel::GEMBkgModel ( const edm::ParameterSet config)

Definition at line 13 of file GEMBkgModel.cc.

15  clusterSizeCut(0.53),
16  averageEfficiency_(config.getParameter<double>("averageEfficiency")),
17  minBunch_(config.getParameter<int>("minBunch")),
18  maxBunch_(config.getParameter<int>("maxBunch")),
19  simulateNoiseCLS_(config.getParameter<bool>("simulateNoiseCLS")),
20  fixedRollRadius_(config.getParameter<bool>("fixedRollRadius")),
21  simulateElectronBkg_(config.getParameter<bool>("simulateElectronBkg")),
22  instLumi_(config.getParameter<double>("instLumi")),
23  rateFact_(config.getParameter<double>("rateFact")),
24  bxWidth_(config.getParameter<double>("bxWidth")),
25  referenceInstLumi_(config.getParameter<double>("referenceInstLumi")),
26  GE11ElecBkgParam0_(config.getParameter<double>("GE11ElecBkgParam0")),
27  GE11ElecBkgParam1_(config.getParameter<double>("GE11ElecBkgParam1")),
28  GE11ElecBkgParam2_(config.getParameter<double>("GE11ElecBkgParam2")),
29  GE21ElecBkgParam0_(config.getParameter<double>("GE21ElecBkgParam0")),
30  GE21ElecBkgParam1_(config.getParameter<double>("GE21ElecBkgParam1")),
31  GE21ElecBkgParam2_(config.getParameter<double>("GE21ElecBkgParam2")),
32  GE11ModNeuBkgParam0_(config.getParameter<double>("GE11ModNeuBkgParam0")),
33  GE11ModNeuBkgParam1_(config.getParameter<double>("GE11ModNeuBkgParam1")),
34  GE11ModNeuBkgParam2_(config.getParameter<double>("GE11ModNeuBkgParam2")),
35  GE21ModNeuBkgParam0_(config.getParameter<double>("GE11ModNeuBkgParam0")),
36  GE21ModNeuBkgParam1_(config.getParameter<double>("GE11ModNeuBkgParam1")),
37  GE21ModNeuBkgParam2_(config.getParameter<double>("GE11ModNeuBkgParam2")) {}
double GE21ModNeuBkgParam1_
Definition: GEMBkgModel.h:59
double GE21ElecBkgParam2_
Definition: GEMBkgModel.h:53
const double clusterSizeCut
Definition: GEMBkgModel.h:33
double GE11ModNeuBkgParam2_
Definition: GEMBkgModel.h:57
bool simulateElectronBkg_
Definition: GEMBkgModel.h:40
double GE11ModNeuBkgParam0_
Definition: GEMBkgModel.h:55
double GE11ModNeuBkgParam1_
Definition: GEMBkgModel.h:56
double GE21ModNeuBkgParam0_
Definition: GEMBkgModel.h:58
Definition: config.py:1
double bxWidth_
Definition: GEMBkgModel.h:43
double instLumi_
Definition: GEMBkgModel.h:41
double GE21ElecBkgParam0_
Definition: GEMBkgModel.h:51
double GE21ModNeuBkgParam2_
Definition: GEMBkgModel.h:60
bool fixedRollRadius_
Definition: GEMBkgModel.h:39
const double referenceInstLumi_
Definition: GEMBkgModel.h:44
double GE11ElecBkgParam2_
Definition: GEMBkgModel.h:50
double GE11ElecBkgParam1_
Definition: GEMBkgModel.h:49
GEMDigiModel(const edm::ParameterSet &)
Definition: GEMDigiModel.h:48
bool simulateNoiseCLS_
Definition: GEMBkgModel.h:38
double GE11ElecBkgParam0_
Definition: GEMBkgModel.h:48
double rateFact_
Definition: GEMBkgModel.h:42
double GE21ElecBkgParam1_
Definition: GEMBkgModel.h:52
double averageEfficiency_
Definition: GEMBkgModel.h:34

◆ ~GEMBkgModel()

GEMBkgModel::~GEMBkgModel ( )
override

Definition at line 39 of file GEMBkgModel.cc.

39 {}

Member Function Documentation

◆ simulate()

void GEMBkgModel::simulate ( const GEMEtaPartition roll,
const edm::PSimHitContainer ,
CLHEP::HepRandomEngine *  engine,
Strips strips_,
DetectorHitMap detectorHitMap_ 
)
overridevirtual

Implements GEMDigiModel.

Definition at line 41 of file GEMBkgModel.cc.

References averageEfficiency_, bxWidth_, nano_mu_local_reco_cff::clusterSize, clusterSizeCut, Exception, fixedRollRadius_, GE11ElecBkgParam0_, GE11ElecBkgParam1_, GE11ElecBkgParam2_, GE11ModNeuBkgParam0_, GE11ModNeuBkgParam1_, GE11ModNeuBkgParam2_, GE21ElecBkgParam0_, GE21ElecBkgParam1_, GE21ElecBkgParam2_, GE21ModNeuBkgParam0_, GE21ModNeuBkgParam1_, GE21ModNeuBkgParam2_, mps_fire::i, instLumi_, maxBunch_, minBunch_, rateFact_, referenceInstLumi_, nano_mu_digi_cff::roll, simulateElectronBkg_, and simulateNoiseCLS_.

45  {
46  const GEMDetId& gemId(roll->id());
47  const int nstrips(roll->nstrips());
48  double trArea(0.0);
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.";
52  }
53  const GEMStripTopology* top_(dynamic_cast<const GEMStripTopology*>(&(roll->topology())));
54  const float striplength(top_->stripLength());
55  trStripArea = (roll->pitch()) * striplength;
56  trArea = trStripArea * nstrips;
57  const int nBxing(maxBunch_ - minBunch_ + 1);
58  const float rollRadius(
60  ? top_->radius()
61  : top_->radius() + CLHEP::RandFlat::shoot(engine, -1. * top_->stripLength() / 2., top_->stripLength() / 2.));
62 
63  //calculate noise from model
64  double averageNeutralNoiseRatePerRoll = 0.;
65  double averageNoiseElectronRatePerRoll = 0.;
66  double averageNoiseRatePerRoll = 0.;
67  if (gemId.station() == 1) {
68  //simulate neutral background for GE1/1
69  averageNeutralNoiseRatePerRoll =
71  GE11ModNeuBkgParam2_ * rollRadius * rollRadius); //simulate electron background for GE1/1
73  averageNoiseElectronRatePerRoll =
74  (GE11ElecBkgParam0_ + GE11ElecBkgParam1_ * rollRadius + GE11ElecBkgParam2_ * rollRadius * rollRadius);
75 
76  // Scale up/down for desired instantaneous lumi (reference is 5E34, double from config is in units of 1E34)
77  averageNoiseRatePerRoll = averageNeutralNoiseRatePerRoll + averageNoiseElectronRatePerRoll;
78  averageNoiseRatePerRoll *= instLumi_ * rateFact_ / referenceInstLumi_;
79  } else if (gemId.station() == 2) {
80  //simulate neutral background for GE2/1
81  averageNeutralNoiseRatePerRoll =
82  (GE21ModNeuBkgParam0_ + GE21ModNeuBkgParam1_ * rollRadius + GE21ModNeuBkgParam2_ * rollRadius * rollRadius);
83  //simulate electron background for GE2/1
85  averageNoiseElectronRatePerRoll =
86  (GE21ElecBkgParam0_ + GE21ElecBkgParam1_ * rollRadius + GE21ElecBkgParam2_ * rollRadius * rollRadius);
87 
88  // Scale up/down for desired instantaneous lumi (reference is 5E34, double from config is in units of 1E34)
89  averageNoiseRatePerRoll = averageNeutralNoiseRatePerRoll + averageNoiseElectronRatePerRoll;
90  averageNoiseRatePerRoll *= instLumi_ * rateFact_ / referenceInstLumi_;
91  }
92 
93  //simulate bkg contribution
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_);
100  if (simulateNoiseCLS_) {
101  std::vector<std::pair<int, int> > cluster_;
102  cluster_.clear();
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) {
107  if (CLHEP::RandFlat::shoot(engine) < averageEfficiency_ && (centralStrip - 1 > 0))
108  cluster_.emplace_back(centralStrip - 1, time_hit);
109  } else {
110  if (CLHEP::RandFlat::shoot(engine) < averageEfficiency_ && (centralStrip + 1 <= nstrips))
111  cluster_.emplace_back(centralStrip + 1, time_hit);
112  }
113  }
114  for (const auto& digi : cluster_) {
115  strips_.emplace(digi);
116  }
117  } //end simulateNoiseCLS_
118  else {
119  strips_.emplace(centralStrip, time_hit);
120  }
121  }
122  return;
123 }
double GE21ModNeuBkgParam1_
Definition: GEMBkgModel.h:59
double GE21ElecBkgParam2_
Definition: GEMBkgModel.h:53
const double clusterSizeCut
Definition: GEMBkgModel.h:33
double GE11ModNeuBkgParam2_
Definition: GEMBkgModel.h:57
bool simulateElectronBkg_
Definition: GEMBkgModel.h:40
double GE11ModNeuBkgParam0_
Definition: GEMBkgModel.h:55
double GE11ModNeuBkgParam1_
Definition: GEMBkgModel.h:56
double GE21ModNeuBkgParam0_
Definition: GEMBkgModel.h:58
double bxWidth_
Definition: GEMBkgModel.h:43
double instLumi_
Definition: GEMBkgModel.h:41
double GE21ElecBkgParam0_
Definition: GEMBkgModel.h:51
double GE21ModNeuBkgParam2_
Definition: GEMBkgModel.h:60
bool fixedRollRadius_
Definition: GEMBkgModel.h:39
const double referenceInstLumi_
Definition: GEMBkgModel.h:44
double GE11ElecBkgParam2_
Definition: GEMBkgModel.h:50
double GE11ElecBkgParam1_
Definition: GEMBkgModel.h:49
bool simulateNoiseCLS_
Definition: GEMBkgModel.h:38
double GE11ElecBkgParam0_
Definition: GEMBkgModel.h:48
double rateFact_
Definition: GEMBkgModel.h:42
double GE21ElecBkgParam1_
Definition: GEMBkgModel.h:52
double averageEfficiency_
Definition: GEMBkgModel.h:34

Member Data Documentation

◆ averageEfficiency_

double GEMBkgModel::averageEfficiency_
private

Definition at line 34 of file GEMBkgModel.h.

Referenced by simulate().

◆ bxWidth_

double GEMBkgModel::bxWidth_
private

Definition at line 43 of file GEMBkgModel.h.

Referenced by simulate().

◆ clusterSizeCut

const double GEMBkgModel::clusterSizeCut
private

Definition at line 33 of file GEMBkgModel.h.

Referenced by simulate().

◆ digitizeOnlyMuons_

bool GEMBkgModel::digitizeOnlyMuons_
private

Definition at line 37 of file GEMBkgModel.h.

◆ fixedRollRadius_

bool GEMBkgModel::fixedRollRadius_
private

Definition at line 39 of file GEMBkgModel.h.

Referenced by simulate().

◆ GE11ElecBkgParam0_

double GEMBkgModel::GE11ElecBkgParam0_
private

Definition at line 48 of file GEMBkgModel.h.

Referenced by simulate().

◆ GE11ElecBkgParam1_

double GEMBkgModel::GE11ElecBkgParam1_
private

Definition at line 49 of file GEMBkgModel.h.

Referenced by simulate().

◆ GE11ElecBkgParam2_

double GEMBkgModel::GE11ElecBkgParam2_
private

Definition at line 50 of file GEMBkgModel.h.

Referenced by simulate().

◆ GE11ModNeuBkgParam0_

double GEMBkgModel::GE11ModNeuBkgParam0_
private

Definition at line 55 of file GEMBkgModel.h.

Referenced by simulate().

◆ GE11ModNeuBkgParam1_

double GEMBkgModel::GE11ModNeuBkgParam1_
private

Definition at line 56 of file GEMBkgModel.h.

Referenced by simulate().

◆ GE11ModNeuBkgParam2_

double GEMBkgModel::GE11ModNeuBkgParam2_
private

Definition at line 57 of file GEMBkgModel.h.

Referenced by simulate().

◆ GE21ElecBkgParam0_

double GEMBkgModel::GE21ElecBkgParam0_
private

Definition at line 51 of file GEMBkgModel.h.

Referenced by simulate().

◆ GE21ElecBkgParam1_

double GEMBkgModel::GE21ElecBkgParam1_
private

Definition at line 52 of file GEMBkgModel.h.

Referenced by simulate().

◆ GE21ElecBkgParam2_

double GEMBkgModel::GE21ElecBkgParam2_
private

Definition at line 53 of file GEMBkgModel.h.

Referenced by simulate().

◆ GE21ModNeuBkgParam0_

double GEMBkgModel::GE21ModNeuBkgParam0_
private

Definition at line 58 of file GEMBkgModel.h.

Referenced by simulate().

◆ GE21ModNeuBkgParam1_

double GEMBkgModel::GE21ModNeuBkgParam1_
private

Definition at line 59 of file GEMBkgModel.h.

Referenced by simulate().

◆ GE21ModNeuBkgParam2_

double GEMBkgModel::GE21ModNeuBkgParam2_
private

Definition at line 60 of file GEMBkgModel.h.

Referenced by simulate().

◆ instLumi_

double GEMBkgModel::instLumi_
private

Definition at line 41 of file GEMBkgModel.h.

Referenced by simulate().

◆ maxBunch_

int GEMBkgModel::maxBunch_
private

Definition at line 36 of file GEMBkgModel.h.

Referenced by simulate().

◆ minBunch_

int GEMBkgModel::minBunch_
private

Definition at line 35 of file GEMBkgModel.h.

Referenced by simulate().

◆ rateFact_

double GEMBkgModel::rateFact_
private

Definition at line 42 of file GEMBkgModel.h.

Referenced by simulate().

◆ referenceInstLumi_

const double GEMBkgModel::referenceInstLumi_
private

Definition at line 44 of file GEMBkgModel.h.

Referenced by simulate().

◆ resolutionX_

double GEMBkgModel::resolutionX_
private

Definition at line 45 of file GEMBkgModel.h.

◆ simulateElectronBkg_

bool GEMBkgModel::simulateElectronBkg_
private

Definition at line 40 of file GEMBkgModel.h.

Referenced by simulate().

◆ simulateNoiseCLS_

bool GEMBkgModel::simulateNoiseCLS_
private

Definition at line 38 of file GEMBkgModel.h.

Referenced by simulate().