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;
112 if(0.0 <= posX && posX < 0.2) {
113 func = (clsMap[1])[(clsMap[1]).size()-1]*(rr_cl);
114 sum_clsize = clsMap[1];
116 if(0.2 <= posX && posX < 0.4) {
117 func = (clsMap[2])[(clsMap[2]).size()-1]*(rr_cl);
118 sum_clsize = clsMap[2];
120 if(0.4 <= posX && posX < 0.6) {
121 func = (clsMap[3])[(clsMap[3]).size()-1]*(rr_cl);
122 sum_clsize = clsMap[3];
124 if(0.6 <= posX && posX < 0.8) {
125 func = (clsMap[4])[(clsMap[4]).size()-1]*(rr_cl);
126 sum_clsize = clsMap[4];
128 if(0.8 <= posX && posX < 1.0) {
129 func = (clsMap[5])[(clsMap[5]).size()-1]*(rr_cl);
130 sum_clsize = clsMap[5];
133 for(vector<double>::iterator iter = sum_clsize.begin();
134 iter != sum_clsize.end(); ++iter){
139 else if(func < (*iter)){
159 std::string nameRoll = RPCname.
name();
163 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin();
164 _hit != rpcHits.end(); ++_hit){
172 float posX = roll->
strip(_hit->localPosition()) - static_cast<int>(roll->
strip(_hit->localPosition()));
174 std::vector<float> veff = (
getRPCSimSetUp())->getEff(rpcId.rawId());
177 int centralStrip = topology.
channel(entr)+1;;
180 if (fire < veff[centralStrip-1]) {
182 int fstrip=centralStrip;
183 int lstrip=centralStrip;
187 if (w < 1.
e-10) w=1.e-10;
190 std::vector<int> cls;
191 cls.push_back(centralStrip);
193 for (
int cl = 0; cl < (clsize-1)/2; cl++){
194 if (centralStrip - cl -1 >= 1 ){
195 fstrip = centralStrip-cl-1;
196 cls.push_back(fstrip);
198 if (centralStrip + cl + 1 <= roll->
nstrips() ){
199 lstrip = centralStrip+cl+1;
200 cls.push_back(lstrip);
208 if (lstrip < roll->nstrips() ){
210 cls.push_back(lstrip);
215 cls.push_back(fstrip);
221 for (std::vector<int>::iterator
i=cls.begin();
i!=cls.end();
i++){
223 if(*
i != centralStrip){
225 std::pair<int, int> digi(*
i,time_hit);
232 std::pair<int, int> digi(*
i,time_hit);
248 std::string nameRoll = RPCname.
name();
253 unsigned int nstrips = roll->
nstrips();
256 if ( rpcId.
region() == 0 )
263 area = striplength*(xmax-xmin);
271 area = striplength*(xmax-xmin);
274 for(
unsigned int j = 0;
j < vnoise.size(); ++
j){
276 if(
j >= nstrips)
break;
295 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
virtual float stripLength() const
DetectorHitMap theDetectorHitMap
void setRPCSimSetUp(RPCSimSetUp *simsetup)
RPCSimSetUp * getRPCSimSetUp()
Container::value_type value_type
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 T & max(const T &a, const T &b)
const std::map< int, std::vector< double > > & getClsMap()
virtual int channel(const LocalPoint &p) const =0
void simulate(const RPCRoll *roll, const edm::PSimHitContainer &rpcHits)
int getSimHitBx(const PSimHit *)
void setRandomEngine(CLHEP::HepRandomEngine &eng)
void setRandomEngine(CLHEP::HepRandomEngine &eng)
virtual LocalPoint localPosition(float strip) const
RPCSynchronizer * _rpcSync
std::vector< PSimHit > PSimHitContainer
std::map< int, std::vector< double > > clsMap
CLHEP::RandFlat * flatDistribution2
CLHEP::RandPoissonQ * poissonDistribution_
virtual LocalPoint localPosition(float strip) const
virtual float stripLength() const
det heigth (strip length in the middle)
RPCDigiSimLinks theRpcDigiSimLinks
const Topology & topology() const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.