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 )
129 const RectangularStripTopology* top_ =
dynamic_cast<const
130 RectangularStripTopology*
>(&(roll->
topology()));
131 float xmin = (top_->localPosition(0.)).
x();
132 float xmax = (top_->localPosition((
float)roll->
nstrips())).x();
133 float striplength = (top_->stripLength());
134 area = striplength*(xmax-
xmin);
138 const TrapezoidalStripTopology* top_=
dynamic_cast<const TrapezoidalStripTopology*
>(&(roll->
topology()));
139 float xmin = (top_->localPosition(0.)).
x();
140 float xmax = (top_->localPosition((
float)roll->
nstrips())).x();
141 float striplength = (top_->stripLength());
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
LocalPoint centreOfStrip(int strip) const
const Topology & topology() const
CaloTopology const * topology(0)
DetectorHitMap theDetectorHitMap
void setRPCSimSetUp(RPCSimSetUp *simsetup)
RPCSimSetUp * getRPCSimSetUp()
const RPCRollSpecs * specs() const
int getSimHitBx(const PSimHit *, CLHEP::HepRandomEngine *)
std::set< std::pair< int, int > > strips
uint32_t rawId() const
get the raw id
edm::DetSet< RPCDigiSimLink > RPCDigiSimLinks
void simulateNoise(const RPCRoll *, CLHEP::HepRandomEngine *) override
Container::value_type value_type
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
const Topology & topology() const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.