Functions | Variables
make_mec_shifts_plots Namespace Reference

Functions

def GetMaximum (hist)
 
def PrepHist (hist, scale, ytitle, line_style, color)
 

Variables

int line_width = 4
 
float top_margin = 0.08
 
float bottom_margin = 0.12
 
float left_margin = 0.15
 
float right_margin = 0.05
 
string default_outdir = "./plots/mec_shifts/"
 Parse Options. More...
 
 parser = OptionParser()
 
 dest
 
 default
 
 None
 
 help
 
 action
 
 False
 
 opts
 
 args
 
string indir = "/pnfs/nova/persistent/users/mislivec/xsec_tuning_paper/"
 
 hists_file_name_data = os.path.join( indir, "hists_2018_%s_data_full.root" % opts.beam )
 
 hists_file_name_mc = os.path.join( indir, "hists_2018_%s_mc_full.root" % opts.beam )
 
 hists_file_data = TFile( hists_file_name_data )
 
 hists_file_mc = TFile( hists_file_name_mc )
 
 tree_pot_data = hists_file_data.Get( "pot" )
 
float pot_data = 0.0
 
 tree_pot_mc = hists_file_mc.Get( "pot" )
 
float pot_mc = 0.0
 
 mc_pot_scale = pot_data/pot_mc
 
int event_scale_power = 4
 
float event_scale = 1.0
 
string text_events = "10^{%d} Events"
 
string isRHC = "RHC"
 
 plots_dir = opts.outdir
 
float label_text_size = 0.04
 
int text_font = 42
 
float text_angle = 0.0
 
bool setNDC = True
 
float ypos_top = 1.0
 
string text_beam = "Neutrino Beam"
 
 label_beam = root_style.GetLabel( text_beam, left_margin + label_text_size, ypos_top, label_text_size, kBlack, text_font, 13, text_angle, setNDC )
 
string text_nova = "NOvA"
 
string text_minerva = "MINERvA"
 
 label_prelim = root_style.GetLabel( text_nova + " Preliminary", 1.0 - right_margin, 1.0 - top_margin + 0.02, 0.06, kBlue, text_font, 31, text_angle, setNDC )
 
 hist_data = hists_file_data.Get( "%s_Data" % var )
 
 hist_cv_mec = hists_file_mc.Get( "%s_MEC" % var )
 
 hist_cv_tot_mc = hists_file_mc.Get( "%s_TotMC" % var )
 
 hist_cv_non_mec = hist_cv_tot_mc.Clone( "%s_NonMEC" % var )
 
 hist_neg_shift_tot_mc = hists_file_mc.Get( "%s_MECShapeDown_TotMC" % var )
 
 hist_pos_shift_tot_mc = hists_file_mc.Get( "%s_MECShapeUp_TotMC" % var )
 
 hist_minerva_tot_mc = hists_file_mc.Get( "%s_MEC_MINERvA" % var )
 
 mc_scale = event_scale*mc_pot_scale
 
 legend = root_style.GetLegend()
 
 xmax = hist_data.GetXaxis().GetXmax()
 
float xmin = 0.0
 
 xndiv = hist_data.GetXaxis().GetNdivisions()
 
float ymax_scale = 1.5
 
 ymax = GetMaximum( hist_data )
 
string canvas_name = "Canvas_"
 
 canvas = TCanvas( canvas_name, canvas_name, 300, 300 )
 
 hist_data_ratio = hist_data.Clone( "%s_Data_Ratio" % var )
 
 hist_pos_shift_tot_mc_ratio = hist_pos_shift_tot_mc.Clone( "%s_ShiftsQELike_TotMC_Ratio" % var )
 
 hist_neg_shift_tot_mc_ratio = hist_neg_shift_tot_mc.Clone( "%s_ShiftsRESLike_TotMC_Ratio" % var )
 
 hist_cv_tot_mc_ratio = hist_cv_tot_mc.Clone( "%s_TotMC_Ratio" % var )
 
 hist_minerva_tot_mc_ratio = hist_minerva_tot_mc.Clone( "%s_TotMC_MINERvA_Ratio" % var )
 
float lower_fraction = 0.35
 
float upper_fraction = 1.0
 
float title_size = 0.05
 
float label_size = 0.035
 
 pad_upper = canvas.GetPad( 1 )
 
 pad_lower = canvas.GetPad( 2 )
 
