test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
GEMSimpleModel Class Reference

#include <GEMSimpleModel.h>

Inheritance diagram for GEMSimpleModel:
GEMDigiModel

Public Member Functions

 GEMSimpleModel (const edm::ParameterSet &)
 
int getSimHitBx (const PSimHit *, CLHEP::HepRandomEngine *)
 
void setup ()
 
std::vector< std::pair< int,
int > > 
simulateClustering (const GEMEtaPartition *, const PSimHit *, const int, CLHEP::HepRandomEngine *) override
 
void simulateNoise (const GEMEtaPartition *, CLHEP::HepRandomEngine *) override
 
void simulateSignal (const GEMEtaPartition *, const edm::PSimHitContainer &, CLHEP::HepRandomEngine *) override
 
 ~GEMSimpleModel ()
 
- Public Member Functions inherited from GEMDigiModel
void fillDigis (int rollDetId, GEMDigiCollection &)
 
const GEMGeometrygetGeometry ()
 
void setGeometry (const GEMGeometry *geom)
 
const StripDigiSimLinksstripDigiSimLinks () const
 
virtual ~GEMDigiModel ()
 

Private Attributes

double averageEfficiency_
 
double averageNoiseRate_
 
double averageShapingTime_
 
int bxwidth_
 
double constElecGE21
 
double constNeuGE11
 
double constNeuGE11_highRate
 
bool cosmics_
 
bool digitizeOnlyMuons_
 
bool doBkgNoise_
 
bool doNoiseCLS_
 
bool fixedRollRadius_
 
double GE11ElecBkgParam0
 
double GE11ElecBkgParam1
 
double GE11ElecBkgParam2
 
double GE11ElecBkgParam3
 
double GE21ModNeuBkgParam0
 
double GE21ModNeuBkgParam1
 
double GE21ModNeuBkgParam2
 
double GE21ModNeuBkgParam3
 
double GE21ModNeuBkgParam4
 
double GE21ModNeuBkgParam5
 
double GE21NeuBkgParam0
 
double GE21NeuBkgParam1
 
double GE21NeuBkgParam2
 
double GE21NeuBkgParam3
 
double GE21NeuBkgParam4
 
double GE21NeuBkgParam5
 
int maxBunch_
 
int minBunch_
 
double signalPropagationSpeed_
 
bool simulateElectronBkg_
 
bool simulateIntrinsicNoise_
 
bool simulateLowNeutralRate_
 
double slopeElecGE21
 
double slopeNeuGE11
 
double slopeNeuGE11_highRate
 
double timeJitter_
 
double timeResolution_
 

Additional Inherited Members

- Public Types inherited from GEMDigiModel
typedef edm::DetSet
< StripDigiSimLink
StripDigiSimLinks
 
- Protected Types inherited from GEMDigiModel
typedef std::multimap
< std::pair< unsigned int, int >
, const PSimHit *, std::less
< std::pair< unsigned int, int > > > 
DetectorHitMap
 
- Protected Member Functions inherited from GEMDigiModel
void addLinks (unsigned int strip, int bx)
 creates links from Digi to SimTrack More...
 
 GEMDigiModel (const edm::ParameterSet &)
 
- Protected Attributes inherited from GEMDigiModel
DetectorHitMap detectorHitMap_
 
const GEMGeometrygeometry_
 
StripDigiSimLinks stripDigiSimLinks_
 
std::set< std::pair< int, int > > strips_
 

Detailed Description

Class for the GEM strip response simulation based on a very simple model

Author
Sven Dildick by Roumyana Hadjiiska

Definition at line 22 of file GEMSimpleModel.h.

Constructor & Destructor Documentation

GEMSimpleModel::GEMSimpleModel ( const edm::ParameterSet config)

Definition at line 20 of file GEMSimpleModel.cc.

