CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
zamt2019raddam.cc File Reference
#include <iostream>
#include <fstream>
#include "TH1.h"
#include "TH2.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TCanvas.h"
#include "TROOT.h"
#include <TMath.h>
#include "TStyle.h"
#include "TSystem.h"
#include "TLegend.h"
#include "TText.h"
#include "TAxis.h"
#include "TFile.h"
#include "TLine.h"
#include "TGraph.h"
#include <TPaveText.h>
#include <TPostScript.h>
#include <TClass.h>
#include <TLatex.h>
#include <TFrame.h>
#include <TPad.h>
#include "TGraphErrors.h"
#include "TF1.h"
#include "TArrow.h"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

===============================================================================================================================================================================================


variant2: for each run define phi-averaged A for normalization channel (Dref,16) and then, divide Rijk on it, i.e. get RRijk

eta=27

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=19

eta=17

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=20

eta=19

eta=18

eta=27 L1=1

eta=25 L1=1

eta=23 L1=1

eta=22 L1=1

eta=21 L1=1

eta=29 L1=1

eta=26 L1=1

eta=24 L1=1

eta=20 L1=1

eta=19 L1=1

eta=18 L1=1

eta=17 L1=1

eta=28 L7=1

eta=27 L7=1

eta=25 L7=1

eta=23 L7=1

eta=22 L7=1

eta=21 L7=1

eta=26 L7=1

eta=24 L7=1

eta=20 L7=1

eta=19 L7=1

eta=18 L7=1

eta=17 L7=1

eta=27

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=19

eta=17

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=20

eta=19

eta=18

eta=27 L1=1

eta=25 L1=1

eta=23 L1=1

eta=22 L1=1

eta=21 L1=1

eta=26 L1=1

eta=24 L1=1

eta=20 L1=1

eta=19 L1=1

eta=18 L1=1

eta=17 L1=1

eta=28 L7=1

eta=27 L7=1

eta=25 L7=1

eta=23 L7=1

eta=22 L7=1

eta=21 L7=1

eta=26 L7=1

eta=24 L7=1

eta=20 L7=1

eta=19 L7=1

eta=18 L7=1

eta=17 L7=1

eta=27

eta=28

Definition at line 33 of file zamt2019raddam.cc.

References alignmentValidation::c1, gather_cfg::cout, alignmentValidation::fname, findQualityFiles::jj, kfactor, compareTotals::pad1, L1TEGammaDiff_cfi::plotName, submitPVValidationJobs::t, HLT_FULL_cff::verbosity, w8, w9, X0, XX, and AlignmentPI::YY.

