15 #include "CLHEP/Random/RandomEngine.h"
16 #include "CLHEP/Random/RandFlat.h"
17 #include <CLHEP/Random/RandGaussQ.h>
18 #include <CLHEP/Random/RandFlat.h>
44 #include "CLHEP/Random/Random.h"
45 #include "CLHEP/Random/RandFlat.h"
46 #include "CLHEP/Random/RandPoissonQ.h"
71 std::cout <<
"Average Cluster Size = "<<aveCls<<
" strips"<<std::endl;
72 std::cout <<
"RPC Time Resolution = "<<resRPC<<
" ns"<<std::endl;
73 std::cout <<
"RPC Signal formation time = "<<timOff<<
" ns"<<std::endl;
74 std::cout <<
"RPC adjacent strip delay = "<<dtimCs<<
" ns"<<std::endl;
75 std::cout <<
"Electronic Jitter = "<<resEle<<
" ns"<<std::endl;
76 std::cout <<
"Signal propagation time = "<<sspeed<<
" x c"<<std::endl;
77 std::cout <<
"Link Board Gate Width = "<<lbGate<<
" ns"<<std::endl;
111 if(0.0 <= posX && posX < 0.2) {
112 func = (clsMap[1])[(clsMap[1]).size()-1]*(rr_cl);
113 sum_clsize = clsMap[1];
115 if(0.2 <= posX && posX < 0.4) {
116 func = (clsMap[2])[(clsMap[2]).size()-1]*(rr_cl);
117 sum_clsize = clsMap[2];
119 if(0.4 <= posX && posX < 0.6) {
120 func = (clsMap[3])[(clsMap[3]).size()-1]*(rr_cl);
121 sum_clsize = clsMap[3];
123 if(0.6 <= posX && posX < 0.8) {
124 func = (clsMap[4])[(clsMap[4]).size()-1]*(rr_cl);
125 sum_clsize = clsMap[4];
127 if(0.8 <= posX && posX < 1.0) {
128 func = (clsMap[5])[(clsMap[5]).size()-1]*(rr_cl);
129 sum_clsize = clsMap[5];
132 for(vector<double>::iterator iter = sum_clsize.begin();
133 iter != sum_clsize.end(); ++iter){
138 else if(func < (*iter)){
161 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin();
162 _hit != rpcHits.end(); ++_hit){
164 if(_hit-> particleType() == 11)
continue;
170 float posX = roll->
strip(_hit->localPosition()) - static_cast<int>(roll->
strip(_hit->localPosition()));
172 std::vector<float> veff = (
getRPCSimSetUp())->getEff(rpcId.rawId());
175 int centralStrip = topology.
channel(entr)+1;;
178 if (fire < veff[centralStrip-1]) {
180 int fstrip=centralStrip;
181 int lstrip=centralStrip;
185 if (w < 1.
e-10) w=1.e-10;
188 std::vector<int> cls;
189 cls.push_back(centralStrip);
191 for (
int cl = 0;
cl < (clsize-1)/2;
cl++){
192 if (centralStrip -
cl -1 >= 1 ){
193 fstrip = centralStrip-
cl-1;
194 cls.push_back(fstrip);
196 if (centralStrip +
cl + 1 <= roll->
nstrips() ){
197 lstrip = centralStrip+
cl+1;
198 cls.push_back(lstrip);
206 if (lstrip < roll->nstrips() ){
208 cls.push_back(lstrip);
213 cls.push_back(fstrip);
219 for (std::vector<int>::iterator
i=cls.begin();
i!=cls.end();
i++){
221 if(*
i != centralStrip){
223 std::pair<int, int> digi(*
i,time_hit);
230 std::pair<int, int> digi(*
i,time_hit);
251 unsigned int nstrips = roll->
nstrips();
254 if ( rpcId.
region() == 0 )
256 const RectangularStripTopology* top_ =
dynamic_cast<const
257 RectangularStripTopology*
>(&(roll->
topology()));
258 float xmin = (top_->localPosition(0.)).
x();
259 float xmax = (top_->localPosition((
float)roll->
nstrips())).x();
260 float striplength = (top_->stripLength());
261 area = striplength*(xmax-
xmin);
265 const TrapezoidalStripTopology* top_=
dynamic_cast<const TrapezoidalStripTopology*
>(&(roll->
topology()));
266 float xmin = (top_->localPosition(0.)).
x();
267 float xmax = (top_->localPosition((
float)roll->
nstrips())).x();
268 float striplength = (top_->stripLength());
269 area = striplength*(xmax-
xmin);
272 for(
unsigned int j = 0;
j < vnoise.size(); ++
j){
274 if(
j >= nstrips)
break;
293 std::pair<int, int> digi(
j+1,time_hit);
void simulateNoise(const RPCRoll *)
T getParameter(std::string const &) const
float strip(const LocalPoint &lp) const
std::vector< double > sum_clsize
LocalPoint centreOfStrip(int strip) const
const Topology & topology() const
CLHEP::RandFlat * flatDistribution
DetectorHitMap theDetectorHitMap
void setRPCSimSetUp(RPCSimSetUp *simsetup)
RPCSimSetUp * getRPCSimSetUp()
const RPCRollSpecs * specs() const
RPCSimAverageNoiseEff(const edm::ParameterSet &config)
std::set< std::pair< int, int > > strips
uint32_t rawId() const
get the raw id
int getClSize(float posX)
edm::DetSet< RPCDigiSimLink > RPCDigiSimLinks
virtual std::string name()
const std::map< int, std::vector< double > > & getClsMap()
virtual int channel(const LocalPoint &p) const =0
Container::value_type value_type
void simulate(const RPCRoll *roll, const edm::PSimHitContainer &rpcHits)
int getSimHitBx(const PSimHit *)
void setRandomEngine(CLHEP::HepRandomEngine &eng)
void setRandomEngine(CLHEP::HepRandomEngine &eng)
RPCSynchronizer * _rpcSync
std::vector< PSimHit > PSimHitContainer
std::map< int, std::vector< double > > clsMap
CLHEP::RandFlat * flatDistribution2
CLHEP::RandPoissonQ * poissonDistribution_
RPCDigiSimLinks theRpcDigiSimLinks
const Topology & topology() const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.