 |
ATLAS Offline Software
|
#include <TBranchAuxDynWriter.h>
|
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 51 of file TBranchAuxDynWriter.h.
◆ TBranchAuxDynWriter()
RootAuxDynIO::TBranchAuxDynWriter::TBranchAuxDynWriter |
( |
TTree & |
tree, |
|
|
TClass & |
cls, |
|
|
int |
bufferSize, |
|
|
int |
splitLevel, |
|
|
int |
offsettab_len, |
|
|
bool |
branch_fill |
|
) |
| |
◆ ~TBranchAuxDynWriter()
virtual RootAuxDynIO::TBranchAuxDynWriter::~TBranchAuxDynWriter |
( |
| ) |
|
|
inlinevirtual |
◆ auxStoreOffset()
int RootAuxDynIO::AuxDynAttrAccess::auxStoreOffset |
( |
TClass & |
tc | ) |
|
|
protectedinherited |
Definition at line 29 of file RootAuxDynIO.cxx.
31 TClass *storeTClass =
tc.GetBaseClass(
"SG::IAuxStoreIO");
35 return tc.GetBaseClassOffset( storeTClass );
◆ castIOStore()
SG::IAuxStoreIO * RootAuxDynIO::AuxDynAttrAccess::castIOStore |
( |
void * |
object | ) |
|
|
protectedinherited |
◆ commit()
int RootAuxDynIO::TBranchAuxDynWriter::commit |
( |
| ) |
|
|
finaloverridevirtual |
◆ createAuxBranch()
void RootAuxDynIO::TBranchAuxDynWriter::createAuxBranch |
( |
AuxInfo & |
info | ) |
|
Definition at line 68 of file TBranchAuxDynWriter.cxx.
69 std::string error_type(
"is unknown");
70 const std::type_info& ti = *
info.typeinfo;
72 auto createBasicAuxBranch = [&](
const char* typeopt) {
73 info.is_basic_type =
true;
77 if ( ti ==
typeid(UInt_t) ) createBasicAuxBranch(
"/i");
78 else if( ti ==
typeid(Int_t) ) createBasicAuxBranch(
"/I");
79 else if( ti ==
typeid(Double_t) ) createBasicAuxBranch(
"/D");
80 else if( ti ==
typeid(Float_t) ) createBasicAuxBranch(
"/F");
81 else if( ti ==
typeid(Long64_t) or ti ==
typeid(std::int64_t) ) createBasicAuxBranch(
"/L");
82 else if( ti ==
typeid(ULong64_t) or ti ==
typeid(
std::uint64_t) ) createBasicAuxBranch(
"/l");
83 else if( ti ==
typeid(Short_t) ) createBasicAuxBranch(
"/S");
84 else if( ti ==
typeid(UShort_t) ) createBasicAuxBranch(
"/s");
85 else if( ti ==
typeid(Char_t) ) createBasicAuxBranch(
"/B");
86 else if( ti ==
typeid(UChar_t) ) createBasicAuxBranch(
"/b");
87 else if( ti ==
typeid(
bool) ) createBasicAuxBranch(
"/O");
88 else if( ti ==
typeid(
char*) || ti ==
typeid(
unsigned char*) ) createBasicAuxBranch(
"/C");
90 TClass*
cl = TClass::GetClass(
info.type_name.c_str());
92 error_type =
" has no TClass";
93 }
else if( !
cl->GetStreamerInfo() ) {
94 error_type =
" has no streamer";
95 }
else if( !
cl->HasDictionary() ) {
96 error_type =
" has no dictionary";
109 error_type += std::string(
" Exception msg: ") +
e.what();
112 error_type +=
" Unknown exception.";
116 throw std::runtime_error( std::string(
"Failed to create Auxiliary branch '") +
info.branch_name
117 +
"'. Class: " +
info.type_name + error_type );
120 info.branch->SetAutoDelete(kFALSE);
◆ hasAuxDynStore()
bool RootAuxDynIO::AuxDynAttrAccess::hasAuxDynStore |
( |
| ) |
const |
|
inherited |
◆ 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.
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
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.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
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.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ needsCommit()
virtual bool RootAuxDynIO::TBranchAuxDynWriter::needsCommit |
( |
| ) |
|
|
inlinefinaloverridevirtual |
◆ setBranchFillMode()
virtual void RootAuxDynIO::TBranchAuxDynWriter::setBranchFillMode |
( |
bool |
mode | ) |
|
|
inlinefinaloverridevirtual |
◆ setBranchOffsetTabLen()
void RootAuxDynIO::TBranchAuxDynWriter::setBranchOffsetTabLen |
( |
TBranch * |
b, |
|
|
int |
offsettab_len |
|
) |
| |
Definition at line 54 of file TBranchAuxDynWriter.cxx.
55 if( offsettab_len > 0 ) {
56 if(
b->GetEntryOffsetLen() > 0 )
57 b->SetEntryOffsetLen( offsettab_len );
58 TIter biter(
b->GetListOfBranches() );
59 TBranch* subbranch(
nullptr);
60 while( (subbranch = (TBranch*)biter.Next()) ) {
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ writeAuxAttributes()
int RootAuxDynIO::TBranchAuxDynWriter::writeAuxAttributes |
( |
const std::string & |
base_branchname, |
|
|
void * |
store, |
|
|
size_t |
backfill_nrows |
|
) |
| |
|
finaloverridevirtual |
handle writing of dynamic xAOD attributes of an object called from RootTreeContainer::writeObject()
handle writing of dynamic xAOD attributes of an object - called from RootTreeContainer::writeObject()
Implements RootAuxDynIO::IRootAuxDynWriter.
Definition at line 128 of file TBranchAuxDynWriter.cxx.
133 int bytes_written = 0;
138 for(
auto& aux_info_entry :
m_auxInfoMap ) aux_info_entry.second.written =
false;
143 if( !attrInfo.branch ) {
145 attrInfo.typeinfo =
store->getIOType(
id);
150 ATH_MSG_DEBUG(
"Creating branch for new dynamic attribute, Id=" <<
id <<
": type=" << attrInfo.type_name
151 <<
", branch=" << attrInfo.branch_name );
154 if( backfill_nrows ) {
156 ATH_MSG_DEBUG(
" Backfilling " << backfill_nrows <<
" entries for " << attrInfo.name);
160 attrInfo.setDummyAddr();
161 for(
size_t r=0;
r<backfill_nrows; ++
r ) {
162 bytes_written += attrInfo.branch->BackFill();
164 " Tree size=" <<
m_ttree->GetEntries()
165 <<
" branch size:" << attrInfo.branch->GetEntries() );
170 attrInfo.object =
obj;
171 attrInfo.branch->SetAddress( attrInfo.objectAddr() );
172 attrInfo.written =
true;
176 AuxInfo& attrInfo = aux_info_entry.second;
178 if( !attrInfo.written ) {
179 attrInfo.setDummyAddr();
180 ATH_MSG_DEBUG(
"Default object added to branch: " << attrInfo.branch_name);
184 bytes_written += attrInfo.branch->Fill();
189 return bytes_written;
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_auxInfoMap
◆ m_branchFillMode
bool RootAuxDynIO::TBranchAuxDynWriter::m_branchFillMode = false |
|
protected |
◆ m_branchOffsetTabLen
int RootAuxDynIO::TBranchAuxDynWriter::m_branchOffsetTabLen = 0 |
|
protected |
◆ m_bufferSize
int RootAuxDynIO::TBranchAuxDynWriter::m_bufferSize = 8192 |
|
protected |
◆ m_holderType
TClass& RootAuxDynIO::AuxDynAttrAccess::m_holderType |
|
protectedinherited |
TClass of the type containing the AuxStore with attributes.
Definition at line 30 of file RootAuxDynIO.h.
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_ioStoreOffset
int RootAuxDynIO::AuxDynAttrAccess::m_ioStoreOffset |
|
protectedinherited |
AuxStoreIO interface offset in the subclass type (for casting). negative means no inheritance.
Definition at line 32 of file RootAuxDynIO.h.
◆ 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_needsFill
bool RootAuxDynIO::TBranchAuxDynWriter::m_needsFill = false |
|
protected |
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_splitLevel
int RootAuxDynIO::TBranchAuxDynWriter::m_splitLevel = 1 |
|
protected |
◆ m_tfile
TFile* RootAuxDynIO::TBranchAuxDynWriter::m_tfile = nullptr |
|
protected |
◆ m_ttree
TTree* RootAuxDynIO::TBranchAuxDynWriter::m_ttree = nullptr |
|
protected |
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
void createAuxBranch(AuxInfo &info)
static AuxTypeRegistry & instance()
Return the singleton registry instance.
std::string normalizedTypeinfoName(const std::type_info &info)
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
#define ATH_MSG_VERBOSE(x)
std::string auxBranchName(const std::string &attr_name, const std::string &baseBranchName)
Construct branch name for a given dynamic attribute.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
IMessageSvc * getMessageSvc(bool quiet=false)
void setBranchOffsetTabLen(TBranch *b, int offsettab_len)
Interface providing I/O for a generic auxiliary store.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE
Messaging initialized (initMessaging)
AthMessaging()
Default constructor:
size_t auxid_t
Identifier for a particular aux data item.
MsgStream & msg() const
The standard message stream.
int m_ioStoreOffset
AuxStoreIO interface offset in the subclass type (for casting). negative means no inheritance.
SG::IAuxStoreIO * castIOStore(void *object)
const std::string selection
bool hasAuxDynStore() const
#define ATH_MSG_WARNING(x)
std::string m_nm
Message source name.
A set of aux data identifiers.
AuxDynAttrAccess(TClass &tc)
void initMessaging() const
Initialize our message level and MessageSvc.
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
std::map< SG::auxid_t, AuxInfo > m_auxInfoMap
cached aux branches data by auxid