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;
117 if(0.0 <= posX && posX < 0.2) {
118 func = clsForDetId[19]*(rr_cl);
121 if(0.2 <= posX && posX < 0.4) {
122 func = clsForDetId[39]*(rr_cl);
125 if(0.4 <= posX && posX < 0.6) {
126 func = clsForDetId[59]*(rr_cl);
129 if(0.6 <= posX && posX < 0.8) {
130 func = clsForDetId[79]*(rr_cl);
133 if(0.8 <= posX && posX < 1.0) {
134 func = clsForDetId[89]*(rr_cl);
139 for(
int i = vectOffset;
i<(vectOffset+20);
i++){
141 if(func > clsForDetId[
i]){
144 else if(func < clsForDetId[i]){
164 if(0.0 <= posX && posX < 0.2) {
165 func = (clsMap[1])[(clsMap[1]).size()-1]*(rr_cl);
166 sum_clsize = clsMap[1];
168 if(0.2 <= posX && posX < 0.4) {
169 func = (clsMap[2])[(clsMap[2]).size()-1]*(rr_cl);
170 sum_clsize = clsMap[2];
172 if(0.4 <= posX && posX < 0.6) {
173 func = (clsMap[3])[(clsMap[3]).size()-1]*(rr_cl);
174 sum_clsize = clsMap[3];
176 if(0.6 <= posX && posX < 0.8) {
177 func = (clsMap[4])[(clsMap[4]).size()-1]*(rr_cl);
178 sum_clsize = clsMap[4];
180 if(0.8 <= posX && posX < 1.0) {
181 func = (clsMap[5])[(clsMap[5]).size()-1]*(rr_cl);
182 sum_clsize = clsMap[5];
185 for(vector<double>::iterator iter = sum_clsize.begin();
186 iter != sum_clsize.end(); ++iter){
191 else if(func < (*iter)){
211 std::string nameRoll = RPCname.
name();
215 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin();
216 _hit != rpcHits.end(); ++_hit){
218 if(_hit-> particleType() == 11)
continue;
224 float posX = roll->
strip(_hit->localPosition()) - static_cast<int>(roll->
strip(_hit->localPosition()));
226 std::vector<float> veff = (
getRPCSimSetUp())->getEff(rpcId.rawId());
229 int centralStrip = topology.
channel(entr)+1;;
232 if (fire < veff[centralStrip-1]) {
234 int fstrip=centralStrip;
235 int lstrip=centralStrip;
239 if (w < 1.e-10) w=1.e-10;
241 int clsize = this->
getClSize(rpcId.rawId(),posX);
242 std::vector<int> cls;
243 cls.push_back(centralStrip);
245 for (
int cl = 0; cl < (clsize-1)/2; cl++){
246 if (centralStrip - cl -1 >= 1 ){
247 fstrip = centralStrip-cl-1;
248 cls.push_back(fstrip);
250 if (centralStrip + cl + 1 <= roll->
nstrips() ){
251 lstrip = centralStrip+cl+1;
252 cls.push_back(lstrip);
260 if (lstrip < roll->nstrips() ){
262 cls.push_back(lstrip);
267 cls.push_back(fstrip);
273 for (std::vector<int>::iterator
i=cls.begin();
i!=cls.end();
i++){
275 if(*
i != centralStrip){
277 std::pair<int, int> digi(*
i,time_hit);
284 std::pair<int, int> digi(*
i,time_hit);
300 std::string nameRoll = RPCname.
name();
305 unsigned int nstrips = roll->
nstrips();
308 if ( rpcId.
region() == 0 )
315 area = striplength*(xmax-xmin);
323 area = striplength*(xmax-xmin);
326 for(
unsigned int j = 0;
j < vnoise.size(); ++
j){
328 if(
j >= nstrips)
break;
346 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
const Topology & topology() const
virtual float stripLength() const
CLHEP::RandFlat * flatDistribution2
DetectorHitMap theDetectorHitMap
void setRPCSimSetUp(RPCSimSetUp *simsetup)
RPCSimSetUp * getRPCSimSetUp()
std::vector< double > clsForDetId
const RPCRollSpecs * specs() const
CLHEP::RandFlat * flatDistribution
int getClSize(float posX)
~RPCSimAverageNoiseEffCls()
std::set< std::pair< int, int > > strips
uint32_t rawId() const
get the raw id
edm::DetSet< RPCDigiSimLink > RPCDigiSimLinks
virtual std::string name()
const T & max(const T &a, const T &b)
std::vector< double > sum_clsize
RPCSynchronizer * _rpcSync
const std::vector< double > & getCls(uint32_t id)
const std::map< int, std::vector< double > > & getClsMap()
virtual int channel(const LocalPoint &p) const =0
Container::value_type value_type
int getSimHitBx(const PSimHit *)
CLHEP::RandPoissonQ * poissonDistribution_
std::map< int, std::vector< double > > clsMap
void setRandomEngine(CLHEP::HepRandomEngine &eng)
void setRandomEngine(CLHEP::HepRandomEngine &eng)
void simulate(const RPCRoll *roll, const edm::PSimHitContainer &rpcHits)
virtual LocalPoint localPosition(float strip) const
RPCSimAverageNoiseEffCls(const edm::ParameterSet &config)
std::vector< PSimHit > PSimHitContainer
virtual LocalPoint localPosition(float strip) const
virtual float stripLength() const
det heigth (strip length in the middle)
RPCDigiSimLinks theRpcDigiSimLinks
void simulateNoise(const RPCRoll *)
const Topology & topology() const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.