CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ParticlePropagator Class Reference

#include <ParticlePropagator.h>

Inheritance diagram for ParticlePropagator:
BaseParticlePropagator

Public Member Functions

double fieldMap (const TrackerLayer &layer, double coord, int success)
 
double fieldMap (double x, double y, double z)
 
void initProperDecayTime ()
 
const HepPDT::ParticleDataTableparticleDataTable () const
 
 ParticlePropagator ()
 Default c'tor. More...
 
 ParticlePropagator (const BaseParticlePropagator &myPropPart, const MagneticFieldMap *aFieldMap, const HepPDT::ParticleDataTable *table)
 
 ParticlePropagator (const FSimTrack &simTrack, const MagneticFieldMap *aFieldMap, const RandomEngineAndDistribution *engine, const HepPDT::ParticleDataTable *table)
 
 ParticlePropagator (const ParticlePropagator &myPropPart)
 
 ParticlePropagator (const RawParticle &myPart, const MagneticFieldMap *aFieldMap, const RandomEngineAndDistribution *engine, const HepPDT::ParticleDataTable *table)
 
 ParticlePropagator (const RawParticle &myPart, double R, double Z, const MagneticFieldMap *aFieldMap, const RandomEngineAndDistribution *engine, const HepPDT::ParticleDataTable *table)
 
 ParticlePropagator (const XYZTLorentzVector &p, const XYZTLorentzVector &v, float q, const MagneticFieldMap *aFieldMap, const HepPDT::ParticleDataTable *table)
 
 ParticlePropagator (const XYZTLorentzVector &p, const XYZVector &v, float q, const MagneticFieldMap *aFieldMap, const HepPDT::ParticleDataTable *table)
 
ParticlePropagator propagated () const
 
bool propagateToBoundSurface (const TrackerLayer &)
 
bool propagateToClosestApproach (double x0=0., double y0=0., bool first=true)
 
bool propagateToNominalVertex (const XYZTLorentzVector &hit2=XYZTLorentzVector(0., 0., 0., 0.))
 
void setPropagationConditions (const TrackerLayer &, bool firstLoop=true)
 
- Public Member Functions inherited from BaseParticlePropagator
bool backPropagate ()
 
 BaseParticlePropagator ()
 Default c'tor. More...
 
 BaseParticlePropagator (const RawParticle &myPart, double r, double z, double B)
 
 BaseParticlePropagator (const RawParticle &myPart, double r, double z, double B, double t)
 
double getMagneticField () const
 Get the magnetic field. More...
 
int getSuccess () const
 Has propagation been performed and was barrel or endcap reached ? More...
 
bool hasDecayed () const
 Has the particle decayed while propagated ? More...
 
double helixCentreDistToAxis () const
 The distance between the cylinder and the helix axes. More...
 
double helixCentreDistToAxis (double xC, double yC) const
 
double helixCentrePhi () const
 The azimuth if the vector joining the cylinder and the helix axes. More...
 
double helixCentrePhi (double xC, double yC) const
 
double helixCentreX () const
 The x coordinate of the helix axis. More...
 
double helixCentreX (double radius, double phi) const
 
double helixCentreY () const
 The y coordinate of the helix axis. More...
 
double helixCentreY (double radius, double phi) const
 
double helixRadius () const
 The helix Radius. More...
 
double helixRadius (double pT) const
 
double helixStartPhi () const
 The azimuth of the momentum at the vertex. More...
 
void increaseRCyl (double delta)
 Just an internal trick. More...
 
void init ()
 Initialize internal switches and quantities. More...
 
bool inside () const
 Is the vertex inside the cylinder ? (stricly inside : true) More...
 
bool inside (double rPos2) const
 
bool onBarrel () const
 Is the vertex already on the cylinder barrel ? More...
 
bool onBarrel (double rPos2) const
 
bool onEndcap () const
 Is the vertex already on the cylinder endcap ? More...
 
bool onEndcap (double rPos2) const
 
bool onFiducial () const
 Is the vertex on some material ? More...
 
bool onSurface () const
 Is the vertex already on the cylinder surface ? More...
 
