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

const VertexClassifierByProxy< Collection > & evaluate (edm::Ref< Collection > const &vertex)
 Classify any vertexes in categories. More...
 
const VertexClassifierByProxy< Collection > & evaluate (edm::Ref< Collection > const &vertex, std::size_t index)
 Classify any vertexes in categories. More...
 
const VertexClassifierByProxy< Collection > & evaluate (TrackingVertexRef const &vertex)
 Classify the TrackingVertex 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
const VertexClassifierevaluate (reco::VertexBaseRef const &)
 Classify the RecoVertex in categories. More...
 
const VertexClassifierevaluate (reco::VertexRef const &vertex)
 Classify the RecoVertex in categories. More...
 
const VertexClassifierevaluate (TrackingVertexRef const &)
 Classify the TrackingVertex in categories. More...
 
const VertexHistoryhistory () 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  }

Member Function Documentation

◆ evaluate() [1/3]

template<typename Collection>
const VertexClassifierByProxy<Collection>& 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  }

◆ evaluate() [2/3]

template<typename Collection>
const VertexClassifierByProxy<Collection>& 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  }

◆ evaluate() [3/3]

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

Classify the TrackingVertex in categories.

Definition at line 32 of file VertexClassifierByProxy.h.

32  {
34  return *this;
35  }

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

◆ 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.

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

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

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
mps_fire.i
i
Definition: mps_fire.py:428
VertexCategories::unknownVertex
void unknownVertex()
Definition: VertexCategories.cc:42
jets_cff.vertexes
vertexes
Definition: jets_cff.py:714
VertexClassifier::VertexClassifier
VertexClassifier(edm::ParameterSet const &pset, edm::ConsumesCollector &&)
Constructor by ParameterSet.
Definition: VertexClassifier.cc:18
edm::RefVector
Definition: EDProductfwd.h:27
VertexCategories::flags
const Flags & flags() const
Returns flags with the category descriptions.
Definition: VertexCategories.h:64
edm::Exception
Definition: EDMException.h:77
config
Definition: config.py:1
VertexClassifier::newEvent
virtual void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
Definition: VertexClassifier.cc:33
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
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
eostools.move
def move(src, dest)
Definition: eostools.py:511
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::InputTag
Definition: InputTag.h:15
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