ATLAS Offline Software
|
#include <MuonTesterTree.h>
Public Types | |
using | FriendTreePtr = std::shared_ptr< MuonTesterTree > |
Appends the other tester Tree as friend to this instance. More... | |
Public Member Functions | |
MuonTesterTree (const std::string &tree_name, const std::string &stream) | |
~MuonTesterTree () | |
TTree * | tree () |
TTree object. More... | |
const TTree * | tree () const |
TTree * | operator-> () |
Operator to the TTree object. More... | |
const TTree * | operator-> () const |
bool | initialized () const |
Has the init method been called and the tree is connected with the output file. More... | |
bool | fill (const EventContext &ctx) |
Fills the tree per call. More... | |
std::string | name () const |
Name of the tree. More... | |
const std::string & | fileStream () const |
file_stream of the analysis to which the tree belongs More... | |
const std::string & | path () const |
sub directory in the TFile More... | |
void | setPath (const std::string &new_path) |
Save the TTree in a subfolder of the TFile. More... | |
template<class OWNER , typename = typename std::enable_if<std::is_base_of<IProperty, OWNER>::value>::type> | |
StatusCode | init (OWNER *instance) |
Initialize method. More... | |
StatusCode | write () |
Finally write the TTree objects. More... | |
bool | registerBranch (std::shared_ptr< IMuonTesterBranch > branch) |
This method adds the branch to the tree and hands over the ownership to the MuonAnalysisTree instance IF the second argument is set to false the branch is not added to the active list of branches i.e. More... | |
bool | addBranch (std::shared_ptr< IMuonTesterBranch > branch) |
Branch is added to the tree without transferring the ownership. More... | |
bool | addBranch (IMuonTesterBranch &branch) |
bool | addBranch (IMuonTesterBranch *branch) |
void | removeBranch (IMuonTesterBranch *branch) |
In case instances of a certain branch type are destroyed before hand. More... | |
void | removeBranch (IMuonTesterBranch &branch) |
void | disableBranch (const std::string &br_name) |
Skips the branch from being added to the tree. More... | |
void | disableBranch (const std::vector< std::string > &br_names) |
template<class T > | |
std::shared_ptr< T > | getBranch (const std::string &str) const |
Retrieves the branches owned by the muon_tree. More... | |
template<typename T > | |
VectorBranch< T > & | newVector (const std::string &name) |
Creates new branches and returns their reference. More... | |
template<typename T > | |
ScalarBranch< T > & | newScalar (const std::string &name) |
template<typename T > | |
MatrixBranch< T > & | newMatrix (const std::string &name) |
template<typename T > | |
SetBranch< T > & | newSet (const std::string &name) |
template<typename T > | |
VectorBranch< T > & | newVector (const std::string &name, const T def_val) |
Creates and returns branches with a default value. More... | |
template<typename T > | |
ScalarBranch< T > & | newScalar (const std::string &name, const T def_val) |
template<typename T > | |
MatrixBranch< T > & | newMatrix (const std::string &name, const T def_val) |
template<typename T > | |
T & | newBranch (std::shared_ptr< T > br) |
returns the reference of the branch More... | |
bool | isActive (const IMuonTesterBranch *branch) const |
Returns a boolean whether the branch is already part of the tree or one of the deligated friends. More... | |
bool | isCommonTree () const |
Returns Whether the Tree is a common tree or not. More... | |
bool | addCommonTree (FriendTreePtr common_tree) |
const std::vector< FriendTreePtr > & | getFriends () const |
bool | msgLvl (const MSG::Level lvl) const |
Test the output level. More... | |
MsgStream & | msg () const |
The standard message stream. More... | |
MsgStream & | msg (const MSG::Level lvl) const |
The standard message stream. More... | |
void | setLevel (MSG::Level lvl) |
Change the current logging level. More... | |
Private Types | |
using | DataDependency = IMuonTesterBranch::DataDependency |
Private Member Functions | |
bool | addClient (MuonTesterTree *client) |
Adds the other TTree as a Client and declares this instance as a Common Tree. More... | |
StatusCode | init (ServiceHandle< ITHistSvc > hist_svc) |
Initialze the tree with the output file. More... | |
void | initMessaging () const |
Initialize our message level and MessageSvc. More... | |
Private Attributes | |
std::vector< DataDependency > | m_dependencies {} |
unsigned int | m_depCounter {0} |
std::unique_ptr< TTree > | m_tree {nullptr} |
std::string | m_stream {} |
std::string | m_path {} |
bool | m_init {false} |
Flag to avoid double initialization with the StoreGate. More... | |
bool | m_written {false} |
Flag to indicate whether the TTree is written to the file or not. More... | |
std::vector< IMuonTesterBranch * > | m_branches_to_init {} |
std::vector< std::shared_ptr< IMuonTesterBranch > > | m_branches {} |
std::set< IMuonTesterBranch * > | m_initialized_br {} |
Set of branches that were already initialized. More... | |
std::set< std::string > | m_excludedBranches {} |
TDirectory * | m_directory {nullptr} |
bool | m_filled {false} |
ServiceHandle< ITHistSvc > | m_hist_svc {"", ""} |
std::vector< FriendTreePtr > | m_friendLinks {} |
List of all other common instances that are acting as friends. More... | |
std::set< MuonTesterTree * > | m_commonClients {} |
List of all other MuonTesterTree instances using this instance as a common Tree If the Tree has one client it is declared as a common Tree. More... | |
std::shared_ptr< EventHashBranch > | m_hash_br |
std::string | m_nm |
Message source name. More... | |
boost::thread_specific_ptr< MsgStream > | m_msg_tls |
MsgStream instance (a std::cout like with print-out levels) More... | |
std::atomic< IMessageSvc * > | m_imsg { nullptr } |
MessageSvc pointer. More... | |
std::atomic< MSG::Level > | m_lvl { MSG::NIL } |
Current logging level. More... | |
std::atomic_flag m_initialized | ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
Messaging initialized (initMessaging) More... | |
Definition at line 30 of file MuonTesterTree.h.
Definition at line 123 of file MuonTesterTree.h.
using MuonVal::MuonTesterTree::FriendTreePtr = std::shared_ptr<MuonTesterTree> |
Appends the other tester Tree as friend to this instance.
Definition at line 109 of file MuonTesterTree.h.
MuonVal::MuonTesterTree::MuonTesterTree | ( | const std::string & | tree_name, |
const std::string & | stream | ||
) |
Definition at line 267 of file MuonTesterTree.cxx.
MuonVal::MuonTesterTree::~MuonTesterTree | ( | ) |
Definition at line 271 of file MuonTesterTree.cxx.
bool MuonVal::MuonTesterTree::addBranch | ( | IMuonTesterBranch & | branch | ) |
Definition at line 62 of file MuonTesterTree.cxx.
bool MuonVal::MuonTesterTree::addBranch | ( | IMuonTesterBranch * | branch | ) |
Definition at line 63 of file MuonTesterTree.cxx.
bool MuonVal::MuonTesterTree::addBranch | ( | std::shared_ptr< IMuonTesterBranch > | branch | ) |
Branch is added to the tree without transferring the ownership.
Definition at line 61 of file MuonTesterTree.cxx.
|
private |
Adds the other TTree as a Client and declares this instance as a Common Tree.
Definition at line 225 of file MuonTesterTree.cxx.
bool MuonVal::MuonTesterTree::addCommonTree | ( | FriendTreePtr | common_tree | ) |
Ensure that the event entries are synchronized
Definition at line 237 of file MuonTesterTree.cxx.
void MuonVal::MuonTesterTree::disableBranch | ( | const std::string & | br_name | ) |
Skips the branch from being added to the tree.
Definition at line 199 of file MuonTesterTree.cxx.
void MuonVal::MuonTesterTree::disableBranch | ( | const std::vector< std::string > & | br_names | ) |
Definition at line 202 of file MuonTesterTree.cxx.
const std::string & MuonVal::MuonTesterTree::fileStream | ( | ) | const |
file_stream of the analysis to which the tree belongs
Definition at line 205 of file MuonTesterTree.cxx.
bool MuonVal::MuonTesterTree::fill | ( | const EventContext & | ctx | ) |
Fills the tree per call.
Remove the information that is no longer of value
Common trees arecan only be filled once in an event
Call the fill method on all friends
These branches are actually initialized
Definition at line 89 of file MuonTesterTree.cxx.
std::shared_ptr<T> MuonVal::MuonTesterTree::getBranch | ( | const std::string & | str | ) | const |
Retrieves the branches owned by the muon_tree.
const std::vector< MuonTesterTree::FriendTreePtr > & MuonVal::MuonTesterTree::getFriends | ( | ) | const |
Definition at line 262 of file MuonTesterTree.cxx.
StatusCode MuonVal::MuonTesterTree::init | ( | OWNER * | instance | ) |
Initialize method.
|
private |
Initialze the tree with the output file.
The stream corresponds to the stream of the file e.g MDTTester HighEtaTester
push back the ds id index
Sort by alphabet
Kick everything that is not owned by the class itself
Definition at line 120 of file MuonTesterTree.cxx.
bool MuonVal::MuonTesterTree::initialized | ( | ) | const |
Has the init method been called and the tree is connected with the output file.
Definition at line 88 of file MuonTesterTree.cxx.
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
bool MuonVal::MuonTesterTree::isActive | ( | const IMuonTesterBranch * | branch | ) | const |
Returns a boolean whether the branch is already part of the tree or one of the deligated friends.
Definition at line 206 of file MuonTesterTree.cxx.
bool MuonVal::MuonTesterTree::isCommonTree | ( | ) | const |
Returns Whether the Tree is a common tree or not.
Definition at line 265 of file MuonTesterTree.cxx.
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
|
inlineinherited |
Test the output level.
lvl | The message level to test against |
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
std::string MuonVal::MuonTesterTree::name | ( | ) | const |
T& MuonVal::MuonTesterTree::newBranch | ( | std::shared_ptr< T > | br | ) |
returns the reference of the branch
MatrixBranch<T>& MuonVal::MuonTesterTree::newMatrix | ( | const std::string & | name | ) |
MatrixBranch<T>& MuonVal::MuonTesterTree::newMatrix | ( | const std::string & | name, |
const T | def_val | ||
) |
ScalarBranch<T>& MuonVal::MuonTesterTree::newScalar | ( | const std::string & | name | ) |
ScalarBranch<T>& MuonVal::MuonTesterTree::newScalar | ( | const std::string & | name, |
const T | def_val | ||
) |
VectorBranch<T>& MuonVal::MuonTesterTree::newVector | ( | const std::string & | name | ) |
Creates new branches and returns their reference.
VectorBranch<T>& MuonVal::MuonTesterTree::newVector | ( | const std::string & | name, |
const T | def_val | ||
) |
Creates and returns branches with a default value.
TTree * MuonVal::MuonTesterTree::operator-> | ( | ) |
const TTree * MuonVal::MuonTesterTree::operator-> | ( | ) | const |
Definition at line 25 of file MuonTesterTree.cxx.
const std::string & MuonVal::MuonTesterTree::path | ( | ) | const |
bool MuonVal::MuonTesterTree::registerBranch | ( | std::shared_ptr< IMuonTesterBranch > | branch | ) |
This method adds the branch to the tree and hands over the ownership to the MuonAnalysisTree instance IF the second argument is set to false the branch is not added to the active list of branches i.e.
no fill and initialize function is called on it
Check whether the branch belongs to the same TTree
Definition at line 28 of file MuonTesterTree.cxx.
void MuonVal::MuonTesterTree::removeBranch | ( | IMuonTesterBranch & | branch | ) |
Definition at line 86 of file MuonTesterTree.cxx.
void MuonVal::MuonTesterTree::removeBranch | ( | IMuonTesterBranch * | branch | ) |
In case instances of a certain branch type are destroyed before hand.
Definition at line 83 of file MuonTesterTree.cxx.
|
inherited |
Change the current logging level.
Use this rather than msg().setLevel() for proper operation with MT.
Definition at line 28 of file AthMessaging.cxx.
void MuonVal::MuonTesterTree::setPath | ( | const std::string & | new_path | ) |
TTree * MuonVal::MuonTesterTree::tree | ( | ) |
const TTree * MuonVal::MuonTesterTree::tree | ( | ) | const |
Definition at line 24 of file MuonTesterTree.cxx.
StatusCode MuonVal::MuonTesterTree::write | ( | ) |
Finally write the TTree objects.
Definition at line 178 of file MuonTesterTree.cxx.
|
mutableprivateinherited |
Messaging initialized (initMessaging)
Definition at line 141 of file AthMessaging.h.
|
private |
Definition at line 145 of file MuonTesterTree.h.
|
private |
Definition at line 143 of file MuonTesterTree.h.
|
private |
List of all other MuonTesterTree instances using this instance as a common Tree If the Tree has one client it is declared as a common Tree.
It can then only be filled once in an event
Definition at line 160 of file MuonTesterTree.h.
|
private |
Definition at line 125 of file MuonTesterTree.h.
|
private |
Definition at line 124 of file MuonTesterTree.h.
|
private |
Definition at line 151 of file MuonTesterTree.h.
|
private |
Definition at line 149 of file MuonTesterTree.h.
|
private |
Definition at line 152 of file MuonTesterTree.h.
|
private |
List of all other common instances that are acting as friends.
Definition at line 156 of file MuonTesterTree.h.
|
private |
Definition at line 162 of file MuonTesterTree.h.
|
private |
Definition at line 153 of file MuonTesterTree.h.
|
mutableprivateinherited |
MessageSvc pointer.
Definition at line 135 of file AthMessaging.h.
|
private |
Flag to avoid double initialization with the StoreGate.
Definition at line 131 of file MuonTesterTree.h.
|
private |
Set of branches that were already initialized.
Definition at line 147 of file MuonTesterTree.h.
|
mutableprivateinherited |
Current logging level.
Definition at line 138 of file AthMessaging.h.
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
|
privateinherited |
Message source name.
Definition at line 129 of file AthMessaging.h.
|
private |
Definition at line 129 of file MuonTesterTree.h.
|
private |
Definition at line 128 of file MuonTesterTree.h.
|
private |
Definition at line 127 of file MuonTesterTree.h.
|
private |
Flag to indicate whether the TTree is written to the file or not.
Definition at line 133 of file MuonTesterTree.h.