References constElecGE21, constNeuGE11, constNeuGE11_highRate, GE11ElecBkgParam0, GE11ElecBkgParam1, GE11ElecBkgParam2, GE11ElecBkgParam3, GE21ModNeuBkgParam0, GE21ModNeuBkgParam1, GE21ModNeuBkgParam2, GE21ModNeuBkgParam3, GE21ModNeuBkgParam4, GE21ModNeuBkgParam5, GE21NeuBkgParam0, GE21NeuBkgParam1, GE21NeuBkgParam2, GE21NeuBkgParam3, GE21NeuBkgParam4, GE21NeuBkgParam5, slopeElecGE21, slopeNeuGE11, and slopeNeuGE11_highRate.

20  :
21 GEMDigiModel(config)
22 , averageEfficiency_(config.getParameter<double> ("averageEfficiency"))
23 , averageShapingTime_(config.getParameter<double> ("averageShapingTime"))
24 , timeResolution_(config.getParameter<double> ("timeResolution"))
25 , timeJitter_(config.getParameter<double> ("timeJitter"))
26 , averageNoiseRate_(config.getParameter<double> ("averageNoiseRate"))
27 , signalPropagationSpeed_(config.getParameter<double> ("signalPropagationSpeed"))
28 , cosmics_(config.getParameter<bool> ("cosmics"))
29 , bxwidth_(config.getParameter<int> ("bxwidth"))
30 , minBunch_(config.getParameter<int> ("minBunch"))
31 , maxBunch_(config.getParameter<int> ("maxBunch"))
32 , digitizeOnlyMuons_(config.getParameter<bool> ("digitizeOnlyMuons"))
33 , doBkgNoise_(config.getParameter<bool> ("doBkgNoise"))
34 , doNoiseCLS_(config.getParameter<bool> ("doNoiseCLS"))
35 , fixedRollRadius_(config.getParameter<bool> ("fixedRollRadius"))
36 , simulateElectronBkg_(config.getParameter<bool> ("simulateElectronBkg"))
37 , simulateLowNeutralRate_(config.getParameter<bool>("simulateLowNeutralRate"))
38 {
39 //initialise parameters from the fit:
40 //params for pol3 model of electron bkg for GE1/1:
41  GE11ElecBkgParam0 = 3402.63;
42  GE11ElecBkgParam1 = -42.9979;
43  GE11ElecBkgParam2 = 0.188475;
44  GE11ElecBkgParam3 = -0.0002822;
45 //params for expo model of electron bkg for GE2/1:
46  constElecGE21 = 9.74156e+02;
47  slopeElecGE21 = -1.18398e-02;
48 //Neutral Bkg
49 //Low Rate model L=10^{34}cm^{-2}s^{-1}
50 //const and slope for the expo model of neutral bkg for GE1/1:
51  constNeuGE11 = 807.;
52  slopeNeuGE11 = -0.01443;
53 //params for the simple pol5 model of neutral bkg for GE2/1:
54  GE21NeuBkgParam0 = 2954.04;
55  GE21NeuBkgParam1 = -58.7558;
56  GE21NeuBkgParam2 = 0.473481;
57  GE21NeuBkgParam3 = -0.00188292;
58  GE21NeuBkgParam4 = 3.67041e-06;
59  GE21NeuBkgParam5 = -2.80261e-09;
60 //High Rate model L=5x10^{34}cm^{-2}s^{-1}
61 //params for expo model of neutral bkg for GE1/1:
62  constNeuGE11_highRate = 1.02603e+04;
63  slopeNeuGE11_highRate = -1.62806e-02;
64 //params for pol5 model of neutral bkg for GE2/1:
65  GE21ModNeuBkgParam0 = 21583.2;
66  GE21ModNeuBkgParam1 = -476.59;
67  GE21ModNeuBkgParam2 = 4.24037;
68  GE21ModNeuBkgParam3 = -0.0185558;
69  GE21ModNeuBkgParam4 = 3.97809e-05;
70  GE21ModNeuBkgParam5 = -3.34575e-08;
71 }
T getParameter(std::string const &) const
double GE21ModNeuBkgParam1
double signalPropagationSpeed_
double GE21ModNeuBkgParam4
double slopeNeuGE11_highRate
double constNeuGE11_highRate
double averageNoiseRate_
double slopeElecGE21
double GE21ModNeuBkgParam5
double GE11ElecBkgParam2
double GE11ElecBkgParam0
double GE11ElecBkgParam3
double averageEfficiency_
double GE11ElecBkgParam1
bool simulateLowNeutralRate_
double GE21NeuBkgParam2
GEMDigiModel(const edm::ParameterSet &)
Definition: GEMDigiModel.h:58
bool simulateElectronBkg_
double GE21ModNeuBkgParam2
double GE21ModNeuBkgParam0
double constElecGE21
double GE21NeuBkgParam4
double GE21ModNeuBkgParam3
double GE21NeuBkgParam3
double GE21NeuBkgParam0
double GE21NeuBkgParam5
double averageShapingTime_
double timeResolution_
double GE21NeuBkgParam1
GEMSimpleModel::~GEMSimpleModel ( )

