CMS 3D CMS Logo

Public Member Functions | Private Attributes

TrackProbabilityTagPlotter Class Reference

#include <TrackProbabilityTagPlotter.h>

Inheritance diagram for TrackProbabilityTagPlotter:
BaseTagInfoPlotter BaseBTagPlotter

List of all members.

Public Member Functions

void analyzeTag (const reco::BaseTagInfo *tagInfo, const int &jetFlavour)
virtual void createPlotsForFinalize ()
void epsPlot (const std::string &name)
virtual void finalize ()
void psPlot (const std::string &name)
 TrackProbabilityTagPlotter (const std::string &tagName, const EtaPtBin &etaPtBin, const edm::ParameterSet &pSet, const bool &update, const bool &mc, const bool &wf)
 ~TrackProbabilityTagPlotter ()

Private Attributes

EffPurFromHistoseffPurFromHistos [4]
double endEffPur_
bool finalized
bool mcPlots_
int nBinEffPur_
double startEffPur_
FlavourHistograms< double > * tkcntHistosSig2D [5]
FlavourHistograms< double > * tkcntHistosSig3D [5]
bool willFinalize_

Detailed Description

Definition at line 12 of file TrackProbabilityTagPlotter.h.


Constructor & Destructor Documentation

TrackProbabilityTagPlotter::TrackProbabilityTagPlotter ( const std::string &  tagName,
const EtaPtBin etaPtBin,
const edm::ParameterSet pSet,
const bool &  update,
const bool &  mc,
const bool &  wf 
)

Definition at line 7 of file TrackProbabilityTagPlotter.cc.

References createPlotsForFinalize(), dir, BaseBTagPlotter::theExtensionString, tkcntHistosSig2D, tkcntHistosSig3D, update, and willFinalize_.

                                                            :
  BaseTagInfoPlotter(tagName, etaPtBin),
  nBinEffPur_(pSet.getParameter<int>("nBinEffPur")),
  startEffPur_(pSet.getParameter<double>("startEffPur")),
  endEffPur_(pSet.getParameter<double>("endEffPur")),
  finalized(false), mcPlots_(mc), willFinalize_(wf)
{
  const std::string dir(theExtensionString.substr(1));

  tkcntHistosSig3D[4] = new FlavourHistograms<double>
       ("ips_3D" + theExtensionString, "3D Probability of impact parameter",
        50, -1.0, 1.0, false, true, true, "b", update,dir, mc) ;

  tkcntHistosSig3D[0] = new FlavourHistograms<double>
       ("ips1_3D" + theExtensionString, "3D Probability of impact parameter 1st trk",
        50, -1.0, 1.0, false, true, true, "b", update,dir, mc) ;

  tkcntHistosSig3D[1] = new FlavourHistograms<double>
       ("ips2_3D" + theExtensionString, "3D Probability of impact parameter 2nd trk",
        50, -1.0, 1.0, false, true, true, "b", update,dir, mc) ;

  tkcntHistosSig3D[2] = new FlavourHistograms<double>
       ("ips3_3D" + theExtensionString, "3D Probability of impact parameter 3rd trk",
        50, -1.0, 1.0, false, true, true, "b", update,dir, mc) ;

  tkcntHistosSig3D[3] = new FlavourHistograms<double>
       ("ips4_3D" + theExtensionString, "3D Probability of impact parameter 4th trk",
        50, -1.0, 1.0, false, true, true, "b", update,dir, mc) ;

  tkcntHistosSig2D[4] = new FlavourHistograms<double>
       ("ips_2D" + theExtensionString, "2D Probability of impact parameter",
        50, -1.0, 1.0, false, true, true, "b", update,dir, mc) ;

  tkcntHistosSig2D[0] = new FlavourHistograms<double>
       ("ips1_2D" + theExtensionString, "2D Probability of impact parameter 1st trk",
        50, -1.0, 1.0, false, true, true, "b", update,dir, mc) ;

  tkcntHistosSig2D[1] = new FlavourHistograms<double>
       ("ips2_2D" + theExtensionString, "2D Probability of impact parameter 2nd trk",
        50, -1.0, 1.0, false, true, true, "b", update,dir, mc) ;

  tkcntHistosSig2D[2] = new FlavourHistograms<double>
       ("ips3_2D" + theExtensionString, "2D Probability of impact parameter 3rd trk",
        50, -1.0, 1.0, false, true, true, "b", update,dir, mc) ;

  tkcntHistosSig2D[3] = new FlavourHistograms<double>
       ("ips4" + theExtensionString, "2D Probability of impact parameter 4th trk",
        50, -1.0, 1.0, false, true, true, "b", update,dir, mc) ;

  if (willFinalize_) createPlotsForFinalize();
 
}
TrackProbabilityTagPlotter::~TrackProbabilityTagPlotter ( )

Definition at line 63 of file TrackProbabilityTagPlotter.cc.

References effPurFromHistos, finalized, n, tkcntHistosSig2D, and tkcntHistosSig3D.

{

  for(int n=0; n != 5; ++n) {
    delete tkcntHistosSig2D[n];
    delete tkcntHistosSig3D[n];
  }
  if (finalized) {
    for(int n=0; n != 4; ++n) delete effPurFromHistos[n];
  }
}

Member Function Documentation

void TrackProbabilityTagPlotter::analyzeTag ( const reco::BaseTagInfo tagInfo,
const int &  jetFlavour 
) [virtual]