bool onSurface (double rPos2) const
 
RawParticleparticle ()
 
RawParticle const & particle () const
 The particle being propagated. More...
 
bool propagate ()
 
BaseParticlePropagator propagated () const
 
bool propagateToBeamCylinder (const XYZTLorentzVector &v, double radius=0.)
 
bool propagateToClosestApproach (double x0=0., double y0=0, bool first=true)
 
bool propagateToEcal (bool first=true)
 
bool propagateToEcalEntrance (bool first=true)
 
bool propagateToHcalEntrance (bool first=true)
 
bool propagateToHcalExit (bool first=true)
 
bool propagateToHOLayer (bool first=true)
 
bool propagateToNominalVertex (const XYZTLorentzVector &hit2=XYZTLorentzVector(0., 0., 0., 0.))
 
bool propagateToPreshowerLayer1 (bool first=true)
 
bool propagateToPreshowerLayer2 (bool first=true)
 
bool propagateToVFcalEntrance (bool first=true)
 
void resetDebug ()
 
void setDebug ()
 Set the debug leve;. More...
 
void setMagneticField (double b)
 Set the magnetic field. More...
 
void setParticle (RawParticle const &iParticle)
 
void setPropagationConditions (double r, double z, bool firstLoop=true)
 Set the propagation characteristics (rCyl, zCyl and first loop only) More...
 
void setProperDecayTime (double t)
 Set the proper decay time. More...
 
double xyImpactParameter (double x0=0., double y0=0.) const
 Transverse impact parameter. More...
 
double zImpactParameter (double x0=0, double y0=0.) const
 Longitudinal impact parameter. More...
 

Private Attributes

const RandomEngineAndDistributionrandom
 
const MagneticFieldMaptheFieldMap
 
const HepPDT::ParticleDataTabletheTable = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from BaseParticlePropagator
double c_light () const
 The speed of light in mm/ns (!) without clhep (yeaaahhh!) More...
 
- Protected Attributes inherited from BaseParticlePropagator
bool fiducial
 The particle traverses some real material. More...
 
int success
 0:propagation still be done, 1:reached 'barrel', 2:reached 'endcaps' More...
 

Detailed Description

Definition at line 28 of file ParticlePropagator.h.

Constructor & Destructor Documentation

◆ ParticlePropagator() [1/8]

ParticlePropagator::ParticlePropagator ( )

Default c'tor.

Definition at line 15 of file ParticlePropagator.cc.

15 : BaseParticlePropagator(), random(nullptr) { ; }

Referenced by propagated().

◆ ParticlePropagator() [2/8]

ParticlePropagator::ParticlePropagator ( const RawParticle myPart,
double  R,
double  Z,
const MagneticFieldMap aFieldMap,
const RandomEngineAndDistribution engine,
const HepPDT::ParticleDataTable table 
)

Constructor taking as arguments a RawParticle, as well as the radius, half-height and magnetic field defining the cylinder for which propagation is to be performed

Definition at line 17 of file ParticlePropagator.cc.

23  : BaseParticlePropagator(myPart, RCyl, ZCyl, 0.), theFieldMap(aFieldMap), random(engine), theTable(table) {
26 }

References fieldMap(), initProperDecayTime(), BaseParticlePropagator::particle(), BaseParticlePropagator::setMagneticField(), X, BeamSpotPI::Y, and BeamSpotPI::Z.

◆ ParticlePropagator() [3/8]

ParticlePropagator::ParticlePropagator ( const RawParticle myPart,
const MagneticFieldMap aFieldMap,
const RandomEngineAndDistribution engine,
const HepPDT::ParticleDataTable table 
)

Constructor with only a RawParticle as argument for subsequent propagation to known surfaces (ECAL, HCAL ...)

Definition at line 28 of file ParticlePropagator.cc.

32  : BaseParticlePropagator(myPart, 0., 0., 0.),
33  theFieldMap(aFieldMap),
34  random(engine),
36 
37 {
40 }

References fieldMap(), initProperDecayTime(), BaseParticlePropagator::particle(), BaseParticlePropagator::setMagneticField(), X, BeamSpotPI::Y, and BeamSpotPI::Z.