33  {
34  //______________________________________________________________________________________________________________________________
35  //TCanvas *c1;
36  TGraph *gr1;
37  TGraph *gr2;
38  TGraph *gr3;
39  TGraph *gr4;
40  TGraph *gr5;
41  TGraph *gr6;
42  TGraph *gr7;
43  TGraph *gr8;
44  TGraph *gr9;
45  TGraphErrors *ge1;
46  TGraphErrors *ge2;
47  TGraphErrors *ge3;
48  TGraphErrors *ge4;
49  TGraphErrors *ge5;
50  TGraphErrors *ge6;
51  TGraphErrors *ge7;
52  TGraphErrors *ge8;
53  TGraphErrors *ge9;
54 
55  //
56  const Int_t NMethods = 38; // total number of Methods (all-together 38 methods)
57  const Int_t NMethodsStart = 0; // since which method to start ( min= 0)
58  const Int_t NMethodsToUse = 37; // choose Number of methods to use ( max= 37)
59  //
60  TString MethodName[NMethods] = {"PLOT0", "PLOT1", "PLOT2", "PLOT3", "PLOT4", "PLOT5", "PLOT6", "PLOT7",
61  "PLOT8", "PLOT9", "PLOT10", "PLOT11", "PLOT12", "PLOT13", "PLOT14", "PLOT15",
62  "PLOT16", "PLOT17", "PLOT18", "PLOT19", "PLOT20", "PLOT21", "PLOT22", "PLOT23",
63  "PLOT24", "PLOT25", "PLOT26", "PLOT27", "PLOT28", "PLOT29", "PLOT30", "PLOT31",
64  "PLOT32", "PLOT33", "PLOT34", "PLOT35", "PLOT36", "PLOT37"};
65  //______________________________________________________________________________________________________________________________
66  //LUMI-DAYS:
67  const Int_t NMAX0 = 220; // number of DAYS(time abscissa)
68 
69  // first experience with lumi taken by eye:
70  Float_t LU[NMAX0] = {
71  0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.2,
72  1.3, 1.6, 1.9, 2.1, 2.4, 2.7, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0,
73  6.5, 6.9, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.4, 7.9, 8.3, 8.7, 9.1, 9.5, 10.0, 10.5, 10.9, 11.3, 11.7,
74  12.1, 12.5, 13.0, 13.4, 13.8, 14.2, 14.6, 15.0, 15.4, 15.8, 16.2, 16.6, 17.0, 17.4, 17.8, 18.2, 18.7, 19.1, 19.5,
75  19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 19.5, 19.8, 20.1, 20.4, 20.8, 21.1, 21.5, 21.9, 22.2, 22.5, 22.5, 22.5, 22.5,
76  23.0, 23.5, 24.0, 24.5, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.2, 25.4, 26.0, 26.5, 27.0, 27.5,
77  28.0, 28.5, 29.0, 29.5, 30.0, 30.5, 31.0, 31.5, 31.5, 31.5, 31.5, 31.5, 31.5, 31.5, 31.5, 31.5, 31.5, 31.5, 31.5,
78  31.5, 31.5, 31.5, 31.5, 31.5, 32.6, 32.8, 33.3, 33.7, 34.0, 34.2, 34.2, 34.2, 34.2, 34.2, 34.2, 34.2, 34.2, 34.2,
79  34.2, 34.9, 35.4, 35.9, 36.4, 36.9, 37.4, 37.8, 38.3, 38.6, 39.0, 39.4, 40.0, 40.5, 41.0, 41.3, 41.3, 41.3, 41.3,
80  41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3,
81  41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 41.3, 0., 0., 0., 0., 0., 0., 0., 0., 0.,
82  0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
83 
84  // recorded LUMI:
85  Float_t LU0[NMAX0] = {
86  24.6, 50.4, 47.7, 28.0, 122.5, 0., 98.5, 0.02, 37., 256.6, 0., 0., 0., 0., 0., 0.,
87  9.4, 5.1, 101.8, 130.6, 190., 198.8, 228.5, 320.3, 301., 338.6, 219.4, 0., 0., 0., 0., 0.,
88  443., 464.6, 0., 365., 191.4, 158.8, 387.8, 182., 740.1, 0., 0., 0., 73.9, 472., 550., 0.,
89  237.4, 345.1, 104.9, 0., 608.4, 340.8, 617.7, 0., 500., 532.6, 485., 360.6, 491.6, 289.7, 525., 0.,
90  541.5, 481.4, 529.1, 172., 470., 611., 0., 673.9, 518.7, 756.5, 250.4, 61.3, 0., 0., 0., 0.,
91  0., 0., 385.4, 0., 324.7, 367.4, 39.2, 412.7, 468., 298., 274., 0., 0., 0., 580.7, 482.4,
92  200.2, 249.9, 407.3, 126.6, 40.3, 180., 0., 0., 0., 0., 238.7, 391.6, 284.9, 805.2, 513.6, 224.7,
93  464.5, 265.2, 471.3, 857.4, 0., 286.5, 428.7, 0., 505.5, 374.3, 0., 0., 0., 0., 0., 0.,
94  0., 0., 0., 0., 0., 0., 0., 0., 0., 17.4, 519.7, 469.4, 397.9, 0., 752., 0.,
95  392.6, 0., 0., 24.9, 0., 10.4, 494.4, 441.7, 211.8, 152.6, 217.4, 600.7, 350.8, 434.6, 500., 127.6,
96  400., 126.8, 399., 271.3, 819., 322.8, 364.6, 106.4, 350., 111.1, 385.3, 0.0, 0.9, 102.5, 130.3, 0.0,
97  0.112, 0.071, 0.036, 1.771, 1.004, 12.40, 10.81, 3.80, 5.396, 8.971, 0.006, 11.17, 4.364, 0.671, 1.310, 7.819,
98  8.927, 7.179, 8.289, 8.268, 4.788, 5.304, 5.443, 0.668, 1.128, 2.569, 7.931, 10.70, 7.068, 10.96, 10.29, 5.189,
99  0.112, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
100  // delivered LUMI: recorderLUMI*klumi (=1.076 (41.3/38.3713) )
101  Float_t LU1[NMAX0];
102  Float_t klumi = 1.076;
103  // Float_t LU1[NMAX0];Float_t klumi = 1.1023122;
104  int ncounts = 1;
105  LU1[ncounts - 1] = klumi * LU0[ncounts - 1] / 1000.; // fb-1
106  // just comparison:
107  cout << "Terminated: ind = " << ncounts - 1 << " LU1 = " << LU1[ncounts - 1] << " LU = " << LU[ncounts - 1]
108  << endl;
109 
110  for (int jj = 1; jj < NMAX0; jj++) {
111  LU1[ncounts] = LU1[ncounts - 1] + klumi * LU0[jj] / 1000.;
112  // cout << " ind = " << ncounts << " LU1 = " << LU1[ncounts] << " LU = " << LU[ncounts] <<endl;
113  ++ncounts;
114  }
115  cout << "LU1[NMAX0-1] = " << LU1[NMAX0 - 1] << endl;
116 
117  // LU1-stuff above obsolet !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
118  //______________________________________________________________________________________________________________________________
120  //===============================================================================================================================================================================================
121  //______________________________________________________________________________________________________________________________
122  // year date #days dates #lines_in_massive
123  // 2016 : 10.5.2016 - 15.11.2016 (190-1)+1=190 1 - 190 168 190 days; 168 lines in massive corresponding LumiFills in Days with Stable Beams only; ALF = 168 -> AlmostLumiFills
124  // fall2016 : 2016.11.16 - 2016.12.04 (209-191)+1=19 191 - 209 34
125  // 2017 : 2017.04.13 - 2017.11.15 (554-370)+1=185 370 - 554 226
126  // 2018 : 2018.04.17 - 2018.10.26 (899-707)+1=193 707 - 899 241
127 
128  // const Int_t ALF =168; +34 = 202; +226 = 428 n=171 -> 27.10 pb-1, but since 172 -> nb-1 already for starting Ion runs; Then, since 203 -> fb-1 +11 (in 2016)
129  // const Int_t ALF =428; // 417+11 (fall2016+2017)=428
130  const Int_t ALF = 670; // 428+241 lines (2018) = 669
131 
132  Int_t DeltaDaysLumiTaken[ALF] = {
133  1, 2, 3, 5, 5, 5, 7, 7, 8, 9, 9, 11, 18, 18, 18, 19, 20, 20, 21, 22, 23, 23, 24,
134  25, 25, 26, 27, 33, 33, 35, 36, 37, 39, 39, 40, 41, 41, 42, 46, 47, 48, 50, 51, 52, 52, 53,
135  54, 54, 55, 56, 56, 58, 59, 60, 61, 62, 64, 64, 66, 67, 68, 69, 70, 71, 73, 74, 74, 74, 75,
136  75, 76, 77, 77, 84, 84, 84, 86, 87, 87, 88, 88, 89, 90, 91, 91, 92, 95, 96, 96, 96, 97, 98,
137  99, 99, 100, 100, 101, 101, 102, 102, 103, 108, 108, 108, 109, 110, 110, 111, 111, 112, 113, 114, 114, 115, 115,
138  116, 117, 117, 118, 119, 120, 122, 123, 139, 139, 139, 140, 140, 141, 142, 144, 144, 146, 150, 152, 152, 153, 153,
139  154, 155, 156, 156, 157, 158, 158, 159, 160, 161, 161, 162, 163, 163, 163, 165, 165, 166, 167, 167, 168, 169, 170,
140  170, 171, 185, 185, 187, 189, 190, 191, 191, 193, 193, 193, 194, 195, 195, 197, 197, 198, 198, 199, 200, 201, 201,
141  201, 202, 202, 203, 203, 204, 205, 205, 205, 206, 206, 206, 207, 207, 208, 208, 209, 209, 339, 371, 379, 380, 381,
142  382, 383, 383, 384, 384, 386, 389, 390, 391, 392, 398, 398, 398, 400, 400, 401, 401, 402, 402, 403, 403, 404, 405,
143  406, 408, 409, 409, 410, 410, 411, 411, 412, 412, 413, 414, 414, 415, 415, 415, 425, 425, 427, 428, 430, 430, 431,
144  431, 432, 432, 434, 434, 435, 435, 435, 435, 436, 436, 437, 438, 440, 443, 444, 444, 444, 445, 445, 445, 445, 446,
145  447, 447, 449, 450, 451, 451, 452, 452, 453, 454, 454, 455, 455, 456, 456, 459, 461, 461, 461, 462, 462, 463, 463,
146  464, 464, 464, 464, 465, 466, 466, 467, 468, 469, 469, 470, 471, 473, 474, 474, 475, 475, 476, 477, 477, 478, 479,
147  479, 479, 480, 480, 481, 481, 482, 483, 483, 483, 484, 484, 485, 486, 486, 486, 487, 487, 488, 488, 489, 490, 490,
148  490, 491, 500, 501, 501, 502, 502, 503, 503, 504, 505, 505, 506, 507, 508, 508, 509, 509, 509, 510, 511, 512, 512,
149  513, 513, 514, 514, 515, 516, 516, 517, 517, 518, 519, 520, 520, 521, 522, 523, 523, 524, 525, 525, 526, 526, 527,
150  527, 528, 529, 529, 530, 530, 531, 531, 532, 533, 534, 535, 535, 536, 536, 537, 538, 538, 539, 539, 540, 540, 541,
151  542, 543, 545, 548, 548, 550, 551, 551, 551, 552, 553, 554, 554, 554, 707, 707, 708, 709, 710, 711, 711, 712, 712,
152  714, 715, 715, 716, 716, 717, 717, 718, 718, 719, 719, 720, 721, 722, 722, 722, 723, 724, 724, 725, 725, 725, 726,
153  726, 727, 727, 728, 729, 730, 730, 731, 732, 732, 733, 734, 735, 735, 736, 736, 736, 737, 738, 738, 739, 739, 740,
154  740, 741, 742, 742, 743, 744, 745, 746, 747, 748, 748, 748, 750, 750, 751, 751, 752, 752, 753, 754, 755, 755, 756,
155  757, 757, 759, 759, 760, 761, 761, 762, 762, 776, 777, 777, 778, 779, 779, 780, 781, 782, 783, 783, 784, 784, 785,
156  785, 786, 787, 788, 789, 789, 790, 792, 792, 793, 794, 795, 795, 796, 796, 796, 797, 797, 798, 799, 800, 800, 801,
157  801, 802, 802, 803, 803, 804, 811, 812, 813, 813, 814, 814, 815, 815, 816, 817, 817, 818, 819, 819, 819, 820, 821,
158  821, 822, 823, 823, 824, 825, 825, 826, 826, 826, 827, 829, 829, 830, 831, 832, 835, 835, 836, 837, 838, 838, 839,
159  839, 840, 840, 841, 841, 841, 842, 843, 843, 843, 844, 844, 845, 845, 845, 846, 846, 847, 847, 848, 849, 849, 850,
160  850, 850, 851, 851, 852, 852, 853, 859, 866, 866, 867, 867, 868, 868, 868, 872, 872, 873, 873, 874, 874, 876, 876,
161  877, 877, 879, 880, 881, 881, 882, 883, 887, 887, 888, 889, 889, 890, 890, 891, 892, 892, 893, 894, 894, 895, 895,
162  896, 899, 909
163 
164  }; //
165 
166  const Int_t NMAXDAYS = DeltaDaysLumiTaken[ALF - 1];
167  cout << "*********** NMAXDAYS = ************* " << NMAXDAYS << endl;
168 
169  Float_t DeliveredLumi[ALF] = {
170  28.0, 59.1, 54.9, 33.5, 31.0, 103.2, 31.4, 72.3, 0.0, 39.3, 0.1, 269.2, 9.7,
171  0.0, 7.1, 103.1, 6.7, 137.5, 204.2, 158.6, 57.9, 249.3, 352.8, 8.0, 308.5, 353.9,
172  235.9, 48.6, 435.7, 488.1, 406.5, 201.7, 198.5, 403.0, 203.4, 107.3, 144.1, 523.0, 85.6,
173  547.4, 710.5, 254.4, 363.4, 19.3, 100.0, 121.2, 122.1, 557.0, 356.7, 171.3, 496.7, 538.8,
174  564.1, 505.6, 381.3, 535.1, 311.8, 552.3, 570.9, 517.4, 549.5, 181.8, 540.6, 652.2, 514.2,
175  197.6, 150.0, 409.9, 34.2, 485.3, 115.8, 163.7, 65.7, 0.0, 54.9, 366.4, 340.2, 36.9,
176  353.0, 29.9, 21.3, 436.0, 150.3, 369.8, 313.9, 295.6, 0.0, 0.0, 182.2, 448.1, 519.3,
177  223.5, 103.9, 38.7, 124.1, 430.9, 34.3, 108.3, 27.6, 14.8, 188.0, 0.0, 7.1, 241.2,
178  447.0, 216.8, 96.4, 431.4, 412.0, 546.5, 232.0, 84.8, 394.7, 334.9, 77.1, 486.4, 96.4,
179  251.9, 598.7, 339.4, 465.3, 542.1, 401.2, 0.1, 11.3, 8.5, 88.2, 495.1, 493.6, 412.8,
180  415.9, 383.4, 405.9, 25.0, 0.2, 11.2, 38.4, 498.8, 467.6, 45.8, 213.1, 166.6, 263.8,
181  6.5, 615.5, 374.4, 458.1, 0.0, 534.7, 132.6, 1.1, 234.2, 205.0, 229.8, 417.9, 297.5,
182  443.3, 416.9, 339.1, 380.0, 111.1, 385.3, 0.0, 0.9, 0.0, 102.5, 130.3, 0.0, 111.8,
183  71.2, 36.5, 1770.9, 10047.3, 12403.8, 10891.5, 3806.9, 5396.6, 8971.2, 5.8, 11172.5, 4364.3, 671.1,
184  6.7, 1310.7, 7819.1, 8927.2, 7179.0, 8289.8, 8268.8, 4788.3, 5304.8, 5443.9, 668.1, 11286.1, 2569.6,
185  7931.7, 10707.8, 7068.5, 10965.6, 10299.9, 5189.4, 112.7, 0.0, 0.0, 0.2, 0.1, 0.9, 0.6,
186  8.3, 7.1, 3.9, 53.1, 63.3, 5.7, 85.2, 2.5, 50.1, 0.1, 43.3, 13.9, 132.2,
187  70.6, 114.2, 209.8, 70.2, 140.9, 153.2, 254.1, 93.1, 380.7, 519.7, 427.4, 44.2, 214.1,
188  347.0, 89.5, 8.6, 518.9, 390.4, 399.7, 435.9, 87.9, 390.3, 253.3, 12.3, 189.5, 0.0,
189  0.0, 2.7, 26.6, 54.6, 4.9, 334.2, 56.8, 125.2, 226.6, 186.9, 330.1, 85.6, 99.2,
190  17.4, 44.5, 15.0, 518.7, 460.9, 153.7, 111.6, 0.1, 0.0, 0.1, 2.1, 14.9, 54.8,
191  10.8, 535.2, 523.1, 135.6, 522.3, 423.1, 110.5, 440.3, 487.8, 67.4, 523.4, 486.9, 353.8,
192  561.3, 48.1, 105.1, 496.7, 427.1, 5.8, 22.9, 105.0, 123.1, 71.8, 149.4, 165.8, 178.1,
193  70.2, 62.7, 102.8, 296.1, 74.6, 214.9, 107.2, 295.0, 254.9, 67.9, 136.2, 142.4, 20.3,
194  92.0, 78.5, 304.2, 33.3, 309.3, 297.8, 10.4, 314.2, 122.3, 17.6, 166.5, 109.4, 112.6,
195  146.8, 253.1, 189.9, 102.8, 101.3, 159.6, 136.2, 248.6, 324.2, 322.4, 74.5, 340.9, 14.8,
196  13.8, 269.6, 83.3, 316.0, 339.0, 330.3, 111.0, 164.2, 16.3, 0.0, 3.5, 16.0, 149.6,
197  344.8, 416.5, 432.5, 420.6, 285.3, 399.2, 457.1, 563.5, 390.3, 435.8, 150.7, 164.1, 134.0,
198  389.8, 386.6, 73.4, 441.1, 437.7, 468.7, 237.8, 272.2, 161.1, 450.8, 300.1, 342.3, 502.0,
199  463.7, 587.6, 0.0, 6.3, 501.9, 595.2, 335.4, 526.7, 494.5, 525.0, 420.7, 392.9, 521.9,
200  48.8, 525.6, 472.8, 70.2, 546.6, 471.7, 519.0, 133.1, 501.9, 591.2, 552.9, 14.5, 279.2,
201  49.6, 471.8, 255.3, 607.6, 213.0, 241.3, 162.3, 52.5, 50.7, 486.7, 555.8, 703.0, 712.6,
202  743.8, 374.4, 680.8, 0.1, 4.2, 2.6, 22.7, 57.2, 36.6, 0.1, 1.2, 12.6, 0.3,
203  0.1, 1.5, 13.6, 5.8, 9.4, 0.4, 63.2, 39.0, 63.2, 115.6, 7.2, 82.0, 78.1,
204  181.2, 181.6, 95.0, 155.5, 264.8, 260.3, 354.6, 392.0, 37.6, 124.3, 509.7, 459.8, 332.3,
205  365.0, 214.7, 25.7, 117.0, 123.7, 520.5, 317.6, 354.2, 305.0, 523.0, 141.9, 501.3, 259.6,
206  554.5, 597.7, 575.8, 552.5, 32.3, 93.8, 204.3, 4.6, 342.6, 396.4, 402.1, 0.6, 493.0,
207  189.5, 83.8, 436.6, 383.8, 490.6, 456.3, 558.2, 390.6, 45.0, 495.0, 172.5, 272.8, 8.9,
208  496.8, 0.0, 407.9, 181.9, 67.5, 541.7, 518.8, 234.4, 54.7, 500.9, 500.6, 439.0, 358.9,
209  449.0, 112.2, 527.2, 529.3, 487.2, 543.4, 118.7, 231.9, 0.1, 16.5, 46.4, 76.5, 13.9,
210  400.0, 0.2, 0.4, 17.0, 0.0, 0.1, 0.4, 0.8, 0.1, 0.2, 2.4, 0.9, 1.3,
211  229.7, 276.6, 602.5, 159.5, 613.2, 0.3, 793.8, 70.6, 405.4, 234.0, 95.4, 17.1, 100.1,
212  486.3, 72.2, 342.3, 454.2, 115.0, 65.6, 529.3, 454.3, 308.6, 408.0, 424.5, 0.2, 0.0,
213  0.2, 98.9, 156.3, 69.5, 116.9, 432.6, 452.6, 290.4, 441.8, 148.1, 506.5, 357.6, 39.0,
214  78.0, 453.7, 473.8, 395.4, 514.5, 314.6, 458.4, 371.8, 214.6, 500.3, 322.9, 10.0, 411.6,
215  754.0, 523.4, 572.2, 472.6, 535.4, 500.7, 117.1, 523.6, 446.2, 518.1, 80.0, 520.7, 527.0,
216  162.5, 292.7, 521.7, 282.1, 107.8, 156.8, 535.8, 520.1, 13.9, 484.7, 16.0, 10.4, 248.2,
217  361.3, 297.8, 332.0, 496.5, 528.9, 445.7, 510.0, 331.6, 436.2, 282.6, 188.7, 183.5, 495.2,
218  481.5, 3.3, 429.6, 409.9, 0.0, 4.0, 70.2, 134.8, 398.5, 451.0, 0.2, 521.8, 497.0,
219  413.0, 313.9, 337.4, 313.4, 268.8, 471.9, 328.5, 408.5, 462.0, 501.4, 79.7, 437.9, 537.3,
220  196.0, 251.9, 0.0, 0.0, 0.2, 31.6, 533.4, 452.3, 546.8, 424.0, 54.2, 545.8, 550.8,
221  412.6, 452.3, 127.9, 559.9, 449.9, 3.6, 0.0}; // DeliveredLumi pb-1; since 172 t0 209 ->nb-1; then again -> pb-1
222  //______________________________________________________________________________________________________________________________
223 
224  // treatment to obtaine massives of Days and DeliveredLumiForDays:
225  cout << "********************* treatment to obtaine massives of Days and DeliveredLumiForDays "
226  "************************** "
227  << endl;
228  Float_t DeliveredLumiForDays[ALF];
229  Int_t Days[ALF];
230  for (int w9 = 0; w9 < ALF; w9++) {
231  Days[w9] = 0.;
232  DeliveredLumiForDays[w9] = 0.;
233  }
234  int w8 = 0;
235  Days[w8] = DeltaDaysLumiTaken[0];
236  DeliveredLumiForDays[w8] += DeliveredLumi[0];
237  // cout << " w8 = " << w8 << " Days[w8] = " << Days[w8] << " DeliveredLumiForDays[w8]= " << DeliveredLumiForDays[w8] <<endl;
238  for (int w9 = 1; w9 < ALF; w9++) {
239  if (DeltaDaysLumiTaken[w9] != DeltaDaysLumiTaken[w9 - 1])
240  w8++;
241  Days[w8] = DeltaDaysLumiTaken[w9];
242  if (DeltaDaysLumiTaken[w9] < 172)
243  DeliveredLumiForDays[w8] += DeliveredLumi[w9]; // pb-1
244  if (DeltaDaysLumiTaken[w9] > 171 && DeltaDaysLumiTaken[w9] < 210)
245  DeliveredLumiForDays[w8] += DeliveredLumi[w9] / 1000.; // nb-1
246  if (DeltaDaysLumiTaken[w9] > 209)
247  DeliveredLumiForDays[w8] += DeliveredLumi[w9]; // pb-1
248  // if((DeltaDaysLumiTaken[w9] > 170 && DeltaDaysLumiTaken[w9] < 210)|| DeltaDaysLumiTaken[w9] > 550) cout << " w8 = " << w8 << " Days[w8] = " << Days[w8] << " DeliveredLumiForDays[w8]= " << DeliveredLumiForDays[w8] <<endl;
249  } // w8massive: 0,...w8 -> w8+1 elements; last element w8
250  // cout << "#Days for RunII up to fall2016 = " << w8+1 <<endl;// result:115 elements in massive: 0,...114
251  // cout << "Last Day for RunII up to fall2016 = " << Days[w8] <<endl;
252  // cout << "this LAST Day DeliveredLumi = " << DeliveredLumiForDays[w8] <<endl;
253 
254  // result:
255  //______________________________________________________________________________________________________________________________
256  // delivered LUMI:
257  Float_t LU2[NMAXDAYS];
258  for (int w9 = 0; w9 < NMAXDAYS; w9++) {
259  LU2[w9] = 0.;
260  }
261  // day 1 , massive-index = 0:
262  LU2[0] = DeliveredLumiForDays[0] / 1000.;
263  // cout << " days = 1" << " Days[w8counts] = " << Days[0] << " LU2 = " << LU2[0] << " LU1= " << LU1[0] << " w8counts = 0 " << " DeliveredLumi = " << DeliveredLumiForDays[0]/1000. <<endl;
264  // next day, massive-index = 1
265  int w8counts = 1;
266  for (int jj = 1; jj < NMAXDAYS; jj++) {
267  if (jj + 1 == Days[w8counts]) {
268  LU2[jj] = LU2[jj - 1] + DeliveredLumiForDays[w8counts] / 1000.;
269  // cout << " days = " << jj+1 << " Days[w8counts] = " << Days[w8counts] << " LU2 = " << LU2[jj] << " LU1= " << LU1[jj] << " w8counts = " << w8counts << " DeliveredLumi = " << DeliveredLumiForDays[w8counts]/1000. <<endl;
270  w8counts++;
271  if (w8counts > w8)
272  break;
273  } else {
274  LU2[jj] = LU2[jj - 1];
275  // cout << " days = " << jj+1 << " Days[w8counts] = " << Days[w8counts] << " LU2 = " << LU2[jj] << " LU1= " << LU1[jj] << " w8counts = " << w8counts << " DeliveredLumi = " << DeliveredLumiForDays[w8counts]/1000. <<endl;
276  }
277  } //for jj
278  // finally:
279  cout << "before any correction: LU2[NMAXDAYS-1] = " << LU2[NMAXDAYS - 1] << endl;
280 
281  // normilized delivered LUMI: LU2*klumi2 (=1.015 (41.07/40.46) );
282  // Float_t klumi2= 1.015;
283  // once Ldeliv(22.04-27.10 ) = 41.07 but Ldeliv(10.05-27.10 ) = 40.46 i.e. diff=1.5% because of dates, do not apply this correction, just =1.0 !!!
284  Float_t klumi2 = 1.0;
285 
286  TH1F *lumiplot = new TH1F("lumiplot", "", NMAXDAYS + 1, 1., float(NMAXDAYS) + 1.);
287  TH1F *lumiplot1 = new TH1F("lumiplot1", "", 172 + 1, 1., float(172) + 1.);
288  TH1F *lumiplot2 = new TH1F("lumiplot2", "", 190 + 1, 1., float(190) + 1.);
289  TH1F *lumiplot3 = new TH1F("lumiplot3", "", 195 + 1, 1., float(195) + 1.);
290  for (int jj = 0; jj < NMAXDAYS; jj++) {
291  if (jj < 172) {
292  LU2[jj] *= klumi2;
293  lumiplot1->Fill(float(jj + 1), LU2[jj]);
294  }
295  if (jj > 370) {
296  lumiplot2->Fill(float(jj + 1 - 370), LU2[jj] - LU2[371]);
297  }
298  if (jj > 707) {
299  lumiplot3->Fill(float(jj + 1 - 707), LU2[jj] - LU2[708]);
300  }
301  lumiplot->Fill(float(jj + 1), LU2[jj]);
302  // lumiplot->SetBinError(0.,0.);
303  }
304  cout << "day 172(27.10.2016) LU2 = " << LU2[171] << endl;
305  // cout << "since 15.05.2017 LU2 = " << LU2[NMAXDAYS-1]-LU2[370] <<endl;
306  cout << "since 15.05.2017 LU2 = " << LU2[555] - LU2[370] << endl;
307  cout << "since 17.04.2018 LU2 = " << LU2[NMAXDAYS - 1] - LU2[706] << endl;
308  cout << "after any correction: LU2[NMAXDAYS-1] = " << LU2[NMAXDAYS - 1] << endl;
309 
310  //______________________________________________________________________________________________________________________________ Lumi end
311  //______________________________________________________________________________________________________________________________
313  // always use maximal!!! value of massives dimention below:
314  // const Int_t NMAXP =102;// 623 runs 321 days 50+623 = 673-6=667 22*2+6=50; 22*3+15=81; 50+81=131; -13 = 113; -3 = 110; -6 = 104 -1 =103; -1 102
315  // const Int_t NMAXP =437;// 623 runs 321 days 50+623 = 673-6=667 22*2+6=50; 22*3+15=81; 50+81=131; -13 = 113; -3 = 110; -6 = 104 -1 =103; -1 102
316  // 102+32= 134
317  const Int_t NMAXP =
318  134; // 623 runs 321 days 50+623 = 673-6=667 22*2+6=50; 22*3+15=81; 50+81=131; -13 = 113; -3 = 110; -6 = 104 -1 =103; -1 102
319  // const Int_t NMAXP =50;// number of LASER runs(time abscissa) 50(2016) + 52(1017)
320  TString LASERrunsP[NMAXP] = {
321  "272957", "273354", "273899", "274185", "274260", "274357", "274409", "274462", "274767", "275273", "275392",
322  "275707", "275802", "275877", "276256", "276424", "276465", "276479", "276523", "276556", "276823", "277134",
323  "277340", "278074", "278223", "278326", "278592", "278901", "279098", "279610", "279734", "279804", "280141",
324  "280204", "280266", "280378", "282043", "282777", "282850", "282854", "282931", "283117", "283328", "283365",
325  "283401", "283445", "283800", "283840", "283982", "285355",
326 
327  "285701", "285878", "287385", "287739", "287765", "287766", "287866", "287867", "287868", "287869", "287870",
328  "288174", "288180", "288181", "288182", "288988", "295678", "296810", "297084", "297526", "297573", "297632",
329  "297692", "297850", "298104", "298295", "298794", "299461", "299971", "300181", "302109", "302256", "302412",
330  "302431", "302434", "302587", "302614", "303249", "303853", "303928", "304232", "304425", "304601", "304633",
331  "304682", "304748", "304860", "305127", "305217", "305472", "305702", "305874",
332 
333  "315059", "315435", "315591", "315809", "316190", "316191", "316192", "316396", "316672", "316748", "316774",
334  "316814", "316885", "316967", "317048", "317113", "317199", "317359", "317423", "317598", "317679", "317724",
335  "317783", "317975", "320576", "321326", "321353", "321444", "321858", "321863", "323505", "324704"
336 
337  //================== 345 LASER runs of 2018:
338  /*
339 ,
340 "315059", "315064", "315082", "315276", "315435", "315442", "315586", "315591", "315600", "315604", "315606", "315609", "315612", "315808", "315809", "315979", "315988", "315994", "315997", "316071", "316074", "316117", "316118", "316190", "316191", "316192", "316193", "316194", "316244", "316248", "316250", "316253", "316257", "316298", "316300", "316303", "316304", "316309", "316384", "316392", "316396", "316397", "316401", "316402", "316476", "316479", "316481", "316484", "316488", "316520", "316521", "316523", "316526", "316527", "316528", "316570", "316572", "316573", "316574", "316622", "316623", "316625", "316628", "316669", "316670", "316671", "316672", "316673", "316744", "316748", "316771", "316772", "316774", "316776", "316777", "316812", "316814", "316818", "316819", "316822", "316832", "316834", "316836", "316837", "316838", "316884", "316885", "316887", "316888", "316966", "316967", "316969", "316970", "317000", "317003", "317005", "317009", "317012", "317044", "317048", "317109", "317113", "317123", "317135", "317137", "317142", "317145", "317147", "317195", "317197", "317198", "317199", "317237", "317238", "317307", "317310", "317311", "317324", "317332", "317356", "317359", "317360", "317361", "317364", "317365", "317366", "317369", "317370", "317423", "317424", "317426", "317427", "317597", "317598", "317676", "317679", "317723", "317724", "317731", "317732", "317733", "317782", "317783", "317967", "317975", "317990", "317991", "317992", "317993", "317994", "317995", "317996", "317997", "318188", "318190", "318591", "318592", "318593", "318594", "318595", "318596", "318597", "318599", "318692", "318694", "318753", "318754", "318759", "318760", "318761", "318763", "318764", "319199", "319200", "319201", "319208", "319210", "319522", "319607", "319608", "319613", "319614", "319963", "320106", "320107", "320118", "320119", "320121", "320123", "320124", "320126", "320224", "320226", "320355", "320356", "320362", "320363", "320364", "320365", "320367", "320575", "320576", "320580", "320581", "320582", "320583", "320584", "320868", "320870", "320874", "320876", "320878", "321030", "321031", "321037", "321039", "321040", "321041", "321042", "321044", "321193", "321195", "321324", "321325", "321326", "321353", "321355", "321362", "321363", "321366", "321367", "321368", "321418", "321422", "321444", "321448", "321449", "321450", "321452", "321453", "321454", "321571", "321575", "321590", "321591", "321697", "321700", "321703", "321805", "321808", "321809", "321811", "321812", "321854", "321858", "321860", "321863", "321873", "321876", "321890", "322161", "322162", "322241", "322242", "322265", "322266", "322268", "322270", "322273", "322411", "322412", "322420", "322421", "322832", "322834", "322859", "322861", "323505", "323506", "323581", "323582", "323584", "323735", "323736", "323743", "323745", "323746", "323747", "323748", "324080", "324081", "324082", "324085", "324092", "324095", "324096", "324097", "324106", "324109", "324139", "324140", "324141", "324142", "324143", "324144", "324216", "324217", "324226", "324227", "324228", "324229", "324230", "324589", "324676", "324677", "324703", "324704", "324922", "324927", "325265", "325266", "325451", "325452", "325634", "325635", "325636", "325638", "326444", "326445", "326447", "326448", "327672", "327678", "327680", "327681"
341 */
342 
343  }; //
344  /*
345 P: 0 - 101: 0-49 & 50-101 -> 66-101(2017)
346 yearcase=1: since 10.05.2016 up to 15.11.2016
347 yearcase=2: since 31.05.2017 up to 30.10.2017
348 yearcase=3: since 10.05.2016 up to 30.10.2017
349 */
350  Float_t X0P[NMAXP] = {
351  1., 4., 15., 20., 22., 25., 26., 28., 30., 38., 43., 46., 48., 50., 55., 57., 59., 59.,
352  60., 62., 67., 74., 77., 85., 87., 90., 93., 99., 103., 109., 112., 114., 119., 120., 121., 123.,
353  145., 154., 155., 155., 156., 157., 160., 161., 161., 162., 165., 166., 169., 190.,
354 
355  197., 200., 277., 284., 284., 284., 287., 287., 287., 287., 287., 291., 291., 291., 291., 304., 387., 401.,
356  404., 413., 414., 415., 416., 420., 422., 423., 428., 437., 444., 448., 479., 481., 485., 485., 485., 489.,
357  490., 498., 504., 505., 511., 513., 515., 516., 518., 519., 521., 525., 527., 532., 535., 539.,
358 
359  715., 721., 723., 728., 733., 733., 733., 737., 742., 743., 744., 745., 746., 748., 749., 750., 751., 755.,
360  756., 760., 763., 764., 766., 770., 813., 829., 829., 832., 840., 840., 869., 889.
361 
362  // to be added... 2018
363 
364  }; // days of year time points (abscissa) !!!
365 
366  // for(int jjj = 1; jjj<=NMAXP; jjj++){
367  // X0P[101+jjj] = 715. + jjj ;
368  // }
369 
371  // const Int_t NMAXM = 94;// number of LASER runs(time abscissa) 47+623 = 670 -7 = 663 47+47
372  //const Int_t NMAXM = 429;// number of LASER runs(time abscissa) 47+623 = 670 -7 = 663 47+47
373  //const Int_t NMAXM = 397;// number of LASER runs(time abscissa) 47+623 = 670 -7 = 663 47+47
374  // 94 + 27 = 121
375  const Int_t NMAXM = 121; // number of LASER runs(time abscissa) 47+623 = 670 -7 = 663 47+47
376  TString LASERrunsM[NMAXM] = {
377  "272967", "273211", "273460", "273562", "273897", "274355", "274408", "274765", "275017", "275272",
378  "275357", "275706", "275874", "276252", "276420", "276470", "276478", "276522", "276532", "276860",
379  "277133", "277174", "277869", "278071", "278221", "278325", "278590", "278898", "279097", "279701",
380  "279802", "279909", "280138", "280202", "280207", "280264", "280376", "282042", "282243", "283325",
381  "283364", "283400", "283443", "283799", "283837", "284735", "285353",
382 
383  "285699", "286399", "287041", "288987", "290828", "293565", "295406", "295677", "295930", "295986",
384  "296189", "296809", "297083", "297524", "297572", "297631", "297690", "297848", "298101", "298294",
385  "298717", "298802", "299459", "299965", "300176", "302105", "302250", "302432", "302433", "302461",
386  "302586", "302607", "303482", "303492", "303849", "303923", "304235", "304424", "304553", "304631",
387  "304678", "304746", "304858", "305214", "305468", "305701", "305871",
388 
389  "315056", "315586", "315808", "316118", "316193", "316194", "316253", "316527", "316528", "316772",
390  "316812", "316884", "316966", "317044", "317109", "317198", "317310", "317356", "317424", "317597",
391  "317723", "317782", "317967", "319607", "321030", "325265", "325634"
392 
393  //================== 302 LASER runs of 2018:
394  /*
395 ,
396 "315056",
397 "315064","315082","315276","315442","315586","315600","315604","315609","315612","315808","315979","315988","315994","315997","316071","316074","316117","316118","316193","316194","316244","316248","316250","316253","316257",
398 "316298","316300","316303","316304","316309","316384","316392","316397","316401","316402","316476","316479","316481","316484","316488","316520","316521","316523","316526","316527","316528","316570","316572","316574","316622",
399 "316623","316625","316628","316669","316670","316671","316673","316744","316771","316772","316776","316777","316812","316818","316819","316822","316832","316834","316836","316837","316838","316884","316887","316888","316966",
400 "316969","316970","317000","317003","317005","317009","317012","317044","317109","317123","317135","317137","317142","317145","317147","317195","317197","317198","317237","317238","317307","317310","317311","317324","317332",
401 "317356","317360","317361","317364","317365","317366","317369","317370","317424","317426","317427","317597","317676","317723","317731","317732","317733","317782","317967","317990","317991","317992","317993","317994","317995",
402 "317996","317997","318188","318190","318591","318592","318593","318594","318595","318596","318597","318599","318692","318694","318753","318754","318759","318760","318761","318763","318764","319199","319200","319201","319208",
403 "319210","319522","319607","319608","319613","319614","319963","320106","320107","320118","320119","320121","320123","320124","320126","320224","320226","320355","320356","320362","320363","320364","320365","320367","320575",
404 "320580","320581","320582","320583","320584","320868","320870","320874","320876","320878","321030","321031","321037","321039","321040","321041","321042","321044","321193","321195","321324","321325","321326","321355","321362",
405 "321363","321366","321367","321368","321418","321422","321448","321449","321450","321452","321453","321454","321571","321575","321590","321591","321697","321700","321703","321805","321808","321809","321811","321812","321854",
406 "321860","321873","321876","321890","322161","322162","322241","322242","322265","322266","322268","322270","322273","322411","322412","322420","322421","322832","322834","322859","322861","323506","323581","323582","323584",
407 "323735","323736","323743","323745","323746","323747","323748","324080","324081","324082","324085","324092","324095","324096","324097","324106","324109","324139","324140","324141","324142","324143","324144","324216","324217",
408 "324226","324227","324228","324229","324230","324589","324676","324677","324703","324922","324927","325265","325266","325451","325452","325634","325635","325636","325638","326444","326445","326447","326448","327672","327678",
409 "327680","327681"
410 
411 //================== 335 LASER runs of 2018:
412 "315056", "315064", "315082", "315276", "315435", "315442", "315586", "315591", "315600", "315604", "315606", "315609", "315612", "315808", "315809", "315979", "315988", "315994", "315997", "316071", "316074", "316117", "316118", "316190", "316191", "316192", "316193", "316194", "316244", "316248", "316250", "316253", "316257", "316298", "316300", "316303", "316304", "316309", "316384", "316392", "316396", "316397", "316401", "316402", "316476", "316479", "316481", "316484", "316488", "316520", "316521", "316523", "316526", "316527", "316528", "316570", "316572", "316573", "316574", "316622", "316623", "316625", "316628", "316669", "316670", "316671", "316672", "316673", "316744", "316748", "316771", "316772", "316774", "316776", "316777", "316812", "316814", "316818", "316819", "316822", "316832", "316834", "316836", "316837", "316838", "316884", "316885", "316887", "316888", "316966", "316967", "316969", "316970", "317000", "317003", "317005", "317009", "317012", "317044", "317048", "317109", "317113", "317123", "317135", "317137", "317142", "317145", "317147", "317195", "317197", "317198", "317199", "317237", "317238", "317307", "317310", "317311", "317324", "317332", "317356", "317359", "317360", "317361", "317364", "317365", "317366", "317369", "317370", "317423", "317424", "317426", "317427", "317597", "317598", "317676", "317679", "317723", "317724", "317731", "317732", "317733", "317782", "317783", "317967", "317975", "317990", "317991", "317992", "317993", "317994", "317995", "317996", "317997", "318188", "318190", "318591", "318592", "318593", "318594", "318595", "318596", "318597", "318599", "318692", "318694", "318753", "318754", "318759", "318760", "318761", "318763", "318764", "319199", "319200", "319201", "319208", "319210", "319522", "319607", "319608", "319613", "319614", "319963", "320106", "320107", "320118", "320119", "320121", "320123", "320124", "320126", "320224", "320226", "320355", "320356", "320362", "320363", "320364", "320365", "320367", "320575", "320576", "320580", "320581", "320582", "320583", "320584", "320868", "320870", "320874", "320876", "320878", "321030", "321031", "321037", "321039", "321040", "321041", "321042", "321044", "321193", "321195", "321324", "321325", "321326", "321353", "321355", "321362", "321363", "321366", "321367", "321368", "321418", "321422", "321444", "321448", "321449", "321450", "321452", "321453", "321454", "321571", "321575", "321590", "321591", "321697", "321700", "321703", "321805", "321808", "321809", "321811", "321812", "321854", "321858", "321860", "321863", "321873", "321876", "321890", "322161", "322162", "322241", "322242", "322265", "322266", "322268", "322270", "322273", "322411", "322412", "322420", "322421", "322832", "322834", "322859", "322861", "323505", "323506", "323581", "323582", "323584", "323735", "323736", "323743", "323745", "323746", "323747", "323748", "324080", "324081", "324082", "324085", "324092", "324095", "324096", "324097", "324106", "324109", "324139", "324140", "324141", "324142", "324143", "324144", "324216", "324217", "324226", "324227", "324228", "324229", "324230", "324589", "324676", "324677", "324703", "324704", "324922", "324927", "325265", "325266", "325451", "325452", "325634", "325635", "325636", "325638", "326444", "326445", "326447", "326448", "327672", "327678", "327680", "327681"
413 */
414 
415  };
416  // 22.10 06.11 15.11
417  /*
418 P: 0 - 93: 0-46 & 47-93 -> -> 53-93(2017)
419 yearcase=1: since 10.05.2016 up to 15.11.2016
420 yearcase=2: since 28.05.2017 up to 30.10.2017
421 yearcase=3: since 10.05.2016 up to 30.10.2017
422 */
423  Float_t X0M[NMAXM] = {1., 3., 6., 9., 15., 25., 26., 30., 36., 38., 41., 46., 50., 55., 57., 59.,
424  59., 60., 61., 68., 74., 75., 83., 85., 87., 90., 93., 99., 103., 111., 114., 116.,
425  119., 120., 120., 121., 123., 145., 148., 159., 161., 161., 162., 165., 166., 181., 190.,
426 
427  197., 207., 273., 304., 329., 364., 384., 387., 389., 390., 393., 401., 404., 413., 414., 415.,
428  416., 420., 422., 423., 427., 428., 437., 444., 448., 479., 481., 485., 485., 486., 489., 490.,
429  500., 500., 504., 505., 511., 513., 515., 516., 518., 519., 521., 527., 532., 535., 539.,
430 
431  715., 723., 728., 732., 733., 733., 735., 739., 739., 744., 745., 746., 747., 748., 749., 750.,
432  752., 754., 755., 759., 763., 765., 769., 795., 820., 899., 899.
433 
434  }; // days of year time points (abscissa) !!!
435 
436  // for(int jjj = 1; jjj<=NMAXM; jjj++){
437  // X0M[93+jjj] = 715. + jjj ;
438  // }
439 
444  //______________________________________________________________________________
445  //______________________________________________________________________________
446  //______________________________________________________________________________
447  //______________________________________________________________________________
448  // 2016 only: yearcase=1
449  // 2017 only: yearcase=2
450  // 20167 : yearcase=3
451  // 2018 only: yearcase=4
452  // 201678 : yearcase=5
453 
454  //define yearcase:
455  // ____________________________________________________________________________ THIS line below is MAIN to make a yearcase selection !!!!!!!!!!!!!!!!!!!!!!!!!!
456  const Int_t yearcase = 4;
457  //______________________________________________________________________________
458 
459  //______________________________________________________________________________
460  // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// flaglumiuse
461  Int_t flaglumiuse = 2; // =0-days; =1-lumi1; =2-lumi2(recomendent);
462 
463  // Int_t flaglumiuse = 0; // =0-days; =1-lumi1; =2-lumi2;
464  cout << "!!********************* flaglumiuse = " << flaglumiuse << endl;
465 
466  //______________________________________________________________________________
467  //
468  //---=[ SetCanvasDef ]=----------------
469  // Create a new canvas.
470  TCanvas *c1 = new TCanvas("c1", "Hcal4test", 10, 10, 900, 700);
471  //TCanvas *c1 = new TCanvas("c1","Hcal4test",200,10,700,900);
472 
473  c1->Range(0, 0, 25, 18);
474  //c1->SetFillColor(40);
475  c1->SetFillColor(0);
476  c1->Clear();
477 
478  TLatex *t = new TLatex();
479  t->SetTextFont(32);
480  //t->SetTextColor(4);
481  t->SetTextSize(0.03);
482  t->SetTextAlign(12);
483  //______________________________________________________________________________
484  t->DrawLatex(0.9,
485  15.5,
486  "Time dependence of full Amplitude averaged over events of each LASER run for some random HE channels");
487 
488  //-----------------------------------------------------------------------------------------------------
489  //
490  // x1 y1 x2 y2
491  // pad1->DrawFrame(1, 0.8, 370, 1.2);// all
492 
493  //
494 
495  // x(abscissa) for Days, no Lumi:
496  //(yearcase == 1
497  Float_t x1 = 0.00;
498  Float_t x2 = 200.00;
499  int Dref = 3;
500  int DepthMax = 4; // depthes: for ref channel & #depthes
501  if (yearcase == 2)
502  x2 = 200.00;
503  if (yearcase == 3)
504  x2 = 550.00;
505  if (yearcase == 4)
506  x2 = 200.00;
507  if (yearcase == 5)
508  x2 = 900.00;
509 
510  // y(ordinate) for All Days and Lumi:
511  //(yearcase == 1
512  Float_t y1 = 0.60;
513  Float_t y2 = 1.01; // for 1,2,5,6 for 11,12,15,16
514  Float_t y3 = 0.85;
515  Float_t y4 = 1.01; // for 3,4 for 13,14
516  Float_t y5 = 0.70;
517  Float_t y6 = 1.01; // for 7,8 for 17,18
518  if (yearcase == 2) {
519  y1 = 0.60;
520  y2 = 1.01; // 11: 0.40 12: 0.40 15: 0.40 16: 0.40 -> same for 1,2,5,6
521  y3 = 0.85;
522  y4 = 1.01; // 13: 0.85 14: 0.75 0.8 18: 0.75 0.8 -> same for 3,4
523  y5 = 0.70;
524  y6 = 1.01; // 17: 0.5 18: 0.75 -> same for 7,8
525  }
526  if (yearcase == 3) {
527  y1 = 0.40;
528  y2 = 1.01; // 11: 0.40 12: 0.40 15: 0.40 16: 0.40 -> same for 1,2,5,6
529  y3 = 0.75;
530  y4 = 1.01; // 13: 0.85 14: 0.75 0.8 18: 0.75 0.8 -> same for 3,4
531  y5 = 0.60;
532  y6 = 1.01; // 17: 0.5 18: 0.75 -> same for 7,8
533  }
534  if (yearcase == 4) {
535  Dref = 4;
536  DepthMax = 8;
537  y1 = 0.60;
538  y2 = 1.01; // 11: 0.40 12: 0.40 15: 0.40 16: 0.40 -> same for 1,2,5,6
539  y3 = 0.85;
540  y4 = 1.01; // 13: 0.85 14: 0.75 0.8 18: 0.75 0.8 -> same for 3,4
541  y5 = 0.70;
542  y6 = 1.01; // 17: 0.5 18: 0.75 -> same for 7,8
543  }
544  if (yearcase > 4) {
545  Dref = 4;
546  DepthMax = 8;
547  y1 = 0.30;
548  y2 = 1.01; // 11: 0.40 12: 0.40 15: 0.40 16: 0.40 -> same for 1,2,5,6
549  y3 = 0.65;
550  y4 = 1.01; // 13: 0.85 14: 0.75 0.8 18: 0.75 0.8 -> same for 3,4
551  y5 = 0.50;
552  y6 = 1.01; // 17: 0.5 18: 0.75 -> same for 7,8
553  }
554 
555  //
556  Float_t xx1 = 0.12;
557  Float_t xx2 = 0.31;
558  Float_t yy1 = 0.17;
559  Float_t yy2 = 0.38;
560  //
561  //-----------------------------------------------------------------------------------------------------
562  //-----------------------------------------------------------------------------------------------------
564  // define max size of massives (to be just NMAXSIZE ):
565  Int_t NMAXSIZE = NMAXM;
566  if (NMAXP > NMAXM)
567  NMAXSIZE = NMAXP;
568  //----------------------------------------------------------------------
569  Float_t X0[NMAXSIZE];
570  TString LASERruns[NMAXSIZE];
571  Double_t XX[NMAXSIZE];
572  Double_t XXE[NMAXSIZE];
573  const Int_t NDEP = 8;
574  const Int_t NETA = 14;
575  const Int_t NETA0 = 83;
576  const Int_t NPHI0 = 73;
577 
578  Double_t ZZM[NMAXSIZE][NDEP][NETA];
579  Double_t ZZP[NMAXSIZE][NDEP][NETA];
580  Double_t YY[NMAXSIZE];
581  Double_t YYE[NMAXSIZE];
582  //
583  Double_t mapRADDAM_HE[NDEP][NETA0][NPHI0];
584  Double_t mapRADDAM_HED2[NDEP][NETA0];
585  Int_t mapRADDAM_HED20[NDEP][NETA0];
586  Float_t gainRADDAM_HE[NDEP][NETA0][NPHI0];
587  Double_t normM[NDEP][NETA0][NPHI0];
588  Double_t normP[NDEP][NETA0][NPHI0];
589 
590  Double_t THETA[13] = {17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29.};
591  Double_t RRM[13];
592  Double_t RRP[13];
593  Double_t THETA7[11] = {18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28.};
594  Double_t RRM7[11];
595  Double_t RRP7[11];
596  for (int ij = 0; ij < 13; ij++) {
597  RRM[ij] = 0.;
598  RRP[ij] = 0.;
599  }
600  for (int ij = 0; ij < 11; ij++) {
601  RRM7[ij] = 0.;
602  RRP7[ij] = 0.;
603  }
605  TH1F *phidependenceM = new TH1F("phidependenceM", "", 72, 0., 72.);
606  TH1F *phidependenceM0 = new TH1F("phidependenceM0", "", 72, 0., 72.);
607  TH1F *phidependenceP = new TH1F("phidependenceP", "", 72, 0., 72.);
608  TH1F *phidependenceP0 = new TH1F("phidependenceP0", "", 72, 0., 72.);
609  TH1F *phidepdrawing30 = (TH1F *)phidependenceM->Clone("phidepdrawing30");
610  TH1F *phidepdrawing31 = (TH1F *)phidependenceP->Clone("phidepdrawing31");
611  TH1F *phiRRM = new TH1F("phiRRM", "", 100, 0., 5.);
612  TH1F *phiRRP = new TH1F("phiRRP", "", 100, 0., 5.);
613  // variant of order of normalization ; =2 as V.Epshteyn
614  Int_t variant = 1;
615  // Int_t variant = 2;// does not work properly for moment(30.03.2017)
618  // define where to run inside massives above:
619  Int_t NMINmM = -1;
620  Int_t NMAXmM = -1;
621  Int_t NMAXaM = -1;
622  Int_t NMINmP = -1;
623  Int_t NMAXmP = -1;
624  Int_t NMAXaP = -1;
625  if (yearcase == 1) {
626  // 2016 only: yearcase=1
627  NMINmM = 0;
628  NMAXmM = 46;
629  NMAXaM = 47; // M
630  NMINmP = 0;
631  NMAXmP = 49;
632  NMAXaP = 50; // P
633  } else if (yearcase == 2) {
634  // 2017 only:: yearcase=2
635  // NMINmM = 47; NMAXmM = 93; NMAXaM = 47; // M
636  // NMINmP = 50; NMAXmP = 101; NMAXaP = 52; // P
637  NMINmM = 53;
638  NMAXmM = 93;
639  NMAXaM = 41; // M
640  NMINmP = 66;
641  NMAXmP = 101;
642  NMAXaP = 36; // P
643  } else if (yearcase == 3) {
644  // 20167 only:: yearcase=3
645  NMINmM = 0;
646  NMAXmM = 93;
647  NMAXaM = 94; // M
648  NMINmP = 0;
649  NMAXmP = 101;
650  NMAXaP = 102; // P
651  } else if (yearcase == 4) {
652  // 2018 only:: yearcase=4
653  // NMINmM = 94; NMAXmM = 428; NMAXaM =335; // M 428-94+1=335
654  // NMINmM = 94; NMAXmM = 396; NMAXaM =303; // M 396-94+1=303
655  NMINmM = 94;
656  NMAXmM = 120;
657  NMAXaM = 27; // M 120-94+1=27
658  // NMINmP = 102; NMAXmP = 436; NMAXaP =335; // P 436-102+1=335
659  NMINmP = 102;
660  NMAXmP = 133;
661  NMAXaP = 32; // P 133-102+1=32
662  } else if (yearcase == 5) {
663  // 20168 only:: yearcase=5
664  NMINmM = 0;
665  NMAXmM = -1;
666  NMAXaM = -1; // M
667  NMINmP = 0;
668  NMAXmP = -1;
669  NMAXaP = -1; // P
670  }
671 
672  if (NMINmM == -1 || NMAXmM == -1 || NMAXaM == -1 || NMINmP == -1 || NMAXmP == -1 || NMAXaP == -1)
673  cout << " STOP !!!!!! NMINmM == -1 || NMAXmM == -1 || NMAXaM == -1 || NMINmP == -1 || NMAXmP == -1 || NMAXaP "
674  "== -1"
675  << endl;
676 
684  Int_t NMAX = 0;
685  // kdirection: negative dir M:=0 ; positive dir P: =1
686  for (int kdirection = 0; kdirection < 2; kdirection++) {
687  //------------------------------------------------------
688  // M:
689  if (kdirection == 0) {
690  NMAX = NMAXaM;
691  // cout << "NMAX= " << NMAX << "NMINmM= " << NMINmM << "NMAXmM= " << NMAXmM <<endl;
692  for (int jjj = NMINmM; jjj <= NMAXmM; jjj++) {
693  LASERruns[jjj - NMINmM] = LASERrunsM[jjj];
694  X0[jjj - NMINmM] = X0M[jjj];
695  // cout << "jjj= " << jjj << " jjj-NMINmM= " << jjj-NMINmM << " LASERrunsM[jjj]= " << LASERrunsM[jjj] << " X0M[jjj]= " << X0M[jjj] <<endl;
696  }
697  }
698  // P:
699  else if (kdirection == 1) {
700  NMAX = NMAXaP;
701  // cout << "NMAX= " << NMAX << "NMINmP= " << NMINmP << "NMAXmP= " << NMAXmP <<endl;
702  for (int jjj = NMINmP; jjj <= NMAXmP; jjj++) {
703  LASERruns[jjj - NMINmP] = LASERrunsP[jjj];
704  X0[jjj - NMINmP] = X0P[jjj];
705  // cout << "jjj= " << jjj << " jjj-NMINmP= " << jjj-NMINmP << " LASERrunsP[jjj]= " << LASERrunsP[jjj] << " X0P[jjj]= " << X0P[jjj] <<endl;
706  }
707  }
709  //========================================================================================================================
710  //---------------------------------------------------------------------------------------------------------------------
711  //---------------------------------------------------------------------------------------------------------------------
712  // Int_t NP = 3; // for loop over time points(LASER runs) NMAX is number of LASER runs(time abscissa)
713  Int_t NP = NMAX; // for loop over time points(LASER runs) NMAX is number of LASER runs(time abscissa)
714  cout << "************************-=============================*************************=======__________++++++++++"
715  "================================================= NP = "
716  << NP << endl;
717  cout << "***********************++++++++++================================================= kdirection = "
718  << kdirection << endl;
719  //
720  //--------------------------------------------------------------------------------------------------------------------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
721  // ------ flagcutamplitude is very important flag !!!!!! :
722  //
723  // = 0 Acut =1 (mean_with_kfactor + cutMinA) =2 (mean_with_k2factor*RMS +cutMinA) <--- all works good; plots are perfect for =2(default now)
724  Int_t flagcutamplitude = 0;
725  // take into account for future treatment only channels with <Aijk>_runevents within cutMinA to cutMaxA:
726  Double_t cutMinA = 10.;
727  Double_t cutMaxA = 50000.;
728  if (kdirection == 0) {
729  cutMinA = 100.;
730  cutMaxA = 3600.;
731  } // only for flagcutamplitude=0 !!!!!!!!!!!!!!!!!!!!!!!!!
732  //Double_t cutMinA = 70.; Double_t cutMaxA = 3500.; if(kdirection == 0 ) {cutMinA =100.;cutMaxA = 3600.;} // only for flagcutamplitude=0
733  Double_t kfactor = 2.6; // only for flagcutamplitude=1 and cutMinA applied as well
734  Double_t k2factor = 1.5; // only for flagcutamplitude=2 and cutMinA applied as well
735 
736  cout << "!!********************* flagcutamplitude= " << flagcutamplitude << endl;
737  if (flagcutamplitude == 1)
738  cout << " kfactor= " << kfactor << endl;
739  if (flagcutamplitude == 2)
740  cout << " k2factor= " << k2factor << endl;
741  //
742  //
743  // /// // // // / // // // // // // // //
744  Double_t cutMinM = 600.;
745  if (kdirection == 0)
746  cutMinM = 800.; // mean value in whole run for run selections: to choose/reject whole run
747  //
748  // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
749  //----------------------------------------------------------------------first ratio Aijk/Aijk_ref ----> cut Rijk
750  // for flagcutamplitude = 2 :
751  Double_t CutrwithphiMin = 0.0;
752  Double_t CutrwithphiMax = 6.0; // P
753  if (kdirection == 0) {
754  CutrwithphiMin = 0.0;
755  CutrwithphiMax = 6.0;
756  } // M
757  // for flagcutamplitude = 0 and 1 :
758  if (flagcutamplitude < 2) {
759  CutrwithphiMin = 0.0;
760  CutrwithphiMax = 6.0; // P
761  if (kdirection == 0) {
762  CutrwithphiMin = 0.0;
763  CutrwithphiMax = 6.0;
764  } // M
765  }
766  //---------------------------------------------------------------------------------------------------------------------
767  //---------------------------------------------------------------------------------------------------------------------
768  //----------------------------------------------------------------------------------------------------- cut rr
769  // Double_t CutrrwithphiMin = 0.4; Double_t CutrrwithphiMax = 99991.5; // P
770  // if(kdirection == 0 ){CutrrwithphiMin = 0.4; CutrrwithphiMax = 99991.5;} // M
771  Double_t CutrrwithphiMin = 0.0;
772  Double_t CutrrwithphiMax = 4.0; // P
773  if (kdirection == 0) {
774  CutrrwithphiMin = 0.0;
775  CutrrwithphiMax = 3.0;
776  } // M
777  //---------------------------------------------------------------------------------------------------------------------
778  //---------------------------------------------------------------------------------------------------------------------
779  //---------------------------------------------------------------------------------------------------------------------
780  //---------------------------------------------------------------------------------------------------------------------
781  //---------------------------------------------------------------------------------------------------------------------Var2 (cut rr)
782  // Float_t CutrwithphiMinVar2 = 0.4; Float_t CutrwithphiMaxVar2 = 1.4; // P
783  // if(kdirection == 0 ){CutrwithphiMinVar2 = 0.4; CutrwithphiMaxVar2 = 2.0;} // M
784 
785  Double_t CutrwithphiMinVar2 = 0.1;
786  Double_t CutrwithphiMaxVar2 = 1.5; // P
787  if (kdirection == 0) {
788  CutrwithphiMinVar2 = 0.1;
789  CutrwithphiMaxVar2 = 1.5;
790  } // M
791 
792  //---------------------------------------------------------------------------------------------------------------------
793  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! flaglumiuse
794  //-----------------------------------------------------------------------------------------------------
795  for (int kk1 = 0; kk1 < NP; kk1++) {
796  XX[kk1] = X0[kk1];
797  int k10 = 0;
798  int z1 = X0[k10];
799  XX[kk1] -= z1;
800  XXE[kk1] = 0.001 * XX[kk1];
801  } //XXE - errors at fit
802  // use lumi ??? and which one ???:
803  // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// flaggaincorrections
804  Int_t flaggaincorrections = 0; // =0 do not use; =1 use corrections
805  // Int_t flaggaincorrections = 1; // =0 do not use; =1 use corrections
806  cout << " !!********************* flaggaincorrections = " << flaggaincorrections << endl;
807  //----------------------------------------------------------------------------------------------------- for test with test-LU
808  // if(flaglumiuse == 0) {for(int k1 = 0; k1<NP; k1++){ int z1=X0[k1]; XX[k1] = LU[z1];} }
809  //-----------------------------------------------------------------------------------------------------
810  if (flaglumiuse == 1) {
811  for (int k1 = 0; k1 < NP; k1++) {
812  int z1 = X0[k1];
813  XX[k1] = LU1[z1];
814  }
815  }
816  //-----------------------------------------------------------------------------------------------------
817  if (flaglumiuse == 2) {
818  for (int k1 = 0; k1 < NP; k1++) {
819  int z1 = X0[k1];
820  XX[k1] = LU2[z1];
821  int k10 = 0;
822  z1 = X0[k10];
823  XX[k1] -= LU2[z1];
824  //cout << " k1 = " << k1 << " z1 = " << z1 << " XX[k1] = " << XX[k1] <<endl;
825  }
826  }
827 
828  // x(abscissa) for Lumi: re-define x2 (wrt days):
829  if (flaglumiuse > 0) {
830  if (yearcase == 1)
831  x2 = 45.0;
832  if (yearcase == 2)
833  x2 = 50.0;
834  if (yearcase == 3)
835  x2 = 95.0;
836  if (yearcase == 4)
837  x2 = 70.0;
838  if (yearcase == 5)
839  x2 = 165.0;
840  }
841  //-----------------------------------------------------------------------------------------------------
842  // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
843  Int_t verbosity =
844  0; // =0 no printout; =9 run selection; others >0 - validation tests
845  //
846  // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2016 & 2017:
847  //
848  // jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
849  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
850  //
851  //
852  // M:L7 for(int k1 = 0; k1<NP; k1++){for(int iii=2;iii<4;iii++) {for (int jj=0;jj<=13;jj++) {
853  // P:L7 for(int k1 = 0; k1<NP; k1++){for(int iii=???...
854 
855  // L1: (iii=d1 & eta 17-29);
856  // M: int LM1 = 0;if((iii==1 && jj<13)) LM1 = 1;
857  // P: int LP1 = 0;if((iii==1 && jj> 0)) LP1 = 1;
858 
859  // :L7: (iii=d2 & eta 17-26) && (iii=d3 & eta 27-28)
860  // M: int LM7=0;if((iii==2 && jj>2 && jj<13) || (iii==3 && jj> 0 && jj< 3)) LM7=1;
861  // P: int LP7=0;if((iii==2 && jj>0 && jj<11) || (iii==3 && jj>10 && jj<13)) LP7=1;
862  //
863  // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2018:
864  //
865  // jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
866  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
867  //
868  //
869  // M:L7 for(int k1 = 0; k1<NP; k1++){for(int iii=2;iii<4;iii++) {for (int jj=0;jj<=13;jj++) {
870  // P:L7 for(int k1 = 0; k1<NP; k1++){for(int iii=???...
871 
872  // L1: (iii=d2 & eta 17-29);
873  // M: int LM1 = 0;if((iii==2 && jj<13)) LM1 = 1;
874  // P: int LP1 = 0;if((iii==2 && jj> 0)) LP1 = 1;
875 
876  // :L7: (iii=d3 & eta 17) && (iii=d4 & eta 18-25) && (iii=d5 & eta 26-28)
877  // M: int LM7=0;if((iii==3 && jj==12) || (iii==4 && jj> 3 && jj<12) || (iii==5 && jj> 0 && jj< 4)) LM7=1;
878  // P: int LP7=0;if((iii==3 && jj==1 ) || (iii==4 && jj> 1 && jj<10) || (iii==5 && jj> 9 && jj<13)) LP7=1;
879  //
880 
881  //========================================================================================== PLOT0: P Amplitude - 100 5000
882  //----------------------------------------------------------------------------------------------------
883  //========================================================================================== PLOT1: M r vs t for Depth1 and eta 21 22 23 25 27 28 (for tests)
884  //========================================================================================== PLOT2: M r vs t for Depth1 and eta 17 18 19 20 24 26 29 (for tests)
885  //----------------------------------------------------------------------------------------------------
886  //========================================================================================== PLOT3: M r vs t for Depth2 and eta 21 22 23 25 27 28 (for tests)
887  //========================================================================================== PLOT4: M r vs t for Depth2 and eta 17 18 19 20 24 26 (for tests)
888  //----------------------------------------------------------------------------------------------------
889  //========================================================================================== PLOT5: M r vs t for L1 and eta 21 22 23 25 27 28
890  //========================================================================================== PLOT6: M r vs t for L1 and eta 17 18 19 20 24 26 29
891  //----------------------------------------------------------------------------------------------------
892  //========================================================================================== PLOT7: M r vs t for L7 and eta 21 22 23 25 27 28
893  //========================================================================================== PLOT8: M r vs t for L7 and eta 17 18 19 20 24 26 29
894  //----------------------------------------------------------------------------------------------------
895  //========================================================================================== PLOT9: M Amplitude
896  //========================================================================================== PLOT10: P Amplitude Amplitude - 100 200
897  //----------------------------------------------------------------------------------------------------
898  //========================================================================================== PLOT11: P r vs t for Depth1 and eta 21 22 23 25 27 28 (for tests)
899  //========================================================================================== PLOT12: P r vs t for Depth1 and eta 17 18 19 20 24 26 29 (for tests)
900  //----------------------------------------------------------------------------------------------------
901  //========================================================================================== PLOT13: P r vs t for Depth2 and eta 21 22 23 25 27 28 (for tests)
902  //========================================================================================== PLOT14: P r vs t for Depth2 and eta 17 18 19 20 24 26 29 (for tests)
903  //----------------------------------------------------------------------------------------------------
904  //========================================================================================== PLOT15: P r vs t for L1 and eta 21 22 23 25 27 28
905  //========================================================================================== PLOT16: P r vs t for L1 and eta 17 18 19 20 24 26 29
906  //----------------------------------------------------------------------------------------------------
907  //========================================================================================== PLOT17: P r vs t for L7 and eta 21 22 23 25 27 28
908  //========================================================================================== PLOT18: P r vs t for L7 and eta 17 18 19 20 24 26 29
909  //----------------------------------------------------------------------------------------------------
910  //========================================================================================== PLOT19: M Amplitude
911  //========================================================================================== PLOT20: p Mean amplitude 3 Depthed (for tests)
912  //----------------------------------------------------------------------------------------------------
913  //========================================================================================== PLOT21: P r vs t for Depth3 and eta 27 28 (for tests)
914  //----------------------------------------------------------------------------------------------------
915  //========================================================================================== PLOT22: P Rijk
916  //========================================================================================== PLOT23: all gains from 2 LED runs
917  //========================================================================================== PLOT24: M Rijk
918  //----------------------------------------------------------------------------------------------------
919  //========================================================================================== PLOT25: all r(Theta) dependence for P & M
920  //========================================================================================== PLOT26: M RRijkM
921  //========================================================================================== PLOT27: P RRijkP
922  //----------------------------------------------------------------------------------------------------
923  //========================================================================================== PLOT28: M Mean Amplitude
924  //========================================================================================== PLOT29: P Mean Amplitude
925  //----------------------------------------------------------------------------------------------------
926  //========================================================================================== PLOT30: M r(PHI) dependence (for tests)
927  //========================================================================================== PLOT31: P r(PHI) dependence (for tests)
928  //----------------------------------------------------------------------------------------------------
929  //========================================================================================== PLOT32: M: RMS <Aijk>_ev.run for all runs
930  //========================================================================================== PLOT33: P: RMS <Aijk>_ev.run for all runs
931  //----------------------------------------------------------------------------------------------------
932  //========================================================================================== PLOT34: LUMI vs days of 2016+2017+2018
933  //========================================================================================== PLOT35: LUMI vs days of 2016
934  //========================================================================================== PLOT36: LUMI vs days of 2017
935  //========================================================================================== PLOT37: LUMI vs days of 2018
936  //----------------------------------------------------------------------------------------------------
937  //========================================================================================== PLOT28: M RMS Amplitude
938  //========================================================================================== PLOT29: P RMS Amplitude
939  //----------------------------------------------------------------------------------------------------
940  //----------------------------------------------------------------------------------------------------
941  //---------------------------------------------------------------------------------------------------- additions (for tests) after PLOT loop:
942  //----------------------------------------------------------------------------------------------------
943  //========================================================================================== PLOT100: M & P r(PHI) dependence ( PLOT30 & PLOT31 )
944  //========================================================================================== PLOT101: like Rijk M & P (PLOT22 & PLOT24) but w/o bad channels on base RRijk limits
945  //----------------------------------------------------------------------------------------------------
946  //----------------------------------------------------------------------------------------------------
947  //----------------------------------------------------------------------------------------------------
948  //----------------------------------------------------------------------------------------------------
949  //----------------------------------------------------------------------------------------------------
951  for (int iii = 0; iii < DepthMax; iii++) {
952  for (int jjj = 0; jjj <= 82; jjj++) {
953  mapRADDAM_HED2[iii][jjj] = 0.;
954  mapRADDAM_HED20[iii][jjj] = 0.;
955  for (int kkk = 0; kkk <= 72; kkk++) {
956  mapRADDAM_HE[iii][jjj][kkk] = 0.;
957  normM[iii][jjj][kkk] = 0.;
958  normP[iii][jjj][kkk] = 0.;
959  gainRADDAM_HE[iii][jjj][kkk] = 0.;
960  }
961  }
962  }
964  //______________________________________________________________________________ gain corrections:
965  TH1F *gainkoeff = new TH1F("gainkoeff", "", 100, 0.5, 1.5);
966  //TH1F* gainkoeff = new TH1F("gainkoeff","", 100, 0.8,1.2);
967  //__________________________________________________________________________________________________________________________________________ gain corrections:
968  // 2016: 272847(09.05) - 285349(15.11) (time range: 187 days) yearcase=1
969  // 2017: 294054(15.05) - 306249(07.11) (time range: 176 days) yearcase=2
970  // 2016: 272847(09.05) - 306249(07.11) (time range: 548 days) yearcase=3
971 
972  TFile *hfile1 =
973  new TFile("/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LED_272847.root",
974  "READ"); // 2016-05-09
975  TFile *hfile2 =
976  new TFile("/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LED_306249.root",
977  "READ"); //2017-11-07
978  TFile *hfile3 =
979  new TFile("/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LED_272847.root",
980  "READ"); // 2016-05-09
981  TFile *hfile4 =
982  new TFile("/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LED_285349.root",
983  "READ"); //2016-11-15
984  TFile *hfile5 =
985  new TFile("/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LED_294054.root",
986  "READ"); // 2017-05-26
987  TFile *hfile6 =
988  new TFile("/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LED_306249.root",
989  "READ"); //2017-11-07
990 
991  // ref.runs1: key letter is wo
992  TH2F *xwod1 = (TH2F *)hfile1->Get("h_mapDepth1ADCAmpl12_HE");
993  TH2F *xwod2 = (TH2F *)hfile1->Get("h_mapDepth2ADCAmpl12_HE");
994  TH2F *xwod3 = (TH2F *)hfile1->Get("h_mapDepth3ADCAmpl12_HE");
995  TH2F *xwo10 = (TH2F *)hfile1->Get("h_mapDepth1_HE");
996  TH2F *xwo20 = (TH2F *)hfile1->Get("h_mapDepth2_HE");
997  TH2F *xwo30 = (TH2F *)hfile1->Get("h_mapDepth3_HE");
998  TH2F *Xwof1 = (TH2F *)xwod1->Clone("Xwof1");
999  TH2F *Xwof2 = (TH2F *)xwod2->Clone("Xwof2");
1000  TH2F *Xwof3 = (TH2F *)xwod3->Clone("Xwof3");
1001  Xwof1->Divide(xwod1, xwo10, 1, 1, "B");
1002  Xwof2->Divide(xwod2, xwo20, 1, 1, "B");
1003  Xwof3->Divide(xwod3, xwo30, 1, 1, "B");
1004  // last.run1: key letter is wo
1005  TH2F *ywod1 = (TH2F *)hfile2->Get("h_mapDepth1ADCAmpl12_HE");
1006  TH2F *ywod2 = (TH2F *)hfile2->Get("h_mapDepth2ADCAmpl12_HE");
1007  TH2F *ywod3 = (TH2F *)hfile2->Get("h_mapDepth3ADCAmpl12_HE");
1008  TH2F *ywo10 = (TH2F *)hfile2->Get("h_mapDepth1_HE");
1009  TH2F *ywo20 = (TH2F *)hfile2->Get("h_mapDepth2_HE");
1010  TH2F *ywo30 = (TH2F *)hfile2->Get("h_mapDepth3_HE");
1011  TH2F *Ywof1 = (TH2F *)ywod1->Clone("Ywof1");
1012  TH2F *Ywof2 = (TH2F *)ywod2->Clone("Ywof2");
1013  TH2F *Ywof3 = (TH2F *)ywod3->Clone("Ywof3");
1014  Ywof1->Divide(ywod1, ywo10, 1, 1, "B");
1015  Ywof2->Divide(ywod2, ywo20, 1, 1, "B");
1016  Ywof3->Divide(ywod3, ywo30, 1, 1, "B");
1018  // ref.runs2: key letter is yo
1019  TH2F *xyod1 = (TH2F *)hfile3->Get("h_mapDepth1ADCAmpl12_HE");
1020  TH2F *xyod2 = (TH2F *)hfile3->Get("h_mapDepth2ADCAmpl12_HE");
1021  TH2F *xyod3 = (TH2F *)hfile3->Get("h_mapDepth3ADCAmpl12_HE");
1022  TH2F *xyo10 = (TH2F *)hfile3->Get("h_mapDepth1_HE");
1023  TH2F *xyo20 = (TH2F *)hfile3->Get("h_mapDepth2_HE");
1024  TH2F *xyo30 = (TH2F *)hfile3->Get("h_mapDepth3_HE");
1025  TH2F *Xyof1 = (TH2F *)xyod1->Clone("Xyof1");
1026  TH2F *Xyof2 = (TH2F *)xyod2->Clone("Xyof2");
1027  TH2F *Xyof3 = (TH2F *)xyod3->Clone("Xyof3");
1028  Xyof1->Divide(xyod1, xyo10, 1, 1, "B");
1029  Xyof2->Divide(xyod2, xyo20, 1, 1, "B");
1030  Xyof3->Divide(xyod3, xyo30, 1, 1, "B");
1031  // last.run2: key letter is yo
1032  TH2F *yyod1 = (TH2F *)hfile4->Get("h_mapDepth1ADCAmpl12_HE");
1033  TH2F *yyod2 = (TH2F *)hfile4->Get("h_mapDepth2ADCAmpl12_HE");
1034  TH2F *yyod3 = (TH2F *)hfile4->Get("h_mapDepth3ADCAmpl12_HE");
1035  TH2F *yyo10 = (TH2F *)hfile4->Get("h_mapDepth1_HE");
1036  TH2F *yyo20 = (TH2F *)hfile4->Get("h_mapDepth2_HE");
1037  TH2F *yyo30 = (TH2F *)hfile4->Get("h_mapDepth3_HE");
1038  TH2F *Yyof1 = (TH2F *)yyod1->Clone("Yyof1");
1039  TH2F *Yyof2 = (TH2F *)yyod2->Clone("Yyof2");
1040  TH2F *Yyof3 = (TH2F *)yyod3->Clone("Yyof3");
1041  Yyof1->Divide(yyod1, yyo10, 1, 1, "B");
1042  Yyof2->Divide(yyod2, yyo20, 1, 1, "B");
1043  Yyof3->Divide(yyod3, yyo30, 1, 1, "B");
1045  // ref.runs3: key letter is zo
1046  TH2F *xzod1 = (TH2F *)hfile5->Get("h_mapDepth1ADCAmpl12_HE");
1047  TH2F *xzod2 = (TH2F *)hfile5->Get("h_mapDepth2ADCAmpl12_HE");
1048  TH2F *xzod3 = (TH2F *)hfile5->Get("h_mapDepth3ADCAmpl12_HE");
1049  TH2F *xzo10 = (TH2F *)hfile5->Get("h_mapDepth1_HE");
1050  TH2F *xzo20 = (TH2F *)hfile5->Get("h_mapDepth2_HE");
1051  TH2F *xzo30 = (TH2F *)hfile5->Get("h_mapDepth3_HE");
1052  TH2F *Xzof1 = (TH2F *)xzod1->Clone("Xzof1");
1053  TH2F *Xzof2 = (TH2F *)xzod2->Clone("Xzof2");
1054  TH2F *Xzof3 = (TH2F *)xzod3->Clone("Xzof3");
1055  Xzof1->Divide(xzod1, xzo10, 1, 1, "B");
1056  Xzof2->Divide(xzod2, xzo20, 1, 1, "B");
1057  Xzof3->Divide(xzod3, xzo30, 1, 1, "B");
1058  // last.run3: key letter is zo
1059  TH2F *yzod1 = (TH2F *)hfile6->Get("h_mapDepth1ADCAmpl12_HE");
1060  TH2F *yzod2 = (TH2F *)hfile6->Get("h_mapDepth2ADCAmpl12_HE");
1061  TH2F *yzod3 = (TH2F *)hfile6->Get("h_mapDepth3ADCAmpl12_HE");
1062  TH2F *yzo10 = (TH2F *)hfile6->Get("h_mapDepth1_HE");
1063  TH2F *yzo20 = (TH2F *)hfile6->Get("h_mapDepth2_HE");
1064  TH2F *yzo30 = (TH2F *)hfile6->Get("h_mapDepth3_HE");
1065  TH2F *Yzof1 = (TH2F *)yzod1->Clone("Yzof1");
1066  TH2F *Yzof2 = (TH2F *)yzod2->Clone("Yzof2");
1067  TH2F *Yzof3 = (TH2F *)yzod3->Clone("Yzof3");
1068  Yzof1->Divide(yzod1, yzo10, 1, 1, "B");
1069  Yzof2->Divide(yzod2, yzo20, 1, 1, "B");
1070  Yzof3->Divide(yzod3, yzo30, 1, 1, "B");
1072 
1073  // fill massive <Aijk>_runevents , where iii=depth, jjj=eta, kkk=phi
1074  // use wo
1075  int gx = Xwof1->GetXaxis()->GetNbins();
1076  int gy = Xwof1->GetYaxis()->GetNbins();
1077  for (int jjj = 0; jjj < gx; jjj++) {
1078  for (int kkk = 0; kkk < gy; kkk++) {
1079  if (Xwof1->GetBinContent(jjj, kkk) != 0.) {
1080  gainRADDAM_HE[1][jjj][kkk + 1] = (Ywof1->GetBinContent(jjj, kkk) / Xwof1->GetBinContent(jjj, kkk));
1081  }
1082  if (Xwof2->GetBinContent(jjj, kkk) != 0.) {
1083  gainRADDAM_HE[2][jjj][kkk + 1] = (Ywof2->GetBinContent(jjj, kkk) / Xwof2->GetBinContent(jjj, kkk));
1084  }
1085  if (Xwof3->GetBinContent(jjj, kkk) != 0.) {
1086  gainRADDAM_HE[3][jjj][kkk + 1] = (Ywof3->GetBinContent(jjj, kkk) / Xwof3->GetBinContent(jjj, kkk));
1087  }
1088  }
1089  }
1090  // use yo
1091  for (int jjj = 0; jjj < gx; jjj++) {
1092  for (int kkk = 0; kkk < gy; kkk++) {
1093  if (Xyof1->GetBinContent(jjj, kkk) != 0. &&
1094  fabs((Yyof1->GetBinContent(jjj, kkk) / Xyof1->GetBinContent(jjj, kkk)) - 1.) <
1095  fabs(gainRADDAM_HE[1][jjj][kkk + 1] - 1.)) {
1096  gainRADDAM_HE[1][jjj][kkk + 1] = (Yyof1->GetBinContent(jjj, kkk) / Xyof1->GetBinContent(jjj, kkk));
1097  }
1098  if (Xyof2->GetBinContent(jjj, kkk) != 0. &&
1099  fabs((Yyof2->GetBinContent(jjj, kkk) / Xyof2->GetBinContent(jjj, kkk)) - 1.) <
1100  fabs(gainRADDAM_HE[1][jjj][kkk + 1] - 1.)) {
1101  gainRADDAM_HE[2][jjj][kkk + 1] = (Yyof2->GetBinContent(jjj, kkk) / Xyof2->GetBinContent(jjj, kkk));
1102  }
1103  if (Xyof3->GetBinContent(jjj, kkk) != 0. &&
1104  fabs((Yyof3->GetBinContent(jjj, kkk) / Xyof3->GetBinContent(jjj, kkk)) - 1.) <
1105  fabs(gainRADDAM_HE[1][jjj][kkk + 1] - 1.)) {
1106  gainRADDAM_HE[3][jjj][kkk + 1] = (Yyof3->GetBinContent(jjj, kkk) / Xyof3->GetBinContent(jjj, kkk));
1107  }
1108  }
1109  }
1110  // use zo
1111  for (int jjj = 0; jjj < gx; jjj++) {
1112  for (int kkk = 0; kkk < gy; kkk++) {
1113  if (Xzof1->GetBinContent(jjj, kkk) != 0. &&
1114  fabs((Yzof1->GetBinContent(jjj, kkk) / Xzof1->GetBinContent(jjj, kkk)) - 1.) <
1115  fabs(gainRADDAM_HE[1][jjj][kkk + 1] - 1.)) {
1116  gainRADDAM_HE[1][jjj][kkk + 1] = (Yzof1->GetBinContent(jjj, kkk) / Xzof1->GetBinContent(jjj, kkk));
1117  }
1118  if (Xzof2->GetBinContent(jjj, kkk) != 0. &&
1119  fabs((Yzof2->GetBinContent(jjj, kkk) / Xzof2->GetBinContent(jjj, kkk)) - 1.) <
1120  fabs(gainRADDAM_HE[1][jjj][kkk + 1] - 1.)) {
1121  gainRADDAM_HE[2][jjj][kkk + 1] = (Yzof2->GetBinContent(jjj, kkk) / Xzof2->GetBinContent(jjj, kkk));
1122  }
1123  if (Xzof3->GetBinContent(jjj, kkk) != 0. &&
1124  fabs((Yzof3->GetBinContent(jjj, kkk) / Xzof3->GetBinContent(jjj, kkk)) - 1.) <
1125  fabs(gainRADDAM_HE[1][jjj][kkk + 1] - 1.)) {
1126  gainRADDAM_HE[3][jjj][kkk + 1] = (Yzof3->GetBinContent(jjj, kkk) / Xzof3->GetBinContent(jjj, kkk));
1127  }
1128  }
1129  }
1130 
1132  // fill massive gainkoeff , where iii=depth, jjj=eta, kkk=phi
1133  for (int iii = 1; iii < DepthMax; iii++) {
1134  for (int jjj = 1; jjj <= 82; jjj++) {
1135  for (int kkk = 1; kkk <= 72; kkk++) {
1136  if (fabs(gainRADDAM_HE[iii][jjj][kkk] - 1.) > 0.5)
1137  gainRADDAM_HE[iii][jjj][kkk] = 1.;
1138  if (flaggaincorrections == 0)
1139  gainRADDAM_HE[iii][jjj][kkk] = 1.;
1140  gainkoeff->Fill(gainRADDAM_HE[iii][jjj][kkk]);
1141  } //for kkk
1142  } // for jjj
1143  } // for iii
1144 
1145  /*
1146  for(int iii = 1; iii<4; iii++) {
1147  for (int jjj=1;jjj<=82;jjj++) {
1148  for (int kkk=1;kkk<=72;kkk++) {
1149  if(gainRADDAM_HE[iii][jjj][kkk] !=0.) {
1150  gainkoeff->Fill(gainRADDAM_HE[iii][jjj][kkk]);
1151  if(flaggaincorrections == 0) gainRADDAM_HE[iii][jjj][kkk] = 1.;
1152  }
1153  }
1154  }
1155  }
1156 */
1157  //______________________________________________________________________________
1158  // ls -latr /afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LASER_* | less
1159  TString fname = "/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LASER_";
1160  // TString fname = "/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LED_";
1161 
1162  // booking:
1163  TH1F *Ceff1D = new TH1F("Ceff1D", "", 200, 0., 5000.);
1164  TH1F *Seff1D = new TH1F("Seff1D", "", 200, 0., 1000.);
1165  TH1F *Ceff1M = new TH1F("Ceff1M", "", 200, 0., 1300.);
1166  TH1F *Ceff1R = new TH1F("Ceff1R", "", 100, 0., 1000.);
1167 
1168  TH1F *Meff1D = new TH1F("Meff1D", "", 100, 0., 4000.);
1169  TH1F *Meff2D = new TH1F("Meff2D", "", 100, 0., 4000.);
1170  TH1F *Meff3D = new TH1F("Meff3D", "", 100, 0., 4000.);
1171  TH1F *Meff4D = new TH1F("Meff4D", "", 100, 0., 4000.);
1172  TH1F *Meff5D = new TH1F("Meff5D", "", 100, 0., 4000.);
1173  TH1F *Meff6D = new TH1F("Meff6D", "", 100, 0., 4000.);
1174  TH1F *Meff7D = new TH1F("Meff7D", "", 100, 0., 4000.);
1175 
1176  // TH1F* rwithphi = new TH1F("rwithphi","", 1000, -1.,2449.);
1177  // TH1F* rwithphi = new TH1F("rwithphi","", 100, -1.,1449.);
1178  // TH1F* rwithphi = new TH1F("rwithphi","", 100, -1.,449.);
1179  // TH1F* rwithphi = new TH1F("rwithphi","", 100, -1.,149.);
1180  TH1F *rwithphi = new TH1F("rwithphi", "", 100, -1., 9.);
1181  // TH1F* rwithphi = new TH1F("rwithphi","", 100, -1.,5.);
1182 
1183  TH1F *rrwithphiM = new TH1F("rrwithphiM", "", 100, -1., 4.);
1184  TH1F *rrwithphiP = new TH1F("rrwithphiP", "", 100, -1., 4.);
1185 
1186  Int_t kmm = 0;
1187  Int_t kpp = 0;
1188  // first runs:
1189  Int_t mk1f = 0;
1190  Int_t pk1f = 0;
1191  //
1192 
1198  Int_t RUN3 = 0;
1199  Dref = 3;
1200  DepthMax = 4;
1201  for (int k1 = 0; k1 < NP; k1++) {
1202  // if(k1==0 || (k1 >37 && k1<42)) {
1203 
1204  //______________________________________________________
1205  TString epsName = fname + LASERruns[k1] + ".root";
1206  TFile *hfile = new TFile(epsName, "READ");
1207  // TFile *hfile= new TFile("LASER_226835.root", "READ");
1208  // TFile *hfile= new TFile("LASER_272957.root", "READ");
1209  if (LASERruns[k1] > "305874")
1210  RUN3 = 1;
1211  // Define nominator denominator for some methods:
1212  //---------------------------------------------------
1213  // 000000000000000000000000000000000000000000000000000000000000000000000000
1214  // TH2F *twod1= (TH2F*)hfile->Get("h_mapDepth1ADCAmpl_HE");
1215  // TH2F *twod2= (TH2F*)hfile->Get("h_mapDepth2ADCAmpl_HE");
1216  // TH2F *twod3= (TH2F*)hfile->Get("h_mapDepth3ADCAmpl_HE");
1217  // 111111111111111111111111111111111111111111111111111111111111111111111111
1218  // h_mapDepth1ADCAmpl12_HE means ADCcounts(massive) within -1 max +1 +2
1219 
1220  TH2F *twod1 = (TH2F *)hfile->Get("h_mapDepth1ADCAmpl12_HE");
1221  TH2F *twod2 = (TH2F *)hfile->Get("h_mapDepth2ADCAmpl12_HE");
1222  TH2F *twod3 = (TH2F *)hfile->Get("h_mapDepth3ADCAmpl12_HE");
1223  TH2F *twod4 = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl12_HE");
1224  TH2F *twod5 = (TH2F *)hfile->Get("h_mapDepth5ADCAmpl12_HE");
1225  TH2F *twod6 = (TH2F *)hfile->Get("h_mapDepth6ADCAmpl12_HE");
1226  TH2F *twod7 = (TH2F *)hfile->Get("h_mapDepth7ADCAmpl12_HE");
1227 
1228  TH2F *t0010 = (TH2F *)hfile->Get("h_mapDepth1_HE");
1229  TH2F *t0020 = (TH2F *)hfile->Get("h_mapDepth2_HE");
1230  TH2F *t0030 = (TH2F *)hfile->Get("h_mapDepth3_HE");
1231  TH2F *t0040 = (TH2F *)hfile->Get("h_mapDepth4_HE");
1232  TH2F *t0050 = (TH2F *)hfile->Get("h_mapDepth5_HE");
1233  TH2F *t0060 = (TH2F *)hfile->Get("h_mapDepth6_HE");
1234  TH2F *t0070 = (TH2F *)hfile->Get("h_mapDepth7_HE");
1235  if (RUN3 = 1) {
1236  Dref = 4;
1237  DepthMax = 8;
1238  }
1239  // cout << "!!!! read LASER run with k1= " << k1 <<" run: " << LASERruns[k1] << " Dref= " << Dref <<" DepthMax: " << DepthMax <<endl;
1240 
1241  //
1242  // 222222222222222222222222222222222222222222222222222222222222222222222222
1243  // h_mapDepth1linADCAmpl12_HE means ADCcounts(linearized) within -1 max +1 +2
1244  /*
1245  TH2F *twod1= (TH2F*)hfile->Get("h_mapDepth1linADCAmpl12_HE");
1246  TH2F *twod2= (TH2F*)hfile->Get("h_mapDepth2linADCAmpl12_HE");
1247  TH2F *twod3= (TH2F*)hfile->Get("h_mapDepth3linADCAmpl12_HE");
1248  TH2F *t0010= (TH2F*)hfile->Get("h_mapDepth1_HE");
1249  TH2F *t0020= (TH2F*)hfile->Get("h_mapDepth2_HE");
1250  TH2F *t0030= (TH2F*)hfile->Get("h_mapDepth3_HE");
1251 */
1252  //
1253  /*
1254  // 3333333333333333333333333333333333333333333333333333333333333333333333
1255  // h_mapDepth1RADDAM_HE means ADCcounts(massive) within -1 max +1 +2
1256  // pedestal subtracted and cut(50 adcCounts) for each digi:
1257  TH2F *twod1= (TH2F*)hfile->Get("h_mapDepth1RADDAM_HE");
1258  TH2F *twod2= (TH2F*)hfile->Get("h_mapDepth2RADDAM_HE");
1259  TH2F *twod3= (TH2F*)hfile->Get("h_mapDepth3RADDAM_HE");
1260  TH2F *t0010= (TH2F*)hfile->Get("h_mapDepth1RADDAM0_HE");
1261  TH2F *t0020= (TH2F*)hfile->Get("h_mapDepth2RADDAM0_HE");
1262  TH2F *t0030= (TH2F*)hfile->Get("h_mapDepth3RADDAM0_HE");
1263 
1264  */
1265  //
1266  //
1267  // Divide Divide Divide Divide Divide Divide Divide Divide:
1268  // for raddam get <Aijk>_runevents
1269  //
1270  // if(t0010->IsA()->InheritsFrom("TH2F")) {
1271  TH2F *Ceff1 = (TH2F *)twod1->Clone("Ceff1");
1272  TH2F *Ceff2 = (TH2F *)twod2->Clone("Ceff2");
1273  TH2F *Ceff3 = (TH2F *)twod3->Clone("Ceff3");
1274  TH2F *Ceff4 = (TH2F *)twod4->Clone("Ceff4");
1275  TH2F *Ceff5 = (TH2F *)twod5->Clone("Ceff5");
1276  TH2F *Ceff6 = (TH2F *)twod6->Clone("Ceff6");
1277  TH2F *Ceff7 = (TH2F *)twod7->Clone("Ceff7");
1278 
1279  // twod1->Sumw2();
1280  // twod2->Sumw2();
1281  // twod3->Sumw2();
1282  // t0010->Sumw2();
1283 
1284  // <Aijk>_runevents:
1285  // kscale =200 for 2018 to have a'la the same A-scale as for HPD(<2018). So, a'la: adcCounts = fC/kscale;
1286  int kscale = 1;
1287  if (RUN3 == 1)
1288  kscale = 200;
1289  Ceff1->Divide(twod1, t0010, 1, kscale, "B");
1290  Ceff2->Divide(twod2, t0020, 1, kscale, "B");
1291  Ceff3->Divide(twod3, t0030, 1, kscale, "B");
1292  Ceff4->Divide(twod4, t0040, 1, kscale, "B");
1293  Ceff5->Divide(twod5, t0050, 1, kscale, "B");
1294  Ceff6->Divide(twod6, t0060, 1, kscale, "B");
1295  Ceff7->Divide(twod7, t0070, 1, kscale, "B");
1296  // Ceff1->Sumw2();Ceff2->Sumw2();Ceff3->Sumw2();
1297  // }
1298 
1299  int nx = Ceff1->GetXaxis()->GetNbins();
1300  int ny = Ceff1->GetYaxis()->GetNbins();
1301  // print for verbosity:
1302  if (verbosity == 2) {
1303  cout << "************* nx = " << nx << " ny = " << ny << endl;
1304  for (int jjj = 0; jjj <= nx; jjj++) {
1305  for (int kkk = 0; kkk <= ny; kkk++) {
1306  if (Ceff1->GetBinContent(jjj, kkk) != 0.)
1307  cout << "*111111************ jjj = " << jjj << "************* kkk = " << kkk << endl;
1308  if (Ceff2->GetBinContent(jjj, kkk) != 0.)
1309  cout << "*******222****** jjj = " << jjj << "************* kkk = " << kkk << endl;
1310  if (Ceff3->GetBinContent(jjj, kkk) != 0.)
1311  cout << "**********3*** jjj = " << jjj << "************* kkk = " << kkk << endl;
1312  if (Ceff4->GetBinContent(jjj, kkk) != 0.)
1313  cout << "*144444************ jjj = " << jjj << "************* kkk = " << kkk << endl;
1314  if (Ceff5->GetBinContent(jjj, kkk) != 0.)
1315  cout << "*******555****** jjj = " << jjj << "************* kkk = " << kkk << endl;
1316  if (Ceff6->GetBinContent(jjj, kkk) != 0.)
1317  cout << "**********6*** jjj = " << jjj << "************* kkk = " << kkk << endl;
1318  if (Ceff7->GetBinContent(jjj, kkk) != 0.)
1319  cout << "**********7*** jjj = " << jjj << "************* kkk = " << kkk << endl;
1320  } //jjj
1321  } //kkk
1322  } // if(verbosity == 2 )
1325  // fill massive <Aijk>_runevents , where iii=depth, jjj=eta, kkk=phi
1326  for (int jjj = 0; jjj < nx; jjj++) {
1327  for (int kkk = 0; kkk < ny; kkk++) {
1328  // FILL NEW PLOTS:
1329  // Aijk: Ceff1D & Seff1D plots
1330  if (Ceff1->GetBinContent(jjj, kkk) != 0.) {
1331  Ceff1D->Fill(Ceff1->GetBinContent(jjj, kkk));
1332  Seff1D->Fill(Ceff1->GetBinContent(jjj, kkk));
1333  }
1334  if (Ceff2->GetBinContent(jjj, kkk) != 0.) {
1335  Ceff1D->Fill(Ceff2->GetBinContent(jjj, kkk));
1336  Seff1D->Fill(Ceff2->GetBinContent(jjj, kkk));
1337  }
1338  if (Ceff3->GetBinContent(jjj, kkk) != 0.) {
1339  Ceff1D->Fill(Ceff3->GetBinContent(jjj, kkk));
1340  Seff1D->Fill(Ceff3->GetBinContent(jjj, kkk));
1341  }
1342  if (Ceff4->GetBinContent(jjj, kkk) != 0.) {
1343  Ceff1D->Fill(Ceff4->GetBinContent(jjj, kkk));
1344  Seff1D->Fill(Ceff4->GetBinContent(jjj, kkk));
1345  }
1346  if (Ceff5->GetBinContent(jjj, kkk) != 0.) {
1347  Ceff1D->Fill(Ceff5->GetBinContent(jjj, kkk));
1348  Seff1D->Fill(Ceff5->GetBinContent(jjj, kkk));
1349  }
1350  if (Ceff6->GetBinContent(jjj, kkk) != 0.) {
1351  Ceff1D->Fill(Ceff6->GetBinContent(jjj, kkk));
1352  Seff1D->Fill(Ceff6->GetBinContent(jjj, kkk));
1353  }
1354  if (Ceff7->GetBinContent(jjj, kkk) != 0.) {
1355  Ceff1D->Fill(Ceff7->GetBinContent(jjj, kkk));
1356  Seff1D->Fill(Ceff7->GetBinContent(jjj, kkk));
1357  }
1358  // to get correct mean w/o channels without signal
1359  if (Ceff1->GetBinContent(jjj, kkk) > cutMinA) {
1360  Meff1D->Fill(Ceff1->GetBinContent(jjj, kkk));
1361  }
1362  if (Ceff2->GetBinContent(jjj, kkk) > cutMinA) {
1363  Meff2D->Fill(Ceff2->GetBinContent(jjj, kkk));
1364  }
1365  if (Ceff3->GetBinContent(jjj, kkk) > cutMinA) {
1366  Meff3D->Fill(Ceff3->GetBinContent(jjj, kkk));
1367  }
1368  if (Ceff4->GetBinContent(jjj, kkk) > cutMinA) {
1369  Meff4D->Fill(Ceff4->GetBinContent(jjj, kkk));
1370  }
1371  if (Ceff5->GetBinContent(jjj, kkk) > cutMinA) {
1372  Meff5D->Fill(Ceff5->GetBinContent(jjj, kkk));
1373  }
1374  if (Ceff6->GetBinContent(jjj, kkk) > cutMinA) {
1375  Meff6D->Fill(Ceff6->GetBinContent(jjj, kkk));
1376  }
1377  if (Ceff7->GetBinContent(jjj, kkk) > cutMinA) {
1378  Meff7D->Fill(Ceff7->GetBinContent(jjj, kkk));
1379  }
1380  }
1381  }
1382  //--------------------------------------
1383  Ceff1M->Fill(Meff1D->GetMean());
1384  Ceff1M->Fill(Meff2D->GetMean());
1385  Ceff1M->Fill(Meff3D->GetMean());
1386  Ceff1M->Fill(Meff4D->GetMean());
1387  Ceff1M->Fill(Meff5D->GetMean());
1388  Ceff1M->Fill(Meff6D->GetMean());
1389  Ceff1M->Fill(Meff7D->GetMean());
1390  //cout<<" kdirection = " << kdirection <<"!!!!!!! run out Mean = " << k1 <<" Meff1D->GetMean() = " << Meff1D->GetMean() <<endl;
1391  if (verbosity == 9 && (Meff1D->GetMean() < cutMinM || Meff2D->GetMean() < cutMinM || Meff3D->GetMean() < cutMinM))
1392  cout << " kdirection = " << kdirection << "****** run out Mean = " << k1
1393  << " Meff1D->GetMean() = " << Meff1D->GetMean() << " cutMinM = " << cutMinM << endl;
1394  Ceff1R->Fill(Meff1D->GetRMS());
1395  Ceff1R->Fill(Meff2D->GetRMS());
1396  Ceff1R->Fill(Meff3D->GetRMS());
1397  Ceff1R->Fill(Meff4D->GetRMS());
1398  Ceff1R->Fill(Meff5D->GetRMS());
1399  Ceff1R->Fill(Meff6D->GetRMS());
1400  Ceff1R->Fill(Meff7D->GetRMS());
1401  //--------------------------------------
1402  //--------------------------------------
1403  //--------------------------------------
1404  //--------------------------------------
1405  //--------------------------------------
1406  //--------------------------------------
1407  //--------------------------------------
1408  //--------------------------------------
1409  // take into account for future treatment only channels with <Aijk>_runevents within cutMinA to cutMaxA: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1410  // apply cut on <Aijk>_runevents
1411  // -41 +41
1412  // 82 bins
1413  //--------------------------------------
1414  //--------------------------------------
1415  //-------------------------------------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! APPLY cutS !!!!! AND FILL MASSIV !!!!!!
1416  //--------------------------------------
1417  //--------------------------------------
1418  if (flagcutamplitude == 0) {
1419  for (int jjj = 0; jjj < nx; jjj++) {
1420  for (int kkk = 0; kkk < ny; kkk++) {
1421  if (Ceff1->GetBinContent(jjj, kkk) > cutMinA && Ceff1->GetBinContent(jjj, kkk) < cutMaxA)
1422  mapRADDAM_HE[1][jjj][kkk + 1] = Ceff1->GetBinContent(jjj, kkk);
1423  if (Ceff2->GetBinContent(jjj, kkk) > cutMinA && Ceff2->GetBinContent(jjj, kkk) < cutMaxA)
1424  mapRADDAM_HE[2][jjj][kkk + 1] = Ceff2->GetBinContent(jjj, kkk);
1425  if (Ceff3->GetBinContent(jjj, kkk) > cutMinA && Ceff3->GetBinContent(jjj, kkk) < cutMaxA)
1426  mapRADDAM_HE[3][jjj][kkk + 1] = Ceff3->GetBinContent(jjj, kkk);
1427  if (Ceff4->GetBinContent(jjj, kkk) > cutMinA && Ceff4->GetBinContent(jjj, kkk) < cutMaxA)
1428  mapRADDAM_HE[4][jjj][kkk + 1] = Ceff4->GetBinContent(jjj, kkk);
1429  if (Ceff5->GetBinContent(jjj, kkk) > cutMinA && Ceff5->GetBinContent(jjj, kkk) < cutMaxA)
1430  mapRADDAM_HE[5][jjj][kkk + 1] = Ceff5->GetBinContent(jjj, kkk);
1431  if (Ceff6->GetBinContent(jjj, kkk) > cutMinA && Ceff6->GetBinContent(jjj, kkk) < cutMaxA)
1432  mapRADDAM_HE[6][jjj][kkk + 1] = Ceff6->GetBinContent(jjj, kkk);
1433  if (Ceff7->GetBinContent(jjj, kkk) > cutMinA && Ceff7->GetBinContent(jjj, kkk) < cutMaxA)
1434  mapRADDAM_HE[7][jjj][kkk + 1] = Ceff7->GetBinContent(jjj, kkk);
1435  }
1436  }
1437  } // if
1438  //--------------------------------------
1439  //--------------------------------------
1440  //--------------------------------------
1441  //--------------------------------------
1442  //--------------------------------------
1443  //--------------------------------------
1444  //--------------------------------------
1445  else if (flagcutamplitude == 1) {
1446  for (int jjj = 0; jjj < nx; jjj++) {
1447  for (int kkk = 0; kkk < ny; kkk++) {
1448  if (Ceff1->GetBinContent(jjj, kkk) > cutMinA &&
1449  Ceff1->GetBinContent(jjj, kkk) < kfactor * Meff1D->GetMean())
1450  mapRADDAM_HE[1][jjj][kkk + 1] = Ceff1->GetBinContent(jjj, kkk);
1451  if (Ceff2->GetBinContent(jjj, kkk) > cutMinA &&
1452  Ceff2->GetBinContent(jjj, kkk) < kfactor * Meff2D->GetMean())
1453  mapRADDAM_HE[2][jjj][kkk + 1] = Ceff2->GetBinContent(jjj, kkk);
1454  if (Ceff3->GetBinContent(jjj, kkk) > cutMinA &&
1455  Ceff3->GetBinContent(jjj, kkk) < kfactor * Meff3D->GetMean())
1456  mapRADDAM_HE[3][jjj][kkk + 1] = Ceff3->GetBinContent(jjj, kkk);
1457  if (Ceff4->GetBinContent(jjj, kkk) > cutMinA &&
1458  Ceff4->GetBinContent(jjj, kkk) < kfactor * Meff1D->GetMean())
1459  mapRADDAM_HE[4][jjj][kkk + 1] = Ceff4->GetBinContent(jjj, kkk);
1460  if (Ceff5->GetBinContent(jjj, kkk) > cutMinA &&
1461  Ceff5->GetBinContent(jjj, kkk) < kfactor * Meff2D->GetMean())
1462  mapRADDAM_HE[5][jjj][kkk + 1] = Ceff5->GetBinContent(jjj, kkk);
1463  if (Ceff6->GetBinContent(jjj, kkk) > cutMinA &&
1464  Ceff6->GetBinContent(jjj, kkk) < kfactor * Meff3D->GetMean())
1465  mapRADDAM_HE[6][jjj][kkk + 1] = Ceff6->GetBinContent(jjj, kkk);
1466  if (Ceff7->GetBinContent(jjj, kkk) > cutMinA &&
1467  Ceff7->GetBinContent(jjj, kkk) < kfactor * Meff3D->GetMean())
1468  mapRADDAM_HE[7][jjj][kkk + 1] = Ceff7->GetBinContent(jjj, kkk);
1469  }
1470  }
1471  } // if
1472  else if (flagcutamplitude == 2) {
1473  for (int jjj = 0; jjj < nx; jjj++) {
1474  for (int kkk = 0; kkk < ny; kkk++) {
1475  if (Ceff1->GetBinContent(jjj, kkk) > cutMinA &&
1476  Ceff1->GetBinContent(jjj, kkk) < (Meff1D->GetMean() + k2factor * Meff1D->GetRMS()))
1477  mapRADDAM_HE[1][jjj][kkk + 1] = Ceff1->GetBinContent(jjj, kkk);
1478  if (Ceff2->GetBinContent(jjj, kkk) > cutMinA &&
1479  Ceff2->GetBinContent(jjj, kkk) < (Meff2D->GetMean() + k2factor * Meff2D->GetRMS()))
1480  mapRADDAM_HE[2][jjj][kkk + 1] = Ceff2->GetBinContent(jjj, kkk);
1481  if (Ceff3->GetBinContent(jjj, kkk) > cutMinA &&
1482  Ceff3->GetBinContent(jjj, kkk) < (Meff3D->GetMean() + k2factor * Meff3D->GetRMS()))
1483  mapRADDAM_HE[3][jjj][kkk + 1] = Ceff3->GetBinContent(jjj, kkk);
1484  if (Ceff4->GetBinContent(jjj, kkk) > cutMinA &&
1485  Ceff4->GetBinContent(jjj, kkk) < (Meff4D->GetMean() + k2factor * Meff4D->GetRMS()))
1486  mapRADDAM_HE[4][jjj][kkk + 1] = Ceff4->GetBinContent(jjj, kkk);
1487  if (Ceff5->GetBinContent(jjj, kkk) > cutMinA &&
1488  Ceff5->GetBinContent(jjj, kkk) < (Meff5D->GetMean() + k2factor * Meff5D->GetRMS()))
1489  mapRADDAM_HE[5][jjj][kkk + 1] = Ceff5->GetBinContent(jjj, kkk);
1490  if (Ceff6->GetBinContent(jjj, kkk) > cutMinA &&
1491  Ceff6->GetBinContent(jjj, kkk) < (Meff6D->GetMean() + k2factor * Meff6D->GetRMS()))
1492  mapRADDAM_HE[6][jjj][kkk + 1] = Ceff6->GetBinContent(jjj, kkk);
1493  if (Ceff7->GetBinContent(jjj, kkk) > cutMinA &&
1494  Ceff7->GetBinContent(jjj, kkk) < (Meff7D->GetMean() + k2factor * Meff7D->GetRMS()))
1495  mapRADDAM_HE[7][jjj][kkk + 1] = Ceff7->GetBinContent(jjj, kkk);
1496  }
1497  }
1498  } // if
1501  for (int iii = 1; iii < DepthMax; iii++) {
1502  for (int jjj = 1; jjj <= 82; jjj++) {
1503  if ((kdirection == 0 && jjj > 41) || (kdirection == 1 && jjj < 42)) {
1504  for (int kkk = 1; kkk <= 72; kkk++) {
1505  mapRADDAM_HE[iii][jjj][kkk] = 0.;
1506  }
1507  }
1508  }
1509  }
1512  if (k1 > 36 && k1 < 45) {
1513  for (int iii = 1; iii < DepthMax; iii++) {
1514  for (int jjj = 1; jjj <= 82; jjj++) {
1515  for (int kkk = 1; kkk <= 72; kkk++) {
1516  if ((iii == 1) &&
1517  (jjj == 59 || jjj == 60 || jjj == 63 || jjj == 65 || jjj == 66 || jjj == 67 || jjj == 68) &&
1518  (kkk == 23 || kkk == 24)) {
1519  mapRADDAM_HE[iii][jjj][kkk] = 0.;
1520  }
1521  }
1522  }
1523  }
1524  }
1531  for (int iii = 1; iii < DepthMax; iii++) {
1532  for (int jjj = 1; jjj <= 82; jjj++) {
1533  for (int kkk = 1; kkk <= 72; kkk++) {
1534  if (mapRADDAM_HE[iii][jjj][kkk] != 0 && gainRADDAM_HE[iii][jjj][kkk] != 0)
1535  mapRADDAM_HE[iii][jjj][kkk] /= gainRADDAM_HE[iii][jjj][kkk];
1536  }
1537  }
1538  }
1540  // define A for refRun Laser-megatile: HEM : 272967 = k1=[0] , HEP : 272957 = k1=[0], 20167
1541  // define A for refRun Laser-megatile: HEM : 315056 = k1=[0] , HEP : 315056 = k1=[0], 2018
1543 
1544  if (k1 == mk1f && kmm == 0 && kdirection == 0) {
1545  kmm = 1; //Int_t mcount=0;
1546  cout << "* to be printed once only CHECK IT please ************ kmm = " << kmm << endl;
1547  cout << "NEGATIVE direction refRun !!!! read LASER run with k1= " << k1 << " run: " << LASERruns[k1] << endl;
1548  for (int iii = 1; iii < DepthMax; iii++) {
1549  for (int jjj = 1; jjj <= 82; jjj++) {
1550  for (int kkk = 1; kkk <= 72; kkk++) {
1551  // if(mapRADDAM_HE[iii][jjj][kkk]!=0.) {dormM += mapRADDAM_HE[iii][jjj][kkk];++mcount;}
1552  normM[iii][jjj][kkk] = mapRADDAM_HE[iii][jjj][kkk];
1553  // AZ2019
1554  // if(normM[iii][jjj][kkk] != 0.) cout<<" normM[iii][jjj][kkk] = " << normM[iii][jjj][kkk] <<" iii = " << iii <<endl;
1555  } //for
1556  } //for
1557  } //for
1558  // dormM /= mcount;
1559  }
1560 
1561  if (k1 == pk1f && kpp == 0 && kdirection == 1) {
1562  kpp = 1; //Int_t pcount=0;
1563  cout << "* to be printed once only CHECK IT please ************ kpp = " << kpp << endl;
1564  cout << "POSITIVE direction refRun !!!! read LASER run with k1= " << k1 << " run: " << LASERruns[k1] << endl;
1565  for (int iii = 1; iii < DepthMax; iii++) {
1566  for (int jjj = 1; jjj <= 82; jjj++) {
1567  for (int kkk = 1; kkk <= 72; kkk++) {
1568  // if(mapRADDAM_HE[iii][jjj][kkk]!=0.) {dormP += mapRADDAM_HE[iii][jjj][kkk];++pcount;}
1569  normP[iii][jjj][kkk] = mapRADDAM_HE[iii][jjj][kkk];
1570  // AZ2019
1571  // if(normP[iii][jjj][kkk] != 0.) cout<<" normP[iii][jjj][kkk] = " << normP[iii][jjj][kkk] <<" iii = " << iii <<endl;
1572  } //for
1573  } //for
1574  } //for
1575  // dormP /= pcount;
1576  }
1582  for (int iii = 1; iii < DepthMax; iii++) {
1583  for (int jjj = 1; jjj <= 82; jjj++) {
1584  for (int kkk = 1; kkk <= 72; kkk++) {
1585  if (jjj < 42 && kdirection == 0) {
1586  if (normM[iii][jjj][kkk] != 0) {
1587  mapRADDAM_HE[iii][jjj][kkk] /= normM[iii][jjj][kkk];
1588  } else {
1589  mapRADDAM_HE[iii][jjj][kkk] = 0.;
1590  }
1591  }
1592  if (jjj > 41 && kdirection == 1) {
1593  if (normP[iii][jjj][kkk] != 0) {
1594  mapRADDAM_HE[iii][jjj][kkk] /= normP[iii][jjj][kkk];
1595  } else {
1596  mapRADDAM_HE[iii][jjj][kkk] = 0.;
1597  }
1598  }
1599  } //for
1600  } //for
1601  } //for
1602  //
1608  if (variant == 2) {
1609  Double_t normchannelM = 0;
1610  Double_t normchannelP = 0;
1612  if (kdirection == 0) {
1613  Int_t mcounter = 0;
1614  for (int kkk = 1; kkk <= 72; kkk++) {
1615  if (mapRADDAM_HE[Dref][26][kkk] > 0.) {
1616  normchannelM += mapRADDAM_HE[Dref][26][kkk];
1617  mcounter++;
1618  }
1619  } //for
1620  if (mcounter != 0)
1621  normchannelM /= mcounter;
1622  } else if (kdirection == 1) {
1623  Int_t pcounter = 0;
1624  for (int kkk = 1; kkk <= 72; kkk++) {
1625  if (mapRADDAM_HE[Dref][57][kkk] > 0.) {
1626  normchannelP += mapRADDAM_HE[Dref][57][kkk];
1627  pcounter++;
1628  }
1629  } //for
1630  if (pcounter != 0)
1631  normchannelP /= pcounter;
1632  }
1633  // cout<<"norm_channel(Dref,16) averaged over PHI: normchannelM = " << normchannelM << " normchannelP = " << normchannelP <<endl;
1637  for (int iii = 1; iii < DepthMax; iii++) {
1638  for (int jjj = 1; jjj <= 82; jjj++) {
1639  for (int kkk = 1; kkk <= 72; kkk++) {
1640  if (mapRADDAM_HE[iii][jjj][kkk] > 0. && normchannelM != 0 && jjj < 42 && kdirection == 0) {
1641  mapRADDAM_HE[iii][jjj][kkk] /= normchannelM;
1642  }
1643  if (mapRADDAM_HE[iii][jjj][kkk] > 0. && normchannelP != 0 && jjj > 41 && kdirection == 1) {
1644  mapRADDAM_HE[iii][jjj][kkk] /= normchannelP;
1645  }
1646  } //for
1647  } //for
1648  } //for
1649 
1650  } // variant2
1651 
1655  // then, avereaging over phi, but first sum over phi before!!! any dividing:
1657  for (int iii = 1; iii < DepthMax; iii++) {
1658  for (int jjj = 1; jjj <= 82; jjj++) {
1659  for (int kkk = 1; kkk <= 72; kkk++) {
1660  if (mapRADDAM_HE[iii][jjj][kkk] > 0) {
1661  // if(mapRADDAM_HE[iii][jjj][kkk]< 0.031) cout<<"***** depth = " << iii <<" k1 = " << k1 <<" eta = " << jjj <<" phi = " << kkk <<" mapRADDAM_ijk = " << mapRADDAM_HE[iii][jjj][kkk] <<endl;
1662  // control histoes to reject bad channels using Rijk:
1663  rwithphi->Fill(mapRADDAM_HE[iii][jjj][kkk]);
1664 
1665  // use only good(rwithphi) Rijk channels:
1666  if ((mapRADDAM_HE[iii][jjj][kkk] > CutrwithphiMin && mapRADDAM_HE[iii][jjj][kkk] < CutrwithphiMax &&
1667  variant != 2) ||
1668  (mapRADDAM_HE[iii][jjj][kkk] > CutrwithphiMinVar2 &&
1669  mapRADDAM_HE[iii][jjj][kkk] < CutrwithphiMaxVar2 && variant == 2)) {
1670  // control only! histoes to reject bad channels using RRijk (rrwithphiM & rrwithphiP) :
1671  Double_t RRrrRr = 0.;
1672  if (variant != 2) {
1673  if (jjj < 42 && kdirection == 0) {
1674  if (mapRADDAM_HE[Dref][26][kkk] != 0) {
1675  RRrrRr = mapRADDAM_HE[iii][jjj][kkk] / mapRADDAM_HE[Dref][26][kkk];
1676  rrwithphiM->Fill(RRrrRr);
1677  }
1678  } else if (jjj > 41 && kdirection == 1) {
1679  if (mapRADDAM_HE[Dref][57][kkk] != 0) {
1680  RRrrRr = mapRADDAM_HE[iii][jjj][kkk] / mapRADDAM_HE[Dref][57][kkk];
1681  rrwithphiP->Fill(RRrrRr);
1682  }
1683  }
1684  } else if (variant == 2) {
1685  if (jjj < 42 && kdirection == 0) {
1686  RRrrRr = mapRADDAM_HE[iii][jjj][kkk];
1687  rrwithphiM->Fill(RRrrRr);
1688  } else if (jjj > 41 && kdirection == 1) {
1689  RRrrRr = mapRADDAM_HE[iii][jjj][kkk];
1690  rrwithphiP->Fill(RRrrRr);
1691  }
1692  // if(RRrrRr< 0.031) cout<<" depth = " << iii <<" k1 = " << k1 <<" eta = " << jjj <<" phi = " << kkk <<" RRrrRr = " << RRrrRr <<endl;
1693  }
1694 
1695  // use only good(rrwithphiM P) RRijk channels:
1696  if ((RRrrRr > CutrrwithphiMin && RRrrRr < CutrrwithphiMax && variant != 2) || variant == 2) {
1697  // ---------------------------------------- sum over phi before!!! any dividing:
1698  mapRADDAM_HED2[iii][jjj] += mapRADDAM_HE[iii][jjj][kkk];
1699  // N phi sectors w/ digihits
1700  mapRADDAM_HED20[iii][jjj]++;
1701 
1702  if (verbosity == 3 && iii == Dref)
1703  cout << " depth = " << iii << " k1 = " << k1 << " eta = " << jjj
1704  << " mapRADDAM_HED2[iii][jjj] = " << mapRADDAM_HED2[iii][jjj]
1705  << " Nphi = " << mapRADDAM_HED20[iii][jjj]
1706  << " mapRADDAM_HE[iii][jjj][kkk = " << mapRADDAM_HE[iii][jjj][kkk] << endl;
1707 
1708  // define pointers for PHI dependence:
1709  if (jjj < 42 && kdirection == 0) {
1710  phidependenceM->Fill(float(kkk - 1), mapRADDAM_HE[iii][jjj][kkk]);
1711  phidependenceM0->Fill(float(kkk - 1), 1.);
1712  phiRRM->Fill(mapRADDAM_HE[iii][jjj][kkk]);
1713  } else if (jjj > 41 && kdirection == 1) {
1714  phidependenceP->Fill(float(kkk - 1), mapRADDAM_HE[iii][jjj][kkk]);
1715  phidependenceP0->Fill(float(kkk - 1), 1.);
1716  phiRRP->Fill(mapRADDAM_HE[iii][jjj][kkk]);
1717  }
1718 
1719  } //if RRrrRr
1720  } //if > CutrwithphiMin
1721 
1722  } // if mapRADDAM_HE[iii][jjj][kkk] != 0
1723  } //for
1724  } //for
1725  } //for
1726  //=================================================================== normalization on first run channel 3,16:
1727  // jjj = 1 | 82
1728  // 1- 41 - 42-82
1729  // 26 57
1730  //HE
1731  // depth1 13-25 - 58-70 13-26 --> N=14, 57-70 --> N=14
1732  // depth2 13-24 - 59-67
1733  // depth3 14,15,26* - *57,68,69
1734  // jjj 13-26 --> N=14 - 57-70 --> N=14
1735  // jj M: 0-13 P: 0-13
1736  // real N: 16-29 16,29
1737  // correspondence realN to jj:
1738  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13* P: 0* 1 2 3 4 5 6 7 8 9 10 11 12 13
1739  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16* 16* 17 18 19 20 21 22 23 24 25 26 27 28 29
1740  // jjj: 13 14 15 16 17 18 19 20 21 22 23 24 25 26* +31= 57* 58 59 60 61 62 63 64 65 66 67 68 69 70
1741  // (jjj-41) 16* 17 18 19 20 21 22 23 24 25 26 27 28 29
1742  //
1743  // ZZM[k1][depth]][jjj=eta] --> ZZM[k1][7][14] negative direction , ZZP[k1][7][14] positive dir.
1744  // jj = 0 - 13 jj = 0 - 13
1745  // jjj = 13 - 26 jjj = 57 - 70
1746  // Cell = ZZM[k1][Dref][13] and ZZP[k1][Dref][0]
1751  for (int iii = 1; iii < DepthMax; iii++) {
1752  for (int jjj = 1; jjj <= 82; jjj++) {
1753  if (mapRADDAM_HED20[iii][jjj] != 0) {
1754  if (verbosity == 1)
1755  cout << "****aver per N-phi_sectors********* depth = " << iii << " RunIndex = " << k1 << " eta = " << jjj
1756  << " Nphi = " << mapRADDAM_HED20[iii][jjj] << endl;
1757  mapRADDAM_HED2[iii][jjj] /= mapRADDAM_HED20[iii][jjj];
1758  if (verbosity == 3 && iii == Dref)
1759  cout << "****aver per N-phi_sectors********* depth = " << iii << " RunIndex = " << k1 << " eta = " << jjj
1760  << " Nphi = " << mapRADDAM_HED20[iii][jjj] << endl;
1761  // int jj = jjj-13;
1762  // if(jj> 13) jj -=44;
1763  // if(jj<0 || jj>13) cout<<"*** ERROR *** depth = " << iii <<" eta = " << jjj <<" new-eta = " << jj <<endl;
1764 
1765  if (jjj < 42) {
1766  if (kdirection == 0) {
1767  int jj = jjj - 13;
1768  if (jj < 0 || jj > 13)
1769  cout << "***ZZM ERROR *** depth = " << iii << " eta = " << jjj << " new-eta = " << jj << endl;
1770  ZZM[k1][iii][jj] = mapRADDAM_HED2[iii][jjj];
1771  if (verbosity == 1)
1772  cout << "****aver per N-phi_sectors********* ZZM[k1][iii][jj] = " << ZZM[k1][iii][jj] << endl;
1773  } //if kdirection=0
1774  } else {
1775  if (kdirection == 1) {
1776  int jj = jjj - 13;
1777  jj -= 44;
1778  if (jj < 0 || jj > 13)
1779  cout << "***ZZP ERROR *** depth = " << iii << " eta = " << jjj << " new-eta = " << jj << endl;
1780  ZZP[k1][iii][jj] = mapRADDAM_HED2[iii][jjj];
1781  if (verbosity == 1)
1782  cout << "****aver per N-phi_sectors****** ZZP[k1][iii][jj] = " << ZZP[k1][iii][jj] << endl;
1783  } //if kdirection=1
1784  } // if jjj<42
1785 
1786  } // if(mapRADDAM_HED20 != 0
1787 
1788  } //for jjj
1789  } //for iii
1793  //
1794  for (int iii = 0; iii < DepthMax; iii++) {
1795  for (int jjj = 0; jjj <= 82; jjj++) {
1796  mapRADDAM_HED2[iii][jjj] = 0.;
1797  mapRADDAM_HED20[iii][jjj] = 0.;
1798  for (int kkk = 0; kkk <= 72; kkk++) {
1799  mapRADDAM_HE[iii][jjj][kkk] = 0.;
1800  }
1801  }
1802  }
1804  hfile->Close();
1806 
1807  /* // max Lumi 41.3 fb-1
1808  if( k1 == NP-1 ) {
1809  TH1F* rwithphi = new TH1F("rwithphi","", 100, -1.,6.);
1810  for(int iii = 1; iii<4; iii++) {
1811  for (int jjj=1;jjj<=82;jjj++) {
1812 ZZM[k1][iii][jj] =
1813 if(mapRADDAM_HE[iii][jjj][kkk] != 0 ) rwithphi->Fill(mapRADDAM_HE[iii][jjj][kkk]);
1814 ZZP[k1][iii][jj] =
1815  }//for
1816  }//for
1817  }//if( k1 == NP-1
1818 */
1819 
1820  // }//if(k1==0 || (k1>37
1821  // END OF LOOP OVER LASER RUNS
1822  } //for k1 loop over time points(LASER runs)
1823  cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DONE: last LASER run READ " << endl;
1824  // ////////////////////////////////////////////////////////////////////////////////////////////////// END OF LOOP OVER LASER RUNS
1827  // ////////////////////////////////////////////////////////////////////////////////////////////////// END OF LOOP OVER LASER RUNS
1830  // ////////////////////////////////////////////////////////////////////////////////////////////////// END OF LOOP OVER LASER RUNS
1833  if (variant != 2) {
1834  // ========================= normalization on channel: ZZM[k1][Dref][13]; ZZP[k1][Dref][0];
1835  //
1836  for (int k1 = 0; k1 < NP; k1++) {
1837  if (verbosity == 1) {
1838  cout << " ********************************************************************time *************point = "
1839  << k1 << endl;
1840  }
1841  for (int iii = 1; iii < DepthMax; iii++) {
1842  for (int jj = 0; jj <= 13; jj++) {
1843  if (verbosity == 1) {
1844  cout << " **** DepthMax = " << DepthMax << " **** iii = " << iii << " **** jj = " << jj << endl;
1845  }
1846  // cout << "!!!!!!!!!!!!!!!!!!normalization on channel:!!!!!!!!!!!!!! Positive Direction " <<endl;
1847 
1848  if (kdirection == 1) {
1849  if (iii == Dref && jj == 0) {
1850  } else {
1851  if (ZZP[k1][Dref][0] != 0) {
1852  ZZP[k1][iii][jj] /= ZZP[k1][Dref][0];
1853  }
1854  if (verbosity == 1 && ZZP[k1][iii][jj] != 0) {
1855  cout << "Normalized P Positive Direction ***** depth = " << iii << " eta = " << jj
1856  << " ZZP[k1][iii][jj] = " << ZZP[k1][iii][jj] << endl;
1857  }
1858  if (verbosity == 3 && ZZP[k1][iii][jj] != 0 && iii == Dref) {
1859  cout << "Normalized P Positive Direction ***** depth = " << iii << " eta = " << jj
1860  << " ZZP[k1][iii][jj] = " << ZZP[k1][iii][jj] << " ZZP[k1][Dref][0] = " << ZZP[k1][Dref][0]
1861  << endl;
1862  }
1863  //AZ2019 if(iii==1&& jj==13) cout<<" k1 = = " << k1<<" ZZP[k1][1][13] = " << ZZP[k1][1][13]<<endl;
1864  } // if
1865  } //if
1866 
1867  else if (kdirection == 0) {
1868  // cout << "!!!!!!!!!!!!!!!!!normalization on channel:!!!!!!!!!!!!!!! Negative Direction " <<endl;
1869  if (iii == Dref && jj == 13) {
1870  } else {
1871  if (ZZM[k1][Dref][13] != 0) {
1872  ZZM[k1][iii][jj] /= ZZM[k1][Dref][13];
1873  }
1874  // if( ZZM[k1][iii][jj] != 0 ) {cout<<"Normalized M Negative Direction ***** depth = " << iii <<" k1 = " << k1 <<" eta = " << jj <<" ZZM[k1][iii][jj] = " << ZZM[k1][iii][jj] <<endl;}
1875  // if(ZZM[k1][iii][jj] != 0 && iii==Dref ) {cout<<"Normalized M Negative Direction iii==Dref ***** depth = " << iii <<" k1 = " << k1 <<" eta = " << jj <<" ZZM[k1][iii][jj] = " << ZZM[k1][iii][jj] <<" ZZM[k1][Dref][0] = " << ZZM[k1][Dref][0]<<endl;}
1876  } // if
1877 
1878  } // if
1879 
1880  } //for
1881  } //for
1882  } //for
1883  //
1884  } // variant
1885  cout << "DONE variant = " << variant << endl;
1886 
1887  //============================= table ====================================== normalization on first run channel 3,16:
1888  // -41 +41
1889  // 82 bins
1890  // jjj = 1 | 82 | -41
1891  // 1- 41 - 42-82
1892  // 26 57 | -41
1893  //HE
1894  // depth1 13-25 - 58-70 13-26 --> N=14, 57-70 --> N=14
1895  // depth2 13-24 - 59-67
1896  // depth3 14,15,26* - *57,68,69
1897  // jjj 13-26 --> N=14 - 57-70 --> N=14
1898  // jj M: 0-13 P: 0-13
1899  // real N: 16-29 16,29
1900  // correspondence realN to jj:
1901  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
1902  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
1903  // - - - - - - - - - - - -
1904  // eta:
1905  //depth1 0 - 12 1 - 13 (+57)
1906  //depth2 2 - 13 2 - 10
1907  //depth3 1,2 - 13* 0* - 11, 12
1908  // ZZM[k1][depth]][jjj=eta] --> ZZM[k1][7][14] negative direction , ZZP[k1][7][14] positive dir.
1909  // jj = 0 - 13 jj = 0 - 13
1910  // jjj = 13 - 26 jjj = 57 - 70
1911  // Cell = ZZM[k1][3][13] and ZZP[k1][3][0]
1912 
1913  //
1914  //
1916  // take last non-zero point corresponding max Integrated Lumi
1917  // you can clarify that using printout line below to see is last massive-element contains 0 or not:
1918  // if(kdirection == 1 ) cout<<"******************** k1last = " <<k1last <<" RRP[12] = " << RRP[12] <<" ZZP[k1last][1][13] = " << ZZP[k1last][1][13] << endl;
1919  int k1last = NP - 1;
1920 
1921  // P:
1922  if (kdirection == 1 && ZZP[k1last][2][13] < 0.1)
1923  k1last = NP - 2;
1924 
1925  // M:
1926  if (kdirection == 0) {
1927  // L1:
1928  cout << "******************** M L1 k1last = " << k1last
1929  << " ZZM[k1last][2][10] = " << ZZM[k1last][2][10] << endl;
1930  cout << "********************************************************************************************************"
1931  "********************************************************* "
1932  << endl;
1933  // L7:
1934  cout << "********************* M L7 k1last = " << k1last
1935  << " ZZM[k1last][5][1] = " << ZZM[k1last][5][1] << endl;
1936  cout << "********************* M L7 k1last = " << k1last
1937  << " ZZM[k1last][5][2] = " << ZZM[k1last][5][2] << endl;
1938  cout << "********************* M L7 k1last = " << k1last
1939  << " ZZM[k1last][5][3] = " << ZZM[k1last][5][3] << endl;
1940  cout << "********************* M L7 k1last = " << k1last
1941  << " ZZM[k1last][4][4] = " << ZZM[k1last][4][4] << endl; // eta=25
1942  cout << "********************* M L7 k1last = " << k1last
1943  << " ZZM[k1last][4][5] = " << ZZM[k1last][4][5] << endl;
1944  cout << "********************* M L7 k1last = " << k1last
1945  << " ZZM[k1last][4][6] = " << ZZM[k1last][4][6] << endl;
1946  cout << "********************* M L7 k1last = " << k1last
1947  << " ZZM[k1last][4][7] = " << ZZM[k1last][4][7] << endl;
1948  cout << "********************* M L7 k1last = " << k1last
1949  << " ZZM[k1last][4][8] = " << ZZM[k1last][4][8] << endl;
1950  cout << "********************* M L7 k1last = " << k1last
1951  << " ZZM[k1last][4][9] = " << ZZM[k1last][4][9] << endl;
1952  cout << "********************* M L7 k1last = " << k1last
1953  << " ZZM[k1last][4][10] = " << ZZM[k1last][4][10] << endl;
1954  cout << "********************* M L7 k1last = " << k1last
1955  << " ZZM[k1last][4][11] = " << ZZM[k1last][4][11] << endl; // eta=18
1956  cout << "********************* M L7 k1last = " << k1last
1957  << " ZZM[k1last][3][12] = " << ZZM[k1last][3][12] << endl; // eta=17 13-jj==1
1958  cout << "****************************************************************************** " << endl;
1959  }
1960  // if(kdirection == 0 && ZZM[k1last][5][10]<0.1 ) k1last=NP-2;
1963  // jj M: 0- 1 2 3 4 5 6 7 8 9 10 11 -12 13 P: 0 1- 2 3 4 5 6 7 8 9 10 11 12 -13
1964  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
1965 
1966  // :
1967  // RR N: 12 11 10 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 10 11 12
1968  // RR7 N: 10 9 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 10
1969 
1970  // 2018:
1971  // L1: (iii=d2 & eta 17-29);
1972  // M: int LM1 = 0;if((iii==2 && jj<13)) LM1 = 1;
1973  // P: int LP1 = 0;if((iii==2 && jj> 0)) LP1 = 1;
1974 
1975  // :L7: (iii=d3 & eta 17) && (iii=d4 & eta 18-25) && (iii=d5 & eta 26-28)
1976  // M: int LM7=0;if((iii==3 && jj==12) || (iii==4 && jj> 3 && jj<12) || (iii==5 && jj> 0 && jj< 4)) LM7=1;
1977  // P: int LP7=0;if((iii==3 && jj==1 ) || (iii==4 && jj> 1 && jj<10) || (iii==5 && jj> 9 && jj<13)) LP7=1;
1978  //
1979 
1980  // L1: eta 17-29
1981  if (kdirection == 0)
1982  for (int jj = 0; jj < 13; jj++) {
1983  if (LASERruns[k1last] > "305874") {
1984  RRM[12 - jj] = ZZM[k1last][2][jj];
1985  } else {
1986  RRM[12 - jj] = ZZM[k1last][1][jj];
1987  }
1988  }
1989  if (kdirection == 1)
1990  for (int jj = 1; jj < 14; jj++) {
1991  if (LASERruns[k1last] > "305874") {
1992  RRP[jj - 1] = ZZP[k1last][2][jj];
1993  } else {
1994  RRP[jj - 1] = ZZP[k1last][1][jj];
1995  }
1996  } // 29 P ?
1997 
1998  // L7: eta 18-28
1999  if (kdirection == 0)
2000  for (int iii = 2; iii < DepthMax; iii++) {
2001  for (int jj = 1; jj < 12; jj++) {
2002  if (LASERruns[k1last] > "305874") {
2003  if ((iii == 3 && 13 - jj == 1) || (iii == 4 && 13 - jj > 1 && 13 - jj < 10) ||
2004  (iii == 5 && 13 - jj > 9 && 13 - jj < 13)) {
2005  RRM7[11 - jj] = ZZM[k1last][iii][jj];
2006  // cout<<"***LAST ***** M L7 k1last = " <<k1last <<" iii = " <<iii <<" jj = " <<jj <<" ZZM[k1last][iii][jj] = " << ZZM[k1last][iii][jj] <<" 11-jj =" <<11-jj <<" RRM7[11-jj] = " << RRM7[11-jj] << endl;
2007  }
2008  } else {
2009  if ((iii == 2 && jj > 2 && jj < 12) || (iii == 3 && jj > 0 && jj < 3))
2010  RRM7[11 - jj] = ZZM[k1last][iii][jj];
2011  }
2012  }
2013  }
2014 
2015  if (kdirection == 1)
2016  for (int iii = 2; iii < DepthMax; iii++) {
2017  for (int jj = 1; jj < 13; jj++) {
2018  if (LASERruns[k1last] > "305874") {
2019  if ((iii == 3 && jj == 1) || (iii == 4 && jj > 1 && jj < 10) || (iii == 5 && jj > 9 && jj < 13)) {
2020  RRP7[jj - 2] = ZZP[k1last][iii][jj];
2021  }
2022  } else {
2023  if ((iii == 2 && jj > 1 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
2024  RRP7[jj - 2] = ZZP[k1last][iii][jj];
2025  }
2026  }
2027  }
2029 
2035 
2036  cout << "**** DRAWING **** **** **** **** Draw Dependencies: *** " << endl;
2037 
2039  Int_t Method = NMethodsStart;
2040  // M: kdirection==0
2041  // P: kdirection==1
2042  while (Method < NMethodsToUse + 1) {
2043  if ((kdirection == 1 && Method != 9 && Method != 19 && Method != 24 && Method != 26 && Method != 28 &&
2044  Method != 32 && Method != 1 && Method != 2 && Method != 3 && Method != 4 && Method != 5 && Method != 6 &&
2045  Method != 7 && Method != 8 && Method != 30) ||
2046  (kdirection == 0 && Method != 0 && Method != 10 && Method != 22 && Method != 27 && Method != 29 &&
2047  Method != 33 && Method != 11 && Method != 12 && Method != 13 && Method != 14 && Method != 15 &&
2048  Method != 16 && Method != 17 && Method != 18 && Method != 31 && Method != 20 && Method != 21 &&
2049  Method != 23 && Method != 25 && Method != 34 && Method != 35 && Method != 36)) {
2050  cout << " **** START Method " << Method << endl;
2051  //======================================================================================================= PLOT0: P: <Aijk>_ev.run for all runs
2052  if (Method == 0) {
2053  cout << "****Draw 0 Dependencies: P: draw <Aijk>_ev.run for all runs *** " << endl;
2054  gPad->SetGridy();
2055  gPad->SetGridx();
2056  gPad->SetLogy();
2057  gStyle->SetOptStat(101110);
2058  // Ceff1D->SetTitle("any Error, HE Depth1 \n");
2059  Ceff1D->SetMarkerStyle(20);
2060  Ceff1D->SetMarkerSize(0.4);
2061  Ceff1D->GetYaxis()->SetLabelSize(0.04);
2062  Ceff1D->SetTitle("P: all runs & channels");
2063  Ceff1D->SetXTitle("<Aijk>");
2064  Ceff1D->SetYTitle("N");
2065  Ceff1D->SetMarkerColor(4);
2066  Ceff1D->SetLineColor(4);
2067  // Ceff1D->Draw("Error");
2068  Ceff1D->Draw("PL");
2069  } //Method = 0
2070  // //////////////////////////////////////////////////////////////////////////
2071  //======================================================================================================= PLOT10: P: <Aijk>_ev.run for all runs
2072  if (Method == 10) {
2073  cout << "****Draw 10 Dependencies: P: draw <Aijk>_ev.run for all runs *** " << endl;
2074  gPad->SetGridy();
2075  gPad->SetGridx();
2076  gPad->SetLogy();
2077  gStyle->SetOptStat(101110);
2078  // Seff1D->SetTitle("any Error, HE Depth1 \n");
2079  Seff1D->SetMarkerStyle(20);
2080  Seff1D->SetMarkerSize(0.4);
2081  Seff1D->GetYaxis()->SetLabelSize(0.04);
2082  Seff1D->SetTitle("P: all runs & channels");
2083  Seff1D->SetXTitle("<Aijk>");
2084  Seff1D->SetYTitle("N");
2085  Seff1D->SetMarkerColor(4);
2086  Seff1D->SetLineColor(4);
2087  // Seff1D->Draw("Error");
2088  Seff1D->Draw("PL");
2089  } //Method = 10
2090  // //////////////////////////////////////////////////////////////////////////
2091  //======================================================================================================= PLOT9: M: <Aijk>_ev.run for all runs
2092  if (Method == 9) {
2093  cout << "****Draw 9 Dependencies: M: draw <Aijk>_ev.run for all runs *** " << endl;
2094  gPad->SetGridy();
2095  gPad->SetGridx();
2096  gPad->SetLogy();
2097  gStyle->SetOptStat(101110);
2098  c1->SetFillColor(0);
2099  // Ceff1D->SetTitle("any Error, HE Depth1 \n");
2100  Ceff1D->SetMarkerStyle(20);
2101  Ceff1D->SetMarkerSize(0.4);
2102  Ceff1D->GetYaxis()->SetLabelSize(0.04);
2103  Ceff1D->SetTitle("M: all runs & channels");
2104  Ceff1D->SetXTitle("<Aijk>");
2105  Ceff1D->SetYTitle("N");
2106  Ceff1D->SetMarkerColor(4);
2107  Ceff1D->SetLineColor(4);
2108  // Ceff1D->Draw("Error");
2109  Ceff1D->Draw("PL");
2110  } //Method = 9
2111  // //////////////////////////////////////////////////////////////////////////
2112  //======================================================================================================= PLOT19: M: <Aijk>_ev.run for all runs
2113  if (Method == 19) {
2114  cout << "****Draw 19 Dependencies: M: draw <Aijk>_ev.run for all runs *** " << endl;
2115  gPad->SetGridy();
2116  gPad->SetGridx();
2117  gPad->SetLogy();
2118  gStyle->SetOptStat(101110);
2119  c1->SetFillColor(0);
2120  // Seff1D->SetTitle("any Error, HE Depth1 \n");
2121  Seff1D->SetMarkerStyle(20);
2122  Seff1D->SetMarkerSize(0.4);
2123  Seff1D->GetYaxis()->SetLabelSize(0.04);
2124  Seff1D->SetTitle("M: all runs & channels");
2125  Seff1D->SetXTitle("<Aijk>");
2126  Seff1D->SetYTitle("N");
2127  Seff1D->SetMarkerColor(4);
2128  Seff1D->SetLineColor(4);
2129  // Seff1D->Draw("Error");
2130  Seff1D->Draw("PL");
2131  } //Method = 19
2132  // //////////////////////////////////////////////////////////////////////////
2133  //======================================================================================================= PLOT20: P: mean <Aijk>_ev.run for all runs 3 Depthes
2134  if (Method == 20) {
2135  cout << "****Draw 20 Dependencies: P: draw mean <Aijk>_ev.run for all runs Depth3 *** " << endl;
2136  gPad->SetGridy();
2137  gPad->SetGridx();
2138  gPad->SetLogy();
2139  gStyle->SetOptStat(101110);
2140  Meff1D->SetMarkerStyle(20);
2141  Meff1D->SetMarkerSize(0.4);
2142  Meff1D->GetYaxis()->SetLabelSize(0.04);
2143  Meff1D->SetXTitle("for mean <Aijk>");
2144  Meff1D->SetYTitle("N");
2145  Meff1D->SetMarkerColor(4);
2146  Meff1D->SetLineColor(4);
2147  Meff1D->Draw("Error");
2148  Meff2D->SetMarkerColor(2);
2149  Meff2D->SetLineColor(2);
2150  Meff2D->Draw("ErrorSame");
2151  Meff3D->SetMarkerColor(3);
2152  Meff3D->SetLineColor(3);
2153  Meff3D->Draw("ErrorSame");
2154  // Meff3D->Draw("PL");
2155  } //Method = 20
2156  // //////////////////////////////////////////////////////////////////////////
2157 
2158  //
2159  /*
2160 Draw("APL"); - w/ errors
2161 
2162  */
2163  // PLOTS WITH ZZM[k1][iii][jj] :
2164  //
2165  //======================================================================================================= PLOT1 r vs t negative direction:Depth1 and eta 21 22 23 25 27 28
2166  if (Method == 1) {
2167  for (int k1 = 0; k1 < NP; k1++) {
2168  YY[k1] = 0.;
2169  }
2170  c1->Range(0, 0, 25, 18);
2171  c1->SetFillColor(0);
2172  c1->Clear();
2173  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
2174  // TPad *pad1 = new TPad("pad1","This is pad1",0.02,0.02,0.98,0.83,33);
2175  pad1->Draw();
2176  pad1->cd();
2177  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
2178  // x1 y1 x2 y2
2179  pad1->DrawFrame(x1, y1, x2, y2); // 1-A,
2180  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
2181  pad1->GetFrame()->SetFillColor(0);
2182  pad1->Draw();
2183  gPad->SetGridy();
2184  gPad->SetGridx();
2185  cout << "****Draw 1 Dependencies: M r vs t for Depth1 and some eta 21 22 23 25 27 28 *** " << endl;
2186  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
2187  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
2188  // - - - - - - - - - - - -
2189  for (int k1 = 0; k1 < NP; k1++) {
2190  YY[k1] = ZZM[k1][1][1];
2191  } // eta=28
2192  gr1 = new TGraph(NP, XX, YY);
2193  gr1->SetLineColor(1);
2194  gr1->SetMarkerColor(1);
2195  gr1->SetMarkerStyle(20);
2196  gr1->SetMarkerSize(1.2);
2197  gr1->SetTitle("ieta 28");
2198  gr1->SetFillStyle(0);
2199  gr1->Draw("P");
2200  for (int k1 = 0; k1 < NP; k1++) {
2201  YY[k1] = ZZM[k1][1][2];
2202  }
2203  gr2 = new TGraph(NP, XX, YY);
2204  gr2->SetLineColor(2);
2205  gr2->SetMarkerColor(2);
2206  gr2->SetMarkerStyle(20);
2207  gr2->SetMarkerSize(1.2);
2208  gr2->SetTitle("ieta 27");
2209  gr2->SetFillStyle(0);
2210  gr2->Draw("P");
2211  for (int k1 = 0; k1 < NP; k1++) {
2212  YY[k1] = ZZM[k1][1][4];
2213  }
2214  gr3 = new TGraph(NP, XX, YY);
2215  gr3->SetLineColor(3);
2216  gr3->SetMarkerColor(3);
2217  gr3->SetMarkerStyle(20);
2218  gr3->SetMarkerSize(1.2);
2219  gr3->SetTitle("ieta 25");
2220  gr3->SetFillStyle(0);
2221  gr3->Draw("P");
2222  for (int k1 = 0; k1 < NP; k1++) {
2223  YY[k1] = ZZM[k1][1][6];
2224  }
2225  gr4 = new TGraph(NP, XX, YY);
2226  gr4->SetLineColor(4);
2227  gr4->SetMarkerColor(4);
2228  gr4->SetMarkerStyle(20);
2229  gr4->SetMarkerSize(1.2);
2230  gr4->SetTitle("ieta 23");
2231  gr4->SetFillStyle(0);
2232  gr4->Draw("P");
2233  for (int k1 = 0; k1 < NP; k1++) {
2234  YY[k1] = ZZM[k1][1][7];
2235  }
2236  gr5 = new TGraph(NP, XX, YY);
2237  gr5->SetLineColor(5);
2238  gr5->SetMarkerColor(5);
2239  gr5->SetMarkerStyle(20);
2240  gr5->SetMarkerSize(1.2);
2241  gr5->SetTitle("ieta 22");
2242  gr5->SetFillStyle(0);
2243  gr5->Draw("P");
2244  for (int k1 = 0; k1 < NP; k1++) {
2245  YY[k1] = ZZM[k1][1][8];
2246  }
2247  gr6 = new TGraph(NP, XX, YY);
2248  gr6->SetLineColor(6);
2249  gr6->SetMarkerColor(6);
2250  gr6->SetMarkerStyle(20);
2251  gr6->SetMarkerSize(1.2);
2252  gr6->SetTitle("ieta 21");
2253  gr6->SetFillStyle(0);
2254  gr6->Draw("P");
2255  // TLegend leg(.6,.67,.78,.88, " HEP Depth1");
2256  TLegend leg(xx1, yy1, xx2, yy2, " HEM Depth1");
2257  leg.AddEntry(gr1);
2258  leg.AddEntry(gr2);
2259  leg.AddEntry(gr3);
2260  leg.AddEntry(gr4);
2261  leg.AddEntry(gr5);
2262  leg.AddEntry(gr6);
2263  leg.SetMargin(0.3);
2264  leg.SetBorderSize(1);
2265  leg.DrawClone("Same");
2266  //
2267  } //1
2268  //======================================================================================================= PLOT2 r vs t negative direction:Depth1 and eta 17 18? 19 20? 24 26 29
2269  if (Method == 2) {
2270  for (int k1 = 0; k1 < NP; k1++) {
2271  YY[k1] = 0.;
2272  }
2273  c1->Range(0, 0, 25, 18);
2274  c1->SetFillColor(0);
2275  c1->Clear();
2276  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
2277  pad1->Draw();
2278  pad1->cd();
2279  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
2280  // x1 y1 x2 y2
2281  pad1->DrawFrame(x1, y1, x2, y2); // 1-A,
2282  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
2283  pad1->GetFrame()->SetFillColor(0);
2284  pad1->Draw();
2285  gPad->SetGridy();
2286  gPad->SetGridx();
2287  cout << "****Draw 2 Dependencies: M r vs t for Depth1 and some eta 17 18 19 20 24 26 29 *** " << endl;
2288  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
2289  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
2290  // - - - - - - - - - - - -
2291  for (int k1 = 0; k1 < NP; k1++) {
2292  YY[k1] = ZZM[k1][1][0];
2293  // if (YY[k1]>1.001 || YY[k1]<0.1 ) cout<<"\"" << LASERruns[k1] <<"\"," << endl;
2294  // if (YY[k1]<.64 ) cout<<" k1 = " << k1 <<" \"," <<"\"" << LASERruns[k1] <<"\"," <<" XX[k1] = " << YY[k1] <<" XX[k1] = " << YY[k1] << endl;
2295  // if (k1> 30 ) cout<<" k1 = " << k1 <<" \"," <<"\"" << LASERruns[k1] <<"\"," <<" XX[k1] = " << XX[k1] <<" YY[k1] = " << YY[k1] << endl;
2296 
2297  } // eta=29
2298  gr1 = new TGraph(NP, XX, YY);
2299  gr1->SetLineColor(1);
2300  gr1->SetMarkerColor(1);
2301  gr1->SetMarkerStyle(20);
2302  gr1->SetMarkerSize(1.2);
2303  gr1->SetTitle("ieta 29");
2304  gr1->SetFillStyle(0);
2305  gr1->Draw("P");
2306  for (int k1 = 0; k1 < NP; k1++) {
2307  YY[k1] = ZZM[k1][1][3];
2308  }
2309  gr2 = new TGraph(NP, XX, YY);
2310  gr2->SetLineColor(2);
2311  gr2->SetMarkerColor(2);
2312  gr2->SetMarkerStyle(20);
2313  gr2->SetMarkerSize(1.2);
2314  gr2->SetTitle("ieta 26");
2315  gr2->SetFillStyle(0);
2316  gr2->Draw("P");
2317  for (int k1 = 0; k1 < NP; k1++) {
2318  YY[k1] = ZZM[k1][1][5];
2319  }
2320  gr3 = new TGraph(NP, XX, YY);
2321  gr3->SetLineColor(3);
2322  gr3->SetMarkerColor(3);
2323  gr3->SetMarkerStyle(20);
2324  gr3->SetMarkerSize(1.2);
2325  gr3->SetTitle("ieta 24");
2326  gr3->SetFillStyle(0);
2327  gr3->Draw("P");
2328  // for(int k1 = 0; k1<NP; k1++) {YY[k1] = ZZM[k1][1][9];}/// eta=20
2329  // gr6 = new TGraph(NP,XX,YY); gr6->SetLineColor(4); gr6->SetMarkerColor(4); gr6->SetMarkerStyle(20); gr6->SetMarkerSize(1.2); gr6->SetTitle("ieta 20"); gr6->SetFillStyle(0); gr6->Draw("P");
2330  for (int k1 = 0; k1 < NP; k1++) {
2331  YY[k1] = ZZM[k1][1][10];
2332  }
2333  gr4 = new TGraph(NP, XX, YY);
2334  gr4->SetLineColor(5);
2335  gr4->SetMarkerColor(5);
2336  gr4->SetMarkerStyle(20);
2337  gr4->SetMarkerSize(1.2);
2338  gr4->SetTitle("ieta 19");
2339  gr4->SetFillStyle(0);
2340  gr4->Draw("P");
2341  // for(int k1 = 0; k1<NP; k1++) {YY[k1] = ZZM[k1][1][11];}/// eta=18
2342  // gr7 = new TGraph(NP,XX,YY); gr7->SetLineColor(6); gr7->SetMarkerColor(6); gr7->SetMarkerStyle(20); gr7->SetMarkerSize(1.2); gr7->SetTitle("ieta 18"); gr7->SetFillStyle(0); gr7->Draw("P");
2343  for (int k1 = 0; k1 < NP; k1++) {
2344  YY[k1] = ZZM[k1][1][12];
2345  }
2346  gr5 = new TGraph(NP, XX, YY);
2347  gr5->SetLineColor(7);
2348  gr5->SetMarkerColor(7);
2349  gr5->SetMarkerStyle(20);
2350  gr5->SetMarkerSize(1.2);
2351  gr5->SetTitle("ieta 17");
2352  gr5->SetFillStyle(0);
2353  gr5->Draw("P");
2354  // TLegend leg(.6,.67,.78,.88, " HEP Depth1");
2355  TLegend leg(xx1, yy1, xx2, yy2, " HEM Depth1");
2356  leg.AddEntry(gr1);
2357  leg.AddEntry(gr2);
2358  leg.AddEntry(gr3);
2359  leg.AddEntry(gr4);
2360  leg.AddEntry(gr5); //leg.AddEntry(gr6);leg.AddEntry(gr7);leg.AddEntry(gr8);
2361  leg.SetMargin(0.3);
2362  leg.SetBorderSize(1);
2363  leg.DrawClone("Same");
2364  //
2365  } //12
2366  //
2367  //======================================================================================================= PLOT3 r vs t negative direction:Depth2 and eta 21 22 23 25
2368  if (Method == 3) {
2369  for (int k1 = 0; k1 < NP; k1++) {
2370  YY[k1] = 0.;
2371  }
2372  c1->Range(0, 0, 25, 18);
2373  c1->SetFillColor(0);
2374  c1->Clear();
2375  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
2376  pad1->Draw();
2377  pad1->cd();
2378  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
2379  // x1 y1 x2 y2
2380  pad1->DrawFrame(x1, y3, x2, y4); // 1-A,
2381  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
2382  pad1->GetFrame()->SetFillColor(0);
2383  pad1->Draw();
2384  gPad->SetGridy();
2385  gPad->SetGridx();
2386  cout << "****Draw 3 Dependencies: M r vs t for Depth2 and some eta 21 22 23 25 27 28 *** " << endl;
2387  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
2388  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
2389  // - - - - - - - - - - - -
2390  for (int k1 = 0; k1 < NP; k1++) {
2391  YY[k1] = ZZM[k1][2][4];
2392  }
2393  gr1 = new TGraph(NP, XX, YY);
2394  gr1->SetLineColor(1);
2395  gr1->SetMarkerColor(1);
2396  gr1->SetMarkerStyle(20);
2397  gr1->SetMarkerSize(1.2);
2398  gr1->SetTitle("ieta 25");
2399  gr1->SetFillStyle(0);
2400  gr1->Draw("P");
2401  for (int k1 = 0; k1 < NP; k1++) {
2402  YY[k1] = ZZM[k1][2][6];
2403  }
2404  gr2 = new TGraph(NP, XX, YY);
2405  gr2->SetLineColor(2);
2406  gr2->SetMarkerColor(2);
2407  gr2->SetMarkerStyle(20);
2408  gr2->SetMarkerSize(1.2);
2409  gr2->SetTitle("ieta 23");
2410  gr2->SetFillStyle(0);
2411  gr2->Draw("P");
2412  for (int k1 = 0; k1 < NP; k1++) {
2413  YY[k1] = ZZM[k1][2][7];
2414  }
2415  gr3 = new TGraph(NP, XX, YY);
2416  gr3->SetLineColor(3);
2417  gr3->SetMarkerColor(3);
2418  gr3->SetMarkerStyle(20);
2419  gr3->SetMarkerSize(1.2);
2420  gr3->SetTitle("ieta 22");
2421  gr3->SetFillStyle(0);
2422  gr3->Draw("P");
2423  for (int k1 = 0; k1 < NP; k1++) {
2424  YY[k1] = ZZM[k1][2][8];
2425  }
2426  gr4 = new TGraph(NP, XX, YY);
2427  gr4->SetLineColor(4);
2428  gr4->SetMarkerColor(4);
2429  gr4->SetMarkerStyle(20);
2430  gr4->SetMarkerSize(1.2);
2431  gr4->SetTitle("ieta 21");
2432  gr4->SetFillStyle(0);
2433  gr4->Draw("P");
2434  // TLegend leg(.6,.67,.78,.88, " HEP Depth2");
2435  TLegend leg(xx1, yy1, xx2, yy2, " HEM Depth2");
2436  leg.AddEntry(gr1);
2437  leg.AddEntry(gr2);
2438  leg.AddEntry(gr3);
2439  leg.AddEntry(gr4); //leg.AddEntry(gr5);leg.AddEntry(gr6);leg.AddEntry(gr7);leg.AddEntry(gr8);
2440  leg.SetMargin(0.3);
2441  leg.SetBorderSize(1);
2442  leg.DrawClone("Same");
2443  //
2444  } //3
2445  //
2446  //======================================================================================================= PLOT4 r vs t negative direction:Depth2 and eta 17 18 19 20 24 26
2447  if (Method == 4) {
2448  for (int k1 = 0; k1 < NP; k1++) {
2449  YY[k1] = 0.;
2450  }
2451  c1->Range(0, 0, 25, 18);
2452  c1->SetFillColor(0);
2453  c1->Clear();
2454  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
2455  pad1->Draw();
2456  pad1->cd();
2457  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
2458  // x1 y1 x2 y2
2459  pad1->DrawFrame(x1, y3, x2, y4); // 1-A,
2460  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
2461  pad1->GetFrame()->SetFillColor(0);
2462  pad1->Draw();
2463  gPad->SetGridy();
2464  gPad->SetGridx();
2465  cout << "****Draw 4 Dependencies: M r vs t for Depth2 and some eta 17 18 19 20 24 26 29 *** " << endl;
2466  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
2467  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
2468  // - - - - - - - - - - - -
2469  for (int k1 = 0; k1 < NP; k1++) {
2470  YY[k1] = ZZM[k1][2][3];
2471  }
2472  gr1 = new TGraph(NP, XX, YY);
2473  gr1->SetLineColor(1);
2474  gr1->SetMarkerColor(1);
2475  gr1->SetMarkerStyle(20);
2476  gr1->SetMarkerSize(1.2);
2477  gr1->SetTitle("ieta 26");
2478  gr1->SetFillStyle(0);
2479  gr1->Draw("P");
2480  for (int k1 = 0; k1 < NP; k1++) {
2481  YY[k1] = ZZM[k1][2][5];
2482  }
2483  gr2 = new TGraph(NP, XX, YY);
2484  gr2->SetLineColor(2);
2485  gr2->SetMarkerColor(2);
2486  gr2->SetMarkerStyle(20);
2487  gr2->SetMarkerSize(1.2);
2488  gr2->SetTitle("ieta 24");
2489  gr2->SetFillStyle(0);
2490  gr2->Draw("P");
2491  for (int k1 = 0; k1 < NP; k1++) {
2492  YY[k1] = ZZM[k1][2][9];
2493  }
2494  gr3 = new TGraph(NP, XX, YY);
2495  gr3->SetLineColor(3);
2496  gr3->SetMarkerColor(3);
2497  gr3->SetMarkerStyle(20);
2498  gr3->SetMarkerSize(1.2);
2499  gr3->SetTitle("ieta 20");
2500  gr3->SetFillStyle(0);
2501  gr3->Draw("P");
2502  for (int k1 = 0; k1 < NP; k1++) {
2503  YY[k1] = ZZM[k1][2][10];
2504  }
2505  gr4 = new TGraph(NP, XX, YY);
2506  gr4->SetLineColor(4);
2507  gr4->SetMarkerColor(4);
2508  gr4->SetMarkerStyle(20);
2509  gr4->SetMarkerSize(1.2);
2510  gr4->SetTitle("ieta 19");
2511  gr4->SetFillStyle(0);
2512  gr4->Draw("P");
2513  for (int k1 = 0; k1 < NP; k1++) {
2514  YY[k1] = ZZM[k1][2][11];
2515  }
2516  gr5 = new TGraph(NP, XX, YY);
2517  gr5->SetLineColor(5);
2518  gr5->SetMarkerColor(5);
2519  gr5->SetMarkerStyle(20);
2520  gr5->SetMarkerSize(1.2);
2521  gr5->SetTitle("ieta 18");
2522  gr5->SetFillStyle(0);
2523  gr5->Draw("P");
2524  // for(int k1 = 0; k1<NP; k1++) {YY[k1] = ZZM[k1][2][12];}/// eta=17
2525  // gr6 = new TGraph(NP,XX,YY); gr6->SetLineColor(6); gr6->SetMarkerColor(6); gr6->SetMarkerStyle(20); gr6->SetMarkerSize(1.2); gr6->SetTitle("ieta 17"); gr6->SetFillStyle(0); gr6->Draw("P");
2526  // TLegend leg(.6,.67,.78,.88, " HEP Depth2");
2527  TLegend leg(xx1, yy1, xx2, yy2, " HEM Depth2");
2528  leg.AddEntry(gr1);
2529  leg.AddEntry(gr2);
2530  leg.AddEntry(gr3);
2531  leg.AddEntry(gr4);
2532  leg.AddEntry(gr5); //leg.AddEntry(gr6);leg.AddEntry(gr7);leg.AddEntry(gr8);
2533  leg.SetMargin(0.3);
2534  leg.SetBorderSize(1);
2535  leg.DrawClone("Same");
2536  //
2537  } // 4
2538  //
2539  //
2540  //================================================================================
2541  //================================================================================
2542  //======================================================================================================= PLOT5 negative direction:r vs t for L1 and eta 21 22 23 25 27 28
2543  if (Method == 5) {
2544  for (int k1 = 0; k1 < NP; k1++) {
2545  YY[k1] = 0.;
2546  }
2547  c1->Range(0, 0, 25, 18);
2548  c1->SetFillColor(0);
2549  c1->Clear();
2550  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
2551  pad1->Draw();
2552  pad1->cd();
2553  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
2554  // x1 y1 x2 y2
2555  pad1->DrawFrame(x1, y1, x2, y2); // 1-A,
2556  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
2557  pad1->GetFrame()->SetFillColor(0);
2558  pad1->Draw();
2559  gPad->SetGridy();
2560  gPad->SetGridx();
2561  cout << "****Draw 5 Dependencies: M r vs t for L1 and eta 21 22 23 25 27 28 **** " << endl;
2562  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
2563  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
2564  // - - - - - - - - - - - -
2565  //======================================================= introduce Layers: negative direction
2566  //jj M: >0 >1 2 >3 <4 5 6 7 8 9 10 11 12 <13 P: 0> 1 2 3 4 5 6 7 8 9 10> <11 12< 13<
2567  // real N: 29- -28 -27 26- 25 24 23 22 21 20 19 18 17- 16 16 17- 18 19 20 21 22 23 24 25 26- 27- 28- 29-
2568  // iii=depth, jj=eta
2569  // M:
2570  // ZZM[k1][iii][jj] (iii=d1 & eta 17-29) L1
2571 
2572  // jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 2018:
2573  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
2574  // L1: (iii=d2 & eta 17-29);
2575  // M: int LM1 = 0;if((iii==2 && jj<13)) LM1 = 1;
2576  // :L7: (iii=d3 & eta 17) && (iii=d4 & eta 18-25) && (iii=d5 & eta 26-28)
2577  // M: int LM7=0;if((iii==3 && jj==12) || (iii==4 && jj> 3 && jj<12) || (iii==5 && jj> 0 && jj< 4)) LM7=1;
2578  //
2579  // eta=28 L1=1
2580  for (int k1 = 0; k1 < NP; k1++) {
2581  YY[k1] = 0.;
2582  if (LASERruns[k1] > "305874") {
2583  for (int iii = 2; iii < 3; iii++) {
2584  for (int jj = 0; jj < 13; jj++) {
2585  int LM1 = 0;
2586  if ((iii == 2 && jj < 13))
2587  LM1 = 1;
2588  if (LM1 == 1 && jj == 1) {
2589  YY[k1] = ZZM[k1][iii][jj];
2590  }
2591  }
2592  }
2593  } else {
2594  for (int iii = 1; iii < 2; iii++) {
2595  for (int jj = 0; jj < 13; jj++) {
2596  int LM1 = 0;
2597  if ((iii == 1 && jj < 13))
2598  LM1 = 1;
2599  if (LM1 == 1 && jj == 1) {
2600  YY[k1] = ZZM[k1][iii][jj];
2601  }
2602  }
2603  }
2604  }
2605  }
2606  gr1 = new TGraph(NP, XX, YY);
2607  gr1->SetLineColor(1);
2608  gr1->SetMarkerColor(1);
2609  gr1->SetMarkerStyle(20);
2610  gr1->SetMarkerSize(1.2);
2611  gr1->SetTitle("ieta 28");
2612  gr1->SetFillStyle(0);
2613  gr1->Draw("P");
2615  for (int k1 = 0; k1 < NP; k1++) {
2616  YY[k1] = 0.;
2617  if (LASERruns[k1] > "305874") {
2618  for (int iii = 2; iii < 3; iii++) {
2619  for (int jj = 0; jj < 13; jj++) {
2620  int LM1 = 0;
2621  if ((iii == 2 && jj < 13))
2622  LM1 = 1;
2623  if (LM1 == 1 && jj == 2) {
2624  YY[k1] = ZZM[k1][iii][jj];
2625  }
2626  }
2627  }
2628  } else {
2629  for (int iii = 1; iii < 2; iii++) {
2630  for (int jj = 0; jj < 13; jj++) {
2631  int LM1 = 0;
2632  if ((iii == 1 && jj < 13))
2633  LM1 = 1;
2634  if (LM1 == 1 && jj == 2) {
2635  YY[k1] = ZZM[k1][iii][jj];
2636  }
2637  }
2638  }
2639  }
2640  }
2641  gr2 = new TGraph(NP, XX, YY);
2642  gr2->SetLineColor(2);
2643  gr2->SetMarkerColor(2);
2644  gr2->SetMarkerStyle(20);
2645  gr2->SetMarkerSize(1.2);
2646  gr2->SetTitle("ieta 27");
2647  gr2->SetFillStyle(0);
2648  gr2->Draw("P");
2650  for (int k1 = 0; k1 < NP; k1++) {
2651  YY[k1] = 0.;
2652  if (LASERruns[k1] > "305874") {
2653  for (int iii = 2; iii < 3; iii++) {
2654  for (int jj = 0; jj < 13; jj++) {
2655  int LM1 = 0;
2656  if ((iii == 2 && jj < 13))
2657  LM1 = 1;
2658  if (LM1 == 1 && jj == 4) {
2659  YY[k1] = ZZM[k1][iii][jj];
2660  }
2661  }
2662  }
2663  } else {
2664  for (int iii = 1; iii < 2; iii++) {
2665  for (int jj = 0; jj < 13; jj++) {
2666  int LM1 = 0;
2667  if ((iii == 1 && jj < 13))
2668  LM1 = 1;
2669  if (LM1 == 1 && jj == 4) {
2670  YY[k1] = ZZM[k1][iii][jj];
2671  }
2672  }
2673  }
2674  }
2675  }
2676  gr3 = new TGraph(NP, XX, YY);
2677  gr3->SetLineColor(3);
2678  gr3->SetMarkerColor(3);
2679  gr3->SetMarkerStyle(20);
2680  gr3->SetMarkerSize(1.2);
2681  gr3->SetTitle("ieta 25");
2682  gr3->SetFillStyle(0);
2683  gr3->Draw("P");
2685  for (int k1 = 0; k1 < NP; k1++) {
2686  YY[k1] = 0.;
2687  if (LASERruns[k1] > "305874") {
2688  for (int iii = 2; iii < 3; iii++) {
2689  for (int jj = 0; jj < 13; jj++) {
2690  int LM1 = 0;
2691  if ((iii == 2 && jj < 13))
2692  LM1 = 1;
2693  if (LM1 == 1 && jj == 6) {
2694  YY[k1] = ZZM[k1][iii][jj];
2695  }
2696  }
2697  }
2698  } else {
2699  for (int iii = 1; iii < 2; iii++) {
2700  for (int jj = 0; jj < 13; jj++) {
2701  int LM1 = 0;
2702  if ((iii == 1 && jj < 13))
2703  LM1 = 1;
2704  if (LM1 == 1 && jj == 6) {
2705  YY[k1] = ZZM[k1][iii][jj];
2706  }
2707  }
2708  }
2709  }
2710  }
2711  gr4 = new TGraph(NP, XX, YY);
2712  gr4->SetLineColor(4);
2713  gr4->SetMarkerColor(4);
2714  gr4->SetMarkerStyle(20);
2715  gr4->SetMarkerSize(1.2);
2716  gr4->SetTitle("ieta 23");
2717  gr4->SetFillStyle(0);
2718  gr4->Draw("P");
2720  for (int k1 = 0; k1 < NP; k1++) {
2721  YY[k1] = 0.;
2722  if (LASERruns[k1] > "305874") {
2723  for (int iii = 2; iii < 3; iii++) {
2724  for (int jj = 0; jj < 13; jj++) {
2725  int LM1 = 0;
2726  if ((iii == 2 && jj < 13))
2727  LM1 = 1;
2728  if (LM1 == 1 && jj == 7) {
2729  YY[k1] = ZZM[k1][iii][jj];
2730  }
2731  }
2732  }
2733  } else {
2734  for (int iii = 1; iii < 2; iii++) {
2735  for (int jj = 0; jj < 13; jj++) {
2736  int LM1 = 0;
2737  if ((iii == 1 && jj < 13))
2738  LM1 = 1;
2739  if (LM1 == 1 && jj == 7) {
2740  YY[k1] = ZZM[k1][iii][jj];
2741  }
2742  }
2743  }
2744  }
2745  }
2746  gr5 = new TGraph(NP, XX, YY);
2747  gr5->SetLineColor(5);
2748  gr5->SetMarkerColor(5);
2749  gr5->SetMarkerStyle(20);
2750  gr5->SetMarkerSize(1.2);
2751  gr5->SetTitle("ieta 22");
2752  gr5->SetFillStyle(0);
2753  gr5->Draw("P");
2755  for (int k1 = 0; k1 < NP; k1++) {
2756  YY[k1] = 0.;
2757  if (LASERruns[k1] > "305874") {
2758  for (int iii = 2; iii < 3; iii++) {
2759  for (int jj = 0; jj < 13; jj++) {
2760  int LM1 = 0;
2761  if ((iii == 2 && jj < 13))
2762  LM1 = 1;
2763  if (LM1 == 1 && jj == 8) {
2764  YY[k1] = ZZM[k1][iii][jj];
2765  }
2766  }
2767  }
2768  } else {
2769  for (int iii = 1; iii < 2; iii++) {
2770  for (int jj = 0; jj < 13; jj++) {
2771  int LM1 = 0;
2772  if ((iii == 1 && jj < 13))
2773  LM1 = 1;
2774  if (LM1 == 1 && jj == 8) {
2775  YY[k1] = ZZM[k1][iii][jj];
2776  }
2777  }
2778  }
2779  }
2780  }
2781  gr6 = new TGraph(NP, XX, YY);
2782  gr6->SetLineColor(6);
2783  gr6->SetMarkerColor(6);
2784  gr6->SetMarkerStyle(20);
2785  gr6->SetMarkerSize(1.2);
2786  gr6->SetTitle("ieta 21");
2787  gr6->SetFillStyle(0);
2788  gr6->Draw("P");
2789  // TLegend leg(.6,.67,.78,.88, " HEP L1");
2790  TLegend leg(xx1, yy1, xx2, yy2, " HEM L1");
2791  leg.AddEntry(gr1);
2792  leg.AddEntry(gr2);
2793  leg.AddEntry(gr3);
2794  leg.AddEntry(gr4);
2795  leg.AddEntry(gr5);
2796  leg.AddEntry(gr6); //leg.AddEntry(gr7);leg.AddEntry(gr8);
2797  leg.SetMargin(0.3);
2798  leg.SetBorderSize(1);
2799  leg.DrawClone("Same");
2800 
2801  } //if(Method == 5
2802  //
2803 
2804  //======================================================================================================= PLOT6 negative direction:r vs t for L1 and eta 17 18 19 20 24 26 29
2805  if (Method == 6) {
2806  for (int k1 = 0; k1 < NP; k1++) {
2807  YY[k1] = 0.;
2808  }
2809  c1->Range(0, 0, 25, 18);
2810  c1->SetFillColor(0);
2811  c1->Clear();
2812  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
2813  pad1->Draw();
2814  pad1->cd();
2815  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
2816  // x1 y1 x2 y2
2817  pad1->DrawFrame(x1, y1, x2, y2); // 1-A,
2818  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
2819  pad1->GetFrame()->SetFillColor(0);
2820  pad1->Draw();
2821  gPad->SetGridy();
2822  gPad->SetGridx();
2823  cout << "****Draw 6 Dependencies: M r vs t for L1 and eta 17 18 19 20 24 26 29 **** " << endl;
2824  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
2825  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
2827  for (int k1 = 0; k1 < NP; k1++) {
2828  YY[k1] = 0.;
2829  if (LASERruns[k1] > "305874") {
2830  for (int iii = 2; iii < 3; iii++) {
2831  for (int jj = 0; jj < 13; jj++) {
2832  int LM1 = 0;
2833  if ((iii == 2 && jj < 13))
2834  LM1 = 1;
2835  if (LM1 == 1 && jj == 0) {
2836  YY[k1] = ZZM[k1][iii][jj];
2837  }
2838  }
2839  }
2840  } else {
2841  for (int iii = 1; iii < 2; iii++) {
2842  for (int jj = 0; jj < 13; jj++) {
2843  int LM1 = 0;
2844  if ((iii == 1 && jj < 13))
2845  LM1 = 1;
2846  if (LM1 == 1 && jj == 0) {
2847  YY[k1] = ZZM[k1][iii][jj];
2848  }
2849  }
2850  }
2851  }
2852  }
2853  gr1 = new TGraph(NP, XX, YY);
2854  gr1->SetLineColor(1);
2855  gr1->SetMarkerColor(1);
2856  gr1->SetMarkerStyle(20);
2857  gr1->SetMarkerSize(1.2);
2858  gr1->SetTitle("ieta 29");
2859  gr1->SetFillStyle(0);
2860  gr1->Draw("P");
2862  for (int k1 = 0; k1 < NP; k1++) {
2863  YY[k1] = 0.;
2864  if (LASERruns[k1] > "305874") {
2865  for (int iii = 2; iii < 3; iii++) {
2866  for (int jj = 0; jj < 13; jj++) {
2867  int LM1 = 0;
2868  if ((iii == 2 && jj < 13))
2869  LM1 = 1;
2870  if (LM1 == 1 && jj == 3) {
2871  YY[k1] = ZZM[k1][iii][jj];
2872  }
2873  }
2874  }
2875  } else {
2876  for (int iii = 1; iii < 2; iii++) {
2877  for (int jj = 0; jj < 13; jj++) {
2878  int LM1 = 0;
2879  if ((iii == 1 && jj < 13))
2880  LM1 = 1;
2881  if (LM1 == 1 && jj == 3) {
2882  YY[k1] = ZZM[k1][iii][jj];
2883  }
2884  }
2885  }
2886  }
2887  }
2888  gr2 = new TGraph(NP, XX, YY);
2889  gr2->SetLineColor(2);
2890  gr2->SetMarkerColor(2);
2891  gr2->SetMarkerStyle(20);
2892  gr2->SetMarkerSize(1.2);
2893  gr2->SetTitle("ieta 26");
2894  gr2->SetFillStyle(0);
2895  gr2->Draw("P");
2897  for (int k1 = 0; k1 < NP; k1++) {
2898  YY[k1] = 0.;
2899  if (LASERruns[k1] > "305874") {
2900  for (int iii = 2; iii < 3; iii++) {
2901  for (int jj = 0; jj < 13; jj++) {
2902  int LM1 = 0;
2903  if ((iii == 2 && jj < 13))
2904  LM1 = 1;
2905  if (LM1 == 1 && jj == 5) {
2906  YY[k1] = ZZM[k1][iii][jj];
2907  }
2908  }
2909  }
2910  } else {
2911  for (int iii = 1; iii < 2; iii++) {
2912  for (int jj = 0; jj < 13; jj++) {
2913  int LM1 = 0;
2914  if ((iii == 1 && jj < 13))
2915  LM1 = 1;
2916  if (LM1 == 1 && jj == 5) {
2917  YY[k1] = ZZM[k1][iii][jj];
2918  }
2919  }
2920  }
2921  }
2922  }
2923  gr3 = new TGraph(NP, XX, YY);
2924  gr3->SetLineColor(3);
2925  gr3->SetMarkerColor(3);
2926  gr3->SetMarkerStyle(20);
2927  gr3->SetMarkerSize(1.2);
2928  gr3->SetTitle("ieta 24");
2929  gr3->SetFillStyle(0);
2930  gr3->Draw("P");
2932  // for(int k1 = 0; k1<NP; k1++) {YY[k1]=0.;if(LASERruns[k1] > "305874" ) {for(int iii = 2; iii<3; iii++) {for (int jj=0;jj<13;jj++) {int LM1 = 0;if((iii==2 && jj<13)) LM1 = 1;if(LM1 == 1 && jj == 9) {YY[k1] = ZZM[k1][iii][jj];} }}}else{for(int iii = 1; iii<2; iii++) {for (int jj=0;jj<13;jj++) {int LM1 = 0;if((iii==1 && jj<13)) LM1 = 1;if(LM1 == 1 && jj == 9) {YY[k1] = ZZM[k1][iii][jj];} }}}}
2933  // gr6 = new TGraph(NP,XX,YY); gr6->SetLineColor(4); gr6->SetMarkerColor(4); gr6->SetMarkerStyle(20); gr6->SetMarkerSize(1.2); gr6->SetTitle("ieta 20"); gr6->SetFillStyle(0); gr6->Draw("P");
2935  for (int k1 = 0; k1 < NP; k1++) {
2936  YY[k1] = 0.;
2937  if (LASERruns[k1] > "305874") {
2938  for (int iii = 2; iii < 3; iii++) {
2939  for (int jj = 0; jj < 13; jj++) {
2940  int LM1 = 0;
2941  if ((iii == 2 && jj < 13))
2942  LM1 = 1;
2943  if (LM1 == 1 && jj == 10) {
2944  YY[k1] = ZZM[k1][iii][jj];
2945  }
2946  }
2947  }
2948  } else {
2949  for (int iii = 1; iii < 2; iii++) {
2950  for (int jj = 0; jj < 13; jj++) {
2951  int LM1 = 0;
2952  if ((iii == 1 && jj < 13))
2953  LM1 = 1;
2954  if (LM1 == 1 && jj == 10) {
2955  YY[k1] = ZZM[k1][iii][jj];
2956  }
2957  }
2958  }
2959  }
2960  }
2961  gr4 = new TGraph(NP, XX, YY);
2962  gr4->SetLineColor(5);
2963  gr4->SetMarkerColor(5);
2964  gr4->SetMarkerStyle(20);
2965  gr4->SetMarkerSize(1.2);
2966  gr4->SetTitle("ieta 19");
2967  gr4->SetFillStyle(0);
2968  gr4->Draw("P");
2970  // for(int k1 = 0; k1<NP; k1++) {YY[k1]=0.;if(LASERruns[k1] > "305874" ) {for(int iii = 2; iii<3; iii++) {for (int jj=0;jj<13;jj++) {int LM1 = 0;if((iii==2 && jj<13)) LM1 = 1;if(LM1 == 1 && jj ==11) {YY[k1] = ZZM[k1][iii][jj];} }}}else{for(int iii = 1; iii<2; iii++) {for (int jj=0;jj<13;jj++) {int LM1 = 0;if((iii==1 && jj<13)) LM1 = 1;if(LM1 == 1 && jj == 11) {YY[k1] = ZZM[k1][iii][jj];} }}}}
2971  // gr7 = new TGraph(NP,XX,YY); gr7->SetLineColor(6); gr7->SetMarkerColor(6); gr7->SetMarkerStyle(20); gr7->SetMarkerSize(1.2); gr7->SetTitle("ieta 18"); gr7->SetFillStyle(0); gr7->Draw("P");
2973  for (int k1 = 0; k1 < NP; k1++) {
2974  YY[k1] = 0.;
2975  if (LASERruns[k1] > "305874") {
2976  for (int iii = 2; iii < 3; iii++) {
2977  for (int jj = 0; jj < 13; jj++) {
2978  int LM1 = 0;
2979  if ((iii == 2 && jj < 13))
2980  LM1 = 1;
2981  if (LM1 == 1 && jj == 12) {
2982  YY[k1] = ZZM[k1][iii][jj];
2983  }
2984  }
2985  }
2986  } else {
2987  for (int iii = 1; iii < 2; iii++) {
2988  for (int jj = 0; jj < 13; jj++) {
2989  int LM1 = 0;
2990  if ((iii == 1 && jj < 13))
2991  LM1 = 1;
2992  if (LM1 == 1 && jj == 12) {
2993  YY[k1] = ZZM[k1][iii][jj];
2994  }
2995  }
2996  }
2997  }
2998  }
2999  gr5 = new TGraph(NP, XX, YY);
3000  gr5->SetLineColor(7);
3001  gr5->SetMarkerColor(7);
3002  gr5->SetMarkerStyle(20);
3003  gr5->SetMarkerSize(1.2);
3004  gr5->SetTitle("ieta 17");
3005  gr5->SetFillStyle(0);
3006  gr5->Draw("P");
3007  // TLegend leg(.6,.67,.78,.88, " HEP L1");
3008  TLegend leg(xx1, yy1, xx2, yy2, " HEM L1");
3009  leg.AddEntry(gr1);
3010  leg.AddEntry(gr2);
3011  leg.AddEntry(gr3);
3012  leg.AddEntry(gr4);
3013  leg.AddEntry(gr5); //leg.AddEntry(gr6);leg.AddEntry(gr7);leg.AddEntry(gr8);
3014  leg.SetMargin(0.3);
3015  leg.SetBorderSize(1);
3016  leg.DrawClone("Same");
3017  } //if(Method == 6
3018 
3019  //
3020  //======================================================================================================= PLOT7 negative direction:r vs t for L7 and eta 21 22 23 25 27 28
3021  if (Method == 7) {
3022  for (int k1 = 0; k1 < NP; k1++) {
3023  YY[k1] = 0.;
3024  }
3025  // reject bad runs:
3026  // cout<<"**** Negative direction: reject bad runs eta 21 **** " <<endl;
3027  cout << "**** Negative direction: take good runs eta 21 **** " << endl;
3028  c1->Range(0, 0, 25, 18);
3029  c1->SetFillColor(0);
3030  c1->Clear();
3031  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
3032  pad1->Draw();
3033  pad1->cd();
3034  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
3035  // x1 y1 x2 y2
3036  pad1->DrawFrame(x1, y5, x2, y6); // 1-A,
3037  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
3038  pad1->GetFrame()->SetFillColor(0);
3039  pad1->Draw();
3040  gPad->SetGridy();
3041  gPad->SetGridx();
3042  cout << "****Draw 7 Dependencies: M r vs t for L7 and eta 21 22 23 25 27 28 **** " << endl;
3043  // jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
3044  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
3045  //======================================================= introduce Layers: positive direction
3046  // :L7: (iii=d3 & eta 17) && (iii=d4 & eta 18-25) && (iii=d5 & eta 26-28)
3047  // (iii=d2 & eta 17-26) && (iii=d3 & eta 27-28) L7 2016 2017
3048  // M: int LM7=0;if((iii==3 && jj==12) || (iii==4 && jj> 3 && jj<12) || (iii==5 && jj> 0 && jj< 4)) LM7=1; 2018
3049 
3051  for (int k1 = 0; k1 < NP; k1++) {
3052  YY[k1] = 0.;
3053  if (LASERruns[k1] > "305874") {
3054  for (int iii = 3; iii < 6; iii++) {
3055  for (int jj = 1; jj < 13; jj++) {
3056  int LM7 = 0;
3057  if ((iii == 3 && jj == 12) || (iii == 4 && jj > 3 && jj < 12) || (iii == 5 && jj > 0 && jj < 4))
3058  LM7 = 1;
3059  if (LM7 == 1 && jj == 1) {
3060  YY[k1] = ZZM[k1][iii][jj];
3061  }
3062  }
3063  }
3064  } else {
3065  for (int iii = 2; iii < 4; iii++) {
3066  for (int jj = 1; jj < 13; jj++) {
3067  int LM7 = 0;
3068  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
3069  LM7 = 1;
3070  if (LM7 == 1 && jj == 1) {
3071  YY[k1] = ZZM[k1][iii][jj];
3072  }
3073  }
3074  }
3075  }
3076  }
3077  gr1 = new TGraph(NP, XX, YY);
3078  gr1->SetLineColor(1);
3079  gr1->SetMarkerColor(1);
3080  gr1->SetMarkerStyle(20);
3081  gr1->SetTitle("ieta 28");
3082  gr1->SetFillStyle(0);
3083  gr1->SetMarkerSize(1.2);
3084  gr1->Draw("P");
3086  for (int k1 = 0; k1 < NP; k1++) {
3087  YY[k1] = 0.;
3088  if (LASERruns[k1] > "305874") {
3089  for (int iii = 3; iii < 6; iii++) {
3090  for (int jj = 1; jj < 13; jj++) {
3091  int LM7 = 0;
3092  if ((iii == 3 && jj == 12) || (iii == 4 && jj > 3 && jj < 12) || (iii == 5 && jj > 0 && jj < 4))
3093  LM7 = 1;
3094  if (LM7 == 1 && jj == 2) {
3095  YY[k1] = ZZM[k1][iii][jj];
3096  }
3097  }
3098  }
3099  } else {
3100  for (int iii = 2; iii < 4; iii++) {
3101  for (int jj = 1; jj < 13; jj++) {
3102  int LM7 = 0;
3103  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
3104  LM7 = 1;
3105  if (LM7 == 1 && jj == 2) {
3106  YY[k1] = ZZM[k1][iii][jj];
3107  }
3108  }
3109  }
3110  }
3111  }
3112  gr2 = new TGraph(NP, XX, YY);
3113  gr2->SetLineColor(2);
3114  gr2->SetMarkerColor(2);
3115  gr2->SetMarkerStyle(20);
3116  gr2->SetTitle("ieta 27");
3117  gr2->SetFillStyle(0);
3118  gr2->SetMarkerSize(1.2);
3119  gr2->Draw("P");
3121  for (int k1 = 0; k1 < NP; k1++) {
3122  YY[k1] = 0.;
3123  if (LASERruns[k1] > "305874") {
3124  for (int iii = 3; iii < 6; iii++) {
3125  for (int jj = 1; jj < 13; jj++) {
3126  int LM7 = 0;
3127  if ((iii == 3 && jj == 12) || (iii == 4 && jj > 3 && jj < 12) || (iii == 5 && jj > 0 && jj < 4))
3128  LM7 = 1;
3129  if (LM7 == 1 && jj == 4) {
3130  YY[k1] = ZZM[k1][iii][jj];
3131  }
3132  }
3133  }
3134  } else {
3135  for (int iii = 2; iii < 4; iii++) {
3136  for (int jj = 1; jj < 13; jj++) {
3137  int LM7 = 0;
3138  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
3139  LM7 = 1;
3140  if (LM7 == 1 && jj == 4) {
3141  YY[k1] = ZZM[k1][iii][jj];
3142  }
3143  }
3144  }
3145  }
3146  }
3147  gr3 = new TGraph(NP, XX, YY);
3148  gr3->SetLineColor(3);
3149  gr3->SetMarkerColor(3);
3150  gr3->SetMarkerStyle(20);
3151  gr3->SetTitle("ieta 25");
3152  gr3->SetFillStyle(0);
3153  gr3->SetMarkerSize(1.2);
3154  gr3->Draw("P");
3156  for (int k1 = 0; k1 < NP; k1++) {
3157  YY[k1] = 0.;
3158  if (LASERruns[k1] > "305874") {
3159  for (int iii = 3; iii < 6; iii++) {
3160  for (int jj = 1; jj < 13; jj++) {
3161  int LM7 = 0;
3162  if ((iii == 3 && jj == 12) || (iii == 4 && jj > 3 && jj < 12) || (iii == 5 && jj > 0 && jj < 4))
3163  LM7 = 1;
3164  if (LM7 == 1 && jj == 6) {
3165  YY[k1] = ZZM[k1][iii][jj];
3166  }
3167  }
3168  }
3169  } else {
3170  for (int iii = 2; iii < 4; iii++) {
3171  for (int jj = 1; jj < 13; jj++) {
3172  int LM7 = 0;
3173  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
3174  LM7 = 1;
3175  if (LM7 == 1 && jj == 6) {
3176  YY[k1] = ZZM[k1][iii][jj];
3177  }
3178  }
3179  }
3180  }
3181  }
3182  gr4 = new TGraph(NP, XX, YY);
3183  gr4->SetLineColor(4);
3184  gr4->SetMarkerColor(4);
3185  gr4->SetMarkerStyle(20);
3186  gr4->SetTitle("ieta 23");
3187  gr4->SetFillStyle(0);
3188  gr4->SetMarkerSize(1.2);
3189  gr4->Draw("P");
3191  for (int k1 = 0; k1 < NP; k1++) {
3192  YY[k1] = 0.;
3193  if (LASERruns[k1] > "305874") {
3194  for (int iii = 3; iii < 6; iii++) {
3195  for (int jj = 1; jj < 13; jj++) {
3196  int LM7 = 0;
3197  if ((iii == 3 && jj == 12) || (iii == 4 && jj > 3 && jj < 12) || (iii == 5 && jj > 0 && jj < 4))
3198  LM7 = 1;
3199  if (LM7 == 1 && jj == 7) {
3200  YY[k1] = ZZM[k1][iii][jj];
3201  }
3202  }
3203  }
3204  } else {
3205  for (int iii = 2; iii < 4; iii++) {
3206  for (int jj = 1; jj < 13; jj++) {
3207  int LM7 = 0;
3208  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
3209  LM7 = 1;
3210  if (LM7 == 1 && jj == 7) {
3211  YY[k1] = ZZM[k1][iii][jj];
3212  }
3213  }
3214  }
3215  }
3216  }
3217  gr5 = new TGraph(NP, XX, YY);
3218  gr5->SetLineColor(5);
3219  gr5->SetMarkerColor(5);
3220  gr5->SetMarkerStyle(20);
3221  gr5->SetTitle("ieta 22");
3222  gr5->SetFillStyle(0);
3223  gr5->SetMarkerSize(1.2);
3224  gr5->Draw("P");
3226  for (int k1 = 0; k1 < NP; k1++) {
3227  YY[k1] = 0.;
3228  if (LASERruns[k1] > "305874") {
3229  for (int iii = 3; iii < 6; iii++) {
3230  for (int jj = 1; jj < 13; jj++) {
3231  int LM7 = 0;
3232  if ((iii == 3 && jj == 12) || (iii == 4 && jj > 3 && jj < 12) || (iii == 5 && jj > 0 && jj < 4))
3233  LM7 = 1;
3234  if (LM7 == 1 && jj == 8) {
3235  YY[k1] = ZZM[k1][iii][jj];
3236  }
3237  }
3238  }
3239  } else {
3240  for (int iii = 2; iii < 4; iii++) {
3241  for (int jj = 1; jj < 13; jj++) {
3242  int LM7 = 0;
3243  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
3244  LM7 = 1;
3245  if (LM7 == 1 && jj == 8) {
3246  YY[k1] = ZZM[k1][iii][jj];
3247  }
3248  }
3249  }
3250  }
3251  //======================================================= introduce Layers: positive direction
3252  // reject bad runs:
3253  // if (YY[k1]>1.05 || YY[k1]<0.1 ) {} else cout<<"\"" << LASERruns[k1] <<"\"," << endl;
3254  }
3255  gr6 = new TGraph(NP, XX, YY);
3256  gr6->SetLineColor(6);
3257  gr6->SetMarkerColor(6);
3258  gr6->SetMarkerStyle(20);
3259  gr6->SetTitle("ieta 21");
3260  gr6->SetFillStyle(0);
3261  gr6->SetMarkerSize(1.2);
3262  gr6->Draw("P");
3263 
3264  // TLegend leg(.6,.67,.78,.88, " HEP L7");
3265  TLegend leg(xx1, yy1, xx2, yy2, " HEM L7");
3266  leg.AddEntry(gr1);
3267  leg.AddEntry(gr2);
3268  leg.AddEntry(gr3);
3269  leg.AddEntry(gr4);
3270  leg.AddEntry(gr5);
3271  leg.AddEntry(gr6); //leg.AddEntry(gr7);leg.AddEntry(gr8);
3272  leg.SetMargin(0.3);
3273  leg.SetBorderSize(1);
3274  leg.DrawClone("Same");
3275  } //if(Method == 7
3276  //
3277  //======================================================================================================= PLOT8 negative direction:r vs t for L7 and eta 17 18 19 20 24 26 29
3278  if (Method == 8) {
3279  for (int k1 = 0; k1 < NP; k1++) {
3280  YY[k1] = 0.;
3281  }
3282  c1->Range(0, 0, 25, 18);
3283  c1->SetFillColor(0);
3284  c1->Clear();
3285  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
3286  pad1->Draw();
3287  pad1->cd();
3288  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
3289  // x1 y1 x2 y2
3290  pad1->DrawFrame(x1, y5, x2, y6); // 1-A,
3291  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
3292  pad1->GetFrame()->SetFillColor(0);
3293  pad1->Draw();
3294  gPad->SetGridy();
3295  gPad->SetGridx();
3296  cout << "****Draw 8 Dependencies: M r vs t for L7 and eta 17 18 19 20 24 26 29 **** " << endl;
3297  // jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
3298  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
3299  //======================================================= introduce Layers: positive direction
3300  // :L7: (iii=d3 & eta 17) && (iii=d4 & eta 18-25) && (iii=d5 & eta 26-28)
3301  // (iii=d2 & eta 17-26) && (iii=d3 & eta 27-28) L7 2016 2017
3302  // M: int LM7=0;if((iii==3 && jj==12) || (iii==4 && jj> 3 && jj<12) || (iii==5 && jj> 0 && jj< 4)) LM7=1; 2018
3303 
3305  for (int k1 = 0; k1 < NP; k1++) {
3306  YY[k1] = 0.;
3307  if (LASERruns[k1] > "305874") {
3308  for (int iii = 3; iii < 6; iii++) {
3309  for (int jj = 1; jj < 13; jj++) {
3310  int LM7 = 0;
3311  if ((iii == 3 && jj == 12) || (iii == 4 && jj > 3 && jj < 12) || (iii == 5 && jj > 0 && jj < 4))
3312  LM7 = 1;
3313  if (LM7 == 1 && jj == 3) {
3314  YY[k1] = ZZM[k1][iii][jj];
3315  }
3316  }
3317  }
3318  } else {
3319  for (int iii = 2; iii < 4; iii++) {
3320  for (int jj = 1; jj < 13; jj++) {
3321  int LM7 = 0;
3322  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
3323  LM7 = 1;
3324  if (LM7 == 1 && jj == 3) {
3325  YY[k1] = ZZM[k1][iii][jj];
3326  }
3327  }
3328  }
3329  }
3330  }
3331  gr1 = new TGraph(NP, XX, YY);
3332  gr1->SetLineColor(1);
3333  gr1->SetMarkerColor(1);
3334  gr1->SetMarkerStyle(20);
3335  gr1->SetTitle("ieta 26");
3336  gr1->SetFillStyle(0);
3337  gr1->SetMarkerSize(1.2);
3338  gr1->Draw("P");
3340  for (int k1 = 0; k1 < NP; k1++) {
3341  YY[k1] = 0.;
3342  if (LASERruns[k1] > "305874") {
3343  for (int iii = 3; iii < 6; iii++) {
3344  for (int jj = 1; jj < 13; jj++) {
3345  int LM7 = 0;
3346  if ((iii == 3 && jj == 12) || (iii == 4 && jj > 3 && jj < 12) || (iii == 5 && jj > 0 && jj < 4))
3347  LM7 = 1;
3348  if (LM7 == 1 && jj == 5) {
3349  YY[k1] = ZZM[k1][iii][jj];
3350  }
3351  }
3352  }
3353  } else {
3354  for (int iii = 2; iii < 4; iii++) {
3355  for (int jj = 1; jj < 13; jj++) {
3356  int LM7 = 0;
3357  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
3358  LM7 = 1;
3359  if (LM7 == 1 && jj == 5) {
3360  YY[k1] = ZZM[k1][iii][jj];
3361  }
3362  }
3363  }
3364  }
3365  }
3366  gr2 = new TGraph(NP, XX, YY);
3367  gr2->SetLineColor(2);
3368  gr2->SetMarkerColor(2);
3369  gr2->SetMarkerStyle(20);
3370  gr2->SetTitle("ieta 24");
3371  gr2->SetFillStyle(0);
3372  gr2->SetMarkerSize(1.2);
3373  gr2->Draw("P");
3375  for (int k1 = 0; k1 < NP; k1++) {
3376  YY[k1] = 0.;
3377  if (LASERruns[k1] > "305874") {
3378  for (int iii = 3; iii < 6; iii++) {
3379  for (int jj = 1; jj < 13; jj++) {
3380  int LM7 = 0;
3381  if ((iii == 3 && jj == 12) || (iii == 4 && jj > 3 && jj < 12) || (iii == 5 && jj > 0 && jj < 4))
3382  LM7 = 1;
3383  if (LM7 == 1 && jj == 9) {
3384  YY[k1] = ZZM[k1][iii][jj];
3385  }
3386  }
3387  }
3388  } else {
3389  for (int iii = 2; iii < 4; iii++) {
3390  for (int jj = 1; jj < 13; jj++) {
3391  int LM7 = 0;
3392  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
3393  LM7 = 1;
3394  if (LM7 == 1 && jj == 9) {
3395  YY[k1] = ZZM[k1][iii][jj];
3396  }
3397  }
3398  }
3399  }
3400  }
3401  gr3 = new TGraph(NP, XX, YY);
3402  gr3->SetLineColor(3);
3403  gr3->SetMarkerColor(3);
3404  gr3->SetMarkerStyle(20);
3405  gr3->SetTitle("ieta 20");
3406  gr3->SetFillStyle(0);
3407  gr3->SetMarkerSize(1.2);
3408  gr3->Draw("P");
3410  for (int k1 = 0; k1 < NP; k1++) {
3411  YY[k1] = 0.;
3412  if (LASERruns[k1] > "305874") {
3413  for (int iii = 3; iii < 6; iii++) {
3414  for (int jj = 1; jj < 13; jj++) {
3415  int LM7 = 0;
3416  if ((iii == 3 && jj == 12) || (iii == 4 && jj > 3 && jj < 12) || (iii == 5 && jj > 0 && jj < 4))
3417  LM7 = 1;
3418  if (LM7 == 1 && jj == 10) {
3419  YY[k1] = ZZM[k1][iii][jj];
3420  }
3421  }
3422  }
3423  } else {
3424  for (int iii = 2; iii < 4; iii++) {
3425  for (int jj = 1; jj < 13; jj++) {
3426  int LM7 = 0;
3427  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
3428  LM7 = 1;
3429  if (LM7 == 1 && jj == 10) {
3430  YY[k1] = ZZM[k1][iii][jj];
3431  }
3432  }
3433  }
3434  }
3435  }
3436  gr4 = new TGraph(NP, XX, YY);
3437  gr4->SetLineColor(4);
3438  gr4->SetMarkerColor(4);
3439  gr4->SetMarkerStyle(20);
3440  gr4->SetTitle("ieta 19");
3441  gr4->SetFillStyle(0);
3442  gr4->SetMarkerSize(1.2);
3443  gr4->Draw("P");
3445  for (int k1 = 0; k1 < NP; k1++) {
3446  YY[k1] = 0.;
3447  if (LASERruns[k1] > "305874") {
3448  for (int iii = 3; iii < 6; iii++) {
3449  for (int jj = 1; jj < 13; jj++) {
3450  int LM7 = 0;
3451  if ((iii == 3 && jj == 12) || (iii == 4 && jj > 3 && jj < 12) || (iii == 5 && jj > 0 && jj < 4))
3452  LM7 = 1;
3453  if (LM7 == 1 && jj == 11) {
3454  YY[k1] = ZZM[k1][iii][jj];
3455  }
3456  }
3457  }
3458  } else {
3459  for (int iii = 2; iii < 4; iii++) {
3460  for (int jj = 1; jj < 13; jj++) {
3461  int LM7 = 0;
3462  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
3463  LM7 = 1;
3464  if (LM7 == 1 && jj == 11) {
3465  YY[k1] = ZZM[k1][iii][jj];
3466  }
3467  }
3468  }
3469  }
3470  }
3471  gr5 = new TGraph(NP, XX, YY);
3472  gr5->SetLineColor(5);
3473  gr5->SetMarkerColor(5);
3474  gr5->SetMarkerStyle(20);
3475  gr5->SetTitle("ieta 18");
3476  gr5->SetFillStyle(0);
3477  gr5->SetMarkerSize(1.2);
3478  gr5->Draw("P");
3480  // for(int k1 = 0; k1<NP; k1++) {YY[k1]=0.;if(LASERruns[k1] > "305874" ) {for(int iii = 3; iii<6; iii++) {for (int jj=1;jj<13;jj++) {int LM7=0;if((iii==3 && jj==12) || (iii==4 && jj> 3 && jj<12) || (iii==5 && jj> 0 && jj< 4)) LM7=1;if(LM7 == 1 && jj ==12) {YY[k1] = ZZM[k1][iii][jj];} }}}else{for(int iii = 2; iii<4; iii++) {for (int jj=1;jj<13;jj++) {int LM7 = 0;if((iii==2 && jj>0 && jj<11) || (iii==3 && jj>10 && jj<13)) LM7 = 1;if(LM7 == 1 && jj ==12) {YY[k1] = ZZM[k1][iii][jj];} }}} }
3481  // gr6 = new TGraph(NP,XX,YY); gr6->SetLineColor(6); gr6->SetMarkerColor(6); gr6->SetMarkerStyle(20); gr6->SetTitle("ieta 17"); gr6->SetFillStyle(0); gr6->SetMarkerSize(1.2); gr6->Draw("P");
3482  // // TLegend leg(.6,.67,.78,.88, " HEP L7");
3483  TLegend leg(xx1, yy1, xx2, yy2, " HEM L7");
3484  leg.AddEntry(gr1);
3485  leg.AddEntry(gr2);
3486  leg.AddEntry(gr3);
3487  leg.AddEntry(gr4);
3488  leg.AddEntry(gr5); //leg.AddEntry(gr6);
3489  leg.SetMargin(0.3);
3490  leg.SetBorderSize(1);
3491  leg.DrawClone("Same");
3492  } //if(Method == 8
3493  //
3494  //=======================================================================================================
3495  //======================================================================================================= positive direction:
3496  //=======================================================================================================
3497  // //////////////////////////////////////////////////////////////////////////
3498  //
3499  // PLOTS WITH ZZP[k1][iii][jj] :
3500  //
3501  //======================================================================================================= PLOT11 r vs t positive direction:Depth1 and eta 21 22 23 25 27 28
3502  if (Method == 11) {
3503  for (int k1 = 0; k1 < NP; k1++) {
3504  YY[k1] = 0.;
3505  }
3506  c1->Range(0, 0, 25, 18);
3507  c1->SetFillColor(0);
3508  c1->Clear();
3509  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
3510  pad1->Draw();
3511  pad1->cd();
3512  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
3513  // x1 y1 x2 y2
3514  pad1->DrawFrame(x1, y1, x2, y2); // 1-A,
3515  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
3516  pad1->GetFrame()->SetFillColor(0);
3517  pad1->Draw();
3518  gPad->SetGridy();
3519  gPad->SetGridx();
3520  cout << "****Draw 11 Dependencies: P r vs t for Depth1 and some eta 21 22 23 25 27 28 *** " << endl;
3521  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
3522  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
3523  // - - - - - - - - - - - -
3524  for (int k1 = 0; k1 < NP; k1++) {
3525  YY[k1] = ZZP[k1][1][12];
3526  } // eta=28
3527  gr1 = new TGraph(NP, XX, YY);
3528  gr1->SetLineColor(1);
3529  gr1->SetMarkerColor(1);
3530  gr1->SetMarkerStyle(20);
3531  gr1->SetMarkerSize(1.2);
3532  gr1->SetTitle("ieta 28");
3533  gr1->SetFillStyle(0);
3534  gr1->Draw("P");
3535  for (int k1 = 0; k1 < NP; k1++) {
3536  YY[k1] = ZZP[k1][1][11];
3537  }
3538  gr2 = new TGraph(NP, XX, YY);
3539  gr2->SetLineColor(2);
3540  gr2->SetMarkerColor(2);
3541  gr2->SetMarkerStyle(20);
3542  gr2->SetMarkerSize(1.2);
3543  gr2->SetTitle("ieta 27");
3544  gr2->SetFillStyle(0);
3545  gr2->Draw("P");
3546  for (int k1 = 0; k1 < NP; k1++) {
3547  YY[k1] = ZZP[k1][1][9];
3548  }
3549  gr3 = new TGraph(NP, XX, YY);
3550  gr3->SetLineColor(3);
3551  gr3->SetMarkerColor(3);
3552  gr3->SetMarkerStyle(20);
3553  gr3->SetMarkerSize(1.2);
3554  gr3->SetTitle("ieta 25");
3555  gr3->SetFillStyle(0);
3556  gr3->Draw("P");
3557  for (int k1 = 0; k1 < NP; k1++) {
3558  YY[k1] = ZZP[k1][1][7];
3559  }
3560  gr4 = new TGraph(NP, XX, YY);
3561  gr4->SetLineColor(4);
3562  gr4->SetMarkerColor(4);
3563  gr4->SetMarkerStyle(20);
3564  gr4->SetMarkerSize(1.2);
3565  gr4->SetTitle("ieta 23");
3566  gr4->SetFillStyle(0);
3567  gr4->Draw("P");
3568  for (int k1 = 0; k1 < NP; k1++) {
3569  YY[k1] = ZZP[k1][1][6];
3570  }
3571  gr5 = new TGraph(NP, XX, YY);
3572  gr5->SetLineColor(5);
3573  gr5->SetMarkerColor(5);
3574  gr5->SetMarkerStyle(20);
3575  gr5->SetMarkerSize(1.2);
3576  gr5->SetTitle("ieta 22");
3577  gr5->SetFillStyle(0);
3578  gr5->Draw("P");
3579  for (int k1 = 0; k1 < NP; k1++) {
3580  YY[k1] = ZZP[k1][1][5];
3581  }
3582  gr6 = new TGraph(NP, XX, YY);
3583  gr6->SetLineColor(6);
3584  gr6->SetMarkerColor(6);
3585  gr6->SetMarkerStyle(20);
3586  gr6->SetMarkerSize(1.2);
3587  gr6->SetTitle("ieta 21");
3588  gr6->SetFillStyle(0);
3589  gr6->Draw("P");
3590  // TLegend leg(.6,.67,.78,.88, " HEP Depth1");
3591  TLegend leg(xx1, yy1, xx2, yy2, " HEP Depth1");
3592  leg.AddEntry(gr1);
3593  leg.AddEntry(gr2);
3594  leg.AddEntry(gr3);
3595  leg.AddEntry(gr4);
3596  leg.AddEntry(gr5);
3597  leg.AddEntry(gr6);
3598  leg.SetMargin(0.3);
3599  leg.SetBorderSize(1);
3600  leg.DrawClone("Same");
3601  //
3602  } //11
3603  //======================================================================================================= PLOT12 r vs t positive direction:Depth1 and eta 17 18? 19 20? 24 26 29
3604  if (Method == 12) {
3605  for (int k1 = 0; k1 < NP; k1++) {
3606  YY[k1] = 0.;
3607  }
3608  c1->Range(0, 0, 25, 18);
3609  c1->SetFillColor(0);
3610  c1->Clear();
3611  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
3612  pad1->Draw();
3613  pad1->cd();
3614  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
3615  // x1 y1 x2 y2
3616  pad1->DrawFrame(x1, y1, x2, y2); // 1-A,
3617  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
3618  pad1->GetFrame()->SetFillColor(0);
3619  pad1->Draw();
3620  gPad->SetGridy();
3621  gPad->SetGridx();
3622  cout << "****Draw 12 Dependencies: P r vs t for Depth1 and some eta 17 18 19 20 24 26 29 *** " << endl;
3623  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
3624  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
3625  // - - - - - - - - - - - -
3626  for (int k1 = 0; k1 < NP; k1++) {
3627  YY[k1] = ZZP[k1][1][13];
3628  // if (YY[k1]>1.001 || YY[k1]<0.1 ) cout<<" k1 = " << k1 <<" \"," <<"\"" << LASERruns[k1] <<"\"," << endl;
3629  // if (YY[k1]<.64 ) cout<<" k1 = " << k1 <<" \"," <<"\"" << LASERruns[k1] <<"\"," <<" XX[k1] = " << YY[k1] <<" XX[k1] = " << YY[k1] << endl;
3630  // if (k1> 30 ) cout<<" k1 = " << k1 <<" \"," <<"\"" << LASERruns[k1] <<"\"," <<" XX[k1] = " << XX[k1] <<" YY[k1] = " << YY[k1] << endl;
3631 
3632  } // eta=29
3633  gr1 = new TGraph(NP, XX, YY);
3634  gr1->SetLineColor(1);
3635  gr1->SetMarkerColor(1);
3636  gr1->SetMarkerStyle(20);
3637  gr1->SetMarkerSize(1.2);
3638  gr1->SetTitle("ieta 29");
3639  gr1->SetFillStyle(0);
3640  gr1->Draw("P");
3641  for (int k1 = 0; k1 < NP; k1++) {
3642  YY[k1] = ZZP[k1][1][10];
3643  }
3644  gr2 = new TGraph(NP, XX, YY);
3645  gr2->SetLineColor(2);
3646  gr2->SetMarkerColor(2);
3647  gr2->SetMarkerStyle(20);
3648  gr2->SetMarkerSize(1.2);
3649  gr2->SetTitle("ieta 26");
3650  gr2->SetFillStyle(0);
3651  gr2->Draw("P");
3652  for (int k1 = 0; k1 < NP; k1++) {
3653  YY[k1] = ZZP[k1][1][8];
3654  }
3655  gr3 = new TGraph(NP, XX, YY);
3656  gr3->SetLineColor(3);
3657  gr3->SetMarkerColor(3);
3658  gr3->SetMarkerStyle(20);
3659  gr3->SetMarkerSize(1.2);
3660  gr3->SetTitle("ieta 24");
3661  gr3->SetFillStyle(0);
3662  gr3->Draw("P");
3663  // for(int k1 = 0; k1<NP; k1++) {YY[k1] = ZZP[k1][1][4];}/// eta=20
3664  // gr6 = new TGraph(NP,XX,YY); gr6->SetLineColor(4); gr6->SetMarkerColor(4); gr6->SetMarkerStyle(20); gr6->SetMarkerSize(1.2); gr6->SetTitle("ieta 20"); gr6->SetFillStyle(0); gr6->Draw("P");
3665  for (int k1 = 0; k1 < NP; k1++) {
3666  YY[k1] = ZZP[k1][1][3];
3667  }
3668  gr4 = new TGraph(NP, XX, YY);
3669  gr4->SetLineColor(5);
3670  gr4->SetMarkerColor(5);
3671  gr4->SetMarkerStyle(20);
3672  gr4->SetMarkerSize(1.2);
3673  gr4->SetTitle("ieta 19");
3674  gr4->SetFillStyle(0);
3675  gr4->Draw("P");
3676  // for(int k1 = 0; k1<NP; k1++) {YY[k1] = ZZP[k1][1][2];}/// eta=18
3677  // gr7 = new TGraph(NP,XX,YY); gr7->SetLineColor(6); gr7->SetMarkerColor(6); gr7->SetMarkerStyle(20); gr7->SetMarkerSize(1.2); gr7->SetTitle("ieta 18"); gr7->SetFillStyle(0); gr7->Draw("P");
3678  for (int k1 = 0; k1 < NP; k1++) {
3679  YY[k1] = ZZP[k1][1][1];
3680  }
3681  gr5 = new TGraph(NP, XX, YY);
3682  gr5->SetLineColor(7);
3683  gr5->SetMarkerColor(7);
3684  gr5->SetMarkerStyle(20);
3685  gr5->SetMarkerSize(1.2);
3686  gr5->SetTitle("ieta 17");
3687  gr5->SetFillStyle(0);
3688  gr5->Draw("P");
3689  // TLegend leg(.6,.67,.78,.88, " HEP Depth1");
3690  TLegend leg(xx1, yy1, xx2, yy2, " HEP Depth1");
3691  leg.AddEntry(gr1);
3692  leg.AddEntry(gr2);
3693  leg.AddEntry(gr3);
3694  leg.AddEntry(gr4);
3695  leg.AddEntry(gr5); //leg.AddEntry(gr6);leg.AddEntry(gr7);leg.AddEntry(gr8);
3696  leg.SetMargin(0.3);
3697  leg.SetBorderSize(1);
3698  leg.DrawClone("Same");
3699  //
3700  } //12
3701  //
3702  //======================================================================================================= PLOT13 r vs t positive direction:Depth2 and eta 21 22 23 25
3703  if (Method == 13) {
3704  for (int k1 = 0; k1 < NP; k1++) {
3705  YY[k1] = 0.;
3706  }
3707  c1->Range(0, 0, 25, 18);
3708  c1->SetFillColor(0);
3709  c1->Clear();
3710  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
3711  pad1->Draw();
3712  pad1->cd();
3713  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
3714  // x1 y1 x2 y2
3715  pad1->DrawFrame(x1, y3, x2, y4); // 1-A,
3716  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
3717  pad1->GetFrame()->SetFillColor(0);
3718  pad1->Draw();
3719  gPad->SetGridy();
3720  gPad->SetGridx();
3721  cout << "****Draw 13 Dependencies: P r vs t for Depth2 and some eta 21 22 23 25 27 28 *** " << endl;
3722  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
3723  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
3724  // - - - - - - - - - - - -
3725  for (int k1 = 0; k1 < NP; k1++) {
3726  YY[k1] = ZZP[k1][2][9];
3727  }
3728  gr1 = new TGraph(NP, XX, YY);
3729  gr1->SetLineColor(1);
3730  gr1->SetMarkerColor(1);
3731  gr1->SetMarkerStyle(20);
3732  gr1->SetMarkerSize(1.2);
3733  gr1->SetTitle("ieta 25");
3734  gr1->SetFillStyle(0);
3735  gr1->Draw("P");
3736  for (int k1 = 0; k1 < NP; k1++) {
3737  YY[k1] = ZZP[k1][2][7];
3738  }
3739  gr2 = new TGraph(NP, XX, YY);
3740  gr2->SetLineColor(2);
3741  gr2->SetMarkerColor(2);
3742  gr2->SetMarkerStyle(20);
3743  gr2->SetMarkerSize(1.2);
3744  gr2->SetTitle("ieta 23");
3745  gr2->SetFillStyle(0);
3746  gr2->Draw("P");
3747  for (int k1 = 0; k1 < NP; k1++) {
3748  YY[k1] = ZZP[k1][2][6];
3749  }
3750  gr3 = new TGraph(NP, XX, YY);
3751  gr3->SetLineColor(3);
3752  gr3->SetMarkerColor(3);
3753  gr3->SetMarkerStyle(20);
3754  gr3->SetMarkerSize(1.2);
3755  gr3->SetTitle("ieta 22");
3756  gr3->SetFillStyle(0);
3757  gr3->Draw("P");
3758  for (int k1 = 0; k1 < NP; k1++) {
3759  YY[k1] = ZZP[k1][2][5];
3760  }
3761  gr4 = new TGraph(NP, XX, YY);
3762  gr4->SetLineColor(4);
3763  gr4->SetMarkerColor(4);
3764  gr4->SetMarkerStyle(20);
3765  gr4->SetMarkerSize(1.2);
3766  gr4->SetTitle("ieta 21");
3767  gr4->SetFillStyle(0);
3768  gr4->Draw("P");
3769  // TLegend leg(.6,.67,.78,.88, " HEP Depth2");
3770  TLegend leg(xx1, yy1, xx2, yy2, " HEP Depth2");
3771  leg.AddEntry(gr1);
3772  leg.AddEntry(gr2);
3773  leg.AddEntry(gr3);
3774  leg.AddEntry(gr4); //leg.AddEntry(gr5);leg.AddEntry(gr6);leg.AddEntry(gr7);leg.AddEntry(gr8);
3775  leg.SetMargin(0.3);
3776  leg.SetBorderSize(1);
3777  leg.DrawClone("Same");
3778  //
3779  } //13
3780  //
3781  //======================================================================================================= PLOT14 r vs t positive direction:Depth2 and eta 17 18 19 20 24 26
3782  if (Method == 14) {
3783  for (int k1 = 0; k1 < NP; k1++) {
3784  YY[k1] = 0.;
3785  }
3786  c1->Range(0, 0, 25, 18);
3787  c1->SetFillColor(0);
3788  c1->Clear();
3789  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
3790  pad1->Draw();
3791  pad1->cd();
3792  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
3793  // x1 y1 x2 y2
3794  pad1->DrawFrame(x1, y3, x2, y4); // 1-A,
3795  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
3796  pad1->GetFrame()->SetFillColor(0);
3797  pad1->Draw();
3798  gPad->SetGridy();
3799  gPad->SetGridx();
3800  cout << "****Draw 14 Dependencies: P r vs t for Depth2 and some eta 17 18 19 20 24 26 29 *** " << endl;
3801  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
3802  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
3803  // - - - - - - - - - - - -
3804  for (int k1 = 0; k1 < NP; k1++) {
3805  YY[k1] = ZZP[k1][2][10];
3806  }
3807  gr1 = new TGraph(NP, XX, YY);
3808  gr1->SetLineColor(1);
3809  gr1->SetMarkerColor(1);
3810  gr1->SetMarkerStyle(20);
3811  gr1->SetMarkerSize(1.2);
3812  gr1->SetTitle("ieta 26");
3813  gr1->SetFillStyle(0);
3814  gr1->Draw("P");
3815  for (int k1 = 0; k1 < NP; k1++) {
3816  YY[k1] = ZZP[k1][2][8];
3817  }
3818  gr2 = new TGraph(NP, XX, YY);
3819  gr2->SetLineColor(2);
3820  gr2->SetMarkerColor(2);
3821  gr2->SetMarkerStyle(20);
3822  gr2->SetMarkerSize(1.2);
3823  gr2->SetTitle("ieta 24");
3824  gr2->SetFillStyle(0);
3825  gr2->Draw("P");
3826  for (int k1 = 0; k1 < NP; k1++) {
3827  YY[k1] = ZZP[k1][2][4];
3828  }
3829  gr3 = new TGraph(NP, XX, YY);
3830  gr3->SetLineColor(3);
3831  gr3->SetMarkerColor(3);
3832  gr3->SetMarkerStyle(20);
3833  gr3->SetMarkerSize(1.2);
3834  gr3->SetTitle("ieta 20");
3835  gr3->SetFillStyle(0);
3836  gr3->Draw("P");
3837  for (int k1 = 0; k1 < NP; k1++) {
3838  YY[k1] = ZZP[k1][2][3];
3839  }
3840  gr4 = new TGraph(NP, XX, YY);
3841  gr4->SetLineColor(4);
3842  gr4->SetMarkerColor(4);
3843  gr4->SetMarkerStyle(20);
3844  gr4->SetMarkerSize(1.2);
3845  gr4->SetTitle("ieta 19");
3846  gr4->SetFillStyle(0);
3847  gr4->Draw("P");
3848  for (int k1 = 0; k1 < NP; k1++) {
3849  YY[k1] = ZZP[k1][2][2];
3850  }
3851  gr5 = new TGraph(NP, XX, YY);
3852  gr5->SetLineColor(5);
3853  gr5->SetMarkerColor(5);
3854  gr5->SetMarkerStyle(20);
3855  gr5->SetMarkerSize(1.2);
3856  gr5->SetTitle("ieta 18");
3857  gr5->SetFillStyle(0);
3858  gr5->Draw("P");
3859  // for(int k1 = 0; k1<NP; k1++) {YY[k1] = ZZP[k1][2][1];}/// eta=17
3860  // gr6 = new TGraph(NP,XX,YY); gr6->SetLineColor(6); gr6->SetMarkerColor(6); gr6->SetMarkerStyle(20); gr6->SetMarkerSize(1.2); gr6->SetTitle("ieta 17"); gr6->SetFillStyle(0); gr6->Draw("P");
3861  // TLegend leg(.6,.67,.78,.88, " HEP Depth2");
3862  TLegend leg(xx1, yy1, xx2, yy2, " HEP Depth2");
3863  leg.AddEntry(gr1);
3864  leg.AddEntry(gr2);
3865  leg.AddEntry(gr3);
3866  leg.AddEntry(gr4);
3867  leg.AddEntry(gr5); //leg.AddEntry(gr6);leg.AddEntry(gr7);leg.AddEntry(gr8);
3868  leg.SetMargin(0.3);
3869  leg.SetBorderSize(1);
3870  leg.DrawClone("Same");
3871  //
3872  } //14
3873  //
3874  //================================================================================
3875  //================================================================================
3876  //======================================================================================================= PLOT15 positive direction:r vs t for L1 and eta 21 22 23 25 27 28
3877  if (Method == 15) {
3878  for (int k1 = 0; k1 < NP; k1++) {
3879  YY[k1] = 0.;
3880  }
3881  c1->Range(0, 0, 25, 18);
3882  c1->SetFillColor(0);
3883  c1->Clear();
3884  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
3885  pad1->Draw();
3886  pad1->cd();
3887  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
3888  // x1 y1 x2 y2
3889  pad1->DrawFrame(x1, y1, x2, y2); // 1-A,
3890  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
3891  pad1->GetFrame()->SetFillColor(0);
3892  pad1->Draw();
3893  gPad->SetGridy();
3894  gPad->SetGridx();
3895  cout << "****Draw 15 Dependencies: P r vs t for L1 and eta 21 22 23 25 27 28 **** " << endl;
3896  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
3897  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
3898  // - - - - - - - - - - - -
3899  //======================================================= introduce Layers: positive direction
3900  // eta=28 L1=1
3901  for (int k1 = 0; k1 < NP; k1++) {
3902  YY[k1] = 0.;
3903  if (LASERruns[k1] > "305874") {
3904  for (int iii = 2; iii < 3; iii++) {
3905  for (int jj = 1; jj <= 13; jj++) {
3906  int LP1 = 0;
3907  if ((iii == 2 && jj > 0))
3908  LP1 = 1;
3909  if (LP1 == 1 && jj == 12) {
3910  YY[k1] = ZZP[k1][iii][jj];
3911  }
3912  }
3913  }
3914  } else {
3915  for (int iii = 1; iii < 2; iii++) {
3916  for (int jj = 1; jj <= 13; jj++) {
3917  int LP1 = 0;
3918  if ((iii == 1 && jj > 0))
3919  LP1 = 1;
3920  if (LP1 == 1 && jj == 12) {
3921  YY[k1] = ZZP[k1][iii][jj];
3922  }
3923  }
3924  }
3925  }
3926  }
3927  gr1 = new TGraph(NP, XX, YY);
3928  gr1->SetLineColor(1);
3929  gr1->SetMarkerColor(1);
3930  gr1->SetMarkerStyle(20);
3931  gr1->SetMarkerSize(1.2);
3932  gr1->SetTitle("ieta 28");
3933  gr1->SetFillStyle(0);
3934  gr1->Draw("P");
3935 
3937  for (int k1 = 0; k1 < NP; k1++) {
3938  YY[k1] = 0.;
3939  if (LASERruns[k1] > "305874") {
3940  for (int iii = 2; iii < 3; iii++) {
3941  for (int jj = 1; jj <= 13; jj++) {
3942  int LP1 = 0;
3943  if ((iii == 2 && jj > 0))
3944  LP1 = 1;
3945  if (LP1 == 1 && jj == 11) {
3946  YY[k1] = ZZP[k1][iii][jj];
3947  }
3948  }
3949  }
3950  } else {
3951  for (int iii = 1; iii < 2; iii++) {
3952  for (int jj = 1; jj <= 13; jj++) {
3953  int LP1 = 0;
3954  if ((iii == 1 && jj > 0))
3955  LP1 = 1;
3956  if (LP1 == 1 && jj == 11) {
3957  YY[k1] = ZZP[k1][iii][jj];
3958  }
3959  }
3960  }
3961  }
3962  }
3963  gr2 = new TGraph(NP, XX, YY);
3964  gr2->SetLineColor(2);
3965  gr2->SetMarkerColor(2);
3966  gr2->SetMarkerStyle(20);
3967  gr2->SetMarkerSize(1.2);
3968  gr2->SetTitle("ieta 27");
3969  gr2->SetFillStyle(0);
3970  gr2->Draw("P");
3972  for (int k1 = 0; k1 < NP; k1++) {
3973  YY[k1] = 0.;
3974  if (LASERruns[k1] > "305874") {
3975  for (int iii = 2; iii < 3; iii++) {
3976  for (int jj = 1; jj <= 13; jj++) {
3977  int LP1 = 0;
3978  if ((iii == 2 && jj > 0))
3979  LP1 = 1;
3980  if (LP1 == 1 && jj == 9) {
3981  YY[k1] = ZZP[k1][iii][jj];
3982  }
3983  }
3984  }
3985  } else {
3986  for (int iii = 1; iii < 2; iii++) {
3987  for (int jj = 1; jj <= 13; jj++) {
3988  int LP1 = 0;
3989  if ((iii == 1 && jj > 0))
3990  LP1 = 1;
3991  if (LP1 == 1 && jj == 9) {
3992  YY[k1] = ZZP[k1][iii][jj];
3993  }
3994  }
3995  }
3996  }
3997  }
3998  gr3 = new TGraph(NP, XX, YY);
3999  gr3->SetLineColor(3);
4000  gr3->SetMarkerColor(3);
4001  gr3->SetMarkerStyle(20);
4002  gr3->SetMarkerSize(1.2);
4003  gr3->SetTitle("ieta 25");
4004  gr3->SetFillStyle(0);
4005  gr3->Draw("P");
4007  for (int k1 = 0; k1 < NP; k1++) {
4008  YY[k1] = 0.;
4009  if (LASERruns[k1] > "305874") {
4010  for (int iii = 2; iii < 3; iii++) {
4011  for (int jj = 1; jj <= 13; jj++) {
4012  int LP1 = 0;
4013  if ((iii == 2 && jj > 0))
4014  LP1 = 1;
4015  if (LP1 == 1 && jj == 7) {
4016  YY[k1] = ZZP[k1][iii][jj];
4017  }
4018  }
4019  }
4020  } else {
4021  for (int iii = 1; iii < 2; iii++) {
4022  for (int jj = 1; jj <= 13; jj++) {
4023  int LP1 = 0;
4024  if ((iii == 1 && jj > 0))
4025  LP1 = 1;
4026  if (LP1 == 1 && jj == 7) {
4027  YY[k1] = ZZP[k1][iii][jj];
4028  }
4029  }
4030  }
4031  }
4032  }
4033  gr4 = new TGraph(NP, XX, YY);
4034  gr4->SetLineColor(4);
4035  gr4->SetMarkerColor(4);
4036  gr4->SetMarkerStyle(20);
4037  gr4->SetMarkerSize(1.2);
4038  gr4->SetTitle("ieta 23");
4039  gr4->SetFillStyle(0);
4040  gr4->Draw("P");
4042  for (int k1 = 0; k1 < NP; k1++) {
4043  YY[k1] = 0.;
4044  if (LASERruns[k1] > "305874") {
4045  for (int iii = 2; iii < 3; iii++) {
4046  for (int jj = 1; jj <= 13; jj++) {
4047  int LP1 = 0;
4048  if ((iii == 2 && jj > 0))
4049  LP1 = 1;
4050  if (LP1 == 1 && jj == 6) {
4051  YY[k1] = ZZP[k1][iii][jj];
4052  }
4053  }
4054  }
4055  } else {
4056  for (int iii = 1; iii < 2; iii++) {
4057  for (int jj = 1; jj <= 13; jj++) {
4058  int LP1 = 0;
4059  if ((iii == 1 && jj > 0))
4060  LP1 = 1;
4061  if (LP1 == 1 && jj == 6) {
4062  YY[k1] = ZZP[k1][iii][jj];
4063  }
4064  }
4065  }
4066  }
4067  }
4068  gr5 = new TGraph(NP, XX, YY);
4069  gr5->SetLineColor(5);
4070  gr5->SetMarkerColor(5);
4071  gr5->SetMarkerStyle(20);
4072  gr5->SetMarkerSize(1.2);
4073  gr5->SetTitle("ieta 22");
4074  gr5->SetFillStyle(0);
4075  gr5->Draw("P");
4077  for (int k1 = 0; k1 < NP; k1++) {
4078  YY[k1] = 0.;
4079  if (LASERruns[k1] > "305874") {
4080  for (int iii = 2; iii < 3; iii++) {
4081  for (int jj = 1; jj <= 13; jj++) {
4082  int LP1 = 0;
4083  if ((iii == 2 && jj > 0))
4084  LP1 = 1;
4085  if (LP1 == 1 && jj == 5) {
4086  YY[k1] = ZZP[k1][iii][jj];
4087  }
4088  }
4089  }
4090  } else {
4091  for (int iii = 1; iii < 2; iii++) {
4092  for (int jj = 1; jj <= 13; jj++) {
4093  int LP1 = 0;
4094  if ((iii == 1 && jj > 0))
4095  LP1 = 1;
4096  if (LP1 == 1 && jj == 5) {
4097  YY[k1] = ZZP[k1][iii][jj];
4098  }
4099  }
4100  }
4101  }
4102  }
4103  gr6 = new TGraph(NP, XX, YY);
4104  gr6->SetLineColor(6);
4105  gr6->SetMarkerColor(6);
4106  gr6->SetMarkerStyle(20);
4107  gr6->SetMarkerSize(1.2);
4108  gr6->SetTitle("ieta 21");
4109  gr6->SetFillStyle(0);
4110  gr6->Draw("P");
4111 
4112  // TLegend leg(.6,.67,.78,.88, " HEP L1");
4113  TLegend leg(xx1, yy1, xx2, yy2, " HEP L1");
4114  leg.AddEntry(gr1);
4115  leg.AddEntry(gr2);
4116  leg.AddEntry(gr3);
4117  leg.AddEntry(gr4);
4118  leg.AddEntry(gr5);
4119  leg.AddEntry(gr6); //leg.AddEntry(gr7);leg.AddEntry(gr8);
4120  leg.SetMargin(0.3);
4121  leg.SetBorderSize(1);
4122  leg.DrawClone("Same");
4123 
4124  } //if(Method == 15
4125  //
4126  //======================================================================================================= PLOT16 positive direction:r vs t for L1 and eta 17 18 19 20 24 26 29
4127  if (Method == 16) {
4128  for (int k1 = 0; k1 < NP; k1++) {
4129  YY[k1] = 0.;
4130  }
4131  c1->Range(0, 0, 25, 18);
4132  c1->SetFillColor(0);
4133  c1->Clear();
4134  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
4135  pad1->Draw();
4136  pad1->cd();
4137  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
4138  // x1 y1 x2 y2
4139  pad1->DrawFrame(x1, y1, x2, y2); // 1-A,
4140  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
4141  pad1->GetFrame()->SetFillColor(0);
4142  pad1->Draw();
4143  gPad->SetGridy();
4144  gPad->SetGridx();
4145  cout << "****Draw 16 Dependencies: P r vs t for L1 and eta 17 18 19 20 24 26 29 **** " << endl;
4146  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
4147  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
4148  // - - - - - - - - - - - -
4149  //======================================================= introduce Layers: positive direction
4150  // eta=29 L1=1
4151  for (int k1 = 0; k1 < NP; k1++) {
4152  YY[k1] = 0.;
4153  if (LASERruns[k1] > "305874") {
4154  for (int iii = 2; iii < 3; iii++) {
4155  for (int jj = 1; jj <= 13; jj++) {
4156  int LP1 = 0;
4157  if ((iii == 2 && jj > 0))
4158  LP1 = 1;
4159  if (LP1 == 1 && jj == 13) {
4160  YY[k1] = ZZP[k1][iii][jj];
4161  }
4162  }
4163  }
4164  } else {
4165  for (int iii = 1; iii < 2; iii++) {
4166  for (int jj = 1; jj <= 13; jj++) {
4167  int LP1 = 0;
4168  if ((iii == 1 && jj > 0))
4169  LP1 = 1;
4170  if (LP1 == 1 && jj == 13) {
4171  YY[k1] = ZZP[k1][iii][jj];
4172  }
4173  }
4174  }
4175  }
4176  }
4177  gr1 = new TGraph(NP, XX, YY);
4178  gr1->SetLineColor(1);
4179  gr1->SetMarkerColor(1);
4180  gr1->SetMarkerStyle(20);
4181  gr1->SetMarkerSize(1.2);
4182  gr1->SetTitle("ieta 29");
4183  gr1->SetFillStyle(0);
4184  gr1->Draw("P");
4185 
4187  for (int k1 = 0; k1 < NP; k1++) {
4188  YY[k1] = 0.;
4189  if (LASERruns[k1] > "305874") {
4190  for (int iii = 2; iii < 3; iii++) {
4191  for (int jj = 1; jj <= 13; jj++) {
4192  int LP1 = 0;
4193  if ((iii == 2 && jj > 0))
4194  LP1 = 1;
4195  if (LP1 == 1 && jj == 10) {
4196  YY[k1] = ZZP[k1][iii][jj];
4197  }
4198  }
4199  }
4200  } else {
4201  for (int iii = 1; iii < 2; iii++) {
4202  for (int jj = 1; jj <= 13; jj++) {
4203  int LP1 = 0;
4204  if ((iii == 1 && jj > 0))
4205  LP1 = 1;
4206  if (LP1 == 1 && jj == 10) {
4207  YY[k1] = ZZP[k1][iii][jj];
4208  }
4209  }
4210  }
4211  }
4212  }
4213  gr2 = new TGraph(NP, XX, YY);
4214  gr2->SetLineColor(2);
4215  gr2->SetMarkerColor(2);
4216  gr2->SetMarkerStyle(20);
4217  gr2->SetMarkerSize(1.2);
4218  gr2->SetTitle("ieta 27");
4219  gr2->SetFillStyle(0);
4220  gr2->Draw("P");
4222  for (int k1 = 0; k1 < NP; k1++) {
4223  YY[k1] = 0.;
4224  if (LASERruns[k1] > "305874") {
4225  for (int iii = 2; iii < 3; iii++) {
4226  for (int jj = 1; jj <= 13; jj++) {
4227  int LP1 = 0;
4228  if ((iii == 2 && jj > 0))
4229  LP1 = 1;
4230  if (LP1 == 1 && jj == 8) {
4231  YY[k1] = ZZP[k1][iii][jj];
4232  }
4233  }
4234  }
4235  } else {
4236  for (int iii = 1; iii < 2; iii++) {
4237  for (int jj = 1; jj <= 13; jj++) {
4238  int LP1 = 0;
4239  if ((iii == 1 && jj > 0))
4240  LP1 = 1;
4241  if (LP1 == 1 && jj == 8) {
4242  YY[k1] = ZZP[k1][iii][jj];
4243  }
4244  }
4245  }
4246  }
4247  }
4248  gr3 = new TGraph(NP, XX, YY);
4249  gr3->SetLineColor(3);
4250  gr3->SetMarkerColor(3);
4251  gr3->SetMarkerStyle(20);
4252  gr3->SetMarkerSize(1.2);
4253  gr3->SetTitle("ieta 25");
4254  gr3->SetFillStyle(0);
4255  gr3->Draw("P");
4257  // for(int k1 = 0; k1<NP; k1++) {YY[k1]=0.;if(LASERruns[k1] > "305874" ) {for(int iii = 2; iii<3; iii++) {for (int jj=1;jj<=13;jj++) {int LP1 = 0;if((iii==2 && jj>0)) LP1 = 1;if(LP1 == 1 && jj == 4) {YY[k1] = ZZP[k1][iii][jj];} }}}else{for(int iii = 1; iii<2; iii++) {for (int jj=1;jj<=13;jj++) {int LP1 = 0;if((iii==1 && jj>0)) LP1 = 1;if(LP1 == 1 && jj == 4) {YY[k1] = ZZP[k1][iii][jj];} }}}}
4258  // gr4 = new TGraph(NP,XX,YY); gr4->SetLineColor(4); gr4->SetMarkerColor(4); gr4->SetMarkerStyle(20); gr4->SetMarkerSize(1.2); gr4->SetTitle("ieta 23"); gr4->SetFillStyle(0); gr4->Draw("P");
4260  for (int k1 = 0; k1 < NP; k1++) {
4261  YY[k1] = 0.;
4262  if (LASERruns[k1] > "305874") {
4263  for (int iii = 2; iii < 3; iii++) {
4264  for (int jj = 1; jj <= 13; jj++) {
4265  int LP1 = 0;
4266  if ((iii == 2 && jj > 0))
4267  LP1 = 1;
4268  if (LP1 == 1 && jj == 3) {
4269  YY[k1] = ZZP[k1][iii][jj];
4270  }
4271  }
4272  }
4273  } else {
4274  for (int iii = 1; iii < 2; iii++) {
4275  for (int jj = 1; jj <= 13; jj++) {
4276  int LP1 = 0;
4277  if ((iii == 1 && jj > 0))
4278  LP1 = 1;
4279  if (LP1 == 1 && jj == 3) {
4280  YY[k1] = ZZP[k1][iii][jj];
4281  }
4282  }
4283  }
4284  }
4285  }
4286  gr5 = new TGraph(NP, XX, YY);
4287  gr5->SetLineColor(5);
4288  gr5->SetMarkerColor(5);
4289  gr5->SetMarkerStyle(20);
4290  gr5->SetMarkerSize(1.2);
4291  gr5->SetTitle("ieta 22");
4292  gr5->SetFillStyle(0);
4293  gr5->Draw("P");
4295  // for(int k1 = 0; k1<NP; k1++) {YY[k1]=0.;if(LASERruns[k1] > "305874" ) {for(int iii = 2; iii<3; iii++) {for (int jj=1;jj<=13;jj++) {int LP1 = 0;if((iii==2 && jj>0)) LP1 = 1;if(LP1 == 1 && jj == 2) {YY[k1] = ZZP[k1][iii][jj];} }}}else{for(int iii = 1; iii<2; iii++) {for (int jj=1;jj<=13;jj++) {int LP1 = 0;if((iii==1 && jj>0)) LP1 = 1;if(LP1 == 1 && jj == 2) {YY[k1] = ZZP[k1][iii][jj];} }}}}
4296  // gr6 = new TGraph(NP,XX,YY); gr6->SetLineColor(6); gr6->SetMarkerColor(6); gr6->SetMarkerStyle(20); gr6->SetMarkerSize(1.2); gr6->SetTitle("ieta 21"); gr6->SetFillStyle(0); gr6->Draw("P");
4298  for (int k1 = 0; k1 < NP; k1++) {
4299  YY[k1] = 0.;
4300  if (LASERruns[k1] > "305874") {
4301  for (int iii = 2; iii < 3; iii++) {
4302  for (int jj = 1; jj <= 13; jj++) {
4303  int LP1 = 0;
4304  if ((iii == 2 && jj > 0))
4305  LP1 = 1;
4306  if (LP1 == 1 && jj == 1) {
4307  YY[k1] = ZZP[k1][iii][jj];
4308  }
4309  }
4310  }
4311  } else {
4312  for (int iii = 1; iii < 2; iii++) {
4313  for (int jj = 1; jj <= 13; jj++) {
4314  int LP1 = 0;
4315  if ((iii == 1 && jj > 0))
4316  LP1 = 1;
4317  if (LP1 == 1 && jj == 1) {
4318  YY[k1] = ZZP[k1][iii][jj];
4319  }
4320  }
4321  }
4322  }
4323  }
4324  gr7 = new TGraph(NP, XX, YY);
4325  gr7->SetLineColor(7);
4326  gr7->SetMarkerColor(7);
4327  gr7->SetMarkerStyle(20);
4328  gr7->SetMarkerSize(1.2);
4329  gr7->SetTitle("ieta 21");
4330  gr7->SetFillStyle(0);
4331  gr7->Draw("P");
4332 
4333  // TLegend leg(.6,.67,.78,.88, " HEP L1");
4334  TLegend leg(xx1, yy1, xx2, yy2, " HEP L1");
4335  leg.AddEntry(gr1);
4336  leg.AddEntry(gr2);
4337  leg.AddEntry(gr3);
4338  leg.AddEntry(gr4);
4339  leg.AddEntry(gr5); //leg.AddEntry(gr6);leg.AddEntry(gr7);leg.AddEntry(gr8);
4340  leg.SetMargin(0.3);
4341  leg.SetBorderSize(1);
4342  leg.DrawClone("Same");
4343  } //if(Method == 16
4344  //
4345  //================================================================================
4346  //======================================================================================================= PLOT17 positive direction:r vs t for L7 and eta 21 22 23 25 27? 28?
4347  if (Method == 17) {
4348  for (int k1 = 0; k1 < NP; k1++) {
4349  YY[k1] = 0.;
4350  }
4351  // reject bad runs:
4352  // cout<<"**** Positive direction: reject bad runs eta 21 **** " <<endl;
4353  cout << "**** Positive direction: take good runs eta 21 **** " << endl;
4354  c1->Range(0, 0, 25, 18);
4355  c1->SetFillColor(0);
4356  c1->Clear();
4357  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
4358  pad1->Draw();
4359  pad1->cd();
4360  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
4361  // x1 y1 x2 y2
4362  pad1->DrawFrame(x1, y5, x2, y6); // 1-A,
4363  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
4364  pad1->GetFrame()->SetFillColor(0);
4365  pad1->Draw();
4366  gPad->SetGridy();
4367  gPad->SetGridx();
4368  cout << "****Draw 17 Dependencies: P r vs t for L7 and eta 21 22 23 25 27 28 **** " << endl;
4369  // jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
4370  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
4371  // :L7: (iii=d3 & eta 17) && (iii=d4 & eta 18-25) && (iii=d5 & eta 26-28)
4372  // P: int LP7=0;if((iii==3 && jj==1 ) || (iii==4 && jj> 1 && jj<10) || (iii==5 && jj> 9 && jj<13)) LP7=1;
4373  //======================================================= introduce Layers: positive direction
4375  for (int k1 = 0; k1 < NP; k1++) {
4376  YY[k1] = 0.;
4377  if (LASERruns[k1] > "305874") {
4378  for (int iii = 3; iii < 6; iii++) {
4379  for (int jj = 1; jj < 13; jj++) {
4380  int LP7 = 0;
4381  if ((iii == 3 && jj == 1) || (iii == 4 && jj > 1 && jj < 10) || (iii == 5 && jj > 9 && jj < 13))
4382  LP7 = 1;
4383  if (LP7 == 1 && jj == 12) {
4384  YY[k1] = ZZP[k1][iii][jj];
4385  }
4386  }
4387  }
4388  } else {
4389  for (int iii = 2; iii < 4; iii++) {
4390  for (int jj = 1; jj < 13; jj++) {
4391  int LP7 = 0;
4392  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
4393  LP7 = 1;
4394  if (LP7 == 1 && jj == 12) {
4395  YY[k1] = ZZP[k1][iii][jj];
4396  }
4397  }
4398  }
4399  }
4400  }
4401  gr1 = new TGraph(NP, XX, YY);
4402  gr1->SetLineColor(1);
4403  gr1->SetMarkerColor(1);
4404  gr1->SetMarkerStyle(20);
4405  gr1->SetTitle("ieta 28");
4406  gr1->SetFillStyle(0);
4407  gr1->SetMarkerSize(1.2);
4408  gr1->Draw("P");
4410  for (int k1 = 0; k1 < NP; k1++) {
4411  YY[k1] = 0.;
4412  if (LASERruns[k1] > "305874") {
4413  for (int iii = 3; iii < 6; iii++) {
4414  for (int jj = 1; jj < 13; jj++) {
4415  int LP7 = 0;
4416  if ((iii == 3 && jj == 1) || (iii == 4 && jj > 1 && jj < 10) || (iii == 5 && jj > 9 && jj < 13))
4417  LP7 = 1;
4418  if (LP7 == 1 && jj == 11) {
4419  YY[k1] = ZZP[k1][iii][jj];
4420  }
4421  }
4422  }
4423  } else {
4424  for (int iii = 2; iii < 4; iii++) {
4425  for (int jj = 1; jj < 13; jj++) {
4426  int LP7 = 0;
4427  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
4428  LP7 = 1;
4429  if (LP7 == 1 && jj == 11) {
4430  YY[k1] = ZZP[k1][iii][jj];
4431  }
4432  }
4433  }
4434  }
4435  }
4436  gr2 = new TGraph(NP, XX, YY);
4437  gr2->SetLineColor(2);
4438  gr2->SetMarkerColor(2);
4439  gr2->SetMarkerStyle(20);
4440  gr2->SetTitle("ieta 27");
4441  gr2->SetFillStyle(0);
4442  gr2->SetMarkerSize(1.2);
4443  gr2->Draw("P");
4445  for (int k1 = 0; k1 < NP; k1++) {
4446  YY[k1] = 0.;
4447  if (LASERruns[k1] > "305874") {
4448  for (int iii = 3; iii < 6; iii++) {
4449  for (int jj = 1; jj < 13; jj++) {
4450  int LP7 = 0;
4451  if ((iii == 3 && jj == 1) || (iii == 4 && jj > 1 && jj < 10) || (iii == 5 && jj > 9 && jj < 13))
4452  LP7 = 1;
4453  if (LP7 == 1 && jj == 9) {
4454  YY[k1] = ZZP[k1][iii][jj];
4455  }
4456  }
4457  }
4458  } else {
4459  for (int iii = 2; iii < 4; iii++) {
4460  for (int jj = 1; jj < 13; jj++) {
4461  int LP7 = 0;
4462  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
4463  LP7 = 1;
4464  if (LP7 == 1 && jj == 9) {
4465  YY[k1] = ZZP[k1][iii][jj];
4466  }
4467  }
4468  }
4469  }
4470  }
4471  gr3 = new TGraph(NP, XX, YY);
4472  gr3->SetLineColor(3);
4473  gr3->SetMarkerColor(3);
4474  gr3->SetMarkerStyle(20);
4475  gr3->SetTitle("ieta 25");
4476  gr3->SetFillStyle(0);
4477  gr3->SetMarkerSize(1.2);
4478  gr3->Draw("P");
4480  for (int k1 = 0; k1 < NP; k1++) {
4481  YY[k1] = 0.;
4482  if (LASERruns[k1] > "305874") {
4483  for (int iii = 3; iii < 6; iii++) {
4484  for (int jj = 1; jj < 13; jj++) {
4485  int LP7 = 0;
4486  if ((iii == 3 && jj == 1) || (iii == 4 && jj > 1 && jj < 10) || (iii == 5 && jj > 9 && jj < 13))
4487  LP7 = 1;
4488  if (LP7 == 1 && jj == 7) {
4489  YY[k1] = ZZP[k1][iii][jj];
4490  }
4491  }
4492  }
4493  } else {
4494  for (int iii = 2; iii < 4; iii++) {
4495  for (int jj = 1; jj < 13; jj++) {
4496  int LP7 = 0;
4497  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
4498  LP7 = 1;
4499  if (LP7 == 1 && jj == 7) {
4500  YY[k1] = ZZP[k1][iii][jj];
4501  }
4502  }
4503  }
4504  }
4505  }
4506  gr4 = new TGraph(NP, XX, YY);
4507  gr4->SetLineColor(4);
4508  gr4->SetMarkerColor(4);
4509  gr4->SetMarkerStyle(20);
4510  gr4->SetMarkerSize(1.2);
4511  gr4->SetTitle("ieta 23");
4512  gr4->SetFillStyle(0);
4513  gr4->SetMarkerSize(1.2);
4514  gr4->Draw("P");
4516  for (int k1 = 0; k1 < NP; k1++) {
4517  YY[k1] = 0.;
4518  if (LASERruns[k1] > "305874") {
4519  for (int iii = 3; iii < 6; iii++) {
4520  for (int jj = 1; jj < 13; jj++) {
4521  int LP7 = 0;
4522  if ((iii == 3 && jj == 1) || (iii == 4 && jj > 1 && jj < 10) || (iii == 5 && jj > 9 && jj < 13))
4523  LP7 = 1;
4524  if (LP7 == 1 && jj == 6) {
4525  YY[k1] = ZZP[k1][iii][jj];
4526  }
4527  }
4528  }
4529  } else {
4530  for (int iii = 2; iii < 4; iii++) {
4531  for (int jj = 1; jj < 13; jj++) {
4532  int LP7 = 0;
4533  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
4534  LP7 = 1;
4535  if (LP7 == 1 && jj == 6) {
4536  YY[k1] = ZZP[k1][iii][jj];
4537  }
4538  }
4539  }
4540  }
4541  }
4542  gr5 = new TGraph(NP, XX, YY);
4543  gr5->SetLineColor(5);
4544  gr5->SetMarkerColor(5);
4545  gr5->SetMarkerStyle(20);
4546  gr5->SetTitle("ieta 22");
4547  gr5->SetFillStyle(0);
4548  gr5->SetMarkerSize(1.2);
4549  gr5->Draw("P");
4551  for (int k1 = 0; k1 < NP; k1++) {
4552  YY[k1] = 0.;
4553  if (LASERruns[k1] > "305874") {
4554  for (int iii = 3; iii < 6; iii++) {
4555  for (int jj = 1; jj < 13; jj++) {
4556  int LP7 = 0;
4557  if ((iii == 3 && jj == 1) || (iii == 4 && jj > 1 && jj < 10) || (iii == 5 && jj > 9 && jj < 13))
4558  LP7 = 1;
4559  if (LP7 == 1 && jj == 5) {
4560  YY[k1] = ZZP[k1][iii][jj];
4561  }
4562  }
4563  }
4564  } else {
4565  for (int iii = 2; iii < 4; iii++) {
4566  for (int jj = 1; jj < 13; jj++) {
4567  int LP7 = 0;
4568  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
4569  LP7 = 1;
4570  if (LP7 == 1 && jj == 5) {
4571  YY[k1] = ZZP[k1][iii][jj];
4572  }
4573  }
4574  }
4575  }
4576  //======================================================= introduce Layers: positive direction
4577  // reject bad runs:
4578  // if (YY[k1]>1.05 || YY[k1]<0.1 ) cout<<"\"" << LASERruns[k1] <<"\"," << endl;
4579  // if (YY[k1]>1.05 || YY[k1]<0.1 ) {} else cout<<"\"" << LASERruns[k1] <<"\"," << endl;
4580  }
4581  gr6 = new TGraph(NP, XX, YY);
4582  gr6->SetLineColor(6);
4583  gr6->SetMarkerColor(6);
4584  gr6->SetMarkerStyle(20);
4585  gr6->SetMarkerSize(1.2);
4586  gr6->SetTitle("ieta 21");
4587  gr6->SetFillStyle(0);
4588  gr6->Draw("P");
4589  // TLegend leg(.6,.67,.78,.88, " HEP L7");
4590  TLegend leg(xx1, yy1, xx2, yy2, " HEP L7");
4591  leg.AddEntry(gr1);
4592  leg.AddEntry(gr2);
4593  leg.AddEntry(gr3);
4594  leg.AddEntry(gr4);
4595  leg.AddEntry(gr5);
4596  leg.AddEntry(gr6); //leg.AddEntry(gr7);leg.AddEntry(gr8);
4597  leg.SetMargin(0.3);
4598  leg.SetBorderSize(1);
4599  leg.DrawClone("Same");
4600  } //if(Method == 17
4601  //
4602  //======================================================================================================= PLOT18 positive direction:r vs t for L7 and eta 17 18 19 20 24 26
4603  if (Method == 18) {
4604  for (int k1 = 0; k1 < NP; k1++) {
4605  YY[k1] = 0.;
4606  }
4607  c1->Range(0, 0, 25, 18);
4608  c1->SetFillColor(0);
4609  c1->Clear();
4610  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
4611  pad1->Draw();
4612  pad1->cd();
4613  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
4614  // x1 y1 x2 y2
4615  pad1->DrawFrame(x1, y5, x2, y6); // 1-A,
4616  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
4617  pad1->GetFrame()->SetFillColor(0);
4618  pad1->Draw();
4619  gPad->SetGridy();
4620  gPad->SetGridx();
4621  cout << "****Draw 18 Dependencies: P r vs t for L7 and eta 17 18 19 20 24 26 29 **** " << endl;
4622  // jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
4623  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
4624  // :L7: (iii=d3 & eta 17) && (iii=d4 & eta 18-25) && (iii=d5 & eta 26-28)
4625  // P: int LP7=0;if((iii==3 && jj==1 ) || (iii==4 && jj> 1 && jj<10) || (iii==5 && jj> 9 && jj<13)) LP7=1;
4626  //======================================================= introduce Layers: positive direction
4628  for (int k1 = 0; k1 < NP; k1++) {
4629  YY[k1] = 0.;
4630  if (LASERruns[k1] > "305874") {
4631  for (int iii = 3; iii < 6; iii++) {
4632  for (int jj = 1; jj < 13; jj++) {
4633  int LP7 = 0;
4634  if ((iii == 3 && jj == 1) || (iii == 4 && jj > 1 && jj < 10) || (iii == 5 && jj > 9 && jj < 13))
4635  LP7 = 1;
4636  if (LP7 == 1 && jj == 10) {
4637  YY[k1] = ZZP[k1][iii][jj];
4638  }
4639  }
4640  }
4641  } else {
4642  for (int iii = 2; iii < 4; iii++) {
4643  for (int jj = 1; jj < 13; jj++) {
4644  int LP7 = 0;
4645  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
4646  LP7 = 1;
4647  if (LP7 == 1 && jj == 10) {
4648  YY[k1] = ZZP[k1][iii][jj];
4649  }
4650  }
4651  }
4652  }
4653  }
4654  gr1 = new TGraph(NP, XX, YY);
4655  gr1->SetLineColor(1);
4656  gr1->SetMarkerColor(1);
4657  gr1->SetMarkerStyle(20);
4658  gr1->SetTitle("ieta 26");
4659  gr1->SetFillStyle(0);
4660  gr1->SetMarkerSize(1.2);
4661  gr1->Draw("P");
4663  for (int k1 = 0; k1 < NP; k1++) {
4664  YY[k1] = 0.;
4665  if (LASERruns[k1] > "305874") {
4666  for (int iii = 3; iii < 6; iii++) {
4667  for (int jj = 1; jj < 13; jj++) {
4668  int LP7 = 0;
4669  if ((iii == 3 && jj == 1) || (iii == 4 && jj > 1 && jj < 10) || (iii == 5 && jj > 9 && jj < 13))
4670  LP7 = 1;
4671  if (LP7 == 1 && jj == 8) {
4672  YY[k1] = ZZP[k1][iii][jj];
4673  }
4674  }
4675  }
4676  } else {
4677  for (int iii = 2; iii < 4; iii++) {
4678  for (int jj = 1; jj < 13; jj++) {
4679  int LP7 = 0;
4680  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
4681  LP7 = 1;
4682  if (LP7 == 1 && jj == 8) {
4683  YY[k1] = ZZP[k1][iii][jj];
4684  }
4685  }
4686  }
4687  }
4688  }
4689  gr2 = new TGraph(NP, XX, YY);
4690  gr2->SetLineColor(2);
4691  gr2->SetMarkerColor(2);
4692  gr2->SetMarkerStyle(20);
4693  gr2->SetTitle("ieta 24");
4694  gr2->SetFillStyle(0);
4695  gr2->SetMarkerSize(1.2);
4696  gr2->Draw("P");
4698  for (int k1 = 0; k1 < NP; k1++) {
4699  YY[k1] = 0.;
4700  if (LASERruns[k1] > "305874") {
4701  for (int iii = 3; iii < 6; iii++) {
4702  for (int jj = 1; jj < 13; jj++) {
4703  int LP7 = 0;
4704  if ((iii == 3 && jj == 1) || (iii == 4 && jj > 1 && jj < 10) || (iii == 5 && jj > 9 && jj < 13))
4705  LP7 = 1;
4706  if (LP7 == 1 && jj == 4) {
4707  YY[k1] = ZZP[k1][iii][jj];
4708  }
4709  }
4710  }
4711  } else {
4712  for (int iii = 2; iii < 4; iii++) {
4713  for (int jj = 1; jj < 13; jj++) {
4714  int LP7 = 0;
4715  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
4716  LP7 = 1;
4717  if (LP7 == 1 && jj == 4) {
4718  YY[k1] = ZZP[k1][iii][jj];
4719  }
4720  }
4721  }
4722  }
4723  }
4724  gr3 = new TGraph(NP, XX, YY);
4725  gr3->SetLineColor(3);
4726  gr3->SetMarkerColor(3);
4727  gr3->SetMarkerStyle(20);
4728  gr3->SetTitle("ieta 20");
4729  gr3->SetFillStyle(0);
4730  gr3->SetMarkerSize(1.2);
4731  gr3->Draw("P");
4733  for (int k1 = 0; k1 < NP; k1++) {
4734  YY[k1] = 0.;
4735  if (LASERruns[k1] > "305874") {
4736  for (int iii = 3; iii < 6; iii++) {
4737  for (int jj = 1; jj < 13; jj++) {
4738  int LP7 = 0;
4739  if ((iii == 3 && jj == 1) || (iii == 4 && jj > 1 && jj < 10) || (iii == 5 && jj > 9 && jj < 13))
4740  LP7 = 1;
4741  if (LP7 == 1 && jj == 3) {
4742  YY[k1] = ZZP[k1][iii][jj];
4743  }
4744  }
4745  }
4746  } else {
4747  for (int iii = 2; iii < 4; iii++) {
4748  for (int jj = 1; jj < 13; jj++) {
4749  int LP7 = 0;
4750  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
4751  LP7 = 1;
4752  if (LP7 == 1 && jj == 3) {
4753  YY[k1] = ZZP[k1][iii][jj];
4754  }
4755  }
4756  }
4757  }
4758  }
4759  gr4 = new TGraph(NP, XX, YY);
4760  gr4->SetLineColor(4);
4761  gr4->SetMarkerColor(4);
4762  gr4->SetMarkerStyle(20);
4763  gr4->SetTitle("ieta 19");
4764  gr4->SetFillStyle(0);
4765  gr4->SetMarkerSize(1.2);
4766  gr4->Draw("P");
4768  for (int k1 = 0; k1 < NP; k1++) {
4769  YY[k1] = 0.;
4770  if (LASERruns[k1] > "305874") {
4771  for (int iii = 3; iii < 6; iii++) {
4772  for (int jj = 1; jj < 13; jj++) {
4773  int LP7 = 0;
4774  if ((iii == 3 && jj == 1) || (iii == 4 && jj > 1 && jj < 10) || (iii == 5 && jj > 9 && jj < 13))
4775  LP7 = 1;
4776  if (LP7 == 1 && jj == 2) {
4777  YY[k1] = ZZP[k1][iii][jj];
4778  }
4779  }
4780  }
4781  } else {
4782  for (int iii = 2; iii < 4; iii++) {
4783  for (int jj = 1; jj < 13; jj++) {
4784  int LP7 = 0;
4785  if ((iii == 2 && jj > 0 && jj < 11) || (iii == 3 && jj > 10 && jj < 13))
4786  LP7 = 1;
4787  if (LP7 == 1 && jj == 2) {
4788  YY[k1] = ZZP[k1][iii][jj];
4789  }
4790  }
4791  }
4792  }
4793  }
4794  gr5 = new TGraph(NP, XX, YY);
4795  gr5->SetLineColor(5);
4796  gr5->SetMarkerColor(5);
4797  gr5->SetMarkerStyle(20);
4798  gr5->SetTitle("ieta 18");
4799  gr5->SetFillStyle(0);
4800  gr5->SetMarkerSize(1.2);
4801  gr5->Draw("P");
4803  // for(int k1 = 0; k1<NP; k1++) {YY[k1]=0.;if(LASERruns[k1] > "305874" ) {for(int iii = 3; iii<6; iii++) {for (int jj=1;jj<13;jj++) {int LP7=0;if((iii==3 && jj==1 ) || (iii==4 && jj> 1 && jj<10) || (iii==5 && jj> 9 && jj<13)) LP7=1;if(LP7 == 1 && jj == 1) {YY[k1] = ZZP[k1][iii][jj];} }}}else{for(int iii = 2; iii<4; iii++) {for (int jj=1;jj<13;jj++) {int LP7 = 0;if((iii==2 && jj>0 && jj<11) || (iii==3 && jj>10 && jj<13)) LP7 = 1;if(LP7 == 1 && jj == 1) {YY[k1] = ZZP[k1][iii][jj];} }}} }
4804  // gr6 = new TGraph(NP,XX,YY); gr6->SetLineColor(6); gr6->SetMarkerColor(6); gr6->SetMarkerStyle(20); gr6->SetTitle("ieta 17"); gr6->SetFillStyle(0); gr6->SetMarkerSize(1.2); gr6->Draw("P");
4805  // TLegend leg(.6,.67,.78,.88, " HEP L7");
4806  TLegend leg(xx1, yy1, xx2, yy2, " HEP L7");
4807  leg.AddEntry(gr1);
4808  leg.AddEntry(gr2);
4809  leg.AddEntry(gr3);
4810  leg.AddEntry(gr4);
4811  leg.AddEntry(gr5); //leg.AddEntry(gr6);leg.AddEntry(gr7);leg.AddEntry(gr8);
4812  leg.SetMargin(0.3);
4813  leg.SetBorderSize(1);
4814  leg.DrawClone("Same");
4815  } //if(Method == 18
4816  //
4817  //======================================================================================================= PLOT21 r vs t positive direction:Depth3 and eta 27 28
4818  if (Method == 21) {
4819  cout << "****Draw 21 Dependencies: P r vs t for Depth3 and some eta 27 28 *** " << endl;
4820  // XXE, YYE - errors
4821  gStyle->SetOptTitle(kFALSE);
4822  gStyle->SetPalette(kSolar);
4823  for (int k1 = 0; k1 < NP; k1++) {
4824  YY[k1] = 0.;
4825  }
4826  c1->Range(0, 0, 25, 18);
4827  // c1->SetFillColor(0);
4828  c1->SetFillColor(0);
4829  c1->Clear();
4830  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
4831  pad1->Draw();
4832  pad1->cd();
4833  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
4834  // x1 y1 x2 y2
4835  pad1->DrawFrame(x1, y1, x2, y2); // 1-A,
4836  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
4837  pad1->GetFrame()->SetFillColor(0);
4838  pad1->Draw();
4839  gPad->SetGridy();
4840  gPad->SetGridx();
4841  //jj M: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 P: 0 1 2 3 4 5 6 7 8 9 10 11 12 13
4842  // real N: 29 28 27 26 25 24 23 22 21 20 19 18 17 16 16 17 18 19 20 21 22 23 24 25 26 27 28 29
4843  // - - - - - - - - - - - -
4844  for (int k1 = 0; k1 < NP; k1++) {
4845  YY[k1] = ZZP[k1][3][11];
4846  YYE[k1] = 0.01 * YY[k1];
4847  }
4848  // gr1 = new TGraph(NP,XX,YY); gr1->SetLineColor(1); gr1->SetMarkerColor(1); gr1->SetMarkerStyle(20); gr1->SetMarkerSize(1.2); gr1->SetTitle("ieta 27"); gr1->SetName("gr1");gr1->SetFillStyle(0); gr1->Draw("P");
4849  ge1 = new TGraphErrors(NP, XX, YY, XXE, YYE);
4850  ge1->SetLineColor(1);
4851  ge1->SetMarkerColor(1);
4852  ge1->SetMarkerStyle(20);
4853  ge1->SetMarkerSize(1.2);
4854  ge1->SetTitle("ieta 27");
4855  ge1->SetName("gr1");
4856  ge1->SetFillStyle(0);
4857  ge1->Draw("P");
4858  TF1 *myfit = new TF1("myfit", "[0] + [1]*x**{[2]}", 1., 2.);
4859  myfit->SetParName(0, "c0");
4860  myfit->SetParName(1, "c1");
4861  myfit->SetParName(2, "c2");
4862  myfit->SetParameter(0, 0.01);
4863  myfit->SetParameter(1, 1.1);
4864  myfit->SetParameter(2, 0.12);
4865  gStyle->SetOptFit(1101);
4866  myfit->SetLineColor(1);
4867  ge1->Fit("myfit"); // OR just: "gaus" "expo" (w/ 2 parameters) "polN" // ge1->Fit("pol5");
4868 
4869  for (int k1 = 0; k1 < NP; k1++) {
4870  YY[k1] = ZZP[k1][3][12];
4871  YYE[k1] = 0.01 * YY[k1];
4872  }
4873  // gr2 = new TGraph(NP,XX,YY); gr2->SetLineColor(2); gr2->SetMarkerColor(2); gr2->SetMarkerStyle(20); gr2->SetMarkerSize(1.2); gr2->SetTitle("ieta 28"); gr2->SetName("gr2"); gr2->SetFillStyle(0); gr2->Draw("P");
4874  ge2 = new TGraphErrors(NP, XX, YY, XXE, YYE);
4875  ge2->SetLineColor(2);
4876  ge2->SetMarkerColor(2);
4877  ge2->SetMarkerStyle(20);
4878  ge2->SetMarkerSize(1.2);
4879  ge2->SetTitle("ieta 28");
4880  ge2->SetName("ge2");
4881  ge2->SetFillStyle(0);
4882  ge2->Draw("P");
4883  // TF1 *myfit = new TF1("myfit","[0] + [1]*x**{[2]}", 1., 2.);
4884  // TF1 *myfit = new TF1("myfit","[0]*sin(x) + [1]*exp(-[2]*x)", 0, 2);
4885  TF1 *myfit2 = new TF1("myfit2", "[0]*sin(x) + [1]*exp(-[2]*x)", 0, 2);
4886  myfit2->SetParName(0, "c0");
4887  myfit2->SetParName(1, "c1");
4888  myfit2->SetParName(2, "c2");
4889  myfit2->SetParameter(0, 0.01);
4890  myfit2->SetParameter(1, 1.1);
4891  myfit2->SetParameter(2, 0.12);
4892  gStyle->SetOptFit(1101);
4893  myfit2->SetLineColor(2);
4894  ge2->Fit("myfit2"); // OR just: "gaus" "expo" (w/ 2 parameters) "polN" // ge1->Fit("pol5");
4895 
4896  // TLegend leg(.5,.67,.88,.88, "HEP Depth3");
4897  TLegend leg(xx1, yy1, xx2, yy2, " HEP Depth3");
4898  // leg.AddEntry(gr1); leg.AddEntry(gr2);
4899  leg.AddEntry(ge1);
4900  leg.AddEntry(ge2);
4901  leg.SetMargin(0.3);
4902  leg.SetBorderSize(1);
4903  leg.DrawClone("Same");
4904 
4905  // gPad->BuildLegend(.5,.67,.88,.88,"HEP L7");
4906  //virtual TLegend * BuildLegend (Double_t x1=0.5, Double_t y1=0.67, Double_t x2=0.88, Double_t y2=0.88, const char *title="", Option_t *option="")
4907 
4908  } //21
4909  //
4910  //================================================================================
4911  //======================================================================================================= PLOT22:P: draw <Rijk>_ev.run for all runs
4912  if (Method == 22) {
4913  cout << "****Draw 22 Dependencies: P: draw <Rijk>_ev.run for all runs *** " << endl;
4914  gPad->SetGridy();
4915  gPad->SetGridx();
4916  gPad->SetLogy();
4917  gStyle->SetOptStat(1110000);
4918  rwithphi->SetMarkerStyle(20);
4919  rwithphi->SetMarkerSize(0.4);
4920  rwithphi->GetYaxis()->SetLabelSize(0.04);
4921  rwithphi->SetTitle("all runs & channels");
4922  rwithphi->SetXTitle("HEP <Rijk>");
4923  rwithphi->SetYTitle("N");
4924  rwithphi->SetMarkerColor(4);
4925  rwithphi->SetLineColor(4);
4926  // rwithphi->Draw("Error");
4927  rwithphi->Draw("PL");
4928  } //Method = 22
4929 
4930  //======================================================================================================= PLOT24:M: draw <Rijk>_ev.run for all runs
4931  if (Method == 24) {
4932  cout << "****Draw 24 Dependencies: M: draw <Rijk>_ev.run for all runs *** " << endl;
4933  gPad->SetGridy();
4934  gPad->SetGridx();
4935  gPad->SetLogy();
4936  gStyle->SetOptStat(1110000);
4937  rwithphi->SetMarkerStyle(20);
4938  rwithphi->SetMarkerSize(0.4);
4939  rwithphi->GetYaxis()->SetLabelSize(0.04);
4940  rwithphi->SetTitle("all runs & channels");
4941  rwithphi->SetXTitle("HEM <Rijk>");
4942  rwithphi->SetYTitle("N");
4943  rwithphi->SetMarkerColor(4);
4944  rwithphi->SetLineColor(4);
4945  // rwithphi->Draw("Error");
4946  rwithphi->Draw("PL");
4947  } //Method = 24
4948 
4949  //================================================================================
4950  //======================================================================================================= PLOT23:P:gains LED runs used
4951  if (Method == 23) {
4952  cout << "****Draw 23 Dependencies: P:gains LED runs used *** " << endl;
4953  gPad->SetGridy();
4954  gPad->SetGridx();
4955  gPad->SetLogy();
4956  gStyle->SetOptStat(1110000);
4957  gainkoeff->SetMarkerStyle(20);
4958  gainkoeff->SetMarkerSize(0.4);
4959  gainkoeff->GetYaxis()->SetLabelSize(0.04);
4960  gainkoeff->SetTitle("all channels");
4961  gainkoeff->SetXTitle("gains");
4962  gainkoeff->SetYTitle("N");
4963  gainkoeff->SetMarkerColor(4);
4964  gainkoeff->SetLineColor(4);
4965  // gainkoeff->Draw("Error");
4966  gainkoeff->Draw("PL");
4967  } //Method = 23
4968  //======================================================================================================= PLOT25:P:R(Theta) Dependencies for last LASER runs for M&P
4969  if (Method == 25) {
4970  cout << "****Draw 25 R(Theta) Dependencies for last LASER runs for M&P *** " << endl;
4971 
4972  // for(int k1 = 0; k1<NP; k1++) {YY[k1]=0.;}
4973  c1->Range(0, 0, 25, 18);
4974  c1->SetFillColor(0);
4975  c1->Clear();
4976  TPad *pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.98, 0.98, 0);
4977  pad1->Draw();
4978  pad1->cd();
4979  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
4980  // x1 y1 x2 y2
4981  // pad1->DrawFrame(16.,0.5,30.,1.0); // 1-A,
4982  // pad1->DrawFrame(16.,0.45,30.,1.05); // 1-A,
4983  pad1->DrawFrame(16., 0.70, 30., 1.05); // 1-A,
4984 
4985  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
4986  pad1->GetFrame()->SetFillColor(0);
4987  pad1->Draw();
4988  gPad->SetGridy();
4989  gPad->SetGridx();
4990 
4991  // cout<<" L1 ***THETA 0 = " << THETA[0] <<" THETA 12 =" << THETA[12] <<endl;
4992  // cout<<"*******RRM 0 = " << RRM[0] <<" RRM 12 = " << RRM[12] <<endl;
4993  // cout<<"*******RRP 0 = " << RRP[0] <<" RRP 12 = " << RRP[12] <<endl;
4994  gr1 = new TGraph(13, THETA, RRM);
4995  gr1->SetLineColor(2);
4996  gr1->SetMarkerColor(2);
4997  gr1->SetMarkerStyle(25);
4998  gr1->SetMarkerSize(1.5);
4999  gr1->SetTitle("HEM");
5000  gr1->SetFillStyle(0);
5001  gr1->Draw("PL");
5002  gr2 = new TGraph(13, THETA, RRP);
5003  gr2->SetLineColor(4);
5004  gr2->SetMarkerColor(4);
5005  gr2->SetMarkerStyle(25);
5006  gr2->SetMarkerSize(1.5);
5007  gr2->SetTitle("HEP");
5008  gr2->SetFillStyle(0);
5009  gr2->Draw("PL");
5010 
5011  cout << "*******THETA7 0 = " << THETA7[0] << " 1 = " << THETA7[1] << " 2= " << THETA7[2] << endl;
5012  cout << "*******RRM7 0 = " << RRM7[0] << " 1 = " << RRM7[1] << " 2= " << RRM7[2] << endl;
5013 
5014  cout << "**************************************************************************************** " << endl;
5015 
5016  cout << "******THETA7 9 = " << THETA7[9] << " 10 = " << THETA7[10] << " 11= " << THETA7[11] << endl;
5017  cout << "*******RRM7 9 = " << RRM7[9] << " 10 = " << RRM7[10] << " 11= " << RRM7[11] << endl;
5018 
5019  gr3 = new TGraph(11, THETA7, RRM7);
5020  gr3->SetLineColor(2);
5021  gr3->SetMarkerColor(2);
5022  gr3->SetMarkerStyle(26);
5023  gr3->SetMarkerSize(1.5);
5024  gr3->SetTitle("HEM");
5025  gr3->SetFillStyle(0);
5026  gr3->Draw("PL");
5027  gr4 = new TGraph(11, THETA7, RRP7);
5028  gr4->SetLineColor(4);
5029  gr4->SetMarkerColor(4);
5030  gr4->SetMarkerStyle(26);
5031  gr4->SetMarkerSize(1.5);
5032  gr4->SetTitle("HEP");
5033  gr4->SetFillStyle(0);
5034  gr4->Draw("PL");
5035 
5036  // TLegend leg(xx1,yy1,xx2,yy2,"");
5037  TLegend leg(xx1, yy1 + 0.1, xx2, yy2 + 0.1, " L1 & L7 ");
5038  leg.AddEntry(gr1);
5039  leg.AddEntry(gr2);
5040  leg.AddEntry(gr3);
5041  leg.AddEntry(gr4);
5042  leg.SetMargin(0.3);
5043  leg.SetBorderSize(1);
5044  leg.DrawClone("Same");
5045 
5046  /*
5047  cout<<"****Draw 25 R(Theta) Dependencies for last LASER runs for M&P *** " <<endl;
5048  gPad->SetGridy();
5049  gPad->SetGridx();
5050  gPad->SetLogy();
5051  gStyle->SetOptStat(1110000);
5052  gainkoeff->SetMarkerStyle(20);
5053  gainkoeff->SetMarkerSize(0.4);
5054  gainkoeff->GetYaxis()->SetLabelSize(0.04);
5055  gainkoeff->SetTitle("intLumi=41.3 fb-1 ");
5056  gainkoeff->SetXTitle("Theta ");
5057  gainkoeff->SetYTitle("R for HEM & HEP");
5058  gainkoeff->SetMarkerColor(4);
5059  gainkoeff->SetLineColor(4);
5060  // gainkoeff->Draw("Error");
5061  gainkoeff->Draw("PL");
5062 */
5063 
5064  } //Method = 25
5065 
5066  //======================================================================================================= PLOT26: M: draw <RRijk>_ev.run for all runs
5067  if (Method == 26) {
5068  cout << "****Draw 26 Dependencies: M: draw <RRijk>_ev.run for all runs *** " << endl;
5069  gPad->SetGridy();
5070  gPad->SetGridx();
5071  gPad->SetLogy();
5072  gStyle->SetOptStat(1110000);
5073  rrwithphiM->SetMarkerStyle(20);
5074  rrwithphiM->SetMarkerSize(0.4);
5075  rrwithphiM->GetYaxis()->SetLabelSize(0.04);
5076  rrwithphiM->SetTitle("all runs & channels");
5077  rrwithphiM->SetXTitle("HEM <RRijk>");
5078  rrwithphiM->SetYTitle("N");
5079  rrwithphiM->SetMarkerColor(4);
5080  rrwithphiM->SetLineColor(4);
5081  // rrwithphiM->Draw("Error");
5082  rrwithphiM->Draw("PL");
5083  } //Method = 26
5084 
5085  //======================================================================================================= PLOT27:P: draw <RRijk>_ev.run for all runs
5086  if (Method == 27) {
5087  cout << "****Draw 27 Dependencies: P: draw <RRijk>_ev.run for all runs *** " << endl;
5088  gPad->SetGridy();
5089  gPad->SetGridx();
5090  gPad->SetLogy();
5091  gStyle->SetOptStat(1110000);
5092  rrwithphiP->SetMarkerStyle(20);
5093  rrwithphiP->SetMarkerSize(0.4);
5094  rrwithphiP->GetYaxis()->SetLabelSize(0.04);
5095  rrwithphiP->SetTitle("all runs & channels");
5096  rrwithphiP->SetXTitle("HEP <RRijk>");
5097  rrwithphiP->SetYTitle("N");
5098  rrwithphiP->SetMarkerColor(4);
5099  rrwithphiP->SetLineColor(4);
5100  // rrwithphiP->Draw("Error");
5101  rrwithphiP->Draw("PL");
5102  } //Method = 27
5103 
5104  //======================================================================================================= PLOT28: M: Mean <Aijk>_ev.run for all runs
5105  if (Method == 28) {
5106  cout << "****Draw 28 Dependencies: M: Mean *** " << endl;
5107  gPad->SetGridy();
5108  gPad->SetGridx();
5109  gPad->SetLogy();
5110  gStyle->SetOptStat(1110000);
5111  c1->SetFillColor(0);
5112  // Ceff1M->SetTitle("any Error, HE Depth1 \n");
5113  Ceff1M->SetMarkerStyle(20);
5114  Ceff1M->SetMarkerSize(0.4);
5115  Ceff1M->GetYaxis()->SetLabelSize(0.04);
5116  Ceff1M->SetTitle("M: all runs & channels");
5117  Ceff1M->SetXTitle("M: Mean <Aijk>");
5118  Ceff1M->SetYTitle("N");
5119  Ceff1M->SetMarkerColor(4);
5120  Ceff1M->SetLineColor(4);
5121  Ceff1M->SetMinimum(0.7);
5122  // Ceff1M->Draw("Error");
5123  Ceff1M->Draw("PL");
5124  } //Method = 28
5125 
5126  //======================================================================================================= PLOT29: P: Mean <Aijk>_ev.run for all runs
5127  if (Method == 29) {
5128  cout << "****Draw 29 Dependencies: P:Mean *** " << endl;
5129  gPad->SetGridy();
5130  gPad->SetGridx();
5131  gPad->SetLogy();
5132  gStyle->SetOptStat(1110000);
5133  c1->SetFillColor(0);
5134  // Ceff1M->SetTitle("any Error, HE Depth1 \n");
5135  Ceff1M->SetMarkerStyle(20);
5136  Ceff1M->SetMarkerSize(0.4);
5137  Ceff1M->GetYaxis()->SetLabelSize(0.04);
5138  Ceff1M->SetTitle("P: all runs & channels");
5139  Ceff1M->SetXTitle("P: Mean <Aijk>");
5140  Ceff1M->SetYTitle("N");
5141  Ceff1M->SetMarkerColor(4);
5142  Ceff1M->SetLineColor(4);
5143  Ceff1M->SetMinimum(0.7);
5144  // Ceff1M->Draw("Error");
5145  Ceff1M->Draw("PL");
5146  } //Method = 29
5147 
5148  //======================================================================================================= PLOT30: M PHI dependence
5149  if (Method == 30) {
5150  cout << "****Draw 30 Dependencies:M PHI *** " << endl;
5151  phidepdrawing30->Divide(phidependenceM, phidependenceM0, 1, 1, "B");
5152  phidepdrawing30->Sumw2();
5153  gPad->SetGridy();
5154  gPad->SetGridx(); //gStyle->SetOptStat(0000000);
5155  gPad->SetLogy(0);
5156  phidepdrawing30->SetMarkerStyle(20);
5157  phidepdrawing30->SetMarkerSize(1.4);
5158  phidepdrawing30->GetYaxis()->SetLabelSize(0.04);
5159  phidepdrawing30->SetXTitle("Phi");
5160  phidepdrawing30->SetYTitle("RR");
5161  phidepdrawing30->SetMarkerColor(2);
5162  phidepdrawing30->SetLineColor(2);
5163  phidepdrawing30->Draw("Error");
5164 
5165  } //Method = 30
5166 
5167  //======================================================================================================= PLOT31: P PHI dependence
5168  if (Method == 31) {
5169  cout << "****Draw 31 Dependencies:P PHI *** " << endl;
5170  phidepdrawing31->Divide(phidependenceP, phidependenceP0, 1, 1, "B");
5171  phidepdrawing31->Sumw2();
5172  gPad->SetGridy();
5173  gPad->SetGridx(); //gStyle->SetOptStat(0000000);
5174  gPad->SetLogy(0);
5175  phidepdrawing31->SetMarkerStyle(20);
5176  phidepdrawing31->SetMarkerSize(1.4);
5177  phidepdrawing31->GetYaxis()->SetLabelSize(0.04);
5178  phidepdrawing31->SetXTitle("Phi");
5179  phidepdrawing31->SetYTitle("RR");
5180  phidepdrawing31->SetMarkerColor(4);
5181  phidepdrawing31->SetLineColor(4);
5182  phidepdrawing31->Draw("Error");
5183 
5184  } //Method = 31
5185 
5186  //======================================================================================================= PLOT32: M: RMS <Aijk>_ev.run for all runs
5187  if (Method == 32) {
5188  cout << "****Draw 32 Dependencies: M:RMS *** " << endl;
5189  gPad->SetGridy();
5190  gPad->SetGridx();
5191  gPad->SetLogy();
5192  gStyle->SetOptStat(1110000);
5193  c1->SetFillColor(0);
5194  Ceff1R->SetMarkerStyle(20);
5195  Ceff1R->SetMarkerSize(0.4);
5196  Ceff1R->GetYaxis()->SetLabelSize(0.04);
5197  Ceff1R->SetTitle("M: all runs & channels");
5198  Ceff1R->SetXTitle("M: RMS <Aijk>");
5199  Ceff1R->SetYTitle("N");
5200  Ceff1R->SetMarkerColor(4);
5201  Ceff1R->SetLineColor(4);
5202  Ceff1R->SetMinimum(0.7);
5203  Ceff1R->Draw("PL");
5204  } //Method = 32
5205 
5206  //======================================================================================================= PLOT33: P: RMS <Aijk>_ev.run for all runs
5207  if (Method == 33) {
5208  cout << "****Draw 33 Dependencies: P:RMS *** " << endl;
5209  gPad->SetGridy();
5210  gPad->SetGridx();
5211  gPad->SetLogy();
5212  gStyle->SetOptStat(1110000);
5213  c1->SetFillColor(0);
5214  Ceff1R->SetMarkerStyle(20);
5215  Ceff1R->SetMarkerSize(0.4);
5216  Ceff1R->GetYaxis()->SetLabelSize(0.04);
5217  Ceff1R->SetTitle("P: all runs & channels");
5218  Ceff1R->SetXTitle("P: RMS <Aijk>");
5219  Ceff1R->SetYTitle("N");
5220  Ceff1R->SetMarkerColor(4);
5221  Ceff1R->SetLineColor(4);
5222  Ceff1R->SetMinimum(0.7);
5223  Ceff1R->Draw("PL");
5224  } //Method = 33
5225 
5226  //================================================================================
5227  //======================================================================================================= PLOT34:P:IntLumi fb-1 vs. Days
5228  if (Method == 34) {
5229  cout << "****Draw 34 P:IntLumi fb-1 vs. Days *** " << endl;
5230  gPad->SetGridy();
5231  gPad->SetGridx();
5232  gPad->SetLogy(0);
5233  gStyle->SetOptStat(000000000);
5234  lumiplot->GetOption();
5235  lumiplot->SetMarkerStyle(20);
5236  lumiplot->SetMarkerSize(0.4);
5237  lumiplot->GetYaxis()->SetLabelSize(0.04);
5238  lumiplot->SetXTitle("days");
5239  lumiplot->SetYTitle("IntLumi fb-1");
5240  lumiplot->SetMarkerColor(4);
5241  lumiplot->SetLineColor(4);
5242  lumiplot->SetMinimum(0.);
5243  lumiplot->SetMaximum(170.);
5244  // gStyle->SetErrorX(0);
5245  lumiplot->Draw("hist PL");
5246  } //Method = 34
5247  //================================================================================
5248  //======================================================================================================= PLOT35:P:IntLumi fb-1 vs. Days (up to 171)
5249  if (Method == 35) {
5250  cout << "****Draw 35 P:IntLumi fb-1 vs. Days (up to 171) *** " << endl;
5251  gPad->SetGridy();
5252  gPad->SetGridx();
5253  gPad->SetLogy(0);
5254  gStyle->SetOptStat(000000000);
5255  lumiplot1->GetOption();
5256  lumiplot1->SetMarkerStyle(20);
5257  lumiplot1->SetMarkerSize(0.4);
5258  lumiplot1->GetYaxis()->SetLabelSize(0.04);
5259  lumiplot1->SetXTitle("days");
5260  lumiplot1->SetYTitle("IntLumi fb-1");
5261  lumiplot1->SetMarkerColor(4);
5262  lumiplot1->SetLineColor(4);
5263  lumiplot1->SetMinimum(0.);
5264  lumiplot1->SetMaximum(45.);
5265  // gStyle->SetErrorX(0);
5266  lumiplot1->Draw("hist PL");
5267  } //Method = 35
5268  //================================================================================
5269  //======================================================================================================= PLOT36:P:IntLumi fb-1 vs. Days (2017 only)
5270  if (Method == 36) {
5271  cout << "****Draw 36 P:IntLumi fb-1 vs. Days (2017 only) *** " << endl;
5272  gPad->SetGridy();
5273  gPad->SetGridx();
5274  gPad->SetLogy(0);
5275  gStyle->SetOptStat(000000000);
5276  lumiplot2->GetOption();
5277  lumiplot2->SetMarkerStyle(20);
5278  lumiplot2->SetMarkerSize(0.4);
5279  lumiplot2->GetYaxis()->SetLabelSize(0.04);
5280  lumiplot2->SetXTitle("days");
5281  lumiplot2->SetYTitle("IntLumi fb-1");
5282  lumiplot2->SetMarkerColor(4);
5283  lumiplot2->SetLineColor(4);
5284  lumiplot2->SetMinimum(0.);
5285  lumiplot2->SetMaximum(55.);
5286  // gStyle->SetErrorX(0);
5287  lumiplot2->Draw("hist PL");
5288  } //Method = 36
5289  //================================================================================
5290  //======================================================================================================= PLOT37:P:IntLumi fb-1 vs. Days (2018 only)
5291  if (Method == 37) {
5292  cout << "****Draw 37 P:IntLumi fb-1 vs. Days (2018 only) *** " << endl;
5293  gPad->SetGridy();
5294  gPad->SetGridx();
5295  gPad->SetLogy(0);
5296  gStyle->SetOptStat(000000000);
5297  lumiplot3->GetOption();
5298  lumiplot3->SetMarkerStyle(20);
5299  lumiplot3->SetMarkerSize(0.4);
5300  lumiplot3->GetYaxis()->SetLabelSize(0.04);
5301  lumiplot3->SetXTitle("days");
5302  lumiplot3->SetYTitle("IntLumi fb-1");
5303  lumiplot3->SetMarkerColor(4);
5304  lumiplot3->SetLineColor(4);
5305  lumiplot3->SetMinimum(0.);
5306  lumiplot3->SetMaximum(75.);
5307  // gStyle->SetErrorX(0);
5308  lumiplot3->Draw("hist PL");
5309  } //Method = 37
5310  //================================================================================
5311  //====================================================================================================================================================
5312  //================================================================================
5313 
5314  // L1: (iii=d1 & eta 17-29);
5315  // M: int LM1 = 0;if((iii==1 && jj<13)) LM1 = 1;
5316  // P: int LP1 = 0;if((iii==1 && jj> 0)) LP1 = 1;
5317 
5318  // :L7: (iii=d2 & eta 17-26) && (iii=d3 & eta 27-28)
5319  // M: int LM7=0;if((iii==2 && jj>3 && jj<13) || (iii==3 && jj> 1 && jj< 4)) LM7=1;
5320  // P: int LP7=0;if((iii==2 && jj>0 && jj<11) || (iii==3 && jj>10 && jj<13)) LP7=1;
5321 
5322  //=======================================================================================================
5323  //======================================================================================================= finish loop over Methods
5324  //=======================================================================================================
5325  TString fdir = "amt2019raddam/";
5326  //
5327  TString plotName = fdir + MethodName[Method] + ".png";
5328  c1->SaveAs(plotName);
5329  cout << "****PLOT " << Method << " drawn **** " << endl;
5330 
5331  } //if( Method != 9
5332  ++Method;
5333  } // loop over Methods
5334  //=======================================================================================================
5335  } // loop over directions
5336  //=======================================================================================================
5337  // // // // // // // additional plots:
5338  // // // // // // // additional plots:
5339  // // // // // // // additional plots:
5340  TString fdir = "amt2019raddam/";
5341  //============================================= PLOT100
5342  // gStyle->SetOptStat(0000000);
5343  phidepdrawing30->Draw("Error");
5344  // gStyle->SetOptStat(0000000);
5345  phidepdrawing31->Draw("ErrorSame");
5346  TString plotName = fdir + "PLOT100.png";
5347  c1->SaveAs(plotName);
5348  cout << "****PLOT " << 100 << " drawn **** " << endl;
5349  //============================================= PLOT101
5350  gStyle->SetOptStat(1110000);
5351  phiRRM->SetMarkerStyle(20);
5352  phiRRM->SetMarkerSize(1.4);
5353  phiRRM->GetYaxis()->SetLabelSize(0.04);
5354  phiRRM->SetXTitle("RR");
5355  phiRRM->SetYTitle("N");
5356  phiRRM->SetMarkerColor(2);
5357  phiRRM->SetLineColor(2);
5358  phiRRM->Draw("Error");
5359  phiRRP->SetMarkerStyle(20);
5360  phiRRP->SetMarkerSize(1.4);
5361  phiRRP->GetYaxis()->SetLabelSize(0.04);
5362  phiRRP->SetXTitle("RR");
5363  phiRRP->SetYTitle("N");
5364  phiRRP->SetMarkerColor(4);
5365  phiRRP->SetLineColor(4);
5366  phiRRP->Draw("ErrorSame");
5367  plotName = fdir + "PLOT101.png";
5368  c1->SaveAs(plotName);
5369  cout << "****PLOT " << 101 << " drawn **** " << endl;
5370  //=======================================================================================================
5371  //=======================================================================================================
5372  //=======================================================================================================
5373  //=======================================================================================================
5374  //=======================================================================================================
5375  //=======================================================================================================
5376  //=======================================================================================================
5377  //=======================================================================================================
5378  //=======================================================================================================
5379  //=======================================================================================================
5380  //______________________________________________________________________________
5381  //______________________________________________________________________________
5382  //
5383  //______________________________________________________________________________
5384  //______________________________________________________________________________
5385  //
5386  gSystem->Exit(0);
5387  //______________________________________________________________________________
5388 }
common ppss p3p6s2 common epss epspn46 common const1 w8
Definition: inclppp.h:1
double XX[2]
Definition: herwig.h:145
static const double X0
common ppss p3p6s2 common epss epspn46 common const1 w9
Definition: inclppp.h:1
string fname
main script
tuple cout
Definition: gather_cfg.py:144
const unsigned int kfactor