CMS 3D CMS Logo

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

NOTE: this is needed even if it seems not. More...

#include <TTStubAssociationMap.h>

Public Member Functions

edm::Ptr< TrackingParticlefindTrackingParticlePtr (edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
 Operations. More...
 
std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > findTTStubRefs (edm::Ptr< TrackingParticle > aTrackingParticle) const
 
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > getTrackingParticleToTTStubsMap () const
 
std::map< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > getTTStubToTrackingParticleMap () const
 Maps. More...
 
bool isCombinatoric (edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
 
bool isGenuine (edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
 MC Truth methods. More...
 
bool isUnknown (edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
 
void setTrackingParticleToTTStubsMap (std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > aMap)
 
void setTTClusterAssociationMap (edm::RefProd< TTClusterAssociationMap< T > > aCluAssoMap)
 
void setTTStubToTrackingParticleMap (std::map< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > aMap)
 
 TTStubAssociationMap ()
 Constructors. More...
 
 ~TTStubAssociationMap ()
 Destructor. More...
 

Private Attributes

std::map< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > stubToTrackingParticleMap
 Data members. More...
 
edm::RefProd< TTClusterAssociationMap< T > > theClusterAssociationMap
 
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > trackingParticleToStubVectorMap
 

Detailed Description

template<typename T>
class TTStubAssociationMap< T >

NOTE: this is needed even if it seems not.

Class to store the MC truth of L1 Track Trigger stubs.

After moving from SimDataFormats to DataFormats, the template structure of the class was maintained in order to accomodate any types other than PixelDigis in case there is such a need in the future.

Author
Nicola Pozzobon
Date
2013, Jul 19

Definition at line 36 of file TTStubAssociationMap.h.

Constructor & Destructor Documentation

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

Constructors.

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.Default Constructor NOTE: to be used with setSomething(...) methods

Set default data members

Definition at line 99 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::stubToTrackingParticleMap, TTStubAssociationMap< T >::theClusterAssociationMap, and TTStubAssociationMap< T >::trackingParticleToStubVectorMap.

99  {
104  theClusterAssociationMap = *aRefProd;
105 }
edm::RefProd< TTClusterAssociationMap< T > > theClusterAssociationMap
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
template<typename T >
TTStubAssociationMap< T >::~TTStubAssociationMap ( )

Destructor.

Definition at line 109 of file TTStubAssociationMap.h.

109 {}

Member Function Documentation

template<typename T >
edm::Ptr< TrackingParticle > TTStubAssociationMap< T >::findTrackingParticlePtr ( edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >  aStub) const

Operations.

Default: return NULL

Definition at line 113 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::stubToTrackingParticleMap.

Referenced by TTStubAssociationMap< T >::isGenuine(), and TTStubAssociationMap< T >::setTTClusterAssociationMap().

114  {
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 }
std::map< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > stubToTrackingParticleMap
Data members.
template<typename T >
std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > TTStubAssociationMap< T >::findTTStubRefs ( edm::Ptr< TrackingParticle aTrackingParticle) const

Definition at line 125 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::trackingParticleToStubVectorMap.

Referenced by TTStubAssociationMap< T >::setTTClusterAssociationMap().

126  {
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 }
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > trackingParticleToStubVectorMap
template<typename T>
std::map<edm::Ptr<TrackingParticle>, std::vector<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> > > > TTStubAssociationMap< T >::getTrackingParticleToTTStubsMap ( ) const
inline

Definition at line 53 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::trackingParticleToStubVectorMap.

53  {
55  }
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > trackingParticleToStubVectorMap
template<typename T>
std::map<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> >, edm::Ptr<TrackingParticle> > TTStubAssociationMap< T >::getTTStubToTrackingParticleMap ( ) const
inline

Maps.

Data members: getABC( ... ) Helper methods: findABC( ... )

Definition at line 49 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::stubToTrackingParticleMap.

49  {
51  }
std::map< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > stubToTrackingParticleMap
Data members.
template<typename T >
bool TTStubAssociationMap< T >::isCombinatoric ( edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >  aStub) const

Defined by exclusion

Definition at line 147 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::isGenuine(), and TTStubAssociationMap< T >::isUnknown().

Referenced by TTStubAssociationMap< T >::setTTClusterAssociationMap().

147  {
149  if (this->isGenuine(aStub))
150  return false;
151 
152  if (this->isUnknown(aStub))
153  return false;
154 
155  return true;
156 }
bool isUnknown(edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
bool isGenuine(edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
MC Truth methods.
template<typename T >
bool TTStubAssociationMap< T >::isGenuine ( edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >  aStub) const

MC Truth methods.

MC truth.

Check if there is a SimTrack

Definition at line 138 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::findTrackingParticlePtr().

Referenced by TTStubAssociationMap< T >::isCombinatoric(), and TTStubAssociationMap< T >::setTTClusterAssociationMap().

138  {
140  if ((this->findTrackingParticlePtr(aStub)).isNull())
141  return false;
142 
143  return true;
144 }
edm::Ptr< TrackingParticle > findTrackingParticlePtr(edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
Operations.
template<typename T >
bool TTStubAssociationMap< T >::isUnknown ( edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >  aStub) const

UNKNOWN means that both clusters are unknown

Sanity check

Definition at line 159 of file TTStubAssociationMap.h.

References edm::RefProd< C >::isNull(), TTClusterAssociationMap< T >::isUnknown(), and TTStubAssociationMap< T >::theClusterAssociationMap.

Referenced by TTStubAssociationMap< T >::isCombinatoric(), and TTStubAssociationMap< T >::setTTClusterAssociationMap().

159  {
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 }
edm::RefProd< TTClusterAssociationMap< T > > theClusterAssociationMap
bool isNull() const
Checks for null.
Definition: RefProd.h:115
bool isUnknown(edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > aCluster) const
template<typename T>
void TTStubAssociationMap< T >::setTrackingParticleToTTStubsMap ( std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > >  aMap)
inline

Definition at line 61 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::trackingParticleToStubVectorMap.

62  {
64  }
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > > trackingParticleToStubVectorMap
template<typename T>
void TTStubAssociationMap< T >::setTTClusterAssociationMap ( edm::RefProd< TTClusterAssociationMap< T > >  aCluAssoMap)
inline
template<typename T>
void TTStubAssociationMap< T >::setTTStubToTrackingParticleMap ( std::map< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > >  aMap)
inline

Definition at line 57 of file TTStubAssociationMap.h.

References TTStubAssociationMap< T >::stubToTrackingParticleMap.

58  {
60  }
std::map< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > >, edm::Ptr< TrackingParticle > > stubToTrackingParticleMap
Data members.

Member Data Documentation

template<typename T>
std::map<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> >, edm::Ptr<TrackingParticle> > TTStubAssociationMap< T >::stubToTrackingParticleMap
private
template<typename T>
edm::RefProd<TTClusterAssociationMap<T> > TTStubAssociationMap< T >::theClusterAssociationMap
private
template<typename T>
std::map<edm::Ptr<TrackingParticle>, std::vector<edm::Ref<edmNew::DetSetVector<TTStub<T> >, TTStub<T> > > > TTStubAssociationMap< T >::trackingParticleToStubVectorMap
private