ATLAS Offline Software
PhysicsAnalysis
D3PDMaker
MuonD3PDMaker
src
MuonTruthClassificationFillerTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
12
#include "
MuonTruthClassificationFillerTool.h
"
13
#include "
AthenaKernel/errorcheck.h
"
14
#include "
xAODMuon/Muon.h
"
15
16
namespace
D3PD
{
17
18
MuonTruthClassificationFillerTool::MuonTruthClassificationFillerTool
(
const
std::string&
type
,
19
const
std::string&
name
,
20
const
IInterface*
parent
)
21
:
Base
(
type
,
name
,
parent
),
22
m_classifier (
"MCTruthClassifier"
)
23
{
24
declareProperty (
"Classifier"
,
m_classifier
,
"Classifier tool instance."
);
25
26
MuonTruthClassificationFillerTool::book
().ignore();
// Avoid coverity warnings.
27
}
28
29
StatusCode
MuonTruthClassificationFillerTool::initialize
() {
30
CHECK
(
m_classifier
.retrieve() );
31
return
Base::initialize
();
32
}
33
34
35
StatusCode
MuonTruthClassificationFillerTool::book
() {
36
CHECK
(
addVariable
(
"type"
,
m_type
,
"MC particle type, from classifier tool"
) );
37
CHECK
(
addVariable
(
"origin"
,
m_origin
,
"MC particle origin, from classifier tool"
) );
38
39
return
StatusCode::SUCCESS;
40
}
41
42
StatusCode
MuonTruthClassificationFillerTool::fill
(
const
xAOD::Muon
&
p
) {
43
44
std::pair<
MCTruthPartClassifier::ParticleType
,
45
MCTruthPartClassifier::ParticleOrigin
>
res
;
46
47
res
=
m_classifier
->particleTruthClassifier(&
p
);
48
49
*
m_type
=
res
.first;
50
*
m_origin
=
res
.second;
51
52
return
StatusCode::SUCCESS;
53
}
54
55
}
// namespace D3PD
D3PD::MuonTruthClassificationFillerTool::m_type
int * m_type
Definition:
MuonTruthClassificationFillerTool.h:40
MuonTruthClassificationFillerTool.h
Block filler for truth classification of muons - uses MCTruthClassifier.
Muon.h
initialize
void initialize()
Definition:
run_EoverP.cxx:894
D3PD::AddVariable::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Definition:
AddVariable.cxx:85
D3PD::MuonTruthClassificationFillerTool::book
virtual StatusCode book()
Declare tuple variables.
Definition:
MuonTruthClassificationFillerTool.cxx:35
xAOD::Muon_v1
Class describing a Muon.
Definition:
Muon_v1.h:38
D3PD
Block filler tool for noisy FEB information.
Definition:
CaloCellDetailsFillerTool.cxx:29
D3PD::MuonTruthClassificationFillerTool::MuonTruthClassificationFillerTool
MuonTruthClassificationFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition:
MuonTruthClassificationFillerTool.cxx:18
python.utils.AtlRunQueryDQUtils.p
p
Definition:
AtlRunQueryDQUtils.py:210
D3PD::MuonTruthClassificationFillerTool::initialize
StatusCode initialize()
Definition:
MuonTruthClassificationFillerTool.cxx:29
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ParticleOrigin
ParticleOrigin
Definition:
TruthClasses.h:51
res
std::pair< std::vector< unsigned int >, bool > res
Definition:
JetGroupProductTest.cxx:14
test_pyathena.parent
parent
Definition:
test_pyathena.py:15
D3PD::BlockFillerTool< xAOD::Muon >
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition:
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:228
D3PD::MuonTruthClassificationFillerTool::m_classifier
ToolHandle< IMCTruthClassifier > m_classifier
Definition:
MuonTruthClassificationFillerTool.h:44
errorcheck.h
Helpers for checking error return status codes and reporting errors.
python.CaloScaleNoiseConfig.type
type
Definition:
CaloScaleNoiseConfig.py:78
D3PD::MuonTruthClassificationFillerTool::fill
virtual StatusCode fill(const xAOD::Muon &p)
Fill one block — type-safe version.
Definition:
MuonTruthClassificationFillerTool.cxx:42
D3PD::MuonTruthClassificationFillerTool::m_origin
int * m_origin
Definition:
MuonTruthClassificationFillerTool.h:41
ParticleType
ParticleType
Definition:
TruthClasses.h:8
Generated on Sun Dec 22 2024 21:15:32 for ATLAS Offline Software by
1.8.18