40 const std::string& name,
41 const IInterface* parent)
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)
#define ATH_MSG_WARNING(x)
Helpers for checking error return status codes and reporting errors.
#define REPORT_ERROR(SC)
Report an error.
#define CHECK(...)
Evaluate an expression and check for errors.
Work around MCTruthClassifier brain-damage.
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)
D3PDMCTruthClassifier(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
bool get_tptruth_name(const std::string &tp_name, std::string &tptruth_name)
Try to find a TrackParticleTruthCollection pointing at TP_NAME.
void setProperty1(const std::string &pname, const std::string &value)
Helper to set the value of a Gaudi property.
virtual StatusCode initialize()
Standard Gaudi initialize method.
ServiceHandle< StoreGateSvc > m_sg
The StoreGate service.
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleTruthClassifier(const xAOD::Electron *el)
Run the classifier for an electron.
void getProperty1(const std::string &pname, std::string &value)
Helper to retrieve the value of a Gaudi property.
bool isDefault() const
Test to see if we're in the default state.
const ID_type & dataID() const
Get the key that we reference, as a string.
bool isValid() const
Test to see if the link is dereferencable.
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleTruthClassifier(const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final
MCTruthClassifier(const std::string &type)
DataLink< Rec::TrackParticleContainer > trackParticleContainerLink() const
const xAOD::Vertex * vertex(size_t index=0) const
Pointer to the xAOD::Vertex/es that match the photon candidate.
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
std::vector< ElementLink< xAOD::TrackParticleContainer > > TrackParticleLinks_t
Type for the associated track particles.
Block filler tool for noisy FEB information.
Vertex_v1 Vertex
Define the latest version of the vertex class.
Muon_v1 Muon
Reference the current persistent version:
Photon_v1 Photon
Definition of the current "egamma version".
Electron_v1 Electron
Definition of the current "egamma version".