ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
EventSelectionAlgorithms
Root
NLargeRJetMassWindowSelectorAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
#include "
EventSelectionAlgorithms/NLargeRJetMassWindowSelectorAlg.h
"
8
9
namespace
CP
{
10
11
NLargeRJetMassWindowSelectorAlg::NLargeRJetMassWindowSelectorAlg
(
const
std::string &
name
, ISvcLocator *pSvcLocator)
12
:
EL
::
AnaAlgorithm
(
name
, pSvcLocator)
13
{}
14
15
StatusCode
NLargeRJetMassWindowSelectorAlg::initialize
() {
16
ANA_CHECK
(
m_ljetsHandle
.initialize(
m_systematicsList
));
17
ANA_CHECK
(
m_ljetSelection
.initialize(
m_systematicsList
,
m_ljetsHandle
,
SG::AllowEmpty
));
18
ANA_CHECK
(
m_eventInfoHandle
.initialize(
m_systematicsList
));
19
20
ANA_CHECK
(
m_preselection
.initialize(
m_systematicsList
,
m_eventInfoHandle
,
SG::AllowEmpty
));
21
ANA_CHECK
(
m_decoration
.initialize(
m_systematicsList
,
m_eventInfoHandle
));
22
ANA_CHECK
(
m_systematicsList
.initialize());
23
24
m_signEnum
=
SignEnum::stringToOperator
.at(
m_sign
);
25
26
return
StatusCode::SUCCESS;
27
}
28
29
StatusCode
NLargeRJetMassWindowSelectorAlg::execute
(
const
EventContext& ctx) {
30
for
(
const
auto
&sys :
m_systematicsList
.systematicsVector()) {
31
// retrieve the EventInfo
32
const
xAOD::EventInfo
*evtInfo =
nullptr
;
33
ANA_CHECK
(
m_eventInfoHandle
.retrieve(evtInfo, sys, ctx));
34
35
// default-decorate EventInfo
36
m_decoration
.setBool(*evtInfo, 0, sys);
37
38
// check the preselection
39
if
(
m_preselection
&& !
m_preselection
.getBool(*evtInfo, sys))
40
continue
;
41
42
// retrieve the large-R jet container
43
const
xAOD::IParticleContainer
*ljets =
nullptr
;
44
ANA_CHECK
(
m_ljetsHandle
.retrieve(ljets, sys, ctx));
45
46
// apply selection and calculate the jet-wise decision
47
int
count
= 0;
48
for
(
const
xAOD::IParticle
*lj : *ljets) {
49
if
(!
m_ljetSelection
||
m_ljetSelection
.getBool(*lj, sys)) {
50
double
mass = lj->m();
51
bool
in_range = ( mass >
m_mlower
&& mass <
m_mupper
);
52
bool
pass =
m_veto
? (!in_range) : in_range;
53
if
(pass)
count
++;
54
}
55
}
56
57
// calculate event-wise decision
58
bool
decision =
SignEnum::checkValue
(
m_count
.value(),
m_signEnum
,
count
);
59
m_decoration
.setBool(*evtInfo, decision, sys);
60
}
61
return
StatusCode::SUCCESS;
62
}
63
}
// namespace CP
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
NLargeRJetMassWindowSelectorAlg.h
CP::NLargeRJetMassWindowSelectorAlg::m_mupper
Gaudi::Property< float > m_mupper
the upper limit of the Mass window
Definition
NLargeRJetMassWindowSelectorAlg.h:40
CP::NLargeRJetMassWindowSelectorAlg::m_decoration
CP::SysWriteSelectionHandle m_decoration
the output selection decoration
Definition
NLargeRJetMassWindowSelectorAlg.h:81
CP::NLargeRJetMassWindowSelectorAlg::NLargeRJetMassWindowSelectorAlg
NLargeRJetMassWindowSelectorAlg(const std::string &name, ISvcLocator *pSvcLocator)
the standard constructor
Definition
NLargeRJetMassWindowSelectorAlg.cxx:11
CP::NLargeRJetMassWindowSelectorAlg::m_sign
Gaudi::Property< std::string > m_sign
the sign against which to compare Mass (GT, LT, etc)
Definition
NLargeRJetMassWindowSelectorAlg.h:46
CP::NLargeRJetMassWindowSelectorAlg::m_preselection
CP::SysReadSelectionHandle m_preselection
the preselection
Definition
NLargeRJetMassWindowSelectorAlg.h:76
CP::NLargeRJetMassWindowSelectorAlg::m_count
Gaudi::Property< int > m_count
the count of events desired
Definition
NLargeRJetMassWindowSelectorAlg.h:55
CP::NLargeRJetMassWindowSelectorAlg::m_systematicsList
CP::SysListHandle m_systematicsList
the systematics
Definition
NLargeRJetMassWindowSelectorAlg.h:58
CP::NLargeRJetMassWindowSelectorAlg::m_eventInfoHandle
CP::SysReadHandle< xAOD::EventInfo > m_eventInfoHandle
the event info handle
Definition
NLargeRJetMassWindowSelectorAlg.h:71
CP::NLargeRJetMassWindowSelectorAlg::m_ljetSelection
CP::SysReadSelectionHandle m_ljetSelection
the large-R jet selection
Definition
NLargeRJetMassWindowSelectorAlg.h:66
CP::NLargeRJetMassWindowSelectorAlg::initialize
virtual StatusCode initialize() override
Definition
NLargeRJetMassWindowSelectorAlg.cxx:15
CP::NLargeRJetMassWindowSelectorAlg::m_mlower
Gaudi::Property< float > m_mlower
the lower limit of the Mass window
Definition
NLargeRJetMassWindowSelectorAlg.h:43
CP::NLargeRJetMassWindowSelectorAlg::m_veto
Gaudi::Property< bool > m_veto
whether to veto events instead of selecting them
Definition
NLargeRJetMassWindowSelectorAlg.h:52
CP::NLargeRJetMassWindowSelectorAlg::m_signEnum
SignEnum::ComparisonOperator m_signEnum
the operator version of the comparison (>, <, etc)
Definition
NLargeRJetMassWindowSelectorAlg.h:49
CP::NLargeRJetMassWindowSelectorAlg::m_ljetsHandle
CP::SysReadHandle< xAOD::IParticleContainer > m_ljetsHandle
the large-R jet handle
Definition
NLargeRJetMassWindowSelectorAlg.h:61
EL::AnaAlgorithm::AnaAlgorithm
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Definition
AnaAlgorithm.cxx:40
EL::AnaAlgorithm::execute
virtual::StatusCode execute()
execute this algorithm
Definition
AnaAlgorithm.cxx:315
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
count
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Definition
hcg.cxx:148
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
SignEnum::checkValue
bool checkValue(T reference, ComparisonOperator sign, T test)
the comparison test given the specified sign and two test values
Definition
SignEnums.h:37
SignEnum::stringToOperator
static const std::map< std::string, ComparisonOperator > stringToOperator
the map between user inputs and comparison operators
Definition
SignEnums.h:27
xAOD::name
name
Definition
TriggerMenuJson_v1.cxx:29
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
xAOD::IParticleContainer
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
Definition
xAOD/xAODBase/xAODBase/IParticleContainer.h:32
Generated on
for ATLAS Offline Software by
1.17.0