| The Gaudi Framework v30r0 (c919700c)

- 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, 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...
| ~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, typename = std::enable_if_t<std::is_base_of<GaudiHistoAlg, PBASE>::value, U>>

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.

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

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 296 of file GaudiTuples.h.

297 : PBASE( type, name, parent )
298 {
299 initGaudiTuplesConstructor();
300 }
GaudiTuples::initGaudiTuplesConstructor
void initGaudiTuplesConstructor()
Constructor initialization and job options.
Definition: GaudiTuples.h:332
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 349 of file GaudiTuples.icpp.

351 {
352 return Tuples::createTupleObj( this, "EvtCol '" + name + "'", tuple, clid, Tuples::EVTCOL );
353 }
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:231
Tuples::EVTCOL
Definition: TupleObj.h:86
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 338 of file GaudiTuples.icpp.

340 {
341 return Tuples::createTupleObj( this, "Tuple '" + name + "'", tuple, clid, Tuples::NTUPLE );
342 }
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:231
Tuples::NTUPLE
Definition: TupleObj.h:85
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 185 of file GaudiTuples.icpp.

186 {
187 // look up in the table
188 Tuples::TupleObj* tuple = m_evtColMapTitle[title];
189 if ( tuple ) {
190 return Tuple( tuple );
191 } // RETURN
192 // Create the tuple ID
193 TupleID ID;
194 if ( this->useNumericAutoIDs() || title.empty() ) {
195 if ( !this->useNumericAutoIDs() ) {
196 this->Warning(
197 "Cannot generate automatic literal ID from an empty title ! Using numeric ID instead for evtCol ID",
198 StatusCode::SUCCESS )
199 .ignore();
200 }
201 // proposed the tuple ID
202 ID = TupleID( m_evtColMapID.size() + 1 + evtColOffSet() );
203 // adjust the proposed ID
204 while ( nTupleExists( ID ) || evtColExists( ID ) ) {
205 ID = TupleID( ID.numeric() + 1 );
206 }
207 } else {
208 // use the title to create a unique literal ID
209 ID = TupleID( this->convertTitleToID( title ) );
210 // Just in case ...
211 while ( nTupleExists( ID ) || evtColExists( ID ) ) {
212 ID = TupleID( ID.idAsString() + "_" );
213 }
214 }
215 // return
216 return evtCol( ID, title, clid );
217 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
std::string::empty
T empty(T...args)
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:199
GaudiTuples::nTupleExists
bool nTupleExists(const TupleID &ID) const
check the existence AND validity of the N-Tuple with the given ID
Definition: GaudiTuples.icpp:413
GaudiTuples::m_evtColMapTitle
TupleMapTitle m_evtColMapTitle
the actual storage of event collections by title
Definition: GaudiTuples.h:375
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:185
GaudiTuples::m_evtColMapID
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:377
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:199
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:421
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 280 of file GaudiTuples.icpp.

281 {
282 // Check ID
283 if ( ID.undefined() ) {
284 this->Error( "Undefined NTuple ID : Title='" + title1 + "'" ).ignore();
285 return Tuple( 0 );
286 }
287
288 // look up in the table
289 Tuples::TupleObj* tuple = m_evtColMapID[ID];
290 if ( tuple ) {
291 return Tuple( tuple );
292 } // RETURN
293
294 // convert ID to the string
295 const std::string tID = ID.idAsString();
296
297 // adjust the NTuple title
298 const std::string title = title1.empty() ? ( "EvtCol #" + tID ) : title1;
299
300 // book new ntuple
301 if ( produceEvtCols() ) {
302 // book NTuple
303 NTuple::Tuple* tup = nullptr;
304 if ( ID.numeric() ) {
305 tup = this->evtColSvc()->book( evtColPath(), ID.numericID(), clid, title );
306 } else if ( ID.literal() ) {
307 tup = this->evtColSvc()->book( evtColPath(), ID.literalID(), clid, title );
308 } else {
309 this->Error( "Undefined NTuple ID" ).ignore();
310 }
311
312 // assertion
313 this->Assert( tup, "Could not book the EvtCol='" + title + "'" );
314 // some printout
315 if ( tup->registry() && this->msgLevel( MSG::DEBUG ) ) {
316 this->debug() << "Booked EvtCol '" << title << "' ID=" << tID << "' Path='" << evtColPath() << "' TS='"
317 << tup->registry()->identifier() << "'" << endmsg;
318 }
319
320 tuple = createEvtCol( title, tup, clid );
321 } else {
322 tuple = createEvtCol( title, (NTuple::Tuple*)0, clid );
323 }
324 // increment the reference
325 tuple->addRef();
326 //
327 m_evtColMapID[ID] = tuple;
328 //
329 tuple->addRef();
330 m_evtColMapTitle[title] = tuple;
331 // return
332 return Tuple( tuple );
333 }
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:349
GaudiTuples::m_evtColMapTitle
TupleMapTitle m_evtColMapTitle
the actual storage of event collections by title
Definition: GaudiTuples.h:375
GaudiTuples::Tuple
Tuples::Tuple Tuple
the actual type of the tuple
Definition: GaudiTuples.h:46
MSG::DEBUG
Definition: IMessageSvc.h:16
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
std::string
STL class.
GaudiTuples::m_evtColMapID
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:377
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:199
Tuples::TupleObj::addRef
unsigned long addRef()
add the reference to TupleObj
Definition: TupleObj.h:1964
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:412
GaudiTuples::evtColPath
std::string evtColPath() const
get the constructed Event Tag Collection path
Definition: GaudiTuples.icpp:466
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:209
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:365
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 421 of file GaudiTuples.icpp.

422 {
423 return m_evtColMapID.end() != m_evtColMapID.find( ID );
424 }
GaudiTuples::m_evtColMapID
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:377
GaudiUtils::Map::end
iterator end()
Definition: Map.h:134
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:151
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:362
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:377
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:375
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:361
template<class PBASE >

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

get the constructed Event Tag Collection path

Definition at line 466 of file GaudiTuples.icpp.

467 {
468 std::string path = evtColLUN() + "/" + evtColTopDir() + evtColDir();
469 return ( splitEvtColDir() ? dirHbookName( path ) : path );
470 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
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:359
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:363
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:370
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:199
GaudiTuples::m_evtColMapTitle
TupleMapTitle m_evtColMapTitle
the actual storage of event collections by title
Definition: GaudiTuples.h:375
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:377
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:358
GaudiTuples::printEvtCols
long printEvtCols() const
perform the actual printout of Event Tag Collections
Definition: GaudiTuples.icpp:386
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:372
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:209
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 332 of file GaudiTuples.h.

333 {
334 m_tuplesPrint.declareUpdateHandler( &GaudiTuples<PBASE>::printNTupleHandler, this );
335 m_evtColsPrint.declareUpdateHandler( &GaudiTuples<PBASE>::printEvtColHandler, this );
336 }
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:359
GaudiTuples::m_tuplesPrint
Gaudi::Property< bool > m_tuplesPrint
Definition: GaudiTuples.h:348
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:29
MSG::DEBUG
Definition: IMessageSvc.h:16
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:61
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:466
GaudiTuples::nTuplePath
std::string nTuplePath() const
get the constructed N-Tuple path
Definition: GaudiTuples.icpp:457
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:209
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 .ignore();
161 }
162 // propose the tuple ID
163 ID = TupleID( m_nTupleMapID.size() + 1 + nTupleOffSet() );
164 // adjust the proposed ID
165 while ( nTupleExists( ID ) || evtColExists( ID ) ) {
166 ID = TupleID( ID.numeric() + 1 );
167 }
168 } else {
169 // use the title to create a unique literal ID
170 ID = TupleID( this->convertTitleToID( title ) );
171 // Just in case ...
172 while ( nTupleExists( ID ) || evtColExists( ID ) ) {
173 ID = TupleID( ID.idAsString() + "_" );
174 }
175 }
176 // return
177 return nTuple( ID, title, clid );
178 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
std::string::empty
T empty(T...args)
GaudiTuples::m_nTupleMapTitle
TupleMapTitle m_nTupleMapTitle
the actual storage of ntuples by title
Definition: GaudiTuples.h:370
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:199
GaudiTuples::nTupleExists
bool nTupleExists(const TupleID &ID) const
check the existence AND validity of the N-Tuple with the given ID
Definition: GaudiTuples.icpp:413
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:421
GaudiTuples::m_nTupleMapID
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:372
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 224 of file GaudiTuples.icpp.

