14   <input>../TreeFitted_B0ToJPsiKs.root</input> 
   15   <contact>Yo Sato; yosato@post.kek.jp</contact> 
   16   <interval>nightly</interval> 
   26 ROOT.gROOT.ProcessLine(
".include " + sysconfig.get_path(
"include"))  
 
   28 workingFiles = glob.glob(str(
"../TreeFitted_B0ToJPsiKs.root"))
 
   30 chain = ROOT.TChain(str(
"B0TreeFit"))
 
   31 for iFile 
in workingFiles:
 
   34 outputFile = ROOT.TFile(
"test7_TreeFitterOutput.root", 
"RECREATE")
 
   40 B0_E_pull_s = ROOT.TH1F(
"B0_E_pull_s", 
'Pull of the B^{0} energy sig', nBins, -RangePull, RangePull)
 
   41 B0_p_pull_s = ROOT.TH1F(
"B0_p_pull_s", 
'Pull of the B^{0} momentum sig', nBins, -RangePull, RangePull)
 
   43 B0_vertex_pullx_s = ROOT.TH1F(
"B0_vertex_pullx_s", 
'Pull of The B^{0} x vertex position sig', nBins, -RangePull, RangePull)
 
   44 B0_vertex_pully_s = ROOT.TH1F(
"B0_vertex_pully_s", 
'Pull of The B^{0} y vertex position sig', nBins, -RangePull, RangePull)
 
   45 B0_vertex_pullz_s = ROOT.TH1F(
"B0_vertex_pullz_s", 
'Pull of The B^{0} z vertex position sig', nBins, -RangePull, RangePull)
 
   47 B0_vertex_resolutionx_s = ROOT.TH1F(
"B0_vertex_resolutionx_s",
 
   48                                     'meas - mc of the B^{0} x vertex sig', nBins, -RangeMicrons, RangeMicrons)
 
   49 B0_vertex_resolutiony_s = ROOT.TH1F(
"B0_vertex_resolutiony_s",
 
   50                                     'meas - mc of the B^{0} y vertex sig', nBins, -RangeMicrons, RangeMicrons)
 
   51 B0_vertex_resolutionz_s = ROOT.TH1F(
"B0_vertex_resolutionz_s",
 
   52                                     'meas - mc of the B^{0} z vertex sig', nBins, -RangeMicrons, RangeMicrons)
 
   53 pVal_s = ROOT.TH1F(
"pVal_s", 
'global pValue sig', nBins, -1, 1)
 
   54 pVal_b = ROOT.TH1F(
"pVal_b", 
'global pValue bkg', nBins, -1, 1)
 
   56 signalCut = ROOT.TCut(
"(isSignal>0)")
 
   57 bkgCut = ROOT.TCut(
"(isSignal<1)")
 
   59 histOperationStrings = [
 
   60     "(E - mcE) / E_uncertainty>>B0_E_pull_s",
 
   61     "(p - mcP) / pErr>>B0_p_pull_s",
 
   62     "(x - mcDecayVertexX) / x_uncertainty>>B0_vertex_pullx_s",
 
   63     "(y - mcDecayVertexY) / y_uncertainty>>B0_vertex_pully_s",
 
   64     "(z - mcDecayVertexZ) / z_uncertainty>>B0_vertex_pullz_s",
 
   65     "(x - mcDecayVertexX)*10000>>B0_vertex_resolutionx_s",
 
   66     "(y - mcDecayVertexY)*10000>>B0_vertex_resolutiony_s",
 
   67     "(z - mcDecayVertexZ)*10000>>B0_vertex_resolutionz_s",
 
   72 drawToNewHist = chain.Draw
 
   73 for histOperation 
in histOperationStrings:
 
   74     if "_s" in histOperation:
 
   75         drawToNewHist(histOperation, signalCut)
 
   77         drawToNewHist(histOperation, bkgCut)
 
   80     B0_E_pull_s: 
"B^{0} E pull",
 
   81     B0_p_pull_s: 
"B^{0} momentum pull",
 
   82     B0_vertex_pullx_s: 
"pull of B^{0} vertex X ",
 
   83     B0_vertex_pully_s: 
"pull of B^{0} vertex Y ",
 
   84     B0_vertex_pullz_s: 
"pull of B^{0} vertex Z ",
 
   85     B0_vertex_resolutionx_s: 
"meas-mc of B^{0} vertex X [#mum]",
 
   86     B0_vertex_resolutiony_s: 
"meas-mc of B^{0} vertex Y [#mum]",
 
   87     B0_vertex_resolutionz_s: 
"meas-mc of B^{0} vertex Z [#mum]",
 
   92 checkForGausian = 
"This should be a Gaussian on flat bkg and not changing." 
   93 metaOptions = 
"pvalue-warn=0.1" 
   94 for hist, xlabel 
in histsAndLabels.items():
 
   95     hist.GetXaxis().SetTitle(xlabel)
 
   96     hist.GetListOfFunctions().Add(ROOT.TNamed(
"Contact", 
"yosato@post.kek.jp"))
 
   97     hist.GetListOfFunctions().Add(ROOT.TNamed(
"Description", xlabel))
 
   98     hist.GetListOfFunctions().Add(ROOT.TNamed(
"MetaOptions", metaOptions))
 
   99     if any(string 
in xlabel 
for string 
in [
"pull", 
"meas-mc"]):
 
  100         hist.GetListOfFunctions().Add(ROOT.TNamed(
"Check", checkForGausian))