Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-29 23:10:24

0001 #ifndef JetAnalyzer_HeavyIons_H
0002 #define JetAnalyzer_HeavyIons_H
0003 
0004 //
0005 // Jet Tester class for heavy ion jets. for DQM jet analysis monitoring
0006 // For CMSSW_7_4_X, especially reading background subtracted jets
0007 // author: Raghav Kunnawalkam Elayavalli,
0008 //         Jan 12th 2015
0009 //         Rutgers University, email: raghav.k.e at CERN dot CH
0010 //
0011 // this class will be very similar to the class available in the validation suite under RecoJets/JetTester_HeavyIons
0012 //
0013 
0014 #include <memory>
0015 #include <fstream>
0016 #include "FWCore/Framework/interface/Frameworkfwd.h"
0017 #include "FWCore/Framework/interface/Event.h"
0018 #include "FWCore/Framework/interface/MakerMacros.h"
0019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0020 #include "DQMServices/Core/interface/DQMStore.h"
0021 
0022 #include "DataFormats/Common/interface/TriggerResults.h"
0023 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
0024 #include "DataFormats/HLTReco/interface/TriggerObject.h"
0025 #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
0026 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
0027 #include "CommonTools/TriggerUtils/interface/GenericTriggerEventFlag.h"
0028 #include "FWCore/Utilities/interface/EDGetToken.h"
0029 
0030 #include "DataFormats/JetReco/interface/Jet.h"
0031 #include "DataFormats/JetReco/interface/CaloJet.h"
0032 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
0033 #include "DataFormats/JetReco/interface/GenJet.h"
0034 #include "DataFormats/JetReco/interface/GenJetCollection.h"
0035 #include "DataFormats/JetReco/interface/JPTJet.h"
0036 #include "DataFormats/JetReco/interface/JPTJetCollection.h"
0037 #include "DataFormats/JetReco/interface/PFJet.h"
0038 
0039 #include "DataFormats/CaloTowers/interface/CaloTower.h"
0040 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
0041 #include "DataFormats/Candidate/interface/Candidate.h"
0042 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0043 #include "DataFormats/Candidate/interface/CandidateWithRef.h"
0044 
0045 // include the basic jet for the PuPF jets.
0046 #include "DataFormats/JetReco/interface/BasicJet.h"
0047 #include "DataFormats/JetReco/interface/BasicJetCollection.h"
0048 // include the pf candidates
0049 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0050 // include the voronoi subtraction
0051 #include "DataFormats/HeavyIonEvent/interface/VoronoiBackground.h"
0052 #include "RecoHI/HiJetAlgos/interface/UEParameters.h"
0053 // include the centrality variables
0054 #include "DataFormats/HeavyIonEvent/interface/Centrality.h"
0055 
0056 #include "JetMETCorrections/Objects/interface/JetCorrector.h"
0057 #include "RecoJets/JetProducers/interface/JetIDHelper.h"
0058 #include "DQMOffline/JetMET/interface/JetMETDQMDCSFilter.h"
0059 #include "DataFormats/VertexReco/interface/Vertex.h"
0060 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0061 #include "DataFormats/DetId/interface/DetId.h"
0062 
0063 #include "DataFormats/Scalers/interface/DcsStatus.h"
0064 #include "PhysicsTools/SelectorUtils/interface/JetIDSelectionFunctor.h"
0065 #include "PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h"
0066 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0067 #include <map>
0068 #include <string>
0069 
0070 const Int_t MAXPARTICLE = 10000;
0071 const Double_t BarrelEta = 2.0;
0072 const Double_t EndcapEta = 3.0;
0073 const Double_t ForwardEta = 5.0;
0074 
0075 class JetAnalyzer_HeavyIons : public DQMEDAnalyzer {
0076 public:
0077   explicit JetAnalyzer_HeavyIons(const edm::ParameterSet&);
0078   ~JetAnalyzer_HeavyIons() override;
0079 
0080   void analyze(const edm::Event&, const edm::EventSetup&) override;
0081   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0082 
0083 private:
0084   static constexpr int fourierOrder_ = 5;
0085   static constexpr int etaBins_ = 7;
0086   static constexpr int ptBins_ = 7;
0087 
0088   //default values - these are changed by the etaMap values for the CS plots
0089   const double edge_pseudorapidity[etaBins_ + 1] = {-5, -3, -2.1, -1.3, 1.3, 2.1, 3, 5};
0090   const int ptBin[ptBins_ + 1] = {0, 20, 40, 60, 100, 150, 300, 99999};
0091 
0092   static constexpr int nedge_pseudorapidity = etaBins_ + 1;
0093 
0094   edm::InputTag mInputCollection;
0095   edm::InputTag mInputVtxCollection;
0096   edm::InputTag mInputPFCandCollection;
0097   edm::InputTag mInputCsCandCollection;
0098 
0099   std::string mOutputFile;
0100   std::string JetType;
0101   std::string UEAlgo;
0102   edm::InputTag Background;
0103   double mRecoJetPtThreshold;
0104   double mReverseEnergyFractionThreshold;
0105   double mRThreshold;
0106   std::string JetCorrectionService;
0107 
0108   edm::InputTag centralityTag_;
0109   edm::EDGetTokenT<reco::Centrality> centralityToken;
0110   edm::Handle<reco::Centrality> centrality_;
0111 
0112   edm::InputTag centralityBinTag_;
0113   edm::EDGetTokenT<int> centralityBinToken;
0114   edm::Handle<int> centralityBin_;
0115 
0116   //Tokens
0117   edm::EDGetTokenT<std::vector<reco::Vertex>> pvToken_;
0118   edm::EDGetTokenT<CaloTowerCollection> caloTowersToken_;
0119   edm::EDGetTokenT<reco::CaloJetCollection> caloJetsToken_;
0120   edm::EDGetTokenT<reco::PFJetCollection> pfJetsToken_;
0121   edm::EDGetTokenT<reco::BasicJetCollection> basicJetsToken_;
0122   edm::EDGetTokenT<reco::JPTJetCollection> jptJetsToken_;
0123   edm::EDGetTokenT<reco::PFCandidateCollection> pfCandToken_;
0124   edm::EDGetTokenT<reco::PFCandidateCollection> csCandToken_;
0125   edm::EDGetTokenT<reco::CandidateView> pfCandViewToken_;
0126   edm::EDGetTokenT<reco::CandidateView> caloCandViewToken_;
0127 
0128   edm::EDGetTokenT<std::vector<reco::Vertex>> hiVertexToken_;
0129 
0130   edm::EDGetTokenT<std::vector<double>> etaToken_;
0131   edm::EDGetTokenT<std::vector<double>> rhoToken_;
0132   edm::EDGetTokenT<std::vector<double>> rhomToken_;
0133 
0134   MonitorElement* mNPFpart;
0135   MonitorElement* mPFPt;
0136   MonitorElement* mPFEta;
0137   MonitorElement* mPFPhi;
0138 
0139   MonitorElement* mPFArea;
0140   MonitorElement* mPFDeltaR;           //MZ
0141   MonitorElement* mPFDeltaR_Scaled_R;  //MZ
0142 
0143   MonitorElement* mNCalopart;
0144   MonitorElement* mCaloPt;
0145   MonitorElement* mCaloEta;
0146   MonitorElement* mCaloPhi;
0147   MonitorElement* mCaloArea;
0148   MonitorElement* mSumpt;
0149   MonitorElement* mSumPFPt;
0150   MonitorElement* mSumPFPt_eta;
0151 
0152   MonitorElement* mSumCaloPt;
0153   MonitorElement* mSumCaloPt_eta;
0154 
0155   MonitorElement* mSumSquaredPFPt;
0156   MonitorElement* mSumSquaredPFPt_eta;
0157 
0158   MonitorElement* mSumSquaredCaloPt;
0159   MonitorElement* mSumSquaredCaloPt_eta;
0160 
0161   // Event variables (including centrality)
0162   MonitorElement* mNvtx;
0163   MonitorElement* mHF;
0164 
0165   // new additions Jan 12th 2015
0166   MonitorElement* mSumPFPt_HF;
0167   MonitorElement* mSumCaloPt_HF;
0168 
0169   MonitorElement* mSumPFPtEtaDep[etaBins_];
0170   MonitorElement* mSumCaloPtEtaDep[etaBins_];
0171 
0172   // Jet parameters
0173   MonitorElement* mEta;
0174   MonitorElement* mPhi;
0175   MonitorElement* mPt;
0176   MonitorElement* mP;
0177   MonitorElement* mEnergy;
0178   MonitorElement* mMass;
0179   MonitorElement* mConstituents;
0180   MonitorElement* mJetArea;
0181   MonitorElement* mjetpileup;
0182   MonitorElement* mNJets;
0183   MonitorElement* mNJets_40;
0184 
0185   MonitorElement* mRhoDist_vsEta;
0186   MonitorElement* mRhoMDist_vsEta;
0187   MonitorElement* mRhoDist_vsPt;
0188   MonitorElement* mRhoMDist_vsPt;
0189   MonitorElement* mRhoDist_vsCent[etaBins_];
0190   MonitorElement* mRhoMDist_vsCent[etaBins_];
0191   MonitorElement* rhoEtaRange;
0192   MonitorElement* mCSCandpT_vsPt[etaBins_];
0193   MonitorElement* mCSCand_corrPFcand[etaBins_];
0194   MonitorElement* mSubtractedEFrac[ptBins_][etaBins_];
0195   MonitorElement* mSubtractedE[ptBins_][etaBins_];
0196 
0197   MonitorElement* mPFCandpT_vs_eta_Unknown;        // pf id 0
0198   MonitorElement* mPFCandpT_vs_eta_ChargedHadron;  // pf id - 1
0199   MonitorElement* mPFCandpT_vs_eta_electron;       // pf id - 2
0200   MonitorElement* mPFCandpT_vs_eta_muon;           // pf id - 3
0201   MonitorElement* mPFCandpT_vs_eta_photon;         // pf id - 4
0202   MonitorElement* mPFCandpT_vs_eta_NeutralHadron;  // pf id - 5
0203   MonitorElement* mPFCandpT_vs_eta_HadE_inHF;      // pf id - 6
0204   MonitorElement* mPFCandpT_vs_eta_EME_inHF;       // pf id - 7
0205 
0206   MonitorElement* mPFCandpT_Barrel_Unknown;        // pf id 0
0207   MonitorElement* mPFCandpT_Barrel_ChargedHadron;  // pf id - 1
0208   MonitorElement* mPFCandpT_Barrel_electron;       // pf id - 2
0209   MonitorElement* mPFCandpT_Barrel_muon;           // pf id - 3
0210   MonitorElement* mPFCandpT_Barrel_photon;         // pf id - 4
0211   MonitorElement* mPFCandpT_Barrel_NeutralHadron;  // pf id - 5
0212   MonitorElement* mPFCandpT_Barrel_HadE_inHF;      // pf id - 6
0213   MonitorElement* mPFCandpT_Barrel_EME_inHF;       // pf id - 7
0214 
0215   MonitorElement* mPFCandpT_Endcap_Unknown;        // pf id 0
0216   MonitorElement* mPFCandpT_Endcap_ChargedHadron;  // pf id - 1
0217   MonitorElement* mPFCandpT_Endcap_electron;       // pf id - 2
0218   MonitorElement* mPFCandpT_Endcap_muon;           // pf id - 3
0219   MonitorElement* mPFCandpT_Endcap_photon;         // pf id - 4
0220   MonitorElement* mPFCandpT_Endcap_NeutralHadron;  // pf id - 5
0221   MonitorElement* mPFCandpT_Endcap_HadE_inHF;      // pf id - 6
0222   MonitorElement* mPFCandpT_Endcap_EME_inHF;       // pf id - 7
0223 
0224   MonitorElement* mPFCandpT_Forward_Unknown;        // pf id 0
0225   MonitorElement* mPFCandpT_Forward_ChargedHadron;  // pf id - 1
0226   MonitorElement* mPFCandpT_Forward_electron;       // pf id - 2
0227   MonitorElement* mPFCandpT_Forward_muon;           // pf id - 3
0228   MonitorElement* mPFCandpT_Forward_photon;         // pf id - 4
0229   MonitorElement* mPFCandpT_Forward_NeutralHadron;  // pf id - 5
0230   MonitorElement* mPFCandpT_Forward_HadE_inHF;      // pf id - 6
0231   MonitorElement* mPFCandpT_Forward_EME_inHF;       // pf id - 7
0232 
0233   // Parameters
0234 
0235   bool isCaloJet;
0236   bool isJPTJet;
0237   bool isPFJet;
0238 };
0239 
0240 #endif