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;
107 if(0.0 <= posX && posX < 0.2) {
108 func = (clsMap[1])[(clsMap[1]).size()-1]*(rr_cl);
109 sum_clsize = clsMap[1];
111 if(0.2 <= posX && posX < 0.4) {
112 func = (clsMap[2])[(clsMap[2]).size()-1]*(rr_cl);
113 sum_clsize = clsMap[2];
115 if(0.4 <= posX && posX < 0.6) {
116 func = (clsMap[3])[(clsMap[3]).size()-1]*(rr_cl);
117 sum_clsize = clsMap[3];
119 if(0.6 <= posX && posX < 0.8) {
120 func = (clsMap[4])[(clsMap[4]).size()-1]*(rr_cl);
121 sum_clsize = clsMap[4];
123 if(0.8 <= posX && posX < 1.0) {
124 func = (clsMap[5])[(clsMap[5]).size()-1]*(rr_cl);
125 sum_clsize = clsMap[5];
128 for(vector<double>::iterator iter = sum_clsize.begin();
129 iter != sum_clsize.end(); ++iter){
134 else if(func < (*iter)){
153 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin();
154 _hit != rpcHits.end(); ++_hit){
159 float posX = roll->
strip(_hit->localPosition()) - static_cast<int>(roll->
strip(_hit->localPosition()));
165 int centralStrip = topology.channel(entr)+1;
166 int fstrip=centralStrip;
167 int lstrip=centralStrip;
170 if (w < 1.
e-10) w=1.e-10;
173 std::vector<int> cls;
174 cls.push_back(centralStrip);
176 for (
int cl = 0; cl < (clsize-1)/2; cl++)
178 if (centralStrip - cl -1 >= 1 ){
179 fstrip = centralStrip-cl-1;
180 cls.push_back(fstrip);
182 if (centralStrip + cl + 1 <= roll->
nstrips() ){
183 lstrip = centralStrip+cl+1;
184 cls.push_back(lstrip);
192 if (lstrip < roll->nstrips() ){
194 cls.push_back(lstrip);
199 cls.push_back(fstrip);
205 for (std::vector<int>::iterator
i=cls.begin();
i!=cls.end();
i++){
207 std::pair<int, int> digi(*
i,time_hit );
220 unsigned int nstrips = roll->
nstrips();
224 if ( rpcId.
region() == 0 )
226 const RectangularStripTopology* top_ =
dynamic_cast<const
227 RectangularStripTopology*
>(&(roll->
topology()));
228 float xmin = (top_->localPosition(0.)).
x();
229 float xmax = (top_->localPosition((
float)roll->
nstrips())).x();
230 float striplength = (top_->stripLength());
231 area = striplength*(xmax-
xmin);
235 const TrapezoidalStripTopology* top_=
dynamic_cast<const TrapezoidalStripTopology*
>(&(roll->
topology()));
236 float xmin = (top_->localPosition(0.)).
x();
237 float xmax = (top_->localPosition((
float)roll->
nstrips())).x();
238 float striplength = (top_->stripLength());
239 area = striplength*(xmax-
xmin);
241 for(
unsigned int j = 0;
j < vnoise.size(); ++
j){
243 if(
j >= nstrips)
break;
250 std::pair<int, int> digi(
j+1,time_hit);
T getParameter(std::string const &) const
float strip(const LocalPoint &lp) const
LocalPoint centreOfStrip(int strip) const
CLHEP::RandFlat * flatDistribution2
const Topology & topology() const
DetectorHitMap theDetectorHitMap
void setRPCSimSetUp(RPCSimSetUp *simsetup)
RPCSimSetUp * getRPCSimSetUp()
const RPCRollSpecs * specs() const
void simulateNoise(const RPCRoll *)
void setRandomEngine(CLHEP::HepRandomEngine &eng)
std::set< std::pair< int, int > > strips
uint32_t rawId() const
get the raw id
int getClSize(float posX)
std::map< int, std::vector< double > > clsMap
edm::DetSet< RPCDigiSimLink > RPCDigiSimLinks
const std::map< int, std::vector< double > > & getClsMap()
Container::value_type value_type
RPCSimAverageNoise(const edm::ParameterSet &config)
int getSimHitBx(const PSimHit *)
void setRandomEngine(CLHEP::HepRandomEngine &eng)
CLHEP::RandFlat * flatDistribution
RPCSynchronizer * _rpcSync
CLHEP::RandPoissonQ * poissonDistribution_
std::vector< PSimHit > PSimHitContainer
void simulate(const RPCRoll *roll, const edm::PSimHitContainer &rpcHits)
RPCDigiSimLinks theRpcDigiSimLinks
std::vector< double > sum_clsize
const Topology & topology() const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.