◆ ParticlePropagator() [4/8]

ParticlePropagator::ParticlePropagator ( const XYZTLorentzVector p,
const XYZTLorentzVector v,
float  q,
const MagneticFieldMap aFieldMap,
const HepPDT::ParticleDataTable table 
)

Constructor with two LorentzVector (momentum and vertex (in cm)) and an electric charge propagation to known surfaces (ECAL, HCAL ...)

Definition at line 42 of file ParticlePropagator.cc.

47  : BaseParticlePropagator(RawParticle(mom, vert, q), 0., 0., 0.),
48  theFieldMap(aFieldMap),
49  random(nullptr),
50  theTable(table) {
52 }

References fieldMap(), BaseParticlePropagator::particle(), BaseParticlePropagator::setMagneticField(), X, BeamSpotPI::Y, and BeamSpotPI::Z.

◆ ParticlePropagator() [5/8]

ParticlePropagator::ParticlePropagator ( const XYZTLorentzVector p,
const XYZVector v,
float  q,
const MagneticFieldMap aFieldMap,
const HepPDT::ParticleDataTable table 
)

Constructor with a LorentzVector (momentum), a Hep3Vector (vertex in cm) and an electric charge propagation to known surfaces (ECAL, HCAL ...)

Definition at line 54 of file ParticlePropagator.cc.

59  : BaseParticlePropagator(RawParticle(mom, XYZTLorentzVector(vert.X(), vert.Y(), vert.Z(), 0.0), q), 0., 0., 0.),
60  theFieldMap(aFieldMap),
61  random(nullptr),
62  theTable(table) {
64 }

References fieldMap(), BaseParticlePropagator::particle(), BaseParticlePropagator::setMagneticField(), X, BeamSpotPI::Y, and BeamSpotPI::Z.

◆ ParticlePropagator() [6/8]

ParticlePropagator::ParticlePropagator ( const FSimTrack simTrack,
const MagneticFieldMap aFieldMap,
const RandomEngineAndDistribution engine,
const HepPDT::ParticleDataTable table 
)

Constructor with a FSimTrack from the FSimEvent

Definition at line 66 of file ParticlePropagator.cc.

71  makeParticle(table, simTrack.type(), simTrack.momentum(), simTrack.vertex().position()), 0., 0., 0.),
72  theFieldMap(aFieldMap),
73  random(engine),
74  theTable(table) {
76  if (simTrack.decayTime() < 0.) {
77  if (simTrack.nDaughters())
78  // This particle already decayed, don't decay it twice
79  this->setProperDecayTime(1E99);
80  else
81  // This particle hasn't decayed yet. Decay time according to particle lifetime
83  } else {
84  // Decay time pre-defined at generator level
85  this->setProperDecayTime(simTrack.decayTime());
86  }
87 }

References FSimTrack::decayTime(), fieldMap(), initProperDecayTime(), BaseParticlePropagator::particle(), BaseParticlePropagator::setMagneticField(), BaseParticlePropagator::setProperDecayTime(), cscDigiValidation_cfi::simTrack, X, BeamSpotPI::Y, and BeamSpotPI::Z.

◆ ParticlePropagator() [7/8]

ParticlePropagator::ParticlePropagator ( const ParticlePropagator myPropPart)

Constructor with a (Base)ParticlePropagator

Definition at line 89 of file ParticlePropagator.cc.

90  : BaseParticlePropagator(myPropPart), theFieldMap(myPropPart.theFieldMap) {
91  // setMagneticField(fieldMap(x(),y(),z()));
92 }

◆ ParticlePropagator() [8/8]

ParticlePropagator::ParticlePropagator ( const BaseParticlePropagator myPropPart,
const MagneticFieldMap aFieldMap,
const HepPDT::ParticleDataTable table 
)

Member Function Documentation

◆ fieldMap() [1/2]

double ParticlePropagator::fieldMap ( const TrackerLayer layer,
double  coord,
int  success 
)

Definition at line 132 of file ParticlePropagator.cc.

