CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
TrackClassifierByProxy< Collection > Class Template Reference

Get track history and classification by proxy. More...

#include <TrackClassifierByProxy.h>

Inheritance diagram for TrackClassifierByProxy< Collection >:
TrackClassifier TrackCategories

Public Types

typedef edm::AssociationMap< edm::OneToMany< Collection, reco::TrackCollection > > Association
 Association type. More...
 
- Public Types inherited from TrackClassifier
typedef TrackCategories Categories
 Type to the associate category. More...
 
- Public Types inherited from TrackCategories
enum  Category {
  Fake = 0, Reconstructed = Fake, Bad, BadInnerHits,
  SharedInnerHits, SignalEvent, Bottom, Charm,
  Light, Muon, TrackerSimHits, BWeakDecay,
  CWeakDecay, ChargePionDecay, ChargeKaonDecay, TauDecay,
  KsDecay, LambdaDecay, JpsiDecay, XiDecay,
  OmegaDecay, SigmaPlusDecay, SigmaMinusDecay, LongLivedDecay,
  KnownProcess, UndefinedProcess, UnknownProcess, PrimaryProcess,
  HadronicProcess, DecayProcess, ComptonProcess, AnnihilationProcess,
  EIoniProcess, HIoniProcess, MuIoniProcess, PhotonProcess,
  MuPairProdProcess, ConversionsProcess, EBremProcess, SynchrotronRadiationProcess,
  MuBremProcess, MuNuclProcess, FromBWeakDecayMuon, FromCWeakDecayMuon,
  DecayOnFlightMuon, FromChargePionMuon, FromChargeKaonMuon, PrimaryVertex,
  SecondaryVertex, TertiaryVertex, TierciaryVertex = TertiaryVertex, Unknown
}
 Categories available to vertex. More...
 
typedef std::vector< bool > Flags
 Main types associated to the class. More...
 

Public Member Functions

TrackClassifierByProxy< Collection > const & evaluate (TrackingParticleRef const &track)
 Classify the TrackingVertex in categories. More...
 
TrackClassifierByProxy< Collection > const & evaluate (edm::Ref< Collection > const &track, std::size_t index)
 Classify any Tracks in categories. More...
 
TrackClassifierByProxy< Collection > const & evaluate (edm::Ref< Collection > const &track)
 Classify any tracks in categories. More...
 
virtual void newEvent (edm::Event const &event, edm::EventSetup const &config)
 Pre-process event information (for accessing reconstraction information). More...
 
 TrackClassifierByProxy (edm::ParameterSet const &config)
 Constructor by ParameterSet. More...
 
- Public Member Functions inherited from TrackClassifier
TrackClassifier const & evaluate (reco::TrackBaseRef const &)
 Classify the RecoTrack in categories. More...
 
TrackClassifier const & evaluate (TrackingParticleRef const &)
 Classify the TrackingParticle in categories. More...
 
TrackClassifier const & evaluate (reco::TrackRef const &track)
 Classify the RecoTrack in categories. More...
 
TrackHistory const & history () const
 Returns a reference to the track history used in the classification. More...
 
void newEvent (edm::Event const &, edm::EventSetup const &)
 Pre-process event information (for accessing reconstraction information) More...
 
TrackQuality const & quality () const
 Returns a reference to the track quality used in the classification. More...
 
 TrackClassifier (edm::ParameterSet const &, edm::ConsumesCollector &&)
 Constructor by ParameterSet. More...
 
- Public Member Functions inherited from TrackCategories
const Flagsflags () const
 Returns flags with the category descriptions. More...
 
bool is (Category category) const
 Returns track flag for a given category. More...
 
 TrackCategories ()
 Void constructor. More...
 

Private Attributes

const edm::InputTag proxy_
 
edm::Handle< AssociationproxyHandler_
 

Additional Inherited Members

- Static Public Attributes inherited from TrackCategories
static const char *const Names []
 Name of the different categories. More...
 
- Protected Member Functions inherited from TrackCategories
void reset ()
 Reset the categories flags. More...
 
void unknownTrack ()
 
- Protected Attributes inherited from TrackCategories
Flags flags_
 Flag containers. More...
 

Detailed Description

template<typename Collection>
class TrackClassifierByProxy< Collection >

Get track history and classification by proxy.

Definition at line 11 of file TrackClassifierByProxy.h.

Member Typedef Documentation

template<typename Collection >
typedef edm::AssociationMap<edm::OneToMany<Collection, reco::TrackCollection> > TrackClassifierByProxy< Collection >::Association

Association type.

Definition at line 17 of file TrackClassifierByProxy.h.

Constructor & Destructor Documentation

template<typename Collection >
TrackClassifierByProxy< Collection >::TrackClassifierByProxy ( edm::ParameterSet const &  config)
inline

Constructor by ParameterSet.

