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 {
38  public:
41 
44 
47 
49  std::map< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > getTTStubToTrackingParticleMap() const
50  { return stubToTrackingParticleMap; }
51  std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > getTrackingParticleToTTStubsMap() const
53 
55  { stubToTrackingParticleMap = aMap; }
56  void setTrackingParticleToTTStubsMap( std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > aMap )
59  { theClusterAssociationMap = aCluAssoMap; }
60 
62  edm::Ptr< TrackingParticle > findTrackingParticlePtr( edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub ) const;
63  std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > findTTStubRefs( edm::Ptr< TrackingParticle > aTrackingParticle ) const;
64 
66  bool isGenuine( edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub ) const;
67  bool isCombinatoric( edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub ) const;
68  bool isUnknown( edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub ) const;
69 
70  private:
72  std::map< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > stubToTrackingParticleMap;
73  std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > trackingParticleToStubVectorMap;
75 
76 };
77 
85 template< typename T >
89 {
94  theClusterAssociationMap = *aRefProd;
95 }
96 
98 template< typename T >
100 
102 template< typename T >
104 {
105  if ( stubToTrackingParticleMap.find( aStub ) != stubToTrackingParticleMap.end() )
106  {
107  return stubToTrackingParticleMap.find( aStub )->second;
108  }
109 
112  return *temp;
113 }
114 
115 template< typename T >
116 std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > TTStubAssociationMap< T >::findTTStubRefs( edm::Ptr< TrackingParticle > aTrackingParticle ) const
117 {
118  if ( trackingParticleToStubVectorMap.find( aTrackingParticle ) != trackingParticleToStubVectorMap.end() )
119  {
120  return trackingParticleToStubVectorMap.find( aTrackingParticle )->second;
121  }
122 
123  std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > tempVector;
124  tempVector.clear();
125  return tempVector;
126 }
127 
128 
130 template< typename T >
132 {
134  if ( (this->findTrackingParticlePtr( aStub )).isNull() )
135  return false;
136 
137  return true;
138 }
139 
140 template< typename T >
142 {
144  if ( this->isGenuine( aStub ) )
145  return false;
146 
147  if ( this->isUnknown( aStub ) )
148  return false;
149 
150  return true;
151 }
152 
153 template< typename T >
155 {
157  //std::vector< edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > > theseClusters = aStub->getClusterRefs();
158 
161  {
162  return true;
163  }
164 
165  if ( theClusterAssociationMap->isUnknown( aStub->getClusterRef(0) ) &&
166  theClusterAssociationMap->isUnknown( aStub->getClusterRef(1) ) )
167  return true;
168 
169  return false;
170 }
171 
172 
173 #endif
174 
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::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > getTTStubToTrackingParticleMap() const
Maps.
edm::RefProd< TTClusterAssociationMap< T > > theClusterAssociationMap
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)
~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
bool isUnknown(edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
bool isNull() const
Checks for null.
Definition: RefProd.h:128
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > getTrackingParticleToTTStubsMap() const
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::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > stubToTrackingParticleMap
Data members.
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.