132  {
133  // Arguments now passed in cm.
134  // return MagneticFieldMap::instance()->inTesla(GlobalPoint(xx/10.,yy/10.,zz/10.)).z();
135  // Return a dummy value for neutral particles!
136  return particle().charge() == 0.0 || theFieldMap == nullptr ? 4. : theFieldMap->inTeslaZ(layer, coord, success);
137 }

References RawParticle::charge(), MagneticFieldMap::inTeslaZ(), phase1PixelTopology::layer, BaseParticlePropagator::particle(), BaseParticlePropagator::success, and theFieldMap.

◆ fieldMap() [2/2]

double ParticlePropagator::fieldMap ( double  x,
double  y,
double  z 
)

The fieldMap given by the detector geormetry

Definition at line 125 of file ParticlePropagator.cc.

125  {
126  // Arguments now passed in cm.
127  // return MagneticFieldMap::instance()->inTesla(GlobalPoint(xx/10.,yy/10.,zz/10.)).z();
128  // Return a dummy value for neutral particles!
129  return particle().charge() == 0.0 || theFieldMap == nullptr ? 4. : theFieldMap->inTeslaZ(GlobalPoint(xx, yy, zz));
130 }

References RawParticle::charge(), MagneticFieldMap::inTeslaZ(), BaseParticlePropagator::particle(), theFieldMap, geometryCSVtoXML::xx, geometryCSVtoXML::yy, and geometryCSVtoXML::zz.

Referenced by ParticlePropagator(), propagateToBoundSurface(), propagateToClosestApproach(), and propagateToNominalVertex().

◆ initProperDecayTime()

void ParticlePropagator::initProperDecayTime ( )

Initialize the proper decay time of the particle

Definition at line 101 of file ParticlePropagator.cc.

101  {
102  // And this is the proper time at which the particle will decay
103  double properDecayTime = (particle().pid() == 0 || particle().pid() == 22 || abs(particle().pid()) == 11 ||
104  abs(particle().pid()) == 2112 || abs(particle().pid()) == 2212 || !random)
105  ? 1E99
107 
108  this->setProperDecayTime(properDecayTime);
109 }

References funct::abs(), pdg::cTau(), RandomEngineAndDistribution::flatShoot(), dqm-mbProfile::log, BaseParticlePropagator::particle(), RawParticle::pid(), BaseParticlePropagator::properDecayTime, random, BaseParticlePropagator::setProperDecayTime(), and theTable.

Referenced by ParticlePropagator().

◆ particleDataTable()

const HepPDT::ParticleDataTable* ParticlePropagator::particleDataTable ( ) const
inline

Definition at line 100 of file ParticlePropagator.h.

100 { return theTable; }

References theTable.

Referenced by PythiaDecays::particleDaughters().

◆ propagated()

ParticlePropagator ParticlePropagator::propagated ( ) const

Return a new instance, corresponding to the particle propagated to the surface of the cylinder

Definition at line 121 of file ParticlePropagator.cc.

References ParticlePropagator(), BaseParticlePropagator::propagated(), theFieldMap, and theTable.

◆ propagateToBoundSurface()

bool ParticlePropagator::propagateToBoundSurface ( const TrackerLayer layer)

Definition at line 139 of file ParticlePropagator.cc.

139  {
140  fiducial = true;
141  BoundDisk const* disk = layer.disk();
142  // bool disk = layer.forward();
143  // double innerradius=-999;
144  double innerradius = disk ? layer.diskInnerRadius() : -999.;
145 
146  // if( disk ) {
147  // const Surface& surface = layer.surface();
148  // const BoundDisk & myDisk = dynamic_cast<const BoundDisk&>(surface);
149  // innerradius=myDisk.innerRadius();
150  // innerradius=myDisk->innerRadius();
151  // }
152 
153  bool done = propagate();
154 
155  // Set the magnetic field at the new location (if succesfully propagated)
156  if (done && !hasDecayed()) {
157  if (success == 2)
159  else if (success == 1)
161  }
162 
163  // There is some real material here
164  fiducial = !(!disk && success != 1) && !(disk && (success != 2 || particle().r() < innerradius));
165 
166  return done;
167 }

