Functions | Variables
makeBrightnessMap Namespace Reference

Functions

def findClosestVal (val, quantList)
 

Variables

 parser = argparse.ArgumentParser(description='Process fiber brightness files')
 
 action
 
 args = parser.parse_args()
 
 fIn = open("FDModuleData.txt", "r")
 
string fOutName = "fdBrightness.root"
 
dictionary planeDict = {}
 
dictionary plane_moduleDict = {}
 
list brightnessLst = []
 
 grBright = ROOT.TGraph()
 
int maxModule = 0
 
int maxCell = 0
 
int maxPlane = 0
 
int maxBrightness = -9999
 
int minBrightness = 9999
 
 splitLine = line.split()
 
 plane = int(splitLine[0])
 
 cell = int(splitLine[1])
 
 brightness = float(splitLine[2])
 
int module = cell/32
 
 brightness1D = ROOT.TH1D("brightness1D", "Brightness Level;Brightness;Cells", 1200, -1, 5)
 
 brightnessValue = ROOT.TH1D("brightnessValue", "Brightness Level Bin Values;Brightness Bin Number;Values", 9, 0, 9)
 
 brightness2D = ROOT.TH2D("brightness2D", ";Plane;Cell", maxPlane+1, 0, maxPlane+1, maxCell+1, 0, maxCell+1)
 
 brightness2DX = ROOT.TH2D("brightness2DX", ";Plane;Cell", maxPlane/2+1, 0, maxPlane/2+1, maxCell+1, 0, maxCell+1)
 
 brightness2DY = ROOT.TH2D("brightness2DY", ";Plane;Cell", maxPlane/2+1, 0, maxPlane/2+1, maxCell+1, 0, maxCell+1)
 
 brightness2D_module = ROOT.TH2D("brightness2D_module", ";Plane;Module", maxPlane+1, 0, maxPlane+1, maxModule+1, 0, maxModule+1)
 
 brightness2D_bin = ROOT.TH2C("brightness2D_bin", "Brightness Level Bin Map;Plane;Cell", maxPlane+1, 0, maxPlane+1, maxCell+1, 0, maxCell+1)
 
 brightness_byplane = ROOT.TH1D("brightness_plane", ";Plane", maxPlane+1, 0, maxPlane+1);
 
 brightnessArr = np.array(brightnessLst)
 
list quantList = [10, 20, 30, 40, 50, 60, 70, 80, 90]
 
 quantVals = np.percentile(brightnessArr, quantList)
 
 position = fIn.seek(0, 0);
 
 iquantBrightness = findClosestVal(brightness/100., quantVals)
 
 quantBrightness = quantVals[iquantBrightness]
 
 count = float(plane_moduleDict[key][0])
 
int totBrightness = float(plane_moduleDict[key][1])/100
 
 fOut = ROOT.TFile(fOutName, "recreate")
 

Function Documentation

def makeBrightnessMap.findClosestVal (   val,
  quantList 
)

Definition at line 8 of file makeBrightnessMap.py.

8 def findClosestVal(val, quantList):
9  n = len( quantList )
10  i = bisect.bisect( quantList, val )
11  if i == 0:
12  return 0
13  if i == n:
14  return n-1
15  if math.fabs( val - quantList[i-1] ) < math.fabs( val - quantList[i] ):
16  return i-1
17  else:
18  return i
19 
def findClosestVal(val, quantList)

Variable Documentation

makeBrightnessMap.action

Definition at line 23 of file makeBrightnessMap.py.

makeBrightnessMap.args = parser.parse_args()

Definition at line 25 of file makeBrightnessMap.py.

makeBrightnessMap.brightness = float(splitLine[2])
makeBrightnessMap.brightness1D = ROOT.TH1D("brightness1D", "Brightness Level;Brightness;Cells", 1200, -1, 5)

Definition at line 76 of file makeBrightnessMap.py.

makeBrightnessMap.brightness2D = ROOT.TH2D("brightness2D", ";Plane;Cell", maxPlane+1, 0, maxPlane+1, maxCell+1, 0, maxCell+1)

Definition at line 78 of file makeBrightnessMap.py.

makeBrightnessMap.brightness2D_bin = ROOT.TH2C("brightness2D_bin", "Brightness Level Bin Map;Plane;Cell", maxPlane+1, 0, maxPlane+1, maxCell+1, 0, maxCell+1)

