CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Attributes
RecoTauPlotDiscriminator Class Reference
Inheritance diagram for RecoTauPlotDiscriminator:
edm::EDAnalyzer

Public Member Functions

void analyze (const edm::Event &evt, const edm::EventSetup &es)
 
 RecoTauPlotDiscriminator (const edm::ParameterSet &pset)
 
virtual ~RecoTauPlotDiscriminator ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Types

typedef std::map< std::string,
HistoMap
DiscMap
 
typedef std::map< std::string,
TH1 * > 
HistoMap
 
typedef std::vector
< edm::InputTag
VInputTag
 

Private Attributes

VInputTag discs_
 
DiscMap histos_
 
edm::InputTag src_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 30 of file RecoTauPlotDiscriminator.cc.

Member Typedef Documentation

typedef std::map<std::string, HistoMap> RecoTauPlotDiscriminator::DiscMap
private

Definition at line 38 of file RecoTauPlotDiscriminator.cc.

typedef std::map<std::string, TH1*> RecoTauPlotDiscriminator::HistoMap
private

Definition at line 37 of file RecoTauPlotDiscriminator.cc.

typedef std::vector<edm::InputTag> RecoTauPlotDiscriminator::VInputTag
private

Definition at line 39 of file RecoTauPlotDiscriminator.cc.

Constructor & Destructor Documentation

RecoTauPlotDiscriminator::RecoTauPlotDiscriminator ( const edm::ParameterSet pset)

Definition at line 44 of file RecoTauPlotDiscriminator.cc.

References discs_, edm::ParameterSet::getParameter(), histos_, edm::InputTag::label(), max(), min, RecoTauCommonJetSelections_cfi::nbins, and GlobalPosition_Frontier_DevDB_cff::tag.

45  :src_(pset.getParameter<edm::InputTag>("src")) {
46  uint32_t nbins = pset.getParameter<uint32_t>("nbins");
47  double min = pset.getParameter<double>("min");
48  double max = pset.getParameter<double>("max");
50  // Get the discriminators
51  discs_ = pset.getParameter<std::vector<edm::InputTag> >("discriminators");
52 
53  BOOST_FOREACH(const edm::InputTag &tag, discs_) {
54  HistoMap discMap;
55  discMap["plain"] =
56  fs->make<TH1F>(tag.label().c_str(), tag.label().c_str(),
57  nbins, min, max);
58 
59  // Make correlation plots w.r.t tau pt
60  std::string vs_pt_name = tag.label()+"_pt";
61  discMap["vs_pt"] =
62  fs->make<TH2F>(vs_pt_name.c_str(), vs_pt_name.c_str(),
63  nbins, min, max, 100, 0, 100);
64 
65  // W.r.t. jet pt
66  std::string vs_jetpt_name = tag.label()+"_jetPt";
67  discMap["vs_jetPt"] =
68  fs->make<TH2F>(vs_jetpt_name.c_str(), vs_jetpt_name.c_str(),
69  nbins, min, max, 100, 0, 100);
70 
71  // W.r.t. embedded pt in alternat lorentz vector (used to hold gen tau pt)
72  std::string vs_embedpt_name = tag.label()+"_embedPt";
73  discMap["vs_embedPt"] =
74  fs->make<TH2F>(vs_embedpt_name.c_str(), vs_embedpt_name.c_str(),
75  nbins, min, max, 100, 0, 100);
76 
77  // 3D histogram with tau pt & jet pt
78  std::string vs_pt_jetPt_name = tag.label()+"_pt_jetPt";
79  discMap["vs_pt_jetPt"] =
80  fs->make<TH3F>(vs_pt_jetPt_name.c_str(), vs_pt_jetPt_name.c_str(),
81  nbins, min, max, 100, 0, 100, 100, 0, 100);
82 
83  std::string vs_pt_embedPt_name = tag.label()+"_pt_embedPt";
84  discMap["vs_pt_embedPt"] =
85  fs->make<TH3F>(vs_pt_embedPt_name.c_str(), vs_pt_embedPt_name.c_str(),
86  nbins, min, max, 100, 0, 100, 100, 0, 100);
87 
88 
89  std::string vs_eta_name = tag.label()+"_eta";
90  discMap["vs_eta"] =
91  fs->make<TH2F>(vs_eta_name.c_str(), vs_eta_name.c_str(),
92  nbins, min, max, 100, -2.5, 2.5);
93 
94  std::string vs_dm_name = tag.label()+"_dm";
95  discMap["vs_dm"] =
96  fs->make<TH2F>(vs_dm_name.c_str(), vs_dm_name.c_str(),
97  nbins, min, max, 15, -0.5, 14.5);
98  histos_[tag.label()] = discMap;
99  }
100 }
T getParameter(std::string const &) const
#define min(a, b)
Definition: mlp_lapack.h:161
const T & max(const T &a, const T &b)
std::map< std::string, TH1 * > HistoMap
std::string const & label() const
Definition: InputTag.h:25
virtual RecoTauPlotDiscriminator::~RecoTauPlotDiscriminator ( )
inlinevirtual

