Presentation on theme: "N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett TruthAssociation EDM Workshop Event Data Model Session Jan 28 2003."— Presentation transcript:
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett TruthAssociation EDM Workshop Event Data Model Session Jan 28 2003
2 Charles Leggett Purpose F Create bi-directional associations between HepMC::GenParticles and Identifiers (or Identifiables). F Provides the ability to query associations from either side. NOT F Does NOT fill the associations for you - you, or someone else, has to do this.
3 Charles Leggett Structure F Package is Simulation/TruthAssociation F HepMC::GenParticles are identified using their barcodes. F Identifiables are identified using Indentifiers F Associations between HepMC::GenParticles and Indentifiables can be many-to-many F Associations are held internally in two maps of sets: typedef long barcode std::map * > m_toTruth; std::map * > m_fromTruth;
4 Charles Leggett Usage F Currently, the TruthAssociation package only provides a simple class - it is not a service. F Items are inserted in the association with: virtual StatusCode insert( const Identifier theID, const barcode theTruth ); F Items can be retrieve by their Identifier, the barcode, or the HepMC::GenParticle* pointer: typedef std::set ::const_iterator TruthIterator; typedef std::set ::const_iterator IdentifierIterator; virtual int retrieveFromId( const Identifier theID, TruthIterator& first TruthIterator& last ) const; virtual int retrieveFromTruth( const barcode theTruth, IdentifierIterator& first, IdentifierIterator& last ) const; virtual int retrieveFromTruth( const HepMC::GenParticle* theTruth, IdentifierIterator& first, IdentifierIterator& last ) const; F user gets back a return code which is the number of entries retrieved, and a set of const iterators over those entries.
5 Charles Leggett Other Functions F Either map can be dumped to stdout: virtual void dumpIdentifierMap() const; virtual void dumpBarcodeMap() const; F Size of association can be retrieved: virtual long size( ) const; F Maps can be emptied: virtual void clear();
6 Charles Leggett Lastly F I told Srini that this talk would only take about 2 minutes, so it’s up to you, David, to keep the audience entertained for the next 18 minutes. Might I suggest a humorous anecdote, or perhaps a short song and dance number?