Definition at line 20 of file TrackClassifierByProxy.h.

21  proxy_( config.getUntrackedParameter<edm::InputTag>("trackProducer") ) {}
Definition: config.py:1
TrackClassifier(edm::ParameterSet const &, edm::ConsumesCollector &&)
Constructor by ParameterSet.

Member Function Documentation

template<typename Collection >
TrackClassifierByProxy<Collection> const& TrackClassifierByProxy< Collection >::evaluate ( TrackingParticleRef const &  track)
inline

Classify the TrackingVertex in categories.

Definition at line 33 of file TrackClassifierByProxy.h.

References TrackClassifier::evaluate().

34  {
36  return *this;
37  }
TrackClassifier const & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
template<typename Collection >
TrackClassifierByProxy<Collection> const& TrackClassifierByProxy< Collection >::evaluate ( edm::Ref< Collection > const &  track,
std::size_t  index 
)
inline

Classify any Tracks in categories.

Definition at line 40 of file TrackClassifierByProxy.h.

References edm::RefVector< C, T, F >::at(), MillePedeFileConverter_cfg::e, TrackClassifier::evaluate(), TrackClassifierByProxy< Collection >::proxyHandler_, TrackCategories::reset(), l1t::tracks, and TrackCategories::unknownTrack().

41  {
42  const reco::TrackRefVector * tracks = 0;
43 
44  try
45  {
46  // Get a reference to the vector of associated tracks
47  tracks = proxyHandler_->find(track)->val;
48  }
49  catch (edm::Exception& e)
50  {
51  // If association fails define the track as unknown
52  reset();
53  unknownTrack();
54  return *this;
55  }
56 
57  // Evaluate the history for a given index
59 
60  return *this;
61  }
TrackClassifier const & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
value_type const at(size_type idx) const
Retrieve an element of the RefVector.
Definition: RefVector.h:88
void reset()
Reset the categories flags.
edm::Handle< Association > proxyHandler_
template<typename Collection >
TrackClassifierByProxy<Collection> const& TrackClassifierByProxy< Collection >::evaluate ( edm::Ref< Collection > const &  track)
inline

Classify any tracks in categories.

Definition at line 64 of file TrackClassifierByProxy.h.

References edm::RefVector< C, T, F >::at(), MillePedeFileConverter_cfg::e, TrackClassifier::evaluate(), TrackCategories::flags(), TrackCategories::flags_, i, diffTreeTool::index, TrackClassifierByProxy< Collection >::proxyHandler_, TrackCategories::reset(), edm::RefVector< C, T, F >::size(), l1t::tracks, and TrackCategories::unknownTrack().

65  {
66  const reco::TrackRefVector * tracks = 0;
67 
68  try
69  {
70  // Get a reference to the vector of associated tracks
71  tracks = proxyHandler_->find(track)->val;
72  }
73  catch (edm::Exception& e)
74  {
75  // If association fails define the track as unknown
76  reset();
77  unknownTrack();
78  return *this;
79  }
80 
81  // Loop over all the associated tracks
82  for (std::size_t index = 0; index < tracks->size(); ++index)
83  {
84  // Copy the last status for all the flags
86 
87  // Evaluate the history for a given index
89 
90  // Combine OR the flag information
91  for (std::size_t i = 0; i < flags_.size(); ++i)
92  flags_[i] = flags_[i] | flags[i];
93  }
94 
95  return *this;
96  }
int i
Definition: DBlmapReader.cc:9
TrackClassifier const & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
const Flags & flags() const
Returns flags with the category descriptions.
value_type const at(size_type idx) const
Retrieve an element of the RefVector.
Definition: RefVector.h:88
size_type size() const
Size of the RefVector.
Definition: RefVector.h:107
std::vector< bool > Flags
Main types associated to the class.
Flags flags_
Flag containers.
void reset()
Reset the categories flags.
edm::Handle< Association > proxyHandler_
template<typename Collection >
virtual void TrackClassifierByProxy< Collection >::newEvent ( edm::Event const &  event,
edm::EventSetup const &  config 
)
inlinevirtual

Pre-process event information (for accessing reconstraction information).

Definition at line 24 of file TrackClassifierByProxy.h.

References TrackClassifier::newEvent(), TrackClassifierByProxy< Collection >::proxy_, and TrackClassifierByProxy< Collection >::proxyHandler_.

25  {
26  // Get the association part of the proxy to the collection
27  event.getByLabel(proxy_, proxyHandler_);
28  // Call the previous new event
30  }
Definition: config.py:1
void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
edm::Handle< Association > proxyHandler_
Definition: event.py:1

Member Data Documentation

template<typename Collection >
const edm::InputTag TrackClassifierByProxy< Collection >::proxy_
private
template<typename Collection >
edm::Handle<Association> TrackClassifierByProxy< Collection >::proxyHandler_
private