Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef MU_END_CROSS_GAP_H
0002 #define MU_END_CROSS_GAP_H
0003 
0004 /** \class CSCCrossGap
0005  * Class used to represent one CSC gas gap crossing by a charged track.
0006  *
0007  * \author Tim Cox
0008  *
0009  * This is used by CSCCSCGasCollisions in the digitization of the CSCs.
0010  * Actually this may NOT model the whole gas gap, but just the path length
0011  * corresponding to a PSimHit in the gap (i.e. from the PSimHit 'entry point'
0012  * to its 'exit point'). PSimHit's can have a pretty evanescent existence
0013  * and I can't pretend to have a full understanding of their full range
0014  * of characteristics. Yet another thing 'to be studied'.
0015  *
0016  */
0017 
0018 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0019 #include "DataFormats/GeometryVector/interface/LocalVector.h"
0020 #include <vector>
0021 
0022 class CSCCrossGap {
0023 public:
0024   /**
0025    * iam = particle type in PDG code.
0026    * mom = momentum of particle
0027    * gap = space std::vector representing the hit entry and exit
0028    */
0029   CSCCrossGap(double mass, float mom, LocalVector gap);
0030   ~CSCCrossGap(){};
0031 
0032   std::vector<LocalPoint> ionClusters() const { return clusters; }
0033   int noOfClusters() const { return clusters.size(); }
0034   std::vector<int> electrons() const { return electronsInClusters; }
0035   int noOfElectrons() const { return electronsInClusters.size(); }
0036   std::vector<double> stepLengths() const { return steps; }
0037   int noOfSteps() const { return steps.size(); }
0038   std::vector<float> eLossPerStep() const { return elosses; }
0039   int noOfElosses() const { return elosses.size(); }
0040 
0041   void addCluster(LocalPoint here) { clusters.push_back(here); }
0042   void addElectrons(int nelec = 1) { electronsInClusters.push_back(nelec); }
0043   void addElectronToBack() { ++electronsInClusters.back(); }
0044 
0045   void addStep(double step) { steps.push_back(step); }
0046   void addEloss(float eloss) { elosses.push_back(eloss); }
0047 
0048   double logGamma(double mass, float momentum);
0049   double logGamma() { return loggam; }
0050   double beta2() const { return theBeta2; }
0051   double gamma() const { return theGamma; }
0052   LocalVector gapVector() const { return theGap; }
0053   LocalVector unitVector() const { return theGap.unit(); }
0054   float length() const { return theGap.mag(); }
0055 
0056 private:
0057   double theBeta2;  // Lorentz beta^2
0058   double theGamma;  // Lorentz gamma
0059   double loggam;
0060   LocalVector theGap;
0061 
0062   std::vector<LocalPoint> clusters;
0063   std::vector<int> electronsInClusters;
0064   std::vector<double> steps;
0065   std::vector<float> elosses;
0066 };
0067 
0068 #endif