9 #include "CLHEP/Random/RandGaussQ.h"
15 const double COSMIC_PAR = 37.62;
20 gauss1_(0), gauss2_(0)
30 const double cspeed = 299792458;
32 signalPropagationSpeed_ = signalPropagationSpeed_ * cspeed * 1
e+2 * 1
e-9;
38 gauss1_ =
new CLHEP::RandGaussQ(eng);
39 gauss2_ =
new CLHEP::RandGaussQ(eng);
67 for(
const auto &det: geometry->
dets())
69 if( dynamic_cast< GEMEtaPartition* >( det ) != 0 )
73 if(roll->
id() == shdetid)
83 float distanceFromEdge = 0;
84 float halfStripLength = 0.;
86 if(shRoll->id().region() == 0)
89 <<
"GEMSynchronizer::getSimHitBx() - this GEM id is from barrel, which cannot happen: "<<shRoll->id()<<
"\n";
93 const TrapezoidalStripTopology* top =
dynamic_cast<const TrapezoidalStripTopology*
> (&(shRoll->topology()));
94 halfStripLength = 0.5 * top->stripLength();
95 distanceFromEdge = halfStripLength - simHitPos.
y();
103 float simhitTime = tof + (
averageShapingTime_ + randomResolutionTime) + (averagePropagationTime + randomJitterTime);
105 float timeDifference =
cosmics_ ? (simhitTime - referenceTime)/COSMIC_PAR : simhitTime - referenceTime;
108 bx =
static_cast<int>( std::round((timeDifference)/
bxwidth_) );
111 const bool debug(
false );
114 std::cout<<
"checktime "<<bx<<
" "<<timeDifference<<
" "<<simhitTime<<
" "<<referenceTime<<
" "<<tof<<
" "<<averagePropagationTime<<std::endl;
T getParameter(std::string const &) const
void setRandomEngine(CLHEP::HepRandomEngine &eng)
CLHEP::RandGaussQ * gauss1_
GEMSimSetUp * getGEMSimSetUp()
double signalPropagationSpeed_
float timeOfFlight() const
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Local3DPoint localPosition() const
double averageShapingTime_
GEMSynchronizer(const edm::ParameterSet &config)
const GEMGeometry * getGeometry()
ESHandle< TrackerGeometry > geometry
CLHEP::RandGaussQ * gauss2_
int getSimHitBx(const PSimHit *)
float getTime(uint32_t id)
unsigned int detUnitId() const