9 #include "CLHEP/Random/RandFlat.h" 10 #include "CLHEP/Random/RandPoissonQ.h" 13 aveEff =
config.getParameter<
double>(
"averageEfficiency");
14 aveCls =
config.getParameter<
double>(
"averageClusterSize");
17 dtimCs =
config.getParameter<
double>(
"deltatimeAdjacentStrip");
19 sspeed =
config.getParameter<
double>(
"signalPropagationSpeed");
29 std::cout <<
"Average Cluster Size = " <<
aveCls <<
" strips" << std::endl;
31 std::cout <<
"RPC Signal formation time = " <<
timOff <<
" ns" << std::endl;
32 std::cout <<
"RPC adjacent strip delay = " <<
dtimCs <<
" ns" << std::endl;
34 std::cout <<
"Signal propagation time = " <<
sspeed <<
" x c" << std::endl;
35 std::cout <<
"Link Board Gate Width = " <<
lbGate <<
" ns" << std::endl;
51 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin(); _hit != rpcHits.end(); ++_hit) {
57 float eff = CLHEP::RandFlat::shoot(engine);
59 int centralStrip =
topology.channel(entr) + 1;
60 int fstrip = centralStrip;
61 int lstrip = centralStrip;
63 double w = CLHEP::RandFlat::shoot(engine);
66 int clsize =
static_cast<int>(-1. *
aveCls *
log(
w) + 1.);
68 cls.push_back(centralStrip);
70 for (
int cl = 0;
cl < (clsize - 1) / 2;
cl++)
71 if (centralStrip -
cl - 1 >= 1) {
72 fstrip = centralStrip -
cl - 1;
73 cls.push_back(fstrip);
75 for (
int cl = 0;
cl < (clsize - 1) / 2;
cl++)
76 if (centralStrip +
cl + 1 <=
roll->nstrips()) {
77 lstrip = centralStrip +
cl + 1;
78 cls.push_back(lstrip);
80 if (clsize % 2 == 0) {
83 double deltaw =
roll->centreOfStrip(centralStrip).x() - entr.
x();
85 if (lstrip < roll->nstrips()) {
87 cls.push_back(lstrip);
92 cls.push_back(fstrip);
98 for (std::vector<int>::iterator
i = cls.begin();
i != cls.end();
i++) {
100 std::pair<unsigned int, int> digi(*
i, time_hit);
111 int nstrips =
roll->nstrips();
114 if (rpcId.
region() == 0) {
130 CLHEP::RandPoissonQ randPoissonQ(*engine, ave);
131 N_hits = randPoissonQ.fire();
134 int strip =
static_cast<int>(CLHEP::RandFlat::shoot(engine, 1, nstrips));
136 time_hit = (
static_cast<int>(CLHEP::RandFlat::shoot(engine, (
nbxing *
gate) /
gate))) -
nbxing / 2;
137 std::pair<int, int> digi(
strip, time_hit);
LocalPoint localPosition(float strip) const override
DetectorHitMap theDetectorHitMap
void setRPCSimSetUp(RPCSimSetUp *simsetup)
RPCSimSetUp * getRPCSimSetUp()
int getSimHitBx(const PSimHit *, CLHEP::HepRandomEngine *)
float stripLength() const override
edm::DetSet< RPCDigiSimLink > RPCDigiSimLinks
Container::value_type value_type
std::set< std::pair< int, int > > strips
void simulateNoise(const RPCRoll *, CLHEP::HepRandomEngine *) override
void simulate(const RPCRoll *roll, const edm::PSimHitContainer &rpcHits, CLHEP::HepRandomEngine *) override
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
std::vector< PSimHit > PSimHitContainer
RPCSynchronizer * _rpcSync
float stripLength() const override
det heigth (strip length in the middle)
RPCSimParam(const edm::ParameterSet &config)
RPCDigiSimLinks theRpcDigiSimLinks
LocalPoint localPosition(float strip) const override