File indexing completed on 2024-09-08 23:51:41
0001 #ifndef DQMOffline_MuonDPG_BaseTnPEfficiencyTask_H
0002 #define DQMOffline_MuonDPG_BaseTnPEfficiencyTask_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0012
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015
0016 #include "DQMServices/Core/interface/DQMStore.h"
0017 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0018
0019 #include "DataFormats/Common/interface/Handle.h"
0020 #include "DataFormats/MuonReco/interface/Muon.h"
0021 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0022 #include "DataFormats/VertexReco/interface/Vertex.h"
0023
0024 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
0025
0026 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
0027
0028 #include "DataFormats/Common/interface/TriggerResults.h"
0029 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
0030
0031 #include <vector>
0032 #include <string>
0033 #include <map>
0034
0035 class BaseTnPEfficiencyTask : public DQMEDAnalyzer {
0036 public:
0037
0038 BaseTnPEfficiencyTask(const edm::ParameterSet& config);
0039
0040
0041 ~BaseTnPEfficiencyTask() override;
0042
0043 protected:
0044
0045 void dqmBeginRun(const edm::Run& run, const edm::EventSetup& context) override;
0046
0047 void bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& run, edm::EventSetup const& context) override;
0048
0049
0050 virtual std::string topFolder() const = 0;
0051
0052
0053 void analyze(const edm::Event& event, const edm::EventSetup& context) override;
0054 bool hasTrigger(std::vector<int>& trigIndices,
0055 const trigger::TriggerObjectCollection& trigObjs,
0056 edm::Handle<trigger::TriggerEvent>& trigEvent,
0057 const reco::Muon& muon);
0058
0059 std::vector<std::vector<unsigned>> m_probeIndices;
0060 std::vector<std::vector<unsigned>> m_tagIndices;
0061
0062 std::map<std::string, MonitorElement*> m_histos;
0063
0064 int m_nEvents;
0065
0066 const edm::EDGetTokenT<reco::MuonCollection> m_muToken;
0067
0068 const double m_borderCut;
0069 const double m_dxCut;
0070 const bool m_detailedAnalysis;
0071
0072 private:
0073 const edm::EDGetTokenT<std::vector<reco::Vertex>> m_primaryVerticesToken;
0074 const edm::EDGetTokenT<edm::TriggerResults> m_triggerResultsToken;
0075 const edm::EDGetTokenT<trigger::TriggerEvent> m_triggerEventToken;
0076
0077 const std::string m_trigName;
0078 HLTConfigProvider m_hltConfig;
0079
0080
0081 const StringCutObjectSelector<reco::Candidate, true> m_probeSelector;
0082 const double m_dxyCut;
0083 const double m_dzCut;
0084
0085
0086 const StringCutObjectSelector<reco::Muon, true> m_tagSelector;
0087
0088
0089 std::vector<int> m_trigIndices;
0090
0091 const double m_lowPairMassCut;
0092 const double m_highPairMassCut;
0093 };
0094
0095 #endif