File indexing completed on 2024-04-06 12:07:08
0001 #ifndef DTChamberEfficiencyTask_H
0002 #define DTChamberEfficiencyTask_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include "FWCore/Framework/interface/Frameworkfwd.h"
0016 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
0017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0018 #include "FWCore/Framework/interface/LuminosityBlock.h"
0019
0020 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0021 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0022 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0023 #include "DataFormats/Common/interface/Handle.h"
0024 #include "FWCore/Framework/interface/ESHandle.h"
0025
0026 #include "DQMServices/Core/interface/DQMStore.h"
0027 #include "FWCore/ServiceRegistry/interface/Service.h"
0028
0029 #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
0030
0031 #include <string>
0032 #include <map>
0033 #include <vector>
0034
0035 class DTChamberEfficiencyTask : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
0036 public:
0037
0038 DTChamberEfficiencyTask(const edm::ParameterSet& pset);
0039
0040
0041 ~DTChamberEfficiencyTask() override;
0042
0043
0044 void dqmBeginRun(const edm::Run& run, const edm::EventSetup& setup) override;
0045
0046
0047 void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) override;
0048 void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) final {}
0049
0050
0051 void analyze(const edm::Event& event, const edm::EventSetup& setup) override;
0052
0053 protected:
0054
0055 void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0056
0057 private:
0058 const DTRecSegment4D& getBestSegment(const DTRecSegment4DCollection::range& segs) const;
0059 const DTRecSegment4D* getBestSegment(const DTRecSegment4D* s1, const DTRecSegment4D* s2) const;
0060 bool isGoodSegment(const DTRecSegment4D& seg) const;
0061 LocalPoint interpolate(const DTRecSegment4D& seg1, const DTRecSegment4D& seg3, const DTChamberId& MB2) const;
0062
0063 void bookHistos(DQMStore::IBooker& ibooker, DTChamberId chId);
0064
0065
0066 bool debug;
0067
0068 bool onlineMonitor;
0069
0070 bool detailedAnalysis;
0071
0072
0073 edm::EDGetTokenT<DTRecSegment4DCollection> recHits4DToken_;
0074
0075 edm::ParameterSet parameters;
0076
0077 std::map<DTChamberId, std::vector<MonitorElement*> > histosPerCh;
0078
0079 unsigned int theMinHitsSegment;
0080 double theMinChi2NormSegment;
0081 double theMinCloseDist;
0082
0083
0084 edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0085 const DTGeometry* dtGeom;
0086 edm::Handle<DTRecSegment4DCollection> segs;
0087 };
0088 #endif
0089
0090
0091
0092
0093