Class writing all variables from one standalone object.
More...
#include <TreeBranchHelpers.h>
|
| void | initMessaging () const |
| | Initialize our message level and MessageSvc.
|
|
| std::vector< std::unique_ptr< ElementBranchProcessor > > | m_branches |
| | List of branch processors set up for this xAOD object.
|
| std::string | m_sgName |
| | Name of the object in the event store.
|
| std::string | m_nm |
| | Message source name.
|
| boost::thread_specific_ptr< MsgStream > | m_msg_tls |
| | MsgStream instance (a std::cout like with print-out levels)
|
| std::atomic< IMessageSvc * > | m_imsg { nullptr } |
| | MessageSvc pointer.
|
| std::atomic< MSG::Level > | m_lvl { MSG::NIL } |
| | Current logging level.
|
| std::atomic_flag m_initialized | ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
| | Messaging initialized (initMessaging)
|
Class writing all variables from one standalone object.
It is designed to work with any type inheriting from SG::AuxElement. Like xAOD::EventInfo. Which is its main user at the moment...
Definition at line 341 of file TreeBranchHelpers.h.
◆ ElementProcessorRegular() [1/2]
| CP::TreeBranchHelpers::ElementProcessorRegular::ElementProcessorRegular |
( |
const std::string & | sgName | ) |
|
Default constructor.
We have to have a default constructor to initialise the asg::AsgMessaging base class correctly. Members of this class would not need an explicit constructor themselves.
Definition at line 829 of file TreeBranchHelpers.cxx.
830 : asg::AsgMessaging( ("CP::TreeBranchHelpers::ElementProcessorRegular/" + sgName).c_str() ),
832
833 }
std::string m_sgName
Name of the object in the event store.
◆ ~ElementProcessorRegular()
| virtual CP::TreeBranchHelpers::ElementProcessorRegular::~ElementProcessorRegular |
( |
| ) |
|
|
virtualdefault |
◆ ElementProcessorRegular() [2/2]
◆ addBranch() [1/2]
| StatusCode CP::TreeBranchHelpers::ElementProcessorRegular::addBranch |
( |
ROOT::RNTupleModel & | model, |
|
|
const BranchConfig & | branchConfig, |
|
|
OutputBranchData & | outputData ) |
|
overridevirtual |
◆ addBranch() [2/2]
| StatusCode CP::TreeBranchHelpers::ElementProcessorRegular::addBranch |
( |
TTree & | tree, |
|
|
const BranchConfig & | branchConfig, |
|
|
OutputBranchData & | outputData ) |
|
overridevirtual |
Add one branch to the output tree.
This function is used during the setup of the output tree to create one branch in it, from one specific auxiliary variable. The type of the variable is figured out at runtime using the auxiliary store infrastructure.
- Parameters
-
| tree | The tree to create the branch in |
| auxName | Name of the auxiliary variable to create the branch from |
| branchName | The name of the branch to create in the tree |
| allowMissing | Set to true to print an error message in case of a failure |
| created | Used to store if the branch was actually created |
- Returns
- The usual
StatusCode values
Implements CP::TreeBranchHelpers::IObjectProcessor.
Definition at line 859 of file TreeBranchHelpers.cxx.
860 {
861
862
863 m_branches.emplace_back(std::make_unique<ElementBranchProcessor>());
865
866
867 return StatusCode::SUCCESS;
868 }
#define ATH_CHECK
Evaluate an expression and check for errors.
MsgStream & msg() const
The standard message stream.
std::vector< std::unique_ptr< ElementBranchProcessor > > m_branches
List of branch processors set up for this xAOD object.
◆ initMessaging()
| void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
40{
42
43 if (
m_lvl == MSG::NIL) {
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)
◆ msg() [1/2]
| MsgStream & asg::AsgMessaging::msg |
( |
| ) |
const |
|
inherited |
The standard message stream.
- Returns
- A reference to the default message stream of this object.
Definition at line 49 of file AsgMessaging.cxx.
49 {
50#ifndef XAOD_STANDALONE
51 return ::AthMessaging::msg();
52#else
53 return m_msg;
54#endif
55 }
◆ msg() [2/2]
| MsgStream & asg::AsgMessaging::msg |
( |
const MSG::Level | lvl | ) |
const |
|
inherited |
The standard message stream.
- Parameters
-
| lvl | The message level to set the stream to |
- Returns
- A reference to the default message stream, set to level "lvl"
Definition at line 57 of file AsgMessaging.cxx.
57 {
58#ifndef XAOD_STANDALONE
59 return ::AthMessaging::msg( lvl );
60#else
61 m_msg << lvl;
62 return m_msg;
63#endif
64 }
◆ msgLvl()
| bool asg::AsgMessaging::msgLvl |
( |
const MSG::Level | lvl | ) |
const |
|
inherited |
Test the output level of the object.
- Parameters
-
| lvl | The message level to test against |
- Returns
- boolean Indicting if messages at given level will be printed
-
true If messages at level "lvl" will be printed
Definition at line 41 of file AsgMessaging.cxx.
41 {
42#ifndef XAOD_STANDALONE
43 return ::AthMessaging::msgLvl( lvl );
44#else
45 return m_msg.msgLevel( lvl );
46#endif
47 }
◆ operator=()
◆ retrieveProcess()
| StatusCode CP::TreeBranchHelpers::ElementProcessorRegular::retrieveProcess |
( |
StoreType & | evtStore | ) |
|
|
overridevirtual |
retrieve and process the object
Implements CP::TreeBranchHelpers::IObjectProcessor.
Definition at line 835 of file TreeBranchHelpers.cxx.
836 {
837
838
839 static const bool ALLOW_MISSING = false;
840 const SG::AuxElement*
el = getElement(
m_sgName,
841 evtStore,
842 ALLOW_MISSING,
msg() );
843 if( ! el ) {
845 << "\"" );
846 return StatusCode::FAILURE;
847 }
848 const SG::AuxElement& element = *
el;
849
850
853 }
854
855
856 return StatusCode::SUCCESS;
857 }
MsgStream & msg() const
The standard message stream.
◆ setLevel()
| void AthMessaging::setLevel |
( |
MSG::Level | lvl | ) |
|
|
inherited |
◆ ATLAS_THREAD_SAFE
| std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_branches
| std::vector<std::unique_ptr<ElementBranchProcessor> > CP::TreeBranchHelpers::ElementProcessorRegular::m_branches |
|
private |
List of branch processors set up for this xAOD object.
Note that when we set up a branch, we tell TTree to remember a physical address in memory. To make sure that the address of the object held by the branch processors are not moved in memory after their construction, we have to use an std::list container here. std::vector would not work. (As it can relocate objects when increasing the size of the container.)
Definition at line 389 of file TreeBranchHelpers.h.
◆ m_imsg
| std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
| std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_msg_tls
| boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nm
| std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_sgName
| std::string CP::TreeBranchHelpers::ElementProcessorRegular::m_sgName |
|
private |
The documentation for this class was generated from the following files: