CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
TTStubAssociationMap< T > Class Template Reference

Stores association of Truth Particles (TP) to L1 Track-Trigger Stubs. More...

#include <TTStubAssociationMap.h>

Public Member Functions

const TrackingParticlePtrfindTrackingParticlePtr (TTStubRefT< T > aStub) const
 Operations. More...
 
const std::vector< TTStubRefT< T > > & findTTStubRefs (TrackingParticlePtr aTrackingParticle) const
 
const MapTPToVecStub< T > & getTrackingParticleToTTStubsMap () const
 
const MapStubToTP< T > & getTTStubToTrackingParticleMap () const
 Get/set stub <-> truth association maps. More...
 
bool isCombinatoric (TTStubRefT< T > aStub) const
 
bool isGenuine (TTStubRefT< T > aStub) const
 MC truth. More...
 
bool isUnknown (TTStubRefT< T > aStub) const
 
void setTrackingParticleToTTStubsMap (const MapTPToVecStub< T > &aMap)
 
void setTTClusterAssociationMap (edm::RefProd< TTClusterAssociationMap< T >> aCluAssoMap)
 Set cluster <-> truth association object. More...
 
void setTTStubToTrackingParticleMap (const MapStubToTP< T > &aMap)
 
 TTStubAssociationMap ()
 Constructors. More...
 
 ~TTStubAssociationMap ()
 Destructor. More...
 

Private Attributes

MapStubToTP< TstubToTrackingParticleMap_
 Data members. More...
 
edm::RefProd< TTClusterAssociationMap< T > > theClusterAssociationMap_
 
MapTPToVecStub< TtrackingParticleToStubVectorMap_
 

Static Private Attributes

static const TrackingParticlePtr nullTrackingParticlePtr_
 Close class. More...
 
static const std::vector< TTStubRefT< T > > nullVecStubRef_
 

Detailed Description

template<typename T>
class TTStubAssociationMap< T >

Stores association of Truth Particles (TP) to L1 Track-Trigger Stubs.

Contains two maps. One associates each stub to its principle TP. (i.e. Not to all TP that contributed to it). The other associates each TP to a vector of all stubs it contributed to. The two maps are therefore not forward-backward symmetric.

(The template structure is used to accomodate types other than PixelDigis, in case they are needed in future).

Author
Nicola Pozzobon
Date
2013, Jul 19 (tidy up: Ian Tomalin, 2020)

Definition at line 49 of file TTStubAssociationMap.h.

Constructor & Destructor Documentation

◆ TTStubAssociationMap()

template<typename T >
TTStubAssociationMap< T >::TTStubAssociationMap ( )

Constructors.

Default Constructor NOTE: to be used with setSomething(...) methods

Set default data members

Definition at line 129 of file TTStubAssociationMap.h.

129  {
131 }

◆ ~TTStubAssociationMap()

template<typename T >
TTStubAssociationMap< T >::~TTStubAssociationMap ( )

Destructor.

Definition at line 135 of file TTStubAssociationMap.h.

135 {}

Member Function Documentation

◆ findTrackingParticlePtr()

template<typename T >
const TrackingParticlePtr & TTStubAssociationMap< T >::findTrackingParticlePtr ( TTStubRefT< T aStub) const

Operations.

Get principle TP associated to a stub. (Non-NULL if isGenuine() below is true). (N.B. There is no function returning all TP associated to a stub). (P.S. As this function only returns principle TP, it is not used when constructing the TTTrackAssociationMap).

Definition at line 139 of file TTStubAssociationMap.h.

139  {
140  if (stubToTrackingParticleMap_.find(aStub) != stubToTrackingParticleMap_.end()) {
141  return stubToTrackingParticleMap_.find(aStub)->second;
142  } else {
144  }
145 }
static const TrackingParticlePtr nullTrackingParticlePtr_
Close class.
MapStubToTP< T > stubToTrackingParticleMap_
Data members.

◆ findTTStubRefs()

template<typename T >
const std::vector< TTStubRefT< T > > & TTStubAssociationMap< T >::findTTStubRefs ( TrackingParticlePtr  aTrackingParticle) const

Get all stubs associated to a TP. (Even if the TP just contributes to one cluster in stub, and even if their are other such TP, it is still listed here).

Definition at line 148 of file TTStubAssociationMap.h.

148  {
149  if (trackingParticleToStubVectorMap_.find(aTrackingParticle) != trackingParticleToStubVectorMap_.end()) {
150  return trackingParticleToStubVectorMap_.find(aTrackingParticle)->second;
151  } else {
152  return nullVecStubRef_;
153  }
154 }
MapTPToVecStub< T > trackingParticleToStubVectorMap_
static const std::vector< TTStubRefT< T > > nullVecStubRef_

◆ getTrackingParticleToTTStubsMap()

template<typename T >
const MapTPToVecStub<T>& TTStubAssociationMap< T >::getTrackingParticleToTTStubsMap ( ) const
inline

◆ getTTStubToTrackingParticleMap()

template<typename T >
const MapStubToTP<T>& TTStubAssociationMap< T >::getTTStubToTrackingParticleMap ( ) const
inline

