All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
RecoMCTruthLinker Class Reference

Optionally creates four collections of LCRelations ("recoMCTruthLink", "trackMCTruthLink", "mcTruthTrackLink", "clusterMCTruthLink", ""clusterMCTruthLink" and "calohitMCTruthLink") with weighetd relations between true particles and reconstructed particles, tracks, clusters, and calorimeter hits, respectively. More...

#include <RecoMCTruthLinker.h>

Inheritance diagram for RecoMCTruthLinker:
[legend]

Public Member Functions

 RecoMCTruthLinker (const RecoMCTruthLinker &)=delete
 
RecoMCTruthLinkeroperator= (const RecoMCTruthLinker &)=delete
 
virtual ProcessornewProcessor ()
 
 RecoMCTruthLinker ()
 
virtual void init ()
 Called at the begin of the job before anything is read. More...
 
virtual void processRunHeader (LCRunHeader *run)
 Called for every run. More...
 
virtual void processEvent (LCEvent *evt)
 Called for every event - the working horse. More...
 
virtual void trackLinker (LCEvent *evt, LCCollection *mcpCol, LCCollection *trackCol, LCCollection **ttrcol, LCCollection **trtcol)
 
virtual void clusterLinker (LCEvent *evt, LCCollection *mcpCol, LCCollection *clusterCol, LCCollection **ctrcol, LCCollection **trccol, LCCollection **chittrlcol)
 
virtual void particleLinker (LCCollection *mcpCol, LCCollection *particleCol, LCCollection *ttrcol, LCCollection *ctrlcol, LCCollection *trtlcol, LCCollection *trclcol, LCCollection **ptrlcol, LCCollection **trplcol)
 
virtual void linkPrinter (LCCollection *mcpCol, LCCollection *particleCol, LCCollection *ptrlcol, LCCollection *trplcol)
 
virtual void check (LCEvent *evt)
 
virtual void makeSkim (LCCollection *mcpCol, LCCollection *ttrcol, LCCollection *ctrcol, LCCollectionVec **skimVec)
 
virtual void end ()
 Called after data processing for clean up. More...
 

Protected Member Functions

virtual void mergeTrackerHitRelations (LCEvent *evt)
 
virtual void mergeCaloHitRelations (LCEvent *evt)
 
void keepMCParticle (MCParticle *mcp)
 
const LCObjectVec * getSimHits (TrackerHit *trkhit, const FloatVec *weights=NULL)
 
const LCObjectVec * getCaloHits (CalorimeterHit *calohit, const FloatVec *weights=NULL)
 
int getDetectorID (TrackerHit *hit)
 

Protected Attributes

std::string _mcParticleCollectionName {}
 input collection names More...
 
std::string _trackCollectionName {}
 
std::string _clusterCollectionName {}
 
std::string _recoParticleCollectionName {}
 
StringVec _simTrkHitCollectionNames {}
 
StringVec _simCaloHitCollectionNames {}
 
StringVec _colNamesTrackerHitRelations {}
 
StringVec _caloHitRelationNames {}
 
LCCollectionVec * _mergedTrackerHitRelCol =nullptr
 
LCRelationNavigator * _navMergedTrackerHitRel =nullptr
 
LCCollectionVec * _mergedCaloHitRelCol =nullptr
 
LCRelationNavigator * _navMergedCaloHitRel =nullptr
 
bool _use_tracker_hit_relations {}
 
std::string _trackMCTruthLinkName {}
 output collection names More...
 
std::string _mCTruthTrackLinkName {}
 
std::string _clusterMCTruthLinkName {}
 
std::string _mCTruthClusterLinkName {}
 
std::string _recoMCTruthLinkName {}
 
std::string _mCTruthRecoLinkName {}
 
std::string _mcParticlesSkimmedName {}
 
std::string _calohitMCTruthLinkName {}
 
bool _FullRecoRelation {}
 output collection steering More...
 
bool _OutputTrackTruthRelation {}
 
bool _OutputTruthTrackRelation {}
 
bool _OutputClusterTruthRelation {}
 
bool _OutputTruthClusterRelation {}
 
bool _OutputCalohitRelation {}
 
bool _OutputTruthRecoRelation {}
 
float _eCutMeV {}
 
bool _saveBremsstrahlungPhotons {}
 
float _bremsstrahlungEnergyCut {}
 
bool _invertedNonDestructiveInteractionLogic {}
 
bool _using_particle_gun {}
 
IntVec _pdgVec {}
 
int _nRun {}
 
int _nEvt {}
 
PDGSet _pdgSet {}
 

Private Types

typedef std::set< unsigned > PDGSet
 

Detailed Description

Optionally creates four collections of LCRelations ("recoMCTruthLink", "trackMCTruthLink", "mcTruthTrackLink", "clusterMCTruthLink", ""clusterMCTruthLink" and "calohitMCTruthLink") with weighetd relations between true particles and reconstructed particles, tracks, clusters, and calorimeter hits, respectively.

If the corresponding parameter for the output collection name is empty the collection is not created.

This relation is based on the number of hits for tracks, for hits weighted with the SimHit-energy for clusters and calorimeter hits. For tracks and clusters, the weight is the sum of hits from the considered true particle divided by the sum of all hits, for calorimter hits, it's simply the simHit energy of the hit. For the reconstructed particles, the relation could either be only to the true particle having the largest weight, or to all contributing true particles. In the former case, the pointer (and weight) will concern the true particle creating hits in the tracker, if there are any. Only for track-less seen particles would it point to the main contributor to the cluster. In the latter case, pointers are set up to all contributing true particles, and the weight is givean as (fractional contribution to track)+ 10000* (fractional contribution to cluster), with fractions given in permil (int). Hence: trackwgt = (int(wgt)%10000)/1000. and clusterwgt = (int(wgt)/10000)/1000. Which of the two is used is selected by the processor flag "FullRecoRelation" (default=true)

For example a weight of 0.95 for a charged particle link implies that 95 percent of the SimTrackerHits used in the particles' track fit have been caused by the linked MCParticle.
If a neutral particle with one cluster has no MC contribution assigned the MCParticle pointing closest to the cluster is assigned and the weight is set to the negative scalar product of the MCParticle's momentum direction and the direction to the Cluster position. (This fixes a bug in the Mokka LCal driver ov mokka-v06-06-p03).

A skimmed MCParticle subset collection is created. It containes all particles created by the generator program and all particles that have been reconstructed including all their parents. Additionally, the daughters of all decays in flight of particles specified in 'KeepDaughtersPDG' (default: gamma, K0s and pi0) are kept in the skimmed list if the original particle is in the skim ( either from the generator or from reconstruction).

Output

  • trackMCTruthLink: holds LCRelations that map the tracks to the corresponding MCParticle - the weight is the fraction of all hits on the the track that have contributions from this MCParticle
  • mcTruthTrackLink: holds LCRelations that map MCParticles to tracks - the weight is the fraction of all sim-hits from the MCParticle that contributed to this track
  • clusterMCTruthLink: holds LCRelations that map the clusters to the corresponding MCParticle
  • recoMCTruthLink: holds LCRelations that map the reconstructed particles to the corresponding MCParticle
  • calohitMCTruthLink: holds LCRelations that map the calorimeter hits to the corresponding MCParticle
  • MCParticlesSkimmed: skimmed MCParticle collection
Parameters
MCParticleCollectionNamethe MCParticle input collection
trackCollectionNamethe ReconstructedParticles input collection
clusterCollectionNamethe ReconstructedParticles input collection
UseTrackerHitRelationsuse the rel collection for TrackerHits default true (false only for very old files)
TrackerHitsRelInputCollectionsthe rel collection for TrackerHit collection
SimClusterHitRelationrelation betweeen simulated and digitized cluster hits
KeepDaughtersPDGabsolute PDG code of particles where daughter are to be kept (default: gamma,pi0,K0_S)
FullRecoRelationSelect which option to use for the reconstructed link ( default: full relation)
TrackMCTruthLinkNamename of output collection - default is ""
MCTruthTrackLinkNamename of output collection - default is ""
ClusterMCTruthLinkNamename of output collection - default is ""
RecoMCTruthLinkNamename of output collection - default is ""
CalohitMCTruthLinkNamename of output collection - default is ""
MCParticlesSkimmedNameskimmed MCParticle collection - default is ""
UsingParticleGunIf Using Particle Gun Ignore Gen Stat - default is false
Author
M. Berggren, DESY, based on RecoMCTruthLinker v 1.0 by F. Gaede, DESY. changelog F.Gaede, 02/2012 modified logic for optional output collections (collection name not empty) and added mcTruthTrackLink
Version
$Id$

Definition at line 106 of file RecoMCTruthLinker.h.

Member Typedef Documentation

typedef std::set< unsigned > RecoMCTruthLinker::PDGSet
private

Definition at line 109 of file RecoMCTruthLinker.h.

Constructor & Destructor Documentation

RecoMCTruthLinker::RecoMCTruthLinker ( const RecoMCTruthLinker )
delete
RecoMCTruthLinker::RecoMCTruthLinker ( )

Definition at line 51 of file RecoMCTruthLinker.cc.

Member Function Documentation

void RecoMCTruthLinker::check ( LCEvent *  evt)
virtual

Definition at line 1983 of file RecoMCTruthLinker.cc.

void RecoMCTruthLinker::clusterLinker ( LCEvent *  evt,
LCCollection *  mcpCol,
LCCollection *  clusterCol,
LCCollection **  ctrcol,
LCCollection **  trccol,
LCCollection **  chittrlcol 
)
virtual

Definition at line 639 of file RecoMCTruthLinker.cc.

void RecoMCTruthLinker::end ( )
virtual

Called after data processing for clean up.

Definition at line 2126 of file RecoMCTruthLinker.cc.

const LCObjectVec * RecoMCTruthLinker::getCaloHits ( CalorimeterHit *  calohit,
const FloatVec *  weights = NULL 
)
protected

Definition at line 2319 of file RecoMCTruthLinker.cc.

int RecoMCTruthLinker::getDetectorID ( TrackerHit *  hit)
inlineprotected

Definition at line 162 of file RecoMCTruthLinker.h.

const LCObjectVec * RecoMCTruthLinker::getSimHits ( TrackerHit *  trkhit,
const FloatVec *  weights = NULL 
)
protected

Definition at line 2106 of file RecoMCTruthLinker.cc.

void RecoMCTruthLinker::init ( )
virtual

Called at the begin of the job before anything is read.

Use to initialize the processor, e.g. book histograms.

Definition at line 284 of file RecoMCTruthLinker.cc.

void RecoMCTruthLinker::keepMCParticle ( MCParticle *  mcp)
protected

Definition at line 1961 of file RecoMCTruthLinker.cc.

void RecoMCTruthLinker::linkPrinter ( LCCollection *  mcpCol,
LCCollection *  particleCol,
LCCollection *  ptrlcol,
LCCollection *  trplcol 
)
virtual

Definition at line 2340 of file RecoMCTruthLinker.cc.

void RecoMCTruthLinker::makeSkim ( LCCollection *  mcpCol,
LCCollection *  ttrcol,
LCCollection *  ctrcol,
LCCollectionVec **  skimVec 
)
virtual

Definition at line 1791 of file RecoMCTruthLinker.cc.

void RecoMCTruthLinker::mergeCaloHitRelations ( LCEvent *  evt)
protectedvirtual

Definition at line 2239 of file RecoMCTruthLinker.cc.

void RecoMCTruthLinker::mergeTrackerHitRelations ( LCEvent *  evt)
protectedvirtual

Definition at line 2153 of file RecoMCTruthLinker.cc.

virtual Processor* RecoMCTruthLinker::newProcessor ( )
inlinevirtual

Definition at line 116 of file RecoMCTruthLinker.h.

RecoMCTruthLinker& RecoMCTruthLinker::operator= ( const RecoMCTruthLinker )
delete
void RecoMCTruthLinker::particleLinker ( LCCollection *  mcpCol,
LCCollection *  particleCol,
LCCollection *  ttrcol,
LCCollection *  ctrlcol,
LCCollection *  trtlcol,
LCCollection *  trclcol,
LCCollection **  ptrlcol,
LCCollection **  trplcol 
)
virtual

Definition at line 1587 of file RecoMCTruthLinker.cc.

void RecoMCTruthLinker::processEvent ( LCEvent *  evt)
virtual

Called for every event - the working horse.

Definition at line 325 of file RecoMCTruthLinker.cc.

void RecoMCTruthLinker::processRunHeader ( LCRunHeader *  run)
virtual

Called for every run.

Definition at line 319 of file RecoMCTruthLinker.cc.

void RecoMCTruthLinker::trackLinker ( LCEvent *  evt,
LCCollection *  mcpCol,
LCCollection *  trackCol,
LCCollection **  ttrcol,
LCCollection **  trtcol 
)
virtual

Definition at line 442 of file RecoMCTruthLinker.cc.

Member Data Documentation

float RecoMCTruthLinker::_bremsstrahlungEnergyCut {}
protected

Definition at line 208 of file RecoMCTruthLinker.h.

std::string RecoMCTruthLinker::_calohitMCTruthLinkName {}
protected

Definition at line 197 of file RecoMCTruthLinker.h.

StringVec RecoMCTruthLinker::_caloHitRelationNames {}
protected

Definition at line 180 of file RecoMCTruthLinker.h.

std::string RecoMCTruthLinker::_clusterCollectionName {}
protected

Definition at line 173 of file RecoMCTruthLinker.h.

std::string RecoMCTruthLinker::_clusterMCTruthLinkName {}
protected

Definition at line 192 of file RecoMCTruthLinker.h.

StringVec RecoMCTruthLinker::_colNamesTrackerHitRelations {}
protected

Definition at line 179 of file RecoMCTruthLinker.h.

float RecoMCTruthLinker::_eCutMeV {}
protected

Definition at line 206 of file RecoMCTruthLinker.h.

bool RecoMCTruthLinker::_FullRecoRelation {}
protected

output collection steering

Definition at line 199 of file RecoMCTruthLinker.h.

bool RecoMCTruthLinker::_invertedNonDestructiveInteractionLogic {}
protected

Definition at line 209 of file RecoMCTruthLinker.h.

std::string RecoMCTruthLinker::_mcParticleCollectionName {}
protected

input collection names

Definition at line 171 of file RecoMCTruthLinker.h.

std::string RecoMCTruthLinker::_mcParticlesSkimmedName {}
protected

Definition at line 196 of file RecoMCTruthLinker.h.

std::string RecoMCTruthLinker::_mCTruthClusterLinkName {}
protected

Definition at line 193 of file RecoMCTruthLinker.h.

std::string RecoMCTruthLinker::_mCTruthRecoLinkName {}
protected

Definition at line 195 of file RecoMCTruthLinker.h.

std::string RecoMCTruthLinker::_mCTruthTrackLinkName {}
protected

Definition at line 191 of file RecoMCTruthLinker.h.

LCCollectionVec* RecoMCTruthLinker::_mergedCaloHitRelCol =nullptr
protected

Definition at line 184 of file RecoMCTruthLinker.h.

LCCollectionVec* RecoMCTruthLinker::_mergedTrackerHitRelCol =nullptr
protected

Definition at line 182 of file RecoMCTruthLinker.h.

LCRelationNavigator* RecoMCTruthLinker::_navMergedCaloHitRel =nullptr
protected

Definition at line 185 of file RecoMCTruthLinker.h.

LCRelationNavigator* RecoMCTruthLinker::_navMergedTrackerHitRel =nullptr
protected

Definition at line 183 of file RecoMCTruthLinker.h.

int RecoMCTruthLinker::_nEvt {}
protected

Definition at line 216 of file RecoMCTruthLinker.h.

int RecoMCTruthLinker::_nRun {}
protected

Definition at line 215 of file RecoMCTruthLinker.h.

bool RecoMCTruthLinker::_OutputCalohitRelation {}
protected

Definition at line 204 of file RecoMCTruthLinker.h.

bool RecoMCTruthLinker::_OutputClusterTruthRelation {}
protected

Definition at line 202 of file RecoMCTruthLinker.h.

bool RecoMCTruthLinker::_OutputTrackTruthRelation {}
protected

Definition at line 200 of file RecoMCTruthLinker.h.

bool RecoMCTruthLinker::_OutputTruthClusterRelation {}
protected

Definition at line 203 of file RecoMCTruthLinker.h.

bool RecoMCTruthLinker::_OutputTruthRecoRelation {}
protected

Definition at line 205 of file RecoMCTruthLinker.h.

bool RecoMCTruthLinker::_OutputTruthTrackRelation {}
protected

Definition at line 201 of file RecoMCTruthLinker.h.

PDGSet RecoMCTruthLinker::_pdgSet {}
protected

Definition at line 218 of file RecoMCTruthLinker.h.

IntVec RecoMCTruthLinker::_pdgVec {}
protected

Definition at line 213 of file RecoMCTruthLinker.h.

std::string RecoMCTruthLinker::_recoMCTruthLinkName {}
protected

Definition at line 194 of file RecoMCTruthLinker.h.

std::string RecoMCTruthLinker::_recoParticleCollectionName {}
protected

Definition at line 174 of file RecoMCTruthLinker.h.

bool RecoMCTruthLinker::_saveBremsstrahlungPhotons {}
protected

Definition at line 207 of file RecoMCTruthLinker.h.

StringVec RecoMCTruthLinker::_simCaloHitCollectionNames {}
protected

Definition at line 177 of file RecoMCTruthLinker.h.

StringVec RecoMCTruthLinker::_simTrkHitCollectionNames {}
protected

Definition at line 176 of file RecoMCTruthLinker.h.

std::string RecoMCTruthLinker::_trackCollectionName {}
protected

Definition at line 172 of file RecoMCTruthLinker.h.

std::string RecoMCTruthLinker::_trackMCTruthLinkName {}
protected

output collection names

Definition at line 190 of file RecoMCTruthLinker.h.

bool RecoMCTruthLinker::_use_tracker_hit_relations {}
protected

Definition at line 187 of file RecoMCTruthLinker.h.

bool RecoMCTruthLinker::_using_particle_gun {}
protected

Definition at line 211 of file RecoMCTruthLinker.h.


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