36 #include "CLHEP/Random/RandFlat.h"
37 #include "CLHEP/Random/RandPoissonQ.h"
38 #include "CLHEP/Random/RandGaussQ.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");
57 do_Y =
config.getParameter<
bool>(
"do_Y_coordinate");
63 edm::LogInfo(
"RPC digitizer parameters") <<
"Average Cluster Size = " <<
aveCls <<
" strips";
64 edm::LogInfo(
"RPC digitizer parameters") <<
"RPC Time Resolution = " <<
resRPC <<
" ns";
65 edm::LogInfo(
"RPC digitizer parameters") <<
"RPC Signal formation time = " <<
timOff <<
" ns";
66 edm::LogInfo(
"RPC digitizer parameters") <<
"RPC adjacent strip delay = " <<
dtimCs <<
" ns";
68 edm::LogInfo(
"RPC digitizer parameters") <<
"Signal propagation time = " <<
sspeed <<
" x c";
69 edm::LogInfo(
"RPC digitizer parameters") <<
"Link Board Gate Width = " <<
lbGate <<
" ns";
79 CLHEP::HepRandomEngine* engine) {
90 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin(); _hit != rpcHits.end(); ++_hit) {
91 if (!
eledig && _hit->particleType() == 11)
99 float posX = roll->
strip(_hit->localPosition()) - static_cast<int>(roll->
strip(_hit->localPosition()));
101 std::vector<float> veff = (
getRPCSimSetUp())->getEff(rpcId.rawId());
104 int centralStrip =
topology.channel(entr) + 1;
106 float fire = CLHEP::RandFlat::shoot(engine);
108 float smearedPositionY = CLHEP::RandGaussQ::shoot(engine, _hit->localPosition().y(),
sigmaY);
110 if (fire < veff[centralStrip - 1]) {
111 int fstrip = centralStrip;
112 int lstrip = centralStrip;
116 std::vector<int> cls;
117 cls.push_back(centralStrip);
119 for (
int cl = 0;
cl < (clsize - 1) / 2;
cl++) {
120 if (centralStrip -
cl - 1 >= 1) {
121 fstrip = centralStrip -
cl - 1;
122 cls.push_back(fstrip);
124 if (centralStrip +
cl + 1 <= roll->
nstrips()) {
125 lstrip = centralStrip +
cl + 1;
126 cls.push_back(lstrip);
129 if (clsize % 2 == 0) {
134 if (lstrip < roll->nstrips()) {
136 cls.push_back(lstrip);
141 cls.push_back(fstrip);
150 for (std::vector<int>::iterator
i = cls.begin();
i != cls.end();
i++) {
151 std::pair<int, int> digi(*
i, time_hit);
157 adigi.
setY(smearedPositionY);
172 unsigned int nstrips = roll->
nstrips();
175 if (rpcId.
region() == 0) {
189 for (
unsigned int j = 0;
j < vnoise.size(); ++
j) {
195 CLHEP::RandPoissonQ randPoissonQ(*engine, ave);
196 N_hits = randPoissonQ.fire();
198 double precise_time = CLHEP::RandFlat::shoot(engine, (
nbxing *
gate) /
gate);
199 int time_hit = (static_cast<int>(precise_time)) -
nbxing / 2;
204 double positionY = CLHEP::RandFlat::shoot(engine, striplength);
205 positionY -= striplength / 2;
207 adigi.
setY(positionY);
227 double rr_cl = CLHEP::RandFlat::shoot(engine);
250 for (
int i = vectOffset;
i < (vectOffset + 20);
i++) {
265 int leftStrip =
strip - 1;
266 int rightStrip =
strip + 1;
270 if (rightStrip > roll.
nstrips())
273 double deltawL = fabs((roll.
centreOfStrip(leftStrip)).
x() - hit_pos.
x());
274 double deltawR = fabs((roll.
centreOfStrip(rightStrip)).
x() - hit_pos.
x());
276 if (deltawL >= deltawR) {