PSEvt::DamageMap Class Reference
[PSEvt package]

Class to map EventKeys to their xtc damage values, and to hold Src only damage. More...

#include <DamageMap.h>

List of all members.

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.


Detailed Description

Class to map EventKeys to their xtc damage values, and to hold Src only damage.

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.

See also:
EventKey
Version:
$Id:
Author:
David Schneider

Definition at line 41 of file DamageMap.h.


Member Typedef Documentation

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.


Member Function Documentation

void PSEvt::DamageMap::addSrcDamage ( Pds::Src  src,
Pds::Damage  damage 
)

Definition at line 32 of file DamageMap.cpp.

References logger, and MsgLog.

const_iterator PSEvt::DamageMap::begin (  )  const [inline]

Definition at line 68 of file DamageMap.h.

iterator PSEvt::DamageMap::begin (  )  [inline]

Definition at line 52 of file DamageMap.h.

Referenced by damageCounts(), and PSEvt::operator<<().

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.

References begin(), and end().

const_iterator PSEvt::DamageMap::end (  )  const [inline]

Definition at line 69 of file DamageMap.h.

iterator PSEvt::DamageMap::end (  )  [inline]

Definition at line 53 of file DamageMap.h.

Referenced by damageCounts(), and PSEvt::operator<<().

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.

Parameters:
[in] eventKey EventKey to look up damage for
Returns:
iterator to eventKey position in map.

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]

Definition at line 76 of file DamageMap.h.

Referenced by PSEvt::operator<<().


The documentation for this class was generated from the following files:
Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7