CMS 3D CMS Logo

TTStubAssociationMap.h
Go to the documentation of this file.
1 
13 #ifndef L1_TRACK_TRIGGER_STUB_ASSOCIATION_FORMAT_H
14 #define L1_TRACK_TRIGGER_STUB_ASSOCIATION_FORMAT_H
15 
24 //#include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
34 
35 template <typename T>
37 public:
40 
43 
46 
48  std::map<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> >, edm::Ptr<TrackingParticle> >
51  }
52  std::map<edm::Ptr<TrackingParticle>, std::vector<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> > > >
55  }
56 
58  std::map<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> >, edm::Ptr<TrackingParticle> > aMap) {
60  }
62  std::map<edm::Ptr<TrackingParticle>, std::vector<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> > > > aMap) {
64  }
66  theClusterAssociationMap = aCluAssoMap;
67  }
68 
71  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> > > findTTStubRefs(
72  edm::Ptr<TrackingParticle> aTrackingParticle) const;
73 
75  bool isGenuine(edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> > aStub) const;
76  bool isCombinatoric(edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> > aStub) const;
77  bool isUnknown(edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> > aStub) const;
78 
79 private:
81  std::map<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> >, edm::Ptr<TrackingParticle> >
83  std::map<edm::Ptr<TrackingParticle>, std::vector<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> > > >
86 
87 };
88 
96 template <typename T>
104  theClusterAssociationMap = *aRefProd;
105 }
106 
108 template <typename T>
110 
112 template <typename T>
115  if (stubToTrackingParticleMap.find(aStub) != stubToTrackingParticleMap.end()) {
116  return stubToTrackingParticleMap.find(aStub)->second;
117  }
118 
120  //edm::Ptr< TrackingParticle >* temp = new edm::Ptr< TrackingParticle >();
122 }
123 
124 template <typename T>
125 std::vector<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> > > TTStubAssociationMap<T>::findTTStubRefs(
126  edm::Ptr<TrackingParticle> aTrackingParticle) const {
127  if (trackingParticleToStubVectorMap.find(aTrackingParticle) != trackingParticleToStubVectorMap.end()) {
128  return trackingParticleToStubVectorMap.find(aTrackingParticle)->second;
129  }
130 
131  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> > > tempVector;
132  tempVector.clear();
133  return tempVector;
134 }
135 
137 template <typename T>
140  if ((this->findTrackingParticlePtr(aStub)).isNull())
141  return false;
142 
143  return true;
144 }
145 
146 template <typename T>
149  if (this->isGenuine(aStub))
150  return false;
151 
152  if (this->isUnknown(aStub))
153  return false;
154 
155  return true;
156 }
157 
158 template <typename T>
161  //std::vector< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > > theseClusters = aStub->getClusterRefs();
162 
165  return true;
166  }
167 
168  if (theClusterAssociationMap->isUnknown(aStub->clusterRef(0)) &&
169  theClusterAssociationMap->isUnknown(aStub->clusterRef(1)))
170  return true;
171 
172  return false;
173 }
174 
175 #endif
TTStubAssociationMap()
Constructors.
edm::Ptr< TrackingParticle > findTrackingParticlePtr(edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
Operations.
std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > findTTStubRefs(edm::Ptr< TrackingParticle > aTrackingParticle) const
void setTTClusterAssociationMap(edm::RefProd< TTClusterAssociationMap< T > > aCluAssoMap)
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > getTrackingParticleToTTStubsMap() const
NOTE: this is needed even if it seems not.
void setTTStubToTrackingParticleMap(std::map< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > aMap)
edm::RefProd< TTClusterAssociationMap< T > > theClusterAssociationMap
~TTStubAssociationMap()
Destructor.
bool isCombinatoric(edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
std::map< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > getTTStubToTrackingParticleMap() const
Maps.
bool isUnknown(edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
std::map< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > stubToTrackingParticleMap
Data members.
bool isNull() const
Checks for null.
Definition: RefProd.h:115
bool isUnknown(edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > aCluster) const
bool isGenuine(edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
MC Truth methods.
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > trackingParticleToStubVectorMap
void setTrackingParticleToTTStubsMap(std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > aMap)
NOTE: this is needed even if it seems not.