CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/CalibMuon/DTCalibration/interface/DTTMax.h

Go to the documentation of this file.
00001 #ifndef DTTMax_H
00002 #define DTTMax_H
00003 
00014 #include "FWCore/Framework/interface/EDAnalyzer.h"
00015 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00016 #include "DataFormats/DTRecHit/interface/DTRecHit1D.h"
00017 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00018 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00019 
00020 #include <string>
00021 #include <vector>
00022 
00023 class DTSuperLayer;
00024 class DTSuperLayerId;
00025 class DTTTrigBaseSync;
00026 
00027 namespace dttmaxenums{
00028   enum TMaxCells {c123, c124, c134, c234, notInit};
00029   enum SigmaFactor{r32, r72, r78, noR};
00030   enum SegDir {L, R};
00031 }
00032 
00033 
00034 class DTTMax {
00035  public:
00036   typedef dttmaxenums::TMaxCells TMaxCells;
00037   typedef dttmaxenums::SegDir SegDir;
00038   typedef dttmaxenums::SigmaFactor SigmaFactor;
00039   
00041   DTTMax(const std::vector<DTRecHit1D> & hits, const DTSuperLayer & isl, GlobalVector dir, 
00042          GlobalPoint pos, DTTTrigBaseSync* sync);
00043   
00045   virtual ~DTTMax();
00046   
00048   struct TMax{
00049     TMax(float t_, TMaxCells cells_, std::string type_, SigmaFactor sigma_, 
00050          unsigned t0Factor_,unsigned hSubGroup_) :
00051     t(t_), cells(cells_), type(type_), sigma(sigma_), t0Factor(t0Factor_), hSubGroup(hSubGroup_) {}
00052     
00053     float t;
00054     TMaxCells cells;
00055     std::string type;       // LLR, LRL,...
00056     SigmaFactor sigma; // factor relating the width of the Tmax distribution 
00057                        // and the cell resolution
00058     unsigned t0Factor; // "quantity" of Delta(t0) included in the tmax formula
00059     unsigned hSubGroup;//different t0 hists (one hit within a given distance from the wire)
00060   };
00061 
00062   // All information on one of the layers crossed by the segment
00063   struct InfoLayer {
00064     InfoLayer(DTRecHit1D rh_, const DTSuperLayer & isl, GlobalVector dir, 
00065               GlobalPoint pos, DTTTrigBaseSync* sync);
00066     DTRecHit1D rh;
00067     DTWireId idWire;
00068     DTEnums::DTCellSide lr;
00069     float wireX;
00070     float time;
00071   };
00072 
00073   // Return the three TMax for a given cell
00074   std::vector<const TMax*> getTMax(const DTWireId & idWire);
00075 
00076   // Return the four TMaxes of the SL
00077   std::vector<const TMax*> getTMax(const DTSuperLayerId & isl);
00078 
00079   // Return one of the four TMaxes of the SL
00080   const TMax* getTMax(TMaxCells cCase);
00081 
00082   // Get InfoLayer (r/w) from layer number
00083   InfoLayer*& getInfoLayer(int layer) {return theInfoLayers[layer-1];}
00084 
00085  private:
00086   DTTMax(){}; // Hide default constructor
00087 
00088   //debug flag 
00089   bool debug;
00090 
00091   std::vector<InfoLayer*> theInfoLayers;
00092   std::vector<TMax*> theTMaxes;
00093   SegDir theSegDir;
00094   std::string theSegType; // LRLR, LRLL, ....
00095 
00096 };
00097 #endif
00098