225 {
226 // Check ID
227 if ( ID.undefined() ) {
228 this->Error( "Undefined NTuple ID : Title='" + title1 + "'" ).ignore();
229 return Tuple( 0 );
230 }
231
232 // look up in the table
233 Tuples::TupleObj* tuple = m_nTupleMapID[ID];
234 if ( tuple ) {
235 return Tuple( tuple );
236 } // RETURN
237
238 // convert ID to the string
239 const std::string tID = ID.idAsString();
240
241 // adjust the NTuple title
242 const std::string title = title1.empty() ? ( "NTuple #" + tID ) : title1;
243
244 // book new ntuple
245 if ( produceNTuples() ) {
246 // book NTupel
247 NTuple::Tuple* tup = nullptr;
248 if ( ID.numeric() ) {
249 tup = this->ntupleSvc()->book( nTuplePath(), ID.numericID(), clid, title );
250 } else if ( ID.literal() ) {
251 tup = this->ntupleSvc()->book( nTuplePath(), ID.literalID(), clid, title );
252 } else {
253 this->Error( "Undefined NTuple ID" ).ignore();
254 }
255
256 // assertion
257 this->Assert( tup, "Could not book the N-Tuple='" + title + "'" );
258 // some printout
259 if ( tup->registry() && this->msgLevel( MSG::DEBUG ) ) {
260 this->debug() << "Booked NTuple '" << title << "' ID=" << tID << "' Path='" << nTuplePath() << "' TS='"
261 << tup->registry()->identifier() << "'" << endmsg;
262 }
263
264 tuple = createNTuple( title, tup, clid );
265 } else {
266 tuple = createNTuple( title, (NTuple::Tuple*)0, clid );
267 }
268 // increment the reference
269 tuple->addRef();
270 //
271 m_nTupleMapID[ID] = tuple;
272 //
273 tuple->addRef();
274 m_nTupleMapTitle[title] = tuple;
275 // return
276 return Tuple( tuple );
277 }
std::string::empty
T empty(T...args)
GaudiTuples::m_nTupleMapTitle
TupleMapTitle m_nTupleMapTitle
the actual storage of ntuples by title
Definition: GaudiTuples.h:370
GaudiTuples::Tuple
Tuples::Tuple Tuple
the actual type of the tuple
Definition: GaudiTuples.h:46
MSG::DEBUG
Definition: IMessageSvc.h:16
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:73
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:199
Tuples::TupleObj::addRef
unsigned long addRef()
add the reference to TupleObj
Definition: TupleObj.h:1964
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:412
GaudiTuples::createNTuple
virtual Tuples::TupleObj * createNTuple(const std::string &name, NTuple::Tuple *tuple, const CLID &clid) const
create TupleObj
Definition: GaudiTuples.icpp:338
GaudiTuples::m_nTupleMapID
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:372
GaudiTuples::nTuplePath
std::string nTuplePath() const
get the constructed N-Tuple path
Definition: GaudiTuples.icpp:457
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:209
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:354
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 413 of file GaudiTuples.icpp.

