CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RecoTauDiscriminantCutMultiplexer.cc
Go to the documentation of this file.
1 /*
2  * RecoTauDiscriminantCutMultiplexer
3  *
4  * Author: Evan K. Friis, UW
5  *
6  * Takes two PFTauDiscriminators.
7  *
8  * The "key" discriminantor is rounded to the nearest integer.
9  *
10  * A set of cuts for different keys on the "toMultiplex" discriminantor is
11  * provided in the config file.
12  *
13  * Both the key and toMultiplex discriminators should map to the same PFTau
14  * collection.
15  *
16  */
17 #include <boost/foreach.hpp>
20 
21 #include "TMath.h"
22 
24  public:
26 
28  double discriminate(const reco::PFTauRef&);
29  void beginEvent(const edm::Event& event, const edm::EventSetup& eventSetup);
30 
31  private:
32  typedef std::map<int, double> DiscriminantCutMap;
33 
39 };
40 
43  toMultiplex_ = pset.getParameter<edm::InputTag>("toMultiplex");
44  key_ = pset.getParameter<edm::InputTag>("key");
45  /*code*/
46  typedef std::vector<edm::ParameterSet> VPSet;
47  VPSet mapping = pset.getParameter<VPSet>("mapping");
48  // Setup our cut map
49  BOOST_FOREACH(const edm::ParameterSet &dm, mapping) {
50  // Get the mass window for each decay mode
51  cuts_.insert(std::make_pair(
52  // The category as a key
53  dm.getParameter<uint32_t>("category"),
54  // The selection
55  dm.getParameter<double>("cut")
56  ));
57  }
58 }
59 
61  const edm::Event& evt, const edm::EventSetup& es) {
64 }
65 
66 double
68  double disc_result = (*toMultiplexHandle_)[tau];
69  double key_result = (*keyHandle_)[tau];
70  DiscriminantCutMap::const_iterator cutIter = cuts_.find(TMath::Nint(key_result));
71 
72  // Return null if it doesn't exist
73  if (cutIter == cuts_.end()) {
75  }
76  // See if the discriminator passes our cuts
77  return disc_result > cutIter->second;
78 }
79 
T getParameter(std::string const &) const
edm::Handle< reco::PFTauDiscriminator > keyHandle_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edm::Handle< reco::PFTauDiscriminator > toMultiplexHandle_
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 getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
RecoTauDiscriminantCutMultiplexer(const edm::ParameterSet &pset)