60 likes | 69 Views
TruthAssociation. EDM Workshop Event Data Model Session Jan 28 2003. Purpose. Create bi-directional associations between HepMC::GenParticles and Identifiers (or Identifiables). Provides the ability to query associations from either side.
E N D
TruthAssociation EDM Workshop Event Data Model Session Jan 28 2003
Purpose • Create bi-directional associations between HepMC::GenParticles and Identifiers (or Identifiables). • Provides the ability to query associations from either side. • Does NOT fill the associations for you - you, or someone else, has to do this.
Structure • Package is Simulation/TruthAssociation • HepMC::GenParticles are identified using their barcodes. • Identifiables are identified using Indentifiers • Associations between HepMC::GenParticles and Indentifiables can be many-to-many • Associations are held internally in two maps of sets: typedef long barcode std::map< Identifier, std::set<barcode>* > m_toTruth; std::map< barcode, std::set<Identifier>* > m_fromTruth;
Usage • Currently, the TruthAssociation package only provides a simple class - it is not a service. • Items are inserted in the association with: virtual StatusCode insert( const Identifier theID, const barcode theTruth ); • Items can be retrieve by their Identifier, the barcode, or the HepMC::GenParticle* pointer: typedef std::set<barcode>::const_iteratorTruthIterator; typedef std::set<Identifier>::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; • user gets back a return code which is the number of entries retrieved, and a set of const iterators over those entries.
Other Functions • Either map can be dumped to stdout: virtual void dumpIdentifierMap() const; virtual void dumpBarcodeMap() const; • Size of association can be retrieved: virtual long size( ) const; • Maps can be emptied: virtual void clear();
Lastly • 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?