96 if (me0Id.region() == 0) {
throw cms::Exception(
"Geometry") <<
"Asking TrapezoidalStripTopology from a ME0 will fail"; }
100 double bottomLength(
parameters[0]); bottomLength = 2*bottomLength;
101 double topLength(
parameters[1]); topLength = 2*topLength;
102 double height(
parameters[2]); height = 2*height;
103 double myTanPhi = (topLength - bottomLength) / (height * 2);
104 double rollRadius = top_->radius();
105 trArea = height * (topLength + bottomLength) / 2.0;
110 int heightbins = height/heightIt;
112 edm::LogVerbatim(
"ME0PreRecoGaussianModelNoise") <<
"[ME0PreRecoDigi :: sNoise]["<<roll->
id().
rawId()<<
"] :: roll with id = "<<roll->
id();
113 edm::LogVerbatim(
"ME0PreRecoGaussianModelNoise") <<
"[ME0PreRecoDigi :: sNoise]["<<roll->
id().
rawId()<<
"] :: extracting parameters from the TrapezoidalStripTopology";
114 edm::LogVerbatim(
"ME0PreRecoGaussianModelNoise") <<
"[ME0PreRecoDigi :: sNoise]["<<roll->
id().
rawId()<<
"] :: bottom = "<<bottomLength<<
" [cm] top = "<<topLength<<
" [cm] height = "<<height<<
" [cm]"
115 <<
" area = "<<trArea<<
" [cm^2] Rmid = "<<rollRadius<<
" [cm] => Rmin = "<<rollRadius-height*1.0/2.0<<
" [cm] Rmax = "<<rollRadius+height*1.0/2.0<<
" [cm]";
116 edm::LogVerbatim(
"ME0PreRecoGaussianModelNoise") <<
"[ME0PreRecoDigi :: sNoise]["<<roll->
id().
rawId()<<
"] :: heightbins = "<<heightbins;
118 for(
int hx=0; hx<heightbins; ++hx) {
119 double bottomIt = bottomLength + hx *2*
tan(10./180*3.14)*heightIt;
120 double topIt = bottomLength + (hx+1)*2*
tan(10./180*3.14)*heightIt;
121 if(hx==heightbins-1) {
123 heightIt = height-hx*heightIt;
125 double areaIt = heightIt*(bottomIt+topIt)*1.0/2;
127 edm::LogVerbatim(
"ME0PreRecoGaussianModelNoise") <<
"[ME0PreRecoDigi :: sNoise]["<<roll->
id().
rawId()<<
"] :: height = "<<std::setw(12)<<heightIt<<
" [cm] bottom = "<<std::setw(12)<<bottomIt<<
" [cm]"
128 <<
" top = "<<std::setw(12)<<topIt<<
" [cm] area = "<<std::setw(12)<<areaIt<<
" [cm^2] || sin(10) = "<<
sin(10./180*3.14);
130 double myRandY = CLHEP::RandFlat::shoot(engine);
131 double y0_rand = (hx+myRandY)*heightIt;
132 double yy_rand = (y0_rand-height*1.0/2);
133 double yy_glob = rollRadius + yy_rand;
135 double xMax = topLength/2.0 - (height/2.0 - yy_rand) * myTanPhi;
151 double averageElectronRatePerRoll = 0.0;
152 double yy_helper = 1.0;
153 for(
int j=0;
j<7; ++
j) { averageElectronRatePerRoll +=
eleBkg[
j]*yy_helper; yy_helper *= yy_glob; }
159 <<
" evaluation of Background Hit Rate at this coord :: "<<std::setw(12)<<averageElectronRatePerRoll<<
" [Hz/cm^2]"
160 <<
" x 9 x 25*10^-9 [s] x Area (of strip = "<<std::setw(12)<<areaIt<<
" [cm^2]) ==> "<<std::setw(12)<<averageElecRate<<
" [hits]";
162 bool ele_eff = (CLHEP::RandFlat::shoot(engine)<averageElecRate)?1:0;
164 edm::LogVerbatim(
"ME0PreRecoGaussianModelNoise") <<
"[ME0PreRecoDigi :: elebkg]["<<roll->
id().
rawId()<<
"] :: myRandY = "<<std::setw(12)<<myRandY<<
" => local y = "<<std::setw(12)<<yy_rand<<
" [cm]"
165 <<
" => global y (global R) = "<<std::setw(12)<<yy_glob<<
" [cm] || Probability = "<<std::setw(12)<<averageElecRate
166 <<
" => efficient? "<<ele_eff<<std::endl;
170 double myRandX = CLHEP::RandFlat::shoot(engine);
171 double xx_rand = 2 * xMax * (myRandX - 0.5);
176 double myrandBX = CLHEP::RandFlat::shoot(engine);
179 double myrandT = CLHEP::RandFlat::shoot(engine);
180 double minBXtime = (bx-0.5)*
bxwidth;
181 double time = myrandT*
bxwidth+minBXtime;
182 double myrandP = CLHEP::RandFlat::shoot(engine);
184 if (myrandP <= 0.5) pdgid = -11;
188 edm::LogVerbatim(
"ME0PreRecoGaussianModelNoise") <<
"[ME0PreRecoDigi :: elebkg]["<<roll->
id().
rawId()<<
"] =====> electron hit in "<<roll->
id()<<
" pdgid = "<<pdgid<<
" bx = "<<bx
190 <<
" at loc x = "<<xx_rand<<
" loc y = "<<yy_rand<<
" time = "<<time<<
" [ns]";
199 double averageNeutralRatePerRoll = 0.0;
200 double yy_helper = 1.0;
201 for(
int j=0;
j<7; ++
j) { averageNeutralRatePerRoll +=
neuBkg[
j]*yy_helper; yy_helper *= yy_glob; }
207 <<
" evaluation of Background Hit Rate at this coord :: "<<std::setw(12)<<averageNeutralRatePerRoll<<
" [Hz/cm^2]"
208 <<
" x 9 x 25*10^-9 [s] x Area (of strip = "<<std::setw(12)<<areaIt<<
" [cm^2]) ==> "<<std::setw(12)<<averageNeutrRate<<
" [hits]";
210 bool neu_eff = (CLHEP::RandFlat::shoot(engine)<averageNeutrRate)?1:0;
212 edm::LogVerbatim(
"ME0PreRecoGaussianModelNoise") <<
"[ME0PreRecoDigi :: neubkg]["<<roll->
id().
rawId()<<
"] :: myRandY = "<<std::setw(12)<<myRandY<<
" => local y = "<<std::setw(12)<<yy_rand<<
" [cm]"
213 <<
" => global y (global R) = "<<std::setw(12)<<yy_glob<<
" [cm] || Probability = "<<std::setw(12)<<averageNeutrRate
214 <<
" => efficient? "<<neu_eff<<std::endl;
218 double myRandX = CLHEP::RandFlat::shoot(engine);
219 double xx_rand = 2 * xMax * (myRandX - 0.5);
224 double myrandBX= CLHEP::RandFlat::shoot(engine);
227 double myrandT = CLHEP::RandFlat::shoot(engine);
228 double minBXtime = (bx-0.5)*
bxwidth;
229 double time = myrandT*
bxwidth+minBXtime;
231 double myrandP = CLHEP::RandFlat::shoot(engine);
232 if (myrandP <= 0.08) pdgid = 2112;
236 edm::LogVerbatim(
"ME0PreRecoGaussianModelNoise") <<
"[ME0PreRecoDigi :: neubkg]["<<roll->
id().
rawId()<<
"] ======> neutral hit in "<<roll->
id()<<
" pdgid = "<<pdgid<<
" bx = "<<bx
238 <<
" at loc x = "<<xx_rand<<
" loc y = "<<yy_rand<<
" time = "<<time<<
" [ns]";
const ME0EtaPartitionSpecs * specs() const
std::vector< double > neuBkg
Sin< T >::type sin(const T &t)
const ME0Specs & parameters() const
uint32_t rawId() const
get the raw id
Tan< T >::type tan(const T &t)
std::set< ME0DigiPreReco > digi_
const Topology & topology() const
std::vector< double > eleBkg
bool simulateElectronBkg_