Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:12

0001 #ifndef MU_END_CSC_GAS_COLLISIONS_H
0002 #define MU_END_CSC_GAS_COLLISIONS_H
0003 
0004 /** \class CSCGasCollisions
0005  * Class to handle CSC gas ionization simulation during digitization.
0006  *
0007  * \author Tim Cox
0008  *
0009  * This class contains the port of the old CMSIM/ORCA Fortran routine
0010  * mc_clus.F, and the GEANT3 code it relied on.
0011  * Of course the version here is much improved :) <BR>
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;  // class name
0063   double gasDensity;     // Density of CSC gas mix
0064   // The question of what is reasonable for deCut is complex. But it seems clear
0065   // that this simulation is not credible if any delta electrons generated here
0066   // have ranges more than a few mm, or equivalently, energies above a few keV.
0067   // deCut = 1000 = 1 keV
0068   // deCut = 10000 = 10 keV
0069   double deCut;          // Delta electron cutoff in eV (Match GEANT!)
0070   double eion;           // ionization threshold (eV) (min. E for ionizatiom)
0071   double ework;          // effective work function (av. energy to create one ion pair)
0072   double clusterExtent;  // Precision of localization of ion clus. Typically 10
0073                          // microns.
0074 
0075   std::vector<float> theGammaBins;
0076   std::vector<float> theEnergyBins;
0077   std::vector<float> theCollisionTable;
0078 
0079   CSCCrossGap *theCrossGap;  // Owned by CSCGasCollisions
0080   const ParticleDataTable *theParticleDataTable;
0081   bool saveGasCollisions_;  // write file of collisions details (not yet
0082                             // implemented in cmssw)
0083   bool dumpGasCollisions_;  // flag to write summary
0084 };
0085 
0086 #endif