19 float ptParticle = momentum.Rho();
20 float etaParticle = momentum.eta();
21 float phiParticle = momentum.phi();
22 float vRho = vertex.Rho();
26 const float RBARM = 1.357 ;
27 const float ZENDM = 3.186 ;
29 float rbend = RBARM-(vRho/100.0);
35 if (fabs(bend/ptParticle) <= 1.)
37 phi = phiParticle - asin(bend/ptParticle)*charge;
41 edm::LogWarning(
"") <<
"[EcalPositionFromTrack::phiTransformation] Warning: "
42 <<
"Too low Pt, giving up";
51 rHit = ZENDM / sinh(fabs(etaParticle));
52 if (fabs(((rHit-(vRho/100.0))/rbend)*bend/ptParticle) <= 1.0)
54 phi = phiParticle - asin(((rHit-(vRho/100.0)) / rbend)*bend/ptParticle)*charge;
58 edm::LogWarning(
"") <<
"[EcalPositionFromTrack::phiTransformation] Warning: "
59 <<
"Too low Pt, giving up";
74 float etaParticle = momentum.eta();
75 float vZ = vertex.z();
76 float vRho = vertex.Rho();
78 if (etaParticle != 0.0)
81 float zEcal = (
R_ECAL-vRho)*sinh(etaParticle)+vZ;
83 if(zEcal != 0.0) theta = atan(
R_ECAL/zEcal);
84 if(theta < 0.0) theta = theta +
Geom::pi() ;
91 if(etaParticle < 0.0 ) Zend = - Zend;
92 float Zlen = Zend - vZ ;
93 float RR = Zlen/sinh(etaParticle);
94 theta = atan((RR+vRho)/Zend);
95 if(theta < 0.0) theta = theta+
Geom::pi();
96 ETA = -
log(
tan(0.5*theta));
101 edm::LogWarning(
"") <<
"[EcalPositionFromTrack::etaTransformation] Warning: "
102 <<
"Eta equals to zero, not correcting";
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
Global3DPoint GlobalPoint
Geom::Theta< T > theta() const
double ecalEta(const math::XYZVector &momentum, const math::XYZPoint &vertex)
double ecalPhi(const MagneticField *magField, const math::XYZVector &momentum, const math::XYZPoint &vertex, const int charge)
Tan< T >::type tan(const T &t)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
static const float etaBarrelEndcap
static const float Z_Endcap
static const float R_ECAL