CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/SimMuon/CSCDigitizer/src/CSCGasCollisions.h

Go to the documentation of this file.
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 "SimDataFormats/TrackingHit/interface/PSimHit.h"
00016 #include "SimMuon/CSCDigitizer/src/CSCCrossGap.h"
00017 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
00018 #include "CLHEP/Random/RandFlat.h"
00019 #include "CLHEP/Random/RandExponential.h"
00020 
00021 #include <vector>
00022 #include <string>
00023 
00024 class CSCGasCollisions {
00025 public:
00026 
00027    CSCGasCollisions();
00028    virtual ~CSCGasCollisions();
00029 
00030    void setParticleDataTable(const ParticleDataTable * pdt);
00031 
00032    void setRandomEngine(CLHEP::HepRandomEngine & engine);
00033 
00034    void simulate(const PSimHit&, 
00035       std::vector<LocalPoint>& clusters, std::vector<int>& electrons );
00036 
00037    static const int N_GAMMA = 21;
00038    static const int N_ENERGY = 63;
00039    static const int N_ENTRIES = N_GAMMA*N_ENERGY;
00040    static const int MAX_STEPS = 400;
00041 
00042 private:
00043    void readCollisionTable();
00044    void fillCollisionsForThisGamma( float, std::vector<float>& ) const;
00045    float lnEnergyLoss( float, const std::vector<float>& ) const;
00046    double generateStep( double avCollisions ) const;
00047    float generateEnergyLoss( double avCollisions, 
00048       double anmin, double anmax, const std::vector<float>& collisions ) const;
00049 
00050    void ionize( double energyTransferred, LocalPoint startHere) const;
00051         
00052    void writeSummary( int n_steps, double sum_steps, float dedx, float simHiteloss ) const;
00053 
00054    const std::string me;       // class name
00055    double gasDensity;     // Density of CSC gas mix
00056    // The question of what is reasonable for deCut is complex. But it seems clear that
00057    // this simulation is not credible if any delta electrons generated here
00058    // have ranges more than a few mm, or equivalently, energies above a few keV.
00059    // deCut = 1000 = 1 keV
00060    // deCut = 10000 = 10 keV
00061    double deCut;          // Delta electron cutoff in eV (Match GEANT!)
00062    double eion;           // ionization threshold (eV) (min. E for ionizatiom)
00063    double ework;          // effective work function (av. energy to create one ion pair)
00064    double clusterExtent;  // Precision of localization of ion clus. Typically 10 microns.
00065 
00066    std::vector<float> theGammaBins;
00067    std::vector<float> theEnergyBins;
00068    std::vector<float> theCollisionTable;
00069 
00070    CSCCrossGap* theCrossGap; // Owned by CSCGasCollisions
00071    const ParticleDataTable * theParticleDataTable;
00072    CLHEP::RandFlat * theRandFlat;
00073    CLHEP::RandExponential * theRandExponential;
00074    bool saveGasCollisions; // Simple Configurable to flag saving info w. debugV
00075 };
00076 
00077 #endif