File indexing completed on 2024-04-06 12:18:47
0001 #ifndef HLTBTagPerformanceAnalyzer_H
0002 #define HLTBTagPerformanceAnalyzer_H
0003
0004
0005 #include <map>
0006 #include <memory>
0007 #include <string>
0008 #include <vector>
0009
0010
0011 #include "DataFormats/BTauReco/interface/JetTag.h"
0012 #include "DataFormats/BTauReco/interface/ShallowTagInfo.h"
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "FWCore/Framework/interface/Frameworkfwd.h"
0015 #include "FWCore/Framework/interface/MakerMacros.h"
0016 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0017 #include <DQMServices/Core/interface/DQMEDAnalyzer.h>
0018
0019
0020 #include "DataFormats/Common/interface/TriggerResults.h"
0021 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
0022
0023
0024 #include "DQMServices/Core/interface/DQMStore.h"
0025 #include "FWCore/Framework/interface/ConsumesCollector.h"
0026 #include "FWCore/ServiceRegistry/interface/Service.h"
0027 #include <DQMServices/Core/interface/DQMEDAnalyzer.h>
0028
0029
0030 #include "DataFormats/JetMatching/interface/JetFlavourMatching.h"
0031 #include <Math/GenVector/VectorUtil.h>
0032
0033 #include "FWCore/Utilities/interface/transform.h"
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 class HLTBTagPerformanceAnalyzer : public DQMEDAnalyzer {
0044 public:
0045 explicit HLTBTagPerformanceAnalyzer(const edm::ParameterSet &);
0046 ~HLTBTagPerformanceAnalyzer() override;
0047 void dqmBeginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override;
0048
0049 private:
0050 void analyze(const edm::Event &, const edm::EventSetup &) override;
0051 void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override;
0052
0053 struct JetRefCompare {
0054 inline bool operator()(const edm::RefToBase<reco::Jet> &j1, const edm::RefToBase<reco::Jet> &j2) const {
0055 return j1.id() < j2.id() || (j1.id() == j2.id() && j1.key() < j2.key());
0056 }
0057 };
0058
0059 typedef std::map<edm::RefToBase<reco::Jet>, float, JetRefCompare> JetTagMap;
0060
0061 enum HCALSpecials { HEP17, HEP18, HEM17 };
0062
0063
0064 edm::EDGetTokenT<edm::TriggerResults> hlTriggerResults_;
0065 std::string mainFolder_;
0066 std::vector<std::string> hltPathNames_;
0067 HLTConfigProvider hltConfigProvider_;
0068 bool triggerConfChanged_;
0069 std::vector<edm::EDGetTokenT<reco::JetTagCollection>> JetTagCollection_;
0070
0071
0072 edm::EDGetTokenT<std::vector<reco::ShallowTagInfo>> shallowTagInfosTokenPf_;
0073
0074
0075 edm::Handle<std::vector<reco::ShallowTagInfo>> shallowTagInfosPf;
0076
0077
0078 std::vector<bool> _isfoundHLTs;
0079 std::vector<int> hltPathIndexs_;
0080
0081
0082 typedef unsigned int flavour_t;
0083 typedef std::vector<flavour_t> flavours_t;
0084
0085 edm::EDGetTokenT<reco::JetFlavourMatchingCollection> m_mcPartons;
0086 std::vector<std::string> m_mcLabels;
0087 std::vector<flavours_t> m_mcFlavours;
0088 double m_mcRadius;
0089 bool m_mcMatching;
0090
0091
0092 std::vector<std::string> folders;
0093
0094
0095 std::vector<std::map<std::string, MonitorElement *>> H1_;
0096 std::vector<std::map<std::string, std::map<HCALSpecials, MonitorElement *>>> H1mod_;
0097 std::vector<std::map<std::string, MonitorElement *>> H2_;
0098 std::vector<std::map<std::string, std::map<HCALSpecials, MonitorElement *>>> H2mod_;
0099 std::vector<std::map<std::string, MonitorElement *>> H2Eta_;
0100 std::vector<std::map<std::string, MonitorElement *>> H2EtaPhi_;
0101 std::vector<std::map<std::string, MonitorElement *>> H2EtaPhi_threshold_;
0102 std::vector<std::map<std::string, MonitorElement *>> H2Phi_;
0103
0104
0105 edm::EDConsumerBase::Labels label;
0106 std::string m_mcPartons_Label;
0107 std::vector<std::string> JetTagCollection_Label;
0108 std::string hlTriggerResults_Label;
0109 std::string hltConfigProvider_Label;
0110 std::map<HLTBTagPerformanceAnalyzer::HCALSpecials, std::string> HCALSpecialsNames;
0111 };
0112
0113 #endif