All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GaudiTuples< PBASE > Class Template Reference

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

#include <GaudiAlg/GaudiTuples.h>

Inheritance diagram for GaudiTuples< PBASE >:
Collaboration diagram for GaudiTuples< PBASE >:

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...
 
 GaudiTuples (const std::string &name, ISvcLocator *pSvcLocator)
 Algorithm constructor. More...
 
 GaudiTuples (const std::string &type, const std::string &name, const IInterface *parent)
 Tool constructor. More...
 
virtual ~GaudiTuples ()
 Destructor. More...
 

Protected Member Functions

const TupleMapTitlenTupleMapTitle () const
 access to the all ntuples by title More...
 
const TupleMapTitleevtColMapTitle () const
 access to the all evet tag collections by title More...
 
const TupleMapIDnTupleMapID () const
 access to the all ntuples by numeric ID More...
 
const TupleMapIDevtColMapID () const
 access to the all evet tag collections by numeric ID More...
 
virtual Tuples::TupleObjcreateNTuple (const std::string &name, NTuple::Tuple *tuple, const CLID &clid) const
 create TupleObj More...
 
virtual Tuples::TupleObjcreateEvtCol (const std::string &name, NTuple::Tuple *tuple, const CLID &clid) const
 create TupleObj for event tag collection More...
 
virtual StatusCode initialize ()
 standard initialization method More...
 
virtual StatusCode finalize ()
 standard finalization method More...
 

Private Member Functions

void initGaudiTuplesConstructor ()
 Constructor initialization and job options. More...
 
void printNTupleHandler (Property &)
 handler for "NTuplePrint" property More...
 
void printEvtColHandler (Property &)
 handler for "EvtColsPrint" property More...
 

Private Attributes

bool m_produceNTuples
 flag to switch ON/OFF the ntuple filling and booking More...
 
bool m_splitNTupleDir
 flag to indicate splitting of tuple directories (useful for HBOOK) More...
 
std::string m_nTupleLUN
 name of logical unit for tuple directory More...
 
std::string m_nTupleTopDir
 top level tuple directory More...
 
std::string m_nTupleDir
 local tuple directory More...
 
TupleID::NumericID m_nTupleOffSet
 the offset for ntuple numerical ID More...
 
bool m_produceEvtCols
 flag to switch ON/OFF the ntuple filling and booking More...
 
bool m_splitEvtColDir
 flag to indicate splitting of tuple directories (useful for HBOOK) More...
 
std::string m_evtColLUN
 name of Logical Unit for tuple directory More...
 
std::string m_evtColTopDir
 top level tuple directory More...
 
std::string m_evtColDir
 local tuple directory More...
 
TupleID::NumericID m_evtColOffSet
 the offset for ntuple numerical ID More...
 
bool m_tuplesPrint
 print tuples at finalization? More...
 
bool m_evtColsPrint
 print event collections at finalization More...
 
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 37 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 42 of file GaudiTuples.h.

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

the actual type of the tuple

Definition at line 44 of file GaudiTuples.h.

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

the actual type of N-tuple ID

Definition at line 46 of file GaudiTuples.h.

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

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

Definition at line 50 of file GaudiTuples.h.

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

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

Definition at line 48 of file GaudiTuples.h.

Constructor & Destructor Documentation

template<class PBASE>
GaudiTuples< PBASE >::GaudiTuples ( const std::string &  name,
ISvcLocator pSvcLocator 
)

Algorithm constructor.

template<class PBASE>
GaudiTuples< PBASE >::GaudiTuples ( const std::string &  type,
const std::string &  name,
const IInterface parent 
)

Tool constructor.

template<class PBASE >
GaudiTuples< PBASE >::~GaudiTuples ( )
virtual

Destructor.

Definition at line 39 of file GaudiTuples.icpp.

39 {}

Member Function Documentation

template<class PBASE >
Tuples::TupleObj * GaudiTuples< PBASE >::createEvtCol ( const std::string &  name,
NTuple::Tuple tuple,
const CLID clid 
) const
protectedvirtual

create TupleObj for event tag collection

Attention
The method should never used directly by users
Parameters
namename/title
tuplethe underlying ntuple implementation
clidunique classID for ntuple
Returns
pointer to newly created TupelObj

Definition at line 358 of file GaudiTuples.icpp.

361 {
363  ( this , "EvtCol '" + name + "'" , tuple , clid , Tuples::EVTCOL ) ;
364 }
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:243
template<class PBASE >
Tuples::TupleObj * GaudiTuples< PBASE >::createNTuple ( const std::string &  name,
NTuple::Tuple tuple,
const CLID clid 
) const
protectedvirtual

create TupleObj

Attention
The method should never used directly by users
Parameters
namename/title
tuplethe underlying ntuple implementation
clidunique classID for ntuple
Returns
pointer to newly created TupleObj

Definition at line 344 of file GaudiTuples.icpp.

347 {
349  ( this , "Tuple '" + name + "'" , tuple , clid , Tuples::NTUPLE ) ;
350 }
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:243
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
titleUnique title for Event Tag Collection
clidN-Tuple class identifier (row or column wise)
Returns
ntuple The Event Tag Collection object

Definition at line 183 of file GaudiTuples.icpp.

