13 #include "CLHEP/Random/RandomEngine.h"
14 #include "CLHEP/Random/RandFlat.h"
15 #include <CLHEP/Random/RandGaussQ.h>
16 #include <CLHEP/Random/RandFlat.h>
42 #include "CLHEP/Random/Random.h"
43 #include "CLHEP/Random/RandFlat.h"
44 #include "CLHEP/Random/RandPoissonQ.h"
67 std::cout <<
"Average Cluster Size = "<<aveCls<<
" strips"<<std::endl;
68 std::cout <<
"RPC Time Resolution = "<<resRPC<<
" ns"<<std::endl;
69 std::cout <<
"RPC Signal formation time = "<<timOff<<
" ns"<<std::endl;
70 std::cout <<
"RPC adjacent strip delay = "<<dtimCs<<
" ns"<<std::endl;
71 std::cout <<
"Electronic Jitter = "<<resEle<<
" ns"<<std::endl;
72 std::cout <<
"Signal propagation time = "<<sspeed<<
" x c"<<std::endl;
73 std::cout <<
"Link Board Gate Width = "<<lbGate<<
" ns"<<std::endl;
106 if(0.0 <= posX && posX < 0.2) {
107 func = (clsMap[1])[(clsMap[1]).size()-1]*(rr_cl);
108 sum_clsize = clsMap[1];
110 if(0.2 <= posX && posX < 0.4) {
111 func = (clsMap[2])[(clsMap[2]).size()-1]*(rr_cl);
112 sum_clsize = clsMap[2];
114 if(0.4 <= posX && posX < 0.6) {
115 func = (clsMap[3])[(clsMap[3]).size()-1]*(rr_cl);
116 sum_clsize = clsMap[3];
118 if(0.6 <= posX && posX < 0.8) {
119 func = (clsMap[4])[(clsMap[4]).size()-1]*(rr_cl);
120 sum_clsize = clsMap[4];
122 if(0.8 <= posX && posX < 1.0) {
123 func = (clsMap[5])[(clsMap[5]).size()-1]*(rr_cl);
124 sum_clsize = clsMap[5];
127 for(vector<double>::iterator iter = sum_clsize.begin();
128 iter != sum_clsize.end(); ++iter){
133 else if(func < (*iter)){
152 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin();
153 _hit != rpcHits.end(); ++_hit){
160 float posX = roll->
strip(_hit->localPosition()) - static_cast<int>(roll->
strip(_hit->localPosition()));
167 int centralStrip = topology.channel(entr)+1;
168 int fstrip=centralStrip;
169 int lstrip=centralStrip;
172 if (w < 1.
e-10) w=1.e-10;
175 std::vector<int> cls;
176 cls.push_back(centralStrip);
178 for (
int cl = 0; cl < (clsize-1)/2; cl++)
179 if (centralStrip - cl -1 >= 1 ){
180 fstrip = centralStrip-cl-1;
181 cls.push_back(fstrip);
183 for (
int cl = 0; cl < (clsize-1)/2; cl++)
184 if (centralStrip + cl + 1 <= roll->
nstrips() ){
185 lstrip = centralStrip+cl+1;
186 cls.push_back(lstrip);
193 if (lstrip < roll->nstrips() ){
195 cls.push_back(lstrip);
200 cls.push_back(fstrip);
206 for (std::vector<int>::iterator
i=cls.begin();
i!=cls.end();
i++){
208 std::pair<int, int> digi(*
i,time_hit);
223 if ( rpcId.
region() == 0 )
225 const RectangularStripTopology* top_ =
dynamic_cast<const
226 RectangularStripTopology*
>(&(roll->
topology()));
227 float xmin = (top_->localPosition(0.)).
x();
228 float xmax = (top_->localPosition((
float)roll->
nstrips())).x();
229 float striplength = (top_->stripLength());
230 area = striplength*(xmax-
xmin);
234 const TrapezoidalStripTopology* top_=
dynamic_cast<const TrapezoidalStripTopology*
>(&(roll->
topology()));
235 float xmin = (top_->localPosition(0.)).
x();
236 float xmax = (top_->localPosition((
float)roll->
nstrips())).x();
237 float striplength = (top_->stripLength());
238 area = striplength*(xmax-
xmin);
249 std::pair<int, int> digi(strip,time_hit);
CLHEP::RandFlat * flatDistribution_
T getParameter(std::string const &) const
std::vector< double > sum_clsize
float strip(const LocalPoint &lp) const
LocalPoint centreOfStrip(int strip) const
const Topology & topology() const
CLHEP::RandPoissonQ * poissonDistribution
int getClSize(float posX)
DetectorHitMap theDetectorHitMap
void setRPCSimSetUp(RPCSimSetUp *simsetup)
RPCSimSetUp * getRPCSimSetUp()
void simulateNoise(const RPCRoll *)
const RPCRollSpecs * specs() const
std::set< std::pair< int, int > > strips
uint32_t rawId() const
get the raw id
edm::DetSet< RPCDigiSimLink > RPCDigiSimLinks
void setRandomEngine(CLHEP::HepRandomEngine &eng)
CLHEP::RandFlat * flatDistribution1
const std::map< int, std::vector< double > > & getClsMap()
CLHEP::RandFlat * flatDistribution2
Container::value_type value_type
int getSimHitBx(const PSimHit *)
void simulate(const RPCRoll *roll, const edm::PSimHitContainer &rpcHits)
RPCSynchronizer * _rpcSync
void setRandomEngine(CLHEP::HepRandomEngine &eng)
RPCSimAverage(const edm::ParameterSet &config)
std::vector< PSimHit > PSimHitContainer
RPCDigiSimLinks theRpcDigiSimLinks
std::map< int, std::vector< double > > clsMap
const Topology & topology() const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.