00001 #ifndef MU_END_CSC_GAS_COLLISIONS_H
00002 #define MU_END_CSC_GAS_COLLISIONS_H
00003
00014 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00015 #include "Geometry/CSCGeometry/interface/CSCLayer.h"
00016 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
00017 #include "SimMuon/CSCDigitizer/src/CSCCrossGap.h"
00018 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
00019 #include "CLHEP/Random/RandFlat.h"
00020 #include "CLHEP/Random/RandExponential.h"
00021
00022 #include <vector>
00023 #include <string>
00024
00025 class CSCGasCollisions {
00026 public:
00027
00028 CSCGasCollisions();
00029 virtual ~CSCGasCollisions();
00030
00031 void setParticleDataTable(const ParticleDataTable * pdt);
00032
00033 void setRandomEngine(CLHEP::HepRandomEngine & engine);
00034
00035 void simulate(const PSimHit&, const CSCLayer * layer,
00036 std::vector<LocalPoint>& clusters, std::vector<int>& electrons );
00037
00038 static const int N_GAMMA = 21;
00039 static const int N_ENERGY = 63;
00040 static const int N_ENTRIES = N_GAMMA*N_ENERGY;
00041 static const int MAX_STEPS = 400;
00042
00043 private:
00044 void readCollisionTable();
00045 void fillCollisionsForThisGamma( float, std::vector<float>& ) const;
00046 float lnEnergyLoss( float, const std::vector<float>& ) const;
00047 double generateStep( double avCollisions ) const;
00048 float generateEnergyLoss( double avCollisions,
00049 double anmin, double anmax, const std::vector<float>& collisions ) const;
00050
00051 void ionize( double energyTransferred, LocalPoint startHere) const;
00052
00053 void writeSummary( int n_steps, double sum_steps, float dedx ) const;
00054
00055 const std::string me;
00056 double gasDensity;
00057
00058
00059
00060
00061
00062 double deCut;
00063 double eion;
00064 double ework;
00065 double clusterExtent;
00066
00067 std::vector<float> theGammaBins;
00068 std::vector<float> theEnergyBins;
00069 std::vector<float> theCollisionTable;
00070
00071 CSCCrossGap* theCrossGap;
00072 const ParticleDataTable * theParticleDataTable;
00073 CLHEP::RandFlat * theRandFlat;
00074 CLHEP::RandExponential * theRandExponential;
00075 bool saveGasCollisions;
00076 };
00077
00078 #endif