33 #include "CLHEP/Random/RandFlat.h"
34 #include "CLHEP/Random/RandPoissonQ.h"
39 aveEff =
config.getParameter<
double>(
"averageEfficiency");
40 aveCls =
config.getParameter<
double>(
"averageClusterSize");
43 dtimCs =
config.getParameter<
double>(
"deltatimeAdjacentStrip");
45 sspeed =
config.getParameter<
double>(
"signalPropagationSpeed");
54 std::cout <<
"Average Cluster Size = " <<
aveCls <<
" strips" << std::endl;
56 std::cout <<
"RPC Signal formation time = " <<
timOff <<
" ns" << std::endl;
57 std::cout <<
"RPC adjacent strip delay = " <<
dtimCs <<
" ns" << std::endl;
59 std::cout <<
"Signal propagation time = " <<
sspeed <<
" x c" << std::endl;
60 std::cout <<
"Link Board Gate Width = " <<
lbGate <<
" ns" << std::endl;
76 double rr_cl = CLHEP::RandFlat::shoot(engine);
100 if (
func > (*iter)) {
102 }
else if (
func < (*iter)) {
111 CLHEP::HepRandomEngine* engine) {
119 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin(); _hit != rpcHits.end(); ++_hit) {
125 float posX = roll->
strip(_hit->localPosition()) - static_cast<int>(roll->
strip(_hit->localPosition()));
130 if (CLHEP::RandFlat::shoot(engine) <
aveEff) {
131 int centralStrip =
topology.channel(entr) + 1;
132 int fstrip = centralStrip;
133 int lstrip = centralStrip;
137 int clsize = this->
getClSize(posX, engine);
139 std::vector<int> cls;
140 cls.push_back(centralStrip);
142 for (
int cl = 0;
cl < (clsize - 1) / 2;
cl++)
143 if (centralStrip -
cl - 1 >= 1) {
144 fstrip = centralStrip -
cl - 1;
145 cls.push_back(fstrip);
147 for (
int cl = 0;
cl < (clsize - 1) / 2;
cl++)
148 if (centralStrip +
cl + 1 <= roll->
nstrips()) {
149 lstrip = centralStrip +
cl + 1;
150 cls.push_back(lstrip);
152 if (clsize % 2 == 0) {
157 if (lstrip < roll->nstrips()) {
159 cls.push_back(lstrip);
164 cls.push_back(fstrip);
170 for (std::vector<int>::iterator
i = cls.begin();
i != cls.end();
i++) {
172 std::pair<int, int> digi(*
i, time_hit);
185 if (rpcId.
region() == 0) {
201 CLHEP::RandPoissonQ randPoissonQ(*engine, ave);
202 N_hits = randPoissonQ.fire();
205 int strip = static_cast<int>(CLHEP::RandFlat::shoot(engine, 1, nstrips));
207 time_hit = (static_cast<int>(CLHEP::RandFlat::shoot(engine, (
nbxing *
gate) /
gate))) -
nbxing / 2;
208 std::pair<int, int> digi(
strip, time_hit);