string plot_name = "%s_%s_MEC_Systs"
 

Function Documentation

def make_mec_shifts_plots.GetMaximum (   hist)
def make_mec_shifts_plots.PrepHist (   hist,
  scale,
  ytitle,
  line_style,
  color 
)

Definition at line 24 of file make_mec_shifts_plots.py.

References SetTitle().

24 def PrepHist( hist, scale, ytitle, line_style, color ) :
25 
26  root_style.ApplyAxisStyleAll( hist )
27  hist.Scale( scale )
28  hist.GetYaxis().SetTitle( ytitle )
29  hist.SetLineWidth( line_width )
30  hist.SetLineStyle( line_style )
31  hist.SetLineColor( color )
32  hist.SetMarkerColor( color )
33 
def PrepHist(hist, scale, ytitle, line_style, color)
gargamelle SetTitle("Gargamelle #nu_{e} CC data")

Variable Documentation

make_mec_shifts_plots.action

Definition at line 46 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.args

Definition at line 51 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.bottom_margin = 0.12

Definition at line 15 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.canvas = TCanvas( canvas_name, canvas_name, 300, 300 )
string make_mec_shifts_plots.canvas_name = "Canvas_"

Definition at line 195 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.default

Definition at line 44 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.default_outdir = "./plots/mec_shifts/"

Parse Options.

Definition at line 41 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.dest

Definition at line 44 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.event_scale = 1.0

Definition at line 88 of file make_mec_shifts_plots.py.

int make_mec_shifts_plots.event_scale_power = 4

Definition at line 87 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.False

Definition at line 46 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.help

Definition at line 44 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hist_cv_mec = hists_file_mc.Get( "%s_MEC" % var )

Definition at line 125 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hist_cv_non_mec = hist_cv_tot_mc.Clone( "%s_NonMEC" % var )

Definition at line 127 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hist_cv_tot_mc = hists_file_mc.Get( "%s_TotMC" % var )

Definition at line 126 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hist_cv_tot_mc_ratio = hist_cv_tot_mc.Clone( "%s_TotMC_Ratio" % var )

Definition at line 211 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hist_data = hists_file_data.Get( "%s_Data" % var )

Definition at line 123 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hist_data_ratio = hist_data.Clone( "%s_Data_Ratio" % var )

Definition at line 208 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hist_minerva_tot_mc = hists_file_mc.Get( "%s_MEC_MINERvA" % var )

Definition at line 132 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hist_minerva_tot_mc_ratio = hist_minerva_tot_mc.Clone( "%s_TotMC_MINERvA_Ratio" % var )

Definition at line 212 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hist_neg_shift_tot_mc = hists_file_mc.Get( "%s_MECShapeDown_TotMC" % var )

Definition at line 130 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hist_neg_shift_tot_mc_ratio = hist_neg_shift_tot_mc.Clone( "%s_ShiftsRESLike_TotMC_Ratio" % var )

Definition at line 210 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hist_pos_shift_tot_mc = hists_file_mc.Get( "%s_MECShapeUp_TotMC" % var )

Definition at line 131 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hist_pos_shift_tot_mc_ratio = hist_pos_shift_tot_mc.Clone( "%s_ShiftsQELike_TotMC_Ratio" % var )

Definition at line 209 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hists_file_data = TFile( hists_file_name_data )

Definition at line 66 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hists_file_mc = TFile( hists_file_name_mc )

Definition at line 67 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hists_file_name_data = os.path.join( indir, "hists_2018_%s_data_full.root" % opts.beam )

Definition at line 59 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.hists_file_name_mc = os.path.join( indir, "hists_2018_%s_mc_full.root" % opts.beam )

Definition at line 60 of file make_mec_shifts_plots.py.

string make_mec_shifts_plots.indir = "/pnfs/nova/persistent/users/mislivec/xsec_tuning_paper/"

Definition at line 57 of file make_mec_shifts_plots.py.

Referenced by ConsolidateSystMaker().

string make_mec_shifts_plots.isRHC = "RHC"

Definition at line 100 of file make_mec_shifts_plots.py.