185 {
186  // look up in the table
187  Tuples::TupleObj* tuple = m_evtColMapTitle[ title ] ;
188  if ( 0 != tuple ) { return Tuple( tuple ) ; } // RETURN
189  // Create the tuple ID
190  TupleID ID;
191  if ( this->useNumericAutoIDs() || title.empty() )
192  {
193  if ( ! this->useNumericAutoIDs() )
194  {
195  this -> Warning( "Cannot generate automatic literal ID from an empty title ! Using numeric ID instead for evtCol ID",
197  }
198  // proposed the tuple ID
199  ID = TupleID ( m_evtColMapID.size() + 1 + evtColOffSet() ) ;
200  // adjust the proposed ID
201  while ( nTupleExists(ID) || evtColExists(ID) )
202  { ID = TupleID ( ID.numeric() + 1 ) ; }
203  }
204  else
205  {
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  // return
213  return evtCol( ID , title , clid ) ;
214 }
size_type size() const
Definition: Map.h:180
bool nTupleExists(const TupleID &ID) const
check the existence AND validity of the N-Tuple with the given ID
TupleMapTitle m_evtColMapTitle
the actual storage of event collections by title
Definition: GaudiTuples.h:443
Tuples::Tuple Tuple
the actual type of the tuple
Definition: GaudiTuples.h:44
Tuple evtCol(const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const
Access an Event Tag Collection object (book on-demand) with unique identifier.
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:445
GaudiAlg::TupleID TupleID
the actual type of N-tuple ID
Definition: GaudiTuples.h:46
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: TupleObj.h:180
bool evtColExists(const TupleID &ID) const
check the existence AND validity of the Event Tag Collection with the given ID
TupleID::NumericID evtColOffSet() const
get the value for Event Tag Collection offset (property "EvtColsOffSet")
Definition: GaudiTuples.h:232
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
IDThe forced Event Tag Collection ID
titleUnique title for Event Tag Collection
clidN-Tuple class identifier (row or column wise)
Returns
ntuple The Event Tag Collection object

Definition at line 282 of file GaudiTuples.icpp.

285 {
286  // Check ID
287  if ( ID.undefined() )
288  { this->Error("Undefined NTuple ID : Title='"+title1+"'"); return Tuple(0); }
289 
290  // look up in the table
291  Tuples::TupleObj* tuple = m_evtColMapID[ID] ;
292  if ( 0 != tuple ) { return Tuple( tuple ) ; } // 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  {
303  // book NTuple
304  NTuple::Tuple* tup = 0;
305  if ( ID.numeric() )
306  {
307  tup = this->evtColSvc()->book ( evtColPath() , ID.numericID() , clid , title ) ;
308  }
309  else if ( ID.literal() )
310  {
311  tup = this->evtColSvc()->book ( evtColPath() , ID.literalID() , clid , title ) ;
312  }
313  else { this->Error( "Undefined NTuple ID" ); }
314 
315  // assertion
316  this->Assert( 0 != tup , "Could not book the EvtCol='" + title + "'" ) ;
317  // some printout
318  if( 0 != tup -> registry() && this->msgLevel(MSG::DEBUG) )
319  { this->debug() << "Booked EvtCol '" << title << "' ID=" << tID
320  << "' Path='" << evtColPath() << "' TS='"
321  << tup -> registry() -> identifier() << "'" << endmsg ; }
322 
323  tuple = createEvtCol ( title , tup , clid ) ;
324  }
325  else
326  {
327  tuple = createEvtCol ( title , (NTuple::Tuple*) 0 , clid ) ;
328  }
329  // increment the reference
330  tuple -> addRef();
331  //
332  m_evtColMapID [ ID ] = tuple ;
333  //
334  tuple -> addRef();
335  m_evtColMapTitle[ title ] = tuple ;
336  // return
337  return Tuple( tuple ) ;
338 }
virtual Tuples::TupleObj * createEvtCol(const std::string &name, NTuple::Tuple *tuple, const CLID &clid) const
create TupleObj for event tag collection
TupleMapTitle m_evtColMapTitle
the actual storage of event collections by title
Definition: GaudiTuples.h:443
Tuples::Tuple Tuple
the actual type of the tuple
Definition: GaudiTuples.h:44
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:445
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: TupleObj.h:180
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
std::string evtColPath() const
get the constructed Event Tag Collection path
bool produceEvtCols() const
get the flag for Event Tag Collection production (property "EvtColsProduce")
Definition: GaudiTuples.h:222
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 230 of file GaudiTuples.h.

230 { return m_evtColDir ; }
std::string m_evtColDir
local tuple directory
Definition: GaudiTuples.h:428
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 436 of file GaudiTuples.icpp.

437 {
438  return m_evtColMapID.end() != m_evtColMapID.find ( ID ) ;
439 }
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:445
iterator end()
Definition: Map.h:131
iterator find(const key_type &key)
Definition: Map.h:148
template<class PBASE>
const std::string& GaudiTuples< PBASE >::evtColLUN ( ) const
inline

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

Definition at line 226 of file GaudiTuples.h.

226 { return m_evtColLUN ; }
std::string m_evtColLUN
name of Logical Unit for tuple directory
Definition: GaudiTuples.h:424
template<class PBASE>
const TupleMapID& GaudiTuples< PBASE >::evtColMapID ( ) const
inlineprotected

access to the all evet tag collections by numeric ID

Definition at line 267 of file GaudiTuples.h.

267 { return m_evtColMapID ; }
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:445
template<class PBASE>
const TupleMapTitle& GaudiTuples< PBASE >::evtColMapTitle ( ) const
inlineprotected

access to the all evet tag collections by title

Definition at line 263 of file GaudiTuples.h.

263 { return m_evtColMapTitle ; }
TupleMapTitle m_evtColMapTitle
the actual storage of event collections by title
Definition: GaudiTuples.h:443
template<class PBASE>
TupleID::NumericID GaudiTuples< PBASE >::evtColOffSet ( ) const
inline

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

Definition at line 232 of file GaudiTuples.h.

232 { return m_evtColOffSet ; }
TupleID::NumericID m_evtColOffSet
the offset for ntuple numerical ID
Definition: GaudiTuples.h:430
template<class PBASE >
std::string GaudiTuples< PBASE >::evtColPath ( ) const

get the constructed Event Tag Collection path

Definition at line 473 of file GaudiTuples.icpp.

474 {
475  std::string path = evtColLUN() + "/" + evtColTopDir() + evtColDir();
476  return ( splitEvtColDir() ? dirHbookName( path ) : path );
477 }
bool splitEvtColDir() const
get the flag for Event Tag Collection path split (property "EvtColsSplitDir")
Definition: GaudiTuples.h:224
const std::string & evtColDir() const
get the Event Tag Collection directory (property "EvtColsDir")
Definition: GaudiTuples.h:230
const std::string & evtColTopDir() const
get the top-level Event Tag Collection directory (property "EvtColsTopDir")
Definition: GaudiTuples.h:228
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
const std::string & evtColLUN() const
get the logical unit for Event Tag Collections (property "EvtColsLUN")
Definition: GaudiTuples.h:226
template<class PBASE>
bool GaudiTuples< PBASE >::evtColsPrint ( ) const
inline

print event collections at finalization

Definition at line 238 of file GaudiTuples.h.

238 { return m_evtColsPrint ; }
bool m_evtColsPrint
print event collections at finalization
Definition: GaudiTuples.h:435
template<class PBASE>
const std::string& GaudiTuples< PBASE >::evtColTopDir ( ) const
inline

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

Definition at line 228 of file GaudiTuples.h.

228 { return m_evtColTopDir ; }
std::string m_evtColTopDir
top level tuple directory
Definition: GaudiTuples.h:426
template<class PBASE >
StatusCode GaudiTuples< PBASE >::finalize ( )
protectedvirtual

standard finalization method

Returns
status code

Reimplemented in GaudiTupleTool, and GaudiTupleAlg.

Definition at line 93 of file GaudiTuples.icpp.

94 {
95  if ( !( nTupleMapTitle () . empty () &&
96  nTupleMapID () . empty () &&
97  evtColMapTitle () . empty () &&
98  evtColMapID () . empty ()
99  ) )
100  {
101  const int nNtuples = nTupleMapID () . size () ;
102  const int nEvtCols = evtColMapID () . size ();
103  this->always()
104  << "Booked " << nNtuples << " N-Tuples and " << nEvtCols
105  << " Event Tag Collections" << endmsg ;
106  }
107 
108  if ( produceNTuples () && tuplesPrint () ) { printTuples () ; }
109  if ( produceEvtCols () && evtColsPrint () ) { printEvtCols () ; }
110 
111  { // release ntuples and clear the container
113  m_nTupleMapTitle.end() != itup ; ++itup )
114  { if( 0 != itup->second ) { itup->second->release() ; } }
116  }
117  { // release ntuples and clear the container
119  m_nTupleMapID.end() != itup ; ++itup )
120  { if( 0 != itup->second ) { itup->second->release() ; } }
122  }
123  { // release ntuples and clear the container
125  m_evtColMapTitle.end() != itup ; ++itup )
126  { if( 0 != itup->second ) { itup->second->release() ; } }
128  }
129  { // release ntuples and clear the container
131  m_evtColMapID.end() != itup ; ++itup )
132  { if( 0 != itup->second ) { itup->second->release() ; } }
133  m_evtColMapID.clear() ;
134  }
135  // finalize base class
136  return PBASE::finalize();
137 }
TupleMapTitle m_nTupleMapTitle
the actual storage of ntuples by title
Definition: GaudiTuples.h:438
TupleMapTitle m_evtColMapTitle
the actual storage of event collections by title
Definition: GaudiTuples.h:443
bool evtColsPrint() const
print event collections at finalization
Definition: GaudiTuples.h:238
TupleMapID m_evtColMapID
the actual storage of event collections by ID
Definition: GaudiTuples.h:445
iterator end()
Definition: Map.h:131
const TupleMapTitle & nTupleMapTitle() const
access to the all ntuples by title
Definition: GaudiTuples.h:261
const TupleMapTitle & evtColMapTitle() const
access to the all evet tag collections by title
Definition: GaudiTuples.h:263
long printTuples() const
perform the actual printout of N-tuples
long printEvtCols() const
perform the actual printout of Event Tag Collections
bool tuplesPrint() const
print tuples at finalization
Definition: GaudiTuples.h:236
iterator begin()
Definition: Map.h:130
map_type::iterator iterator
Definition: Map.h:98
const TupleMapID & nTupleMapID() const
access to the all ntuples by numeric ID
Definition: GaudiTuples.h:265
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:440
bool produceEvtCols() const
get the flag for Event Tag Collection production (property "EvtColsProduce")
Definition: GaudiTuples.h:222
void clear()
Definition: Map.h:176
bool produceNTuples() const
get the flag for N-Tuple production (property "NTupleProduce")
Definition: GaudiTuples.h:208
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
const TupleMapID & evtColMapID() const
access to the all evet tag collections by numeric ID
Definition: GaudiTuples.h:267
template<class PBASE>
void GaudiTuples< PBASE >::initGaudiTuplesConstructor ( )
inlineprivate

