5 #include "CLHEP/Units/PhysicalConstants.h"
6 #include "CLHEP/Units/SystemOfUnits.h"
15 double tmp = R/CLHEP::c_light/CLHEP::ns;
18 int subdet =
id.subdetId();
24 const double rEB = 1292*CLHEP::mm;
25 dist = rEB/
sin(theta);
26 }
else if (subdet == static_cast<int>(
EcalEndcap)) {
27 const double zEE = 3192*CLHEP::mm;
28 dist = zEE/
cos(theta);
30 const double zES = 3032*CLHEP::mm;
31 dist = zES/
cos(theta);
35 const double rHB = 1807*CLHEP::mm;
36 dist = rHB/
sin(theta);
37 }
else if (subdet == static_cast<int>(
HcalEndcap)) {
38 const double zHE = 4027*CLHEP::mm;
39 dist = zHE/
cos(theta);
40 }
else if (subdet == static_cast<int>(
HcalOuter)) {
41 const double rHO = 3848*CLHEP::mm;
42 dist = rHO/
sin(theta);
45 dist = zHF/
cos(theta);
48 double tmp1 = dist/CLHEP::c_light/CLHEP::ns;
50 std::cout <<
"Detector " << det <<
"/" << subdet <<
" Eta/Theta " << eta
51 <<
"/" << theta/CLHEP::deg <<
" Dist " << dist/CLHEP::cm
52 <<
" R " << R <<
" TOF " << tmp <<
":" << tmp1 << std::endl;
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
std::vector< std::vector< double > > tmp
double timeOfFlight(DetId id, const CaloGeometry *geo, bool debug=false)