CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
13 
14 public:
15 
18 
21  proxy_( config.getUntrackedParameter<edm::InputTag>("vertexProducer") ) {}
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
29  VertexClassifier::newEvent(event, config);
30  }
31 
34  {
36  return *this;
37  }
38 
41  {
42  const reco::VertexRefVector * vertexes = 0;
43 
44  try
45  {
46  // Get a reference to the vector of associated vertexes
47  vertexes = &(proxyHandler_->find(vertex)->val);
48  }
49  catch (edm::Exception& e)
50  {
51  // If association fails define the vertex as unknown
52  reset();
53  unknownVertex();
54  return *this;
55  }
56 
57  // Evaluate the history for a given index
58  VertexClassifier::evaluate( vertexes->at(index) );
59 
60  return *this;
61  }
62 
65  {
66  const reco::VertexRefVector * vertexes = 0;
67 
68  try
69  {
70  // Get a reference to the vector of associated vertexes
71  vertexes = &(proxyHandler_->find(vertex)->val);
72  }
73  catch (edm::Exception& e)
74  {
75  // If association fails define the vertex as unknown
76  reset();
77  unknownVertex();
78  return *this;
79  }
80 
81  // Loop over all the associated vertexes
82  for (std::size_t index = 0; index < vertexes->size(); ++index)
83  {
84  // Copy the last status for all the flags
86 
87  // Evaluate the history for a given index
88  VertexClassifier::evaluate( vertexes->at(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
Get track history and classification by proxy.
int i
Definition: DBlmapReader.cc:9
VertexClassifierByProxy(edm::ParameterSet const &config)
Constructor by ParameterSet.
Get track history and classify it in function of their .
void reset()
Reset the categories flags.
std::vector< bool > Flags
Main types associated to the class.
Flags flags_
Flag containers.
VertexClassifierByProxy< Collection > const & evaluate(edm::Ref< Collection > const &vertex, std::size_t index)
Classify any vertexes in categories.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
const Flags & flags() const
Returns flags with the category descriptions.
edm::Handle< Association > proxyHandler_
VertexClassifierByProxy< Collection > const & evaluate(edm::Ref< Collection > const &vertex)
Classify any vertexes in categories.
VertexClassifierByProxy< Collection > const & evaluate(TrackingVertexRef const &vertex)
Classify the TrackingVertex in categories.
edm::AssociationMap< edm::OneToMany< Collection, reco::VertexCollection > > Association
Association type.
value_type const at(size_type idx) const
Retrieve an element of the RefVector.
Definition: RefVector.h:76
VertexClassifier const & evaluate(reco::VertexBaseRef const &)
Classify the RecoVertex in categories.
virtual void newEvent(edm::Event const &event, edm::EventSetup const &config)
Pre-process event information (for accessing reconstraction information).
size_type size() const
Size of the RefVector.
Definition: RefVector.h:89
virtual void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)