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 
22 
26 
28 namespace reco {
29  namespace modules {
31  template<>
32  struct ParameterAdapter<pat::VertexAssociationSelector> {
35  if (iConfig.existsAs<double>("deltaZ")) assoconf.dZ = iConfig.getParameter<double>("deltaZ");
36  if (iConfig.existsAs<double>("deltaR")) assoconf.dR = iConfig.getParameter<double>("deltaR");
37  if (iConfig.existsAs<double>("sigmasZ")) assoconf.sigmasZ = iConfig.getParameter<double>("sigmasZ");
38  if (iConfig.existsAs<double>("sigmasR")) assoconf.sigmasR = iConfig.getParameter<double>("sigmasR");
39  return pat::VertexAssociationSelector(assoconf);
40  }
41  };
42  }
43 }
44 
45 namespace pat { namespace helper {
47  public:
50 
52  bool enabled() const { return enabled_; }
53 
55  void newEvent(const edm::Event &event) ;
56 
59  void newEvent(const edm::Event &event, const edm::EventSetup & setup) ;
60 
63  template<typename AnyCandRef>
64  pat::VertexAssociation operator()(const AnyCandRef &) const ;
65 
66  private:
68  bool enabled_;
69 
71  bool playback_;
72 
75 
76  //-------- Tools for production of vertex associations -------
80  bool useTracks_;
82 
83  //--------- Tools for reading vertex associations (playback mode) -----
86 
89 
93 
94  }; // class
95 
96  template<typename AnyCandRef>
98  pat::helper::VertexingHelper::operator()(const AnyCandRef &cand) const
99  {
100  if (playback_) {
101  const pat::VertexAssociation &assoc = (*vertexAssoMap_)[cand];
102  return assoSelector_(assoc) ? assoc : pat::VertexAssociation();
103  } else {
104  return associate( *cand );
105  }
106 
107  }
108 
109 } }
110 
111 
112 
113 
114 #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:185
edm::Handle< edm::ValueMap< pat::VertexAssociation > > vertexAssoMap_
reco::TrackBaseRef getTrack_(const reco::Candidate &c) const
Get out the track from the Candidate / RecoCandidate / PFCandidate.
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
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
edm::EDGetTokenT< edm::ValueMap< pat::VertexAssociation > > vertexAssociationsToken_
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
edm::Handle< reco::VertexCollection > vertexHandle_
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:26
volatile std::atomic< bool > shutdown_flag false
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