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

const TrackClassifierByProxy< Collection > & evaluate (edm::Ref< Collection > const &track)
 Classify any tracks in categories. More...
 
const TrackClassifierByProxy< Collection > & evaluate (edm::Ref< Collection > const &track, std::size_t index)
 Classify any Tracks in categories. More...
 
const TrackClassifierByProxy< Collection > & evaluate (TrackingParticleRef const &track)
 Classify the TrackingVertex 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
const TrackClassifierevaluate (reco::TrackBaseRef const &)
 Classify the RecoTrack in categories. More...
 
const TrackClassifierevaluate (reco::TrackRef const &track)
 Classify the RecoTrack in categories. More...
 
const TrackClassifierevaluate (TrackingParticleRef const &)
 Classify the TrackingParticle in categories. More...
 
const TrackHistoryhistory () 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...
 
const TrackQualityquality () 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

◆ Association

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

◆ TrackClassifierByProxy()

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") ) {}

Member Function Documentation

◆ evaluate() [1/3]

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

Classify any tracks in categories.

Definition at line 64 of file TrackClassifierByProxy.h.

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  }

References MillePedeFileConverter_cfg::e, TrackClassifier::evaluate(), TrackCategories::flags(), TrackCategories::flags_, mps_fire::i, TrackClassifierByProxy< Collection >::proxyHandler_, TrackCategories::reset(), HLT_2018_cff::track, PDWG_EXOHSCP_cff::tracks, and TrackCategories::unknownTrack().

◆ evaluate() [2/3]

template<typename Collection >
const TrackClassifierByProxy<Collection>& 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.

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  }

References MillePedeFileConverter_cfg::e, TrackClassifier::evaluate(), TrackClassifierByProxy< Collection >::proxyHandler_, TrackCategories::reset(), HLT_2018_cff::track, PDWG_EXOHSCP_cff::tracks, and TrackCategories::unknownTrack().

◆ evaluate() [3/3]

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

Classify the TrackingVertex in categories.

Definition at line 33 of file TrackClassifierByProxy.h.

34  {
36  return *this;
37  }

References TrackClassifier::evaluate(), and HLT_2018_cff::track.

◆ newEvent()

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.

25  {
26  // Get the association part of the proxy to the collection
27  event.getByLabel(proxy_, proxyHandler_);
28  // Call the previous new event
30  }

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

Member Data Documentation

◆ proxy_

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

◆ proxyHandler_

template<typename Collection >
edm::Handle<Association> TrackClassifierByProxy< Collection >::proxyHandler_
private
TrackClassifier::TrackClassifier
TrackClassifier(edm::ParameterSet const &, edm::ConsumesCollector &&)
Constructor by ParameterSet.
Definition: TrackClassifier.cc:15
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:355
TrackCategories::flags_
Flags flags_
Flag containers.
Definition: TrackCategories.h:89
edm::RefVector< TrackCollection >
edm::Exception
Definition: EDMException.h:77
config
Definition: config.py:1
TrackCategories::unknownTrack
void unknownTrack()
Definition: TrackCategories.cc:57
TrackClassifier::evaluate
const TrackClassifier & evaluate(reco::TrackBaseRef const &)
Classify the RecoTrack in categories.
Definition: TrackClassifier.cc:75
TrackClassifierByProxy::proxy_
const edm::InputTag proxy_
Definition: TrackClassifierByProxy.h:100
TrackClassifier::newEvent
void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
Definition: TrackClassifier.cc:44
TrackCategories::reset
void reset()
Reset the categories flags.
Definition: TrackCategories.h:83
TrackClassifierByProxy::proxyHandler_
edm::Handle< Association > proxyHandler_
Definition: TrackClassifierByProxy.h:102
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
event
Definition: event.py:1
edm::InputTag
Definition: InputTag.h:15
TrackCategories::flags
const Flags & flags() const
Returns flags with the category descriptions.
Definition: TrackCategories.h:79
TrackCategories::Flags
std::vector< bool > Flags
Main types associated to the class.
Definition: TrackCategories.h:70
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37