ATLAS Offline Software
Loading...
Searching...
No Matches
TreeMakerAlg.cxx
Go to the documentation of this file.
1// Copyright (C) 2002-2019 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
12 ANA_CHECK(book(TTree(m_treeName.value().c_str(), "xAOD->NTuple tree")));
13 TTree *treePtr = tree(m_treeName);
14 if (!treePtr)
15 {
16 ANA_MSG_ERROR("Failed to create output tree \"" << m_treeName.value() << "\"");
17 return StatusCode::FAILURE;
18 }
19 treePtr->SetAutoFlush(m_treeAutoFlush);
20 return StatusCode::SUCCESS;
21 }
22
23} // namespace CP
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
StatusCode book(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
Gaudi::Property< std::string > m_treeName
The name of the output tree to write.
virtual StatusCode initialize() override
Gaudi::Property< int > m_treeAutoFlush
Flush setting for the output tree.
Select isolated Photons, Electrons and Muons.
TChain * tree