CMS 3D CMS Logo

Functions
zamt0shunt6gsm2018.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 <TGaxis.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

◆ main()

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

Definition at line 34 of file zamt0shunt6gsm2018.cc.

References testProducerWithPsetDescEmpty_cfi::a2, b1, fftjetpileupestimator_calo_uncalib_cfi::c0, alignmentValidation::c1, gather_cfg::cout, writedatasetfile::firstrun, alignmentValidation::fname, mps_fire::i, l1tHGCalConcentratorProducer_cfi::Method, dqmiodumpmetadata::n, PostProcessor_cff::normalization, compareTotals::pad1, L1TEGammaDiff_cfi::plotName, submitPVValidationJobs::t, ctppsCommonDQMSource_cfi::verbosity, x, ecalPiZeroTask_cfi::X0, testProducerWithPsetDescEmpty_cfi::x1, testProducerWithPsetDescEmpty_cfi::x2, AlignmentPI::XX, testProducerWithPsetDescEmpty_cfi::y1, testProducerWithPsetDescEmpty_cfi::y2, and AlignmentPI::YY.

34  {
35  cout << "********************************************************************* START job " << endl;
36  //______________________________________________________________________________________________________________________________
37  //TCanvas *c1;
38  TGraph* gr1;
39  TGraph* gr2;
40  TGraph* gr3;
41  TGraph* gr4;
42  TGraph* gr5;
43  TGraph* gr6;
44  TGraph* gr7;
45  TGraph* gr8;
46  TGraph* gr9;
47  TGraphErrors* ge1;
48  TGraphErrors* ge2;
49  TGraphErrors* ge3;
50  TGraphErrors* ge4;
51  TGraphErrors* ge5;
52  TGraphErrors* ge6;
53  TGraphErrors* ge7;
54  TGraphErrors* ge8;
55  TGraphErrors* ge9;
56 
57  //
58  const Int_t NMethods = 14; // total number of Methods (all-together 37 methods)
59  const Int_t NMethodsStart = 0; // since which method to start ( min= 0)
60  const Int_t NMethodsToUse = 13; // choose Number of methods to use ( max= 36)
61  //
62  TString MethodName[NMethods] = {"PLOT0",
63  "PLOT1",
64  "PLOT2",
65  "PLOT3",
66  "PLOT4",
67  "PLOT5",
68  "PLOT6",
69  "PLOT7",
70  "PLOT8",
71  "PLOT9",
72  "PLOT10",
73  "PLOT11",
74  "PLOT12",
75  "PLOT13"};
76  //______________________________________________________________________________________________________________________________
77  //______________________________________________________________________________________________________________________________
78  //______________________________________________________________________________________________________________________________
79  //______________________________________________________________________________________________________________________________
80  //______________________________________________________________________________________________________________________________
81  //______________________________________________________________________________________________________________________________
82  //______________________________________________________________________________________________________________________________ WORKABLE:
83 
84  //______________________________________________________________________________________________________________________________ 22+161=183
85  // (306249 -> 07.11.2017) 164 + DEL=23+31+11= 65 (307782 -> 11.01.2018) = 229
86  // const Int_t NMAXM =22;//
87  // const Int_t NMAXM =17;//
88 
89  // const Int_t NMAXM =14;//
90  // const Int_t NMAXM =553;//
91  // const Int_t NMAXM =202;//
92  // const Int_t NMAXM =115;//
93  // const Int_t NMAXM =97;//
94  const Int_t NMAXM = 73; //
95 
96  cout << "********************************************************************* NMAXM = " << NMAXM << endl;
97 
98  // const Int_t NMAXM =2;//
99  // const Int_t NMAXM =4;//
100  // const Int_t NMAXM =1;//
101  TString LEDrunsM[NMAXM] = {
102 
103  /*
104  // 2017 HEP17 shunt6
105  "295401","295675","296185","296808","297082","297522","297571","297630","297687","298863",
106  "299468","302183","302246","302585","304276","304432","304526","305142","305485","305711",
107  "305886","306249"
108 */
109 
110  // 2018 shunt6
111  // "308784","308882","309238","309318","309321",
112  // "309370","309573","309704","310262","310456",
113  // "310847","310973","311457","311566"
114  // 12.03.2018
115 
116  /*
117  // 2018 all 553 runs LED
118 "308784","308786","308788","308792","308821","308839","308851","308870","308881","308882","308937","308959","308960","308995","309008","309009","309010","309024","309036","309037","309059","309064","309069","309122","309123",
119 "309133","309134","309141","309144","309145","309152","309154","309156","309161","309162","309175","309237","309238","309318","309321","309322","309342","309370","309372","309373","309411","309444","309445","309538","309539",
120 "309545","309546","309565","309573","309592","309596","309646","309669","309670","309671","309672","309674","309678","309704","309714","309723","309727","309752","309819","309820","309821","309823","309824","309825","309833",
121 "309850","309869","309870","309873","309875","309877","309878","309880","309923","309924","309939","309940","309945","310008","310043","310052","310106","310108","310179","310181","310182","310183","310185","310188","310192",
122 "310197","310201","310202","310204","310222","310223","310226","310229","310244","310256","310262","310268","310285","310334","310340","310341","310348","310349","310363","310382","310387","310403","310410","310427","310452",
123 "310454","310456","310604","310806","310807","310847","310947","310948","310949","310952","310968","310973","311327","311334","311335","311338","311344","311347","311349","311353","311355","311358","311360","311361","311362",
124 "311363","311364","311366","311367","311369","311413","311454","311456","311457","311551","311566","311573","311753","311754","311759","311767","311783","311858","311901","312004","312009","312011","312013","312029","312031",
125 "312040","312051","312052","312054","312057","312058","312153","312155","312156","312157","312160","312185","312189","312200","312204","312211","312253","312281","312314","312316","312320","312333","312341","312372","312374",
126 "312375","312379","312384","312386","312392","312458","312461","312462","312466","312467","312469","312470","312471","312472","312482","312483","312484","312486","312487","312489","312524","312571","312575","312579","312618",
127 "312622","312626","312717","312756","312757","312775","312778","312870","312872","312874","312879","312880","312884","312886","312889","312953","313009","313049","313051","313064","313067","313072","313090","313149","313158",
128 "313174","313194","313232","313259","313260","313263","313264","313307","313335","313338","313340","313344","313371","313373","313375","313430","313479","313493","313495","313498","313625","313632","313890","313891","313897",
129 "313904","313915","313918","313919","314046","314097","314100","314103","314106","314111","314298","314308","314313","314419","314420","314422","314423","314424","314425","314426","314430","314431","314432","314542","314595",
130 "314597","314608","314695","314696","314769","314770","314776","314777","314779","314780","314782","314786","314795","314800","314826","314827","314895","314896","314897","314898","314899","314943","314944","314948","314949",
131 "315012","315016","315021","315023","315024","315040","315073","315129","315130","315132","315213","315285","315437","315579","315594","315657","315660","315735","315746","315748","315749","315754","315757","315812","315816",
132 "315984","316129","316316","316410","316489","316530","316584","316632","316677","316815","316826","317116","317119","317191","317193","317229","317268","317271","317273","317326","317363","317367","317398","317401","317444",
133 "317448","317601","317606","317607","317609","317610","317611","317612","317613","317617","317718","317719","317722","317728","317785","317790","317977","317981","317984","318207","318208","318211","318217","318222","318235",
134 "318758","318840","319198","319213","319401","319517","319519","319520","319564","319610","319612","319734","319771","319774","319857","319964","319969","320108","320117","320125","320158","320203","320205","320220","320348",
135 "320358","320371","320374","320577","320579","320871","320873","320892","320944","320947","320949","320950","320952","321019","321033","321036","321187","321197","321329","321339","321359","321371","321445","321447","321514",
136 "321534","321549","321552","321807","321853","321874","321927","322166","322255","322261","322338","322415","322419","322718","322719","322720","322721","322725","322781","322782","322801","322843","322853","322876","322931",
137 "322995","323016","323038","323308","323314","323502","323530","323531","323567","323579","323613","323737","323742","324030","324032","324111","324138","324219","324225","324296","324303","324591","324705","324919","324934",
138 "325141","325267","325433","325446","325453","325456","325457","325488","325498","325551","325640","325641","325748","325757","325787","325790","326234","326324","326780","326871","326875","327091","327283","327284","327288",
139 "327438","327441","327443","327547","327548","327552","327576","327577","327579","327580","327581","327591","327595","327616","327620","327656","327660","327670","327686","327687","327688","327689","327690","327691","327709",
140 "327711","327762","327785"
141 */
142  /*
143  // 2018 all 205 runs LED
144 "315812","315816","315984","316129","316316","316410","316489","316530","316584","316632","316677","316815","316826","317116","317119","317191","317193","317229","317268","317271","317273","317326","317363","317367","317398",
145 "317401","317444","317448","317601","317606","317607","317609","317610","317611","317612","317613","317617","317718","317719","317722","317785","317790","317977","317981","317984","318207","318208","318211","318217","318222",
146 "318235","318758","318840","319198","319213","319401","319517","319519","319520","319564","319610","319612","319734","319771","319774","319857","319964","319969","320108","320117","320125","320158","320203","320205","320220",
147 "320348","320358","320371","320374","320577","320579","320871","320873","320892","320944","320947","320949","320950","320952","321019","321033","321036","321187","321197","321329","321339","321359","321371","321445","321447",
148 "321514","321534","321807","321853","321874","321927","322166","322255","322261","322338","322415","322419","322718","322719","322720","322721","322725","322781","322782","322801","322843","322853","322876","322931","322995",
149 "323016","323038","323308","323314","323502","323530","323531","323567","323579","323613","323737","323742","324030","324032","324111","324138","324219","324225","324296","324303","324591","324705","324919","324934","325141",
150 "325267","325433","325446","325453","325456","325457","325488","325498","325551","325640","325641","325748","325757","325787","325790","326234","326324","326780","326871","326875","327091","327283","327284","327288","327438",
151 "327441","327443","327547","327548","327552","327576","327577","327579","327580","327581","327591","327595","327616","327620","327656","327660","327670","327686","327687","327688","327689","327690","327691","327709","327711",
152 "327762","327785"
153 */
154 
155  /*
156 // 2018 117 led runs
157 "315812","315984","316826","317116","317193","317268","317271","317273","317363","317398","317401","317444","317606","317607","317609","317610","317611","317612","317613","317617","317785","317981","317984","318207","318208",
158 "318235","318758","318840","319198","319401","319517","319519","319520","319564","319612","319734","319771","319774","319857","319969","320117","320158","320203","320205","320348","320579","320873","320892","320944","320952",
159 "321019","321036","321187","321339","321359","321371","321447","321514","321807","321853","321874","321927","322166","322261","322338","322419","322718","322719","322720","322721","322725","322781","322782","322801","322853",
160 "322876","322931","322995","323308","323314","323502","323530","323531","323579","323613","323742","324030","324032","324138","324225","324296","324919","325141","325433","325446","325456","325488","325498","325551",
161 "325757","325787","326234","326780","326875","327288","327438","327552","327579", "327591","327595","327616","327620","327656","327660","327670"
162 */
163  /*
164 "315812","315984","316826","317116","317193","317268","317271","317273","317363","317398","317401","317444","317606","317607","317609","317610","317611","317612","317613","317617","317785","318235","318758","318840","319198",
165 "319401","319517","319519","319520","319564","319612","319734","319771","319774","319857","319969","320117","320158","320203","320205","320348","320579","320873","320892","320944","320952","321019","321036","321187","321339",
166 "321359","321371","321447","321514","321807","321853","321874","321927","322166","322261","322338","322419","322718","322719","322720","322721","322725","322781","322782","322801","323308","323314","323502","323530","323531",
167 "323579","323613","323742","324030","324032","324138","324225","324296","324919","325141","325787","326234","326780","326875","327288","327438","327552","327579","327591","327595","327616","327620"
168 */
169  "315812", "315984", "316826", "317116", "317193", "317268", "317271", "317273", "317363", "317444", "317606",
170  "317607", "317609", "317610", "317611", "317612", "317613", "317617", "317785", "318758", "319198", "319401",
171  "319517", "319519", "319520", "319564", "319612", "319734", "319771", "319774", "319857", "319969", "320117",
172  "320158", "320203", "320205", "320348", "320579", "320873", "320892", "320952", "321019", "321036", "321187",
173  "321339", "321359", "321371", "321447", "321514", "321853", "321874", "322781", "322782", "323314", "323502",
174  "323579", "323613", "323742", "324030", "324032", "324138", "324225", "324296", "324919", "325141", "325787",
175  "326234", "326780", "326875", "327288", "327438", "327552", "327579"
176 
178 
179  // 2018 shunt1:
180  // "310244","310387","310587","310650"
181  //
182  // "309880"
183 
184  };
185  cout << "********************************************************************* first massives defined " << endl;
187  /*
188  // 2017 HEP17 shunt6
189  1., 4., 10., 18., 21., 30., 31., 32., 33., 46.,
190  54., 97., 98., 106., 128., 130., 132., 142., 149., 152.,
191  156., 164.
192 */
193  Float_t X0M[NMAXM] = {
194  // 2018 shunt6 led runs delta
195  /*
196  0., 2., 17., 22., 23., 24., 24., 24., 27., 28., 28., 28., 32., 32., 32., 32., 32., 32., 32., 32., 38., 42., 42., 45., 45.,
197  45., 51., 52., 58., 63., 65., 65., 65., 66., 68., 70., 71., 71., 72., 74., 77., 78., 79., 79., 80., 85., 90., 91., 92., 92.,
198  93., 93., 98., 101., 101., 101., 104., 106., 111., 112., 112., 114., 119., 121., 122., 123., 128., 128., 128., 128., 128., 129., 129., 130., 133.,
199  133., 134., 134., 138., 138., 141., 142., 142., 142., 143., 146., 150., 150., 151., 153., 155., 165., 169., 175., 175., 175., 176., 176., 177.,
200  179., 179., 183., 193., 195., 203., 205., 208., 209., 210., 210., 210., 210., 212., 212., 212.
201 */
202  /*
203  0., 2., 17., 22., 23., 24., 24., 24., 27., 28., 28., 28., 32., 32., 32., 32., 32., 32., 32., 32., 38., 45., 51., 52., 58.,
204  63., 65., 65., 65., 66., 68., 70., 71., 71., 72., 74., 77., 78., 79., 79., 80., 85., 90., 91., 92., 92., 93., 93., 98., 101.,
205  101., 101., 104., 106., 111., 112., 112., 114., 119., 121., 122., 123., 128., 128., 128., 128., 128., 129., 129., 130., 138., 138., 141., 142., 142.,
206  142., 143., 146., 150., 150., 151., 153., 155., 165., 169., 179., 183., 193., 195., 203., 205., 208., 209., 210., 210., 210., 210.,
207 */
208 
209  0., 2., 17., 22., 23., 24., 24., 24., 27., 29., 32., 32., 32., 32., 32., 32., 32., 32., 38.,
210  51., 58., 63., 65., 65., 65., 66., 68., 70., 71., 71., 72., 74., 77., 78., 79., 79., 80., 85.,
211  90., 91., 92., 93., 93., 98., 101., 101., 101., 104., 106., 112., 112., 129., 129., 138., 141., 142., 143.,
212  146., 150., 150., 151., 153., 155., 165., 169., 179., 183., 193., 195., 203., 205., 208., 209.
213 
214  /*
215  // 2018 shunt6
216 // 1., 2., 8., 9., 10.,
217 // 13., 14., 20., 23., 25.,
218 // 31., 34., 39., 41.
219 
220 
221  // 2018 all 553
222  1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25.,
223  26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38., 39., 40., 41., 42., 43., 44., 45., 46., 47., 48., 49., 50.,
224  51., 52., 53., 54., 55., 56., 57., 58., 59., 60., 61., 62., 63., 64., 65., 66., 67., 68., 69., 70., 71., 72., 73., 74., 75.,
225  76., 77., 78., 79., 80., 81., 82., 83., 84., 85., 86., 87., 88., 89., 90., 91., 92., 93., 94., 95., 96., 97., 98., 99., 100.,
226  101., 102., 103., 104., 105., 106., 107., 108., 109., 110., 111., 112., 113., 114., 115., 116., 117., 118., 119., 120., 121., 122., 123., 124., 125.,
227  126., 127., 128., 129., 130., 131., 132., 133., 134., 135., 136., 137., 138., 139., 140., 141., 142., 143., 144., 145., 146., 147., 148., 149., 150.,
228  151., 152., 153., 154., 155., 156., 157., 158., 159., 160., 161., 162., 163., 164., 165., 166., 167., 168., 169., 170., 171., 172., 173., 174., 175.,
229  176., 177., 178., 179., 180., 181., 182., 183., 184., 185., 186., 187., 188., 189., 190., 191., 192., 193., 194., 195., 196., 197., 198., 199., 200.,
230  201., 202., 203., 204., 205., 206., 207., 208., 209., 210., 211., 212., 213., 214., 215., 216., 217., 218., 219., 220., 221., 222., 223., 224., 225.,
231  226., 227., 228., 229., 230., 231., 232., 233., 234., 235., 236., 237., 238., 239., 240., 241., 242., 243., 244., 245., 246., 247., 248., 249., 250.,
232  251., 252., 253., 254., 255., 256., 257., 258., 259., 260., 261., 262., 263., 264., 265., 266., 267., 268., 269., 270., 271., 272., 273., 274., 275.,
233  276., 277., 278., 279., 280., 281., 282., 283., 284., 285., 286., 287., 288., 289., 290., 291., 292., 293., 294., 295., 296., 297., 298., 299., 300.,
234  301., 302., 303., 304., 305., 306., 307., 308., 309., 310., 311., 312., 313., 314., 315., 316., 317., 318., 319., 320., 321., 322., 323., 324., 325.,
235  326., 327., 328., 329., 330., 331., 332., 333., 334., 335., 336., 337., 338., 339., 340., 341., 342., 343., 344., 345., 346., 347., 348., 349., 350.,
236  351., 352., 353., 354., 355., 356., 357., 358., 359., 360., 361., 362., 363., 364., 365., 366., 367., 368., 369., 370., 371., 372., 373., 374., 375.,
237  376., 377., 378., 379., 380., 381., 382., 383., 384., 385., 386., 387., 388., 389., 390., 391., 392., 393., 394., 395., 396., 397., 398., 399., 400.,
238  401., 402., 403., 404., 405., 406., 407., 408., 409., 410., 411., 412., 413., 414., 415., 416., 417., 418., 419., 420., 421., 422., 423., 424., 425.,
239  426., 427., 428., 429., 430., 431., 432., 433., 434., 435., 436., 437., 438., 439., 440., 441., 442., 443., 444., 445., 446., 447., 448., 449., 450.,
240  451., 452., 453., 454., 455., 456., 457., 458., 449., 460., 461., 462., 463., 464., 465., 466., 467., 468., 469., 470., 471., 472., 473., 474., 475.,
241  476., 477., 478., 479., 480., 481., 482., 483., 484., 485., 486., 487., 488., 489., 490., 491., 492., 493., 494., 495., 496., 497., 498., 499., 500.,
242  501., 502., 503., 504., 505., 506., 507., 508., 509., 510., 511., 512., 513., 514., 515., 516., 517., 518., 519., 520., 521., 522., 523., 524., 525.,
243  526., 527., 528., 529., 530., 531., 532., 533., 534., 535., 536., 537., 538., 539., 540., 541., 542., 543., 544., 545., 546., 547., 548., 549., 550.,
244  551., 552., 553.
245 
246 
247 
249 
250  // 2018 shunt1:
251  // 1., 7., 11., 31.
252 
253  //850.,900.,950.,1000.,1050.,1100.,1150.,1200.
254 */
255  }; // days of year time points (abscissa) !!!
256  /*
257  // Float_t X0M[NMAXM];
258  for(int kk1 = 0; kk1<NMAXM; kk1++){
259  // X0M[kk1] = kk1+1.;
260  ++X0M[kk1];// delta+1
261  }//
262 */
263  cout << "********************************************************************* both massives are defined " << endl;
264  //______________________________________________________________________________________________________________________________ TEST
265  //______________________________________________________________________________________________________________________________ TEST
266  //______________________________________________________________________________________________________________________________ TEST
267  //______________________________________________________________________________________________________________________________ TEST
268  /*
269  const Int_t NMAXM =1;//
270  TString LEDrunsM[NMAXM] = {
271  // "309445"
272  "309714"
273  };
275  Float_t X0M[NMAXM] = {
276  1.
277  };// days of year time points (abscissa) !!!
278 */
286  //______________________________________________________________________________
287  //______________________________________________________________________________
288  //______________________________________________________________________________
289  //______________________________________________________________________________
290  // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
291  // 2018 only: yearcase=0 for test
292 
293  // 2016 only: yearcase=1
294  // 2017 only: yearcase=2
295  // 20167 : yearcase=3
296  // 2018 only: yearcase=4
297  // 201678 : yearcase=5
298 
299  //define yearcase:
300  // ____________________________________________________________________________ THIS line below is MAIN to make a yearcase selection !!!!!!!!!!!!!!!!!!!!!!!!!!
301  const Int_t yearcase = 0;
302  //
303  cout << "************************************** yearcase = " << yearcase << endl;
304  // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
305  // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
306  // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
307  // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
308  // Int_t verbosity = 2;//
309  // Int_t verbosity = 3;//
310  // Int_t verbosity = 4;// to clarify # channels in HEP17
311  Int_t verbosity = 0; //
312  // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
313 
314  const Int_t flagHEP17selection = 2; // -> ALL channels w/o bad ones (was used for final !!! result)
315  // const Int_t flagHEP17selection = 1;// ==1 HEP17;
316  // const Int_t flagHEP17selection = 0;// -> ALL channels (used to see 2D plots of bad channels)
317 
318  cout << "************************************** flagHEP17selection = " << flagHEP17selection << endl;
319  // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
320  //______________________________________________________________________________
321 
322  //______________________________________________________________________________
323  //______________________________________________________________________________
324  //
325  //---=[ SetCanvasDef ]=----------------
326  // Create a new canvas.
327  //TCanvas *c1 = new TCanvas("c1","GSM",10,10,900,700);
328 
329  //TCanvas *c1 = new TCanvas("c1","GSM",20,50,920,850);
330  TCanvas* c1 = new TCanvas("c1", "GSM", 10, 10, 1010, 1010);
331 
332  //TCanvas *c1 = new TCanvas("c1","GSM",200,10,700,900);
333  //TCanvas *c1 = new TCanvas("c1","Hcal4test",200,10,700,900);
334 
335  c1->Range(0, 0, 25, 18);
336  //c1->SetFillColor(40);
337  c1->SetFillColor(0);
338  c1->Clear();
339 
340  TLatex* t = new TLatex();
341  t->SetTextFont(32);
342  //t->SetTextColor(4);
343  t->SetTextSize(0.03);
344  t->SetTextAlign(12);
345  //______________________________________________________________________________
346  t->DrawLatex(
347  0.9, 15.5, "Time dependence of full Amplitude averaged over events of each LED run for some random HE channels");
348 
349  //-----------------------------------------------------------------------------------------------------
350  //
351  // x1 y1 x2 y2
352  // pad1->DrawFrame(1, 0.8, 370, 1.2);// all
353 
354  //
355  // Float_t x1=0.00; Float_t x2=170.00;
356  // Float_t x1=0.00; Float_t x2=850.00;
357 
358  // Float_t x1=0.00; Float_t x2=45.00;
359  Float_t x1 = 0.00;
360  Float_t x2 = 215.0;
361 
362  // y(ordinate) for All Days
363  // Float_t y1=0.985; Float_t y2= 1.015;
364  Float_t y1 = 0.9;
365  Float_t y2 = 1.1;
366 
367  //
368  // x(abscissa) for Days
369  Float_t RrangeMIN = y1;
370  Float_t RrangeMAX = y2;
371 
372  //
373  Float_t xx1 = 0.35;
374  Float_t xx2 = 0.55;
375  Float_t yy1 = 0.76;
376  Float_t yy2 = 0.88;
377  //
378  cout << "************************************** RrangeMIN = " << RrangeMIN << " RrangeMAX = " << RrangeMAX << endl;
379 
380  //-----------------------------------------------------------------------------------------------------
381  //-----------------------------------------------------------------------------------------------------
383  const Int_t NDEP = 8;
384  const Int_t NETA0 = 83;
385  const Int_t NPHI0 = 73;
386  //
387  Double_t mapRATIO[NDEP][NETA0][NPHI0];
388  Double_t mapRATIOD2[NETA0][NPHI0];
389  Int_t mapRATIOD20[NETA0][NPHI0];
390 
391  //Double_t normalization[NDEP][NETA0][NPHI0];
392  Double_t normalization[NETA0][NPHI0];
393  cout << "************************************** NDEP = " << NDEP << " NETA0 = " << NETA0 << " NPHI0 = " << NPHI0
394  << endl;
395 
396  // define max size of massives (to be just NMAXSIZE ):
397  Int_t NMAXSIZE = NMAXM;
398  Float_t X0[NMAXSIZE];
399  TString LEDruns[NMAXSIZE];
400  Double_t XX[NMAXSIZE];
401  Double_t XXE[NMAXSIZE];
402  Double_t XXX[NMAXSIZE];
403  Double_t XXXE[NMAXSIZE];
404  Int_t indWAS[NMAXSIZE];
405 
406  Double_t YY[NMAXSIZE];
407  Double_t YYE[NMAXSIZE];
408  cout << "************************************** NMAXSIZE = " << NMAXSIZE << " NMAXM = " << NMAXM << endl;
409  //----------------------------------------------------------------------
410 
411  Double_t GSMRATIOD2[NMAXSIZE][NETA0][NPHI0];
412 
416  // define where to run inside massives above:
417  // yearcase=0
418  Int_t NMINmM = 0;
419  Int_t NMAXmM = NMAXSIZE - 1;
420  Int_t NMAXaM = NMAXSIZE;
421  if (yearcase == 1) {
422  // 2016 only: yearcase=1
423  NMINmM = 0;
424  NMAXmM = 46;
425  NMAXaM = 47; // M
426  } else if (yearcase == 2) {
427  // 2017 only:: yearcase=2
428  NMINmM = 53;
429  NMAXmM = 93;
430  NMAXaM = 41; // M
431  } else if (yearcase == 3) {
432  // 20167 only:: yearcase=3
433  NMINmM = 0;
434  NMAXmM = 93;
435  NMAXaM = 94; // M
436  } else if (yearcase == 4) {
437  // 2018 only:: yearcase=4
438  NMINmM = 94;
439  NMAXmM = -1;
440  NMAXaM = -1; // M
441  } else if (yearcase == 5) {
442  // 20168 only:: yearcase=5
443  NMINmM = 0;
444  NMAXmM = -1;
445  NMAXaM = -1; // M
446  }
447 
448  cout << "************************************** NMINmM = " << NMINmM << " NMAXmM = " << NMAXmM
449  << " NMAXaM = " << NMAXaM << endl;
450  if (NMINmM == -1 || NMAXmM == -1 || NMAXaM == -1)
451  cout << " STOP !!!!!! NMINmM == -1 || NMAXmM == -1 || NMAXaM == -1 " << endl;
453  Int_t NMAX = 0;
454  NMAX = NMAXaM;
455  // cout << "NMAX= " << NMAX << "NMINmM= " << NMINmM << "NMAXmM= " << NMAXmM <<endl;
456  for (int jjj = NMINmM; jjj <= NMAXmM; jjj++) {
457  LEDruns[jjj - NMINmM] = LEDrunsM[jjj];
458  X0[jjj - NMINmM] = X0M[jjj];
459  // cout << "jjj= " << jjj << " jjj-NMINmM= " << jjj-NMINmM << " LEDrunsM[jjj]= " << LEDrunsM[jjj] << " X0M[jjj]= " << X0M[jjj] <<endl;
460  }
462  //========================================================================================================================
463  //---------------------------------------------------------------------------------------------------------------------
464  //---------------------------------------------------------------------------------------------------------------------
465  // Int_t NP = 22; // for loop over time points(LED runs) NMAX is number of LED runs(time abscissa)
466  Int_t NP = NMAX; // for loop over time points(LED runs) NMAX is number of LED runs(time abscissa)
467  cout << "******************* NP = " << NP << endl;
468  //
469  //--------------------------------------------------------------------------------------------------------------------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
470  // take into account for future treatment only channels with <Aijk>_runevents within cutMinA to cutMaxA:
471  // Double_t cutMinA =400.; Double_t cutMaxA = 1200.; // HPD HE only
472 
473  // Double_t cutMinA =0.; Double_t cutMaxA = 999999999999.;
474  Double_t cutMinA = 50000.;
475  Double_t cutMaxA = 150000.;
476  // Double_t cutMinA =50000.; Double_t cutMaxA = 350000.;
477 
478  // Double_t cutMinA =9000.; Double_t cutMaxA = 40000.;
479  //
480  // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
481  //---------------------------------------------------------------------------------------------------------------------
482  //------------------------------------ define DELTA (days) of current point wrt first point
483  for (int kk1 = 0; kk1 < NP; kk1++) {
484  XX[kk1] = X0[kk1];
485  int k10 = 0;
486  int z1 = X0[k10];
487  XX[kk1] -= z1;
488  if (verbosity == 2) {
489  cout << "ORDINATE points: kk1 = " << kk1 << " XX[kk1]= " << XX[kk1] << endl;
490  }
491 
492  XXE[kk1] = 0.001 * XX[kk1];
493  } //XXE - errors at fit
494  //-----------------------------------------------------------------------------------------------------
495 
496  //----------------------------------------------------------------------------------------------------
497  //----------------------------------------------------------------------------------------------------
499  for (int jjj = 0; jjj <= 82; jjj++) {
500  for (int kkk = 0; kkk <= 72; kkk++) {
501  mapRATIOD2[jjj][kkk] = 0.;
502  mapRATIOD20[jjj][kkk] = 0.;
503  normalization[jjj][kkk] = 0.;
504 
505  for (int k1 = 0; k1 < NP; k1++) {
506  GSMRATIOD2[k1][jjj][kkk] = mapRATIOD2[jjj][kkk];
507  }
508 
509  for (int iii = 0; iii < NDEP; iii++) {
510  mapRATIO[iii][jjj][kkk] = 0.;
511  // normalization[iii][jjj][kkk] = 0.;
512  }
513 
514  } // for
515  } // for
516 
518 
519  //______________________________________________________________________________
520  // ls -latr /afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LED_* | less
521 
522  TString fname = "/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LED_";
523  // TString fname = "/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LASER_";
524 
525  // booking:
526  TH1F* Seff1D = new TH1F("Seff1D", "", 1000, 10., 100010.);
527  TH1F* Ceff1D = new TH1F("Ceff1D", "", 1500, 10., 500010.);
528  // TH1F* Seff1D = new TH1F("Seff1D","", 1000, 0.,100000.);
529  // TH1F* Ceff1D = new TH1F("Ceff1D","", 1500, 0.,1500000.);
530  // led shunt1 low-intensity Gsel0:
531  // TH1F* Seff1D = new TH1F("Seff1D","", 1000, 0.,1000.);
532  // TH1F* Ceff1D = new TH1F("Ceff1D","", 350, 0.,350.);
533 
534  TH2F* mapBADchannels = new TH2F("mapBADchannels", " ", 82, -41., 41., 72, 0., 72.);
535  TH2F* mapBADchannels0 = new TH2F("mapBADchannels0", " ", 82, -41., 41., 72, 0., 72.);
536 
537  TH2F* mapchannelsdepth1 = new TH2F("mapchannelsdepth1", " ", 82, -41., 41., 72, 0., 72.);
538  TH2F* mapchannelsdepth2 = new TH2F("mapchannelsdepth2", " ", 82, -41., 41., 72, 0., 72.);
539  TH2F* mapchannelsdepth3 = new TH2F("mapchannelsdepth3", " ", 82, -41., 41., 72, 0., 72.);
540  TH2F* mapchannelsdepth4 = new TH2F("mapchannelsdepth4", " ", 82, -41., 41., 72, 0., 72.);
541  TH2F* mapchannelsdepth5 = new TH2F("mapchannelsdepth5", " ", 82, -41., 41., 72, 0., 72.);
542  TH2F* mapchannelsdepth6 = new TH2F("mapchannelsdepth6", " ", 82, -41., 41., 72, 0., 72.);
543  TH2F* mapchannelsdepth7 = new TH2F("mapchannelsdepth7", " ", 82, -41., 41., 72, 0., 72.);
544 
545  TH1F* gainkoeff = new TH1F("gainkoeff", "", 100, y1, y2);
546  TH1F* gainkoeff0 = new TH1F("gainkoeff0", "", 100, 0.9, 1.1);
547  TH1F* gainkoeff9 = new TH1F("gainkoeff9", "", 100, 0.1, 1.9);
548  TH1F* GOODruns = new TH1F("GOODruns", "", NP, 0., float(NP));
549  TH1F* BADruns = new TH1F("BADruns", "", NP, 0., float(NP));
550  TH1F* NotEmptyDepthes = new TH1F("NotEmptyDepthes", "", 56, 0., 56.);
551 
553  Int_t kmm = 0;
554  Int_t firstrun = 0;
555  // Int_t firstrun=1;
556  // Int_t firstrun=2; //
557  // Int_t firstrun=3;
558  // Int_t firstrun=4;
559  // Int_t firstrun=5;
560 
561  // Int_t firstrun=6;
562  // Int_t firstrun=54;
563  // Int_t firstrun=347;
564 
565  // Int_t firstrun=7;
566  // Int_t firstrun=8;
567  // Int_t firstrun=9;
568  //
569  cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! firstrun = " << firstrun << " run = " << LEDruns[firstrun] << endl;
570 
574 
576  // cout << "!!!!!!!!!!!!!!!!!!!!!! use root files from official RMT dir. " <<endl;
577  cout << "!!!!!!!!!!!!!!!!!!!!!! use root files from my shunt6 dir. " << endl;
578  //cout << "!!!!!!!!!!!!!!!!!!!!!! use root files from my shunt1 dir. " <<endl;
580 
581  // TH1F* Aeff1D = new TH1F("Aeff1D","", 300, 0.,300.);
582  TH1F* Aeff1D = new TH1F("Aeff1D", "", 200, 0., 2000000.);
583  int ck1count = 0;
584  for (int k1 = firstrun; k1 < NP; k1++) {
585  // for(int k1 = 0; k1<NP; k1++) {
586  ck1count++;
588  // my dir.
589  // TString epsName = "rootshunt6/LEDtest" + LEDruns[k1] + ".root";
590  // TString epsName = "rootshunt1/LEDtest" + LEDruns[k1] + ".root";
591 
592  // if(k1 > 21) {epsName = fname + LEDruns[k1] + ".root";}// 2018 shunt1
593  // TString epsName = "rootshunt1/LEDtest" + LEDruns[k1] + ".root";
594 
595  /*
596  TString epsName;
597  if(k1 < 0) {epsName = "rootshunt6/LEDtest" + LEDruns[k1] + ".root";}// was used: shunt6 for HEP17 2017 channels !!!
598  if(k1 == 0) {epsName = "rootshunt1/LEDtest" + LEDruns[k1] + ".root";}
599  if(k1 == 1) {epsName = "rootshunt6/LEDtest" + LEDruns[k1] + ".root";}
600 */
601  // TString epsName = "LEDtest" + LEDruns[k1] + ".root";
602 
603  // TString epsName = "LEDtest309714.root";
604  // TString epsName = "LEDtest307971NEW.root";
605 
606  // RMT:
607  TString epsName = fname + LEDruns[k1] + ".root";
608 
610 
611  TFile* hfile = new TFile(epsName, "READ");
612  // cout << "!!!! read LED run with k1= " << k1 <<" run: " << LEDruns[k1] <<endl;
613 
614  // display existing histoes: preparation for plotting all runs into Aeff1D
615  // TH1F * Aeff1= (TH1F*)hfile->Get("h_ADCAmpl_HE");
616  // h_ADCAmpl345Zoom_HE = new TH1F("h_ADCAmpl345Zoom_HE"," ", 300, 0.,300.);
617  // h_ADCAmpl345Zoom1_HE = new TH1F("h_ADCAmpl345Zoom1_HE"," ", 200, 0.,1200.);
618  // h_ADCAmplZoom1_HE = new TH1F("h_ADCAmplZoom1_HE"," ", 500, 0.,500.);
619 
620  // TH1F * Aeff1= (TH1F*)hfile->Get("h_ADCAmpl345Zoom_HE");
621  // TH1F * Aeff1= (TH1F*)hfile->Get("h_ADCAmpl345Zoom1_HE");
622  // TH1F * Aeff1= (TH1F*)hfile->Get("h_ADCAmplZoom1_HE");
623  TH1F* Aeff1 = (TH1F*)hfile->Get("h_ADCAmpl_HE");
624 
625  int kx = Aeff1->GetXaxis()->GetNbins();
626  // cout <<"BEGINNING k1= " << k1 <<" kx= " << kx <<endl;
627  int maxvalueA = -1;
628  for (int jjj = 0; jjj < kx; jjj++) {
629  if (double(Aeff1->GetBinContent(jjj)) > 0. && maxvalueA < jjj)
630  maxvalueA = jjj;
631  // cout <<" k1= " << k1 <<" jjj= " << jjj <<" content= " << Aeff1->GetBinContent(jjj) <<endl;
632  Aeff1D->Fill(float(jjj), double(Aeff1->GetBinContent(jjj)));
633  } // for
634  cout << " run = " << LEDruns[k1] << " k1= " << k1 << " max bin value= " << maxvalueA << " ck1count= " << ck1count
635  << endl;
636 
637  //
638  //
639  // display last-run existing histoes:
640  if (k1 == NP - 1) {
641  c1->Clear();
642  c1->Divide(1, 1);
643  c1->cd(1);
644  gPad->SetGridy();
645  gPad->SetGridx();
646  gPad->SetLogy();
647  gStyle->SetOptStat(101110);
648  Aeff1->SetMarkerStyle(20);
649  Aeff1->SetMarkerSize(0.4);
650  Aeff1->GetYaxis()->SetLabelSize(0.04);
651  // Aeff1->SetTitle("Last run & events & channels");
652  Aeff1->SetXTitle("Aijk");
653  Aeff1->SetYTitle("N");
654  Aeff1->SetMarkerColor(4);
655  Aeff1->SetLineColor(4);
656  Aeff1->SetMinimum(0.8);
657  Aeff1->Draw("PL");
658  c1->Update();
659  TString fdir = "testamt0shunt6gsm2018/";
660  // TString plotName = fdir + "Aijk.png";
661  TString plotName = fdir + "Aijk-Run" + LEDruns[k1] + ".png";
662  c1->SaveAs(plotName);
663  cout << "****PLOT AijkLastRun.png is drawn **** " << endl;
664  }
665  // display first runt existing histoes:
666  // if(k1== 0 ) {
667  if (k1 == firstrun) {
668  c1->Clear();
669  c1->Divide(1, 1);
670  c1->cd(1);
671  gPad->SetGridy();
672  gPad->SetGridx();
673  // gPad->SetLogy();
674  gStyle->SetOptStat(101110);
675  Aeff1->SetMarkerStyle(20);
676  Aeff1->SetMarkerSize(0.4);
677  Aeff1->GetYaxis()->SetLabelSize(0.04);
678  Aeff1->SetTitle("First run & events & channels");
679  Aeff1->SetXTitle("Aijk");
680  Aeff1->SetYTitle("N");
681  Aeff1->SetMarkerColor(4);
682  Aeff1->SetLineColor(4);
683  Aeff1->SetMinimum(0.8);
684  Aeff1->Draw("PL");
685  c1->Update();
686  TString fdir = "testamt0shunt6gsm2018/";
687  TString plotName = fdir + "AijkFirstRun.png";
688  c1->SaveAs(plotName);
689  cout << "****PLOT AijkLAST.png is drawn **** " << endl;
690  }
691  // 000000000000000000000000000000000000000000000000000000000000000000000000
692  // TH2F *twod1= (TH2F*)hfile->Get("h_mapDepth1ADCAmpl");
693  // TH2F *twod2= (TH2F*)hfile->Get("h_mapDepth2ADCAmpl");
694  // TH2F *twod3= (TH2F*)hfile->Get("h_mapDepth3ADCAmpl");
695  // 111111111111111111111111111111111111111111111111111111111111111111111111
696  // h_mapDepth1ADCAmpl12 means ADCcounts(massive) within -1 max +1 +2
697 
698  /*
699  TH2F *twod1= (TH2F*)hfile->Get("h_mapDepth1ADCAmpl12_HE");
700  TH2F *twod2= (TH2F*)hfile->Get("h_mapDepth2ADCAmpl12_HE");
701  TH2F *twod3= (TH2F*)hfile->Get("h_mapDepth3ADCAmpl12_HE");
702 */
703  // HEP17 of 2017:
704  // TH2F *twod1= (TH2F*)hfile->Get("h_mapDepth1ADCAmpl12SiPM_HE");
705  // TH2F *twod2= (TH2F*)hfile->Get("h_mapDepth2ADCAmpl12SiPM_HE");
706  // TH2F *twod3= (TH2F*)hfile->Get("h_mapDepth3ADCAmpl12SiPM_HE");
707  // all:
708 
709  TH2F* twod1 = (TH2F*)hfile->Get("h_mapDepth1ADCAmpl12_HE");
710  TH2F* twod2 = (TH2F*)hfile->Get("h_mapDepth2ADCAmpl12_HE");
711  TH2F* twod3 = (TH2F*)hfile->Get("h_mapDepth3ADCAmpl12_HE");
712 
713  TH2F* twod4 = (TH2F*)hfile->Get("h_mapDepth4ADCAmpl12_HE");
714  TH2F* twod5 = (TH2F*)hfile->Get("h_mapDepth5ADCAmpl12_HE");
715  TH2F* twod6 = (TH2F*)hfile->Get("h_mapDepth6ADCAmpl12_HE");
716  TH2F* twod7 = (TH2F*)hfile->Get("h_mapDepth7ADCAmpl12_HE");
717 
718  // all TS bins:
719  // TH2F *twod1= (TH2F*)hfile->Get("h_mapDepth1ADCAmpl_HE");
720  // TH2F *twod2= (TH2F*)hfile->Get("h_mapDepth2ADCAmpl_HE");
721  // TH2F *twod3= (TH2F*)hfile->Get("h_mapDepth3ADCAmpl_HE");
722 
723  // TH2F *twod4= (TH2F*)hfile->Get("h_mapDepth4ADCAmpl_HE");
724  // TH2F *twod5= (TH2F*)hfile->Get("h_mapDepth5ADCAmpl_HE");
725  // TH2F *twod6= (TH2F*)hfile->Get("h_mapDepth6ADCAmpl_HE");
726  // TH2F *twod7= (TH2F*)hfile->Get("h_mapDepth7ADCAmpl_HE");
727 
728  int nx = twod1->GetXaxis()->GetNbins();
729  int ny = twod1->GetYaxis()->GetNbins();
730  // cout <<"BEGINNING k1= " << k1 <<" nx= " << nx <<" ny= " << ny <<endl;
731 
732  TH2F* t0010 = (TH2F*)hfile->Get("h_mapDepth1_HE");
733  TH2F* t0020 = (TH2F*)hfile->Get("h_mapDepth2_HE");
734  TH2F* t0030 = (TH2F*)hfile->Get("h_mapDepth3_HE");
735  TH2F* t0040 = (TH2F*)hfile->Get("h_mapDepth4_HE");
736  TH2F* t0050 = (TH2F*)hfile->Get("h_mapDepth5_HE");
737  TH2F* t0060 = (TH2F*)hfile->Get("h_mapDepth6_HE");
738  TH2F* t0070 = (TH2F*)hfile->Get("h_mapDepth7_HE");
739 
740  TH2F* Ceff1 = (TH2F*)twod1->Clone("Ceff1");
741  TH2F* Ceff2 = (TH2F*)twod2->Clone("Ceff2");
742  TH2F* Ceff3 = (TH2F*)twod3->Clone("Ceff3");
743  TH2F* Ceff4 = (TH2F*)twod4->Clone("Ceff4");
744  TH2F* Ceff5 = (TH2F*)twod5->Clone("Ceff5");
745  TH2F* Ceff6 = (TH2F*)twod6->Clone("Ceff6");
746  TH2F* Ceff7 = (TH2F*)twod7->Clone("Ceff7");
747 
748  // <Aijk>_runevents:
749  Ceff1->Divide(twod1, t0010, 1, 1, "B");
750  Ceff2->Divide(twod2, t0020, 1, 1, "B");
751  Ceff3->Divide(twod3, t0030, 1, 1, "B");
752  Ceff4->Divide(twod4, t0040, 1, 1, "B");
753  Ceff5->Divide(twod5, t0050, 1, 1, "B");
754  Ceff6->Divide(twod6, t0060, 1, 1, "B");
755  Ceff7->Divide(twod7, t0070, 1, 1, "B");
756  // Ceff1->Sumw2();Ceff2->Sumw2();Ceff3->Sumw2();
758  for (int jjj = 0; jjj < nx; jjj++) {
759  for (int kkk = 0; kkk < ny; kkk++) {
760  // HEP17 selection:
761  if (flagHEP17selection == 0 ||
762  (flagHEP17selection == 1 && (((jjj > 56 && jjj < 62) && (kkk > 63 && kkk < 68)) ||
763  ((jjj > 61 && jjj < 71) && (kkk == 64 || kkk == 66)))) ||
764  (flagHEP17selection == 2 && !(((jjj > 14 && jjj < 25) && (kkk > 55 && kkk < 64))))) {
765  // if(Ceff1->GetBinContent(jjj,kkk) !=0.) cout <<" k1=111111 " << k1 <<" eta= " << jjj <<" phi= " << kkk <<" Ceff1= " << Ceff1->GetBinContent(jjj,kkk) <<endl;
766  // if(Ceff7->GetBinContent(jjj,kkk) !=0.) cout <<" k1=77777777777 " << k1 <<" eta= " << jjj <<" phi= " << kkk <<" Ceff7= " << Ceff7->GetBinContent(jjj,kkk) <<endl;
767  if (Ceff1->GetBinContent(jjj, kkk) > 0.)
768  mapchannelsdepth1->Fill(double(jjj) - 41., double(kkk), Ceff1->GetBinContent(jjj, kkk));
769  if (Ceff2->GetBinContent(jjj, kkk) > 0.)
770  mapchannelsdepth2->Fill(double(jjj) - 41., double(kkk), Ceff2->GetBinContent(jjj, kkk));
771  if (Ceff3->GetBinContent(jjj, kkk) > 0.)
772  mapchannelsdepth3->Fill(double(jjj) - 41., double(kkk), Ceff3->GetBinContent(jjj, kkk));
773  if (Ceff4->GetBinContent(jjj, kkk) > 0.)
774  mapchannelsdepth4->Fill(double(jjj) - 41., double(kkk), Ceff4->GetBinContent(jjj, kkk));
775  if (Ceff5->GetBinContent(jjj, kkk) > 0.)
776  mapchannelsdepth5->Fill(double(jjj) - 41., double(kkk), Ceff5->GetBinContent(jjj, kkk));
777  if (Ceff6->GetBinContent(jjj, kkk) > 0.)
778  mapchannelsdepth6->Fill(double(jjj) - 41., double(kkk), Ceff6->GetBinContent(jjj, kkk));
779  if (Ceff7->GetBinContent(jjj, kkk) > 0.)
780  mapchannelsdepth7->Fill(double(jjj) - 41., double(kkk), Ceff7->GetBinContent(jjj, kkk));
781  } // if HEP17 selection
782  } // for
783  } // for
785  // }
786 
787  //
788  //
789  // fill:
790  // fill massive <Aijk>_runevents , where iii=depth, jjj=eta, kkk=phi
791  for (int jjj = 0; jjj < nx; jjj++) {
792  for (int kkk = 0; kkk < ny; kkk++) {
793  //
794  // HEP17 selection:
795  if (flagHEP17selection == 0 ||
796  (flagHEP17selection == 1 && (((jjj > 56 && jjj < 62) && (kkk > 63 && kkk < 68)) ||
797  ((jjj > 61 && jjj < 71) && (kkk == 64 || kkk == 66)))) ||
798  (flagHEP17selection == 2 && !(((jjj > 14 && jjj < 25) && (kkk > 55 && kkk < 64))))) {
799  // FILL NEW PLOTS:
800  // Aijk: Ceff1D & Seff1D plots
801  if (Ceff1->GetBinContent(jjj, kkk) != 0.) {
802  Ceff1D->Fill(Ceff1->GetBinContent(jjj, kkk));
803  Seff1D->Fill(Ceff1->GetBinContent(jjj, kkk));
804  }
805  if (Ceff2->GetBinContent(jjj, kkk) != 0.) {
806  Ceff1D->Fill(Ceff2->GetBinContent(jjj, kkk));
807  Seff1D->Fill(Ceff2->GetBinContent(jjj, kkk));
808  }
809  if (Ceff3->GetBinContent(jjj, kkk) != 0.) {
810  Ceff1D->Fill(Ceff3->GetBinContent(jjj, kkk));
811  Seff1D->Fill(Ceff3->GetBinContent(jjj, kkk));
812  }
813  if (Ceff4->GetBinContent(jjj, kkk) != 0.) {
814  Ceff1D->Fill(Ceff4->GetBinContent(jjj, kkk));
815  Seff1D->Fill(Ceff4->GetBinContent(jjj, kkk));
816  }
817  if (Ceff5->GetBinContent(jjj, kkk) != 0.) {
818  Ceff1D->Fill(Ceff5->GetBinContent(jjj, kkk));
819  Seff1D->Fill(Ceff5->GetBinContent(jjj, kkk));
820  }
821  if (Ceff6->GetBinContent(jjj, kkk) != 0.) {
822  Ceff1D->Fill(Ceff6->GetBinContent(jjj, kkk));
823  Seff1D->Fill(Ceff6->GetBinContent(jjj, kkk));
824  }
825  if (Ceff7->GetBinContent(jjj, kkk) != 0.) {
826  Ceff1D->Fill(Ceff7->GetBinContent(jjj, kkk));
827  Seff1D->Fill(Ceff7->GetBinContent(jjj, kkk));
828  }
829  } //if
830  }
831  }
832 
833  //--------------------------------------
834  // take into account for future treatment only HEP17 channels and cuts on <Aijk>_runevents within cutMinA to cutMaxA:
835  // apply cut on <Aijk>_runevents
836  // -41 +41
837  // 82 bins
838  for (int jjj = 0; jjj < nx; jjj++) {
839  for (int kkk = 0; kkk < ny; kkk++) {
840  // HEP17 selection:
841  if (flagHEP17selection == 0 ||
842  (flagHEP17selection == 1 && (((jjj > 56 && jjj < 62) && (kkk > 63 && kkk < 68)) ||
843  ((jjj > 61 && jjj < 71) && (kkk == 64 || kkk == 66)))) ||
844  (flagHEP17selection == 2 && !(((jjj > 14 && jjj < 25) && (kkk > 55 && kkk < 64))))) {
845  if (Ceff1->GetBinContent(jjj, kkk) > cutMinA && Ceff1->GetBinContent(jjj, kkk) < cutMaxA)
846  mapRATIO[1][jjj][kkk] = Ceff1->GetBinContent(jjj, kkk);
847  if (Ceff2->GetBinContent(jjj, kkk) > cutMinA && Ceff2->GetBinContent(jjj, kkk) < cutMaxA)
848  mapRATIO[2][jjj][kkk] = Ceff2->GetBinContent(jjj, kkk);
849  if (Ceff3->GetBinContent(jjj, kkk) > cutMinA && Ceff3->GetBinContent(jjj, kkk) < cutMaxA)
850  mapRATIO[3][jjj][kkk] = Ceff3->GetBinContent(jjj, kkk);
851  if (Ceff4->GetBinContent(jjj, kkk) > cutMinA && Ceff4->GetBinContent(jjj, kkk) < cutMaxA)
852  mapRATIO[4][jjj][kkk] = Ceff4->GetBinContent(jjj, kkk);
853  if (Ceff5->GetBinContent(jjj, kkk) > cutMinA && Ceff5->GetBinContent(jjj, kkk) < cutMaxA)
854  mapRATIO[5][jjj][kkk] = Ceff5->GetBinContent(jjj, kkk);
855  if (Ceff6->GetBinContent(jjj, kkk) > cutMinA && Ceff6->GetBinContent(jjj, kkk) < cutMaxA)
856  mapRATIO[6][jjj][kkk] = Ceff6->GetBinContent(jjj, kkk);
857  if (Ceff7->GetBinContent(jjj, kkk) > cutMinA && Ceff7->GetBinContent(jjj, kkk) < cutMaxA)
858  mapRATIO[7][jjj][kkk] = Ceff7->GetBinContent(jjj, kkk);
859  } //if
860  } // for
861  } // for
863  /*
864  // define A for refRun : k1=[0]
866  if(k1==firstrun && kmm==0 ) {
867  kmm=1; //Int_t mcount=0;
868  cout<<"* to be printed once only CHECK IT please ************ kmm = " << kmm <<endl;
869  for(int iii = 1; iii<4; iii++) {
870 // for (int jjj=1;jjj<=82;jjj++) {
871 // for (int kkk=1;kkk<=72;kkk++) {
872  for (int jjj=0;jjj<nx;jjj++) {
873  for (int kkk=0;kkk<ny;kkk++) {
874  normalization[iii][jjj][kkk] = mapRATIO[iii][jjj][kkk];
875  }//for
876  }//for
877  }//for
878  }// if(k1=firstrun
879 */
880  //--------------------------------------
881  // then, averaging over depthes, but first sum over depthes before!!! any dividing. Use mapRATIOD2[jjj][kkk] and mapRATIOD20[jjj][kkk]
883  int totalhep17count = 0;
884  int totalhep17count1 = 0;
885  int totalhep17count2 = 0;
886  int totalhep17count3 = 0;
887  int totalhep17count4 = 0;
888  int totalhep17count5 = 0;
889  int totalhep17count6 = 0;
890  int totalhep17count7 = 0;
891  for (int iii = 1; iii < NDEP; iii++) {
892  for (int jjj = 0; jjj < nx; jjj++) {
893  for (int kkk = 0; kkk < ny; kkk++) {
894  // for (int jjj=1;jjj<=82;jjj++) {
895  // for (int kkk=1;kkk<=72;kkk++) {
896  if (mapRATIO[iii][jjj][kkk] > 0) {
897  // calculate # channels in HEP17 for each depth:
898  totalhep17count++;
899  if (verbosity == 4 && k1 == 0) {
900  cout << " k1= " << k1 << " depth= " << iii << " eta= " << jjj << " phi= " << kkk
901  << " mapRATIO= " << mapRATIO[iii][jjj][kkk] << endl;
902  }
903  if (iii == 1)
904  totalhep17count1++;
905  if (iii == 2)
906  totalhep17count2++;
907  if (iii == 3)
908  totalhep17count3++;
909  if (iii == 4)
910  totalhep17count4++;
911  if (iii == 5)
912  totalhep17count5++;
913  if (iii == 6)
914  totalhep17count6++;
915  if (iii == 7)
916  totalhep17count7++;
917  // ---------------------------------------- sum over depthes before!!! any dividing:
918  mapRATIOD2[jjj][kkk] += mapRATIO[iii][jjj][kkk];
919  // count entries with digis only:
920  mapRATIOD20[jjj][kkk]++;
921  if (verbosity == 3 && iii == 3)
922  cout << " depth = " << iii << " k1 = " << k1 << " eta = " << jjj
923  << " mapRATIOD2[jjj][kkk] = " << mapRATIOD2[jjj][kkk] << " #entries = " << mapRATIOD20[jjj][kkk]
924  << " mapRATIO[iii][jjj][kkk] = " << mapRATIO[iii][jjj][kkk] << endl;
925  } // if mapRATIO[iii][jjj][kkk] != 0
926  } //for
927  } //for
928  } //for
929 
930  // ERROR printout !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
931  // if(totalhep17count != 184 ) {cout <<"!!!!!! ERROR:NOT ALL CHANNELS HEP17 INVOLEVED FOR RUN WITH k1= " << k1 <<" totalhep17count= " << totalhep17count <<endl;}
932 
933  if (verbosity == 4 && k1 == 0) {
934  cout << " k1= " << k1 << " totalhep17count= " << totalhep17count << endl;
935  cout << " k1= " << k1 << " totalhep17count1= " << totalhep17count1 << endl;
936  cout << " k1= " << k1 << " totalhep17count2= " << totalhep17count2 << endl;
937  cout << " k1= " << k1 << " totalhep17count3= " << totalhep17count3 << endl;
938  cout << " k1= " << k1 << " totalhep17count4= " << totalhep17count4 << endl;
939  cout << " k1= " << k1 << " totalhep17count5= " << totalhep17count5 << endl;
940  cout << " k1= " << k1 << " totalhep17count6= " << totalhep17count6 << endl;
941  cout << " k1= " << k1 << " totalhep17count7= " << totalhep17count7 << endl;
942  }
943 
946  Int_t depthAVERAGEcount = 0;
947  for (int jjj = 0; jjj < nx; jjj++) {
948  for (int kkk = 0; kkk < ny; kkk++) {
949  // for (int jjj=1;jjj<=82;jjj++) {
950  //for(int kkk=1;kkk<=72;kkk++) {
951  depthAVERAGEcount = 4 * (jjj - 57) + (kkk - 64);
952  if (mapRATIOD20[jjj][kkk] != 0) {
953  NotEmptyDepthes->Fill(float(depthAVERAGEcount));
954  if (verbosity == 1)
955  cout << "****aver per depthes********* phi = " << kkk << " RunIndex = " << k1 << " eta = " << jjj
956  << " #entries = " << mapRATIOD20[jjj][kkk] << endl;
957  mapRATIOD2[jjj][kkk] /= mapRATIOD20[jjj][kkk];
958  if (verbosity == 3 && kkk == 3)
959  cout << "****aver per depthes********* phi = " << jjj << " RunIndex = " << k1 << " eta = " << jjj
960  << " Nphi = " << mapRATIOD20[jjj][kkk] << endl;
961  } // if(mapRATIOD20 != 0
962  } //for kkk
963  } //for jjj
965  // define A for refRun : k1=[0]
967  if (k1 == firstrun && kmm == 0) {
968  kmm = 1; //Int_t mcount=0;
969  cout << "* to be printed once only CHECK IT please ************ kmm = " << kmm << endl;
970  // for (int jjj=1;jjj<=82;jjj++) {
971  // for (int kkk=1;kkk<=72;kkk++) {
972  for (int jjj = 0; jjj < nx; jjj++) {
973  for (int kkk = 0; kkk < ny; kkk++) {
974  normalization[jjj][kkk] = mapRATIOD2[jjj][kkk];
975  } //for
976  } //for
977  } // if(k1=firstrun
978  //--------------------------------------
981  // int etaphicount = 0;
982  // for (int jjj=1;jjj<=82;jjj++) {
983  // for (int kkk=1;kkk<=72;kkk++) {
984  for (int jjj = 0; jjj < nx; jjj++) {
985  for (int kkk = 0; kkk < ny; kkk++) {
986  if (normalization[jjj][kkk] != 0) {
987  GSMRATIOD2[k1][jjj][kkk] = mapRATIOD2[jjj][kkk] / normalization[jjj][kkk];
988  // plotting:
989  if (GSMRATIOD2[k1][jjj][kkk] < RrangeMAX && GSMRATIOD2[k1][jjj][kkk] > RrangeMIN) {
990  gainkoeff->Fill(GSMRATIOD2[k1][jjj][kkk]);
991  gainkoeff0->Fill(GSMRATIOD2[k1][jjj][kkk]);
992  gainkoeff9->Fill(GSMRATIOD2[k1][jjj][kkk]);
993  // printout
994  // etaphicount++;
995  // if(etaphicount > 30 ) cout <<"etaphicount = " << etaphicount << "for k1= " << k1 <<endl;
996  // if(etaphicount == 30 ) cout <<"etaphicount == 30 for k1= " << k1 <<endl;
997  // cout <<" k1= " << k1 <<" eta= " << jjj <<" phi= " << kkk <<endl;
998  GOODruns->Fill(float(k1)); // fill #channels w/ R inside unit
999  } else {
1000  if (GSMRATIOD2[k1][jjj][kkk] > 0.)
1001  BADruns->Fill(float(k1));
1002  } // fill #channels outside R unit
1003  // else{if(GSMRATIOD2[k1][jjj][kkk]>0.) BADruns->Fill(float(k1));}
1004 
1005  } // if(normalization[jjj][kkk] != 0
1006  } //for kkk
1007  } //for jjj
1008 
1009  //
1015  for (int jjj = 0; jjj <= 82; jjj++) {
1016  for (int kkk = 0; kkk <= 72; kkk++) {
1017  mapRATIOD2[jjj][kkk] = 0.;
1018  mapRATIOD20[jjj][kkk] = 0.;
1019  for (int iii = 0; iii < NDEP; iii++) {
1020  mapRATIO[iii][jjj][kkk] = 0.;
1021  }
1022  } // for
1023  } // for
1024 
1026  hfile->Close();
1028 
1029  // }//if(k1==0 || (k1>37
1031  } //for k1 loop over time points(LED runs)
1032  cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DONE: last LED run READ " << endl;
1033 
1034  // c1->Clear();
1035 
1036  // ////////////////////////////////////////////////////////////////////////////////////////////////// END OF LOOP OVER LED RUNS
1040 
1046  cout << "**** **** **** **** **** Draw Dependencies: *** " << endl;
1047 
1049  Int_t Method = NMethodsStart;
1050  while (Method < NMethodsToUse + 1) {
1051  if (Method != 9999992) {
1052  cout << " **** START Method " << Method << endl;
1053  //======================================================================================================= PLOT0: <Aijk> for each event and all LED runs
1054  if (Method == 0) {
1055  cout << "****Draw 0 Dependencies: <Aijk> for each event and all LED runs *** " << endl;
1056  gPad->SetGridy();
1057  gPad->SetGridx();
1058  gPad->SetLogy();
1059  gStyle->SetOptStat(101110);
1060  Ceff1D->SetMarkerStyle(20);
1061  Ceff1D->SetMarkerSize(0.4);
1062  Ceff1D->GetYaxis()->SetLabelSize(0.04);
1063  Ceff1D->SetTitle("all runs & channels");
1064  Ceff1D->SetXTitle("<Aijk>");
1065  Ceff1D->SetYTitle("N");
1066  Ceff1D->SetMarkerColor(4);
1067  Ceff1D->SetLineColor(4);
1068  // Ceff1D->Draw("Error");
1069  Ceff1D->Draw("PL");
1070  } //Method = 0
1071  //======================================================================================================= PLOT1: <Aijk> for each event and all LED runs ZOOM
1072  if (Method == 1) {
1073  cout << "****Draw 1 Dependencies: <Aijk> for each event and all LED runs ZOOM *** " << endl;
1074  gPad->SetGridy();
1075  gPad->SetGridx();
1076  gPad->SetLogy();
1077  gStyle->SetOptStat(101110);
1078  // Seff1D->SetTitle("any Error, HE Depth1 \n");
1079  Seff1D->SetMarkerStyle(20);
1080  Seff1D->SetMarkerSize(0.4);
1081  Seff1D->GetYaxis()->SetLabelSize(0.04);
1082  Seff1D->SetTitle("ZOOM all runs & channels");
1083  Seff1D->SetXTitle("<Aijk> ZOOM ");
1084  Seff1D->SetYTitle("N");
1085  Seff1D->SetMarkerColor(4);
1086  Seff1D->SetLineColor(4);
1087  // Seff1D->Draw("Error");
1088  Seff1D->Draw("PL");
1089  } //Method = 1
1090  // //////////////////////////////////////////////////////////////////////////
1091  //======================================================================================================= PLOT2 GSM ratio vs days
1092  if (Method == 2) {
1093  cout << "****Draw 2 Dependencies: GSM ratio vs days *** " << endl;
1094  for (int k1 = 0; k1 < NP; k1++) {
1095  YY[k1] = 0.;
1096  }
1097  // c1->Range(0,0,25,18);
1098  // c1->SetFillColor(0);
1099  // c1->Clear();
1100  TPad* pad1 = new TPad("pad1", "This is pad1", 0.02, 0.02, 0.99, 0.99, 0);
1101  pad1->Draw();
1102  pad1->cd();
1103  pad1->Range(-0.255174, -19.25, 2.29657, -6.75);
1104  // x1 y1 x2 y2
1105  pad1->DrawFrame(x1, y1, x2, y2); // 1-A,
1106  // pad1->DrawFrame(1, 0., 370, 2.0); // 1-A,
1107  pad1->GetFrame()->SetFillColor(0);
1108  pad1->Draw();
1109  gPad->SetGridy();
1110  gPad->SetGridx();
1111  // - - - - - - - - - - - -
1112  Int_t colorlines = 0;
1113  Int_t generalcount = 0;
1114  // for (int jjj=1;jjj<=82;jjj++) {
1115  // for (int kkk=1;kkk<=72;kkk++) {
1116  for (int jjj = 0; jjj < 82; jjj++) {
1117  for (int kkk = 0; kkk < 72; kkk++) {
1118  Int_t sscount = -1;
1119  for (int k1 = 0; k1 < NP; k1++) {
1120  if (GSMRATIOD2[k1][jjj][kkk] != 0) {
1121  // if(GSMRATIOD2[k1][jjj][kkk]< 1.033 && GSMRATIOD2[k1][jjj][kkk] > 0.91 ) {
1122  // if(GSMRATIOD2[k1][jjj][kkk]< 9. && GSMRATIOD2[k1][jjj][kkk] > 0. ) {
1123  if (GSMRATIOD2[k1][jjj][kkk] < RrangeMAX && GSMRATIOD2[k1][jjj][kkk] > RrangeMIN) {
1124  // if(GSMRATIOD2[k1][jjj][kkk]< 1.05 && GSMRATIOD2[k1][jjj][kkk] > 0.91 ) {
1125  // if(GSMRATIOD2[k1][jjj][kkk]< 1.15 && GSMRATIOD2[k1][jjj][kkk] > 0.85 ) {
1126  sscount++;
1127  YY[sscount] = GSMRATIOD2[k1][jjj][kkk]; //
1128  XXX[sscount] = XX[k1];
1129  indWAS[sscount] = k1;
1130  mapBADchannels->Fill(double(jjj) - 42., double(kkk) - 1., GSMRATIOD2[k1][jjj][kkk]);
1131  mapBADchannels0->Fill(double(jjj) - 42., double(kkk) - 1., 1.);
1132  } // GSMRATIOD2[k1][jjj][kkk] < 1.05
1133  else {
1134  // mapBADchannels->Fill(double(jjj)-42., double(kkk)-1., GSMRATIOD2[k1][jjj][kkk]);
1135  }
1136  } // GSMRATIOD2[k1][jjj][kkk] != 0
1137  } //for k1
1138  Int_t MMcount = sscount + 1;
1139  if (MMcount > 0) {
1140  generalcount++;
1141  if (generalcount == 1 && verbosity == 2)
1142  for (int k1 = 0; k1 < MMcount; k1++) {
1143  cout << "**** All GOOD runs: indWAS[k1](1,..) = " << indWAS[k1] + 1 << " XXX[k1]+1 = " << XXX[k1] + 1
1144  << endl;
1145  }
1146  gr1 = new TGraph(MMcount, XXX, YY);
1147  colorlines = generalcount / 5. + 2;
1148  gr1->SetLineColor(colorlines);
1149  gr1->SetMarkerColor(colorlines);
1150  gr1->SetMarkerStyle(20);
1151  gr1->SetMarkerSize(1.2);
1152  gr1->SetFillStyle(0);
1153  gr1->GetXaxis()->SetTitle("days");
1154  gr1->GetYaxis()->SetTitle("R");
1155  gr1->Draw("PL");
1156  } // if
1157  // else {cout<<"****ERROR for PLOT2: MMcount is lower 1, MMcount = *** " << MMcount << endl;}
1158  } //for kkk
1159  } //for jjj
1160 
1161  // TLegend leg(.6,.67,.78,.88, " HEP Depth1");
1162  // TLegend leg(xx1,yy1,xx2,yy2, "HEP17: R vs t");
1163  TLegend leg(xx1, yy1, xx2, yy2, "HE SiPM: R vs t(days)");
1164  // leg.AddEntry(gr1);
1165  leg.SetMargin(0.3);
1166  leg.SetBorderSize(1);
1167  leg.DrawClone("Same");
1168  /*
1169  // Draw labels on the y axis
1170  TText *t7 = new TText();
1171  t7->SetTextAlign(32);
1172  t7->SetTextSize(0.035);
1173  t7->SetTextFont(72);
1174  char *labels[NP+1] = {"31","1","7","7","8","9","12","13","19","22","22","24","24","24","24","24","24","Feb."};
1175  float X7[NP];
1176  for(int k1 = 0; k1<NP; k1++) {
1177  // cout<<"**** XXX[k1] = " << XXX[k1] <<" YY[k1] = " << YY[k1] << endl;
1178  t7->DrawText(0.2+XXX[k1],0.890,labels[k1]);
1179  }
1180  t7->DrawText(0.2+XXX[NP-1]+75.,0.890,labels[NP]);
1181 */
1182 
1183  }
1184  //
1185 
1186  //======================================================================================================= PLOT3: 2D SiPM channels
1187  if (Method == 3) {
1188  cout << "****Draw 3 Dependencies: 2D SiPM channels *** " << endl;
1189  TH2F* Cdepth2hbff = (TH2F*)mapBADchannels->Clone("Cdepth2hbff");
1190  Cdepth2hbff->Divide(mapBADchannels, mapBADchannels0, 1, 1, "B");
1191  Cdepth2hbff->Sumw2();
1192  gPad->SetGridy();
1193  gPad->SetGridx();
1194  gStyle->SetOptStat(0000000);
1195  Cdepth2hbff->SetMarkerStyle(20);
1196  Cdepth2hbff->SetMarkerSize(0.4);
1197  Cdepth2hbff->GetYaxis()->SetLabelSize(0.04);
1198  Cdepth2hbff->SetTitle("within R & Weighted by R");
1199  Cdepth2hbff->SetXTitle("#eta \b");
1200  Cdepth2hbff->SetYTitle("#phi \b");
1201  Cdepth2hbff->SetMarkerColor(4);
1202  Cdepth2hbff->SetLineColor(4);
1203  Cdepth2hbff->Draw("COLZ");
1204  } //Method = 3
1205  //======================================================================================================= PLOT4:gains LED runs
1206  if (Method == 4) {
1207  cout << "****Draw 4 Dependencies: gains LED runs *** " << endl;
1208  gPad->SetGridy();
1209  gPad->SetGridx();
1210  // gPad->SetLogy();
1211  //gStyle->SetOptStat(1110000);
1212  gStyle->SetOptStat(1100); // only mean & rms
1213  //gStyle->SetOptStat(1111111);// only mean & rms
1214  gainkoeff->SetMarkerStyle(20);
1215  gainkoeff->SetMarkerSize(0.4);
1216  gainkoeff->GetYaxis()->SetLabelSize(0.04);
1217  gainkoeff->SetXTitle("gains");
1218  gainkoeff->SetYTitle("N");
1219  gainkoeff->SetMarkerColor(4);
1220  gainkoeff->SetLineColor(4);
1221  // gainkoeff->Draw("Error");
1222  gainkoeff->Draw("PL");
1223  } //Method = 4
1224  //======================================================================================================= PLOT5:gains LED runs
1225  if (Method == 5) {
1226  cout << "****Draw 5 Dependencies: gains LED runs *** " << endl;
1227  gPad->SetGridy();
1228  gPad->SetGridx();
1229  gPad->SetLogy();
1230  //gStyle->SetOptStat(1110000);
1231  gStyle->SetOptStat(1100); // only mean & rms
1232  //gStyle->SetOptStat(1111111);// only mean & rms
1233  gainkoeff9->SetMarkerStyle(20);
1234  gainkoeff9->SetMarkerSize(0.4);
1235  gainkoeff9->GetYaxis()->SetLabelSize(0.04);
1236  gainkoeff9->SetXTitle("gains");
1237  gainkoeff9->SetYTitle("N");
1238  gainkoeff9->SetMarkerColor(4);
1239  gainkoeff9->SetLineColor(4);
1240  // gainkoeff9->Draw("Error");
1241  gainkoeff9->Draw("PL");
1242  } //Method = 5
1243  //======================================================================================================= PLOT6:gains LED runs
1244  if (Method == 6) {
1245  cout << "****Draw 6 Dependencies: gains LED runs *** " << endl;
1246  gPad->SetGridy();
1247  gPad->SetGridx();
1248  gPad->SetLogy();
1249  //gStyle->SetOptStat(1110000);
1250  gStyle->SetOptStat(1100); // only mean & rms
1251  //gStyle->SetOptStat(1111111);// only mean & rms
1252  gainkoeff0->SetMarkerStyle(20);
1253  gainkoeff0->SetMarkerSize(0.4);
1254  gainkoeff0->GetYaxis()->SetLabelSize(0.04);
1255  gainkoeff0->SetXTitle("gains");
1256  gainkoeff0->SetYTitle("N");
1257  gainkoeff0->SetMarkerColor(4);
1258  gainkoeff0->SetLineColor(4);
1259  // gainkoeff0->Draw("Error");
1260  gainkoeff0->Draw("PL");
1261  } //Method = 6
1262  //======================================================================================================= PLOT7: BADruns
1263  if (Method == 7) {
1264  cout << "****Draw 7 Dependencies: BADruns *** " << endl;
1265  gPad->Update();
1266  gPad->SetGridy();
1267  gPad->SetGridx();
1268  gPad->SetLogy(kFALSE);
1269  gStyle->SetOptStat(101110);
1270  BADruns->SetMarkerStyle(20);
1271  BADruns->SetMarkerSize(0.4);
1272  BADruns->GetYaxis()->SetLabelSize(0.04);
1273  BADruns->SetTitle("#channels outside Rrange VS iRun");
1274  BADruns->SetXTitle("iRun");
1275  BADruns->SetYTitle("#channels");
1276  BADruns->SetMarkerColor(4);
1277  BADruns->SetLineColor(4);
1278  // BADruns->Draw("Error");
1279  BADruns->Draw("PL");
1280  // PRINTOUT ONLY:
1281  // if(verbosity == 4 ){
1282  int cx = BADruns->GetXaxis()->GetNbins();
1283  cout << "***** ************* Number of runs w/ R outside unit-range = " << cx << endl;
1284  int nbadruns = 0;
1285  for (int jjj = 1; jjj <= cx; jjj++) {
1286  if (BADruns->GetBinContent(jjj) > 200.) {
1287  cout << "BADruns w/ content>60: jjj= " << jjj << " run= " << LEDruns[jjj - 1]
1288  << " R ouside unit-range for # channels= " << BADruns->GetBinContent(jjj) << endl;
1289  ++nbadruns;
1290  }
1291  // if( BADruns->GetBinContent(jjj) >8.) {cout<<"BADruns w/ content>60: jjj= " << jjj <<" run= " << LEDruns[jjj-1] <<" R ouside unit-range for # channels= " << BADruns->GetBinContent(jjj) <<endl;++nbadruns;}
1292  } //jjj
1293  cout << "BADruns w/ content>60 nbadruns= " << nbadruns << endl;
1294  // }// if(verbosity == 2 )
1295  } //Method = 7
1296 
1297  //======================================================================================================= PLOT8: Goodruns
1298  if (Method == 8) {
1299  cout << "****Draw 8 Dependencies: Goodruns *** " << endl;
1300  gPad->SetGridy();
1301  gPad->SetGridx();
1302  // gPad->SetLogy();
1303  gStyle->SetOptStat(101110);
1304  GOODruns->SetMarkerStyle(20);
1305  GOODruns->SetMarkerSize(0.4);
1306  GOODruns->GetYaxis()->SetLabelSize(0.04);
1307  GOODruns->SetTitle("#channels inside Rrange VS iRun");
1308  GOODruns->SetXTitle("iRun");
1309  GOODruns->SetYTitle("#channels");
1310  GOODruns->SetMarkerColor(4);
1311  GOODruns->SetLineColor(4);
1312  // GOODruns->Draw("Error");
1313  GOODruns->Draw("PL");
1314  // PRINTOUT ONLY:
1315  // if(verbosity == 4 ){
1316  int cx = GOODruns->GetXaxis()->GetNbins();
1317  cout << "************* cx = " << cx << endl;
1318  for (int jjj = 0; jjj <= cx; jjj++) {
1319  // if( GOODruns->GetBinContent(jjj) >100.) cout<<"GOODruns: k1= " << jjj <<endl;
1320  // if( GOODruns->GetBinContent(jjj) >5.) cout<<"GOODruns: k1= " << jjj <<endl;
1321  if (GOODruns->GetBinContent(jjj) > 1400.)
1322  cout << "GOODruns: k1(0,...)= " << jjj
1323  << " GOODruns->GetBinContent(jjj)= " << GOODruns->GetBinContent(jjj) << endl;
1324  } //jjj
1325  // }// if(verbosity == 2 )
1326  } //Method = 8
1327 
1328  //======================================================================================================= PLOT9:depthes with zero A
1329  if (Method == 9) {
1330  cout << "****Draw 9 Dependencies: depthes with zero A *** " << endl;
1331  gPad->SetGridy();
1332  gPad->SetGridx();
1333  gPad->SetLogy(kFALSE);
1334  gStyle->SetOptStat(1110000);
1335  NotEmptyDepthes->SetMarkerStyle(20);
1336  NotEmptyDepthes->SetMarkerSize(0.4);
1337  NotEmptyDepthes->GetYaxis()->SetLabelSize(0.04);
1338  NotEmptyDepthes->SetTitle("# Not Empty Channels in etq-phi projection");
1339  NotEmptyDepthes->SetXTitle("4*(eta-57)+(phi-64)");
1340  NotEmptyDepthes->SetYTitle("N");
1341  NotEmptyDepthes->SetMarkerColor(4);
1342  NotEmptyDepthes->SetLineColor(4);
1343  // NotEmptyDepthes->Draw("Error");
1344  NotEmptyDepthes->Draw("PL");
1345  } //Method = 9
1346  //======================================================================================================= PLOT10: Aijk for each event and all LED runs
1347  if (Method == 10) {
1348  cout << "****Draw 10 Dependencies: Aijk for each event and all LED runs *** " << endl;
1349 
1350  c1->Clear();
1351  c1->Divide(1, 1);
1352 
1353  c1->cd(1);
1354  // TString epsName = fname + LEDruns[0] +".root";
1355  // TFile *hfile= new TFile(epsName, "READ");
1356  // TH1F * Aeff1D= (TH1F*)hfile->Get("h_ADCAmpl_HE");
1357 
1358  gPad->SetGridy();
1359  gPad->SetGridx();
1360  gPad->SetLogy();
1361  gStyle->SetOptStat(101110);
1362  // Aeff1D->SetStats(0);
1363  Aeff1D->SetMarkerStyle(20);
1364  Aeff1D->SetMarkerSize(0.4);
1365  Aeff1D->GetYaxis()->SetLabelSize(0.04);
1366  Aeff1D->SetTitle("all runs & events& channels");
1367  Aeff1D->SetXTitle("Aijk");
1368  Aeff1D->SetYTitle("N");
1369  Aeff1D->SetMarkerColor(4);
1370  Aeff1D->SetLineColor(4);
1371  // Aeff1D->Draw("Error");
1372  // Aeff1D->Draw("PL");
1373  Aeff1D->SetMinimum(0.8);
1374  Aeff1D->Draw("");
1375 
1376  c1->Update();
1377 
1378  } //Method = 10
1379  //======================================================================================================= PLOT11: 2D SiPM channels Depthes1,2,3,4
1380  if (Method == 11) {
1381  cout << "****Draw 11 <A>: 2D Depthes1,2,3,4 *** " << endl;
1382  // gPad->SetGridy();
1383  // gPad->SetGridx();
1384  // gStyle->SetOptStat(0000000);
1385  c1->Clear();
1386  c1->Divide(2, 2);
1387 
1388  c1->cd(1);
1389  mapchannelsdepth1->SetStats(0);
1390  mapchannelsdepth1->SetTitle("<A> Depth1");
1391  mapchannelsdepth1->SetXTitle("#eta \b");
1392  mapchannelsdepth1->SetYTitle("#phi \b");
1393  mapchannelsdepth1->Draw("COLZ");
1394  c1->cd(2);
1395  mapchannelsdepth2->SetStats(0);
1396  mapchannelsdepth2->SetTitle("<A> Depth2");
1397  mapchannelsdepth2->SetXTitle("#eta \b");
1398  mapchannelsdepth2->SetYTitle("#phi \b");
1399  mapchannelsdepth2->Draw("COLZ");
1400  c1->cd(3);
1401  mapchannelsdepth3->SetStats(0);
1402  mapchannelsdepth3->SetTitle("<A> Depth3");
1403  mapchannelsdepth3->SetXTitle("#eta \b");
1404  mapchannelsdepth3->SetYTitle("#phi \b");
1405  mapchannelsdepth3->Draw("COLZ");
1406  c1->cd(4);
1407  mapchannelsdepth4->SetStats(0);
1408  mapchannelsdepth4->SetTitle("<A> Depth4");
1409  mapchannelsdepth4->SetXTitle("#eta \b");
1410  mapchannelsdepth4->SetYTitle("#phi \b");
1411  mapchannelsdepth4->Draw("COLZ");
1412 
1413  c1->Update();
1414 
1415  } //Method = 11
1416  //======================================================================================================= PLOT12: 2D SiPM channels Depthes5,6,7
1417  if (Method == 12) {
1418  cout << "****Draw 12 <A>: 2D Depthes5,6,7 *** " << endl;
1419  // gPad->SetGridy();
1420  // gPad->SetGridx();
1421  // gStyle->SetOptStat(0000000);
1422  c1->Clear();
1423  c1->Divide(2, 2);
1424 
1425  c1->cd(1);
1426  mapchannelsdepth5->SetStats(0);
1427  mapchannelsdepth5->SetTitle("<A> Depth5");
1428  mapchannelsdepth5->SetXTitle("#eta \b");
1429  mapchannelsdepth5->SetYTitle("#phi \b");
1430  mapchannelsdepth5->Draw("COLZ");
1431  c1->cd(2);
1432  mapchannelsdepth6->SetStats(0);
1433  mapchannelsdepth6->SetTitle("<A> Depth6");
1434  mapchannelsdepth6->SetXTitle("#eta \b");
1435  mapchannelsdepth6->SetYTitle("#phi \b");
1436  mapchannelsdepth6->Draw("COLZ");
1437  c1->cd(3);
1438  mapchannelsdepth7->SetStats(0);
1439  mapchannelsdepth7->SetTitle("<A> Depth7");
1440  mapchannelsdepth7->SetXTitle("#eta \b");
1441  mapchannelsdepth7->SetYTitle("#phi \b");
1442  mapchannelsdepth7->Draw("COLZ");
1443 
1444  c1->Update();
1445 
1446  } //Method = 12
1447 
1448  //======================================================================================================= PLOT13: 2D SiPM channels Depthes5,6,7
1449  if (Method == 13) {
1450  cout << "****Draw 13 function, fC *** " << endl;
1451  c1->Clear();
1452  c1->Divide(1, 1);
1453 
1454  c1->cd(1);
1455  {
1456  double c0 = 1.000000;
1457  double b1 = 2.71238e-05;
1458  double a2 = 1.32877e-10;
1459  Int_t n = 50;
1460  Double_t x[n], y[n];
1461  for (Int_t i = 0; i < n; i++) {
1462  x[i] = (i + 1) * 20000.;
1463  y[i] = a2 * x[i] * x[i] / 40. / 40. + b1 * x[i] / 40. + c0;
1464  }
1465 
1466  // create graph
1467  TGraph* gr = new TGraph(n, x, y);
1468 
1469  // draw the graph with axis, continuous line, and put
1470  // a * at each point
1471  gPad->SetGridy();
1472  gPad->SetGridx();
1473  // gPad->SetLogy();
1474  gr->Draw("AC*");
1475  /*
1476  gr1 = new TGraph(MMcount,XXX,YY);
1477  colorlines = generalcount/5.+2;
1478  gr1->SetLineColor(colorlines); gr1->SetMarkerColor(colorlines);
1479  gr1->SetMarkerStyle(20); gr1->SetMarkerSize(1.2); gr1->SetFillStyle(0); gr1->Draw("PL");
1480  */
1481  }
1482 
1483  c1->Update();
1484 
1485  } //Method = 13
1486 
1487  // //////////////////////////////////////////////////////////////////////////
1488 
1489  //=======================================================================================================
1490  //======================================================================================================= finish loop over Methods
1491  //=======================================================================================================
1492  TString fdir = "testamt0shunt6gsm2018/";
1493  //
1494  TString plotName = fdir + MethodName[Method] + ".png";
1495  c1->SaveAs(plotName);
1496  cout << "****PLOT " << Method << " drawn **** " << endl;
1497 
1498  } //if( Method != 9
1499  ++Method;
1500  } //while loop over Methods
1501  //=======================================================================================================
1502  //=======================================================================================================
1503  //=======================================================================================================
1504  //=======================================================================================================
1505  //=======================================================================================================
1506  //=======================================================================================================
1507  //=======================================================================================================
1508  //=======================================================================================================
1509  //=======================================================================================================
1510  //______________________________________________________________________________
1511  //______________________________________________________________________________
1512  //
1513  //______________________________________________________________________________
1514  //______________________________________________________________________________
1515  //
1516  gSystem->Exit(0);
1517  //______________________________________________________________________________
1518 }
weight_default_t b1[25]
Definition: b1.h:9
string fname
main script
float x