CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
VertexingHelper.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_PatAlgos_interface_VertexingHelper_h
2 #define PhysicsTools_PatAlgos_interface_VertexingHelper_h
3 
18 
21 
25 
27 namespace reco {
28  namespace modules {
30  template<>
31  struct ParameterAdapter<pat::VertexAssociationSelector> {
34  if (iConfig.existsAs<double>("deltaZ")) assoconf.dZ = iConfig.getParameter<double>("deltaZ");
35  if (iConfig.existsAs<double>("deltaR")) assoconf.dR = iConfig.getParameter<double>("deltaR");
36  if (iConfig.existsAs<double>("sigmasZ")) assoconf.sigmasZ = iConfig.getParameter<double>("sigmasZ");
37  if (iConfig.existsAs<double>("sigmasR")) assoconf.sigmasR = iConfig.getParameter<double>("sigmasR");
38  return pat::VertexAssociationSelector(assoconf);
39  }
40  };
41  }
42 }
43 
44 namespace pat { namespace helper {
46  public:
48  VertexingHelper(const edm::ParameterSet &iConfig) ;
49 
51  bool enabled() const { return enabled_; }
52 
54  void newEvent(const edm::Event &event) ;
55 
58  void newEvent(const edm::Event &event, const edm::EventSetup & setup) ;
59 
62  template<typename AnyCandRef>
63  pat::VertexAssociation operator()(const AnyCandRef &) const ;
64 
65  private:
67  bool enabled_;
68 
70  bool playback_;
71 
74 
75  //-------- Tools for production of vertex associations -------
79  bool useTracks_;
81 
82  //--------- Tools for reading vertex associations (playback mode) -----
85 
88 
92 
93  }; // class
94 
95  template<typename AnyCandRef>
97  pat::helper::VertexingHelper::operator()(const AnyCandRef &cand) const
98  {
99  if (playback_) {
100  const pat::VertexAssociation &assoc = (*vertexAssoMap_)[cand];
101  return assoSelector_(assoc) ? assoc : pat::VertexAssociation();
102  } else {
103  return associate( *cand );
104  }
105 
106  }
107 
108 } }
109 
110 
111 
112 
113 #endif
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:187
edm::Handle< edm::ValueMap< pat::VertexAssociation > > vertexAssoMap_
reco::TrackBaseRef getTrack_(const reco::Candidate &c) const
Get out the track from the Candidate / RecoCandidate / PFCandidate.
edm::Handle< reco::VertexCollection > vertexHandle_
pat::VertexAssociation operator()(const AnyCandRef &) const
edm::ESHandle< TransientTrackBuilder > ttBuilder_
static pat::VertexAssociationSelector make(const edm::ParameterSet &iConfig)
bool useTracks_
use tracks inside candidates
pat::VertexAssociation associate(const reco::Candidate &) const
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
bool playback_
true if it&#39;s just reading the associations from the event
void newEvent(const edm::Event &event)
To be called for each new event, reads in the vertex collection.
bool enabled() const
returns true if this was given a non dummy configuration
bool enabled_
true if it has non null configuration
float dZ
cuts on Z and transverse distance from the vertex, absolute values or significances ...
Analysis-level structure for vertex-related information.
Definition: Vertexing.h:27
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
Produces and/or checks pat::VertexAssociation&#39;s.
pat::VertexAssociationSelector assoSelector_
selector of associations