Get/set stub <-> truth association maps.

Definition at line 59 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::stubToTrackingParticleMap_.

MapStubToTP< T > stubToTrackingParticleMap_
Data members.

◆ isCombinatoric()

template<typename T >
bool TTStubAssociationMap< T >::isCombinatoric ( TTStubRefT< T aStub) const

Defined by exclusion

Definition at line 167 of file TTStubAssociationMap.h.

167  {
169  if (this->isGenuine(aStub))
170  return false;
171 
172  if (this->isUnknown(aStub))
173  return false;
174 
175  return true;
176 }
bool isUnknown(TTStubRefT< T > aStub) const
bool isGenuine(TTStubRefT< T > aStub) const
MC truth.

◆ isGenuine()

template<typename T >
bool TTStubAssociationMap< T >::isGenuine ( TTStubRefT< T aStub) const

MC truth.

— Get quality of stub based on truth info. (N.B. Both genuine & combinatoric stubs contribute to "genuine" L1 tracks associated by TTTrackAssociationMap). (exactly 1 of following 3 functions is always true) If both clusters are unknown, the stub is "unknown". If only one cluster is unknown, the stub is combinatoric. If both clusters are genuine, and are associated to the same (main) TrackingParticle, the stub is "genuine". If both clusters are genuine, but are associated to different (main) TrackingParticles, the stub is "combinatoric". If one cluster is combinatoric and the other is genuine/combinatoric, and they both share exactly one TrackingParticle in common, then the stub is "genuine". (The clusters can have other TrackingParticles besides the shared one, as long as these are not shared). If instead the clusters share 0 or ≥2 TrackingParticles in common, then the stub is "combinatoric".

Check if there is a SimTrack

Definition at line 158 of file TTStubAssociationMap.h.

158  {
160  if ((this->findTrackingParticlePtr(aStub)).isNull())
161  return false;
162 
163  return true;
164 }
const TrackingParticlePtr & findTrackingParticlePtr(TTStubRefT< T > aStub) const
Operations.

◆ isUnknown()

template<typename T >
bool TTStubAssociationMap< T >::isUnknown ( TTStubRefT< T aStub) const

UNKNOWN means that both clusters are unknown

Sanity check

Definition at line 179 of file TTStubAssociationMap.h.

179  {
181 
184  return true;
185  }
186 
187  if (theClusterAssociationMap_->isUnknown(aStub->clusterRef(0)) &&
188  theClusterAssociationMap_->isUnknown(aStub->clusterRef(1)))
189  return true;
190 
191  return false;
192 }
bool isUnknown(TTClusterRefT< T > aCluster) const
Cluster "unknown": i.e. not associated with any TP.
edm::RefProd< TTClusterAssociationMap< T > > theClusterAssociationMap_
bool isNull() const
Checks for null.
Definition: RefProd.h:115

◆ setTrackingParticleToTTStubsMap()

template<typename T >
void TTStubAssociationMap< T >::setTrackingParticleToTTStubsMap ( const MapTPToVecStub< T > &  aMap)
inline

◆ setTTClusterAssociationMap()

template<typename T >
void TTStubAssociationMap< T >::setTTClusterAssociationMap ( edm::RefProd< TTClusterAssociationMap< T >>  aCluAssoMap)
inline

Set cluster <-> truth association object.

Definition at line 66 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::theClusterAssociationMap_.

66  {
67  theClusterAssociationMap_ = aCluAssoMap;
68  }
edm::RefProd< TTClusterAssociationMap< T > > theClusterAssociationMap_

◆ setTTStubToTrackingParticleMap()

template<typename T >
void TTStubAssociationMap< T >::setTTStubToTrackingParticleMap ( const MapStubToTP< T > &  aMap)
inline

Definition at line 62 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::stubToTrackingParticleMap_.

MapStubToTP< T > stubToTrackingParticleMap_
Data members.

Member Data Documentation

◆ nullTrackingParticlePtr_

template<typename T >
const TrackingParticlePtr TTStubAssociationMap< T >::nullTrackingParticlePtr_
staticprivate

Close class.

Implementation of methods

Here, in the header file, the methods which do not depend on the specific type <T> that can fit the template. Other methods, with type-specific features, are implemented in the source file.

Definition at line 108 of file TTStubAssociationMap.h.

◆ nullVecStubRef_

template<typename T >
const std::vector< TTStubRefT< T > > TTStubAssociationMap< T >::nullVecStubRef_
staticprivate

Definition at line 109 of file TTStubAssociationMap.h.

◆ stubToTrackingParticleMap_

template<typename T >
MapStubToTP<T> TTStubAssociationMap< T >::stubToTrackingParticleMap_
private

◆ theClusterAssociationMap_

template<typename T >
edm::RefProd<TTClusterAssociationMap<T> > TTStubAssociationMap< T >::theClusterAssociationMap_
private

◆ trackingParticleToStubVectorMap_

template<typename T >
MapTPToVecStub<T> TTStubAssociationMap< T >::trackingParticleToStubVectorMap_
private