Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:33

0001 #include "TH2F.h"
0002 #include "TLine.h"
0003 
0004 inline void DrawEB(TH2F* ebmap, float min, float max) {
0005   ebmap->SetXTitle("i#phi");
0006   ebmap->SetYTitle("i#eta");
0007   ebmap->GetXaxis()->SetNdivisions(-418, kFALSE);
0008   ebmap->GetYaxis()->SetNdivisions(-1702, kFALSE);
0009   ebmap->GetXaxis()->SetLabelSize(0.03);
0010   ebmap->GetYaxis()->SetLabelSize(0.03);
0011   ebmap->GetXaxis()->SetTickLength(0.01);
0012   ebmap->GetYaxis()->SetTickLength(0.01);
0013   ebmap->SetMaximum(max);
0014   ebmap->SetMinimum(min);
0015   ebmap->Draw("colz");
0016   TLine* l = new TLine;
0017   l->SetLineWidth(1);
0018   for (int i = 0; i < 17; i++) {
0019     Double_t x = 20. + (i * 20);
0020     l = new TLine(x, -85., x, 85.);
0021     l->Draw();
0022   }
0023   l = new TLine(0., 85., 360., 85.);
0024   l->Draw();
0025   l = new TLine(0., 0., 360., 0.);
0026   l->Draw();
0027 }  //   DrawEB method
0028 
0029 inline void DrawEE(TH2F* endc, float min, float max) {
0030   int ixSectorsEE[202] = {
0031       62, 62, 61, 61, 60, 60, 59, 59, 58, 58, 56, 56, 46, 46, 44, 44, 43, 43, 42, 42,  41,  41,  40,  40, 41, 41,
0032       42, 42, 43, 43, 44, 44, 46, 46, 56, 56, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62,  0,   101, 101, 98, 98, 96,
0033       96, 93, 93, 88, 88, 86, 86, 81, 81, 76, 76, 66, 66, 61, 61, 41, 41, 36, 36, 26,  26,  21,  21,  16, 16, 14,
0034       14, 9,  9,  6,  6,  4,  4,  1,  1,  4,  4,  6,  6,  9,  9,  14, 14, 16, 16, 21,  21,  26,  26,  36, 36, 41,
0035       41, 61, 61, 66, 66, 76, 76, 81, 81, 86, 86, 88, 88, 93, 93, 96, 96, 98, 98, 101, 101, 0,   62,  66, 66, 71,
0036       71, 81, 81, 91, 91, 93, 0,  62, 66, 66, 91, 91, 98, 0,  58, 61, 61, 66, 66, 71,  71,  76,  76,  81, 81, 0,
0037       51, 51, 0,  44, 41, 41, 36, 36, 31, 31, 26, 26, 21, 21, 0,  40, 36, 36, 11, 11,  4,   0,   40,  36, 36, 31,
0038       31, 21, 21, 11, 11, 9,  0,  46, 46, 41, 41, 36, 36, 0,  56, 56, 61, 61, 66, 66};
0039 
0040   int iySectorsEE[202] = {51, 56, 56, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 61, 61, 60, 60, 59, 59, 58,  58,  56,  56,
0041                           46, 46, 44, 44, 43, 43, 42, 42, 41, 41, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44,  46,  46,  51,
0042                           0,  51, 61, 61, 66, 66, 76, 76, 81, 81, 86, 86, 88, 88, 93, 93, 96, 96, 98, 98,  101, 101, 98,
0043                           98, 96, 96, 93, 93, 88, 88, 86, 86, 81, 81, 76, 76, 66, 66, 61, 61, 41, 41, 36,  36,  26,  26,
0044                           21, 21, 16, 16, 14, 14, 9,  9,  6,  6,  4,  4,  1,  1,  4,  4,  6,  6,  9,  9,   14,  14,  16,
0045                           16, 21, 21, 26, 26, 36, 36, 41, 41, 51, 0,  46, 46, 41, 41, 36, 36, 31, 31, 26,  26,  0,   51,
0046                           51, 56, 56, 61, 61, 0,  61, 61, 66, 66, 71, 71, 76, 76, 86, 86, 88, 0,  62, 101, 0,   61,  61,
0047                           66, 66, 71, 71, 76, 76, 86, 86, 88, 0,  51, 51, 56, 56, 61, 61, 0,  46, 46, 41,  41,  36,  36,
0048                           31, 31, 26, 26, 0,  40, 31, 31, 16, 16, 6,  0,  40, 31, 31, 16, 16, 6};
0049 
0050   TLine* l = new TLine;
0051   l->SetLineWidth(1);
0052 
0053   endc->SetXTitle("ix");
0054   endc->SetYTitle("iy");
0055   endc->SetMaximum(max);
0056   endc->SetMinimum(min);
0057   endc->Draw("colz1");
0058   for (int i = 0; i < 201; i = i + 1) {
0059     if ((ixSectorsEE[i] != 0 || iySectorsEE[i] != 0) && (ixSectorsEE[i + 1] != 0 || iySectorsEE[i + 1] != 0)) {
0060       l->DrawLine(ixSectorsEE[i], iySectorsEE[i], ixSectorsEE[i + 1], iySectorsEE[i + 1]);
0061     }
0062   }
0063 }  //   DrawEE method
0064 
0065 inline void DrawEE_Tower(TH2F* endc, TLine* l, double minScale, double maxScale) {
0066   endc->SetStats(false);
0067   endc->SetMinimum(minScale);
0068   endc->SetMaximum(maxScale);
0069   endc->Draw("colz");
0070 
0071   int ixSectorsEE[136] = {8,  14, 14, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 20, 20, 19, 19, 18, 18, 17, 17, 14, 14,
0072                           8,  8,  5,  5,  4,  4,  3,  3,  2,  2,  1,  1,  2,  2,  3,  3,  4,  4,  5,  5,  8,  8,  8,
0073                           9,  9,  10, 10, 12, 12, 13, 13, 12, 12, 10, 10, 9,  9,  10, 10, 0,  11, 11, 0,  10, 9,  9,
0074                           8,  8,  7,  7,  6,  6,  5,  5,  0,  12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 0,  9,  8,
0075                           8,  3,  3,  1,  0,  13, 14, 14, 19, 19, 21, 0,  9,  8,  8,  7,  7,  5,  5,  3,  3,  2,  0,
0076                           13, 14, 14, 15, 15, 17, 17, 19, 19, 20, 0,  14, 14, 13, 13, 12, 12, 0};
0077 
0078   int iySectorsEE[136] = {1,  1,  2,  2,  3,  3,  4,  4,  5,  5,  8,  8,  14, 14, 17, 17, 18, 18, 19, 19, 20, 20, 21,
0079                           21, 20, 20, 19, 19, 18, 18, 17, 17, 14, 14, 8,  8,  5,  5,  4,  4,  3,  3,  2,  2,  1,  4,
0080                           4,  7,  7,  9,  9,  10, 10, 12, 12, 13, 13, 12, 12, 10, 10, 9,  0,  13, 21, 0,  13, 13, 14,
0081                           14, 15, 15, 16, 16, 18, 18, 19, 0,  13, 13, 14, 14, 15, 15, 16, 16, 18, 18, 19, 0,  11, 11,
0082                           12, 12, 13, 13, 0,  11, 11, 12, 12, 13, 13, 0,  10, 10, 9,  9,  8,  8,  7,  7,  6,  6,  0,
0083                           10, 10, 9,  9,  8,  8,  7,  7,  6,  6,  0,  2,  4,  4,  7,  7,  9,  0};
0084 
0085   for (int i = 0; i < 136; i = i + 1)
0086     if ((ixSectorsEE[i] != 0 || iySectorsEE[i] != 0) && (ixSectorsEE[i + 1] != 0 || iySectorsEE[i + 1] != 0))
0087       l->DrawLine(ixSectorsEE[i], iySectorsEE[i], ixSectorsEE[i + 1], iySectorsEE[i + 1]);
0088 
0089 }  //draw EE in case of a tower
0090 
0091 inline void drawTable(int nbRows, int nbColumns) {
0092   TLine* l = new TLine;
0093   l->SetLineWidth(1);
0094   for (int i = 1; i < nbRows; i++) {
0095     double y = (double)i;
0096     l = new TLine(0., y, nbColumns, y);
0097     l->Draw();
0098   }
0099 
0100   for (int i = 1; i < nbColumns; i++) {
0101     double x = (double)i;
0102     double y = (double)nbRows;
0103     l = new TLine(x, 0., x, y);
0104     l->Draw();
0105   }
0106 }