CMS 3D CMS Logo

VertexClassifierByProxy.h
Go to the documentation of this file.
1 
2 #ifndef VertexClassifierByProxy_h
3 #define VertexClassifierByProxy_h
4 
6 
8 
10 template <typename Collection>
12 public:
15 
18  : VertexClassifier(config, std::move(collector)),
19  proxy_(config.getUntrackedParameter<edm::InputTag>("vertexProducer")) {
20  collector.consumes<Association>(proxy_);
21  }
22 
24  void newEvent(edm::Event const &event, edm::EventSetup const &config) override {
25  // Get the association part of the proxy to the collection
26  event.getByLabel(proxy_, proxyHandler_);
27  // Call the previous new event
29  }
30 
34  return *this;
35  }
36 
39  const reco::VertexRefVector *vertexes = nullptr;
40 
41  try {
42  // Get a reference to the vector of associated vertexes
43  vertexes = &(proxyHandler_->find(vertex)->val);
44  } catch (edm::Exception &e) {
45  // If association fails define the vertex as unknown
46  reset();
47  unknownVertex();
48  return *this;
49  }
50 
51  // Evaluate the history for a given index
53 
54  return *this;
55  }
56 
59  const reco::VertexRefVector *vertexes = nullptr;
60 
61  try {
62  // Get a reference to the vector of associated vertexes
63  vertexes = &(proxyHandler_->find(vertex)->val);
64  } catch (edm::Exception &e) {
65  // If association fails define the vertex as unknown
66  reset();
67  unknownVertex();
68  return *this;
69  }
70 
71  // Loop over all the associated vertexes
72  for (std::size_t index = 0; index < vertexes->size(); ++index) {
73  // Copy the last status for all the flags
75 
76  // Evaluate the history for a given index
78 
79  // Combine OR the flag information
80  for (std::size_t i = 0; i < flags_.size(); ++i)
81  flags_[i] = flags_[i] | flags[i];
82  }
83 
84  return *this;
85  }
86 
87 private:
89 
91 };
92 
93 #endif
mps_fire.i
i
Definition: mps_fire.py:355
VertexCategories::unknownVertex
void unknownVertex()
Definition: VertexCategories.cc:42
edm
HLT enums.
Definition: AlignableModifier.h:19
VertexClassifierByProxy::evaluate
const VertexClassifierByProxy< Collection > & evaluate(TrackingVertexRef const &vertex)
Classify the TrackingVertex in categories.
Definition: VertexClassifierByProxy.h:32
AssociationMap.h
VertexClassifierByProxy
Get track history and classification by proxy.
Definition: VertexClassifierByProxy.h:11
VertexClassifierByProxy::evaluate
const VertexClassifierByProxy< Collection > & evaluate(edm::Ref< Collection > const &vertex)
Classify any vertexes in categories.
Definition: VertexClassifierByProxy.h:58
jets_cff.vertexes
vertexes
Definition: jets_cff.py:644
edm::RefVector
Definition: EDProductfwd.h:27
edm::Handle
Definition: AssociativeIterator.h:50
VertexCategories::flags
const Flags & flags() const
Returns flags with the category descriptions.
Definition: VertexCategories.h:64
edm::Ref< TrackingVertexCollection >
edm::Exception
Definition: EDMException.h:77
config
Definition: config.py:1
VertexClassifierByProxy::evaluate
const VertexClassifierByProxy< Collection > & evaluate(edm::Ref< Collection > const &vertex, std::size_t index)
Classify any vertexes in categories.
Definition: VertexClassifierByProxy.h:38
VertexClassifier.h
VertexClassifier::newEvent
virtual void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
Definition: VertexClassifier.cc:33
VertexClassifierByProxy::newEvent
void newEvent(edm::Event const &event, edm::EventSetup const &config) override
Pre-process event information (for accessing reconstraction information).
Definition: VertexClassifierByProxy.h:24
VertexClassifier
Get track history and classify it in function of their .
Definition: VertexClassifier.h:18
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
edm::AssociationMap
Definition: AssociationMap.h:48
VertexClassifierByProxy::proxy_
const edm::InputTag proxy_
Definition: VertexClassifierByProxy.h:88
VertexClassifierByProxy::Association
edm::AssociationMap< edm::OneToMany< Collection, reco::VertexCollection > > Association
Association type.
Definition: VertexClassifierByProxy.h:14
edm::EventSetup
Definition: EventSetup.h:57
VertexClassifierByProxy::VertexClassifierByProxy
VertexClassifierByProxy(edm::ParameterSet const &config, edm::ConsumesCollector &&collector)
Constructor by ParameterSet.
Definition: VertexClassifierByProxy.h:17
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
VertexCategories::flags_
Flags flags_
Flag containers.
Definition: VertexCategories.h:74
VertexClassifier::evaluate
const VertexClassifier & evaluate(reco::VertexBaseRef const &)
Classify the RecoVertex in categories.
Definition: VertexClassifier.cc:47
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
VertexClassifierByProxy::proxyHandler_
edm::Handle< Association > proxyHandler_
Definition: VertexClassifierByProxy.h:90
VertexCategories::reset
void reset()
Reset the categories flags.
Definition: VertexCategories.h:68
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
VertexCategories::Flags
std::vector< bool > Flags
Main types associated to the class.
Definition: VertexCategories.h:55
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37