CMS 3D CMS Logo

AlphaTVarAnalyzer.cc
Go to the documentation of this file.
2 
5 
8 
11 
12 #include <cmath>
13 
14 // A simple constructor which takes as input only the name of the PF jet
15 // collection
17  : ScoutingAnalyzerBase(conf),
18  m_jetCollectionTag(
19  conf.getUntrackedParameter<edm::InputTag>("jetCollectionName", edm::InputTag("hltCaloJetIDPassed"))),
20  m_alphaTVarCollectionTag(conf.getUntrackedParameter<edm::InputTag>("alphaTVarCollectionName")) {
21  // set Token(-s)
23  consumes<std::vector<double>>(conf.getUntrackedParameter<edm::InputTag>("alphaTVarCollectionName"));
24 }
25 
27 
28 // Function to book the Monitoring Elements.
31  // the full inclusive histograms
32  m_HTAlphaT = bookH2withSumw2(iBooker,
33  "HTvsAlphaT",
34  "H_{T} vs #alpha_{T} (All Events)",
35  400,
36  0.,
37  4000.,
38  50,
39  0.,
40  1.,
41  "H_{T} [GeV]",
42  "#alpha_{T}");
44  bookH1withSumw2(iBooker, "HTvsAlphaTg0p55", "H_{T} (#alpha_{T} > 0.55)", 400, 0., 4000., "H_{T} [GeV]");
46  bookH1withSumw2(iBooker, "HTvsAlphaTg0p60", "H_{T} (#alpha_{T} > 0.60)", 400, 0., 4000., "H_{T} [GeV]");
47 }
48 
49 // Usual analyze method
51  edm::Handle<std::vector<double>> alphaTvar_handle;
52  iEvent.getByToken(m_alphaTVarCollectionTagToken_, alphaTvar_handle);
53 
54  if (alphaTvar_handle->size() > 1) {
55  const double AlphaT = alphaTvar_handle->at(0);
56  const double HT = alphaTvar_handle->at(1);
57  m_HTAlphaT->Fill(HT, AlphaT);
58  if (AlphaT > 0.55)
59  m_HTAlphaTg0p55->Fill(HT);
60  if (AlphaT > 0.60)
61  m_HTAlphaTg0p60->Fill(HT);
62  }
63 }
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T getUntrackedParameter(std::string const &, T const &) const
Definition: AlphaT.h:8
void analyze(const edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void prepareBooking(DQMStore::IBooker &)
MonitorElement * m_HTAlphaT
MonitorElement * bookH1withSumw2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
MonitorElement * m_HTAlphaTg0p55
void Fill(long long x)
MonitorElement * m_HTAlphaTg0p60
int iEvent
Definition: GenABIO.cc:224
MonitorElement * bookH2withSumw2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
edm::EDGetTokenT< std::vector< double > > m_alphaTVarCollectionTagToken_
HLT enums.
AlphaTVarAnalyzer(const edm::ParameterSet &)
Definition: HT.h:21
~AlphaTVarAnalyzer() override
Definition: Run.h:45