diff --git a/DataQuality/DataQualityConfigurations/config/HLT/HLTminbias/collisions_run.config b/DataQuality/DataQualityConfigurations/config/HLT/HLTminbias/collisions_run.config index 7b347a2a42d1e4ae4076dac766241be8f316ff4f..08b5c811f36d3f246db7bcefe579f76f784e8097 100644 --- a/DataQuality/DataQualityConfigurations/config/HLT/HLTminbias/collisions_run.config +++ b/DataQuality/DataQualityConfigurations/config/HLT/HLTminbias/collisions_run.config @@ -90,27 +90,38 @@ dir HLT { } dir Tracking { dir HLT_mb_sptrk_L1RD0_FILLED { - hist efficiency_low_mult { + hist efficiencyLowMult { output = HLT/Run3/TRMBI/SHIFTER - description = "Normal: Quick rise to almost 100% for 1,2 tracks, no eff. drop for higher multiplicities" + description = Normal: Quick rise to almost 100% for 1,2 tracks, no eff. drop for higher multiplicities } + hist nTrkOfflineLowMult { + output = HLT/Run3/TRMBI/SHIFTER + description = Normal: Quick rise to almost 100% for 1,2 tracks, no eff. drop for higher multiplicities + } + hist nTrkOnlineLowMult { + output = HLT/Run3/TRMBI/SHIFTER + description = Normal: Sharp rise at ntrk ==1, (literally has to be a step function) + } + } dir HLT_mb_sp.* { - hist efficiency_low_mult { - output = HLT/Run3/TRMBI/SHIFTER/SPTRK - description = "Normal: Quick rise to almost 100% for 1,2 tracks, no eff. drop for higher multiplicities" - } hist nTrkRatio { output = HLT/Run3/TRMBI/EXPERT/SPTRK - description = "Normal: narrow peak slightly below 1 (0.9), if much below it means online tracking has to many fakes" - + description = Normal: narrow peak slightly below 1 (0.9), if much below it means online tracking has to many fakes } } dir HLT_.*hmt.* { - hist nTrkOffline_vs_decision { + hist efficiencyAnyMult { output = HLT/Run3/TRMBI/SHIFTER/SPTRK - description = "Normal: Typical trigger turn-on, should be reaching max around the threshold specified in the trigger name" - + description = Normal: Typical trigger turn-on, should be reaching max around the threshold specified in the trigger name + } + hist nTrkOnline { + output = HLT/Run3/TRMBI/EXPERT/SPTRK + description = Normal: exponent like distribution with a hard cut from the left side + } + hist nTrkOffline { + output = HLT/Run3/TRMBI/EXPERT/SPTRK + description = Normal: exponent like distribution with a soft cut from the left side } } } diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py index 0132da1640ec8f8afd242002ffcbc2b3196429a2..56229d6fda9724486ac4a03c0b5152265442350a 100644 --- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py +++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/python/TrigSPTRKMonitoringMT.py @@ -11,11 +11,11 @@ def TrigSPTRK(configFlags): from AthenaMonitoring import AthMonitorCfgHelper - monConfig = AthMonitorCfgHelper(configFlags, "HLTMinBiasTrkMonAlg") + monConfig = AthMonitorCfgHelper(configFlags, "HLTMBSPTRKMonAlg") from AthenaConfiguration.ComponentFactory import CompFactory - alg = monConfig.addAlgorithm(CompFactory.HLTMinBiasTrkMonAlg, "HLTMinBiasTrkMonAlg") + alg = monConfig.addAlgorithm(CompFactory.HLTMinBiasTrkMonAlg, "HLTMBSPTRKMonAlg") trkSel = CompFactory.InDet.InDetTrackSelectionTool( "InDetTrackSelectionTool_TightPrimary", CutLevel="TightPrimary" ) @@ -26,191 +26,46 @@ def TrigSPTRK(configFlags): mbEffAllGroup = monConfig.addGroup(alg, "EffAll", topPath="HLT/MinBiasMon/") length = len(alg.triggerList) - mbEffAllGroup.defineHistogram( - "PurityPassed,whichTrigger", - type="TH2D", - title=";Purity;trigger passed", - xbins=2, - xmin=0, - xmax=2, - xlabels=["0 track", ">0 tracks"], - ybins=length, - ymin=0, - ymax=length, - ylabels=list(alg.triggerList), - ) - mbEffAllGroup.defineHistogram( - "whichTrigger", - title="count of triggers;HLT", - xbins=length, - xmin=0, - xmax=length, - xlabels=list(alg.triggerList), - ) + mbEffAllGroup.defineHistogram( "PurityPassed,whichTrigger", type="TH2D", title=";Purity;trigger passed", xbins=2, xmin=0, xmax=2, xlabels=["0 track", ">0 tracks"], + ybins=length, ymin=0, ymax=length, ylabels=list(alg.triggerList) ) + mbEffAllGroup.defineHistogram( "whichTrigger", title="count of triggers;HLT", xbins=length, xmin=0, xmax=length, xlabels=list(alg.triggerList) ) for chain in alg.triggerList: mbEffGroup = monConfig.addGroup( alg, chain + "_Tracking", topPath="HLT/MinBiasMon/Tracking/" + chain + "/" ) - mbEffGroup.defineHistogram( - "decision,nTrkOffline", - type="TEfficiency", - title="Efficiency;Offline Good nTrk", - xbins=100, - xmin=0, - xmax=1000, - ) - mbEffGroup.defineHistogram( - "decision,nTrkOffline;efficiency_low_mult", - type="TEfficiency", - title="Efficiency;Offline Good nTrk", - xbins=50, - xmin=0, - xmax=50, - ) - mbEffGroup.defineHistogram( - "nTrkRatio", - title="Number of tracks reconstructed online/offline;track counts online/offline", - xbins=100, - xmin=-1, - xmax=4, - ) - mbEffGroup.defineHistogram( - "decision,nTrk", - type="TEfficiency", - title="Efficiency (step curve);Online nTrk", - xbins=1000, - xmin=0, - xmax=1000, - ) - # expert plots - mbEffGroup.defineHistogram( - "trkSelOfflineRatio", - path="Expert", - title="Number of tracks reconstructed offline(selected)/offline; N sel/all", - xbins=100, - xmin=-1, - xmax=4, - ) - mbEffGroup.defineHistogram( - "nTrkOnline,nTrkOffline", - type="TH2F", - path="Expert", - title=";N online tracks;N oflfine tracks", - xbins=20, - xmin=0, - xmax=2000, - ybins=20, - ymin=0, - ymax=2000, - ) + + mbEffGroup.defineHistogram( "decision,nTrkOffline;efficiencyAnyMult", type="TEfficiency", title="Efficiency;Offline Good nTrk", xbins=100, xmin=0, xmax=400 ) + mbEffGroup.defineHistogram( "decision,nTrkOffline;efficiencyLowMult", type="TEfficiency", title="Efficiency;Offline Good nTrk", xbins=50, xmin=0, xmax=50 ) + mbEffGroup.defineHistogram( "nTrkOffline;nTrkOfflineLowMult", title="Number of tracks reconstructed offline;track counts", xbins=50, xmin=-1, xmax=50 ) + + mbEffGroup.defineHistogram( "nTrkOffline", title="Number of tracks reconstructed offline;track counts", xbins=100, xmin=-1, xmax=400 ) + mbEffGroup.defineHistogram( "nTrkOnline;nTrkOnlineLowMult", title="Number of tracks reconstructed online;track counts", xbins=50, xmin=-1, xmax=50 ) + mbEffGroup.defineHistogram( "nTrkOnline", title="Number of tracks reconstructed online;track counts", xbins=100, xmin=-1, xmax=400 ) + mbEffGroup.defineHistogram( "nTrkRatio", title="Number of tracks reconstructed online/offline;track counts online/offline", xbins=100, xmin=-1, xmax=4 ) + mbEffGroup.defineHistogram( "decision,nTrkOnline", type="TEfficiency", title="Efficiency (step curve);Online nTrk", xbins=1000, xmin=0, xmax=1000 ) # expert plots + mbEffGroup.defineHistogram( "trkSelOfflineRatio", path="Expert", title="Number of tracks reconstructed offline(selected)/offline; N sel/all", xbins=100, xmin=0.1, xmax=1.9 ) + mbEffGroup.defineHistogram( "nTrkOnline,nTrkOffline", type="TH2F", path="Expert", title=";N online tracks;N offline tracks", xbins=20, xmin=0, xmax=400, ybins=20, ymin=0, ymax=400 ) mbSpGroup = monConfig.addGroup( alg, chain + "_SpacePoints", - topPath="HLT/MinBiasMon/SPacePoints/" + chain + "/", - ) - mbSpGroup.defineHistogram( - "PixelCL;PixelCLNarrowRange", - title="Number of SP in whole Pixels detector for all events", - xbins=100, - xmin=0, - xmax=100, - ) - mbSpGroup.defineHistogram( - "PixelCL;PixelCLWideRange", - title="Number of SP in whole Pixels detector for all events", - xbins=100, - xmin=0, - xmax=30000, - ) - mbSpGroup.defineHistogram( - "PixBarr_SP", - title="Number of SP for all events in Barrel", - xbins=100, - xmin=0, - xmax=30000, - ) - mbSpGroup.defineHistogram( - "PixECA_SP", - title="Number of SP for all events in ECA", - xbins=100, - xmin=0, - xmax=30000, - ) - mbSpGroup.defineHistogram( - "PixECC_SP", - title="Number of SP for all events in ECC", - xbins=100, - xmin=0, - xmax=30000, - ) - mbSpGroup.defineHistogram( - "SctTot", - title="Number of SP in whole SCT detector for all events", - xbins=100, - xmin=0, - xmax=120000, - ) - mbSpGroup.defineHistogram( - "SctBarr_SP", - title="Number of SCT_SP for all events in Barrel", - xbins=100, - xmin=0, - xmax=50000, - ) - mbSpGroup.defineHistogram( - "SctECA_SP", - title="Number of SCT_SP for all events in ECA", - xbins=100, - xmin=0, - xmax=50000, - ) - mbSpGroup.defineHistogram( - "SctECC_SP", - title="Number of SCT_SP for all events in ECC", - xbins=100, - xmin=0, - xmax=50000, - ) + topPath="HLT/MinBiasMon/SpacePoints/" + chain + "/", + ) + mbSpGroup.defineHistogram( "PixelCL;PixelCLNarrowRange", title="Number of SP in whole Pixels detector for all events", xbins=100, xmin=0, xmax=100 ) + mbSpGroup.defineHistogram( "PixelCL;PixelCLWideRange", title="Number of SP in whole Pixels detector for all events", xbins=100, xmin=0, xmax=30000 ) + mbSpGroup.defineHistogram( "PixBarr_SP", title="Number of SP for all events in Barrel", xbins=100, xmin=0, xmax=30000 ) + mbSpGroup.defineHistogram( "PixECA_SP", title="Number of SP for all events in ECA", xbins=100, xmin=0, xmax=30000 ) + mbSpGroup.defineHistogram( "PixECC_SP", title="Number of SP for all events in ECC", xbins=100, xmin=0, xmax=30000 ) + mbSpGroup.defineHistogram( "SctTot", title="Number of SP in whole SCT detector for all events", xbins=100, xmin=0, xmax=120000 ) + mbSpGroup.defineHistogram( "SctBarr_SP", title="Number of SCT_SP for all events in Barrel", xbins=100, xmin=0, xmax=50000 ) + mbSpGroup.defineHistogram( "SctECA_SP", title="Number of SCT_SP for all events in ECA", xbins=100, xmin=0, xmax=50000 ) + mbSpGroup.defineHistogram( "SctECC_SP", title="Number of SCT_SP for all events in ECC", xbins=100, xmin=0, xmax=50000 ) # expert plots - mbSpGroup.defineHistogram( - "SctECA_SP,SctECC_SP", - type="TH2F", - path="Expert", - title="SctECA_SP;SctECC_SP", - xbins=100, - xmin=0, - xmax=100, - ybins=100, - ymin=0, - ymax=100, - ) - mbSpGroup.defineHistogram( - "PixECA_SP,PixECC_SP", - type="TH2F", - path="Expert", - title="PixECA_SP;PixECC_SP", - xbins=100, - xmin=0, - xmax=100, - ybins=100, - ymin=0, - ymax=100, - ) - mbSpGroup.defineHistogram( - "SctBarr_SP,PixBarr_SP", - type="TH2F", - path="Expert", - title="SctBarr_SP;PixBarr_SP", - xbins=100, - xmin=0, - xmax=100, - ybins=100, - ymin=0, - ymax=100, - ) + mbSpGroup.defineHistogram( "SctECA_SP,SctECC_SP", type="TH2F", title="SctECA_SP;SctECC_SP", xbins=100, xmin=0, xmax=100, ybins=100, ymin=0, ymax=100 ) + mbSpGroup.defineHistogram( "PixECA_SP,PixECC_SP", type="TH2F", title="PixECA_SP;PixECC_SP", xbins=100, xmin=0, xmax=100, ybins=100, ymin=0, ymax=100 ) + mbSpGroup.defineHistogram( "SctBarr_SP,PixBarr_SP", type="TH2F", title="SctBarr_SP;PixBarr_SP", xbins=100, xmin=0, xmax=100, ybins=100, ymin=0, ymax=100 ) return monConfig.result() @@ -221,8 +76,6 @@ if __name__ == "__main__": Configurable.configurableRun3Behavior = 1 - # Setup logs - from AthenaCommon.Constants import DEBUG # Set the Athena configuration flags from AthenaConfiguration.AllConfigFlags import ConfigFlags @@ -232,9 +85,7 @@ if __name__ == "__main__": # ConfigFlags.Input.Files = ['/afs/cern.ch/user/s/somadutt/public/testUPC2.AOD.pool.root'] #Local HI-UPC file # data AOD file - - # 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.Files = ["myAOD.pool.root"] +# ConfigFlags.Input.Files = ["myAOD.pool.root"] # ConfigFlags.Input.isMC = True #un-Comment this line for MC AOD files, comment for data-AOD files ConfigFlags.Output.HISTFileName = "TestMonitorOutput.root" @@ -250,8 +101,8 @@ if __name__ == "__main__": cfg.merge(TrigSPTRK(ConfigFlags)) # If you want to turn on more detailed messages ... - # cfg.getEventAlgo('HLTMinBiasTrkMonAlg').OutputLevel = 2 # DEBUG #either this line or the next works!! - cfg.getEventAlgo("HLTMinBiasTrkMonAlg").OutputLevel = DEBUG # DEBUG + from AthenaCommon.Constants import DEBUG + cfg.getEventAlgo("HLTMBSPTRKMonAlg").OutputLevel = DEBUG cfg.printConfig(withDetails=True) # set True for exhaustive info with open("cfg.pkl", "wb") as f: cfg.store(f) diff --git a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasTrkMonAlg.cxx b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasTrkMonAlg.cxx index d378bda3d199e716e03df265aa5fea51adb24c47..5c0d26ebbea5a102179a491aa292a50fdb6f34e2 100644 --- a/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasTrkMonAlg.cxx +++ b/Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/HLTMinBiasTrkMonAlg.cxx @@ -131,12 +131,12 @@ StatusCode HLTMinBiasTrkMonAlg::monitorTrkCounts(const EventContext &context) co if ( ! (passBits & TrigDefs::EF_prescaled) ) { auto decision = Scalar<int>("decision", trigDecTool->isPassed(trig, TrigDefs::requireDecision) ? 1 : 0); - auto nTrk = Scalar("nTrkOnline", trkCountsHandle->at(0)->getDetail<int>("ntrks")); + auto nTrkOnline = Scalar("nTrkOnline", trkCountsHandle->at(0)->getDetail<int>("ntrks")); auto whichtrigger = Scalar<std::string>("whichTrigger", trig); double nTrkRatio = offlineTrkHandle->size() > 0 ? static_cast<double>(offlineTrkHandle->size()) / static_cast<double>(trkCountsHandle->at(0)->getDetail<int>("ntrks")) : -1.0; auto trkRatio = Scalar("nTrkRatio", nTrkRatio); - fill(trig + "_Tracking", nTrkOffline, nAllTrkOffline, decision, whichtrigger, trkRatio, nMBTrkTrkOfflineRatio); + fill(trig + "_Tracking", nTrkOffline, nAllTrkOffline, nTrkOnline, decision, whichtrigger, trkRatio, nMBTrkTrkOfflineRatio); fill("EffAll", decision, whichtrigger); }