Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:46:06

0001 /*Emacs: -*- C++ -*- */
0002 #ifndef PARTICLEPROPAGATOR_H
0003 #define PARTICLEPROPAGATOR_H
0004 
0005 /**
0006 * This class extend the BaseParticlePropagator class to the official 
0007 * field map, and with a few additional constructors specific to the 
0008 * framework. The member function 
0009 *
0010 *    propagateToBoundSurface(const Layer&)
0011 *
0012 * allows particles to be propagated to a boundSurface (only
0013 * cylinders and disks, though).
0014 *
0015 * \author Patrick Janot 
0016 * $Date : 19-Aug-2002, with subsequent modification for FAMOS
0017 * \version 15-Dec-2003 */
0018 
0019 // FAMOS Headers
0020 #include "CommonTools/BaseParticlePropagator/interface/BaseParticlePropagator.h"
0021 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
0022 
0023 class TrackerLayer;
0024 class FSimTrack;
0025 class RandomEngineAndDistribution;
0026 class MagneticFieldMap;
0027 
0028 class ParticlePropagator : public BaseParticlePropagator {
0029 public:
0030   /// Default c'tor
0031   ParticlePropagator();
0032 
0033   /** Constructor taking as arguments a RawParticle, as well as the radius,
0034       half-height and magnetic field defining the cylinder for which 
0035       propagation is to be performed */
0036   ParticlePropagator(const RawParticle& myPart,
0037                      double R,
0038                      double Z,
0039                      const MagneticFieldMap* aFieldMap,
0040                      const RandomEngineAndDistribution* engine,
0041                      const HepPDT::ParticleDataTable* table);
0042 
0043   /** Constructor with only a RawParticle as argument for subsequent 
0044       propagation to known surfaces (ECAL, HCAL ...) */
0045   ParticlePropagator(const RawParticle& myPart,
0046                      const MagneticFieldMap* aFieldMap,
0047                      const RandomEngineAndDistribution* engine,
0048                      const HepPDT::ParticleDataTable* table);
0049 
0050   /** Constructor with two LorentzVector (momentum and vertex (in cm)) and 
0051       an electric charge propagation to known surfaces (ECAL, HCAL ...) */
0052   ParticlePropagator(const XYZTLorentzVector& p,
0053                      const XYZTLorentzVector& v,
0054                      float q,
0055                      const MagneticFieldMap* aFieldMap,
0056                      const HepPDT::ParticleDataTable* table);
0057 
0058   /** Constructor with a LorentzVector (momentum), a Hep3Vector (vertex in cm)
0059       and an electric charge propagation to known surfaces (ECAL, HCAL ...) */
0060   ParticlePropagator(const XYZTLorentzVector& p,
0061                      const XYZVector& v,
0062                      float q,
0063                      const MagneticFieldMap* aFieldMap,
0064                      const HepPDT::ParticleDataTable* table);
0065 
0066   /** Constructor with a FSimTrack from the FSimEvent*/
0067   ParticlePropagator(const FSimTrack& simTrack,
0068                      const MagneticFieldMap* aFieldMap,
0069                      const RandomEngineAndDistribution* engine,
0070                      const HepPDT::ParticleDataTable* table);
0071 
0072   /** Constructor with a (Base)ParticlePropagator*/
0073   ParticlePropagator(const ParticlePropagator& myPropPart);
0074   //  ParticlePropagator(BaseParticlePropagator myPropPart);
0075   ParticlePropagator(const BaseParticlePropagator& myPropPart,
0076                      const MagneticFieldMap* aFieldMap,
0077                      const HepPDT::ParticleDataTable* table);
0078 
0079   /**Initialize the proper decay time of the particle*/
0080   void initProperDecayTime();
0081 
0082   /** Return a new instance, corresponding to the particle propagated
0083       to the surface of the cylinder */
0084   ParticlePropagator propagated() const;
0085 
0086   /** Update the particle after propagation to the closest approach from 
0087       Z axis, to the preshower layer 1 & 2, to the ECAL entrance, to the 
0088       HCAL entrance, the HCAL 2nd and 3rd layer (not coded yet), the VFCAL 
0089       entrance, or any BoundSurface(disk or cylinder)*/
0090   bool propagateToClosestApproach(double x0 = 0., double y0 = 0., bool first = true);
0091   bool propagateToNominalVertex(const XYZTLorentzVector& hit2 = XYZTLorentzVector(0., 0., 0., 0.));
0092 
0093   /** The fieldMap given by the detector geormetry */
0094   double fieldMap(double x, double y, double z);
0095   double fieldMap(const TrackerLayer& layer, double coord, int success);
0096 
0097   bool propagateToBoundSurface(const TrackerLayer&);
0098   void setPropagationConditions(const TrackerLayer&, bool firstLoop = true);
0099 
0100   const HepPDT::ParticleDataTable* particleDataTable() const { return theTable; }
0101 
0102 private:
0103   const MagneticFieldMap* theFieldMap;
0104   const RandomEngineAndDistribution* random;
0105   const HepPDT::ParticleDataTable* theTable = nullptr;
0106 };
0107 
0108 #endif