6 #include "CLHEP/Units/PhysicalConstants.h"
7 #include "CLHEP/Units/SystemOfUnits.h"
16 double tmp = R/CLHEP::c_light/CLHEP::ns;
19 int subdet =
id.subdetId();
26 dist = rEB/
sin(theta);
27 }
else if (subdet == static_cast<int>(
EcalEndcap)) {
29 dist = zEE/
cos(theta);
32 dist = zES/
cos(theta);
37 dist = rHB/
sin(theta);
38 }
else if (subdet == static_cast<int>(
HcalEndcap)) {
40 dist = zHE/
cos(theta);
41 }
else if (subdet == static_cast<int>(
HcalOuter)) {
43 dist = rHO/
sin(theta);
46 dist = zHF/
cos(theta);
49 double tmp1 = dist/CLHEP::c_light/CLHEP::ns;
51 std::cout <<
"Detector " << det <<
"/" << subdet <<
" Eta/Theta " << eta
52 <<
"/" << theta/CLHEP::deg <<
" Dist " << dist/CLHEP::cm
53 <<
" R " << R <<
" TOF " << tmp <<
":" << tmp1 << std::endl;
static const double zFrontHE
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
static const double zFrontHF
static const double rFrontHB
static const double zFrontEE
static const double rFrontEB
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.
static const double zFrontES
std::vector< std::vector< double > > tmp
static const double rFrontHO
double timeOfFlight(DetId id, const CaloGeometry *geo, bool debug=false)