CMS 3D CMS Logo

ESDrawUtils.h
Go to the documentation of this file.
1 #include "TH2F.h"
2 #include "TLine.h"
3 
4 inline void DrawES(int plane, int side) {
5  int ixF[172] = {
6  2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 10, 10, 11, 11, 14, 14, // external upper crown (44)
7  16, 16, 26, 26, 28, 28, 31, 31, 32, 32, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, // external upper crown
8  39, 39, 40, 40, // external upper crown
9  28, 28, 27, 27, 26, 26, 25, 25, 23, 23, 19, 19, 17, 17, 16, 16, 15, 15, 14, 14, 2, // internal upper crown (21)
10  0, 6, 6, 8, 8, 0, 16, 16, 14, 14, 0, 20, 20, 0, 26, 26, 0, 32, 32, 30, 30,
11  0, // upper FEDs (22)
12  2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 10, 10, 11, 11, 14, 14, 16, // external lower crown (44)
13  16, 26, 26, 28, 28, 31, 31, 32, 32, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, // external lower crown
14  39, 40, 40, 0, // external lower crown
15  14, 14, 15, 15, 16, 16, 17, 17, 19, 19, 23, 23, 25, 25, 26, 26, 27, 27, 28, 28, 0, // internal lower crown (21)
16  10, 10, 12, 12, 0, 16, 16, 0, 22, 22, 0, 26, 26, 28, 28, 0, 36, 36, 34, 34}; // lower FEDs (20)
17  int iyF[172] = {
18  14, 26, 26, 28, 28, 31, 31, 32, 32, 33, 33, 34, 34, 36, 36, 37, 37, 38, 38, 39, // external upper crown
19  39, 40, 40, 39, 39, 38, 38, 37, 37, 36, 36, 34, 34, 33, 33, 32, 32, 31, 31, 28, // external upper crown
20  28, 26, 26, 20, // external upper crown
21  20, 22, 22, 24, 24, 25, 25, 26, 26, 27, 27, 26, 26, 25, 25, 24, 24, 22, 22, 20, 20, // internal upper crown
22  0, 20, 30, 30, 36, 0, 24, 26, 26, 38, 0, 27, 40, 0, 24, 40, 0, 20, 24, 24, 38, 0, // upper FEDs
23  14, 14, 12, 12, 9, 9, 8, 8, 7, 7, 6, 6, 4, 4, 3, 3, 2, 2, 1, 1, // external lower crown
24  0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9, 12, 12, // external lower crown
25  14, 14, 20, 0, // external lower crown
26  20, 18, 18, 16, 16, 15, 15, 14, 14, 13, 13, 14, 14, 15, 15, 16, 16, 18, 18, 20, 0, // internal lower crown
27  20, 16, 16, 2, 0, 16, 1, 0, 13, 0, 0, 16, 14, 14, 1, 0, 20, 10, 10, 6}; // lower FEDs
28  int ixR[171] = {
29  0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9, 12, 12, // external crown (86)
30  14, 14, 26, 26, 28, 28, 31, 31, 32, 32, 33, 33, 34, 34, 36, 36, 37, 37, 38, 38, // external crown
31  39, 39, 40, 40, 39, 39, 38, 38, 37, 37, 36, 36, 34, 34, 33, 33, 32, 32, 31, 31, // external crown
32  28, 28, 26, 26, 14, 14, 12, 12, 9, 9, 8, 8, 7, 7, 6, 6, 4, 4, 3, 3, // external crown
33  2, 2, 1, 1, 0, 0, // external crown
34  13, 13, 14, 14, 15, 15, 16, 16, 18, 18, 22, 22, 24, 24, 25, 25, 26, 26, 27, 27, // internal crown (38)
35  26, 26, 25, 25, 24, 24, 22, 22, 18, 18, 16, 16, 15, 15, 14, 14, 13, 0, // internal crown
36  20, 20, 0, 20, 20, 0, 2, 16, 16, 20, 0, 0, 16, 0, 0, 13, 0, 1, 14, 14, // FEDs (47)
37  16, 0, 4, 10, 10, 20, 0, 20, 24, 24, 38, 0, 24, 40, 0, 27, 40, 0, 24, 26, // FEDs
38  26, 39, 0, 20, 30, 30, 36}; // FEDs
39  int iyR[171] = {15, 25, 25, 27, 27, 30, 30, 31, 31, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, // external crown
40  38, 39, 39, 38, 38, 37, 37, 36, 36, 35, 35, 34, 34, 33, 33, 31, 31, 30, 30, 27, // external crown
41  27, 25, 25, 15, 15, 13, 13, 10, 10, 9, 9, 7, 7, 6, 6, 5, 5, 4, 4, 3, // external crown
42  3, 2, 2, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 9, 9, 10, // external crown
43  10, 13, 13, 15, 15, 0, // external crown
44  18, 22, 22, 24, 24, 25, 25, 26, 26, 27, 27, 26, 26, 25, 25, 24, 24, 22, 22, 18, // internal crown
45  18, 16, 16, 15, 15, 14, 14, 13, 13, 14, 14, 15, 15, 16, 16, 18, 18, 0, // internal crown
46  39, 27, 0, 13, 1, 0, 11, 11, 9, 9, 0, 15, 15, 0, 21, 21, 0, 27, 27, 25, // FEDs
47  25, 0, 33, 33, 35, 35, 0, 31, 31, 29, 29, 0, 25, 25, 0, 19, 19, 0, 15, 15, // FEDs
48  13, 13, 0, 5, 5, 7, 7}; // FEDs
49 
50  // std::cout << " plane " << plane << " side " << side << std::endl;
51  TLine* l = new TLine;
52  l->SetLineWidth(1);
53 
54  if (plane == 0 && side == 0)
55  for (int i = 0; i < 171; i = i + 1) {
56  if ((ixF[i] != 0 || iyF[i] != 0) && (ixF[i + 1] != 0 || iyF[i + 1] != 0)) {
57  l->DrawLine(ixF[i] - 1, iyF[i], ixF[i + 1] - 1, iyF[i + 1]);
58  }
59  }
60  else if (plane == 0 && side == 1)
61  for (int i = 0; i < 171; i = i + 1) {
62  if ((ixF[i] != 0 || iyF[i] != 0) && (ixF[i + 1] != 0 || iyF[i + 1] != 0)) {
63  l->DrawLine(41 - ixF[i], iyF[i], 41 - ixF[i + 1], iyF[i + 1]);
64  }
65  }
66  else if (plane == 1 && side == 1) {
67  for (int i = 0; i < 170; i = i + 1) {
68  if ((ixR[i] != 0 || iyR[i] != 0) && (ixR[i + 1] != 0 || iyR[i + 1] != 0)) {
69  l->DrawLine(ixR[i], iyR[i], ixR[i + 1], iyR[i + 1]);
70  }
71  }
72  } else if (plane == 1 && side == 0) {
73  for (int i = 0; i < 170; i = i + 1) {
74  if ((ixR[i] != 0 || iyR[i] != 0) && (ixR[i + 1] != 0 || iyR[i + 1] != 0)) {
75  l->DrawLine(40 - ixR[i], iyR[i], 40 - ixR[i + 1], iyR[i + 1]);
76  }
77  }
78  }
79 }
void DrawES(int plane, int side)
Definition: ESDrawUtils.h:4