36 #include "CLHEP/Random/RandFlat.h"
37 #include "CLHEP/Random/RandPoissonQ.h"
44 aveEff =
config.getParameter<
double>(
"averageEfficiency");
45 aveCls =
config.getParameter<
double>(
"averageClusterSize");
48 dtimCs =
config.getParameter<
double>(
"deltatimeAdjacentStrip");
50 sspeed =
config.getParameter<
double>(
"signalPropagationSpeed");
62 <<
"Average Cluster Size = " <<
aveCls <<
" strips" <<
'\n'
63 <<
"RPC Time Resolution = " <<
resRPC <<
" ns" <<
'\n'
64 <<
"RPC Signal formation time = " <<
timOff <<
" ns" <<
'\n'
65 <<
"RPC adjacent strip delay = " <<
dtimCs <<
" ns" <<
'\n'
66 <<
"Electronic Jitter = " <<
resEle <<
" ns" <<
'\n'
67 <<
"Signal propagation time = " <<
sspeed <<
" x c" <<
'\n'
68 <<
"Link Board Gate Width = " <<
lbGate <<
" ns" <<
'\n';
88 double rr_cl = CLHEP::RandFlat::shoot(engine);
111 for (
int i = vectOffset;
i < (vectOffset + 20);
i++) {
130 double rr_cl = CLHEP::RandFlat::shoot(engine);
154 if (
func > (*iter)) {
156 }
else if (
func < (*iter)) {
165 CLHEP::HepRandomEngine* engine) {
177 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin(); _hit != rpcHits.end(); ++_hit) {
178 if (!
eledig && _hit->particleType() == 11)
184 float posX = roll->
strip(_hit->localPosition()) - static_cast<int>(roll->
strip(_hit->localPosition()));
186 std::vector<float> veff = (
getRPCSimSetUp())->getEff(rpcId.rawId());
189 int centralStrip =
topology.channel(entr) + 1;
191 float fire = CLHEP::RandFlat::shoot(engine);
193 if (fire < veff[centralStrip - 1]) {
194 int fstrip = centralStrip;
195 int lstrip = centralStrip;
199 std::vector<int> cls;
200 cls.push_back(centralStrip);
202 for (
int cl = 0;
cl < (clsize - 1) / 2;
cl++) {
203 if (centralStrip -
cl - 1 >= 1) {
204 fstrip = centralStrip -
cl - 1;
205 cls.push_back(fstrip);
207 if (centralStrip +
cl + 1 <= roll->
nstrips()) {
208 lstrip = centralStrip +
cl + 1;
209 cls.push_back(lstrip);
212 if (clsize % 2 == 0) {
217 if (lstrip < roll->nstrips()) {
219 cls.push_back(lstrip);
224 cls.push_back(fstrip);
230 for (std::vector<int>::iterator
i = cls.begin();
i != cls.end();
i++) {
232 if (*
i != centralStrip) {
233 if (CLHEP::RandFlat::shoot(engine) < veff[*
i - 1]) {
234 std::pair<int, int> digi(*
i, time_hit);
240 std::pair<int, int> digi(*
i, time_hit);
258 unsigned int nstrips = roll->
nstrips();
261 if (rpcId.
region() == 0) {
275 for (
unsigned int j = 0;
j < vnoise.size(); ++
j) {
289 CLHEP::RandPoissonQ randPoissonQ(*engine, ave);
290 N_hits = randPoissonQ.fire();
293 int time_hit = (static_cast<int>(CLHEP::RandFlat::shoot(engine, (
nbxing *
gate) /
gate))) -
nbxing / 2;
294 std::pair<int, int> digi(
j + 1, time_hit);