|
Gaudi Framework, version v21r4 |
| Home | Generated: 7 Sep 2009 |
#include <GaudiAlg/GaudiTuples.h>

Definition at line 40 of file GaudiTuples.h.
Public Types | |
| typedef GaudiAlg::HistoID | HistoID |
| the actual type for histogram identifier | |
| typedef Tuples::Tuple | Tuple |
| the actual type of the tuple | |
| typedef GaudiAlg::TupleID | TupleID |
| the actual type of N-tuple ID | |
| typedef GaudiAlg::TupleMapTitle | TupleMapTitle |
| the actual type of (title) -> (tuple) mappping | |
| typedef GaudiAlg::TupleMapNumericID | TupleMapNumID |
| the actual type of (Numeric ID) -> (tuple) mappping | |
| typedef GaudiAlg::TupleMapLiteralID | TupleMapLitID |
| the actual type of (Literal ID) -> (tuple) mappping | |
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. | |
| 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. | |
| Tuple | evtCol (const std::string &title, const CLID &clid=CLID_ColumnWiseTuple) const |
| Access an Event Tag Collection object (book on-demand) with unique identifier. | |
| 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. | |
| bool | produceNTuples () const |
| get the flag for N-Tuple production (property "NTupleProduce") | |
| bool | splitNTupleDir () const |
| get the flag for N-Tuple path split (property "NTupleSplitDir") | |
| const std::string & | nTupleLUN () const |
| get the logical unit for N-Tuples (property "NTupleLUN") | |
| const std::string & | nTupleTopDir () const |
| get the top-level N-Tuple directory (property "NTupleTopDir") | |
| const std::string & | nTupleDir () const |
| get the N-Tuple directory (property "NTupleDir") | |
| TupleID::NumericID | nTupleOffSet () const |
| get the value for N-Tuple offset (property "NTupleOffSet") | |
| std::string | nTuplePath () const |
| get the constructed N-Tuple path | |
| bool | produceEvtCols () const |
| get the flag for Event Tag Collection production (property "EvtColsProduce") | |
| bool | splitEvtColDir () const |
| get the flag for Event Tag Collection path split (property "EvtColsSplitDir") | |
| const std::string & | evtColLUN () const |
| get the logical unit for Event Tag Collections (property "EvtColsLUN") | |
| const std::string & | evtColTopDir () const |
| get the top-level Event Tag Collection directory (property "EvtColsTopDir") | |
| const std::string & | evtColDir () const |
| get the Event Tag Collection directory (property "EvtColsDir") | |
| TupleID::NumericID | evtColOffSet () const |
| get the value for Event Tag Collection offset (property "EvtColsOffSet") | |
| std::string | evtColPath () const |
| get the constructed Event Tag Collection path | |
| bool | tuplesPrint () const |
| print tuples at finalization | |
| bool | evtColsPrint () const |
| print event collections at finalization | |
| long | printTuples () const |
| perform the actual printout of N-tuples | |
| long | printEvtCols () const |
| perform the actual printout of Event Tag Collections | |
| bool | nTupleExists (const TupleID &ID) const |
| check the existence AND validity of the N-Tuple with the given ID | |
| bool | evtColExists (const TupleID &ID) const |
| check the existence AND validity of the Event Tag Collection with the given ID | |
| GaudiTuples (const std::string &name, ISvcLocator *pSvcLocator) | |
| Algorithm constructor. | |
| GaudiTuples (const std::string &type, const std::string &name, const IInterface *parent) | |
| Tool constructor. | |
| virtual | ~GaudiTuples () |
| Destructor. | |
Protected Member Functions | |
| const TupleMapTitle & | nTupleMapTitle () const |
| access to the all ntuples by title | |
| const TupleMapTitle & | evtColMapTitle () const |
| access to the all evet tag collections by title | |
| const TupleMapNumID & | nTupleMapNumID () const |
| access to the all ntuples by numeric ID | |
| const TupleMapNumID & | evtColMapNumID () const |
| access to the all evet tag collections by numeric ID | |
| const TupleMapLitID & | nTupleMapLitID () const |
| access to the all ntuples by literal ID | |
| const TupleMapLitID & | evtColMapLitID () const |
| access to the all evet tag collections by literal ID | |
| virtual Tuples::TupleObj * | createNTuple (const std::string &name, NTuple::Tuple *tuple, const CLID &clid) const |
| create TupleObj | |
| virtual Tuples::TupleObj * | createEvtCol (const std::string &name, NTuple::Tuple *tuple, const CLID &clid) const |
| create TupleObj for event tag collection | |
| virtual StatusCode | initialize () |
| standard initialization method | |
| virtual StatusCode | finalize () |
| standard finalization method | |
Private Member Functions | |
| void | initGaudiTuplesConstructor () |
| Constructor initialization and job options. | |
| void | printNTupleHandler (Property &) |
| handler for "NTuplePrint" property | |
| void | printEvtColHandler (Property &) |
| handler for "EvtColsPrint" property | |
Private Attributes | |
| bool | m_produceNTuples |
| flag to switch ON/OFF the ntuple filling and booking | |
| bool | m_splitNTupleDir |
| flag to indicate splitting of tuple directories (useful for HBOOK) | |
| std::string | m_nTupleLUN |
| name of logical unit for tuple directory | |
| std::string | m_nTupleTopDir |
| top level tuple directory | |
| std::string | m_nTupleDir |
| local tuple directory | |
| TupleID::NumericID | m_nTupleOffSet |
| the offset for ntuple numerical ID | |
| bool | m_produceEvtCols |
| flag to switch ON/OFF the ntuple filling and booking | |
| bool | m_splitEvtColDir |
| flag to indicate splitting of tuple directories (useful for HBOOK) | |
| std::string | m_evtColLUN |
| name of Logical Unit for tuple directory | |
| std::string | m_evtColTopDir |
| top level tuple directory | |
| std::string | m_evtColDir |
| local tuple directory | |
| TupleID::NumericID | m_evtColOffSet |
| the offset for ntuple numerical ID | |
| bool | m_tuplesPrint |
| print tuples at finalization? | |
| bool | m_evtColsPrint |
| print event collections at finalization | |
| TupleMapTitle | m_nTupleMapTitle |
| the actual storage of ntuples by title | |
| TupleMapNumID | m_nTupleMapNumID |
| the actual storage of ntuples by numeric ID | |
| TupleMapLitID | m_nTupleMapLitID |
| the actual storage of ntuples by literal ID | |
| TupleMapTitle | m_evtColMapTitle |
| the actual storage of event collections by title | |
| TupleMapNumID | m_evtColMapNumID |
| the actual storage of event collections by numeric ID | |
| TupleMapLitID | m_evtColMapLitID |
| the actual storage of event collections by literal ID | |
| typedef GaudiAlg::HistoID GaudiTuples< PBASE >::HistoID |
| typedef Tuples::Tuple GaudiTuples< PBASE >::Tuple |
the actual type of the tuple
Reimplemented in TupleTool.
Definition at line 47 of file GaudiTuples.h.
| typedef GaudiAlg::TupleID GaudiTuples< PBASE >::TupleID |
the actual type of N-tuple ID
Reimplemented in TupleTool.
Definition at line 49 of file GaudiTuples.h.
| typedef GaudiAlg::TupleMapTitle GaudiTuples< PBASE >::TupleMapTitle |
| typedef GaudiAlg::TupleMapNumericID GaudiTuples< PBASE >::TupleMapNumID |
| typedef GaudiAlg::TupleMapLiteralID GaudiTuples< PBASE >::TupleMapLitID |
| GaudiTuples< PBASE >::GaudiTuples | ( | const std::string & | name, | |
| ISvcLocator * | pSvcLocator | |||
| ) |
Algorithm constructor.
| GaudiTuples< PBASE >::GaudiTuples | ( | const std::string & | type, | |
| const std::string & | name, | |||
| const IInterface * | parent | |||
| ) |
Tool constructor.
| GaudiTuples< PBASE >::~GaudiTuples | ( | ) | [inline, virtual] |
| Tuples::Tuple GaudiTuples< PBASE >::nTuple | ( | const std::string & | title, | |
| const CLID & | clid = CLID_ColumnWiseTuple | |||
| ) | const [inline] |
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();
| title | Unique title for N-Tuple | |
| clid | N-Tuple class identifier (row or column wise) |
Reimplemented in TupleTool.
Definition at line 146 of file GaudiTuples.icpp.
00148 { 00149 // look up in the table 00150 Tuples::TupleObj* tuple = m_nTupleMapTitle[ title ] ; 00151 if ( 0 != tuple ) { return Tuple( tuple ) ; } // RETURN 00152 // Create the tuple ID 00153 TupleID ID; 00154 if ( this->useNumericAutoIDs() || title.empty() ) 00155 { 00156 if ( ! this->useNumericAutoIDs() ) 00157 { 00158 this -> Warning( "Cannot generate automatic literal ID from an empty title ! Using numeric ID instead for nTuple ID", 00159 StatusCode::SUCCESS ); 00160 } 00161 // propose the tuple ID 00162 ID = TupleID ( m_nTupleMapNumID.size() + 1 + nTupleOffSet() ); 00163 // adjust the proposed ID 00164 while ( nTupleExists(ID) || evtColExists(ID) ) 00165 { ID = TupleID ( ID.numeric() + 1 ) ; } 00166 } 00167 else 00168 { 00169 // use the title to create a unique literal ID 00170 ID = TupleID( this->convertTitleToID(title) ); 00171 // Just in case ... 00172 while ( nTupleExists(ID) || evtColExists(ID) ) 00173 { ID = TupleID(ID.idAsString()+"_"); } 00174 } 00175 // return 00176 return nTuple( ID , title , clid ) ; 00177 }
| Tuples::Tuple GaudiTuples< PBASE >::nTuple | ( | const TupleID & | ID, | |
| const std::string & | title, | |||
| const CLID & | clid = CLID_ColumnWiseTuple | |||
| ) | const [inline] |
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();
| ID | The forced N-Tuple ID | |
| title | Unique title for N-Tuple | |
| clid | N-Tuple class identifier (row or column wise) |
Reimplemented in TupleTool.
Definition at line 224 of file GaudiTuples.icpp.
00227 { 00228 // Check ID 00229 if ( ID.undefined() ) 00230 { this->Error("Undefined NTuple ID : Title='"+title1+"'"); return Tuple(0); } 00231 00232 // look up in the table 00233 Tuples::TupleObj * tuple = 00234 ( ID.numeric() ? m_nTupleMapNumID[ID.numericID()] : m_nTupleMapLitID[ID.literalID()] ) ; 00235 if( 0 != tuple ) { return Tuple( tuple ) ; } // RETURN 00236 00237 // convert ID to the string 00238 const std::string tID = ID.idAsString() ; 00239 00240 // adjust the NTuple title 00241 const std::string title = title1.empty() ? ( "NTuple #" + tID ) : title1 ; 00242 00243 // book new ntuple 00244 if( produceNTuples() ) 00245 { 00246 // book NTupel 00247 NTuple::Tuple * tup = 0; 00248 if ( ID.numeric() ) 00249 { 00250 tup = this->ntupleSvc() -> book ( nTuplePath() , ID.numericID() , clid , title ); 00251 } 00252 else if ( ID.literal() ) 00253 { 00254 tup = this->ntupleSvc() -> book ( nTuplePath() , ID.literalID() , clid , title ); 00255 } 00256 else { this->Error( "Undefined NTuple ID" ); } 00257 00258 // assertion 00259 this->Assert( 0 != tup , "Could not book the N-Tuple='" + title + "'" ) ; 00260 // some printout 00261 if( 0 != tup -> registry() && this->msgLevel(MSG::DEBUG) ) 00262 { this->debug() << "Booked NTuple '" << title << "' ID=" << tID 00263 << "' Path='" << nTuplePath() << "' TS='" 00264 << tup -> registry() -> identifier() << "'" << endmsg; } 00265 00266 tuple = createNTuple ( title , tup , clid ) ; 00267 } 00268 else 00269 { 00270 tuple = createNTuple ( title , (NTuple::Tuple*) 0 , clid ) ; 00271 } 00272 // increment the reference 00273 tuple -> addRef(); 00274 if ( ID.numeric() ) { m_nTupleMapNumID [ ID.numericID() ] = tuple ; } 00275 else { m_nTupleMapLitID [ ID.literalID() ] = tuple ; } 00276 tuple -> addRef(); 00277 m_nTupleMapTitle[ title ] = tuple ; 00278 // return 00279 return Tuple( tuple ) ; 00280 };
| Tuples::Tuple GaudiTuples< PBASE >::evtCol | ( | const std::string & | title, | |
| const CLID & | clid = CLID_ColumnWiseTuple | |||
| ) | const [inline] |
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.
| title | Unique title for Event Tag Collection | |
| clid | N-Tuple class identifier (row or column wise) |
Reimplemented in TupleTool.
Definition at line 185 of file GaudiTuples.icpp.
00187 { 00188 // look up in the table 00189 Tuples::TupleObj* tuple = m_evtColMapTitle[ title ] ; 00190 if ( 0 != tuple ) { return Tuple( tuple ) ; } // RETURN 00191 // Create the tuple ID 00192 TupleID ID; 00193 if ( this->useNumericAutoIDs() || title.empty() ) 00194 { 00195 if ( ! this->useNumericAutoIDs() ) 00196 { 00197 this -> Warning( "Cannot generate automatic literal ID from an empty title ! Using numeric ID instead for evtCol ID", 00198 StatusCode::SUCCESS ); 00199 } 00200 // proposed the tuple ID 00201 ID = m_evtColMapNumID.size() + 1 + evtColOffSet() ; 00202 // adjust the proposed ID 00203 while ( nTupleExists(ID) || evtColExists(ID) ) 00204 { ID = TupleID ( ID.numeric() + 1 ) ; } 00205 } 00206 else 00207 { 00208 // use the title to create a unique literal ID 00209 ID = TupleID( this->convertTitleToID(title) ); 00210 // Just in case ... 00211 while ( nTupleExists(ID) || evtColExists(ID) ) 00212 { ID = TupleID ( ID.idAsString()+"_" ) ; } 00213 } 00214 // return 00215 return evtCol( ID , title , clid ) ; 00216 }
| Tuples::Tuple GaudiTuples< PBASE >::evtCol | ( | const TupleID & | ID, | |
| const std::string & | title, | |||
| const CLID & | clid = CLID_ColumnWiseTuple | |||
| ) | const [inline] |
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();
| ID | The forced Event Tag Collection ID | |
| title | Unique title for Event Tag Collection | |
| clid | N-Tuple class identifier (row or column wise) |
Reimplemented in TupleTool.
Definition at line 285 of file GaudiTuples.icpp.
00288 { 00289 // Check ID 00290 if ( ID.undefined() ) 00291 { this->Error("Undefined NTuple ID : Title='"+title1+"'"); return Tuple(0); } 00292 00293 // look up in the table 00294 Tuples::TupleObj* tuple = 00295 ( ID.numeric() ? m_evtColMapNumID[ID.numericID()] : m_evtColMapLitID[ID.literalID()] ) ; 00296 if ( 0 != tuple ) { return Tuple( tuple ) ; } // RETURN 00297 00298 // convert ID to the string 00299 const std::string tID = ID.idAsString() ; 00300 00301 // adjust the NTuple title 00302 const std::string title = title1.empty() ? ( "EvtCol #" + tID ) : title1 ; 00303 00304 // book new ntuple 00305 if( produceEvtCols() ) 00306 { 00307 // book NTuple 00308 NTuple::Tuple* tup = 0; 00309 if ( ID.numeric() ) 00310 { 00311 tup = this->evtColSvc()->book ( evtColPath() , ID.numericID() , clid , title ) ; 00312 } 00313 else if ( ID.literal() ) 00314 { 00315 tup = this->evtColSvc()->book ( evtColPath() , ID.literalID() , clid , title ) ; 00316 } 00317 else { this->Error( "Undefined NTuple ID" ); } 00318 00319 // assertion 00320 this->Assert( 0 != tup , "Could not book the EvtCol='" + title + "'" ) ; 00321 // some printout 00322 if( 0 != tup -> registry() && this->msgLevel(MSG::DEBUG) ) 00323 { this->debug() << "Booked EvtCol '" << title << "' ID=" << tID 00324 << "' Path='" << evtColPath() << "' TS='" 00325 << tup -> registry() -> identifier() << "'" << endmsg ; } 00326 00327 tuple = createEvtCol ( title , tup , clid ) ; 00328 } 00329 else 00330 { 00331 tuple = createEvtCol ( title , (NTuple::Tuple*) 0 , clid ) ; 00332 } 00333 // increment the reference 00334 tuple -> addRef(); 00335 if ( ID.numeric() ) { m_evtColMapNumID [ ID.numericID() ] = tuple ; } 00336 else { m_evtColMapLitID [ ID.literalID() ] = tuple ; } 00337 tuple -> addRef(); 00338 m_evtColMapTitle[ title ] = tuple ; 00339 // return 00340 return Tuple( tuple ) ; 00341 }
| bool GaudiTuples< PBASE >::produceNTuples | ( | ) | const [inline] |
get the flag for N-Tuple production (property "NTupleProduce")
Definition at line 213 of file GaudiTuples.h.
00213 { return m_produceNTuples ; }
| bool GaudiTuples< PBASE >::splitNTupleDir | ( | ) | const [inline] |
get the flag for N-Tuple path split (property "NTupleSplitDir")
Definition at line 215 of file GaudiTuples.h.
00215 { return m_splitNTupleDir ; }
| const std::string& GaudiTuples< PBASE >::nTupleLUN | ( | ) | const [inline] |
get the logical unit for N-Tuples (property "NTupleLUN")
Definition at line 217 of file GaudiTuples.h.
00217 { return m_nTupleLUN ; }
| const std::string& GaudiTuples< PBASE >::nTupleTopDir | ( | ) | const [inline] |
get the top-level N-Tuple directory (property "NTupleTopDir")
Definition at line 219 of file GaudiTuples.h.
00219 { return m_nTupleTopDir ; }
| const std::string& GaudiTuples< PBASE >::nTupleDir | ( | ) | const [inline] |
get the N-Tuple directory (property "NTupleDir")
Definition at line 221 of file GaudiTuples.h.
00221 { return m_nTupleDir ; }
| TupleID::NumericID GaudiTuples< PBASE >::nTupleOffSet | ( | ) | const [inline] |
get the value for N-Tuple offset (property "NTupleOffSet")
Definition at line 223 of file GaudiTuples.h.
00223 { return m_nTupleOffSet ; }
| std::string GaudiTuples< PBASE >::nTuplePath | ( | ) | const [inline] |
get the constructed N-Tuple path
Definition at line 225 of file GaudiTuples.h.
00226 { 00227 const std::string path = nTupleLUN() + "/" + nTupleTopDir() + nTupleDir(); 00228 return ( splitNTupleDir() ? dirHbookName( path ) : path ) ; 00229 }
| bool GaudiTuples< PBASE >::produceEvtCols | ( | ) | const [inline] |
get the flag for Event Tag Collection production (property "EvtColsProduce")
Definition at line 231 of file GaudiTuples.h.
00231 { return m_produceEvtCols ; }
| bool GaudiTuples< PBASE >::splitEvtColDir | ( | ) | const [inline] |
get the flag for Event Tag Collection path split (property "EvtColsSplitDir")
Definition at line 233 of file GaudiTuples.h.
00233 { return m_splitEvtColDir ; }
| const std::string& GaudiTuples< PBASE >::evtColLUN | ( | ) | const [inline] |
get the logical unit for Event Tag Collections (property "EvtColsLUN")
Definition at line 235 of file GaudiTuples.h.
00235 { return m_evtColLUN ; }
| const std::string& GaudiTuples< PBASE >::evtColTopDir | ( | ) | const [inline] |
get the top-level Event Tag Collection directory (property "EvtColsTopDir")
Definition at line 237 of file GaudiTuples.h.
00237 { return m_evtColTopDir ; }
| const std::string& GaudiTuples< PBASE >::evtColDir | ( | ) | const [inline] |
get the Event Tag Collection directory (property "EvtColsDir")
Definition at line 239 of file GaudiTuples.h.
00239 { return m_evtColDir ; }
| TupleID::NumericID GaudiTuples< PBASE >::evtColOffSet | ( | ) | const [inline] |
get the value for Event Tag Collection offset (property "EvtColsOffSet")
Definition at line 241 of file GaudiTuples.h.
00241 { return m_evtColOffSet ; }
| std::string GaudiTuples< PBASE >::evtColPath | ( | ) | const [inline] |
get the constructed Event Tag Collection path
Definition at line 243 of file GaudiTuples.h.
00244 { 00245 std::string path = evtColLUN() + "/" + evtColTopDir() + evtColDir(); 00246 return ( splitEvtColDir() ? dirHbookName( path ) : path ); 00247 }
| bool GaudiTuples< PBASE >::tuplesPrint | ( | ) | const [inline] |
print tuples at finalization
Definition at line 249 of file GaudiTuples.h.
00249 { return m_tuplesPrint ; }
| bool GaudiTuples< PBASE >::evtColsPrint | ( | ) | const [inline] |
print event collections at finalization
Definition at line 251 of file GaudiTuples.h.
00251 { return m_evtColsPrint ; }
| long GaudiTuples< PBASE >::printTuples | ( | ) | const [inline] |
perform the actual printout of N-tuples
Definition at line 376 of file GaudiTuples.icpp.
00377 { 00378 00379 typedef std::set<const NTuple::Tuple*> _Tuples ; 00380 00381 if ( nTupleMapTitle().empty() && 00382 nTupleMapNumID().empty() && 00383 nTupleMapLitID().empty() ) 00384 { if (this->msgLevel(MSG::DEBUG)) this->debug() << "No N-Tuples are booked" << endmsg ; } 00385 else 00386 { this->always() << "List of booked N-Tuples in directory " 00387 << "\"" << nTuplePath() << "\"" << endmsg ; } 00388 00389 _Tuples tuples ; 00390 { // N-Tuple by Numeric ID 00391 typedef std::map<TupleMapNumID::key_type, TupleMapNumID::mapped_type> ordered_map_t; 00392 ordered_map_t ordered_map(nTupleMapNumID().begin(), nTupleMapNumID().end()); 00393 for ( ordered_map_t::const_iterator entry = ordered_map.begin() ; 00394 ordered_map.end() != entry ; ++entry ) 00395 { 00396 if ( 0 == entry->second ) { continue ; } 00397 const NTuple::Tuple* tuple = entry->second->tuple() ; 00398 if ( 0 == tuple ) 00399 { this->error() << " NTuple::Tuple* points to NULL" << endmsg ; continue ; } 00400 if ( tuples.end() != tuples.find( tuple ) ) { continue ; } 00401 tuples.insert ( tuple ) ; 00402 this->always() << GaudiAlg::PrintTuple::print ( tuple , entry->first ) << endmsg ; 00403 } 00404 } 00405 { // N-Tuple by Literal ID 00406 typedef std::map<TupleMapLitID::key_type, TupleMapLitID::mapped_type> ordered_map_t; 00407 ordered_map_t ordered_map(nTupleMapLitID().begin(), nTupleMapLitID().end()); 00408 for ( ordered_map_t::const_iterator entry = ordered_map.begin() ; 00409 ordered_map.end() != entry ; ++entry ) 00410 { 00411 if ( 0 == entry->second ) { continue ; } 00412 const NTuple::Tuple* tuple = entry->second->tuple() ; 00413 if ( 0 == tuple ) 00414 { this->error() << " NTuple::Tuple* points to NULL" << endmsg ; continue ; } 00415 if ( tuples.end() != tuples.find( tuple ) ) { continue ; } 00416 tuples.insert ( tuple ) ; 00417 this->always() << GaudiAlg::PrintTuple::print ( tuple , entry->first ) << endmsg ; 00418 } 00419 } 00420 { // N-Tuples by Title 00421 typedef std::map<TupleMapTitle::key_type, TupleMapTitle::mapped_type> ordered_map_t; 00422 ordered_map_t ordered_map(nTupleMapTitle().begin(), nTupleMapTitle().end()); 00423 for ( ordered_map_t::const_iterator entry = ordered_map.begin() ; 00424 ordered_map.end() != entry ; ++entry ) 00425 { 00426 if ( 0 == entry->second ) { continue ; } 00427 const NTuple::Tuple* tuple = entry->second->tuple() ; 00428 if ( 0 == tuple ) 00429 { this->error() << " NTuple::Tuple* points to NULL" << endmsg ; continue ; } 00430 if ( tuples.end() != tuples.find( tuple ) ) { continue ; } 00431 tuples.insert ( tuple ) ; 00432 this->always() << GaudiAlg::PrintTuple::print ( tuple ) << endmsg ; 00433 } 00434 } 00435 00436 return tuples.size() ; 00437 };
| long GaudiTuples< PBASE >::printEvtCols | ( | ) | const [inline] |
perform the actual printout of Event Tag Collections
Definition at line 444 of file GaudiTuples.icpp.
00445 { 00446 typedef std::set<const NTuple::Tuple*> _Tuples ; 00447 00448 if ( evtColMapTitle().empty() && 00449 evtColMapNumID().empty() && 00450 evtColMapLitID().empty() ) 00451 { this->always() << "No Event Tag Collections are booked" << endmsg ; } 00452 else 00453 { this->always() << "List of booked Event Tag Collections in directory " 00454 << "\"" << evtColPath() << "\"" << endmsg ; } 00455 00456 _Tuples tuples ; 00457 { // EvtCols by Numeric ID 00458 for ( TupleMapNumID::const_iterator entry = evtColMapNumID().begin() ; 00459 evtColMapNumID().end() != entry ; ++entry ) 00460 { 00461 if ( 0 == entry->second ) { continue ; } 00462 const NTuple::Tuple* tuple = entry->second->tuple() ; 00463 if ( 0 == tuple ) 00464 { this->error() << "NTuple::Tuple* points to NULL" << endmsg ; continue ; } 00465 if ( tuples.end() != tuples.find( tuple ) ) { continue ; } 00466 tuples.insert ( tuple ) ; 00467 this->always() << GaudiAlg::PrintTuple::print ( tuple , entry->first ) 00468 << " Items:" 00469 << Gaudi::Utils::toString ( entry->second->items() ) << endmsg ; 00470 } 00471 } 00472 { // EvtCols by literal ID 00473 for ( TupleMapLitID::const_iterator entry = evtColMapLitID().begin() ; 00474 evtColMapLitID().end() != entry ; ++entry ) 00475 { 00476 if ( 0 == entry->second ) { continue ; } 00477 const NTuple::Tuple* tuple = entry->second->tuple() ; 00478 if ( 0 == tuple ) 00479 { this->error() << "NTuple::Tuple* points to NULL" << endmsg ; continue ; } 00480 if ( tuples.end() != tuples.find( tuple ) ) { continue ; } 00481 tuples.insert ( tuple ) ; 00482 this->always() << GaudiAlg::PrintTuple::print ( tuple , entry->first ) 00483 << " Items:" 00484 << Gaudi::Utils::toString ( entry->second->items() ) << endmsg ; 00485 } 00486 } 00487 { // EvtCols by Title 00488 for ( TupleMapTitle::const_iterator entry = evtColMapTitle().begin() ; 00489 evtColMapTitle().end() != entry ; ++entry ) 00490 { 00491 if ( 0 == entry->second ) { continue ; } 00492 const NTuple::Tuple* tuple = entry->second->tuple() ; 00493 if ( 0 == tuple ) 00494 { this->error() << "NTuple::Tuple* points to NULL" << endmsg ; continue ; } 00495 if ( tuples.end() != tuples.find( tuple ) ) { continue ; } 00496 tuples.insert ( tuple ) ; 00497 this->always() << GaudiAlg::PrintTuple::print ( tuple ) 00498 << " Items:" 00499 << Gaudi::Utils::toString ( entry->second->items() ) << endmsg ; 00500 } 00501 } 00502 00503 return tuples.size() ; 00504 }
| bool GaudiTuples< PBASE >::nTupleExists | ( | const TupleID & | ID | ) | const [inline] |
check the existence AND validity of the N-Tuple with the given ID
Definition at line 510 of file GaudiTuples.icpp.
00511 { 00512 bool OK(false); 00513 if ( ID.numeric() ) 00514 { 00515 TupleMapNumID::iterator found = m_nTupleMapNumID.find( ID.numericID() ) ; 00516 OK = ( m_nTupleMapNumID.end() != found ); 00517 } 00518 else 00519 { 00520 TupleMapLitID::iterator found = m_nTupleMapLitID.find( ID.literalID() ) ; 00521 OK = ( m_nTupleMapLitID.end() != found ); 00522 } 00523 return OK; 00524 }
| bool GaudiTuples< PBASE >::evtColExists | ( | const TupleID & | ID | ) | const [inline] |
check the existence AND validity of the Event Tag Collection with the given ID
Definition at line 530 of file GaudiTuples.icpp.
00531 { 00532 bool OK(false); 00533 if ( ID.numeric() ) 00534 { 00535 TupleMapNumID::iterator found = m_evtColMapNumID.find( ID.numericID() ) ; 00536 OK = ( m_evtColMapNumID.end() != found ); 00537 } 00538 else 00539 { 00540 TupleMapLitID::iterator found = m_evtColMapLitID.find( ID.literalID() ) ; 00541 OK = ( m_evtColMapLitID.end() != found ); 00542 } 00543 return OK; 00544 }
| const TupleMapTitle& GaudiTuples< PBASE >::nTupleMapTitle | ( | ) | const [inline, protected] |
access to the all ntuples by title
Definition at line 274 of file GaudiTuples.h.
00274 { return m_nTupleMapTitle ; }
| const TupleMapTitle& GaudiTuples< PBASE >::evtColMapTitle | ( | ) | const [inline, protected] |
access to the all evet tag collections by title
Definition at line 276 of file GaudiTuples.h.
00276 { return m_evtColMapTitle ; }
| const TupleMapNumID& GaudiTuples< PBASE >::nTupleMapNumID | ( | ) | const [inline, protected] |
access to the all ntuples by numeric ID
Definition at line 278 of file GaudiTuples.h.
00278 { return m_nTupleMapNumID ; }
| const TupleMapNumID& GaudiTuples< PBASE >::evtColMapNumID | ( | ) | const [inline, protected] |
access to the all evet tag collections by numeric ID
Definition at line 280 of file GaudiTuples.h.
00280 { return m_evtColMapNumID ; }
| const TupleMapLitID& GaudiTuples< PBASE >::nTupleMapLitID | ( | ) | const [inline, protected] |
access to the all ntuples by literal ID
Definition at line 282 of file GaudiTuples.h.
00282 { return m_nTupleMapLitID ; }
| const TupleMapLitID& GaudiTuples< PBASE >::evtColMapLitID | ( | ) | const [inline, protected] |
access to the all evet tag collections by literal ID
Definition at line 284 of file GaudiTuples.h.
00284 { return m_evtColMapLitID ; }
| Tuples::TupleObj * GaudiTuples< PBASE >::createNTuple | ( | const std::string & | name, | |
| NTuple::Tuple * | tuple, | |||
| const CLID & | clid | |||
| ) | const [inline, protected, virtual] |
create TupleObj
| name | name/title | |
| tuple | the underlying ntuple implementation | |
| clid | unique classID for ntuple |
Definition at line 349 of file GaudiTuples.icpp.
00352 { 00353 return Tuples::createTupleObj 00354 ( this , "Tuple '" + name + "'" , tuple , clid , Tuples::NTUPLE ) ; 00355 }
| Tuples::TupleObj * GaudiTuples< PBASE >::createEvtCol | ( | const std::string & | name, | |
| NTuple::Tuple * | tuple, | |||
| const CLID & | clid | |||
| ) | const [inline, protected, virtual] |
create TupleObj for event tag collection
| name | name/title | |
| tuple | the underlying ntuple implementation | |
| clid | unique classID for ntuple |
Definition at line 363 of file GaudiTuples.icpp.
00366 { 00367 return Tuples::createTupleObj 00368 ( this , "EvtCol '" + name + "'" , tuple , clid , Tuples::EVTCOL ) ; 00369 }
| StatusCode GaudiTuples< PBASE >::initialize | ( | ) | [inline, protected, virtual] |
standard initialization method
Reimplemented in GaudiTupleAlg, and GaudiTupleTool.
Definition at line 43 of file GaudiTuples.icpp.
00044 { 00045 // initialize base class 00046 const StatusCode sc = PBASE::initialize(); 00047 if ( sc.isFailure() ) return sc; 00048 00049 if ( produceNTuples() ) 00050 { 00051 // check the existance of service 00052 if ( this->ntupleSvc() == 0 ) 00053 { return this->Error( "INTupleSvc* points to NULL!" ); } 00054 // Print ntuple path 00055 Print( "The N-Tuple path is set to be '" + nTuplePath() + "'", 00056 StatusCode(StatusCode::SUCCESS, true) , MSG::DEBUG); 00057 } 00058 else 00059 { this->debug() << "Production of N-Tuples is switched OFF" << endmsg; } 00060 00061 if ( produceEvtCols() ) 00062 { 00063 // check the existance of service 00064 if ( 0 == this->evtColSvc() ) 00065 { return this->Error( "INTupleSvc* points to NULL!" ); } 00066 // Print EvtCol path 00067 Print( "The EventCol path is set to be '" + evtColPath() + "'", 00068 StatusCode(StatusCode::SUCCESS, true) , MSG::DEBUG ); 00069 } 00070 else 00071 { this->debug() << "Production of Event Collections is switched OFF" << endmsg; } 00072 00073 return sc; 00074 }
| StatusCode GaudiTuples< PBASE >::finalize | ( | void | ) | [inline, protected, virtual] |
standard finalization method
Reimplemented in GaudiTupleAlg, and GaudiTupleTool.
Definition at line 80 of file GaudiTuples.icpp.
00081 { 00082 if ( !( nTupleMapTitle() .empty() && 00083 nTupleMapNumID() .empty() && 00084 nTupleMapLitID() .empty() && 00085 evtColMapTitle() .empty() && 00086 evtColMapNumID() .empty() && 00087 evtColMapLitID() .empty() 00088 ) ) 00089 { 00090 const int nNtuples = nTupleMapNumID().size() + nTupleMapLitID().size(); 00091 const int nEvtCols = evtColMapNumID().size() + evtColMapLitID().size(); 00092 this->always() 00093 << "Booked " << nNtuples << " N-Tuples and " << nEvtCols 00094 << " Event Tag Collections" << endmsg ; 00095 } 00096 00097 if ( produceNTuples () && tuplesPrint () ) { printTuples () ; } 00098 if ( produceEvtCols () && evtColsPrint () ) { printEvtCols () ; } 00099 00100 { // release ntuples and clear the container 00101 for( TupleMapTitle::iterator itup = m_nTupleMapTitle.begin() ; 00102 m_nTupleMapTitle.end() != itup ; ++itup ) 00103 { if( 0 != itup->second ) { itup->second->release() ; } } 00104 m_nTupleMapTitle.clear() ; 00105 } 00106 { // release ntuples and clear the container 00107 for( TupleMapNumID::iterator itup = m_nTupleMapNumID.begin() ; 00108 m_nTupleMapNumID.end() != itup ; ++itup ) 00109 { if( 0 != itup->second ) { itup->second->release() ; } } 00110 m_nTupleMapNumID.clear(); 00111 } 00112 { // release ntuples and clear the container 00113 for( TupleMapLitID::iterator itup = m_nTupleMapLitID.begin() ; 00114 m_nTupleMapLitID.end() != itup ; ++itup ) 00115 { if( 0 != itup->second ) { itup->second->release() ; } } 00116 m_nTupleMapLitID.clear(); 00117 } 00118 { // release ntuples and clear the container 00119 for( TupleMapTitle::iterator itup = m_evtColMapTitle.begin() ; 00120 m_evtColMapTitle.end() != itup ; ++itup ) 00121 { if( 0 != itup->second ) { itup->second->release() ; } } 00122 m_evtColMapTitle.clear(); 00123 } 00124 { // release ntuples and clear the container 00125 for( TupleMapNumID::iterator itup = m_evtColMapNumID.begin() ; 00126 m_evtColMapNumID.end() != itup ; ++itup ) 00127 { if( 0 != itup->second ) { itup->second->release() ; } } 00128 m_evtColMapNumID.clear() ; 00129 } 00130 { // release ntuples and clear the container 00131 for( TupleMapLitID::iterator itup = m_evtColMapLitID.begin() ; 00132 m_evtColMapLitID.end() != itup ; ++itup ) 00133 { if( 0 != itup->second ) { itup->second->release() ; } } 00134 m_evtColMapLitID.clear() ; 00135 } 00136 00137 // finalize base class 00138 return PBASE::finalize(); 00139 }
| void GaudiTuples< PBASE >::initGaudiTuplesConstructor | ( | ) | [inline, private] |
Constructor initialization and job options.
Definition at line 337 of file GaudiTuples.h.
00338 { 00339 m_produceNTuples = true ; // Switch ON/OFF ntuple production 00340 m_splitNTupleDir = false ; // for HBOOK it is better to use 'true' 00341 m_nTupleLUN = "FILE1" ; // logical unit for ntuples 00342 m_nTupleTopDir = "" ; // top level ntuple directory 00343 m_nTupleDir = this->name() ; // ntuple directory 00344 m_nTupleOffSet = 0 ; // offset for ntuples 00345 // 00346 m_produceEvtCols = false ; // Switch ON/OFF ntupel production 00347 m_splitEvtColDir = false ; // for HBOOK it is better to use 'true' 00348 m_evtColLUN = "EVTCOL" ; // logical unit for ntuples 00349 m_evtColTopDir = "" ; // top level ntuple directory 00350 m_evtColDir = this->name() ; // ntuple directory 00351 m_evtColOffSet = 0 ; // offset for ntuples 00352 // 00353 m_tuplesPrint = true ; // print tuples at end of job 00354 m_evtColsPrint = false ; // print event collections at end of job 00355 // 00356 this -> declareProperty 00357 ( "NTupleProduce" , m_produceNTuples , 00358 "General switch to enable/disable N-tuples" ) ; 00359 this -> declareProperty 00360 ( "NTuplePrint" , m_tuplesPrint , 00361 "Print N-tuple statistics" ) 00362 -> declareUpdateHandler ( &GaudiTuples<PBASE>::printNTupleHandler , this ) ; 00363 this -> declareProperty 00364 ( "NTupleSplitDir" , m_splitNTupleDir , 00365 "Split long directory names into short pieces (suitable for HBOOK)" ) ; 00366 this -> declareProperty 00367 ( "NTupleOffSet" , m_nTupleOffSet , 00368 "Offset for numerical N-tuple ID" ) ; 00369 this -> declareProperty 00370 ( "NTupleLUN" , m_nTupleLUN , 00371 "Logical File Unit for N-tuples" ) ; 00372 this -> declareProperty 00373 ( "NTupleTopDir" , m_nTupleTopDir , 00374 "Top-level directory for N-Tuples") ; 00375 this -> declareProperty 00376 ( "NTupleDir" , m_nTupleDir , 00377 "Subdirectory for N-Tuples" ) ; 00378 // ======================================================================== 00379 this -> declareProperty 00380 ( "EvtColsProduce" , m_produceEvtCols , 00381 "General switch to enable/disable Event Tag Collections" ) ; 00382 this -> declareProperty 00383 ( "EvtColsPrint" , m_evtColsPrint , 00384 "Print statistics for Event Tag Collections " ) 00385 -> declareUpdateHandler ( &GaudiTuples<PBASE>::printEvtColHandler , this ) ; 00386 this -> declareProperty 00387 ( "EvtColSplitDir" , m_splitEvtColDir , 00388 "Split long directory names into short pieces" ) ; 00389 this -> declareProperty 00390 ( "EvtColOffSet" , m_evtColOffSet , 00391 "Offset for numerical N-tuple ID" ) ; 00392 this -> declareProperty 00393 ( "EvtColLUN" , m_evtColLUN , 00394 "Logical File Unit for Event Tag Collections" ) ; 00395 this -> declareProperty 00396 ( "EvtColTopDir" , m_evtColTopDir , 00397 "Top-level directory for Event Tag Collections" ) ; 00398 this -> declareProperty 00399 ( "EvtColDir" , m_evtColDir , 00400 "Subdirectory for Event Tag Collections" ) ; 00401 // ======================================================================== 00402 }
| void GaudiTuples< PBASE >::printNTupleHandler | ( | Property & | ) | [inline, private] |
handler for "NTuplePrint" property
Definition at line 549 of file GaudiTuples.icpp.
00550 { 00551 // no action if not yet initialized 00552 if ( this -> FSMState() < Gaudi::StateMachine::INITIALIZED ) { return ; } 00553 if ( this -> tuplesPrint() ) { this -> printTuples () ; } 00554 }
| void GaudiTuples< PBASE >::printEvtColHandler | ( | Property & | ) | [inline, private] |
handler for "EvtColsPrint" property
Definition at line 559 of file GaudiTuples.icpp.
00560 { 00561 // no action if not yet initialized 00562 if ( this -> FSMState() < Gaudi::StateMachine::INITIALIZED ) { return ; } 00563 if ( this -> evtColsPrint() ) { this -> printEvtCols () ; } 00564 }
bool GaudiTuples< PBASE >::m_produceNTuples [private] |
bool GaudiTuples< PBASE >::m_splitNTupleDir [private] |
flag to indicate splitting of tuple directories (useful for HBOOK)
Definition at line 416 of file GaudiTuples.h.
std::string GaudiTuples< PBASE >::m_nTupleLUN [private] |
std::string GaudiTuples< PBASE >::m_nTupleTopDir [private] |
std::string GaudiTuples< PBASE >::m_nTupleDir [private] |
TupleID::NumericID GaudiTuples< PBASE >::m_nTupleOffSet [private] |
bool GaudiTuples< PBASE >::m_produceEvtCols [private] |
bool GaudiTuples< PBASE >::m_splitEvtColDir [private] |
flag to indicate splitting of tuple directories (useful for HBOOK)
Definition at line 429 of file GaudiTuples.h.
std::string GaudiTuples< PBASE >::m_evtColLUN [private] |
std::string GaudiTuples< PBASE >::m_evtColTopDir [private] |
std::string GaudiTuples< PBASE >::m_evtColDir [private] |
TupleID::NumericID GaudiTuples< PBASE >::m_evtColOffSet [private] |
bool GaudiTuples< PBASE >::m_tuplesPrint [private] |
bool GaudiTuples< PBASE >::m_evtColsPrint [private] |
TupleMapTitle GaudiTuples< PBASE >::m_nTupleMapTitle [mutable, private] |
TupleMapNumID GaudiTuples< PBASE >::m_nTupleMapNumID [mutable, private] |
TupleMapLitID GaudiTuples< PBASE >::m_nTupleMapLitID [mutable, private] |
TupleMapTitle GaudiTuples< PBASE >::m_evtColMapTitle [mutable, private] |
TupleMapNumID GaudiTuples< PBASE >::m_evtColMapNumID [mutable, private] |
TupleMapLitID GaudiTuples< PBASE >::m_evtColMapLitID [mutable, private] |