CMS 3D CMS Logo

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