Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef MU_END_DRIFT_SIM_H
0002 #define MU_END_DRIFT_SIM_H
0003 
0004 /** \class CSCDriftSim
0005  * Simulate drift of electrons through CSC gas.
0006  *
0007  * \author Rick Wilkinson
0008  *
0009  * Someday this class will be subclassed into fast and slow sims,
0010  * Now it's just slow, according to the rest of the ORCA developers...
0011  *
0012  * Last mod: <BR>
0013  * 30-Jun-00 ptc Doxygenate. <BR>
0014  *               Bug-fix in ctor: first bin of integral was 'nan'. <BR>
0015  *               Bug-trap in avalancheCharge(): very rarely could attempt access
0016  * outside std::vector. <BR> <p> 01-08/00 vin  use binary search in
0017  * avalancheCharge()<br>
0018  */
0019 
0020 #include <vector>
0021 class CSCLayer;
0022 class CSCDetectorHit;
0023 class PSimHit;
0024 class MagneticField;
0025 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0026 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0027 
0028 namespace CLHEP {
0029   class HepRandomEngine;
0030 }
0031 
0032 class CSCDriftSim {
0033 public:
0034   CSCDriftSim();
0035 
0036   ~CSCDriftSim();
0037 
0038   /** takes a point,
0039    and creates a signal on the wire
0040   */
0041   CSCDetectorHit getWireHit(const Local3DPoint &ionClusterPosition,
0042                             const CSCLayer *,
0043                             int wire,
0044                             const PSimHit &simHit,
0045                             CLHEP::HepRandomEngine *);
0046 
0047   void setMagneticField(const MagneticField *field) { theMagneticField = field; }
0048 
0049 private:
0050   // helper functions
0051   double avgPathLengthLowB();
0052   double pathSigmaLowB();
0053   double avgDriftTimeLowB();
0054   double driftTimeSigmaLowB();
0055   double avgPathLengthHighB();
0056   double pathSigmaHighB();
0057   double avgDriftTimeHighB();
0058   double driftTimeSigmaHighB();
0059   double avgDrift() const;
0060   double driftSigma() const;
0061   double avalancheCharge(CLHEP::HepRandomEngine *);
0062   double gasGain(const CSCDetId &id) const;
0063 
0064   // local magnetic field
0065   float bz;
0066   // distances from wire
0067   double ycell, zcell;
0068   // dN/dE for the avalanche sim.
0069   std::vector<double> dNdEIntegral;
0070   const double STEP_SIZE;
0071 
0072   const double ELECTRON_DIFFUSION_COEFF;
0073 
0074   const MagneticField *theMagneticField;
0075 };
0076 
0077 #endif