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
ME0PreRecoGaussianModel Class Reference

#include <ME0PreRecoGaussianModel.h>

Inheritance diagram for ME0PreRecoGaussianModel:
ME0DigiPreRecoModel

Public Member Functions

 ME0PreRecoGaussianModel (const edm::ParameterSet &)
 
void setup ()
 
void simulateNoise (const ME0EtaPartition *, CLHEP::HepRandomEngine *) override
 
void simulateSignal (const ME0EtaPartition *, const edm::PSimHitContainer &, CLHEP::HepRandomEngine *) override
 
 ~ME0PreRecoGaussianModel ()
 
- Public Member Functions inherited from ME0DigiPreRecoModel
void fillDigis (int rollDetId, ME0DigiPreRecoCollection &)
 
const ME0GeometrygetGeometry ()
 
void setGeometry (const ME0Geometry *geom)
 
virtual ~ME0DigiPreRecoModel ()
 

Private Attributes

double averageEfficiency_
 
double averageNoiseRate_
 
int bxwidth_
 
bool corr
 
bool digitizeOnlyMuons_
 
bool doBkgNoise_
 
bool etaproj
 
int maxBunch_
 
double ME0ModElecBkgParam0
 
double ME0ModElecBkgParam1
 
double ME0ModElecBkgParam2
 
double ME0ModElecBkgParam3
 
double ME0ModElecBkgParam4
 
double ME0ModElecBkgParam5
 
double ME0ModElecBkgParam6
 
double ME0ModElecBkgParam7
 
double ME0ModNeuBkgParam0
 
double ME0ModNeuBkgParam1
 
double ME0ModNeuBkgParam2
 
double ME0ModNeuBkgParam3
 
double ME0ModNeuBkgParam4
 
double ME0ModNeuBkgParam5
 
double ME0ModNeuBkgParam6
 
int minBunch_
 
double sigma_t
 
double sigma_u
 
double sigma_v
 
bool simulateElectronBkg_
 
bool simulateIntrinsicNoise_
 

Additional Inherited Members

- Protected Member Functions inherited from ME0DigiPreRecoModel
 ME0DigiPreRecoModel (const edm::ParameterSet &)
 
- Protected Attributes inherited from ME0DigiPreRecoModel
std::set< ME0DigiPreRecodigi_
 
const ME0Geometrygeometry_
 

Detailed Description

Class for the ME0 Gaussian response simulation as pre-reco step

Definition at line 18 of file ME0PreRecoGaussianModel.h.

Constructor & Destructor Documentation

ME0PreRecoGaussianModel::ME0PreRecoGaussianModel ( const edm::ParameterSet config)

Definition at line 14 of file ME0PreRecoGaussianModel.cc.

References ME0ModElecBkgParam0, ME0ModElecBkgParam1, ME0ModElecBkgParam2, ME0ModElecBkgParam3, ME0ModElecBkgParam4, ME0ModElecBkgParam5, ME0ModElecBkgParam6, ME0ModNeuBkgParam0, ME0ModNeuBkgParam1, ME0ModNeuBkgParam2, ME0ModNeuBkgParam3, ME0ModNeuBkgParam4, ME0ModNeuBkgParam5, and ME0ModNeuBkgParam6.

14  :
15  ME0DigiPreRecoModel(config)
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"))
30 
31 {
32  //params for the simple pol6 model of neutral and electron bkg for ME0:
33  ME0ModNeuBkgParam0 = 5.69e+06;
34  ME0ModNeuBkgParam1 = -293334;
35  ME0ModNeuBkgParam2 = 6279.6;
36  ME0ModNeuBkgParam3 = -71.2928;
37  ME0ModNeuBkgParam4 = 0.452244;
38  ME0ModNeuBkgParam5 = -0.0015191;
39  ME0ModNeuBkgParam6 = 2.1106e-06;
40 
41  ME0ModElecBkgParam0 = 3.77712e+06;
42  ME0ModElecBkgParam1 = -199280;
43  ME0ModElecBkgParam2 = 4340.69;
44  ME0ModElecBkgParam3 = -49.922;
45  ME0ModElecBkgParam4 = 0.319699;
46  ME0ModElecBkgParam5 = -0.00108113;
47  ME0ModElecBkgParam6 = 1.50889e-06;
48 
49 }
T getParameter(std::string const &) const
ME0DigiPreRecoModel(const edm::ParameterSet &)
ME0PreRecoGaussianModel::~ME0PreRecoGaussianModel ( )

