CMS 3D CMS Logo

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

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

#include <TTTrackAssociationMap.h>

Public Member Functions

template<>
edm::Ptr< TrackingParticlefindTrackingParticlePtr (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 Implementation of methods. More...
 
edm::Ptr< TrackingParticlefindTrackingParticlePtr (edm::Ptr< TTTrack< T > > aTrack) const
 Operations. More...
 
template<>
edm::Ptr< TrackingParticlefindTrackingParticlePtr (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 Operations. More...
 
template<>
std::vector< edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > > findTTTrackPtrs (edm::Ptr< TrackingParticle > aTrackingParticle) const
 
std::vector< edm::Ptr< TTTrack< T > > > findTTTrackPtrs (edm::Ptr< TrackingParticle > aTrackingParticle) const
 
template<>
std::vector< edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > > findTTTrackPtrs (edm::Ptr< TrackingParticle > aTrackingParticle) const
 
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > getTrackingParticleToTTTracksMap () const
 
std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > getTTTrackToTrackingParticleMap () const
 Maps. More...
 
bool isCombinatoric (edm::Ptr< TTTrack< T > > aTrack) const
 
template<>
bool isCombinatoric (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 
template<>
bool isCombinatoric (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 
template<>
bool isGenuine (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 MC truth. More...
 
bool isGenuine (edm::Ptr< TTTrack< T > > aTrack) const
 MC Truth methods. More...
 
template<>
bool isGenuine (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 MC truth. More...
 
template<>
bool isLooselyGenuine (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 MC truth. More...
 
bool isLooselyGenuine (edm::Ptr< TTTrack< T > > aTrack) const
 
template<>
bool isLooselyGenuine (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 MC truth. More...
 
bool isUnknown (edm::Ptr< TTTrack< T > > aTrack) const
 
template<>
bool isUnknown (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 
template<>
bool isUnknown (edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > aTrack) const
 
void setTrackingParticleToTTTracksMap (std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > aMap)
 
void setTTStubAssociationMap (edm::RefProd< TTStubAssociationMap< T > > aStubAssoMap)
 
void setTTTrackToTrackingParticleMap (std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > aMap)
 
 TTTrackAssociationMap ()
 Constructors. More...
 
 ~TTTrackAssociationMap ()
 Destructor. More...
 

Private Attributes

edm::RefProd< TTStubAssociationMap< T > > theStubAssociationMap
 
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > trackingParticleToTrackVectorMap
 
std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > trackToTrackingParticleMap
 Data members. More...
 

Detailed Description

template<typename T>
class TTTrackAssociationMap< T >

NOTE: this is needed even if it seems not.

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

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 34 of file TTTrackAssociationMap.h.

Constructor & Destructor Documentation

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

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 87 of file TTTrackAssociationMap.h.

References TTTrackAssociationMap< T >::trackingParticleToTrackVectorMap, and TTTrackAssociationMap< T >::trackToTrackingParticleMap.

88 {
92 }
std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > trackToTrackingParticleMap
Data members.
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > trackingParticleToTrackVectorMap
template<typename T >
TTTrackAssociationMap< T >::~TTTrackAssociationMap ( )

Member Function Documentation

template<>
edm::Ptr< TrackingParticle > TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::findTrackingParticlePtr ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

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.Operations

Default: return NULL

Definition at line 13 of file TTTrackAssociationMap.cc.

References groupFilesInBlocks::temp.

14 {
15  if ( trackToTrackingParticleMap.find( aTrack ) != trackToTrackingParticleMap.end() )
16  {
17  return trackToTrackingParticleMap.find( aTrack )->second;
18  }
19 
22  return *temp;
23 }
std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > trackToTrackingParticleMap
Data members.
template<typename T>
edm::Ptr< TrackingParticle > TTTrackAssociationMap< T >::findTrackingParticlePtr ( edm::Ptr< TTTrack< T > >  aTrack) const
template<>
edm::Ptr< TrackingParticle > TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::findTrackingParticlePtr ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

Operations.

template<>
std::vector< edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > > TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::findTTTrackPtrs ( edm::Ptr< TrackingParticle aTrackingParticle) const

Default: return empty vector

Definition at line 26 of file TTTrackAssociationMap.cc.

27 {
28  if ( trackingParticleToTrackVectorMap.find( aTrackingParticle ) != trackingParticleToTrackVectorMap.end() )
29  {
30  return trackingParticleToTrackVectorMap.find( aTrackingParticle )->second;
31  }
32 
34  std::vector< edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > > tempVec;
35  tempVec.clear();
36  return tempVec;
37 }
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > trackingParticleToTrackVectorMap
template<typename T>
std::vector< edm::Ptr< TTTrack< T > > > TTTrackAssociationMap< T >::findTTTrackPtrs ( edm::Ptr< TrackingParticle aTrackingParticle) const
template<>
std::vector< edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > > > TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::findTTTrackPtrs ( edm::Ptr< TrackingParticle aTrackingParticle) const
template<typename T>
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > TTTrackAssociationMap< T >::getTrackingParticleToTTTracksMap ( ) const
inline

Definition at line 49 of file TTTrackAssociationMap.h.

References TTTrackAssociationMap< T >::trackingParticleToTrackVectorMap.

std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > trackingParticleToTrackVectorMap
template<typename T>
std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > TTTrackAssociationMap< T >::getTTTrackToTrackingParticleMap ( ) const
inline

Maps.

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

Definition at line 47 of file TTTrackAssociationMap.h.

References TTTrackAssociationMap< T >::trackToTrackingParticleMap.

48  { return trackToTrackingParticleMap; }
std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > trackToTrackingParticleMap
Data members.
template<typename T>
bool TTTrackAssociationMap< T >::isCombinatoric ( edm::Ptr< TTTrack< T > >  aTrack) const
template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isCombinatoric ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

Defined by exclusion

Definition at line 79 of file TTTrackAssociationMap.cc.

80 {
82  if ( this->isLooselyGenuine( aTrack ) )
83  return false;
84 
85  if ( this->isUnknown( aTrack ) )
86  return false;
87 
88  return true;
89 }
bool isUnknown(edm::Ptr< TTTrack< T > > aTrack) const
bool isLooselyGenuine(edm::Ptr< TTTrack< T > > aTrack) const
template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isCombinatoric ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const
template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isGenuine ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

MC truth.

Check if there is a TrackingParticle

Get all the stubs from this TrackingParticle

We want that all the stubs of the track are included in the container of all the stubs produced by this particular TrackingParticle which we already know is one of the TrackingParticles that released hits in this track we are evaluating right now

Definition at line 52 of file TTTrackAssociationMap.cc.

References spr::find().

53 {
55  if ( (this->findTrackingParticlePtr( aTrack )).isNull() )
56  return false;
57 
59  std::vector< edm::Ref< edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ > >, TTStub< Ref_Phase2TrackerDigi_ > > > TP_Stubs = theStubAssociationMap->findTTStubRefs( this->findTrackingParticlePtr( aTrack ) );
60  std::vector< edm::Ref< edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ > >, TTStub< Ref_Phase2TrackerDigi_ > > > TRK_Stubs = aTrack->getStubRefs();
61 
62  for ( unsigned int js = 0; js < TRK_Stubs.size(); js++ )
63  {
68  if ( std::find( TP_Stubs.begin(), TP_Stubs.end(), TRK_Stubs.at(js) ) == TP_Stubs.end() )
69  {
70  return false;
71  }
72  }
73 
74  return true;
75 }
std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > findTTStubRefs(edm::Ptr< TrackingParticle > aTrackingParticle) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
edm::RefProd< TTStubAssociationMap< T > > theStubAssociationMap
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
edm::Ptr< TrackingParticle > findTrackingParticlePtr(edm::Ptr< TTTrack< T > > aTrack) const
Operations.
template<typename T>
bool TTTrackAssociationMap< T >::isGenuine ( edm::Ptr< TTTrack< T > >  aTrack) const
template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isGenuine ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

MC truth.

template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isLooselyGenuine ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

MC truth.

Check if there is a TrackingParticle

Definition at line 41 of file TTTrackAssociationMap.cc.

42 {
44  if ( (this->findTrackingParticlePtr( aTrack )).isNull() )
45  return false;
46 
47  return true;
48 }
edm::Ptr< TrackingParticle > findTrackingParticlePtr(edm::Ptr< TTTrack< T > > aTrack) const
Operations.
template<typename T>
bool TTTrackAssociationMap< T >::isLooselyGenuine ( edm::Ptr< TTTrack< T > >  aTrack) const
template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isLooselyGenuine ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

MC truth.

template<typename T>
bool TTTrackAssociationMap< T >::isUnknown ( edm::Ptr< TTTrack< T > >  aTrack) const
template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isUnknown ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const

UNKNOWN means that more than 2 stubs are unknown

Definition at line 92 of file TTTrackAssociationMap.cc.

References mps_fire::i.

93 {
95  int unknownstubs=0;
96 
97  std::vector< edm::Ref< edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ > >, TTStub< Ref_Phase2TrackerDigi_ > > > theseStubs = aTrack->getStubRefs();
98  for ( unsigned int i = 0; i < theseStubs.size(); i++ )
99  {
100  if ( theStubAssociationMap->isUnknown( theseStubs.at(i) ) == false )
101  {
102  ++unknownstubs;
103  if (unknownstubs>=2) return false;
104  }
105  }
106 
107  return true;
108 }
edm::RefProd< TTStubAssociationMap< T > > theStubAssociationMap
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
bool isUnknown(edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > aStub) const
template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::isUnknown ( edm::Ptr< TTTrack< Ref_Phase2TrackerDigi_ > >  aTrack) const
template<typename T>
void TTTrackAssociationMap< T >::setTrackingParticleToTTTracksMap ( std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > >  aMap)
inline

Definition at line 54 of file TTTrackAssociationMap.h.

References TTTrackAssociationMap< T >::trackingParticleToTrackVectorMap.

std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > trackingParticleToTrackVectorMap
template<typename T>
void TTTrackAssociationMap< T >::setTTStubAssociationMap ( edm::RefProd< TTStubAssociationMap< T > >  aStubAssoMap)
inline
template<typename T>
void TTTrackAssociationMap< T >::setTTTrackToTrackingParticleMap ( std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > >  aMap)
inline

Definition at line 52 of file TTTrackAssociationMap.h.

References TTTrackAssociationMap< T >::trackToTrackingParticleMap.

53  { trackToTrackingParticleMap = aMap; }
std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > trackToTrackingParticleMap
Data members.

Member Data Documentation

template<typename T>
edm::RefProd< TTStubAssociationMap< T > > TTTrackAssociationMap< T >::theStubAssociationMap
private
template<typename T>
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > TTTrackAssociationMap< T >::trackingParticleToTrackVectorMap
private
template<typename T>
std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > TTTrackAssociationMap< T >::trackToTrackingParticleMap
private