6 #include "CLHEP/Units/PhysicalConstants.h" 7 #include "CLHEP/Units/SystemOfUnits.h" 18 double tmp = R/CLHEP::c_light/CLHEP::ns;
22 int subdet =
id.subdetId();
29 dist = rEB/
sin(theta);
30 }
else if (subdet == static_cast<int>(
EcalEndcap)) {
32 dist = zEE/
cos(theta);
35 dist = zES/
cos(theta);
40 dist = rHB/
sin(theta);
41 }
else if (subdet == static_cast<int>(
HcalEndcap)) {
43 dist = zHE/
cos(theta);
44 }
else if (subdet == static_cast<int>(
HcalOuter)) {
46 dist = rHO/
sin(theta);
49 dist = zHF/
cos(theta);
52 double tmp1 = dist/CLHEP::c_light/CLHEP::ns;
54 std::cout <<
"Detector " << det <<
"/" << subdet <<
" Eta/Theta " << eta
55 <<
"/" << theta/CLHEP::deg <<
" Dist " << dist/CLHEP::cm
56 <<
" 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)