#include <DamageMap.h>
Public Types | |
typedef std::map< PSEvt::EventKey, Pds::Damage > | MapImpl |
typedef MapImpl::iterator | iterator |
typedef MapImpl::const_iterator | const_iterator |
Public Member Functions | |
Pds::Damage & | operator[] (const PSEvt::EventKey &eventKey) |
add damage to DamageMap. Works the same as std::map::operator[] | |
iterator | begin () |
iterator | end () |
iterator | find (const PSEvt::EventKey &eventKey) |
finds damage in the DamageMap. Tries two keys if eventKey has key string. | |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | find (const PSEvt::EventKey &eventKey) const |
const version of find(), see documentation for find(). | |
void | addSrcDamage (Pds::Src src, Pds::Damage damage) |
bool | splitEvent () const |
std::map< uint32_t, int > | damageCounts () const |
returns a histogram of damage values in the DamageMap associated with EventKeys | |
const std::vector< std::pair< Pds::Src, Pds::Damage > > & | getSrcDroppedContributions () const |
returns the list of src only damage for the event. |
If a Psana Input Module records damage during event processing, for objects placed in either the EventStore or ConfigStore, the input module should place an instance of DamageMap in the Event. Any damage to objects placed into the Event or ConfigStore should be added to the DamageMap with the same EventKey used to store the object in the Event or ConfigStore. Damage associated only with a Pds::Src value should also be placed in the DamageMap. Src damage should always contain the DroppedContribution bit. If it is not present, the damage value is ignored.
Modules can then look for the DamageMap in the Event and find out if there was any damage for specific EventKey's, as well as find out if dropped contributions (src damage) were present. This kind of damage implies a split event.
This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.
Definition at line 41 of file DamageMap.h.
typedef MapImpl::const_iterator PSEvt::DamageMap::const_iterator |
Definition at line 45 of file DamageMap.h.
typedef MapImpl::iterator PSEvt::DamageMap::iterator |
Definition at line 44 of file DamageMap.h.
typedef std::map<PSEvt::EventKey, Pds::Damage> PSEvt::DamageMap::MapImpl |
Definition at line 43 of file DamageMap.h.
void PSEvt::DamageMap::addSrcDamage | ( | Pds::Src | src, | |
Pds::Damage | damage | |||
) |
const_iterator PSEvt::DamageMap::begin | ( | ) | const [inline] |
Definition at line 68 of file DamageMap.h.
iterator PSEvt::DamageMap::begin | ( | ) | [inline] |
std::map< uint32_t, int > PSEvt::DamageMap::damageCounts | ( | ) | const |
returns a histogram of damage values in the DamageMap associated with EventKeys
distinct Damage values are mapped to their frequency within the DamageMap. No reporting is provided for Src damage - use getSrcDroppedContributions or splitEvent for this
Definition at line 41 of file DamageMap.cpp.
const_iterator PSEvt::DamageMap::end | ( | ) | const [inline] |
Definition at line 69 of file DamageMap.h.
iterator PSEvt::DamageMap::end | ( | ) | [inline] |
PSEvt::DamageMap::const_iterator PSEvt::DamageMap::find | ( | const PSEvt::EventKey & | eventKey | ) | const |
const version of find(), see documentation for find().
Definition at line 20 of file DamageMap.cpp.
References PSEvt::EventKey::key(), PSEvt::EventKey::src(), and PSEvt::EventKey::typeinfo().
PSEvt::DamageMap::iterator PSEvt::DamageMap::find | ( | const PSEvt::EventKey & | eventKey | ) |
finds damage in the DamageMap. Tries two keys if eventKey has key string.
EventKey's have three componenents, type, Src and key, where key is a string that users may create, typically for data derived from original data in the Psana Event store. If no damage has been recorded for the given key, and the given key includes a string component, find() will also look for damage associated with the corresponding EventKey where the string component is blank.
[in] | eventKey | EventKey to look up damage for |
Definition at line 8 of file DamageMap.cpp.
References PSEvt::EventKey::key(), PSEvt::EventKey::src(), and PSEvt::EventKey::typeinfo().
const std::vector<std::pair<Pds::Src,Pds::Damage> >& PSEvt::DamageMap::getSrcDroppedContributions | ( | ) | const [inline] |
returns the list of src only damage for the event.
All damage values will contain the DroppedContribution bit.
Definition at line 91 of file DamageMap.h.
Referenced by PSEvt::operator<<().
Pds::Damage& PSEvt::DamageMap::operator[] | ( | const PSEvt::EventKey & | eventKey | ) | [inline] |
add damage to DamageMap. Works the same as std::map::operator[]
Definition at line 50 of file DamageMap.h.
bool PSEvt::DamageMap::splitEvent | ( | ) | const [inline] |