Functions | Variables
plotROC Namespace Reference

Functions

def getEfficiencies (t, classifierExpression, cut)
 

Variables

int nBins = 500
 
float binLo = 0.0
 
float binHi = 1.0
 
float fontSize = 0.05
 
 parser = argparse.ArgumentParser(prog=prog, description='Make dataset definitions page')
 
 help
 
 type
 
 args = parser.parse_args()
 
dictionary mainDefaults = {}
 
 cfg = SafeConfigParser(mainDefaults)
 
 classifierExpression = cfg.get("main","classifierExpression")
 
 title = cfg.get("main","title")
 
 trueSignalCut = cfg.get("main","trueSignalCut")
 
 instancesNames = cfg.get("main","instances").split()
 
 outFile = cfg.get("main","outFile")
 
 legendX = float(cfg.get("main","legendX"))
 
 legendY = float(cfg.get("main","legendY"))
 
 legendW = float(cfg.get("main","legendW"))
 
 legendH = float(cfg.get("main","legendH"))
 
 sgnlMin
 
 sgnlMax
 
 bkgdMin
 
 bkgdMax
 
list rocCurves = []
 
 fileName = cfg.get(instanceName,"fileName")
 
 iFile = TFile(fileName,"read")
 
 iTree = iFile.Get("t")
 
 sgnlEfficiencies = getEfficiencies(iTree,classifierExpression,trueSignalCut)
 
string trueBackgroundCut = "! (%s)"
 
 bkgdEfficiencies = getEfficiencies(iTree,classifierExpression,trueBackgroundCut)
 
 rocTitle = cfg.get(instanceName,"title")
 
 nPoints = len(bkgdEfficiencies)
 
 rocCurve = TGraph(nPoints,bkgdEfficiencies,sgnlEfficiencies)
 
 rocCan = TCanvas("rocCan","rocCan")
 
 leg = TLegend(legendX, legendY-legendH, legendX+legendW, legendY)
 
 temppoint = Double(0)
 
 cut = TCutG()
 
int lastpoint = 0
 
 tempx
 
 tempy
 
 rocIntegral = str(-1*cut.Area())
 
 newtitle = str("#splitline{"+rocTitle+"}{Integral: "+rocIntegral+"}")
 

Function Documentation

def plotROC.getEfficiencies (   t,
  classifierExpression,
  cut 
)

Definition at line 22 of file plotROC.py.

References PandAna.Demos.demo1.range.

22 def getEfficiencies(t,classifierExpression,cut):
23 
24  fullExpression="%s>>h" %classifierExpression
25  h=TH1F("h","h",nBins,binLo,binHi)
26  t.Draw(fullExpression,cut)
27 
28  totIntegral=h.Integral()
29 
30  return array('f', [h.Integral(iBin,nBins)/totIntegral for iBin in range(1,nBins)] )
31 
32 
33 prog=sys.argv[0]
def getEfficiencies(t, classifierExpression, cut)
Definition: plotROC.py:22

Variable Documentation

plotROC.args = parser.parse_args()

Definition at line 38 of file plotROC.py.

float plotROC.binHi = 1.0

Definition at line 18 of file plotROC.py.

float plotROC.binLo = 0.0

Definition at line 17 of file plotROC.py.

Definition at line 85 of file plotROC.py.

plotROC.bkgdMax

Definition at line 71 of file plotROC.py.

plotROC.bkgdMin

Definition at line 71 of file plotROC.py.

plotROC.cfg = SafeConfigParser(mainDefaults)
plotROC.classifierExpression = cfg.get("main","classifierExpression")

Definition at line 57 of file plotROC.py.

plotROC.cut = TCutG()

Definition at line 111 of file plotROC.py.

plotROC.fileName = cfg.get(instanceName,"fileName")

Definition at line 78 of file plotROC.py.

