25 #include "CLHEP/Random/RandomEngine.h"
26 #include "CLHEP/Random/RandFlat.h"
27 #include <CLHEP/Random/RandGaussQ.h>
28 #include <CLHEP/Random/RandFlat.h>
44 dtimCs = config.
getParameter<
double>(
"deltatimeAdjacentStrip");
46 sspeed = config.
getParameter<
double>(
"signalPropagationSpeed");
63 gauss1 =
new CLHEP::RandGaussQ(eng);
64 gauss2 =
new CLHEP::RandGaussQ(eng);
87 float rr_el = gauss1->fire(0.,resEle);
93 for(TrackingGeometry::DetContainer::const_iterator it = geometry->
dets().begin(); it != geometry->
dets().end(); it++){
95 if( dynamic_cast< RPCChamber* >( *it ) != 0 ){
99 std::vector< const RPCRoll*> rollsRaf = (ch->
rolls());
100 for(std::vector<const RPCRoll*>::iterator
r = rollsRaf.begin();
101 r != rollsRaf.end(); ++
r){
103 if((*r)->id() == SimDetId) {
113 float distanceFromEdge = 0;
114 float half_stripL = 0.;
116 if(SimRoll->id().region() == 0){
117 const RectangularStripTopology* top_=
dynamic_cast<const RectangularStripTopology*
> (&(SimRoll->topology()));
118 half_stripL = top_->stripLength()/2;
119 distanceFromEdge = half_stripL + simHitPos.
y();
121 const TrapezoidalStripTopology* top_=
dynamic_cast<const TrapezoidalStripTopology*
> (&(SimRoll->topology()));
122 half_stripL = top_->stripLength()/2;
123 distanceFromEdge = half_stripL - simHitPos.
y();
127 float prop_time = distanceFromEdge/sspeed;
129 double rr_tim1 = gauss2->fire(0.,resEle);
130 double total_time = tof + prop_time + timOff + rr_tim1 + rr_el;
133 double time_differ = 0.;
136 time_differ = (total_time - (timeref + ((half_stripL/sspeed ) + timOff)))/cosmicPar;
139 time_differ = total_time - (timeref + ( half_stripL/sspeed ) + timOff);
146 for(
int n = -5;
n <= 5; ++
n){
149 inf_time = (-lbGate/2 +
n*lbGate )/cosmicPar;
150 sup_time = ( lbGate/2 +
n*lbGate )/cosmicPar;
153 inf_time = -lbGate/2 +
n*lbGate;
154 sup_time = lbGate/2 +
n*lbGate;
157 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)
const RPCGeometry * getGeometry()
float timeOfFlight() const
Local3DPoint localPosition() const
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
int getSimHitBx(const PSimHit *)
void setRandomEngine(CLHEP::HepRandomEngine &eng)
ESHandle< TrackerGeometry > geometry
unsigned int detUnitId() const