| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
GaudiTuples< PBASE > Class Template Reference

Templated base class providing common 'ntupling' methods. More...

`#include <GaudiAlg/GaudiTuples.h>`

Inheritance diagram for GaudiTuples< PBASE >:
[legend]
Collaboration diagram for GaudiTuples< PBASE >:
[legend]

## 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...
typedef GaudiAlg::TupleMapTitle | TupleMapTitle
| the actual type of (title) -> (tuple) mappping More...
typedef GaudiAlg::TupleMapID | TupleMapID
| the actual type of (Numeric ID) -> (tuple) mappping 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, class = typename std::enable_if<std::is_base_of<GaudiHistoAlg,PBASE>::value,U>::type>
| 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, class = typename std::enable_if<std::is_base_of<GaudiHistoTool,PBASE>::value,U>::type>
| 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...
| ~GaudiTuples () override=default
| Destructor. More...

## Protected Member Functions
const TupleMapTitle & | nTupleMapTitle () const
| access to the all ntuples by title More...
const TupleMapTitle & | evtColMapTitle () const
| access to the all evet tag collections by title More...
const TupleMapID & | nTupleMapID () const
| access to the all ntuples by numeric ID More...
const TupleMapID & | evtColMapID () const
| access to the all evet tag collections by numeric ID More...
virtual Tuples::TupleObj * | createNTuple (const std::string &name, NTuple::Tuple *tuple, const CLID &clid) const
| create TupleObj More...
virtual 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 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
TupleMapTitle | m_nTupleMapTitle
| the actual storage of ntuples by title More...
TupleMapID | m_nTupleMapID
| the actual storage of ntuples by ID More...
TupleMapTitle | m_evtColMapTitle
| the actual storage of event collections by title More...
TupleMapID | m_evtColMapID
| the actual storage of event collections by ID More...

## Detailed Description

### template<class PBASE>
class GaudiTuples< PBASE >

Templated base class providing common 'ntupling' methods.

Author
  Chris Jones Chris.nosp@m.toph.nosp@m.er.Ro.nosp@m.b.Jo.nosp@m.nes@c.nosp@m.ern..nosp@m.ch
  Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru

Date
  2005-08-08

Definition at line 39 of file GaudiTuples.h.

## Member Typedef Documentation

template<class PBASE>

typedef GaudiAlg::HistoID GaudiTuples< PBASE >::HistoID

the actual type for histogram identifier

Definition at line 44 of file GaudiTuples.h.

template<class PBASE>

typedef Tuples::Tuple GaudiTuples< PBASE >::Tuple

the actual type of the tuple

Definition at line 46 of file GaudiTuples.h.

template<class PBASE>

typedef GaudiAlg::TupleID GaudiTuples< PBASE >::TupleID

the actual type of N-tuple ID

Definition at line 48 of file GaudiTuples.h.

template<class PBASE>

typedef GaudiAlg::TupleMapID GaudiTuples< PBASE >::TupleMapID

the actual type of (Numeric ID) -> (tuple) mappping

Definition at line 52 of file GaudiTuples.h.

template<class PBASE>

typedef GaudiAlg::TupleMapTitle GaudiTuples< PBASE >::TupleMapTitle

the actual type of (title) -> (tuple) mappping

Definition at line 50 of file GaudiTuples.h.

## Constructor & Destructor Documentation

template<class PBASE>
template<typename U = PBASE, class = typename std::enable_if<std::is_base_of<GaudiHistoAlg,PBASE>::value,U>::type>

GaudiTuples< PBASE >::GaudiTuples | ( | const std::string & | name,
|  | ISvcLocator * | pSvcLocator
| ) |  |
| inline

Algorithm constructor - the SFINAE constraint below ensures that this is constructor is only defined if PBASE derives from GaudiHistoAlg.

Definition at line 289 of file GaudiTuples.h.

290 : PBASE(name,pSvcLocator)
291 {
292 initGaudiTuplesConstructor();
293 }
GaudiTuples::initGaudiTuplesConstructor
void initGaudiTuplesConstructor()
Constructor initialization and job options.
Definition: GaudiTuples.h:334
template<class PBASE>
template<typename U = PBASE, class = typename std::enable_if<std::is_base_of<GaudiHistoTool,PBASE>::value,U>::type>

GaudiTuples< PBASE >::GaudiTuples | ( | const std::string & | type,
|  | const std::string & | name,
|  | const IInterface * | parent
| ) |  |
| inline

Tool constructor - SFINAE-ed to insure this constructor is only defined if PBASE derives from AlgTool.

Definition at line 297 of file GaudiTuples.h.

299 : PBASE(type,name,parent)
300 {
301 initGaudiTuplesConstructor();
302 }
GaudiTuples::initGaudiTuplesConstructor
void initGaudiTuplesConstructor()
Constructor initialization and job options.
Definition: GaudiTuples.h:334
template<class PBASE>

GaudiTuples< PBASE >::~GaudiTuples | ( |  | ) |
| override default

Destructor.

## Member Function Documentation

template<class PBASE >

Tuples::TupleObj * GaudiTuples< PBASE >::createEvtCol | ( | const std::string & | name,
|  | NTuple::Tuple * | tuple,
|  | const CLID & | clid
| ) |  | const
| protected virtual

create TupleObj for event tag collection

Attention
  The method should never used directly by users

Parameters

  name | name/title
  tuple | the underlying ntuple implementation
  clid | unique classID for ntuple

Returns
  pointer to newly created TupelObj

Definition at line 347 of file GaudiTuples.icpp.

349 {
350 return Tuples::createTupleObj( this, "EvtCol '" + name + "'", tuple, clid, Tuples::EVTCOL );
351 }
Tuples::createTupleObj
TupleObj * createTupleObj(const OWNER *owner, const std::string &name, NTuple::Tuple *tuple, const CLID &clid=CLID_ColumnWiseTuple, const Tuples::Type type=Tuples::NTUPLE)
Templated helper functions allow to avoid heavy semantics of dealing with explicit type of class Tupl...
Definition: TupleDetail.h:242
Tuples::EVTCOL
Definition: TupleObj.h:82
template<class PBASE >

