Skip to content
Snippets Groups Projects
Commit 9b486d32 authored by Nils Erik Krumnack's avatar Nils Erik Krumnack
Browse files

Merge branch '21.2-AnalysisBase-DualUseJetAlg' into '21.2'

Changes to support a dual-use jet reconstruction configuration python framework

See merge request atlas/athena!13975

Former-commit-id: a9135b95c55909612f5d915848e4b21e9675f9d7
parents a40a373d 11f118d4
No related branches found
No related tags found
No related merge requests found
Showing
with 69 additions and 97 deletions
......@@ -57,5 +57,5 @@ if( XAOD_STANDALONE )
SCRIPT python -m unittest AnaAlgorithm.AlgSequence )
else()
atlas_install_python_modules( python/__init__.py python/DualUseConfig.py
python/AlgSequence.py python/AnaAlgSequence.py )
python/AlgSequence.py python/AnaAlgSequence.py python/Logging.py )
endif()
......@@ -9,7 +9,7 @@
# the standalone logger
try:
from AthenaCommon import logging
from AthenaCommon.Logging import logging as logging
except:
......
......@@ -22,24 +22,24 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
# Component(s) in the package:
atlas_add_library( EventShapeToolsLib
Root/*.cxx
src/*.cxx
PUBLIC_HEADERS EventShapeTools
INCLUDE_DIRS ${FASTJET_INCLUDE_DIRS}
PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${FASTJET_LIBRARIES} AsgTools GaudiKernel EventShapeInterface JetInterface
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps xAODEventShape )
LINK_LIBRARIES ${FASTJET_LIBRARIES} AsgTools EventShapeInterface JetInterface
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} xAODEventShape )
atlas_add_component( EventShapeTools
src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${FASTJET_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${FASTJET_LIBRARIES} AsgTools GaudiKernel EventShapeInterface JetInterface AthenaBaseComps xAODEventShape EventShapeToolsLib )
if( NOT XAOD_STANDALONE )
atlas_add_component( EventShapeTools
src/*.cxx src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${FASTJET_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${FASTJET_LIBRARIES} AsgTools GaudiKernel EventShapeInterface JetInterface AthenaBaseComps xAODEventShape EventShapeToolsLib )
endif()
atlas_add_dictionary( EventShapeToolsDict
EventShapeTools/EventShapeToolsDict.h
EventShapeTools/selection.xml
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${FASTJET_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${FASTJET_LIBRARIES} AsgTools GaudiKernel EventShapeInterface JetInterface AthenaBaseComps xAODEventShape EventShapeToolsLib )
LINK_LIBRARIES ${ROOT_LIBRARIES} ${FASTJET_LIBRARIES} AsgTools EventShapeInterface JetInterface xAODEventShape EventShapeToolsLib )
# Install files from the package:
atlas_install_python_modules( python/*.py )
......@@ -83,17 +83,10 @@ if( NOT XAOD_STANDALONE )
${extra_libs} )
endif()
if( XAOD_STANDALONE )
atlas_add_dictionary( JetMomentToolsDict
JetMomentTools/JetMomentToolsDict.h
JetMomentTools/selection_standalone.xml
LINK_LIBRARIES JetMomentToolsLib )
else()
atlas_add_dictionary( JetMomentToolsDict
atlas_add_dictionary( JetMomentToolsDict
JetMomentTools/JetMomentToolsDict.h
JetMomentTools/selection.xml
LINK_LIBRARIES JetMomentToolsLib )
endif()
if( XAOD_ANALYSIS )
atlas_add_executable( JetJvtTools_Example
......@@ -109,4 +102,3 @@ endif()
atlas_install_python_modules( python/*.py )
atlas_install_runtime( share/*.root )
atlas_install_data( share/*.root )
......@@ -11,9 +11,9 @@
#include <vector>
class JetCaloEnergies : public JetModifierBase {
ASG_TOOL_CLASS0(JetCaloEnergies)
ASG_TOOL_CLASS(JetCaloEnergies,IJetModifier)
public:
JetCaloEnergies(const std::string & t);
......@@ -23,10 +23,9 @@ protected:
void fillEperSamplingCluster(xAOD::Jet &jet, std::vector<float> & ePerSampling ) const ;
void fillEperSamplingPFO(xAOD::Jet &jet, std::vector<float> & ePerSampling ) const ;
};
#undef ASG_DERIVED_TOOL_CLASS
#endif
......@@ -4,11 +4,11 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
/**
@class JetCaloQualityTool
Calculates calorimeter based variables for jet quality
Calculates calorimeter based variables for jet quality
@author Nikola Makovec
@author P-A Delsart
@author P-A Delsart
@date (first implementation) October , 2009
@date (run 2 implementation) February , 2014
......@@ -18,9 +18,9 @@
List of known calculations (see also the implementation of initialize()) :
LArQuality, Timing, NegativeE, Centroid, N90Constituents, BchCorrCell, FracSamplingMax
This class performs cluster-based calculation. For similar cell-based calculation, see JetCaloCellQualityUtils.h
*/
#ifndef JETREC_JETCALOQUALITYTOOL_H
#define JETREC_JETCALOQUALITYTOOL_H
......@@ -34,30 +34,29 @@
class JetCaloQualityTool: public JetModifierBase {
ASG_TOOL_CLASS0(JetCaloQualityTool)
ASG_TOOL_CLASS(JetCaloQualityTool,IJetModifier)
public:
JetCaloQualityTool(const std::string & name);
virtual int modifyJet(xAOD::Jet& ) const ;
virtual StatusCode initialize();
protected:
/// Names of calo quantities to compute and to add as attributes
std::vector<std::string> m_calculationNames;
std::vector<std::string> m_calculationNames;
/// Time cuts for Out-of-time calo quantities.
std::vector <double> m_timingTimeCuts;
/// This objects holds a list of cluster-based calculators
/// This objects holds a list of cluster-based calculators
jet::JetCaloCalculations m_jetCalculations;
// internal pointer to m_jetCalculations (this pointer is also used in the cell-based derived tool)
jet::JetCaloCalculations * m_calcProcessor;
bool m_doFracSamplingMax; // internal
};
#endif
bool m_doFracSamplingMax; // internal
};
#endif
<lcgdict>
<!-- <class name="JetBadChanCorrTool.h"/> -->
<!-- <class name="JetCaloQualityTool.h"/> -->
<!-- <class name="JetIsolationTool.h"/> -->
<!-- <class name="JetVoronoiDiagramHelpers.h"/> -->
<!-- <class name="JetVoronoiMomentsTool.h"/> -->
<class name="JetCaloEnergies.h"/>
<class name="JetClusterMomentsTool.h"/>
<class name="JetConstitFourMomTool.h"/>
<class name="JetECPSFractionTool.h"/>
<class name="JetForwardJvtTool.h"/>
<class name="JetLArHVTool.h"/>
<class name="JetMuonSegmentMomentsTool.h"/>
<class name="JetOriginCorrectionTool.h"/>
<class name="JetPtAssociationTool.h"/>
<class name="JetTrackMomentsTool.h"/>
<class name="JetTrackSumMomentsTool.h"/>
<class name="JetVertexFractionTool.h"/>
<class name="JetVertexTaggerTool.h"/>
<class name="JetWidthTool.h"/>
<class name="JetCaloEnergies"/>
<class name="JetCaloQualityTool"/>
<class name="JetClusterMomentsTool"/>
<class name="JetConstitFourMomTool"/>
<class name="JetECPSFractionTool"/>
<class name="JetForwardJvtTool"/>
<class name="JetIsolationTool"/>
<class name="JetLArHVTool"/>
<class name="JetMuonSegmentMomentsTool"/>
<class name="JetOriginCorrectionTool"/>
<class name="JetPtAssociationTool"/>
<class name="JetTrackMomentsTool"/>
<class name="JetTrackSumMomentsTool"/>
<class name="JetVertexFractionTool"/>
<class name="JetVertexTaggerTool"/>
<class name="JetWidthTool"/>
</lcgdict>
<lcgdict>
<class name="JetCaloQualityTool"/>
<class name="JetClusterMomentsTool"/>
<class name="JetConstitFourMomTool"/>
<class name="JetECPSFractionTool"/>
<class name="JetForwardJvtTool"/>
<class name="JetLArHVTool"/>
<class name="JetMuonSegmentMomentsTool"/>
<class name="JetOriginCorrectionTool"/>
<class name="JetPtAssociationTool"/>
<class name="JetTrackMomentsTool"/>
<class name="JetTrackSumMomentsTool"/>
<class name="JetVertexFractionTool"/>
<class name="JetVertexTaggerTool"/>
<class name="JetWidthTool"/>
</lcgdict>
......@@ -19,7 +19,7 @@ StatusCode JetLArHVTool::initialize()
}
int JetLArHVTool::modifyJet( xAOD::Jet& jet ) const
int JetLArHVTool::modifyJet( xAOD::Jet& jet ) const
{
double energyHVaff=0;
int numCellsHVaff=0;
......@@ -29,7 +29,7 @@ int JetLArHVTool::modifyJet( xAOD::Jet& jet ) const
for(size_t i=0;i<num;i++) {
const xAOD::CaloCluster * cl = dynamic_cast<const xAOD::CaloCluster *>(jet.rawConstituent(i));
if( !cl) continue;
double m;
if(cl->retrieveMoment(xAOD::CaloCluster::ENG_BAD_HV_CELLS,m) ) energyHVaff += m;
if(cl->retrieveMoment(xAOD::CaloCluster::N_BAD_HV_CELLS, m) ) numCellsHVaff += m;
......@@ -39,8 +39,6 @@ int JetLArHVTool::modifyJet( xAOD::Jet& jet ) const
// set the attributes
jet.setAttribute<float>("LArBadHVEnergyFrac", energyHVaff / emE);
jet.setAttribute<int>("LArBadHVNCell", numCellsHVaff);
return 0;
}
......@@ -17,6 +17,7 @@ atlas_depends_on_subdirs(
PUBLIC
Control/AthLinks
Control/AthToolSupport/AsgTools
PhysicsAnalysis/D3PDTools/AnaAlgorithm
Event/xAOD/xAODCaloEvent
Event/xAOD/xAODJet
Event/xAOD/xAODMuon
......@@ -44,7 +45,7 @@ atlas_add_library( JetRecLib
PRIVATE_INCLUDE_DIRS ${FASTJETCONTRIB_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${FASTJET_LIBRARIES} AthLinks AsgTools
xAODCaloEvent xAODJet xAODMuon EventShapeInterface JetEDM
JetInterface JetCalibToolsLib
JetInterface JetCalibToolsLib AnaAlgorithmLib
PRIVATE_LINK_LIBRARIES ${FASTJETCONTRIB_LIBRARIES} xAODBase xAODCore
xAODEventInfo xAODTracking )
......
......@@ -2,34 +2,34 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// JetAlgorithm.h
// JetAlgorithm.h
#ifndef JetAlgorithm_H
#define JetAlgorithm_H
#include "AthenaBaseComps/AthAlgorithm.h"
#include "GaudiKernel/ToolHandle.h"
#include "AnaAlgorithm/AnaAlgorithm.h"
#include "AsgTools/ToolHandle.h"
class IJetExecuteTool;
class JetAlgorithm : public AthAlgorithm {
class JetAlgorithm : public EL::AnaAlgorithm {
public:
public:
/// Constructor with parameters:
/// Constructor with parameters:
JetAlgorithm(const std::string& name, ISvcLocator* pSvcLocator);
/// Destructor:
~JetAlgorithm();
/// Destructor:
~JetAlgorithm();
/// Athena algorithm's Hooks
StatusCode initialize();
StatusCode execute();
StatusCode finalize();
private:
private:
/// Default constructor:
/// Default constructor:
JetAlgorithm();
private:
......@@ -37,6 +37,6 @@ private:
/// Athena configured tools
ToolHandleArray<IJetExecuteTool> m_exetools;
};
};
#endif
......@@ -31,5 +31,6 @@
#include "JetRec/PseudoJetGetter.h"
#include "JetRec/PseudoJetGetterRegistry.h"
#include "JetRec/JetAlgorithm.h"
#endif
......@@ -27,4 +27,6 @@
<class name="PseudoJetGetter"/>
<class name="PseudoJetGetterRegistry"/>
<class name="JetAlgorithm"/>
</lcgdict>
......@@ -2,18 +2,18 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// JetAlgorithm.cxx
// JetAlgorithm.cxx
#include "JetAlgorithm.h"
#include "JetRec/JetAlgorithm.h"
#include "JetInterface/IJetExecuteTool.h"
using std::string;
//**********************************************************************
JetAlgorithm::JetAlgorithm(const std::string& name,
JetAlgorithm::JetAlgorithm(const std::string& name,
ISvcLocator* pSvcLocator )
: ::AthAlgorithm( name, pSvcLocator ) {
: EL::AnaAlgorithm( name, pSvcLocator ) {
declareProperty( "Tools", m_exetools);
}
......@@ -50,7 +50,7 @@ StatusCode JetAlgorithm::finalize() {
//**********************************************************************
StatusCode JetAlgorithm::execute() {
StatusCode JetAlgorithm::execute() {
ATH_MSG_VERBOSE("Executing " << name() << "...");
// Loop over tools.
unsigned int ntools = m_exetools.size();
......
// JetRec_entries.cxx
#include "../JetAlgorithm.h"
#include "JetRec/JetAlgorithm.h"
#include "JetRec/JetToolRunner.h"
#include "JetRec/JetRecTool.h"
#include "JetRec/JetDumper.h"
......
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