Skip to content
Snippets Groups Projects
Commit cc2472f7 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'newMonitoring' into 'master'

Improving MinBias Monitoring Algorithm

See merge request atlas/athena!33307
parents e6f40098 fa06a2b8
No related branches found
No related tags found
No related merge requests found
...@@ -7,28 +7,24 @@ ...@@ -7,28 +7,24 @@
''' '''
def TrigMinBias(configFlags): def TrigMinBias(configFlags):
from AthenaMonitoring import AthMonitorCfgHelper from AthenaMonitoring import AthMonitorCfgHelper
monConfig = AthMonitorCfgHelper(configFlags,'HLTMinBiasMonAlgMTAcc') monConfig = AthMonitorCfgHelper(configFlags,'HLTMinBiasMonAlgMTAcc')
from AthenaConfiguration.ComponentFactory import CompFactory from AthenaConfiguration.ComponentFactory import CompFactory
alg = monConfig.addAlgorithm(CompFactory.HLTMinBiasMonAlgMT,'HLTMinBiasMonAlgMT') alg = monConfig.addAlgorithm(CompFactory.HLTMinBiasMonAlgMT,'HLTMinBiasMonAlgMT')
mbEffAllGroup = monConfig.addGroup( mbEffAllGroup = monConfig.addGroup(
alg, alg,
'EffAll', 'EffAll',
'HLT/MinBiasMon/' 'HLT/MinBiasMon/'
) )
alg.triggerList = [ "HLT_mb_sptrk_L1RD0_FILLED"]
length = len(alg.triggerList) length = len(alg.triggerList)
mbEffAllGroup.defineHistogram( "PurityAll,whichTrigger",type = 'TEfficiency',title="PurityAll;whichTrigger" ,xbins=length, xmin=0, xmax=length)
mbEffAllGroup.defineHistogram( "PurityPassed,whichTrigger",type = 'TEfficiency',title="PurityPassed;whichTrigger",xbins=length, xmin=0, xmax=length, xlabels = list(alg.triggerList)) mbEffAllGroup.defineHistogram( "PurityPassed,whichTrigger",type = 'TEfficiency',title="PurityPassed;whichTrigger",xbins=length, xmin=0, xmax=length, xlabels = list(alg.triggerList))
mbEffAllGroup.defineHistogram( "EfficiencyAll,whichTrigger",type = 'TEfficiency', title="EfficiencyAll;whichTrigger",xbins=length, xmin=0, xmax=length) mbEffAllGroup.defineHistogram( "whichTrigger",title="count of triggers;HLT", xbins=length, xmin=0, xmax=length, xlabels = list(alg.triggerList))
mbEffAllGroup.defineHistogram( "EfficiencyPassed,whichTrigger",type = 'TEfficiency', title="EfficiencyPassed;whichTrigger", xbins=length, xmin=0, xmax=length) mbEffAllGroup.defineHistogram( "whichTrigger;No. of events", type='TH1I',title='Event per Trigger;HLT',xbins=length, xmin=0, xmax=length, xlabels = list(alg.triggerList))
mbEffAllGroup.defineHistogram( "EfficiencyPassed,trigNo",type = 'TEfficiency', title="EfficiencyPassed;trig No.", xbins=length, xmin=0, xmax=length, xlabels = list(alg.triggerList)) mbEffAllGroup.defineHistogram( "decision,whichTrigger", type='TEfficiency',title='Efficiency of selecting Events with One Good Trk;TriggerName',xbins=length, xmin=0, xmax=length, xlabels = list(alg.triggerList))
mbEffAllGroup.defineHistogram( "whichTrigger",title="count of triggers", xbins=length, xmin=0, xmax=length)
mbEffAllGroup.defineHistogram( "EfficiencyPassed,trigCount",type = 'TProfile',title="EfficiencyPassed;Trigger;EfficiencyPassed", xbins=length, xmin=0, xmax=length)
for chain in alg.triggerList: for chain in alg.triggerList:
mbGroup = monConfig.addGroup( mbGroup = monConfig.addGroup(
alg, alg,
...@@ -38,8 +34,7 @@ def TrigMinBias(configFlags): ...@@ -38,8 +34,7 @@ def TrigMinBias(configFlags):
alg, alg,
chain+'_Eff', chain+'_Eff',
'HLT/MinBiasMon/Purities&Efficiencies/'+chain+'/') 'HLT/MinBiasMon/Purities&Efficiencies/'+chain+'/')
# correct the titles of following histograms # correct the titles of following histograms
mbGroup.defineHistogram( "PixelSPLow", title="Number of SP in whole Pixels detector for all events in low range", xbins=100, xmin=0, xmax=100) mbGroup.defineHistogram( "PixelSPLow", title="Number of SP in whole Pixels detector for all events in low range", xbins=100, xmin=0, xmax=100)
mbGroup.defineHistogram( "PixelSPHigh", title="Number of SP in whole Pixels detector for all events in high range", xbins=100, xmin=0, xmax=30000) mbGroup.defineHistogram( "PixelSPHigh", title="Number of SP in whole Pixels detector for all events in high range", xbins=100, xmin=0, xmax=30000)
...@@ -56,10 +51,13 @@ def TrigMinBias(configFlags): ...@@ -56,10 +51,13 @@ def TrigMinBias(configFlags):
mbGroup.defineHistogram( "SctECA_SP,SctECC_SP",type = 'TH2F', title="SctECA_SP;SctECC_SP", xbins=100, xmin=0, xmax=30000, ybins=100, ymin=0, ymax=30000) mbGroup.defineHistogram( "SctECA_SP,SctECC_SP",type = 'TH2F', title="SctECA_SP;SctECC_SP", xbins=100, xmin=0, xmax=30000, ybins=100, ymin=0, ymax=30000)
mbGroup.defineHistogram( "PixECA_SP,PixECC_SP",type = 'TH2F', title="PixECA_SP;PixECC_SP", xbins=100, xmin=0, xmax=30000, ybins=100, ymin=0, ymax=30000) mbGroup.defineHistogram( "PixECA_SP,PixECC_SP",type = 'TH2F', title="PixECA_SP;PixECC_SP", xbins=100, xmin=0, xmax=30000, ybins=100, ymin=0, ymax=30000)
mbGroup.defineHistogram( "SctBarr_SP,PixBarr_SP",type = 'TH2F', title="SctBarr_SP;PixBarr_SP", xbins=100, xmin=0, xmax=120000, ybins=100, ymin=0, ymax=30000) mbGroup.defineHistogram( "SctBarr_SP,PixBarr_SP",type = 'TH2F', title="SctBarr_SP;PixBarr_SP", xbins=100, xmin=0, xmax=120000, ybins=100, ymin=0, ymax=30000)
mbEffGroup.defineHistogram( "decision,nTrk",type = 'TEfficiency', title="EfficiencyTracks;nTrk", xbins=100, xmin=0, xmax=30000)
mbEffGroup.defineHistogram( "NumGoodOnlineTracks", title="NumGoodOnlineTracks", xbins=100, xmin=0, xmax=2000) mbEffGroup.defineHistogram( "NumGoodOnlineTracks", title="NumGoodOnlineTracks", xbins=100, xmin=0, xmax=2000)
mbEffGroup.defineHistogram( "NumGoodOfflineTracks", title="NumGoodOfflineTracks", xbins=100, xmin=0, xmax=2000) mbEffGroup.defineHistogram( "NumGoodOfflineTracks", title="NumGoodOfflineTracks", xbins=100, xmin=0, xmax=2000)
mbEffGroup.defineHistogram( "NumGoodOnlineTracks,NumGoodOfflineTracks",type = 'TH2F', title="NumGoodOnlineTracks;NumGoodOfflineTracks", xbins=100, xmin=0, xmax=2000, ybins=100, ymin=0, ymax=2000) mbEffGroup.defineHistogram( "NumGoodOnlineTracks,NumGoodOfflineTracks",type = 'TH2F', title="NumGoodOnlineTracks;NumGoodOfflineTracks", xbins=100, xmin=0, xmax=2000, ybins=100, ymin=0, ymax=2000)
mbEffGroup.defineHistogram( "decision,NumGoodOfflineTracks", type='TEfficiency',title='Efficiency;Offline Good nTrk',xbins=1000,xmin=0,xmax=1000)
mbEffGroup.defineHistogram( "decision,nTrk",type = 'TEfficiency', title="Efficiency;nTrk", xbins=1000,xmin=0,xmax=1000)
return monConfig.result() return monConfig.result()
if __name__=='__main__': if __name__=='__main__':
# Setup the Run III behavior # Setup the Run III behavior
...@@ -70,25 +68,29 @@ if __name__=='__main__': ...@@ -70,25 +68,29 @@ if __name__=='__main__':
from AthenaCommon.Constants import DEBUG from AthenaCommon.Constants import DEBUG
# Set the Athena configuration flags # Set the Athena configuration flags
from AthenaConfiguration.AllConfigFlags import ConfigFlags from AthenaConfiguration.AllConfigFlags import ConfigFlags
# ConfigFlags.Input.Files = ['/afs/cern.ch/user/s/somadutt/public/testUPC2.AOD.pool.root'] #our file runs fine # ConfigFlags.Input.Files = ['/afs/cern.ch/user/s/somadutt/public/testUPC2.AOD.pool.root'] #Local HI-UPC file
ConfigFlags.Input.Files = ['/afs/cern.ch/user/s/somadutt/public/AOD.pool.root'] #from https://atlas-art-data.web.cern.ch/atlas-art-data/grid-output/master/Athena/x86_64-centos7-gcc8-opt/2020-02-10T2132//TrigAnalysisTest/test_trigAna_RDOtoT0Mon_mt1_grid/
ConfigFlags.Input.isMC = True # data AOD file
ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/data-art/build-output/master/Athena/x86_64-centos7-gcc8-opt/2020-06-01T2139/TrigP1Test/test_trigP1_v1PhysP1_T0Mon_build/AOD.pool.root']
# ConfigFlags.Input.Files = ['/eos/atlas/atlascerngroupdisk/data-art/build-output/master/Athena/x86_64-centos7-gcc8-opt/2020-05-22T2142/TrigAnalysisTest/test_trigAna_RDOtoT0Mon_mt1_build/AOD.pool.root']
# ConfigFlags.Input.isMC = True #un-Comment this line for MC AOD files, comment for data-AOD files
ConfigFlags.Output.HISTFileName = 'TestMonitorOutput.root' ConfigFlags.Output.HISTFileName = 'TestMonitorOutput.root'
ConfigFlags.lock() ConfigFlags.lock()
# Initialize configuration object, add accumulator, merge, and run. # Initialize configuration object, add accumulator, merge, and run.
from AthenaConfiguration.MainServicesConfig import MainServicesCfg from AthenaConfiguration.MainServicesConfig import MainServicesCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
cfg = MainServicesCfg(ConfigFlags) cfg = MainServicesCfg(ConfigFlags)
cfg.merge(PoolReadCfg(ConfigFlags)) cfg.merge(PoolReadCfg(ConfigFlags))
cfg.merge(TrigMinBias(ConfigFlags)) cfg.merge(TrigMinBias(ConfigFlags))
# If you want to turn on more detailed messages ... # If you want to turn on more detailed messages ...
# cfg.getEventAlgo('HLTMinBiasMonAlgMT').OutputLevel = 2 # DEBUG #either this line or the next works!! # cfg.getEventAlgo('HLTMinBiasMonAlgMT').OutputLevel = 2 # DEBUG #either this line or the next works!!
cfg.getEventAlgo('HLTMinBiasMonAlgMT').OutputLevel = DEBUG # DEBUG cfg.getEventAlgo('HLTMinBiasMonAlgMT').OutputLevel = DEBUG # DEBUG
cfg.printConfig(withDetails=True) # set True for exhaustive info cfg.printConfig(withDetails=True) # set True for exhaustive info
cfg.run() #use cfg.run(20) to only run on first 20 events cfg.run() #use cfg.run(20) to only run on first 20 events
# to run: # to run:
# python -m TrigMinBiasMonitoring.TrigMinBiasMonitoringMT # python -m TrigMinBiasMonitoring.TrigMinBiasMonitoringMT
...@@ -5,8 +5,7 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ...@@ -5,8 +5,7 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
#include "HLTMinBiasMonAlgMT.h" #include "HLTMinBiasMonAlgMT.h"
HLTMinBiasMonAlgMT::HLTMinBiasMonAlgMT(const std::string& name, ISvcLocator* pSvcLocator) : HLTMinBiasMonAlgMT::HLTMinBiasMonAlgMT(const std::string& name, ISvcLocator* pSvcLocator) :
AthMonitorAlgorithm(name, pSvcLocator), AthMonitorAlgorithm(name, pSvcLocator)
m_trigDecTool("Trig::TrigDecisionTool/TrigDecisionTool")
{ {
} }
...@@ -21,6 +20,7 @@ StatusCode HLTMinBiasMonAlgMT::initialize() ...@@ -21,6 +20,7 @@ StatusCode HLTMinBiasMonAlgMT::initialize()
ATH_CHECK( m_trkCountsKey.initialize() ); ATH_CHECK( m_trkCountsKey.initialize() );
ATH_CHECK( m_HLTxaodTrkKey.initialize() ); ATH_CHECK( m_HLTxaodTrkKey.initialize() );
ATH_CHECK( m_inDetTrackParticlesKey.initialize()); ATH_CHECK( m_inDetTrackParticlesKey.initialize());
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -37,7 +37,6 @@ StatusCode HLTMinBiasMonAlgMT::fillHistograms(const EventContext& context) const ...@@ -37,7 +37,6 @@ StatusCode HLTMinBiasMonAlgMT::fillHistograms(const EventContext& context) const
ATH_CHECK( monitorPurities( context ) ); ATH_CHECK( monitorPurities( context ) );
ATH_CHECK( monitorSPCounts( context ) ); ATH_CHECK( monitorSPCounts( context ) );
ATH_CHECK( monitorTrkCounts( context ) ); ATH_CHECK( monitorTrkCounts( context ) );
ATH_CHECK( m_trigDecTool.retrieve() );
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -49,91 +48,117 @@ StatusCode HLTMinBiasMonAlgMT::monitorPurities(const EventContext& /*context*/) ...@@ -49,91 +48,117 @@ StatusCode HLTMinBiasMonAlgMT::monitorPurities(const EventContext& /*context*/)
StatusCode HLTMinBiasMonAlgMT::monitorSPCounts(const EventContext& context) const { StatusCode HLTMinBiasMonAlgMT::monitorSPCounts(const EventContext& context) const {
auto spCountsHandle = SG::makeHandle( m_spCountsKey, context); auto spCountsHandle = SG::makeHandle( m_spCountsKey, context);
ATH_MSG_DEBUG("Inside SP Loop");
ATH_MSG_DEBUG(spCountsHandle->size());
ATH_MSG_DEBUG(spCountsHandle.isValid());
if (!spCountsHandle.isValid()) { if (!spCountsHandle.isValid()) {
ATH_MSG_DEBUG("Could not retrieve spCountsHandle"); ATH_MSG_DEBUG("Could not retrieve spCountsHandle");
return StatusCode::SUCCESS; } return StatusCode::SUCCESS; }
ATH_CHECK( spCountsHandle.isValid() ); ATH_CHECK( spCountsHandle.isValid() );
if ( spCountsHandle->size() == 0 ) { // trigger did not run, no monitoring if ( spCountsHandle->size() == 0 ) { // trigger did not run, no monitoring
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
ATH_CHECK( spCountsHandle->size() == 1 ); // if object is present then it should have size == 1 ATH_CHECK( spCountsHandle->size() == 1 ); // if object is present then it should have size == 1
using namespace Monitored;
for (long unsigned int i =0; i<m_triggerList.size(); i++){
if (m_trigDecTool->getPrescale(m_triggerList[i])) { using namespace Monitored;
auto pixelSPLow = Scalar( "PixelSPLow", spCountsHandle->at(0)->getDetail<int>("totNumPixSP") ); const auto& trigDecTool = getTrigDecisionTool();
auto pixelSPHigh = Scalar( "PixelSPHigh", spCountsHandle->at(0)->getDetail<int>("totNumPixSP") ); auto chaingroup = trigDecTool->getChainGroup("HLT_mb.*");//checking if this works ;
auto PixBarr_SP = Scalar( "PixBarr_SP", spCountsHandle->at(0)->getDetail<int>("pixClBarrel") );
auto PixECA_SP = Scalar( "PixECA_SP", spCountsHandle->at(0)->getDetail<int>("pixClEndcapA") );
auto PixECC_SP = Scalar( "PixECC_SP", spCountsHandle->at(0)->getDetail<int>("pixClEndcapC") );
auto SctTot = Scalar( "SctTot", spCountsHandle->at(0)->getDetail<int>("totNumSctSP") ); for(auto &trig : chaingroup->getListOfTriggers()) {
auto SctBarr_SP = Scalar( "SctBarr_SP", spCountsHandle->at(0)->getDetail<int>("SctSpBarrel") ); auto cg = trigDecTool->getChainGroup(trig);
auto SctECA_SP = Scalar( "SctECA_SP", spCountsHandle->at(0)->getDetail<int>("SctSpEndcapA") ); std::string thisTrig = trig;
auto SctECC_SP = Scalar( "SctECC_SP", spCountsHandle->at(0)->getDetail<int>("SctSpEndcapC") );
fill(m_triggerList[i], pixelSPLow, pixelSPHigh, PixBarr_SP,PixECA_SP, PixECC_SP, SctTot, SctBarr_SP, SctECA_SP, SctECC_SP); ATH_MSG_DEBUG (thisTrig << " chain prescale = " << cg->getPrescale());
}
}
return StatusCode::SUCCESS; if(trigDecTool->isPassed(trig)) {ATH_MSG_DEBUG("Chain "<<trig <<" is passed: YES");}
} else ATH_MSG_DEBUG("Chain "<<trig <<" is passed: NO");
StatusCode HLTMinBiasMonAlgMT::monitorTrkCounts(const EventContext& context) const { if (cg->getPrescale()) {
auto HLTxaodTrkHandle = SG::makeHandle( m_HLTxaodTrkKey, context); auto pixelSPLow = Scalar( "PixelSPLow", spCountsHandle->at(0)->getDetail<int>("totNumPixSP") );
auto inDetTrackParticlesHandle = SG::makeHandle( m_inDetTrackParticlesKey, context); auto pixelSPHigh = Scalar( "PixelSPHigh", spCountsHandle->at(0)->getDetail<int>("totNumPixSP") );
auto trkCountsHandle = SG::makeHandle( m_trkCountsKey, context); auto PixBarr_SP = Scalar( "PixBarr_SP", spCountsHandle->at(0)->getDetail<int>("pixClBarrel") );
auto PixECA_SP = Scalar( "PixECA_SP", spCountsHandle->at(0)->getDetail<int>("pixClEndcapA") );
auto PixECC_SP = Scalar( "PixECC_SP", spCountsHandle->at(0)->getDetail<int>("pixClEndcapC") );
using namespace Monitored; auto SctTot = Scalar( "SctTot", spCountsHandle->at(0)->getDetail<int>("totNumSctSP") );
auto SctBarr_SP = Scalar( "SctBarr_SP", spCountsHandle->at(0)->getDetail<int>("SctSpBarrel") );
auto SctECA_SP = Scalar( "SctECA_SP", spCountsHandle->at(0)->getDetail<int>("SctSpEndcapA") );
auto SctECC_SP = Scalar( "SctECC_SP", spCountsHandle->at(0)->getDetail<int>("SctSpEndcapC") );
if (!trkCountsHandle.isValid()) { fill(thisTrig, pixelSPLow, pixelSPHigh, PixBarr_SP,PixECA_SP, PixECC_SP, SctTot, SctBarr_SP, SctECA_SP, SctECC_SP);
ATH_MSG_DEBUG("Could not retrieve trkCountsHandle"); }
return StatusCode::SUCCESS; } }
ATH_CHECK( trkCountsHandle.isValid() );
if ( trkCountsHandle->size() == 0 ) { // trigger did not run, no monitoring
return StatusCode::SUCCESS;
}
ATH_CHECK( HLTxaodTrkHandle.isValid() );
if ( HLTxaodTrkHandle->size() == 0 ) { // trigger did not run, no monitoring
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
ATH_CHECK( inDetTrackParticlesHandle.isValid() );
if ( inDetTrackParticlesHandle->size() == 0 ) { // trigger did not run, no monitoring
return StatusCode::SUCCESS;
}
ATH_CHECK( trkCountsHandle->size() == 1 ); // if object is present then it should have size == 1
using namespace Monitored;
for (long unsigned int i =0; i<m_triggerList.size(); i++){
const unsigned int passBits = m_trigDecTool->isPassedBits(m_triggerList[i]);
ATH_MSG_DEBUG(passBits);
ATH_MSG_DEBUG(TrigDefs::EF_prescaled);
ATH_MSG_DEBUG(m_trigDecTool->isPassed("L1_RD0_FILLED"));
ATH_MSG_DEBUG(m_trigDecTool->isPassed(m_triggerList[i]));
if ((!(passBits & TrigDefs::EF_prescaled)) && (passBits & TrigDefs::L1_isPassedAfterVeto)) {
auto xaodntrk = Scalar( "xaodnTrk", HLTxaodTrkHandle->size() );
auto decision = Scalar<int>("decision", m_trigDecTool->isPassed(m_triggerList[i]) ? 1 : 0);
auto NumGoodOfflineTracks = Scalar("NumGoodOfflineTracks", inDetTrackParticlesHandle->size());
auto ntrk = Scalar( "nTrk", trkCountsHandle->at(0)->getDetail<int>("ntrks") );
auto NumGoodOnlineTracks = Scalar("NumGoodOnlineTracks", trkCountsHandle->at(0)->getDetail<int>("ntrks"));
auto whichTrigger = Scalar("whichTrigger",m_triggerList[i]);
fill(m_triggerList[i]+"_Eff", ntrk,NumGoodOnlineTracks,xaodntrk,decision,NumGoodOfflineTracks,whichTrigger);
fill("EffAll",decision,whichTrigger);
}
if ( m_trigDecTool->isPassed(m_triggerList[i]) ) { StatusCode HLTMinBiasMonAlgMT::monitorTrkCounts(const EventContext& context) const {
auto whichTrigger = Scalar("whichTrigger",m_triggerList[i]); auto HLTxaodTrkHandle = SG::makeHandle( m_HLTxaodTrkKey, context);
auto PurityPassed = Scalar<int>("PurityPassed", m_trigDecTool->isPassed(m_triggerList[i]) ? 1 : 0); auto inDetTrackParticlesHandle = SG::makeHandle( m_inDetTrackParticlesKey, context);
fill("EffAll",PurityPassed,whichTrigger); auto trkCountsHandle = SG::makeHandle( m_trkCountsKey, context);
ATH_MSG_DEBUG("Inside Trk Loop");
ATH_MSG_DEBUG(trkCountsHandle->size());
ATH_MSG_DEBUG(trkCountsHandle.isValid());
if (!trkCountsHandle.isValid()) {
ATH_MSG_DEBUG("Could not retrieve trkCountsHandle");
return StatusCode::SUCCESS; }
ATH_CHECK( trkCountsHandle.isValid() );
if ( trkCountsHandle->size() == 0 ) { // trigger did not run, no monitoring
return StatusCode::SUCCESS;
}
ATH_CHECK( HLTxaodTrkHandle.isValid() );
if ( HLTxaodTrkHandle->size() == 0 ) { // trigger did not run, no monitoring
return StatusCode::SUCCESS;
}
ATH_CHECK( inDetTrackParticlesHandle.isValid() );
if ( inDetTrackParticlesHandle->size() == 0 ) { // trigger did not run, no monitoring
return StatusCode::SUCCESS;
}
ATH_CHECK( trkCountsHandle->size() == 1 ); // if object is present then it should have size == 1
using namespace Monitored;
const auto& trigDecTool = getTrigDecisionTool();
auto chaingroup = trigDecTool->getChainGroup("HLT_mb_sptrk_L1.*");//checking if this works ;
long unsigned int counter = 0;
for(auto &trig : chaingroup->getListOfTriggers()) {
std::string thisTrig = trig;
if(thisTrig!=m_triggerList[counter]) {
ATH_MSG_DEBUG("Trigger Names or Ordering Don't match");
ATH_MSG_DEBUG ("trig in Alg = "<<thisTrig << " trig in List = " << m_triggerList[counter]);
return StatusCode::SUCCESS;
}
if(trigDecTool->isPassed(trig)) {
ATH_MSG_DEBUG("Chain "<<trig <<" is passed: YES");
}
else ATH_MSG_DEBUG("Chain "<<trig <<" is passed: NO");
const unsigned int passBits = trigDecTool->isPassedBits(trig);
ATH_MSG_DEBUG(passBits);
ATH_MSG_DEBUG(TrigDefs::EF_prescaled);
ATH_MSG_DEBUG(trigDecTool->isPassed("L1_RD0_FILLED"));
ATH_MSG_DEBUG(trigDecTool->isPassed(trig));
if ((!(passBits & TrigDefs::EF_prescaled)) && (passBits & TrigDefs::L1_isPassedAfterVeto)) {
auto xaodntrk = Scalar( "xaodnTrk", HLTxaodTrkHandle->size() );
auto decision = Scalar<int>("decision", trigDecTool->isPassed(trig) ? 1 : 0);
auto NumGoodOfflineTracks = Scalar("NumGoodOfflineTracks", inDetTrackParticlesHandle->size());
auto ntrk = Scalar( "nTrk", trkCountsHandle->at(0)->getDetail<int>("ntrks") );
auto NumGoodOnlineTracks = Scalar("NumGoodOnlineTracks", trkCountsHandle->at(0)->getDetail<int>("ntrks"));
auto whichtrigger = Scalar("whichTrigger",trig);
fill(thisTrig+"_Eff",ntrk,NumGoodOnlineTracks,xaodntrk,decision,NumGoodOfflineTracks,whichtrigger);
fill("EffAll",decision,whichtrigger);
}
if ( trigDecTool->isPassed(trig) ) {
auto whichtrigger = Scalar("whichTrigger",trig);
auto PurityPassed = Scalar<int>("PurityPassed", trigDecTool->isPassed(trig) ? 1 : 0);
fill("EffAll",PurityPassed,whichtrigger);
}
if(counter<m_triggerList.size())counter++;
}
return StatusCode::SUCCESS;
} }
}
return StatusCode::SUCCESS;
}
/* /*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef TRIGMINBIASMONITORING_HLTMINBIASMONALGMT_H #ifndef TRIGMINBIASMONITORING_HLTMINBIASMONALGMT_H
#define TRIGMINBIASMONITORING_HLTMINBIASMONALGMT_H #define TRIGMINBIASMONITORING_HLTMINBIASMONALGMT_H
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
#include <string> #include <string>
/** /**
* @class HLTMinBiasMonAlgMT * @class HLTMinBiasMonAlgMT
* @brief * @brief
**/ **/
class HLTMinBiasMonAlgMT : public AthMonitorAlgorithm { class HLTMinBiasMonAlgMT : public AthMonitorAlgorithm {
public: public:
HLTMinBiasMonAlgMT(const std::string& name, ISvcLocator* pSvcLocator); HLTMinBiasMonAlgMT(const std::string& name, ISvcLocator* pSvcLocator);
...@@ -32,11 +32,10 @@ public: ...@@ -32,11 +32,10 @@ public:
private: private:
SG::ReadHandleKey<xAOD::TrigCompositeContainer> m_spCountsKey { this, "SPCountsKey", "HLT_SpacePointCounts", "Name of Space Points info object produced by the HLT SP counting FEX algorithm" }; SG::ReadHandleKey<xAOD::TrigCompositeContainer> m_spCountsKey { this, "SPCountsKey", "HLT_SpacePointCounts", "Name of Space Points info object produced by the HLT SP counting FEX algorithm" };
SG::ReadHandleKey<xAOD::TrigCompositeContainer> m_trkCountsKey { this, "TrackCountsKey", "HLT_TrackCounts", "Name of Online track counts info object produced by the HLT track counting FEX algorithm" }; SG::ReadHandleKey<xAOD::TrigCompositeContainer> m_trkCountsKey { this, "TrackCountsKey", "HLT_TrackCount", "Name of Online track counts info object produced by the HLT track counting FEX algorithm" };
SG::ReadHandleKey<xAOD::TrackParticleContainer> m_HLTxaodTrkKey { this, "HLTxaodTrkKey", "HLT_IDTrack_FS_FTF", "Name of track counts info object produced by the HLT track counting FEX algorithm" }; SG::ReadHandleKey<xAOD::TrackParticleContainer> m_HLTxaodTrkKey { this, "HLTxaodTrkKey", "HLT_IDTrack_FS_FTF", "Name of track counts info object produced by the HLT track counting FEX algorithm" };
SG::ReadHandleKey<xAOD::TrackParticleContainer> m_inDetTrackParticlesKey { this, "inDetTrackParticlesKey", "InDetTrackParticles", "Name of Offline track counts info object produced by the HLT track counting FEX algorithm" }; SG::ReadHandleKey<xAOD::TrackParticleContainer> m_inDetTrackParticlesKey { this, "inDetTrackParticlesKey", "InDetTrackParticles", "Name of Offline track counts info object produced by the HLT track counting FEX algorithm" };
ToolHandle<Trig::TrigDecisionTool> m_trigDecTool;
Gaudi::Property<std::vector<std::string>> m_triggerList{this, "triggerList",{"HLT_mb_sptrk_L1RD0_FILLED"}, "Add triggers to this to be monitored"}; Gaudi::Property<std::vector<std::string>> m_triggerList{this, "triggerList",{"HLT_mb_sptrk_L1RD0_FILLED"}, "Add triggers to this to be monitored"};
StatusCode monitorPurities(const EventContext& context) const; StatusCode monitorPurities(const EventContext& context) const;
StatusCode monitorSPCounts(const EventContext& context) const; StatusCode monitorSPCounts(const EventContext& context) const;
......
#!/bin/bash
# art-description: athenaMT trigger test for min bias reconstruction algorithms.
# art-type: build
# art-include: master/Athena
# Skipping art-output which has no effect for build tests.
# If you create a grid version, check art-output in existing grid tests.
export EVENTS=20
export THREADS=1
export SLOTS=1
export JOBOPTION="TrigUpgradeTest/MinBias.py"
# Skip dumping chain counts because this test doesn't produce the histogram including them
export SKIP_CHAIN_DUMP=1
source exec_TrigUpgradeTest_art_athenaMT.sh
source exec_TrigUpgradeTest_art_post.sh
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