Referenced by AnalyzeNus18Systs(), fnex::BeamSyst.BeamSyst(), fnex::EventListManipulator.Cosmics2017(), cmf::EventListManipulator.Deserialize(), fnex::EventListManipulator.Deserialize(), DrawExtrapSurface(), EHadVisMECpairs(), fnex::EventListManipulator.FarDetCosmicBackgroundHistAndScale(), fnex::CAFToEventList.FillVariables(), cmf::CAFToEventList.FillVariables(), fnex::EventListManipulator.FixNearDetMCExposures(), FormatFile.FormatFile(), genie_syst_pca(), getData(), Plotter.GetMCPlots(), getPredictions(), fnex::ShifterAndWeighter.HornCurrentWeight(), remid::RecoMuon.Init(), slid::DedxDistribution.Initialize(), cmf::ShifterAndWeighter.LoadBeamSystHists2017(), fnex::ShifterAndWeighter.LoadBeamSystHists2017(), fnex::ShifterAndWeighter.LoadSABeamSystHists(), make_prediction(), make_prediction_rhc(), make_tmva_NCPi0s_2selection(), cmf::ShifterAndWeighter.NueAcceptSignalKin2018Weight(), fnex::ShifterAndWeighter.NueAcceptSignalKin2018Weight(), fnex::ShifterAndWeighter.NueExtrapSig2017Weight(), numue::NumuEAlg.NumuEAlg(), Nus18SystsBeamTranspAna(), Nus18SystsCalibAbsAna(), Nus18SystsCalibRelAna(), Nus18SystsGENIEAna(), Nus18SystsKaonAna(), Nus18SystsLightLevelAna(), Nus18SystsLLMethodAna(), Nus18SystsNeutronAna(), Nus18SystsPPFXAna(), Nus18SystsTauAna(), Nus18SystsXSecOnOffAna(), PlotNus18Sideband(), ppfx_syst_pca_fn(), fnex::ReadCAFMakeEventList.ReadCAFTree(), meta::Metadata.respondToOpenInputFile(), skim::DataProductSkimmer.respondToOpenInputFile(), saveFDMCHists(), fnex::BeamSyst.setFileAndHistNames(), cmf::BeamSyst.setFileAndHistNames(), and art::TFileService.TFileService().

float plotROC.fontSize = 0.05

Definition at line 20 of file plotROC.py.

plotROC.help

Definition at line 37 of file plotROC.py.

plotROC.iFile = TFile(fileName,"read")

Definition at line 79 of file plotROC.py.

plotROC.instancesNames = cfg.get("main","instances").split()

Definition at line 61 of file plotROC.py.

plotROC.iTree = iFile.Get("t")

Definition at line 80 of file plotROC.py.

int plotROC.lastpoint = 0

Definition at line 112 of file plotROC.py.

plotROC.leg = TLegend(legendX, legendY-legendH, legendX+legendW, legendY)

Definition at line 97 of file plotROC.py.

plotROC.legendH = float(cfg.get("main","legendH"))

Definition at line 68 of file plotROC.py.

plotROC.legendW = float(cfg.get("main","legendW"))

Definition at line 67 of file plotROC.py.

plotROC.legendX = float(cfg.get("main","legendX"))

Definition at line 65 of file plotROC.py.

Referenced by main().

plotROC.legendY = float(cfg.get("main","legendY"))

Definition at line 66 of file plotROC.py.

Referenced by main().

dictionary plotROC.mainDefaults = {}

Definition at line 40 of file plotROC.py.

int plotROC.nBins = 500
plotROC.newtitle = str("#splitline{"+rocTitle+"}{Integral: "+rocIntegral+"}")

Definition at line 122 of file plotROC.py.

Referenced by plot_with_zoom().

plotROC.nPoints = len(bkgdEfficiencies)

Definition at line 88 of file plotROC.py.

Referenced by cosrej::CosRejFxs.FScatterEstim(), and Toy_analyses().

plotROC.outFile = cfg.get("main","outFile")

Definition at line 63 of file plotROC.py.

plotROC.parser = argparse.ArgumentParser(prog=prog, description='Make dataset definitions page')

Definition at line 34 of file plotROC.py.

plotROC.rocCan = TCanvas("rocCan","rocCan")

Definition at line 93 of file plotROC.py.

plotROC.rocCurve = TGraph(nPoints,bkgdEfficiencies,sgnlEfficiencies)

Definition at line 89 of file plotROC.py.

list plotROC.rocCurves = []

Definition at line 76 of file plotROC.py.

plotROC.rocIntegral = str(-1*cut.Area())

Definition at line 120 of file plotROC.py.

plotROC.rocTitle = cfg.get(instanceName,"title")

Definition at line 87 of file plotROC.py.

Definition at line 82 of file plotROC.py.

plotROC.sgnlMax

Definition at line 70 of file plotROC.py.

plotROC.sgnlMin

Definition at line 70 of file plotROC.py.

plotROC.temppoint = Double(0)

Definition at line 106 of file plotROC.py.

plotROC.tempx

Definition at line 114 of file plotROC.py.

plotROC.tempy

Definition at line 114 of file plotROC.py.

plotROC.title = cfg.get("main","title")

Definition at line 58 of file plotROC.py.

