ATLAS Offline Software
fillSCTHists.py
Go to the documentation of this file.
1 # ================================
2 # Fills the SCT Histograms
3 # Author John Alison <johnda@hep.upenn.edu>
4 
5 # In the text file, the followint is the order of the information
6 # m_sct_barrel_ec, m_sct_layer_disk, m_sct_phi_module, m_sct_eta_module, m_sct_x, m_sct_y, m_sct_z);
7 for i in range(len(sctElements1)):
8  sct_x1 = sctElements1[i][4] #+ 0.8
9  sct_y1 = sctElements1[i][5] #- 0.2
10  sct_z1 = sctElements1[i][6]
11 
12  sct_x2 = sctElements2[i][4]
13  sct_y2 = sctElements2[i][5]
14  sct_z2 = sctElements2[i][6]
15 
16  if sctElements1[i][0] == 0:
17  fillBarrelHists(sct_x1,sct_y1,sct_z1
18  ,sct_x2,sct_y2,sct_z2
19  ,sctHists
20  )
21 
22  # Fill SCT Trans Cans
23  etaMod = int(sctElements1[i][3])
24  if etaMod < 0:
25  etaMod = etaMod + 6
26  else:
27  etaMod = etaMod + 5
28 
29  sctTransCan[etaMod].cd()
30  line.SetLineColor(kBlue+1)
31  line.DrawArrow(sct_x1,sct_y1,sct_x1+TRASL_FACTOR*(sct_x2-sct_x1),sct_y1+TRASL_FACTOR*(sct_y2-sct_y1),0.01,"")
32 
33  if etaMod == 6:
34  IDTransCan.cd()
35  line.SetLineColor(kBlue+1)
36  line.DrawArrow(sct_x1,sct_y1,sct_x1+TRASL_FACTOR*(sct_x2-sct_x1),sct_y1+TRASL_FACTOR*(sct_y2-sct_y1),0.01,"")
37 
38 
39  # Fill 3D plot lists
40  color = 51 + int(sctElements1[i][2])
41  if color > 100:
42  color = 51 - (color- 100)
43 
44  sctPoly = TPolyLine3D(2)
45  sctPoly.SetLineWidth(1)
46  sctPoly.SetLineColor(color)
47  sctPoly.SetPoint(0,
48  sct_x1,
49  sct_y1,
50  sct_z1)
51  sctPoly.SetPoint(1,
52  sct_x1+TRASL_FACTOR*(sct_x2-sct_x1),
53  sct_y1+TRASL_FACTOR*(sct_y2-sct_y1),
54  sct_z1+TRASL_FACTOR*(sct_z2-sct_z1))
55  sctLines[int(sctElements1[i][1])].append(sctPoly)
56 
57  sctMark = TPolyMarker3D(1)
58  sctMark.SetMarkerSize(4)
59  sctMark.SetMarkerColor(color)
60  sctMark.SetMarkerStyle(7)
61  sctMark.SetPoint(0,
62  sct_x1,
63  sct_y1,
64  sct_z1)
65  sctPoints[int(sctElements1[i][1])].append(sctMark)
66 
67 
68  if sctElements1[i][0] == 2:
69  fillEndcapHists(sct_x1,sct_y1,sct_z1
70  ,sct_x2,sct_y2,sct_z2
71  ,sctHists
72  ,2
73  )
74 
75  if sctElements1[i][0] == -2:
76  fillEndcapHists(sct_x1,sct_y1,sct_z1
77  ,sct_x2,sct_y2,sct_z2
78  ,sctHists
79  ,0
80  )
81 
82 sct3DCan.cd()
83 fullSctAxes = make_axes()
84 fullSctAxes.Draw()
85 fullSctTitle = make_title("SCT Visualization Barrel")
86 fullSctTitle.Draw()
87 for i in range(len(sct3DLayers)):
88  sct3DLayers[i].cd()
89  sctAxes[i].Draw()
90  sctTitles[i].Draw()
91  for j in range(len(sctLines[i])):
92  sct3DCan.cd()
93  sctLines[i][j].Draw()
94  sctPoints[i][j].Draw()
95  sct3DLayers[i].cd()
96  sctLines[i][j].Draw()
97  sctPoints[i][j].Draw()
make3DCanvas.make_axes
def make_axes()
Definition: make3DCanvas.py:6
comparisonUtils.fillBarrelHists
def fillBarrelHists(x1, y1, z1, x2, y2, z2, theHists)
Definition: comparisonUtils.py:5
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
comparisonUtils.fillEndcapHists
def fillEndcapHists(x1, y1, z1, x2, y2, z2, theHists, side)
Definition: comparisonUtils.py:65
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
make3DCanvas.make_title
def make_title(text)
Definition: make3DCanvas.py:17
calibdata.cd
cd
Definition: calibdata.py:51