2 #ifndef CommonTools_BaseParticlePropagator_BaseParticlePropagator_h 3 #define CommonTools_BaseParticlePropagator_BaseParticlePropagator_h 93 double r,
double z,
double B);
95 double r,
double z,
double B,
double t);
154 inline double c_light()
const {
return 299.792458; }
185 return particle_.
Z() - particle_.
Pz() *
std::sqrt( ((particle_.
X()-x0)*(particle_.
X()-x0) + (particle_.
Y()-y0)*(particle_.
Y()-y0) ) / particle_.
Perp2());
198 return particle_.
charge() == 0 ? 0.0 : - particle_.
Pt() / (
c_light() * 1
e-5 * bField * particle_.
charge() );
203 return particle_.
charge() == 0 ? 0.0 : - pT / (
c_light() * 1
e-5 * bField * particle_.
charge() );
209 return particle_.
Px() == 0.0 && particle_.
Py() == 0.0 ? 0.0 : std::atan2(particle_.
Py(),particle_.
Px());
220 return particle_.
X() - radius *
std::sin (phi);
231 return particle_.
Y() + radius *
std::cos (phi);
252 return xC == 0.0 && yC == 0.0 ? 0.0 : std::atan2(yC,xC);
257 return xC == 0.0 && yC == 0.0 ? 0.0 : std::atan2(yC,xC);
262 return (particle_.
R2()<rCyl2-0.00001*rCyl && fabs(particle_.
Z())<zCyl-0.00001);}
265 return (rPos2<rCyl2-0.00001*rCyl && fabs(particle_.
Z())<zCyl-0.00001);}
279 double rPos2 = particle_.
R2();
280 return ( fabs(rPos2-rCyl2) < 0.00001*rCyl && fabs(particle_.
Z()) <= zCyl );
284 return ( fabs(rPos2-rCyl2) < 0.00001*rCyl && fabs(particle_.
Z()) <= zCyl );
289 return ( fabs(fabs(particle_.
Z())-zCyl) < 0.00001 && particle_.
R2() <=
rCyl2 );
293 return ( fabs(fabs(particle_.
Z())-zCyl) < 0.00001 && rPos2 <=
rCyl2 );
bool hasDecayed() const
Has the particle decayed while propagated ?
bool onSurface(double rPos2) const
double zCyl
Half-height of the cylinder (centred at 0,0,0) to which propagation is done.
double helixRadius() const
The helix Radius.
double zImpactParameter(double x0=0, double y0=0.) const
Longitudinal impact parameter.
double helixCentrePhi() const
The azimuth if the vector joining the cylinder and the helix axes.
bool propagateToPreshowerLayer1(bool first=true)
bool inside(double rPos2) const
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
void increaseRCyl(double delta)
Just an internal trick.
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.
int getSuccess() const
Has propagation been performed and was barrel or endcap reached ?
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)
void setMagneticField(double b)
Set the magnetic field.
RawParticle const & particle() const
The particle being propagated.
double helixCentrePhi(double xC, double yC) const
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)
void setParticle(RawParticle const &iParticle)
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)
double helixCentreDistToAxis() const
The distance between the cylinder and the helix axes.
void setDebug()
Set the debug leve;.
double properDecayTime
The proper decay time of the particle.
bool propagateToHcalExit(bool first=true)
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
bool onEndcap(double rPos2) const
static const std::string B
double Pz() const
z of the momentum
double charge() const
get the MEASURED charge
double helixCentreY(double radius, double phi) const
int propDir
The propagation direction.
bool propagateToEcalEntrance(bool first=true)
double helixCentreX(double radius, double phi) const
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.
double getMagneticField() const
Get the magnetic field.
bool propagateToHcalEntrance(bool first=true)
double helixRadius(double pT) const
void setProperDecayTime(double t)
Set the proper decay time.
double Px() const
x of the momentum
double bField
Magnetic field in the cylinder, oriented along the Z axis.
bool onFiducial() const
Is the vertex on some material ?
bool propagateToHOLayer(bool first=true)
bool onBarrel(double rPos2) const
bool onBarrel() const
Is the vertex already on the cylinder barrel ?
bool propagateToPreshowerLayer2(bool first=true)
double helixCentreDistToAxis(double xC, double yC) const
double xyImpactParameter(double x0=0., double y0=0.) const
Transverse impact parameter.
bool fiducial
The particle traverses some real material.
math::XYZTLorentzVector XYZTLorentzVector