Skip to content
Snippets Groups Projects
Commit 0af5e50d authored by Jonathan Bossio's avatar Jonathan Bossio
Browse files

Monitor HLT jet multiplicity and basic kinematics

parent cc7669ec
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@ atlas_depends_on_subdirs(
PUBLIC
Control/AthLinks
Control/AthContainers
Control/AthenaMonitoringKernel
Control/AthToolSupport/AsgTools
Event/xAOD/xAODCaloEvent
Event/xAOD/xAODJet
......@@ -49,12 +50,12 @@ atlas_add_library( JetRecLib
xAODCaloEvent xAODJet xAODMuon EventShapeInterface JetEDM
JetInterface
PRIVATE_LINK_LIBRARIES ${FASTJETCONTRIB_LIBRARIES} CxxUtils xAODBase xAODCore
xAODEventInfo xAODTracking )
xAODEventInfo xAODTracking AthenaMonitoringKernelLib)
if( NOT XAOD_STANDALONE )
atlas_add_component( JetRec
src/*.h src/*.cxx src/components/*.cxx
LINK_LIBRARIES GaudiKernel AthenaBaseComps JetInterface JetRecLib )
LINK_LIBRARIES GaudiKernel AthenaBaseComps JetInterface JetRecLib AthenaMonitoringKernelLib )
endif()
atlas_add_dictionary( JetRecDict
......
......@@ -61,6 +61,7 @@
#include "StoreGate/ReadHandleKeyArray.h"
#include "JetEDM/PseudoJetVector.h"
#include "JetRec/PseudoJetContainer.h"
#include "AthenaMonitoringKernel/GenericMonitoringTool.h"
class JetRecTool
: public asg::AsgTool,
......@@ -157,6 +158,10 @@ private:
mutable std::vector<TStopwatch> m_modclocks;
mutable std::vector<TStopwatch> m_conclocks;
ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"};
const double m_mevtogev = 0.001;
};
#endif
......@@ -22,6 +22,8 @@
#include "StoreGate/ReadHandle.h"
#include "AthenaMonitoringKernel/Monitored.h"
typedef ToolHandleArray<IJetModifier> ModifierArray;
typedef ToolHandleArray<IJetConsumer> ConsumerArray;
......@@ -221,6 +223,8 @@ StatusCode JetRecTool::initialize() {
m_conclock.Reset();
m_nevt = 0;
if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
ATH_MSG_INFO("Timing detail: " << m_timer);
return rstat;
}
......@@ -403,6 +407,15 @@ const JetContainer* JetRecTool::build() const {
m_conclock.Stop();
}
// monitor jet multiplicity and basic jet kinematics
auto njets = Monitored::Scalar<int>("nJets");
auto pt = Monitored::Collection("pt", *jetsHandle, [c=m_mevtogev]( const xAOD::Jet* jet ) { return jet->pt()*c; });
auto et = Monitored::Collection("et", *jetsHandle, [c=m_mevtogev]( const xAOD::Jet* jet ) { return jet->p4().Et()*c; });
auto eta = Monitored::Collection("eta", *jetsHandle, []( const xAOD::Jet* jet ) { return jet->eta(); });
auto phi = Monitored::Collection("phi", *jetsHandle, []( const xAOD::Jet* jet ) { return jet->phi(); });
auto mon = Monitored::Group(m_monTool,njets,pt,et,eta,phi);
njets = jetsHandle->size();
m_totclock.Stop();
return jetsHandle.isValid() ? &(*jetsHandle) : 0;
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# define histograms for monitoring of HLT jets
def getMonTool_TrigJetAlgorithm(path):
from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
monTool = GenericMonitoringTool('MonTool')
monTool.HistPath = path
monTool.defineHistogram( 'nJets', path='EXPERT', type='TH1F', title='Counts', xbins=100, xmin=0, xmax=100 )
monTool.defineHistogram( 'pt', path='EXPERT', type='TH1F', title='Counts', xbins=100, xmin=0, xmax=500 )
monTool.defineHistogram( 'et', path='EXPERT', type='TH1F', title='Counts', xbins=100, xmin=0, xmax=500 )
monTool.defineHistogram( 'eta', path='EXPERT', type='TH1F', title='Counts', xbins=50, xmin=-5, xmax=5 )
monTool.defineHistogram( 'phi', path='EXPERT', type='TH1F', title='Counts', xbins=50, xmin=-3, xmax=3 )
return monTool
......@@ -416,7 +416,7 @@ def getGhostPJGAlg(ghostdef):
# Function for configuring the jet algorithm and builders, given the
# set of dependencies
#
def getJetAlgorithm(jetname, jetdef, pjs, modlist):
def getJetAlgorithm(jetname, jetdef, pjs, modlist, monTool = None):
jetlog.debug("Configuring JetAlgorithm \"jetalg_{0}\"".format(jetname))
builder = getJetBuilder()
......@@ -431,6 +431,7 @@ def getJetAlgorithm(jetname, jetdef, pjs, modlist):
mods.append(mod)
rectool = getJetRecTool(jetname,finder,pjs,mods)
if monTool: rectool.MonTool = monTool
jetalg = CompFactory.JetAlgorithm("jetalg_"+jetname)
jetalg.Tools = [rectool]
......
......@@ -181,9 +181,13 @@ def jetRecoSequence( dummyFlags, dataSource, RoIs = 'FSJETRoI', **jetRecoDict):
calibMods = JetRecoConfiguration.defineCalibFilterMods(jetRecoDict,dataSource, rhoKey)
jetModList += calibMods
# Get online monitoring tool
from JetRec import JetOnlineMon
monTool = JetOnlineMon.getMonTool_TrigJetAlgorithm("HLTJets/"+jetsFullName+"/")
# Generate a JetAlgorithm to run the jet finding and modifiers
# (via a JetRecTool instance).
jetRecAlg = JetRecConfig.getJetAlgorithm(jetsFullName, jetDef, pjs, jetModList)
jetRecAlg = JetRecConfig.getJetAlgorithm(jetsFullName, jetDef, pjs, jetModList, monTool)
recoSeq += conf2toConfigurable( jetRecAlg )
# End of basic jet reco
pass
......
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