Constructor initialization and job options.

Definition at line 330 of file GaudiTuples.h.

331  {
332  m_produceNTuples = true ; // Switch ON/OFF ntuple production
333  m_splitNTupleDir = false ; // for HBOOK it is better to use 'true'
334  m_nTupleLUN = "FILE1" ; // logical unit for ntuples
335  m_nTupleTopDir = "" ; // top level ntuple directory
336  m_nTupleDir = this->name() ; // ntuple directory
337  m_nTupleOffSet = 0 ; // offset for ntuples
338  //
339  m_produceEvtCols = false ; // Switch ON/OFF ntupel production
340  m_splitEvtColDir = false ; // for HBOOK it is better to use 'true'
341  m_evtColLUN = "EVTCOL" ; // logical unit for ntuples
342  m_evtColTopDir = "" ; // top level ntuple directory
343  m_evtColDir = this->name() ; // ntuple directory
344  m_evtColOffSet = 0 ; // offset for ntuples
345  //
346  m_tuplesPrint = true ; // print tuples at end of job
347  m_evtColsPrint = false ; // print event collections at end of job
348  //
349  this -> declareProperty
350  ( "NTupleProduce" , m_produceNTuples ,
351  "General switch to enable/disable N-tuples" ) ;
352  this -> declareProperty
353  ( "NTuplePrint" , m_tuplesPrint ,
354  "Print N-tuple statistics" )
355  -> declareUpdateHandler ( &GaudiTuples<PBASE>::printNTupleHandler , this ) ;
356  this -> declareProperty
357  ( "NTupleSplitDir" , m_splitNTupleDir ,
358  "Split long directory names into short pieces (suitable for HBOOK)" ) ;
359  this -> declareProperty
360  ( "NTupleOffSet" , m_nTupleOffSet ,
361  "Offset for numerical N-tuple ID" ) ;
362  this -> declareProperty
363  ( "NTupleLUN" , m_nTupleLUN ,
364  "Logical File Unit for N-tuples" ) ;
365  this -> declareProperty
366  ( "NTupleTopDir" , m_nTupleTopDir ,
367  "Top-level directory for N-Tuples") ;
368  this -> declareProperty
369  ( "NTupleDir" , m_nTupleDir ,
370  "Subdirectory for N-Tuples" ) ;
371  // ========================================================================
372  this -> declareProperty
373  ( "EvtColsProduce" , m_produceEvtCols ,
374  "General switch to enable/disable Event Tag Collections" ) ;
375  this -> declareProperty
376  ( "EvtColsPrint" , m_evtColsPrint ,
377  "Print statistics for Event Tag Collections " )
378  -> declareUpdateHandler ( &GaudiTuples<PBASE>::printEvtColHandler , this ) ;
379  this -> declareProperty
380  ( "EvtColSplitDir" , m_splitEvtColDir ,
381  "Split long directory names into short pieces" ) ;
382  this -> declareProperty
383  ( "EvtColOffSet" , m_evtColOffSet ,
384  "Offset for numerical N-tuple ID" ) ;
385  this -> declareProperty
386  ( "EvtColLUN" , m_evtColLUN ,
387  "Logical File Unit for Event Tag Collections" ) ;
388  this -> declareProperty
389  ( "EvtColTopDir" , m_evtColTopDir ,
390  "Top-level directory for Event Tag Collections" ) ;
391  this -> declareProperty
392  ( "EvtColDir" , m_evtColDir ,
393  "Subdirectory for Event Tag Collections" ) ;
394  // ========================================================================
395  }
std::string m_nTupleTopDir
top level tuple directory
Definition: GaudiTuples.h:413
std::string m_nTupleLUN
name of logical unit for tuple directory
Definition: GaudiTuples.h:411
Templated base class providing common 'ntupling' methods.
Definition: GaudiTuples.h:37
std::string m_evtColDir
local tuple directory
Definition: GaudiTuples.h:428
TupleID::NumericID m_nTupleOffSet
the offset for ntuple numerical ID
Definition: GaudiTuples.h:417
TupleID::NumericID m_evtColOffSet
the offset for ntuple numerical ID
Definition: GaudiTuples.h:430
std::string m_evtColLUN
name of Logical Unit for tuple directory
Definition: GaudiTuples.h:424
bool m_splitEvtColDir
flag to indicate splitting of tuple directories (useful for HBOOK)
Definition: GaudiTuples.h:422
std::string m_evtColTopDir
top level tuple directory
Definition: GaudiTuples.h:426
bool m_splitNTupleDir
flag to indicate splitting of tuple directories (useful for HBOOK)
Definition: GaudiTuples.h:409
bool m_tuplesPrint
print tuples at finalization?
Definition: GaudiTuples.h:433
bool m_produceEvtCols
flag to switch ON/OFF the ntuple filling and booking
Definition: GaudiTuples.h:420
std::string m_nTupleDir
local tuple directory
Definition: GaudiTuples.h:415
bool m_produceNTuples
flag to switch ON/OFF the ntuple filling and booking
Definition: GaudiTuples.h:407
bool m_evtColsPrint
print event collections at finalization
Definition: GaudiTuples.h:435
template<class PBASE >
StatusCode GaudiTuples< PBASE >::initialize ( )
protectedvirtual

