Go to the documentation of this file.
11 #ifndef GAUDIALG_GAUDITUPLES_H
12 #define GAUDIALG_GAUDITUPLES_H 1
25 #include "boost/algorithm/string/replace.hpp"
26 #include <boost/multi_index/hashed_index.hpp>
27 #include <boost/multi_index/member.hpp>
28 #include <boost/multi_index/ordered_index.hpp>
29 #include <boost/multi_index_container.hpp>
52 template <
class PBASE>
250 long printTuples()
const;
254 long printEvtCols()
const;
257 bool nTupleExists(
const TupleID& ID )
const;
259 bool evtColExists(
const TupleID& ID )
const;
271 const CLID& clid )
const;
280 const CLID& clid )
const;
286 template <
typename U = PBASE,
typename = std::enable_if_t<std::is_base_of_v<GaudiHistoAlg, PBASE>, U>>
290 template <
typename U = PBASE,
typename = std::enable_if_t<std::is_base_of_v<GaudiHistoTool, PBASE>, U>>
302 return i_gtInitialize();
313 return i_gtFinalize();
326 this->tuplesPrint() )
329 "print N-tuple statistics"};
331 "split long directory names into short pieces (suitable for HBOOK)"};
336 this,
"NTupleDir", boost::algorithm::replace_all_copy( this->
name(),
":",
"_" ),
"subdirectory for N-Tuples"};
339 "general switch to enable/disable Event Tag Collections"};
344 this->evtColsPrint() )
345 this->printEvtCols();
347 "print statistics for Event Tag Collections "};
348 Gaudi::Property<bool> m_splitEvtColDir{
this,
"EvtColSplitDir",
false,
"split long directory names into short pieces"};
352 "Top-level directory for Event Tag Collections"};
354 boost::algorithm::replace_all_copy( this->
name(),
":",
"_" ),
355 "Subdirectory for Event Tag Collections"};
364 template <
typename... Ts>
366 template <
typename... Ts>
368 template <
typename... Ts>
370 template <
typename Obj,
typename Type, Type Obj::*Member>
371 using member = boost::multi_index::member<Obj, Type, Member>;
372 template <
typename T>
373 using tag = boost::multi_index::tag<T>;
383 decltype(
auto ) nTupleByID()
const {
return m_nTupleMap.template get<id_t>(); }
384 decltype(
auto ) nTupleByTitle()
const {
return m_nTupleMap.template get<title_t>(); }
385 decltype(
auto ) nTupleOrdered()
const {
return m_nTupleMap.template get<order_t>(); }
391 decltype(
auto ) evtColByID()
const {
return m_evtColMap.template get<id_t>(); }
392 decltype(
auto ) evtColByTitle()
const {
return m_evtColMap.template get<title_t>(); }
393 decltype(
auto ) evtColOrdered()
const {
return m_evtColMap.template get<order_t>(); }
400 #endif // GAUDIALG_GAUDITUPLES_H
const std::string & nTupleLUN() const
get the logical unit for N-Tuples (property "NTupleLUN")
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...
const std::string & nTupleDir() const
get the N-Tuple directory (property "NTupleDir")
boost::multi_index::ordered_unique< Ts... > ordered_unique
GaudiAlg::TupleID TupleID
the actual type of N-tuple ID
boost::multi_index::indexed_by< Ts... > indexed_by
const std::string & evtColDir() const
get the Event Tag Collection directory (property "EvtColsDir")
GaudiTuples(const std::string &name, ISvcLocator *pSvcLocator)
Algorithm constructor - the SFINAE constraint below ensures that this is constructor is only defined ...
nTupleMap m_nTupleMap
the actual storage of ntuples by title and ID
std::shared_ptr< Tuples::TupleObj > tuple
bool produceEvtCols() const
get the flag for Event Tag Collection production (property "EvtColsProduce")
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
boost::multi_index::hashed_unique< Ts... > hashed_unique
boost::multi_index::tag< T > tag
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 > >> > nTupleMap
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
nTupleMap m_evtColMap
the actual storage of event collections by title and ID
bool produceNTuples() const
get the flag for N-Tuple production (property "NTupleProduce")
unsigned int CLID
Class ID definition.
GaudiAlg::ID TupleID
the actual type for N-Tuple identifier (HBOOK-style)
boost::multi_index::member< Obj, Type, Member > member
def nTuple(dirpath, ID, ID2=None, topdir=None, LUN='FILE1')
TupleID::NumericID nTupleOffSet() const
get the value for N-Tuple offset (property "NTupleOffSet")
int NumericID
type for internal numeric ID
Abstract base class which allows the user to interact with the actual N tuple implementation.
const std::string & evtColLUN() const
get the logical unit for Event Tag Collections (property "EvtColsLUN")
bool evtColsPrint() const
print event collections at finalization
TupleID::NumericID evtColOffSet() const
get the value for Event Tag Collection offset (property "EvtColsOffSet")
bool splitEvtColDir() const
get the flag for Event Tag Collection path split (property "EvtColsSplitDir")
Tuples::Tuple Tuple
the actual type of the tuple
const std::string & evtColTopDir() const
get the top-level Event Tag Collection directory (property "EvtColsTopDir")
const std::string & nTupleTopDir() const
get the top-level N-Tuple directory (property "NTupleTopDir")
bool tuplesPrint() const
print tuples at finalization
bool splitNTupleDir() const
get the flag for N-Tuple path split (property "NTupleSplitDir")