9 #include "CLHEP/Random/RandFlat.h" 10 #include "CLHEP/Random/RandPoissonQ.h" 29 std::cout <<
"Average Cluster Size = "<<aveCls<<
" strips"<<std::endl;
30 std::cout <<
"RPC Time Resolution = "<<resRPC<<
" ns"<<std::endl;
31 std::cout <<
"RPC Signal formation time = "<<timOff<<
" ns"<<std::endl;
32 std::cout <<
"RPC adjacent strip delay = "<<dtimCs<<
" ns"<<std::endl;
33 std::cout <<
"Electronic Jitter = "<<resEle<<
" 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;
49 CLHEP::HepRandomEngine* engine)
58 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin();
59 _hit != rpcHits.end(); ++_hit){
66 float eff = CLHEP::RandFlat::shoot(engine);
69 int centralStrip = topology.channel(entr)+1;
70 int fstrip=centralStrip;
71 int lstrip=centralStrip;
73 double w = CLHEP::RandFlat::shoot(engine);
74 if (w < 1.
e-10) w=1.e-10;
75 int clsize =
static_cast<int>( -1.*
aveCls*
log(w)+1.);
77 cls.push_back(centralStrip);
79 for (
int cl = 0;
cl < (clsize-1)/2;
cl++)
80 if (centralStrip -
cl -1 >= 1 ){
81 fstrip = centralStrip-
cl-1;
82 cls.push_back(fstrip);
84 for (
int cl = 0;
cl < (clsize-1)/2;
cl++)
85 if (centralStrip +
cl + 1 <= roll->
nstrips() ){
86 lstrip = centralStrip+
cl+1;
87 cls.push_back(lstrip);
94 if (lstrip < roll->nstrips() ){
96 cls.push_back(lstrip);
101 cls.push_back(fstrip);
107 for (std::vector<int>::iterator
i=cls.begin();
i!=cls.end();
i++){
109 std::pair<unsigned int, int> digi(*
i,time_hit);
120 CLHEP::HepRandomEngine* engine)
127 if ( rpcId.
region() == 0 )
134 area = striplength*(xmax-
xmin);
142 area = striplength*(xmax-
xmin);
147 CLHEP::RandPoissonQ randPoissonQ(*engine, ave);
148 N_hits = randPoissonQ.fire();
151 int strip =
static_cast<int>(CLHEP::RandFlat::shoot(engine, 1, nstrips));
153 time_hit = (
static_cast<int>(CLHEP::RandFlat::shoot(engine, (
nbxing*
gate)/gate))) -
nbxing/2;
154 std::pair<int, int> digi(strip,time_hit);
T getParameter(std::string const &) const
const Topology & topology() const override
LocalPoint centreOfStrip(int strip) const
LocalPoint localPosition(float strip) const override
CaloTopology const * topology(0)
DetectorHitMap theDetectorHitMap
void setRPCSimSetUp(RPCSimSetUp *simsetup)
constexpr uint32_t rawId() const
get the raw id
LocalPoint localPosition(float strip) const override
RPCSimSetUp * getRPCSimSetUp()
const RPCRollSpecs * specs() const
const Topology & topology() const override
int getSimHitBx(const PSimHit *, CLHEP::HepRandomEngine *)
std::set< std::pair< int, int > > strips
edm::DetSet< RPCDigiSimLink > RPCDigiSimLinks
Container::value_type value_type
void simulateNoise(const RPCRoll *, CLHEP::HepRandomEngine *) override
float stripLength() const override
det heigth (strip length in the middle)
void simulate(const RPCRoll *roll, const edm::PSimHitContainer &rpcHits, CLHEP::HepRandomEngine *) override
std::vector< PSimHit > PSimHitContainer
RPCSynchronizer * _rpcSync
RPCSimParam(const edm::ParameterSet &config)
RPCDigiSimLinks theRpcDigiSimLinks
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
float stripLength() const override