Reimplemented from BaseTagInfoPlotter.

Definition at line 64 of file MVAJetTagPlotter.cc.

References MVAJetTagPlotter::analyzeTag(), MVAJetTagPlotter::categoryPlotters, MVAJetTagPlotter::categoryVariable, MVAJetTagPlotter::computer, reco::TaggingVariableList::get(), reco::btau::lastTaggingVariable, and GenericMVAJetTagComputer::taggingVariables().

{
        // taggingVariables() should not need EventSetup
        // computer->setEventSetup(es);

        const JetTagComputer::TagInfoHelper helper(baseTagInfos);
        const TaggingVariableList& vars = computer->taggingVariables(helper);

        categoryPlotters.front()->analyzeTag(vars, jetFlavour);
        if (categoryVariable != btau::lastTaggingVariable) {
                unsigned int cat =
                        (unsigned int)(vars.get(categoryVariable, -1) + 1);
                if (cat >= 1 && cat < categoryPlotters.size())
                        categoryPlotters[cat]->analyzeTag(vars, jetFlavour);
        }
}
void TrackProbabilityTagPlotter::createPlotsForFinalize ( ) [virtual]
void TrackProbabilityTagPlotter::epsPlot ( const std::string &  name) [virtual]

Implements BaseBTagPlotter.

Definition at line 175 of file TrackProbabilityTagPlotter.cc.

References effPurFromHistos, FlavourHistograms< T >::epsPlot(), finalized, n, tkcntHistosSig2D, and tkcntHistosSig3D.

{
  for(int n=0; n != 5; ++n) {
    tkcntHistosSig2D[n]->epsPlot(name);
    tkcntHistosSig3D[n]->epsPlot(name);
  }
  if (finalized) {
    for(int n=0; n != 4; ++n) effPurFromHistos[n]->epsPlot(name);
  }
}
void TrackProbabilityTagPlotter::finalize ( void  ) [virtual]

Implements BaseBTagPlotter.

Definition at line 113 of file TrackProbabilityTagPlotter.cc.

References bookConverter::compute(), effPurFromHistos, finalized, and n.

{
  //
  // final processing:
  // produce the misid. vs. eff histograms
  //
  for(int n=0; n != 4; ++n) effPurFromHistos[n]->compute();
  finalized = true;
}
void TrackProbabilityTagPlotter::psPlot ( const std::string &  name) [virtual]

Implements BaseBTagPlotter.

Definition at line 123 of file TrackProbabilityTagPlotter.cc.

References MultipleCompare::canvas, EffPurFromHistos::discriminatorCutEfficScan(), EffPurFromHistos::discriminatorNoCutEffic(), effPurFromHistos, finalized, n, FlavourHistograms< T >::plot(), EffPurFromHistos::plot(), plotscripts::setTDRStyle(), BaseBTagPlotter::theExtensionString, tkcntHistosSig2D, and tkcntHistosSig3D.

{
  const std::string cName("TrackProbabilityPlots"+ theExtensionString);
  setTDRStyle()->cd();
  TCanvas canvas(cName.c_str(), cName.c_str(), 600, 900);
  canvas.UseCurrentStyle();
  canvas.Divide(2,3);
  canvas.Print((name + cName + ".ps[").c_str());
  canvas.cd(1);

  tkcntHistosSig3D[4]->plot();
  for(int n=0; n != 4; ++n) {
    canvas.cd(2+n);
    tkcntHistosSig3D[n]->plot();
  }

  canvas.Print((name + cName + ".ps").c_str());
  canvas.Clear();
  canvas.Divide(2,3);

  canvas.cd(1);
  tkcntHistosSig2D[4]->plot();
  for(int n=0; n != 4; ++n) {
    canvas.cd(2+n);
    tkcntHistosSig2D[n]->plot();
  }

  if (finalized) {
    for(int n=0; n != 2; ++n) {
      canvas.Print((name + cName + ".ps").c_str());
      canvas.Clear();
      canvas.Divide(2,3);
      canvas.cd(1);
      effPurFromHistos[0+n]->discriminatorNoCutEffic()->plot();
      canvas.cd(2);
      effPurFromHistos[0+n]->discriminatorCutEfficScan()->plot();
      canvas.cd(3);
      effPurFromHistos[0+n]->plot();
      canvas.cd(4);
      effPurFromHistos[1+n]->discriminatorNoCutEffic()->plot();
      canvas.cd(5);
      effPurFromHistos[1+n]->discriminatorCutEfficScan()->plot();
      canvas.cd(6);
      effPurFromHistos[1+n]->plot();
    }
  }

  canvas.Print((name + cName + ".ps").c_str());
  canvas.Print((name + cName + ".ps]").c_str());
}

Member Data Documentation

Definition at line 35 of file TrackProbabilityTagPlotter.h.

Referenced by createPlotsForFinalize().

Definition at line 40 of file TrackProbabilityTagPlotter.h.

Referenced by createPlotsForFinalize().

Definition at line 33 of file TrackProbabilityTagPlotter.h.

Referenced by createPlotsForFinalize().

Definition at line 34 of file TrackProbabilityTagPlotter.h.

Referenced by createPlotsForFinalize().

Definition at line 40 of file TrackProbabilityTagPlotter.h.

Referenced by TrackProbabilityTagPlotter().