Referenced by fnex::NuMuAnalysisSetup.Analysis2018Energy(), comi::NearlineAna.analyze(), Beam(), caf::Proxy< caf::SRNeutrino >.CheckEquals(), caf::Proxy< caf::SRSpill >.CheckEquals(), datamc_ND_numu_kinematics_FHC_pTBins(), datamc_ND_numu_kinematics_FHC_REW_pTBins(), datamc_ND_numu_kinematics_RHC_pTBins(), datamc_ND_numu_kinematics_RHC_REW_pTBins(), FillGraphs(), fnex::NuMuAnalysisSetup.FillRecoVars(), GetExtrapolationDefs(), ana.GetJointFitSystematicList(), GetJointFitSystematicList(), ana::SpectrumLoaderBase.GetNextFile(), remid::RecoMuon.Init(), ana.initNumuHadE2018Var(), ana.initNumuHadE2020Var(), ana.initNumuMuE2018Var(), ana.initNumuMuE2020Var(), make_fc_mass_and_oct_nersc_2018(), make_fc_mass_and_oct_nersc_2019(), make_fc_mh_nersc_2018(), make_fc_mh_nersc_2019(), make_fc_oct_nersc_2018(), make_fc_oct_nersc_2019(), make_fc_surfaces_2020(), make_fc_surfaces_2020_validation(), make_fc_surfaces_nersc_2018(), make_fc_surfaces_nersc_2018_stats(), make_fc_surfaces_nersc_2019(), make_nueFDprediction_kinematics_FHC_pTExtrap(), make_nueFDprediction_kinematics_FHC_REW_pTExtrap(), make_nueFDprediction_kinematics_RHC_pTExtrap(), make_nueFDprediction_kinematics_RHC_REW_pTExtrap(), make_predictions_systs(), mec_tuning(), mec_tuning_fitter_2020(), mec_tuning_preds_2020(), ND_DataMC(), caf::Proxy< caf::SRNeutrino >.operator=(), caf::Proxy< caf::SRSpill >.operator=(), NumuEnergyFunc.predict_prod4_nd_had_energy_p(), NumuEnergyFunc.predict_prod5_nd_had_energy_p(), util::RewriteSpillData.produce(), cosrej::CosRej.produce(), ndreco::NDReco.produce(), resolution2018(), SliceLID::FillSliceLID.selectModel(), LSTME::FillLSTME.selectModel(), ana.TAHadEND(), and fnex::NuMuAnalysisSetup.ThirdAnalysisEnergy().

make_mec_shifts_plots.label_beam = root_style.GetLabel( text_beam, left_margin + label_text_size, ypos_top, label_text_size, kBlack, text_font, 13, text_angle, setNDC )

Definition at line 114 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.label_prelim = root_style.GetLabel( text_nova + " Preliminary", 1.0 - right_margin, 1.0 - top_margin + 0.02, 0.06, kBlue, text_font, 31, text_angle, setNDC )

Definition at line 119 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.label_size = 0.035

Definition at line 248 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.label_text_size = 0.04

Definition at line 105 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.left_margin = 0.15

Definition at line 16 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.legend = root_style.GetLegend()
int make_mec_shifts_plots.line_width = 4

Definition at line 13 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.lower_fraction = 0.35

Definition at line 244 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.mc_pot_scale = pot_data/pot_mc

Definition at line 81 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.mc_scale = event_scale*mc_pot_scale

Definition at line 137 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.None

Definition at line 44 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.opts

Definition at line 51 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.pad_lower = canvas.GetPad( 2 )

Definition at line 264 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.pad_upper = canvas.GetPad( 1 )

Definition at line 250 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.parser = OptionParser()

Definition at line 43 of file make_mec_shifts_plots.py.

string make_mec_shifts_plots.plot_name = "%s_%s_MEC_Systs"
make_mec_shifts_plots.plots_dir = opts.outdir

Definition at line 102 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.pot_data = 0.0

Definition at line 70 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.pot_mc = 0.0

Definition at line 76 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.right_margin = 0.05

Definition at line 17 of file make_mec_shifts_plots.py.

bool make_mec_shifts_plots.setNDC = True

Definition at line 108 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.text_angle = 0.0

Definition at line 107 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.text_beam = "Neutrino Beam"

Definition at line 112 of file make_mec_shifts_plots.py.

string make_mec_shifts_plots.text_events = "10^{%d} Events"

Definition at line 89 of file make_mec_shifts_plots.py.

int make_mec_shifts_plots.text_font = 42

Definition at line 106 of file make_mec_shifts_plots.py.

string make_mec_shifts_plots.text_minerva = "MINERvA"

