Skip to content
Snippets Groups Projects
Commit 2cbb0932 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch '20240316' into 'main'

Drop code behind ifndef MCTRUTHCLASSIFIER_CONST

See merge request atlas/athena!69872
parents a5ae9b13 59fa1eed
No related branches found
No related tags found
No related merge requests found
......@@ -100,14 +100,9 @@ void classify(ToolHandle<IMCTruthClassifier>& classif,
unsigned int& particleType,
unsigned int& particleOrigin )
{
#ifdef MCTRUTHCLASSIFIER_CONST
MCTruthPartClassifier::Info info;
std::pair<MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin> classification = classif->particleTruthClassifier(theParticle, &info);
particleOutCome = info.particleOutCome;
#else
std::pair<MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin> classification = classif->particleTruthClassifier(theParticle);
particleOutCome = classif->getParticleOutCome();
#endif
result = (unsigned int)classif->classify(theParticle);
auto parent = classif->getParentHadron(theParticle);
hadron_pdg = parent ? parent->pdg_id() : 0;
......
......@@ -82,20 +82,12 @@ StatusCode DerivationFramework::TruthClassificationDecorator::addBranches() cons
SG::WriteDecorHandle<xAOD::TruthParticleContainer, unsigned int> classificationDecorator(m_classificationDecoratorKey, ctx);
for (unsigned int i=0; i<nParticles; ++i) {
#ifdef MCTRUTHCLASSIFIER_CONST
MCTruthPartClassifier::Info info;
std::pair<MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin> classification =
m_classifier->particleTruthClassifier((*truthParticles)[i], &info);
unsigned int particleOutCome = info.particleOutCome;
unsigned int result = (unsigned int)m_classifier->classify((*truthParticles)[i]);
#else
std::pair<MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin> classification =
m_classifier->particleTruthClassifier((*truthParticles)[i]);
unsigned int particleOutCome = m_classifier->getParticleOutCome();
unsigned int result = (unsigned int)m_classifier->classify((*truthParticles)[i]);
#endif
unsigned int result = (unsigned int)m_classifier->classify((*truthParticles)[i]);
unsigned int particleType = classification.first;
unsigned int particleOrigin = classification.second;
typeDecorator(*((*truthParticles)[i])) = particleType;
......
......@@ -19,8 +19,6 @@
#include <unordered_map>
#include <vector>
#define MCTRUTHCLASSIFIER_CONST
#ifndef GENERATIONBASE
#include "xAODCaloEvent/CaloClusterFwd.h"
#include "xAODEgamma/ElectronFwd.h"
......
......@@ -234,12 +234,7 @@ StatusCode EgammaPhysValMonitoringTool::fillHistograms()
m_truthParticleContainerKey, ctx);
ATH_CHECK(truthallParticles.isValid());
#ifdef MCTRUTHCLASSIFIER_CONST
MCTruthPartClassifier::Info info;
#else
std::pair<ParticleType, ParticleOrigin> partClass;
MCTruthPartClassifier::ParticleType type;
#endif
bool elecPrompt = false;
bool photonPrompt = false;
......@@ -252,23 +247,10 @@ StatusCode EgammaPhysValMonitoringTool::fillHistograms()
MC::isStable(truthallParticle) &&
HepMC::generations(truthallParticle) == 0) {
#ifdef MCTRUTHCLASSIFIER_CONST
auto type =
m_truthClassifier->particleTruthClassifier(truthallParticle, &info);
if (type.first == IsoElectron)
elecPrompt = true;
#else
partClass = std::make_pair(Unknown, NonDefined);
type = Unknown;
if (truthallParticle->isAvailable<int>("truthType")) {
MCTruthPartClassifier::ParticleType type =
(MCTruthPartClassifier::ParticleType)truthallParticle->auxdata<int>(
"truthType");
}
if (type == IsoElectron)
elecPrompt = true;
#endif
m_oElectronValidationPlots.m_oTruthAllPlots.fill(*truthallParticle,
*eventInfo);
......@@ -285,23 +267,11 @@ StatusCode EgammaPhysValMonitoringTool::fillHistograms()
MC::isStable(truthallParticle) &&
HepMC::generations(truthallParticle) == 0) {
#ifdef MCTRUTHCLASSIFIER_CONST
auto type =
m_truthClassifier->particleTruthClassifier(truthallParticle, &info);
if (type.first == IsoPhoton)
photonPrompt = true;
#else
partClass = std::make_pair(Unknown, NonDefined);
type = Unknown;
if (truthallParticle->isAvailable<int>("truthType")) {
MCTruthPartClassifier::ParticleType type =
(MCTruthPartClassifier::ParticleType)truthallParticle->auxdata<int>(
"truthType");
}
if (type == IsoPhoton)
photonPrompt = true;
#endif
m_oPhotonValidationPlots.m_oTruthAllPlots.fill(*truthallParticle,
*eventInfo);
......@@ -312,12 +282,8 @@ StatusCode EgammaPhysValMonitoringTool::fillHistograms()
fabs(truthallParticle->eta()) < 2.47) {
m_oPhotonValidationPlots.m_oTruthAllIsoPlots.fill(*truthallParticle,
*eventInfo);
#ifdef MCTRUTHCLASSIFIER_CONST
m_truthClassifier->particleTruthClassifier(truthallParticle, &info);
ParticleOutCome photOutCome = info.particleOutCome;
#else
ParticleOutCome photOutCome = m_truthClassifier->getParticleOutCome();
#endif
float convTruthR = 9999.;
if (truthallParticle->decayVtx())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment