CMS 3D CMS Logo

TTStubAssociationMap.h
Go to the documentation of this file.
1 
18 #ifndef L1_TRACK_TRIGGER_STUB_ASSOCIATION_FORMAT_H
19 #define L1_TRACK_TRIGGER_STUB_ASSOCIATION_FORMAT_H
20 
31 //#include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
41 
42 // Templated aliases
43 template <typename T>
44 using MapStubToTP = std::map<TTStubRefT<T>, TrackingParticlePtr>;
45 template <typename T>
46 using MapTPToVecStub = std::map<TrackingParticlePtr, std::vector<TTStubRefT<T>>>;
47 
48 template <typename T>
50 public:
53 
56 
58 
61 
64 
67  theClusterAssociationMap_ = aCluAssoMap;
68  }
69 
75 
79  const std::vector<TTStubRefT<T>>& findTTStubRefs(TrackingParticlePtr aTrackingParticle) const;
80 
85 
96 
97  bool isGenuine(TTStubRefT<T> aStub) const;
98  bool isCombinatoric(TTStubRefT<T> aStub) const;
99  bool isUnknown(TTStubRefT<T> aStub) const;
100 
101 private:
106 
107  // Allow functions to return reference to null.
109  static const std::vector<TTStubRefT<T>> nullVecStubRef_;
110 
111 };
112 
120 // Static constant data members.
121 template <typename T>
123 template <typename T>
124 const std::vector<TTStubRefT<T>> TTStubAssociationMap<T>::nullVecStubRef_;
125 
128 template <typename T>
131 }
132 
134 template <typename T>
136 
138 template <typename T>
140  if (stubToTrackingParticleMap_.find(aStub) != stubToTrackingParticleMap_.end()) {
141  return stubToTrackingParticleMap_.find(aStub)->second;
142  } else {
143  return nullTrackingParticlePtr_;
144  }
145 }
146 
147 template <typename T>
148 const std::vector<TTStubRefT<T>>& TTStubAssociationMap<T>::findTTStubRefs(TrackingParticlePtr aTrackingParticle) const {
149  if (trackingParticleToStubVectorMap_.find(aTrackingParticle) != trackingParticleToStubVectorMap_.end()) {
150  return trackingParticleToStubVectorMap_.find(aTrackingParticle)->second;
151  } else {
152  return nullVecStubRef_;
153  }
154 }
155 
157 template <typename T>
160  if ((this->findTrackingParticlePtr(aStub)).isNull())
161  return false;
162 
163  return true;
164 }
165 
166 template <typename T>
169  if (this->isGenuine(aStub))
170  return false;
171 
172  if (this->isUnknown(aStub))
173  return false;
174 
175  return true;
176 }
177 
178 template <typename T>
181 
183  if (theClusterAssociationMap_.isNull()) {
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 }
193 
194 #endif
edm::RefProd
Definition: EDProductfwd.h:25
TTStubAssociationMap::trackingParticleToStubVectorMap_
MapTPToVecStub< T > trackingParticleToStubVectorMap_
Definition: TTStubAssociationMap.h:104
RefProd.h
TTStubAssociationMap::findTrackingParticlePtr
const TrackingParticlePtr & findTrackingParticlePtr(TTStubRefT< T > aStub) const
Operations.
Definition: TTStubAssociationMap.h:139
TTClusterAssociationMap
Stores association of Truth Particles (TP) to L1 Track-Trigger Clusters.
Definition: TTClusterAssociationMap.h:44
TTTypes.h
TTStubAssociationMap::theClusterAssociationMap_
edm::RefProd< TTClusterAssociationMap< T > > theClusterAssociationMap_
Definition: TTStubAssociationMap.h:105
TTStubAssociationMap::isCombinatoric
bool isCombinatoric(TTStubRefT< T > aStub) const
Definition: TTStubAssociationMap.h:167
TTStubAssociationMap::findTTStubRefs
const std::vector< TTStubRefT< T > > & findTTStubRefs(TrackingParticlePtr aTrackingParticle) const
Definition: TTStubAssociationMap.h:148
TTStubAssociationMap::~TTStubAssociationMap
~TTStubAssociationMap()
Destructor.
Definition: TTStubAssociationMap.h:135
TTClusterAssociationMap.h
edm::Ref
Definition: AssociativeIterator.h:58
TTStubAssociationMap::setTTStubToTrackingParticleMap
void setTTStubToTrackingParticleMap(const MapStubToTP< T > &aMap)
Definition: TTStubAssociationMap.h:62
TTStubAssociationMap
Stores association of Truth Particles (TP) to L1 Track-Trigger Stubs.
Definition: TTStubAssociationMap.h:49
TTStubAssociationMap::isUnknown
bool isUnknown(TTStubRefT< T > aStub) const
Definition: TTStubAssociationMap.h:179
TTStubAssociationMap::stubToTrackingParticleMap_
MapStubToTP< T > stubToTrackingParticleMap_
Data members.
Definition: TTStubAssociationMap.h:103
MapStubToTP
std::map< TTStubRefT< T >, TrackingParticlePtr > MapStubToTP
NOTE: this is needed even if it seems not.
Definition: TTStubAssociationMap.h:44
Phase2TrackerDigi.h
TTStubAssociationMap::nullVecStubRef_
static const std::vector< TTStubRefT< T > > nullVecStubRef_
Definition: TTStubAssociationMap.h:109
TTStubAssociationMap::setTTClusterAssociationMap
void setTTClusterAssociationMap(edm::RefProd< TTClusterAssociationMap< T >> aCluAssoMap)
Set cluster <-> truth association object.
Definition: TTStubAssociationMap.h:66
Ptr.h
MeasurementPoint.h
DetSetVector.h
edm::Ptr< TrackingParticle >
TrackingParticle.h
Ref.h
TTStubAssociationMap::isGenuine
bool isGenuine(TTStubRefT< T > aStub) const
MC truth.
Definition: TTStubAssociationMap.h:158
DetId.h
TrackingParticleFwd.h
TTStubAssociationMap::setTrackingParticleToTTStubsMap
void setTrackingParticleToTTStubsMap(const MapTPToVecStub< T > &aMap)
Definition: TTStubAssociationMap.h:63
TTStubAssociationMap::getTTStubToTrackingParticleMap
const MapStubToTP< T > & getTTStubToTrackingParticleMap() const
Get/set stub <-> truth association maps.
Definition: TTStubAssociationMap.h:59
TTStub.h
DetSet.h
SimTrack.h
MapTPToVecStub
std::map< TrackingParticlePtr, std::vector< TTStubRefT< T > >> MapTPToVecStub
Definition: TTStubAssociationMap.h:46
GlobalPoint.h
SimTrackContainer.h
TTStubAssociationMap::TTStubAssociationMap
TTStubAssociationMap()
Constructors.
Definition: TTStubAssociationMap.h:129
DetSetVectorNew.h
TTStubAssociationMap::nullTrackingParticlePtr_
static const TrackingParticlePtr nullTrackingParticlePtr_
Close class.
Definition: TTStubAssociationMap.h:108
TTStubAssociationMap::getTrackingParticleToTTStubsMap
const MapTPToVecStub< T > & getTrackingParticleToTTStubsMap() const
Definition: TTStubAssociationMap.h:60
EncodedEventId.h