File indexing completed on 2024-04-06 12:33:16
0001 #ifndef TauTagValidation_h
0002 #define TauTagValidation_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include "FWCore/Common/interface/Provenance.h"
0020 #include "FWCore/Framework/interface/Event.h"
0021 #include "FWCore/Framework/interface/MakerMacros.h"
0022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0023 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0024 #include "FWCore/ServiceRegistry/interface/Service.h"
0025 #include "CommonTools/TriggerUtils/interface/GenericTriggerEventFlag.h"
0026 #include "DataFormats/Math/interface/Vector3D.h"
0027 #include "DataFormats/Math/interface/LorentzVector.h"
0028 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
0029 #include "DataFormats/Provenance/interface/ProductProvenance.h"
0030 #include "DataFormats/TauReco/interface/PFTau.h"
0031 #include "DataFormats/TauReco/interface/PFTauDiscriminator.h"
0032 #include "DataFormats/TauReco/interface/TauDiscriminatorContainer.h"
0033 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0034
0035 #include "RecoParticleFlow/Benchmark/interface/PFBenchmarkAlgo.h"
0036
0037
0038 #include "Math/GenVector/VectorUtil.h"
0039 #include "Math/GenVector/PxPyPzE4D.h"
0040 #include "TLorentzVector.h"
0041 #include "TH1D.h"
0042 #include "TH1.h"
0043 #include "TH1F.h"
0044 #include <vector>
0045 #include <string>
0046
0047
0048 #include <DQMServices/Core/interface/DQMStore.h>
0049 #include <DQMServices/Core/interface/DQMEDAnalyzer.h>
0050
0051 typedef math::XYZTLorentzVectorD LV;
0052 typedef std::vector<LV> LVCollection;
0053
0054 struct hinfo {
0055 int nbins;
0056 double min;
0057 double max;
0058 hinfo(int n, double m, double M) {
0059 nbins = n;
0060 min = m;
0061 max = M;
0062 }
0063 hinfo(const edm::ParameterSet& config) {
0064 nbins = config.getParameter<int>("nbins");
0065 min = config.getParameter<double>("min");
0066 max = config.getParameter<double>("max");
0067 }
0068 };
0069
0070
0071 class TauTagValidation : public DQMEDAnalyzer {
0072 public:
0073 explicit TauTagValidation(const edm::ParameterSet&);
0074 ~TauTagValidation() override;
0075
0076 void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0077 void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
0078 void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0079
0080 private:
0081
0082 std::string moduleLabel_;
0083
0084 double getSumPt(const std::vector<edm::Ptr<reco::Candidate> >& candidates);
0085
0086 bool stripDiscriminatorLabel(const std::string& discriminatorLabel, std::string& newLabel);
0087
0088 edm::ParameterSet histoSettings_;
0089
0090 GenericTriggerEventFlag* genericTriggerEventFlag_;
0091
0092
0093 std::string dataType_;
0094
0095
0096 double matchDeltaR_Leptons_;
0097 double matchDeltaR_Jets_;
0098 double TauPtCut_;
0099
0100
0101 std::string recoCuts_, genCuts_;
0102
0103
0104 bool saveoutputhistograms_, turnOnTrigger_;
0105
0106
0107 edm::InputTag refCollectionInputTag_;
0108 edm::EDGetTokenT<edm::View<reco::Candidate> > refCollectionInputTagToken_;
0109 edm::EDGetTokenT<reco::PFTauCollection> tauProducerInputTagToken_;
0110 edm::EDGetTokenT<reco::VertexCollection> primaryVertexCollectionToken_;
0111 std::vector<edm::EDGetTokenT<reco::PFTauDiscriminator> > currentDiscriminatorToken_;
0112 std::vector<std::pair<edm::EDGetTokenT<reco::TauDiscriminatorContainer>, int> > currentDiscriminatorContainerToken_;
0113 std::vector<std::string> currentDiscriminatorContainerProvCfgName_;
0114 std::vector<std::pair<std::string, std::string> > currentDiscriminatorContainerIdName_;
0115 edm::ProcessHistoryID phID_;
0116 std::string refCollection_;
0117
0118
0119 std::string extensionName_;
0120
0121
0122 edm::InputTag TauProducerInputTag_, PrimaryVertexCollection_;
0123 std::string TauProducer_;
0124
0125
0126
0127
0128 std::vector<edm::ParameterSet> discriminators_;
0129
0130
0131
0132 std::string tversion;
0133 std::string outPutFile_;
0134
0135 std::map<std::string, MonitorElement*> ptTauVisibleMap;
0136 std::map<std::string, MonitorElement*> etaTauVisibleMap;
0137 std::map<std::string, MonitorElement*> phiTauVisibleMap;
0138 std::map<std::string, MonitorElement*> pileupTauVisibleMap;
0139 std::map<std::string, MonitorElement*> nTauVisibleMap;
0140 std::map<std::string, MonitorElement*> massTauVisibleMap;
0141 std::map<std::string, MonitorElement*> plotMap_;
0142 std::map<std::string, MonitorElement*> summaryMap;
0143
0144 std::map<std::string, int> tauDecayCountMap_;
0145
0146 MonitorElement* nTaus_;
0147
0148
0149
0150
0151
0152 MonitorElement* nPFJet_LeadingChargedHadron_ChargedHadronsSignal_;
0153 MonitorElement* nPFJet_LeadingChargedHadron_ChargedHadronsIsolAnnulus_;
0154 MonitorElement* nPFJet_LeadingChargedHadron_GammasSignal_;
0155 MonitorElement* nPFJet_LeadingChargedHadron_GammasIsolAnnulus_;
0156 MonitorElement* nPFJet_LeadingChargedHadron_NeutralHadronsSignal_;
0157 MonitorElement* nPFJet_LeadingChargedHadron_NeutralHadronsIsolAnnulus_;
0158
0159
0160
0161 MonitorElement* nIsolated_NoChargedHadrons_ChargedHadronsSignal_;
0162 MonitorElement* nIsolated_NoChargedHadrons_GammasSignal_;
0163 MonitorElement* nIsolated_NoChargedHadrons_GammasIsolAnnulus_;
0164 MonitorElement* nIsolated_NoChargedHadrons_NeutralHadronsSignal_;
0165 MonitorElement* nIsolated_NoChargedHadrons_NeutralHadronsIsolAnnulus_;
0166
0167
0168
0169 MonitorElement* nIsolated_NoChargedNoGammas_ChargedHadronsSignal_;
0170 MonitorElement* nIsolated_NoChargedNoGammas_GammasSignal_;
0171 MonitorElement* nIsolated_NoChargedNoGammas_NeutralHadronsSignal_;
0172 MonitorElement* nIsolated_NoChargedNoGammas_NeutralHadronsIsolAnnulus_;
0173
0174
0175 int numEvents_;
0176
0177 protected:
0178 PFBenchmarkAlgo* algo_;
0179
0180 private:
0181 bool chainCuts_;
0182 };
0183
0184 #endif