Definition at line 33 of file RecoTauPlotDiscriminator.cc.

33 {}

Member Function Documentation

void RecoTauPlotDiscriminator::analyze ( const edm::Event evt,
const edm::EventSetup es 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 103 of file RecoTauPlotDiscriminator.cc.

References discs_, HcalObjRepresent::Fill(), edm::Event::getByLabel(), histos_, collect_tpl::input, edm::InputTag::label(), query::result, src_, GlobalPosition_Frontier_DevDB_cff::tag, and metsig::tau.

104  {
105  // Get the input collection to clean
107  evt.getByLabel(src_, input);
108 
109  // Cast the input candidates to Refs to real taus
110  reco::PFTauRefVector inputRefs =
111  reco::tau::castView<reco::PFTauRefVector>(input);
112 
113  // Plot the discriminator output for each of our taus
114  BOOST_FOREACH(const reco::PFTauRef& tau, inputRefs) {
115  // Plot each discriminator
116  BOOST_FOREACH(const edm::InputTag &tag, discs_) {
118  evt.getByLabel(tag, discHandle);
119  //const HistoMap &discHistos = disc.second;
120  double result = (*discHandle)[tau];
121  HistoMap& mymap = histos_[tag.label()];
122  mymap["plain"]->Fill(result);
123  mymap["vs_pt"]->Fill(result, tau->pt());
124  mymap["vs_jetPt"]->Fill(result, tau->jetRef()->pt());
125  mymap["vs_embedPt"]->Fill(result, tau->alternatLorentzVect().pt());
126  dynamic_cast<TH3F*>(mymap["vs_pt_jetPt"])->Fill(
127  result, tau->pt(), tau->jetRef()->pt());
128  dynamic_cast<TH3F*>(mymap["vs_pt_embedPt"])->Fill(
129  result, tau->pt(), tau->alternatLorentzVect().pt());
130  mymap["vs_eta"]->Fill(result, tau->eta());
131  mymap["vs_dm"]->Fill(result, tau->decayMode());
132  }
133  }
134 }
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
std::map< std::string, TH1 * > HistoMap
tuple input
Definition: collect_tpl.py:10
std::string const & label() const
Definition: InputTag.h:25

Member Data Documentation

VInputTag RecoTauPlotDiscriminator::discs_
private

Definition at line 40 of file RecoTauPlotDiscriminator.cc.

Referenced by analyze(), and RecoTauPlotDiscriminator().

DiscMap RecoTauPlotDiscriminator::histos_
private

Definition at line 41 of file RecoTauPlotDiscriminator.cc.

Referenced by analyze(), and RecoTauPlotDiscriminator().

edm::InputTag RecoTauPlotDiscriminator::src_
private

Definition at line 36 of file RecoTauPlotDiscriminator.cc.

Referenced by analyze().