35 #include "CLHEP/Random/RandFlat.h"
36 #include "CLHEP/Random/RandPoissonQ.h"
43 aveEff =
config.getParameter<
double>(
"averageEfficiency");
44 aveCls =
config.getParameter<
double>(
"averageClusterSize");
47 dtimCs =
config.getParameter<
double>(
"deltatimeAdjacentStrip");
49 sspeed =
config.getParameter<
double>(
"signalPropagationSpeed");
61 <<
"Average Cluster Size = " <<
aveCls <<
" strips" <<
'\n'
62 <<
"RPC Time Resolution = " <<
resRPC <<
" ns" <<
'\n'
63 <<
"RPC Signal formation time = " <<
timOff <<
" ns" <<
'\n'
64 <<
"RPC adjacent strip delay = " <<
dtimCs <<
" ns" <<
'\n'
65 <<
"Electronic Jitter = " <<
resEle <<
" ns" <<
'\n'
66 <<
"Signal propagation time = " <<
sspeed <<
" x c" <<
'\n'
67 <<
"Link Board Gate Width = " <<
lbGate <<
" ns" <<
'\n';
87 double rr_cl = CLHEP::RandFlat::shoot(engine);
110 for (
int i = vectOffset;
i < (vectOffset + 20);
i++) {
129 double rr_cl = CLHEP::RandFlat::shoot(engine);
153 if (
func > (*iter)) {
155 }
else if (
func < (*iter)) {
164 CLHEP::HepRandomEngine* engine) {
176 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin(); _hit != rpcHits.end(); ++_hit) {
177 if (!
eledig && _hit->particleType() == 11)
183 float posX = roll->
strip(_hit->localPosition()) - static_cast<int>(roll->
strip(_hit->localPosition()));
185 std::vector<float> veff = (
getRPCSimSetUp())->getEff(rpcId.rawId());
188 int centralStrip =
topology.channel(entr) + 1;
190 float fire = CLHEP::RandFlat::shoot(engine);
192 if (fire < veff[centralStrip - 1]) {
193 int fstrip = centralStrip;
194 int lstrip = centralStrip;
198 std::vector<int> cls;
199 cls.push_back(centralStrip);
201 for (
int cl = 0;
cl < (clsize - 1) / 2;
cl++) {
202 if (centralStrip -
cl - 1 >= 1) {
203 fstrip = centralStrip -
cl - 1;
204 cls.push_back(fstrip);
206 if (centralStrip +
cl + 1 <= roll->
nstrips()) {
207 lstrip = centralStrip +
cl + 1;
208 cls.push_back(lstrip);
211 if (clsize % 2 == 0) {
216 if (lstrip < roll->nstrips()) {
218 cls.push_back(lstrip);
223 cls.push_back(fstrip);
229 for (std::vector<int>::iterator
i = cls.begin();
i != cls.end();
i++) {
231 if (*
i != centralStrip) {
232 if (CLHEP::RandFlat::shoot(engine) < veff[*
i - 1]) {
233 std::pair<int, int> digi(*
i, time_hit);
239 std::pair<int, int> digi(*
i, time_hit);
257 unsigned int nstrips = roll->
nstrips();
260 if (rpcId.
region() == 0) {
274 for (
unsigned int j = 0;
j < vnoise.size(); ++
j) {
288 CLHEP::RandPoissonQ randPoissonQ(*engine, ave);
289 N_hits = randPoissonQ.fire();
292 int time_hit = (static_cast<int>(CLHEP::RandFlat::shoot(engine, (
nbxing *
gate) /
gate))) -
nbxing / 2;
293 std::pair<int, int> digi(
j + 1, time_hit);