Skip to content
Snippets Groups Projects
Commit 5274024d authored by Roger Felipe Naranjo Garcia's avatar Roger Felipe Naranjo Garcia
Browse files

ajusting folder structure and scripts

parent 8187a196
No related branches found
No related tags found
No related merge requests found
......@@ -36,8 +36,7 @@ atlas_add_component (egammmaValidation
xAODEgamma xAODTracking TrkValHistUtils AsgAnalysisInterfaces)
# Install JO/python files from the package:
atlas_install_python_modules( python/*.py )
atlas_install_joboptions( share/*.py )
# ART shell executable scripts :
atlas_install_scripts( test/*.sh)
atlas_install_scripts( test/*.sh scripts/*py )
#!/usr/bin/env python
#
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration.
#
import sys
import os
#Import the ROOT libraries
from ROOT import gDirectory, gROOT, gStyle, kTRUE, TCanvas, TFile, TFileIter, TH1, TH1D, TLegend, TPad
def GetKeyNames(f0, dir = ""):
f0.cd(dir)
return [key.GetName() for key in gDirectory.GetListOfKeys()]
if __name__ == '__main__':
f1 = TFile(sys.argv[1])
f2 = TFile(sys.argv[2])
particleType = sys.argv[3]
fO = TFile("BN_ComparisonPlots_"+particleType+".hist.root", "RECREATE")
gROOT.SetBatch(kTRUE)
for folder in GetKeyNames(f1):
for histo in GetKeyNames(f1,folder):
c1 = TCanvas()
mainPad = TPad("mainPad", "top", 0.00, 0.254758, 1.00, 1.00)
mainPad.SetLeftMargin(0.12)
mainPad.SetRightMargin(0.04)
mainPad.SetTopMargin(0.02)
mainPad.SetBottomMargin(0.02)
mainPad.SetTicky(0)
mainPad.SetTickx(0)
mainPad.Draw()
c1.Update()
ratioPad = TPad("ratioPad","bottom", 0.00, 0.00, 1.00, 0.25)
ratioPad.SetLeftMargin(0.12)
ratioPad.SetRightMargin(0.04)
ratioPad.SetTopMargin(0.03)
ratioPad.SetTickx(0)
ratioPad.SetBottomMargin(0.36)
ratioPad.Draw()
c1.Update()
h_Base = f1.Get(folder+'/'+histo)
h_Base.SetMarkerStyle(3)
h_Base.SetMarkerSize(2)
h_Base.SetMarkerColor(2)
h_Base.GetXaxis().SetLabelOffset(1.20)
h_Night = f2.Get(folder+'/'+histo)
h_Night.SetLineColor(4)
mainPad.cd()
h_Base.Draw("hist p")
h_Night.Draw("same")
c1.Update()
leg = TLegend(0.330986, 0.884087, 0.879499, 0.97053)
leg.SetHeader(folder+'_'+histo, "C")
leg.SetNColumns(2)
leg.SetFillStyle(0)
leg.SetBorderSize(0)
leg.AddEntry(h_Base , "Baseline", "p")
leg.AddEntry(h_Night, "Nightly" , "l")
leg.Draw()
c1.Update()
ratioPad.cd()
h1clone = h_Night.Clone()
h1clone.Sumw2()
h1clone.SetStats(0)
h1clone.Divide(h_Base)
h1clone.SetMarkerColor(1)
h1clone.SetMarkerStyle(20)
h1clone.GetXaxis().SetLabelSize(0.10)
h1clone.GetXaxis().SetTitleSize(0.13)
h1clone.GetYaxis().SetLabelSize(0.09)
h1clone.GetYaxis().SetRangeUser(0.75, 1.25)
h1clone.GetYaxis().SetTitle("Ratio")
h1clone.GetYaxis().CenterTitle(1)
h1clone.GetYaxis().SetTitleSize(0.09)
h1clone.GetYaxis().SetTitleOffset(0.3)
h1clone.GetYaxis().SetNdivisions(505)
h1clone.Draw("p")
c1.Update()
c1.SaveAs(folder+'_'+histo+".pdf" )
c1.SaveAs(folder+'_'+histo+".png" )
fO.cd()
c1.Write(folder+'_'+histo)
fO.Write()
fO.Close()
......@@ -35,7 +35,6 @@ athena -c "particleType='electron'" egamma_art_checker_joboptions.py
echo "art-result: $? athena_job"
get_files -jo plotsMaker.py
python plotsMaker.py /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/egammaValidation/Baseline_Files/rootFiles/Baseline-monitoring_electron.hist.root Nightly-monitoring_electron.hist.root electron
plotsMaker.py /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/egammaValidation/Baseline_Files/rootFiles/Baseline-monitoring_electron.hist.root Nightly-monitoring_electron.hist.root electron
echo "art-result: $? final_comparison"
......@@ -35,7 +35,6 @@ athena -c "particleType='gamma'" egamma_art_checker_joboptions.py
echo "art-result: $? athena_job"
get_files -jo plotsMaker.py
python plotsMaker.py /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/egammaValidation/Baseline_Files/rootFiles/Baseline-monitoring_gamma.hist.root Nightly-monitoring_gamma.hist.root gamma
plotsMaker.py /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/egammaValidation/Baseline_Files/rootFiles/Baseline-monitoring_gamma.hist.root Nightly-monitoring_gamma.hist.root gamma
echo "art-result: $? final_comparison"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment