CMS 3D CMS Logo

TrackClassifierByProxy.h
Go to the documentation of this file.
1 
2 #ifndef TrackClassifierByProxy_h
3 #define TrackClassifierByProxy_h
4 
6 
8 
10 template <typename Collection>
12 {
13 
14 public:
15 
18 
21  proxy_( config.getUntrackedParameter<edm::InputTag>("trackProducer") ) {}
22 
24  virtual void newEvent(edm::Event const & event, edm::EventSetup const & config)
25  {
26  // Get the association part of the proxy to the collection
27  event.getByLabel(proxy_, proxyHandler_);
28  // Call the previous new event
30  }
31 
34  {
36  return *this;
37  }
38 
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  }
62 
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  }
97 
98 private:
99 
101 
103 
104 };
105 
106 #endif
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:355
edm
HLT enums.
Definition: AlignableModifier.h:19
AssociationMap.h
TrackCategories::flags_
Flags flags_
Flag containers.
Definition: TrackCategories.h:89
TrackClassifierByProxy::evaluate
const TrackClassifierByProxy< Collection > & evaluate(TrackingParticleRef const &track)
Classify the TrackingVertex in categories.
Definition: TrackClassifierByProxy.h:33
edm::RefVector< TrackCollection >
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref< TrackingParticleCollection >
edm::Exception
Definition: EDMException.h:77
TrackClassifierByProxy
Get track history and classification by proxy.
Definition: TrackClassifierByProxy.h:11
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.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
edm::AssociationMap
Definition: AssociationMap.h:48
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
edm::EventSetup
Definition: EventSetup.h:57
TrackClassifierByProxy::proxyHandler_
edm::Handle< Association > proxyHandler_
Definition: TrackClassifierByProxy.h:102
TrackClassifierByProxy::TrackClassifierByProxy
TrackClassifierByProxy(edm::ParameterSet const &config)
Constructor by ParameterSet.
Definition: TrackClassifierByProxy.h:20
TrackClassifierByProxy::newEvent
virtual void newEvent(edm::Event const &event, edm::EventSetup const &config)
Pre-process event information (for accessing reconstraction information).
Definition: TrackClassifierByProxy.h:24
TrackClassifierByProxy::evaluate
const TrackClassifierByProxy< Collection > & evaluate(edm::Ref< Collection > const &track)
Classify any tracks in categories.
Definition: TrackClassifierByProxy.h:64
TrackClassifierByProxy::evaluate
const TrackClassifierByProxy< Collection > & evaluate(edm::Ref< Collection > const &track, std::size_t index)
Classify any Tracks in categories.
Definition: TrackClassifierByProxy.h:40
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
event
Definition: event.py:1
TrackClassifier
Get track history and classify it in function of their .
Definition: TrackClassifier.h:29
edm::Event
Definition: Event.h:73
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
TrackClassifierByProxy::Association
edm::AssociationMap< edm::OneToMany< Collection, reco::TrackCollection > > Association
Association type.
Definition: TrackClassifierByProxy.h:17
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37