ATLAS Offline Software
Loading...
Searching...
No Matches
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
9
11#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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
StatusCode retrieveAndBook(P *&pHisto, const std::string &identifier, const std::string &folderOverride="", const std::string &nameOverride="")
Definition PlotMgr.h:64
PlotMgr(const std::string &dirName, const std::string &anaTag, PlotMgr *pParent=nullptr)
Constructor taking parent node and directory name for plots pParent = nullptr by default to book plot...
Definition PlotMgr.cxx:25
void finalizePlots()
Print out final stats on histograms.
StatusCode fillPlots(const std::vector< size_t > &testTrackCounts, const std::vector< size_t > &refTrackCounts, bool isNewEvent, float weight)
Dedicated fill method.
SummaryPlots(PlotMgr *pParent, const std::string &dirName, const std::string &anaTag, bool doTrigger=false)
Constructor.
void initializePlots()
Book the histograms.
StatusCode bookPlots()
const std::string & getDirectory()
Definition PlotBase.h:88
void fill(H5::Group &out_file, size_t iterations)