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 47 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 127 of file TTStubAssociationMap.h.

127  {
129 }

◆ ~TTStubAssociationMap()

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

Destructor.

Definition at line 133 of file TTStubAssociationMap.h.

133 {}

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 137 of file TTStubAssociationMap.h.

Referenced by l1tVertexFinder::Stub::fillTruth(), and tmtt::Stub::fillTruth().

137  {
138  if (stubToTrackingParticleMap_.find(aStub) != stubToTrackingParticleMap_.end()) {
139  return stubToTrackingParticleMap_.find(aStub)->second;
140  } else {
142  }
143 }
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 146 of file TTStubAssociationMap.h.

146  {
147  if (trackingParticleToStubVectorMap_.find(aTrackingParticle) != trackingParticleToStubVectorMap_.end()) {
148  return trackingParticleToStubVectorMap_.find(aTrackingParticle)->second;
149  } else {
150  return nullVecStubRef_;
151  }
152 }
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 57 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 165 of file TTStubAssociationMap.h.

165  {
167  if (this->isGenuine(aStub))
168  return false;
169 
170  if (this->isUnknown(aStub))
171  return false;
172 
173  return true;
174 }
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 156 of file TTStubAssociationMap.h.

Referenced by l1tVertexFinder::Stub::fillTruth(), and tmtt::Stub::fillTruth().

156  {
158  if ((this->findTrackingParticlePtr(aStub)).isNull())
159  return false;
160 
161  return true;
162 }
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 177 of file TTStubAssociationMap.h.

177  {
179 
182  return true;
183  }
184 
185  if (theClusterAssociationMap_->isUnknown(aStub->clusterRef(0)) &&
186  theClusterAssociationMap_->isUnknown(aStub->clusterRef(1)))
187  return true;
188 
189  return false;
190 }
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 64 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::theClusterAssociationMap_.

64  {
65  theClusterAssociationMap_ = aCluAssoMap;
66  }
edm::RefProd< TTClusterAssociationMap< T > > theClusterAssociationMap_

◆ setTTStubToTrackingParticleMap()

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

Definition at line 60 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 106 of file TTStubAssociationMap.h.

◆ nullVecStubRef_

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

Definition at line 107 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