Commit 55b020eb authored by vpalladi's avatar vpalladi

modfied the python navigation and naming

parent b5cf91c7
......@@ -167,8 +167,12 @@ def main():
if wafer_type == 0 :
wafer_must_build = 1
if len(PICK_WAFER) != 0:
if wafer_id in PICK_WAFER :
wafer_must_build = 1
if PICK_WAFER_FLAG == 'by_cms_id' :
if wafer_id in PICK_WAFER :
wafer_must_build = 1
if PICK_WAFER_FLAG == 'by_norm_id' :
if wafer_norm_id in PICK_WAFER :
wafer_must_build = 1
else :
wafer_must_build = 1
if wafer_must_build == 1 :
......
......@@ -270,13 +270,16 @@ class Trigger_cell :
else :
return 0
# trigger cell ids (only tc has a different way of identification for all the other classes cms is thecurrent id)
# trigger cell ids (only tc has a different way of identification for all the other classes cms is the current id)
def set_id(self, id) :
self.id = id
def get_id(self) :
return self.id
def get_norm_id(self) :
return self.norm_id
def set_cms_id(self, cms_id) :
self.cms_id = cms_id
......@@ -308,6 +311,8 @@ class Trigger_cell :
self.norm_id[1] = int( round( self.full_center[0]/(self.side*2.*math.sqrt(3.) ) ) ) # col
########################
### Draw
########################
......@@ -317,10 +322,10 @@ class Trigger_cell :
pr.set_facecolor(blue)
plt.gca().add_patch(pr)
def draw(self, id_on=0, norm_id_on=0) :
def draw(self, id_on=0, norm_id_on=0, fill=0) :
tc = plt.Polygon( self.corners )
tc.set_linewidth(2)
tc.set_fill(0)
tc.set_fill(fill)
plt.gca().add_patch(tc)
if id_on :
......
......@@ -71,6 +71,7 @@ class Wafer:
self.wafer_id_col = int( round( self.center[0] / ( math.sqrt(3)*self.side ) ) ) # col
else :
self.wafer_id_col = int( round( ( self.center[0] - math.sqrt(3)*self.side/2. ) / ( math.sqrt(3)*self.side) ) ) # col
# place the wafer and move the cells and the tcs
self.corners = [ [ p_coo+c_coo for p_coo,c_coo in zip(point,self.center)] for point in self.corners]
self.corners_extended = [ [ p_coo+c_coo for p_coo,c_coo in zip(point,self.center)] for point in self.corners_extended]
......@@ -292,10 +293,13 @@ class Wafer:
verticalalignment='center', color=dark_blue)
def draw_trigger_cells( self, id_on=0, norm_id_on=0 ) :
def draw_trigger_cells( self, id_on=0, norm_id_on=0, list_of_hits=[] ) :
for row in self.trigger_cells :
for col in self.trigger_cells[row] :
self.trigger_cells[row][col].draw(id_on, norm_id_on)
fill = 0
if self.trigger_cells[row][col].get_norm_id() in list_of_hits :
fill = 1
self.trigger_cells[row][col].draw(id_on, norm_id_on, fill)
if 0 :
for row in self.trigger_cells :
......
......@@ -11,8 +11,10 @@ LAST_ROW = 15
FIRST_COLUMN = -15
LAST_COLUMN = 15
# 1 = all the wafers have the same TC definition; 0 = each wafer has a different TC definition in order to match full TCs on the edges
TC_CELL_PIVOT_FIX = 0
# trigger cell pivot (0123) before 23/9/2016 was (ABCD)
TC_CELL_PIVOT_FIX = 1
TC_CELL_PIVOT = 3 # D
# layer 0->39
......@@ -56,11 +58,17 @@ BUILD_WAFER_256 = 1
BUILD_WAFER_128 = 1
BUILD_WAFER_TEST = 0
PICK_WAFER_FLAG = 'by_norm_id'
#PICK_WAFER_FLAG = 'by_cms_id'
#PICK_WAFER = [237,238,239,240,241,242,243,244,255,256,257,258,217,218,219,220,221,222,223,224,225,226,227,228] # if -1 all wafers are printout if any positive number only that particular wafer is printout
PICK_WAFER = [237,238,255,256] # if -1 all wafers are printout if any positive number only that particular wafer is printout
#PICK_WAFER = [237,238,255,256] # if -1 all wafers are printout if any positive number only that particular wafer is printout
#PICK_WAFER = [237,238,255,156] # if -1 all wafers are printout if any positive number only that particular wafer is printout
#PICK_WAFER = [648,332,333,334,600,312,313,314,636,292,293,294] # if -1 all wafers are printout if any positive number only that particular wafer is printout
#PICK_WAFER = [] # if -1 all wafers are printout if any positive number only that particular wafer is printout
PICK_WAFER = [[0, -7], [0, -8], [0, -9], [0, -10], [-2, -7], [-2, -8], [-2, -9], [-2, -10], [1, -10], [1, -9], [1, -8], [-1, -8], [-1, -9], [-1, -10]] # if -1 all wafers are printout if any positive number only that particular wafer is printout
###############################
### draw options
......@@ -78,7 +86,7 @@ DRAW_WAFER_128 = 1
DRAW_WAFER_TEST = 0
DRAW_TCS = 1
DRAW_CELLS = 0
DRAW_CELLS = 1
# labels and coloring
USER_ID_ON = 0
......@@ -86,8 +94,8 @@ CMS_ID_ON = 0
TYPE_ON = 0
TRIGGER_CELL_ID_ON = 0
TRIGGER_CELL_NORM_ID_ON = 1
WAFER_ID_ON = 1
WAFER_NORM_ID_ON = 0
WAFER_ID_ON = 0
WAFER_NORM_ID_ON = 1
# safe pdf
SAVE_PDF = 1
......@@ -96,3 +104,5 @@ SAVE_PDF = 1
PRINT_LIST = 0
PRINT_LIST_ORG = 0
#PRINT_LIST_ALL = 100 # if -1 all wafers are printout if any positive number only that particular wafer is printout
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment