Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/zmumu/SUSY/SF2015/fitMuonID.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@
#Choose Numerator/Denominator
#_*_*_*_*_*_*_*_*_*_*_*_*_*_*

ID_BINS = []

#_*_
#IDs
Expand Down Expand Up @@ -547,7 +548,6 @@
#Produce the efficiency .root files
#_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*

ID_BINS = []

for ID, ALLBINS in ID_BINS:
X = ALLBINS[0]
Expand Down
29 changes: 7 additions & 22 deletions test/zmumu/SUSY/SF2015/make_ratioplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def getplotpath(_file, _path, _tptree):
for file in dir:
if file == 'Plots': continue
if not file == _file: continue
print "The file is", file
#print "The file is", file
f = r.TFile.Open(_path+file)
r.gDirectory.cd(_tptree)
for key in r.gDirectory.GetListOfKeys():
Expand All @@ -21,20 +21,15 @@ def getplotpath(_file, _path, _tptree):
r.gDirectory.cd('fit_eff_plots')
PLOTS = r.gDirectory.GetListOfKeys()
PAR = getparameter(_file)
#print "PAR is", PAR
for plot in PLOTS:
print 'plot is', plot.GetName()
for par in PAR:
if plot.GetName().startswith(par):
print '============\n'
print 'name checked'
print '============\n'

_canvas = _tptree + '/' + key.GetName() + '/fit_eff_plots' +'/' + plot.GetName()
CANVAS.append(_canvas)
#print "_canvas is", _canvas
#print '\nEnd getplotpath'
#print '=================\n'
return CANVAS

def getparameter(_file):
Expand All @@ -47,9 +42,9 @@ def getparameter(_file):
elif _file.find('pt_highabseta') != -1:_par.append('pt_PLOT')
elif _file.find('_vtx') != -1: _par.append('tag_nVertices_PLOT')
elif _file.find('_phi') != -1: _par.append('phi_PLOT')
elif _file.find('activity') != -1: _par.append('pfCombAbsActivitydBCorr_PLOT')
elif _file.find('activity') != -1: _par.append('pfCombRelActivitydBCorr_PLOT')
else:
#print "@ERROR: parameter not found !"
print "@ERROR: parameter not found !"
sys.exit()
return _par

Expand Down Expand Up @@ -108,32 +103,22 @@ def getparameter(_file):
_output += '/' + scenario1 + bspace1 + run1 + order1 + '_' + scenario2 + bspace2 + run2 + order2 +'/'
if not os.path.exists(_output):
os.makedirs(_output)
##print '_output is ', _output
if not os.path.exists(_output):
os.makedirs(_output)

##print 'path1 is', _path1
##print 'path2 is', _path2
_tptree = 'tpTree'

##!! Get the list of files
dir = os.listdir(_path1)
for file in dir:
##print 'the file is ', file
if file.find("activity") != -1:
print '=============================='
print 'ACIVITY !!!'
print '=============================='
if debug: print 'the file is ', file
if file.find('TnP_MuonID') != -1:
if not os.path.isfile(_path2 + '/' + file):
sys.exit()
if debug: print 'The file ', file, 'doesn\'t exist in ', _path2
continue
#if debug: #print 'The file ', file, 'doesn\'t exist in ', _path2
else:
#if debug: #print 'The file', file, 'exists !'
if debug: print 'The file', file, 'exists !'
CANVAS = getplotpath( file, _path1, _tptree)
#print "hello"
#print "CANVAS is", CANVAS
if debug: print "CANVAS is", CANVAS
for _canvas in CANVAS:
#print 'will retrieve the canvas ', _canvas
r.make_ratioplots(file, _canvas, _path1, _path2, _output, comparison)
2 changes: 1 addition & 1 deletion test/zmumu/SUSY/SF2015/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
cd /afs/cern.ch/work/g/gaperrin/private/TnP/TnP_v3/CMSSW_7_4_10/src/MuonAnalysis/TagAndProbe/test/zmumu/SUSY/SF2015/
cd /afs/cern.ch/work/g/gaperrin/private/TnPTutorial/TnPSUSY_v1/CMSSW_7_4_10/src/MuonAnalysis/TagAndProbe/test/zmumu/SUSY/SF2015/

eval `scramv1 runtime -sh`
cmsRun fitMuonID.py $1 $2 $3 $4 $5