Skip to content
Snippets Groups Projects
Commit 7049af0b authored by Christopher Young's avatar Christopher Young
Browse files

Modifying the Augmentation tool to have additional information attached to...

Modifying the Augmentation tool to have additional information attached to charged PFOs and out these in JETM5


Former-commit-id: 4d761867e8fabcaacee1fce380f32af2da4d0c3b
parent d67c5f6d
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ def applyPFOAugmentation(sequence=DerivationFrameworkJob):
if hasattr(ToolSvc,"PFlowAugmentationTool"):
pfoaugtool = getattr(ToolSvc,"PFlowAugmentationTool")
else:
weightpfotool = CfgMgr.CP__WeightPFOTool("PFAugmentationWeightTool",DoEoverPWeight=False)
weightpfotool = CfgMgr.CP__WeightPFOTool("PFAugmentationWeightTool",DoEoverPWeight=True)
ToolSvc += weightpfotool
pfoaugtool = CfgMgr.DerivationFramework__PFlowAugmentationTool("PFlowAugmentationTool",
WeightPFOTool=weightpfotool)
......
......@@ -13,6 +13,12 @@ if DerivationFrameworkIsMonteCarlo:
from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents
addStandardTruthContents()
#====================================================================
# ADD PFLOW AUG INFORMATION
#====================================================================
from DerivationFrameworkJetEtMiss.PFlowCommon import applyPFOAugmentation
applyPFOAugmentation(DerivationFrameworkJob)
#====================================================================
# SKIMMING TOOL
#====================================================================
......@@ -127,7 +133,7 @@ JETM5SlimmingHelper.AllVariables = ["CaloCalTopoClusters",
"Kt4EMTopoOriginEventShape","Kt4LCTopoOriginEventShape","Kt4EMPFlowEventShape",
]
JETM5SlimmingHelper.ExtraVariables = ["JetETMissNeutralParticleFlowObjects.m.mEM.pfo_TrackLinks.eflowRec_ISOLATION.pfo_ClusterLinks.eflowRec_TIMING.eflowRec_AVG_LAR_Q.eflowRec_EM_PROBABILITY.eflowRec_CENTER_LAMBDA.centerMag.pt.ptEM.phi.eta",
"JetETMissChargedParticleFlowObjects.pt.eta.phi.m.eflowRec_tracksExpectedEnergyDeposit.pfo_vertex.charge.eflowRec_isInDenseEnvironment.pfo_TrackLinks",]
"JetETMissChargedParticleFlowObjects.pt.eta.phi.m.eflowRec_tracksExpectedEnergyDeposit.pfo_vertex.charge.eflowRec_isInDenseEnvironment.pfo_TrackLinks.DFCommonPFlow_z0.DFCommonPFlow_d0.DFCommonPFlow_theta.DFCommonPFlow_envWeight",]
for truthc in [
"TruthMuons",
......
......@@ -5,7 +5,7 @@
///////////////////////////////////////////////////////////////////
// PFlowAugmentationTool.cxx, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
// Author: Fabrice Balli (fabrice.balli@cern.ch)
// Author: Fabrice Balli (fabrice.balli@cern.ch), Chris Young (christopher.young@cern.ch)
//
#include "PFlowAugmentationTool.h"
......@@ -15,6 +15,10 @@ namespace DerivationFramework {
const static SG::AuxElement::Decorator<char> dec_PVmatched("DFCommonPFlow_PVMatched");
const static SG::AuxElement::Decorator<float> dec_corrP4_pt("DFCommonPFlow_CaloCorrectedPt");
const static SG::AuxElement::Decorator<float> dec_z0("DFCommonPFlow_z0");
const static SG::AuxElement::Decorator<float> dec_d0("DFCommonPFlow_d0");
const static SG::AuxElement::Decorator<float> dec_theta("DFCommonPFlow_theta");
const static SG::AuxElement::Decorator<float> dec_envWeight("DFCommonPFlow_envWeight");
PFlowAugmentationTool::PFlowAugmentationTool(const std::string& t,
const std::string& n,
......@@ -84,7 +88,10 @@ const static SG::AuxElement::Decorator<float> dec_corrP4_pt("DFCommonPFlow_CaloC
continue;
}
float weight = 1.0;
// decorate the track properties
dec_z0(*cpfo) = ptrk->z0();
dec_d0(*cpfo) = ptrk->d0();
dec_theta(*cpfo) = ptrk->theta();
bool matchedToPrimaryVertex = false;
//vtz.z() provides z of that vertex w.r.t the center of the beamspot (z = 0). Thus we correct the track z0 to be w.r.t z = 0
......@@ -97,15 +104,17 @@ const static SG::AuxElement::Decorator<float> dec_corrP4_pt("DFCommonPFlow_CaloC
}
}// if pv available
//find the weights from the tool
int isInDenseEnvironment = false;
bool gotVariable = cpfo->attribute(xAOD::PFODetails::PFOAttributes::eflowRec_isInDenseEnvironment,isInDenseEnvironment);
if(gotVariable && isInDenseEnvironment){
float weight = 1.0;
if(cpfo->attribute(xAOD::PFODetails::PFOAttributes::eflowRec_isInDenseEnvironment,isInDenseEnvironment)){
ATH_CHECK( m_weightPFOTool->fillWeight( *cpfo, weight ) );
}
// generate static decorators to avoid multiple lookups
// decorate the computed variables
dec_PVmatched(*cpfo) = matchedToPrimaryVertex;
dec_corrP4_pt(*cpfo) = weight*cpfo->pt();
dec_envWeight(*cpfo) = weight;
}
return StatusCode::SUCCESS;
......
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