Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:25

0001 #ifndef DTTMax_H
0002 #define DTTMax_H
0003 
0004 /** \class DTTMax
0005  *  Class to calculate the different TMax values according to
0006  *  the track path
0007  *
0008 
0009  *  \author Marina Giunta
0010  */
0011 
0012 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0013 #include "DataFormats/DTRecHit/interface/DTRecHit1D.h"
0014 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0015 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0016 #include "Histogram.h"
0017 
0018 #include <string>
0019 #include <vector>
0020 
0021 class DTSuperLayer;
0022 class DTSuperLayerId;
0023 class DTTTrigBaseSync;
0024 
0025 namespace dttmaxenums {
0026   enum TMaxCells { c123, c124, c134, c234, notInit };
0027   enum SigmaFactor { r32, r72, r78, noR };
0028   enum SegDir { L, R };
0029 }  // namespace dttmaxenums
0030 
0031 class DTTMax {
0032 public:
0033   typedef dttmaxenums::TMaxCells TMaxCells;
0034   typedef dttmaxenums::SegDir SegDir;
0035   typedef dttmaxenums::SigmaFactor SigmaFactor;
0036 
0037   /// Constructor
0038   DTTMax(const std::vector<DTRecHit1D>& hits,
0039          const DTSuperLayer& isl,
0040          GlobalVector dir,
0041          GlobalPoint pos,
0042          const DTTTrigBaseSync& sync,
0043          dtcalibration::Histograms& hist);
0044 
0045   /// Destructor
0046   virtual ~DTTMax();
0047 
0048   /// Information on each of the four TMax values in a SL
0049   struct TMax {
0050     TMax(float t_, TMaxCells cells_, std::string type_, SigmaFactor sigma_, unsigned t0Factor_, unsigned hSubGroup_)
0051         : t(t_), cells(cells_), type(type_), sigma(sigma_), t0Factor(t0Factor_), hSubGroup(hSubGroup_) {}
0052 
0053     float t;
0054     TMaxCells cells;
0055     std::string type;    // LLR, LRL,...
0056     SigmaFactor sigma;   // factor relating the width of the Tmax distribution
0057                          // and the cell resolution
0058     unsigned t0Factor;   // "quantity" of Delta(t0) included in the tmax formula
0059     unsigned hSubGroup;  //different t0 hists (one hit within a given distance from the wire)
0060   };
0061 
0062   // All information on one of the layers crossed by the segment
0063   struct InfoLayer {
0064     InfoLayer(
0065         const DTRecHit1D& rh_, const DTSuperLayer& isl, GlobalVector dir, GlobalPoint pos, const DTTTrigBaseSync& sync);
0066     DTRecHit1D rh;
0067     DTWireId idWire;
0068     DTEnums::DTCellSide lr;
0069     float wireX;
0070     float time;
0071   };
0072 
0073   // Return the three TMax for a given cell
0074   std::vector<const TMax*> getTMax(const DTWireId& idWire);
0075 
0076   // Return the four TMaxes of the SL
0077   std::vector<const TMax*> getTMax(const DTSuperLayerId& isl);
0078 
0079   // Return one of the four TMaxes of the SL
0080   const TMax* getTMax(TMaxCells cCase);
0081 
0082   // Get InfoLayer (r/w) from layer number
0083   InfoLayer*& getInfoLayer(int layer) { return theInfoLayers[layer - 1]; }
0084 
0085 private:
0086   DTTMax(){};  // Hide default constructor
0087 
0088   //debug flag
0089   bool debug;
0090 
0091   std::vector<InfoLayer*> theInfoLayers;
0092   std::vector<TMax*> theTMaxes;
0093   SegDir theSegDir;
0094   std::string theSegType;  // LRLR, LRLL, ....
0095 };
0096 #endif