standard initialization method

Returns
status code

Reimplemented in GaudiTupleTool, and GaudiTupleAlg.

Definition at line 50 of file GaudiTuples.icpp.

51 {
52  // initialize base class
54  if ( sc.isFailure() ) return sc;
55 
56  if ( produceNTuples() )
57  {
58  // check the existance of service
59  if ( this->ntupleSvc() == 0 )
60  { return this->Error( "INTupleSvc* points to NULL!" ); }
61  // Print ntuple path
62  this->Print( "The N-Tuple path is set to be '" + nTuplePath() + "'",
63  StatusCode(StatusCode::SUCCESS, true) , MSG::DEBUG).ignore();
64  }
65  else
66  { this->debug() << "Production of N-Tuples is switched OFF" << endmsg; }
67 
68  if ( produceEvtCols() )
69  {
70  // check the existance of service
71  if ( 0 == this->evtColSvc() )
72  { return this->Error( "INTupleSvc* points to NULL!" ); }
73  // Print EvtCol path
74  this->Print( "The EventCol path is set to be '" + evtColPath() + "'",
75  StatusCode(StatusCode::SUCCESS, true) , MSG::DEBUG ).ignore();
76  }
77  else
78  { this->debug() << "Production of Event Collections is switched OFF" << endmsg; }
79 
80  return sc;
81 }
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:85
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
std::string evtColPath() const
get the constructed Event Tag Collection path
std::string nTuplePath() const
get the constructed N-Tuple path
bool produceEvtCols() const
get the flag for Event Tag Collection production (property "EvtColsProduce")
Definition: GaudiTuples.h:222
bool produceNTuples() const
get the flag for N-Tuple production (property "NTupleProduce")
Definition: GaudiTuples.h:208
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
titleUnique title for N-Tuple
clidN-Tuple class identifier (row or column wise)
Returns
ntuple The ntuple object