Definition at line 117 of file make_mec_shifts_plots.py.

string make_mec_shifts_plots.text_nova = "NOvA"

Definition at line 116 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.title_size = 0.05
float make_mec_shifts_plots.top_margin = 0.08

Definition at line 14 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.tree_pot_data = hists_file_data.Get( "pot" )

Definition at line 69 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.tree_pot_mc = hists_file_mc.Get( "pot" )

Definition at line 75 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.upper_fraction = 1.0

Definition at line 245 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.xmax = hist_data.GetXaxis().GetXmax()

Definition at line 163 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.xmin = 0.0

Definition at line 164 of file make_mec_shifts_plots.py.

Referenced by genie::Spline.Add(), showere::ShowerEnergyAna.analyze(), evd::TZProjPad.AutoZoom(), evd::TZProjPad.AutoZoomBox(), evd::TZProjPad.AutoZoomSlice(), evd::TZProjPad.AutoZoomTruth(), ana::BayesianSurface.BayesianSurface(), genie::BLI2DNonUnifGrid.BLI2DNonUnifGrid(), genie::BLI2DUnifGrid.BLI2DUnifGrid(), ana::BayesianSurface.BuildHist(), genie::Spline.BuildSpline(), CalcFiberLoopCorr(), genie::SKKinematicsGenerator.CalculateKin_AtharSingleKaon(), genie::COHKinematicsGenerator.CalculateKin_ReinSehgal(), genie::DFRKinematicsGenerator.ComputeMaxXSec(), genie::DISKinematicsGenerator.ComputeMaxXSec(), genie::SKKinematicsGenerator.ComputeMaxXSec(), genie::DMDISKinematicsGenerator.ComputeMaxXSec(), trk::KalmanTrackAna.Containment(), demo_CPT(), genie::utils::kinematics.DISImportanceSamplingEnvelope(), genie::Spline.Divide(), Draw1DProfile(), draw_background(), DrawFrame(), DrawMedianAndUniverses(), DrawSliceCanvas(), ana::CovMxSurface.DrawSurfacePoint(), DrawSurfacePoint(), ana.ExpandedHistogram(), ana.ExtendGraphToTop(), showere::ShowerEnergyFilterMC.filter(), FindSignPoint(), ana.FindValley(), calib::AttenFit.FitQuality(), calib::AttenuationFit.FitQuality(), evd::XZYZProjectionsView.FixAspectRatio(), genie::Spline.GetAsTGraph(), evd::SliceNavigator.GetBox(), GoodDataSelDate(), GoodDataSelDuration(), GoodDataSelEmptySpillFrac(), GoodDataSelGoodDB(), GoodDataSelLiveTime(), GoodDataSelMipRate(), GoodDataSelNumSlices(), GoodDataSelRuns(), GoodDataSelTimingPeakEnd(), GoodDataSelTimingPeakStart(), GoodDataSelTrkFrac(), genie::BLI2DUnifGrid.Init(), genie::BLI2DNonUnifGrid.Init(), remid::ReMIdValidate.IsContained(), remid::RecoMuon.IsTrackContained(), jointsensitivity(), ana.LogLikelihood(), main(), ana.MakeHistCanvasReady_Quant(), MakeLegend(), genie::Spline.Multiply(), ReadBDTG.NormVariable(), ReadBDTA.NormVariable(), PID2DAxis(), PlotEfficiency(), plotTrainTest(), genie::Spline.Print(), PrintPlot(), numusand::FillSandbox.produce(), resolutionplotter(), resolutionplotterbias(), sensitivity2020(), evd::TZProjPad.ShowFull(), evd::TZProjPad.ShowPartial(), SliceLegend(), ana::SurfaceKrige.SurfaceKrige(), test_mc_rejection_method_lin(), test_mc_rejection_method_log(), TrimGraph(), and genie::BLI2DGrid.ZMax().

int make_mec_shifts_plots.xndiv = hist_data.GetXaxis().GetNdivisions()

Definition at line 165 of file make_mec_shifts_plots.py.

make_mec_shifts_plots.ymax = GetMaximum( hist_data )

Definition at line 186 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.ymax_scale = 1.5

Definition at line 166 of file make_mec_shifts_plots.py.

float make_mec_shifts_plots.ypos_top = 1.0

Definition at line 110 of file make_mec_shifts_plots.py.