test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EfficiencyLoader.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_PatAlgos_EfficiencyLoader_h
2 #define PhysicsTools_PatAlgos_EfficiencyLoader_h
3 
8 
13 
14 
15 namespace pat { namespace helper {
17  public:
20 
23 
25  bool enabled() const { return !names_.empty(); }
26 
28  void newEvent(const edm::Event &event);
29 
31  template<typename T, typename R>
32  void setEfficiencies( pat::PATObject<T> &obj, const R & originalRef ) const ;
33 
34  private:
35  std::vector<std::string> names_;
36  std::vector<edm::EDGetTokenT<edm::ValueMap<pat::LookupTableRecord> > > tokens_;
37  std::vector<edm::Handle< edm::ValueMap<pat::LookupTableRecord> > > handles_;
38 }; // class
39 
40 template<typename T, typename R>
41 void
43 {
44  for (size_t i = 0, n = names_.size(); i < n; ++i) {
45  obj.setEfficiency(names_[i], (* handles_[i])[originalRef] );
46  }
47 }
48 
49 } }
50 
51 #endif
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
int i
Definition: DBlmapReader.cc:9
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
std::vector< std::string > names_
EfficiencyLoader()
Empty constructor.
std::vector< edm::EDGetTokenT< edm::ValueMap< pat::LookupTableRecord > > > tokens_
void setEfficiency(const std::string &name, const pat::LookupTableRecord &value)
Definition: PATObject.h:655
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
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
std::vector< edm::Handle< edm::ValueMap< pat::LookupTableRecord > > > handles_
Templated PAT object container.
Definition: PATObject.h:49