ATLAS Offline Software
Loading...
Searching...
No Matches
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
14class HWIdentifier;
15class LArOnlineID;
16class LArEM_ID;
17class LArHEC_ID;
18class LArFCAL_ID;
19class MsgStream;
20
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
69
70};
71#endif
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
const LArOnlineID * m_onlineId
virtual StatusCode initialize() override
virtual StatusCode finalize() override
const LArFCAL_ID * m_fcalId
std::string m_ntTitle
virtual StatusCode CBNT_clear()
virtual StatusCode CBNT_execute()
MsgStream * m_log
std::string m_ntpath
virtual StatusCode CBNT_finalize()
void addBranch(const std::string &branchname, T *&obj)
const LArEM_ID * m_emId
void addBranch(const std::string &branchname, T &obj, const std::string &leaflist)
virtual StatusCode pre_execute()
CBNT_TBRecBase(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode CBNT_initialize()
virtual StatusCode execute() override
virtual ~CBNT_TBRecBase()
const LArHEC_ID * m_hecId
void addBranch(const std::string &branchname, T *&obj, int bufferSize, int splitLevel)
Helper class for LArEM offline identifiers.
Definition LArEM_ID.h:111
Helper class for LArFCAL offline identifiers.
Definition LArFCAL_ID.h:49
Helper class for LArHEC offline identifiers.
Definition LArHEC_ID.h:76