Tuples::TupleObj * GaudiTuples< PBASE >::createNTuple | ( | const std::string & | name,
|  | NTuple::Tuple * | tuple,
|  | const CLID & | clid
| ) |  | const
| protected virtual

create TupleObj

Attention
  The method should never used directly by users

Parameters

  name | name/title
  tuple | the underlying ntuple implementation
  clid | unique classID for ntuple

Returns
  pointer to newly created TupleObj

Definition at line 336 of file GaudiTuples.icpp.

338 {
339 return Tuples::createTupleObj( this, "Tuple '" + name + "'", tuple, clid, Tuples::NTUPLE );
340 }
Tuples::createTupleObj
TupleObj * createTupleObj(const OWNER *owner, const std::string &name, NTuple::Tuple *tuple, const CLID &clid=CLID_ColumnWiseTuple, const Tuples::Type type=Tuples::NTUPLE)
Templated helper functions allow to avoid heavy semantics of dealing with explicit type of class Tupl...
Definition: TupleDetail.h:242
Tuples::NTUPLE
Definition: TupleObj.h:81
template<class PBASE >

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.

Tuple tuple = evtCol( "My Tag Collection" ) ;
tuple->column( "A" , sin(0.1) );
tuple->column( "B" , cos(0.1) );
tuple->column( "C" , tan(0.1) );
tuple->write();

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.

Parameters

  title | Unique title for Event Tag Collection
  clid | N-Tuple class identifier (row or column wise)

Returns
  ntuple The Event Tag Collection object

Definition at line 184 of file GaudiTuples.icpp.

