ATLAS Offline Software
Functions | Variables
extractSporadic Namespace Reference

Functions

def printProperties (h, q, hLB)
 
def displayHistos (h, q, hLB, canvas)
 

Variables

string nameFile = "/castor/cern.ch/grid/atlas/tzero/prod1/perm/data10_7TeV/physics_CosmicCalo/0"+sys.argv[1]+"/data10_7TeV.00"+sys.argv[1]+".physics_CosmicCalo.merge.HIST."+sys.argv[2]+"/data10_7TeV.00"+sys.argv[1]+".physics_CosmicCalo.merge.HIST."+sys.argv[2]+"._0001.1"
 
string nameDir = "run_"+sys.argv[1]+"/CaloMonitoring/LArCellMon_NoTrigSel/Sporadic20GeV/"+sys.argv[3]
 
 myFile = TRFIOFile(nameFile)
 
 hNbEvts = myFile.Get("run_"+sys.argv[1]+"/LAr/FEBMon/perPartitionData/Eventtype")
 
list h = []
 
list q = []
 
list hLB = []
 
 listOfKeys = gDirectory.GetListOfKeys()
 
 name = key.GetName()
 
 type = key.GetClassName()
 
 nhists = len(h)
 
 nameHisto = sys.argv[4]
 
 c1 = TCanvas('c1','c1',1000,600)
 

Function Documentation

◆ displayHistos()

def extractSporadic.displayHistos (   h,
  q,
  hLB,
  canvas 
)

Definition at line 45 of file extractSporadic.py.

45 def displayHistos(h,q,hLB,canvas):
46  canvas.Divide(1,2)
47  canvas.cd(1)
48  ROOT.gPad.Divide(2,1)
49  ROOT.gPad.cd(1)
50  ROOT.gPad.SetLogy()
51  gStyle.SetOptStat(100110)
52  h.Draw()
53 
54  canvas.cd(1)
55  ROOT.gPad.cd(2)
56  q.Draw()
57 
58  canvas.cd(2)
59  hLB.SetStats(0)
60  hLB.Draw("COLZ")
61 
62  canvas.cd()
63  return
64 
65 
66 # Main =================================================================

◆ printProperties()

def extractSporadic.printProperties (   h,
  q,
  hLB 
)

Definition at line 8 of file extractSporadic.py.

8 def printProperties(h,q,hLB):
9 
10  print ("=======================Harware coordinates :",h.GetName()[0:h.GetName().find("Phi")-1])
11  print ("Coordinates : Eta = ",h.GetName()[h.GetName().find("Eta")+3:h.GetName().find("Eta")+7]," Phi = ",h.GetName()[h.GetName().find("Phi")+3:h.GetName().find("Phi")+7])
12 
13 
14  # Nb of events with E>20GeV and mean energy
15  nbEvts20GeV = 0
16  meanE = 0
17  for ix in range(61,h.GetNbinsX()+2):# Bin 61 = 20GeV
18  nbEvts20GeV = nbEvts20GeV+h.GetBinContent(ix)
19  meanE = meanE + h.GetBinContent(ix)*h.GetBinCenter(ix)
20  meanE = meanE / nbEvts20GeV/ 1000
21 
22  # Nb of events with q factor > 4000
23  nbEvts4000 = 0
24  for ix in range(11,q.GetNbinsX()+2):# Bin 11 = 4000
25  nbEvts4000 = nbEvts4000 + q.GetBinContent(ix)
26 
27  # Nb of LBs where at least one event with E>20GeV is found
28  nbLB20GeV = 0
29  allLBs = ""
30  for ix in range(1,hLB.GetNbinsX()+1):
31  lbAff = False
32  for iy in range(61,hLB.GetNbinsY()+2):# Bin 61 = 20GeV
33  if hLB.GetBinContent(ix,iy) != 0:
34  lbAff = True
35  if lbAff:
36  nbLB20GeV = nbLB20GeV+1
37  allLBs = allLBs + " %d"%ix
38 
39  print ("# of events: E>20GeV / E>20GeV && q>4000 : %d / %d"%(nbEvts4000,nbEvts20GeV))
40  print ("Mean energy above 20geV: %.2f GeV"%meanE)
41  print (nbLB20GeV," LBs contains energetic events: ", allLBs )
42  return
43 
44 # ======================================================================

Variable Documentation

◆ c1

extractSporadic.c1 = TCanvas('c1','c1',1000,600)

Definition at line 134 of file extractSporadic.py.

◆ h

extractSporadic.h = []

Definition at line 97 of file extractSporadic.py.

◆ hLB

extractSporadic.hLB = []

Definition at line 99 of file extractSporadic.py.

◆ hNbEvts

extractSporadic.hNbEvts = myFile.Get("run_"+sys.argv[1]+"/LAr/FEBMon/perPartitionData/Eventtype")

Definition at line 90 of file extractSporadic.py.

◆ listOfKeys

extractSporadic.listOfKeys = gDirectory.GetListOfKeys()

Definition at line 100 of file extractSporadic.py.

◆ myFile

extractSporadic.myFile = TRFIOFile(nameFile)

Definition at line 87 of file extractSporadic.py.

◆ name

extractSporadic.name = key.GetName()

Definition at line 102 of file extractSporadic.py.

◆ nameDir

string extractSporadic.nameDir = "run_"+sys.argv[1]+"/CaloMonitoring/LArCellMon_NoTrigSel/Sporadic20GeV/"+sys.argv[3]

Definition at line 85 of file extractSporadic.py.

◆ nameFile

string extractSporadic.nameFile = "/castor/cern.ch/grid/atlas/tzero/prod1/perm/data10_7TeV/physics_CosmicCalo/0"+sys.argv[1]+"/data10_7TeV.00"+sys.argv[1]+".physics_CosmicCalo.merge.HIST."+sys.argv[2]+"/data10_7TeV.00"+sys.argv[1]+".physics_CosmicCalo.merge.HIST."+sys.argv[2]+"._0001.1"

Definition at line 84 of file extractSporadic.py.

◆ nameHisto

extractSporadic.nameHisto = sys.argv[4]

Definition at line 120 of file extractSporadic.py.

◆ nhists

extractSporadic.nhists = len(h)

Definition at line 111 of file extractSporadic.py.

◆ q

extractSporadic.q = []

Definition at line 98 of file extractSporadic.py.

◆ type

extractSporadic.type = key.GetClassName()

Definition at line 103 of file extractSporadic.py.

find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
extractSporadic.printProperties
def printProperties(h, q, hLB)
Definition: extractSporadic.py:8
extractSporadic.displayHistos
def displayHistos(h, q, hLB, canvas)
Definition: extractSporadic.py:45