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
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 class MaterialEffectsSimulator {
0026 public:
0027 typedef std::vector<RawParticle>::const_iterator RHEP_const_iter;
0028
0029
0030 MaterialEffectsSimulator(double A = 28.0855, double Z = 14.0000, double density = 2.329, double radLen = 9.360);
0031
0032 virtual ~MaterialEffectsSimulator();
0033
0034
0035
0036
0037
0038 inline double theA() const { return A; }
0039
0040 inline double theZ() const { return Z; }
0041
0042 inline double rho() const { return density; }
0043
0044 inline double radLenIncm() const { return radLen; }
0045
0046 inline double excitE() const { return 12.5E-9 * theZ(); }
0047
0048 inline double eMass() const { return 0.000510998902; }
0049
0050
0051 void updateState(ParticlePropagator& myTrack, double radlen, RandomEngineAndDistribution const*);
0052
0053
0054 inline RHEP_const_iter beginDaughters() const { return _theUpdatedState.begin(); }
0055
0056
0057 inline RHEP_const_iter endDaughters() const { return _theUpdatedState.end(); }
0058
0059
0060 inline unsigned nDaughters() const { return _theUpdatedState.size(); }
0061
0062
0063 inline void setNormalVector(const GlobalVector& normal) { theNormalVector = normal; }
0064
0065
0066 XYZVector orthogonal(const XYZVector&) const;
0067
0068
0069 inline int closestDaughterId() { return theClosestChargedDaughterId; }
0070
0071
0072 virtual void save(){};
0073
0074 private:
0075
0076 virtual void compute(ParticlePropagator& Particle, RandomEngineAndDistribution const*) = 0;
0077
0078
0079 inline double radiationLength() const { return radLengths; }
0080
0081 protected:
0082 std::vector<RawParticle> _theUpdatedState;
0083
0084 double radLengths;
0085
0086
0087 double A;
0088 double Z;
0089 double density;
0090 double radLen;
0091
0092 GlobalVector theNormalVector;
0093
0094 int theClosestChargedDaughterId;
0095 };
0096
0097 #endif