References fileCollector::done, BaseParticlePropagator::fiducial, fieldMap(), BaseParticlePropagator::hasDecayed(), phase1PixelTopology::layer, BaseParticlePropagator::particle(), BaseParticlePropagator::propagate(), alignCSCRings::r, BaseParticlePropagator::setMagneticField(), BaseParticlePropagator::success, and z.

Referenced by TrajectoryManager::propagateToLayer().

◆ propagateToClosestApproach()

bool ParticlePropagator::propagateToClosestApproach ( double  x0 = 0.,
double  y0 = 0.,
bool  first = true 
)

Update the particle after propagation to the closest approach from Z axis, to the preshower layer 1 & 2, to the ECAL entrance, to the HCAL entrance, the HCAL 2nd and 3rd layer (not coded yet), the VFCAL entrance, or any BoundSurface(disk or cylinder)

Definition at line 111 of file ParticlePropagator.cc.

111  {
112  setMagneticField(fieldMap(0., 0., 0.));
114 }

References fieldMap(), first, BaseParticlePropagator::propagateToClosestApproach(), and BaseParticlePropagator::setMagneticField().

◆ propagateToNominalVertex()

bool ParticlePropagator::propagateToNominalVertex ( const XYZTLorentzVector hit2 = XYZTLorentzVector(0., 0., 0., 0.))

◆ setPropagationConditions()

void ParticlePropagator::setPropagationConditions ( const TrackerLayer layer,
bool  firstLoop = true 
)

Definition at line 169 of file ParticlePropagator.cc.

169  {
170  // Set the magentic field
171  // setMagneticField(fieldMap(x(),y(),z()));
172 
173  // Set R and Z according to the Tracker Layer characteristics.
174  // const Surface& surface = layer.surface();
175 
176  if (layer.forward()) {
177  // const BoundDisk & myDisk = dynamic_cast<const BoundDisk&>(surface);
178  // ParticlePropagator works in mm, whereas the detector geometry is in cm
180  layer.diskOuterRadius(), fabs(layer.disk()->position().z()), firstLoop);
181 
182  // ... or if it is a cylinder barrel
183  } else {
184  // const BoundCylinder & myCylinder = dynamic_cast<const BoundCylinder &>(surface);
185  // ParticlePropagator works now in cm
187  layer.cylinder()->bounds().width() / 2., layer.cylinder()->bounds().length() / 2., firstLoop);
188  }
189 }

References BaseParticlePropagator::firstLoop, phase1PixelTopology::layer, and BaseParticlePropagator::setPropagationConditions().

Referenced by ConvBremSeedProducer::produce(), and TrajectoryManager::propagateToLayer().

Member Data Documentation

◆ random

const RandomEngineAndDistribution* ParticlePropagator::random
private

Definition at line 104 of file ParticlePropagator.h.

Referenced by initProperDecayTime().

◆ theFieldMap

const MagneticFieldMap* ParticlePropagator::theFieldMap
private

Definition at line 103 of file ParticlePropagator.h.

Referenced by fieldMap(), and propagated().

◆ theTable

const HepPDT::ParticleDataTable* ParticlePropagator::theTable = nullptr
private

Definition at line 105 of file ParticlePropagator.h.

Referenced by initProperDecayTime(), particleDataTable(), and propagated().

