ATLAS Offline Software
Loading...
Searching...
No Matches
GeneratorEventInfo.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace GeneratorPhysVal {
8GeneratorEventInfo::GeneratorEventInfo(PlotBase* pParent, const std::string& sDir,
9 const std::string& sType)
10 : PlotBase(pParent, sDir), m_sType(sType) {
11
12 m_event_number = Book1D("is_event_number", "is_event_number", 2, -0.5, 1.5);
14 Book1D("is_mc_ChannelNumber", "is_mc_ChannelNumber", 2, -0.5, 1.5);
15}
17 const auto eventNumber = evt->eventNumber();
18 m_event_number->Fill(eventNumber > 0 ? 1.0 : 0.0);
19}
20
22 int ref) {
23 int mcChannelNumber = evt->mcChannelNumber();
24 if (ref == 0) {
25 ref = mcChannelNumber;
26 m_mc_ChannelNumber->Fill(1.);
27 } else {
28 m_mc_ChannelNumber->Fill(mcChannelNumber == ref ? 1.0 : 0.0);
29 }
30 return ref;
31}
32} // namespace GeneratorPhysVal
const boost::regex ref(r_ef)
void check_eventNumber(SG::ReadHandle< xAOD::EventInfo > evt)
GeneratorEventInfo(PlotBase *pParent, const std::string &sDir, const std::string &sType="")
int check_mcChannelNumber(SG::ReadHandle< xAOD::EventInfo > evt, int ref)
TH1D * Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition PlotBase.cxx:94
PlotBase(PlotBase *parent, const std::string &sDir)
Definition PlotBase.cxx:29