17#include <unordered_map>
18#include <unordered_set>
25#include "TClassEdit.h"
32#include "GaudiKernel/FileIncident.h"
33#include "GaudiKernel/IIoComponentMgr.h"
34#include "GaudiKernel/ISvcLocator.h"
35#include "GaudiKernel/ITHistSvc.h"
36#include "GaudiKernel/MsgStream.h"
37#include "GaudiKernel/StatusCode.h"
38#include "GaudiKernel/System.h"
53#include "AthenaRootComps/TransferTree.h"
56#include "EventInfo/EventInfo.h"
72 root_typename(
const std::string& root_type_name)
74 static const std::unordered_map<std::string,std::string>
s = {
75 {
"Int_t", System::typeinfoName(
typeid(Int_t))},
76 {
"UInt_t", System::typeinfoName(
typeid(UInt_t))},
78 {
"Long_t", System::typeinfoName(
typeid(Long_t))},
79 {
"ULong_t", System::typeinfoName(
typeid(ULong_t))},
81 {
"Long64_t", System::typeinfoName(
typeid(Long64_t))},
82 {
"ULong64_t", System::typeinfoName(
typeid(ULong64_t))},
84 {
"Float_t", System::typeinfoName(
typeid(Float_t))},
85 {
"Float16_t", System::typeinfoName(
typeid(Float16_t))},
86 {
"Double_t", System::typeinfoName(
typeid(Double_t))},
87 {
"Double32_t", System::typeinfoName(
typeid(Double32_t))},
89 {
"Bool_t", System::typeinfoName(
typeid(Bool_t))},
90 {
"Char_t", System::typeinfoName(
typeid(Char_t))},
91 {
"UChar_t", System::typeinfoName(
typeid(UChar_t))},
93 {
"Short_t", System::typeinfoName(
typeid(Short_t))},
94 {
"UShort_t", System::typeinfoName(
typeid(UShort_t))}
97 return s.at(root_type_name);
101 std::vector<std::string>
102 get_active_leaves(TTree *tuple)
104 std::vector<std::string>
active;
105 TObjArray *leaves = tuple->GetListOfLeaves();
108 for (Int_t i = 0;
i < leaves->GetEntries(); ++
i) {
109 TLeaf *leaf = (TLeaf *)leaves->At(i);
110 TBranch *branch = leaf->GetBranch();
112 const char *brname = branch->GetName();
113 if (tuple->GetBranchStatus(brname)) {
114 active.push_back(std::string(brname));
131 public ::IEvtSelector::Context
165 {
return m_evtsel->m_inputCollectionsName.value(); }
203 if (cur &&
tree != cur) {
204 TFile *old_file = cur->GetCurrentFile();
224 ISvcLocator* svcLoc ) :
225 extends ( name, svcLoc ),
226 m_dataStore(
"StoreGateSvc/StoreGateSvc", name ),
227 m_imetaStore(
"StoreGateSvc/InputMetaDataStore", name ),
228 m_ometaStore(
"StoreGateSvc/MetaDataStore", name ),
229 m_clidsvc (
"ClassIDSvc", name ),
230 m_dictsvc (
"AthDictLoaderSvc", name ),
231 m_incsvc (
"IncidentSvc", name ),
238 declareProperty(
"DataStore",
240 "Store where to publish data");
242 declareProperty(
"InputMetaStore",
244 "Store where to publish (input) metadata");
246 declareProperty(
"MetaStore",
248 "Store where to publish (output) metadata");
250 declareProperty(
"InputCollections",
251 m_inputCollectionsName,
252 "List of input (ROOT) file names" );
253 m_inputCollectionsName.declareUpdateHandler
256 declareProperty(
"TupleName",
257 m_tupleName =
"CollectionTree",
258 "Name of the TTree to load/read from input file(s). "
259 "May be a semicolon-separated string to read multiple TTrees.");
261 declareProperty(
"SkipEvents",
263 "Number of events to skip at the beginning" );
265 declareProperty(
"ActiveBranches",
267 "List of branch names to activate" );
277 ATH_MSG_INFO (
"Enter RootNtupleEventSelector initialization...");
280 if ( !m_clidsvc.retrieve().isSuccess() ) {
282 (
"Could not retrieve [" << m_clidsvc.typeAndName() <<
"]");
283 return StatusCode::FAILURE;
287 if ( !m_dictsvc.retrieve().isSuccess() ) {
289 (
"Could not retrieve [" << m_dictsvc.typeAndName() <<
"]");
290 return StatusCode::FAILURE;
295 if ( m_tupleNames.empty() ) {
297 (
"You have to give a TTree name to read from the ROOT files !");
298 return StatusCode::FAILURE;
301 CHECK( m_incsvc.retrieve() );
302 m_incsvc->addListener(
this,IncidentType::BeginEvent,99);
306 const std::size_t nbrInputFiles = m_inputCollectionsName.value().size();
307 if ( nbrInputFiles < 1 ) {
309 (
"You need to give at least 1 input file !!" <<
endmsg
310 <<
"(Got [" << nbrInputFiles <<
"] file instead !)");
311 return StatusCode::FAILURE;
314 (
"Selector configured to read [" << nbrInputFiles <<
"] file(s)..."
316 <<
" TTree [" << m_tupleName.value() <<
"]");
322 if (!iomgr.retrieve().isSuccess()) {
324 return StatusCode::FAILURE;
326 if (!iomgr->io_register(
this).isSuccess()) {
327 ATH_MSG_FATAL(
"Could not register myself with the IoComponentMgr !");
328 return StatusCode::FAILURE;
331 const std::vector<std::string>& incol = m_inputCollectionsName.value();
333 for (std::size_t icol = 0,
imax = incol.size(); icol <
imax; icol++) {
334 if (!iomgr->io_register(
this,
335 IIoComponentMgr::IoMode::READ,
336 incol[icol]).isSuccess()) {
337 ATH_MSG_FATAL(
"could not register [" << incol[icol] <<
"] for output !");
340 ATH_MSG_VERBOSE(
"io_register[" << this->name() <<
"](" << incol[icol] <<
") [ok]");
344 return StatusCode::FAILURE;
349 return StatusCode::FAILURE;
380 std::vector<std::string> propVal;
382 bool foundSvc(
false);
383 for(
const std::string& s : propVal) {
384 if(s==
"Athena::xAODCnvSvc") { foundSvc=
true;
break; }
387 propVal.push_back(
"Athena::NtupleCnvSvc");
388 CHECK( epSvc->setProperty(
"CnvServices", Gaudi::Utils::toString( propVal ) ));
393 CHECK( ppSvc.retrieve() );
394 ppSvc->addProvider(
this );
398 return StatusCode::SUCCESS;
407 return StatusCode::SUCCESS;
415 ATH_MSG_INFO (
"Total events read: " << (m_nbrEvts - m_skipEvts));
424 return StatusCode::SUCCESS;
448 if (
SG::DataProxy* dp = m_dataStore->proxy_exact (cdp->sgkey())) {
449 dp->setAddress (
nullptr);
454 const bool forceRemove =
false;
455 CHECK( m_dataStore->clearStore(forceRemove) );
461 return StatusCode::SUCCESS;
474 ATH_MSG_ERROR (
"Could not dyn-cast to RootNtupleEventContext !!");
475 throw "RootNtupleEventSelector: Unable to get RootNtupleEventContext";
487 const std::string& fname = fnames[fidx];
490 throw "RootNtupleEventSelector: Unable to get tree";
504 return StatusCode::FAILURE;
507 int64_t global_entry = rctx->
entry();
510 int64_t
entry = global_entry;
511 if (
m_collEvts[tupleIdx][collIdx].min_entries < 0) {
513 long coll_idx, tuple_idx;
530 if ( nentries > entry ) {
534 if (
tree->LoadTree(entry) < 0) {
536 (
"Problem loading tree for event [" << m_curEvt <<
"] !!");
537 throw "RootNtupleEventSelector: Problem loading input tree";
543 m_curEvt = global_entry + 1;
546 if (!m_eventNumberVar.value().empty()) {
547 if (TLeaf* leaf =
tree->GetLeaf (m_eventNumberVar.value().c_str())) {
548 leaf->GetBranch()->GetEntry(entry);
552 ATH_MSG_ERROR(
"Cannot find event number variable: " << m_eventNumberVar);
557 if (!m_runNumberVar.value().empty()) {
558 if (TLeaf* leaf =
tree->GetLeaf (m_runNumberVar.value().c_str())) {
559 leaf->GetBranch()->GetEntry(entry);
563 ATH_MSG_ERROR(
"Cannot find run number variable: " << m_runNumberVar);
567 EventIDBase::number_type lbn = EventIDBase::UNDEFNUM;
568 if (!m_lbnVar.value().empty()) {
569 if (TLeaf* leaf =
tree->GetLeaf (m_lbnVar.value().c_str())) {
570 leaf->GetBranch()->GetEntry(entry);
571 lbn = std::abs(leaf->GetValue());
580 EventType* evtType =
new EventType;
582 evtInfo->
event_ID()->set_lumi_block (lbn);
583 if ( !m_dataStore->record( evtInfo,
"TTreeEventInfo" ).isSuccess() ) {
585 delete evtInfo; evtInfo = 0;
586 return StatusCode::FAILURE;
590 auto ei = std::make_unique<xAOD::EventInfo>();
591 auto ei_store = std::make_unique<xAOD::EventAuxInfo>();
592 ei->setStore (ei_store.get());
593 ei->setRunNumber (runNumber);
594 ei->setEventNumber (eventNumber);
595 ei->setLumiBlock (lbn);
597 static const SG::AuxElement::Accessor<std::string> tupleName (
"tupleName");
598 static const SG::AuxElement::Accessor<std::string> collName (
"collectionName");
599 tupleName(*ei) = m_tupleNames[tupleIdx];
600 collName(*ei) = m_inputCollectionsName[collIdx];
602 CHECK( m_dataStore->record (std::move(ei),
"EventInfo") );
603 CHECK( m_dataStore->record (std::move(ei_store),
"EventInfoAux.") );
608 return StatusCode::SUCCESS;
628 if (self()->
seek(ctx, m_curEvt + jump).isSuccess()) {
629 return StatusCode::FAILURE;
637 return next( ctx, -1 );
643 return next( ctx, -jump );
649 ATH_MSG_ERROR (
"............. Last Event Not Implemented .............");
650 return StatusCode::FAILURE;
657 return self()->seek(ctxt, 0);
665 return StatusCode::SUCCESS;
670 IOpaqueAddress*& )
const
673 return StatusCode::SUCCESS;
682 return StatusCode::SUCCESS;
685 return StatusCode::FAILURE;
691 ATH_MSG_ERROR (
"............. resetCriteria Not Implemented .............");
692 return StatusCode::FAILURE;
708 return StatusCode::FAILURE;
715 long coll_idx, tuple_idx;
722 if ((coll_idx == -1 || tuple_idx == -1) && evtnum < m_curEvt) {
727 if (coll_idx == -1 || tuple_idx == -1) {
729 return StatusCode::RECOVERABLE;
732 if (coll_idx !=
static_cast<int>(rctx->
fileIndex()) ||
733 tuple_idx !=
static_cast<int>(rctx->
tupleIndex()))
744 return StatusCode::SUCCESS;
765 if (!iomgr.retrieve().isSuccess()) {
767 return StatusCode::FAILURE;
769 if (!iomgr->io_hasitem(
this)) {
770 ATH_MSG_FATAL(
"IoComponentMgr does not know about myself !");
771 return StatusCode::FAILURE;
773 std::vector<std::string> inputCollections = m_inputCollectionsName.value();
777 imax = m_inputCollectionsName.value().size();
780 std::string &fname = inputCollections[i];
782 if (!iomgr->io_contains(
this, fname)) {
783 ATH_MSG_ERROR(
"IoComponentMgr does not know about [" << fname <<
"] !");
784 return StatusCode::FAILURE;
786 if (!iomgr->io_retrieve(
this, fname).isSuccess()) {
787 ATH_MSG_FATAL(
"Could not retrieve new value for [" << fname <<
"] !");
788 return StatusCode::FAILURE;
793 m_inputCollectionsName = inputCollections;
808 return StatusCode::FAILURE;
812 return StatusCode::SUCCESS;
826 return StatusCode::SUCCESS;
837 return StatusCode::SUCCESS;
843 const EventContext& )
846 if (m_dataStore->proxy_exact (tad->
sgkey())) {
847 return StatusCode::SUCCESS;
849 return StatusCode::FAILURE;
852 return StatusCode::SUCCESS;
874 return(StatusCode::SUCCESS);
879 return StatusCode::FAILURE;
882 TObjArray *leaves =
m_tuple->GetListOfLeaves();
885 return StatusCode::SUCCESS;
889 for (Int_t i = 0; i < leaves->GetEntries(); ++i) {
890 TLeaf *leaf = (TLeaf *)leaves->At(i);
891 TBranch *branch = leaf->GetBranch();
895 const void* value_ptr =
m_tuple;
896 const std::string type_name = leaf->GetTypeName();
897 const std::string br_name = branch->GetName();
898 const std::string sg_key = br_name;
899 TClass *cls = TClass::GetClass(type_name.c_str());
900 const std::type_info *ti = 0;
903 ti = cls->GetTypeInfo();
906 m_dictsvc->load_type(*ti);
913 std::string ti_typename = System::typeinfoName(*ti);
914 if (!m_clidsvc->getIDOfTypeInfoName(ti_typename,
id)
921 R__WRITE_LOCKGUARD(ROOT::gCoreMutex);
922 ti_typename = TClassEdit::ShortType(ti_typename.c_str(),
923 TClassEdit::kDropAllDefault);
925 if (!m_clidsvc->getIDOfTypeInfoName(ti_typename,
id)
928 << System::typeinfoName(*ti) <<
"]");
929 ATH_MSG_DEBUG(
"** could not find a CLID from type-info-alias ["
930 << ti_typename <<
"]");
936 if (!m_clidsvc->getIDOfTypeName(::root_typename(type_name),
id)
939 << type_name <<
"]");
945 << type_name <<
"]");
949 (ROOT_StorageType,
id,
952 (
unsigned long)(value_ptr),
953 (
unsigned long)(m_curEvt-1));
958 proxy->setAddress (addr);
962 taddr->setProvider(
this, storeID);
965 tads.push_back(taddr);
972 return StatusCode::SUCCESS;
978 const std::string& prefix)
const
982 return StatusCode::FAILURE;
987 return StatusCode::FAILURE;
992 if (store->
record(temp,prefix).isFailure())
ATH_MSG_ERROR(
"Unable to record metadata tree " <<
tree->GetName());
994 const std::string tree_name =
tree->GetName();
995 TObjArray *branches =
tree->GetListOfBranches();
998 return StatusCode::SUCCESS;
1002 for (Int_t i = 0; i < branches->GetEntries(); ++i) {
1003 TBranch *branch = (TBranch *)branches->At(i);
1007 const void* value_ptr =
tree;
1008 const std::string type_name = branch->GetClassName();
1009 const std::string br_name = branch->GetName();
1010 const std::string sg_key = prefix.empty()
1012 : prefix +
"/" + br_name;
1014 if (!type_name.empty()) {
1015 cls = TClass::GetClass(type_name.c_str());
1017 const std::type_info *ti = 0;
1020 ti = cls->GetTypeInfo();
1023 m_dictsvc->load_type(*ti);
1030 std::string ti_typename = System::typeinfoName(*ti);
1031 if (!m_clidsvc->getIDOfTypeInfoName(ti_typename,
id)
1038 R__WRITE_LOCKGUARD(ROOT::gCoreMutex);
1039 ti_typename = TClassEdit::ShortType(ti_typename.c_str(),
1040 TClassEdit::kDropAllDefault);
1042 if (!m_clidsvc->getIDOfTypeInfoName(ti_typename,
id)
1044 ATH_MSG_INFO(
"** could not find a CLID from type-info ["
1045 << System::typeinfoName(*ti) <<
"]");
1046 ATH_MSG_INFO(
"** could not find a CLID from type-info-alias ["
1047 << ti_typename <<
"]");
1053 TObjArray *leaves = branch->GetListOfLeaves();
1055 leaves->GetEntries() == 1) {
1056 const std::string type_name = ((TLeaf*)leaves->At(0))->GetTypeName();
1057 if (!m_clidsvc->getIDOfTypeName(::root_typename(type_name),
id)
1059 ATH_MSG_INFO(
"** could not find a CLID for type-name ["
1060 << type_name <<
"]");
1066 ATH_MSG_INFO(
"** could not find a CLID for type-name ["
1067 << type_name <<
"]");
1072 (ROOT_StorageType,
id,
1075 (
unsigned long)(value_ptr),
1076 (
unsigned long)(0)));
1077 if (!store->recordAddress(sg_key, std::move(addr),
true).isSuccess()) {
1078 ATH_MSG_ERROR(
"could not record address at [" << sg_key <<
"] in store ["
1079 << store->
name() <<
"]");
1088 return StatusCode::SUCCESS;
1093 const std::string& tupleName)
const
1099 TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject(fname.c_str());
1100 TFile* fnew =
nullptr;
1102 f = TFile::Open(fname.c_str(),
"READ");
1105 f->SetName(fname.c_str());
1108 if (!f || f->IsZombie()) {
1109 ATH_MSG_ERROR(
"could not open next file in input collection ["
1117 tree = (TTree*)f->Get(tupleName.c_str());
1119 ATH_MSG_ERROR(
"could not retrieve tree [" << tupleName <<
"]"
1120 <<
" from file [" << fname <<
"]");
1130 tree->SetBranchStatus(
"*", 0);
1131 if (!m_eventNumberVar.value().empty()) {
1132 tree->SetBranchStatus(m_eventNumberVar.value().c_str(), 1);
1134 if (!m_runNumberVar.value().empty()) {
1135 tree->SetBranchStatus(m_runNumberVar.value().c_str(), 1);
1137 if (!m_lbnVar.value().empty()) {
1138 tree->SetBranchStatus(m_lbnVar.value().c_str(), 1);
1141 if (!m_imetaStore->clearStore().isSuccess()) {
1142 ATH_MSG_INFO(
"could not clear store [" << m_imetaStore.typeAndName() <<
"]");
1153 TDirectoryFile *metadir = (TDirectoryFile*)fileObj->Get(metadirname.c_str());
1154 if (!metadir)
return;
1160 std::unordered_set<std::string> meta_keys;
1161 const TList *keys = metadir->GetListOfKeys();
1162 for (Int_t i=0; i < keys->GetSize(); ++i) {
1163 TKey* key =
dynamic_cast<TKey*
>(keys->At(i));
1168 const std::string meta_key = key->GetName();
1169 if (!meta_keys.emplace(key->GetName()).second) {
1177 std::string fullPrefix(prefix);
1178 if (prefix !=
"") fullPrefix +=
"/";
1179 const std::string path = fullPrefix + key->GetName();
1181 TString fullKeyName(TString::Format(
"%s;%hi", key->GetName(), key->GetCycle()));
1182 TObject *objRef = metadir->Get(fullKeyName);
1184 TTree *metatree =
dynamic_cast<TTree*
>(objRef);
1190 TObjString *metaObjString =
dynamic_cast<TObjString*
>(objRef);
1191 if (metaObjString) {
1196 ATH_MSG_WARNING(
"Unsupported metadata type: " << objRef->ClassName());
1202 if (metatree->GetEntry(0) < 0) {
1203 ATH_MSG_INFO(
"Problem retrieving data from metadata-tree [" << path <<
"] !!");
1208 ATH_MSG_INFO(
"Could not create metadata for tree [" << path <<
"]");
1214 std::string *converted =
new std::string(metastring->String());
1215 if (!m_imetaStore->record(converted, path).isSuccess()) {
1216 ATH_MSG_INFO(
"Could not create metadata for string [" << path <<
"]");
1228 zero.min_entries = -1;
1229 zero.max_entries = -1;
1232 for (
size_t i = 0; i <
m_collEvts.size(); i++) {
1233 m_collEvts[i].resize(m_inputCollectionsName.value().size(),
zero);
1240 throw "RootNtupleEventSelector: Unable to fetch Ntuple";
1248 m_curEvt = m_skipEvts;
1252 return StatusCode::SUCCESS;
1260RootNtupleEventSelector::find_coll_idx (
int evtidx,
1262 long& tuple_idx)
const
1269 for (
size_t ituple = 0; ituple <
m_collEvts.size(); ++ituple) {
1270 for (
size_t icoll = 0; icoll <
m_collEvts[ituple].size(); ++icoll) {
1271 CollMetaData &itr =
m_collEvts[ituple][icoll];
1272 if (itr.min_entries == -1) {
1274 m_tupleNames[ituple]);
1278 offset =
m_collEvts[ituple][icoll-1].max_entries;
1280 else if (ituple > 0) {
1281 offset =
m_collEvts[ituple-1].back().max_entries;
1283 itr.entries =
tree->GetEntriesFast();
1284 itr.min_entries =
offset;
1285 itr.max_entries =
offset + itr.entries;
1287 throw "RootNtupleEventSelector: Unable to fetch ntuple";
1293 if (itr.min_entries <= evtidx && evtidx < itr.max_entries) {
1305 long coll_idx, tuple_idx;
1312 if (
m_fireBIF && incident.type() == IncidentType::BeginEvent) {
1313 std::string fname =
m_tuple->GetCurrentFile()->GetName();
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
#define CHECK(...)
Evaluate an expression and check for errors.
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
This class provides general information about an event.
uint32_t CLID
The Class ID type.
size_t size() const
Number of registered mappings.
Include TBranchElement.h, suppressing clang warnings.
A simple class to hold the buffer of a TBranch from a TTree.
state of a few global resources from ROOT and restores their initial value upon d-tor call.
ROOT specific event selector context.
virtual void * identifier() const
context identifier
std::string m_fid
connection FID
long m_tupleIdx
current tuple index (into `m_tupleNames')
void setTree(TTree *tree)
set the tree used to iterate
std::size_t fileIndex() const
access to the file iterator
std::size_t tupleIndex() const
std::vector< std::string > FileNames_t
definition of the file container
const std::string & fid() const
access to the connection FID
virtual ~RootNtupleEventContext()
standard d-tor
void setFileIndex(std::size_t idx)
set file iterator
long m_collIdx
current collection index (into m_inputCollectionsName)
const FileNames_t & files() const
int64_t entry() const
access to the current event entry number
const RootNtupleEventSelector * m_evtsel
reference to the hosting event selector instance
TTree * tree() const
access to the tree used to iterate
void setTupleIndex(std::size_t idx)
void setFID(const std::string &fid)
set connection FID
RootNtupleEventContext(const RootNtupleEventSelector *sel)
standard c-tor with initialization
Class implementing the GAUDI IEvtSelector interface using ROOT TTree as a backend.
virtual StatusCode seek(Context &refCtxt, int evtnum) const override
Seek to a given event number.
virtual ~RootNtupleEventSelector()
Destructor:
virtual StatusCode finalize() override
virtual int size(Context &refCtxt) const override
ICollectionSize interface
RootNtupleEventSelector(const std::string &name, ISvcLocator *svcLoc)
Constructor with parameters:
virtual StatusCode releaseContext(Context *&refCtxt) const override
virtual int curEvent(const Context &refCtxt) const override
return the current event number.
void setupInputCollection(Gaudi::Details::PropertyBase &inputCollectionsName)
callback to synchronize the list of input files
virtual StatusCode loadAddresses(StoreID::type storeID, tadList &list) override
get all new addresses from Provider for this Event.
virtual StatusCode last(Context &refContext) const override
virtual StatusCode resetCriteria(const std::string &cr, Context &ctx) const override
virtual StatusCode preLoadAddresses(StoreID::type storeID, tadList &list) override
TTree * m_tuple
current tree being read
std::vector< std::vector< CollMetaData > > m_collEvts
helper method to get the collection index (into m_inputCollectionsName) and tuple index (into m_tuple...
bool m_needReload
The (python) selection function to apply on the TChain we are reading.
virtual StatusCode updateAddress(StoreID::type storeID, SG::TransientAddress *tad, const EventContext &ctx) override
update a transient Address
std::vector< TFile * > m_files
virtual StatusCode next(Context &refCtxt) const override
StatusCode endInputFile(RootNtupleEventContext *rctx) const
StatusCode do_init_io()
helper method to init the i/o components
StatusCode createMetaDataRootBranchAddresses(StoreGateSvc *store, TTree *tree, const std::string &prefix) const
helper method to create proxies for the metadata store
bool m_fireBIF
Flag to fire BeginInputFile on the next BeginEvent incident.
friend class Athena::RootNtupleEventContext
void addMetadataFromDirectoryName(const std::string &metadirname, TFile *fileObj, const std::string &prefix="") const
virtual StatusCode createContext(Context *&refpCtxt) const override
std::optional< InputFileIncidentGuard > m_inputFileGuard
RAII guard: guarantees a matching EndInputFile for every BeginInputFile.
void addMetadataFromDirectory(TDirectoryFile *metadir, const std::string &prefix="") const
void addMetadata(TTree *metatree, const std::string &path="") const
TTree * fetchNtuple(const std::string &fname, const std::string &tupleName) const
helper method to retrieve the correct tuple
virtual void handle(const Incident &incident) override
StatusCode createRootBranchAddresses(StoreID::type storeID, tadList &tads)
helper method to create proxies
virtual StatusCode initialize() override
virtual StatusCode previous(Context &refCtxt) const override
virtual StatusCode stop() override
virtual StatusCode io_reinit() override
Callback method to reinitialize the internal state of the component for I/O purposes (e....
virtual StatusCode rewind(Context &refCtxt) const override
virtual StatusCode createAddress(const Context &refCtxt, IOpaqueAddress *&) const override
Simple smart pointer for Gaudi-style refcounted objects.
EventID * event_ID()
the unique identification of the event.
void record(const T *p, const std::string &key)
virtual const std::string & name() const override
sgkey_t sgkey() const
Set the primary (hashed) SG key.
The Athena Transient Store API.
void zero(TH2 *h)
zero the contents of a 2d histogram
std::vector< std::string > files
file names and file pointers
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
RootNtupleEventContext::FileNames_t FileNames_t
find_coll_idx(-1, coll_idx, tuple_idx)
StatusCode ROOTMessageFilterSvc::initialize ATLAS_NOT_THREAD_SAFE()
Return the file descriptor fataldump() uses for output.
std::vector< std::string > tokenize(std::string_view the_str, std::string_view delimiters)
Splits the string into smaller substrings.
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
EventInfo_v1 EventInfo
Definition of the latest event info version.