32 #include "CLHEP/Random/RandFlat.h" 33 #include "CLHEP/Random/RandPoissonQ.h" 38 aveEff =
config.getParameter<
double>(
"averageEfficiency");
39 aveCls =
config.getParameter<
double>(
"averageClusterSize");
42 dtimCs =
config.getParameter<
double>(
"deltatimeAdjacentStrip");
44 sspeed =
config.getParameter<
double>(
"signalPropagationSpeed");
53 std::cout <<
"Average Cluster Size = " <<
aveCls <<
" strips" << std::endl;
55 std::cout <<
"RPC Signal formation time = " <<
timOff <<
" ns" << std::endl;
56 std::cout <<
"RPC adjacent strip delay = " <<
dtimCs <<
" ns" << std::endl;
58 std::cout <<
"Signal propagation time = " <<
sspeed <<
" x c" << std::endl;
59 std::cout <<
"Link Board Gate Width = " <<
lbGate <<
" ns" << std::endl;
75 double rr_cl = CLHEP::RandFlat::shoot(engine);
101 }
else if (
func < (*iter)) {
110 CLHEP::HepRandomEngine* engine) {
118 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin(); _hit != rpcHits.end(); ++_hit) {
124 float posX =
roll->strip(_hit->localPosition()) - static_cast<int>(
roll->strip(_hit->localPosition()));
129 if (CLHEP::RandFlat::shoot(engine) <
aveEff) {
130 int centralStrip =
topology.channel(entr) + 1;
131 int fstrip = centralStrip;
132 int lstrip = centralStrip;
136 int clsize = this->
getClSize(posX, engine);
138 std::vector<int> cls;
139 cls.push_back(centralStrip);
141 for (
int cl = 0;
cl < (clsize - 1) / 2;
cl++)
142 if (centralStrip -
cl - 1 >= 1) {
143 fstrip = centralStrip -
cl - 1;
144 cls.push_back(fstrip);
146 for (
int cl = 0;
cl < (clsize - 1) / 2;
cl++)
147 if (centralStrip +
cl + 1 <=
roll->nstrips()) {
148 lstrip = centralStrip +
cl + 1;
149 cls.push_back(lstrip);
151 if (clsize % 2 == 0) {
154 double deltaw =
roll->centreOfStrip(centralStrip).x() - entr.
x();
156 if (lstrip < roll->nstrips()) {
158 cls.push_back(lstrip);
163 cls.push_back(fstrip);
169 for (std::vector<int>::iterator
i = cls.begin();
i != cls.end();
i++) {
171 std::pair<int, int> digi(*
i, time_hit);
181 int nstrips =
roll->nstrips();
184 if (rpcId.
region() == 0) {
200 CLHEP::RandPoissonQ randPoissonQ(*engine, ave);
201 N_hits = randPoissonQ.fire();
204 int strip =
static_cast<int>(CLHEP::RandFlat::shoot(engine, 1, nstrips));
206 time_hit = (
static_cast<int>(CLHEP::RandFlat::shoot(engine, (
nbxing *
gate) /
gate))) -
nbxing / 2;
207 std::pair<int, int> digi(
strip, time_hit);
std::vector< double > sum_clsize
void simulateNoise(const RPCRoll *, CLHEP::HepRandomEngine *) override
LocalPoint localPosition(float strip) const override
int getClSize(float posX, CLHEP::HepRandomEngine *)
DetectorHitMap theDetectorHitMap
void setRPCSimSetUp(RPCSimSetUp *simsetup)
RPCSimSetUp * getRPCSimSetUp()
void simulate(const RPCRoll *roll, const edm::PSimHitContainer &rpcHits, CLHEP::HepRandomEngine *) override
~RPCSimAverage() override
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
std::map< int, std::vector< double > > clsMap
const std::map< int, std::vector< double > > & getClsMap()
RPCSynchronizer * _rpcSync
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
RPCSimAverage(const edm::ParameterSet &config)
std::vector< PSimHit > PSimHitContainer
float stripLength() const override
det heigth (strip length in the middle)
RPCDigiSimLinks theRpcDigiSimLinks
LocalPoint localPosition(float strip) const override