35 #include "CLHEP/Random/RandFlat.h"
36 #include "CLHEP/Random/RandPoissonQ.h"
37 #include "CLHEP/Random/RandGaussQ.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");
56 do_Y =
config.getParameter<
bool>(
"do_Y_coordinate");
62 edm::LogInfo(
"RPC digitizer parameters") <<
"Average Cluster Size = " <<
aveCls <<
" strips";
63 edm::LogInfo(
"RPC digitizer parameters") <<
"RPC Time Resolution = " <<
resRPC <<
" ns";
64 edm::LogInfo(
"RPC digitizer parameters") <<
"RPC Signal formation time = " <<
timOff <<
" ns";
65 edm::LogInfo(
"RPC digitizer parameters") <<
"RPC adjacent strip delay = " <<
dtimCs <<
" ns";
67 edm::LogInfo(
"RPC digitizer parameters") <<
"Signal propagation time = " <<
sspeed <<
" x c";
68 edm::LogInfo(
"RPC digitizer parameters") <<
"Link Board Gate Width = " <<
lbGate <<
" ns";
78 CLHEP::HepRandomEngine* engine) {
89 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin(); _hit != rpcHits.end(); ++_hit) {
90 if (!
eledig && _hit->particleType() == 11)
98 float posX = roll->
strip(_hit->localPosition()) - static_cast<int>(roll->
strip(_hit->localPosition()));
100 std::vector<float> veff = (
getRPCSimSetUp())->getEff(rpcId.rawId());
103 int centralStrip =
topology.channel(entr) + 1;
105 float fire = CLHEP::RandFlat::shoot(engine);
107 float smearedPositionY = CLHEP::RandGaussQ::shoot(engine, _hit->localPosition().y(),
sigmaY);
109 if (fire < veff[centralStrip - 1]) {
110 int fstrip = centralStrip;
111 int lstrip = centralStrip;
115 std::vector<int> cls;
116 cls.push_back(centralStrip);
118 for (
int cl = 0;
cl < (clsize - 1) / 2;
cl++) {
119 if (centralStrip -
cl - 1 >= 1) {
120 fstrip = centralStrip -
cl - 1;
121 cls.push_back(fstrip);
123 if (centralStrip +
cl + 1 <= roll->
nstrips()) {
124 lstrip = centralStrip +
cl + 1;
125 cls.push_back(lstrip);
128 if (clsize % 2 == 0) {
133 if (lstrip < roll->nstrips()) {
135 cls.push_back(lstrip);
140 cls.push_back(fstrip);
149 for (std::vector<int>::iterator
i = cls.begin();
i != cls.end();
i++) {
150 std::pair<int, int> digi(*
i, time_hit);
156 adigi.
setY(smearedPositionY);
171 unsigned int nstrips = roll->
nstrips();
174 if (rpcId.
region() == 0) {
188 for (
unsigned int j = 0;
j < vnoise.size(); ++
j) {
194 CLHEP::RandPoissonQ randPoissonQ(*engine, ave);
195 N_hits = randPoissonQ.fire();
197 double precise_time = CLHEP::RandFlat::shoot(engine, (
nbxing *
gate) /
gate);
198 int time_hit = (static_cast<int>(precise_time)) -
nbxing / 2;
203 double positionY = CLHEP::RandFlat::shoot(engine, striplength);
204 positionY -= striplength / 2;
206 adigi.
setY(positionY);
226 double rr_cl = CLHEP::RandFlat::shoot(engine);
249 for (
int i = vectOffset;
i < (vectOffset + 20);
i++) {
264 int leftStrip =
strip - 1;
265 int rightStrip =
strip + 1;
269 if (rightStrip > roll.
nstrips())
272 double deltawL = fabs((roll.
centreOfStrip(leftStrip)).
x() - hit_pos.
x());
273 double deltawR = fabs((roll.
centreOfStrip(rightStrip)).
x() - hit_pos.
x());
275 if (deltawL >= deltawR) {