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
 
bool getAllowOneFalse2SStub ()
 
template<>
bool getAllowOneFalse2SStub ()
 
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 setAllowOneFalse2SStub (bool allowFalse2SStub)
 
template<>
void setAllowOneFalse2SStub (bool allowFalse2SStub)
 
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

bool AllowOneFalse2SStub
 
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 97 of file TTTrackAssociationMap.h.

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

97  {
101 }
std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > > trackingParticleToTrackVectorMap
std::map< edm::Ptr< TTTrack< T > >, edm::Ptr< TrackingParticle > > trackToTrackingParticleMap
Data members.
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 12 of file TTTrackAssociationMap.cc.

References groupFilesInBlocks::temp.

13  {
14  if (trackToTrackingParticleMap.find(aTrack) != trackToTrackingParticleMap.end()) {
15  return trackToTrackingParticleMap.find(aTrack)->second;
16  }
17 
20  return *temp;
21 }
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 24 of file TTTrackAssociationMap.cc.

25  {
26  if (trackingParticleToTrackVectorMap.find(aTrackingParticle) != trackingParticleToTrackVectorMap.end()) {
27  return trackingParticleToTrackVectorMap.find(aTrackingParticle)->second;
28  }
29 
31  std::vector<edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_> > > tempVec;
32  tempVec.clear();
33  return tempVec;
34 }
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>
bool TTTrackAssociationMap< T >::getAllowOneFalse2SStub ( )
template<>
bool TTTrackAssociationMap< Ref_Phase2TrackerDigi_ >::getAllowOneFalse2SStub ( )

Definition at line 117 of file TTTrackAssociationMap.cc.

117  {
118  return AllowOneFalse2SStub;
119 }
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.

49  {
51  }
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 46 of file TTTrackAssociationMap.h.

References TTTrackAssociationMap< T >::trackToTrackingParticleMap.

46  {
48  }
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 81 of file TTTrackAssociationMap.cc.

82  {
84  if (this->isLooselyGenuine(aTrack))
85  return false;
86 
87  if (this->isUnknown(aTrack))
88  return false;
89 
90  return true;
91 }
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 Now modifying to allow one and only one false 2S stub in the track idr 06/19

Definition at line 49 of file TTTrackAssociationMap.cc.

References spr::find().

49  {
51  if ((this->findTrackingParticlePtr(aTrack)).isNull())
52  return false;
53 
55  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_> >, TTStub<Ref_Phase2TrackerDigi_> > >
57  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_> >, TTStub<Ref_Phase2TrackerDigi_> > >
58  TRK_Stubs = aTrack->getStubRefs();
59 
60  bool one2SStub = false;
61  for (unsigned int js = 0; js < TRK_Stubs.size(); js++) {
67  if (std::find(TP_Stubs.begin(), TP_Stubs.end(), TRK_Stubs.at(js)) == TP_Stubs.end()) {
68  if (!AllowOneFalse2SStub || TRK_Stubs.at(js)->moduleTypePS() || one2SStub) // Has to be first false 2S stub
69  {
70  return false;
71  } else {
72  one2SStub = true;
73  }
74  }
75  }
76 
77  return true;
78 }
edm::Ptr< TrackingParticle > findTrackingParticlePtr(edm::Ptr< TTTrack< T > > aTrack) const
Operations.
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:19
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
edm::RefProd< TTStubAssociationMap< T > > theStubAssociationMap
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 38 of file TTTrackAssociationMap.cc.

39  {
41  if ((this->findTrackingParticlePtr(aTrack)).isNull())
42  return false;
43 
44  return true;
45 }
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 94 of file TTTrackAssociationMap.cc.

References mps_fire::i.

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

Definition at line 112 of file TTTrackAssociationMap.cc.

112  {
113  AllowOneFalse2SStub = allowFalse2SStub;
114 }
template<typename T>
void TTTrackAssociationMap< T >::setTrackingParticleToTTTracksMap ( std::map< edm::Ptr< TrackingParticle >, std::vector< edm::Ptr< TTTrack< T > > > >  aMap)
inline

Definition at line 56 of file TTTrackAssociationMap.h.

References TTTrackAssociationMap< T >::trackingParticleToTrackVectorMap.

57  {
59  }
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 53 of file TTTrackAssociationMap.h.

References TTTrackAssociationMap< T >::trackToTrackingParticleMap.

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

Member Data Documentation

template<typename T>
bool TTTrackAssociationMap< T >::AllowOneFalse2SStub
private

Definition at line 83 of file TTTrackAssociationMap.h.

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