22 #include "CLHEP/Random/RandGaussQ.h" 38 dtimCs = config.
getParameter<
double>(
"deltatimeAdjacentStrip");
40 sspeed = config.
getParameter<
double>(
"signalPropagationSpeed");
44 irpc_timing_res = config.
getParameter<
double>(
"IRPC_time_resolution");
45 irpc_electronics_jitter = config.
getParameter<
double>(
"IRPC_electronics_jitter");
71 float rr_el = CLHEP::RandGaussQ::shoot(engine, 0.,resEle);
75 const RPCRoll* SimRoll =
nullptr;
77 for(TrackingGeometry::DetContainer::const_iterator it = geometry->
dets().begin(); it != geometry->
dets().end(); it++){
79 if( dynamic_cast< const RPCChamber* >( *it ) !=
nullptr ){
81 auto ch =
dynamic_cast<const RPCChamber*
>( *it );
83 std::vector< const RPCRoll*> rollsRaf = (ch->rolls());
84 for(std::vector<const RPCRoll*>::iterator
r = rollsRaf.begin();
85 r != rollsRaf.end(); ++
r){
87 if((*r)->id() == SimDetId) {
95 if(SimRoll !=
nullptr){
97 float distanceFromEdge = 0;
98 float half_stripL = 0.;
100 if(SimRoll->id().region() == 0){
103 distanceFromEdge = half_stripL + simHitPos.
y();
107 distanceFromEdge = half_stripL - simHitPos.
y();
111 float prop_time = distanceFromEdge/sspeed;
113 double rr_tim1 = CLHEP::RandGaussQ::shoot(engine, 0.,resRPC);
114 double total_time = tof + prop_time + timOff + rr_tim1 + rr_el;
117 double time_differ = 0.;
120 time_differ = (total_time - (timeref + ((half_stripL/sspeed ) + timOff)))/cosmicPar;
123 time_differ = total_time - (timeref + ( half_stripL/sspeed ) + timOff);
133 inf_time = (-lbGate/2 +
n*LHCGate )/cosmicPar;
134 sup_time = ( lbGate/2 +
n*LHCGate )/cosmicPar;
137 inf_time = -lbGate/2 +
n*LHCGate;
138 sup_time = lbGate/2 +
n*LHCGate;
141 if(inf_time < time_differ && time_differ < sup_time) {
166 float rr_el = CLHEP::RandGaussQ::shoot(engine, 0., irpc_electronics_jitter);
170 const RPCRoll* SimRoll =
nullptr;
172 for(TrackingGeometry::DetContainer::const_iterator it = geometry->
dets().begin(); it != geometry->
dets().end(); it++){
174 if( dynamic_cast< const RPCChamber* >( *it ) !=
nullptr ){
176 auto ch =
dynamic_cast<const RPCChamber*
>( *it );
178 std::vector< const RPCRoll*> rollsRaf = (ch->rolls());
179 for(std::vector<const RPCRoll*>::iterator
r = rollsRaf.begin();
180 r != rollsRaf.end(); ++
r){
182 if((*r)->id() == SimDetId) {
190 if(SimRoll !=
nullptr){
192 float distanceFromEdge = 0;
193 float half_stripL = 0.;
195 if(SimRoll->id().region() == 0){
198 distanceFromEdge = half_stripL + simHitPos.
y();
203 distanceFromEdge = half_stripL - simHitPos.
y();
207 float prop_time = distanceFromEdge/sspeed;
210 double rr_tim1 = CLHEP::RandGaussQ::shoot(engine, 0., irpc_timing_res);
212 double total_time = tof + prop_time + timOff + rr_tim1 + rr_el;
216 double time_differ = 0.;
219 time_differ = (total_time - (timeref + ((half_stripL/sspeed ) + timOff)))/cosmicPar;
222 time_differ = total_time - (timeref + ( half_stripL/sspeed ) + timOff);
225 double exact_total_time = tof + prop_time + timOff;
226 double exact_time_differ = 0.;
229 exact_time_differ = (exact_total_time - (timeref + ((half_stripL/sspeed ) + timOff)))/cosmicPar;
232 exact_time_differ = exact_total_time - (timeref + ( half_stripL/sspeed ) + timOff);
243 inf_time = (-lbGate/2 +
n*LHCGate )/cosmicPar;
244 sup_time = ( lbGate/2 +
n*LHCGate )/cosmicPar;
247 inf_time = -lbGate/2 +
n*LHCGate;
248 sup_time = lbGate/2 +
n*LHCGate;
251 if(inf_time < time_differ && time_differ < sup_time) {
253 the_exact_time=exact_time_differ;
254 the_smeared_time=time_differ;
T getParameter(std::string const &) const
float getTime(uint32_t id)
RPCSynchronizer(const edm::ParameterSet &config)
int getSimHitBx(const PSimHit *, CLHEP::HepRandomEngine *)
const RPCGeometry * getGeometry()
float timeOfFlight() const
Local3DPoint localPosition() const
float stripLength() const override
det heigth (strip length in the middle)
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
int getSimHitBxAndTimingForIRPC(const PSimHit *, CLHEP::HepRandomEngine *)
unsigned int detUnitId() const
float stripLength() const override