ATLAS Offline Software
CBNT_TBRecBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //Dear emacs, this is -*-c++-*-
6 #ifndef TBREC_CBNT_TBRECBASE_H
7 #define TBREC_CBNT_TBRECBASE_H
8 
10 #include "GaudiKernel/ToolHandle.h"
11 
12 #include "TTree.h"
13 
14 class HWIdentifier;
15 class LArOnlineID;
16 class LArEM_ID;
17 class LArHEC_ID;
18 class LArFCAL_ID;
19 class MsgStream;
20 
21 class CBNT_TBRecBase : public AthAlgorithm {
22 
23  public:
24  CBNT_TBRecBase(const std::string & name, ISvcLocator * pSvcLocator);
25  virtual ~CBNT_TBRecBase();
26 
27  //Standard algo methods
28  virtual StatusCode initialize() override;
29  virtual StatusCode execute() override;
30  virtual StatusCode finalize() override;
31  virtual StatusCode pre_execute();
32 
33  //These needs to be implemented by the deriving class
34  virtual StatusCode CBNT_initialize() {return StatusCode::SUCCESS;}
35  virtual StatusCode CBNT_execute() {return StatusCode::SUCCESS;}
36  virtual StatusCode CBNT_finalize() {return StatusCode::SUCCESS;}
37  virtual StatusCode CBNT_clear() {return StatusCode::SUCCESS;}
38 
39  private:
41 
42  protected:
43  // wrapper to add branches
44  template <class T> void addBranch(const std::string &branchname, T &obj, const std::string &leaflist) {
45  m_nt->Branch(branchname.c_str(), &obj, leaflist.c_str());
46  }
47  template <class T> void addBranch(const std::string &branchname, T *&obj) {
48  obj = new T();
49  m_nt->Branch(branchname.c_str(), &obj);
50  }
51  template <class T> void addBranch(const std::string &branchname, T *&obj, int bufferSize, int splitLevel) {
52  obj = new T();
53  m_nt->Branch(branchname.c_str(), &obj, bufferSize, splitLevel);
54  }
55 
56  enum {NOT_VALID = -999};
57 
58  std::string m_ntpath, m_ntTitle;
59 
60  //Ntuple pointer
61  TTree* m_nt;
62 
63  MsgStream* m_log;
64 
65  const LArEM_ID* m_emId;
69 
70 };
71 #endif
CBNT_TBRecBase::CBNT_finalize
virtual StatusCode CBNT_finalize()
Definition: CBNT_TBRecBase.h:36
CBNT_TBRecBase::m_nt
TTree * m_nt
Definition: CBNT_TBRecBase.h:61
CBNT_TBRecBase::m_initialized
bool m_initialized
Definition: CBNT_TBRecBase.h:40
CBNT_TBRecBase::NOT_VALID
@ NOT_VALID
Definition: CBNT_TBRecBase.h:56
CBNT_TBRecBase::m_onlineId
const LArOnlineID * m_onlineId
Definition: CBNT_TBRecBase.h:68
CBNT_TBRecBase::CBNT_clear
virtual StatusCode CBNT_clear()
Definition: CBNT_TBRecBase.h:37
CBNT_TBRecBase::CBNT_initialize
virtual StatusCode CBNT_initialize()
Definition: CBNT_TBRecBase.h:34
CBNT_TBRecBase::CBNT_execute
virtual StatusCode CBNT_execute()
Definition: CBNT_TBRecBase.h:35
LArHEC_ID
Helper class for LArHEC offline identifiers.
Definition: LArHEC_ID.h:85
HWIdentifier
Definition: HWIdentifier.h:13
CBNT_TBRecBase::addBranch
void addBranch(const std::string &branchname, T *&obj)
Definition: CBNT_TBRecBase.h:47
RTTAlgmain.branchname
string branchname
Definition: RTTAlgmain.py:60
AthAlgorithm.h
CBNT_TBRecBase
Definition: CBNT_TBRecBase.h:21
CBNT_TBRecBase::m_emId
const LArEM_ID * m_emId
Definition: CBNT_TBRecBase.h:65
CBNT_TBRecBase::m_fcalId
const LArFCAL_ID * m_fcalId
Definition: CBNT_TBRecBase.h:67
CBNT_TBRecBase::addBranch
void addBranch(const std::string &branchname, T *&obj, int bufferSize, int splitLevel)
Definition: CBNT_TBRecBase.h:51
CBNT_TBRecBase::m_log
MsgStream * m_log
Definition: CBNT_TBRecBase.h:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CBNT_TBRecBase::addBranch
void addBranch(const std::string &branchname, T &obj, const std::string &leaflist)
Definition: CBNT_TBRecBase.h:44
CBNT_TBRecBase::execute
virtual StatusCode execute() override
Definition: CBNT_TBRecBase.cxx:154
CBNT_TBRecBase::CBNT_TBRecBase
CBNT_TBRecBase(const std::string &name, ISvcLocator *pSvcLocator)
Definition: CBNT_TBRecBase.cxx:12
CBNT_TBRecBase::m_hecId
const LArHEC_ID * m_hecId
Definition: CBNT_TBRecBase.h:66
AthAlgorithm
Definition: AthAlgorithm.h:47
CBNT_TBRecBase::initialize
virtual StatusCode initialize() override
Definition: CBNT_TBRecBase.cxx:22
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
LArOnlineID
Definition: LArOnlineID.h:20
CBNT_TBRecBase::~CBNT_TBRecBase
virtual ~CBNT_TBRecBase()
Definition: CBNT_TBRecBase.cxx:18
CBNT_TBRecBase::finalize
virtual StatusCode finalize() override
Definition: CBNT_TBRecBase.cxx:205
CBNT_TBRecBase::pre_execute
virtual StatusCode pre_execute()
Definition: CBNT_TBRecBase.cxx:61
LArEM_ID
Helper class for LArEM offline identifiers.
Definition: LArEM_ID.h:118
CBNT_TBRecBase::m_ntTitle
std::string m_ntTitle
Definition: CBNT_TBRecBase.h:58
CBNT_TBRecBase::m_ntpath
std::string m_ntpath
Definition: CBNT_TBRecBase.h:58
python.PyAthena.obj
obj
Definition: PyAthena.py:132
LArFCAL_ID
Helper class for LArFCAL offline identifiers.
Definition: LArFCAL_ID.h:60
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35