Overlay  0.16.0
Static Public Member Functions | List of all members
overlay::Merger Class Reference

Basic utility to merge two events or collections. More...

#include <Merger.h>

Static Public Member Functions

static void mergeMC (EVENT::LCEvent *srcEvent, EVENT::LCEvent *destEvent, std::string mcDestString)
 Tries to merge collections with a name present in both events (like merge(EVENT::LCEvent*, EVENT::LCEvent*) but the MC particle collection in srcEvent is merged with the collection named mcDestString. More...
 
static void mergeMC (EVENT::LCEvent *srcEvent, std::string mcSrcString, EVENT::LCEvent *destEvent, std::string mcDestString)
 merge function, takes two events and tries to merge collections with a name present in both events. More...
 
static void merge (EVENT::LCEvent *srcEvent, EVENT::LCEvent *destEvent)
 Tries to merge collections with a name present in both events. More...
 
static void merge (EVENT::LCEvent *srcEvent, EVENT::LCEvent *destEvent, std::map< std::string, std::string > *mergeMap)
 Merges the collections of the two events according to a given map
More...
 
static void merge (EVENT::LCEvent *srcEvent, std::string srcString, EVENT::LCEvent *destEvent, std::string destString)
 Merges the two named collections in the given events. More...
 
static void merge (EVENT::LCCollection *src, EVENT::LCCollection *dest)
 merge function, takes two collections and addes the elements from src to dest. More...
 

Detailed Description

Basic utility to merge two events or collections.

So far only simulation collections are supported.

Author
N. Chiapolini, DESY
Version
Id:
Merger.h 848 2012-09-11 09:12:03Z gaede

Member Function Documentation

static void overlay::Merger::merge ( EVENT::LCEvent *  srcEvent,
EVENT::LCEvent *  destEvent 
)
static

Tries to merge collections with a name present in both events.

Parameters
srcEventsource event.
destEventdestination event

calles merge(EVENT::LCCollection*, EVENT::LCCollection*) internally

static void overlay::Merger::merge ( EVENT::LCEvent *  srcEvent,
EVENT::LCEvent *  destEvent,
std::map< std::string, std::string > *  mergeMap 
)
static

Merges the collections of the two events according to a given map

Parameters
srcEventsource event.
destEventdestination event
*mergeMapMap containing the src->dest association for the collection names
Map structure: (srcColName, destColName)
If srcCol does not exist, the pair will be ignored, if destCol does not exist, a new collection with the same type as srcCol will be created.

calles merge(EVENT::LCCollection*, EVENT::LCCollection*) internally

static void overlay::Merger::merge ( EVENT::LCEvent *  srcEvent,
std::string  srcString,
EVENT::LCEvent *  destEvent,
std::string  destString 
)
static

Merges the two named collections in the given events.

Parameters
srcEventsource event.
srcStringname of the source collection
destEventdestination event
destStringname of the destination collection

calles merge(EVENT::LCCollection*, EVENT::LCCollection*) internally

static void overlay::Merger::merge ( EVENT::LCCollection *  src,
EVENT::LCCollection *  dest 
)
static

merge function, takes two collections and addes the elements from src to dest.

Both collections need to have same type!
Types merged:

  • MCPARTICLE
  • SIMTRACKERHIT
  • SIMCALORIMETERHIT
  • TRACKERHIT
  • CALORIMETERHIT

Algorithm: MCPARTICLE, SIMTRACKERHIT, TRACKERHIT: All Hits from the source collection are copied into the destination collection. SIMCALORIMETERHIT, CALORIMETERHIT}: If the destination collection contains a hit with the same cellID, the energy of the source hit will be added to it. Otherwiese the hit will be copied into the destination collection. (In case of simulated data the MCParticle contributions will be preserved.)

!! It is the callers responsability to make sure the mcParticles pointed to by the hits do exist !!

Parameters
srcCollection containing the entries that should be added to another collection.
srcCollection to which the new entries should be added.
static void overlay::Merger::mergeMC ( EVENT::LCEvent *  srcEvent,
EVENT::LCEvent *  destEvent,
std::string  mcDestString 
)
static

Tries to merge collections with a name present in both events (like merge(EVENT::LCEvent*, EVENT::LCEvent*) but the MC particle collection in srcEvent is merged with the collection named mcDestString.


Parameters
srcEventsource event.
destEventdestination event
mcDestStringname of the collection that the MCPARTICLE collection should be merged with. If more then one collection of type MCPARTICLE exists in srcEvent the function exits without any action.

calles mergeMC(EVENT::LCEvent*, std::string, EVENT::LCEvent*, std::string) internally

static void overlay::Merger::mergeMC ( EVENT::LCEvent *  srcEvent,
std::string  mcSrcString,
EVENT::LCEvent *  destEvent,
std::string  mcDestString 
)
static

merge function, takes two events and tries to merge collections with a name present in both events.


Parameters
srcEventsource event.
destEventdestination event
mcSrcStringThe MC particle collection in srcEvent
mcDestStringThe MC particle collection the source particles should be addet to. If this collection does not exist, a new collection is created.

calles merge(EVENT::LCEvent*, EVENT::LCEvent*) internally (after merging the MC collections and removing mcSrcString from the srcEvent)


The documentation for this class was generated from the following file: