Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:07:07

0001 
0002 #ifndef DTCalibValidationFromMuons_H
0003 #define DTCalibValidationFromMuons_H
0004 
0005 /** \class DTCalibValidationFromMuons
0006  *  Analysis on DT residuals to validate the kFactor
0007  *
0008  *
0009  *  \author G. Mila - INFN Torino
0010  */
0011 
0012 #include "FWCore/Framework/interface/Frameworkfwd.h"
0013 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "FWCore/Framework/interface/LuminosityBlock.h"
0016 
0017 #include "DQMServices/Core/interface/DQMStore.h"
0018 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0019 
0020 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0021 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
0022 #include "DataFormats/DTRecHit/interface/DTRecSegment2DCollection.h"
0023 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0024 
0025 #include "DataFormats/MuonReco/interface/Muon.h"
0026 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0027 #include "RecoMuon/TrackingTools/interface/MuonSegmentMatcher.h"
0028 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0029 
0030 #include "FWCore/Framework/interface/ESHandle.h"
0031 
0032 #include <string>
0033 #include <map>
0034 #include <vector>
0035 
0036 // To remove into CMSSW versions before 20X; removed in CMSSW 10_5_X onwards
0037 // To add into CMSSW versions before 20X
0038 //class DaqMonitorBEInterface;
0039 
0040 class DTGeometry;
0041 class DTChamber;
0042 
0043 // FR class DTCalibValidationFromMuons: public edm::EDAnalyzer{
0044 class DTCalibValidationFromMuons : public DQMEDAnalyzer {
0045 public:
0046   /// Constructor
0047   DTCalibValidationFromMuons(const edm::ParameterSet& pset);
0048 
0049   /// Destructor
0050   ~DTCalibValidationFromMuons() override;
0051 
0052   /// BeginRun
0053   void dqmBeginRun(const edm::Run& r, const edm::EventSetup& c) override;
0054 
0055   // Operations
0056   void analyze(const edm::Event& event, const edm::EventSetup& setup) override;
0057 
0058 protected:
0059   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0060 
0061 private:
0062   // Switch for verbosity
0063   //bool debug;
0064   edm::ParameterSet parameters;
0065   int wrongSegment;
0066   int rightSegment;
0067   int nevent;
0068   // the geometry
0069   edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0070   const DTGeometry* dtGeom;
0071 
0072   // Label of 4D segments in the event
0073   edm::EDGetTokenT<DTRecSegment4DCollection> segment4DToken_;
0074 
0075   // Label of muons in the event
0076   edm::EDGetTokenT<reco::MuonCollection> muonToken_;
0077 
0078   // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
0079   float recHitDistFromWire(const DTRecHit1DPair& hitPair, const DTLayer* layer);
0080   // Compute the distance from wire (cm) of a hits in a DTRecHit1D
0081   float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
0082   // Compute the position with respect to the wire (cm) of a hits in a DTRecHit1DPair
0083   float recHitPosition(
0084       const DTRecHit1DPair& hitPair, const DTLayer* layer, const DTChamber* chamber, float segmPos, int sl);
0085   // Compute the position with respect to the wire (cm) of a hits in a DTRecHit1D
0086   float recHitPosition(const DTRecHit1D& recHit, const DTLayer* layer, const DTChamber* chamber, float segmPos, int sl);
0087 
0088   // Does the real job
0089   void compute(const DTGeometry* dtGeom, const DTRecSegment4D& segment);
0090 
0091   // Book a set of histograms for a give chamber
0092   void bookHistos(DTSuperLayerId slId, int step);
0093   // Fill a set of histograms for a give chamber
0094   void fillHistos(DTSuperLayerId slId,
0095                   float distance,
0096                   float residualOnDistance,
0097                   float position,
0098                   float residualOnPosition,
0099                   int step);
0100 
0101   std::map<std::pair<DTSuperLayerId, int>, std::vector<MonitorElement*> > histosPerSL;
0102 };
0103 #endif
0104 
0105 /* Local Variables: */
0106 /* show-trailing-whitespace: t */
0107 /* truncate-lines: t */
0108 /* End: */