36 #include "CLHEP/Random/RandFlat.h"
37 #include "CLHEP/Random/RandPoissonQ.h"
42 aveEff =
config.getParameter<
double>(
"averageEfficiency");
43 aveCls =
config.getParameter<
double>(
"averageClusterSize");
46 dtimCs =
config.getParameter<
double>(
"deltatimeAdjacentStrip");
48 sspeed =
config.getParameter<
double>(
"signalPropagationSpeed");
59 std::cout <<
"Average Cluster Size = " <<
aveCls <<
" strips" << std::endl;
61 std::cout <<
"RPC Signal formation time = " <<
timOff <<
" ns" << std::endl;
62 std::cout <<
"RPC adjacent strip delay = " <<
dtimCs <<
" ns" << std::endl;
64 std::cout <<
"Signal propagation time = " <<
sspeed <<
" x c" << std::endl;
65 std::cout <<
"Link Board Gate Width = " <<
lbGate <<
" ns" << std::endl;
81 double rr_cl = CLHEP::RandFlat::shoot(engine);
105 if (
func > (*iter)) {
107 }
else if (
func < (*iter)) {
116 CLHEP::HepRandomEngine* engine) {
128 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin(); _hit != rpcHits.end(); ++_hit) {
129 if (_hit->particleType() == 11)
136 float posX = roll->
strip(_hit->localPosition()) - static_cast<int>(roll->
strip(_hit->localPosition()));
138 std::vector<float> veff = (
getRPCSimSetUp())->getEff(rpcId.rawId());
141 int centralStrip =
topology.channel(entr) + 1;
143 float fire = CLHEP::RandFlat::shoot(engine);
145 if (fire < veff[centralStrip - 1]) {
146 int fstrip = centralStrip;
147 int lstrip = centralStrip;
152 int clsize = this->
getClSize(posX, engine);
154 std::vector<int> cls;
155 cls.push_back(centralStrip);
157 for (
int cl = 0;
cl < (clsize - 1) / 2;
cl++) {
158 if (centralStrip -
cl - 1 >= 1) {
159 fstrip = centralStrip -
cl - 1;
160 cls.push_back(fstrip);
162 if (centralStrip +
cl + 1 <= roll->
nstrips()) {
163 lstrip = centralStrip +
cl + 1;
164 cls.push_back(lstrip);
167 if (clsize % 2 == 0) {
172 if (lstrip < roll->nstrips()) {
174 cls.push_back(lstrip);
179 cls.push_back(fstrip);
185 for (std::vector<int>::iterator
i = cls.begin();
i != cls.end();
i++) {
187 if (*
i != centralStrip) {
188 if (CLHEP::RandFlat::shoot(engine) < veff[*
i - 1]) {
189 std::pair<int, int> digi(*
i, time_hit);
195 std::pair<int, int> digi(*
i, time_hit);
214 unsigned int nstrips = roll->
nstrips();
217 if (rpcId.
region() == 0) {
231 for (
unsigned int j = 0;
j < vnoise.size(); ++
j) {
245 CLHEP::RandPoissonQ randPoissonQ(*engine, ave);
246 N_hits = randPoissonQ.fire();
249 int time_hit = (static_cast<int>(CLHEP::RandFlat::shoot(engine, (
nbxing *
gate) /
gate))) -
nbxing / 2;
250 std::pair<int, int> digi(
j + 1, time_hit);