Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:00:46

0001 #ifndef MATERIALEFFECTSSIMULATOR_H
0002 #define MATERIALEFFECTSSIMULATOR_H
0003 
0004 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0005 
0006 #include "FastSimulation/ParticlePropagator/interface/ParticlePropagator.h"
0007 
0008 #include <vector>
0009 
0010 class RandomEngineAndDistribution;
0011 
0012 /** 
0013  * This is the generic class for Material Effects in the tracker material, 
0014  * from which FamosPairProductionSimulator, FamosBremsstrahlungSimulator, 
0015  * FamosEnergyLossSimulator and FamosMultipleScatteringSimulator inherit. It
0016  * determines the fraction of radiation lengths traversed by the particle 
0017  * in this tracker layer, defines the tracker layer characteristics (hmmm,
0018  * 100% Silicon, very crude, but what can we do?) and returns a list of
0019  * new RawParticles if needed.
0020  *
0021  * \author Stephan Wynhoff, Florian Beaudette, Patrick Janot
0022  * $Date: Last update 8-Jan-2004
0023  */
0024 
0025 class MaterialEffectsSimulator {
0026 public:
0027   typedef std::vector<RawParticle>::const_iterator RHEP_const_iter;
0028 
0029   // Constructor : default values are for Silicon
0030   MaterialEffectsSimulator(double A = 28.0855, double Z = 14.0000, double density = 2.329, double radLen = 9.360);
0031 
0032   virtual ~MaterialEffectsSimulator();
0033 
0034   /// Functions to return atomic properties of the material
0035   /// Here the tracker material is assumed to be 100% Silicon
0036 
0037   /// A
0038   inline double theA() const { return A; }
0039   /// Z
0040   inline double theZ() const { return Z; }
0041   ///Density in g/cm3
0042   inline double rho() const { return density; }
0043   ///One radiation length in cm
0044   inline double radLenIncm() const { return radLen; }
0045   ///Mean excitation energy (in GeV)
0046   inline double excitE() const { return 12.5E-9 * theZ(); }
0047   ///Electron mass in GeV/c2
0048   inline double eMass() const { return 0.000510998902; }
0049 
0050   /// Compute the material effect (calls the sub class)
0051   void updateState(ParticlePropagator& myTrack, double radlen, RandomEngineAndDistribution const*);
0052 
0053   /// Returns const iterator to the beginning of the daughters list
0054   inline RHEP_const_iter beginDaughters() const { return _theUpdatedState.begin(); }
0055 
0056   /// Returns const iterator to the end of the daughters list
0057   inline RHEP_const_iter endDaughters() const { return _theUpdatedState.end(); }
0058 
0059   /// Returns the number of daughters
0060   inline unsigned nDaughters() const { return _theUpdatedState.size(); }
0061 
0062   /// Sets the vector normal to the surface traversed
0063   inline void setNormalVector(const GlobalVector& normal) { theNormalVector = normal; }
0064 
0065   /// A vector orthogonal to another one (because it's not in XYZTLorentzVector)
0066   XYZVector orthogonal(const XYZVector&) const;
0067 
0068   /// The id of the closest charged daughter (filled for nuclear interactions only)
0069   inline int closestDaughterId() { return theClosestChargedDaughterId; }
0070 
0071   /// Used by  NuclearInteractionSimulator to save last sampled event
0072   virtual void save(){};
0073 
0074 private:
0075   /// Overloaded in all material effects updtators
0076   virtual void compute(ParticlePropagator& Particle, RandomEngineAndDistribution const*) = 0;
0077 
0078   /// Returns the fraction of radiation lengths traversed
0079   inline double radiationLength() const { return radLengths; }
0080 
0081 protected:
0082   std::vector<RawParticle> _theUpdatedState;
0083 
0084   double radLengths;
0085 
0086   // Material properties
0087   double A;
0088   double Z;
0089   double density;
0090   double radLen;
0091 
0092   GlobalVector theNormalVector;
0093 
0094   int theClosestChargedDaughterId;
0095 };
0096 
0097 #endif