Definition at line 83 of file makeBrightnessMap.py.

makeBrightnessMap.brightness2D_module = ROOT.TH2D("brightness2D_module", ";Plane;Module", maxPlane+1, 0, maxPlane+1, maxModule+1, 0, maxModule+1)

Definition at line 82 of file makeBrightnessMap.py.

makeBrightnessMap.brightness2DX = ROOT.TH2D("brightness2DX", ";Plane;Cell", maxPlane/2+1, 0, maxPlane/2+1, maxCell+1, 0, maxCell+1)

Definition at line 79 of file makeBrightnessMap.py.

makeBrightnessMap.brightness2DY = ROOT.TH2D("brightness2DY", ";Plane;Cell", maxPlane/2+1, 0, maxPlane/2+1, maxCell+1, 0, maxCell+1)

Definition at line 80 of file makeBrightnessMap.py.

makeBrightnessMap.brightness_byplane = ROOT.TH1D("brightness_plane", ";Plane", maxPlane+1, 0, maxPlane+1);

Definition at line 84 of file makeBrightnessMap.py.

makeBrightnessMap.brightnessArr = np.array(brightnessLst)

Definition at line 90 of file makeBrightnessMap.py.

list makeBrightnessMap.brightnessLst = []

Definition at line 44 of file makeBrightnessMap.py.

makeBrightnessMap.brightnessValue = ROOT.TH1D("brightnessValue", "Brightness Level Bin Values;Brightness Bin Number;Values", 9, 0, 9)

Definition at line 77 of file makeBrightnessMap.py.

makeBrightnessMap.cell = int(splitLine[1])

Definition at line 56 of file makeBrightnessMap.py.

makeBrightnessMap.count = float(plane_moduleDict[key][0])

Definition at line 159 of file makeBrightnessMap.py.

makeBrightnessMap.fIn = open("FDModuleData.txt", "r")

Definition at line 36 of file makeBrightnessMap.py.

Referenced by CAFReweightExample().

makeBrightnessMap.fOut = ROOT.TFile(fOutName, "recreate")
string makeBrightnessMap.fOutName = "fdBrightness.root"

Definition at line 37 of file makeBrightnessMap.py.

makeBrightnessMap.grBright = ROOT.TGraph()

Definition at line 45 of file makeBrightnessMap.py.

makeBrightnessMap.iquantBrightness = findClosestVal(brightness/100., quantVals)

Definition at line 131 of file makeBrightnessMap.py.

makeBrightnessMap.maxBrightness = -9999

Definition at line 51 of file makeBrightnessMap.py.

makeBrightnessMap.maxCell = 0
makeBrightnessMap.maxModule = 0

Definition at line 47 of file makeBrightnessMap.py.

makeBrightnessMap.maxPlane = 0
makeBrightnessMap.minBrightness = 9999

Definition at line 52 of file makeBrightnessMap.py.

int makeBrightnessMap.module = cell/32

Definition at line 58 of file makeBrightnessMap.py.

makeBrightnessMap.parser = argparse.ArgumentParser(description='Process fiber brightness files')

Definition at line 22 of file makeBrightnessMap.py.

makeBrightnessMap.plane = int(splitLine[0])

Definition at line 55 of file makeBrightnessMap.py.

dictionary makeBrightnessMap.plane_moduleDict = {}

Definition at line 43 of file makeBrightnessMap.py.

dictionary makeBrightnessMap.planeDict = {}

Definition at line 42 of file makeBrightnessMap.py.

makeBrightnessMap.position = fIn.seek(0, 0);
makeBrightnessMap.quantBrightness = quantVals[iquantBrightness]

Definition at line 132 of file makeBrightnessMap.py.

list makeBrightnessMap.quantList = [10, 20, 30, 40, 50, 60, 70, 80, 90]

Definition at line 96 of file makeBrightnessMap.py.

makeBrightnessMap.quantVals = np.percentile(brightnessArr, quantList)

Definition at line 97 of file makeBrightnessMap.py.

makeBrightnessMap.splitLine = line.split()

Definition at line 54 of file makeBrightnessMap.py.

Referenced by INukeOsetTable.processLine().

int makeBrightnessMap.totBrightness = float(plane_moduleDict[key][1])/100

Definition at line 160 of file makeBrightnessMap.py.