File indexing completed on 2024-04-06 12:30:42
0001 #ifndef MU_END_CSC_GAS_COLLISIONS_H
0002 #define MU_END_CSC_GAS_COLLISIONS_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0017 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
0018 #include "SimMuon/CSCDigitizer/src/CSCCrossGap.h"
0019
0020 #include <string>
0021 #include <vector>
0022
0023 namespace CLHEP {
0024 class HepRandomEngine;
0025 }
0026
0027 class CSCGasCollisions {
0028 public:
0029 CSCGasCollisions(const edm::ParameterSet &pset);
0030 virtual ~CSCGasCollisions();
0031
0032 void setParticleDataTable(const ParticleDataTable *pdt);
0033
0034 void simulate(const PSimHit &,
0035 std::vector<LocalPoint> &clusters,
0036 std::vector<int> &electrons,
0037 CLHEP::HepRandomEngine *);
0038
0039 bool dumpGasCollisions(void) const { return dumpGasCollisions_; }
0040 bool saveGasCollisions(void) const { return saveGasCollisions_; }
0041
0042 static const int N_GAMMA = 21;
0043 static const int N_ENERGY = 63;
0044 static const int N_ENTRIES = N_GAMMA * N_ENERGY;
0045 static const int MAX_STEPS = 400;
0046
0047 private:
0048 void readCollisionTable();
0049 void fillCollisionsForThisGamma(float, std::vector<float> &) const;
0050 float lnEnergyLoss(float, const std::vector<float> &) const;
0051 double generateStep(double avCollisions, CLHEP::HepRandomEngine *) const;
0052 float generateEnergyLoss(double avCollisions,
0053 double anmin,
0054 double anmax,
0055 const std::vector<float> &collisions,
0056 CLHEP::HepRandomEngine *) const;
0057
0058 void ionize(double energyTransferred, LocalPoint startHere) const;
0059
0060 void writeSummary(int n_try, int n_steps, double sum_steps, float dedx, const PSimHit &simhit) const;
0061
0062 const std::string me;
0063 double gasDensity;
0064
0065
0066
0067
0068
0069 double deCut;
0070 double eion;
0071 double ework;
0072 double clusterExtent;
0073
0074
0075 std::vector<float> theGammaBins;
0076 std::vector<float> theEnergyBins;
0077 std::vector<float> theCollisionTable;
0078
0079 CSCCrossGap *theCrossGap;
0080 const ParticleDataTable *theParticleDataTable;
0081 bool saveGasCollisions_;
0082
0083 bool dumpGasCollisions_;
0084 };
0085
0086 #endif