Definition at line 73 of file GEMSimpleModel.cc.

74 {
75 }

Member Function Documentation

int GEMSimpleModel::getSimHitBx ( const PSimHit simhit,
CLHEP::HepRandomEngine *  engine 
)

Definition at line 123 of file GEMSimpleModel.cc.

References averageShapingTime_, bxwidth_, cosmics_, gather_cfg::cout, debug, PSimHit::detUnitId(), alignCSCRings::e, GEMGeometry::etaPartition(), Exception, GEMDigiModel::geometry_, PSimHit::localPosition(), signalPropagationSpeed_, mathSSE::sqrt(), timeJitter_, PSimHit::timeOfFlight(), timeResolution_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by simulateSignal().

124 {
125  int bx = -999;
126  const LocalPoint simHitPos(simhit->localPosition());
127  const float tof(simhit->timeOfFlight());
128  // random Gaussian time correction due to electronics jitter
129  float randomJitterTime = CLHEP::RandGaussQ::shoot(engine, 0., timeJitter_);
130  const GEMDetId id(simhit->detUnitId());
131  const GEMEtaPartition* roll(geometry_->etaPartition(id));
132  if (!roll)
133  {
134  throw cms::Exception("Geometry")<< "GEMSimpleModel::getSimHitBx() - GEM simhit id does not match any GEM roll id: " << id << "\n";
135  return 999;
136  }
137  if (roll->id().region() == 0)
138  {
139  throw cms::Exception("Geometry") << "GEMSimpleModel::getSimHitBx() - this GEM id is from barrel, which cannot happen: " << roll->id() << "\n";
140  }
141  const double cspeed = 299792458; // signal propagation speed in vacuum in [m/s]
142  const int nstrips = roll->nstrips();
143  float middleStrip = nstrips/2.;
144  LocalPoint middleOfRoll = roll->centreOfStrip(middleStrip);
145  GlobalPoint globMiddleRol = roll->toGlobal(middleOfRoll);
146  double muRadius = sqrt(globMiddleRol.x()*globMiddleRol.x() + globMiddleRol.y()*globMiddleRol.y() +globMiddleRol.z()*globMiddleRol.z());
147  double timeCalibrationOffset_ = (muRadius *1e+9)/(cspeed*1e+2); //[ns]
148 
149  const TrapezoidalStripTopology* top(dynamic_cast<const TrapezoidalStripTopology*> (&(roll->topology())));
150  const float halfStripLength(0.5 * top->stripLength());
151  const float distanceFromEdge(halfStripLength - simHitPos.y());
152 
153  // signal propagation speed in material in [cm/ns]
154  double signalPropagationSpeedTrue = signalPropagationSpeed_ * cspeed * 1e-7; // 1e+2 * 1e-9;
155 
156  // average time for the signal to propagate from the SimHit to the top of a strip
157  const float averagePropagationTime(distanceFromEdge / signalPropagationSpeedTrue);
158  // random Gaussian time correction due to the finite timing resolution of the detector
159  float randomResolutionTime = CLHEP::RandGaussQ::shoot(engine, 0., timeResolution_);
160  const float simhitTime(tof + averageShapingTime_ + randomResolutionTime + averagePropagationTime + randomJitterTime);
161  float referenceTime = 0.;
162  referenceTime = timeCalibrationOffset_ + halfStripLength / signalPropagationSpeedTrue + averageShapingTime_;
163  const float timeDifference(cosmics_ ? (simhitTime - referenceTime) / COSMIC_PAR : simhitTime - referenceTime);
164  // assign the bunch crossing
165  bx = static_cast<int> (std::round((timeDifference) / bxwidth_));
166 
167  // check time
168  const bool debug(false);
169  if (debug)
170  {
171  std::cout << "checktime " << "bx = " << bx << "\tdeltaT = " << timeDifference << "\tsimT = " << simhitTime
172  << "\trefT = " << referenceTime << "\ttof = " << tof << "\tavePropT = " << averagePropagationTime
173  << "\taveRefPropT = " << halfStripLength / signalPropagationSpeedTrue << std::endl;
174  }
175  return bx;
176 }
double signalPropagationSpeed_
T y() const
Definition: PV3DBase.h:63
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
Definition: GEMGeometry.cc:103
float timeOfFlight() const
Definition: PSimHit.h:69
Local3DPoint localPosition() const
Definition: PSimHit.h:44
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
#define debug
Definition: HDRShower.cc:19
const GEMGeometry * geometry_
Definition: GEMDigiModel.h:60
double averageShapingTime_
double timeResolution_
tuple cout
Definition: gather_cfg.py:145
T x() const
Definition: PV3DBase.h:62
unsigned int detUnitId() const
Definition: PSimHit.h:93
void GEMSimpleModel::setup ( void  )
virtual