Definition at line 144 of file GaudiTuples.icpp.

146 {
147  // look up in the table
148  Tuples::TupleObj* tuple = m_nTupleMapTitle[ title ] ;
149  if ( 0 != tuple ) { return Tuple( tuple ) ; } // RETURN
150  // Create the tuple ID
151  TupleID ID;
152  if ( this->useNumericAutoIDs() || title.empty() )
153  {
154  if ( ! this->useNumericAutoIDs() )
155  {
156  this -> Warning( "Cannot generate automatic literal ID from an empty title ! Using numeric ID instead for nTuple ID",
158  }
159  // propose the tuple ID
160  ID = TupleID ( m_nTupleMapID.size() + 1 + nTupleOffSet() );
161  // adjust the proposed ID
162  while ( nTupleExists(ID) || evtColExists(ID) )
163  { ID = TupleID ( ID.numeric() + 1 ) ; }
164  }
165  else
166  {
167  // use the title to create a unique literal ID
168  ID = TupleID( this->convertTitleToID(title) );
169  // Just in case ...
170  while ( nTupleExists(ID) || evtColExists(ID) )
171  { ID = TupleID(ID.idAsString()+"_"); }
172  }
173  // return
174  return nTuple( ID , title , clid ) ;
175 }
TupleMapTitle m_nTupleMapTitle
the actual storage of ntuples by title
Definition: GaudiTuples.h:438
size_type size() const
Definition: Map.h:180
bool nTupleExists(const TupleID &ID) const
check the existence AND validity of the N-Tuple with the given ID
Tuples::Tuple Tuple
the actual type of the tuple
Definition: GaudiTuples.h:44
GaudiAlg::TupleID TupleID
the actual type of N-tuple ID
Definition: GaudiTuples.h:46
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: TupleObj.h:180
TupleID::NumericID nTupleOffSet() const
get the value for N-Tuple offset (property "NTupleOffSet")
Definition: GaudiTuples.h:218
Tuple nTuple(const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const
Access an N-Tuple object (book on-demand) with unique identifier.
bool evtColExists(const TupleID &ID) const
check the existence AND validity of the Event Tag Collection with the given ID
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:440
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
IDThe forced N-Tuple ID
titleUnique title for N-Tuple
clidN-Tuple class identifier (row or column wise)
Returns
ntuple The ntuple object

Definition at line 222 of file GaudiTuples.icpp.

225 {
226  // Check ID
227  if ( ID.undefined() )
228  { this->Error("Undefined NTuple ID : Title='"+title1+"'"); return Tuple(0); }
229 
230  // look up in the table
231  Tuples::TupleObj * tuple = m_nTupleMapID[ ID ] ;
232  if( 0 != tuple ) { return Tuple( tuple ) ; } // RETURN
233 
234  // convert ID to the string
235  const std::string tID = ID.idAsString() ;
236 
237  // adjust the NTuple title
238  const std::string title = title1.empty() ? ( "NTuple #" + tID ) : title1 ;
239 
240  // book new ntuple
241  if( produceNTuples() )
242  {
243  // book NTupel
244  NTuple::Tuple * tup = 0;
245  if ( ID.numeric() )
246  {
247  tup = this->ntupleSvc() -> book ( nTuplePath() , ID.numericID() , clid , title );
248  }
249  else if ( ID.literal() )
250  {
251  tup = this->ntupleSvc() -> book ( nTuplePath() , ID.literalID() , clid , title );
252  }
253  else { this->Error( "Undefined NTuple ID" ); }
254 
255  // assertion
256  this->Assert( 0 != tup , "Could not book the N-Tuple='" + title + "'" ) ;
257  // some printout
258  if( 0 != tup -> registry() && this->msgLevel(MSG::DEBUG) )
259  { this->debug() << "Booked NTuple '" << title << "' ID=" << tID
260  << "' Path='" << nTuplePath() << "' TS='"
261  << tup -> registry() -> identifier() << "'" << endmsg; }
262 
263  tuple = createNTuple ( title , tup , clid ) ;
264  }
265  else
266  {
267  tuple = createNTuple ( title , (NTuple::Tuple*) 0 , clid ) ;
268  }
269  // increment the reference
270  tuple -> addRef();
271  //
272  m_nTupleMapID [ ID ] = tuple ;
273  //
274  tuple -> addRef();
275  m_nTupleMapTitle[ title ] = tuple ;
276  // return
277  return Tuple( tuple ) ;
278 }
GAUDI_API AIDA::IHistogram1D * book(IHistogramSvc *svc, const std::string &path, const Gaudi::Histo1DDef &hist)
helper function to book 1D-histogram
Definition: HistoDef.cpp:132
TupleMapTitle m_nTupleMapTitle
the actual storage of ntuples by title
Definition: GaudiTuples.h:438
Tuples::Tuple Tuple
the actual type of the tuple
Definition: GaudiTuples.h:44
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: TupleObj.h:180
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
virtual Tuples::TupleObj * createNTuple(const std::string &name, NTuple::Tuple *tuple, const CLID &clid) const
create TupleObj
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:440
std::string nTuplePath() const
get the constructed N-Tuple path
bool produceNTuples() const
get the flag for N-Tuple production (property "NTupleProduce")
Definition: GaudiTuples.h:208
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 216 of file GaudiTuples.h.

216 { return m_nTupleDir ; }
std::string m_nTupleDir
local tuple directory
Definition: GaudiTuples.h:415
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 428 of file GaudiTuples.icpp.

429 {
430  return m_nTupleMapID.end() != m_nTupleMapID.find ( ID ) ;
431 }
iterator end()
Definition: Map.h:131
iterator find(const key_type &key)
Definition: Map.h:148
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:440
template<class PBASE>
const std::string& GaudiTuples< PBASE >::nTupleLUN ( ) const
inline

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

Definition at line 212 of file GaudiTuples.h.

212 { return m_nTupleLUN ; }
std::string m_nTupleLUN
name of logical unit for tuple directory
Definition: GaudiTuples.h:411
template<class PBASE>
const TupleMapID& GaudiTuples< PBASE >::nTupleMapID ( ) const
inlineprotected

access to the all ntuples by numeric ID

Definition at line 265 of file GaudiTuples.h.

265 { return m_nTupleMapID ; }
TupleMapID m_nTupleMapID
the actual storage of ntuples by ID
Definition: GaudiTuples.h:440
template<class PBASE>
const TupleMapTitle& GaudiTuples< PBASE >::nTupleMapTitle ( ) const
inlineprotected

access to the all ntuples by title

Definition at line 261 of file GaudiTuples.h.

261 { return m_nTupleMapTitle ; }
TupleMapTitle m_nTupleMapTitle
the actual storage of ntuples by title
Definition: GaudiTuples.h:438
template<class PBASE>
TupleID::NumericID GaudiTuples< PBASE >::nTupleOffSet ( ) const
inline

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

Definition at line 218 of file GaudiTuples.h.

218 { return m_nTupleOffSet ; }
TupleID::NumericID m_nTupleOffSet
the offset for ntuple numerical ID
Definition: GaudiTuples.h:417
template<class PBASE >
std::string GaudiTuples< PBASE >::nTuplePath ( ) const

get the constructed N-Tuple path

Definition at line 464 of file GaudiTuples.icpp.

465 {
466  const std::string path = nTupleLUN() + "/" + nTupleTopDir() + nTupleDir();
467  return ( splitNTupleDir() ? dirHbookName( path ) : path ) ;
468 }
const std::string & nTupleLUN() const
get the logical unit for N-Tuples (property "NTupleLUN")
Definition: GaudiTuples.h:212
const std::string & nTupleTopDir() const
get the top-level N-Tuple directory (property "NTupleTopDir")
Definition: GaudiTuples.h:214
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
const std::string & nTupleDir() const
get the N-Tuple directory (property "NTupleDir")
Definition: GaudiTuples.h:216
bool splitNTupleDir() const
get the flag for N-Tuple path split (property "NTupleSplitDir")
Definition: GaudiTuples.h:210
template<class PBASE>
const std::string& GaudiTuples< PBASE >::nTupleTopDir ( ) const
inline

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

Definition at line 214 of file GaudiTuples.h.

214 { return m_nTupleTopDir ; }
std::string m_nTupleTopDir
top level tuple directory
Definition: GaudiTuples.h:413
template<class PBASE >
void GaudiTuples< PBASE >::printEvtColHandler ( Property )
private

handler for "EvtColsPrint" property

Definition at line 454 of file GaudiTuples.icpp.

455 {
456  // no action if not yet initialized
457  if ( this -> FSMState() < Gaudi::StateMachine::INITIALIZED ) { return ; }
458  if ( this -> evtColsPrint() ) { this -> printEvtCols () ; }
459 }
bool evtColsPrint() const
print event collections at finalization
Definition: GaudiTuples.h:238
long printEvtCols() const
perform the actual printout of Event Tag Collections
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 398 of file GaudiTuples.icpp.

399 {
400  if ( evtColMapTitle().empty() && evtColMapID().empty() )
401  { this->always() << "No Event Tag Collections are booked" << endmsg ; }
402  else
403  { this->always() << "List of booked Event Tag Collections in directory "
404  << "\"" << evtColPath() << "\"" << endmsg ; }
405 
406  // helper container to sort it:
407  typedef std::map<TupleID,const Tuples::TupleObj*> OrderedMapType;
408  OrderedMapType OrderedMap ( evtColMapID().begin() , evtColMapID().end() ) ;
409  //
410  for ( OrderedMapType::const_iterator entry = OrderedMap.begin() ;
411  OrderedMap.end() != entry ; ++entry )
412  {
413  if ( 0 == entry->second ) { continue ; }
414  const NTuple::Tuple* tuple = entry->second->tuple() ;
415  if ( 0 == tuple )
416  { this->error() << " NTuple::Tuple* points to NULL" << endmsg ; continue ; }
417  this->always() << GaudiAlg::PrintTuple::print ( tuple , entry->first )
418  << " Items:"
419  << Gaudi::Utils::toString ( entry->second->items() ) << endmsg ;
420  }
421  //
422  return this->evtColMapID().size() ;
423 }
static std::string print(const INTuple *tuple, const GaudiAlg::TupleID &ID)
Definition: Print.cpp:177
size_type size() const
Definition: Map.h:180
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:367
const TupleMapTitle & evtColMapTitle() const
access to the all evet tag collections by title
Definition: GaudiTuples.h:263
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
tuple end
Definition: IOTest.py:101
std::string evtColPath() const
get the constructed Event Tag Collection path
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
const TupleMapID & evtColMapID() const
access to the all evet tag collections by numeric ID
Definition: GaudiTuples.h:267
template<class PBASE >
void GaudiTuples< PBASE >::printNTupleHandler ( Property )
private

handler for "NTuplePrint" property

Definition at line 444 of file GaudiTuples.icpp.

445 {
446  // no action if not yet initialized
447  if ( this -> FSMState() < Gaudi::StateMachine::INITIALIZED ) { return ; }
448  if ( this -> tuplesPrint() ) { this -> printTuples () ; }
449 }
long printTuples() const
perform the actual printout of N-tuples
bool tuplesPrint() const
print tuples at finalization
Definition: GaudiTuples.h:236
template<class PBASE >
long GaudiTuples< PBASE >::printTuples ( ) const

perform the actual printout of N-tuples

Returns
number of active N-Tuples

Definition at line 369 of file GaudiTuples.icpp.

370 {
371 
372  if ( nTupleMapTitle().empty() && nTupleMapID().empty() )
373  { if (this->msgLevel(MSG::DEBUG)) this->debug() << "No N-Tuples are booked" << endmsg ; }
374  else
375  { this->always() << "List of booked N-Tuples in directory "
376  << "\"" << nTuplePath() << "\"" << endmsg ; }
377 
378  // helper container to sort it:
379  typedef std::map<TupleID,const Tuples::TupleObj*> OrderedMapType;
380  OrderedMapType OrderedMap ( nTupleMapID().begin() , nTupleMapID().end() ) ;
381  //
382  for ( OrderedMapType::const_iterator entry = OrderedMap.begin() ;
383  OrderedMap.end() != entry ; ++entry )
384  {
385  if ( 0 == entry->second ) { continue ; }
386  const NTuple::Tuple* tuple = entry->second->tuple() ;
387  if ( 0 == tuple )
388  { this->error() << " NTuple::Tuple* points to NULL" << endmsg ; continue ; }
389  this->always() << GaudiAlg::PrintTuple::print ( tuple , entry->first ) << endmsg ;
390  }
391  //
392  return this->nTupleMapID().size() ;
393 }
static std::string print(const INTuple *tuple, const GaudiAlg::TupleID &ID)
Definition: Print.cpp:177
size_type size() const
Definition: Map.h:180
const TupleMapTitle & nTupleMapTitle() const
access to the all ntuples by title
Definition: GaudiTuples.h:261
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:367
tuple end
Definition: IOTest.py:101
const TupleMapID & nTupleMapID() const
access to the all ntuples by numeric ID
Definition: GaudiTuples.h:265
std::string nTuplePath() const
get the constructed N-Tuple path
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 222 of file GaudiTuples.h.

222 { return m_produceEvtCols ; }
bool m_produceEvtCols
flag to switch ON/OFF the ntuple filling and booking
Definition: GaudiTuples.h:420
template<class PBASE>
bool GaudiTuples< PBASE >::produceNTuples ( ) const
inline

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

Definition at line 208 of file GaudiTuples.h.

208 { return m_produceNTuples ; }
bool m_produceNTuples
flag to switch ON/OFF the ntuple filling and booking
Definition: GaudiTuples.h:407
template<class PBASE>
bool GaudiTuples< PBASE >::splitEvtColDir ( ) const
inline

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

Definition at line 224 of file GaudiTuples.h.

224 { return m_splitEvtColDir ; }
bool m_splitEvtColDir
flag to indicate splitting of tuple directories (useful for HBOOK)
Definition: GaudiTuples.h:422
template<class PBASE>
bool GaudiTuples< PBASE >::splitNTupleDir ( ) const
inline

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

Definition at line 210 of file GaudiTuples.h.

210 { return m_splitNTupleDir ; }
bool m_splitNTupleDir
flag to indicate splitting of tuple directories (useful for HBOOK)
Definition: GaudiTuples.h:409
template<class PBASE>
bool GaudiTuples< PBASE >::tuplesPrint ( ) const
inline

print tuples at finalization

Definition at line 236 of file GaudiTuples.h.

236 { return m_tuplesPrint ; }
bool m_tuplesPrint
print tuples at finalization?
Definition: GaudiTuples.h:433

Member Data Documentation

template<class PBASE>
std::string GaudiTuples< PBASE >::m_evtColDir
private

local tuple directory

Definition at line 428 of file GaudiTuples.h.

template<class PBASE>
std::string GaudiTuples< PBASE >::m_evtColLUN
private

name of Logical Unit for tuple directory

Definition at line 424 of file GaudiTuples.h.

template<class PBASE>
TupleMapID GaudiTuples< PBASE >::m_evtColMapID
mutableprivate

the actual storage of event collections by ID

Definition at line 445 of file GaudiTuples.h.

template<class PBASE>
TupleMapTitle GaudiTuples< PBASE >::m_evtColMapTitle
mutableprivate

the actual storage of event collections by title

Definition at line 443 of file GaudiTuples.h.

template<class PBASE>
TupleID::NumericID GaudiTuples< PBASE >::m_evtColOffSet
private

the offset for ntuple numerical ID

Definition at line 430 of file GaudiTuples.h.

template<class PBASE>
bool GaudiTuples< PBASE >::m_evtColsPrint
private

print event collections at finalization

Definition at line 435 of file GaudiTuples.h.

template<class PBASE>
std::string GaudiTuples< PBASE >::m_evtColTopDir
private

top level tuple directory

Definition at line 426 of file GaudiTuples.h.

template<class PBASE>
std::string GaudiTuples< PBASE >::m_nTupleDir
private

local tuple directory

Definition at line 415 of file GaudiTuples.h.

template<class PBASE>
std::string GaudiTuples< PBASE >::m_nTupleLUN
private

name of logical unit for tuple directory

Definition at line 411 of file GaudiTuples.h.

template<class PBASE>
TupleMapID GaudiTuples< PBASE >::m_nTupleMapID
mutableprivate

the actual storage of ntuples by ID

Definition at line 440 of file GaudiTuples.h.

template<class PBASE>
TupleMapTitle GaudiTuples< PBASE >::m_nTupleMapTitle
mutableprivate

the actual storage of ntuples by title

Definition at line 438 of file GaudiTuples.h.

template<class PBASE>
TupleID::NumericID GaudiTuples< PBASE >::m_nTupleOffSet
private

the offset for ntuple numerical ID

Definition at line 417 of file GaudiTuples.h.

template<class PBASE>
std::string GaudiTuples< PBASE >::m_nTupleTopDir
private

top level tuple directory

Definition at line 413 of file GaudiTuples.h.

template<class PBASE>
bool GaudiTuples< PBASE >::m_produceEvtCols
private

flag to switch ON/OFF the ntuple filling and booking

Definition at line 420 of file GaudiTuples.h.

template<class PBASE>
bool GaudiTuples< PBASE >::m_produceNTuples
private

flag to switch ON/OFF the ntuple filling and booking

Definition at line 407 of file GaudiTuples.h.

template<class PBASE>
bool GaudiTuples< PBASE >::m_splitEvtColDir
private

flag to indicate splitting of tuple directories (useful for HBOOK)

Definition at line 422 of file GaudiTuples.h.

template<class PBASE>
bool GaudiTuples< PBASE >::m_splitNTupleDir
private

flag to indicate splitting of tuple directories (useful for HBOOK)

Definition at line 409 of file GaudiTuples.h.

template<class PBASE>
bool GaudiTuples< PBASE >::m_tuplesPrint
private

print tuples at finalization?

Definition at line 433 of file GaudiTuples.h.


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