CMS 3D CMS Logo

Public Member Functions | Private Attributes

TrackCountingTagPlotter Class Reference

#include <TrackCountingTagPlotter.h>

Inheritance diagram for TrackCountingTagPlotter:
BaseTagInfoPlotter BaseBTagPlotter

List of all members.

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 11 of file TrackCountingTagPlotter.h.


Constructor & Destructor Documentation

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

Definition at line 7 of file TrackCountingTagPlotter.cc.

References createPlotsForFinalize(), dir, lowerIPSBound, BaseBTagPlotter::theExtensionString, tkcntHistosSig2D, tkcntHistosSig3D, trkNbr2D, trkNbr3D, update, upperIPSBound, and willFinalize_.

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

  trkNbr3D = new FlavourHistograms<int>
        ("selTrksNbr_3D" + theExtensionString, "Number of selected tracks for 3D IPS" + theExtensionString, 31, -0.5, 30.5,
        false, true, true, "b", update, dir, mc);

  trkNbr2D = new FlavourHistograms<int>
        ("selTrksNbr_2D" + theExtensionString, "Number of selected tracks for 2D IPS" + theExtensionString, 31, -0.5, 30.5,
        false, true, true, "b", update, dir, mc);

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

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

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

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

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

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

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

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

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

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

  if (willFinalize_) createPlotsForFinalize();

}
TrackCountingTagPlotter::~TrackCountingTagPlotter ( )

Definition at line 70 of file TrackCountingTagPlotter.cc.

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

{

  delete trkNbr3D;
  delete trkNbr2D;

  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 TrackCountingTagPlotter::analyzeTag ( const reco::BaseTagInfo baseTagInfo,
const int &  jetFlavour 
) [virtual]

Reimplemented from BaseTagInfoPlotter.

Definition at line 86 of file TrackCountingTagPlotter.cc.

References Exception, FlavourHistograms< T >::fill(), lowerIPSBound, n, reco::TrackCountingTagInfo::selectedTracks(), reco::TrackCountingTagInfo::significance(), tkcntHistosSig2D, tkcntHistosSig3D, trkNbr2D, and trkNbr3D.

{

  const reco::TrackCountingTagInfo * tagInfo = 
        dynamic_cast<const reco::TrackCountingTagInfo *>(baseTagInfo);

  if (!tagInfo) {
    throw cms::Exception("Configuration")
      << "BTagPerformanceAnalyzer: Extended TagInfo not of type TrackCountingTagInfo. " << endl;
  }

  trkNbr3D->fill(jetFlavour, tagInfo->selectedTracks(0));
  trkNbr2D->fill(jetFlavour, tagInfo->selectedTracks(1));

  for(int n=0; n != tagInfo->selectedTracks(1) && n != 4; ++n)
    tkcntHistosSig2D[n]->fill(jetFlavour, tagInfo->significance(n,1));
  for(int n=tagInfo->selectedTracks(1); n < 4; ++n)
    tkcntHistosSig2D[n]->fill(jetFlavour, lowerIPSBound-1.0);

  for(int n=0; n != tagInfo->selectedTracks(0) && n != 4; ++n)
    tkcntHistosSig3D[n]->fill(jetFlavour, tagInfo->significance(n,0));
  for(int n=tagInfo->selectedTracks(0); n < 4; ++n)
    tkcntHistosSig3D[n]->fill(jetFlavour, lowerIPSBound-1.0);

  for(int n=0; n != tagInfo->selectedTracks(1); ++n)
    tkcntHistosSig2D[4]->fill(jetFlavour, tagInfo->significance(n,1));
  for(int n=0; n != tagInfo->selectedTracks(0); ++n)
    tkcntHistosSig3D[4]->fill(jetFlavour, tagInfo->significance(n,0));
}
void TrackCountingTagPlotter::createPlotsForFinalize ( ) [virtual]
void TrackCountingTagPlotter::epsPlot ( const std::string &  name) [virtual]
void TrackCountingTagPlotter::finalize ( void  ) [virtual]

Implements BaseBTagPlotter.

Definition at line 140 of file TrackCountingTagPlotter.cc.

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

{
  for(int n=0; n != 4; ++n) effPurFromHistos[n]->compute();
  finalized = true;
}
void TrackCountingTagPlotter::psPlot ( const std::string &  name) [virtual]

Implements BaseBTagPlotter.

Definition at line 146 of file TrackCountingTagPlotter.cc.

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

{
  const std::string cName("TrackCountingPlots"+ 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);
  trkNbr3D->plot();
  canvas.cd(2);
  tkcntHistosSig3D[4]->plot();
  for(int n=0; n < 4; n++) {
    canvas.cd(3+n);
    tkcntHistosSig3D[n]->plot();
  }

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

  canvas.cd(1);
  trkNbr2D->plot();
  canvas.cd(2);
  tkcntHistosSig2D[4]->plot();
  for(int n=0; n != 4; ++n) {
    canvas.cd(3+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 34 of file TrackCountingTagPlotter.h.

Referenced by createPlotsForFinalize().

Definition at line 44 of file TrackCountingTagPlotter.h.

Referenced by epsPlot(), finalize(), psPlot(), and ~TrackCountingTagPlotter().

Definition at line 41 of file TrackCountingTagPlotter.h.

Referenced by analyzeTag(), and TrackCountingTagPlotter().

Definition at line 31 of file TrackCountingTagPlotter.h.

Referenced by createPlotsForFinalize().

Definition at line 32 of file TrackCountingTagPlotter.h.

Referenced by createPlotsForFinalize().

Definition at line 33 of file TrackCountingTagPlotter.h.

Referenced by createPlotsForFinalize().

Definition at line 41 of file TrackCountingTagPlotter.h.

Referenced by TrackCountingTagPlotter().

Definition at line 36 of file TrackCountingTagPlotter.h.

Referenced by TrackCountingTagPlotter().