![]() |
The Gaudi Framework
v30r3 (a5ef0a68)
|
Templated base class providing common 'ntupling' methods. More...
#include <GaudiAlg/GaudiTuples.h>
Classes | |
struct | id_t |
struct | nTupleMapItem |
struct | order_t |
struct | title_t |
Public Types | |
typedef GaudiAlg::HistoID | HistoID |
the actual type for histogram identifier More... | |
typedef Tuples::Tuple | Tuple |
the actual type of the tuple More... | |
typedef GaudiAlg::TupleID | TupleID |
the actual type of N-tuple ID More... | |
Public Member Functions | |
Tuple | nTuple (const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const |
Access an N-Tuple object (book on-demand) with unique identifier. More... | |
Tuple | nTuple (const TupleID &ID, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const |
Access an N-Tuple object (book on-demand) with forced identifier. More... | |
Tuple | evtCol (const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const |
Access an Event Tag Collection object (book on-demand) with unique identifier. More... | |
Tuple | evtCol (const TupleID &ID, const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const |
Access an Event Tag Collection object (book on-demand) with forced identifier. More... | |
bool | produceNTuples () const |
get the flag for N-Tuple production (property "NTupleProduce") More... | |
bool | splitNTupleDir () const |
get the flag for N-Tuple path split (property "NTupleSplitDir") More... | |
const std::string & | nTupleLUN () const |
get the logical unit for N-Tuples (property "NTupleLUN") More... | |
const std::string & | nTupleTopDir () const |
get the top-level N-Tuple directory (property "NTupleTopDir") More... | |
const std::string & | nTupleDir () const |
get the N-Tuple directory (property "NTupleDir") More... | |
TupleID::NumericID | nTupleOffSet () const |
get the value for N-Tuple offset (property "NTupleOffSet") More... | |
std::string | nTuplePath () const |
get the constructed N-Tuple path More... | |
bool | produceEvtCols () const |
get the flag for Event Tag Collection production (property "EvtColsProduce") More... | |
bool | splitEvtColDir () const |
get the flag for Event Tag Collection path split (property "EvtColsSplitDir") More... | |
const std::string & | evtColLUN () const |
get the logical unit for Event Tag Collections (property "EvtColsLUN") More... | |
const std::string & | evtColTopDir () const |
get the top-level Event Tag Collection directory (property "EvtColsTopDir") More... | |
const std::string & | evtColDir () const |
get the Event Tag Collection directory (property "EvtColsDir") More... | |
TupleID::NumericID | evtColOffSet () const |
get the value for Event Tag Collection offset (property "EvtColsOffSet") More... | |
std::string | evtColPath () const |
get the constructed Event Tag Collection path More... | |
bool | tuplesPrint () const |
print tuples at finalization More... | |
bool | evtColsPrint () const |
print event collections at finalization More... | |
long | printTuples () const |
perform the actual printout of N-tuples More... | |
long | printEvtCols () const |
perform the actual printout of Event Tag Collections More... | |
bool | nTupleExists (const TupleID &ID) const |
check the existence AND validity of the N-Tuple with the given ID More... | |
bool | evtColExists (const TupleID &ID) const |
check the existence AND validity of the Event Tag Collection with the given ID More... | |
template<typename U = PBASE, typename = std::enable_if_t<std::is_base_of<GaudiHistoAlg, PBASE>::value, U>> | |
GaudiTuples (const std::string &name, ISvcLocator *pSvcLocator) | |
Algorithm constructor - the SFINAE constraint below ensures that this is constructor is only defined if PBASE derives from GaudiHistoAlg. More... | |
template<typename U = PBASE, typename = std::enable_if_t<std::is_base_of<GaudiHistoTool, PBASE>::value, U>> | |
GaudiTuples (const std::string &type, const std::string &name, const IInterface *parent) | |
Tool constructor - SFINAE-ed to insure this constructor is only defined if PBASE derives from AlgTool. More... | |
Protected Member Functions | |
virtual std::unique_ptr< Tuples::TupleObj > | createNTuple (const std::string &name, NTuple::Tuple *tuple, const CLID &clid) const |
create TupleObj More... | |
virtual std::unique_ptr< Tuples::TupleObj > | createEvtCol (const std::string &name, NTuple::Tuple *tuple, const CLID &clid) const |
create TupleObj for event tag collection More... | |
StatusCode | initialize () override |
standard initialization method More... | |
StatusCode | finalize () override |
standard finalization method More... | |
Private Types | |
template<typename... Ts> | |
using | indexed_by = boost::multi_index::indexed_by< Ts... > |
template<typename... Ts> | |
using | hashed_unique = boost::multi_index::hashed_unique< Ts... > |
template<typename... Ts> | |
using | ordered_unique = boost::multi_index::ordered_unique< Ts... > |
template<typename Obj , typename Type , Type Obj::* Member> | |
using | member = boost::multi_index::member< Obj, Type, Member > |
template<typename T > | |
using | tag = boost::multi_index::tag< T > |
using | nTupleMap = boost::multi_index_container< nTupleMapItem, indexed_by< hashed_unique< tag< title_t >, member< nTupleMapItem, std::string,&nTupleMapItem::title >>, hashed_unique< tag< id_t >, member< nTupleMapItem, TupleID,&nTupleMapItem::id >>, ordered_unique< tag< order_t >, member< nTupleMapItem, TupleID,&nTupleMapItem::id >>>> |
Private Member Functions | |
void | initGaudiTuplesConstructor () |
Constructor initialization and job options. More... | |
void | printNTupleHandler (Gaudi::Details::PropertyBase &) |
handler for "NTuplePrint" property More... | |
void | printEvtColHandler (Gaudi::Details::PropertyBase &) |
handler for "EvtColsPrint" property More... | |
Private Attributes | |
Gaudi::Property< bool > | m_produceNTuples {this, "NTupleProduce", true, "general switch to enable/disable N-tuples"} |
Gaudi::Property< bool > | m_tuplesPrint {this, "NTuplePrint", true, "print N-tuple statistics"} |
Gaudi::Property< bool > | m_splitNTupleDir |
Gaudi::Property< TupleID::NumericID > | m_nTupleOffSet {this, "NTupleOffSet", 0, "offset for numerical N-tuple ID"} |
Gaudi::Property< std::string > | m_nTupleLUN {this, "NTupleLUN", "FILE1", "Logical File Unit for N-tuples"} |
Gaudi::Property< std::string > | m_nTupleTopDir {this, "NTupleTopDir", "", "top-level directory for N-Tuples"} |
Gaudi::Property< std::string > | m_nTupleDir |
Gaudi::Property< bool > | m_produceEvtCols |
Gaudi::Property< bool > | m_evtColsPrint {this, "EvtColsPrint", false, "print statistics for Event Tag Collections "} |
Gaudi::Property< bool > | m_splitEvtColDir {this, "EvtColSplitDir", false, "split long directory names into short pieces"} |
Gaudi::Property< TupleID::NumericID > | m_evtColOffSet {this, "EvtColOffSet", 0, "offset for numerical N-tuple ID"} |
Gaudi::Property< std::string > | m_evtColLUN {this, "EvtColLUN", "EVTCOL", "Logical File Unit for Event Tag Collections"} |
Gaudi::Property< std::string > | m_evtColTopDir |
Gaudi::Property< std::string > | m_evtColDir |
nTupleMap | m_nTupleMap |
the actual storage of ntuples by title and ID More... | |
nTupleMap | m_evtColMap |
the actual storage of event collections by title and ID More... | |
Templated base class providing common 'ntupling' methods.
Definition at line 43 of file GaudiTuples.h.
|
private |
Definition at line 369 of file GaudiTuples.h.
typedef GaudiAlg::HistoID GaudiTuples< PBASE >::HistoID |
the actual type for histogram identifier
Definition at line 48 of file GaudiTuples.h.
|
private |
Definition at line 367 of file GaudiTuples.h.
|
private |
Definition at line 373 of file GaudiTuples.h.
|
private |
Definition at line 379 of file GaudiTuples.h.
|
private |
Definition at line 371 of file GaudiTuples.h.
|
private |
Definition at line 375 of file GaudiTuples.h.
typedef Tuples::Tuple GaudiTuples< PBASE >::Tuple |
the actual type of the tuple
Definition at line 50 of file GaudiTuples.h.
typedef GaudiAlg::TupleID GaudiTuples< PBASE >::TupleID |
the actual type of N-tuple ID
Definition at line 52 of file GaudiTuples.h.
|
inline |
Algorithm constructor - the SFINAE constraint below ensures that this is constructor is only defined if PBASE derives from GaudiHistoAlg.
Definition at line 278 of file GaudiTuples.h.
|
inline |
Tool constructor - SFINAE-ed to insure this constructor is only defined if PBASE derives from AlgTool.
Definition at line 285 of file GaudiTuples.h.
|
protectedvirtual |
create TupleObj for event tag collection
name | name/title |
tuple | the underlying ntuple implementation |
clid | unique classID for ntuple |
Definition at line 300 of file GaudiTuples.icpp.
|
protectedvirtual |
create TupleObj
name | name/title |
tuple | the underlying ntuple implementation |
clid | unique classID for ntuple |
Definition at line 289 of file GaudiTuples.icpp.
Tuples::Tuple GaudiTuples< PBASE >::evtCol | ( | const std::string & | title, |
const CLID & | clid = CLID_ColumnWiseTuple |
||
) | const |
Access an Event Tag Collection object (book on-demand) with unique identifier.
The Event Tag Collection will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first Event Tag Collection booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given Event Tag Collection will be given when filled under conditional statements, since in these circumstances the order in which the Event Tag Collection are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given Event Tag Collection could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.
title | Unique title for Event Tag Collection |
clid | N-Tuple class identifier (row or column wise) |
Definition at line 151 of file GaudiTuples.icpp.
Tuples::Tuple GaudiTuples< PBASE >::evtCol | ( | const TupleID & | ID, |
const std::string & | title, | ||
const CLID & | clid = CLID_ColumnWiseTuple |
||
) | const |
Access an Event Tag Collection object (book on-demand) with forced identifier.
ID | The forced Event Tag Collection ID |
title | Unique title for Event Tag Collection |
clid | N-Tuple class identifier (row or column wise) |
Definition at line 239 of file GaudiTuples.icpp.
|
inline |
get the Event Tag Collection directory (property "EvtColsDir")
Definition at line 226 of file GaudiTuples.h.
bool GaudiTuples< PBASE >::evtColExists | ( | const TupleID & | ID | ) | const |
check the existence AND validity of the Event Tag Collection with the given ID
Definition at line 365 of file GaudiTuples.icpp.
|
inline |
get the logical unit for Event Tag Collections (property "EvtColsLUN")
Definition at line 222 of file GaudiTuples.h.
|
inline |
get the value for Event Tag Collection offset (property "EvtColsOffSet")
Definition at line 228 of file GaudiTuples.h.
std::string GaudiTuples< PBASE >::evtColPath | ( | ) | const |
get the constructed Event Tag Collection path
Definition at line 403 of file GaudiTuples.icpp.
|
inline |
|
inline |
get the top-level Event Tag Collection directory (property "EvtColsTopDir")
Definition at line 224 of file GaudiTuples.h.
|
overrideprotected |
standard finalization method
Definition at line 88 of file GaudiTuples.icpp.
|
inlineprivate |
Constructor initialization and job options.
Definition at line 319 of file GaudiTuples.h.
|
overrideprotected |
standard initialization method
Definition at line 43 of file GaudiTuples.icpp.
Tuples::Tuple GaudiTuples< PBASE >::nTuple | ( | const std::string & | title, |
const CLID & | clid = CLID_ColumnWiseTuple |
||
) | const |
Access an N-Tuple object (book on-demand) with unique identifier.
title | Unique title for N-Tuple |
clid | N-Tuple class identifier (row or column wise) |
Definition at line 113 of file GaudiTuples.icpp.
Tuples::Tuple GaudiTuples< PBASE >::nTuple | ( | const TupleID & | ID, |
const std::string & | title, | ||
const CLID & | clid = CLID_ColumnWiseTuple |
||
) | const |
Access an N-Tuple object (book on-demand) with forced identifier.
ID | The forced N-Tuple ID |
title | Unique title for N-Tuple |
clid | N-Tuple class identifier (row or column wise) |
Definition at line 189 of file GaudiTuples.icpp.
|
inline |
bool GaudiTuples< PBASE >::nTupleExists | ( | const TupleID & | ID | ) | const |
check the existence AND validity of the N-Tuple with the given ID
Definition at line 356 of file GaudiTuples.icpp.
|
inline |
get the logical unit for N-Tuples (property "NTupleLUN")
Definition at line 208 of file GaudiTuples.h.
|
inline |
get the value for N-Tuple offset (property "NTupleOffSet")
Definition at line 214 of file GaudiTuples.h.
std::string GaudiTuples< PBASE >::nTuplePath | ( | ) | const |
get the constructed N-Tuple path
Definition at line 394 of file GaudiTuples.icpp.
|
inline |
get the top-level N-Tuple directory (property "NTupleTopDir")
Definition at line 210 of file GaudiTuples.h.
|
private |
handler for "EvtColsPrint" property
Definition at line 384 of file GaudiTuples.icpp.
long GaudiTuples< PBASE >::printEvtCols | ( | ) | const |
perform the actual printout of Event Tag Collections
Definition at line 333 of file GaudiTuples.icpp.
|
private |
handler for "NTuplePrint" property
Definition at line 374 of file GaudiTuples.icpp.
long GaudiTuples< PBASE >::printTuples | ( | ) | const |
perform the actual printout of N-tuples
Definition at line 309 of file GaudiTuples.icpp.
|
inline |
get the flag for Event Tag Collection production (property "EvtColsProduce")
Definition at line 218 of file GaudiTuples.h.
|
inline |
get the flag for N-Tuple production (property "NTupleProduce")
Definition at line 204 of file GaudiTuples.h.
|
inline |
get the flag for Event Tag Collection path split (property "EvtColsSplitDir")
Definition at line 220 of file GaudiTuples.h.
|
inline |
get the flag for N-Tuple path split (property "NTupleSplitDir")
Definition at line 206 of file GaudiTuples.h.
|
inline |
|
private |
Definition at line 352 of file GaudiTuples.h.
|
private |
Definition at line 349 of file GaudiTuples.h.
|
mutableprivate |
the actual storage of event collections by title and ID
Definition at line 391 of file GaudiTuples.h.
|
private |
Definition at line 348 of file GaudiTuples.h.
|
private |
Definition at line 346 of file GaudiTuples.h.
|
private |
Definition at line 350 of file GaudiTuples.h.
|
private |
Definition at line 341 of file GaudiTuples.h.
|
private |
Definition at line 339 of file GaudiTuples.h.
|
mutableprivate |
the actual storage of ntuples by title and ID
Definition at line 383 of file GaudiTuples.h.
|
private |
Definition at line 338 of file GaudiTuples.h.
|
private |
Definition at line 340 of file GaudiTuples.h.
|
private |
Definition at line 344 of file GaudiTuples.h.
|
private |
Definition at line 334 of file GaudiTuples.h.
|
private |
Definition at line 347 of file GaudiTuples.h.
|
private |
Definition at line 336 of file GaudiTuples.h.
|
private |
Definition at line 335 of file GaudiTuples.h.