Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:33:16

0001 #ifndef TauValidationMiniAOD_h
0002 #define TauValidationMiniAOD_h
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    TauValidationMiniAOD
0007 // Class:      TauValidationMiniAOD
0008 //
0009 /* *\class TauValidationMiniAOD TauValidationMiniAOD.cc
0010 
0011  Description: EDAnalyzer to validate tau collection in miniAOD
0012  Implementation:
0013 
0014 */
0015 // Original Author: Aniello Spiezia On August 13, 2019
0016 // Updated April, 2020 by Ece Asilar and Gage DeZoort
0017 // Updated July, 2023 by Gourab Saha
0018 
0019 // user include files
0020 #include "FWCore/Framework/interface/Event.h"
0021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0022 #include "FWCore/ServiceRegistry/interface/Service.h"
0023 #include "DataFormats/Math/interface/Vector3D.h"
0024 #include "DataFormats/Math/interface/LorentzVector.h"
0025 #include "DataFormats/TauReco/interface/PFTau.h"
0026 #include "DataFormats/PatCandidates/interface/Tau.h"
0027 #include "DataFormats/Math/interface/deltaR.h"
0028 
0029 // Include DQM core
0030 #include <DQMServices/Core/interface/DQMStore.h>
0031 #include <DQMServices/Core/interface/MonitorElement.h>
0032 #include <DQMServices/Core/interface/DQMEDAnalyzer.h>
0033 
0034 struct histoInfo {
0035   int nbins;
0036   double min;
0037   double max;
0038   histoInfo(int n, double m, double M) {
0039     nbins = n;
0040     min = m;
0041     max = M;
0042   }
0043   histoInfo(const edm::ParameterSet &config) {
0044     nbins = config.getParameter<int>("nbins");
0045     min = config.getParameter<double>("min");
0046     max = config.getParameter<double>("max");
0047   }
0048 };
0049 
0050 // class declaration
0051 class TauValidationMiniAOD : public DQMEDAnalyzer {
0052 public:
0053   explicit TauValidationMiniAOD(const edm::ParameterSet &);
0054   ~TauValidationMiniAOD() override;
0055 
0056   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0057   void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override;
0058   // https://twiki.cern.ch/twiki/bin/viewauth/CMS/TauIDRecommendationForRun2#Decay_Mode_Reconstruction
0059   int findDecayMode(int Nc, int Np) { return 5 * (Nc - 1) + Np; };
0060 
0061 private:
0062   edm::EDGetTokenT<std::vector<pat::Tau> > tauCollection_;
0063   edm::EDGetTokenT<edm::View<reco::Candidate> > refCollectionInputTagToken_;
0064   edm::EDGetTokenT<std::vector<reco::Vertex> > primaryVertexCollectionToken_;
0065   edm::EDGetTokenT<std::vector<reco::GenParticle> > prunedGenToken_;
0066   edm::EDGetTokenT<std::vector<reco::GenJet> > genJetsToken_;
0067 
0068   std::map<std::string, MonitorElement *> ptMap, etaMap, phiMap, massMap, puMap;
0069   std::map<std::string, MonitorElement *> ptTightvsJetMap, phiTightvsJetMap, etaTightvsJetMap, massTightvsJetMap,
0070       puTightvsJetMap;
0071   std::map<std::string, MonitorElement *> ptTightvsEleMap, phiTightvsEleMap, etaTightvsEleMap, massTightvsEleMap,
0072       puTightvsEleMap;
0073   std::map<std::string, MonitorElement *> ptTightvsMuoMap, phiTightvsMuoMap, etaTightvsMuoMap, massTightvsMuoMap,
0074       puTightvsMuoMap;
0075   std::map<std::string, MonitorElement *> ptMediumvsJetMap, phiMediumvsJetMap, etaMediumvsJetMap, massMediumvsJetMap,
0076       puMediumvsJetMap;
0077   std::map<std::string, MonitorElement *> ptMediumvsEleMap, phiMediumvsEleMap, etaMediumvsEleMap, massMediumvsEleMap,
0078       puMediumvsEleMap;
0079   std::map<std::string, MonitorElement *> ptMediumvsMuoMap, phiMediumvsMuoMap, etaMediumvsMuoMap, massMediumvsMuoMap,
0080       puMediumvsMuoMap;
0081   std::map<std::string, MonitorElement *> ptLoosevsJetMap, phiLoosevsJetMap, etaLoosevsJetMap, massLoosevsJetMap,
0082       puLoosevsJetMap;
0083   std::map<std::string, MonitorElement *> ptLoosevsEleMap, phiLoosevsEleMap, etaLoosevsEleMap, massLoosevsEleMap,
0084       puLoosevsEleMap;
0085   std::map<std::string, MonitorElement *> ptLoosevsMuoMap, phiLoosevsMuoMap, etaLoosevsMuoMap, massLoosevsMuoMap,
0086       puLoosevsMuoMap;
0087   std::map<std::string, MonitorElement *> decayModeFindingMap, decayModeMap, byDeepTau2018v2p5VSerawMap,
0088       byDeepTau2018v2p5VSjetrawMap, byDeepTau2018v2p5VSmurawMap, summaryMap;
0089   std::map<std::string, MonitorElement *> mtau_dm0Map, mtau_dm1p2Map, mtau_dm5Map, mtau_dm6Map, mtau_dm10Map,
0090       mtau_dm11Map;
0091   std::map<std::string, MonitorElement *> dmMigrationMap, ntau_vs_dmMap;
0092   std::map<std::string, MonitorElement *> pTOverProng_dm0Map, pTOverProng_dm1p2Map, pTOverProng_dm5Map,
0093       pTOverProng_dm6Map, pTOverProng_dm10Map, pTOverProng_dm11Map;
0094   edm::ParameterSet histoSettings_;
0095   std::string extensionName_;
0096   std::vector<edm::ParameterSet> discriminators_;
0097   std::vector<edm::ParameterSet> againstXs_;
0098   std::string qcd;
0099   std::string real_data;
0100   std::string real_eledata;
0101   std::string real_mudata;
0102   std::string ztt;
0103   std::string zee;
0104   std::string zmm;
0105 };
0106 
0107 #endif