ATLAS Offline Software
Functions | Variables
get_cutMap Namespace Reference

Functions

def waitNext (savename='temp', pad=gPad)
 
def showCutMap (var, effFun, sTag='test')
 
def test ()
 

Variables

 funlist
 

Function Documentation

◆ showCutMap()

def get_cutMap.showCutMap (   var,
  effFun,
  sTag = 'test' 
)

Definition at line 24 of file get_cutMap.py.

24 def showCutMap(var, effFun, sTag='test'):
25  dir0 = '/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/'
26  print dir0
27  f1 = TFile(dir0+'IsolationSelection/v2/MC15_Z_Jpsi_cutMap.root','read')
28  h1 = f1.Get('Muons/DFCommonGoodMuon/mu_cutValues_'+var)
29  h1.GetZaxis().SetRangeUser(99,99)
30  h1_xy = h1.Project3D('xy')
31  h1_xy.GetXaxis().SetTitle(h1_xy.GetXaxis().GetTitle().replace('eta','#eta'))
32 
33 # h1_xy.Draw('colz')
34 
35  h1_xy.Reset()
36  h1_eff = h1_xy.Clone(h1_xy.GetName()+'_eff')
37  fun1 = TF1('fun1', effFun, 0.0, 1000.0)
38  for ix in range(h1_xy.GetNbinsX()+2):
39  for iy in range(h1_xy.GetNbinsY()+2):
40  pt = h1_xy.GetYaxis().GetBinCenter(iy)
41  print pt,min(int(fun1.Eval(pt)),99),0.1*pt+90
42  h1_xy.SetBinContent(ix,iy,h1.GetBinContent(iy,ix, min(int(fun1.Eval(pt)), 99)))
43  h1_eff.SetBinContent(ix,iy, min(int(fun1.Eval(pt)),99))
44 
45  h1_eff.Draw('colz')
46  gPad.Update()
47  waitNext(sTag+'_eff')
48 # waitRootCmd(sTag+'_eff')
49  h1_xy.Draw('colztext')
50  lt = TLatex()
51  lt.DrawLatexNDC(0.25,0.95,var+', #epsilon='+effFun.replace('x','p_{T}')+' [%]')
52 
53  gPad.Update()
54  waitNext(sTag+'_cuts')
55 # waitRootCmd(sTag+'_cuts')
56 

◆ test()

def get_cutMap.test ( )

Definition at line 57 of file get_cutMap.py.

57 def test():
58  dir1 = './'
59 # dir1 = get_default_fig_dir()
60 
61 # showCutMap('ptvarcone30', '99', dir1+'LooseTrackOnlyIso_ptvarcone30')
62 #
63 # showCutMap('topoetcone20', '99', dir1+'LooseIso_topoetcone20')
64  showCutMap('topoetcone20', '96', dir1+'TightIso_topoetcone20')
65 #
66 # showCutMap('ptvarcone30', '96', dir1+'TightIso_ptvarcone30')
67 #
68 # showCutMap('topoetcone20', '0.1143*x+92.14', dir1+'GradientIso_topoetcone20')
69 # showCutMap('ptvarcone30', '0.1143*x+92.14', dir1+'GradientIso_ptvarcone30')
70 
71 # showCutMap('topoetcone20', '0.057*x+95.57', dir1+'GradientLooseIso_topoetcone20')
72 # showCutMap('ptvarcone30', '0.057*x+95.57', dir1+'GradientLooseIso_ptvarcone30')
73 
74 funlist.append(test)
75 

◆ waitNext()

def get_cutMap.waitNext (   savename = 'temp',
  pad = gPad 
)

Definition at line 10 of file get_cutMap.py.

10 def waitNext(savename='temp', pad=gPad):
11  while True:
12  c = raw_input('Next:')
13  if c=='q': sys.exit(0)
14  elif c=='s':
15  pad.SaveAs(savename+'.pdf')
16  pad.SaveAs(savename+'.eps')
17  pad.SaveAs(savename+'.png')
18  elif c=='n':
19  return
20  else:
21  print "'q' to quit\n's' to save\n'n' for next"
22 
23 

Variable Documentation

◆ funlist

get_cutMap.funlist

Definition at line 8 of file get_cutMap.py.

replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
get_cutMap.waitNext
def waitNext(savename='temp', pad=gPad)
Definition: get_cutMap.py:10
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
get_cutMap.test
def test()
Definition: get_cutMap.py:57
get_cutMap.showCutMap
def showCutMap(var, effFun, sTag='test')
Definition: get_cutMap.py:24