414 {
415 return m_nTupleMapID.end() != m_nTupleMapID.find( ID );
416 }
GaudiUtils::Map::end
iterator end()
Definition: Map.h:134
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:151
GaudiTuples::m_nTupleMapID
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:372
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:352
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:372
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:370
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:351
template<class PBASE >

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

get the constructed N-Tuple path

Definition at line 457 of file GaudiTuples.icpp.

458 {
459 const std::string path = nTupleLUN() + "/" + nTupleTopDir() + nTupleDir();
460 return ( splitNTupleDir() ? dirHbookName( path ) : path );
461 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
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:353
template<class PBASE >

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

handler for "EvtColsPrint" property

Definition at line 443 of file GaudiTuples.icpp.

444 {
445 // no action if not yet initialized
446 if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) {
447 return;
448 }
449 if ( this->evtColsPrint() ) {
450 this->printEvtCols();
451 }
452 }
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:17
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:386
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 386 of file GaudiTuples.icpp.

387 {
388 if ( evtColMapTitle().empty() && evtColMapID().empty() ) {
389 this->always() << "No Event Tag Collections are booked" << endmsg;
390 } else {
391 this->always() << "List of booked Event Tag Collections in directory "
392 << "\"" << evtColPath() << "\"" << endmsg;
393 }
394 for ( const auto& entry : ordered( evtColMapID() ) ) {
395 if ( !entry.second ) {
396 continue;
397 }
398 const auto tuple = entry.second->tuple();
399 if ( !tuple ) {
400 this->error() << " NTuple::Tuple* points to NULL" << endmsg;
401 continue;
402 }
403 this->always() << GaudiAlg::PrintTuple::print( tuple, entry.first )
404 << " Items:" << Gaudi::Utils::toString( entry.second->items() ) << endmsg;
405 }
406 //
407 return this->evtColMapID().size();
408 }
GaudiAlg::PrintTuple::print
static std::string print(const INTuple *tuple, const GaudiAlg::TupleID &ID)
Definition: Print.cpp:151
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:199
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:346
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:466
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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 429 of file GaudiTuples.icpp.