cscDigiValidation_cfi.simTrack
simTrack
Definition: cscDigiValidation_cfi.py:29
RawParticle
Definition: RawParticle.h:37
geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
BaseParticlePropagator::particle
RawParticle const & particle() const
The particle being propagated.
Definition: BaseParticlePropagator.h:164
makeParticle
RawParticle makeParticle(HepPDT::ParticleDataTable const *, int id, const math::XYZTLorentzVector &p)
Definition: makeParticle.cc:28
X
#define X(str)
Definition: MuonsGrabber.cc:38
ParticlePropagator::fieldMap
double fieldMap(double x, double y, double z)
Definition: ParticlePropagator.cc:125
MagneticFieldMap::inTeslaZ
double inTeslaZ(const GlobalPoint &) const
Definition: MagneticFieldMap.cc:91
FSimTrack::decayTime
double decayTime() const
Return the pre-defined decay time.
Definition: FSimTrack.h:218
ParticlePropagator::initProperDecayTime
void initProperDecayTime()
Definition: ParticlePropagator.cc:101
RawParticle::pid
int pid() const
get the HEP particle ID number
Definition: RawParticle.h:277
XYZTLorentzVector
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:25
BaseParticlePropagator::setProperDecayTime
void setProperDecayTime(double t)
Set the proper decay time.
Definition: BaseParticlePropagator.h:169
findQualityFiles.v
v
Definition: findQualityFiles.py:179
RawParticle::charge
double charge() const
get the MEASURED charge
Definition: RawParticle.h:294
ParticlePropagator::theTable
const HepPDT::ParticleDataTable * theTable
Definition: ParticlePropagator.h:105
BoundDisk
fileCollector.done
done
Definition: fileCollector.py:123
DDAxes::z
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
ParticlePropagator::theFieldMap
const MagneticFieldMap * theFieldMap
Definition: ParticlePropagator.h:103
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
BaseParticlePropagator::fiducial
bool fiducial
The particle traverses some real material.
Definition: BaseParticlePropagator.h:147
geometryCSVtoXML.yy
yy
Definition: geometryCSVtoXML.py:19
BaseParticlePropagator::propagate
bool propagate()
Definition: BaseParticlePropagator.cc:34
BaseParticlePropagator::success
int success
0:propagation still be done, 1:reached 'barrel', 2:reached 'endcaps'
Definition: BaseParticlePropagator.h:145
BaseParticlePropagator::BaseParticlePropagator
BaseParticlePropagator()
Default c'tor.
Definition: BaseParticlePropagator.cc:5
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
ParticlePropagator::random
const RandomEngineAndDistribution * random
Definition: ParticlePropagator.h:104
BaseParticlePropagator::propagateToNominalVertex
bool propagateToNominalVertex(const XYZTLorentzVector &hit2=XYZTLorentzVector(0., 0., 0., 0.))
Definition: BaseParticlePropagator.cc:566
RandomEngineAndDistribution::flatShoot
double flatShoot(double xmin=0.0, double xmax=1.0) const
Definition: RandomEngineAndDistribution.h:27
BaseParticlePropagator::setMagneticField
void setMagneticField(double b)
Set the magnetic field.
Definition: BaseParticlePropagator.h:299
BaseParticlePropagator::setPropagationConditions
void setPropagationConditions(double r, double z, bool firstLoop=true)
Set the propagation characteristics (rCyl, zCyl and first loop only)
Definition: BaseParticlePropagator.cc:318
alignCSCRings.r
r
Definition: alignCSCRings.py:93
pdg::cTau
double cTau(int pdgID, const HepPDT::ParticleDataTable *pdt)
Definition: pdg_functions.cc:26
BaseParticlePropagator::firstLoop
bool firstLoop
Do only the first half-loop.
Definition: BaseParticlePropagator.h:154
BaseParticlePropagator::propagated
BaseParticlePropagator propagated() const
Definition: BaseParticlePropagator.cc:304
BaseParticlePropagator::propagateToClosestApproach
bool propagateToClosestApproach(double x0=0., double y0=0, bool first=true)
Definition: BaseParticlePropagator.cc:325
BeamSpotPI::Y
Definition: BeamSpotPayloadInspectorHelper.h:32
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
BeamSpotPI::Z
Definition: BeamSpotPayloadInspectorHelper.h:33
BaseParticlePropagator::properDecayTime
double properDecayTime
The proper decay time of the particle.
Definition: BaseParticlePropagator.h:139
TableParser.table
table
Definition: TableParser.py:111
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
ParticlePropagator::ParticlePropagator
ParticlePropagator()
Default c'tor.
Definition: ParticlePropagator.cc:15
BaseParticlePropagator::hasDecayed
bool hasDecayed() const
Has the particle decayed while propagated ?
Definition: BaseParticlePropagator.h:293