CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
virtual void newEvent (edm::Event const &event, edm::EventSetup const &config)
 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

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

Association type.

Definition at line 17 of file VertexClassifierByProxy.h.

Constructor & Destructor Documentation

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

Constructor by ParameterSet.

Definition at line 20 of file VertexClassifierByProxy.h.

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

Member Function Documentation

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

Classify the TrackingVertex in categories.

Definition at line 36 of file VertexClassifierByProxy.h.

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

37  {
39  return *this;
40  }
VertexClassifier const & evaluate(reco::VertexBaseRef const &)
Classify the RecoVertex in categories.
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 43 of file VertexClassifierByProxy.h.

44  {
45  const reco::VertexRefVector * vertexes = 0;
46 
47  try
48  {
49  // Get a reference to the vector of associated vertexes
50  vertexes = &(proxyHandler_->find(vertex)->val);
51  }
52  catch (edm::Exception& e)
53  {
54  // If association fails define the vertex as unknown
55  reset();
56  unknownVertex();
57  return *this;
58  }
59 
60  // Evaluate the history for a given index
61  VertexClassifier::evaluate( vertexes->at(index) );
62 
63  return *this;
64  }
void reset()
Reset the categories flags.
edm::Handle< Association > proxyHandler_
value_type const at(size_type idx) const
Retrieve an element of the RefVector.
Definition: RefVector.h:80
VertexClassifier const & evaluate(reco::VertexBaseRef const &)
Classify the RecoVertex in categories.
template<typename Collection>
VertexClassifierByProxy<Collection> const& VertexClassifierByProxy< Collection >::evaluate ( edm::Ref< Collection > const &  vertex)
inline

Classify any vertexes in categories.

Definition at line 67 of file VertexClassifierByProxy.h.

68  {
69  const reco::VertexRefVector * vertexes = 0;
70 
71  try
72  {
73  // Get a reference to the vector of associated vertexes
74  vertexes = &(proxyHandler_->find(vertex)->val);
75  }
76  catch (edm::Exception& e)
77  {
78  // If association fails define the vertex as unknown
79  reset();
80  unknownVertex();
81  return *this;
82  }
83 
84  // Loop over all the associated vertexes
85  for (std::size_t index = 0; index < vertexes->size(); ++index)
86  {
87  // Copy the last status for all the flags
89 
90  // Evaluate the history for a given index
91  VertexClassifier::evaluate( vertexes->at(index) );
92 
93  // Combine OR the flag information
94  for (std::size_t i = 0; i < flags_.size(); ++i)
95  flags_[i] = flags_[i] | flags[i];
96  }
97 
98  return *this;
99  }
int i
Definition: DBlmapReader.cc:9
void reset()
Reset the categories flags.
std::vector< bool > Flags
Main types associated to the class.
Flags flags_
Flag containers.
const Flags & flags() const
Returns flags with the category descriptions.
edm::Handle< Association > proxyHandler_
value_type const at(size_type idx) const
Retrieve an element of the RefVector.
Definition: RefVector.h:80
VertexClassifier const & evaluate(reco::VertexBaseRef const &)
Classify the RecoVertex in categories.
size_type size() const
Size of the RefVector.
Definition: RefVector.h:99
template<typename Collection>
virtual void VertexClassifierByProxy< Collection >::newEvent ( edm::Event const &  event,
edm::EventSetup const &  config 
)
inlinevirtual

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

Reimplemented from VertexClassifier.

Definition at line 27 of file VertexClassifierByProxy.h.

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

28  {
29  // Get the association part of the proxy to the collection
30  event.getByLabel(proxy_, proxyHandler_);
31  // Call the previous new event
33  }
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
edm::Handle< Association > proxyHandler_
virtual void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)

Member Data Documentation

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