430 {
431 // no action if not yet initialized
432 if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) {
433 return;
434 }
435 if ( this->tuplesPrint() ) {
436 this->printTuples();
437 }
438 }
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:17
GaudiTuples::printTuples
long printTuples() const
perform the actual printout of N-tuples
Definition: GaudiTuples.icpp:358
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 358 of file GaudiTuples.icpp.

359 {
360
361 if ( nTupleMapTitle().empty() && nTupleMapID().empty() ) {
362 if ( this->msgLevel( MSG::DEBUG ) ) this->debug() << "No N-Tuples are booked" << endmsg;
363 } else {
364 this->always() << "List of booked N-Tuples in directory "
365 << "\"" << nTuplePath() << "\"" << endmsg;
366 }
367
368 for ( const auto& entry : ordered( nTupleMapID() ) ) {
369 if ( !entry.second ) {
370 continue;
371 }
372 const NTuple::Tuple* tuple = entry.second->tuple();
373 if ( !tuple ) {
374 this->error() << " NTuple::Tuple* points to NULL" << endmsg;
375 continue;
376 }
377 this->always() << GaudiAlg::PrintTuple::print( tuple, entry.first ) << endmsg;
378 }
379 //
380 return this->nTupleMapID().size();
381 }
GaudiAlg::PrintTuple::print
static std::string print(const INTuple *tuple, const GaudiAlg::TupleID &ID)
Definition: Print.cpp:151
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:199
MSG::DEBUG
Definition: IMessageSvc.h:16
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:412
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:457
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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:357
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:347
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:360
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:349
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:348

## 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 365 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 362 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 377 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 375 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 361 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 359 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 363 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 354 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 352 of file GaudiTuples.h.

template<class PBASE>

TupleMapID GaudiTuples< PBASE >::m_nTupleMapID
| mutable private

the actual storage of ntuples by ID

Definition at line 372 of file GaudiTuples.h.

template<class PBASE>

TupleMapTitle GaudiTuples< PBASE >::m_nTupleMapTitle
| mutable private

the actual storage of ntuples by title

Definition at line 370 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 351 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 353 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 357 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 347 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 360 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 349 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 348 of file GaudiTuples.h.

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

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