diff --git a/Reconstruction/PFlow/PFlowUtils/share/PFlowCalibHitDecorator_algorithms.py b/Reconstruction/PFlow/PFlowUtils/share/PFlowCalibHitDecorator_algorithms.py index c816b24d85495a105fd65de617735c89233f2a3a..be51b9225f74ec3f5947d1c0f250352e5ad50a9d 100644 --- a/Reconstruction/PFlow/PFlowUtils/share/PFlowCalibHitDecorator_algorithms.py +++ b/Reconstruction/PFlow/PFlowUtils/share/PFlowCalibHitDecorator_algorithms.py @@ -14,4 +14,9 @@ from PFlowUtils.PFlowUtilsConf import PFlowCalibPFODecoratorAlgorithm PFlowCalibPFODecoratorAlgorithm = PFlowCalibPFODecoratorAlgorithm() PFlowCalibPFOTruthAttributerTool = CalibClusterTruthAttributerTool("PFlowCalibPFOTruthAttributerTool") PFlowCalibPFODecoratorAlgorithm.TruthAttributerTool = PFlowCalibPFOTruthAttributerTool +#allow flow element decoration if the eflowRec JO permits it +from eflowRec.eflowRecFlags import jobproperties as jobprops +if(jobprops.eflowRecFlags.useFlowElements==True): + PFlowCalibPFODecoratorAlgorithm.useFlowElements=True + topSequence+=PFlowCalibPFODecoratorAlgorithm diff --git a/Reconstruction/PFlow/PFlowUtils/src/PFlowCalibPFODecoratorAlgorithm.cxx b/Reconstruction/PFlow/PFlowUtils/src/PFlowCalibPFODecoratorAlgorithm.cxx index 7f09d44dc0b2a3a3c50280713d80640f17010ae7..d4369bd464856b8923030a90149ad797cf4dc144 100644 --- a/Reconstruction/PFlow/PFlowUtils/src/PFlowCalibPFODecoratorAlgorithm.cxx +++ b/Reconstruction/PFlow/PFlowUtils/src/PFlowCalibPFODecoratorAlgorithm.cxx @@ -13,6 +13,7 @@ StatusCode PFlowCalibPFODecoratorAlgorithm::initialize(){ ATH_CHECK(m_mapTruthBarcodeToTruthParticleReadHandleKey.initialize()); ATH_CHECK(m_pfoWriteDecorHandleKeyNLeadingTruthParticles.initialize()); + ATH_CHECK(m_feWriteDecorHandleKeyNLeadingTruthParticles.initialize()); ATH_CHECK(m_truthAttributerTool.retrieve()); @@ -84,8 +85,8 @@ StatusCode PFlowCalibPFODecoratorAlgorithm::execute(const EventContext& ctx) con pfoWriteDecorHandleNLeadingTruthParticles, mapIdentifierToCalibHitsReadHandle, mapTruthBarcodeToTruthParticleReadHandle)); // end of check block - bool doFlowElements=true; - if(doFlowElements){ + + if(m_useFlowElements){ SG::WriteDecorHandle<xAOD::FlowElementContainer,std::vector<std::pair<unsigned int, double> > > feWriteDecorHandleNLeadingTruthParticles(m_feWriteDecorHandleKeyNLeadingTruthParticles,ctx); ATH_CHECK(this->LinkCalibHitPFO( diff --git a/Reconstruction/PFlow/PFlowUtils/src/PFlowCalibPFODecoratorAlgorithm.h b/Reconstruction/PFlow/PFlowUtils/src/PFlowCalibPFODecoratorAlgorithm.h index dab000a8c0bdbea47e02c178063be7a289f8fe63..3fa8869e138ef846e67db0944d43e37b5fa49b41 100644 --- a/Reconstruction/PFlow/PFlowUtils/src/PFlowCalibPFODecoratorAlgorithm.h +++ b/Reconstruction/PFlow/PFlowUtils/src/PFlowCalibPFODecoratorAlgorithm.h @@ -64,6 +64,9 @@ private: /** Allow user to set the number of truth particles per clusterCaloCluster or PFO, in descending pt order, for which to store calibration hit enery */ Gaudi::Property<unsigned int> m_numTruthParticles{this,"NumTruthParticles",3,"Set number of truth particles per CaloCluster/PFO for which we store calibration hit energy"}; + + Gaudi::Property<bool> m_useFlowElements{this,"useFlowElements",false,"Set decoration of flow element container as well as PFO"}; + // functions to do the links between either PFO or FlowElements StatusCode LinkCalibHitPFO( SG::WriteDecorHandle<xAOD::FlowElementContainer, std::vector< std::pair<unsigned int, double> > >& pfoWriteDecorHandle,