CMS 3D CMS Logo

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

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

#include <VertexClassifierByProxy.h>

Inheritance diagram for VertexClassifierByProxy< Collection >:
VertexClassifier VertexCategories

Public Types

typedef edm::AssociationMap< edm::OneToMany< Collection, reco::VertexCollection > > Association
 Association type. More...
 
- Public Types inherited from VertexClassifier
typedef VertexCategories Categories
 Type to the associate category. More...
 
- Public Types inherited from VertexCategories
enum  Category {
  Fake = 0, Reconstructed = Fake, SignalEvent, BWeakDecay,
  CWeakDecay, 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,
  PrimaryVertex, SecondaryVertex, TertiaryVertex, TierciaryVertex = TertiaryVertex,
  Unknown
}
 Categories available to vertexes. More...
 
typedef std::vector< bool > Flags
 Main types associated to the class. More...
 

Public Member Functions

VertexClassifierByProxy< Collection > const & evaluate (TrackingVertexRef const &vertex)
 Classify the TrackingVertex in categories. More...
 
VertexClassifierByProxy< Collection > const & evaluate (edm::Ref< Collection > const &vertex, std::size_t index)
 Classify any vertexes in categories. More...
 
VertexClassifierByProxy< Collection > const & evaluate (edm::Ref< Collection > const &vertex)
 Classify any vertexes in categories. More...
 
void newEvent (edm::Event const &event, edm::EventSetup const &config) override
 Pre-process event information (for accessing reconstraction information). More...
 
 VertexClassifierByProxy (edm::ParameterSet const &config, edm::ConsumesCollector &&collector)
 Constructor by ParameterSet. More...
 
- Public Member Functions inherited from VertexClassifier
VertexClassifier const & evaluate (reco::VertexBaseRef const &)
 Classify the RecoVertex in categories. More...
 
VertexClassifier const & evaluate (TrackingVertexRef const &)
 Classify the TrackingVertex in categories. More...
 
VertexClassifier const & evaluate (reco::VertexRef const &vertex)
 Classify the RecoVertex in categories. More...
 
VertexHistory const & history () const
 Returns a reference to the vertex history used in the classification. More...
 
 VertexClassifier (edm::ParameterSet const &pset, edm::ConsumesCollector)
 Constructor by ParameterSet. More...
 
virtual ~VertexClassifier ()
 
- Public Member Functions inherited from VertexCategories
const Flagsflags () const
 Returns flags with the category descriptions. More...
 
bool is (Category category) const
 Returns track flag for a given category. More...
 
 VertexCategories ()
 Void constructor. More...
 

Private Attributes

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

Additional Inherited Members

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

Detailed Description

template<typename Collection>
class VertexClassifierByProxy< Collection >

Get track history and classification by proxy.

Definition at line 11 of file VertexClassifierByProxy.h.

Member Typedef Documentation

◆ Association

template<typename Collection>
typedef edm::AssociationMap<edm::OneToMany<Collection, reco::VertexCollection> > VertexClassifierByProxy< Collection >::Association

Association type.

Definition at line 14 of file VertexClassifierByProxy.h.

Constructor & Destructor Documentation

◆ VertexClassifierByProxy()

template<typename Collection>
VertexClassifierByProxy< Collection >::VertexClassifierByProxy ( edm::ParameterSet const &  config,
edm::ConsumesCollector &&  collector 
)
inline

Constructor by ParameterSet.

Definition at line 17 of file VertexClassifierByProxy.h.

18  : VertexClassifier(config, std::move(collector)),
19  proxy_(config.getUntrackedParameter<edm::InputTag>("vertexProducer")) {
20  collector.consumes<Association>(proxy_);
21  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: config.py:1
VertexClassifier(edm::ParameterSet const &pset, edm::ConsumesCollector)
Constructor by ParameterSet.
edm::AssociationMap< edm::OneToMany< Collection, reco::VertexCollection > > Association
Association type.
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

◆ evaluate() [1/3]

template<typename Collection>
VertexClassifierByProxy<Collection> const& VertexClassifierByProxy< Collection >::evaluate ( TrackingVertexRef const &  vertex)
inline

Classify the TrackingVertex in categories.

Definition at line 32 of file VertexClassifierByProxy.h.

Referenced by SVTagInfoValidationAnalyzer::analyze(), and recoBSVTagInfoValidationAnalyzer::analyze().

32  {
34  return *this;
35  }
VertexClassifier const & evaluate(reco::VertexBaseRef const &)
Classify the RecoVertex in categories.

◆ evaluate() [2/3]

template<typename Collection>
VertexClassifierByProxy<Collection> const& VertexClassifierByProxy< Collection >::evaluate ( edm::Ref< Collection > const &  vertex,
std::size_t  index 
)
inline

Classify any vertexes in categories.

Definition at line 38 of file VertexClassifierByProxy.h.

38  {
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  }
void reset()
Reset the categories flags.
VertexClassifier const & evaluate(reco::VertexBaseRef const &)
Classify the RecoVertex in categories.
edm::Handle< Association > proxyHandler_

◆ evaluate() [3/3]

template<typename Collection>
VertexClassifierByProxy<Collection> const& VertexClassifierByProxy< Collection >::evaluate ( edm::Ref< Collection > const &  vertex)
inline

Classify any vertexes in categories.

Definition at line 58 of file VertexClassifierByProxy.h.

58  {
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  }
void reset()
Reset the categories flags.
std::vector< bool > Flags
Main types associated to the class.
Flags flags_
Flag containers.
VertexClassifier const & evaluate(reco::VertexBaseRef const &)
Classify the RecoVertex in categories.
edm::Handle< Association > proxyHandler_
const Flags & flags() const
Returns flags with the category descriptions.

◆ newEvent()

template<typename Collection>
void VertexClassifierByProxy< Collection >::newEvent ( edm::Event const &  event,
edm::EventSetup const &  config 
)
inlineoverridevirtual

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

Reimplemented from VertexClassifier.

Definition at line 24 of file VertexClassifierByProxy.h.

Referenced by SVTagInfoValidationAnalyzer::analyze(), and recoBSVTagInfoValidationAnalyzer::analyze().

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

Member Data Documentation

◆ proxy_

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

◆ proxyHandler_

template<typename Collection>
edm::Handle<Association> VertexClassifierByProxy< Collection >::proxyHandler_
private