ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
14#include "xAODMuon/Muon.h"
15
16namespace D3PD {
17
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
30 CHECK( m_classifier.retrieve() );
31 return Base::initialize();
32}
33
34
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
43
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
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
std::pair< std::vector< unsigned int >, bool > res
Block filler for truth classification of muons - uses MCTruthClassifier.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
MuonTruthClassificationFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode fill(const xAOD::Muon &p)
Fill one block — type-safe version.
virtual StatusCode book()
Declare tuple variables.
Block filler tool for noisy FEB information.
Muon_v1 Muon
Reference the current persistent version: