6 rCyl(0.), rCyl2(0.), zCyl(0.),
bField(0), properDecayTime(1E99)
72 double b2 =
rCyl2 * pT2;
79 if ( ac2 > b2 )
return false;
89 double solution = tminus < 0 ? tplus/pT2 : tminus/pT2;
90 if ( solution < 0. )
return false;
95 if ( fabs(zProp) >
zCyl ) {
98 solution = tminus < 0 ? tplus : tminus;
99 if ( solution < 0. )
return false;
131 if (
success == 2 && xProp*xProp+yProp*yProp >
rCyl2 ) {
159 if ( fabs ( fabs(radius) - dist ) >
rCyl )
return false;
170 double phiProp, zProp;
174 double rProp =
std::min(fabs(radius)+dist-0.000001,
rCyl);
178 (rProp*rProp-radius*radius-dist*dist)/( 2.*dist*radius);
184 if ( 1.-fabs(sinPhiProp) < 1E-9 ) {
191 double delta = r0*r0 + rcyl2*(1.-q0);
195 deltaPhi = radius > 0 ?
202 if ( fabs(deltaPhi) > 1E-3 ) {
206 phiProp = std::asin(sinPhiProp);
218 if ( fabs(phiProp - phi0) > 2.*
M_PI )
219 phiProp += ( phiProp > phi0 ? -2.*
M_PI : +2.*
M_PI );
225 if ( (phiProp-phi0)*radius < 0.0 )
226 radius > 0.0 ? phiProp += 2 *
M_PI : phiProp -= 2 *
M_PI;
238 zProp =
particle_.
Z() + ( phiProp - phi0 ) * pZ * radius / pT ;
239 if ( fabs(zProp) >
zCyl ) {
241 zProp =
zCyl * fabs(pZ)/pZ;
242 phiProp = phi0 + (zProp -
particle_.
Z()) / radius * pT / pZ;
251 if ( rProp <
rCyl ) {
253 if (
firstLoop || fabs(pZ)/pT < 1E-10 ) {
259 zProp =
zCyl * fabs(pZ)/pZ;
260 phiProp = phi0 + (zProp -
particle_.
Z()) / radius * pT / pZ;
290 phiProp = phi0 + (phiProp-phi0)*factor;
294 double xProp = xC + radius * sProp;
295 double yProp = yC - radius * cProp;
297 double pxProp = pT * cProp;
298 double pyProp = pT * sProp;
304 if (
success == 2 && xProp*xProp+yProp*yProp >
rCyl2 ) {
378 rz = fabs ( fabs(radius) - distz ) +
std::sqrt(x0*x0+y0*y0) + 0.0000001;
379 r0 = fabs ( fabs(radius) - dist0 ) + 0.0000001;
393 if ( !done )
return done;
396 if ( fabs(rz-r0) < 1E-10 )
return done;
400 if ( dist1 < 1E-10 )
return done;
409 if ( !done )
return done;
415 if ( !done )
return done;
419 if ( dist2 > dist1 ) {
561 if ( done && ( c2teta < 0.99014 || c2teta > 0.9998755 ) )
success = 0;
651 double Dxy2 = Dxy*Dxy;
652 double Sxy2 = Sxy*Sxy;
653 double SDxy = dx*dx + dy*
dy;
655 double ATxy = std::atan2(dy,dx);
657 double a = r2 - Dxy2/SDxy;
658 double b = r * (r2 - Sxy);
659 double c = r4 - 2.*Sxy*r2 + Sxy2 + Dxy2;
663 std::array<double,4> helixRs = {{0.}};
664 helixRs[0] = (b -
std::sqrt(b*b - a*c))/(2.*a);
665 helixRs[1] = (b +
std::sqrt(b*b - a*c))/(2.*a);
666 helixRs[2] = -helixRs[0];
667 helixRs[3] = -helixRs[1];
669 std::array<double,4> helixPhis = {{0.}};
670 helixPhis[0] = std::asin ( SSDxy/(2.*helixRs[0]) );
671 helixPhis[1] = std::asin ( SSDxy/(2.*helixRs[1]) );
672 helixPhis[2] = -helixPhis[0];
673 helixPhis[3] = -helixPhis[1];
680 for (
unsigned int i=0;
i<4; ++
i ) {
681 helixPhis[
i] = ATxy + helixPhis[
i];
694 if ( fabs( fabs(fabs(helixRs[i]) - dist) -fabs(radius) ) < 1
e-6 ) {
696 if ( solution1 == 0. ) {
697 solution1 = helixRs[
i];
700 }
else if ( solution2 == 0. ) {
701 if ( helixRs[i] < solution1 ) {
702 solution2 = solution1;
703 solution1 = helixRs[
i];
707 solution2 = helixRs[
i];
712 std::cout <<
"warning !!! More than two solutions for this track !!! " << std::endl;
719 double helixPhi = 0.;
722 if ( solution1*solution2 == 0. ) {
723 std::cout <<
"warning !!! Less than two solution for this track! " 724 << solution1 <<
" " << solution2 << std::endl;
727 }
else if ( solution1*solution2 < 0. ) {
729 double norm = pT/SSDxy;
745 double norm = pT/SSDxy;
769 ip = distz - fabs(radius);
double zCyl
Half-height of the cylinder (centred at 0,0,0) to which propagation is done.
void setMomentum(const XYZTLorentzVector &vtx)
set the momentum
void setCharge(float q)
set the MEASURED charge
double helixRadius() const
The helix Radius.
double helixCentrePhi() const
The azimuth if the vector joining the cylinder and the helix axes.
bool propagateToPreshowerLayer1(bool first=true)
double pt() const
transverse momentum
double rCyl
Simulated particle that is to be resp has been propagated.
bool propagateToNominalVertex(const XYZTLorentzVector &hit2=XYZTLorentzVector(0., 0., 0., 0.))
void init()
Initialize internal switches and quantities.
double Perp2() const
perpendicular momentum squared
bool firstLoop
Do only the first half-loop.
int success
0:propagation still be done, 1:reached 'barrel', 2:reached 'endcaps'
double properTime
The proper time of the particle.
Sin< T >::type sin(const T &t)
BaseParticlePropagator()
Default c'tor.
bool propagateToBeamCylinder(const XYZTLorentzVector &v, double radius=0.)
void setPropagationConditions(double r, double z, bool firstLoop=true)
Set the propagation characteristics (rCyl, zCyl and first loop only)
double mass() const
get the MEASURED mass
double c_light() const
The speed of light in mm/ns (!) without clhep (yeaaahhh!)
double R2() const
vertex radius**2
bool propagateToEcal(bool first=true)
bool propagateToClosestApproach(double x0=0., double y0=0, bool first=true)
double helixCentreX() const
The x coordinate of the helix axis.
bool propagateToVFcalEntrance(bool first=true)
const XYZTLorentzVector & momentum() const
the momentum fourvector
double helixCentreDistToAxis() const
The distance between the cylinder and the helix axes.
double properDecayTime
The proper decay time of the particle.
bool propagateToHcalExit(bool first=true)
double cos2ThetaV() const
Cos< T >::type cos(const T &t)
double Y() const
y of vertex
double Py() const
y of the momentum
double Pt() const
transverse momentum
double Z() const
z of vertex
Abs< T >::type abs(const T &t)
static const std::string B
double Pz() const
z of the momentum
double charge() const
get the MEASURED charge
int propDir
The propagation direction.
bool propagateToEcalEntrance(bool first=true)
const XYZTLorentzVector & vertex() const
the vertex fourvector
bool onEndcap() const
Is the vertex already on the cylinder endcap ?
bool decayed
The particle decayed while propagated !
BaseParticlePropagator propagated() const
double helixCentreY() const
The y coordinate of the helix axis.
bool inside() const
Is the vertex inside the cylinder ? (stricly inside : true)
bool onSurface() const
Is the vertex already on the cylinder surface ?
double X() const
x of vertex
bool debug
The debug level.
double helixStartPhi() const
The azimuth of the momentum at the vertex.
bool propagateToHcalEntrance(bool first=true)
double Px() const
x of the momentum
double E() const
energy of the momentum
double bField
Magnetic field in the cylinder, oriented along the Z axis.
double T() const
vertex time
bool propagateToHOLayer(bool first=true)
bool onBarrel() const
Is the vertex already on the cylinder barrel ?
bool propagateToPreshowerLayer2(bool first=true)
void setVertex(const XYZTLorentzVector &vtx)
set the vertex
double xyImpactParameter(double x0=0., double y0=0.) const
Transverse impact parameter.
bool fiducial
The particle traverses some real material.
math::XYZTLorentzVector XYZTLorentzVector