22 #include "CLHEP/Random/RandGaussQ.h"
38 dtimCs = config.
getParameter<
double>(
"deltatimeAdjacentStrip");
40 sspeed = config.
getParameter<
double>(
"signalPropagationSpeed");
73 float rr_el = CLHEP::RandGaussQ::shoot(engine, 0.,resEle);
79 for(TrackingGeometry::DetContainer::const_iterator it = geometry->
dets().begin(); it != geometry->
dets().end(); it++){
81 if( dynamic_cast< const RPCChamber* >( *it ) != 0 ){
83 auto ch =
dynamic_cast<const RPCChamber*
>( *it );
85 std::vector< const RPCRoll*> rollsRaf = (ch->rolls());
86 for(std::vector<const RPCRoll*>::iterator
r = rollsRaf.begin();
87 r != rollsRaf.end(); ++
r){
89 if((*r)->id() == SimDetId) {
99 float distanceFromEdge = 0;
100 float half_stripL = 0.;
102 if(SimRoll->id().region() == 0){
103 const RectangularStripTopology* top_=
dynamic_cast<const RectangularStripTopology*
> (&(SimRoll->topology()));
104 half_stripL = top_->stripLength()/2;
105 distanceFromEdge = half_stripL + simHitPos.
y();
107 const TrapezoidalStripTopology* top_=
dynamic_cast<const TrapezoidalStripTopology*
> (&(SimRoll->topology()));
108 half_stripL = top_->stripLength()/2;
109 distanceFromEdge = half_stripL - simHitPos.
y();
113 float prop_time = distanceFromEdge/sspeed;
115 double rr_tim1 = CLHEP::RandGaussQ::shoot(engine, 0.,resRPC);
116 double total_time = tof + prop_time + timOff + rr_tim1 + rr_el;
119 double time_differ = 0.;
122 time_differ = (total_time - (timeref + ((half_stripL/sspeed ) + timOff)))/cosmicPar;
125 time_differ = total_time - (timeref + ( half_stripL/sspeed ) + timOff);
132 for(
int n = -5;
n <= 5; ++
n){
135 inf_time = (-lbGate/2 +
n*LHCGate )/cosmicPar;
136 sup_time = ( lbGate/2 +
n*LHCGate )/cosmicPar;
139 inf_time = -lbGate/2 +
n*LHCGate;
140 sup_time = lbGate/2 +
n*LHCGate;
143 if(inf_time < time_differ && time_differ < sup_time) {
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
virtual const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
ESHandle< TrackerGeometry > geometry
unsigned int detUnitId() const