ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsAnalysis
PhysicsValidation
GeneratorPhysVal
src
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
5
#include "
GeneratorEventInfo.h
"
6
7
namespace
GeneratorPhysVal
{
8
GeneratorEventInfo::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);
13
m_mc_ChannelNumber
=
14
Book1D
(
"is_mc_ChannelNumber"
,
"is_mc_ChannelNumber"
, 2, -0.5, 1.5);
15
}
16
void
GeneratorEventInfo::check_eventNumber
(
SG::ReadHandle<xAOD::EventInfo>
evt) {
17
const
auto
eventNumber = evt->eventNumber();
18
m_event_number
->Fill(eventNumber > 0 ? 1.0 : 0.0);
19
}
20
21
int
GeneratorEventInfo::check_mcChannelNumber
(
SG::ReadHandle<xAOD::EventInfo>
evt,
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
ref
const boost::regex ref(r_ef)
GeneratorEventInfo.h
GeneratorPhysVal::GeneratorEventInfo::check_eventNumber
void check_eventNumber(SG::ReadHandle< xAOD::EventInfo > evt)
Definition
GeneratorEventInfo.cxx:16
GeneratorPhysVal::GeneratorEventInfo::GeneratorEventInfo
GeneratorEventInfo(PlotBase *pParent, const std::string &sDir, const std::string &sType="")
Definition
GeneratorEventInfo.cxx:8
GeneratorPhysVal::GeneratorEventInfo::m_mc_ChannelNumber
TH1 * m_mc_ChannelNumber
Definition
GeneratorEventInfo.h:24
GeneratorPhysVal::GeneratorEventInfo::check_mcChannelNumber
int check_mcChannelNumber(SG::ReadHandle< xAOD::EventInfo > evt, int ref)
Definition
GeneratorEventInfo.cxx:21
GeneratorPhysVal::GeneratorEventInfo::m_event_number
TH1 * m_event_number
Definition
GeneratorEventInfo.h:23
GeneratorPhysVal::GeneratorEventInfo::m_sType
std::string m_sType
Definition
GeneratorEventInfo.h:27
PlotBase::Book1D
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
PlotBase(PlotBase *parent, const std::string &sDir)
Definition
PlotBase.cxx:29
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
GeneratorPhysVal
Definition
GeneratorEventInfo.cxx:7
Generated on
for ATLAS Offline Software by
1.14.0