Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
40 const std::string&
name,
43 m_sg (
"StoreGateSvc",
name)
55 return StatusCode::SUCCESS;
69 bool got_names =
false;
70 std::string tp_truth_name, tp_name;
71 if (
el->trackParticleLink().isValid()) {
72 tp_name =
el->trackParticleLink().dataID();
78 std::string old_tp_truth_name, old_tp_name;
80 getProperty1 (
"TrackParticleTruthCollection", old_tp_truth_name);
81 getProperty1 (
"TrackParticleContainerName", old_tp_name);
82 setProperty1 (
"TrackParticleTruthCollection", tp_truth_name);
93 setProperty1 (
"TrackParticleTruthCollection", old_tp_truth_name);
94 setProperty1 (
"TrackParticleContainerName", old_tp_name);
111 bool got_names =
false;
112 std::string tp_truth_name, tp_name;
116 for (
auto trklink :
links) {
117 if (trklink.isValid()) {
118 tp_name = trklink.dataID();
120 if (got_names)
break;
127 std::string old_tp_truth_name, old_tp_name;
129 getProperty1 (
"TrackParticleTruthCollection", old_tp_truth_name);
130 getProperty1 (
"TrackParticleContainerName", old_tp_name);
131 setProperty1 (
"TrackParticleTruthCollection", tp_truth_name);
142 setProperty1 (
"TrackParticleTruthCollection", old_tp_truth_name);
143 setProperty1 (
"TrackParticleContainerName", old_tp_name);
158 if(
mu->muonType() == xAOD::Muon::SiliconAssociatedForwardMuon ) {
175 std::string& tptruth_name)
179 std::vector<std::string>
keys;
182 for (
size_t i = 0;
i <
keys.size();
i++) {
184 if (
m_sg->retrieve (tptc,
keys[
i]).isFailure() || !tptc)
190 tptruth_name =
keys[
i];
192 std::string target_tp_name;
195 target_tp_name =
"TrackParticleCandidate";
202 if (tp_name == target_tp_name)
229 const std::string&
value)
Work around MCTruthClassifier brain-damage.
void getProperty1(const std::string &pname, std::string &value)
Helper to retrieve the value of a Gaudi property.
#define REPORT_ERROR(SC)
Report an error.
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
D3PDMCTruthClassifier(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
const ID_type & dataID() const
Get the key that we reference, as a string.
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleTruthClassifier(const xAOD::Electron *el)
Run the classifier for an electron.
virtual StatusCode initialize()
Standard Gaudi initialize method.
Block filler tool for noisy FEB information.
DataLink< Rec::TrackParticleContainer > trackParticleContainerLink() const
void setProperty1(const std::string &pname, const std::string &value)
Helper to set the value of a Gaudi property.
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
std::vector< ElementLink< xAOD::TrackParticleContainer > > TrackParticleLinks_t
Type for the associated track particles.
bool isValid() const
Test to see if the link is dereferencable.
ServiceHandle< StoreGateSvc > m_sg
The StoreGate service.
bool get_tptruth_name(const std::string &tp_name, std::string &tptruth_name)
Try to find a TrackParticleTruthCollection pointing at TP_NAME.
bool isDefault() const
Test to see if we're in the default state.
Helpers for checking error return status codes and reporting errors.
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleTruthClassifier(const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final
const xAOD::Vertex * vertex(size_t index=0) const
Pointer to the xAOD::Vertex/es that match the photon candidate.