CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/DQM/DTMonitorModule/interface/DTCalibValidation.h

Go to the documentation of this file.
00001 #ifndef DTCalibValidation_H
00002 #define DTCalibValidation_H
00003 
00013 #include "FWCore/Framework/interface/Frameworkfwd.h"
00014 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
00015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00016 #include <FWCore/Framework/interface/EDAnalyzer.h>
00017 #include <FWCore/Framework/interface/LuminosityBlock.h>
00018 
00019 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00020 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
00021 #include "DataFormats/DTRecHit/interface/DTRecSegment2DCollection.h"
00022 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
00023 #include <FWCore/Framework/interface/ESHandle.h>
00024 
00025 #include <string>
00026 #include <map>
00027 #include <vector>
00028 
00029 
00030 // To remove into CMSSW versions before 20X
00031 class DQMStore;
00032 // To add into CMSSW versions before 20X
00033 //class DaqMonitorBEInterface;
00034 
00035 class MonitorElement;
00036 class DTGeometry;
00037 class DTChamber;
00038 
00039 
00040 class DTCalibValidation: public edm::EDAnalyzer{
00041  public:
00043   DTCalibValidation(const edm::ParameterSet& pset);
00044 
00046   virtual ~DTCalibValidation();
00047 
00049   void beginJob();
00050 
00052   void beginRun(const edm::Run&, const edm::EventSetup&);
00053 
00055   void endJob();
00056 
00057   // Operations
00058   void analyze(const edm::Event& event, const edm::EventSetup& setup);
00059 
00060 
00061  protected:
00062 
00063  private:
00064 
00065   // To remove into CMSSW versions before 20X
00066   DQMStore* theDbe;
00067   // To add into CMSSW versions before 20X
00068   //DaqMonitorBEInterface* theDbe;
00069 
00070   // Switch for verbosity
00071   //bool debug;
00072   edm::ParameterSet parameters;
00073   int wrongSegment;
00074   int rightSegment;
00075   int nevent;
00076   // the analysis type
00077   bool detailedAnalysis;
00078   // the geometry
00079   edm::ESHandle<DTGeometry> dtGeom;
00080 
00081   // Lable of 1D rechits in the event
00082   std::string recHits1DLabel;
00083   // Lable of 2D segments in the event
00084   std::string segment2DLabel;
00085   // Lable of 4D segments in the event
00086   std::string segment4DLabel;
00087 
00088   // Return a map between DTRecHit1DPair and wireId
00089   std::map<DTWireId, std::vector<DTRecHit1DPair> >
00090     map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs);
00091 
00092   // Return a map between DTRecHit1D and wireId
00093   std::map<DTWireId, std::vector<DTRecHit1D> >
00094     map1DRecHitsPerWire(const DTRecSegment2DCollection* segment2Ds);
00095 
00096   // Return a map between DTRecHit1D and wireId
00097   std::map<DTWireId, std::vector<DTRecHit1D> >
00098     map1DRecHitsPerWire(const DTRecSegment4DCollection* segment4Ds);
00099 
00100   template  <typename type>
00101   const type* 
00102   findBestRecHit(const DTLayer* layer,
00103                  DTWireId wireId,
00104                  const std::vector<type>& recHits,
00105                  const float simHitDist);
00106 
00107   // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
00108   float recHitDistFromWire(const DTRecHit1DPair& hitPair, const DTLayer* layer);
00109   // Compute the distance from wire (cm) of a hits in a DTRecHit1D
00110   float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
00111   // Compute the position with respect to the wire (cm) of a hits in a DTRecHit1DPair
00112   float recHitPosition(const DTRecHit1DPair& hitPair, const DTLayer* layer, const DTChamber* chamber, float segmPos, int sl);
00113   // Compute the position with respect to the wire (cm) of a hits in a DTRecHit1D
00114   float recHitPosition(const DTRecHit1D& recHit, const DTLayer* layer, const DTChamber* chamber, float segmPos, int sl);
00115   
00116   // Does the real job
00117   template  <typename type>
00118     void compute(const DTGeometry *dtGeom,
00119                  const DTRecSegment4D& segment,
00120                std::map<DTWireId, std::vector<type> > recHitsPerWire,
00121                  int step);
00122 
00123   // Book a set of histograms for a give chamber
00124   void bookHistos(DTSuperLayerId slId, int step);
00125   // Fill a set of histograms for a give chamber 
00126   void fillHistos(DTSuperLayerId slId,
00127                   float distance,
00128                   float residualOnDistance,
00129                   float position,
00130                   float residualOnPosition,
00131                   int step);
00132 
00133   std::map<std::pair<DTSuperLayerId,int>, std::vector<MonitorElement*> > histosPerSL;
00134 
00135 };
00136 #endif
00137 
00138 
00139