Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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/ESHandle.h"
0022 
0023 #include "DQMServices/Core/interface/DQMStore.h"
0024 #include "FWCore/ServiceRegistry/interface/Service.h"
0025 
0026 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0027 
0028 //RecHit
0029 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0030 
0031 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0032 #include "CondFormats/DataRecord/interface/DTStatusFlagRcd.h"
0033 
0034 #include <string>
0035 #include <map>
0036 #include <vector>
0037 
0038 class DTGeometry;
0039 class DTStatusFlag;
0040 
0041 class DTSegmentAnalysisTask : public DQMEDAnalyzer {
0042 public:
0043   /// Constructor
0044   DTSegmentAnalysisTask(const edm::ParameterSet& pset);
0045 
0046   /// Destructor
0047   ~DTSegmentAnalysisTask() override;
0048 
0049   /// BeginRun
0050   void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
0051 
0052   // Operations
0053   void analyze(const edm::Event& event, const edm::EventSetup& setup) override;
0054 
0055 protected:
0056   // Book the histograms
0057   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0058 
0059 private:
0060   // Switch for detailed analysis
0061   bool detailedAnalysis;
0062 
0063   // Get the DT Geometry
0064   edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0065   const DTGeometry* dtGeom;
0066 
0067   // Get the status Map
0068   edm::ESGetToken<DTStatusFlag, DTStatusFlagRcd> statusMapToken_;
0069   const DTStatusFlag* statusMap;
0070 
0071   // Label of 4D segments in the event
0072   edm::EDGetTokenT<DTRecSegment4DCollection> recHits4DToken_;
0073 
0074   // Get the map of noisy channels
0075   bool checkNoisyChannels;
0076 
0077   // book the histos
0078   void bookHistos(DQMStore::IBooker& ibooker, DTChamberId chamberId);
0079   // Fill a set of histograms for a given chamber
0080   void fillHistos(DTChamberId chamberId, int nHits, float chi2);
0081 
0082   //  the histos
0083   std::map<DTChamberId, std::vector<MonitorElement*> > histosPerCh;
0084   std::map<int, MonitorElement*> summaryHistos;
0085 
0086   int nevents;
0087   // top folder for the histograms in DQMStore
0088   std::string topHistoFolder;
0089   // hlt DQM mode
0090   bool hltDQMMode;
0091   // max phi angle of reconstructed segments
0092   double phiSegmCut;
0093   // min # hits of segment used to validate a segment in WB+-2/SecX/MB1
0094   int nhitsCut;
0095 
0096   MonitorElement* nEventMonitor;
0097 };
0098 #endif
0099 
0100 /* Local Variables: */
0101 /* show-trailing-whitespace: t */
0102 /* truncate-lines: t */
0103 /* End: */