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");
54 std::cout <<
"Average Cluster Size = " <<
aveCls <<
" strips" << std::endl;
56 std::cout <<
"RPC Signal formation time = " <<
timOff <<
" ns" << std::endl;
57 std::cout <<
"RPC adjacent strip delay = " <<
dtimCs <<
" ns" << std::endl;
59 std::cout <<
"Signal propagation time = " <<
sspeed <<
" x c" << std::endl;
60 std::cout <<
"Link Board Gate Width = " <<
lbGate <<
" ns" << std::endl;
76 double rr_cl = CLHEP::RandFlat::shoot(engine);
100 if (
func > (*iter)) {
102 }
else if (
func < (*iter)) {
111 CLHEP::HepRandomEngine* engine) {
119 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin(); _hit != rpcHits.end(); ++_hit) {
123 float posX =
roll->strip(_hit->localPosition()) - static_cast<int>(
roll->strip(_hit->localPosition()));
127 if (CLHEP::RandFlat::shoot(engine) <
aveEff) {
128 int centralStrip = topology.channel(entr) + 1;
129 int fstrip = centralStrip;
130 int lstrip = centralStrip;
134 int clsize = this->
getClSize(posX, engine);
136 std::vector<int> cls;
137 cls.push_back(centralStrip);
139 for (
int cl = 0;
cl < (clsize - 1) / 2;
cl++) {
140 if (centralStrip -
cl - 1 >= 1) {
141 fstrip = centralStrip -
cl - 1;
142 cls.push_back(fstrip);
144 if (centralStrip +
cl + 1 <=
roll->nstrips()) {
145 lstrip = centralStrip +
cl + 1;
146 cls.push_back(lstrip);
149 if (clsize % 2 == 0) {
152 double deltaw =
roll->centreOfStrip(centralStrip).x() - entr.
x();
154 if (lstrip < roll->nstrips()) {
156 cls.push_back(lstrip);
161 cls.push_back(fstrip);
167 for (std::vector<int>::iterator
i = cls.begin();
i != cls.end();
i++) {
169 std::pair<int, int> digi(*
i, time_hit);
181 unsigned int nstrips =
roll->nstrips();
185 if (rpcId.
region() == 0) {
198 for (
unsigned int j = 0;
j < vnoise.size(); ++
j) {
203 CLHEP::RandPoissonQ randPoissonQ(*engine, ave);
204 N_hits = randPoissonQ.fire();
207 int time_hit = (
static_cast<int>(CLHEP::RandFlat::shoot(engine, (
nbxing *
gate) /
gate))) -
nbxing / 2;
208 std::pair<int, int> digi(
j + 1, time_hit);
LocalPoint localPosition(float strip) const override
DetectorHitMap theDetectorHitMap
void setRPCSimSetUp(RPCSimSetUp *simsetup)
RPCSimSetUp * getRPCSimSetUp()
std::map< int, std::vector< double > > clsMap
int getSimHitBx(const PSimHit *, CLHEP::HepRandomEngine *)
int getClSize(float posX, 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
const std::map< int, std::vector< double > > & getClsMap()
void simulate(const RPCRoll *roll, const edm::PSimHitContainer &rpcHits, CLHEP::HepRandomEngine *) override
RPCSimAverageNoise(const edm::ParameterSet &config)
~RPCSimAverageNoise() override
constexpr uint32_t rawId() const
get the raw id
RPCSynchronizer * _rpcSync
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
std::vector< PSimHit > PSimHitContainer
float stripLength() const override
det heigth (strip length in the middle)
RPCDigiSimLinks theRpcDigiSimLinks
LocalPoint localPosition(float strip) const override
std::vector< double > sum_clsize