ATLAS Offline Software
Loading...
Searching...
No Matches
TreeFillerAlg.cxx
Go to the documentation of this file.
1// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3// Local include(s):
5
6// ROOT include(s):
7#include <TTree.h>
8
9namespace CP {
10
11 StatusCode TreeFillerAlg::execute(const EventContext& /*ctx*/) {
12 // get the output tree for the first time
13 if( ! m_tree ) {
15 }
16
17 if( ! m_tree ) {
18 ATH_MSG_ERROR( "Could not find output tree \"" << m_treeName
19 << "\"" );
20 return StatusCode::FAILURE;
21 }
22
23 // Fill the tree.
24 if( m_tree->Fill() < 0 ) {
25 ATH_MSG_ERROR( "Error while filling TTree" );
26 return StatusCode::FAILURE;
27 }
28
29 // Return gracefully.
30 return StatusCode::SUCCESS;
31 }
32
33} // namespace CP
#define ATH_MSG_ERROR(x,...)
TTree * m_tree
The tree being written.
Gaudi::Property< std::string > m_treeName
The name of the output tree to write.
virtual::StatusCode execute()
execute this algorithm
Select isolated Photons, Electrons and Muons.
TChain * tree