185 {
186 // look up in the table
187 Tuples::TupleObj* tuple = m_evtColMapTitle[title];
188 if ( tuple ) {
189 return Tuple( tuple );
190 } // RETURN
191 // Create the tuple ID
192 TupleID ID;
193 if ( this->useNumericAutoIDs() || title.empty() ) {
194 if ( !this->useNumericAutoIDs() ) {
195 this->Warning(
196 "Cannot generate automatic literal ID from an empty title ! Using numeric ID instead for evtCol ID",
197 StatusCode::SUCCESS );
198 }
199 // proposed the tuple ID
200 ID = TupleID( m_evtColMapID.size() + 1 + evtColOffSet() );
201 // adjust the proposed ID
202 while ( nTupleExists( ID ) || evtColExists( ID ) ) {
203 ID = TupleID( ID.numeric() + 1 );
204 }
205 } else {
206 // use the title to create a unique literal ID
207 ID = TupleID( this->convertTitleToID( title ) );
208 // Just in case ...
209 while ( nTupleExists( ID ) || evtColExists( ID ) ) {
210 ID = TupleID( ID.idAsString() + "_" );
211 }
212 }
213 // return
214 return evtCol( ID, title, clid );
215 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
std::string::empty
T empty(T...args)
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:182
GaudiTuples::nTupleExists
bool nTupleExists(const TupleID &ID) const
check the existence AND validity of the N-Tuple with the given ID
Definition: GaudiTuples.icpp:411
GaudiTuples::m_evtColMapTitle
TupleMapTitle m_evtColMapTitle
the actual storage of event collections by title
Definition: GaudiTuples.h:377
GaudiTuples::Tuple
Tuples::Tuple Tuple
the actual type of the tuple
Definition: GaudiTuples.h:46
GaudiTuples::evtCol
Tuple evtCol(const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const
Access an Event Tag Collection object (book on-demand) with unique identifier.
Definition: GaudiTuples.icpp:184
GaudiTuples::m_evtColMapID
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:379
GaudiTuples::TupleID
GaudiAlg::TupleID TupleID
the actual type of N-tuple ID
Definition: GaudiTuples.h:48
Tuples::TupleObj
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: TupleObj.h:196
GaudiTuples::evtColExists
bool evtColExists(const TupleID &ID) const
check the existence AND validity of the Event Tag Collection with the given ID
Definition: GaudiTuples.icpp:419
GaudiTuples::evtColOffSet
TupleID::NumericID evtColOffSet() const
get the value for Event Tag Collection offset (property "EvtColsOffSet")
Definition: GaudiTuples.h:228
template<class PBASE >

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.

// Book Ntuple with a numeric ID
Tuple tuple = evtCol( 1, "My Tag Collection" ) ;
// ... or
Tuple tuple = evtCol( "1", "My Tag Collection" ) ;
// ... or, Book Ntuple with a literal ID
Tuple tuple = evtCol( "mytuple", "My Tag Collection" ) ;
// ... or, Book Ntuple with a literal ID in a sub-dir
Tuple tuple = evtCol( "subdir/mytuple", "My Tag Collection" ) ;
// Fill and write
tuple->column( "A" , sin(0.1) );
tuple->column( "B" , cos(0.1) );
tuple->column( "C" , tan(0.1) );
tuple->write();

Attention
  If the Event Tag Collection with given ID is already booked through automatic assignment of Event Tag Collection ID, the error will not be detected. Therefore it is recommended to use a non-trivial Event Tag Collection ID offset (property "EvtColOffSet") if one need to combine these techniques together It is still desirable to use the unique Event Tag Collection title to avoid a bad interference.

Parameters

  ID | The forced Event Tag Collection ID
  title | Unique title for Event Tag Collection
  clid | N-Tuple class identifier (row or column wise)

Returns
  ntuple The Event Tag Collection object

Definition at line 278 of file GaudiTuples.icpp.

279 {
280 // Check ID
281 if ( ID.undefined() ) {
282 this->Error( "Undefined NTuple ID : Title='" + title1 + "'" );
283 return Tuple( 0 );
284 }
285
286 // look up in the table
287 Tuples::TupleObj* tuple = m_evtColMapID[ID];
288 if ( tuple ) {
289 return Tuple( tuple );
290 } // RETURN
291
292 // convert ID to the string
293 const std::string tID = ID.idAsString();
294
295 // adjust the NTuple title
296 const std::string title = title1.empty() ? ( "EvtCol #" + tID ) : title1;
297
298 // book new ntuple
299 if ( produceEvtCols() ) {
300 // book NTuple
301 NTuple::Tuple* tup = nullptr;
302 if ( ID.numeric() ) {
303 tup = this->evtColSvc()->book( evtColPath(), ID.numericID(), clid, title );
304 } else if ( ID.literal() ) {
305 tup = this->evtColSvc()->book( evtColPath(), ID.literalID(), clid, title );
306 } else {
307 this->Error( "Undefined NTuple ID" );
308 }
309
310 // assertion
311 this->Assert( tup, "Could not book the EvtCol='" + title + "'" );
312 // some printout
313 if ( tup->registry() && this->msgLevel( MSG::DEBUG ) ) {
314 this->debug() << "Booked EvtCol '" << title << "' ID=" << tID << "' Path='" << evtColPath() << "' TS='"
315 << tup->registry()->identifier() << "'" << endmsg;
316 }
317
318 tuple = createEvtCol( title, tup, clid );
319 } else {
320 tuple = createEvtCol( title, (NTuple::Tuple*)0, clid );
321 }
322 // increment the reference
323 tuple->addRef();
324 //
325 m_evtColMapID[ID] = tuple;
326 //
327 tuple->addRef();
328 m_evtColMapTitle[title] = tuple;
329 // return
330 return Tuple( tuple );
331 }
std::string::empty
T empty(T...args)
GaudiTuples::createEvtCol
virtual Tuples::TupleObj * createEvtCol(const std::string &name, NTuple::Tuple *tuple, const CLID &clid) const
create TupleObj for event tag collection
Definition: GaudiTuples.icpp:347
GaudiTuples::m_evtColMapTitle
TupleMapTitle m_evtColMapTitle
the actual storage of event collections by title
Definition: GaudiTuples.h:377
GaudiTuples::Tuple
Tuples::Tuple Tuple
the actual type of the tuple
Definition: GaudiTuples.h:46
MSG::DEBUG
Definition: IMessageSvc.h:18
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
std::string
STL class.
GaudiTuples::m_evtColMapID
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:379
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
Tuples::TupleObj
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: TupleObj.h:196
Tuples::TupleObj::addRef
unsigned long addRef()
add the reference to TupleObj
Definition: TupleObj.h:2003
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:370
GaudiTuples::evtColPath
std::string evtColPath() const
get the constructed Event Tag Collection path
Definition: GaudiTuples.icpp:464
GaudiTuples::produceEvtCols
bool produceEvtCols() const
get the flag for Event Tag Collection production (property "EvtColsProduce")
Definition: GaudiTuples.h:218
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
template<class PBASE>

const std::string& GaudiTuples< PBASE >::evtColDir | ( |  | ) | const
| inline

get the Event Tag Collection directory (property "EvtColsDir")

Definition at line 226 of file GaudiTuples.h.

226 { return m_evtColDir; }
GaudiTuples::m_evtColDir
Gaudi::Property< std::string > m_evtColDir
Definition: GaudiTuples.h:367
template<class PBASE >

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 419 of file GaudiTuples.icpp.

420 {
421 return m_evtColMapID.end() != m_evtColMapID.find( ID );
422 }
GaudiTuples::m_evtColMapID
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:379
GaudiUtils::Map::end
iterator end()
Definition: Map.h:132
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:149
template<class PBASE>

const std::string& GaudiTuples< PBASE >::evtColLUN | ( |  | ) | const
| inline

get the logical unit for Event Tag Collections (property "EvtColsLUN")

Definition at line 222 of file GaudiTuples.h.

222 { return m_evtColLUN; }
GaudiTuples::m_evtColLUN
Gaudi::Property< std::string > m_evtColLUN
Definition: GaudiTuples.h:364
template<class PBASE>

const TupleMapID& GaudiTuples< PBASE >::evtColMapID | ( |  | ) | const
| inline protected

access to the all evet tag collections by numeric ID

Definition at line 263 of file GaudiTuples.h.

263 { return m_evtColMapID; }
GaudiTuples::m_evtColMapID
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:379
template<class PBASE>

const TupleMapTitle& GaudiTuples< PBASE >::evtColMapTitle | ( |  | ) | const
| inline protected

access to the all evet tag collections by title

Definition at line 259 of file GaudiTuples.h.

259 { return m_evtColMapTitle; }
GaudiTuples::m_evtColMapTitle
TupleMapTitle m_evtColMapTitle
the actual storage of event collections by title
Definition: GaudiTuples.h:377
template<class PBASE>

TupleID::NumericID GaudiTuples< PBASE >::evtColOffSet | ( |  | ) | const
| inline

get the value for Event Tag Collection offset (property "EvtColsOffSet")

Definition at line 228 of file GaudiTuples.h.

228 { return m_evtColOffSet; }
GaudiTuples::m_evtColOffSet
Gaudi::Property< TupleID::NumericID > m_evtColOffSet
Definition: GaudiTuples.h:363
template<class PBASE >

std::string GaudiTuples< PBASE >::evtColPath | ( |  | ) | const

get the constructed Event Tag Collection path

Definition at line 464 of file GaudiTuples.icpp.

465 {
466 std::string path = evtColLUN() + "/" + evtColTopDir() + evtColDir();
467 return ( splitEvtColDir() ? dirHbookName( path ) : path );
468 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:772
GaudiTuples::splitEvtColDir
bool splitEvtColDir() const
get the flag for Event Tag Collection path split (property "EvtColsSplitDir")
Definition: GaudiTuples.h:220
GaudiTuples::evtColDir
const std::string & evtColDir() const
get the Event Tag Collection directory (property "EvtColsDir")
Definition: GaudiTuples.h:226
GaudiTuples::evtColTopDir
const std::string & evtColTopDir() const
get the top-level Event Tag Collection directory (property "EvtColsTopDir")
Definition: GaudiTuples.h:224
std::string
STL class.
GaudiTuples::evtColLUN
const std::string & evtColLUN() const
get the logical unit for Event Tag Collections (property "EvtColsLUN")
Definition: GaudiTuples.h:222
template<class PBASE>

bool GaudiTuples< PBASE >::evtColsPrint | ( |  | ) | const
| inline

print event collections at finalization

Definition at line 234 of file GaudiTuples.h.

234 { return m_evtColsPrint; }
GaudiTuples::m_evtColsPrint
Gaudi::Property< bool > m_evtColsPrint
Definition: GaudiTuples.h:361
template<class PBASE>

const std::string& GaudiTuples< PBASE >::evtColTopDir | ( |  | ) | const
| inline

get the top-level Event Tag Collection directory (property "EvtColsTopDir")

Definition at line 224 of file GaudiTuples.h.

224 { return m_evtColTopDir; }
GaudiTuples::m_evtColTopDir
Gaudi::Property< std::string > m_evtColTopDir
Definition: GaudiTuples.h:365
template<class PBASE >

StatusCode GaudiTuples< PBASE >::finalize | ( |  | ) |
| override protected

standard finalization method

Returns
  status code

Definition at line 111 of file GaudiTuples.icpp.

112 {
113 if ( !( nTupleMapTitle().empty() && nTupleMapID().empty() && evtColMapTitle().empty() && evtColMapID().empty() ) ) {
114 const int nNtuples = nTupleMapID().size();
115 const int nEvtCols = evtColMapID().size();
116 this->always() << "Booked " << nNtuples << " N-Tuples and " << nEvtCols << " Event Tag Collections" << endmsg;
117 }
118
119 if ( produceNTuples() && tuplesPrint() ) {
120 printTuples();
121 }
122 if ( produceEvtCols() && evtColsPrint() ) {
123 printEvtCols();
124 }
125
126 // release ntuples and clear the container
127 releaseAndClear( m_nTupleMapTitle );
128
129 // release ntuples and clear the container
130 releaseAndClear( m_nTupleMapID );
131
132 // release ntuples and clear the container
133 releaseAndClear( m_evtColMapTitle );
134
135 // release ntuples and clear the container
136 releaseAndClear( m_evtColMapID );
137
138 // finalize base class
139 return PBASE::finalize();
140 }
GaudiTuples::m_nTupleMapTitle
TupleMapTitle m_nTupleMapTitle
the actual storage of ntuples by title
Definition: GaudiTuples.h:372
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:182
GaudiTuples::m_evtColMapTitle
TupleMapTitle m_evtColMapTitle
the actual storage of event collections by title
Definition: GaudiTuples.h:377
GaudiTuples::evtColsPrint
bool evtColsPrint() const
print event collections at finalization
Definition: GaudiTuples.h:234
GaudiTuples::m_evtColMapID
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:379
GaudiTuples::nTupleMapTitle
const TupleMapTitle & nTupleMapTitle() const
access to the all ntuples by title
Definition: GaudiTuples.h:257
GaudiTuples::evtColMapTitle
const TupleMapTitle & evtColMapTitle() const
access to the all evet tag collections by title
Definition: GaudiTuples.h:259
GaudiTuples::printTuples
long printTuples() const
perform the actual printout of N-tuples
Definition: GaudiTuples.icpp:356
GaudiTuples::printEvtCols
long printEvtCols() const
perform the actual printout of Event Tag Collections
Definition: GaudiTuples.icpp:384
GaudiTuples::tuplesPrint
bool tuplesPrint() const
print tuples at finalization
Definition: GaudiTuples.h:232
GaudiTuples::nTupleMapID
const TupleMapID & nTupleMapID() const
access to the all ntuples by numeric ID
Definition: GaudiTuples.h:261
GaudiTuples::m_nTupleMapID
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:374
GaudiTuples::produceEvtCols
bool produceEvtCols() const
get the flag for Event Tag Collection production (property "EvtColsProduce")
Definition: GaudiTuples.h:218
GaudiTuples::produceNTuples
bool produceNTuples() const
get the flag for N-Tuple production (property "NTupleProduce")
Definition: GaudiTuples.h:204
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
GaudiTuples::evtColMapID
const TupleMapID & evtColMapID() const
access to the all evet tag collections by numeric ID
Definition: GaudiTuples.h:263
template<class PBASE>

void GaudiTuples< PBASE >::initGaudiTuplesConstructor | ( |  | ) |
| inline private

Constructor initialization and job options.

Definition at line 334 of file GaudiTuples.h.

335 {
336 m_tuplesPrint.declareUpdateHandler( &GaudiTuples<PBASE>::printNTupleHandler, this );
337 m_evtColsPrint.declareUpdateHandler( &GaudiTuples<PBASE>::printEvtColHandler, this );
338 }
GaudiTuples
Templated base class providing common &#39;ntupling&#39; methods.
Definition: GaudiTuples.h:39
GaudiTuples::m_evtColsPrint
Gaudi::Property< bool > m_evtColsPrint
Definition: GaudiTuples.h:361
GaudiTuples::m_tuplesPrint
Gaudi::Property< bool > m_tuplesPrint
Definition: GaudiTuples.h:350
template<class PBASE >

StatusCode GaudiTuples< PBASE >::initialize | ( |  | ) |
| override protected

standard initialization method

Returns
  status code

Definition at line 66 of file GaudiTuples.icpp.

67 {
68 // initialize base class
69 const StatusCode sc = PBASE::initialize();
70 if ( sc.isFailure() ) return sc;
71
72 if ( produceNTuples() ) {
73 // check the existance of service
74 if ( this->ntupleSvc() == 0 ) {
75 return this->Error( "INTupleSvc* points to NULL!" );
76 }
77 // Print ntuple path
78 this->Print( "The N-Tuple path is set to be '" + nTuplePath() + "'", StatusCode( StatusCode::SUCCESS, true ),
79 MSG::DEBUG )
80 .ignore();
81 } else {
82 this->debug() << "Production of N-Tuples is switched OFF" << endmsg;
83 }
84
85 if ( produceEvtCols() ) {
86 // check the existance of service
87 if ( 0 == this->evtColSvc() ) {
88 return this->Error( "INTupleSvc* points to NULL!" );
89 }
90 // Print EvtCol path
91 this->Print( "The EventCol path is set to be '" + evtColPath() + "'", StatusCode( StatusCode::SUCCESS, true ),
92 MSG::DEBUG )
93 .ignore();
94 } else {
95 this->debug() << "Production of Event Collections is switched OFF" << endmsg;
96 }
97
98 return sc;
99 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
MSG::DEBUG
Definition: IMessageSvc.h:18
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiTuples::evtColPath
std::string evtColPath() const
get the constructed Event Tag Collection path
Definition: GaudiTuples.icpp:464
GaudiTuples::nTuplePath
std::string nTuplePath() const
get the constructed N-Tuple path
Definition: GaudiTuples.icpp:455
GaudiTuples::produceEvtCols
bool produceEvtCols() const
get the flag for Event Tag Collection production (property "EvtColsProduce")
Definition: GaudiTuples.h:218
GaudiTuples::produceNTuples
bool produceNTuples() const
get the flag for N-Tuple production (property "NTupleProduce")
Definition: GaudiTuples.h:204
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
template<class PBASE >

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.

Tuple tuple = nTuple( "My N-Tuple" ) ;
tuple->column( "A" , sin(0.1) );
tuple->column( "B" , cos(0.1) );
tuple->column( "C" , tan(0.1) );
tuple->write();

Attention
  The NTuple 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 NTuple 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 NTuple will be given when filled under conditional statements, since in these circumstances the order in which the NTuple 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 NTuple 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.

Parameters

  title | Unique title for N-Tuple
  clid | N-Tuple class identifier (row or column wise)

Returns
  ntuple The ntuple object

Definition at line 146 of file GaudiTuples.icpp.

147 {
148 // look up in the table
149 auto* tuple = m_nTupleMapTitle[title];
150 if ( tuple ) {
151 return Tuple( tuple );
152 } // RETURN
153 // Create the tuple ID
154 TupleID ID;
155 if ( this->useNumericAutoIDs() || title.empty() ) {
156 if ( !this->useNumericAutoIDs() ) {
157 this->Warning(
158 "Cannot generate automatic literal ID from an empty title ! Using numeric ID instead for nTuple ID",
159 StatusCode::SUCCESS );
160 }
161 // propose the tuple ID
162 ID = TupleID( m_nTupleMapID.size() + 1 + nTupleOffSet() );
163 // adjust the proposed ID
164 while ( nTupleExists( ID ) || evtColExists( ID ) ) {
165 ID = TupleID( ID.numeric() + 1 );
166 }
167 } else {
168 // use the title to create a unique literal ID
169 ID = TupleID( this->convertTitleToID( title ) );
170 // Just in case ...
171 while ( nTupleExists( ID ) || evtColExists( ID ) ) {
172 ID = TupleID( ID.idAsString() + "_" );
173 }
174 }
175 // return
176 return nTuple( ID, title, clid );
177 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
std::string::empty
T empty(T...args)
GaudiTuples::m_nTupleMapTitle
TupleMapTitle m_nTupleMapTitle
the actual storage of ntuples by title
Definition: GaudiTuples.h:372
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:182
GaudiTuples::nTupleExists
bool nTupleExists(const TupleID &ID) const
check the existence AND validity of the N-Tuple with the given ID
Definition: GaudiTuples.icpp:411
GaudiTuples::Tuple
Tuples::Tuple Tuple
the actual type of the tuple
Definition: GaudiTuples.h:46
GaudiTuples::TupleID
GaudiAlg::TupleID TupleID
the actual type of N-tuple ID
Definition: GaudiTuples.h:48
GaudiTuples::nTupleOffSet
TupleID::NumericID nTupleOffSet() const
get the value for N-Tuple offset (property "NTupleOffSet")
Definition: GaudiTuples.h:214
GaudiTuples::nTuple
Tuple nTuple(const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const
Access an N-Tuple object (book on-demand) with unique identifier.
Definition: GaudiTuples.icpp:146
GaudiTuples::evtColExists
bool evtColExists(const TupleID &ID) const
check the existence AND validity of the Event Tag Collection with the given ID
Definition: GaudiTuples.icpp:419
GaudiTuples::m_nTupleMapID
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:374
template<class PBASE >

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.

// Book Ntuple with a numeric ID
Tuple tuple = nTuple( 1, "My tuple" ) ;
// ... or
Tuple tuple = nTuple( "1", "My tuple" ) ;
// ... or, Book Ntuple with a literal ID
Tuple tuple = nTuple( "mytuple", "My tuple" ) ;
// ... or, Book Ntuple with a literal ID in a sub-dir
Tuple tuple = nTuple( "subdir/mytuple", "My tuple" ) ;
// Fill and write NTuple
tuple->column( "A" , sin(0.1) );
tuple->column( "B" , cos(0.1) );
tuple->column( "C" , tan(0.1) );
tuple->write();

Attention
  If the N-Tuple with given ID is already booked through automatic assignment of N-Tuple ID, the error will not be detected. Therefore it is recommended to use a non-trivial N-Tuple ID offset (property "NTupleOffSet") if one need to combine these techniques together It is still desirable to use the unique N-Tuple title to avoid a bad interference.

Parameters

  ID | The forced N-Tuple ID
  title | Unique title for N-Tuple
  clid | N-Tuple class identifier (row or column wise)

Returns
  ntuple The ntuple object

Definition at line 222 of file GaudiTuples.icpp.

223 {
224 // Check ID
225 if ( ID.undefined() ) {
226 this->Error( "Undefined NTuple ID : Title='" + title1 + "'" );
227 return Tuple( 0 );
228 }
229
230 // look up in the table
231 Tuples::TupleObj* tuple = m_nTupleMapID[ID];
232 if ( tuple ) {
233 return Tuple( tuple );
234 } // RETURN
235
236 // convert ID to the string
237 const std::string tID = ID.idAsString();
238
239 // adjust the NTuple title
240 const std::string title = title1.empty() ? ( "NTuple #" + tID ) : title1;
241
242 // book new ntuple
243 if ( produceNTuples() ) {
244 // book NTupel
245 NTuple::Tuple* tup = nullptr;
246 if ( ID.numeric() ) {
247 tup = this->ntupleSvc()->book( nTuplePath(), ID.numericID(), clid, title );
248 } else if ( ID.literal() ) {
249 tup = this->ntupleSvc()->book( nTuplePath(), ID.literalID(), clid, title );
250 } else {
251 this->Error( "Undefined NTuple ID" );
252 }
253
254 // assertion
255 this->Assert( tup, "Could not book the N-Tuple='" + title + "'" );
256 // some printout
257 if ( tup->registry() && this->msgLevel( MSG::DEBUG ) ) {
258 this->debug() << "Booked NTuple '" << title << "' ID=" << tID << "' Path='" << nTuplePath() << "' TS='"
259 << tup->registry()->identifier() << "'" << endmsg;
260 }
261
262 tuple = createNTuple( title, tup, clid );
263 } else {
264 tuple = createNTuple( title, (NTuple::Tuple*)0, clid );
265 }
266 // increment the reference
267 tuple->addRef();
268 //
269 m_nTupleMapID[ID] = tuple;
270 //
271 tuple->addRef();
272 m_nTupleMapTitle[title] = tuple;
273 // return
274 return Tuple( tuple );
275 }
std::string::empty
T empty(T...args)
GaudiTuples::m_nTupleMapTitle
TupleMapTitle m_nTupleMapTitle
the actual storage of ntuples by title
Definition: GaudiTuples.h:372
GaudiTuples::Tuple
Tuples::Tuple Tuple
the actual type of the tuple
Definition: GaudiTuples.h:46
MSG::DEBUG
Definition: IMessageSvc.h:18
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
std::string
STL class.
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
Tuples::TupleObj
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: TupleObj.h:196
Tuples::TupleObj::addRef
unsigned long addRef()
add the reference to TupleObj
Definition: TupleObj.h:2003
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:370
GaudiTuples::createNTuple
virtual Tuples::TupleObj * createNTuple(const std::string &name, NTuple::Tuple *tuple, const CLID &clid) const
create TupleObj
Definition: GaudiTuples.icpp:336
GaudiTuples::m_nTupleMapID
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:374
GaudiTuples::nTuplePath
std::string nTuplePath() const
get the constructed N-Tuple path
Definition: GaudiTuples.icpp:455
GaudiTuples::produceNTuples
bool produceNTuples() const
get the flag for N-Tuple production (property "NTupleProduce")
Definition: GaudiTuples.h:204
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
template<class PBASE>

const std::string& GaudiTuples< PBASE >::nTupleDir | ( |  | ) | const
| inline

get the N-Tuple directory (property "NTupleDir")

Definition at line 212 of file GaudiTuples.h.

212 { return m_nTupleDir; }
GaudiTuples::m_nTupleDir
Gaudi::Property< std::string > m_nTupleDir
Definition: GaudiTuples.h:356
template<class PBASE >

bool GaudiTuples< PBASE >::nTupleExists | ( | const TupleID & | ID | ) | const

check the existence AND validity of the N-Tuple with the given ID

Definition at line 411 of file GaudiTuples.icpp.

412 {
413 return m_nTupleMapID.end() != m_nTupleMapID.find( ID );
414 }
GaudiUtils::Map::end
iterator end()
Definition: Map.h:132
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:149
GaudiTuples::m_nTupleMapID
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:374
template<class PBASE>

const std::string& GaudiTuples< PBASE >::nTupleLUN | ( |  | ) | const
| inline

get the logical unit for N-Tuples (property "NTupleLUN")

Definition at line 208 of file GaudiTuples.h.

208 { return m_nTupleLUN; }
GaudiTuples::m_nTupleLUN
Gaudi::Property< std::string > m_nTupleLUN
Definition: GaudiTuples.h:354
template<class PBASE>

const TupleMapID& GaudiTuples< PBASE >::nTupleMapID | ( |  | ) | const
| inline protected

access to the all ntuples by numeric ID

Definition at line 261 of file GaudiTuples.h.

261 { return m_nTupleMapID; }
GaudiTuples::m_nTupleMapID
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:374
template<class PBASE>

const TupleMapTitle& GaudiTuples< PBASE >::nTupleMapTitle | ( |  | ) | const
| inline protected

access to the all ntuples by title

Definition at line 257 of file GaudiTuples.h.

257 { return m_nTupleMapTitle; }
GaudiTuples::m_nTupleMapTitle
TupleMapTitle m_nTupleMapTitle
the actual storage of ntuples by title
Definition: GaudiTuples.h:372
template<class PBASE>

TupleID::NumericID GaudiTuples< PBASE >::nTupleOffSet | ( |  | ) | const
| inline

get the value for N-Tuple offset (property "NTupleOffSet")

Definition at line 214 of file GaudiTuples.h.

214 { return m_nTupleOffSet; }
GaudiTuples::m_nTupleOffSet
Gaudi::Property< TupleID::NumericID > m_nTupleOffSet
Definition: GaudiTuples.h:353
template<class PBASE >

std::string GaudiTuples< PBASE >::nTuplePath | ( |  | ) | const

get the constructed N-Tuple path

Definition at line 455 of file GaudiTuples.icpp.

456 {
457 const std::string path = nTupleLUN() + "/" + nTupleTopDir() + nTupleDir();
458 return ( splitNTupleDir() ? dirHbookName( path ) : path );
459 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:772
GaudiTuples::nTupleLUN
const std::string & nTupleLUN() const
get the logical unit for N-Tuples (property "NTupleLUN")
Definition: GaudiTuples.h:208
GaudiTuples::nTupleTopDir
const std::string & nTupleTopDir() const
get the top-level N-Tuple directory (property "NTupleTopDir")
Definition: GaudiTuples.h:210
std::string
STL class.
GaudiTuples::nTupleDir
const std::string & nTupleDir() const
get the N-Tuple directory (property "NTupleDir")
Definition: GaudiTuples.h:212
GaudiTuples::splitNTupleDir
bool splitNTupleDir() const
get the flag for N-Tuple path split (property "NTupleSplitDir")
Definition: GaudiTuples.h:206
template<class PBASE>

const std::string& GaudiTuples< PBASE >::nTupleTopDir | ( |  | ) | const
| inline

get the top-level N-Tuple directory (property "NTupleTopDir")

Definition at line 210 of file GaudiTuples.h.

210 { return m_nTupleTopDir; }
GaudiTuples::m_nTupleTopDir
Gaudi::Property< std::string > m_nTupleTopDir
Definition: GaudiTuples.h:355
template<class PBASE >

void GaudiTuples< PBASE >::printEvtColHandler | ( | Gaudi::Details::PropertyBase & |  | ) |
| private

handler for "EvtColsPrint" property

Definition at line 441 of file GaudiTuples.icpp.

442 {
443 // no action if not yet initialized
444 if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) {
445 return;
446 }
447 if ( this->evtColsPrint() ) {
448 this->printEvtCols();
449 }
450 }
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
GaudiTuples::evtColsPrint
bool evtColsPrint() const
print event collections at finalization
Definition: GaudiTuples.h:234
GaudiTuples::printEvtCols
long printEvtCols() const
perform the actual printout of Event Tag Collections
Definition: GaudiTuples.icpp:384
template<class PBASE >

long GaudiTuples< PBASE >::printEvtCols | ( |  | ) | const

perform the actual printout of Event Tag Collections

Returns
  number of active Event Tag Collections

Definition at line 384 of file GaudiTuples.icpp.

385 {
386 if ( evtColMapTitle().empty() && evtColMapID().empty() ) {
387 this->always() << "No Event Tag Collections are booked" << endmsg;
388 } else {
389 this->always() << "List of booked Event Tag Collections in directory "
390 << "\"" << evtColPath() << "\"" << endmsg;
391 }
392 for ( const auto& entry : ordered( evtColMapID() ) ) {
393 if ( !entry.second ) {
394 continue;
395 }
396 const auto tuple = entry.second->tuple();
397 if ( !tuple ) {
398 this->error() << " NTuple::Tuple* points to NULL" << endmsg;
399 continue;
400 }
401 this->always() << GaudiAlg::PrintTuple::print( tuple, entry.first )
402 << " Items:" << Gaudi::Utils::toString( entry.second->items() ) << endmsg;
403 }
404 //
405 return this->evtColMapID().size();
406 }
GaudiAlg::PrintTuple::print
static std::string print(const INTuple *tuple, const GaudiAlg::TupleID &ID)
Definition: Print.cpp:168
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:182
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:367
GaudiTuples::evtColMapTitle
const TupleMapTitle & evtColMapTitle() const
access to the all evet tag collections by title
Definition: GaudiTuples.h:259
GaudiTuples::evtColPath
std::string evtColPath() const
get the constructed Event Tag Collection path
Definition: GaudiTuples.icpp:464
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
GaudiTuples::evtColMapID
const TupleMapID & evtColMapID() const
access to the all evet tag collections by numeric ID
Definition: GaudiTuples.h:263
template<class PBASE >

void GaudiTuples< PBASE >::printNTupleHandler | ( | Gaudi::Details::PropertyBase & |  | ) |
| private

handler for "NTuplePrint" property

Definition at line 427 of file GaudiTuples.icpp.

428 {
429 // no action if not yet initialized
430 if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) {
431 return;
432 }
433 if ( this->tuplesPrint() ) {
434 this->printTuples();
435 }
436 }
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
GaudiTuples::printTuples
long printTuples() const
perform the actual printout of N-tuples
Definition: GaudiTuples.icpp:356
GaudiTuples::tuplesPrint
bool tuplesPrint() const
print tuples at finalization
Definition: GaudiTuples.h:232
template<class PBASE >

long GaudiTuples< PBASE >::printTuples | ( |  | ) | const

perform the actual printout of N-tuples

Returns
  number of active N-Tuples

Definition at line 356 of file GaudiTuples.icpp.

357 {
358
359 if ( nTupleMapTitle().empty() && nTupleMapID().empty() ) {
360 if ( this->msgLevel( MSG::DEBUG ) ) this->debug() << "No N-Tuples are booked" << endmsg;
361 } else {
362 this->always() << "List of booked N-Tuples in directory "
363 << "\"" << nTuplePath() << "\"" << endmsg;
364 }
365
366 for ( const auto& entry : ordered( nTupleMapID() ) ) {
367 if ( !entry.second ) {
368 continue;
369 }
370 const NTuple::Tuple* tuple = entry.second->tuple();
371 if ( !tuple ) {
372 this->error() << " NTuple::Tuple* points to NULL" << endmsg;
373 continue;
374 }
375 this->always() << GaudiAlg::PrintTuple::print( tuple, entry.first ) << endmsg;
376 }
377 //
378 return this->nTupleMapID().size();
379 }
GaudiAlg::PrintTuple::print
static std::string print(const INTuple *tuple, const GaudiAlg::TupleID &ID)
Definition: Print.cpp:168
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:182
MSG::DEBUG
Definition: IMessageSvc.h:18
GaudiTuples::nTupleMapTitle
const TupleMapTitle & nTupleMapTitle() const
access to the all ntuples by title
Definition: GaudiTuples.h:257
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:370
GaudiTuples::nTupleMapID
const TupleMapID & nTupleMapID() const
access to the all ntuples by numeric ID
Definition: GaudiTuples.h:261
GaudiTuples::nTuplePath
std::string nTuplePath() const
get the constructed N-Tuple path
Definition: GaudiTuples.icpp:455
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
template<class PBASE>

bool GaudiTuples< PBASE >::produceEvtCols | ( |  | ) | const
| inline

get the flag for Event Tag Collection production (property "EvtColsProduce")

Definition at line 218 of file GaudiTuples.h.

218 { return m_produceEvtCols; }
GaudiTuples::m_produceEvtCols
Gaudi::Property< bool > m_produceEvtCols
Definition: GaudiTuples.h:359
template<class PBASE>

bool GaudiTuples< PBASE >::produceNTuples | ( |  | ) | const
| inline

get the flag for N-Tuple production (property "NTupleProduce")

Definition at line 204 of file GaudiTuples.h.

204 { return m_produceNTuples; }
GaudiTuples::m_produceNTuples
Gaudi::Property< bool > m_produceNTuples
Definition: GaudiTuples.h:349
template<class PBASE>

bool GaudiTuples< PBASE >::splitEvtColDir | ( |  | ) | const
| inline

get the flag for Event Tag Collection path split (property "EvtColsSplitDir")

Definition at line 220 of file GaudiTuples.h.

220 { return m_splitEvtColDir; }
GaudiTuples::m_splitEvtColDir
Gaudi::Property< bool > m_splitEvtColDir
Definition: GaudiTuples.h:362
template<class PBASE>

bool GaudiTuples< PBASE >::splitNTupleDir | ( |  | ) | const
| inline

get the flag for N-Tuple path split (property "NTupleSplitDir")

Definition at line 206 of file GaudiTuples.h.

206 { return m_splitNTupleDir; }
GaudiTuples::m_splitNTupleDir
Gaudi::Property< bool > m_splitNTupleDir
Definition: GaudiTuples.h:351
template<class PBASE>

bool GaudiTuples< PBASE >::tuplesPrint | ( |  | ) | const
| inline

print tuples at finalization

Definition at line 232 of file GaudiTuples.h.

232 { return m_tuplesPrint; }
GaudiTuples::m_tuplesPrint
Gaudi::Property< bool > m_tuplesPrint
Definition: GaudiTuples.h:350

## Member Data Documentation

template<class PBASE>

Gaudi::Property<std::string> GaudiTuples< PBASE >::m_evtColDir
| private

Initial value:
{this, "EvtColDir",
boost::algorithm::replace_all_copy( this->name(), ":", "_" ),
"Subdirectory for Event Tag Collections"}

Definition at line 367 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<std::string> GaudiTuples< PBASE >::m_evtColLUN {this, "EvtColLUN", "EVTCOL", "Logical File Unit for Event Tag Collections"}
| private

Definition at line 364 of file GaudiTuples.h.

template<class PBASE>

TupleMapID GaudiTuples< PBASE >::m_evtColMapID
| mutable private

the actual storage of event collections by ID

Definition at line 379 of file GaudiTuples.h.

template<class PBASE>

TupleMapTitle GaudiTuples< PBASE >::m_evtColMapTitle
| mutable private

the actual storage of event collections by title

Definition at line 377 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<TupleID::NumericID> GaudiTuples< PBASE >::m_evtColOffSet {this, "EvtColOffSet", 0, "offset for numerical N-tuple ID"}
| private

Definition at line 363 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<bool> GaudiTuples< PBASE >::m_evtColsPrint {this, "EvtColsPrint", false, "print statistics for Event Tag Collections "}
| private

Definition at line 361 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<std::string> GaudiTuples< PBASE >::m_evtColTopDir
| private

Initial value:
{this, "EvtColTopDir", "",
"Top-level directory for Event Tag Collections"}

Definition at line 365 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<std::string> GaudiTuples< PBASE >::m_nTupleDir
| private

Initial value:
{
this, "NTupleDir", boost::algorithm::replace_all_copy( this->name(), ":", "_" ), "subdirectory for N-Tuples"}

Definition at line 356 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<std::string> GaudiTuples< PBASE >::m_nTupleLUN {this, "NTupleLUN", "FILE1", "Logical File Unit for N-tuples"}
| private

Definition at line 354 of file GaudiTuples.h.

template<class PBASE>

TupleMapID GaudiTuples< PBASE >::m_nTupleMapID
| mutable private

the actual storage of ntuples by ID

Definition at line 374 of file GaudiTuples.h.

template<class PBASE>

TupleMapTitle GaudiTuples< PBASE >::m_nTupleMapTitle
| mutable private

the actual storage of ntuples by title

Definition at line 372 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<TupleID::NumericID> GaudiTuples< PBASE >::m_nTupleOffSet {this, "NTupleOffSet", 0, "offset for numerical N-tuple ID"}
| private

Definition at line 353 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<std::string> GaudiTuples< PBASE >::m_nTupleTopDir {this, "NTupleTopDir", "", "top-level directory for N-Tuples"}
| private

Definition at line 355 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<bool> GaudiTuples< PBASE >::m_produceEvtCols
| private

Initial value:
{this, "EvtColsProduce", false,
"general switch to enable/disable Event Tag Collections"}

Definition at line 359 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<bool> GaudiTuples< PBASE >::m_produceNTuples {this, "NTupleProduce", true, "general switch to enable/disable N-tuples"}
| private

Definition at line 349 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<bool> GaudiTuples< PBASE >::m_splitEvtColDir {this, "EvtColSplitDir", false, "split long directory names into short pieces"}
| private

Definition at line 362 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<bool> GaudiTuples< PBASE >::m_splitNTupleDir
| private

Initial value:
{this, "NTupleSplitDir", false,
"split long directory names into short pieces (suitable for HBOOK)"}

Definition at line 351 of file GaudiTuples.h.

template<class PBASE>

Gaudi::Property<bool> GaudiTuples< PBASE >::m_tuplesPrint {this, "NTuplePrint", true, "print N-tuple statistics"}
| private

Definition at line 350 of file GaudiTuples.h.

The documentation for this class was generated from the following files:

- GaudiAlg/GaudiAlg/GaudiTuples.h
- GaudiAlg/GaudiAlg/GaudiTuples.icpp