|
ATLAS Offline Software
|
Class implementing the GAUDI IEvtSelector
interface using ROOT TTree
as a backend.
More...
#include <RootNtupleEventSelector.h>
|
| RootNtupleEventSelector (const std::string &name, ISvcLocator *svcLoc) |
| Constructor with parameters: More...
|
|
virtual | ~RootNtupleEventSelector () |
| Destructor: More...
|
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | finalize () override |
|
virtual void | handle (const Incident &incident) override |
|
virtual StatusCode | io_reinit () override |
| Callback method to reinitialize the internal state of the component for I/O purposes (e.g. More...
|
|
virtual int | size (Context &refCtxt) const override |
| ICollectionSize interface More...
|
|
|
virtual StatusCode | createContext (Context *&refpCtxt) const override |
|
virtual StatusCode | last (Context &refContext) const override |
|
virtual StatusCode | next (Context &refCtxt) const override |
|
virtual StatusCode | next (Context &refCtxt, int jump) const override |
|
virtual StatusCode | previous (Context &refCtxt) const override |
|
virtual StatusCode | previous (Context &refCtxt, int jump) const override |
|
virtual StatusCode | rewind (Context &refCtxt) const override |
|
virtual StatusCode | createAddress (const Context &refCtxt, IOpaqueAddress *&) const override |
|
virtual StatusCode | releaseContext (Context *&refCtxt) const override |
|
virtual StatusCode | resetCriteria (const std::string &cr, Context &ctx) const override |
|
|
virtual StatusCode | seek (Context &refCtxt, int evtnum) const override |
| Seek to a given event number. More...
|
|
virtual int | curEvent (const Context &refCtxt) const override |
| return the current event number. More...
|
|
|
virtual StatusCode | preLoadAddresses (StoreID::type storeID, tadList &list) override |
|
virtual StatusCode | loadAddresses (StoreID::type storeID, tadList &list) override |
| get all new addresses from Provider for this Event. More...
|
|
virtual StatusCode | updateAddress (StoreID::type storeID, SG::TransientAddress *tad, const EventContext &ctx) override |
| update a transient Address More...
|
|
|
StatusCode | endInputFile (RootNtupleEventContext *rctx) const |
|
void | setupInputCollection (Gaudi::Details::PropertyBase &inputCollectionsName) |
| callback to synchronize the list of input files More...
|
|
StatusCode | createRootBranchAddresses (StoreID::type storeID, tadList &tads) |
| helper method to create proxies More...
|
|
TTree * | fetchNtuple (const std::string &fname, const std::string &tupleName) const |
| helper method to retrieve the correct tuple More...
|
|
void | addMetadataFromDirectoryName (const std::string &metadirname, TFile *fileObj, const std::string &prefix="") const |
|
void | addMetadataFromDirectory (TDirectoryFile *metadir, const std::string &prefix="") const |
|
void | addMetadata (TTree *metatree, const std::string &path="") const |
|
void | addMetadata (TObjString *metastring, const std::string &path="") const |
|
StatusCode | createMetaDataRootBranchAddresses (StoreGateSvc *store, TTree *tree, const std::string &prefix) const |
| helper method to create proxies for the metadata store More...
|
|
StatusCode | do_init_io () |
| helper method to init the i/o components More...
|
|
void | find_coll_idx (int evtidx, long &coll_idx, long &tuple_idx) const |
| helper method to get the collection index (into m_inputCollectionsName ) and tuple index (into ‘m_tupleNames’) for a given event index evtidx . More...
|
|
RootNtupleEventSelector * | self () const |
| non-const access to self (b/c next() is const) More...
|
|
Class implementing the GAUDI IEvtSelector
interface using ROOT TTree
as a backend.
Definition at line 45 of file RootNtupleEventSelector.h.
◆ ICLIDSvc_t
◆ IDictSvc_t
◆ IIncSvc_t
◆ StoreGateSvc_t
◆ RootNtupleEventSelector()
Athena::RootNtupleEventSelector::RootNtupleEventSelector |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
svcLoc |
|
) |
| |
Constructor with parameters:
Definition at line 222 of file RootNtupleEventSelector.cxx.
224 extends (
name, svcLoc ),
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",
252 "List of input (ROOT) file names" );
256 declareProperty(
"TupleName",
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" );
◆ ~RootNtupleEventSelector()
Athena::RootNtupleEventSelector::~RootNtupleEventSelector |
( |
| ) |
|
|
virtual |
◆ addMetadata() [1/2]
void Athena::RootNtupleEventSelector::addMetadata |
( |
TObjString * |
metastring, |
|
|
const std::string & |
path = "" |
|
) |
| const |
|
private |
◆ addMetadata() [2/2]
void Athena::RootNtupleEventSelector::addMetadata |
( |
TTree * |
metatree, |
|
|
const std::string & |
path = "" |
|
) |
| const |
|
private |
◆ addMetadataFromDirectory()
void Athena::RootNtupleEventSelector::addMetadataFromDirectory |
( |
TDirectoryFile * |
metadir, |
|
|
const std::string & |
prefix = "" |
|
) |
| const |
|
private |
Definition at line 1125 of file RootNtupleEventSelector.cxx.
1127 std::unordered_set<std::string> meta_keys;
1128 const TList *
keys = metadir->GetListOfKeys();
1129 for (Int_t
i=0;
i <
keys->GetSize(); ++
i) {
1130 TKey*
key =
dynamic_cast<TKey*
>(
keys->At(
i));
1135 const std::string meta_key =
key->GetName();
1136 if (meta_keys.find(meta_key) != meta_keys.end()) {
1142 meta_keys.insert(meta_key);
1145 std::string fullPrefix(
prefix);
1146 if (
prefix !=
"") fullPrefix +=
"/";
1147 const std::string
path = fullPrefix +
key->GetName();
1150 TObject *objRef = metadir->Get(fullKeyName);
1152 TTree *metatree =
dynamic_cast<TTree*
>(objRef);
1158 TObjString *metaObjString =
dynamic_cast<TObjString*
>(objRef);
1159 if (metaObjString) {
1164 ATH_MSG_WARNING(
"Unsupported metadata type: " << objRef->ClassName());
◆ addMetadataFromDirectoryName()
void Athena::RootNtupleEventSelector::addMetadataFromDirectoryName |
( |
const std::string & |
metadirname, |
|
|
TFile * |
fileObj, |
|
|
const std::string & |
prefix = "" |
|
) |
| const |
|
private |
Definition at line 1118 of file RootNtupleEventSelector.cxx.
1120 TDirectoryFile *metadir = (TDirectoryFile*)fileObj->Get(metadirname.c_str());
1121 if (!metadir)
return;
◆ createAddress()
StatusCode Athena::RootNtupleEventSelector::createAddress |
( |
const Context & |
refCtxt, |
|
|
IOpaqueAddress *& |
|
|
) |
| const |
|
overridevirtual |
◆ createContext()
StatusCode Athena::RootNtupleEventSelector::createContext |
( |
Context *& |
refpCtxt | ) |
const |
|
overridevirtual |
IEvtSelector
interface
Definition at line 631 of file RootNtupleEventSelector.cxx.
633 RootNtupleEventContext *ctx =
new RootNtupleEventContext(
this);
635 return StatusCode::SUCCESS;
◆ createMetaDataRootBranchAddresses()
StatusCode Athena::RootNtupleEventSelector::createMetaDataRootBranchAddresses |
( |
StoreGateSvc * |
store, |
|
|
TTree * |
tree, |
|
|
const std::string & |
prefix |
|
) |
| const |
|
private |
helper method to create proxies for the metadata store
Definition at line 952 of file RootNtupleEventSelector.cxx.
958 return StatusCode::FAILURE;
963 return StatusCode::FAILURE;
970 const std::string tree_name =
tree->GetName();
974 return StatusCode::SUCCESS;
978 for (Int_t
i = 0;
i <
branches->GetEntries(); ++
i) {
983 const void* value_ptr =
tree;
984 const std::string type_name =
branch->GetClassName();
985 const std::string br_name =
branch->GetName();
986 const std::string sg_key =
prefix.empty()
990 if (!type_name.empty()) {
991 cls = TClass::GetClass(type_name.c_str());
993 const std::type_info *ti = 0;
996 ti =
cls->GetTypeInfo();
1007 if (!
m_clidsvc->getIDOfTypeInfoName(ti_typename,
id)
1014 R__WRITE_LOCKGUARD(ROOT::gCoreMutex);
1015 ti_typename = TClassEdit::ShortType(ti_typename.c_str(),
1016 TClassEdit::kDropAllDefault);
1018 if (!
m_clidsvc->getIDOfTypeInfoName(ti_typename,
id)
1020 ATH_MSG_INFO(
"** could not find a CLID from type-info ["
1022 ATH_MSG_INFO(
"** could not find a CLID from type-info-alias ["
1023 << ti_typename <<
"]");
1029 TObjArray *leaves =
branch->GetListOfLeaves();
1031 leaves->GetEntries() == 1) {
1032 const std::string type_name = ((TLeaf*)leaves->At(0))->GetTypeName();
1033 if (!
m_clidsvc->getIDOfTypeName(::root_typename(type_name),
id)
1035 ATH_MSG_INFO(
"** could not find a CLID for type-name ["
1036 << type_name <<
"]");
1042 ATH_MSG_INFO(
"** could not find a CLID for type-name ["
1043 << type_name <<
"]");
1047 (ROOT_StorageType,
id,
1050 (
unsigned long)(value_ptr),
1051 (
unsigned long)(0));
1052 if (!
store->recordAddress(sg_key, addr,
true).isSuccess()) {
1053 ATH_MSG_ERROR(
"could not record address at [" << sg_key <<
"] in store ["
1055 delete addr; addr = 0;
1064 return StatusCode::SUCCESS;
◆ createRootBranchAddresses()
StatusCode Athena::RootNtupleEventSelector::createRootBranchAddresses |
( |
StoreID::type |
storeID, |
|
|
tadList & |
tads |
|
) |
| |
|
private |
helper method to create proxies
Definition at line 839 of file RootNtupleEventSelector.cxx.
844 return(StatusCode::SUCCESS);
849 return StatusCode::FAILURE;
852 TObjArray *leaves =
m_tuple->GetListOfLeaves();
855 return StatusCode::SUCCESS;
859 for (Int_t
i = 0;
i < leaves->GetEntries(); ++
i) {
860 TLeaf *leaf = (TLeaf *)leaves->At(
i);
861 TBranch *
branch = leaf->GetBranch();
865 const void* value_ptr =
m_tuple;
866 const std::string type_name = leaf->GetTypeName();
867 const std::string br_name =
branch->GetName();
868 const std::string sg_key = br_name;
869 TClass *
cls = TClass::GetClass(type_name.c_str());
870 const std::type_info *ti = 0;
873 ti =
cls->GetTypeInfo();
884 if (!
m_clidsvc->getIDOfTypeInfoName(ti_typename,
id)
891 R__WRITE_LOCKGUARD(ROOT::gCoreMutex);
892 ti_typename = TClassEdit::ShortType(ti_typename.c_str(),
893 TClassEdit::kDropAllDefault);
895 if (!
m_clidsvc->getIDOfTypeInfoName(ti_typename,
id)
899 ATH_MSG_DEBUG(
"** could not find a CLID from type-info-alias ["
900 << ti_typename <<
"]");
906 if (!
m_clidsvc->getIDOfTypeName(::root_typename(type_name),
id)
909 << type_name <<
"]");
915 << type_name <<
"]");
919 (ROOT_StorageType,
id,
922 (
unsigned long)(value_ptr),
928 proxy->setAddress (addr);
932 taddr->setProvider(
this, storeID);
935 tads.push_back(taddr);
948 return StatusCode::SUCCESS;
◆ curEvent()
int Athena::RootNtupleEventSelector::curEvent |
( |
const Context & |
refCtxt | ) |
const |
|
overridevirtual |
◆ do_init_io()
StatusCode Athena::RootNtupleEventSelector::do_init_io |
( |
| ) |
|
|
private |
helper method to init the i/o components
Definition at line 1189 of file RootNtupleEventSelector.cxx.
1196 zero.min_entries = -1;
1197 zero.max_entries = -1;
1208 throw "RootNtupleEventSelector: Unable to fetch Ntuple";
1220 return StatusCode::SUCCESS;
◆ endInputFile()
Definition at line 426 of file RootNtupleEventSelector.cxx.
429 std::size_t fidx = rctx->fileIndex();
430 m_incsvc->fireIncident(FileIncident(
name(),
"EndInputFile", fnames[fidx]));
445 dp->setAddress (
nullptr);
450 const bool forceRemove =
false;
454 return StatusCode::SUCCESS;
◆ fetchNtuple()
TTree * Athena::RootNtupleEventSelector::fetchNtuple |
( |
const std::string & |
fname, |
|
|
const std::string & |
tupleName |
|
) |
| const |
|
private |
helper method to retrieve the correct tuple
Definition at line 1068 of file RootNtupleEventSelector.cxx.
1073 RootGlobalsRestore rgr;
1075 TFile *
f = (TFile*)gROOT->GetListOfFiles()->FindObject(
fname.c_str());
1076 TFile* fnew =
nullptr;
1078 f = TFile::Open(
fname.c_str(),
"READ");
1081 f->SetName(
fname.c_str());
1084 if (!
f ||
f->IsZombie()) {
1085 ATH_MSG_ERROR(
"could not open next file in input collection ["
1093 tree = (TTree*)
f->Get(tupleName.c_str());
1095 ATH_MSG_ERROR(
"could not retrieve tree [" << tupleName <<
"]"
1096 <<
" from file [" <<
fname <<
"]");
1106 tree->SetBranchStatus(
"*", 0);
◆ finalize()
StatusCode Athena::RootNtupleEventSelector::finalize |
( |
| ) |
|
|
overridevirtual |
◆ find_coll_idx()
void Athena::RootNtupleEventSelector::find_coll_idx |
( |
int |
evtidx, |
|
|
long & |
coll_idx, |
|
|
long & |
tuple_idx |
|
) |
| const |
|
private |
helper method to get the collection index (into m_inputCollectionsName
) and tuple index (into ‘m_tupleNames’) for a given event index evtidx
.
returns -1 if not found.
Definition at line 1228 of file RootNtupleEventSelector.cxx.
1237 for (
size_t ituple = 0; ituple <
m_collEvts.size(); ++ituple) {
1238 for (
size_t icoll = 0; icoll <
m_collEvts[ituple].size(); ++icoll) {
1239 CollMetaData &itr =
m_collEvts[ituple][icoll];
1240 if (itr.min_entries == -1) {
1248 else if (ituple > 0) {
1251 itr.entries =
tree->GetEntriesFast();
1252 itr.min_entries =
offset;
1253 itr.max_entries =
offset + itr.entries;
1255 throw "RootNtupleEventSelector: Unable to fetch ntuple";
1261 if (itr.min_entries <= evtidx && evtidx < itr.max_entries) {
◆ handle()
void Athena::RootNtupleEventSelector::handle |
( |
const Incident & |
incident | ) |
|
|
overridevirtual |
◆ initialize()
StatusCode Athena::RootNtupleEventSelector::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 275 of file RootNtupleEventSelector.cxx.
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;
293 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
294 boost::char_separator<char>
sep (
" ;");
300 (
"You have to give a TTree name to read from the ROOT files !");
301 return StatusCode::FAILURE;
305 m_incsvc->addListener(
this,IncidentType::BeginEvent,99);
310 if ( nbrInputFiles < 1 ) {
312 (
"You need to give at least 1 input file !!" <<
endmsg
313 <<
"(Got [" << nbrInputFiles <<
"] file instead !)");
314 return StatusCode::FAILURE;
317 (
"Selector configured to read [" << nbrInputFiles <<
"] file(s)..."
325 if (!iomgr.retrieve().isSuccess()) {
327 return StatusCode::FAILURE;
329 if (!iomgr->io_register(
this).isSuccess()) {
330 ATH_MSG_FATAL(
"Could not register myself with the IoComponentMgr !");
331 return StatusCode::FAILURE;
337 if (!iomgr->io_register(
this,
339 incol[
icol]).isSuccess()) {
347 return StatusCode::FAILURE;
352 return StatusCode::FAILURE;
384 std::vector<std::string>
propVal;
386 bool foundSvc(
false);
387 for(
const std::string&
s :
propVal) {
388 if(
s==
"Athena::xAODCnvSvc") { foundSvc=
true;
break; }
391 propVal.push_back(
"Athena::NtupleCnvSvc");
398 ppSvc->addProvider(
this );
402 return StatusCode::SUCCESS;
◆ io_reinit()
StatusCode Athena::RootNtupleEventSelector::io_reinit |
( |
| ) |
|
|
overridevirtual |
Callback method to reinitialize the internal state of the component for I/O purposes (e.g.
upon fork(2)
)
Definition at line 730 of file RootNtupleEventSelector.cxx.
735 if (!iomgr.retrieve().isSuccess()) {
737 return StatusCode::FAILURE;
739 if (!iomgr->io_hasitem(
this)) {
740 ATH_MSG_FATAL(
"IoComponentMgr does not know about myself !");
741 return StatusCode::FAILURE;
752 if (!iomgr->io_contains(
this,
fname)) {
754 return StatusCode::FAILURE;
756 if (!iomgr->io_retrieve(
this,
fname).isSuccess()) {
758 return StatusCode::FAILURE;
778 return StatusCode::FAILURE;
782 return StatusCode::SUCCESS;
◆ last()
StatusCode Athena::RootNtupleEventSelector::last |
( |
Context & |
refContext | ) |
const |
|
overridevirtual |
◆ loadAddresses()
StatusCode Athena::RootNtupleEventSelector::loadAddresses |
( |
StoreID::type |
storeID, |
|
|
tadList & |
list |
|
) |
| |
|
overridevirtual |
◆ next() [1/2]
StatusCode Athena::RootNtupleEventSelector::next |
( |
IEvtSelector::Context & |
ctx | ) |
const |
|
overridevirtual |
Definition at line 458 of file RootNtupleEventSelector.cxx.
465 RootNtupleEventContext* rctx =
dynamic_cast<RootNtupleEventContext*
>(&ctx);
467 ATH_MSG_ERROR (
"Could not dyn-cast to RootNtupleEventContext !!");
468 throw "RootNtupleEventSelector: Unable to get RootNtupleEventContext";
471 TTree *
tree = rctx->tree();
474 std::size_t fidx = rctx->fileIndex();
480 const std::string&
fname = fnames[fidx];
483 throw "RootNtupleEventSelector: Unable to get tree";
490 rctx->setTupleIndex (rctx->tupleIndex()+1);
491 rctx->setFileIndex (0);
497 return StatusCode::FAILURE;
500 int64_t global_entry = rctx->entry();
501 size_t collIdx = rctx->fileIndex();
502 size_t tupleIdx = rctx->tupleIndex();
503 int64_t
entry = global_entry;
504 if (
m_collEvts[tupleIdx][collIdx].min_entries < 0) {
506 long coll_idx, tuple_idx;
529 (
"Problem loading tree for event [" <<
m_curEvt <<
"] !!");
530 throw "RootNtupleEventSelector: Problem loading input tree";
541 const std::size_t runNbr = 0;
543 if ( !
m_dataStore->record( evtInfo,
"TTreeEventInfo" ).isSuccess() ) {
545 delete evtInfo; evtInfo = 0;
546 return StatusCode::FAILURE;
550 auto ei = std::make_unique<xAOD::EventInfo>();
551 auto ei_store = std::make_unique<xAOD::EventAuxInfo>();
552 ei->setStore (ei_store.get());
553 ei->setRunNumber (runNbr);
554 ei->setEventNumber (global_entry);
578 return StatusCode::SUCCESS;
583 rctx->setFileIndex (rctx->fileIndex() + 1);
◆ next() [2/2]
StatusCode Athena::RootNtupleEventSelector::next |
( |
Context & |
refCtxt, |
|
|
int |
jump |
|
) |
| const |
|
overridevirtual |
◆ preLoadAddresses()
StatusCode Athena::RootNtupleEventSelector::preLoadAddresses |
( |
StoreID::type |
storeID, |
|
|
tadList & |
list |
|
) |
| |
|
overridevirtual |
◆ previous() [1/2]
StatusCode Athena::RootNtupleEventSelector::previous |
( |
IEvtSelector::Context & |
ctx | ) |
const |
|
overridevirtual |
◆ previous() [2/2]
StatusCode Athena::RootNtupleEventSelector::previous |
( |
Context & |
refCtxt, |
|
|
int |
jump |
|
) |
| const |
|
overridevirtual |
◆ releaseContext()
StatusCode Athena::RootNtupleEventSelector::releaseContext |
( |
Context *& |
refCtxt | ) |
const |
|
overridevirtual |
Definition at line 647 of file RootNtupleEventSelector.cxx.
649 RootNtupleEventContext *ctx =
dynamic_cast<RootNtupleEventContext*
>(refCtxt);
652 return StatusCode::SUCCESS;
655 return StatusCode::FAILURE;
◆ resetCriteria()
StatusCode Athena::RootNtupleEventSelector::resetCriteria |
( |
const std::string & |
cr, |
|
|
Context & |
ctx |
|
) |
| const |
|
overridevirtual |
◆ rewind()
StatusCode Athena::RootNtupleEventSelector::rewind |
( |
Context & |
refCtxt | ) |
const |
|
overridevirtual |
◆ seek()
StatusCode Athena::RootNtupleEventSelector::seek |
( |
Context & |
ctx, |
|
|
int |
evtnum |
|
) |
| const |
|
overridevirtual |
Seek to a given event number.
IEvtSelectorSeek
interface
- Parameters
-
evtnum | The event number to which to seek. |
evtnum | The event number to which to seek. |
Definition at line 674 of file RootNtupleEventSelector.cxx.
676 RootNtupleEventContext* rctx =
dynamic_cast<RootNtupleEventContext*
>(&ctx);
678 return StatusCode::FAILURE;
685 long coll_idx, tuple_idx;
692 if ((coll_idx == -1 || tuple_idx == -1) && evtnum <
m_curEvt) {
693 coll_idx = rctx->fileIndex();
694 tuple_idx = rctx->tupleIndex();
697 if (coll_idx == -1 || tuple_idx == -1) {
699 return StatusCode::RECOVERABLE;
702 if (coll_idx !=
static_cast<int>(rctx->fileIndex()) ||
703 tuple_idx !=
static_cast<int>(rctx->tupleIndex()))
710 rctx->setFileIndex (coll_idx);
711 rctx->setTupleIndex (tuple_idx);
714 return StatusCode::SUCCESS;
◆ self()
◆ setupInputCollection()
void Athena::RootNtupleEventSelector::setupInputCollection |
( |
Gaudi::Details::PropertyBase & |
inputCollectionsName | ) |
|
|
private |
◆ size()
int Athena::RootNtupleEventSelector::size |
( |
Context & |
refCtxt | ) |
const |
|
overridevirtual |
◆ updateAddress()
update a transient Address
Definition at line 812 of file RootNtupleEventSelector.cxx.
817 return StatusCode::SUCCESS;
819 return StatusCode::FAILURE;
822 return StatusCode::SUCCESS;
◆ Athena::RootNtupleEventContext
◆ m_activeBranchNames
StringArrayProperty Athena::RootNtupleEventSelector::m_activeBranchNames |
|
private |
◆ m_clidsvc
ICLIDSvc_t Athena::RootNtupleEventSelector::m_clidsvc |
|
private |
◆ m_collEvts
std::vector<std::vector<CollMetaData> > Athena::RootNtupleEventSelector::m_collEvts |
|
mutableprivate |
cache of the number of entries for each collection Indexed like [tuple][collection]
Definition at line 238 of file RootNtupleEventSelector.h.
◆ m_curEvt
long Athena::RootNtupleEventSelector::m_curEvt |
|
mutableprivate |
◆ m_dataStore
◆ m_dictsvc
IDictSvc_t Athena::RootNtupleEventSelector::m_dictsvc |
|
private |
◆ m_files
std::vector<TFile*> Athena::RootNtupleEventSelector::m_files |
|
mutableprivate |
◆ m_fireBIF
bool Athena::RootNtupleEventSelector::m_fireBIF |
|
mutableprivate |
◆ m_imetaStore
◆ m_incsvc
IIncSvc_t Athena::RootNtupleEventSelector::m_incsvc |
|
private |
◆ m_inputCollectionsName
StringArrayProperty Athena::RootNtupleEventSelector::m_inputCollectionsName |
|
private |
◆ m_nbrEvts
long Athena::RootNtupleEventSelector::m_nbrEvts |
|
mutableprivate |
◆ m_needReload
bool Athena::RootNtupleEventSelector::m_needReload |
|
mutableprivate |
◆ m_ometaStore
◆ m_skipEvts
long Athena::RootNtupleEventSelector::m_skipEvts |
|
private |
◆ m_tuple
TTree* Athena::RootNtupleEventSelector::m_tuple |
|
mutableprivate |
◆ m_tupleName
StringProperty Athena::RootNtupleEventSelector::m_tupleName |
|
private |
◆ m_tupleNames
std::vector<std::string> Athena::RootNtupleEventSelector::m_tupleNames |
|
private |
The documentation for this class was generated from the following files:
long m_skipEvts
Number of events to skip at the beginning.
IIncSvc_t m_incsvc
Handle to the incident service.
void addMetadataFromDirectoryName(const std::string &metadirname, TFile *fileObj, const std::string &prefix="") const
StatusCode endInputFile(RootNtupleEventContext *rctx) const
StringProperty m_tupleName
Name of TTree to load from collection of input files.
path
python interpreter configuration --------------------------------------—
StatusCode parse(std::tuple< Tup... > &tup, const Gaudi::Parsers::InputData &input)
Helper class to provide type-safe access to aux data.
StringArrayProperty m_inputCollectionsName
List of input files containing TTree.
This class represents the "type of event" where the type is given by one or more "characteristics".
RootNtupleEventSelector(const std::string &name, ISvcLocator *svcLoc)
Constructor with parameters:
IDictSvc_t m_dictsvc
Pointer to the IDictLoaderSvc.
sgkey_t sgkey() const
Set the primary (hashed) SG key.
void setupInputCollection(Gaudi::Details::PropertyBase &inputCollectionsName)
callback to synchronize the list of input files
long m_nbrEvts
Number of Events read so far.
virtual int size(Context &refCtxt) const override
ICollectionSize interface
#define ATH_MSG_VERBOSE(x)
TTree * fetchNtuple(const std::string &fname, const std::string &tupleName) const
helper method to retrieve the correct tuple
TTree * m_tuple
current tree being read
virtual StatusCode seek(Context &refCtxt, int evtnum) const override
Seek to a given event number.
void addMetadata(TTree *metatree, const std::string &path="") const
StatusCode do_init_io()
helper method to init the i/o components
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
std::string typeinfoName(const std::type_info &ti)
Convert a type_info to a demangled string.
std::vector< std::string > m_tupleNames
Names of all trees over which to iterate.
long m_curEvt
current event index
StoreGateSvc_t m_ometaStore
Pointer to the StoreGateSvc output metadata store.
std::vector< std::vector< CollMetaData > > m_collEvts
cache of the number of entries for each collection Indexed like [tuple][collection]
#define CHECK(...)
Evaluate an expression and check for errors.
StatusCode createRootBranchAddresses(StoreID::type storeID, tadList &tads)
helper method to create proxies
virtual const std::string & name() const override
uint32_t CLID
The Class ID type.
bool allGood
Loop over the SDOs & Digits.
bool m_needReload
The (python) selection function to apply on the TChain we are reading.
StatusCode createMetaDataRootBranchAddresses(StoreGateSvc *store, TTree *tree, const std::string &prefix) const
helper method to create proxies for the metadata store
This class provides general information about an event. Event information is provided by the accessor...
std::vector< TFile * > m_files
void record(const T *p, const std::string &key)
ICLIDSvc_t m_clidsvc
Pointer to the IClassIDSvc.
StoreGateSvc_t m_dataStore
Pointer to the StoreGateSvc event store.
#define ATH_MSG_WARNING(x)
virtual StatusCode next(Context &refCtxt) const override
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
StoreGateSvc_t m_imetaStore
Pointer to the StoreGateSvc input metadata store.
RootNtupleEventContext::FileNames_t FileNames_t
void addMetadataFromDirectory(TDirectoryFile *metadir, const std::string &prefix="") const
void zero(TH2 *h)
zero the contents of a 2d histogram
void find_coll_idx(int evtidx, long &coll_idx, long &tuple_idx) const
helper method to get the collection index (into m_inputCollectionsName) and tuple index (into ‘m_tupl...
StringArrayProperty m_activeBranchNames
List of branches to activate in the TTree.