Public Member Functions | |
void | analyze (const edm::Event &evt, const edm::EventSetup &es) |
RecoTauPlotDiscriminator (const edm::ParameterSet &pset) | |
virtual | ~RecoTauPlotDiscriminator () |
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_ |
Definition at line 29 of file RecoTauPlotDiscriminator.cc.
typedef std::map<std::string, HistoMap> RecoTauPlotDiscriminator::DiscMap [private] |
Definition at line 37 of file RecoTauPlotDiscriminator.cc.
typedef std::map<std::string, TH1*> RecoTauPlotDiscriminator::HistoMap [private] |
Definition at line 36 of file RecoTauPlotDiscriminator.cc.
typedef std::vector<edm::InputTag> RecoTauPlotDiscriminator::VInputTag [private] |
Definition at line 38 of file RecoTauPlotDiscriminator.cc.
RecoTauPlotDiscriminator::RecoTauPlotDiscriminator | ( | const edm::ParameterSet & | pset | ) |
Definition at line 43 of file RecoTauPlotDiscriminator.cc.
References discs_, edm::ParameterSet::getParameter(), histos_, edm::InputTag::label(), max(), min, ExpressReco_HICollisions_FallBack::nbins, and GlobalPosition_Frontier_DevDB_cff::tag.
:src_(pset.getParameter<edm::InputTag>("src")) { uint32_t nbins = pset.getParameter<uint32_t>("nbins"); double min = pset.getParameter<double>("min"); double max = pset.getParameter<double>("max"); edm::Service<TFileService> fs; // Get the discriminators discs_ = pset.getParameter<std::vector<edm::InputTag> >("discriminators"); BOOST_FOREACH(const edm::InputTag &tag, discs_) { HistoMap discMap; discMap["plain"] = fs->make<TH1F>(tag.label().c_str(), tag.label().c_str(), nbins, min, max); // Make correlation plots std::string vs_pt_name = tag.label()+"_pt"; discMap["vs_pt"] = fs->make<TH2F>(vs_pt_name.c_str(), vs_pt_name.c_str(), nbins, min, max, 100, 0, 100); std::string vs_eta_name = tag.label()+"_eta"; discMap["vs_eta"] = fs->make<TH2F>(vs_eta_name.c_str(), vs_eta_name.c_str(), nbins, min, max, 100, -2.5, 2.5); std::string vs_dm_name = tag.label()+"_dm"; discMap["vs_dm"] = fs->make<TH2F>(vs_dm_name.c_str(), vs_dm_name.c_str(), nbins, min, max, 15, -0.5, 14.5); histos_[tag.label()] = discMap; } }
virtual RecoTauPlotDiscriminator::~RecoTauPlotDiscriminator | ( | ) | [inline, virtual] |
Definition at line 32 of file RecoTauPlotDiscriminator.cc.
{}
void RecoTauPlotDiscriminator::analyze | ( | const edm::Event & | evt, |
const edm::EventSetup & | es | ||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 78 of file RecoTauPlotDiscriminator.cc.
References discs_, edm::Event::getByLabel(), histos_, collect_tpl::input, edm::InputTag::label(), query::result, src_, GlobalPosition_Frontier_DevDB_cff::tag, and metsig::tau.
{ // Get the input collection to clean edm::Handle<reco::CandidateView> input; evt.getByLabel(src_, input); // Cast the input candidates to Refs to real taus reco::PFTauRefVector inputRefs = reco::tau::castView<reco::PFTauRefVector>(input); // Plot the discriminator output for each of our taus BOOST_FOREACH(const reco::PFTauRef& tau, inputRefs) { // Plot each discriminator BOOST_FOREACH(const edm::InputTag &tag, discs_) { edm::Handle<reco::PFTauDiscriminator> discHandle; evt.getByLabel(tag, discHandle); //const HistoMap &discHistos = disc.second; double result = (*discHandle)[tau]; HistoMap& mymap = histos_[tag.label()]; mymap["plain"]->Fill(result); mymap["vs_pt"]->Fill(result, tau->pt()); mymap["vs_eta"]->Fill(result, tau->eta()); mymap["vs_dm"]->Fill(result, tau->decayMode()); } } }
VInputTag RecoTauPlotDiscriminator::discs_ [private] |
Definition at line 39 of file RecoTauPlotDiscriminator.cc.
Referenced by analyze(), and RecoTauPlotDiscriminator().
DiscMap RecoTauPlotDiscriminator::histos_ [private] |
Definition at line 40 of file RecoTauPlotDiscriminator.cc.
Referenced by analyze(), and RecoTauPlotDiscriminator().
edm::InputTag RecoTauPlotDiscriminator::src_ [private] |
Definition at line 35 of file RecoTauPlotDiscriminator.cc.
Referenced by analyze().