Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:09:35

0001 #include "DQM/DataScouting/plugins/AlphaTVarAnalyzer.h"
0002 
0003 #include "DataFormats/JetReco/interface/CaloJet.h"
0004 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
0005 
0006 #include "DataFormats/EgammaCandidates/interface/Electron.h"
0007 #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
0008 
0009 #include "DataFormats/MuonReco/interface/Muon.h"
0010 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
0011 
0012 #include <cmath>
0013 
0014 // A simple constructor which takes as input only the name of the PF jet
0015 // collection
0016 AlphaTVarAnalyzer::AlphaTVarAnalyzer(const edm::ParameterSet &conf)
0017     : ScoutingAnalyzerBase(conf),
0018       m_jetCollectionTag(
0019           conf.getUntrackedParameter<edm::InputTag>("jetCollectionName", edm::InputTag("hltCaloJetIDPassed"))),
0020       m_alphaTVarCollectionTag(conf.getUntrackedParameter<edm::InputTag>("alphaTVarCollectionName")) {
0021   // set Token(-s)
0022   m_alphaTVarCollectionTagToken_ =
0023       consumes<std::vector<double>>(conf.getUntrackedParameter<edm::InputTag>("alphaTVarCollectionName"));
0024 }
0025 
0026 AlphaTVarAnalyzer::~AlphaTVarAnalyzer() {}
0027 
0028 // Function to book the Monitoring Elements.
0029 void AlphaTVarAnalyzer::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &, edm::EventSetup const &) {
0030   ScoutingAnalyzerBase::prepareBooking(iBooker);
0031   // the full inclusive histograms
0032   m_HTAlphaT = bookH2withSumw2(iBooker,
0033                                "HTvsAlphaT",
0034                                "H_{T} vs #alpha_{T} (All Events)",
0035                                400,
0036                                0.,
0037                                4000.,
0038                                50,
0039                                0.,
0040                                1.,
0041                                "H_{T} [GeV]",
0042                                "#alpha_{T}");
0043   m_HTAlphaTg0p55 =
0044       bookH1withSumw2(iBooker, "HTvsAlphaTg0p55", "H_{T} (#alpha_{T} > 0.55)", 400, 0., 4000., "H_{T} [GeV]");
0045   m_HTAlphaTg0p60 =
0046       bookH1withSumw2(iBooker, "HTvsAlphaTg0p60", "H_{T} (#alpha_{T} > 0.60)", 400, 0., 4000., "H_{T} [GeV]");
0047 }
0048 
0049 // Usual analyze method
0050 void AlphaTVarAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &c) {
0051   edm::Handle<std::vector<double>> alphaTvar_handle;
0052   iEvent.getByToken(m_alphaTVarCollectionTagToken_, alphaTvar_handle);
0053 
0054   if (alphaTvar_handle->size() > 1) {
0055     const double AlphaT = alphaTvar_handle->at(0);
0056     const double HT = alphaTvar_handle->at(1);
0057     m_HTAlphaT->Fill(HT, AlphaT);
0058     if (AlphaT > 0.55)
0059       m_HTAlphaTg0p55->Fill(HT);
0060     if (AlphaT > 0.60)
0061       m_HTAlphaTg0p60->Fill(HT);
0062   }
0063 }