Referenced by AnaPlotMaker(), cmf::CovarianceMatrixMaker.beginJob(), fnex::CovarianceMatrixMaker.beginJob(), hough::HoughValidate.beginJob(), BiCountCanvas(), BiprobabilityCanvas(), BiProbCanvas(), naming_schema.categoryName(), ana.ComparisonTable(), ana.ComparisonTableOne(), ana.ComparisonTableOneNbins(), naming_schema.componentName(), confusionMatrix(), confusionMatrixProng(), ana::FrequentistSurface.CreateHistograms(), NdmcClient.createMetric(), genie::NtpWriter.CreateTree(), data_over_mc_profile(), DCSPlotMaker(), DDTOnMonPlotMaker(), ana::TwoSampleDecomp.Decomp(), DrawContourCanvas(), fnex::CorrectedSpectrum.DrawCounts(), fnex::CorrectedSpectrum.DrawDataVsMC(), DrawSliceCanvas(), fnex::CorrectedSpectrum.DrawStacks(), FCContour(), calib::AttenFit.fit_channel_prof(), calib::AttenuationFit.fit_channel_prof(), genie_contours(), fnex::CorrectedSpectrum.GetOscParCanvasCopy(), NdmcClient.getSendTimeInterval(), fnex::CorrectedSpectrum.GetStacksCanvasCopy(), fnex::CorrectedSpectrum.GetSystCanvasCopy(), GoodDataSelDate(), GoodDataSelDuration(), GoodDataSelEmptySpillFrac(), GoodDataSelGoodDB(), GoodDataSelLiveTime(), GoodDataSelMipRate(), GoodDataSelNumSlices(), GoodDataSelRuns(), GoodDataSelTimingPeakEnd(), GoodDataSelTimingPeakStart(), GoodDataSelTrkFrac(), evd::HeaderDrawer.Header(), heatMap(), lem::EventSummary.IsSig(), load_libs_muonid(), stan::services::util::mcmc_writer.log_timing(), ana.LogLikelihood(), main(), fnex::ContourMaker.Make1DPlot(), cmf::PlotUtilities.Make1DPlot(), fnex::CAFContourMaker.Make2DContours(), cmf::PlotUtilities.Make2DContours(), fnex::ContourMaker.Make2DContours(), cmf::PlotUtilities.Make2DHist(), fnex::ContourMaker.Make2DHist(), cmf::PlotUtilities.Make2DSystematicHists(), fnex::ContourMaker.Make2DSystematicHists(), PageMakers.makeFrontPage(), MakeLegend(), ana.MakeNueSystematicsFile(), ana::InteractionSpectra.MakePlot(), ana::ResolutionScan.MakePlot(), cmf::StarPlot.MakeStarPlot(), fnex::StarPlot.MakeStarPlot(), ValidCalibPDF.MakeTex(), ana.MakeTH1D(), ana.MakeTH1F(), ana.MakeTH2D(), ana.MakeTH2F(), ana.MakeTH3D(), cmf::RandomUniverses.MakeUniverseHistograms(), PageMakers.makeValidationPage(), genie::flux::GAtmoFlux.MinEnergy(), NewNearlinePlots(), naming_schema.observableName(), OnMonPlotMaker(), pidPlot(), pidPlotProng(), plane_label(), plot_hists(), plot_ratios(), PlotEfficiency(), PlotEvents(), ana.PlotMultiSyst(), ana.PlotPurEff(), ana.PlotSpectra(), PlotStack(), PlotSyst(), ana.PlotSyst(), ana.PlotSystBand(), PlotSysts(), PrintEffs(), ProbabilityCanvas(), ana::FrequentistSurface.ProgressBarTitle(), om::IPC.Publish1DHistogram(), om::IPC.Publish2DHistogram(), ana::TwoSampleDecomp.RatioCalc(), om::HistoTable.ReadFile(), NdmcMetric< T >.resetValue(), SaveGraphsToRootFile(), ana::ModularExtrapComponent.SetQuiet(), NdmcMetric< T >.setTitle(), novaddt::SendTriggerSignal.startHeartbeat(), fnex::CAFContourMaker.StoreContourGraphs(), cmf::PlotUtilities.StoreContourGraphs(), fnex::ContourMaker.StoreContourGraphs(), ana.test_best_spline(), NdmcMetricTest.testSetTitle(), and stan::services::util::mcmc_writer.write_timing().

string plotROC.trueBackgroundCut = "! (%s)"

Definition at line 84 of file plotROC.py.

plotROC.trueSignalCut = cfg.get("main","trueSignalCut")

Definition at line 59 of file plotROC.py.

plotROC.type

Definition at line 37 of file plotROC.py.