Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-21 22:39:45

0001 
0002 #ifndef DTSegmentAnalysisTask_H
0003 #define DTSegmentAnalysisTask_H
0004 
0005 /** \class DTSegmentAnalysisTask
0006  *  DQM Analysis of 4D DT segments, it produces plots about: <br>
0007  *      - number of segments per event <br>
0008  *      - number of hits per segment <br>
0009  *      - position of the segments in chamber RF <br>
0010  *      - direction of the segments (theta and phi projections) <br>
0011  *      - reduced chi-square <br>
0012  *  All histos are produce per Chamber
0013  *
0014  *
0015  *  \author G. Cerminara - INFN Torino
0016  */
0017 
0018 #include "FWCore/Framework/interface/Frameworkfwd.h"
0019 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 #include "FWCore/Framework/interface/EDAnalyzer.h"
0022 #include "FWCore/Framework/interface/ESHandle.h"
0023 
0024 #include "DQMServices/Core/interface/DQMStore.h"
0025 #include "FWCore/ServiceRegistry/interface/Service.h"
0026 
0027 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0028 
0029 //RecHit
0030 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0031 
0032 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0033 #include "CondFormats/DataRecord/interface/DTStatusFlagRcd.h"
0034 
0035 #include <string>
0036 #include <map>
0037 #include <vector>
0038 
0039 class DTGeometry;
0040 class DTStatusFlag;
0041 
0042 class DTSegmentAnalysisTask : public DQMEDAnalyzer {
0043 public:
0044   /// Constructor
0045   DTSegmentAnalysisTask(const edm::ParameterSet& pset);
0046 
0047   /// Destructor
0048   ~DTSegmentAnalysisTask() override;
0049 
0050   /// BeginRun
0051   void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
0052 
0053   // Operations
0054   void analyze(const edm::Event& event, const edm::EventSetup& setup) override;
0055 
0056 protected:
0057   // Book the histograms
0058   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0059 
0060 private:
0061   // Switch for detailed analysis
0062   bool detailedAnalysis;
0063 
0064   // Get the DT Geometry
0065   edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0066   const DTGeometry* dtGeom;
0067 
0068   // Get the status Map
0069   edm::ESGetToken<DTStatusFlag, DTStatusFlagRcd> statusMapToken_;
0070   const DTStatusFlag* statusMap;
0071 
0072   // Label of 4D segments in the event
0073   edm::EDGetTokenT<DTRecSegment4DCollection> recHits4DToken_;
0074 
0075   // Get the map of noisy channels
0076   bool checkNoisyChannels;
0077 
0078   // book the histos
0079   void bookHistos(DQMStore::IBooker& ibooker, DTChamberId chamberId);
0080   // Fill a set of histograms for a given chamber
0081   void fillHistos(DTChamberId chamberId, int nHits, float chi2);
0082 
0083   //  the histos
0084   std::map<DTChamberId, std::vector<MonitorElement*> > histosPerCh;
0085   std::map<int, MonitorElement*> summaryHistos;
0086 
0087   int nevents;
0088   // top folder for the histograms in DQMStore
0089   std::string topHistoFolder;
0090   // hlt DQM mode
0091   bool hltDQMMode;
0092   // max phi angle of reconstructed segments
0093   double phiSegmCut;
0094   // min # hits of segment used to validate a segment in WB+-2/SecX/MB1
0095   int nhitsCut;
0096 
0097   MonitorElement* nEventMonitor;
0098 };
0099 #endif
0100 
0101 /* Local Variables: */
0102 /* show-trailing-whitespace: t */
0103 /* truncate-lines: t */
0104 /* End: */