Implements GEMDigiModel.

Definition at line 77 of file GEMSimpleModel.cc.

78 {
79  return;
80 }
std::vector< std::pair< int, int > > GEMSimpleModel::simulateClustering ( const GEMEtaPartition roll,
const PSimHit simHit,
const int  bx,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

Implements GEMDigiModel.

Definition at line 299 of file GEMSimpleModel.cc.

References averageEfficiency_, GEMEtaPartition::centreOfStrip(), Topology::channel(), PSimHit::localPosition(), GEMEtaPartition::nstrips(), GEMEtaPartition::specificTopology(), GeomDet::toGlobal(), ecaldqm::topology(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by simulateSignal().

301 {
302  const StripTopology& topology = roll->specificTopology(); // const LocalPoint& entry(simHit->entryPoint());
303  const LocalPoint& hit_position(simHit->localPosition());
304  const int nstrips(roll->nstrips());
305  int centralStrip = 0;
306  if (!(topology.channel(hit_position) + 1 > nstrips))
307  centralStrip = topology.channel(hit_position) + 1;
308  else
309  centralStrip = topology.channel(hit_position);
310  GlobalPoint pointSimHit = roll->toGlobal(hit_position);
311  GlobalPoint pointDigiHit = roll->toGlobal(roll->centreOfStrip(centralStrip));
312  double deltaX = pointSimHit.x() - pointDigiHit.x();
313 // Add central digi to cluster vector
314  std::vector < std::pair<int, int> > cluster_;
315  cluster_.clear();
316  cluster_.push_back(std::pair<int, int>(centralStrip, bx));
317 //simulate cross talk
318  int clusterSize((CLHEP::RandFlat::shoot(engine)) <= 0.53 ? 1 : 2);
319  if (clusterSize == 2)
320  {
321  if (deltaX <= 0)
322  {
323  if (CLHEP::RandFlat::shoot(engine) < averageEfficiency_ && (centralStrip - 1 > 0))
324  cluster_.push_back(std::pair<int, int>(centralStrip - 1, bx));
325  }
326  else
327  {
328  if (CLHEP::RandFlat::shoot(engine) < averageEfficiency_ && (centralStrip + 1 <= nstrips))
329  cluster_.push_back(std::pair<int, int>(centralStrip + 1, bx));
330  }
331  }
332  return cluster_;
333 }
CaloTopology const * topology(0)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
LocalPoint centreOfStrip(int strip) const
int nstrips() const
number of readout strips in partition
Local3DPoint localPosition() const
Definition: PSimHit.h:44
double averageEfficiency_
virtual int channel(const LocalPoint &p) const =0
const StripTopology & specificTopology() const
T x() const
Definition: PV3DBase.h:62
void GEMSimpleModel::simulateNoise ( const GEMEtaPartition roll,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

Implements GEMDigiModel.

Definition at line 178 of file GEMSimpleModel.cc.

References averageEfficiency_, averageNoiseRate_, bxwidth_, constElecGE21, constNeuGE11, constNeuGE11_highRate, doBkgNoise_, doNoiseCLS_, alignCSCRings::e, Exception, fixedRollRadius_, GE11ElecBkgParam0, GE11ElecBkgParam1, GE11ElecBkgParam2, GE11ElecBkgParam3, GE21ModNeuBkgParam0, GE21ModNeuBkgParam1, GE21ModNeuBkgParam2, GE21ModNeuBkgParam3, GE21ModNeuBkgParam4, GE21ModNeuBkgParam5, GE21NeuBkgParam0, GE21NeuBkgParam1, GE21NeuBkgParam2, GE21NeuBkgParam3, GE21NeuBkgParam4, GE21NeuBkgParam5, i, GEMEtaPartition::id(), j, relval_2017::k, maxBunch_, minBunch_, GEMEtaPartition::nstrips(), GEMEtaPartition::pitch(), simulateElectronBkg_, simulateIntrinsicNoise_, simulateLowNeutralRate_, slopeElecGE21, slopeNeuGE11, slopeNeuGE11_highRate, GEMDigiModel::strips_, and GEMEtaPartition::topology().

180 {
181  if (!doBkgNoise_)
182  return;
183  const GEMDetId gemId(roll->id());
184  const int nstrips(roll->nstrips());
185  double trArea(0.0);
186  double trStripArea(0.0);
187  if (gemId.region() == 0)
188  {
189  throw cms::Exception("Geometry")
190  << "GEMSynchronizer::simulateNoise() - this GEM id is from barrel, which cannot happen.";
191  }
192  const TrapezoidalStripTopology* top_(dynamic_cast<const TrapezoidalStripTopology*>(&(roll->topology())));
193  const float striplength(top_->stripLength());
194  trStripArea = (roll->pitch()) * striplength;
195  trArea = trStripArea * nstrips;
196  const int nBxing(maxBunch_ - minBunch_ + 1);
197  const float rollRadius(fixedRollRadius_ ? top_->radius() :
198  top_->radius() + CLHEP::RandFlat::shoot(engine, -1.*top_->stripLength()/2., top_->stripLength()/2.));
199 
200 //calculate noise from model
201  double averageNeutralNoiseRatePerRoll = 0.;
202  double averageNoiseElectronRatePerRoll = 0.;
203  double averageNoiseRatePerRoll = 0.;
204  if (gemId.station() == 1)
205  {
206 //simulate neutral background for GE1/1
208  averageNeutralNoiseRatePerRoll = constNeuGE11 * TMath::Exp(slopeNeuGE11 * rollRadius);
209  else
210  averageNeutralNoiseRatePerRoll = constNeuGE11_highRate * TMath::Exp(slopeNeuGE11_highRate * rollRadius);
211 //simulate electron background for GE1/1
213  averageNoiseElectronRatePerRoll = GE11ElecBkgParam0
214  + GE11ElecBkgParam1 * rollRadius
215  + GE11ElecBkgParam2 * rollRadius * rollRadius
216  + GE11ElecBkgParam3 * rollRadius * rollRadius * rollRadius;
217  averageNoiseRatePerRoll = averageNeutralNoiseRatePerRoll + averageNoiseElectronRatePerRoll;
218  }
219  if (gemId.station() == 2 || gemId.station() == 3)
220  {
221 //simulate neutral background for GE2/1
223  averageNeutralNoiseRatePerRoll = GE21NeuBkgParam0
224  + GE21NeuBkgParam1 * rollRadius
225  + GE21NeuBkgParam2 * rollRadius * rollRadius
226  + GE21NeuBkgParam3 * rollRadius * rollRadius * rollRadius
227  + GE21NeuBkgParam4 * rollRadius * rollRadius * rollRadius * rollRadius
228  + GE21NeuBkgParam5 * rollRadius * rollRadius * rollRadius * rollRadius * rollRadius;
229  else
230  averageNeutralNoiseRatePerRoll = GE21ModNeuBkgParam0
231  + GE21ModNeuBkgParam1 * rollRadius
232  + GE21ModNeuBkgParam2 * rollRadius * rollRadius
233  + GE21ModNeuBkgParam3 * rollRadius * rollRadius * rollRadius
234  + GE21ModNeuBkgParam4 * rollRadius * rollRadius * rollRadius * rollRadius
235  + GE21ModNeuBkgParam5 * rollRadius * rollRadius * rollRadius * rollRadius * rollRadius;
236 //simulate electron background for GE2/1
238  averageNoiseElectronRatePerRoll = constElecGE21 * TMath::Exp(slopeElecGE21 * rollRadius);
239  averageNoiseRatePerRoll = averageNeutralNoiseRatePerRoll + averageNoiseElectronRatePerRoll;
240  }
241 //simulate intrinsic noise
243  {
244  const double aveIntrinsicNoisePerStrip(averageNoiseRate_ * nBxing * bxwidth_ * trStripArea * 1.0e-9);
245  for(int j = 0; j < nstrips; ++j)
246  {
247  CLHEP::RandPoissonQ randPoissonQ(*engine, aveIntrinsicNoisePerStrip);
248  const int n_intrHits(randPoissonQ.fire());
249 
250  for (int k = 0; k < n_intrHits; k++ )
251  {
252  const int time_hit(static_cast<int>(CLHEP::RandFlat::shoot(engine, nBxing)) + minBunch_);
253  std::pair<int, int> digi(k+1,time_hit);
254  strips_.insert(digi);
255  }
256  }
257  }//end simulate intrinsic noise
258 //simulate bkg contribution
259  const double averageNoise(averageNoiseRatePerRoll * nBxing * bxwidth_ * trArea * 1.0e-9);
260  CLHEP::RandPoissonQ randPoissonQ(*engine, averageNoise);
261  const int n_hits(randPoissonQ.fire());
262  for (int i = 0; i < n_hits; ++i)
263  {
264  const int centralStrip(static_cast<int> (CLHEP::RandFlat::shoot(engine, 1, nstrips)));
265  const int time_hit(static_cast<int>(CLHEP::RandFlat::shoot(engine, nBxing)) + minBunch_);
266  if (doNoiseCLS_)
267  {
268  std::vector < std::pair<int, int> > cluster_;
269  cluster_.clear();
270  cluster_.push_back(std::pair<int, int>(centralStrip, time_hit));
271  int clusterSize((CLHEP::RandFlat::shoot(engine)) <= 0.53 ? 1 : 2);
272  if (clusterSize == 2)
273  {
274  if(CLHEP::RandFlat::shoot(engine) < 0.5)
275  {
276  if (CLHEP::RandFlat::shoot(engine) < averageEfficiency_ && (centralStrip - 1 > 0))
277  cluster_.push_back(std::pair<int, int>(centralStrip - 1, time_hit));
278  }
279  else
280  {
281  if (CLHEP::RandFlat::shoot(engine) < averageEfficiency_ && (centralStrip + 1 <= nstrips))
282  cluster_.push_back(std::pair<int, int>(centralStrip + 1, time_hit));
283  }
284  }
285  for (auto & digi : cluster_)
286  {
287  strips_.insert(digi);
288  }
289  } //end doNoiseCLS_
290  else
291  {
292  std::pair<int, int> digi(centralStrip, time_hit);
293  strips_.insert(digi);
294  }
295  }
296  return;
297 }
double GE21ModNeuBkgParam1
int i
Definition: DBlmapReader.cc:9
double GE21ModNeuBkgParam4
double slopeNeuGE11_highRate
double constNeuGE11_highRate
double averageNoiseRate_
double slopeElecGE21
const Topology & topology() const
double GE21ModNeuBkgParam5
GEMDetId id() const
int nstrips() const
number of readout strips in partition
double GE11ElecBkgParam2
double GE11ElecBkgParam0
bool simulateIntrinsicNoise_
double GE11ElecBkgParam3
double averageEfficiency_
double GE11ElecBkgParam1
int j
Definition: DBlmapReader.cc:9
bool simulateLowNeutralRate_
float pitch() const
double GE21NeuBkgParam2
bool simulateElectronBkg_
double GE21ModNeuBkgParam2
double GE21ModNeuBkgParam0
double constElecGE21
double GE21NeuBkgParam4
double GE21ModNeuBkgParam3
double GE21NeuBkgParam3
double GE21NeuBkgParam0
double GE21NeuBkgParam5
std::set< std::pair< int, int > > strips_
Definition: GEMDigiModel.h:62
double GE21NeuBkgParam1
void GEMSimpleModel::simulateSignal ( const GEMEtaPartition roll,
const edm::PSimHitContainer simHits,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

Implements GEMDigiModel.

Definition at line 82 of file GEMSimpleModel.cc.

References funct::abs(), averageEfficiency_, edm::DetSet< T >::clear(), GEMDigiModel::detectorHitMap_, digitizeOnlyMuons_, alignCSCRings::e, getSimHitBx(), GEMEtaPartition::id(), dqm-mbProfile::log, DetId::rawId(), simulateClustering(), GEMDigiModel::stripDigiSimLinks_, and GEMDigiModel::strips_.

83 {
85  detectorHitMap_.clear();
87  bool digiMuon = false;
88  bool digiElec = false;
89  for (edm::PSimHitContainer::const_iterator hit = simHits.begin(); hit != simHits.end(); ++hit)
90  {
91  if (std::abs(hit->particleType()) != 13 && digitizeOnlyMuons_)
92  continue;
93  double elecEff = 0.;
94  double partMom = hit->pabs();
95  double checkMuonEff = CLHEP::RandFlat::shoot(engine, 0., 1.);
96  double checkElecEff = CLHEP::RandFlat::shoot(engine, 0., 1.);
97  if (std::abs(hit->particleType()) == 13 && checkMuonEff < averageEfficiency_)
98  digiMuon = true;
99  if (std::abs(hit->particleType()) != 13) //consider all non muon particles with gem efficiency to electrons
100  {
101  if (partMom <= 1.95e-03)
102  elecEff = 1.7e-05 * TMath::Exp(2.1 * partMom * 1000.);
103  if (partMom > 1.95e-03 && partMom < 10.e-03)
104  elecEff = 1.34 * log(7.96e-01 * partMom * 1000. - 5.75e-01)
105  / (1.34 + log(7.96e-01 * partMom * 1000. - 5.75e-01));
106  if (partMom > 10.e-03)
107  elecEff = 1.;
108  if (checkElecEff < elecEff)
109  digiElec = true;
110  }
111  if (!(digiMuon || digiElec))
112  continue;
113  const int bx(getSimHitBx(&(*hit), engine));
114  const std::vector<std::pair<int, int> > cluster(simulateClustering(roll, &(*hit), bx, engine));
115  for (auto & digi : cluster)
116  {
118  strips_.insert(digi);
119  }
120  }
121 }
int getSimHitBx(const PSimHit *, CLHEP::HepRandomEngine *)
GEMDetId id() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
double averageEfficiency_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::pair< int, int > > simulateClustering(const GEMEtaPartition *, const PSimHit *, const int, CLHEP::HepRandomEngine *) override
tuple simHits
Definition: trackerHits.py:16
std::set< std::pair< int, int > > strips_
Definition: GEMDigiModel.h:62
void clear()
Definition: DetSet.h:69
DetectorHitMap detectorHitMap_
Definition: GEMDigiModel.h:74
StripDigiSimLinks stripDigiSimLinks_
Definition: GEMDigiModel.h:75
edm::DetSet< StripDigiSimLink > StripDigiSimLinks
Definition: GEMDigiModel.h:35

Member Data Documentation

double GEMSimpleModel::averageEfficiency_
private

Definition at line 43 of file GEMSimpleModel.h.

Referenced by simulateClustering(), simulateNoise(), and simulateSignal().

double GEMSimpleModel::averageNoiseRate_
private

Definition at line 47 of file GEMSimpleModel.h.

Referenced by simulateNoise().

double GEMSimpleModel::averageShapingTime_
private

Definition at line 44 of file GEMSimpleModel.h.

Referenced by getSimHitBx().

int GEMSimpleModel::bxwidth_
private

Definition at line 50 of file GEMSimpleModel.h.

Referenced by getSimHitBx(), and simulateNoise().

double GEMSimpleModel::constElecGE21
private

Definition at line 67 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::constNeuGE11
private

Definition at line 72 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::constNeuGE11_highRate
private

Definition at line 83 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

bool GEMSimpleModel::cosmics_
private

Definition at line 49 of file GEMSimpleModel.h.

Referenced by getSimHitBx().

bool GEMSimpleModel::digitizeOnlyMuons_
private

Definition at line 53 of file GEMSimpleModel.h.

Referenced by simulateSignal().

bool GEMSimpleModel::doBkgNoise_
private

Definition at line 54 of file GEMSimpleModel.h.

Referenced by simulateNoise().

bool GEMSimpleModel::doNoiseCLS_
private

Definition at line 55 of file GEMSimpleModel.h.

Referenced by simulateNoise().

bool GEMSimpleModel::fixedRollRadius_
private

Definition at line 56 of file GEMSimpleModel.h.

Referenced by simulateNoise().

double GEMSimpleModel::GE11ElecBkgParam0
private

Definition at line 62 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE11ElecBkgParam1
private

Definition at line 63 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE11ElecBkgParam2
private

Definition at line 64 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE11ElecBkgParam3
private

Definition at line 65 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE21ModNeuBkgParam0
private

Definition at line 86 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE21ModNeuBkgParam1
private

Definition at line 87 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE21ModNeuBkgParam2
private

Definition at line 88 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE21ModNeuBkgParam3
private

Definition at line 89 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE21ModNeuBkgParam4
private

Definition at line 90 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE21ModNeuBkgParam5
private

Definition at line 91 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE21NeuBkgParam0
private

Definition at line 75 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE21NeuBkgParam1
private

Definition at line 76 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE21NeuBkgParam2
private

Definition at line 77 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE21NeuBkgParam3
private

Definition at line 78 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE21NeuBkgParam4
private

Definition at line 79 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::GE21NeuBkgParam5
private

Definition at line 80 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

int GEMSimpleModel::maxBunch_
private

Definition at line 52 of file GEMSimpleModel.h.

Referenced by simulateNoise().

int GEMSimpleModel::minBunch_
private

Definition at line 51 of file GEMSimpleModel.h.

Referenced by simulateNoise().

double GEMSimpleModel::signalPropagationSpeed_
private

Definition at line 48 of file GEMSimpleModel.h.

Referenced by getSimHitBx().

bool GEMSimpleModel::simulateElectronBkg_
private

Definition at line 58 of file GEMSimpleModel.h.

Referenced by simulateNoise().

bool GEMSimpleModel::simulateIntrinsicNoise_
private

Definition at line 57 of file GEMSimpleModel.h.

Referenced by simulateNoise().

bool GEMSimpleModel::simulateLowNeutralRate_
private

Definition at line 59 of file GEMSimpleModel.h.

Referenced by simulateNoise().

double GEMSimpleModel::slopeElecGE21
private

Definition at line 68 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::slopeNeuGE11
private

Definition at line 73 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::slopeNeuGE11_highRate
private

Definition at line 84 of file GEMSimpleModel.h.

Referenced by GEMSimpleModel(), and simulateNoise().

double GEMSimpleModel::timeJitter_
private

Definition at line 46 of file GEMSimpleModel.h.

Referenced by getSimHitBx().

double GEMSimpleModel::timeResolution_
private

Definition at line 45 of file GEMSimpleModel.h.

Referenced by getSimHitBx().