Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SummaryPlots.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #include "SummaryPlots.h"
12 
13 
18  PlotMgr* pParent, const std::string& dirName,
19  const std::string& anaTag,
20  bool doTrigger ) :
21  PlotMgr( dirName, anaTag, pParent ),
22  m_doTrigger( doTrigger ) { }
23 
24 
29 {
30  StatusCode sc = bookPlots();
31  if( sc.isFailure() ) {
32  ATH_MSG_ERROR( "Failed to book summary plots" );
33  }
34 }
35 
36 
38 {
39  ATH_MSG_DEBUG( "Booking Summary plots in " << getDirectory() );
40 
41  if( m_doTrigger ) {
42  ATH_CHECK( retrieveAndBook( m_summary_trig, "summary_trigNav" ) );
43  } else {
44  ATH_CHECK( retrieveAndBook( m_summary, "summary" ) );
45  }
46 
47  return StatusCode::SUCCESS;
48 }
49 
50 
55  const std::vector< size_t >& testTrackCounts,
56  const std::vector< size_t >& refTrackCounts,
57  bool isNewEvent,
58  float weight )
59 {
60  if( m_doTrigger ) {
62  if( isNewEvent ) {
64  ATH_CHECK( fill( m_summary_trig, Nevents_trig+0.5, weight ) );
65  ATH_CHECK( fill( m_summary_trig, NtotTest_trig+0.5, weight * testTrackCounts[ ALL ] ) );
66  ATH_CHECK( fill( m_summary_trig, NselTest_trig+0.5, weight * testTrackCounts[ SELECTED ] ) );
67  ATH_CHECK( fill( m_summary_trig, NtotRef_trig+0.5, weight * refTrackCounts[ ALL ] ) );
68  ATH_CHECK( fill( m_summary_trig, NselRef_trig+0.5, weight * refTrackCounts[ SELECTED ] ) );
69  }
71  ATH_CHECK( fill( m_summary_trig, Nrois_trig+0.5, weight ) );
72  ATH_CHECK( fill( m_summary_trig, NinRoiTest_trig+0.5, weight * testTrackCounts[ INROI ] ) );
73  ATH_CHECK( fill( m_summary_trig, NmatchTest_trig+0.5, weight * testTrackCounts[ MATCHED ] ) );
74  ATH_CHECK( fill( m_summary_trig, NinRoiRef_trig+0.5, weight * refTrackCounts[ INROI ] ) );
75  ATH_CHECK( fill( m_summary_trig, NmatchRef_trig+0.5, weight * refTrackCounts[ MATCHED ] ) );
76  } else {
78  if( isNewEvent ) {
81  ATH_CHECK( fill( m_summary, Nevents+0.5, weight ) );
82  ATH_CHECK( fill( m_summary, NtotTest+0.5, weight * testTrackCounts[ ALL ] ) );
83  ATH_CHECK( fill( m_summary, NselTest+0.5, weight * testTrackCounts[ SELECTED ] ) );
84  ATH_CHECK( fill( m_summary, NtotRef+0.5, weight * refTrackCounts[ ALL ] ) );
85  ATH_CHECK( fill( m_summary, NselRef+0.5, weight * refTrackCounts[ SELECTED ] ) );
86  }
87  ATH_CHECK( fill( m_summary, NmatchTest+0.5, weight * testTrackCounts[ MATCHED ] ) );
88  ATH_CHECK( fill( m_summary, NmatchRef+0.5, weight * refTrackCounts[ MATCHED ] ) );
89  }
90 
91  return StatusCode::SUCCESS;
92 }
93 
94 
99 {
100  ATH_MSG_DEBUG( "Finalising Summary plots" );
102 }
DoubleEventSelectorOverlayTest.doTrigger
doTrigger
Definition: DoubleEventSelectorOverlayTest.py:46
IDTPM::SummaryPlots::finalizePlots
void finalizePlots()
Print out final stats on histograms.
Definition: SummaryPlots.cxx:98
IDTPM::SummaryPlots::SummaryPlots
SummaryPlots(PlotMgr *pParent, const std::string &dirName, const std::string &anaTag, bool doTrigger=false)
Constructor.
Definition: SummaryPlots.cxx:17
InDetVertexTruthMatchUtils::MATCHED
@ MATCHED
Definition: InDetVertexTruthMatchUtils.h:21
PrintTrkAnaSummary.dirName
dirName
Definition: PrintTrkAnaSummary.py:137
IDTPM::SummaryPlots::initializePlots
void initializePlots()
Book the histograms.
Definition: SummaryPlots.cxx:28
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
IDTPM::PlotMgr
Definition: PlotMgr.h:33
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SummaryPlots.h
IDTPM::SummaryPlots::fillPlots
StatusCode fillPlots(const std::vector< size_t > &testTrackCounts, const std::vector< size_t > &refTrackCounts, bool isNewEvent, float weight)
Dedicated fill method.
Definition: SummaryPlots.cxx:54
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
LArHVCorrMonAlg.Nevents
int Nevents
Definition: LArHVCorrMonAlg.py:212
IDTPM::SummaryPlots::bookPlots
StatusCode bookPlots()
Definition: SummaryPlots.cxx:37