Definition at line 51 of file ME0PreRecoGaussianModel.cc.

52 {
53 }

Member Function Documentation

void ME0PreRecoGaussianModel::setup ( void  )
inlinevirtual

Implements ME0DigiPreRecoModel.

Definition at line 30 of file ME0PreRecoGaussianModel.h.

30 {}
void ME0PreRecoGaussianModel::simulateNoise ( const ME0EtaPartition roll,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

Implements ME0DigiPreRecoModel.

Definition at line 77 of file ME0PreRecoGaussianModel.cc.

References bxwidth_, corr, ME0DigiPreRecoModel::digi_, doBkgNoise_, alignCSCRings::e, Exception, i, ME0EtaPartition::id(), maxBunch_, ME0ModElecBkgParam0, ME0ModElecBkgParam1, ME0ModElecBkgParam2, ME0ModElecBkgParam3, ME0ModElecBkgParam4, ME0ModElecBkgParam5, ME0ModElecBkgParam6, ME0ModNeuBkgParam0, ME0ModNeuBkgParam1, ME0ModNeuBkgParam2, ME0ModNeuBkgParam3, ME0ModNeuBkgParam4, ME0ModNeuBkgParam5, ME0ModNeuBkgParam6, minBunch_, Parameters::parameters, ME0EtaPartitionSpecs::parameters(), sigma_t, sigma_u, sigma_v, simulateElectronBkg_, ME0EtaPartition::specs(), mathSSE::sqrt(), GeomDet::toGlobal(), ME0EtaPartition::topology(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

78 {
79  const double cspeed = 299792458;
80  double trArea(0.0);
81  const ME0DetId me0Id(roll->id());
82 
83  if (me0Id.region() == 0)
84  {
85  throw cms::Exception("Geometry")
86  << "GEMSynchronizer::simulateNoise() - this GEM id is from barrel, which cannot happen.";
87  }
88  const TrapezoidalStripTopology* top_(dynamic_cast<const TrapezoidalStripTopology*> (&(roll->topology())));
89 
90  // base_bottom, base_top, height, strips, pads (all half length)
91  auto& parameters(roll->specs()->parameters());
92  float semiBottomEdge(parameters[0]);
93  float semiTopEdge(parameters[1]);
94  float semiHeight(parameters[2]);
95  float myTanPhi = (semiTopEdge - semiBottomEdge) / (semiHeight * 2);
96  double rollRadius = top_->radius();
97  const int nBxing(maxBunch_ - minBunch_ + 1);
98  trArea = 2 * semiHeight * (semiTopEdge + semiBottomEdge);
99 
100  //simulate bkg contribution
101  if (!doBkgNoise_)
102  return;
103 
104  double aveNeutrRateBotRoll = 0.;
105  double averageNoiseElectronRatePerRoll = 0.;
106  int pdgid = 0;
107 
108  float myRand = CLHEP::RandFlat::shoot(engine);
109  float yy_rand = 2 * semiHeight * (myRand - 0.5);
110 
111  double radius_rand = rollRadius + yy_rand;
112 
114  averageNoiseElectronRatePerRoll = ME0ModElecBkgParam0
115  + ME0ModElecBkgParam1 * radius_rand
116  + ME0ModElecBkgParam2 * radius_rand * radius_rand
117  + ME0ModElecBkgParam3 * radius_rand * radius_rand * radius_rand
118  + ME0ModElecBkgParam4 * radius_rand * radius_rand * radius_rand * radius_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;
121 
122  const double averageNoiseElec(averageNoiseElectronRatePerRoll * nBxing * bxwidth_ * trArea * 1.0e-9);
123  const int n_elechits(CLHEP::RandPoissonQ::shoot(engine, averageNoiseElec));
124 
125  double xMax = semiTopEdge - (semiHeight - yy_rand) * myTanPhi;
126  for (int i = 0; i < n_elechits; ++i)
127  {
128  //calculate xx_rand at a given yy_rand
129  float myRandX = CLHEP::RandFlat::shoot(engine);
130  float xx_rand = 2 * xMax * (myRandX - 0.5);
131 
132  float ex = sigma_u;
133  float ey = sigma_v;
134  float corr = 0.;
135 
136  GlobalPoint pointDigiHit = roll->toGlobal(LocalPoint(xx_rand, yy_rand));
137  //calc tof to the random estimated point
138  double stripRadius = sqrt(pointDigiHit.x() * pointDigiHit.x() + pointDigiHit.y() * pointDigiHit.y()
139  + pointDigiHit.z() * pointDigiHit.z());
140  double timeCalibrationOffset_ = (stripRadius * 1e+9) / (cspeed * 1e+2); //[ns]
141  float tof = CLHEP::RandGaussQ::shoot(engine, timeCalibrationOffset_, sigma_t);
142 
143  float myrand = CLHEP::RandFlat::shoot(engine);
144  if (myrand <= 0.5)
145  pdgid = -11;
146  else
147  pdgid = 11;
148 
149  ME0DigiPreReco digi(xx_rand, yy_rand, ex, ey, corr, tof, pdgid);
150  digi_.insert(digi);
151  }
152 
153  aveNeutrRateBotRoll = ME0ModNeuBkgParam0
154  + ME0ModNeuBkgParam1 * radius_rand
155  + ME0ModNeuBkgParam2 * radius_rand * radius_rand
156  + ME0ModNeuBkgParam3 * radius_rand * radius_rand * radius_rand
157  + ME0ModNeuBkgParam4 * radius_rand * radius_rand * radius_rand * radius_rand
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;
160 
161  const double averageNoiseNeutral(aveNeutrRateBotRoll * nBxing * bxwidth_ * trArea * 1.0e-9);
162  const int n_hits(CLHEP::RandPoissonQ::shoot(engine, averageNoiseNeutral));
163 
164  for (int i = 0; i < n_hits; ++i)
165  {
166  //calculate xx_rand at a given yy_rand
167  float myRandX = CLHEP::RandFlat::shoot(engine);
168  float xx_rand = 2 * xMax * (myRandX - 0.5);
169 
170  float ex = sigma_u;
171  float ey = sigma_v;
172  float corr = 0.;
173 
174  GlobalPoint pointDigiHit = roll->toGlobal(LocalPoint(xx_rand, yy_rand));
175  //calc tof to the random estimated point
176  double stripRadius = sqrt(pointDigiHit.x() * pointDigiHit.x() + pointDigiHit.y() * pointDigiHit.y()
177  + pointDigiHit.z() * pointDigiHit.z());
178  double timeCalibrationOffset_ = (stripRadius * 1e+9) / (cspeed * 1e+2); //[ns]
179  float tof = CLHEP::RandGaussQ::shoot(engine, timeCalibrationOffset_, sigma_t);
180 
181  //distribute bkg between neutrons and gammas
182  float myrand = CLHEP::RandFlat::shoot(engine);
183  if (myrand <= 0.1)
184  pdgid = 2112; // neutrons
185  else
186  pdgid = 22;
187 
188  ME0DigiPreReco digi(xx_rand, yy_rand, ex, ey, corr, tof, pdgid);
189  digi_.insert(digi);
190  }
191 }
const ME0EtaPartitionSpecs * specs() const
int i
Definition: DBlmapReader.cc:9
dictionary parameters
Definition: Parameters.py:2
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:52
T y() const
Definition: PV3DBase.h:63
const ME0Specs & parameters() const
T sqrt(T t)
Definition: SSEVec.h:48
ME0DetId id() const
T z() const
Definition: PV3DBase.h:64
std::set< ME0DigiPreReco > digi_
const Topology & topology() const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
T x() const
Definition: PV3DBase.h:62
void ME0PreRecoGaussianModel::simulateSignal ( const ME0EtaPartition roll,
const edm::PSimHitContainer simHits,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

Implements ME0DigiPreRecoModel.

Definition at line 55 of file ME0PreRecoGaussianModel.cc.

References funct::abs(), averageEfficiency_, corr, ME0DigiPreRecoModel::digi_, digitizeOnlyMuons_, sigma_t, sigma_u, sigma_v, x, and y.

56 {
57 for (const auto & hit: simHits)
58 {
59  if (std::abs(hit.particleType()) != 13 && digitizeOnlyMuons_) continue;
60  // GEM efficiency
61  if (CLHEP::RandFlat::shoot(engine) > averageEfficiency_) continue;
62 
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);
66  float ex=sigma_u;
67  float ey=sigma_v;
68  float corr=0.;
69  float tof=CLHEP::RandGaussQ::shoot(engine, hit.timeOfFlight(), sigma_t);
70  int pdgid = hit.particleType();
71  // please keep hit time always 0 for this model
72  ME0DigiPreReco digi(x,y,ex,ey,corr,tof,pdgid);
73  digi_.insert(digi);
74 }
75 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::set< ME0DigiPreReco > digi_
tuple simHits
Definition: trackerHits.py:16

Member Data Documentation

double ME0PreRecoGaussianModel::averageEfficiency_
private

Definition at line 39 of file ME0PreRecoGaussianModel.h.

Referenced by simulateSignal().

double ME0PreRecoGaussianModel::averageNoiseRate_
private

Definition at line 44 of file ME0PreRecoGaussianModel.h.

int ME0PreRecoGaussianModel::bxwidth_
private

Definition at line 45 of file ME0PreRecoGaussianModel.h.

Referenced by simulateNoise().

bool ME0PreRecoGaussianModel::corr
private

Definition at line 36 of file ME0PreRecoGaussianModel.h.

Referenced by simulateNoise(), and simulateSignal().

bool ME0PreRecoGaussianModel::digitizeOnlyMuons_
private

Definition at line 38 of file ME0PreRecoGaussianModel.h.

Referenced by simulateSignal().

bool ME0PreRecoGaussianModel::doBkgNoise_
private

Definition at line 40 of file ME0PreRecoGaussianModel.h.

Referenced by simulateNoise().

bool ME0PreRecoGaussianModel::etaproj
private

Definition at line 37 of file ME0PreRecoGaussianModel.h.

int ME0PreRecoGaussianModel::maxBunch_
private

Definition at line 47 of file ME0PreRecoGaussianModel.h.

Referenced by simulateNoise().

double ME0PreRecoGaussianModel::ME0ModElecBkgParam0
private

Definition at line 58 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModElecBkgParam1
private

Definition at line 59 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModElecBkgParam2
private

Definition at line 60 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModElecBkgParam3
private

Definition at line 61 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModElecBkgParam4
private

Definition at line 62 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModElecBkgParam5
private

Definition at line 63 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModElecBkgParam6
private

Definition at line 64 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModElecBkgParam7
private

Definition at line 65 of file ME0PreRecoGaussianModel.h.

double ME0PreRecoGaussianModel::ME0ModNeuBkgParam0
private

Definition at line 50 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModNeuBkgParam1
private

Definition at line 51 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModNeuBkgParam2
private

Definition at line 52 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModNeuBkgParam3
private

Definition at line 53 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModNeuBkgParam4
private

Definition at line 54 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModNeuBkgParam5
private

Definition at line 55 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

double ME0PreRecoGaussianModel::ME0ModNeuBkgParam6
private

Definition at line 56 of file ME0PreRecoGaussianModel.h.

Referenced by ME0PreRecoGaussianModel(), and simulateNoise().

int ME0PreRecoGaussianModel::minBunch_
private

Definition at line 46 of file ME0PreRecoGaussianModel.h.

Referenced by simulateNoise().

double ME0PreRecoGaussianModel::sigma_t
private

Definition at line 33 of file ME0PreRecoGaussianModel.h.

Referenced by simulateNoise(), and simulateSignal().

double ME0PreRecoGaussianModel::sigma_u
private

Definition at line 34 of file ME0PreRecoGaussianModel.h.

Referenced by simulateNoise(), and simulateSignal().

double ME0PreRecoGaussianModel::sigma_v
private

Definition at line 35 of file ME0PreRecoGaussianModel.h.

Referenced by simulateNoise(), and simulateSignal().

bool ME0PreRecoGaussianModel::simulateElectronBkg_
private

Definition at line 42 of file ME0PreRecoGaussianModel.h.

Referenced by simulateNoise().

bool ME0PreRecoGaussianModel::simulateIntrinsicNoise_
private

Definition at line 41 of file ME0PreRecoGaussianModel.h.