CMS 3D CMS Logo

TEcnaHistos.cc
Go to the documentation of this file.
1 //---------Author's Name: B.Fabbro DSM/IRFU/SPP CEA-Saclay
2 //---------Copyright: Those valid for CEA sofware
3 //---------Modified: 30/01/2014
4 
6 
7 //--------------------------------------
8 // TEcnaHistos.cc
9 // Class creation: 18 April 2005
10 // Documentation: see TEcnaHistos.h
11 //--------------------------------------
12 
14 //______________________________________________________________________________
15 //
16 
17 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18 //
19 // (attributes) ===> TEcnaParPaths --->|
20 // TEcnaParEcal --->|
21 // TEcnaWrite ---> TEcnaParPaths --->|
22 // TEcnaParCout --->|
23 // TEcnaParEcal --->|
24 // TEcnaNumbering ---> TEcnaParEcal --->|
25 // TEcnaParHistos ---> TEcnaParEcal --->|
26 // TEcnaNumbering ---> TEcnaParEcal --->|
27 // TEcnaNumbering ---> TEcnaParEcal --->|
28 //
29 // TEcnaRead ---> TEcnaParCout --->|
30 // TEcnaParPaths --->|
31 // TEcnaHeader --->|
32 // TEcnaParEcal --->|
33 // TEcnaWrite ---> TEcnaParPaths --->|
34 // TEcnaParCout --->|
35 // TEcnaParEcal --->|
36 // TEcnaNumbering ---> TEcnaParEcal --->|
37 // TEcnaNumbering ---> TEcnaParEcal --->|
38 //
39 //
40 // Terminal classes: TEcnaParPaths, TEcnaParEcal, TEcnaParCout, TEcnaHeader, TEcnaNArrayD,
41 // TEcnaObject, TEcnaResultType, TEcnaRootFile
42 // Non terminal classes: TEcnaGui, TEcnaHistos, TEcnaParHistos, TEcnaNumbering, TEcnaRead,
43 // TEcnaRun, TEcnaWrite
44 //
45 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
46 
48  //destructor
49 
50  if (fT1DRunNumber != nullptr) {
51  delete[] fT1DRunNumber;
52  fCdelete++;
53  }
54 
55  //if (fCnaParHistos != 0){delete fCnaParHistos; fCdelete++;}
56  //if (fCnaParPaths != 0){delete fCnaParPaths; fCdelete++;}
57  //if (fCnaParCout != 0){delete fCnaParCout; fCdelete++;}
58  //if (fCnaWrite != 0){delete fCnaWrite; fCdelete++;}
59  //if (fEcal != 0){delete fEcal; fCdelete++;}
60  //if (fEcalNumbering != 0){delete fEcalNumbering; fCdelete++;}
61 
62  //if (fMyRootFile != 0){delete fMyRootFile; fCdelete++;}
63  //if (fReadHistoDummy != 0){delete fReadHistoDummy; fCdelete++;}
64 
65  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66 
67  if (fCnew != fCdelete) {
68  std::cout << "*TEcnaHistos> WRONG MANAGEMENT OF ALLOCATIONS: fCnew = " << fCnew << ", fCdelete = " << fCdelete
69  << fTTBELL << std::endl;
70  } else {
71  // std::cout << "*TEcnaHistos> BRAVO! GOOD MANAGEMENT OF ALLOCATIONS: fCnew = "
72  // << fCnew << ", fCdelete = " << fCdelete << std::endl;
73  }
74 
75 #define MGRA
76 #ifndef MGRA
77  if (fCnewRoot != fCdeleteRoot) {
78  std::cout << "*TEcnaHistos> WRONG MANAGEMENT OF ROOT ALLOCATIONS: fCnewRoot = " << fCnewRoot
79  << ", fCdeleteRoot = " << fCdeleteRoot << std::endl;
80  } else {
81  std::cout << "*TEcnaHistos> BRAVO! GOOD MANAGEMENT OF ROOT ALLOCATIONS:"
82  << " fCnewRoot = " << fCnewRoot << ", fCdeleteRoot = " << fCdeleteRoot << std::endl;
83  }
84 #endif // MGRA
85 
86  // std::cout << "TEcnaHistos> Leaving destructor" << std::endl;
87  // std::cout << " fCnew = " << fCnew << ", fCdelete = " << fCdelete << std::endl;
88 
89  // std::cout << "[Info Management] CLASS: TEcnaHistos. DESTROY OBJECT: this = " << this << std::endl;
90 }
91 
92 //===================================================================
93 //
94 // Constructors
95 //
96 //===================================================================
98  // Constructor without argument. Call to Init()
99 
100  // std::cout << "[Info Management] CLASS: TEcnaHistos. CREATE OBJECT: this = " << this << std::endl;
101 
102  Init();
103 }
104 
105 TEcnaHistos::TEcnaHistos(TEcnaObject* pObjectManager, const TString& SubDet) {
106  // std::cout << "[Info Management] CLASS: TEcnaHistos. CREATE OBJECT: this = " << this << std::endl;
107 
108  Long_t i_this = (Long_t)this;
109  pObjectManager->RegisterPointer("TEcnaHistos", i_this);
110 
111  Init();
112 
113  //----------------------- Object management
114 
115  //............................ fCnaParCout
116  fCnaParCout = nullptr;
117  Long_t iCnaParCout = pObjectManager->GetPointerValue("TEcnaParCout");
118  if (iCnaParCout == 0) {
119  fCnaParCout = new TEcnaParCout(pObjectManager); /*fCnew++*/
120  } else {
121  fCnaParCout = (TEcnaParCout*)iCnaParCout;
122  }
123 
124  //............................ fCnaParPaths
125  fCnaParPaths = nullptr;
126  Long_t iCnaParPaths = pObjectManager->GetPointerValue("TEcnaParPaths");
127  if (iCnaParPaths == 0) {
128  fCnaParPaths = new TEcnaParPaths(pObjectManager); /*fCnew++*/
129  } else {
130  fCnaParPaths = (TEcnaParPaths*)iCnaParPaths;
131  }
132 
135 
136  //............................ fEcal => to be changed in fParEcal
137  fEcal = nullptr;
138  Long_t iParEcal = pObjectManager->GetPointerValue("TEcnaParEcal");
139  if (iParEcal == 0) {
140  fEcal = new TEcnaParEcal(pObjectManager, SubDet.Data()); /*fCnew++*/
141  } else {
142  fEcal = (TEcnaParEcal*)iParEcal;
143  }
144 
145  //............................ fEcalNumbering
146  fEcalNumbering = nullptr;
147  Long_t iEcalNumbering = pObjectManager->GetPointerValue("TEcnaNumbering");
148  if (iEcalNumbering == 0) {
149  fEcalNumbering = new TEcnaNumbering(pObjectManager, SubDet.Data()); /*fCnew++*/
150  } else {
151  fEcalNumbering = (TEcnaNumbering*)iEcalNumbering;
152  }
153 
154  //............................ fCnaParHistos
155  fCnaParHistos = nullptr;
156  Long_t iCnaParHistos = pObjectManager->GetPointerValue("TEcnaParHistos");
157  if (iCnaParHistos == 0) {
158  fCnaParHistos = new TEcnaParHistos(pObjectManager, SubDet.Data()); /*fCnew++*/
159  } else {
160  fCnaParHistos = (TEcnaParHistos*)iCnaParHistos;
161  }
162 
163  //............................ fCnaWrite
164  fCnaWrite = nullptr;
165  Long_t iCnaWrite = pObjectManager->GetPointerValue("TEcnaWrite");
166  if (iCnaWrite == 0) {
167  fCnaWrite = new TEcnaWrite(pObjectManager, SubDet.Data()); /*fCnew++*/
168  } else {
169  fCnaWrite = (TEcnaWrite*)iCnaWrite;
170  }
171 
172  //............................ fMyRootFile
173  fMyRootFile = nullptr;
174  Long_t iMyRootFile = pObjectManager->GetPointerValue("TEcnaRead");
175  if (iMyRootFile == 0) {
176  fMyRootFile = new TEcnaRead(pObjectManager, SubDet.Data()); /*fCnew++*/
177  } else {
178  fMyRootFile = (TEcnaRead*)iMyRootFile;
179  }
180 
182 
183  //------------------- creation objet TEcnaRead fMyRootFile (a reprendre plus clairement)
184  //fFileHeader = 0;
185  //fMyRootFile = new TEcnaRead(fFlagSubDet.Data(), fCnaParPaths, fCnaParCout,
186  // fFileHeader, fEcalNumbering, fCnaWrite); fCnew++;
187  //fMyRootFile->PrintNoComment();
188 
189  SetEcalSubDetector(SubDet.Data());
190  //......... init ymin,ymax histos -> Default values for Ymin and Ymax
192 }
193 
195  //========================= GENERAL INITIALISATION
196  fCnew = 0;
197  fCdelete = 0;
198  fCnewRoot = 0;
199  fCdeleteRoot = 0;
200 
201  fCnaCommand = 0;
202  fCnaError = 0;
203 
204  //------------------------------ initialisations ----------------------
205  fTTBELL = '\007';
206 
207  fT1DRunNumber = nullptr;
208 
209  //.......... init flags Same plot
243  //.......... init flags colors (Init)
277 
278  //.......... init counter Same canvas
312  //................. Flag Scale X anf Y set to "LIN" and flag color palete set to "Black/Red/Blue"
313 
314  fFlagScaleX.Resize(charArrLen);
315  fFlagScaleX = "LIN";
316 
317  fFlagScaleY.Resize(charArrLen);
318  fFlagScaleY = "LIN";
319 
320  fFlagColPal.Resize(charArrLen);
321  fFlagColPal = "Black/Red/Blue";
322 
323  //................. Flag General Title set to empty string
325  fFlagGeneralTitle = "";
326 
327  //................. Init codes Options
328  fOptScaleLinx = 31400;
329  fOptScaleLogx = 31401;
330  fOptScaleLiny = 31402;
331  fOptScaleLogy = 31403;
332 
333  fOptVisLine = 1101;
334  fOptVisPolm = 1102;
335 
336  //............................ (Init)
338  fCovarianceMatrix = "Cov";
340  fCorrelationMatrix = "Cor";
341 
342  fLFBetweenStins.Resize(charArrLen);
343  fLFBetweenStins = "MttLF";
344  fHFBetweenStins.Resize(charArrLen);
345  fHFBetweenStins = "MttHF";
346 
348  fLFBetweenChannels = "MccLF";
350  fHFBetweenChannels = "MccHF";
351 
352  fBetweenSamples.Resize(charArrLen);
353  fBetweenSamples = "Mss";
354 
355  //.................................. text pave alignement for pave "SeveralChanging" (HistimePlot)
356  fTextPaveAlign = 12; // 1 = left adjusted, 2 = vertically centered
357  fTextPaveFont = 100; // 10*10 = 10*(ID10 = Courier New)
358  fTextPaveSize = (Float_t)0.025; // 0.0xxx = xxx% of the pave size
359  fTextBorderSize = 1; // Pave Border (=>Shadow)
360 
361  //................................. Init Xvar, Yvar, NbBins management for options SAME and SAME n
362  fXMemoH1SamePlus = "";
363  fXMemoD_NOE_ChNb = "";
364  fXMemoD_NOE_ChDs = "";
365  fXMemoD_Ped_ChNb = "";
366  fXMemoD_Ped_ChDs = "";
367  fXMemoD_TNo_ChNb = "";
368  fXMemoD_TNo_ChDs = "";
369  fXMemoD_MCs_ChNb = "";
370  fXMemoD_MCs_ChDs = "";
371  fXMemoD_LFN_ChNb = "";
372  fXMemoD_LFN_ChDs = "";
373  fXMemoD_HFN_ChNb = "";
374  fXMemoD_HFN_ChDs = "";
375  fXMemoD_SCs_ChNb = "";
376  fXMemoD_SCs_ChDs = "";
377  fXMemoD_MSp_SpNb = "";
378  fXMemoD_MSp_SpDs = "";
379  fXMemoD_SSp_SpNb = "";
380  fXMemoD_SSp_SpDs = "";
381  fXMemoD_Adc_EvDs = "";
382  fXMemoD_Adc_EvNb = "";
383  fXMemoH_Ped_Date = "";
384  fXMemoH_TNo_Date = "";
385  fXMemoH_MCs_Date = "";
386  fXMemoH_LFN_Date = "";
387  fXMemoH_HFN_Date = "";
388  fXMemoH_SCs_Date = "";
389  fXMemoH_Ped_RuDs = "";
390  fXMemoH_TNo_RuDs = "";
391  fXMemoH_MCs_RuDs = "";
392  fXMemoH_LFN_RuDs = "";
393  fXMemoH_HFN_RuDs = "";
394  fXMemoH_SCs_RuDs = "";
395 
396  fYMemoH1SamePlus = "";
397  fYMemoD_NOE_ChNb = "";
398  fYMemoD_NOE_ChDs = "";
399  fYMemoD_Ped_ChNb = "";
400  fYMemoD_Ped_ChDs = "";
401  fYMemoD_TNo_ChNb = "";
402  fYMemoD_TNo_ChDs = "";
403  fYMemoD_MCs_ChNb = "";
404  fYMemoD_MCs_ChDs = "";
405  fYMemoD_LFN_ChNb = "";
406  fYMemoD_LFN_ChDs = "";
407  fYMemoD_HFN_ChNb = "";
408  fYMemoD_HFN_ChDs = "";
409  fYMemoD_SCs_ChNb = "";
410  fYMemoD_SCs_ChDs = "";
411  fYMemoD_MSp_SpNb = "";
412  fYMemoD_MSp_SpDs = "";
413  fYMemoD_SSp_SpNb = "";
414  fYMemoD_SSp_SpDs = "";
415  fYMemoD_Adc_EvDs = "";
416  fYMemoD_Adc_EvNb = "";
417  fYMemoH_Ped_Date = "";
418  fYMemoH_TNo_Date = "";
419  fYMemoH_MCs_Date = "";
420  fYMemoH_LFN_Date = "";
421  fYMemoH_HFN_Date = "";
422  fYMemoH_SCs_Date = "";
423  fYMemoH_Ped_RuDs = "";
424  fYMemoH_TNo_RuDs = "";
425  fYMemoH_MCs_RuDs = "";
426  fYMemoH_LFN_RuDs = "";
427  fYMemoH_HFN_RuDs = "";
428  fYMemoH_SCs_RuDs = "";
429 
463 
464  //.................................. Init canvas/pad pointers (Init)
465  fCurrentCanvas = nullptr;
466 
467  fCurrentCanvasName = "?";
468 
469  fCanvH1SamePlus = nullptr;
470  fCanvD_NOE_ChNb = nullptr;
471  fCanvD_NOE_ChDs = nullptr;
472  fCanvD_Ped_ChNb = nullptr;
473  fCanvD_Ped_ChDs = nullptr;
474  fCanvD_TNo_ChNb = nullptr;
475  fCanvD_TNo_ChDs = nullptr;
476  fCanvD_MCs_ChNb = nullptr;
477  fCanvD_MCs_ChDs = nullptr;
478  fCanvD_LFN_ChNb = nullptr;
479  fCanvD_LFN_ChDs = nullptr;
480  fCanvD_HFN_ChNb = nullptr;
481  fCanvD_HFN_ChDs = nullptr;
482  fCanvD_SCs_ChNb = nullptr;
483  fCanvD_SCs_ChDs = nullptr;
484  fCanvD_MSp_SpNb = nullptr;
485  fCanvD_MSp_SpDs = nullptr;
486  fCanvD_SSp_SpNb = nullptr;
487  fCanvD_SSp_SpDs = nullptr;
488  fCanvD_Adc_EvDs = nullptr;
489  fCanvD_Adc_EvNb = nullptr;
490  fCanvH_Ped_Date = nullptr;
491  fCanvH_TNo_Date = nullptr;
492  fCanvH_MCs_Date = nullptr;
493  fCanvH_LFN_Date = nullptr;
494  fCanvH_HFN_Date = nullptr;
495  fCanvH_SCs_Date = nullptr;
496  fCanvH_Ped_RuDs = nullptr;
497  fCanvH_TNo_RuDs = nullptr;
498  fCanvH_MCs_RuDs = nullptr;
499  fCanvH_LFN_RuDs = nullptr;
500  fCanvH_HFN_RuDs = nullptr;
501  fCanvH_SCs_RuDs = nullptr;
502 
503  fClosedH1SamePlus = kFALSE; // (Canvas Closed SIGNAL)
504  fClosedD_NOE_ChNb = kFALSE;
505  fClosedD_NOE_ChDs = kFALSE;
506  fClosedD_Ped_ChNb = kFALSE;
507  fClosedD_Ped_ChDs = kFALSE;
508  fClosedD_TNo_ChNb = kFALSE;
509  fClosedD_TNo_ChDs = kFALSE;
510  fClosedD_MCs_ChNb = kFALSE;
511  fClosedD_MCs_ChDs = kFALSE;
512  fClosedD_LFN_ChNb = kFALSE;
513  fClosedD_LFN_ChDs = kFALSE;
514  fClosedD_HFN_ChNb = kFALSE;
515  fClosedD_HFN_ChDs = kFALSE;
516  fClosedD_SCs_ChNb = kFALSE;
517  fClosedD_SCs_ChDs = kFALSE;
518  fClosedD_MSp_SpNb = kFALSE;
519  fClosedD_MSp_SpDs = kFALSE;
520  fClosedD_SSp_SpNb = kFALSE;
521  fClosedD_SSp_SpDs = kFALSE;
522  fClosedD_Adc_EvDs = kFALSE;
523  fClosedD_Adc_EvNb = kFALSE;
524  fClosedH_Ped_Date = kFALSE;
525  fClosedH_TNo_Date = kFALSE;
526  fClosedH_MCs_Date = kFALSE;
527  fClosedH_LFN_Date = kFALSE;
528  fClosedH_HFN_Date = kFALSE;
529  fClosedH_SCs_Date = kFALSE;
530  fClosedH_Ped_RuDs = kFALSE;
531  fClosedH_TNo_RuDs = kFALSE;
532  fClosedH_MCs_RuDs = kFALSE;
533  fClosedH_LFN_RuDs = kFALSE;
534  fClosedH_HFN_RuDs = kFALSE;
535  fClosedH_SCs_RuDs = kFALSE;
536 
537  fCurrentPad = nullptr; // (Init)
538 
539  fPadH1SamePlus = nullptr;
540  fPadD_NOE_ChNb = nullptr;
541  fPadD_NOE_ChDs = nullptr;
542  fPadD_Ped_ChNb = nullptr;
543  fPadD_Ped_ChDs = nullptr;
544  fPadD_TNo_ChNb = nullptr;
545  fPadD_TNo_ChDs = nullptr;
546  fPadD_MCs_ChNb = nullptr;
547  fPadD_MCs_ChDs = nullptr;
548  fPadD_LFN_ChNb = nullptr;
549  fPadD_LFN_ChDs = nullptr;
550  fPadD_HFN_ChNb = nullptr;
551  fPadD_HFN_ChDs = nullptr;
552  fPadD_SCs_ChNb = nullptr;
553  fPadD_SCs_ChDs = nullptr;
554  fPadD_MSp_SpNb = nullptr;
555  fPadD_MSp_SpDs = nullptr;
556  fPadD_SSp_SpNb = nullptr;
557  fPadD_SSp_SpDs = nullptr;
558  fPadD_Adc_EvDs = nullptr;
559  fPadD_Adc_EvNb = nullptr;
560  fPadH_Ped_Date = nullptr;
561  fPadH_TNo_Date = nullptr;
562  fPadH_MCs_Date = nullptr;
563  fPadH_LFN_Date = nullptr;
564  fPadH_HFN_Date = nullptr;
565  fPadH_SCs_Date = nullptr;
566  fPadH_Ped_RuDs = nullptr;
567  fPadH_TNo_RuDs = nullptr;
568  fPadH_MCs_RuDs = nullptr;
569  fPadH_LFN_RuDs = nullptr;
570  fPadH_HFN_RuDs = nullptr;
571  fPadH_SCs_RuDs = nullptr;
572 
573  fPavTxtH1SamePlus = nullptr; // (Init)
574  fPavTxtD_NOE_ChNb = nullptr;
575  fPavTxtD_NOE_ChDs = nullptr;
576  fPavTxtD_Ped_ChNb = nullptr;
577  fPavTxtD_Ped_ChDs = nullptr;
578  fPavTxtD_TNo_ChNb = nullptr;
579  fPavTxtD_TNo_ChDs = nullptr;
580  fPavTxtD_MCs_ChNb = nullptr;
581  fPavTxtD_MCs_ChDs = nullptr;
582  fPavTxtD_LFN_ChNb = nullptr;
583  fPavTxtD_LFN_ChDs = nullptr;
584  fPavTxtD_HFN_ChNb = nullptr;
585  fPavTxtD_HFN_ChDs = nullptr;
586  fPavTxtD_SCs_ChNb = nullptr;
587  fPavTxtD_SCs_ChDs = nullptr;
588  fPavTxtD_MSp_SpNb = nullptr;
589  fPavTxtD_MSp_SpDs = nullptr;
590  fPavTxtD_SSp_SpNb = nullptr;
591  fPavTxtD_SSp_SpDs = nullptr;
592  fPavTxtD_Adc_EvDs = nullptr;
593  fPavTxtD_Adc_EvNb = nullptr;
594  fPavTxtH_Ped_Date = nullptr;
595  fPavTxtH_TNo_Date = nullptr;
596  fPavTxtH_MCs_Date = nullptr;
597  fPavTxtH_LFN_Date = nullptr;
598  fPavTxtH_HFN_Date = nullptr;
599  fPavTxtH_SCs_Date = nullptr;
600  fPavTxtH_Ped_RuDs = nullptr;
601  fPavTxtH_TNo_RuDs = nullptr;
602  fPavTxtH_MCs_RuDs = nullptr;
603  fPavTxtH_LFN_RuDs = nullptr;
604  fPavTxtH_HFN_RuDs = nullptr;
605  fPavTxtH_SCs_RuDs = nullptr;
606 
607  fImpH1SamePlus = nullptr; // (Init)
608  fImpD_NOE_ChNb = nullptr;
609  fImpD_NOE_ChDs = nullptr;
610  fImpD_Ped_ChNb = nullptr;
611  fImpD_Ped_ChDs = nullptr;
612  fImpD_TNo_ChNb = nullptr;
613  fImpD_TNo_ChDs = nullptr;
614  fImpD_MCs_ChNb = nullptr;
615  fImpD_MCs_ChDs = nullptr;
616  fImpD_LFN_ChNb = nullptr;
617  fImpD_LFN_ChDs = nullptr;
618  fImpD_HFN_ChNb = nullptr;
619  fImpD_HFN_ChDs = nullptr;
620  fImpD_SCs_ChNb = nullptr;
621  fImpD_SCs_ChDs = nullptr;
622  fImpD_MSp_SpNb = nullptr;
623  fImpD_MSp_SpDs = nullptr;
624  fImpD_SSp_SpNb = nullptr;
625  fImpD_SSp_SpDs = nullptr;
626  fImpD_Adc_EvDs = nullptr;
627  fImpD_Adc_EvNb = nullptr;
628  fImpH_Ped_Date = nullptr;
629  fImpH_TNo_Date = nullptr;
630  fImpH_MCs_Date = nullptr;
631  fImpH_LFN_Date = nullptr;
632  fImpH_HFN_Date = nullptr;
633  fImpH_SCs_Date = nullptr;
634  fImpH_Ped_RuDs = nullptr;
635  fImpH_TNo_RuDs = nullptr;
636  fImpH_MCs_RuDs = nullptr;
637  fImpH_LFN_RuDs = nullptr;
638  fImpH_HFN_RuDs = nullptr;
639  fImpH_SCs_RuDs = nullptr;
640 
641  fNbBinsProj = 100; // number of bins for histos in option Projection
642 
643  //.................................... Miscellaneous parameters (Init)
644 
651 
658 
659  fNbOfExistingRuns = 0;
660 
661  fFapNbOfRuns = -1; // INIT NUMBER OF RUNS: set to -1
662  fFapMaxNbOfRuns = -1; // INIT MAXIMUM NUMBER OF RUNS: set to -1
663 
664  fFapFileRuns.Resize(charArrLen);
665  fFapFileRuns = "(file with list of runs parameters: no info)";
666 
667  fStartEvolTime = 0;
668  fStopEvolTime = 0;
669  fStartEvolDate = "Start date: not known";
670  fStopEvolDate = "Stop date: not known";
671 
672  fStartEvolRun = 0;
673  fStopEvolRun = 0;
674 
675  fRunType = "Run type: not known";
676 
677  fFapNbOfEvts = 0;
678 
679  fMyRootFileName.Resize(charArrLen);
680  fMyRootFileName = "No ROOT file name available (fMyRootFileName).";
681 
682  fFapAnaType = "Analysis name: not known"; // Init Type of analysis
683  fFapNbOfSamples = 0; // Init Nb of required samples
684  fFapRunNumber = 0; // Init Run number
685  fFapFirstReqEvtNumber = 0; // Init First requested event number
686  fFapLastReqEvtNumber = 0; // Init Last requested event number
687  fFapReqNbOfEvts = 0; // Init Requested number of events
688  fFapStexNumber = 0; // Init Stex number
689 
690  //------------------ Init read file flags
691  fAlreadyRead = 1;
692  fMemoAlreadyRead = 0;
693  fTobeRead = 0;
694  fZerv = 0;
695  fUnev = 1;
696  TVectorD fReadHistoDummy(fUnev);
697  TMatrixD fReadMatrixDummy(fUnev, fUnev);
698 
699  //------------------ Init fAsciiFileName
700  fAsciiFileName = "?";
701 
702 } // end of Init()
703 
704 //----------------------------------------------------------------------------------------
706  // Set Subdetector (EB or EE)
707 
708  fFlagSubDet.Resize(charArrLen);
709  fFlagSubDet = fEcal->GetEcalSubDetector(); // fFlagSubDet = "EB" or "EE"
710 
711  //.................................. Init specific EB/EE parameters ( SetEcalSubDetector(...) )
712  fFapStexName.Resize(charArrLen);
713  fFapStexName = "no info for Stex";
714  fFapStinName.Resize(charArrLen);
715  fFapStinName = "no info for Stin";
716  fFapXtalName.Resize(charArrLen);
717  fFapXtalName = "no info for Xtal";
718  fFapEchaName.Resize(charArrLen);
719  fFapEchaName = "no info for Echa";
720 
721  if (fFlagSubDet == "EB") {
722  fFapStexName = "SM";
723  fFapStinName = "Tower";
724  fFapXtalName = "Xtal";
725  fFapEchaName = "Chan";
727  }
728 
729  if (fFlagSubDet == "EE") {
730  fFapStexName = "Dee";
731  fFapStinName = "SC";
732  fFapXtalName = "Xtal";
733  fFapEchaName = "Chan";
735  fFapStexDir = "right";
736  fFapStinQuadType = "top";
737  }
738 
739  //........................ init code plot type (SetEcalSubDetector)
740  fOnlyOnePlot.Resize(charArrLen);
742 
743  fSeveralPlot.Resize(charArrLen);
745 
746  fSameOnePlot.Resize(charArrLen);
748 
751 
753 
754 } // ---------------- end of SetEcalSubDetector(...) ----------------
755 
756 //--------------------------------------------------------------------------------------------
757 //
758 // FileParameters(s)(...)
759 //
760 //--------------------------------------------------------------------------------------------
761 
762 //===> DON'T SUPPRESS: THESE METHODS ARE CALLED BY TEcnaGui and can be called by any other program
763 void TEcnaHistos::FileParameters(const TString& xArgAnaType,
764  const Int_t& xArgNbOfSamples,
765  const Int_t& xArgRunNumber,
766  const Int_t& xArgFirstReqEvtNumber,
767  const Int_t& xArgLastReqEvtNumber,
768  const Int_t& xArgReqNbOfEvts,
769  const Int_t& xArgStexNumber) {
770  // Set parameters for reading the right ECNA results file
771 
772  fFapAnaType = xArgAnaType;
773  fFapNbOfSamples = xArgNbOfSamples;
774  fFapRunNumber = xArgRunNumber;
775  fFapFirstReqEvtNumber = xArgFirstReqEvtNumber;
776  fFapLastReqEvtNumber = xArgLastReqEvtNumber;
777  fFapReqNbOfEvts = xArgReqNbOfEvts;
778  fFapStexNumber = xArgStexNumber;
779 
780  InitSpecParBeforeFileReading(); // SpecPar = Special Parameters (dates, times, run types)
781 }
782 
784  // Set parameters for reading the right ECNA results file
785 
786  InitSpecParBeforeFileReading(); // SpecPar = Special Parameters (dates, times, run types)
787 
788  //............... Filename parameter values
789  fFapAnaType = MyRootFile->GetAnalysisName();
790  fFapNbOfSamples = MyRootFile->GetNbOfSamples();
791  fFapRunNumber = MyRootFile->GetRunNumber();
794  fFapReqNbOfEvts = MyRootFile->GetReqNbOfEvts();
795  fFapStexNumber = MyRootFile->GetStexNumber();
796 
797  //............... parameter values from file contents
798  fStartDate = MyRootFile->GetStartDate();
799  fStopDate = MyRootFile->GetStopDate();
800  fRunType = MyRootFile->GetRunType();
801 
803 }
804 
805 //=============================================================================================
806 // Set general title
807 // Set lin or log scale on X or Y axis
808 // Set color palette
809 // Set start and stop date
810 // Set run type
811 //=============================================================================================
812 //............................................................................................
813 void TEcnaHistos::GeneralTitle(const TString& title) { fFlagGeneralTitle = title.Data(); }
814 void TEcnaHistos::SetHistoScaleX(const TString& option_scale) {
815  fFlagScaleX = "LIN";
816  if (option_scale == "LOG") {
817  fFlagScaleX = "LOG";
818  }
819 }
820 void TEcnaHistos::SetHistoScaleY(const TString& option_scale) {
821  fFlagScaleY = "LIN";
822  if (option_scale == "LOG") {
823  fFlagScaleY = "LOG";
824  }
825 }
826 void TEcnaHistos::SetHistoColorPalette(const TString& option_palette) {
827  fFlagColPal = "Black/Red/Blue";
828  if (!(option_palette == "Rainbow" || option_palette == "rainbow")) {
829  fFlagColPal = "Black/Red/Blue";
830  }
831  if (option_palette == "Rainbow" || option_palette == "rainbow") {
832  fFlagColPal = "Rainbow";
833  }
834 }
835 void TEcnaHistos::StartStopDate(const TString& start_date, const TString& stop_date) {
836  fStartDate = start_date.Data();
837  fStopDate = stop_date.Data();
838 }
839 void TEcnaHistos::RunType(const TString& run_type) { fRunType = run_type.Data(); }
840 void TEcnaHistos::NumberOfEvents(const Int_t& nb_of_evts) { fFapNbOfEvts = nb_of_evts; }
841 //====================== return status for root file and data existence
844 
845 //=======================================================================================
846 //
847 // ( R e a d A n d ) P l o t (1D , 2D , History)
848 //
849 //=======================================================================================
850 //---------------------------------------------------------------------------------------------
851 // TechHistoCode list modification (06/10/09)
852 //
853 // D = Detector Plot ChNb = Channel Number
854 // ChDs = Channel Distribution (Y projection)
855 //
856 // H = History Plot Date = date in format YYMMJJ hhmmss
857 // RuDs = Run distribution
858 //
859 // old code new code std code X std code Y (std = standard)
860 //
861 // * 1 H1NbOfEvtsGlobal D_NOE_ChNb Xtal NOE NOE = Number Of Events
862 // * 2 H1NbOfEvtsProj D_NOE_ChDs NOE NOX NOX = Number Of Xtals
863 // * 3 H1EvEvGlobal D_Ped_ChNb Xtal Ped Ped = Pedestal
864 // * 4 H1EvEvProj D_Ped_ChDs Ped NOX
865 // * 5 H1EvSigGlobal D_TNo_ChNb Xtal TNo TNo = Total Noise
866 // * 6 H1EvSigProj D_TNo_ChDs TNo NOX
867 // * 7 H1SigEvGlobal D_LFN_ChNb Xtal LFN LFN = Low Frequency noise
868 // * 8 H1SigEvProj D_LFN_ChDs LFN NOX
869 // * 9 H1SigSigGlobal D_HFN_ChNb Xtal HFN HFN = High Frequency noise
870 // * 10 H1SigSigProj D_HFN_ChDs HFN NOX
871 // * 11 H1EvCorssGlobal D_MCs_ChNb Xtal MCs MCs = Mean correlations between samples
872 // * 12 H1EvCorssProj D_MCs_ChDs MCs NOX
873 // * 13 H1SigCorssGlobal D_SCs_ChNb Xtal SCs SCs = Sigma of the correlations between samples
874 // * 14 H1SigCorssProj D_SCs_ChDs SCs NOX
875 // * 15 Ev D_MSp_SpNb Sample MSp MSp = Means of the samples
876 // * 16 EvProj D_MSp_SpDs MSp NOS NOS = Number of samples
877 // * 17 Sigma D_SSp_SpNb Sample SSp SSp = Sigmas of the samples
878 // * 18 SigmaProj D_SSp_SpDs SSp NOS
879 // * 19 SampTime D_Adc_EvNb Event Adc Adc = ADC count as a function of Event number
880 // * 20 AdcProj D_Adc_EvDs Adc NOE EvDs = Event distribution
881 // * 21 EvolEvEv H_Ped_Date Time Ped Time = date YY/MM/DD hh:mm:ss
882 // * 22 EvolEvEvProj H_Ped_RuDs Ped NOR NOR = Number Of Runs
883 // * 23 EvolEvSig H_TNo_Date Time TNo
884 // * 24 EvolEvSigProj H_TNo_RuDs TNo NOR
885 // * 25 EvolSigEv H_LFN_Date Time LFN
886 // * 26 EvolSigEvProj H_LFN_RuDs LFN NOR
887 // * 27 EvolSigSig H_HFN_Date Time HFN
888 // * 28 EvolSigSigProj H_HFN_RuDs HFN NOR
889 // * 29 EvolEvCorss H_MCs_Date Time MCs
890 // * 30 EvolEvCorssProj H_MCs_RuDs MCs NOR
891 // * 31 EvolSigCorss H_SCs_Date Time SCs
892 // * 32 EvolSigCorssProj H_SCs_RuDs SCs NOR
893 //
894 //---------------------------------------------------------------------------------------------
895 
896 //---------------------------------------------------------------------------------------
897 //
898 // (ReadAnd)PlotMatrix
899 //
900 //---------------------------------------------------------------------------------------
901 //................................ Corcc[for 1 Stex] (big matrix), Cortt[for 1 Stex]
902 void TEcnaHistos::PlotMatrix(const TMatrixD& read_matrix_corcc,
903  const TString& UserCorOrCov,
904  const TString& UserBetweenWhat) {
905  PlotMatrix(read_matrix_corcc, UserCorOrCov, UserBetweenWhat, "");
906 }
907 
908 void TEcnaHistos::PlotMatrix(const TMatrixD& read_matrix_corcc,
909  const TString& UserCorOrCov,
910  const TString& UserBetweenWhat,
911  const TString& UserPlotOption) {
912  TString CallingMethod = "2D";
913 
914  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
915 
916  TString BetweenWhat = fCnaParHistos->BuildStandardBetweenWhatCode(CallingMethod, UserBetweenWhat);
917  TString CorOrCov = fCnaParHistos->BuildStandardCovOrCorCode(CallingMethod, UserCorOrCov);
918 
919  if (BetweenWhat != "?" && CorOrCov != "?") {
920  if (BetweenWhat == "MttLF" || BetweenWhat == "MttHF") {
921  fAlreadyRead = 1;
922  ViewMatrix(read_matrix_corcc, fAlreadyRead, fZerv, fZerv, fZerv, CorOrCov, BetweenWhat, StandardPlotOption);
923  }
924  if (BetweenWhat == "MccLF") {
925  StexHocoVecoLHFCorcc("LF");
926  } // forced to Read file and Plot
927  if (BetweenWhat == "MccHF") {
928  StexHocoVecoLHFCorcc("HF");
929  } // forced to Read file and Plot
930  } else {
931  fFlagUserHistoMin = "OFF";
932  fFlagUserHistoMax = "OFF";
933  std::cout << "!TEcnaHistos::PlotMatrix(...)> Histo cannot be reached." << fTTBELL << std::endl;
934  }
935 }
936 
937 void TEcnaHistos::PlotMatrix(const TString& UserCorOrCov, const TString& UserBetweenWhat) {
938  PlotMatrix(UserCorOrCov, UserBetweenWhat, "");
939 }
940 
941 void TEcnaHistos::PlotMatrix(const TString& UserCorOrCov,
942  const TString& UserBetweenWhat,
943  const TString& UserPlotOption) {
944  TString CallingMethod = "2D";
945 
946  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
947 
948  TString BetweenWhat = fCnaParHistos->BuildStandardBetweenWhatCode(CallingMethod, UserBetweenWhat);
949  TString CorOrCov = fCnaParHistos->BuildStandardCovOrCorCode(CallingMethod, UserCorOrCov);
950 
951  if (BetweenWhat != "?" && CorOrCov != "?") {
952  if (BetweenWhat == "MttLF" || BetweenWhat == "MttHF") {
953  ViewMatrix(fReadMatrixDummy, fTobeRead, fZerv, fZerv, fZerv, CorOrCov, BetweenWhat, StandardPlotOption);
954  }
955  if (BetweenWhat == "MccLF") {
956  StexHocoVecoLHFCorcc("LF");
957  } // Plot only
958  if (BetweenWhat == "MccHF") {
959  StexHocoVecoLHFCorcc("HF");
960  } // Plot only
961  } else {
962  fFlagUserHistoMin = "OFF";
963  fFlagUserHistoMax = "OFF";
964  std::cout << "!TEcnaHistos::PlotMatrix(...)> Histo cannot be reached." << fTTBELL << std::endl;
965  }
966 }
967 
968 //....................................... Corcc for channels (cStexStin_A, cStexStin_B)
969 // Corss, Covss for one channel (-> i0StinEcha)
970 void TEcnaHistos::PlotMatrix(const TMatrixD& read_matrix,
971  const TString& UserCorOrCov,
972  const TString& UserBetweenWhat,
973  const Int_t& arg_n1,
974  const Int_t& arg_n2) {
975  PlotMatrix(read_matrix, UserCorOrCov, UserBetweenWhat, arg_n1, arg_n2, "");
976 }
977 
978 void TEcnaHistos::PlotMatrix(const TMatrixD& read_matrix,
979  const TString& UserCorOrCov,
980  const TString& UserBetweenWhat,
981  const Int_t& arg_n1,
982  const Int_t& arg_n2,
983  const TString& UserPlotOption) {
984  TString CallingMethod = "2D";
985 
986  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
987 
988  TString BetweenWhat = fCnaParHistos->BuildStandardBetweenWhatCode(CallingMethod, UserBetweenWhat);
989  TString CorOrCov = fCnaParHistos->BuildStandardCovOrCorCode(CallingMethod, UserCorOrCov);
990 
991  if (BetweenWhat != "?" && CorOrCov != "?") {
992  if (BetweenWhat == "MccLF" || BetweenWhat == "MccHF") {
993  Int_t cStexStin_A = arg_n1;
994  Int_t cStexStin_B = arg_n2;
995  fAlreadyRead = 1;
996  ViewMatrix(read_matrix, fAlreadyRead, cStexStin_A, cStexStin_B, fZerv, CorOrCov, BetweenWhat, StandardPlotOption);
997  }
998 
999  if (BetweenWhat == "Mss") {
1000  Int_t n1StexStin = arg_n1;
1001  Int_t i0StinEcha = arg_n2;
1002  if (fFlagSubDet == "EE") {
1004  }
1005  fAlreadyRead = 1;
1006  ViewMatrix(read_matrix, fAlreadyRead, n1StexStin, fZerv, i0StinEcha, CorOrCov, BetweenWhat, StandardPlotOption);
1007  }
1008  } else {
1009  fFlagUserHistoMin = "OFF";
1010  fFlagUserHistoMax = "OFF";
1011  std::cout << "!TEcnaHistos::PlotMatrix(...)> Histo cannot be reached." << fTTBELL << std::endl;
1012  }
1013 }
1014 
1015 void TEcnaHistos::PlotMatrix(const TString& UserCorOrCov,
1016  const TString& UserBetweenWhat,
1017  const Int_t& arg_n1,
1018  const Int_t& arg_n2) {
1019  PlotMatrix(UserCorOrCov, UserBetweenWhat, arg_n1, arg_n2, "");
1020 }
1021 
1022 void TEcnaHistos::PlotMatrix(const TString& UserCorOrCov,
1023  const TString& UserBetweenWhat,
1024  const Int_t& arg_n1,
1025  const Int_t& arg_n2,
1026  const TString& UserPlotOption) {
1027  TString CallingMethod = "2D";
1028 
1029  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1030 
1031  TString StandardBetweenWhat = fCnaParHistos->BuildStandardBetweenWhatCode(CallingMethod, UserBetweenWhat);
1032  TString StandardCorOrCov = fCnaParHistos->BuildStandardCovOrCorCode(CallingMethod, UserCorOrCov);
1033 
1034  if (StandardBetweenWhat != "?" && StandardCorOrCov != "?") {
1035  if (StandardBetweenWhat == "MccLF" || StandardBetweenWhat == "MccHF") {
1036  Int_t cStexStin_A = arg_n1;
1037  Int_t cStexStin_B = arg_n2;
1039  fTobeRead,
1040  cStexStin_A,
1041  cStexStin_B,
1042  fZerv,
1043  StandardCorOrCov,
1044  StandardBetweenWhat,
1045  StandardPlotOption);
1046  }
1047 
1048  if (StandardBetweenWhat == "Mss") {
1049  Int_t n1StexStin = arg_n1;
1050  Int_t i0StinEcha = arg_n2;
1051  if (fFlagSubDet == "EE") {
1053  }
1054 
1056  fTobeRead,
1057  n1StexStin,
1058  fZerv,
1059  i0StinEcha,
1060  StandardCorOrCov,
1061  StandardBetweenWhat,
1062  StandardPlotOption);
1063  }
1064  } else {
1065  fFlagUserHistoMin = "OFF";
1066  fFlagUserHistoMax = "OFF";
1067  std::cout << "!TEcnaHistos::PlotMatrix(...)> Histo cannot be reached." << fTTBELL << std::endl;
1068  }
1069 }
1070 
1071 //---------------------------------------------------------------------------------------
1072 //
1073 // (ReadAnd)PlotDetector
1074 //
1075 //---------------------------------------------------------------------------------------
1076 //.................................... 2D plots for Stex OR Stas
1077 void TEcnaHistos::PlotDetector(const TString& UserHistoCode, const TString& UserDetector) {
1078  TString CallingMethod = "2DS";
1079 
1080  TString StandardHistoCode = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, UserHistoCode);
1081  if (StandardHistoCode != "?") {
1082  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(StandardHistoCode);
1083  TString StandardDetectorCode = fCnaParHistos->BuildStandardDetectorCode(UserDetector);
1084  if (StandardDetectorCode != "?") {
1085  //if( StandardDetectorCode == "SM" || StandardDetectorCode == "EB" )
1086  // {fEcal->SetEcalSubDetector("EB");}
1087  //if( StandardDetectorCode == "Dee" || StandardDetectorCode == "EE" )
1088  // {fEcal->SetEcalSubDetector("EE");}
1089 
1090  if (StandardDetectorCode == "SM" || StandardDetectorCode == "Dee") {
1091  ViewStex(fReadHistoDummy, fTobeRead, TechHistoCode);
1092  }
1093  if (StandardDetectorCode == "EB" || StandardDetectorCode == "EE") {
1094  ViewStas(fReadHistoDummy, fTobeRead, TechHistoCode);
1095  }
1096  } else {
1097  fFlagUserHistoMin = "OFF";
1098  fFlagUserHistoMax = "OFF";
1099  std::cout << "!TEcnaHistos::PlotDetector(...)> Histo cannot be reached." << fTTBELL << std::endl;
1100  }
1101  } else {
1102  fFlagUserHistoMin = "OFF";
1103  fFlagUserHistoMax = "OFF";
1104  std::cout << "!TEcnaHistos::PlotDetector(...)> Histo cannot be reached." << fTTBELL << std::endl;
1105  }
1106 }
1107 
1108 void TEcnaHistos::PlotDetector(const TVectorD& read_histo, const TString& UserHistoCode, const TString& UserDetector) {
1109  TString CallingMethod = "2DS";
1110 
1111  TString StandardHistoCode = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, UserHistoCode);
1112  if (StandardHistoCode != "?") {
1113  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(StandardHistoCode);
1114  TString StandardDetectorCode = fCnaParHistos->BuildStandardDetectorCode(UserDetector);
1115  if (StandardDetectorCode != "?") {
1116  fAlreadyRead = 1;
1117 
1118  //if( StandardDetectorCode == "SM" || StandardDetectorCode == "EB" )
1119  // {fEcal->SetEcalSubDetector("EB");}
1120  //if( StandardDetectorCode == "Dee" || StandardDetectorCode == "EE" )
1121  // {fEcal->SetEcalSubDetector("EE");}
1122 
1123  if (StandardDetectorCode == "SM" || StandardDetectorCode == "Dee") {
1124  ViewStex(read_histo, fAlreadyRead, TechHistoCode);
1125  }
1126  if (StandardDetectorCode == "EB" || StandardDetectorCode == "EE") {
1127  ViewStas(read_histo, fAlreadyRead, TechHistoCode);
1128  }
1129  } else {
1130  fFlagUserHistoMin = "OFF";
1131  fFlagUserHistoMax = "OFF";
1132  std::cout << "!TEcnaHistos::PlotDetector(...)> Histo cannot be reached." << fTTBELL << std::endl;
1133  }
1134  } else {
1135  fFlagUserHistoMin = "OFF";
1136  fFlagUserHistoMax = "OFF";
1137  std::cout << "!TEcnaHistos::PlotDetector(...)> Histo cannot be reached." << fTTBELL << std::endl;
1138  }
1139 }
1140 
1141 //---------------------------------------------------------------------------------------
1142 //
1143 // (ReadAnd)Plot1DHisto
1144 //
1145 //---------------------------------------------------------------------------------------
1146 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1147  const TString& User_X_Quantity,
1148  const TString& User_Y_Quantity,
1149  const TString& UserDetector) {
1150  Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, UserDetector, "");
1151 }
1152 
1153 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1154  const TString& User_X_Quantity,
1155  const TString& User_Y_Quantity,
1156  const TString& UserDetector,
1157  const TString& UserPlotOption) {
1158  TString CallingMethod = "1D";
1159 
1160  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1161 
1162  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1163  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1164 
1165  if (Standard_X_Quantity != "?" && Standard_Y_Quantity != "?") {
1166  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1167  if (fAlreadyRead > 1) {
1168  fAlreadyRead = 1;
1169  }
1170  TString StandardDetectorCode = fCnaParHistos->BuildStandardDetectorCode(UserDetector);
1171  if (StandardDetectorCode != "?") {
1172  if (StandardDetectorCode == "EB" || StandardDetectorCode == "EE") {
1173  fFapStexNumber = 0;
1174  }
1175  ViewHisto(InputHisto, fAlreadyRead, fZerv, fZerv, fZerv, TechHistoCode, StandardPlotOption);
1176  } else {
1177  fFlagUserHistoMin = "OFF";
1178  fFlagUserHistoMax = "OFF";
1179  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;
1180  }
1181  } else {
1182  fFlagUserHistoMin = "OFF";
1183  fFlagUserHistoMax = "OFF";
1184  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;
1185  }
1186 }
1187 
1188 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity,
1189  const TString& User_Y_Quantity,
1190  const TString& UserDetector) {
1191  Plot1DHisto(User_X_Quantity, User_Y_Quantity, UserDetector, "");
1192 }
1193 
1194 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity,
1195  const TString& User_Y_Quantity,
1196  const TString& UserDetector,
1197  const TString& UserPlotOption) {
1198  TString CallingMethod = "1D";
1199 
1200  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1201 
1202  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1203  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1204 
1205  if (Standard_X_Quantity != "?" && Standard_Y_Quantity != "?") {
1206  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1207  TString StandardDetectorCode = fCnaParHistos->BuildStandardDetectorCode(UserDetector);
1208  if (StandardDetectorCode != "?") {
1209  if (StandardDetectorCode == "EB" || StandardDetectorCode == "EE") {
1210  fFapStexNumber = 0;
1211  }
1212  ViewHisto(fReadHistoDummy, fTobeRead, fZerv, fZerv, fZerv, TechHistoCode, StandardPlotOption);
1213  } else {
1214  fFlagUserHistoMin = "OFF";
1215  fFlagUserHistoMax = "OFF";
1216  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;
1217  }
1218  } else {
1219  fFlagUserHistoMin = "OFF";
1220  fFlagUserHistoMax = "OFF";
1221  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;
1222  }
1223 }
1224 
1225 //=> BUG SCRAM? Si on enleve la methode ci-dessous, ca passe a la compilation de test/EcnaHistosExample2.cc
1226 // (qui appelle cette methode) et ca se plante a l'execution (voir test/TEcnaHistosExample2.cc).
1227 #define PLUD
1228 #ifdef PLUD
1229 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1230  const TString& User_X_Quantity,
1231  const TString& User_Y_Quantity,
1232  const Int_t& n1StexStin) {
1233  Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, n1StexStin, "");
1234 }
1235 
1236 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1237  const TString& User_X_Quantity,
1238  const TString& User_Y_Quantity,
1239  const Int_t& n1StexStin,
1240  const TString& UserPlotOption) {
1241  TString CallingMethod = "1DX";
1242  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1243  Int_t i0StinEcha = 0;
1244  Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, StandardPlotOption);
1245 }
1246 #endif // PLUD
1247 
1248 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1249  const TString& User_X_Quantity,
1250  const TString& User_Y_Quantity,
1251  const Int_t& n1StexStin,
1252  const Int_t& i0StinEcha) {
1253  Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, "");
1254 }
1255 
1256 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1257  const TString& User_X_Quantity,
1258  const TString& User_Y_Quantity,
1259  const Int_t& n1StexStin,
1260  const Int_t& i0StinEcha,
1261  const TString& UserPlotOption) {
1262  TString CallingMethod = "1D";
1263  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1264  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1265  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1266 
1267  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1268 
1269  if (Standard_X_Quantity != "?" && Standard_Y_Quantity != "?") {
1270  fAlreadyRead = 1;
1271  if (StandardPlotOption != fAllXtalsInStinPlot) {
1272  ViewHisto(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, fZerv, TechHistoCode, StandardPlotOption);
1273  }
1274 
1275  if (StandardPlotOption == fAllXtalsInStinPlot && fAlreadyRead >= 1 && fAlreadyRead <= fEcal->MaxCrysInStin()) {
1276  if (Standard_X_Quantity == "Smp" && Standard_Y_Quantity == "MSp") {
1277  XtalSamplesEv(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, StandardPlotOption);
1278  }
1279  if (Standard_X_Quantity == "MSp" && Standard_Y_Quantity == "NOS") {
1280  EvSamplesXtals(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, StandardPlotOption);
1281  }
1282  if (Standard_X_Quantity == "Smp" && Standard_Y_Quantity == "SSp") {
1283  XtalSamplesSigma(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, StandardPlotOption);
1284  }
1285  if (Standard_X_Quantity == "SSp" && Standard_Y_Quantity == "NOS") {
1286  SigmaSamplesXtals(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, StandardPlotOption);
1287  }
1288  }
1289  } else {
1290  fFlagUserHistoMin = "OFF";
1291  fFlagUserHistoMax = "OFF";
1292  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;
1293  }
1294 }
1295 
1296 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity,
1297  const TString& User_Y_Quantity,
1298  const Int_t& n1StexStin,
1299  const Int_t& i0StinEcha) {
1300  Plot1DHisto(User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, "");
1301 }
1302 
1303 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity,
1304  const TString& User_Y_Quantity,
1305  const Int_t& n1StexStin,
1306  const Int_t& i0StinEcha,
1307  const TString& UserPlotOption) {
1308  TString CallingMethod = "1D";
1309 
1310  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1311 
1312  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1313  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1314 
1315  if (Standard_X_Quantity != "?" && Standard_Y_Quantity != "?") {
1316  if (StandardPlotOption != fAllXtalsInStinPlot) {
1317  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1318  ViewHisto(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, fZerv, TechHistoCode, StandardPlotOption);
1319  }
1320  if (StandardPlotOption == fAllXtalsInStinPlot && fAlreadyRead >= 1 && fAlreadyRead <= fEcal->MaxCrysInStin()) {
1321  if (Standard_X_Quantity == "Smp" && Standard_Y_Quantity == "MSp") {
1322  XtalSamplesEv(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, StandardPlotOption);
1323  }
1324  if (Standard_X_Quantity == "MSp" && Standard_Y_Quantity == "NOS") {
1325  EvSamplesXtals(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, StandardPlotOption);
1326  }
1327  if (Standard_X_Quantity == "Smp" && Standard_Y_Quantity == "SSp") {
1328  XtalSamplesSigma(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, StandardPlotOption);
1329  }
1330  if (Standard_X_Quantity == "SSp" && Standard_Y_Quantity == "NOS") {
1331  SigmaSamplesXtals(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, StandardPlotOption);
1332  }
1333  }
1334  } else {
1335  fFlagUserHistoMin = "OFF";
1336  fFlagUserHistoMax = "OFF";
1337  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;
1338  }
1339 }
1340 
1341 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1342  const TString& User_X_Quantity,
1343  const TString& User_Y_Quantity,
1344  const Int_t& n1StexStin,
1345  const Int_t& i0StinEcha,
1346  const Int_t& n1Sample) {
1347  Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, n1Sample, "");
1348 }
1349 
1350 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1351  const TString& User_X_Quantity,
1352  const TString& User_Y_Quantity,
1353  const Int_t& n1StexStin,
1354  const Int_t& i0StinEcha,
1355  const Int_t& n1Sample,
1356  const TString& UserPlotOption) {
1357  TString CallingMethod = "1D";
1358 
1359  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1360 
1361  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1362  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1363 
1364  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1365 
1366  if (Standard_X_Quantity != "?" && Standard_Y_Quantity != "?") {
1367  Int_t i0Sample = n1Sample - 1;
1368  fAlreadyRead = 1;
1369  ViewHisto(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, i0Sample, TechHistoCode, StandardPlotOption);
1370  } else {
1371  fFlagUserHistoMin = "OFF";
1372  fFlagUserHistoMax = "OFF";
1373  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;
1374  }
1375 }
1376 
1377 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity,
1378  const TString& User_Y_Quantity,
1379  const Int_t& n1StexStin,
1380  const Int_t& i0StinEcha,
1381  const Int_t& n1Sample) {
1382  Plot1DHisto(User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, n1Sample, "");
1383 }
1384 
1385 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity,
1386  const TString& User_Y_Quantity,
1387  const Int_t& n1StexStin,
1388  const Int_t& i0StinEcha,
1389  const Int_t& n1Sample,
1390  const TString& UserPlotOption) {
1391  TString CallingMethod = "1D";
1392 
1393  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1394 
1395  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1396  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1397 
1398  Int_t i0Sample = n1Sample - 1;
1399 
1400  if (Standard_X_Quantity != "?" && Standard_Y_Quantity != "?") {
1401  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1402  ViewHisto(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, i0Sample, TechHistoCode, StandardPlotOption);
1403  } else {
1404  fFlagUserHistoMin = "OFF";
1405  fFlagUserHistoMax = "OFF";
1406  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;
1407  }
1408 }
1409 
1410 //---------------------------------------------------------------------------------------
1411 //
1412 // (ReadAnd)PlotHistory
1413 //
1414 //---------------------------------------------------------------------------------------
1415 void TEcnaHistos::PlotHistory(const TString& User_X_Quantity,
1416  const TString& User_Y_Quantity,
1417  const TString& list_of_run_file_name,
1418  const Int_t& StexStin_A,
1419  const Int_t& i0StinEcha) {
1420  PlotHistory(User_X_Quantity, User_Y_Quantity, list_of_run_file_name, StexStin_A, i0StinEcha, "");
1421 }
1422 
1423 void TEcnaHistos::PlotHistory(const TString& User_X_Quantity,
1424  const TString& User_Y_Quantity,
1425  const TString& list_of_run_file_name,
1426  const Int_t& StexStin_A,
1427  const Int_t& i0StinEcha,
1428  const TString& UserPlotOption) {
1429  TString CallingMethod = "Time";
1430 
1431  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1432 
1433  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1434  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1435 
1436  if (Standard_X_Quantity != "?" && Standard_Y_Quantity != "?") {
1437  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1438  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, TechHistoCode, StandardPlotOption);
1439  } else {
1440  fFlagUserHistoMin = "OFF";
1441  fFlagUserHistoMax = "OFF";
1442  std::cout << "!TEcnaHistos::PlotHistory(...)> Histo cannot be reached." << fTTBELL << std::endl;
1443  }
1444 }
1445 
1446 //=============================================================================================
1447 //
1448 // " V I E W " M E T H O D S
1449 //
1450 //=============================================================================================
1451 
1452 //=============================================================================================================
1453 //
1454 // ViewMatrix(***)
1455 //
1456 // arg_read_matrix: 2D array
1457 // arg_AlreadyRead: =1 <=> use arg_read_matrix
1458 // =0 <=> read the 2D array in this method with TEcnaRead
1459 // StexStin_A: tower number in SM (if EB) OR SC "ECNA" number in Dee (if EE)
1460 // StexStin_B: tower' number in SM (if EB) OR SC' "ECNA" number in Dee (if EE)
1461 // MatrixBinIndex: channel number in tower (if EB) OR in SC (if EE)
1462 // CorOrCov: flag CORRELATION/COVARIANCE
1463 // BetweenWhat: flag BETWEEN SAMPLES / BETWEEN CHANNELS / BETWEEN TOWERS / BETWEEN SCs / LF, HF, ...
1464 // PlotOption: ROOT 2D histos draw options (COLZ, LEGO, ...) + additional (ASCII)
1465 //
1466 // MatrixBinIndex: = i0StinEcha if cov(s,s'), cor(s,s')
1467 // = 0 if cov(c,c'), cor(c,c'), cov(Stin,Stin'), cor(Stin,Stin')
1468 //
1469 // ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, CorOrCov, BetweenWhat, PlotOption)
1470 // ViewMatrix(StexStin_A, 0, i0StinEcha, CorOrCov, "Mss", PlotOption)
1471 // Output:
1472 // Plot of cov(s,s') or cor(s,s') matrix for i0StinEcha of StexStin_A
1473 //
1474 // ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, CorOrCov, BetweenWhat, PlotOption)
1475 // ViewMatrix(StexStin_A, StexStin_B, 0, CorOrCov, "Mcc", PlotOption)
1476 // Output:
1477 // Plot LF-HF Corcc matrix for Stins: (StexStin_A, StexStin_B)
1478 //
1479 // ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, CorOrCov, BetweenWhat, PlotOption)
1480 // ViewMatrix( 0, 0, 0, CorOrCov, "Mcc", PlotOption)
1481 // Output:
1482 // Plot of LF-HF Corcc matrix for Stex (big matrix)
1483 //
1484 // ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, CorOrCov, BetweenWhat, PlotOption)
1485 // ViewMatrix( 0, 0, 0, CorOrCov, "Mtt", PlotOption)
1486 // Output:
1487 // Plot of LF-HF Cortt matrix
1488 //
1489 //=============================================================================================================
1490 void TEcnaHistos::ViewMatrix(const TMatrixD& arg_read_matrix,
1491  const Int_t& arg_AlreadyRead,
1492  const Int_t& StexStin_A,
1493  const Int_t& StexStin_B,
1494  const Int_t& MatrixBinIndex,
1495  const TString& CorOrCov,
1496  const TString& BetweenWhat,
1497  const TString& PlotOption) {
1498  //Plot correlation or covariance matrix between samples or channels or Stins
1499 
1500  if ((fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas())) {
1501  Bool_t OKArray = kFALSE;
1502  Bool_t OKData = kFALSE;
1503  TVectorD vStin(fEcal->MaxStinEcnaInStex());
1504 
1505  if (arg_AlreadyRead == fTobeRead) {
1509  fFapRunNumber,
1514  fCfgResultsRootFilePath.Data());
1515  OKArray = fMyRootFile->LookAtRootFile();
1516  if (OKArray == kTRUE) {
1518  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
1519  // std::cout << "*TEcnaHistos::ViewMatrix(...)> Data are analyzed from file ----> "
1520  // << fp_name_short << std::endl;
1521  //...................................................................... (ViewMatrix)
1522  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
1523  vStin(i) = (Double_t)0.;
1524  }
1526 
1530 
1531  if (fMyRootFile->DataExist() == kTRUE) {
1532  OKData = kTRUE;
1533  }
1534  }
1535  }
1536  if (arg_AlreadyRead >= 1) {
1537  OKArray = kTRUE;
1538  OKData = kTRUE;
1539  if (fFlagSubDet == "EB") {
1540  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
1541  vStin(i) = i;
1542  }
1543  }
1544  if (fFlagSubDet == "EE") {
1545  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
1546  vStin(i) = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i));
1547  }
1548  }
1549  }
1550 
1551  if (OKArray == kTRUE) // (ViewMatrix)
1552  {
1553  fStatusFileFound = kTRUE;
1554 
1555  if (OKData == kTRUE) {
1556  fStatusDataExist = kTRUE;
1557 
1558  Int_t Stin_X_ok = 0;
1559  Int_t Stin_Y_ok = 0;
1560 
1561  if ((BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins)) {
1562  Stin_X_ok = 1;
1563  Stin_Y_ok = 1;
1564  }
1565  if (BetweenWhat == fBetweenSamples) {
1566  Stin_Y_ok = 1;
1567  }
1568 
1569  for (Int_t index_Stin = 0; index_Stin < fEcal->MaxStinEcnaInStex(); index_Stin++) {
1570  if (vStin(index_Stin) == StexStin_A) {
1571  Stin_X_ok = 1;
1572  }
1573  if (vStin(index_Stin) == StexStin_B) {
1574  Stin_Y_ok = 1;
1575  }
1576  }
1577  //................................................................. (ViewMatrix)
1578  if (Stin_X_ok == 1 && Stin_Y_ok == 1) {
1579  Int_t MatSize = -1;
1580  Int_t ReadMatSize = -1;
1581  Int_t i0StinEcha = -1;
1582 
1583  //-------------------------- Set values of ReadMatSize, MatSize, i0StinEcha
1584  if (BetweenWhat == fBetweenSamples) {
1585  ReadMatSize = fFapNbOfSamples;
1586  MatSize = fEcal->MaxSampADC();
1587  i0StinEcha = (Int_t)MatrixBinIndex;
1588  }
1589 
1590  if (BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels) {
1591  ReadMatSize = fEcal->MaxCrysInStin();
1592  MatSize = fEcal->MaxCrysInStin(); /*i0Sample=MatrixBinIndex;*/
1593  }
1594 
1595  if ((BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins)) {
1596  ReadMatSize = fEcal->MaxStinEcnaInStex();
1597  MatSize = fEcal->MaxStinInStex();
1598  }
1599 
1600  //------------------------------------------------------------------------------------- (ViewMatrix)
1601  if ((BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins) ||
1602  (BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels
1603  /* && (i0Sample >= 0) && (i0Sample < fFapNbOfSamples ) */) ||
1604  ((BetweenWhat == fBetweenSamples) && (i0StinEcha >= 0) && (i0StinEcha < fEcal->MaxCrysInStin()))) {
1605  TMatrixD read_matrix(ReadMatSize, ReadMatSize);
1606  for (Int_t i = 0; i - ReadMatSize < 0; i++) {
1607  for (Int_t j = 0; j - ReadMatSize < 0; j++) {
1608  read_matrix(i, j) = (Double_t)0.;
1609  }
1610  }
1611 
1612  Bool_t OKData = kFALSE;
1613  if (arg_AlreadyRead == fTobeRead) {
1614  if (BetweenWhat == fBetweenSamples && CorOrCov == fCovarianceMatrix) {
1615  read_matrix = fMyRootFile->ReadCovariancesBetweenSamples(StexStin_A, i0StinEcha, ReadMatSize);
1616  }
1617 
1618  if (BetweenWhat == fBetweenSamples && CorOrCov == fCorrelationMatrix) {
1619  read_matrix = fMyRootFile->ReadCorrelationsBetweenSamples(StexStin_A, i0StinEcha, ReadMatSize);
1620  }
1621 
1622  if (BetweenWhat == fLFBetweenChannels && CorOrCov == fCovarianceMatrix) {
1623  read_matrix =
1624  fMyRootFile->ReadLowFrequencyCovariancesBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);
1625  }
1626 
1627  if (BetweenWhat == fLFBetweenChannels && CorOrCov == fCorrelationMatrix) {
1628  read_matrix =
1629  fMyRootFile->ReadLowFrequencyCorrelationsBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);
1630  }
1631 
1632  if (BetweenWhat == fHFBetweenChannels && CorOrCov == fCovarianceMatrix) {
1633  read_matrix =
1634  fMyRootFile->ReadHighFrequencyCovariancesBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);
1635  }
1636 
1637  if (BetweenWhat == fHFBetweenChannels && CorOrCov == fCorrelationMatrix) {
1638  read_matrix =
1639  fMyRootFile->ReadHighFrequencyCorrelationsBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);
1640  }
1641 
1642  if (BetweenWhat == fLFBetweenStins && CorOrCov == fCorrelationMatrix) {
1643  read_matrix = fMyRootFile->ReadLowFrequencyMeanCorrelationsBetweenStins(ReadMatSize);
1644  }
1645 
1646  if (BetweenWhat == fHFBetweenStins && CorOrCov == fCorrelationMatrix) {
1647  read_matrix = fMyRootFile->ReadHighFrequencyMeanCorrelationsBetweenStins(ReadMatSize);
1648  }
1649 
1650  OKData = fMyRootFile->DataExist();
1651  } else {
1652  read_matrix = arg_read_matrix;
1653  OKData = kTRUE;
1654  }
1655  //.......................................................... (ViewMatrix)
1656  if (OKData == kTRUE) {
1657  fStatusDataExist = kTRUE;
1658 
1659  if (PlotOption == "ASCII") {
1660  WriteMatrixAscii(BetweenWhat, CorOrCov, StexStin_A, MatrixBinIndex, ReadMatSize, read_matrix);
1661  } else {
1662  //......................... matrix title (ViewMatrix)
1663  char f_in_mat_tit[charArrLen];
1664 
1665  if (BetweenWhat == fBetweenSamples && CorOrCov == fCovarianceMatrix) {
1666  sprintf(f_in_mat_tit, "Covariance(Sample, Sample')");
1667  }
1668  if (BetweenWhat == fBetweenSamples && CorOrCov == fCorrelationMatrix) {
1669  sprintf(f_in_mat_tit, "Correlation(Sample, Sample')");
1670  }
1671 
1672  if (fFlagSubDet == "EB") {
1673  if (BetweenWhat == fLFBetweenStins && CorOrCov == fCorrelationMatrix) {
1674  sprintf(f_in_mat_tit, "Mean LF |Cor(Xtal,Xtal')| for each (Tower,Tower')");
1675  }
1676  if (BetweenWhat == fHFBetweenStins && CorOrCov == fCorrelationMatrix) {
1677  sprintf(f_in_mat_tit, "Mean HF |Cor(Xtal,Xtal')| for each (Tower,Tower')");
1678  }
1679  }
1680  if (fFlagSubDet == "EE") {
1681  if (BetweenWhat == fLFBetweenStins && CorOrCov == fCorrelationMatrix) {
1682  sprintf(f_in_mat_tit, "Mean LF |Cor(Xtal,Xtal')| for each (SC,SC')");
1683  }
1684  if (BetweenWhat == fHFBetweenStins && CorOrCov == fCorrelationMatrix) {
1685  sprintf(f_in_mat_tit, "Mean HF |Cor(Xtal,Xtal')| for each (SC,SC')");
1686  }
1687  }
1688 
1689  if (BetweenWhat == fLFBetweenChannels && CorOrCov == fCorrelationMatrix) {
1690  if (fFlagSubDet == "EB") {
1691  sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') matrix elts for (Tow,Tow')");
1692  }
1693  if (fFlagSubDet == "EE") {
1694  sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') matrix elts for (SC,SC')");
1695  }
1696  }
1697  if (BetweenWhat == fHFBetweenChannels && CorOrCov == fCorrelationMatrix) {
1698  if (fFlagSubDet == "EB") {
1699  sprintf(f_in_mat_tit, "HF Cor(Xtal,Xtal') matrix elts for (Tow,Tow')");
1700  }
1701  if (fFlagSubDet == "EE") {
1702  sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') matrix elts for (SC,SC')");
1703  }
1704  }
1705 
1706  //................................. Axis parameters (ViewMatrix)
1707  TString axis_x_var_name;
1708  TString axis_y_var_name;
1709 
1710  char f_in_axis_x[charArrLen];
1711  char f_in_axis_y[charArrLen];
1712 
1713  if (BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins) {
1714  if (fFlagSubDet == "EB") {
1715  sprintf(f_in_axis_x, " %s number ", fFapStinName.Data());
1716  }
1717  if (fFlagSubDet == "EE") {
1718  sprintf(f_in_axis_x, " %s number for construction ", fFapStinName.Data());
1719  }
1720 
1721  axis_x_var_name = f_in_axis_x;
1722  axis_y_var_name = f_in_axis_x;
1723  }
1724  if (BetweenWhat == fBetweenSamples) {
1725  axis_x_var_name = " Sample ";
1726  axis_y_var_name = " Sample ";
1727  }
1728  if (BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels) {
1729  sprintf(f_in_axis_x, " Crystal %s %d ", fFapStinName.Data(), StexStin_A);
1730  sprintf(f_in_axis_y, " Crystal %s %d ", fFapStinName.Data(), StexStin_B);
1731  axis_x_var_name = f_in_axis_x;
1732  axis_y_var_name = f_in_axis_y;
1733  }
1734 
1735  Int_t nb_binx = MatSize;
1736  Int_t nb_biny = MatSize;
1737  Axis_t xinf_bid = (Axis_t)0.;
1738  Axis_t xsup_bid = (Axis_t)MatSize;
1739  Axis_t yinf_bid = (Axis_t)0.;
1740  Axis_t ysup_bid = (Axis_t)MatSize;
1741 
1742  if ((fFlagSubDet == "EE") && (BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins)) {
1743  if (fFapStexNumber == 1 || fFapStexNumber == 3) {
1744  xinf_bid += fEcal->MaxStinInStex();
1745  xsup_bid += fEcal->MaxStinInStex();
1746  yinf_bid += fEcal->MaxStinInStex();
1747  ysup_bid += fEcal->MaxStinInStex();
1748  }
1749  }
1750  //................................................... histogram booking (ViewMatrix)
1751  TH2D* h_fbid0 =
1752  new TH2D("bidim", f_in_mat_tit, nb_binx, xinf_bid, xsup_bid, nb_biny, yinf_bid, ysup_bid);
1753  fCnewRoot++;
1754  h_fbid0->Reset();
1755 
1756  h_fbid0->GetXaxis()->SetTitle(axis_x_var_name);
1757  h_fbid0->GetYaxis()->SetTitle(axis_y_var_name);
1758 
1759  //------------------------------------------------ F I L L H I S T O (ViewMatrix)
1760  if ((fFlagSubDet == "EE") && (BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins)) {
1761  for (Int_t i = 0; i < ReadMatSize; i++) {
1762  for (Int_t j = 0; j < ReadMatSize; j++) {
1763  Int_t ip = i + 1;
1764  Double_t xi_bid = (Double_t)fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, ip);
1765  Int_t jp = j + 1;
1766  Double_t xj_bid = (Double_t)fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, jp);
1767  if (xi_bid > 0 && xj_bid > 0) {
1768  Int_t xi_bid_m = xi_bid - 1;
1769  Int_t xj_bid_m = xj_bid - 1;
1770  h_fbid0->Fill(xi_bid_m, xj_bid_m, read_matrix(i, j));
1771  }
1772  }
1773  }
1774  } else {
1775  for (Int_t i = 0; i - ReadMatSize < 0; i++) {
1776  Double_t xi = (Double_t)i;
1777  for (Int_t j = 0; j < ReadMatSize; j++) {
1778  Double_t xj = (Double_t)j;
1779  Double_t mat_val = (Double_t)read_matrix(i, j);
1780  h_fbid0->Fill(xi, xj, (Double_t)mat_val);
1781  }
1782  }
1783  }
1784  //--------------- H I S T O M I N / M A X M A N A G E M E N T (ViewMatrix)
1785 
1786  //................................ Put histo min max values
1787  TString quantity_code = "D_MCs_ChNb";
1788  if (CorOrCov == fCorrelationMatrix) {
1789  if (BetweenWhat == fBetweenSamples) {
1790  quantity_code = "D_MCs_ChNb";
1791  }
1792 
1793  if (BetweenWhat == fLFBetweenChannels) {
1794  quantity_code = "H2LFccMosMatrix";
1795  }
1796  if (BetweenWhat == fHFBetweenChannels) {
1797  quantity_code = "H2HFccMosMatrix";
1798  }
1799 
1800  if (BetweenWhat == fLFBetweenStins) {
1801  quantity_code = "H2LFccMosMatrix";
1802  }
1803  if (BetweenWhat == fHFBetweenStins) {
1804  quantity_code = "H2HFccMosMatrix";
1805  }
1806  }
1807  if (CorOrCov == fCovarianceMatrix) {
1808  quantity_code = "H2HFccMosMatrix";
1809  }
1810  //.......... default if flag not set to "ON"
1811  SetYminMemoFromValue(quantity_code, fCnaParHistos->GetYminDefaultValue(quantity_code));
1812  SetYmaxMemoFromValue(quantity_code, fCnaParHistos->GetYmaxDefaultValue(quantity_code));
1813 
1814  if (fUserHistoMin == fUserHistoMax) {
1815  fFlagUserHistoMin = "AUTO";
1816  fFlagUserHistoMax = "AUTO";
1817  }
1818  //................................. User's min and/or max (ViewMatrix)
1819  if (fFlagUserHistoMin == "ON") {
1820  SetYminMemoFromValue(quantity_code, fUserHistoMin);
1821  fFlagUserHistoMin = "OFF";
1822  }
1823  if (fFlagUserHistoMax == "ON") {
1824  SetYmaxMemoFromValue(quantity_code, fUserHistoMax);
1825  fFlagUserHistoMax = "OFF";
1826  }
1827  //................................. automatic min and/or max
1828  if (fFlagUserHistoMin == "AUTO") {
1829  SetYminMemoFromValue(quantity_code, h_fbid0->GetMinimum());
1830  fFlagUserHistoMin = "OFF";
1831  }
1832  if (fFlagUserHistoMax == "AUTO") {
1833  SetYmaxMemoFromValue(quantity_code, h_fbid0->GetMaximum());
1834  fFlagUserHistoMax = "OFF";
1835  }
1836  //...................................... histo set ymin and ymax (ViewMatrix)
1837  if (CorOrCov == fCorrelationMatrix) {
1838  if (BetweenWhat == fBetweenSamples) {
1839  SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "D_MCs_ChNb");
1840  }
1841  if (BetweenWhat == fLFBetweenStins || BetweenWhat == fLFBetweenChannels) {
1842  SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "H2LFccMosMatrix");
1843  }
1844  if (BetweenWhat == fHFBetweenStins || BetweenWhat == fHFBetweenChannels) {
1845  SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "H2HFccMosMatrix");
1846  }
1847  //************************** A GARDER EN RESERVE ******************************
1848  //............. special contour level for correlations (square root wise scale)
1849  // Int_t nb_niv = 9;
1850  // Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
1851  // SqrtContourLevels(nb_niv, &cont_niv[0]);
1852  // h_fbid0->SetContour(nb_niv, &cont_niv[0]);
1853  // delete [] cont_niv; fCdelete++;
1854  //******************************** (FIN RESERVE) ******************************
1855  }
1856  if (CorOrCov == fCovarianceMatrix) {
1857  if (BetweenWhat == fBetweenSamples) {
1858  SetYminMemoFromPreviousMemo("D_TNo_ChNb"); // covariance => same level as sigmas
1859  SetYmaxMemoFromPreviousMemo("D_TNo_ChNb");
1860  SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "D_TNo_ChNb");
1861  }
1862  if (BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins ||
1863  BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels) {
1864  SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "H2HFccMosMatrix");
1865  }
1866  }
1867 
1868  // ----------------------------------------------- P L O T S (ViewMatrix)
1869  char f_in[charArrLen];
1870  //...................... Taille/format canvas
1871  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
1872  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
1873 
1874  //............................. options generales
1875  TString HistoType;
1876  HistoType.Resize(charArrLen);
1877  HistoType = "(no quantity type info)";
1878 
1879  if (PlotOption == "COLZ") {
1880  HistoType = "colz";
1881  }
1882  if (PlotOption == "BOX") {
1883  HistoType = "colz";
1884  }
1885  if (PlotOption == "TEXT") {
1886  HistoType = "colz";
1887  }
1888  if (PlotOption == "CONTZ") {
1889  HistoType = "colz";
1890  }
1891  if (PlotOption == "LEGO2Z") {
1892  HistoType = "lego";
1893  }
1894  if (PlotOption == "SURF1Z") {
1895  HistoType = "surf";
1896  }
1897  if (PlotOption == "SURF2Z") {
1898  HistoType = "surf";
1899  }
1900  if (PlotOption == "SURF3Z") {
1901  HistoType = "surf";
1902  }
1903  if (PlotOption == "SURF4") {
1904  HistoType = "surf";
1905  }
1906 
1907  if (fFlagSubDet == "EB") {
1909  SetAllPavesViewMatrix(BetweenWhat.Data(), StexStin_A, StexStin_B, i0StinEcha);
1910  }
1911  if (fFlagSubDet == "EE") {
1914  SetAllPavesViewMatrix(BetweenWhat.Data(), StexStin_A, StexStin_B, i0StinEcha);
1915  }
1916 
1917  //---------------------------------------- Canvas name (ViewMatrix)
1918  TString name_cov_cor;
1919  name_cov_cor.Resize(charArrLen);
1920  name_cov_cor = "?";
1921  if (CorOrCov == fCovarianceMatrix) {
1922  name_cov_cor = "Covariance";
1923  }
1924  if (CorOrCov == fCorrelationMatrix) {
1925  name_cov_cor = "Correlation";
1926  }
1927 
1928  TString name_chan_samp;
1929  name_chan_samp.Resize(charArrLen);
1930  name_chan_samp = "?";
1931 
1932  if (BetweenWhat == fLFBetweenStins) {
1933  name_chan_samp = "LFccMos";
1934  }
1935  if (BetweenWhat == fHFBetweenStins) {
1936  name_chan_samp = "HFccMos";
1937  }
1938 
1939  if (BetweenWhat == fLFBetweenChannels) {
1940  name_chan_samp = "LF_cc";
1941  }
1942  if (BetweenWhat == fHFBetweenChannels) {
1943  name_chan_samp = "HF_cc";
1944  }
1945 
1946  if (BetweenWhat == fBetweenSamples) {
1947  name_chan_samp = "Between_Samples"; // MatrixBinIndex = i0StinEcha
1948  }
1949 
1950  TString name_visu;
1951  name_visu.Resize(charArrLen);
1952  name_visu = "?";
1953 
1954  name_visu = PlotOption;
1955 
1956  if ((BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins)) {
1957  sprintf(f_in,
1958  "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%s",
1959  name_cov_cor.Data(),
1960  name_chan_samp.Data(),
1961  fFapAnaType.Data(),
1963  fFapRunNumber,
1966  fFapStexName.Data(),
1968  name_visu.Data());
1969  }
1970 
1971  if (BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels) {
1972  sprintf(f_in,
1973  "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%sX%d_%sY%d_%s",
1974  name_cov_cor.Data(),
1975  name_chan_samp.Data(),
1976  fFapAnaType.Data(),
1978  fFapRunNumber,
1981  fFapStexName.Data(),
1983  fFapStexName.Data(),
1984  StexStin_A,
1985  fFapStexName.Data(),
1986  StexStin_B,
1987  name_visu.Data());
1988  }
1989 
1990  if (BetweenWhat == fBetweenSamples) {
1991  sprintf(f_in,
1992  "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%sX%d_%sY%d_ElecChannel_%d_%s",
1993  name_cov_cor.Data(),
1994  name_chan_samp.Data(),
1995  fFapAnaType.Data(),
1997  fFapRunNumber,
2000  fFapStexName.Data(),
2002  fFapStexName.Data(),
2003  StexStin_A,
2004  fFapStexName.Data(),
2005  StexStin_B,
2006  MatrixBinIndex,
2007  name_visu.Data());
2008  }
2009 
2010  //---------------------------------------------------------- (ViewMatrix)
2011 
2012  SetHistoPresentation((TH1D*)h_fbid0, HistoType);
2013  TCanvas* MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h);
2014  fCnewRoot++;
2015  fCurrentCanvas = MainCanvas;
2016  fCurrentCanvasName = f_in;
2017 
2018  // std::cout << "*TEcnaHistos::ViewMatrix(...)> Plot is displayed on canvas ----> "
2019  // << fCurrentCanvasName << std::endl;
2020  // std::cout << "*TEcnaHistos::ViewMatrix(...)> fCurrentCanvas = " << fCurrentCanvas << std::endl;
2021 
2022  if (fPavComGeneralTitle != nullptr) {
2023  fPavComGeneralTitle->Draw();
2024  }
2025  fPavComStex->Draw();
2026 
2027  if (BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels) {
2028  fPavComStin->Draw();
2029  }
2030  if (BetweenWhat == fBetweenSamples) {
2031  fPavComStin->Draw();
2032  fPavComXtal->Draw();
2033  }
2034 
2035  fPavComAnaRun->Draw();
2036  fPavComNbOfEvts->Draw();
2037 
2038  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
2039  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
2040  MainCanvas->Divide(1, 1, x_margin, y_margin);
2041  gPad->cd(1);
2042 
2043  //---------------------------------------------------------- (ViewMatrix)
2044  Int_t logy = 0;
2045  gPad->SetLogy(logy);
2046  if ((BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins)) {
2047  gPad->SetGrid(1, 1);
2048  }
2049  h_fbid0->DrawCopy(PlotOption);
2050  h_fbid0->SetStats(true);
2051  gPad->Update();
2052  h_fbid0->Delete();
2053  h_fbid0 = nullptr;
2054  fCdeleteRoot++;
2055 
2056  //MainCanvas->Delete(); fCdeleteRoot++;
2057  }
2058  } // end of if ( OKData == kTRUE )
2059  else {
2060  fStatusDataExist = kFALSE;
2061  }
2062  } // end of if ((BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins) ) ||
2063  //( (BetweenWhat == fBetweenSamples) && (i0StinEcha>= 0) && (i0StinEcha<fEcal->MaxCrysInStin())) ||
2064  //( (BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels)
2065  // /* && (i0Sample >= 0) && (i0Sample < fFapNbOfSamples ) */ ) )
2066  else {
2067  if (BetweenWhat == fBetweenSamples) {
2068  std::cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* ==> Wrong channel number in " << fFapStinName.Data()
2069  << ". Value = " << i0StinEcha << " (required range: [0, " << fEcal->MaxCrysInStin() - 1 << "] )"
2070  << fTTBELL << std::endl;
2071  }
2072 
2073  // if( BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels )
2074  // {
2075  // std::cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* ==> Wrong sample index. Value = "
2076  // << i0Sample << " (required range: [0, "
2077  // << fFapNbOfSamples-1 << "] )"
2078  // << fTTBELL << std::endl;
2079  //}
2080  }
2081  } else // else of the if ( Stin_X_ok ==1 && Stin_Y_ok ==1 )
2082  {
2083  //---------------------------------------------------------- (ViewMatrix)
2084  if (Stin_X_ok != 1) {
2085  if (fFlagSubDet == "EB") {
2086  std::cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> " << fFapStinName.Data() << " " << StexStin_A
2087  << ", " << fFapStinName.Data() << " not found. Available numbers = ";
2088  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
2089  if (vStin(i) > 0) {
2090  std::cout << vStin(i) << ", ";
2091  }
2092  }
2093  }
2094 
2095  if (fFlagSubDet == "EE") {
2096  std::cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> " << fFapStinName.Data() << " "
2098  << fFapStinName.Data() << " not found. Available numbers = ";
2099  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
2100  if (vStin(i) > 0) {
2102  }
2103  }
2104  }
2105  std::cout << fTTBELL << std::endl;
2106  }
2107  if (Stin_Y_ok != 1) {
2108  if (fFlagSubDet == "EB") {
2109  std::cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> " << fFapStinName.Data() << " " << StexStin_B
2110  << ", " << fFapStinName.Data() << " not found. Available numbers = ";
2111  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
2112  if (vStin(i) > 0) {
2113  std::cout << vStin(i) << ", ";
2114  }
2115  }
2116  }
2117 
2118  if (fFlagSubDet == "EE") {
2119  std::cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> " << fFapStinName.Data() << " "
2121  << fFapStinName.Data() << " not found. Available numbers = ";
2122  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
2123  if (vStin(i) > 0) {
2125  }
2126  }
2127  }
2128  std::cout << fTTBELL << std::endl;
2129  }
2130  }
2131  } // end of if ( fMyRootFile->DataExist() == kTRUE )
2132  else {
2133  fStatusDataExist = kFALSE;
2134  std::cout << "!TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
2135  << " Histo not available." << fTTBELL << std::endl;
2136  fFlagUserHistoMin = "OFF";
2137  fFlagUserHistoMax = "OFF";
2138  }
2139  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
2140  else {
2141  fStatusFileFound = kFALSE;
2142  std::cout << "!TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
2143  << " ROOT file not found" << fTTBELL << std::endl;
2144  }
2145  } // ---- end of if( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) ) -----
2146  else {
2147  std::cout << "!TEcnaHistos::ViewMatrix(...)> " << fFapStexName.Data() << " = " << fFapStexNumber
2148  << ". Out of range (range = [1," << fEcal->MaxStexInStas() << "]) " << fTTBELL << std::endl;
2149  }
2150 } // end of ViewMatrix(...)
2151 
2152 //==========================================================================
2153 //
2154 // ViewStin ( => option COLZ )
2155 //
2156 //==========================================================================
2157 
2158 void TEcnaHistos::CorrelationsBetweenSamples(const Int_t& StinNumber) {
2159  TString CorOrCov = fCorrelationMatrix;
2160  ViewStin(StinNumber, CorOrCov);
2161 }
2162 
2163 void TEcnaHistos::CovariancesBetweenSamples(const Int_t& StinNumber) {
2164  TString CorOrCov = fCovarianceMatrix;
2165  ViewStin(StinNumber, CorOrCov);
2166 }
2167 
2168 //==========================================================================
2169 //
2170 // ViewStin ( => option COLZ )
2171 //
2172 // StexStin ==>
2173 // (sample,sample) cor or cov matrices for all the crystal of StexStin
2174 //
2175 //
2176 //==========================================================================
2177 void TEcnaHistos::ViewStin(const Int_t& cStexStin, const TString& CorOrCov) {
2178  //cor(s,s') or cov(s,s') matrices for all the crystals of one given Stin. Option COLZ mandatory.
2179 
2180  // cStexStin = number for cons (in case of EE)
2181  // StexStin = ECNA number
2182 
2183  if ((fFapStexNumber > 0) && fFapStexNumber <= fEcal->MaxStexInStas()) {
2184  Int_t StexStin = cStexStin;
2185  if (fFlagSubDet == "EE") {
2187  }
2188 
2192  fFapRunNumber,
2197  fCfgResultsRootFilePath.Data());
2198 
2199  if (fMyRootFile->LookAtRootFile() == kTRUE) // (ViewStin)
2200  {
2201  fStatusFileFound = kTRUE;
2202 
2204  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
2205  // std::cout << "*TEcnaHistos::ViewStin(...)> Data are analyzed from file ----> "
2206  // << fp_name_short << std::endl;
2207 
2208  TVectorD vStin(fEcal->MaxStinEcnaInStex());
2209  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
2210  vStin(i) = (Double_t)0.;
2211  }
2213 
2214  if (fMyRootFile->DataExist() == kTRUE) {
2215  fStatusDataExist = kTRUE;
2216 
2217  Int_t Stin_ok = 0;
2218  for (Int_t index_Stin = 0; index_Stin < fEcal->MaxStinEcnaInStex(); index_Stin++) {
2219  if (vStin(index_Stin) == StexStin) {
2220  Stin_ok++;
2221  }
2222  }
2223 
2224  if (Stin_ok == 1) {
2228 
2229  //......................... matrix title (ViewStin)
2230  char f_in_mat_tit[charArrLen];
2231 
2232  if (CorOrCov == fCovarianceMatrix) {
2233  sprintf(f_in_mat_tit, "Xtal's Cov(s,s') matrices in %s.", fFapStinName.Data());
2234  }
2235  if (CorOrCov == fCorrelationMatrix) {
2236  sprintf(f_in_mat_tit, "Xtal's Cor(s,s') matrices in %s.", fFapStinName.Data());
2237  }
2238 
2239  //................................. Bidim parameters
2240  Int_t GeoBidSize = fEcal->MaxSampADC() * fEcal->MaxCrysHocoInStin();
2241  Int_t nb_binx = GeoBidSize;
2242  Int_t nb_biny = GeoBidSize;
2243  Axis_t xinf_bid = (Axis_t)0.;
2244  Axis_t xsup_bid = (Axis_t)GeoBidSize;
2245  Axis_t yinf_bid = (Axis_t)0.;
2246  Axis_t ysup_bid = (Axis_t)GeoBidSize;
2247 
2248  //--------------------------------------------------------- (ViewStin)
2249  //............. matrices reading and histogram filling
2250 
2251  TH2D* h_geo_bid =
2252  new TH2D("geobidim_ViewStin", f_in_mat_tit, nb_binx, xinf_bid, xsup_bid, nb_biny, yinf_bid, ysup_bid);
2253  fCnewRoot++;
2254 
2255  h_geo_bid->Reset();
2256 
2257  //======================================================== (ViewStin)
2258 
2259  //----------------------------------------------- Geographical bidim filling
2260  Int_t ReadMatSize = fFapNbOfSamples;
2261  Int_t MatSize = fEcal->MaxSampADC();
2262  TMatrixD read_matrix(ReadMatSize, ReadMatSize);
2263  for (Int_t i = 0; i - ReadMatSize < 0; i++) {
2264  for (Int_t j = 0; j - ReadMatSize < 0; j++) {
2265  read_matrix(i, j) = (Double_t)0.;
2266  }
2267  }
2268 
2269  Int_t i_data_exist = 0;
2270 
2271  for (Int_t n_crys = 0; n_crys < fEcal->MaxCrysInStin(); n_crys++) {
2272  if (CorOrCov == fCovarianceMatrix) {
2273  read_matrix = fMyRootFile->ReadCovariancesBetweenSamples(StexStin, n_crys, ReadMatSize);
2274  }
2275  if (CorOrCov == fCorrelationMatrix) {
2276  read_matrix = fMyRootFile->ReadCorrelationsBetweenSamples(StexStin, n_crys, ReadMatSize);
2277  }
2278 
2279  if (fMyRootFile->DataExist() == kFALSE) {
2280  fStatusDataExist = kFALSE;
2281  break; // <= if no data: exiting loop over the channels
2282  } else {
2283  fStatusDataExist = kTRUE;
2284  i_data_exist++;
2285 
2286  for (Int_t i_samp = 0; i_samp < ReadMatSize; i_samp++) {
2287  Int_t i_xgeo = GetXSampInStin(fFapStexNumber, StexStin, n_crys, i_samp);
2288  for (Int_t j_samp = 0; j_samp < ReadMatSize; j_samp++) {
2289  Int_t j_ygeo = GetYSampInStin(fFapStexNumber, StexStin, n_crys, j_samp);
2290  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)j_ygeo, (Double_t)read_matrix(i_samp, j_samp));
2291  }
2292  }
2293  }
2294  }
2295 
2296  //=========== H I S T O M I N / M A X M A N A G E M E N T ======== (ViewStin)
2297  //................................ Put histo min max values
2298  TString quantity_code = "D_MCs_ChNb";
2299  if (CorOrCov == fCorrelationMatrix) {
2300  quantity_code = "D_MCs_ChNb";
2301  }
2302  if (CorOrCov == fCovarianceMatrix) {
2303  quantity_code = "H2HFccMosMatrix";
2304  }
2305 
2306  //.......... default if flag not set to "ON"
2307  SetYminMemoFromValue(quantity_code, fCnaParHistos->GetYminDefaultValue(quantity_code));
2308  SetYmaxMemoFromValue(quantity_code, fCnaParHistos->GetYmaxDefaultValue(quantity_code));
2309 
2310  if (fUserHistoMin == fUserHistoMax) {
2311  fFlagUserHistoMin = "AUTO";
2312  fFlagUserHistoMax = "AUTO";
2313  }
2314  //.......... user's min and/or max values
2315  if (fFlagUserHistoMin == "ON") {
2316  SetYminMemoFromValue(quantity_code, fUserHistoMin);
2317  fFlagUserHistoMin = "OFF";
2318  }
2319  if (fFlagUserHistoMax == "ON") {
2320  SetYmaxMemoFromValue(quantity_code, fUserHistoMax);
2321  fFlagUserHistoMax = "OFF";
2322  }
2323  //................................. automatic min and/or max
2324  if (fFlagUserHistoMin == "AUTO") {
2325  SetYminMemoFromValue(quantity_code, h_geo_bid->GetMinimum());
2326  fFlagUserHistoMin = "OFF";
2327  }
2328  if (fFlagUserHistoMax == "AUTO") {
2329  SetYmaxMemoFromValue(quantity_code, h_geo_bid->GetMaximum());
2330  fFlagUserHistoMax = "OFF";
2331  }
2332  //...................................... histo set ymin and ymax (ViewStin)
2333  if (CorOrCov == fCorrelationMatrix) {
2334  SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, "D_MCs_ChNb");
2335 
2336  // ************************** A GARDER EN RESERVE *******************************
2337  //............. special contour level for correlations (square root wise scale)
2338  //Int_t nb_niv = 9;
2339  //Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
2340  //SqrtContourLevels(nb_niv, &cont_niv[0]);
2341  //h_geo_bid->SetContour(nb_niv, &cont_niv[0]);
2342  //delete [] cont_niv; fCdelete++;
2343  // ******************************** (FIN RESERVE) *******************************
2344  }
2345  if (CorOrCov == fCovarianceMatrix) {
2346  SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, "D_TNo_ChNb");
2347  }
2348 
2349  // =================================== P L O T S ======================== (ViewStin)
2350  if (i_data_exist > 0) {
2351  char f_in[charArrLen];
2352 
2353  //...................... Taille/format canvas
2354  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
2355  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
2356 
2357  //.................................................. paves commentaires (ViewStin)
2358  SetAllPavesViewStin(StexStin);
2359 
2360  //------------------------------------ Canvas name ----------------- (ViewStin)
2361  TString name_cov_cor;
2362  name_cov_cor.Resize(charArrLen);
2363  name_cov_cor = "?";
2364  if (CorOrCov == fCovarianceMatrix) {
2365  name_cov_cor = "CovSS_Matrices_in_";
2366  }
2367  if (CorOrCov == fCorrelationMatrix) {
2368  name_cov_cor = "CorSS_Matrices_in_";
2369  }
2370 
2371  TString name_visu;
2372  name_visu.Resize(charArrLen);
2373  name_visu = "colz";
2374 
2375  sprintf(f_in,
2376  "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%s%d_%s",
2377  name_cov_cor.Data(),
2378  fFapStinName.Data(),
2379  fFapAnaType.Data(),
2381  fFapRunNumber,
2384  fFapStexName.Data(),
2386  fFapStinName.Data(),
2387  StexStin,
2388  name_visu.Data());
2389 
2390  SetHistoPresentation((TH1D*)h_geo_bid, "Stin");
2391 
2392  TCanvas* MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h);
2393  fCnewRoot++;
2394  fCurrentCanvas = MainCanvas;
2395  fCurrentCanvasName = f_in;
2396 
2397  // std::cout << "*TEcnaHistos::ViewStin(...)> Plot is displayed on canvas ----> " << f_in << std::endl;
2398 
2399  //------------------------ Canvas draw and update ------------ (ViewStin)
2400  if (fPavComGeneralTitle != nullptr) {
2401  fPavComGeneralTitle->Draw();
2402  }
2403  fPavComStex->Draw();
2404  fPavComStin->Draw();
2405  fPavComAnaRun->Draw();
2406  fPavComNbOfEvts->Draw();
2407 
2408  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
2409  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
2410  MainCanvas->Divide(1, 1, x_margin, y_margin);
2411  gPad->cd(1);
2412 
2413  Int_t logy = 0;
2414  gPad->SetLogy(logy);
2415 
2416  h_geo_bid->DrawCopy("COLZ");
2417 
2418  //--------------------------------------------------------------------------- (ViewStin)
2419  Int_t size_Hoco = fEcal->MaxCrysHocoInStin();
2420  Int_t size_Veco = fEcal->MaxCrysVecoInStin();
2421 
2422  ViewStinGrid(fFapStexNumber, StexStin, MatSize, size_Hoco, size_Veco, " ");
2423 
2424  gPad->Update();
2425 
2426  h_geo_bid->SetStats(true);
2427 
2428  // delete MainCanvas; fCdeleteRoot++;
2429  }
2430 
2431  h_geo_bid->Delete();
2432  h_geo_bid = nullptr;
2433  fCdeleteRoot++;
2434  } else {
2435  std::cout << "!TEcnaHistos::ViewStin(...)> *ERROR* =====> " << fFapStinName.Data() << " " << cStexStin
2436  << " not found."
2437  << " Available numbers = ";
2438  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
2439  if (vStin(i) > 0) {
2440  if (fFlagSubDet == "EB") {
2441  std::cout << (Int_t)vStin(i) << ", ";
2442  }
2443  if (fFlagSubDet == "EE") {
2445  }
2446  }
2447  }
2448  std::cout << fTTBELL << std::endl;
2449  }
2450  } // end of if ( myRootFile->DataExist() == kTRUE )
2451  else {
2452  fStatusDataExist = kFALSE;
2453  }
2454  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
2455  else {
2456  fStatusFileFound = kFALSE;
2457 
2458  std::cout << "!TEcnaHistos::ViewStin(...)> *ERROR* =====> "
2459  << " ROOT file not found" << fTTBELL << std::endl;
2460  }
2461  } else {
2462  std::cout << "!TEcnaHistos::ViewStin(...)> " << fFapStexName.Data() << " = " << fFapStexNumber
2463  << ". Out of range (range = [1," << fEcal->MaxStexInStas() << "]) " << fTTBELL << std::endl;
2464  }
2465 } // end of ViewStin(...)
2466 
2467 //====================================================================================
2468 //
2469 // StinCrystalNumbering
2470 // independent of the ROOT file => StexNumber as argument
2471 //
2472 //====================================================================================
2473 void TEcnaHistos::StinCrystalNumbering(const Int_t& StexNumber, const Int_t& cStexStin) {
2474  //display the crystal numbering of one Stin
2475  // cStexStin = Tower number in case of EB or SC number for construction in case of EE
2476 
2477  if (fFlagSubDet == "EB") {
2478  TowerCrystalNumbering(StexNumber, cStexStin);
2479  }
2480  if (fFlagSubDet == "EE") {
2481  SCCrystalNumbering(StexNumber, cStexStin);
2482  }
2483 }
2484 //----------------> end of StinCrystalNumbering()
2485 
2486 //====================================================================================
2487 //
2488 // TowerCrystalNumbering
2489 // independent of the ROOT file => SMNumber as argument
2490 //
2491 //====================================================================================
2492 void TEcnaHistos::TowerCrystalNumbering(const Int_t& SMNumber, const Int_t& n1SMTow) {
2493  //display the crystal numbering of one tower
2494 
2495  if ((SMNumber > 0) && (SMNumber <= fEcal->MaxSMInEB())) {
2497 
2498  Int_t MatSize = fEcal->MaxSampADC();
2499  Int_t size_eta = fEcal->MaxCrysEtaInTow();
2500  Int_t size_phi = fEcal->MaxCrysPhiInTow();
2501 
2502  //---------------------------------- bidim
2503 
2504  Int_t nb_bins = fEcal->MaxSampADC();
2505  Int_t nx_gbins = nb_bins * size_eta;
2506  Int_t ny_gbins = nb_bins * size_phi;
2507 
2508  Axis_t xinf_gbid = (Axis_t)0.;
2509  Axis_t xsup_gbid = (Axis_t)fEcal->MaxSampADC() * size_eta;
2510  Axis_t yinf_gbid = (Axis_t)0.;
2511  Axis_t ysup_gbid = (Axis_t)fEcal->MaxSampADC() * size_phi;
2512 
2513  TString fg_name = "M0' crystals";
2514  TString fg_tit = "Xtal numbering (chan. in tow, chan. in SM, Xtal in SM, hashed)";
2515 
2516  //----------------------- empty 2D histo for pave coordinates registration
2517  TH2D* h_gbid;
2518  h_gbid = new TH2D(fg_name.Data(), fg_tit.Data(), nx_gbins, xinf_gbid, xsup_gbid, ny_gbins, yinf_gbid, ysup_gbid);
2519  fCnewRoot++;
2520  h_gbid->Reset();
2521 
2522  //----------------- T R A C E D E S P L O T S ------ (TowerCrystalNumbering)
2523 
2524  char f_in[charArrLen];
2525 
2526  //...................... Taille/format canvas
2527 
2528  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
2529  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
2530 
2531  //........................................ couleurs
2532  Color_t couleur_noir = fCnaParHistos->SetColorsForNumbers("crystal");
2533  Color_t couleur_rouge = fCnaParHistos->SetColorsForNumbers("lvrb_top");
2534  Color_t couleur_bleu_fonce = fCnaParHistos->SetColorsForNumbers("lvrb_bottom");
2535 
2536  gStyle->SetPalette(1, nullptr); // Rainbow spectrum
2537 
2538  //.................................... options generales
2540 
2541  //.................................... paves commentaires (TowerCrystalNumbering)
2542 
2543  SetAllPavesViewStinCrysNb(SMNumber, n1SMTow);
2544 
2545  //---------------------------------------------- (TowerCrystalNumbering)
2546 
2547  //..................... Canvas name
2548  sprintf(f_in, "Crystal_Numbering_for_%s_X_%d_%s%d", fFapStinName.Data(), n1SMTow, fFapStexName.Data(), SMNumber);
2549 
2550  SetHistoPresentation((TH1D*)h_gbid, "Stin");
2551 
2552  TCanvas* MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h);
2553  fCnewRoot++;
2554  fCurrentCanvas = MainCanvas;
2555  fCurrentCanvasName = f_in;
2556 
2557  // std::cout << "*TEcnaHistosEB::TowerCrystalNumbering(...)> Plot is displayed on canvas ----> "
2558  // << f_in << std::endl;
2559 
2560  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
2561  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
2562  MainCanvas->Divide(1, 1, x_margin, y_margin);
2563 
2564  fPavComStex->Draw();
2565  fPavComStin->Draw();
2566  fPavComLVRB->Draw();
2567 
2568  Bool_t b_true = true;
2569  Bool_t b_false = false;
2570  gPad->cd(1);
2571 
2572  gStyle->SetMarkerColor(couleur_rouge);
2573 
2574  Int_t logy = 0;
2575  gPad->SetLogy(logy);
2576 
2577  //............................... bidim .......... (TowerCrystalNumbering)
2578 
2579  h_gbid->SetStats(b_false);
2580  h_gbid->DrawCopy("COLZ");
2581 
2582  //..... Ecriture des numeros de channels dans la grille..... (TowerCrystalNumbering)
2583  // et des numeros SM des cristaux
2584 
2585  //............... prepa arguments fixes appels [TText]->DrawText()
2586  char f_in_elec[charArrLen];
2587  TString TowerLvrbType = fEcalNumbering->GetTowerLvrbType(n1SMTow);
2588  TText* text_elec_num = new TText();
2589  fCnewRoot++;
2590  if (TowerLvrbType == "top") {
2591  text_elec_num->SetTextColor(couleur_rouge);
2592  }
2593  if (TowerLvrbType == "bottom") {
2594  text_elec_num->SetTextColor(couleur_bleu_fonce);
2595  }
2596  text_elec_num->SetTextSize(0.04);
2597 
2598  char f_in_sme[charArrLen];
2599  TText* text_sme_num = new TText();
2600  fCnewRoot++;
2601  if (TowerLvrbType == "top") {
2602  text_sme_num->SetTextColor(couleur_rouge);
2603  }
2604  if (TowerLvrbType == "bottom") {
2605  text_sme_num->SetTextColor(couleur_bleu_fonce);
2606  }
2607  text_sme_num->SetTextSize(0.03);
2608 
2609  char f_in_sm[charArrLen];
2610  TText* text_sm_num = new TText();
2611  fCnewRoot++;
2612  text_sm_num->SetTextColor(couleur_noir);
2613  text_sm_num->SetTextSize(0.03);
2614 
2615  char f_in_hsd[charArrLen];
2616  TText* text_hsd_num = new TText();
2617  fCnewRoot++;
2618  text_hsd_num->SetTextColor(couleur_noir);
2619  text_hsd_num->SetTextSize(0.03);
2620 
2621  //............... prepa arguments fixes appels GetXGeo(...) et GetYGeo(...)
2622  Int_t i_samp = 0;
2623  //Double_t off_set = (Double_t)(fEcal->MaxSampADC()/4);
2624  Double_t off_set = (Double_t)1.;
2625 
2626  //------------------ LOOP ON THE CRYSTAL ELECTRONIC CHANNEL NUMBER (TowerCrystalNumbering)
2627 
2628  for (Int_t i_chan = 0; i_chan < fEcal->MaxCrysInTow(); i_chan++) {
2629  Int_t i_xgeo = GetXSampInStin(SMNumber, n1SMTow, i_chan, i_samp);
2630  Int_t i_ygeo = GetYSampInStin(SMNumber, n1SMTow, i_chan, i_samp);
2631 
2632  Double_t xgi = i_xgeo + 3. * off_set;
2633  Double_t ygj = i_ygeo + 7. * off_set;
2634 
2635  Double_t xgi_sme = i_xgeo + 3. * off_set;
2636  Double_t ygj_sme = i_ygeo + 5. * off_set;
2637 
2638  Double_t xgi_sm = i_xgeo + 3. * off_set;
2639  Double_t ygj_sm = i_ygeo + 3. * off_set;
2640 
2641  Double_t xgi_hsd = i_xgeo + 3. * off_set;
2642  Double_t ygj_hsd = i_ygeo + 1. * off_set;
2643 
2644  Int_t i_crys_sme = fEcalNumbering->Get0SMEchaFrom1SMTowAnd0TowEcha(n1SMTow, i_chan);
2645  Int_t i_crys_sm = fEcalNumbering->Get1SMCrysFrom1SMTowAnd0TowEcha(n1SMTow, i_chan);
2646 
2647  Double_t Eta = fEcalNumbering->GetEta(SMNumber, n1SMTow, i_chan);
2648  Double_t Phi = fEcalNumbering->GetPhi(SMNumber, n1SMTow, i_chan);
2649 
2650  Int_t i_crys_hsd = fEcalNumbering->GetHashedNumberFromIEtaAndIPhi((Int_t)Eta, (Int_t)Phi);
2651 
2652  //------------------------------------------------------- TowerCrystalNumbering
2653 
2654  sprintf(f_in_elec, "%d", i_chan);
2655  text_elec_num->DrawText(xgi, ygj, f_in_elec);
2656 
2657  sprintf(f_in_sme, "%d", i_crys_sme);
2658  text_sme_num->DrawText(xgi_sme, ygj_sme, f_in_sme);
2659 
2660  sprintf(f_in_sm, "%d", i_crys_sm);
2661  text_sm_num->DrawText(xgi_sm, ygj_sm, f_in_sm);
2662 
2663  sprintf(f_in_hsd, "%d", i_crys_hsd);
2664  text_sm_num->DrawText(xgi_hsd, ygj_hsd, f_in_hsd);
2665  }
2666  text_sm_num->Delete();
2667  text_sm_num = nullptr;
2668  fCdeleteRoot++;
2669  text_sme_num->Delete();
2670  text_sme_num = nullptr;
2671  fCdeleteRoot++;
2672  text_elec_num->Delete();
2673  text_elec_num = nullptr;
2674  fCdeleteRoot++;
2675  text_hsd_num->Delete();
2676  text_hsd_num = nullptr;
2677  fCdeleteRoot++;
2678 
2679  ViewStinGrid(SMNumber, n1SMTow, MatSize, size_eta, size_phi, "CrystalNumbering");
2680 
2681  gPad->Update();
2682  h_gbid->SetStats(b_true);
2683 
2684  h_gbid->Delete();
2685  h_gbid = nullptr;
2686  fCdeleteRoot++;
2687 
2688  } else {
2689  std::cout << "!TEcnaHistos::TowerCrystalNumbering(...)> SM = " << SMNumber << ". Out of range ( range = [1,"
2690  << fEcal->MaxSMInEB() << "] )" << fTTBELL << std::endl;
2691  }
2692 }
2693 //----------------> end of TowerCrystalNumbering()
2694 
2695 //====================================================================================
2696 //
2697 // SCCrystalNumbering
2698 // independent of the ROOT file => DeeNumber and n1DeeSCEcna as argument
2699 //
2700 //====================================================================================
2701 void TEcnaHistos::SCCrystalNumbering(const Int_t& DeeNumber, const Int_t& n1DeeSCCons) {
2702  //display the crystal numbering of one SC
2703 
2704  if ((DeeNumber > 0) && (DeeNumber <= fEcal->MaxDeeInEE())) {
2705  Int_t n1DeeSCEcna = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(DeeNumber, n1DeeSCCons);
2708 
2709  //Int_t MatSize = fEcal->MaxSampADC();
2710  Int_t size_IX = fEcal->MaxCrysIXInSC();
2711  Int_t size_IY = fEcal->MaxCrysIYInSC();
2712 
2713  //---------------------------------- bidim
2714 
2715  Int_t nb_bins = fEcal->MaxSampADC();
2716  Int_t nx_gbins = nb_bins * size_IX;
2717  Int_t ny_gbins = nb_bins * size_IY;
2718 
2719  Axis_t xinf_gbid = (Axis_t)0.;
2720  Axis_t xsup_gbid = (Axis_t)fEcal->MaxSampADC() * size_IX;
2721  Axis_t yinf_gbid = (Axis_t)0.;
2722  Axis_t ysup_gbid = (Axis_t)fEcal->MaxSampADC() * size_IY;
2723 
2724  TString fg_name = "crystalnbring";
2725  TString fg_tit = "Xtal numbering for construction";
2726 
2727  TH2D* h_gbid;
2728  h_gbid = new TH2D(fg_name.Data(), fg_tit.Data(), nx_gbins, xinf_gbid, xsup_gbid, ny_gbins, yinf_gbid, ysup_gbid);
2729  fCnewRoot++;
2730  h_gbid->Reset();
2731 
2732  //----------------- T R A C E D E S P L O T S ------ (SCCrystalNumbering)
2733 
2734  char f_in[charArrLen];
2735 
2736  //...................... Taille/format canvas
2737 
2738  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
2739  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
2740  //........................................ couleurs
2741  // Color_t couleur_noir = fCnaParHistos->ColorDefinition("noir");
2742  Color_t couleur_rouge = fCnaParHistos->ColorDefinition("rouge");
2743  // Color_t couleur_bleu_fonce = fCnaParHistos->ColorDefinition("bleu_fonce");
2744 
2745  gStyle->SetPalette(1, nullptr); // Rainbow spectrum
2746  //.................................... options generales
2748 
2749  //.................................... paves commentaires (SCCrystalNumbering)
2750  SetAllPavesViewStinCrysNb(DeeNumber, n1DeeSCEcna);
2751 
2752  //---------------------------------------------- (SCCrystalNumbering)
2753  //..................... Canvas name
2754  sprintf(
2755  f_in, "Crystal_Numbering_for_%s_X_%d_%s%d", fFapStinName.Data(), n1DeeSCEcna, fFapStexName.Data(), DeeNumber);
2756 
2757  SetHistoPresentation((TH1D*)h_gbid, "Stin");
2758 
2759  TCanvas* MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h);
2760  fCnewRoot++;
2761  fCurrentCanvas = MainCanvas;
2762  fCurrentCanvasName = f_in;
2763 
2764  // std::cout << "*TEcnaHistosEE::SCCrystalNumbering(...)> Plot is displayed on canvas ----> "
2765  // << f_in << std::endl;
2766 
2767  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
2768  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
2769 
2770  MainCanvas->Divide(1, 1, x_margin, y_margin);
2771 
2772  fPavComStex->Draw();
2773  fPavComStin->Draw();
2774  fPavComCxyz->Draw();
2775 
2776  Bool_t b_true = true;
2777  Bool_t b_false = false;
2778  gPad->cd(1);
2779 
2780  gStyle->SetMarkerColor(couleur_rouge);
2781 
2782  Int_t logy = 0;
2783  gPad->SetLogy(logy);
2784 
2785  //............................... bidim .......... (SCCrystalNumbering)
2786  h_gbid->SetStats(b_false);
2787  fCnaParHistos->SetViewHistoOffsets((TH1D*)h_gbid, "Stin", " ");
2788  h_gbid->DrawCopy("COLZ");
2789 
2790  //..... Ecriture des numeros de channels dans la grille..... (SCCrystalNumbering)
2791  // et des numeros Dee des cristaux
2792  TString SCQuadType = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna);
2793  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
2794  TString DeeEndcap = fEcalNumbering->GetEEDeeEndcap(DeeNumber);
2795  Color_t couleur_SC = GetSCColor(DeeEndcap, DeeDir, SCQuadType);
2796  //............... prepa arguments fixes appels [TText]->DrawText()
2797  char f_in_elec[charArrLen];
2798  TText* text_elec_num = new TText();
2799  fCnewRoot++;
2800  text_elec_num->SetTextColor(couleur_SC);
2801  text_elec_num->SetTextSize(0.06);
2802 
2803  //............... prepa arguments fixes appels GetXGeo(...) et GetYGeo(...)
2804  Int_t i_samp = 0;
2805  Double_t off_set = (Double_t)(fEcal->MaxSampADC() / 3);
2806 
2807  //------------------ LOOP ON THE CRYSTAL ELECTRONIC CHANNEL NUMBER (SCCrystalNumbering)
2808 
2809  for (Int_t i_chan = 0; i_chan < fEcal->MaxCrysInSC(); i_chan++) {
2810  Int_t i_xgeo = GetXSampInStin(DeeNumber, n1DeeSCEcna, i_chan, i_samp);
2811  Int_t i_ygeo = GetYSampInStin(DeeNumber, n1DeeSCEcna, i_chan, i_samp);
2812 
2813  Double_t xgi = i_xgeo + off_set;
2814  Double_t ygj = i_ygeo + 2 * off_set;
2815 
2816  //------------------------------------------------------- SCCrystalNumbering
2817  Int_t i_chan_p = i_chan + 1;
2818  sprintf(f_in_elec, "%d", i_chan_p); // offset = +1 (Xtal for construction numbering, CMS NOTE 2006/027)
2819  text_elec_num->DrawText(xgi, ygj, f_in_elec);
2820  }
2821  text_elec_num->Delete();
2822  text_elec_num = nullptr;
2823  fCdeleteRoot++;
2824 
2825  ViewStinGrid(DeeNumber, n1DeeSCEcna, fEcal->MaxSampADC(), size_IX, size_IY, "CrystalNumbering");
2826 
2827  gPad->Update();
2828  h_gbid->SetStats(b_true);
2829 
2830  h_gbid->Delete();
2831  h_gbid = nullptr;
2832  fCdeleteRoot++;
2833 
2834  } else {
2835  std::cout << "!TEcnaHistos::SCCrystalNumbering(...)> Dee = " << DeeNumber << ". Out of range ( range = [1,"
2836  << fEcal->MaxDeeInEE() << "] )" << fTTBELL << std::endl;
2837  }
2838 }
2839 //----------------> end of SCCrystalNumbering()
2840 
2841 //==================================================================================
2842 //
2843 // GetXSampInStin, GetYSampInStin
2844 //
2845 //==================================================================================
2846 Int_t TEcnaHistos::GetXSampInStin(const Int_t& StexNumber,
2847  const Int_t& StexStin,
2848  const Int_t& i0StinEcha,
2849  const Int_t& i_samp) {
2850  //Gives the X coordinate in the geographic view of one Stin
2851 
2852  Int_t ix_geo = -1;
2853 
2854  if (fFlagSubDet == "EB") {
2855  TString ctype = fEcalNumbering->GetStinLvrbType(StexStin);
2856  TString btype = fEcalNumbering->GetStexHalfStas(StexNumber);
2857  if ((btype == "EB+" && ctype == "bottom") || (btype == "EB-" && ctype == "top")) {
2858  ix_geo =
2859  ((fEcal->MaxCrysHocoInStin() - 1) - (i0StinEcha / fEcal->MaxCrysHocoInStin())) * fEcal->MaxSampADC() + i_samp;
2860  }
2861  if ((btype == "EB+" && ctype == "top") || (btype == "EB-" && ctype == "bottom")) {
2862  ix_geo = (i0StinEcha / fEcal->MaxCrysHocoInStin()) * fEcal->MaxSampADC() + i_samp;
2863  }
2864  }
2865 
2866  if (fFlagSubDet == "EE") {
2867  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(StexNumber);
2868  if (DeeDir == "right") {
2869  ix_geo = (fEcalNumbering->GetIXCrysInSC(StexNumber, StexStin, i0StinEcha) - 1) * fEcal->MaxSampADC() + i_samp;
2870  }
2871  if (DeeDir == "left") {
2872  ix_geo = (fEcal->MaxCrysHocoInStin() - fEcalNumbering->GetIXCrysInSC(StexNumber, StexStin, i0StinEcha)) *
2873  fEcal->MaxSampADC() +
2874  i_samp;
2875  }
2876  }
2877 
2878  return ix_geo;
2879 }
2880 //--------------------------------------------------------------------------------------------
2881 Int_t TEcnaHistos::GetYSampInStin(const Int_t& StexNumber,
2882  const Int_t& StexStin,
2883  const Int_t& i0StinEcha,
2884  const Int_t& j_samp) {
2885  //Gives the Y coordinate in the geographic view of one Stin
2886 
2887  Int_t jy_geo = -1;
2888 
2889  if (fFlagSubDet == "EB") {
2890  TString ctype = fEcalNumbering->GetStinLvrbType(StexStin);
2891  TString btype = fEcalNumbering->GetStexHalfStas(StexNumber);
2892 
2893  //.......................... jy_geo for the EB+ (and beginning for the EB-)
2894 
2895  if ((btype == "EB+" && ctype == "top") || (btype == "EB-" && ctype == "bottom")) {
2896  if (i0StinEcha >= 0 && i0StinEcha <= 4) {
2897  jy_geo = (i0StinEcha - 0) * fEcal->MaxSampADC() + j_samp;
2898  }
2899  if (i0StinEcha >= 5 && i0StinEcha <= 9) {
2900  jy_geo = -(i0StinEcha - 9) * fEcal->MaxSampADC() + j_samp;
2901  }
2902  if (i0StinEcha >= 10 && i0StinEcha <= 14) {
2903  jy_geo = (i0StinEcha - 10) * fEcal->MaxSampADC() + j_samp;
2904  }
2905  if (i0StinEcha >= 15 && i0StinEcha <= 19) {
2906  jy_geo = -(i0StinEcha - 19) * fEcal->MaxSampADC() + j_samp;
2907  }
2908  if (i0StinEcha >= 20 && i0StinEcha <= 24) {
2909  jy_geo = (i0StinEcha - 20) * fEcal->MaxSampADC() + j_samp;
2910  }
2911  }
2912 
2913  if ((btype == "EB+" && ctype == "bottom") || (btype == "EB-" && ctype == "top")) {
2914  if (i0StinEcha >= 0 && i0StinEcha <= 4) {
2915  jy_geo = ((fEcal->MaxCrysVecoInStin() - 1) - (i0StinEcha - 0)) * fEcal->MaxSampADC() + j_samp;
2916  }
2917  if (i0StinEcha >= 5 && i0StinEcha <= 9) {
2918  jy_geo = ((fEcal->MaxCrysVecoInStin() - 1) + (i0StinEcha - 9)) * fEcal->MaxSampADC() + j_samp;
2919  }
2920  if (i0StinEcha >= 10 && i0StinEcha <= 14) {
2921  jy_geo = ((fEcal->MaxCrysVecoInStin() - 1) - (i0StinEcha - 10)) * fEcal->MaxSampADC() + j_samp;
2922  }
2923  if (i0StinEcha >= 15 && i0StinEcha <= 19) {
2924  jy_geo = ((fEcal->MaxCrysVecoInStin() - 1) + (i0StinEcha - 19)) * fEcal->MaxSampADC() + j_samp;
2925  }
2926  if (i0StinEcha >= 20 && i0StinEcha <= 24) {
2927  jy_geo = ((fEcal->MaxCrysVecoInStin() - 1) - (i0StinEcha - 20)) * fEcal->MaxSampADC() + j_samp;
2928  }
2929  }
2930  }
2931 
2932  if (fFlagSubDet == "EE") {
2933  jy_geo = (fEcalNumbering->GetJYCrysInSC(StexNumber, StexStin, i0StinEcha) - 1) * fEcal->MaxSampADC() + j_samp;
2934  }
2935 
2936  return jy_geo;
2937 }
2938 
2939 //===============================================================================
2940 //
2941 // ViewStinGrid
2942 // independent of the ROOT file => StexNumber as argument
2943 //
2944 //===============================================================================
2945 void TEcnaHistos::ViewStinGrid(const Int_t& StexNumber,
2946  const Int_t& StexStin,
2947  const Int_t& MatSize,
2948  const Int_t& size_Hoco,
2949  const Int_t& size_Veco,
2950  const TString& chopt) {
2951  //Grid of one Stin with axis Hoco and Veco
2952 
2953  if (fFlagSubDet == "EB") {
2954  ViewTowerGrid(StexNumber, StexStin, MatSize, size_Hoco, size_Veco, chopt);
2955  }
2956  if (fFlagSubDet == "EE") {
2957  ViewSCGrid(StexNumber, StexStin, MatSize, size_Hoco, size_Veco, chopt);
2958  }
2959 
2960 } // end of ViewStinGrid
2961 
2962 //===============================================================================
2963 //
2964 // ViewTowerGrid
2965 // independent of the ROOT file => SMNumber as argument
2966 //
2967 //===============================================================================
2968 void TEcnaHistos::ViewTowerGrid(const Int_t& SMNumber,
2969  const Int_t& n1SMTow,
2970  const Int_t& MatSize,
2971  const Int_t& size_eta,
2972  const Int_t& size_phi,
2973  const TString& chopt) {
2974  //Grid of one tower with axis eta and phi
2975  //.......................... lignes verticales
2976  Double_t xline = 0.;
2977 
2978  Double_t yline_bot = 0.;
2979  Double_t yline_top = (Double_t)(MatSize * size_eta);
2980 
2981  for (Int_t i = 0; i < size_eta; i++) {
2982  xline = xline + (Double_t)MatSize;
2983  TLine* lin;
2984  lin = new TLine(xline, yline_bot, xline, yline_top);
2985  fCnewRoot++;
2986  lin->Draw();
2987  // delete lin; fCdeleteRoot++;
2988  }
2989  //............................. lignes horizontales
2990  Double_t xline_left = 0;
2991  Double_t xline_right = (Double_t)(MatSize * size_eta);
2992 
2993  Double_t yline = -(Double_t)MatSize;
2994 
2995  for (Int_t j = 0; j < size_eta + 1; j++) {
2996  yline = yline + (Double_t)MatSize;
2997  TLine* lin;
2998  lin = new TLine(xline_left, yline, xline_right, yline);
2999  fCnewRoot++;
3000  lin->Draw();
3001  // delete lin; fCdeleteRoot++;
3002  }
3003 
3004  //------------------ trace axes en eta et phi --------------- ViewTowerGrid
3005 
3006  //...................................................... Axe i(eta) (x bottom) (ViewTowerGrid)
3007 
3008  Double_t eta_min = fEcalNumbering->GetIEtaMin(SMNumber, n1SMTow);
3009  Double_t eta_max = fEcalNumbering->GetIEtaMax(SMNumber, n1SMTow);
3010 
3011  TString x_var_name = GetEtaPhiAxisTitle("ietaTow");
3012  TString x_direction = fEcalNumbering->GetXDirectionEB(SMNumber);
3013 
3014  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
3015  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize();
3016  Float_t tic_siz_x = fCnaParHistos->AxisTickSize();
3017  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("Towx");
3018  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("Towx");
3019 
3020  new TF1("f1", x_direction.Data(), eta_min, eta_max);
3021  fCnewRoot++;
3022 
3023  TGaxis* sup_axis_x = nullptr;
3024 
3025  if (x_direction == "-x") // NEVER IN THIS CASE: xmin->xmax <=> right->left ("-x") direction
3026  {
3027  sup_axis_x = new TGaxis(
3028  -(Float_t)MatSize, (Float_t)0, (Float_t)(size_eta * MatSize), (Float_t)0., "f1", size_eta, "BCS", 0.);
3029  fCnewRoot++;
3030  std::cout << "TEcnaHistosEB::ViewTowerGrid()> non foreseen case. eta with -x direction." << fTTBELL << std::endl;
3031  }
3032 
3033  if (x_direction == "x") // ALWAYS IN THIS CASE: xmin->xmax <=> left->right ("x") direction
3034  {
3035  sup_axis_x =
3036  new TGaxis((Float_t)0., (Float_t)0., (Float_t)(size_eta * MatSize), (Float_t)0., "f1", size_eta, "CS", 0.);
3037  fCnewRoot++;
3038  }
3039 
3040  sup_axis_x->SetTitle(x_var_name);
3041  sup_axis_x->SetTitleSize(tit_siz_x);
3042  sup_axis_x->SetTitleOffset(tit_off_x);
3043  sup_axis_x->SetLabelSize(lab_siz_x);
3044  sup_axis_x->SetLabelOffset(lab_off_x);
3045  sup_axis_x->SetTickSize(tic_siz_x);
3046  sup_axis_x->Draw("SAME");
3047 
3048  //...................................................... Axe phi (y right) (ViewTowerGrid)
3049  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
3050  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
3051  Float_t tic_siz_y = fCnaParHistos->AxisTickSize();
3052  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("Towy");
3053  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("Towy");
3054 
3055  if (chopt == "CrystalNumbering") {
3056  Double_t phi_min = fEcalNumbering->GetPhiMin(SMNumber, n1SMTow);
3057  Double_t phi_max = fEcalNumbering->GetPhiMax(SMNumber, n1SMTow);
3058 
3059  TString y_var_name = GetEtaPhiAxisTitle("phi");
3060  TString y_direction = fEcalNumbering->GetYDirectionEB(SMNumber);
3061 
3062  new TF1("f2", y_direction.Data(), phi_min, phi_max);
3063  fCnewRoot++;
3064  TGaxis* sup_axis_y = nullptr;
3065 
3066  if (y_direction == "-x") // ALWAYS IN THIS CASE: ymin->ymax <=> top->bottom ("-x") direction
3067  {
3068  sup_axis_y = new TGaxis((Float_t)(size_eta * MatSize),
3069  (Float_t)0.,
3070  (Float_t)(size_eta * MatSize),
3071  (Float_t)(size_phi * MatSize),
3072  "f2",
3073  size_phi,
3074  "+CS",
3075  0.);
3076  fCnewRoot++;
3077  }
3078 
3079  if (y_direction == "x") // NEVER IN THIS CASE: ymin->ymax <=> bottom->top ("x") direction
3080  {
3081  sup_axis_y =
3082  new TGaxis((Float_t)0., (Float_t)0., (Float_t)0., (Float_t)(size_phi * MatSize), "f2", size_phi, "BCS", 0.);
3083  fCnewRoot++;
3084  }
3085 
3086  sup_axis_y->SetTitle(y_var_name);
3087  sup_axis_y->SetTitleSize(tit_siz_y);
3088  sup_axis_y->SetTitleOffset(tit_off_y);
3089  sup_axis_y->SetLabelSize(lab_siz_y);
3090  sup_axis_y->SetLabelOffset(lab_off_y);
3091  sup_axis_y->SetTickSize(tic_siz_y);
3092  sup_axis_y->Draw("SAME");
3093  }
3094  //...................................................... Axe j(phi) (y left) (ViewTowerGrid)
3095 
3096  Double_t j_phi_min = fEcalNumbering->GetJPhiMin(SMNumber, n1SMTow);
3097  Double_t j_phi_max = fEcalNumbering->GetJPhiMax(SMNumber, n1SMTow);
3098 
3099  TString jy_var_name = GetEtaPhiAxisTitle("jphiTow");
3100  TString jy_direction = fEcalNumbering->GetJYDirectionEB(SMNumber);
3101 
3102  new TF1("f3", jy_direction.Data(), j_phi_min, j_phi_max);
3103  fCnewRoot++;
3104  TGaxis* sup_axis_jy = nullptr;
3105 
3106  sup_axis_jy =
3107  new TGaxis((Float_t)0., (Float_t)0., (Float_t)0., (Float_t)(size_phi * MatSize), "f3", size_phi, "SC", 0.);
3108  fCnewRoot++;
3109 
3110  sup_axis_jy->SetTitle(jy_var_name);
3111  sup_axis_jy->SetTitleSize(tit_siz_y);
3112  sup_axis_jy->SetTitleOffset(tit_off_y);
3113  sup_axis_jy->SetLabelSize(lab_siz_y);
3114  sup_axis_jy->SetLabelOffset(lab_off_y);
3115  sup_axis_jy->SetTickSize(tic_siz_y);
3116  sup_axis_jy->Draw("SAME");
3117 } // end of ViewTowerGrid
3118 
3119 //===============================================================================
3120 //
3121 // ViewSCGrid
3122 // independent of the ROOT file => DeeNumber as argument
3123 //
3124 //===============================================================================
3125 void TEcnaHistos::ViewSCGrid(const Int_t& DeeNumber,
3126  const Int_t& n1DeeSCEcna,
3127  const Int_t& MatSize,
3128  const Int_t& size_IX,
3129  const Int_t& size_IY,
3130  const TString& chopt) {
3131  //Grid of one SC with axis IX and IY
3132  //.......................... lignes verticales
3133  Double_t xline = 0.;
3134 
3135  Double_t yline_bot = 0.;
3136  Double_t yline_top = (Double_t)(MatSize * size_IX);
3137 
3138  for (Int_t i = 0; i < size_IX; i++) {
3139  xline = xline + (Double_t)MatSize;
3140  TLine* lin;
3141  lin = new TLine(xline, yline_bot, xline, yline_top);
3142  fCnewRoot++;
3143  lin->Draw();
3144  // delete lin; fCdeleteRoot++;
3145  }
3146  //............................. lignes horizontales
3147  Double_t xline_left = 0;
3148  Double_t xline_right = (Double_t)(MatSize * size_IX);
3149 
3150  Double_t yline = -(Double_t)MatSize;
3151 
3152  for (Int_t j = 0; j < size_IX + 1; j++) {
3153  yline = yline + (Double_t)MatSize;
3154  TLine* lin;
3155  lin = new TLine(xline_left, yline, xline_right, yline);
3156  fCnewRoot++;
3157  lin->Draw();
3158  // delete lin; fCdeleteRoot++;
3159  }
3160 
3161  //------------------ trace axes en IX et IY --------------- ViewSCGrid
3162 
3163  //...................................................... Axe i(IX) (x bottom) (ViewSCGrid)
3164 
3165  Double_t IX_min = fEcalNumbering->GetIIXMin(n1DeeSCEcna) - 0.5;
3166  Double_t IX_max = fEcalNumbering->GetIIXMax(n1DeeSCEcna) + 0.5;
3167 
3168  Float_t axis_x_inf = 0;
3169  Float_t axis_x_sup = 0;
3170  Float_t axis_y_inf = 0;
3171  Float_t axis_y_sup = 0;
3172  Int_t axis_nb_div = 1;
3173  Double_t IX_values_min = 0;
3174  Double_t IX_values_max = 0;
3175  Option_t* axis_chopt = "CS";
3176 
3177  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
3178  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize();
3179  Float_t tic_siz_x = fCnaParHistos->AxisTickSize();
3180  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("SCx");
3181  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("SCx");
3182 
3183  TString StrDee = "iIXSC";
3184  if (DeeNumber == 1) {
3185  StrDee = "iIXDee1";
3186  }
3187  if (DeeNumber == 2) {
3188  StrDee = "iIXDee2";
3189  }
3190  if (DeeNumber == 3) {
3191  StrDee = "iIXDee3";
3192  }
3193  if (DeeNumber == 4) {
3194  StrDee = "iIXDee4";
3195  }
3196 
3197  TString x_var_name = GetIXIYAxisTitle(StrDee.Data());
3198  TString x_direction = fEcalNumbering->GetXDirectionEE(DeeNumber);
3199 
3200  TGaxis* sup_axis_x = nullptr;
3201 
3202  if (DeeNumber == 1) // -xmin -> -xmax <=> left->right
3203  {
3204  axis_x_inf = 0;
3205  axis_y_inf = 0;
3206  axis_x_sup = size_IX * MatSize;
3207  axis_y_sup = 0;
3208  axis_nb_div = size_IX;
3209  IX_values_min = -IX_min;
3210  IX_values_max = -IX_max;
3211  axis_chopt = "CS";
3212  }
3213  if (DeeNumber == 2) // xmin -> xmax <=> right->left
3214  {
3215  axis_x_inf = 0;
3216  axis_y_inf = 0;
3217  axis_x_sup = size_IX * MatSize;
3218  axis_y_sup = 0;
3219  axis_nb_div = size_IX;
3220  IX_values_min = IX_min;
3221  IX_values_max = IX_max;
3222  axis_chopt = "CS";
3223  }
3224  if (DeeNumber == 3) // xmin -> xmax <=> left->right
3225  {
3226  axis_x_inf = 0;
3227  axis_y_inf = 0;
3228  axis_x_sup = size_IX * MatSize;
3229  axis_y_sup = 0;
3230  axis_nb_div = size_IX;
3231  IX_values_min = IX_min;
3232  IX_values_max = IX_max;
3233  axis_chopt = "CS";
3234  }
3235  if (DeeNumber == 4) // -xmin -> -xmax <=> right->left
3236  {
3237  axis_x_inf = 0;
3238  axis_y_inf = 0;
3239  axis_x_sup = size_IX * MatSize;
3240  axis_y_sup = 0;
3241  axis_nb_div = size_IX;
3242  IX_values_min = -IX_min;
3243  IX_values_max = -IX_max;
3244  axis_chopt = "CS";
3245  }
3246 
3247  new TF1("f1", x_direction.Data(), IX_values_min, IX_values_max);
3248  fCnewRoot++;
3249  sup_axis_x = new TGaxis(axis_x_inf, axis_y_inf, axis_x_sup, axis_y_sup, "f1", axis_nb_div, axis_chopt, 0.);
3250  fCnewRoot++;
3251 
3252  sup_axis_x->SetTitle(x_var_name);
3253  sup_axis_x->SetTitleSize(tit_siz_x);
3254  sup_axis_x->SetTitleOffset(tit_off_x);
3255  sup_axis_x->SetLabelSize(lab_siz_x);
3256  sup_axis_x->SetLabelOffset(lab_off_x);
3257  sup_axis_x->SetTickSize(tic_siz_x); // <===== NE MARCHE QU'AVEC L'OPTION "S"
3258  sup_axis_x->Draw("SAME");
3259 
3260  //...................................................... Axe j(IY) (ViewSCGrid)
3261 
3262  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
3263  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
3264  Float_t tic_siz_y = fCnaParHistos->AxisTickSize();
3265  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("SCy");
3266  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("SCy");
3267 
3268  Double_t j_IY_min = fEcalNumbering->GetJIYMin(DeeNumber, n1DeeSCEcna) - 0.5;
3269  Double_t j_IY_max = fEcalNumbering->GetJIYMax(DeeNumber, n1DeeSCEcna) + 0.5;
3270 
3271  TString jy_var_name = GetIXIYAxisTitle("jIYSC");
3272  TString jy_direction = fEcalNumbering->GetJYDirectionEE(DeeNumber);
3273 
3274  new TF1("f2", jy_direction.Data(), j_IY_min, j_IY_max);
3275  fCnewRoot++;
3276 
3277  TGaxis* sup_axis_jy =
3278  new TGaxis((Float_t)0., (Float_t)0., (Float_t)0., (Float_t)(size_IY * MatSize), "f2", size_IY, "CS", 0.);
3279  fCnewRoot++;
3280 
3281  sup_axis_jy->SetTitle(jy_var_name);
3282  sup_axis_jy->SetTitleSize(tit_siz_y);
3283  sup_axis_jy->SetTitleOffset(tit_off_y);
3284  sup_axis_jy->SetLabelSize(lab_siz_y);
3285  sup_axis_jy->SetLabelOffset(lab_off_y);
3286  sup_axis_jy->SetTickSize(tic_siz_y); // <===== NE MARCHE QU'AVEC L'OPTION "S"
3287  sup_axis_jy->Draw();
3288 
3289 } // end of ViewSCGrid
3290 
3291 //=======================================================================================
3292 //
3293 // ViewStex(***)
3294 //
3295 // (Hoco,Veco) matrices for all the Stins of a Stex
3296 //
3297 // arg_read_histo: 1D array containing the quantity for each channel in the Stex
3298 // (dim = MaxCrysInStex())
3299 // arg_AlreadyRead: =1 <=> arg_read_histo
3300 // =0 <=> read the 1D array in this method with TEcnaRead
3301 //
3302 // HistoCode: code for the plotted quantity
3303 //
3304 //=======================================================================================
3305 void TEcnaHistos::ViewStex(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead, const TString& HistoCode) {
3306  // (Hoco, Veco) matrices for all the Stins of a Stex
3307 
3308  Bool_t OKFileExists = kFALSE;
3309  Bool_t OKData = kFALSE;
3310 
3311  Int_t n1StexStin = -1;
3312 
3313  if (arg_AlreadyRead == fTobeRead) {
3317  fFapRunNumber,
3322  fCfgResultsRootFilePath.Data());
3323 
3324  if (fMyRootFile->LookAtRootFile() == kTRUE) {
3325  OKFileExists = kTRUE;
3326  }
3327 
3328  if (OKFileExists == kTRUE) {
3330  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
3331  // std::cout << "*TEcnaHistos::ViewStex(...)> Data are analyzed from file ----> "
3332  // << fp_name_short << std::endl;
3333 
3337  }
3338  }
3339  if (arg_AlreadyRead >= 1) {
3340  OKFileExists = kTRUE;
3341  }
3342 
3343  if (OKFileExists == kTRUE) {
3344  fStatusFileFound = kTRUE;
3345 
3346  //......................... matrix title (ViewStex)
3347  char f_in_mat_tit[charArrLen];
3348  sprintf(f_in_mat_tit, "?");
3349 
3350  if (HistoCode == "D_NOE_ChNb") {
3351  sprintf(f_in_mat_tit, "Number of events");
3352  }
3353  if (HistoCode == "D_Ped_ChNb") {
3354  sprintf(f_in_mat_tit, "Pedestals");
3355  }
3356  if (HistoCode == "D_TNo_ChNb") {
3357  sprintf(f_in_mat_tit, "Total noise");
3358  }
3359  if (HistoCode == "D_MCs_ChNb") {
3360  sprintf(f_in_mat_tit, "Mean cor(s,s')");
3361  }
3362  if (HistoCode == "D_LFN_ChNb") {
3363  sprintf(f_in_mat_tit, "Low frequency noise");
3364  }
3365  if (HistoCode == "D_HFN_ChNb") {
3366  sprintf(f_in_mat_tit, "High frequency noise");
3367  }
3368  if (HistoCode == "D_SCs_ChNb") {
3369  sprintf(f_in_mat_tit, "Sigma of cor(s,s')");
3370  }
3371 
3372  //................................. Axis parameters
3373  Int_t GeoBidSizeHoco = fEcal->MaxStinHocoInStex() * fEcal->MaxCrysHocoInStin();
3374  Int_t GeoBidSizeVeco = fEcal->MaxStinVecoInStex() * fEcal->MaxCrysVecoInStin();
3375 
3376  Int_t nb_binx = GeoBidSizeHoco;
3377  Int_t nb_biny = GeoBidSizeVeco;
3378  Axis_t xinf_bid = (Axis_t)0.;
3379  Axis_t xsup_bid = (Axis_t)GeoBidSizeHoco;
3380  Axis_t yinf_bid = (Axis_t)0.;
3381  Axis_t ysup_bid = (Axis_t)GeoBidSizeVeco;
3382 
3383  TString axis_x_var_name = " #Hoco ";
3384  TString axis_y_var_name = " #Veco ";
3385 
3386  //............. matrices reading and histogram filling (ViewStex)
3387 
3388  TH2D* h_geo_bid =
3389  new TH2D("geobidim_ViewStex", f_in_mat_tit, nb_binx, xinf_bid, xsup_bid, nb_biny, yinf_bid, ysup_bid);
3390  fCnewRoot++;
3391 
3392  h_geo_bid->Reset();
3393 
3394  //............................................... 1D histo reading (ViewStex)
3395  TVectorD partial_histp(fEcal->MaxCrysEcnaInStex());
3396  for (Int_t i = 0; i < fEcal->MaxCrysEcnaInStex(); i++) {
3397  partial_histp(i) = (Double_t)0.;
3398  }
3399 
3400  if (arg_AlreadyRead == fTobeRead) {
3401  if (HistoCode == "D_NOE_ChNb") {
3403  }
3404  if (HistoCode == "D_Ped_ChNb") {
3405  partial_histp = fMyRootFile->ReadPedestals(fEcal->MaxCrysEcnaInStex());
3406  }
3407  if (HistoCode == "D_TNo_ChNb") {
3408  partial_histp = fMyRootFile->ReadTotalNoise(fEcal->MaxCrysEcnaInStex());
3409  }
3410  if (HistoCode == "D_MCs_ChNb") {
3412  }
3413  if (HistoCode == "D_LFN_ChNb") {
3415  }
3416  if (HistoCode == "D_HFN_ChNb") {
3418  }
3419  if (HistoCode == "D_SCs_ChNb") {
3421  }
3422 
3423  OKData = fMyRootFile->DataExist();
3424  }
3425 
3426  if (arg_AlreadyRead >= 1) {
3427  partial_histp = arg_read_histo;
3428  OKData = kTRUE;
3429  }
3430 
3431  //------------------------------- Build 2D matrix to be ploted from 1D read histo (ViewStex)
3432  TMatrixD read_matrix(nb_binx, nb_biny);
3433  for (Int_t i = 0; i < nb_binx; i++) {
3434  for (Int_t j = 0; j < nb_biny; j++) {
3435  read_matrix(i, j) = (Double_t)0.;
3436  }
3437  }
3438 
3439  if (OKData == kTRUE) {
3440  fStatusDataExist = kTRUE;
3441 
3442  for (Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++) {
3443  if (arg_AlreadyRead == fTobeRead) {
3444  n1StexStin = fMyRootFile->GetStexStinFromIndex(i0StexStinEcna);
3445  }
3446  if (arg_AlreadyRead >= 1) {
3447  n1StexStin = i0StexStinEcna + 1;
3448  }
3449 
3450  if (n1StexStin != -1) {
3451  //------------------ Geographical bidim filling (ViewStex)
3452  for (Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++) {
3453  Int_t iStexEcha = (n1StexStin - 1) * fEcal->MaxCrysInStin() + i0StinEcha;
3454  Int_t i_xgeo = GetXCrysInStex(fFapStexNumber, n1StexStin, i0StinEcha);
3455  Int_t i_ygeo = GetYCrysInStex(fFapStexNumber, n1StexStin, i0StinEcha);
3456 
3457  if (i_xgeo >= 0 && i_xgeo < nb_binx && i_ygeo >= 0 && i_ygeo < nb_biny) {
3458  read_matrix(i_xgeo, i_ygeo) = partial_histp(iStexEcha);
3459  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo, (Double_t)read_matrix(i_xgeo, i_ygeo));
3460  }
3461  }
3462  }
3463  }
3464 
3465  //=============== H I S T O M I N / M A X M A N A G E M E N T ============ (ViewStex)
3466 
3467  //................................ Put histo min max values
3468  //.......... default if flag not set to "ON"
3469  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
3470  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
3471 
3472  if (fUserHistoMin == fUserHistoMax) {
3473  fFlagUserHistoMin = "AUTO";
3474  fFlagUserHistoMax = "AUTO";
3475  }
3476  //.......... user's value if flag set to "ON"
3477  if (fFlagUserHistoMin == "ON") {
3478  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
3479  fFlagUserHistoMin = "OFF";
3480  }
3481  if (fFlagUserHistoMax == "ON") {
3482  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
3483  fFlagUserHistoMax = "OFF";
3484  }
3485  //................................. automatic min and/or max
3486  if (fFlagUserHistoMin == "AUTO") {
3487  SetYminMemoFromValue(HistoCode.Data(), h_geo_bid->GetMinimum());
3488  fFlagUserHistoMin = "OFF";
3489  }
3490  if (fFlagUserHistoMax == "AUTO") {
3491  SetYmaxMemoFromValue(HistoCode.Data(), h_geo_bid->GetMaximum());
3492  fFlagUserHistoMax = "OFF";
3493  }
3494  //...................................... histo set ymin and ymax
3495  SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, HistoCode);
3496 
3497  // ************************** A GARDER EN RESERVE *******************************
3498  //............. special contour level for correlations (square root wise scale)
3499  //if ( HistoCode == "D_MCs_ChNb" )
3500  //{
3501  // Int_t nb_niv = 9;
3502  // Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
3503  // SqrtContourLevels(nb_niv, &cont_niv[0]);
3504  // h_geo_bid->SetContour(nb_niv, &cont_niv[0]);
3505  // delete [] cont_niv; fCdelete++;
3506  //}
3507  // ******************************** (FIN RESERVE) *******************************
3508 
3509  // =================================== P L O T S ======================== (ViewStex)
3510 
3511  char f_in[charArrLen];
3512 
3513  //...................... Taille/format canvas
3514  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
3515  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
3516 
3517  if (fFlagSubDet == "EB") {
3518  canv_h = fCnaParHistos->CanvasFormatH("etaphiSM");
3519  canv_w = fCnaParHistos->CanvasFormatW("etaphiSM");
3520  }
3521  if (fFlagSubDet == "EE") {
3522  canv_h = fCnaParHistos->CanvasFormatH("IXIYDee");
3523  canv_w = fCnaParHistos->CanvasFormatW("IXIYDee");
3524  }
3525 
3526  //............................................... paves commentaires (ViewStex)
3528 
3529  //------------------------------------ Canvas name ----------------- (ViewStex)
3530  TString name_cov_cor;
3531  name_cov_cor.Resize(charArrLen);
3532  name_cov_cor = "?";
3533 
3534  if (HistoCode == "D_NOE_ChNb") {
3535  name_cov_cor = "Nb_Of_D_Adc_EvDs";
3536  }
3537  if (HistoCode == "D_Ped_ChNb") {
3538  name_cov_cor = "Pedestals";
3539  }
3540  if (HistoCode == "D_TNo_ChNb") {
3541  name_cov_cor = "Total_noise";
3542  }
3543  if (HistoCode == "D_MCs_ChNb") {
3544  name_cov_cor = "Mean_Corss";
3545  }
3546  if (HistoCode == "D_LFN_ChNb") {
3547  name_cov_cor = "Low_Fq_Noise";
3548  }
3549  if (HistoCode == "D_HFN_ChNb") {
3550  name_cov_cor = "High_Fq_Noise";
3551  }
3552  if (HistoCode == "D_SCs_ChNb") {
3553  name_cov_cor = "Sigma_Corss";
3554  }
3555 
3556  TString name_visu;
3557  name_visu.Resize(charArrLen);
3558  name_visu = "colz";
3559 
3560  TString flag_already_read;
3561  flag_already_read.Resize(charArrLen);
3562  flag_already_read = "?";
3563  sprintf(f_in, "M%d", arg_AlreadyRead);
3564  flag_already_read = f_in;
3565 
3566  sprintf(f_in,
3567  "%s_%s_S1_%d_R%d_%d_%d_%s%d_%s_HocoVeco_R%s",
3568  name_cov_cor.Data(),
3569  fFapAnaType.Data(),
3571  fFapRunNumber,
3574  fFapStexName.Data(),
3576  name_visu.Data(),
3577  flag_already_read.Data());
3578 
3579  if (fFlagSubDet == "EB") {
3580  SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEB");
3581  }
3582  if (fFlagSubDet == "EE") {
3583  SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEE");
3584  }
3585 
3586  TCanvas* MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h);
3587  fCnewRoot++;
3588  fCurrentCanvas = MainCanvas;
3589  fCurrentCanvasName = f_in;
3590 
3591  // std::cout << "*TEcnaHistos::ViewStex(...)> Plot is displayed on canvas ----> " << f_in << std::endl;
3592 
3593  //------------------------ Canvas draw and update ------------ (ViewStex)
3594  if (fPavComGeneralTitle != nullptr) {
3595  fPavComGeneralTitle->Draw();
3596  }
3597  fPavComStex->Draw();
3598  fPavComAnaRun->Draw();
3599  fPavComNbOfEvts->Draw();
3600 
3601  //----------------------------------------------------------- pad margins
3602  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3603  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
3604  Double_t x_margin = x_low;
3605  Double_t y_margin = y_low;
3606  MainCanvas->Divide(1, 1, x_margin, y_margin);
3607  // Divide(nx, ny, x_margin, y_margin, color);
3608  gPad->cd(1);
3609  //........................... specific EE
3610  if (fFlagSubDet == "EE") {
3611  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
3612  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_Dee") - 0.005;
3613  TVirtualPad* main_subpad = gPad;
3614  main_subpad->SetPad(x_low, y_low, x_up, y_up);
3615  }
3616 
3617  //------------------------------------------------------------
3618  h_geo_bid->GetXaxis()->SetTitle(axis_x_var_name);
3619  h_geo_bid->GetYaxis()->SetTitle(axis_y_var_name);
3620 
3621  h_geo_bid->DrawCopy("COLZ");
3622 
3623  // trace de la grille: un rectangle = une tour ou un SC ---------------- (ViewStex)
3625  gPad->Draw();
3626  gPad->Update();
3627 
3628  //..................... retour aux options standard
3629  Bool_t b_true = true;
3630  h_geo_bid->SetStats(b_true);
3631  h_geo_bid->Delete();
3632  h_geo_bid = nullptr;
3633  fCdeleteRoot++;
3634 
3635  // delete MainCanvas; fCdeleteRoot++;
3636  } // end of if OKData == kTRUE )
3637  } // end of if OKFileExists == kTRUE )
3638  else {
3639  fStatusFileFound = kFALSE;
3640 
3641  std::cout << "!TEcnaHistos::ViewStex(...)> *ERROR* =====> "
3642  << " ROOT file not found" << fTTBELL << std::endl;
3643  }
3644 } // end of ViewStex(...)
3645 
3646 //===========================================================================
3647 //
3648 // StexHocoVecoLHFCorcc(***)
3649 //
3650 // Geographical view of the cor(c,c) matrices (mean over samples) of
3651 // all (Stin_A,Stin_A) [case A=B only] of a given Stex (BIG MATRIX)
3652 //
3653 //===========================================================================
3654 void TEcnaHistos::StexHocoVecoLHFCorcc(const TString& Freq) {
3655  // (Hoco, Veco) matrices for all the Stins of a Stex
3656 
3660  fFapRunNumber,
3665  fCfgResultsRootFilePath.Data());
3666 
3667  if (fMyRootFile->LookAtRootFile() == kTRUE) // (StexHocoVecoLHFCorcc)
3668  {
3669  fStatusFileFound = kTRUE;
3670 
3672  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
3673  //std::cout << "*TEcnaHistos::StexHocoVecoLHFCorcc(...)> Data are analyzed from file ----> "
3674  // << fp_name_short << std::endl;
3675 
3679 
3680  //......................... matrix title
3681  char f_in_mat_tit[charArrLen];
3682 
3683  if (fFlagSubDet == "EB" && Freq == "LF") {
3684  sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') for each tower in SM");
3685  }
3686  if (fFlagSubDet == "EB" && Freq == "HF") {
3687  sprintf(f_in_mat_tit, "HF Cor(Xtal,Xtal') for each tower in SM");
3688  }
3689  if (fFlagSubDet == "EE" && Freq == "LF") {
3690  sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') for each SC in Dee");
3691  }
3692  if (fFlagSubDet == "EE" && Freq == "HF") {
3693  sprintf(f_in_mat_tit, "HF Cor(Xtal,Xtal') for each SC in Dee");
3694  }
3695 
3696  //................................. Axis parameters
3697  Int_t GeoBidSizeHoco = fEcal->MaxStinHocoInStex() * fEcal->MaxCrysInStin();
3698  Int_t GeoBidSizeVeco = fEcal->MaxStinVecoInStex() * fEcal->MaxCrysInStin();
3699 
3700  Int_t nb_binx = GeoBidSizeHoco;
3701  Int_t nb_biny = GeoBidSizeVeco;
3702  Axis_t xinf_bid = (Axis_t)0.;
3703  Axis_t xsup_bid = (Axis_t)GeoBidSizeHoco;
3704  Axis_t yinf_bid = (Axis_t)0.;
3705  Axis_t ysup_bid = (Axis_t)GeoBidSizeVeco;
3706 
3707  TString axis_x_var_name = " #Hoco ";
3708  TString axis_y_var_name = " #varVeco ";
3709 
3710  //======================================================== (StexHocoVecoLHFCorcc)
3711  TVectorD Stin_numbers(fEcal->MaxStinEcnaInStex());
3712  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
3713  Stin_numbers(i) = (Double_t)0.;
3714  }
3715  Stin_numbers = fMyRootFile->ReadStinNumbers(fEcal->MaxStinEcnaInStex());
3716 
3717  if (fMyRootFile->DataExist() == kTRUE) {
3718  fStatusDataExist = kTRUE;
3719 
3720  //............. matrices reading and histogram filling
3721  TMatrixD partial_matrix(fEcal->MaxCrysEcnaInStex(), fEcal->MaxCrysEcnaInStex());
3722  for (Int_t i = 0; i < fEcal->MaxCrysEcnaInStex(); i++) {
3723  for (Int_t j = 0; j < fEcal->MaxCrysEcnaInStex(); j++) {
3724  partial_matrix(i, j) = (Double_t)0.;
3725  }
3726  }
3727 
3728  if (Freq == "LF") {
3730  }
3731  if (Freq == "HF") {
3733  }
3734 
3735  if (fMyRootFile->DataExist() == kTRUE) {
3736  fStatusDataExist = kTRUE;
3737 
3738  //............................... 2D histo booking
3739  TH2D* h_geo_bid = new TH2D(
3740  "geobidim_HocoVecoLHFCorcc", f_in_mat_tit, nb_binx, xinf_bid, xsup_bid, nb_biny, yinf_bid, ysup_bid);
3741  fCnewRoot++;
3742  h_geo_bid->Reset();
3743 
3745 
3746  for (Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++) {
3747  Int_t n1StexStin = (Int_t)Stin_numbers(i0StexStinEcna);
3748  Int_t offset_x = ((n1StexStin - 1) / fEcal->MaxStinVecoInStex()) * fEcal->MaxCrysInStin();
3749  Int_t offset_y = ((n1StexStin - 1) % fEcal->MaxStinVecoInStex()) * fEcal->MaxCrysInStin();
3750 
3751  if (n1StexStin != -1) {
3752  //================================================= (StexHocoVecoLHFCorcc)
3753  //------------------ Geographical bidim filling
3754  for (Int_t i0StinEcha = 0; i0StinEcha < fEcal->MaxCrysInStin(); i0StinEcha++) {
3755  for (Int_t j0StinEcha = 0; j0StinEcha < fEcal->MaxCrysInStin(); j0StinEcha++) {
3756  Int_t i_xgeo = offset_x + i0StinEcha;
3757  Int_t i_ygeo = offset_y + j0StinEcha;
3758 
3759  if (i_xgeo >= 0 && i_xgeo < nb_binx && i_ygeo >= 0 && i_ygeo < nb_biny) {
3760  Int_t iEcha = (n1StexStin - 1) * fEcal->MaxCrysInStin() + i0StinEcha;
3761  Int_t jEcha = (n1StexStin - 1) * fEcal->MaxCrysInStin() + j0StinEcha;
3762 
3763  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo, (Double_t)partial_matrix(iEcha, jEcha));
3764  }
3765  }
3766  }
3767  }
3768  }
3769 
3770  //=============== H I S T O M I N / M A X M A N A G E M E N T ============ (StexHocoVecoLHFCorcc)
3771 
3772  TString HistoCode = "H2CorccInStins";
3773 
3774  //................................ Put histo min max values
3775  //.......... default if flag not set to "ON"
3776  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
3777  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
3778 
3779  if (fUserHistoMin == fUserHistoMax) {
3780  fFlagUserHistoMin = "AUTO";
3781  fFlagUserHistoMax = "AUTO";
3782  }
3783  //.......... user's value if flag set to "ON"
3784  if (fFlagUserHistoMin == "ON") {
3785  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
3786  fFlagUserHistoMin = "OFF";
3787  }
3788  if (fFlagUserHistoMax == "ON") {
3789  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
3790  fFlagUserHistoMax = "OFF";
3791  }
3792  //................................. automatic min and/or max
3793  if (fFlagUserHistoMin == "AUTO") {
3794  SetYminMemoFromValue(HistoCode.Data(), h_geo_bid->GetMinimum());
3795  fFlagUserHistoMin = "OFF";
3796  }
3797  if (fFlagUserHistoMax == "AUTO") {
3798  SetYmaxMemoFromValue(HistoCode.Data(), h_geo_bid->GetMaximum());
3799  fFlagUserHistoMax = "OFF";
3800  }
3801  //...................................... histo set ymin and ymax
3802  SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, HistoCode);
3803 
3804  // ----------------------------------- P L O T S (StexHocoVecoLHFCorcc)
3805 
3806  char f_in[charArrLen];
3807 
3808  //...................... Taille/format canvas
3809 
3810  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
3811  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
3812 
3813  if (fFlagSubDet == "EB") {
3814  canv_h = fCnaParHistos->CanvasFormatH("etaphiSM");
3815  canv_w = fCnaParHistos->CanvasFormatW("etaphiSM");
3816  }
3817  if (fFlagSubDet == "EE") {
3818  canv_h = fCnaParHistos->CanvasFormatH("IXIYDee");
3819  canv_w = fCnaParHistos->CanvasFormatW("IXIYDee");
3820  }
3821 
3822  //..................................... paves commentaires (StexHocoVecoLHFCorcc)
3824 
3825  //----------------- Canvas name ------- (StexHocoVecoLHFCorcc)
3826  TString name_cov_cor;
3827  name_cov_cor.Resize(charArrLen);
3828  if (Freq == "LF") {
3829  name_cov_cor = "StexLFCorcc";
3830  }
3831  if (Freq == "HF") {
3832  name_cov_cor = "StexHFCorcc";
3833  }
3834 
3835  TString name_visu;
3836  name_visu.Resize(charArrLen);
3837  name_visu = "colz";
3838 
3839  sprintf(f_in,
3840  "%s_%s_S1_%d_R%d_%d_%d_Stex%s%d_%s_HocoVeco",
3841  name_cov_cor.Data(),
3842  fFapAnaType.Data(),
3844  fFapRunNumber,
3847  fFapStexName.Data(),
3849  name_visu.Data());
3850 
3851  if (fFlagSubDet == "EB") {
3852  SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEB");
3853  }
3854  if (fFlagSubDet == "EE") {
3855  SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEE");
3856  }
3857 
3858  TCanvas* MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h);
3859  fCnewRoot++;
3860  fCurrentCanvas = MainCanvas;
3861  fCurrentCanvasName = f_in;
3862 
3863  // std::cout << "*TEcnaHistos::StexHocoVecoLHFCorcc(...)> Plot is displayed on canvas ----> "
3864  // << f_in << std::endl;
3865 
3866  //------------ Canvas draw and update ------ (StexHocoVecoLHFCorcc)
3867  if (fPavComGeneralTitle != nullptr) {
3868  fPavComGeneralTitle->Draw();
3869  }
3870  fPavComStex->Draw();
3871  fPavComAnaRun->Draw();
3872  fPavComNbOfEvts->Draw();
3873 
3874  //----------------------------------------------------------- pad margins
3875  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3876  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
3877  Double_t x_margin = x_low;
3878  Double_t y_margin = y_low;
3879  MainCanvas->Divide(1, 1, x_margin, y_margin);
3880  // Divide(nx, ny, x_margin, y_margin, color);
3881  gPad->cd(1);
3882  //........................... specific EE
3883  if (fFlagSubDet == "EE") {
3884  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
3885  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_Dee") - 0.005;
3886  TVirtualPad* main_subpad = gPad;
3887  main_subpad->SetPad(x_low, y_low, x_up, y_up);
3888  }
3889 
3890  h_geo_bid->GetXaxis()->SetTitle(axis_x_var_name);
3891  h_geo_bid->GetYaxis()->SetTitle(axis_y_var_name);
3892 
3893  h_geo_bid->DrawCopy("COLZ");
3894 
3895  // trace de la grille: un rectangle = une tour (StexHocoVecoLHFCorcc)
3896  ViewStexGrid(fFapStexNumber, "corcc");
3897  gPad->Draw();
3898  gPad->Update();
3899 
3900  //..................... retour aux options standard
3901  Bool_t b_true = true;
3902  h_geo_bid->SetStats(b_true);
3903  h_geo_bid->Delete();
3904  h_geo_bid = nullptr;
3905  fCdeleteRoot++;
3906 
3907  // delete MainCanvas; fCdeleteRoot++;
3908  }
3909  }
3910  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
3911  else {
3912  fStatusFileFound = kFALSE;
3913 
3914  std::cout << "!TEcnaHistos::StexHocoVecoLHFCorcc(...)> *ERROR* =====> "
3915  << " ROOT file not found" << fTTBELL << std::endl;
3916  }
3917 } // end of StexHocoVecoLHFCorcc
3918 
3919 //==================================================================================
3920 //
3921 // GetXCrysInStex, GetYCrysInStex
3922 //
3923 //==================================================================================
3924 Int_t TEcnaHistos::GetXCrysInStex(const Int_t& StexNumber, const Int_t& n1StexStin, const Int_t& i0StinEcha) {
3925  //Gives the X crystal coordinate in the geographic view of one Stex
3926  // (X = 0 to MaxStinHocoInStex*NbCrysHocoInStin - 1)
3927 
3928  Int_t ix_geo = 0;
3929 
3930  if (fFlagSubDet == "EB") {
3931  TString ctype = fEcalNumbering->GetStexHalfStas(StexNumber);
3932  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha, StexNumber);
3933  ix_geo = (n1StexCrys - 1) / fEcal->MaxCrysVecoInStex(); // ix_geo for EB+
3934  if (ctype == "EB-") {
3935  ix_geo = fEcal->MaxCrysHocoInStex() - ix_geo - 1;
3936  }
3937  }
3938 
3939  if (fFlagSubDet == "EE") {
3940  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(StexNumber);
3941  ix_geo = 0;
3942  if (DeeDir == "right") {
3943  ix_geo = fEcalNumbering->GetIXCrysInDee(StexNumber, n1StexStin, i0StinEcha) - 1;
3944  }
3945  if (DeeDir == "left") {
3946  ix_geo = fEcal->MaxCrysIXInDee() - fEcalNumbering->GetIXCrysInDee(StexNumber, n1StexStin, i0StinEcha);
3947  }
3948  }
3949 
3950  return ix_geo;
3951 }
3952 
3953 Int_t TEcnaHistos::GetYCrysInStex(const Int_t& StexNumber, const Int_t& n1StexStin, const Int_t& j0StinEcha) {
3954  //Gives the Y crystal coordinate in the geographic view of one Stex
3955  // (Y = 0 to MaxStinVecoInStex*NbCrysVecoInStin - 1)
3956 
3957  Int_t iy_geo = 0;
3958 
3959  if (fFlagSubDet == "EB") {
3960  TString ctype = fEcalNumbering->GetStexHalfStas(StexNumber);
3961  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(n1StexStin, j0StinEcha, StexNumber);
3962  Int_t ix_geo = (n1StexCrys - 1) / fEcal->MaxCrysVecoInStex(); // ix_geo for EB+
3963  iy_geo = n1StexCrys - 1 - ix_geo * fEcal->MaxCrysVecoInStex(); // iy_geo for EB+
3964  if (ctype == "EB-") {
3965  iy_geo = fEcal->MaxCrysVecoInStex() - iy_geo - 1;
3966  }
3967  }
3968 
3969  if (fFlagSubDet == "EE") {
3970  iy_geo = fEcalNumbering->GetJYCrysInDee(StexNumber, n1StexStin, j0StinEcha) - 1;
3971  }
3972 
3973  return iy_geo;
3974 }
3975 
3976 //===========================================================================
3977 //
3978 // StexStinNumbering, ViewStexStinNumberingPad
3979 //
3980 // independent of the ROOT file => StexNumber as argument
3981 //
3982 //===========================================================================
3983 void TEcnaHistos::StexStinNumbering(const Int_t& StexNumber) {
3984  //display the Stin numbering of the Stex
3985 
3986  if (fFlagSubDet == "EB") {
3987  SMTowerNumbering(StexNumber);
3988  }
3989  if (fFlagSubDet == "EE") {
3990  DeeSCNumbering(StexNumber);
3991  }
3992 }
3993 // end of StexStinNumbering
3994 
3995 //=============================================================================
3996 //
3997 // ViewStexStinNumberingPad
3998 // independent of the ROOT file => StexNumber as argument
3999 //
4000 //=============================================================================
4001 void TEcnaHistos::ViewStexStinNumberingPad(const Int_t& StexNumber) {
4002  //display the Stin numbering of the Stex in a Pad
4003 
4004  if (fFlagSubDet == "EB") {
4005  ViewSMTowerNumberingPad(StexNumber);
4006  }
4007  if (fFlagSubDet == "EE") {
4008  ViewDeeSCNumberingPad(StexNumber);
4009  }
4010 }
4011 //----------------> end of ViewStexStinNumberingPad()
4012 
4013 //==========================================================================
4014 //
4015 // ViewStexGrid
4016 // independent of the ROOT file => StexNumber as argument
4017 //
4018 //==========================================================================
4019 void TEcnaHistos::ViewStexGrid(const Int_t& StexNumber, const TString& c_option) {
4020  //Grid of one Stex with axis Hoco and Veco
4021 
4022  if (fFlagSubDet == "EB") {
4023  ViewSMGrid(StexNumber, c_option);
4024  }
4025  if (fFlagSubDet == "EE") {
4026  ViewDeeGrid(StexNumber, c_option);
4027  }
4028 
4029 } // end of ViewStexGrid
4030 
4031 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& S P E C I F I C &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
4032 
4033 //======================================= BARREL ===============================
4034 void TEcnaHistos::SMTowerNumbering(const Int_t& SMNumber) {
4035  //display the tower numbering of the super-module
4036 
4037  if ((SMNumber > 0) && (SMNumber <= fEcal->MaxSMInEB())) {
4038  Int_t GeoBidSizeEta = fEcal->MaxTowEtaInSM() * fEcal->MaxCrysEtaInTow();
4039  Int_t GeoBidSizePhi = fEcal->MaxTowPhiInSM() * fEcal->MaxCrysPhiInTow();
4040 
4041  Int_t nb_binx = GeoBidSizeEta;
4042  Int_t nb_biny = GeoBidSizePhi;
4043  Axis_t xinf_bid = (Axis_t)0.;
4044  Axis_t xsup_bid = (Axis_t)GeoBidSizeEta;
4045  Axis_t yinf_bid = (Axis_t)0.;
4046  Axis_t ysup_bid = (Axis_t)GeoBidSizePhi;
4047 
4048  TString axis_x_var_name = " #eta ";
4049  TString axis_y_var_name = " #varphi ";
4050 
4051  //------------------------------------------------------------------- SMTowerNumbering
4052 
4053  //............. matrices reading and histogram filling
4054  char f_in_mat_tit[charArrLen];
4055 
4056  if (SMNumber <= fEcal->MaxSMPhiInEB()) {
4057  sprintf(f_in_mat_tit, " SM tower numbering");
4058  }
4059  if (SMNumber > fEcal->MaxSMPhiInEB()) {
4060  sprintf(f_in_mat_tit, " SM tower numbering ");
4061  }
4062 
4063  // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
4064 
4065  TH2D* h_empty_bid =
4066  new TH2D("grid_bidim_eta_phi", f_in_mat_tit, nb_binx, xinf_bid, xsup_bid, nb_biny, yinf_bid, ysup_bid);
4067  fCnewRoot++;
4068  h_empty_bid->Reset();
4069 
4070  h_empty_bid->GetXaxis()->SetTitle(axis_x_var_name);
4071  h_empty_bid->GetYaxis()->SetTitle(axis_y_var_name);
4072 
4073  // ------------------------------------------------ P L O T S (SMTowerNumbering)
4074 
4075  char f_in[charArrLen];
4076 
4077  //...................... Taille/format canvas
4078 
4079  UInt_t canv_h = fCnaParHistos->CanvasFormatH("etaphiSM");
4080  UInt_t canv_w = fCnaParHistos->CanvasFormatW("etaphiSM");
4081 
4082  //............................................... options generales
4083 
4085 
4086  //............................................... paves commentaires (SMTowerNumbering)
4087  SetAllPavesViewStex("Numbering", SMNumber);
4088 
4089  //------------------------------------ Canvas name ----------------- (SMTowerNumbering)
4090 
4091  sprintf(f_in, "tower_numbering_for_SuperModule_SM%d", SMNumber);
4092 
4093  SetHistoPresentation((TH1D*)h_empty_bid, "Stex2DEB");
4094 
4095  TCanvas* MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h);
4096  fCnewRoot++;
4097  fCurrentCanvas = MainCanvas;
4098  fCurrentCanvasName = f_in;
4099 
4100  // std::cout << "*TEcnaHistosEB::ViewSM(...)> Plot is displayed on canvas ----> " << f_in << std::endl;
4101 
4102  //------------------------ Canvas draw and update ------------ (SMTowerNumbering)
4103  fPavComStex->Draw();
4104 
4105  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
4106  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
4107  MainCanvas->Divide(1, 1, x_margin, y_margin);
4108  gPad->cd(1);
4109 
4110  h_empty_bid->DrawCopy("COL"); // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
4111 
4112  ViewSMTowerNumberingPad(SMNumber);
4113  gPad->Update();
4114 
4115  //..................... retour aux options standard
4116  Bool_t b_true = true;
4117  h_empty_bid->SetStats(b_true);
4118 
4119  h_empty_bid->Delete();
4120  h_empty_bid = nullptr;
4121  fCdeleteRoot++;
4122 
4123  // delete MainCanvas; fCdeleteRoot++;
4124 
4125  } else {
4126  std::cout << "!TEcnaHistos::SMTowerNumbering(...)> SM = " << SMNumber << ". Out of range ( range = [1,"
4127  << fEcal->MaxSMInEB() << "] )" << fTTBELL << std::endl;
4128  }
4129 }
4130 // end of SMTowerNumbering
4131 
4132 void TEcnaHistos::ViewSMTowerNumberingPad(const Int_t& SMNumber) {
4133  //display the tower numbering of the super-module in a Pad
4134 
4135  gStyle->SetTitleW(0.2); // taille titre histos
4136  gStyle->SetTitleH(0.07);
4137 
4138  ViewSMGrid(SMNumber, " ");
4139 
4140  Color_t couleur_rouge = fCnaParHistos->SetColorsForNumbers("lvrb_top");
4141  Color_t couleur_bleu_fonce = fCnaParHistos->SetColorsForNumbers("lvrb_bottom");
4142 
4143  //..... Ecriture des numeros de tours dans la grille..... (ViewSMTowerNumberingPad)
4144 
4145  char f_in[charArrLen];
4146  gStyle->SetTextSize(0.075);
4147 
4148  // x_channel, y_channel: coordinates of the text "Txx"
4149  Int_t y_channel = 12;
4150  Int_t x_channel = 12;
4151 
4152  Int_t max_tow_phi = fEcal->MaxTowPhiInSM() * fEcal->MaxCrysPhiInTow();
4153 
4154  //------------------ LOOP ON THE SM_TOWER NUMBER (ViewSMTowerNumberingPad)
4155 
4156  TText* text_SMtow_num = new TText();
4157  fCnewRoot++;
4158 
4159  for (Int_t i_SMtow = 1; i_SMtow <= fEcal->MaxTowInSM(); i_SMtow++) {
4160  if (fEcalNumbering->GetTowerLvrbType(i_SMtow) == "top") {
4161  text_SMtow_num->SetTextColor(couleur_rouge);
4162  }
4163  if (fEcalNumbering->GetTowerLvrbType(i_SMtow) == "bottom") {
4164  text_SMtow_num->SetTextColor(couleur_bleu_fonce);
4165  }
4166 
4167  //................................ x from eta
4168  Double_t x_from_eta = fEcalNumbering->GetEta(SMNumber, i_SMtow, x_channel) - (Double_t)1;
4169  if (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") {
4170  x_from_eta = fEcal->MaxTowEtaInSM() * fEcal->MaxCrysEtaInTow() + x_from_eta + (Double_t)1;
4171  }
4172 
4173  //................................ y from phi
4174  Double_t y_from_phi =
4175  max_tow_phi - 1 - (fEcalNumbering->GetPhi(SMNumber, i_SMtow, y_channel) - fEcalNumbering->GetPhiMin(SMNumber));
4176  if (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") {
4177  y_from_phi = -y_from_phi + fEcal->MaxTowPhiInSM() * fEcal->MaxCrysPhiInTow() - (Double_t)1;
4178  }
4179 
4180  sprintf(f_in, "%d", i_SMtow);
4181  text_SMtow_num->DrawText(x_from_eta, y_from_phi, f_in); // <=== prend du temps si on mets "T%d" dans le sprintf
4182  }
4183 
4184  text_SMtow_num->Delete();
4185  text_SMtow_num = nullptr;
4186  fCdeleteRoot++;
4187 
4188  //.................................................... legende (ViewSMTowerNumberingPad)
4189  Double_t offset_tow_tex_eta = (Double_t)8.;
4190  Double_t offset_tow_tex_phi = (Double_t)15.;
4191 
4192  Color_t couleur_noir = fCnaParHistos->ColorDefinition("noir");
4193  Double_t x_legend = (Double_t)0.;
4194  Double_t y_legend = (Double_t)0.;
4195 
4196  Int_t ref_tower = fEcal->MaxTowInSM();
4197 
4198  //................................................. LVRB TOP (ViewSMTowerNumberingPad)
4199  gStyle->SetTextSize(0.075);
4200  gStyle->SetTextColor(couleur_rouge);
4201  x_legend = fEcalNumbering->GetEta(SMNumber, ref_tower, x_channel);
4202  y_legend = fEcalNumbering->GetPhi(SMNumber, ref_tower, y_channel) - fEcalNumbering->GetPhiMin(SMNumber);
4203 
4204  if (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+") {
4205  x_legend = x_legend + offset_tow_tex_eta;
4206  y_legend = y_legend + offset_tow_tex_phi;
4207  }
4208  if (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") {
4209  x_legend = -x_legend + offset_tow_tex_eta;
4210  y_legend = y_legend + offset_tow_tex_phi;
4211  }
4212 
4213  sprintf(f_in, "xx");
4214  TText* text_legend_rouge = new TText(x_legend, y_legend, f_in);
4215  fCnewRoot++;
4216  text_legend_rouge->Draw();
4217  gStyle->SetTextSize(0.05);
4218  x_legend = x_legend - (Double_t)3.5;
4219  y_legend = y_legend - (Double_t)2.;
4220  sprintf(f_in, " LVRB ");
4221  TText* text_legend_rouge_expl = new TText(x_legend, y_legend, f_in);
4222  fCnewRoot++;
4223  text_legend_rouge_expl->Draw();
4224  y_legend = y_legend - (Double_t)1.75;
4225  if (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+") {
4226  sprintf(f_in, " <--- ");
4227  }
4228  if (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") {
4229  sprintf(f_in, " ---> ");
4230  }
4231  TText* text_legend_rouge_expm = new TText(x_legend, y_legend, f_in);
4232  fCnewRoot++;
4233  text_legend_rouge_expm->Draw();
4234  //text_legend_rouge_expl->Delete(); text_legend_rouge_expl = 0; fCdeleteRoot++;
4235 
4236  //................................................. LVRB BOTTOM (ViewSMTowerNumberingPad)
4237  gStyle->SetTextSize(0.075);
4238  gStyle->SetTextColor(couleur_bleu_fonce);
4239  x_legend = fEcalNumbering->GetEta(SMNumber, ref_tower, x_channel);
4240  y_legend = fEcalNumbering->GetPhi(SMNumber, ref_tower, y_channel) - fEcalNumbering->GetPhiMin(SMNumber);
4241 
4242  if (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+") {
4243  x_legend = x_legend + offset_tow_tex_eta;
4244  y_legend = y_legend + offset_tow_tex_phi / 3;
4245  }
4246  if (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") {
4247  x_legend = -x_legend + offset_tow_tex_eta;
4248  y_legend = y_legend + offset_tow_tex_phi / 3;
4249  }
4250 
4251  sprintf(f_in, "xx");
4252  TText* text_legend_bleu = new TText(x_legend, y_legend, f_in);
4253  fCnewRoot++;
4254  text_legend_bleu->Draw();
4255  //text_legend_bleu->Delete(); text_legend_bleu = 0; fCdeleteRoot++;
4256  gStyle->SetTextSize(0.05);
4257  x_legend = x_legend - (Double_t)3.5;
4258  y_legend = y_legend - (Double_t)2.;
4259  sprintf(f_in, " LVRB ");
4260  TText* text_legend_bleu_expl = new TText(x_legend, y_legend, f_in);
4261  fCnewRoot++;
4262  text_legend_bleu_expl->Draw();
4263  y_legend = y_legend - (Double_t)1.75;
4264  if (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+") {
4265  sprintf(f_in, " ---> ");
4266  }
4267  if (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") {
4268  sprintf(f_in, " <--- ");
4269  }
4270  TText* text_legend_bleu_expm = new TText(x_legend, y_legend, f_in);
4271  fCnewRoot++;
4272  text_legend_bleu_expm->Draw();
4273  //text_legend_bleu_expl->Delete(); text_legend_bleu_expl = 0; fCdeleteRoot++;
4274 
4275  gStyle->SetTextColor(couleur_noir);
4276 }
4277 //----------------> end of ViewSMTowerNumberingPad()
4278 
4279 void TEcnaHistos::ViewSMGrid(const Int_t& SMNumber, const TString& c_option) {
4280  //Grid of one supermodule with axis eta and phi
4281 
4282  Int_t GeoBidSizeEta = fEcal->MaxTowEtaInSM() * fEcal->MaxCrysEtaInTow();
4283  Int_t GeoBidSizePhi = fEcal->MaxTowPhiInSM() * fEcal->MaxCrysPhiInTow();
4284 
4285  if (c_option == "corcc") {
4286  GeoBidSizeEta = fEcal->MaxTowEtaInSM() * fEcal->MaxCrysInTow();
4287  GeoBidSizePhi = fEcal->MaxTowPhiInSM() * fEcal->MaxCrysInTow();
4288  }
4289 
4290  Int_t nb_binx = GeoBidSizeEta;
4291  Int_t nb_biny = GeoBidSizePhi;
4292  Axis_t xinf_bid = (Axis_t)0.;
4293  Axis_t xsup_bid = (Axis_t)GeoBidSizeEta;
4294  Axis_t yinf_bid = (Axis_t)0.;
4295  Axis_t ysup_bid = (Axis_t)GeoBidSizePhi;
4296 
4297  //---------------- trace de la grille: un rectangle = une tour
4298 
4299  Int_t size_eta = fEcal->MaxCrysEtaInTow();
4300  Int_t size_phi = fEcal->MaxCrysPhiInTow();
4301  if (c_option == "corcc") {
4302  size_eta = fEcal->MaxCrysInTow();
4303  size_phi = fEcal->MaxCrysInTow();
4304  }
4305  Int_t max_x = nb_binx / size_eta;
4306  Int_t max_y = nb_biny / size_phi;
4307 
4308  //............................. lignes horizontales
4309  Double_t yline = (Double_t)yinf_bid;
4310 
4311  Double_t xline_left = (Double_t)xinf_bid;
4312  Double_t xline_right = (Double_t)xsup_bid;
4313 
4314  for (Int_t j = 0; j < max_y; j++) {
4315  yline = yline + (Double_t)size_phi;
4316  TLine* lin;
4317  lin = new TLine(xline_left, yline, xline_right, yline);
4318  fCnewRoot++;
4319  lin->Draw();
4320  // delete lin; fCdeleteRoot++;
4321  }
4322 
4323  //.......................... lignes verticales
4324  Double_t xline = (Double_t)xinf_bid - (Double_t)size_eta;
4325 
4326  Double_t yline_bot = (Double_t)yinf_bid;
4327  Double_t yline_top = (Double_t)ysup_bid;
4328 
4329  Color_t coul_surligne = fCnaParHistos->ColorDefinition("noir");
4330  Color_t coul_textmodu = fCnaParHistos->ColorDefinition("vert36");
4331 
4332  //............................ Mj text
4333  gStyle->SetTextColor(coul_textmodu);
4334  gStyle->SetTextSize(0.075);
4335 
4336  char f_in[charArrLen];
4337 
4338  for (Int_t i = 0; i < max_x; i++) {
4339  xline = xline + (Double_t)size_eta;
4340  TLine* lin;
4341  lin = new TLine(xline, yline_bot, xline, yline_top);
4342  fCnewRoot++;
4343 
4344  //............. Surlignage separateur des modules
4345  if ((fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") && (i == 4 || i == 8 || i == 12)) {
4346  lin->SetLineWidth(2);
4347  lin->SetLineColor(coul_surligne);
4348  }
4349  if ((fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+") && (i == 5 || i == 9 || i == 13)) {
4350  lin->SetLineWidth(2);
4351  lin->SetLineColor(coul_surligne);
4352  }
4353 
4354  lin->Draw();
4355  // delete lin; fCdeleteRoot++;
4356 
4357  //............. Numeros des modules
4358  if ((fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") && (i == 2 || i == 6 || i == 10 || i == 14)) {
4359  if (i == 2) {
4360  sprintf(f_in, "M4");
4361  }
4362  if (i == 6) {
4363  sprintf(f_in, "M3");
4364  }
4365  if (i == 10) {
4366  sprintf(f_in, "M2");
4367  }
4368  if (i == 14) {
4369  sprintf(f_in, "M1");
4370  }
4371 
4372  TText* text_num_module = new TText(xline + 1, yline_top + 1, f_in);
4373  fCnewRoot++;
4374  text_num_module->Draw();
4375  //text_num_module->Delete(); text_num_module = 0; fCdeleteRoot++;
4376  }
4377  if ((fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+") && (i == 3 || i == 7 || i == 11 || i == 15)) {
4378  if (i == 3) {
4379  sprintf(f_in, "M1");
4380  }
4381  if (i == 7) {
4382  sprintf(f_in, "M2");
4383  }
4384  if (i == 11) {
4385  sprintf(f_in, "M3");
4386  }
4387  if (i == 15) {
4388  sprintf(f_in, "M4");
4389  }
4390 
4391  TText* text_num_module = new TText(xline, yline_top + 1, f_in);
4392  fCnewRoot++;
4393  text_num_module->Draw();
4394  //text_num_module->Delete(); text_num_module = 0; fCdeleteRoot++;
4395  }
4396  }
4397 
4398  //------------------ trace axes en eta et phi --------------- ViewSMGrid
4399 
4400  Int_t MatSize = fEcal->MaxCrysEtaInTow();
4401  if (c_option == "corcc") {
4402  MatSize = fEcal->MaxCrysInTow();
4403  }
4404 
4405  Int_t size_eta_sm = fEcal->MaxTowEtaInSM();
4406  Int_t size_phi_sm = fEcal->MaxTowPhiInSM();
4407 
4408  //...................................................... Axe i(eta) (bottom x) ViewSMGrid
4409  Double_t eta_min = fEcalNumbering->GetIEtaMin(SMNumber);
4410  Double_t eta_max = fEcalNumbering->GetIEtaMax(SMNumber);
4411 
4412  TString x_var_name = GetHocoVecoAxisTitle("ietaSM");
4413  ;
4414  TString x_direction = fEcalNumbering->GetXDirectionEB(SMNumber);
4415 
4416  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
4417  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize("SMx");
4418  Float_t tic_siz_x = fCnaParHistos->AxisTickSize("SMx");
4419  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("SMx");
4420  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("SMx");
4421 
4422  new TF1("f1", x_direction.Data(), eta_min, eta_max);
4423  fCnewRoot++;
4424  TGaxis* sup_axis_x = nullptr;
4425 
4426  if (x_direction == "-x") // NEVER IN THIS CASE: xmin->xmax <=> right->left ("-x") direction
4427  {
4428  sup_axis_x = new TGaxis(
4429  (Float_t)0., (Float_t)0., (Float_t)(size_eta_sm * MatSize), (Float_t)0., "f1", size_eta_sm, "SC", 0.);
4430  fCnewRoot++;
4431  }
4432 
4433  if (x_direction == "x") // ALWAYS IN THIS CASE: xmin->xmax <=> left->right ("x") direction
4434  {
4435  sup_axis_x = new TGaxis(
4436  (Float_t)0., (Float_t)0., (Float_t)(size_eta_sm * MatSize), (Float_t)0., "f1", size_eta_sm, "SC", 0.);
4437  fCnewRoot++;
4438  }
4439 
4440  sup_axis_x->SetTitle(x_var_name);
4441  sup_axis_x->SetTitleSize(tit_siz_x);
4442  sup_axis_x->SetTitleOffset(tit_off_x);
4443  sup_axis_x->SetLabelSize(lab_siz_x);
4444  sup_axis_x->SetLabelOffset(lab_off_x);
4445  sup_axis_x->SetTickSize(tic_siz_x);
4446  sup_axis_x->Draw("SAME");
4447 
4448  //...................................................... Axe phi (y) ViewSMGrid
4449  Double_t phi_min = fEcalNumbering->GetPhiMin(SMNumber);
4450  Double_t phi_max = fEcalNumbering->GetPhiMax(SMNumber);
4451 
4452  TString y_var_name = GetHocoVecoAxisTitle("phi");
4453  TString y_direction = fEcalNumbering->GetYDirectionEB(SMNumber);
4454 
4455  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
4456  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize("SMy");
4457  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("SMy");
4458  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("SMy");
4459  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("SMy");
4460 
4461  new TF1("f2", y_direction.Data(), phi_min, phi_max);
4462  fCnewRoot++;
4463  TGaxis* sup_axis_y = nullptr;
4464 
4465  if (y_direction == "-x") // ALWAYS IN THIS CASE: ymin->ymax <=> top->bottom ("-x") direction
4466  {
4467  sup_axis_y = new TGaxis(-(Float_t)1.5 * (Float_t)size_eta,
4468  (Float_t)0.,
4469  -(Float_t)1.5 * (Float_t)size_eta,
4470  (Float_t)(size_phi_sm * MatSize),
4471  "f2",
4472  (Int_t)size_phi_sm,
4473  "SC",
4474  0.);
4475  fCnewRoot++;
4476  }
4477 
4478  if (y_direction == "x") // NEVER IN THIS CASE: ymin->ymax <=> bottom->top ("x") direction
4479  {
4480  sup_axis_y = new TGaxis(-(Float_t)1.5 * (Float_t)size_eta,
4481  (Float_t)0.,
4482  -(Float_t)1.5 * (Float_t)size_eta,
4483  (Float_t)(size_phi_sm * MatSize),
4484  "f2",
4485  (Int_t)size_phi_sm,
4486  "SC",
4487  0.);
4488  fCnewRoot++;
4489  }
4490 
4491  sup_axis_y->SetTitle(y_var_name);
4492  sup_axis_y->SetTitleSize(tit_siz_y);
4493  sup_axis_y->SetTitleOffset(tit_off_y);
4494  sup_axis_y->SetLabelSize(lab_siz_y);
4495  sup_axis_y->SetLabelOffset(lab_off_y);
4496  sup_axis_y->SetTickSize(tic_siz_y);
4497  sup_axis_y->Draw("SAME");
4498 
4499  //...................................................... Axe jphi (jy) ViewSMGrid
4500  Double_t jphi_min = fEcalNumbering->GetJPhiMin(SMNumber);
4501  Double_t jphi_max = fEcalNumbering->GetJPhiMax(SMNumber);
4502 
4503  TString jy_var_name = " ";
4504  TString jy_direction = fEcalNumbering->GetJYDirectionEB(SMNumber);
4505 
4506  new TF1("f3", jy_direction.Data(), jphi_min, jphi_max);
4507  fCnewRoot++;
4508  TGaxis* sup_axis_jy = nullptr;
4509 
4510  //............; essai
4511  sup_axis_jy = new TGaxis(
4512  (Float_t)0., (Float_t)0., (Float_t)0., (Float_t)(size_phi_sm * MatSize), "f3", (Int_t)size_phi_sm, "SC", 0.);
4513  fCnewRoot++;
4514 
4515  if (jy_direction == "-x") // IN THIS CASE FOR EB+: ymin->ymax <=> top->bottom ("-x") direction
4516  {
4517  jy_var_name = GetEtaPhiAxisTitle("jphiSMB+");
4518  }
4519 
4520  if (jy_direction == "x") // IN THIS CASE FOR EB-: ymin->ymax <=> bottom->top ("x") direction
4521  {
4522  jy_var_name = GetEtaPhiAxisTitle("jphiSMB-");
4523  }
4524 
4525  lab_off_y = fCnaParHistos->AxisLabelOffset("SMyInEB");
4526 
4527  sup_axis_jy->SetTitle(jy_var_name);
4528  sup_axis_jy->SetTitleSize(tit_siz_y);
4529  sup_axis_jy->SetTitleOffset(tit_off_y);
4530  sup_axis_jy->SetLabelSize(lab_siz_y);
4531  sup_axis_jy->SetLabelOffset(lab_off_y);
4532  sup_axis_jy->SetTickSize(tic_siz_y);
4533  sup_axis_jy->Draw("SAME");
4534 
4535  //--------------------------- ViewSMGrid
4536 
4537  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
4538 
4539 } // end of ViewSMGrid
4540 
4541 //======================================= ENDCAP ===============================
4542 void TEcnaHistos::DeeSCNumbering(const Int_t& DeeNumber) {
4543  //display the SC numbering of the Dee
4544 
4545  if ((DeeNumber > 0) && (DeeNumber <= fEcal->MaxDeeInEE())) {
4546  Int_t GeoBidSizeIX = fEcal->MaxSCIXInDee() * fEcal->MaxCrysIXInSC();
4547  Int_t GeoBidSizeIY = fEcal->MaxSCIYInDee() * fEcal->MaxCrysIYInSC();
4548 
4549  Int_t nb_binx = GeoBidSizeIX;
4550  Int_t nb_biny = GeoBidSizeIY;
4551  Axis_t xinf_bid = (Axis_t)0.;
4552  Axis_t xsup_bid = (Axis_t)GeoBidSizeIX;
4553  Axis_t yinf_bid = (Axis_t)0.;
4554  Axis_t ysup_bid = (Axis_t)GeoBidSizeIY;
4555 
4556  TString axis_x_var_name = " IX ";
4557  TString axis_y_var_name = " IY ";
4558 
4559  //------------------------------------------------------------------- DeeSCNumbering
4560 
4561  //........................................... empty histogram filling
4562  char f_in_mat_tit[charArrLen];
4563 
4564  sprintf(f_in_mat_tit, " Dee SC numbering ");
4565 
4566  // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
4567 
4568  TH2D* h_empty_bid =
4569  new TH2D("grid_bidim_IX_IY", f_in_mat_tit, nb_binx, xinf_bid, xsup_bid, nb_biny, yinf_bid, ysup_bid);
4570  fCnewRoot++;
4571 
4572  h_empty_bid->Reset();
4573 
4574  h_empty_bid->GetXaxis()->SetTitle(axis_x_var_name);
4575  h_empty_bid->GetYaxis()->SetTitle(axis_y_var_name);
4576 
4577  // ------------------------------------------------ P L O T S (DeeSCNumbering)
4578 
4579  char f_in[charArrLen];
4580 
4581  //...................... Taille/format canvas
4582 
4583  UInt_t canv_h = fCnaParHistos->CanvasFormatH("IXIYDee");
4584  UInt_t canv_w = fCnaParHistos->CanvasFormatW("IXIYDee");
4585 
4586  //............................................... options generales
4588 
4589  //............................................... paves commentaires (DeeSCNumbering)
4590  SetAllPavesViewStex("Numbering", DeeNumber);
4591 
4592  //------------------------------------ Canvas name ----------------- (DeeSCNumbering)
4593 
4594  sprintf(f_in, "SC_numbering_for_Dee_Dee%d", DeeNumber);
4595  SetHistoPresentation((TH1D*)h_empty_bid, "Stex2DEENb");
4596  TCanvas* MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h);
4597  fCnewRoot++;
4598  fCurrentCanvas = MainCanvas;
4599  fCurrentCanvasName = f_in;
4600 
4601  // std::cout << "*TEcnaHistosEE::ViewDee(...)> Plot is displayed on canvas ----> " << f_in << std::endl;
4602 
4603  //------------------------ Canvas draw and update ------------ (DeeSCNumbering)
4604  fPavComStex->Draw();
4605  fPavComCxyz->Draw();
4606 
4607  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
4608  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
4609  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
4610  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_Dee") - 0.005;
4611 
4612  Double_t x_margin = x_low;
4613  Double_t y_margin = y_low;
4614 
4615  MainCanvas->Divide(1, 1, x_margin, y_margin);
4616  // Divide(nx, ny, x_margin, y_margin, color);
4617 
4618  gPad->cd(1);
4619  TVirtualPad* main_subpad = gPad;
4620  main_subpad->SetPad(x_low, y_low, x_up, y_up);
4621 
4622  h_empty_bid->DrawCopy("COL"); // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
4623 
4624  ViewDeeSCNumberingPad(DeeNumber);
4625 
4626  gPad->Update(); // prend beaucoup de temps...
4627 
4628  //..................... retour aux options standard
4629  Bool_t b_true = true;
4630  h_empty_bid->SetStats(b_true);
4631 
4632  h_empty_bid->Delete();
4633  h_empty_bid = nullptr;
4634  fCdeleteRoot++;
4635 
4636  // delete MainCanvas; fCdeleteRoot++;
4637  } else {
4638  std::cout << "!TEcnaHistos::DeeSCNumbering(...)> Dee = " << DeeNumber << ". Out of range ( range = [1,"
4639  << fEcal->MaxDeeInEE() << "] )" << fTTBELL << std::endl;
4640  }
4641 }
4642 // end of DeeSCNumbering
4643 
4644 void TEcnaHistos::ViewDeeSCNumberingPad(const Int_t& DeeNumber) {
4645  //display the SC numbering of the Dee in a Pad
4646 
4647  gStyle->SetTitleW(0.4); // taille titre histos
4648  gStyle->SetTitleH(0.08);
4649 
4650  ViewDeeGrid(DeeNumber, " ");
4651 
4652  //..... SC numbers writing in the grid .... (ViewDeeSCNumberingPad)
4653 
4654  char f_in[charArrLen];
4655  gStyle->SetTextSize(0.0325);
4656 
4657  //------------------ LOOP ON THE Dee_SC NUMBER (ViewDeeSCNumberingPad)
4658  Int_t x_channel = 0; // => defined here after according to DeeDir and SCQuadType
4659  TText* text_DSSC_num = new TText();
4660  fCnewRoot++;
4661  TText* text_DeeSCCons_num = new TText();
4662  fCnewRoot++;
4663 
4664  for (Int_t n1DeeSCEcna = 1; n1DeeSCEcna <= fEcal->MaxSCEcnaInDee(); n1DeeSCEcna++) {
4665  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
4666  TString SCQuadType = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna);
4667  if (SCQuadType == "top" && DeeDir == "right") {
4668  x_channel = 13;
4669  }
4670  if (SCQuadType == "top" && DeeDir == "left") {
4671  x_channel = 7;
4672  }
4673  if (SCQuadType == "bottom" && DeeDir == "left") {
4674  x_channel = 11;
4675  }
4676  if (SCQuadType == "bottom" && DeeDir == "right") {
4677  x_channel = 17;
4678  }
4679  Int_t i_SCEcha = (Int_t)x_channel;
4680 
4681  Double_t x_from_IX = (Double_t)GetXCrysInStex(DeeNumber, n1DeeSCEcna, i_SCEcha);
4682  Double_t y_from_IY = (Double_t)GetYCrysInStex(DeeNumber, n1DeeSCEcna, i_SCEcha);
4683  Double_t y_from_IYp = y_from_IY + (Double_t)1.;
4684  Double_t y_from_IYm = y_from_IY - (Double_t)1.;
4685 
4686  TString DeeEndcap = fEcalNumbering->GetEEDeeEndcap(DeeNumber);
4687  Color_t couleur_SC = GetSCColor(DeeEndcap, DeeDir, SCQuadType);
4688  text_DSSC_num->SetTextColor(couleur_SC);
4689  text_DeeSCCons_num->SetTextColor((Color_t)1);
4690 
4691  Int_t i_DSSC = fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
4692  Int_t i_DeeSCCons = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
4693  if (i_DSSC > 0) {
4694  if (
4695  //.................................................... (D2,S9) , (D4,S1)
4696  !(i_DeeSCCons == 33 && n1DeeSCEcna == 60) && !(i_DeeSCCons == 33 && n1DeeSCEcna == 119) &&
4697  //................................................... (D2,S8) , (D4,S2)
4698  !(i_DeeSCCons == 29 && n1DeeSCEcna == 32) && // !(29c and 58c)
4699  !(i_DeeSCCons == 29 && n1DeeSCEcna == 138) && !(i_DeeSCCons == 29 && n1DeeSCEcna == 157) &&
4700  !(i_DeeSCCons == 58 && n1DeeSCEcna == 176) && !(i_DeeSCCons == 58 && n1DeeSCEcna == 193) &&
4701  //.................................................... (D2,S7) , (D4,S3)
4702  !(i_DeeSCCons == 149 && n1DeeSCEcna == 188) &&
4703  //.................................................... (D2,S6) , (D4,S4)
4704  !(i_DeeSCCons == 112 && n1DeeSCEcna == 29) && !(i_DeeSCCons == 112 && n1DeeSCEcna == 144) &&
4705  !(i_DeeSCCons == 112 && n1DeeSCEcna == 165) && !(i_DeeSCCons == 119 && n1DeeSCEcna == 102) &&
4706  !(i_DeeSCCons == 119 && n1DeeSCEcna == 123) &&
4707  //.................................................... (D2,S5) , (D4,S5)
4708  !(i_DeeSCCons == 132 && n1DeeSCEcna == 41) &&
4709  //----------------------------------------------------------------------
4710  //.................................................... (D1,S1) , (D3,S9)
4711  !(i_DeeSCCons == 182 && n1DeeSCEcna == 60) && !(i_DeeSCCons == 182 && n1DeeSCEcna == 119) &&
4712  //.................................................... (D1,S2) , (D3,S8)
4713  !(i_DeeSCCons == 178 && n1DeeSCEcna == 32) && // !(178c and 207c)
4714  !(i_DeeSCCons == 178 && n1DeeSCEcna == 138) && !(i_DeeSCCons == 178 && n1DeeSCEcna == 157) &&
4715  !(i_DeeSCCons == 207 && n1DeeSCEcna == 176) && !(i_DeeSCCons == 207 && n1DeeSCEcna == 193) &&
4716  //.................................................... (D1,S3) , (D3,S7)
4717  !(i_DeeSCCons == 298 && n1DeeSCEcna == 188) &&
4718  //.................................................... (D1,S4) , (D3,S6)
4719  !(i_DeeSCCons == 261 && n1DeeSCEcna == 29) && // !(261a and 268a)
4720  !(i_DeeSCCons == 261 && n1DeeSCEcna == 144) && !(i_DeeSCCons == 261 && n1DeeSCEcna == 165) &&
4721  !(i_DeeSCCons == 268 && n1DeeSCEcna == 102) && !(i_DeeSCCons == 268 && n1DeeSCEcna == 123) &&
4722  //.................................................... (D1,S5) , (D3,S5)
4723  !(i_DeeSCCons == 281 && n1DeeSCEcna == 41)) {
4724  sprintf(f_in, "%d", i_DSSC);
4725  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in); // <=== DrawText: prend du temps
4726  sprintf(f_in, "%d", i_DeeSCCons);
4727  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in); // <=== DrawText: prend du temps
4728  }
4729 
4730  //.................................................... (D2,S9) , (D4,S1)
4731 
4732  if (i_DeeSCCons == 33 && n1DeeSCEcna == 60) {
4733  sprintf(f_in, "30a");
4734  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4735  sprintf(f_in, "33a");
4736  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4737  }
4738  if (i_DeeSCCons == 33 && n1DeeSCEcna == 119) {
4739  sprintf(f_in, "30b");
4740  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4741  sprintf(f_in, "33b");
4742  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4743  }
4744  //.................................................... (D2,S8) , (D4,S2)
4745  if (i_DeeSCCons == 29 && n1DeeSCEcna == 32) {
4746  sprintf(f_in, " 3c-25c");
4747  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4748  sprintf(f_in, "29c-58c");
4749  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4750  }
4751  if (i_DeeSCCons == 29 && n1DeeSCEcna == 138) {
4752  sprintf(f_in, "3a");
4753  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4754  sprintf(f_in, "29a");
4755  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4756  }
4757  if (i_DeeSCCons == 29 && n1DeeSCEcna == 157) {
4758  sprintf(f_in, "3b");
4759  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4760  sprintf(f_in, "29b");
4761  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4762  }
4763 
4764  if (i_DeeSCCons == 58 && n1DeeSCEcna == 176) {
4765  sprintf(f_in, "25a");
4766  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4767  sprintf(f_in, "58a");
4768  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4769  }
4770  if (i_DeeSCCons == 58 && n1DeeSCEcna == 193) {
4771  sprintf(f_in, "25b");
4772  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4773  sprintf(f_in, "58b");
4774  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4775  }
4776  //.................................................... (D2,S7) , (D4,S3)
4777  if (i_DeeSCCons == 149 && n1DeeSCEcna == 188) {
4778  sprintf(f_in, "34a");
4779  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4780  sprintf(f_in, "149a");
4781  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4782  }
4783  //.................................................... (D2,S6) , (D4,S4)
4784  if (i_DeeSCCons == 112 && n1DeeSCEcna == 29) {
4785  sprintf(f_in, " 14a-21a");
4786  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4787  sprintf(f_in, "112a-119a");
4788  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4789  }
4790  if (i_DeeSCCons == 112 && n1DeeSCEcna == 144) {
4791  sprintf(f_in, "14c");
4792  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4793  sprintf(f_in, "112c");
4794  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4795  }
4796  if (i_DeeSCCons == 112 && n1DeeSCEcna == 165) {
4797  sprintf(f_in, "14b");
4798  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4799  sprintf(f_in, "112b");
4800  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4801  }
4802 
4803  if (i_DeeSCCons == 119 && n1DeeSCEcna == 102) {
4804  sprintf(f_in, "21c");
4805  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4806  sprintf(f_in, "119c");
4807  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4808  }
4809  if (i_DeeSCCons == 119 && n1DeeSCEcna == 123) {
4810  sprintf(f_in, "21b");
4811  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4812  sprintf(f_in, "119b");
4813  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4814  }
4815  //.................................................... (D2,S5) , (D4,S5)
4816  if (i_DeeSCCons == 132 && n1DeeSCEcna == 41) {
4817  sprintf(f_in, "3a");
4818  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4819  sprintf(f_in, "132a");
4820  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4821  }
4822 
4823  //.................................................... (D1,S1) , (D3,S9)
4824  if (i_DeeSCCons == 182 && n1DeeSCEcna == 60) {
4825  sprintf(f_in, "30a");
4826  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4827  sprintf(f_in, "182a");
4828  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4829  }
4830  if (i_DeeSCCons == 182 && n1DeeSCEcna == 119) {
4831  sprintf(f_in, "30b");
4832  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4833  sprintf(f_in, "182b");
4834  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4835  }
4836  //.................................................... (D1,S2) , (D3,S8)
4837  if (i_DeeSCCons == 178 && n1DeeSCEcna == 32) {
4838  sprintf(f_in, " 3c-25c");
4839  text_DSSC_num->DrawText(x_from_IX - 6, y_from_IYp, f_in);
4840  sprintf(f_in, "178c-207c");
4841  text_DeeSCCons_num->DrawText(x_from_IX - 6, y_from_IYm, f_in);
4842  }
4843  if (i_DeeSCCons == 178 && n1DeeSCEcna == 138) {
4844  sprintf(f_in, "3a");
4845  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4846  sprintf(f_in, "178a");
4847  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4848  }
4849  if (i_DeeSCCons == 178 && n1DeeSCEcna == 157) {
4850  sprintf(f_in, "3b");
4851  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4852  sprintf(f_in, "178b");
4853  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4854  }
4855 
4856  if (i_DeeSCCons == 207 && n1DeeSCEcna == 176) {
4857  sprintf(f_in, "25a");
4858  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4859  sprintf(f_in, "207a");
4860  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4861  }
4862  if (i_DeeSCCons == 207 && n1DeeSCEcna == 193) {
4863  sprintf(f_in, "25b");
4864  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4865  sprintf(f_in, "207b");
4866  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4867  }
4868  //.................................................... (D1,S3) , (D3,S7)
4869  if (i_DeeSCCons == 298 && n1DeeSCEcna == 188) {
4870  sprintf(f_in, "34a");
4871  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4872  sprintf(f_in, "298a");
4873  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4874  }
4875  //.................................................... (D1,S4) , (D3,S6)
4876  if (i_DeeSCCons == 261 && n1DeeSCEcna == 29) {
4877  sprintf(f_in, " 14a-21a");
4878  text_DSSC_num->DrawText(x_from_IX - 6, y_from_IYp, f_in);
4879  sprintf(f_in, "261a-268a");
4880  text_DeeSCCons_num->DrawText(x_from_IX - 6, y_from_IYm, f_in);
4881  }
4882  if (i_DeeSCCons == 261 && n1DeeSCEcna == 144) {
4883  sprintf(f_in, "14c");
4884  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4885  sprintf(f_in, "261c");
4886  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4887  }
4888  if (i_DeeSCCons == 261 && n1DeeSCEcna == 165) {
4889  sprintf(f_in, "14b");
4890  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4891  sprintf(f_in, "261b");
4892  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4893  }
4894 
4895  if (i_DeeSCCons == 268 && n1DeeSCEcna == 102) {
4896  sprintf(f_in, "21c");
4897  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4898  sprintf(f_in, "268c");
4899  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4900  }
4901  if (i_DeeSCCons == 268 && n1DeeSCEcna == 123) {
4902  sprintf(f_in, "21b");
4903  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4904  sprintf(f_in, "268b");
4905  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4906  }
4907  //.................................................... (D1,S5) , (D3,S5)
4908  if (i_DeeSCCons == 281 && n1DeeSCEcna == 41) {
4909  sprintf(f_in, "20a");
4910  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4911  sprintf(f_in, "281a");
4912  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4913  }
4914  }
4915  }
4916 
4917  // delete text_DSSC_num; fCdeleteRoot++;
4918 
4919  //......................... mention "color, black"
4920  Color_t coul_textcolors = fCnaParHistos->ColorDefinition("noir");
4921  sprintf(f_in, "color: nb in Data Sector, black: nb for construction");
4922  Int_t x_colors = 3;
4923  Int_t y_colors = -14;
4924 
4925  TText* text_colors = new TText(x_colors, y_colors, f_in);
4926  fCnewRoot++;
4927  text_colors->SetTextSize(0.03);
4928  text_colors->SetTextColor(coul_textcolors);
4929  text_colors->Draw();
4930 
4931  Color_t couleur_noir = fCnaParHistos->ColorDefinition("noir");
4932  gStyle->SetTextColor(couleur_noir);
4933 }
4934 //----------------> end of ViewDeeSCNumberingPad()
4935 
4936 void TEcnaHistos::ViewDeeGrid(const Int_t& DeeNumber, const TString& c_option) {
4937  //Grid of one Dee with axis IX and IY
4938 
4939  Int_t GeoBidSizeIX = fEcal->MaxSCIXInDee() * fEcal->MaxCrysIXInSC();
4940  Int_t GeoBidSizeIY = fEcal->MaxSCIYInDee() * fEcal->MaxCrysIYInSC();
4941 
4942  if (c_option == "corcc") {
4943  GeoBidSizeIX = fEcal->MaxSCIXInDee() * fEcal->MaxCrysInSC();
4944  GeoBidSizeIY = fEcal->MaxSCIYInDee() * fEcal->MaxCrysInSC();
4945  }
4946 
4947  Int_t nb_binx = GeoBidSizeIX;
4948  Int_t nb_biny = GeoBidSizeIY;
4949  Axis_t xinf_bid = (Axis_t)0.;
4950  Axis_t xsup_bid = (Axis_t)GeoBidSizeIX;
4951 
4952  Axis_t yinf_bid = (Axis_t)0.;
4953  Axis_t ysup_bid = (Axis_t)GeoBidSizeIY;
4954  Double_t ymid_bid = (Double_t)(ysup_bid - yinf_bid) / 2.;
4955 
4956  //---------------- trace de la grille: un rectangle = un super-cristal
4957 
4958  Int_t size_IX = fEcal->MaxCrysIXInSC();
4959  Int_t size_IY = fEcal->MaxCrysIYInSC();
4960 
4961  if (c_option == "corcc") {
4962  size_IX = fEcal->MaxCrysInSC();
4963  size_IY = fEcal->MaxCrysInSC();
4964  }
4965 
4966  Int_t max_x = nb_binx / size_IX;
4967  Int_t max_y = nb_biny / size_IY;
4968  Int_t max_yd = max_y / 2;
4969 
4970  //= SURLIGNAGES (unite de coordonnees: le cristal ou 5 fois le cristal si option corcc)
4971  //........................... multplicative coefficient for corcc option
4972  Int_t coefcc_x = (Int_t)1;
4973  Int_t coefcc_y = (Int_t)1;
4974  if (c_option == "corcc") {
4975  coefcc_x = fEcal->MaxCrysIXInSC();
4976  coefcc_y = fEcal->MaxCrysIYInSC();
4977  }
4978 
4979  //............................. lignes horizontales
4980  Double_t yline = (Double_t)yinf_bid - (Double_t)size_IY;
4981 
4982  Double_t xline_beg = (Double_t)xinf_bid;
4983  Double_t xline_end = (Double_t)xsup_bid;
4984 
4985  // k = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10
4986  Int_t x_min[11] = {11, 11, 7, 0, 0, 0, 0, 0, 0, 0, 0};
4987  Int_t x_max[11] = {50, 50, 47, 45, 45, 42, 37, 35, 30, 15, 50};
4988  for (Int_t i = 0; i < 11; i++) {
4989  x_min[i] = coefcc_x * x_min[i];
4990  x_max[i] = coefcc_x * x_max[i];
4991  }
4992 
4993  for (Int_t j = 0; j < max_y; j++) {
4994  if (j < max_yd) // j = 0,1,2,3,4,5,6,7,8,9
4995  {
4996  if (DeeNumber == 1 || DeeNumber == 3) {
4997  xline_beg = xinf_bid + (Double_t)x_min[10 - j];
4998  xline_end = xinf_bid + (Double_t)x_max[10 - j];
4999  }
5000  if (DeeNumber == 2 || DeeNumber == 4) {
5001  xline_beg = xsup_bid - (Double_t)x_max[10 - j];
5002  xline_end = xsup_bid - (Double_t)x_min[10 - j];
5003  }
5004  }
5005 
5006  if (j == max_yd) // j = 10
5007  {
5008  if (DeeNumber == 1 || DeeNumber == 3) {
5009  xline_beg = xinf_bid + (Double_t)x_min[0];
5010  xline_end = xinf_bid + (Double_t)x_max[0];
5011  }
5012  if (DeeNumber == 2 || DeeNumber == 4) {
5013  xline_beg = xsup_bid - (Double_t)x_max[0];
5014  xline_end = xsup_bid - (Double_t)x_min[0];
5015  }
5016  }
5017 
5018  if (j > max_yd) // j = 11,12,13,14,15,16,17,18,19,20
5019  {
5020  if (DeeNumber == 1 || DeeNumber == 3) {
5021  xline_beg = xinf_bid + (Double_t)x_min[j - 10];
5022  xline_end = xinf_bid + (Double_t)x_max[j - 10];
5023  }
5024  if (DeeNumber == 2 || DeeNumber == 4) {
5025  xline_beg = xsup_bid - (Double_t)x_max[j - 10];
5026  xline_end = xsup_bid - (Double_t)x_min[j - 10];
5027  }
5028  }
5029 
5030  yline = yline + (Double_t)size_IY;
5031  TLine* lin;
5032  lin = new TLine(xline_beg, yline, xline_end, yline);
5033  fCnewRoot++;
5034  lin->Draw();
5035  //lin->Delete(); // => si on delete, pas de trace de la ligne
5036  // delete lin; fCdeleteRoot++;
5037  }
5038 
5039  //.......................... lignes verticales
5040  Double_t xline = (Double_t)xinf_bid - (Double_t)size_IX;
5041 
5042  Double_t yline_haut_bot = (Double_t)ymid_bid;
5043  Double_t yline_haut_top = (Double_t)ysup_bid;
5044 
5045  Double_t yline_bas_bot = (Double_t)yinf_bid;
5046  Double_t yline_bas_top = (Double_t)ymid_bid;
5047 
5048  // coordonnees demi-lignes
5049  // l = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10
5050  Int_t y_min[11] = {0, 11, 7, 0, 0, 0, 0, 0, 0, 0, 0};
5051  Int_t y_max[11] = {50, 50, 47, 45, 45, 42, 38, 35, 30, 15, 10};
5052  for (Int_t i = 0; i < 11; i++) {
5053  y_min[i] = coefcc_y * y_min[i];
5054  y_max[i] = coefcc_y * y_max[i];
5055  }
5056 
5057  gStyle->SetTextSize(0.075); // ===> pourquoi pas avant?
5058 
5059  for (Int_t i = 0; i <= max_x; i++) {
5060  if (DeeNumber == 1 || DeeNumber == 3) {
5061  yline_haut_bot = ymid_bid + (Double_t)y_min[i];
5062  yline_haut_top = ymid_bid + (Double_t)y_max[i];
5063  }
5064  if (DeeNumber == 2 || DeeNumber == 4) {
5065  yline_haut_bot = ymid_bid + (Double_t)y_min[10 - i];
5066  yline_haut_top = ymid_bid + (Double_t)y_max[10 - i];
5067  }
5068  yline_bas_bot = ysup_bid - yline_haut_top;
5069  yline_bas_top = ysup_bid - yline_haut_bot;
5070 
5071  xline = xline + (Double_t)size_IX;
5072  TLine* lin_haut;
5073  lin_haut = new TLine(xline, yline_haut_bot, xline, yline_haut_top);
5074  fCnewRoot++;
5075  lin_haut->Draw();
5076  // delete lin_haut; fCdeleteRoot++;
5077  TLine* lin_bas;
5078  lin_bas = new TLine(xline, yline_bas_bot, xline, yline_bas_top);
5079  fCnewRoot++;
5080  lin_bas->Draw();
5081  // delete lin_bas; fCdeleteRoot++;
5082  }
5083 
5084  Float_t fcoefcc_x = (Float_t)coefcc_x;
5085  Float_t fcoefcc_y = (Float_t)coefcc_y;
5086 
5087  EEDataSectors(fcoefcc_x, fcoefcc_y, DeeNumber, "Dee");
5088  EEGridAxis(DeeNumber, "Dee", c_option);
5089 
5090 } // end of ViewDeeGrid
5091 
5092 //=================================================================================
5093 //
5094 // SqrtContourLevels(const Int_t& nb_niv, Double_t* cont_niv)
5095 //
5096 //=================================================================================
5097 void TEcnaHistos::SqrtContourLevels(const Int_t& nb_niv, Double_t* cont_niv) {
5098  //Calculation of levels in z coordinate for 3D plots. Square root scale
5099 
5100  Int_t nb_niv2 = (nb_niv + 1) / 2;
5101 
5102  for (Int_t num_niv = 0; num_niv < nb_niv2; num_niv++) {
5103  Int_t ind_niv = num_niv + nb_niv2 - 1;
5104  if (ind_niv < 0 || ind_niv > nb_niv) {
5105  std::cout << "!TEcnaHistos::ContourLevels(...)> *** ERROR *** "
5106  << "wrong contour levels for correlation matrix" << fTTBELL << std::endl;
5107  } else {
5108  cont_niv[ind_niv] = (Double_t)(num_niv * num_niv) / ((Double_t)((nb_niv2 - 1) * (nb_niv2 - 1)));
5109  }
5110  }
5111  for (Int_t num_niv = -1; num_niv > -nb_niv2; num_niv--) {
5112  Int_t ind_niv = num_niv + nb_niv2 - 1;
5113  if (ind_niv < 0 || ind_niv > nb_niv) {
5114  std::cout << "!TEcnaHistos::ContourLevels(...)> *** ERROR *** "
5115  << "wrong contour levels for correlation matrix" << fTTBELL << std::endl;
5116  } else {
5117  cont_niv[ind_niv] = -(Double_t)(num_niv * num_niv) / ((Double_t)((nb_niv2 - 1) * (nb_niv2 - 1)));
5118  }
5119  }
5120 }
5121 
5122 //==========================================================================
5123 //
5124 // GetHocoVecoAxisTitle
5125 //
5126 //==========================================================================
5127 TString TEcnaHistos::GetHocoVecoAxisTitle(const TString& chcode) {
5128  TString xname = " ";
5129 
5130  if (fFlagSubDet == "EB") {
5131  xname = GetEtaPhiAxisTitle(chcode);
5132  }
5133  if (fFlagSubDet == "EE") {
5134  xname = GetIXIYAxisTitle(chcode);
5135  }
5136 
5137  return xname;
5138 }
5139 
5140 TString TEcnaHistos::GetEtaPhiAxisTitle(const TString& chcode) {
5141  TString xname = " ";
5142 
5143  if (chcode == "ietaEB") {
5144  xname = "i#eta Xtal ";
5145  }
5146  if (chcode == "ietaSM") {
5147  xname = "i#eta Xtal ";
5148  }
5149  if (chcode == "ietaTow") {
5150  xname = "i#eta Xtal ";
5151  }
5152 
5153  if (chcode == "iphiEB") {
5154  xname = " i#varphi Xtal";
5155  }
5156  if (chcode == "jphiEB+") {
5157  xname = " i#varphi Xtal";
5158  }
5159  if (chcode == "jphiEB-") {
5160  xname = " i#varphi Xtal";
5161  }
5162  if (chcode == "jphiSMB+") {
5163  xname = " i#varphi Xtal";
5164  }
5165  if (chcode == "jphiSMB-") {
5166  xname = "i#varphi Xtal ";
5167  }
5168  if (chcode == "jphiTow") {
5169  xname = "i#varphi Xtal in SM ";
5170  }
5171  if (chcode == "phi") {
5172  xname = "i#varphi Xtal in EB ";
5173  }
5174 
5175  return xname;
5176 }
5177 
5178 TString TEcnaHistos::GetIXIYAxisTitle(const TString& chcode) {
5179  TString xname = " ";
5180 
5181  if (chcode == "iIXDee") {
5182  xname = "IX(SC)";
5183  }
5184 
5185  if (chcode == "iIXDee1") {
5186  xname = " -IX Xtal";
5187  }
5188  if (chcode == "iIXDee2") {
5189  xname = " IX Xtal ";
5190  }
5191  if (chcode == "iIXDee3") {
5192  xname = " IX Xtal";
5193  }
5194  if (chcode == "iIXDee4") {
5195  xname = "-IX Xtal ";
5196  }
5197 
5198  if (chcode == "iIXEE") {
5199  xname = " IX Xtal";
5200  }
5201 
5202  if (chcode == "iIXSC") {
5203  xname = "IX Xtal";
5204  }
5205 
5206  if (chcode == "jIYDee") {
5207  xname = "IY Xtal";
5208  }
5209  if (chcode == "jIYSC") {
5210  xname = "IY Xtal";
5211  }
5212  if (chcode == "IY") {
5213  xname = "IY";
5214  }
5215 
5216  return xname;
5217 }
5218 
5219 //=======================================================================================
5220 //
5221 // ViewStas(***)
5222 //
5223 // (Hoco,Veco) matrices for all the Stex's of a Stas
5224 // Stas = EB or EE
5225 //
5226 //=======================================================================================
5227 void TEcnaHistos::ViewStas(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead, const TString& HistoCode) {
5228  // (Hoco, Veco) matrices for all the Stex's of a Stas
5229 
5230  //......................... matrix title
5231  char f_in_mat_tit[charArrLen];
5232 
5233  if (HistoCode == "D_NOE_ChNb") {
5234  sprintf(f_in_mat_tit, "Number of Events");
5235  }
5236  if (HistoCode == "D_Ped_ChNb") {
5237  sprintf(f_in_mat_tit, "Pedestals");
5238  }
5239  if (HistoCode == "D_TNo_ChNb") {
5240  sprintf(f_in_mat_tit, "Total noise");
5241  }
5242  if (HistoCode == "D_MCs_ChNb") {
5243  sprintf(f_in_mat_tit, "Mean cor(s,s')");
5244  }
5245  if (HistoCode == "D_LFN_ChNb") {
5246  sprintf(f_in_mat_tit, "Low frequency noise");
5247  }
5248  if (HistoCode == "D_HFN_ChNb") {
5249  sprintf(f_in_mat_tit, "High frequency noise");
5250  }
5251  if (HistoCode == "D_SCs_ChNb") {
5252  sprintf(f_in_mat_tit, "Sigma of cor(s,s')");
5253  }
5254 
5255  //.... Axis parameters: *** WARNING *** EB ===> x (Bid Hoco) = phi (StinVeco), y (Bid Veco) = eta (StinHoco)
5256  Int_t GeoBidSizeHoco = fEcal->MaxStinVecoInStas();
5257  Int_t GeoBidSizeVeco = fEcal->MaxStinHocoInStas();
5258 
5259  Int_t vertic_empty_strips = 3;
5260  Int_t vertic_empty_strip_1 = 1;
5261 
5262  if (fFlagSubDet == "EE") {
5263  // for empty vertical strips: before EE-, between EE- and EE+, after EE+ on plot
5264  GeoBidSizeHoco = fEcal->MaxStinHocoInStas() + vertic_empty_strips;
5265  GeoBidSizeVeco = fEcal->MaxStinVecoInStas();
5266  }
5267 
5268  Int_t nb_binx = GeoBidSizeHoco;
5269  Int_t nb_biny = GeoBidSizeVeco;
5270  Axis_t xinf_bid = (Axis_t)0.;
5271  Axis_t xsup_bid = (Axis_t)GeoBidSizeHoco;
5272  Axis_t yinf_bid = (Axis_t)0.;
5273  Axis_t ysup_bid = (Axis_t)GeoBidSizeVeco;
5274 
5275  TString axis_x_var_name = " #Hoco ";
5276  TString axis_y_var_name = " #varVeco ";
5277 
5278  //............. matrices reading and histogram filling (ViewStas)
5279 
5280  TH2D* h_geo_bid =
5281  new TH2D("geobidim_ViewStas", f_in_mat_tit, nb_binx, xinf_bid, xsup_bid, nb_biny, yinf_bid, ysup_bid);
5282  fCnewRoot++;
5283  h_geo_bid->Reset();
5284 
5285  Int_t CounterExistingFile = 0;
5286  Int_t CounterDataExist = 0;
5287 
5288  Int_t* xFapNbOfEvts = new Int_t[fEcal->MaxStexInStas()];
5289  fCnew++;
5290  for (Int_t i = 0; i < fEcal->MaxStexInStas(); i++) {
5291  xFapNbOfEvts[i] = 0;
5292  }
5293 
5294  //Int_t* NOFE_int = new Int_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
5295 
5296  //......................................................................... (ViewStas)
5297  for (Int_t iStasStex = 0; iStasStex < fEcal->MaxStexInStas(); iStasStex++) {
5298  TVectorD partial_histp(fEcal->MaxStinEcnaInStex());
5299  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
5300  partial_histp(i) = (Double_t)0.;
5301  }
5302 
5303  Bool_t OKFileExists = kFALSE;
5304  Bool_t OKDataExist = kFALSE;
5305 
5306  if (arg_AlreadyRead == fTobeRead) {
5308  Int_t n1StasStex = iStasStex + 1;
5311  fFapRunNumber,
5315  n1StasStex,
5316  fCfgResultsRootFilePath.Data());
5317 
5318  if (fMyRootFile->LookAtRootFile() == kTRUE) {
5319  OKFileExists = kTRUE;
5320  } // (ViewStas)
5321 
5322  if (OKFileExists == kTRUE) {
5323  xFapNbOfEvts[iStasStex] = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, n1StasStex);
5324  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
5325  // std::cout << "*TEcnaHistos::ViewStas(...)> Data are analyzed from file ----> "
5326  // << fp_name_short << std::endl;
5327 
5328  //....................... search for first and last dates
5329  if (iStasStex == 0) {
5334  }
5335 
5336  time_t xStartTime = fMyRootFile->GetStartTime();
5337  time_t xStopTime = fMyRootFile->GetStopTime();
5338  TString xStartDate = fMyRootFile->GetStartDate();
5339  TString xStopDate = fMyRootFile->GetStopDate();
5340 
5341  if (xStartTime < fStartTime) {
5342  fStartTime = xStartTime;
5343  fStartDate = xStartDate;
5344  }
5345  if (xStopTime > fStopTime) {
5346  fStopTime = xStopTime;
5347  fStopDate = xStopDate;
5348  }
5349 
5351 
5352  //----------------------------------------------------------------------------- file reading (ViewStas)
5353  if (HistoCode == "D_NOE_ChNb") {
5355  }
5356  if (HistoCode == "D_Ped_ChNb") {
5358  }
5359  if (HistoCode == "D_TNo_ChNb") {
5361  }
5362  if (HistoCode == "D_MCs_ChNb") {
5364  }
5365  if (HistoCode == "D_LFN_ChNb") {
5367  }
5368  if (HistoCode == "D_HFN_ChNb") {
5370  }
5371  if (HistoCode == "D_SCs_ChNb") {
5373  }
5374 
5375  if (fMyRootFile->DataExist() == kTRUE) {
5376  OKDataExist = kTRUE;
5377  }
5378  } else {
5379  fStatusFileFound = kFALSE;
5380  std::cout << "!TEcnaHistos::ViewStas(...)> *ERROR* =====> "
5381  << " ROOT file not found" << fTTBELL << std::endl;
5382  }
5383  }
5384 
5385  if (arg_AlreadyRead == 1) {
5386  OKDataExist = kTRUE;
5387  for (Int_t i0Stin = 0; i0Stin < fEcal->MaxStinEcnaInStex(); i0Stin++) {
5388  partial_histp(i0Stin) = arg_read_histo(fEcal->MaxStinEcnaInStex() * iStasStex + i0Stin);
5389  }
5390  }
5391 
5392  if (OKDataExist == kTRUE) {
5393  fStatusFileFound = kTRUE;
5394  CounterExistingFile++;
5395 
5396  //................................................................. (ViewStas)
5397  TMatrixD read_matrix(nb_binx, nb_biny);
5398  for (Int_t i = 0; i < nb_binx; i++) {
5399  for (Int_t j = 0; j < nb_biny; j++) {
5400  read_matrix(i, j) = (Double_t)0.;
5401  }
5402  }
5403 
5404  if (OKDataExist == kTRUE) {
5405  fStatusDataExist = kTRUE;
5406  CounterDataExist++;
5407 
5408  for (Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++) {
5409  //-------------------------------------- Geographical bidim filling (ViewStas)
5410  Int_t i_xgeo = GetXStinInStas(iStasStex, i0StexStinEcna, vertic_empty_strip_1);
5411  Int_t i_ygeo = GetYStinInStas(iStasStex, i0StexStinEcna);
5412 
5413  if (i_xgeo >= 0 && i_xgeo < nb_binx && i_ygeo >= 0 && i_ygeo < nb_biny) {
5414  Int_t n1StexStinEcna = i0StexStinEcna + 1;
5415 
5416  if (fFlagSubDet == "EB") {
5417  read_matrix(i_xgeo, i_ygeo) = partial_histp(i0StexStinEcna);
5418  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo, (Double_t)read_matrix(i_xgeo, i_ygeo));
5419  }
5420 
5421  if (fFlagSubDet == "EE") {
5422  //---------------------> do not draw bin for SCEcna = 10 or 11 (ViewStas)
5423  if (!((n1StexStinEcna == 10 || n1StexStinEcna == 11 || n1StexStinEcna == 29 || n1StexStinEcna == 32))) {
5424  read_matrix(i_xgeo, i_ygeo) = partial_histp(i0StexStinEcna);
5425  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo, (Double_t)read_matrix(i_xgeo, i_ygeo));
5426  }
5427  if (n1StexStinEcna == 29) {
5428  //----------------------------------------------------------------- (ViewStas)
5429  // Average on SCEcna 29 (x1+x2+x3+x6+x7) and SCEcna 10: (x11)
5430  // (x = Xtal# in SC; see CMS NOTE 2006/027, p.10)
5431  //
5432  // (x1+x2+x3+x6+x7)/5 = partial_histp(29-1) ; x11 = partial_histp(10-1)
5433  //
5434  // => (x1+x2+x3+x6+x7+x11)/6 = partial_histp(29-1)*5/6 + partial_histp(10-1)/6
5435  //
5436  // // except for "D_NOE_ChNb" because average done in ReadAverageNumberOfEvents
5437  // // (no averaged NbOfEvts in root file)
5438  //---------------------------------------------------------------------------------
5439  read_matrix(i_xgeo, i_ygeo) =
5440  partial_histp(i0StexStinEcna) * (Double_t)(5. / 6.) + partial_histp(9) / (Double_t)6.;
5441  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo, (Double_t)read_matrix(i_xgeo, i_ygeo));
5442  }
5443  //if( n1StexStinEcna == 32 && HistoCode != "D_NOE_ChNb" ) (ViewStas)
5444  if (n1StexStinEcna == 32) {
5445  //---- same as previous case: replace SCEcna 29 by 32 AND SCEcna 10 by 11
5446  //----> (x1+x2+x3+x6+x7+x11)/6 = partial_histp(32-1)*5/6 + partial_histp(11-1)/6
5447  read_matrix(i_xgeo, i_ygeo) =
5448  partial_histp(i0StexStinEcna) * (Double_t)(5. / 6.) + partial_histp(10) / (Double_t)6.;
5449  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo, (Double_t)read_matrix(i_xgeo, i_ygeo));
5450  }
5451  } // end of if( fFlagSubDet == "EE" )
5452  } // end of if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
5453  } // end of for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
5454  } // end of if ( fMyRootFile->DataExist() == kTRUE )
5455  else {
5456  fStatusDataExist = kFALSE;
5457 
5458  std::cout << "!TEcnaHistos::ViewStas(...)> "
5459  << " Data not available for " << fFapStexName << " " << iStasStex + 1
5460  << " (Quantity not present in the ROOT file)" << fTTBELL << std::endl;
5461  }
5462  } // end of if( fMyRootFile->LookAtRootFile() == kTRUE ) (ViewStas)
5463  else {
5464  fStatusFileFound = kFALSE;
5465 
5466  std::cout << "!TEcnaHistos::ViewStas(...)> "
5467  << " Data not available for " << fFapStexName << " " << iStasStex + 1 << " (ROOT file not found)"
5468  << fTTBELL << std::endl;
5469  }
5470 
5471  if (fFapNbOfEvts <= xFapNbOfEvts[iStasStex]) {
5472  fFapNbOfEvts = xFapNbOfEvts[iStasStex];
5473  }
5474 
5475  } // end of for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
5476 
5477  //delete [] NOFE_int; NOFE_int = 0; fCdelete++;
5478  delete[] xFapNbOfEvts;
5479  xFapNbOfEvts = nullptr;
5480  fCdelete++;
5481 
5482  if (CounterExistingFile > 0 && CounterDataExist > 0) {
5483  //=============== H I S T O M I N / M A X M A N A G E M E N T ============ (ViewStas)
5484  //................................ Put histo min max values
5485  //.......... default if flag not set to "ON"
5486  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
5487  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
5488 
5489  if (fUserHistoMin == fUserHistoMax) {
5490  fFlagUserHistoMin = "AUTO";
5491  fFlagUserHistoMax = "AUTO";
5492  }
5493  //.......... user's value if flag set to "ON"
5494  if (fFlagUserHistoMin == "ON") {
5495  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
5496  fFlagUserHistoMin = "OFF";
5497  }
5498  if (fFlagUserHistoMax == "ON") {
5499  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
5500  fFlagUserHistoMax = "OFF";
5501  }
5502  //................................. automatic min and/or max
5503  if (fFlagUserHistoMin == "AUTO") {
5504  SetYminMemoFromValue(HistoCode.Data(), h_geo_bid->GetMinimum());
5505  fFlagUserHistoMin = "OFF";
5506  }
5507  if (fFlagUserHistoMax == "AUTO") {
5508  SetYmaxMemoFromValue(HistoCode.Data(), h_geo_bid->GetMaximum());
5509  fFlagUserHistoMax = "OFF";
5510  }
5511  //...................................... histo set ymin and ymax
5512  SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, HistoCode);
5513 
5514  // ************************** A GARDER EN RESERVE *******************************
5515  //............. special contour level for correlations (square root wise scale)
5516  //if ( HistoCode == "D_MCs_ChNb" )
5517  //{
5518  // Int_t nb_niv = 9;
5519  // Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
5520  // SqrtContourLevels(nb_niv, &cont_niv[0]);
5521  // h_geo_bid->SetContour(nb_niv, &cont_niv[0]);
5522  // delete [] cont_niv; fCdelete++;
5523  //}
5524  // ******************************** (FIN RESERVE) *******************************
5525 
5526  // =================================== P L O T S ======================== (ViewStas)
5527 
5528  char f_in[charArrLen];
5529 
5530  //...................... Taille/format canvas
5531  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
5532  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
5533 
5534  if (fFlagSubDet == "EB") {
5535  canv_w = fCnaParHistos->CanvasFormatW("phietaEB");
5536  canv_h = fCnaParHistos->CanvasFormatH("phietaEB");
5537  }
5538  if (fFlagSubDet == "EE") {
5539  canv_w = fCnaParHistos->CanvasFormatW("IYIXEE");
5540  canv_h = fCnaParHistos->CanvasFormatH("IYIXEE");
5541  }
5542 
5543  //............................................... paves commentaires (ViewStas)
5545 
5546  //------------------------------------ Canvas name ----------------- (ViewStas)
5547  TString name_cov_cor;
5548  name_cov_cor.Resize(charArrLen);
5549  name_cov_cor = "?";
5550 
5551  if (HistoCode == "D_NOE_ChNb") {
5552  name_cov_cor = "Number_of_Events";
5553  }
5554  if (HistoCode == "D_Ped_ChNb") {
5555  name_cov_cor = "Pedestals";
5556  }
5557  if (HistoCode == "D_TNo_ChNb") {
5558  name_cov_cor = "Total_noise";
5559  }
5560  if (HistoCode == "D_MCs_ChNb") {
5561  name_cov_cor = "Mean_Corss";
5562  }
5563  if (HistoCode == "D_LFN_ChNb") {
5564  name_cov_cor = "Low_Fq_Noise";
5565  }
5566  if (HistoCode == "D_HFN_ChNb") {
5567  name_cov_cor = "High_Fq_Noise";
5568  }
5569  if (HistoCode == "D_SCs_ChNb") {
5570  name_cov_cor = "Sigma_Corss";
5571  }
5572 
5573  TString name_visu;
5574  name_visu.Resize(charArrLen);
5575  name_visu = "colz";
5576 
5577  sprintf(f_in,
5578  "%s_%s_S1_%d_R%d_%d_%d_%s_%s_HocoVeco_R%d",
5579  name_cov_cor.Data(),
5580  fFapAnaType.Data(),
5582  fFapRunNumber,
5585  fFlagSubDet.Data(),
5586  name_visu.Data(),
5587  arg_AlreadyRead);
5588 
5589  if (fFlagSubDet == "EB") {
5590  SetHistoPresentation((TH1D*)h_geo_bid, "Stas2DEB");
5591  }
5592  if (fFlagSubDet == "EE") {
5593  SetHistoPresentation((TH1D*)h_geo_bid, "Stas2DEE");
5594  }
5595 
5596  TCanvas* MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h);
5597  fCnewRoot++;
5598  fCurrentCanvas = MainCanvas;
5599  fCurrentCanvasName = f_in;
5600 
5601  // std::cout << "*TEcnaHistos::ViewStas(...)> Plot is displayed on canvas ----> " << f_in << std::endl;
5602 
5603  //------------------------ Canvas draw and update ------------ (ViewStas)
5604  if (fPavComGeneralTitle != nullptr) {
5605  fPavComGeneralTitle->Draw();
5606  }
5607 
5608  fPavComStas->Draw();
5609  fPavComAnaRun->Draw();
5610  fPavComNbOfEvts->Draw();
5611 
5612  //----------------------------------------------------------- pad margins
5613  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
5614  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
5615  Double_t x_margin = x_low;
5616  Double_t y_margin = y_low;
5617  MainCanvas->Divide(1, 1, x_margin, y_margin);
5618  // Divide(nx, ny, x_margin, y_margin, color);
5619  gPad->cd(1);
5620  //........................... specific EE
5621  if (fFlagSubDet == "EE") {
5622  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
5623  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_EE") - 0.005;
5624  TVirtualPad* main_subpad = gPad;
5625  main_subpad->SetPad(x_low, y_low, x_up, y_up);
5626  }
5627 
5628  //------------------------------------------------------------
5629  h_geo_bid->GetXaxis()->SetTitle(axis_x_var_name);
5630  h_geo_bid->GetYaxis()->SetTitle(axis_y_var_name);
5631 
5632  h_geo_bid->DrawCopy("COLZ");
5633 
5634  // trace de la grille ---------------- (ViewStas)
5635  ViewStasGrid(vertic_empty_strips);
5636  gPad->Draw();
5637  gPad->Update();
5638 
5639  // delete MainCanvas; fCdeleteRoot++;
5640  }
5641  //..................... retour aux options standard
5642 
5643  Bool_t b_true = true;
5644  h_geo_bid->SetStats(b_true);
5645  h_geo_bid->Delete();
5646  h_geo_bid = nullptr;
5647  fCdeleteRoot++;
5648 
5649 } // end of ViewStas(...)
5650 
5651 //==================================================================================
5652 //
5653 // GetXStinInStas , GetYStinInStas
5654 //
5655 //==================================================================================
5656 Int_t TEcnaHistos::GetXStinInStas(const Int_t& iStasStex,
5657  const Int_t& StexStinEcna,
5658  const Int_t& vertic_empty_strip_1) {
5659  //Gives the X Stin coordinate in the geographic view of the Stas
5660  // (X = 0 to MaxStexHocoInStas*MaxStinHocoInStex - 1 + vertic_empty_strips(EE only))
5661 
5662  Int_t ix_geo = 0;
5663  Int_t n1StasStex = iStasStex + 1;
5664  TString ctype = fEcalNumbering->GetStexHalfStas(n1StasStex);
5665 
5666  if (fFlagSubDet == "EB") {
5667  if (ctype == "EB-") {
5668  ix_geo = (iStasStex - fEcal->MaxStexInStasMinus()) * fEcal->MaxStinVecoInStex() +
5669  StexStinEcna % fEcal->MaxStinVecoInStex();
5670  }
5671  if (ctype == "EB+") {
5672  ix_geo = iStasStex * fEcal->MaxStinVecoInStex() + fEcal->MaxStinVecoInStex() - 1 -
5673  StexStinEcna % fEcal->MaxStinVecoInStex();
5674  }
5675  }
5676 
5677  if (fFlagSubDet == "EE") {
5678  TString LeftRightFromIP = fEcalNumbering->GetDeeDirViewedFromIP(n1StasStex);
5679 
5680  if (ctype == "EE-" && LeftRightFromIP == "left") {
5681  ix_geo = fEcal->MaxStinHocoInStex() - StexStinEcna / fEcal->MaxStinVecoInStex() - 1 + vertic_empty_strip_1;
5682  }
5683  if (ctype == "EE-" && LeftRightFromIP == "right") {
5684  ix_geo = fEcal->MaxStinHocoInStex() + StexStinEcna / fEcal->MaxStinVecoInStex() + vertic_empty_strip_1;
5685  }
5686  if (ctype == "EE+" && LeftRightFromIP == "left") {
5687  ix_geo = (Int_t)fCnaParHistos->DeeOffsetX(fFlagSubDet, n1StasStex) + fEcal->MaxStinHocoInStex() -
5688  StexStinEcna / fEcal->MaxStinVecoInStex() - 1;
5689  }
5690  if (ctype == "EE+" && LeftRightFromIP == "right") {
5691  ix_geo = (Int_t)fCnaParHistos->DeeOffsetX(fFlagSubDet, n1StasStex) + StexStinEcna / fEcal->MaxStinVecoInStex();
5692  }
5693  }
5694  return ix_geo;
5695 }
5696 
5697 Int_t TEcnaHistos::GetYStinInStas(const Int_t& iStasStex, const Int_t& StexStinEcna) {
5698  //Gives the Y crystal coordinate in the geographic view of one Stex
5699  // (Y = 0 to MaxStexVecoInStas*MaxStinVecoInStex - 1)
5700 
5701  Int_t iy_geo = 0;
5702 
5703  if (fFlagSubDet == "EB") {
5704  Int_t n1StasStex = iStasStex + 1;
5705  TString ctype = fEcalNumbering->GetStexHalfStas(n1StasStex);
5706  if (ctype == "EB+") {
5707  iy_geo = StexStinEcna / fEcal->MaxStinVecoInStex() + fEcal->MaxStinHocoInStex();
5708  }
5709  if (ctype == "EB-") {
5710  iy_geo = fEcal->MaxStinHocoInStex() - 1 - StexStinEcna / fEcal->MaxStinVecoInStex();
5711  }
5712  }
5713 
5714  if (fFlagSubDet == "EE") {
5715  iy_geo = StexStinEcna % fEcal->MaxStinVecoInStex();
5716  }
5717  return iy_geo;
5718 }
5719 
5720 //==========================================================================
5721 //
5722 // ViewStasGrid
5723 // independent of the ROOT file
5724 //
5725 //==========================================================================
5726 void TEcnaHistos::ViewStasGrid(const Int_t& vertic_empty_strips) {
5727  //Grid of Stas with axis Hoco and Veco
5728 
5729  if (fFlagSubDet == "EB") {
5730  ViewEBGrid();
5731  }
5732  if (fFlagSubDet == "EE") {
5733  ViewEEGrid(vertic_empty_strips);
5734  }
5735 
5736 } // end of ViewStasGrid
5737 
5739  //Grid of EB with axis Hoco and Veco
5740 
5741  Int_t GeoBidSizeEta = fEcal->MaxSMEtaInEB() * fEcal->MaxTowEtaInSM();
5742  Int_t GeoBidSizePhi = fEcal->MaxSMPhiInEB() * fEcal->MaxTowPhiInSM();
5743 
5744  Int_t size_y = fEcal->MaxTowEtaInSM();
5745  Int_t size_x = fEcal->MaxTowPhiInSM();
5746 
5747  Int_t nb_binx = GeoBidSizePhi;
5748  Int_t nb_biny = GeoBidSizeEta;
5749  Axis_t xinf_bid = (Axis_t)0.;
5750  Axis_t xsup_bid = (Axis_t)nb_binx;
5751  Axis_t yinf_bid = (Axis_t)0.;
5752  Axis_t ysup_bid = (Axis_t)nb_biny;
5753 
5754  //---------------- trace de la grille: un rectangle = un SM
5755 
5756  Int_t max_x = nb_binx / size_x; // = fEcal->MaxSMPhiInEB()
5757  Int_t max_y = nb_biny / size_y; // = fEcal->MaxSMEtaInEB()
5758 
5759  //............................. lignes horizontales (ViewEBGrid)
5760  Double_t yline = (Double_t)yinf_bid;
5761 
5762  Double_t xline_left = (Double_t)xinf_bid;
5763  Double_t xline_right = (Double_t)xsup_bid;
5764 
5765  for (Int_t j = 0; j < max_y; j++) {
5766  yline = yline + (Double_t)size_y;
5767  TLine* lin;
5768  lin = new TLine(xline_left, yline, xline_right, yline);
5769  fCnewRoot++;
5770  lin->Draw();
5771  // delete lin; fCdeleteRoot++;
5772  }
5773 
5774  //-------------------------------- lignes verticales
5775  Double_t xline = (Double_t)xinf_bid - (Double_t)size_x;
5776 
5777  Double_t yline_bot = (Double_t)yinf_bid;
5778  Double_t yline_top = (Double_t)ysup_bid;
5779 
5780  for (Int_t i = 0; i < max_x; i++) {
5781  xline = xline + (Double_t)size_x;
5782  TLine* lin;
5783  lin = new TLine(xline, yline_bot, xline, yline_top);
5784  fCnewRoot++;
5785  lin->Draw();
5786  }
5787 
5788  //-------------------------------- Numeros des SM
5789  Double_t yTextBot = yline_bot - (yline_top - yline_bot) / 25.;
5790  Double_t yTextTop = yline_top + (yline_top - yline_bot) / 120.;
5791  xline = (Double_t)xinf_bid - (Double_t)size_x;
5792 
5793  char f_in[charArrLen];
5794  TText* text_SM = new TText();
5795  fCnewRoot++;
5796  for (Int_t i = 0; i < max_x; i++) {
5797  xline = xline + (Double_t)size_x;
5798  text_SM->SetTextColor(fCnaParHistos->ColorDefinition("bleu_fonce"));
5799  text_SM->SetTextSize((Double_t)0.03);
5800  sprintf(f_in, " +%d", i + 1);
5801  text_SM->DrawText(xline, yTextTop, f_in);
5802  sprintf(f_in, " %d", -i - 1);
5803  text_SM->DrawText(xline, yTextBot, f_in);
5804  }
5805 
5806  //------------------ trace axes en eta et phi --------------- ViewEBGrid
5807 
5808  Int_t SMNumber = 1;
5809 
5810  //...................................................... Axe i(phi) (bottom x) ViewEBGrid
5811  Int_t MatSize = fEcal->MaxTowPhiInSM();
5812  Int_t size_x_eb = fEcal->MaxSMPhiInEB();
5813  Double_t phi_min = 0;
5814  Double_t phi_max = 360;
5815 
5816  TString x_var_name = GetHocoVecoAxisTitle("iphiEB");
5817  ;
5818  TString x_direction = fEcalNumbering->GetXDirectionEB(SMNumber);
5819 
5820  new TF1("f1", x_direction.Data(), phi_min, phi_max);
5821  fCnewRoot++;
5822  TGaxis* sup_axis_x = nullptr;
5823 
5824  if (x_direction == "-x") // NEVER IN THIS CASE: xmin->xmax <=> right->left ("-x") direction
5825  {
5826  sup_axis_x =
5827  new TGaxis((Float_t)0., (Float_t)0., (Float_t)(size_x_eb * MatSize), (Float_t)0., "f1", size_x_eb, "SC", 0.);
5828  fCnewRoot++;
5829  }
5830 
5831  if (x_direction == "x") // ALWAYS IN THIS CASE: xmin->xmax <=> left->right ("x") direction
5832  {
5833  sup_axis_x =
5834  new TGaxis((Float_t)0., (Float_t)0., (Float_t)(size_x_eb * MatSize), (Float_t)0., "f1", size_x_eb, "SC", 0.);
5835  fCnewRoot++;
5836  }
5837 
5838  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
5839  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize("EBx");
5840  Float_t tic_siz_x = fCnaParHistos->AxisTickSize("SMx");
5841  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("EBx");
5842  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("EBx");
5843 
5844  sup_axis_x->SetTitle(x_var_name);
5845  sup_axis_x->SetTitleSize(tit_siz_x);
5846  sup_axis_x->SetTitleOffset(tit_off_x);
5847  sup_axis_x->SetLabelSize(lab_siz_x);
5848  sup_axis_x->SetLabelOffset(lab_off_x);
5849  sup_axis_x->SetTickSize(tic_siz_x);
5850  sup_axis_x->Draw("SAME");
5851 
5852  //...................................................... Axe eta (y) ViewEBGrid
5853  MatSize = fEcal->MaxTowEtaInSM();
5854  Int_t size_y_eb = fEcal->MaxSMEtaInEB();
5855 
5856  Double_t eta_min = (Double_t)(-85.);
5857  Double_t eta_max = (Double_t)85.;
5858 
5859  TString y_var_name = GetHocoVecoAxisTitle("ietaEB");
5860 
5861  TGaxis* sup_axis_y = nullptr;
5862  sup_axis_y = new TGaxis(
5863  (Float_t)0., (Float_t)0., (Float_t)0., (Float_t)(size_y_eb * MatSize), eta_min, eta_max, MatSize / 2, "SC", 0.);
5864  fCnewRoot++;
5865 
5866  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
5867  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize("EBy");
5868  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("SMy");
5869  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("EBy");
5870  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("EBy");
5871 
5872  sup_axis_y->SetTitle(y_var_name);
5873  sup_axis_y->SetTitleSize(tit_siz_y);
5874  sup_axis_y->SetTitleOffset(tit_off_y);
5875  sup_axis_y->SetLabelColor(1);
5876  sup_axis_y->SetLabelSize(lab_siz_y);
5877  sup_axis_y->SetLabelOffset(lab_off_y);
5878  sup_axis_y->SetTickSize(tic_siz_y);
5879  sup_axis_y->Draw("SAME");
5880 
5881  //f2 = 0;
5882 
5883  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
5884 
5885 } // end of ViewEBGrid
5886 //---------------------------------------------------------------------
5887 void TEcnaHistos::ViewEEGrid(const Int_t& vertic_empty_strips) {
5888  //Grid of EE with axis Hoco and Veco
5889 
5890  Float_t coefcc_x = (Float_t)1. / (Float_t)5.;
5891  Float_t coefcc_y = (Float_t)1. / (Float_t)5.;
5892 
5893  for (Int_t DeeNumber = 1; DeeNumber <= 4; DeeNumber++) {
5894  EEDataSectors(coefcc_x, coefcc_y, DeeNumber, "EE");
5895  EEGridAxis(DeeNumber, "EE", " ");
5896  }
5897 
5898  // vertical line between the two endcaps
5899  Double_t xline = (Double_t)coefcc_x * ((Double_t)2. * fEcal->MaxCrysIXInDee() +
5900  ((Double_t)vertic_empty_strips) / (Double_t)2. * fEcal->MaxCrysIXInSC());
5901 
5902  Double_t yline_bot = (Double_t)coefcc_y * (Double_t)0.;
5903  Double_t yline_top = (Double_t)coefcc_y * (Double_t)fEcal->MaxCrysIYInDee();
5904 
5905  TLine* lin;
5906  lin = new TLine(xline, yline_bot, xline, yline_top);
5907  fCnewRoot++;
5908  lin->Draw();
5909 
5910  // vertical line in the midles of the two endcaps
5911  // xline = xline + coefcc_x*( fEcal->MaxCrysIXInDee()+ 0.5*fEcal->MaxCrysIXInSC() );
5912  xline = (Double_t)coefcc_x *
5913  (3 * fEcal->MaxCrysIXInDee() + ((Double_t)vertic_empty_strips - 1.) * fEcal->MaxCrysIXInSC());
5914  TLine* lin12;
5915  lin12 = new TLine(xline, yline_bot, xline, yline_top);
5916  fCnewRoot++;
5917  lin12->SetLineStyle(2);
5918  lin12->Draw();
5919 
5920  xline =
5921  (Double_t)coefcc_x * (fEcal->MaxCrysIXInDee() + ((Double_t)vertic_empty_strips) / 3. * fEcal->MaxCrysIXInSC());
5922  TLine* lin34;
5923  lin34 = new TLine(xline, yline_bot, xline, yline_top);
5924  fCnewRoot++;
5925  lin34->SetLineStyle(2);
5926  lin34->Draw();
5927 
5928  // horizontal line at IY = 50
5929  Double_t xline_end =
5930  (Double_t)coefcc_x * (4 * fEcal->MaxCrysIXInDee() + vertic_empty_strips * fEcal->MaxCrysIXInSC());
5931  Double_t yline_mid = (Double_t)coefcc_x * fEcal->MaxCrysIYInDee() / 2;
5932 
5933  TLine* linh;
5934  linh = new TLine(0., yline_mid, xline_end, yline_mid);
5935  fCnewRoot++;
5936  linh->SetLineStyle(2);
5937  linh->Draw();
5938 
5939 } // end of ViewEEGrid
5940 
5941 //==================================================================================================
5942 void TEcnaHistos::EEDataSectors(const Float_t& coefcc_x,
5943  const Float_t& coefcc_y,
5944  const Int_t& DeeNumber,
5945  const TString& opt_plot) {
5946  //Surlignage des bords du Dee et des Data Sectors. Numeros des secteurs.
5947 
5948  // Epaisseur du trait selon option
5949  Int_t LineWidth = 2; // DEFAULT => option "EE"
5950  if (opt_plot == "Dee") {
5951  LineWidth = 3;
5952  }
5953 
5954  Int_t ngmax = 0;
5955  // surlignage du bord interne du Dee (unite de coordonnees: le cristal)
5956  ngmax = 13;
5957  Float_t xg_dee_int_bot[13] = {0, 5, 5, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11};
5958  Float_t yg_dee_int_bot[13] = {39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 45, 45, 50};
5959 
5960  for (Int_t i = 0; i < ngmax; i++) {
5961  xg_dee_int_bot[i] = coefcc_x * xg_dee_int_bot[i];
5962  yg_dee_int_bot[i] = coefcc_y * yg_dee_int_bot[i];
5963  }
5964 
5965  Float_t XgDeeIntBotRight[13];
5966  Float_t YgDeeIntBotRight[13];
5967  Float_t XgDeeIntTopRight[13];
5968  Float_t YgDeeIntTopRight[13];
5969 
5970  for (Int_t i = 0; i < ngmax; i++) {
5971  XgDeeIntBotRight[i] = xg_dee_int_bot[i];
5972  YgDeeIntBotRight[i] = yg_dee_int_bot[i];
5973  XgDeeIntTopRight[i] = XgDeeIntBotRight[i];
5974  YgDeeIntTopRight[i] = coefcc_y * fEcal->MaxCrysIYInDee() - YgDeeIntBotRight[i];
5975  if (DeeNumber == 2 || DeeNumber == 4) {
5976  XgDeeIntBotRight[i] = -XgDeeIntBotRight[i] + coefcc_x * fEcal->MaxCrysIXInDee();
5977  XgDeeIntTopRight[i] = -XgDeeIntTopRight[i] + coefcc_x * fEcal->MaxCrysIXInDee();
5978  }
5979  XgDeeIntBotRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5980  XgDeeIntTopRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5981  }
5982 
5983  TGraph* BDeeIntBotRight = new TGraph(ngmax, XgDeeIntBotRight, YgDeeIntBotRight);
5984  BDeeIntBotRight->SetLineWidth(LineWidth);
5985  BDeeIntBotRight->DrawGraph(ngmax, XgDeeIntBotRight, YgDeeIntBotRight);
5986 
5987  TGraph* BDeeIntTopRight = new TGraph(ngmax, XgDeeIntTopRight, YgDeeIntTopRight);
5988  BDeeIntTopRight->SetLineWidth(LineWidth);
5989  BDeeIntTopRight->DrawGraph(ngmax, XgDeeIntTopRight, YgDeeIntTopRight);
5990 
5991  // surlignage du bord externe du Dee (unite de coordonnees: le cristal)
5992  ngmax = 21;
5993  Float_t xg_dee_ext_bot[21] = {0, 10, 10, 15, 15, 25, 25, 30, 30, 35, 35, 37, 37, 42, 42, 45, 45, 47, 47, 50, 50};
5994  Float_t yg_dee_ext_bot[21] = {0, 0, 3, 3, 5, 5, 8, 8, 13, 13, 15, 15, 20, 20, 25, 25, 35, 35, 40, 40, 50};
5995  for (Int_t i = 0; i < ngmax; i++) {
5996  xg_dee_ext_bot[i] = coefcc_x * xg_dee_ext_bot[i];
5997  yg_dee_ext_bot[i] = coefcc_y * yg_dee_ext_bot[i];
5998  }
5999 
6000  Float_t XgDeeExtBotRight[21];
6001  Float_t YgDeeExtBotRight[21];
6002  Float_t XgDeeExtTopRight[21];
6003  Float_t YgDeeExtTopRight[21];
6004 
6005  for (Int_t i = 0; i < ngmax; i++) {
6006  XgDeeExtBotRight[i] = xg_dee_ext_bot[i];
6007  YgDeeExtBotRight[i] = yg_dee_ext_bot[i];
6008  XgDeeExtTopRight[i] = XgDeeExtBotRight[i];
6009  YgDeeExtTopRight[i] = coefcc_y * fEcal->MaxCrysIYInDee() - YgDeeExtBotRight[i];
6010  if (DeeNumber == 2 || DeeNumber == 4) {
6011  XgDeeExtBotRight[i] = -XgDeeExtBotRight[i] + coefcc_x * fEcal->MaxCrysIXInDee();
6012  XgDeeExtTopRight[i] = -XgDeeExtTopRight[i] + coefcc_x * fEcal->MaxCrysIXInDee();
6013  }
6014  XgDeeExtBotRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
6015  XgDeeExtTopRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
6016  }
6017 
6018  TGraph* BDeeExtBotRight = new TGraph(ngmax, XgDeeExtBotRight, YgDeeExtBotRight);
6019  BDeeExtBotRight->SetLineWidth(LineWidth);
6020  BDeeExtBotRight->DrawGraph(ngmax, XgDeeExtBotRight, YgDeeExtBotRight);
6021 
6022  TGraph* BDeeExtTopRight = new TGraph(ngmax, XgDeeExtTopRight, YgDeeExtTopRight);
6023  BDeeExtTopRight->SetLineWidth(LineWidth);
6024  BDeeExtTopRight->DrawGraph(ngmax, XgDeeExtTopRight, YgDeeExtTopRight);
6025 
6026  char f_in[charArrLen];
6027 
6028  //............. Surlignage separateurs des secteurs en phi (Data sectors)
6029 
6030  //================== S9 -> S1 (EE-) option "EE" seulement
6031  if (opt_plot == "EE") {
6032  ngmax = 2;
6033  Float_t xg_dee_data_sec9[2] = {0, 0};
6034  Float_t yg_dee_data_sec9[2] = {61, 100};
6035  for (Int_t i = 0; i < ngmax; i++) {
6036  xg_dee_data_sec9[i] = coefcc_x * xg_dee_data_sec9[i];
6037  yg_dee_data_sec9[i] = coefcc_y * yg_dee_data_sec9[i];
6038  }
6039 
6040  Float_t XgDeeDataSec9[11];
6041  Float_t YgDeeDataSec9[11];
6042  for (Int_t i = 0; i < ngmax; i++) {
6043  XgDeeDataSec9[i] = xg_dee_data_sec9[i];
6044  YgDeeDataSec9[i] = yg_dee_data_sec9[i];
6045  if (DeeNumber == 2 || DeeNumber == 4) {
6046  XgDeeDataSec9[i] = -XgDeeDataSec9[i] + coefcc_x * fEcal->MaxCrysIXInDee();
6047  }
6048  XgDeeDataSec9[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
6049  }
6050  TGraph* BDeeDataSec9 = new TGraph(ngmax, XgDeeDataSec9, YgDeeDataSec9);
6051  BDeeDataSec9->SetLineWidth(LineWidth);
6052  BDeeDataSec9->DrawGraph(ngmax, XgDeeDataSec9, YgDeeDataSec9);
6053  }
6054 
6055  //================= S1->S2(EE-)
6056  ngmax = 11;
6057  Float_t xg_dee_data_sec1[11] = {7, 10, 10, 15, 15, 20, 20, 25, 25, 30, 30};
6058  Float_t yg_dee_data_sec1[11] = {60, 60, 65, 65, 70, 70, 75, 75, 85, 85, 87};
6059  for (Int_t i = 0; i < ngmax; i++) {
6060  xg_dee_data_sec1[i] = coefcc_x * xg_dee_data_sec1[i];
6061  yg_dee_data_sec1[i] = coefcc_y * yg_dee_data_sec1[i];
6062  }
6063 
6064  Float_t XgDeeDataSec1[11];
6065  Float_t YgDeeDataSec1[11];
6066  for (Int_t i = 0; i < ngmax; i++) {
6067  XgDeeDataSec1[i] = xg_dee_data_sec1[i];
6068  YgDeeDataSec1[i] = yg_dee_data_sec1[i];
6069  if (DeeNumber == 2 || DeeNumber == 4) {
6070  XgDeeDataSec1[i] = -XgDeeDataSec1[i] + coefcc_x * fEcal->MaxCrysIXInDee();
6071  }
6072  XgDeeDataSec1[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
6073  }
6074 
6075  TGraph* BDeeDataSec1 = new TGraph(ngmax, XgDeeDataSec1, YgDeeDataSec1);
6076  BDeeDataSec1->SetLineWidth(LineWidth);
6077  BDeeDataSec1->DrawGraph(ngmax, XgDeeDataSec1, YgDeeDataSec1);
6078 
6079  //================= S2->S3(EE-)
6080  ngmax = 6;
6081  Float_t xg_dee_data_sec2[6] = {11, 15, 15, 40, 40, 47};
6082  Float_t yg_dee_data_sec2[6] = {50, 50, 55, 55, 60, 60};
6083  for (Int_t i = 0; i < ngmax; i++) {
6084  xg_dee_data_sec2[i] = coefcc_x * xg_dee_data_sec2[i];
6085  yg_dee_data_sec2[i] = coefcc_y * yg_dee_data_sec2[i];
6086  }
6087 
6088  Float_t XgDeeDataSec2[6];
6089  Float_t YgDeeDataSec2[6];
6090  for (Int_t i = 0; i < ngmax; i++) {
6091  XgDeeDataSec2[i] = xg_dee_data_sec2[i];
6092  YgDeeDataSec2[i] = yg_dee_data_sec2[i];
6093  if (DeeNumber == 2 || DeeNumber == 4) {
6094  XgDeeDataSec2[i] = -XgDeeDataSec2[i] + coefcc_x * fEcal->MaxCrysIXInDee();
6095  }
6096  XgDeeDataSec2[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
6097  }
6098  TGraph* BDeeDataSec2 = new TGraph(ngmax, XgDeeDataSec2, YgDeeDataSec2);
6099  BDeeDataSec2->SetLineWidth(LineWidth);
6100  BDeeDataSec2->DrawGraph(ngmax, XgDeeDataSec2, YgDeeDataSec2);
6101 
6102  //================= S3->S4(EE-)
6103  ngmax = 10;
6104  Float_t xg_dee_data_sec3[10] = {10, 15, 15, 20, 20, 30, 30, 40, 40, 42};
6105  Float_t yg_dee_data_sec3[10] = {45, 45, 40, 40, 35, 35, 30, 30, 25, 25};
6106  for (Int_t i = 0; i < ngmax; i++) {
6107  xg_dee_data_sec3[i] = coefcc_x * xg_dee_data_sec3[i];
6108  yg_dee_data_sec3[i] = coefcc_y * yg_dee_data_sec3[i];
6109  }
6110 
6111  Float_t XgDeeDataSec3[10];
6112  Float_t YgDeeDataSec3[10];
6113  for (Int_t i = 0; i < ngmax; i++) {
6114  XgDeeDataSec3[i] = xg_dee_data_sec3[i];
6115  YgDeeDataSec3[i] = yg_dee_data_sec3[i];
6116  if (DeeNumber == 2 || DeeNumber == 4) {
6117  XgDeeDataSec3[i] = -XgDeeDataSec3[i] + coefcc_x * fEcal->MaxCrysIXInDee();
6118  }
6119  XgDeeDataSec3[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
6120  }
6121  TGraph* BDeeDataSec3 = new TGraph(ngmax, XgDeeDataSec3, YgDeeDataSec3);
6122  BDeeDataSec3->SetLineWidth(LineWidth);
6123  BDeeDataSec3->DrawGraph(ngmax, XgDeeDataSec3, YgDeeDataSec3);
6124 
6125  //================= S4->S5(EE-)
6126  ngmax = 6;
6127  Float_t xg_dee_data_sec4[6] = {5, 5, 10, 10, 15, 15};
6128  Float_t yg_dee_data_sec4[6] = {40, 30, 30, 15, 15, 5};
6129  for (Int_t i = 0; i < ngmax; i++) {
6130  xg_dee_data_sec4[i] = coefcc_x * xg_dee_data_sec4[i];
6131  yg_dee_data_sec4[i] = coefcc_y * yg_dee_data_sec4[i];
6132  }
6133 
6134  Float_t XgDeeDataSec4[6];
6135  Float_t YgDeeDataSec4[6];
6136  for (Int_t i = 0; i < ngmax; i++) {
6137  XgDeeDataSec4[i] = xg_dee_data_sec4[i];
6138  YgDeeDataSec4[i] = yg_dee_data_sec4[i];
6139  if (DeeNumber == 2 || DeeNumber == 4) {
6140  XgDeeDataSec4[i] = -XgDeeDataSec4[i] + coefcc_x * fEcal->MaxCrysIXInDee();
6141  }
6142  XgDeeDataSec4[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
6143  }
6144  TGraph* BDeeDataSec4 = new TGraph(ngmax, XgDeeDataSec4, YgDeeDataSec4);
6145  BDeeDataSec4->SetLineWidth(LineWidth);
6146  BDeeDataSec4->DrawGraph(ngmax, XgDeeDataSec4, YgDeeDataSec4);
6147 
6148  //..................................... Numeros des secteurs S_i (option "Dee" seulement)
6149  if (opt_plot == "Dee" || opt_plot == "EE") {
6150  //............. Coordonnees des numeros de secteurs
6151  ngmax = 5;
6152  Float_t xg_coord_sector[5] = {16, 41, 45, 33, -2};
6153  Float_t yg_coord_sector[5] = {96, 83, 30, 5, -8};
6154 
6155  //....... Reprise secteurs 3 et 7
6156  if (opt_plot == "Dee" && (DeeNumber == 1)) {
6157  xg_coord_sector[2] += 0.5;
6158  }
6159  if (opt_plot == "Dee" && (DeeNumber == 2)) {
6160  xg_coord_sector[2] -= 1.;
6161  }
6162  if (opt_plot == "Dee" && (DeeNumber == 3)) {
6163  xg_coord_sector[2] += 0.7;
6164  }
6165  if (opt_plot == "Dee" && (DeeNumber == 4)) {
6166  xg_coord_sector[2] -= 1.2;
6167  }
6168 
6169  if (opt_plot == "EE" && (DeeNumber == 2 || DeeNumber == 3)) {
6170  xg_coord_sector[2] += 0.55;
6171  }
6172  if (opt_plot == "EE" && (DeeNumber == 4)) {
6173  xg_coord_sector[2] -= 0.2;
6174  }
6175 
6176  for (Int_t i = 0; i < ngmax; i++) {
6177  xg_coord_sector[i] = coefcc_x * xg_coord_sector[i];
6178  yg_coord_sector[i] = coefcc_y * yg_coord_sector[i];
6179  }
6180 
6181  Float_t xg_sector[9];
6182  Float_t yg_sector[9];
6183  Int_t ns1 = 1;
6184  Int_t ns2 = 5;
6185  Float_t xinv_d2d4 = coefcc_x * 44;
6186 
6187  if (DeeNumber == 1) {
6188  ns1 = 1;
6189  ns2 = 5;
6190  xg_sector[1 - ns1] = xg_coord_sector[1 - ns1];
6191  yg_sector[1 - ns1] = yg_coord_sector[1 - ns1];
6192  xg_sector[2 - ns1] = xg_coord_sector[2 - ns1];
6193  yg_sector[2 - ns1] = yg_coord_sector[2 - ns1];
6194  xg_sector[3 - ns1] = xg_coord_sector[3 - ns1];
6195  yg_sector[3 - ns1] = yg_coord_sector[3 - ns1];
6196  xg_sector[4 - ns1] = xg_coord_sector[4 - ns1];
6197  yg_sector[4 - ns1] = yg_coord_sector[4 - ns1];
6198  xg_sector[5 - ns1] = xg_coord_sector[5 - ns1];
6199  yg_sector[5 - ns1] = yg_coord_sector[5 - ns1];
6200  }
6201 
6202  if (DeeNumber == 2) {
6203  ns1 = 5;
6204  ns2 = 9;
6205  xg_sector[ns2 - 1] = xinv_d2d4 - xg_coord_sector[1 - 1];
6206  yg_sector[ns2 - 1] = yg_coord_sector[1 - 1];
6207  xg_sector[ns2 - 2] = xinv_d2d4 - xg_coord_sector[2 - 1];
6208  yg_sector[ns2 - 2] = yg_coord_sector[2 - 1];
6209  xg_sector[ns2 - 3] = xinv_d2d4 - xg_coord_sector[3 - 1];
6210  yg_sector[ns2 - 3] = yg_coord_sector[3 - 1];
6211  xg_sector[ns2 - 4] = xinv_d2d4 - xg_coord_sector[4 - 1];
6212  yg_sector[ns2 - 4] = yg_coord_sector[4 - 1];
6213  xg_sector[ns2 - 5] = xinv_d2d4 - xg_coord_sector[5 - 1];
6214  yg_sector[ns2 - 5] = yg_coord_sector[5 - 1];
6215  }
6216  if (DeeNumber == 3) {
6217  ns1 = 5;
6218  ns2 = 9;
6219  xg_sector[ns2 - 1] = xg_coord_sector[1 - 1];
6220  yg_sector[ns2 - 1] = yg_coord_sector[1 - 1];
6221  xg_sector[ns2 - 2] = xg_coord_sector[2 - 1];
6222  yg_sector[ns2 - 2] = yg_coord_sector[2 - 1];
6223  xg_sector[ns2 - 3] = xg_coord_sector[3 - 1];
6224  yg_sector[ns2 - 3] = yg_coord_sector[3 - 1];
6225  xg_sector[ns2 - 4] = xg_coord_sector[4 - 1];
6226  yg_sector[ns2 - 4] = yg_coord_sector[4 - 1];
6227  xg_sector[ns2 - 5] = xg_coord_sector[5 - 1];
6228  yg_sector[ns2 - 5] = yg_coord_sector[5 - 1];
6229  }
6230  if (DeeNumber == 4) {
6231  ns1 = 1;
6232  ns2 = 5;
6233  xg_sector[1 - ns1] = xinv_d2d4 - xg_coord_sector[1 - ns1];
6234  yg_sector[1 - ns1] = yg_coord_sector[1 - ns1];
6235  xg_sector[2 - ns1] = xinv_d2d4 - xg_coord_sector[2 - ns1];
6236  yg_sector[2 - ns1] = yg_coord_sector[2 - ns1];
6237  xg_sector[3 - ns1] = xinv_d2d4 - xg_coord_sector[3 - ns1];
6238  yg_sector[3 - ns1] = yg_coord_sector[3 - ns1];
6239  xg_sector[4 - ns1] = xinv_d2d4 - xg_coord_sector[4 - ns1];
6240  yg_sector[4 - ns1] = yg_coord_sector[4 - ns1];
6241  xg_sector[5 - ns1] = xinv_d2d4 - xg_coord_sector[5 - ns1];
6242  yg_sector[5 - ns1] = yg_coord_sector[5 - ns1];
6243  }
6244 
6245  Color_t coul_textsector = fCnaParHistos->ColorDefinition("vert37");
6246  for (Int_t ns = ns1; ns <= ns2; ns++) {
6247  xg_sector[ns - 1] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
6248  if (DeeNumber == 1 || DeeNumber == 2) {
6249  sprintf(f_in, "+%d", ns);
6250  }
6251  if (DeeNumber == 3 || DeeNumber == 4) {
6252  sprintf(f_in, "-%d", ns);
6253  }
6254  TText* text_num_module = new TText(xg_sector[ns - 1], yg_sector[ns - 1], f_in);
6255  fCnewRoot++;
6256  if (opt_plot == "Dee") {
6257  text_num_module->SetTextSize(0.065);
6258  }
6259  if (opt_plot == "EE") {
6260  text_num_module->SetTextSize(0.045);
6261  }
6262  text_num_module->SetTextColor(coul_textsector);
6263  if (opt_plot == "Dee" || (opt_plot == "EE" && !((DeeNumber == 3 && ns == 5) || (DeeNumber == 1 && ns == 5)))) {
6264  text_num_module->Draw();
6265  }
6266 
6267  // text_num_module->Delete(); text_num_module = 0; fCdeleteRoot++;
6268  }
6269 
6270  //............................ numeros des dee's
6271  ngmax = 4;
6272  Float_t xg_coord_dee[4] = {0, 0, 0, 0};
6273  Float_t yg_coord_dee[4] = {48, 48, 48, 48};
6274 
6275  xg_coord_dee[DeeNumber - 1] = coefcc_x * xg_coord_dee[DeeNumber - 1];
6276  yg_coord_dee[DeeNumber - 1] = coefcc_y * yg_coord_dee[DeeNumber - 1];
6277 
6278  Float_t xg_dee = xg_coord_dee[DeeNumber - 1];
6279  Float_t yg_dee = yg_coord_dee[DeeNumber - 1];
6280 
6281  Color_t coul_textdee = fCnaParHistos->ColorDefinition("noir");
6282 
6283  xg_dee += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber) + fCnaParHistos->DeeNumberOffsetX(opt_plot, DeeNumber);
6284 
6285  if (DeeNumber == 1) {
6286  sprintf(f_in, "D1");
6287  }
6288  if (DeeNumber == 2) {
6289  sprintf(f_in, "D2");
6290  }
6291  if (DeeNumber == 3) {
6292  sprintf(f_in, "D3");
6293  }
6294  if (DeeNumber == 4) {
6295  sprintf(f_in, "D4");
6296  }
6297 
6298  TText* text_num_module = new TText(xg_dee, yg_dee, f_in);
6299  fCnewRoot++;
6300  if (opt_plot == "EE") {
6301  text_num_module->SetTextSize(0.045);
6302  }
6303  if (opt_plot == "Dee") {
6304  text_num_module->SetTextSize(0.085);
6305  }
6306  text_num_module->SetTextColor(coul_textdee);
6307  text_num_module->Draw();
6308  }
6309 
6310  //..................................... Numeros des Dee et indication EE+- (option "EE" seulement)
6311  if (opt_plot == "EE") {
6312  //............................ indication EE+-
6313  ngmax = 4;
6314  Float_t xg_coord_eepm[4] = {0, 0, 0, 0};
6315  Float_t yg_coord_eepm[4] = {95, 95, 95, 95};
6316 
6317  xg_coord_eepm[DeeNumber - 1] = coefcc_x * xg_coord_eepm[DeeNumber - 1];
6318  yg_coord_eepm[DeeNumber - 1] = coefcc_y * yg_coord_eepm[DeeNumber - 1];
6319 
6320  Float_t xg_eepm = xg_coord_eepm[DeeNumber - 1];
6321  Float_t yg_eepm = yg_coord_eepm[DeeNumber - 1];
6322 
6323  Color_t coul_texteepm = fCnaParHistos->ColorDefinition("noir");
6324 
6325  xg_eepm += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber) + fCnaParHistos->DeeNameOffsetX(DeeNumber);
6326 
6327  if (DeeNumber == 1) {
6328  sprintf(f_in, "EE+F");
6329  }
6330  if (DeeNumber == 2) {
6331  sprintf(f_in, "EE+N");
6332  }
6333  if (DeeNumber == 3) {
6334  sprintf(f_in, "EE-N");
6335  }
6336  if (DeeNumber == 4) {
6337  sprintf(f_in, "EE-F");
6338  }
6339 
6340  TText* text_num_eepm = new TText(xg_eepm, yg_eepm, f_in);
6341  fCnewRoot++;
6342  text_num_eepm->SetTextSize(0.04);
6343  text_num_eepm->SetTextColor(coul_texteepm);
6344  text_num_eepm->Draw();
6345  }
6346 
6347  //......................... mention "viewed from IP"
6348  Color_t coul_textfromIP = fCnaParHistos->ColorDefinition("rouge49");
6349  sprintf(f_in, "viewed from IP");
6350  Float_t x_from_ip = 15.;
6351  Float_t y_from_ip = -10.;
6352  if (opt_plot == "EE") {
6353  y_from_ip = -16.;
6354  }
6355  x_from_ip = coefcc_x * x_from_ip;
6356  y_from_ip = coefcc_x * y_from_ip;
6357  if (opt_plot == "EE" && DeeNumber == 3) {
6358  x_from_ip += 1.4 * fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
6359  }
6360  TText* text_from_ip = new TText(x_from_ip, y_from_ip, f_in);
6361  fCnewRoot++;
6362  text_from_ip->SetTextSize(0.045);
6363  if (opt_plot == "EE") {
6364  text_from_ip->SetTextSize(0.035);
6365  }
6366  text_from_ip->SetTextColor(coul_textfromIP);
6367  if (opt_plot == "Dee" || (opt_plot == "EE" && DeeNumber == 3)) {
6368  text_from_ip->Draw();
6369  }
6370 
6371 } // ------ end of EEDataSectors() ------
6372 
6373 //==========================================================================================
6374 
6375 void TEcnaHistos::EEGridAxis(const Int_t& DeeNumber, const TString& opt_plot, const TString& c_option) {
6376  //------------------ trace axes en IX et IY --------------- EEGridAxis
6377  //=============================================================================== Axe IX
6378  Int_t size_IX_dee = fEcal->MaxSCIXInDee();
6379 
6380  Double_t IX_min = fEcalNumbering->GetIIXMin(1) - 0.5; // IX_min = 0.5 pour les 4 dee's
6381  Double_t IX_max = fEcalNumbering->GetIIXMax() * fEcal->MaxCrysIXInSC() + 0.5; // IX_max = 50.5 pour les 4 dee's
6382 
6383  Int_t MatSize = 1;
6384  if (opt_plot == "Dee" && c_option == "corcc") {
6385  MatSize = fEcal->MaxCrysInSC();
6386  IX_min = fEcalNumbering->GetIIXMin() - 0.5;
6387  IX_max = fEcalNumbering->GetIIXMax() + 0.5;
6388  }
6389  if (opt_plot == "EE" && c_option == "corcc") {
6390  return;
6391  } // => a voir...
6392 
6393  if (opt_plot == "Dee" && c_option != "corcc") {
6394  MatSize = fEcal->MaxCrysIXInSC();
6395  }
6396  if (opt_plot == "EE" && c_option != "corcc") {
6397  MatSize = 1;
6398  }
6399 
6400  TString x_var_name = " ";
6401 
6402  Float_t axis_x_inf = 0;
6403  Float_t axis_x_sup = 0;
6404  Float_t axis_y_inf = 0;
6405  Float_t axis_y_sup = 0;
6406  Int_t axis_nb_div = 205; // DEFAULT: option "EE"
6407  Double_t IX_values_min = 0;
6408  Double_t IX_values_max = 0;
6409  Option_t* chopt = "C";
6410 
6411  //........................................................................EEGridAxis
6412  if (DeeNumber == 1) // xmin -> xmax <=> right->left
6413  {
6414  //.....axis min->max/left->right: first draw axis with -ticksize and no label
6415  axis_x_inf = size_IX_dee * MatSize;
6416  axis_x_sup = 0;
6417  axis_y_inf = 0;
6418  axis_y_sup = 0;
6419  IX_values_min = -IX_max; // -50.5 right
6420  IX_values_max = -IX_min; // - 0.5 left
6421  if (opt_plot == "Dee") {
6422  x_var_name = GetIXIYAxisTitle("iIXDee1");
6423  }
6424  if (opt_plot == "EE") {
6425  x_var_name = GetIXIYAxisTitle("iIXEE");
6426  }
6427  if (opt_plot == "Dee") {
6428  axis_nb_div = size_IX_dee;
6429  }
6430  chopt = "-CSU";
6431  }
6432  if (DeeNumber == 2) // xmin -> xmax <=> right->left
6433  {
6434  //.....axis min->max/left->right: first draw axis with -ticksize and no label
6435  axis_x_inf = size_IX_dee * MatSize;
6436  axis_x_sup = 0;
6437  axis_y_inf = 0;
6438  axis_y_sup = 0;
6439  IX_values_min = IX_min; // + 0.5 right
6440  IX_values_max = IX_max; // +50.5 left
6441  if (opt_plot == "Dee") {
6442  x_var_name = GetIXIYAxisTitle("iIXDee2");
6443  }
6444  if (opt_plot == "EE") {
6445  x_var_name = " ";
6446  }
6447  if (opt_plot == "Dee") {
6448  axis_nb_div = size_IX_dee;
6449  }
6450  chopt = "-CSU";
6451  }
6452  if (DeeNumber == 3) // xmin -> xmax <=> left->right
6453  {
6454  axis_x_inf = 0;
6455  axis_x_sup = size_IX_dee * MatSize;
6456  axis_y_inf = 0;
6457  axis_y_sup = 0;
6458  IX_values_min = IX_min; // + 0.5 left
6459  IX_values_max = IX_max; // +50.5 right
6460  if (opt_plot == "Dee") {
6461  x_var_name = GetIXIYAxisTitle("iIXDee3");
6462  }
6463  if (opt_plot == "EE") {
6464  x_var_name = " ";
6465  }
6466  if (opt_plot == "Dee") {
6467  axis_nb_div = size_IX_dee;
6468  }
6469  chopt = "CS";
6470  }
6471  if (DeeNumber == 4) // xmin -> xmax <=> left->right
6472  {
6473  axis_x_inf = 0;
6474  axis_x_sup = size_IX_dee * MatSize;
6475  axis_y_inf = 0;
6476  axis_y_sup = 0;
6477  IX_values_min = -IX_max; // -50.5 left
6478  IX_values_max = -IX_min; // - 0.5 right
6479  if (opt_plot == "Dee") {
6480  x_var_name = GetIXIYAxisTitle("iIXDee4");
6481  }
6482  if (opt_plot == "EE") {
6483  x_var_name = " ";
6484  }
6485  if (opt_plot == "Dee") {
6486  axis_nb_div = size_IX_dee;
6487  }
6488  chopt = "CS";
6489  }
6490 
6491  //.................................................................... EEGridAxis
6492  axis_x_inf += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
6493  axis_x_sup += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
6494 
6495  TGaxis* sup_axis_x = nullptr;
6496  sup_axis_x =
6497  new TGaxis(axis_x_inf, axis_y_inf, axis_x_sup, axis_y_sup, IX_values_min, IX_values_max, axis_nb_div, chopt, 0.);
6498  fCnewRoot++;
6499 
6500  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
6501  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize();
6502 
6503  Float_t tic_siz_x = fCnaParHistos->AxisTickSize("Deex");
6504  if (opt_plot == "EE") {
6505  tic_siz_x = fCnaParHistos->AxisTickSize("EEx");
6506  }
6507 
6508  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("Deex");
6509  if (opt_plot == "EE") {
6510  tit_off_x = fCnaParHistos->AxisTitleOffset("EEx");
6511  }
6512 
6513  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("Deex");
6514  if (opt_plot == "EE") {
6515  lab_off_x = fCnaParHistos->AxisLabelOffset("EEx");
6516  }
6517 
6518  sup_axis_x->SetTitle(x_var_name);
6519  sup_axis_x->SetTitleSize(tit_siz_x);
6520  sup_axis_x->SetTitleOffset(tit_off_x);
6521  sup_axis_x->SetLabelSize(lab_siz_x);
6522  sup_axis_x->SetLabelOffset(lab_off_x);
6523  sup_axis_x->SetTickSize(tic_siz_x);
6524  sup_axis_x->Draw("SAME");
6525 
6526  //.....axis min->max/right->left: redraw axis with ticksize = 0 and with -labelOffset
6527  if (DeeNumber == 1 || DeeNumber == 2) {
6528  chopt = "CS";
6529  TGaxis* sup_axis_x_bis = nullptr;
6530  sup_axis_x_bis = new TGaxis(
6531  axis_x_inf, axis_y_inf, axis_x_sup, axis_y_sup, IX_values_min, IX_values_max, axis_nb_div, chopt, 0.);
6532  fCnewRoot++;
6533  sup_axis_x_bis->SetTickSize(0.);
6534  lab_siz_x = sup_axis_x->GetLabelSize();
6535  sup_axis_x_bis->SetLabelSize(lab_siz_x);
6536  lab_off_x = sup_axis_x->GetLabelOffset();
6537  sup_axis_x_bis->SetLabelOffset(-lab_off_x);
6538  sup_axis_x_bis->Draw("SAME");
6539  }
6540 
6541  //================================================================== Axe IY EEGridAxis
6542 
6543  if (opt_plot == "Dee" || (opt_plot == "EE" && DeeNumber == 4)) {
6544  Int_t size_IY_dee = fEcal->MaxSCIYInDee();
6545  Int_t size_IY_axis = size_IY_dee;
6546 
6547  if (opt_plot == "Dee") {
6548  axis_nb_div = size_IY_axis;
6549  }
6550  if (opt_plot == "EE") {
6551  axis_nb_div = 210;
6552  }
6553 
6554  Double_t jIY_min = fEcalNumbering->GetJIYMin(DeeNumber, 1) - 0.5;
6555  Double_t jIY_max = fEcalNumbering->GetJIYMax(DeeNumber) * fEcal->MaxCrysIYInSC() + 0.5;
6556 
6557  TString jy_var_name = " ";
6558  TString jy_direction = "x";
6559 
6560  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
6561  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
6562 
6563  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("Deey");
6564  if (opt_plot == "EE") {
6565  tic_siz_y = fCnaParHistos->AxisTickSize("EEy");
6566  }
6567 
6568  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("Deey");
6569  if (opt_plot == "EE") {
6570  tit_off_y = fCnaParHistos->AxisTitleOffset("EEy");
6571  }
6572 
6573  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("Deey");
6574  if (opt_plot == "EE") {
6575  lab_off_y = fCnaParHistos->AxisLabelOffset("EEy");
6576  }
6577 
6578  TGaxis* axis_jy_plus = nullptr;
6579  axis_jy_plus = new TGaxis((Float_t)0.,
6580  (Float_t)0.,
6581  (Float_t)0.,
6582  (Float_t)(size_IY_axis * MatSize),
6583  jIY_min,
6584  jIY_max,
6585  axis_nb_div,
6586  "SC",
6587  0.);
6588  fCnewRoot++;
6589 
6590  jy_var_name = GetIXIYAxisTitle("jIYDee");
6591  axis_jy_plus->SetTitle(jy_var_name);
6592  axis_jy_plus->SetTitleSize(tit_siz_y);
6593  axis_jy_plus->SetTitleOffset(tit_off_y);
6594  axis_jy_plus->SetLabelSize(lab_siz_y);
6595  axis_jy_plus->SetLabelOffset(lab_off_y);
6596  axis_jy_plus->SetTickSize(tic_siz_y);
6597  axis_jy_plus->Draw("SAME");
6598  }
6599 
6600 //---------------------------------- 2 axes (0,50) et (0,-50)
6601 #define IYAX
6602 #ifndef IYAX
6603  if (opt_plot == "Dee" || (opt_plot == "EE" && DeeNumber == 4)) {
6604  Int_t size_IY_dee = fEcal->MaxSCIYInDee();
6605  Int_t size_IY_axis = size_IY_dee / 2;
6606 
6607  if (opt_plot == "Dee") {
6608  axis_nb_div = (Int_t)size_IY_axis;
6609  }
6610  if (opt_plot == "EE") {
6611  axis_nb_div = 5;
6612  }
6613 
6614  Double_t jIY_min = fEcalNumbering->GetJIYMin(DeeNumber, 1) - 0.5;
6615  Double_t jIY_max = (fEcalNumbering->GetJIYMax(DeeNumber) / 2) * fEcal->MaxCrysIYInSC() + 0.5;
6616 
6617  TString jy_var_name = " ";
6618  TString jy_direction = "x";
6619 
6620  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
6621  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
6622 
6623  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("Deey");
6624  if (opt_plot == "EE") {
6625  tic_siz_y = fCnaParHistos->AxisTickSize("EEy");
6626  }
6627 
6628  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("Deey");
6629  if (opt_plot == "EE") {
6630  tit_off_y = fCnaParHistos->AxisTitleOffset("EEy");
6631  }
6632 
6633  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("Deey");
6634  if (opt_plot == "EE") {
6635  lab_off_y = fCnaParHistos->AxisLabelOffset("EEy");
6636  }
6637 
6638  TGaxis* axis_jy_plus = 0;
6639  axis_jy_plus = new TGaxis((Float_t)0.,
6640  (Float_t)(size_IY_dee * MatSize / 2),
6641  (Float_t)0.,
6642  (Float_t)(2 * size_IY_dee * MatSize / 2),
6643  jIY_min,
6644  jIY_max,
6645  axis_nb_div,
6646  "SC",
6647  0.);
6648  fCnewRoot++;
6649 
6650  jy_var_name = GetIXIYAxisTitle("jIYDee");
6651  axis_jy_plus->SetTitle(jy_var_name);
6652  axis_jy_plus->SetTitleSize(tit_siz_y);
6653  axis_jy_plus->SetTitleOffset(tit_off_y);
6654  axis_jy_plus->SetLabelSize(lab_siz_y);
6655  axis_jy_plus->SetLabelOffset(lab_off_y);
6656  axis_jy_plus->SetTickSize(tic_siz_y);
6657  axis_jy_plus->Draw("SAME");
6658 
6659  TGaxis* axis_jy_minus = 0;
6660  axis_jy_minus = new TGaxis((Float_t)0.,
6661  (Float_t)(size_IY_dee * MatSize / 2),
6662  (Float_t)0.,
6663  (Float_t)0.,
6664  -jIY_min,
6665  -jIY_max,
6666  axis_nb_div,
6667  "-SC",
6668  0.);
6669  fCnewRoot++;
6670 
6671  jy_var_name = GetIXIYAxisTitle("jIYDee");
6672  axis_jy_minus->SetTitle(jy_var_name);
6673  axis_jy_minus->SetTitleSize(tit_siz_y);
6674  axis_jy_minus->SetTitleOffset(tit_off_y);
6675  axis_jy_minus->SetLabelSize(lab_siz_y);
6676  axis_jy_minus->SetLabelOffset(lab_off_y);
6677  axis_jy_minus->SetTickSize(tic_siz_y);
6678  axis_jy_minus->Draw("SAME");
6679  }
6680 #endif // IYAX
6681 
6682 } // ------------- end of EEGridAxis(...) --------------
6683 
6684 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6685 //
6686 // ViewHisto(***)
6687 //
6688 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6689 //======================== D_MSp_SpNb
6690 void TEcnaHistos::XtalSamplesEv(const TVectorD& arg_read_histo,
6691  const Int_t& arg_AlreadyRead,
6692  const Int_t& n1StexStin,
6693  const Int_t& i0StinEcha) {
6694  XtalSamplesEv(arg_read_histo, arg_AlreadyRead, n1StexStin, i0StinEcha, "ONLYONE");
6695 }
6696 void TEcnaHistos::XtalSamplesEv(const TVectorD& arg_read_histo,
6697  const Int_t& arg_AlreadyRead,
6698  const Int_t& n1StexStin,
6699  const Int_t& i0StinEcha,
6700  const TString& PlotOption) {
6701  if (fFapStexNumber > 0) {
6702  if (PlotOption == fAllXtalsInStinPlot) {
6703  Int_t StexStin_A = n1StexStin;
6704  if (fFlagSubDet == "EE") {
6705  StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);
6706  }
6707 
6708  Bool_t aOKData = kFALSE;
6709  TVectorD read_histo(fEcal->MaxCrysInStin() * fEcal->MaxSampADC());
6710 
6711  if (arg_AlreadyRead == fTobeRead) {
6715  fFapRunNumber,
6720  fCfgResultsRootFilePath.Data());
6721 
6722  if (fMyRootFile->LookAtRootFile() == kTRUE) {
6723  fStatusFileFound = kTRUE;
6724  read_histo = fMyRootFile->ReadSampleMeans(StexStin_A, fEcal->MaxCrysInStin() * fEcal->MaxSampADC());
6725  if (fMyRootFile->DataExist() == kTRUE) {
6726  fStatusDataExist = kTRUE;
6727  }
6728  } else {
6729  fStatusFileFound = kFALSE;
6730  std::cout << "!TEcnaHistos::XtalSamplesEv(...)> Data not available (ROOT file not found)." << std::endl;
6731  }
6732  if (fStatusFileFound == kTRUE && fStatusDataExist == kTRUE) {
6733  aOKData = kTRUE;
6734  }
6735  }
6736  if (arg_AlreadyRead >= 1) {
6737  for (Int_t i = 0; i < fEcal->MaxCrysInStin() * fEcal->MaxSampADC(); i++) {
6738  read_histo[i] = arg_read_histo[i];
6739  }
6740  fStatusDataExist = kTRUE;
6741  aOKData = kTRUE;
6742  }
6743 
6744  if (aOKData == kTRUE) {
6745  TVectorD read_histo_samps(fFapNbOfSamples);
6746 
6747  Int_t xAlreadyRead = 1;
6748  for (Int_t i0_stin_echa = 0; i0_stin_echa < fEcal->MaxCrysInStin(); i0_stin_echa++) {
6749  if (fFapStexName == "SM") {
6750  std::cout << "*TEcnaHistos::XtalSamplesEv(...)> channel " << std::setw(2) << i0_stin_echa << ": ";
6751  }
6752  if (fFapStexName == "Dee") {
6753  std::cout << "*TEcnaHistos::XtalSamplesEv(...)> Xtal " << std::setw(2) << i0_stin_echa + 1 << ": ";
6754  }
6755 
6756  for (Int_t i0_samp = 0; i0_samp < fFapNbOfSamples; i0_samp++) {
6757  read_histo_samps(i0_samp) = read_histo(i0_stin_echa * fFapNbOfSamples + i0_samp);
6758  std::cout << std::setprecision(4) << std::setw(8) << read_histo_samps(i0_samp) << ", ";
6759  }
6760  std::cout << std::endl;
6761  ViewHisto(read_histo_samps, xAlreadyRead, StexStin_A, i0_stin_echa, fZerv, "D_MSp_SpNb", fAllXtalsInStinPlot);
6762  xAlreadyRead++;
6763  }
6764  xAlreadyRead = 0;
6765  } else {
6766  std::cout << "!TEcnaHistos::XtalSamplesEv(...)> Data not available." << std::endl;
6767  }
6768  }
6769 
6770  if (!(PlotOption == fAllXtalsInStinPlot)) {
6771  Int_t StexStin_A = n1StexStin;
6772  if (fFlagSubDet == "EE") {
6773  StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);
6774  }
6775  ViewHisto(fReadHistoDummy, fTobeRead, StexStin_A, i0StinEcha, fZerv, "D_MSp_SpNb", PlotOption);
6776  }
6777  } else {
6778  std::cout << "!TEcnaHistos::XtalSamplesEv(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6779  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << std::endl;
6780  }
6781 }
6782 
6783 //======================== D_MSp_SpDs
6784 void TEcnaHistos::EvSamplesXtals(const TVectorD& arg_read_histo,
6785  const Int_t& arg_AlreadyRead,
6786  const Int_t& n1StexStin,
6787  const Int_t& i0StinEcha) {
6788  EvSamplesXtals(arg_read_histo, arg_AlreadyRead, n1StexStin, i0StinEcha, "ONLYONE");
6789 }
6790 void TEcnaHistos::EvSamplesXtals(const TVectorD& arg_read_histo,
6791  const Int_t& arg_AlreadyRead,
6792  const Int_t& n1StexStin,
6793  const Int_t& i0StinEcha,
6794  const TString& PlotOption) {
6795  if (fFapStexNumber > 0) {
6796  if (PlotOption == fAllXtalsInStinPlot) {
6797  Int_t StexStin_A = n1StexStin;
6798  if (fFlagSubDet == "EE") {
6799  StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);
6800  }
6801 
6802  Bool_t aOKData = kFALSE;
6803  TVectorD read_histo(fEcal->MaxCrysInStin() * fEcal->MaxSampADC());
6804 
6805  if (arg_AlreadyRead == fTobeRead) {
6809  fFapRunNumber,
6814  fCfgResultsRootFilePath.Data());
6815 
6816  if (fMyRootFile->LookAtRootFile() == kTRUE) {
6817  fStatusFileFound = kTRUE;
6818  read_histo = fMyRootFile->ReadSampleMeans(StexStin_A, fEcal->MaxCrysInStin() * fEcal->MaxSampADC());
6819  if (fMyRootFile->DataExist() == kTRUE) {
6820  fStatusDataExist = kTRUE;
6821  }
6822  } else {
6823  fStatusFileFound = kFALSE;
6824  std::cout << "!TEcnaHistos::EvSamplesXtals(...)> Data not available (ROOT file not found)." << std::endl;
6825  }
6826  if (fStatusFileFound == kTRUE && fStatusDataExist == kTRUE) {
6827  aOKData = kTRUE;
6828  }
6829  }
6830  if (arg_AlreadyRead >= 1) {
6831  for (Int_t i = 0; i < fEcal->MaxCrysInStin() * fEcal->MaxSampADC(); i++) {
6832  read_histo[i] = arg_read_histo[i];
6833  }
6834  fStatusDataExist = kTRUE;
6835  aOKData = kTRUE;
6836  }
6837  if (aOKData == kTRUE) {
6838  TVectorD read_histo_samps(fFapNbOfSamples);
6839 
6840  Int_t xAlreadyRead = 1;
6841  for (Int_t i0_stin_echa = 0; i0_stin_echa < fEcal->MaxCrysInStin(); i0_stin_echa++) {
6842  if (fFapStexName == "SM") {
6843  std::cout << "*TEcnaHistos::EvSamplesXtals(...)> channel " << std::setw(2) << i0_stin_echa << ": ";
6844  }
6845  if (fFapStexName == "Dee") {
6846  std::cout << "*TEcnaHistos::EvSamplesXtals(...)> Xtal " << std::setw(2) << i0_stin_echa + 1 << ": ";
6847  }
6848 
6849  for (Int_t i0_samp = 0; i0_samp < fFapNbOfSamples; i0_samp++) {
6850  read_histo_samps(i0_samp) = read_histo(i0_stin_echa * fFapNbOfSamples + i0_samp);
6851  std::cout << std::setprecision(4) << std::setw(8) << read_histo_samps(i0_samp) << ", ";
6852  }
6853  std::cout << std::endl;
6854  ViewHisto(read_histo_samps, xAlreadyRead, StexStin_A, i0_stin_echa, fZerv, "D_MSp_SpDs", fAllXtalsInStinPlot);
6855  xAlreadyRead++;
6856  }
6857  xAlreadyRead = 0;
6858  } else {
6859  std::cout << "!TEcnaHistos::EvSamplesXtals(...)> Data not available." << std::endl;
6860  }
6861  }
6862 
6863  if (!(PlotOption == fAllXtalsInStinPlot)) {
6864  Int_t StexStin_A = n1StexStin;
6865  if (fFlagSubDet == "EE") {
6866  StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);
6867  }
6868  ViewHisto(fReadHistoDummy, fTobeRead, StexStin_A, i0StinEcha, fZerv, "D_MSp_SpDs", PlotOption);
6869  }
6870  } else {
6871  std::cout << "!TEcnaHistos::EvSamplesXtals(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6872  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << std::endl;
6873  }
6874 } // end of EvSamplesXtals(...)
6875 
6876 //======================== D_SSp_SpNb
6877 void TEcnaHistos::XtalSamplesSigma(const TVectorD& arg_read_histo,
6878  const Int_t& arg_AlreadyRead,
6879  const Int_t& n1StexStin,
6880  const Int_t& i0StinEcha) {
6881  XtalSamplesSigma(arg_read_histo, arg_AlreadyRead, n1StexStin, i0StinEcha, "ONLYONE");
6882 }
6883 void TEcnaHistos::XtalSamplesSigma(const TVectorD& arg_read_histo,
6884  const Int_t& arg_AlreadyRead,
6885  const Int_t& n1StexStin,
6886  const Int_t& i0StinEcha,
6887  const TString& PlotOption) {
6888  if (fFapStexNumber > 0) {
6889  if (PlotOption == fAllXtalsInStinPlot) {
6890  Int_t StexStin_A = n1StexStin;
6891  if (fFlagSubDet == "EE") {
6892  StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);
6893  }
6894 
6895  Bool_t aOKData = kFALSE;
6896  TVectorD read_histo(fEcal->MaxCrysInStin() * fEcal->MaxSampADC());
6897 
6898  if (arg_AlreadyRead == fTobeRead) {
6902  fFapRunNumber,
6907  fCfgResultsRootFilePath.Data());
6908 
6909  if (fMyRootFile->LookAtRootFile() == kTRUE) {
6910  fStatusFileFound = kTRUE;
6911  read_histo = fMyRootFile->ReadSampleSigmas(StexStin_A, fEcal->MaxCrysInStin() * fEcal->MaxSampADC());
6912  if (fMyRootFile->DataExist() == kTRUE) {
6913  fStatusDataExist = kTRUE;
6914  }
6915  } else {
6916  fStatusFileFound = kFALSE;
6917  std::cout << "!TEcnaHistos::XtalSamplesSigma(...)> Data not available (ROOT file not found)." << std::endl;
6918  }
6919  if (fStatusFileFound == kTRUE && fStatusDataExist == kTRUE) {
6920  aOKData = kTRUE;
6921  }
6922  }
6923  if (arg_AlreadyRead >= 1) {
6924  for (Int_t i = 0; i < fEcal->MaxCrysInStin() * fEcal->MaxSampADC(); i++) {
6925  read_histo[i] = arg_read_histo[i];
6926  }
6927  fStatusDataExist = kTRUE;
6928  aOKData = kTRUE;
6929  }
6930  if (aOKData == kTRUE) {
6931  TVectorD read_histo_samps(fFapNbOfSamples);
6932 
6933  Int_t xAlreadyRead = 1;
6934  for (Int_t i0_stin_echa = 0; i0_stin_echa < fEcal->MaxCrysInStin(); i0_stin_echa++) {
6935  if (fFapStexName == "SM") {
6936  std::cout << "*TEcnaHistos::XtalSamplesSigma(...)> channel " << std::setw(2) << i0_stin_echa << ": ";
6937  }
6938  if (fFapStexName == "Dee") {
6939  std::cout << "*TEcnaHistos::XtalSamplesSigma(...)> Xtal " << std::setw(2) << i0_stin_echa + 1 << ": ";
6940  }
6941 
6942  for (Int_t i0_samp = 0; i0_samp < fFapNbOfSamples; i0_samp++) {
6943  read_histo_samps(i0_samp) = read_histo(i0_stin_echa * fFapNbOfSamples + i0_samp);
6944  std::cout << std::setprecision(3) << std::setw(6) << read_histo_samps(i0_samp) << ", ";
6945  }
6946  std::cout << std::endl;
6947  ViewHisto(read_histo_samps, xAlreadyRead, StexStin_A, i0StinEcha, fZerv, "D_SSp_SpNb", fAllXtalsInStinPlot);
6948  xAlreadyRead++;
6949  }
6950  xAlreadyRead = 0;
6951  } else {
6952  std::cout << "!TEcnaHistos::XtalSamplesSigma(...)> Data not available." << std::endl;
6953  }
6954  }
6955 
6956  if (!(PlotOption == fAllXtalsInStinPlot)) {
6957  Int_t StexStin_A = n1StexStin;
6958  if (fFlagSubDet == "EE") {
6959  StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);
6960  }
6961  ViewHisto(fReadHistoDummy, fTobeRead, StexStin_A, i0StinEcha, fZerv, "D_SSp_SpNb", PlotOption);
6962  }
6963  } else {
6964  std::cout << "!TEcnaHistos::XtalSamplesSigma(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6965  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << std::endl;
6966  }
6967 }
6968 
6969 //======================== D_SSp_SpDs
6970 void TEcnaHistos::SigmaSamplesXtals(const TVectorD& arg_read_histo,
6971  const Int_t& arg_AlreadyRead,
6972  const Int_t& n1StexStin,
6973  const Int_t& i0StinEcha) {
6974  SigmaSamplesXtals(arg_read_histo, arg_AlreadyRead, n1StexStin, i0StinEcha, "ONLYONE");
6975 }
6976 void TEcnaHistos::SigmaSamplesXtals(const TVectorD& arg_read_histo,
6977  const Int_t& arg_AlreadyRead,
6978  const Int_t& n1StexStin,
6979  const Int_t& i0StinEcha,
6980  const TString& PlotOption) {
6981  if (fFapStexNumber > 0) {
6982  if (PlotOption == fAllXtalsInStinPlot) {
6983  Int_t StexStin_A = n1StexStin;
6984  if (fFlagSubDet == "EE") {
6985  StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);
6986  }
6987 
6988  Bool_t aOKData = kFALSE;
6989  TVectorD read_histo(fEcal->MaxCrysInStin() * fEcal->MaxSampADC());
6990 
6991  if (arg_AlreadyRead == fTobeRead) {
6995  fFapRunNumber,
7000  fCfgResultsRootFilePath.Data());
7001  if (fMyRootFile->LookAtRootFile() == kTRUE) {
7002  fStatusFileFound = kTRUE;
7003  read_histo = fMyRootFile->ReadSampleSigmas(StexStin_A, fEcal->MaxCrysInStin() * fEcal->MaxSampADC());
7004  if (fMyRootFile->DataExist() == kTRUE) {
7005  fStatusDataExist = kTRUE;
7006  }
7007  } else {
7008  fStatusFileFound = kFALSE;
7009  std::cout << "!TEcnaHistos::SigmaSamplesXtals(...)> Data not available (ROOT file not found)." << std::endl;
7010  }
7011  if (fStatusFileFound == kTRUE && fStatusDataExist == kTRUE) {
7012  aOKData = kTRUE;
7013  }
7014  }
7015 
7016  if (arg_AlreadyRead >= 1) {
7017  for (Int_t i = 0; i < fEcal->MaxCrysInStin() * fEcal->MaxSampADC(); i++) {
7018  read_histo[i] = arg_read_histo[i];
7019  }
7020  fStatusDataExist = kTRUE;
7021  aOKData = kTRUE;
7022  }
7023  if (aOKData == kTRUE) {
7024  TVectorD read_histo_samps(fFapNbOfSamples);
7025 
7026  Int_t xAlreadyRead = 1;
7027  for (Int_t i0_stin_echa = 0; i0_stin_echa < fEcal->MaxCrysInStin(); i0_stin_echa++) {
7028  if (fFapStexName == "SM") {
7029  std::cout << "*TEcnaHistos::SigmaSamplesXtals(...)> channel " << std::setw(2) << i0_stin_echa << ": ";
7030  }
7031  if (fFapStexName == "Dee") {
7032  std::cout << "*TEcnaHistos::SigmaSamplesXtals(...)> Xtal " << std::setw(2) << i0_stin_echa + 1 << ": ";
7033  }
7034 
7035  for (Int_t i0_samp = 0; i0_samp < fFapNbOfSamples; i0_samp++) {
7036  read_histo_samps(i0_samp) = read_histo(i0_stin_echa * fFapNbOfSamples + i0_samp);
7037  std::cout << std::setprecision(3) << std::setw(6) << read_histo_samps(i0_samp) << ", ";
7038  }
7039  std::cout << std::endl;
7040  ViewHisto(read_histo_samps, xAlreadyRead, StexStin_A, i0StinEcha, fZerv, "D_SSp_SpDs", fAllXtalsInStinPlot);
7041  xAlreadyRead++;
7042  }
7043  xAlreadyRead = 0;
7044  } else {
7045  std::cout << "!TEcnaHistos::SigmaSamplesXtals(...)> Data not available." << std::endl;
7046  }
7047  }
7048 
7049  if (!(PlotOption == fAllXtalsInStinPlot)) {
7050  Int_t StexStin_A = n1StexStin;
7051  if (fFlagSubDet == "EE") {
7052  StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);
7053  }
7054  ViewHisto(fReadHistoDummy, fTobeRead, StexStin_A, i0StinEcha, fZerv, "D_SSp_SpDs", PlotOption);
7055  }
7056  } else {
7057  std::cout << "!TEcnaHistos::SigmaSamplesXtals(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
7058  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << std::endl;
7059  }
7060 } // end of SigmaSamplesXtals(...)
7061 
7062 //==========================================================================================
7063 //
7064 // ViewHisto
7065 //
7066 // arg_read_histo = array containing the values
7067 // arg_AlreadyRead = histo flag: =1 => arg_read_histo exists,
7068 // =0 => values will be read by internal
7069 // call to TEcnaRead inside ViewHisto
7070 // StexStin_A = [1,68] or [1,150] ==> tower# if EB, SC# if EE
7071 // i0StinEcha = [0,24] = Electronic channel# in tower (if EB) or SC (if EE)
7072 // i0Sample = [0,9] = sample#
7073 // HistoCode = String for histo type (pedestal, total noise, mean cor(s,s), ...)
7074 // opt_plot_arg = String for plot option (SAME or not SAME)
7075 //
7076 //===========================================================================================
7077 void TEcnaHistos::ViewHisto(const TVectorD& arg_read_histo,
7078  const Int_t& arg_AlreadyRead,
7079  const Int_t& StexStin_A,
7080  const Int_t& i0StinEcha,
7081  const Int_t& i0Sample,
7082  const TString& HistoCode,
7083  const TString& opt_plot_arg) {
7084  //Histogram of the quantities (one run)
7085 
7086  TString opt_plot = opt_plot_arg;
7087  fPlotAllXtalsInStin = 0;
7088 
7089  if (opt_plot_arg == fAllXtalsInStinPlot) {
7090  opt_plot = fOnlyOnePlot;
7091  fPlotAllXtalsInStin = 1;
7092  }
7093 
7094  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
7095 
7096  Int_t OKHisto = 0;
7097 
7098  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Canvas already closed in option SAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7099  Int_t xCanvasExists = 1; // a priori ==> Canvas exists // (ViewHisto)
7100  if (opt_plot != fOnlyOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy") {
7101  TVirtualPad* main_subpad = nullptr;
7102  //---------------- Call to ActivePad
7103  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
7104  if (main_subpad == nullptr) {
7105  std::cout << "*TEcnaHistos::ViewHisto(...)> WARNING ===> Canvas has been closed in option SAME or SAME n."
7106  << std::endl
7107  << " Please, restart with a new canvas." << fTTBELL << std::endl;
7108 
7109  ReInitCanvas(HistoCode, opt_plot);
7110  xCanvasExists = 0;
7111  }
7112  }
7113  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7114 
7115  //%%%%%%%%%%%%%%%%%%%%%%%% Change of X variable in option SAME n with no proj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7116  Int_t SameXVarMemo = 1; // a priori ==> SAME n option: X variable OK (ViewHisto)
7117  if (!(HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj") && !(arg_AlreadyRead >= 1)) {
7118  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
7119  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
7120  if ((opt_plot == fSameOnePlot) && GetMemoFlag(HistoCode, opt_plot) == "Free") {
7121  SetXVarMemo(HistoCode, opt_plot, XVarHisto);
7122  SetYVarMemo(HistoCode, opt_plot, YVarHisto);
7123  SameXVarMemo = 1;
7124  }
7125  if ((opt_plot == fSameOnePlot) && GetMemoFlag(HistoCode, opt_plot) == "Busy") {
7126  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
7127  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
7128 
7129  if (XVarHisto != XVariableMemo) {
7130  std::cout << "!TEcnaHistos::ViewHisto(...)> *** ERROR *** ===> X coordinate changed in option SAME n."
7131  << std::endl
7132  << " Present X = " << XVarHisto << std::endl
7133  << " Present Y = " << YVarHisto << std::endl
7134  << " Previous X = " << XVariableMemo << std::endl
7135  << " Previous Y = " << YVariableMemo << fTTBELL << std::endl;
7136  SameXVarMemo = 0;
7137  } else {
7138  SetYVarMemo(HistoCode, opt_plot, YVarHisto);
7139  }
7140  }
7141  }
7142  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7143 
7144  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Change of Y variable in option SAME n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7145  Int_t SameYVarMemo = 1; // a priori ==> SAME n option: Y variable OK (ViewHisto)
7146  if ((HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj") && !(arg_AlreadyRead >= 1)) {
7147  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
7148  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
7149  if ((opt_plot == fSameOnePlot) && GetMemoFlag(HistoCode, opt_plot) == "Free") {
7150  SetYVarMemo(HistoCode, opt_plot, YVarHisto);
7151  SetYVarMemo(HistoCode, opt_plot, YVarHisto);
7152  SameYVarMemo = 1;
7153  }
7154  if ((opt_plot == fSameOnePlot) && GetMemoFlag(HistoCode, opt_plot) == "Busy") {
7155  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
7156  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
7157 
7158  if (YVarHisto != YVariableMemo) {
7159  std::cout << "!TEcnaHistos::ViewHisto(...)> *** ERROR *** ===> Y coordinate changed in option SAME n."
7160  << std::endl
7161  << " Present X = " << XVarHisto << std::endl
7162  << " Present Y = " << YVarHisto << std::endl
7163  << " Previous X = " << XVariableMemo << std::endl
7164  << " Previous Y = " << YVariableMemo << fTTBELL << std::endl;
7165  SameYVarMemo = 0;
7166  } else {
7167  SetYVarMemo(HistoCode, opt_plot, YVarHisto);
7168  }
7169  }
7170  }
7171  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7172 
7173  //%%%%%%%%%%%%%%%%%%%%%%%%%%% Number of bins change in option SAME or SAME n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7174  Int_t OkBinsMemoSameOne = 1; // a priori ==> SAME n option: Nb bins OK (ViewHisto)
7175 
7176  Int_t SizeForPlot = GetHistoSize(HistoCode.Data(), "plot");
7177  Int_t xNbBins = GetHistoNumberOfBins(HistoCode.Data(), SizeForPlot);
7178 
7179  if ((opt_plot == fSameOnePlot || opt_plot == fSeveralPlot) && GetMemoFlag(HistoCode, opt_plot) == "Free") {
7180  SetNbBinsMemo(HistoCode, opt_plot, xNbBins);
7181  OkBinsMemoSameOne = 1;
7182  }
7183 
7184  if ((opt_plot == fSameOnePlot || opt_plot == fSeveralPlot) && GetMemoFlag(HistoCode, opt_plot) == "Busy") {
7185  Int_t NbBinsMemo = GetNbBinsFromMemo(HistoCode, opt_plot);
7186  if (xNbBins != NbBinsMemo) {
7187  std::cout << "!TEcnaHistos::ViewHisto(...)> *** ERROR *** ===> Number of bins changed in option SAME or SAME n."
7188  << " Present number = " << xNbBins << ", requested number = " << NbBinsMemo << fTTBELL << std::endl;
7189  OkBinsMemoSameOne = 0;
7190  }
7191  }
7192 
7193  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7194 
7195  if (xCanvasExists == 1 && SameXVarMemo == 1 && SameYVarMemo == 1 && OkBinsMemoSameOne == 1) {
7196  OKHisto = 1;
7197  }
7198 
7199  //======================== Histo accepted (ViewHisto)
7200  if (OKHisto == 1) {
7201  Int_t opt_scale_x = fOptScaleLinx;
7202  if (fFlagScaleX == "LIN") {
7203  opt_scale_x = fOptScaleLinx;
7204  }
7205  if (fFlagScaleX == "LOG") {
7206  opt_scale_x = fOptScaleLogx;
7207  }
7208 
7209  Int_t opt_scale_y = fOptScaleLiny;
7210  if (fFlagScaleY == "LIN") {
7211  opt_scale_y = fOptScaleLiny;
7212  }
7213  if (fFlagScaleY == "LOG") {
7214  opt_scale_y = fOptScaleLogy;
7215  }
7216 
7218  TString fp_name_short = " ";
7219 
7220  //-------------------- read_histo size
7221  Int_t SizeForRead = GetHistoSize(HistoCode.Data(), "read");
7222 
7223  //............................................... allocation/init_histo
7224  TVectorD histo_for_plot(SizeForPlot);
7225  for (Int_t i = 0; i < SizeForPlot; i++) {
7226  histo_for_plot[i] = (Double_t)0;
7227  }
7228 
7229  TVectorD histo_for_plot_memo(SizeForPlot);
7230  for (Int_t i = 0; i < SizeForPlot; i++) {
7231  histo_for_plot_memo[i] = (Double_t)0;
7232  }
7233 
7234  Int_t i_data_exist = 0;
7235  Int_t OKPlot = 0;
7236 
7237  //------------------------------------- histos Global, (Global)Proj, SampGlobal and SampProj
7238  if (HistoType == "Global" || HistoType == "Proj" || HistoType == "SampGlobal" || HistoType == "SampProj") {
7239  if (fFapStexNumber == 0) {
7240  Bool_t ok_view_histo = kFALSE;
7241 
7242  //--------------------------------------------------------------------- Stas Histo (ViewHisto)
7243  Int_t CounterExistingFile = 0;
7244  Int_t CounterDataExist = 0;
7245 
7246  Int_t* xFapNbOfEvts = new Int_t[fEcal->MaxStexInStas()];
7247  fCnew++;
7248  for (Int_t i = 0; i < fEcal->MaxStexInStas(); i++) {
7249  xFapNbOfEvts[i] = 0;
7250  }
7251 
7252  //Int_t* NOFE_int = new Int_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
7253 
7254  for (Int_t iStasStex = 0; iStasStex < fEcal->MaxStexInStas(); iStasStex++) {
7255  Bool_t OKFileExists = kFALSE;
7256  Bool_t ok_data_exists = kFALSE;
7257 
7258  TVectorD read_histo(fEcal->MaxStinEcnaInStex());
7259  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
7260  read_histo(i) = (Double_t)0.;
7261  }
7262 
7263  if (arg_AlreadyRead == 0) {
7264  //----------------------------------------------------------------------------- file reading
7266  Int_t n1StasStex = iStasStex + 1;
7269  fFapRunNumber,
7273  n1StasStex,
7274  fCfgResultsRootFilePath.Data());
7275 
7276  if (fMyRootFile->LookAtRootFile() == kTRUE) {
7277  OKFileExists = kTRUE;
7278  } // (ViewHisto, Stas)
7279  if (OKFileExists == kTRUE) {
7280  xFapNbOfEvts[iStasStex] = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, n1StasStex);
7281  fp_name_short = fMyRootFile->GetRootFileNameShort();
7282  // std::cout << "*TEcnaHistos::ViewHisto(...)> Data are analyzed from file ----> "
7283  // << fp_name_short << std::endl;
7284  //....................... search for first and last dates
7285  if (iStasStex == 0) {
7290  }
7291 
7292  time_t xStartTime = fMyRootFile->GetStartTime();
7293  time_t xStopTime = fMyRootFile->GetStopTime();
7294  TString xStartDate = fMyRootFile->GetStartDate();
7295  TString xStopDate = fMyRootFile->GetStopDate();
7296 
7297  if (xStartTime < fStartTime) {
7298  fStartTime = xStartTime;
7299  fStartDate = xStartDate;
7300  }
7301  if (xStopTime > fStopTime) {
7302  fStopTime = xStopTime;
7303  fStopDate = xStopDate;
7304  }
7305 
7307  ok_view_histo = GetOkViewHisto(fMyRootFile, StexStin_A, i0StinEcha, i0Sample, HistoCode.Data());
7308 
7309  if (ok_view_histo == kTRUE) {
7310  //............................................... histo reading (ViewHisto, Stas)
7311  if (HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs") {
7313  }
7314  if (HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs") {
7316  }
7317  if (HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs") {
7319  }
7320  if (HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs") {
7322  }
7323  if (HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs") {
7325  }
7326  if (HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs") {
7328  }
7329  if (HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs") {
7331  }
7332  if (fMyRootFile->DataExist() == kTRUE) {
7333  ok_data_exists = kTRUE;
7334  }
7335  }
7336  }
7337  }
7338 
7339  if (arg_AlreadyRead >= 1) {
7340  ok_data_exists = kTRUE;
7341  for (Int_t i0Stin = 0; i0Stin < fEcal->MaxStinEcnaInStex(); i0Stin++) {
7342  read_histo(i0Stin) = arg_read_histo(fEcal->MaxStinEcnaInStex() * iStasStex + i0Stin);
7343  }
7344  }
7345 
7346  if (ok_data_exists == kTRUE) {
7347  fStatusFileFound = kTRUE;
7348  CounterExistingFile++;
7349 
7350  //...........................................................
7351  if (ok_data_exists == kTRUE) {
7352  fStatusDataExist = kTRUE;
7353  CounterDataExist++;
7354 
7355  for (Int_t i0StexStinEcna = 0; i0StexStinEcna < fEcal->MaxStinEcnaInStex(); i0StexStinEcna++) {
7356  //Int_t n1StexStinEcna = i0StexStinEcna+1;
7357  //-------------------------------------- Stas histo filling (ViewHisto, Stas)
7358  Int_t i_xgeo = -1;
7359  //...................................... EB
7360  if (fFlagSubDet == "EB") {
7361  i_xgeo = iStasStex * fEcal->MaxStinEcnaInStex() + i0StexStinEcna;
7362  if (i_xgeo >= 0 && i_xgeo < SizeForPlot) {
7363  histo_for_plot[i_xgeo] = read_histo[i0StexStinEcna];
7364  } else {
7365  std::cout << "!TEcnaHistos::ViewHisto(...)> <EB> i_xgeo = " << i_xgeo
7366  << ". OUT OF RANGE ( range = [0," << SizeForPlot << "] " << std::endl;
7367  }
7368  }
7369  //...................................... EE (ViewHisto)
7370  //-------> Dee order: D4, D3, D2, D1
7371  if (fFlagSubDet == "EE") {
7372  Int_t DeeOffset = 0;
7373  Int_t DSOffset = 0;
7374 
7375  Int_t DeeNumber = iStasStex + 1;
7376  Int_t n1DeeSCEcna = i0StexStinEcna + 1;
7377 
7378  //................................................ Dee offset
7379  if (DeeNumber == 3) {
7380  DeeOffset += fEcal->MaxSCForConsInDee();
7381  } // 149
7382  if (DeeNumber == 2) {
7383  DeeOffset += 3 * fEcal->MaxSCForConsInDee() - 1;
7384  } // 446
7385  if (DeeNumber == 1) {
7386  DeeOffset += 4 * fEcal->MaxSCForConsInDee() - 1;
7387  } // 595
7388 
7389  //................................................ Data Sector offset (ViewHisto, Stas)
7390  Int_t StexDataSector = fEcalNumbering->GetDSFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
7391  //.... returns 0 if n1DeeSCEcna corresponds to an empty "ECNA-SC"
7392 
7393  //................................................ SC final coordinate (ViewHisto, Stas)
7394  Int_t StexDSStin = fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
7395  //--> return StexDSStin = 25 (not 3) for n1DeeSCEcna = 32
7396  //--> return StexDSStin = 14 (not 21) for n1DeeSCEcna = 29
7397  //--> return StexDSStin = -1 for n1DeeSCEcna = 10 and n1DeeSCEcna = 11
7398 
7399  if (StexDataSector >= 1 && StexDataSector <= 9) {
7400  if (DeeNumber == 4) // Sectors 1,2,3,4,5a
7401  {
7402  for (Int_t is = 2; is <= 5; is++) {
7403  if (StexDataSector >= is) {
7404  Int_t ism = is - 1;
7405  DSOffset += fEcalNumbering->GetMaxSCInDS(ism);
7406  }
7407  }
7408  }
7409 
7410  if (DeeNumber == 3) // Sectors 5b,6,7,8,9
7411  {
7412  if (StexDataSector >= 6) {
7413  DSOffset += fEcalNumbering->GetMaxSCInDS(5) / 2;
7414  }
7415  for (Int_t is = 7; is <= 9; is++) {
7416  if (StexDataSector >= is) {
7417  Int_t ism = is - 1;
7418  DSOffset += fEcalNumbering->GetMaxSCInDS(ism);
7419  }
7420  }
7421  }
7422 
7423  if (DeeNumber == 2) // Sectors 9,8,7,6,5a
7424  {
7425  if (StexDataSector >= 6) {
7426  DSOffset -= fEcalNumbering->GetMaxSCInDS(5) / 2;
7427  }
7428  for (Int_t is = 7; is <= 9; is++) {
7429  if (StexDataSector >= is) {
7430  Int_t ism = is - 1;
7431  DSOffset -= fEcalNumbering->GetMaxSCInDS(ism);
7432  }
7433  }
7434  }
7435 
7436  if (DeeNumber == 1) // Sectors 5b,4,3,2,1
7437  {
7438  for (Int_t is = 2; is <= 5; is++) {
7439  if (StexDataSector >= is) {
7440  Int_t ism = is - 1;
7441  DSOffset -= fEcalNumbering->GetMaxSCInDS(ism);
7442  }
7443  }
7444  }
7445 
7446  if (StexDSStin >= 1 && StexDSStin <= fEcalNumbering->GetMaxSCInDS(StexDataSector)) {
7447  if (DeeNumber == 4) // Sectors 1,2,3,4,5a
7448  {
7449  if (StexDataSector != 5) {
7450  i_xgeo = DeeOffset + DSOffset + (StexDSStin - 1);
7451  }
7452  if (StexDataSector == 5) {
7453  i_xgeo = DeeOffset + DSOffset + (StexDSStin - 1);
7454  }
7455  }
7456  if (DeeNumber == 3) // Sectors 5b,6,7,8,9
7457  {
7458  if (StexDataSector != 5) {
7459  i_xgeo = DeeOffset + DSOffset + (StexDSStin - 1);
7460  }
7461  if (StexDataSector == 5) {
7462  i_xgeo = DeeOffset + DSOffset + (StexDSStin - 17) - 1;
7463  }
7464  }
7465  if (DeeNumber == 2) // Sectors 5a,6,7,8,9
7466  {
7467  if (StexDataSector != 5) {
7468  i_xgeo = DeeOffset + DSOffset - fEcalNumbering->GetMaxSCInDS(StexDataSector) + StexDSStin;
7469  }
7470  if (StexDataSector == 5) {
7471  i_xgeo = DeeOffset + DSOffset - fEcalNumbering->GetMaxSCInDS(StexDataSector) / 2 + StexDSStin;
7472  }
7473  }
7474  if (DeeNumber == 1) // Sectors 1,2,3,4,5b
7475  {
7476  if (StexDataSector != 5) {
7477  i_xgeo = DeeOffset + DSOffset - fEcalNumbering->GetMaxSCInDS(StexDataSector) + StexDSStin;
7478  }
7479  if (StexDataSector == 5) {
7480  i_xgeo = DeeOffset + DSOffset - fEcalNumbering->GetMaxSCInDS(StexDataSector) / 2 +
7481  (StexDSStin - 17);
7482  }
7483  }
7484 
7485  } // end of if(StexDSStin >=1 && StexDSStin <= fEcalNumbering->GetMaxSCInDS(StexDataSector))
7486  else {
7487  std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> StexDSStin = " << StexDSStin
7488  << ". OUT OF RANGE ( range = [1," << fEcalNumbering->GetMaxSCInDS(StexDataSector)
7489  << "]. DeeNumber = " << DeeNumber << ", n1DeeSCEcna = " << n1DeeSCEcna
7490  << ", StexDataSector = " << StexDataSector << ", i_xgeo = " << i_xgeo << std::endl;
7491  }
7492  } // end of if( StexDataSector >= 1 && StexDataSector <= 9 )
7493  else {
7494  //std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> StexDataSector = " << StexDataSector
7495  // << ". OUT OF RANGE ( range = [1,9]. DeeNumber = " << DeeNumber
7496  // << ", n1DeeSCEcna = " << n1DeeSCEcna
7497  // << ", i_xgeo = " << i_xgeo << std::endl;
7498  }
7499  //......................................... transfert read_histo -> histo_for_plot
7500  if (i_xgeo >= -1 && i_xgeo < SizeForPlot) {
7501  // special treatement for not connected & mixed SC's
7502  if (n1DeeSCEcna == 29 || n1DeeSCEcna == 32 || // 261a, 207c, 268a, 178c
7503  // [ 14a, 25c, 21a, 3c]
7504  n1DeeSCEcna == 144 || n1DeeSCEcna == 165 || // 261c, 261b [14c, 14b]
7505  n1DeeSCEcna == 176 || n1DeeSCEcna == 193 || // 207a, 207b [25a, 25b]
7506  n1DeeSCEcna == 60 || n1DeeSCEcna == 119 || // 182a, 182b [30a, 30b]
7507  n1DeeSCEcna == 102 || n1DeeSCEcna == 123 || // 268c, 268b [21c, 21b]
7508  n1DeeSCEcna == 138 || n1DeeSCEcna == 157) // 178a, 178b [ 3a, 3b]
7509  {
7510  //--------------- DSSC 14
7511  if (n1DeeSCEcna == 29 && i_xgeo >= 0) {
7512  histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna] / (Double_t)5.;
7513  }
7514  if ((n1DeeSCEcna == 144 || n1DeeSCEcna == 165) && i_xgeo >= 0) {
7515  histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna] * (Double_t)10. / (Double_t)25.;
7516  }
7517 
7518  //--------------- DSSC 25
7519  if (n1DeeSCEcna == 32 && i_xgeo >= 0) {
7520  histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna] / (Double_t)5.;
7521  }
7522  if ((n1DeeSCEcna == 176 || n1DeeSCEcna == 193) && i_xgeo >= 0) {
7523  histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna] * (Double_t)10. / (Double_t)25.;
7524  }
7525 
7526  //--------------- DSSC 30
7527  if ((n1DeeSCEcna == 60 || n1DeeSCEcna == 119) && i_xgeo >= 0) {
7528  histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna] / (Double_t)2.;
7529  }
7530 
7531  //--------------- DSSC 21 (Add SC translated at 10-1 only once, i_xgeo = -1 accepted)
7532  if (n1DeeSCEcna == 102) {
7533  histo_for_plot[i_xgeo] +=
7534  read_histo[9] / (Double_t)21. + read_histo[i0StexStinEcna] * (Double_t)10. / (Double_t)21.;
7535  }
7536  if (n1DeeSCEcna == 123 && i_xgeo >= 0) {
7537  histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna] * (Double_t)10. / (Double_t)21.;
7538  }
7539 
7540  //--------------- DSSC 3 (Add SC translated at 11-1 only once, i_xgeo = -1 accepted)
7541  if (n1DeeSCEcna == 138) {
7542  histo_for_plot[i_xgeo] +=
7543  read_histo[10] / (Double_t)21. + read_histo[i0StexStinEcna] * (Double_t)10. / (Double_t)21.;
7544  }
7545  if (n1DeeSCEcna == 157 && i_xgeo >= 0) {
7546  histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna] * (Double_t)10. / (Double_t)21.;
7547  }
7548  } else {
7549  if (i_xgeo >= 0) {
7550  histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna];
7551  } // standard treatment
7552  }
7553  } // end of if( i_xgeo >= -1 && i_xgeo < SizeForPlot )
7554  else {
7555  //std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> i_xgeo = " << i_xgeo
7556  // << ". OUT OF RANGE ( range = [0,"<< SizeForPlot << "] " << std::endl;
7557  }
7558  } // end of if( fFlagSubDet == "EE" )
7559  } // end of for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
7560  } else {
7561  std::cout << "!TEcnaHistos::ViewHisto(...)> "
7562  << " Data not available for " << fFapStexName << " " << iStasStex + 1
7563  << " (Quantity not present in the ROOT file)" << std::endl;
7564  }
7565  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE ) (ViewHisto/Stas)
7566  else {
7567  fStatusFileFound = kFALSE;
7568 
7569  std::cout << "!TEcnaHistos::ViewHisto(...)> "
7570  << " Data not available for " << fFapStexName << " " << iStasStex + 1 << " (ROOT file not found)"
7571  << std::endl;
7572  }
7573 
7574  if (fFapNbOfEvts <= xFapNbOfEvts[iStasStex]) {
7575  fFapNbOfEvts = xFapNbOfEvts[iStasStex];
7576  }
7577 
7578  } // end of for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
7579 
7580  //delete [] NOFE_int; NOFE_int = 0; fCdelete++;
7581  delete[] xFapNbOfEvts;
7582  xFapNbOfEvts = nullptr;
7583  fCdelete++;
7584 
7585  if (CounterExistingFile > 0 && CounterDataExist > 0) {
7586  OKPlot = 1;
7587  }
7588 
7589  } // end of if( fFapStexNumber == 0 )
7590 
7591  //---------------------------------------------------------------------------- (ViewHisto [Stex])
7592 
7593  if (fFapStexNumber > 0) {
7594  Bool_t OKFileExists = kFALSE;
7595  Bool_t ok_view_histo = kFALSE;
7596 
7597  if (arg_AlreadyRead == 0) {
7601  fFapRunNumber,
7606  fCfgResultsRootFilePath.Data());
7607 
7608  if (fMyRootFile->LookAtRootFile() == kTRUE) {
7609  OKFileExists = kTRUE;
7610  } // (ViewHisto, Stex)
7611 
7612  if (OKFileExists == kTRUE) {
7614  fp_name_short = fMyRootFile->GetRootFileNameShort();
7615  // std::cout << "*TEcnaHistos::ViewHisto(...)> Data are analyzed from file ----> "
7616  // << fp_name_short << std::endl;
7617 
7621 
7622  ok_view_histo = GetOkViewHisto(fMyRootFile, StexStin_A, i0StinEcha, i0Sample, HistoCode.Data());
7623  }
7624  }
7625 
7626  if (arg_AlreadyRead >= 1) {
7627  OKFileExists = kTRUE;
7628  ok_view_histo = kTRUE;
7629  }
7630 
7631  if (OKFileExists == kTRUE) {
7632  fStatusFileFound = kTRUE;
7633  //---------------------------------------------------------------------------- (ViewHisto [Stex])
7634 
7635  if (ok_view_histo == kTRUE) {
7636  //------------ EB or EE with SampGlobal or SampProj (histo_for_plot = read_histo)
7637  if (fFlagSubDet == "EB" ||
7638  (fFlagSubDet == "EE" && (HistoType == "SampGlobal" || HistoType == "SampProj"))) {
7639  histo_for_plot = GetHistoValues(arg_read_histo,
7640  arg_AlreadyRead,
7641  fMyRootFile,
7642  HistoCode.Data(),
7643  SizeForPlot,
7644  SizeForRead,
7645  StexStin_A,
7646  i0StinEcha,
7647  i0Sample,
7648  i_data_exist);
7649  if (i_data_exist > 0) {
7650  OKPlot = 1;
7651  }
7652  if (OKPlot == 1 && opt_plot == "ASCII" && (HistoType == "Global" || HistoType == "Proj")) {
7653  WriteHistoAscii(HistoCode.Data(), SizeForPlot, histo_for_plot);
7654  }
7655  }
7656 
7657  //------------ EE except for SampGlobal and SampProj) (histo_for_plot # read_histo)
7658  if (fFlagSubDet == "EE" && !(HistoType == "SampGlobal" || HistoType == "SampProj")) {
7659  TVectorD read_histo(SizeForRead);
7660  for (Int_t i = 0; i < SizeForRead; i++) {
7661  read_histo(i) = (Double_t)0.;
7662  }
7663 
7664  read_histo = GetHistoValues(arg_read_histo,
7665  arg_AlreadyRead,
7666  fMyRootFile,
7667  HistoCode.Data(),
7668  SizeForRead,
7669  SizeForRead,
7670  StexStin_A,
7671  i0StinEcha,
7672  i0Sample,
7673  i_data_exist);
7674  if (i_data_exist > 0) {
7675  OKPlot = 1;
7676  }
7677  if (OKPlot == 1 && opt_plot == "ASCII") {
7678  WriteHistoAscii(HistoCode.Data(), fEcal->MaxCrysEcnaInDee(), read_histo);
7679  }
7680  if (OKPlot == 1 && opt_plot != "ASCII") {
7681  //..................... Build histo_for_plot from read_histo (ViewHisto [Stex])
7682  Int_t DeeNumber = fFapStexNumber;
7683  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
7684 
7685  //%%%%%%%%%%%%%%%%%%%%%%%%%%%% LOOP ON Echa (Ecna) %%%%%%%%%%%%%%%%%%%%%%%%%% (ViewHisto [Stex])
7686  for (Int_t i0DeeEcha = 0; i0DeeEcha < fEcal->MaxCrysEcnaInDee(); i0DeeEcha++) {
7687  Int_t n1SCEcha = fEcalNumbering->Get1SCEchaFrom0DeeEcha(i0DeeEcha);
7688  Int_t n1DeeSCEcna = i0DeeEcha / fEcal->MaxCrysInSC() + 1;
7689 
7690  Int_t DataSector = fEcalNumbering->GetDSFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
7691  Int_t SC_in_DS = fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna, n1SCEcha);
7692 
7693  Int_t i_xgeo = -1;
7694 
7695  if (n1SCEcha >= 1 && n1SCEcha <= fEcal->MaxCrysInSC()) {
7696  if (n1DeeSCEcna >= 1 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee()) {
7697  if (DataSector >= 1 && DataSector <= 9) {
7698  if (SC_in_DS >= 1 && SC_in_DS <= fEcalNumbering->GetMaxSCInDS(DataSector)) {
7699  if (read_histo[i0DeeEcha] != 0) {
7700  //................................... Data Sector offset
7701  Int_t DSOffset = GetDSOffset(DeeNumber, DataSector);
7702 
7703  //........................ Super-Crystal (SC) offset (ViewHisto [Stex])
7704  Int_t SCOffset = GetSCOffset(DeeNumber, DataSector, SC_in_DS);
7705 
7706  //........................ Xtal final bin
7707  Int_t nSCCons =
7708  fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna, n1SCEcha);
7709 
7710  Int_t n1FinalSCEcha = n1SCEcha;
7711 
7712  if (fEcalNumbering->GetSCType(nSCCons) == "NotConnected" ||
7713  fEcalNumbering->GetSCType(nSCCons) ==
7714  "NotComplete") { //----- not complete and not connected SC's
7715  // no i_xgeo value if SC = 14 or 25 and channel 11
7716  if (!((SC_in_DS == 14 || SC_in_DS == 25) && n1SCEcha == 11)) {
7717  n1FinalSCEcha = ModifiedSCEchaForNotConnectedSCs(
7718  DeeNumber, nSCCons, SC_in_DS, n1DeeSCEcna, n1SCEcha);
7719  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha - 1);
7720  }
7721  // change SC 14 -> 21 and channel 11 -> 21
7722  if (SC_in_DS == 14 && n1SCEcha == 11) {
7723  SCOffset = GetSCOffset(DeeNumber, DataSector, 21);
7724  n1FinalSCEcha = 21;
7725  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha - 1);
7726  }
7727  // change SC 25 -> 3 for channel 11 -> 21
7728  if (SC_in_DS == 25 && n1SCEcha == 11) {
7729  SCOffset = GetSCOffset(DeeNumber, DataSector, 3);
7730  n1FinalSCEcha = 21;
7731  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha - 1);
7732  }
7733  } else { //----------- Complete SCs
7734  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha - 1);
7735  }
7736 
7737  histo_for_plot_memo[i_xgeo]++;
7738  if (histo_for_plot_memo[i_xgeo] >= 2) {
7739  std::cout << "! histo_memo[" << i_xgeo << "] = " << histo_for_plot_memo[i_xgeo]
7740  << ", nSCCons = " << nSCCons << ", SC_in_DS = " << SC_in_DS
7741  << ", DSOffset = " << DSOffset << ", SCOffset = " << SCOffset
7742  << ", n1DeeSCEcna = " << n1DeeSCEcna << ", n1SCEcha = " << n1SCEcha
7743  << ", n1FinalSCEcha = " << n1FinalSCEcha << std::endl;
7744  }
7745  //.............................. transfert read_histo -> histo_for_plot
7746  if (i_xgeo >= 0 && i_xgeo < SizeForPlot) {
7747  if (n1FinalSCEcha > 0) {
7748  histo_for_plot[i_xgeo] += read_histo[i0DeeEcha];
7749  }
7750  } else {
7751  std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> i_xgeo = " << i_xgeo
7752  << ". OUT OF RANGE ( range = [0," << SizeForPlot << "] " << std::endl;
7753  }
7754  } // end of if( read_histo[i0DeeEcha] > 0 )
7755  } // end of if( SC_in_DS >= 1 && SC_in_DS <= fEcalNumbering->GetMaxSCInDS(DataSector) )
7756  else {
7757  std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> SC_in_DS = " << SC_in_DS
7758  << ". OUT OF RANGE ( range = [1," << fEcalNumbering->GetMaxSCInDS(DataSector)
7759  << "] "
7760  << ", DataSector = " << DataSector << ", n1DeeSCEcna = " << n1DeeSCEcna
7761  << ", n1SCEcha = " << n1SCEcha << ", i0DeeEcha = " << i0DeeEcha << std::endl;
7762  }
7763  } // end of if( DataSector >= 1 && DataSector <= 9 )
7764  else {
7765  if (DataSector != 0) {
7766  std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> DataSector = " << DataSector
7767  << ". OUT OF RANGE ( range = [1,9] "
7768  << ", n1DeeSCEcna = " << n1DeeSCEcna << ", n1SCEcha = " << n1SCEcha
7769  << ", i0DeeEcha = " << i0DeeEcha << std::endl;
7770  }
7771  }
7772  } // end of if( n1DeeSCEcna >= 1 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
7773  else {
7774  std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> n1DeeSCEcna = " << n1DeeSCEcna
7775  << ". OUT OF RANGE ( range = [1," << fEcal->MaxSCEcnaInDee() << "] "
7776  << ", n1SCEcha = " << n1SCEcha << ", i0DeeEcha = " << i0DeeEcha << std::endl;
7777  }
7778  } // end of if(n1SCEcha >= 1 && n1SCEcha <= fEcal->MaxCrysInSC() )
7779  else {
7780  std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> n1SCEcha = " << n1SCEcha
7781  << ". OUT OF RANGE ( range = [1," << fEcal->MaxCrysInSC() << "] "
7782  << ", i0DeeEcha = " << i0DeeEcha << std::endl;
7783  }
7784  }
7785  } // end of if( OKPlot == 1 && opt_plot != "ASCII" )
7786  } // end of if(fFlagSubDet == "EE")
7787  } // end of if(ok_view_histo == kTRUE)
7788  else {
7789  std::cout << "!TEcnaHistos::ViewHisto(...)> *ERROR* =====> "
7790  << " ok_view_histo != kTRUE " << fTTBELL << std::endl;
7791  }
7792  } // end of if(fMyRootFile->LookAtRootFile() == kTRUE)
7793  else {
7794  fStatusFileFound = kFALSE;
7795 
7796  std::cout << "!TEcnaHistos::ViewHisto(...)> *ERROR* =====> "
7797  << " ROOT file not found" << fTTBELL << std::endl;
7798  }
7799  } // end of if(fFapStexNumber > 0)
7800  } // end of if( HistoType == "Global" || HistoType == "Proj" || HistoType == "SampGlobal" || HistoType == "SampProj" )
7801  else {
7802  //--------------------------------------------------------------------- not Global-Proj Histo
7803  if ((fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas())) {
7804  Bool_t OKFileExists = kFALSE;
7805 
7806  if (!(arg_AlreadyRead > 1)) {
7810  fFapRunNumber,
7815  fCfgResultsRootFilePath.Data());
7816  OKFileExists = fMyRootFile->LookAtRootFile();
7817  if (OKFileExists == kTRUE) {
7819  }
7820  } else {
7821  OKFileExists = kTRUE;
7822  }
7823 
7824  if (OKFileExists == kTRUE) // (ViewHisto, not Global-Proj)
7825  {
7826  fStatusFileFound = kTRUE;
7827 
7828  for (Int_t i = 0; i < SizeForPlot; i++) {
7829  histo_for_plot[i] = (Double_t)0;
7830  }
7831 
7832  histo_for_plot = GetHistoValues(arg_read_histo,
7833  arg_AlreadyRead,
7834  fMyRootFile,
7835  HistoCode.Data(),
7836  SizeForPlot,
7837  SizeForRead,
7838  StexStin_A,
7839  i0StinEcha,
7840  i0Sample,
7841  i_data_exist);
7842 
7847 
7848  if (i_data_exist > 0) {
7849  OKPlot = 1;
7850  }
7851  } else {
7852  std::cout << "!TEcnaHistos::ViewHisto(...)> *ERROR* =====> "
7853  << " ROOT file not found" << fTTBELL << std::endl;
7854  }
7855  } else {
7856  std::cout << "!TEcnaHistos::ViewHisto(...)> " << fFapStexName.Data() << " = " << fFapStexNumber
7857  << ". Out of range (range = [1," << fEcal->MaxStexInStas() << "]) " << fTTBELL << std::endl;
7858  }
7859  }
7860 
7861  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PLOT accepted
7862 
7863  if ((HistoType == "Global" || HistoType == "Proj" || HistoType == "SampGlobal" || HistoType == "SampProj" ||
7864  HistoType == "H1Basic" || HistoType == "H1BasicProj") ||
7865  (!(HistoType == "Global" || HistoType == "Proj" || HistoType == "SampGlobal" || HistoType == "SampProj" ||
7866  HistoType == "H1Basic" || HistoType == "H1BasicProj") &&
7867  ((fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas())))) {
7868  if (opt_plot != "ASCII") {
7869  if (OKPlot > 0) {
7870  //... Ymin and ymax default values will be taken if fFlagUserHistoMin/Max = "OFF"
7871  // and if "Free" for "SAME" and "SAME n" options
7872  if ((opt_plot == fOnlyOnePlot && (arg_AlreadyRead == 0 || arg_AlreadyRead == 1)) ||
7873  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
7874  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free")) {
7875  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
7876  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
7877  }
7878 
7879  //==== H I S T O P R O J X I N F / X S U P M A N A G E M E N T ======== (ViewHisto)
7880  //
7881  // must be done before booking because of the x <-> y permutation in case of "Proj"
7882  //
7883  //-----------------------------------------------------------------------------------------
7884  //
7885  // CASE: HistoType == "Proj" OR HistoType == "SampProj"
7886  //
7887  // Xinf and Xsup must be calculated from ymin and ymax
7888  // of the direct ("Global") histo
7889  //
7890  //-----------------------------------------------------------------------------------------
7891  if (HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj") {
7892  TString HistoCodi = HistoCode; // HistoCodi = direct histo
7893 
7894  if (HistoCode == "D_NOE_ChDs") {
7895  HistoCodi = "D_NOE_ChNb";
7896  }
7897  if (HistoCode == "D_Ped_ChDs") {
7898  HistoCodi = "D_Ped_ChNb";
7899  }
7900  if (HistoCode == "D_TNo_ChDs") {
7901  HistoCodi = "D_TNo_ChNb";
7902  }
7903  if (HistoCode == "D_MCs_ChDs") {
7904  HistoCodi = "D_MCs_ChNb";
7905  }
7906  if (HistoCode == "D_LFN_ChDs") {
7907  HistoCodi = "D_LFN_ChNb";
7908  }
7909  if (HistoCode == "D_HFN_ChDs") {
7910  HistoCodi = "D_HFN_ChNb";
7911  }
7912  if (HistoCode == "D_SCs_ChDs") {
7913  HistoCodi = "D_SCs_ChNb";
7914  }
7915  if (HistoCode == "D_MSp_SpDs") {
7916  HistoCodi = "D_MSp_SpNb";
7917  }
7918  if (HistoCode == "D_SSp_SpDs") {
7919  HistoCodi = "D_SSp_SpNb";
7920  }
7921  if (HistoCode == "D_Adc_EvDs") {
7922  HistoCodi = "D_Adc_EvNb";
7923  }
7924 
7925  TString TitleHisto = ";";
7926  if (opt_plot != fSameOnePlot) {
7927  TitleHisto = fCnaParHistos->GetQuantityName(HistoCodi);
7928  }
7929 
7930  if (fUserHistoMin >= fUserHistoMax) {
7931  fFlagUserHistoMin = "AUTO";
7932  fFlagUserHistoMax = "AUTO";
7933  }
7934 
7935  //--------------------------------------------------------------------------- (ViewHisto)
7936  //
7937  // fOnlyOnePlot => compute Xinf and Xsup at each time
7938  // fSeveralPlot => compute Xinf and Xsup once when flag = "Free" for each HistoCode
7939  // fSameOnePlot => compute Xinf and Xsup once
7940  //
7941  //--------------------------------------------------------------------------------------
7942  if ((opt_plot == fOnlyOnePlot && (arg_AlreadyRead == 0 || arg_AlreadyRead == 1)) ||
7943  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, fSeveralPlot) == "Free") ||
7944  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, fSameOnePlot) == "Free")) {
7945  Double_t XinfProj = (Double_t)0;
7946  Double_t XsupProj = (Double_t)0;
7947 
7948  //...................................................................... (ViewHisto)
7949  if (fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO") {
7950  Int_t HisSiza = GetHistoSize(HistoCodi.Data(), "plot");
7951  Int_t ReadHisSiza = HisSiza;
7952  //.............................. prepa direct histogram booking (ViewHisto)
7953  Axis_t xinf_hisa = GetHistoXinf(HistoCodi.Data(), HisSiza, opt_plot);
7954  Axis_t xsup_hisa = GetHistoXsup(HistoCodi.Data(), HisSiza, opt_plot);
7955  Int_t nb_binxa = GetHistoNumberOfBins(HistoCodi.Data(), HisSiza);
7956  //.............................. direct ("Global") histogram booking (ViewHisto)
7957  TH1D* h_hisa = new TH1D("histoa", TitleHisto.Data(), nb_binxa, xinf_hisa, xsup_hisa);
7958  fCnewRoot++;
7959  h_hisa->Reset();
7960  //.... direct histogram filling to get its ymin (=> xminProj) and ymax (=> xmaxProj)
7961  FillHisto(h_hisa, histo_for_plot, HistoCodi.Data(), ReadHisSiza);
7962  //... Get direct histo ymin and/or ymax and keep them as xinf and xsup
7963  // in memo for the plotted histo
7964  XinfProj = fUserHistoMin;
7965  XsupProj = fUserHistoMax;
7966  if (fFlagUserHistoMin == "AUTO") {
7967  XinfProj = h_hisa->GetMinimum();
7968  }
7969  if (fFlagUserHistoMax == "AUTO") {
7970  XsupProj = h_hisa->GetMaximum();
7971  }
7972  XsupProj += (XsupProj - XinfProj) * fCnaParHistos->GetMarginAutoMinMax(); // to see the last bin
7973  h_hisa->Delete();
7974  h_hisa = nullptr;
7975  fCdeleteRoot++;
7976  } // end of if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
7977  else {
7978  if (fFlagUserHistoMin == "OFF") {
7979  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
7980  XinfProj = GetYminValueFromMemo(HistoCode.Data());
7981  }
7982 
7983  if (fFlagUserHistoMax == "OFF") {
7984  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
7985  XsupProj = GetYmaxValueFromMemo(HistoCode.Data());
7986  }
7987  if (fFlagUserHistoMin == "ON") {
7988  XinfProj = fUserHistoMin;
7989  }
7990  if (fFlagUserHistoMax == "ON") {
7991  XsupProj = fUserHistoMax;
7992  }
7993  }
7994 
7995  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
7996  SetXinfMemoFromValue(HistoCode.Data(), XinfProj);
7997  SetXsupMemoFromValue(HistoCode.Data(), XsupProj);
7998  } else {
7999  SetXinfMemoFromValue(XinfProj);
8000  SetXsupMemoFromValue(XsupProj);
8001  }
8002  } // end of if( (opt_plot == fOnlyOnePlot) ||
8003  // (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8004  // (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
8005  } // end of if( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj" )
8006 
8007  //=============== H I S T O B O O K I N G A N D F I L L I N G ======== (ViewHisto)
8008  //.............................. prepa histogram booking (ViewHisto)
8009 
8010  //.......... Set number of bins: forcing to fNbBinsProj if "HistoType" == "Proj"
8011  Int_t xNbBins = GetHistoNumberOfBins(HistoCode.Data(), SizeForPlot);
8012 
8013  Double_t cXinf = (Double_t)0.;
8014  Double_t cXsup = (Double_t)0.;
8015 
8016  //.......... Set Xinf and Xsup at each time because of simultaneous SAME options
8017  if (HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj") {
8018  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
8019  cXinf = GetXinfValueFromMemo(HistoCode.Data());
8020  cXsup = GetXsupValueFromMemo(HistoCode.Data());
8021  } else {
8022  cXinf = GetXinfValueFromMemo();
8023  cXsup = GetXsupValueFromMemo();
8024  }
8025  } else {
8026  cXinf = GetHistoXinf(HistoCode.Data(), SizeForPlot, opt_plot);
8027  cXsup = GetHistoXsup(HistoCode.Data(), SizeForPlot, opt_plot);
8028  }
8029 
8030  //.............................. histogram booking (ViewHisto)
8031  Axis_t xinf_his = cXinf; // ancillary variables since no const in arguments of TH1D
8032  Axis_t xsup_his = cXsup;
8033  Int_t nb_binx = xNbBins;
8034 
8035  TString TitleHisto = ";";
8036  if (opt_plot != fSameOnePlot) {
8037  TitleHisto = fCnaParHistos->GetQuantityName(HistoCode.Data());
8038  }
8039  TH1D* h_his0 = new TH1D("histo", TitleHisto.Data(), nb_binx, xinf_his, xsup_his);
8040  fCnewRoot++;
8041  h_his0->Reset();
8042  //............................... histogram filling
8043  FillHisto(h_his0, histo_for_plot, HistoCode.Data(), SizeForPlot);
8044 
8045  //=============== H I S T O Y M I N / Y M A X M A N A G E M E N T =========== (ViewHisto)
8046  if (opt_plot == fOnlyOnePlot || (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8047  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free")) {
8048  if (opt_plot == fSameOnePlot) {
8049  fHistoCodeFirst = HistoCode;
8050  } // registration of first HistoCode
8051  //................................. Automatic min and/or max for other options than "Proj"
8052  if (HistoType != "Proj" && HistoType != "SampProj" && HistoType != "H1BasicProj") {
8053  if (fUserHistoMin >= fUserHistoMax) {
8054  fFlagUserHistoMin = "AUTO";
8055  fFlagUserHistoMax = "AUTO";
8056  }
8057  //................................. user's min and/or max
8058  if (fFlagUserHistoMin == "ON") {
8059  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
8060  fFlagUserHistoMin = "OFF";
8061  }
8062  if (fFlagUserHistoMax == "ON") {
8063  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
8064  fFlagUserHistoMax = "OFF";
8065  }
8066  //................................. automatic min and/or max
8067  if (fFlagUserHistoMin == "AUTO") {
8068  //.............. no bottom margin if ymin = 0
8069  Double_t ymin = GetYminFromHistoFrameAndMarginValue(h_his0, (Double_t)0.);
8070  if (ymin != (Double_t)0.) {
8072  }
8073  SetYminMemoFromValue(HistoCode.Data(), ymin);
8074  fFlagUserHistoMin = "OFF";
8075  }
8076  if (fFlagUserHistoMax == "AUTO") {
8078  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
8079  fFlagUserHistoMax = "OFF";
8080  }
8081  //................................. Set YMin and YMax of histo (ViewHisto)
8082  SetYminMemoFromPreviousMemo(HistoCode);
8083  SetYmaxMemoFromPreviousMemo(HistoCode);
8084  } // end of if( HistoType != "Proj" && HistoType != "SampProj" && HistoType != "H1BasicProj" )
8085 
8086  //.......... Find maximum in case of Proj (LIN scale only) // PS: EvolProj => in ViewHistime
8087  if ((HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj") &&
8088  fFlagScaleY == "LIN") {
8089  SetYmaxMemoFromValue(HistoCode.Data(),
8091  }
8092  } // end of if( opt_plot == fOnlyOnePlot ||
8093  // (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8094  // (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
8095 
8096  //--- Set ymin and ymax to the first HistoCode values for option SAME n
8097  if (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy") {
8098  Double_t ymin = GetYminValueFromMemo(fHistoCodeFirst.Data());
8099  SetYminMemoFromValue(HistoCode.Data(), ymin);
8100 
8101  Double_t ymax = GetYmaxValueFromMemo(fHistoCodeFirst.Data());
8102  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
8103  }
8104 
8105  //... histogram set ymin and ymax and consequently margin at top of the plot
8106  Int_t xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo(h_his0, HistoCode);
8107 
8108  //==================================== P L O T ============================== (ViewHisto)
8109  HistoPlot(h_his0,
8110  SizeForPlot,
8111  xinf_his,
8112  xsup_his,
8113  HistoCode.Data(),
8114  HistoType.Data(),
8115  StexStin_A,
8116  i0StinEcha,
8117  i0Sample,
8118  opt_scale_x,
8119  opt_scale_y,
8120  opt_plot,
8121  arg_AlreadyRead,
8122  xFlagAutoYsupMargin);
8123  h_his0->Delete();
8124  h_his0 = nullptr;
8125  fCdeleteRoot++;
8126  //===========================================================================
8127 
8128  //--- Recover ymin and ymax from user's values in option SAME n
8129  if ((opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy")) {
8130  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
8131  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
8132  }
8133  } // end of if( OKPlot > 0 )
8134  else {
8135  std::cout << "!TEcnaHistos::ViewHisto(...)> Histo not available." << fTTBELL << std::endl;
8136  }
8137  }
8138  }
8139  } // end of if( OKHisto == 1 )
8140 
8141 } // end of ViewHisto(...)
8142 
8143 //------------------------------------------------------------------------------------
8144 Int_t TEcnaHistos::GetDSOffset(const Int_t& DeeNumber, const Int_t& DataSector) {
8145  // gives the DataSector Offset on 1D histos for option "Global"
8146 
8147  Int_t DSOffset = 0;
8148 
8149  if (DeeNumber == 4) {
8150  if (DataSector >= 1) {
8151  }
8152  if (DataSector >= 2) {
8153  DSOffset += fEcalNumbering->GetMaxSCInDS(1) * fEcal->MaxCrysInSC();
8154  }
8155  if (DataSector >= 3) {
8156  DSOffset += fEcalNumbering->GetMaxSCInDS(2) * fEcal->MaxCrysInSC();
8157  }
8158  if (DataSector >= 4) {
8159  DSOffset += fEcalNumbering->GetMaxSCInDS(3) * fEcal->MaxCrysInSC();
8160  }
8161  if (DataSector >= 5) {
8162  DSOffset += fEcalNumbering->GetMaxSCInDS(4) * fEcal->MaxCrysInSC();
8163  }
8164  }
8165  if (DeeNumber == 3) {
8166  if (DataSector >= 5) {
8167  }
8168  if (DataSector >= 6) {
8169  DSOffset += (fEcalNumbering->GetMaxSCInDS(5) / 2) * fEcal->MaxCrysInSC();
8170  }
8171  if (DataSector >= 7) {
8172  DSOffset += fEcalNumbering->GetMaxSCInDS(6) * fEcal->MaxCrysInSC();
8173  }
8174  if (DataSector >= 8) {
8175  DSOffset += fEcalNumbering->GetMaxSCInDS(7) * fEcal->MaxCrysInSC();
8176  }
8177  if (DataSector >= 9) {
8178  DSOffset += fEcalNumbering->GetMaxSCInDS(8) * fEcal->MaxCrysInSC();
8179  }
8180  }
8181  if (DeeNumber == 2) {
8182  if (DataSector <= 9) {
8183  }
8184  if (DataSector <= 8) {
8185  DSOffset += fEcalNumbering->GetMaxSCInDS(9) * fEcal->MaxCrysInSC();
8186  }
8187  if (DataSector <= 7) {
8188  DSOffset += fEcalNumbering->GetMaxSCInDS(8) * fEcal->MaxCrysInSC();
8189  }
8190  if (DataSector <= 6) {
8191  DSOffset += fEcalNumbering->GetMaxSCInDS(7) * fEcal->MaxCrysInSC();
8192  }
8193  if (DataSector <= 5) {
8194  DSOffset += fEcalNumbering->GetMaxSCInDS(6) * fEcal->MaxCrysInSC();
8195  }
8196  }
8197  if (DeeNumber == 1) {
8198  if (DataSector <= 5) {
8199  }
8200  if (DataSector <= 4) {
8201  DSOffset += (fEcalNumbering->GetMaxSCInDS(5) / 2) * fEcal->MaxCrysInSC();
8202  }
8203  if (DataSector <= 3) {
8204  DSOffset += fEcalNumbering->GetMaxSCInDS(4) * fEcal->MaxCrysInSC();
8205  }
8206  if (DataSector <= 2) {
8207  DSOffset += fEcalNumbering->GetMaxSCInDS(3) * fEcal->MaxCrysInSC();
8208  }
8209  if (DataSector <= 1) {
8210  DSOffset += fEcalNumbering->GetMaxSCInDS(2) * fEcal->MaxCrysInSC();
8211  }
8212  }
8213  return DSOffset;
8214 }
8215 //------------------------------------------------------------------------------------
8216 Int_t TEcnaHistos::GetSCOffset(const Int_t& DeeNumber, const Int_t& DataSector, const Int_t& SC_in_DS) {
8217  // gives the SC (Super-Crystal) Offset on 1D histos for option "Global"
8218 
8219  Int_t SCOffset = 0;
8220 
8221  if (DeeNumber == 1 || DeeNumber == 3) {
8222  if (DataSector == 5) {
8223  SCOffset += ((SC_in_DS - 17) - 1) * fEcal->MaxCrysInSC();
8224  }
8225  if (DataSector != 5) {
8226  SCOffset += (SC_in_DS - 1) * fEcal->MaxCrysInSC();
8227  }
8228  }
8229 
8230  if (DeeNumber == 2 || DeeNumber == 4) {
8231  SCOffset += (SC_in_DS - 1) * fEcal->MaxCrysInSC();
8232  }
8233 
8234  return SCOffset;
8235 }
8236 //------------------------------------------------------------------------------------
8237 Int_t TEcnaHistos::ModifiedSCEchaForNotConnectedSCs(const Int_t& n1DeeNumber,
8238  const Int_t& nSCCons,
8239  const Int_t& SC_in_DS,
8240  const Int_t& n1DeeSCEcna,
8241  const Int_t& n1SCEcha) {
8242  //------------------------ Modification of n1SCEcha number for not connected SC's
8243 
8244  Int_t ModifiedSCEcha = -1;
8245  TString SCQuad = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna); // SCQuad = top OR bottom
8246  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(n1DeeNumber); // DeeDir = left OR right
8247 
8248  TString TypQuad = "?";
8249  if (SCQuad == "top" && DeeDir == "right") {
8250  TypQuad = "TR";
8251  }
8252  if (SCQuad == "top" && DeeDir == "left") {
8253  TypQuad = "TL";
8254  }
8255  if (SCQuad == "bottom" && DeeDir == "left") {
8256  TypQuad = "BL";
8257  }
8258  if (SCQuad == "bottom" && DeeDir == "right") {
8259  TypQuad = "BR";
8260  }
8261 
8262  //------------------------------------------------------------------------------------------- top
8263 
8264  //..... (D1,S1), (D3,S9) SC_in_DS = 30, n1DeeSCEcna = 60 -> 182a for construction top/right
8265  //..... (D1,S2), (D3,S8) SC_in_DS = 3, n1DeeSCEcna = 138 -> 178a for construction top/right
8266  if ((SC_in_DS == 30 && n1DeeSCEcna == 60 && TypQuad == "TR") ||
8267  (SC_in_DS == 3 && n1DeeSCEcna == 138 && TypQuad == "TR")) {
8268  if (n1SCEcha > 15) {
8269  ModifiedSCEcha = n1SCEcha - 15;
8270  }
8271  }
8272 
8273  //..... (D4,S1), (D2,S9) SC_in_DS = 30, n1DeeSCEcna = 60 -> 33a for construction top/left
8274  //..... (D4,S2), (D2,S8) SC_in_DS = 3, n1DeeSCEcna = 138 -> 29a for construction top/left
8275  if ((SC_in_DS == 30 && n1DeeSCEcna == 60 && TypQuad == "TL") ||
8276  (SC_in_DS == 3 && n1DeeSCEcna == 138 && TypQuad == "TL")) {
8277  if (n1SCEcha == 4) {
8278  ModifiedSCEcha = 1;
8279  }
8280  if (n1SCEcha == 5) {
8281  ModifiedSCEcha = 2;
8282  }
8283  if (n1SCEcha == 9) {
8284  ModifiedSCEcha = 3;
8285  }
8286  if (n1SCEcha == 10) {
8287  ModifiedSCEcha = 4;
8288  }
8289  if (n1SCEcha == 14) {
8290  ModifiedSCEcha = 5;
8291  }
8292  if (n1SCEcha == 15) {
8293  ModifiedSCEcha = 6;
8294  }
8295  if (n1SCEcha == 19) {
8296  ModifiedSCEcha = 7;
8297  }
8298  if (n1SCEcha == 20) {
8299  ModifiedSCEcha = 8;
8300  }
8301  if (n1SCEcha == 24) {
8302  ModifiedSCEcha = 9;
8303  }
8304  if (n1SCEcha == 25) {
8305  ModifiedSCEcha = 10;
8306  }
8307  }
8308 
8309  //..... (D1,S1), (D3,S9) SC_in_DS = 30, n1DeeSCEcna = 119 -> 182b for construction top/right
8310  if (SC_in_DS == 30 && n1DeeSCEcna == 119 && TypQuad == "TR") {
8311  if (n1SCEcha > 5) {
8312  ModifiedSCEcha = n1SCEcha - 5;
8313  }
8314  }
8315 
8316  //..... (D4,S1), (D2,S9) SC_in_DS = 30, n1DeeSCEcna = 119 -> 33b for construction top/left
8317  if (SC_in_DS == 30 && n1DeeSCEcna == 119 && TypQuad == "TL") {
8318  if (n1SCEcha == 4) {
8319  ModifiedSCEcha = 11;
8320  }
8321  if (n1SCEcha == 5) {
8322  ModifiedSCEcha = 12;
8323  }
8324  if (n1SCEcha == 9) {
8325  ModifiedSCEcha = 13;
8326  }
8327  if (n1SCEcha == 10) {
8328  ModifiedSCEcha = 14;
8329  }
8330  if (n1SCEcha == 14) {
8331  ModifiedSCEcha = 15;
8332  }
8333  if (n1SCEcha == 15) {
8334  ModifiedSCEcha = 16;
8335  }
8336  if (n1SCEcha == 19) {
8337  ModifiedSCEcha = 17;
8338  }
8339  if (n1SCEcha == 20) {
8340  ModifiedSCEcha = 18;
8341  }
8342  if (n1SCEcha == 24) {
8343  ModifiedSCEcha = 19;
8344  }
8345  if (n1SCEcha == 25) {
8346  ModifiedSCEcha = 20;
8347  }
8348  }
8349 
8350  //..... (D1,S1), (D3,S9) SC_in_DS = 12, n1DeeSCEcna = 13 -> 161 for construction top/right
8351  //..... (D4,S1), (D2,S9) SC_in_DS = 12, n1DeeSCEcna = 13 -> 12 for construction top/left
8352  if (SC_in_DS == 12 && n1DeeSCEcna == 13 && TypQuad == "TR") {
8353  ModifiedSCEcha = n1SCEcha;
8354  }
8355  if (SC_in_DS == 12 && n1DeeSCEcna == 13 && TypQuad == "TL") {
8356  if (n1SCEcha >= 1 && n1SCEcha <= 4) {
8357  ModifiedSCEcha = n1SCEcha;
8358  }
8359  if (n1SCEcha >= 6 && n1SCEcha <= 9) {
8360  ModifiedSCEcha = n1SCEcha - 1;
8361  }
8362  if (n1SCEcha >= 11 && n1SCEcha <= 14) {
8363  ModifiedSCEcha = n1SCEcha - 2;
8364  }
8365  if (n1SCEcha >= 16 && n1SCEcha <= 19) {
8366  ModifiedSCEcha = n1SCEcha - 3;
8367  }
8368  if (n1SCEcha >= 21 && n1SCEcha <= 24) {
8369  ModifiedSCEcha = n1SCEcha - 4;
8370  }
8371  }
8372 
8373  //..... (D1,S2), (D3,S8) SC_in_DS = 25, n1DeeSCEcna = 176 -> 207a for construction top/right
8374  if (SC_in_DS == 25 && n1DeeSCEcna == 176 && TypQuad == "TR") {
8375  if (n1SCEcha == 4) {
8376  ModifiedSCEcha = 1;
8377  }
8378  if (n1SCEcha == 5) {
8379  ModifiedSCEcha = 2;
8380  }
8381  if (n1SCEcha == 9) {
8382  ModifiedSCEcha = 3;
8383  }
8384  if (n1SCEcha == 10) {
8385  ModifiedSCEcha = 4;
8386  }
8387  if (n1SCEcha == 14) {
8388  ModifiedSCEcha = 5;
8389  }
8390  if (n1SCEcha == 15) {
8391  ModifiedSCEcha = 6;
8392  }
8393  if (n1SCEcha == 19) {
8394  ModifiedSCEcha = 7;
8395  }
8396  if (n1SCEcha == 20) {
8397  ModifiedSCEcha = 8;
8398  }
8399  if (n1SCEcha == 24) {
8400  ModifiedSCEcha = 9;
8401  }
8402  if (n1SCEcha == 25) {
8403  ModifiedSCEcha = 10;
8404  }
8405  }
8406 
8407  //..... (D4,S2), (D2,S8) SC_in_DS = 25, n1DeeSCEcna = 176 -> 58a for construction top/left
8408  if (SC_in_DS == 25 && n1DeeSCEcna == 176 && TypQuad == "TL") {
8409  if (n1SCEcha == 16) {
8410  ModifiedSCEcha = 1;
8411  }
8412  if (n1SCEcha == 21) {
8413  ModifiedSCEcha = 2;
8414  }
8415  if (n1SCEcha == 17) {
8416  ModifiedSCEcha = 3;
8417  }
8418  if (n1SCEcha == 22) {
8419  ModifiedSCEcha = 4;
8420  }
8421  if (n1SCEcha == 18) {
8422  ModifiedSCEcha = 5;
8423  }
8424  if (n1SCEcha == 23) {
8425  ModifiedSCEcha = 6;
8426  }
8427  if (n1SCEcha == 19) {
8428  ModifiedSCEcha = 7;
8429  }
8430  if (n1SCEcha == 24) {
8431  ModifiedSCEcha = 8;
8432  }
8433  if (n1SCEcha == 20) {
8434  ModifiedSCEcha = 9;
8435  }
8436  if (n1SCEcha == 25) {
8437  ModifiedSCEcha = 10;
8438  }
8439  }
8440 
8441  //..... (D1,S2), (D3,S8) SC_in_DS = 3, n1DeeSCEcna = 157 -> 178b for construction top/right
8442  //..... (D1,S2), (D3,S8) SC_in_DS = 25, n1DeeSCEcna = 193 -> 207b for construction top/right
8443  if ((SC_in_DS == 3 && n1DeeSCEcna == 157 && TypQuad == "TR") ||
8444  (SC_in_DS == 25 && n1DeeSCEcna == 193 && TypQuad == "TR")) {
8445  if (n1SCEcha == 4) {
8446  ModifiedSCEcha = 11;
8447  }
8448  if (n1SCEcha == 5) {
8449  ModifiedSCEcha = 12;
8450  }
8451  if (n1SCEcha == 9) {
8452  ModifiedSCEcha = 13;
8453  }
8454  if (n1SCEcha == 10) {
8455  ModifiedSCEcha = 14;
8456  }
8457  if (n1SCEcha == 14) {
8458  ModifiedSCEcha = 15;
8459  }
8460  if (n1SCEcha == 15) {
8461  ModifiedSCEcha = 16;
8462  }
8463  if (n1SCEcha == 19) {
8464  ModifiedSCEcha = 17;
8465  }
8466  if (n1SCEcha == 20) {
8467  ModifiedSCEcha = 18;
8468  }
8469  if (n1SCEcha == 24) {
8470  ModifiedSCEcha = 19;
8471  }
8472  if (n1SCEcha == 25) {
8473  ModifiedSCEcha = 20;
8474  }
8475  }
8476 
8477  //..... (D4,S2), (D2,S8) SC_in_DS = 3, n1DeeSCEcna = 157 -> 29b for construction top/left
8478  //..... (D4,S2), (D2,S8) SC_in_DS = 25, n1DeeSCEcna = 193 -> 58b for construction top/left
8479  if ((SC_in_DS == 3 && n1DeeSCEcna == 157 && TypQuad == "TL") ||
8480  (SC_in_DS == 25 && n1DeeSCEcna == 193 && TypQuad == "TL")) {
8481  if (n1SCEcha == 16) {
8482  ModifiedSCEcha = 11;
8483  }
8484  if (n1SCEcha == 21) {
8485  ModifiedSCEcha = 12;
8486  }
8487  if (n1SCEcha == 17) {
8488  ModifiedSCEcha = 13;
8489  }
8490  if (n1SCEcha == 22) {
8491  ModifiedSCEcha = 14;
8492  }
8493  if (n1SCEcha == 18) {
8494  ModifiedSCEcha = 15;
8495  }
8496  if (n1SCEcha == 23) {
8497  ModifiedSCEcha = 16;
8498  }
8499  if (n1SCEcha == 19) {
8500  ModifiedSCEcha = 17;
8501  }
8502  if (n1SCEcha == 24) {
8503  ModifiedSCEcha = 18;
8504  }
8505  if (n1SCEcha == 20) {
8506  ModifiedSCEcha = 19;
8507  }
8508  if (n1SCEcha == 25) {
8509  ModifiedSCEcha = 20;
8510  }
8511  }
8512 
8513  //..... (D1,S2), (D3,S8) SC_in_DS = 32, n1DeeSCEcna = 51 -> 216 for construction top/right
8514  if (SC_in_DS == 32 && n1DeeSCEcna == 51 && TypQuad == "TR") {
8515  if (n1SCEcha >= 1 && n1SCEcha <= 4) {
8516  ModifiedSCEcha = n1SCEcha;
8517  }
8518  if (n1SCEcha >= 6 && n1SCEcha <= 9) {
8519  ModifiedSCEcha = n1SCEcha - 1;
8520  }
8521  if (n1SCEcha >= 11 && n1SCEcha <= 14) {
8522  ModifiedSCEcha = n1SCEcha - 2;
8523  }
8524  if (n1SCEcha >= 16 && n1SCEcha <= 19) {
8525  ModifiedSCEcha = n1SCEcha - 3;
8526  }
8527  if (n1SCEcha >= 21 && n1SCEcha <= 24) {
8528  ModifiedSCEcha = n1SCEcha - 4;
8529  }
8530  }
8531 
8532  //..... (D4,S2), (D2,S8) SC_in_DS = 32, n1DeeSCEcna = 51 -> 67 for construction top/left
8533  if (SC_in_DS == 32 && n1DeeSCEcna == 51 && TypQuad == "TL") {
8534  ModifiedSCEcha = n1SCEcha;
8535  }
8536 
8537  // **************************** Special case: TWO SC's IN THE SAME SC-Ecna place *************************
8538  //========================================================================================== D1,D3 ======
8539  // (D1,S2), (D3,S8) SC_in_DS = 3, n1DeeSCEcna = 32 -> 178c for construction top/right
8540  // (D1,S2), (D3,S8) SC_in_DS = 25, n1DeeSCEcna = 32 -> 207c for construction top/right
8541  // For n1DeeSCEcna = 32: ONLY "25" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
8542  // fT2d_DSSC[dee-1][32-1] = 25; // also 3; // ( (207c, 58c) also (178c, 29c) for construction)
8543  // is recovered from number for construction
8544  //=======================================================================================================
8545  if (n1DeeSCEcna == 32 && TypQuad == "TR") {
8546  if (nSCCons == 207) {
8547  if (n1SCEcha == 1) {
8548  ModifiedSCEcha = 21;
8549  }
8550  if (n1SCEcha == 2) {
8551  ModifiedSCEcha = 22;
8552  }
8553  if (n1SCEcha == 3) {
8554  ModifiedSCEcha = 23;
8555  }
8556  if (n1SCEcha == 6) {
8557  ModifiedSCEcha = 24;
8558  }
8559  if (n1SCEcha == 7) {
8560  ModifiedSCEcha = 25;
8561  }
8562  }
8563  if (nSCCons == 178) {
8564  if (n1SCEcha == 11) {
8565  ModifiedSCEcha = 21;
8566  }
8567  }
8568  }
8569 
8570  //========================================================================================== D2,D4 ======
8571  // (D4,S2), (D2,S8) SC_in_DS = 3, n1DeeSCEcna = 32 -> 29c for construction top/left
8572  // (D4,S2), (D2,S8) SC_in_DS = 25, n1DeeSCEcna = 32 -> 58c for construction top/left
8573  // For n1DeeSCEcna = 32: ONLY "25" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
8574  // fT2d_DSSC[dee-1][32-1] = 25; // also 3; // ( (207c, 58c) also (178c, 29c) for construction)
8575  // is recovered from number for construction
8576  //=======================================================================================================
8577  if (n1DeeSCEcna == 32 && TypQuad == "TL") {
8578  if (nSCCons == 58) {
8579  if (n1SCEcha == 1) {
8580  ModifiedSCEcha = 21;
8581  }
8582  if (n1SCEcha == 2) {
8583  ModifiedSCEcha = 22;
8584  }
8585  if (n1SCEcha == 3) {
8586  ModifiedSCEcha = 23;
8587  }
8588  if (n1SCEcha == 6) {
8589  ModifiedSCEcha = 24;
8590  }
8591  if (n1SCEcha == 7) {
8592  ModifiedSCEcha = 25;
8593  }
8594  }
8595  if (nSCCons == 29) {
8596  if (n1SCEcha == 11) {
8597  ModifiedSCEcha = 21;
8598  }
8599  }
8600  }
8601  //****************************************************************************************************
8602 
8603  //------------------------------------------------------------------------------------------- bottom
8604 
8605  // **************************** Special case: TWO SC's IN THE SAME SC-Ecna place *************************
8606  //========================================================================================== D1,D3 ======
8607  // (D1,S4), (D3,S6) SC_in_DS = 14, n1DeeSCEcna = 29 -> 261a for construction bottom/right
8608  // (D1,S4), (D3,S6) SC_in_DS = 21, n1DeeSCEcna = 29 -> 268a for construction bottom/right
8609  // For n1DeeSCEcna = 29: ONLY "14" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
8610  // fT2d_DSSC[dee-1][29-1] = 14; // also 21; // ( (261a, 112a) also (268a, 119a) for construction)
8611  // is recovered from number for construction
8612  //=======================================================================================================
8613  if (n1DeeSCEcna == 29 && TypQuad == "BR") {
8614  if (nSCCons == 261) {
8615  if (n1SCEcha == 1) {
8616  ModifiedSCEcha = 21;
8617  }
8618  if (n1SCEcha == 2) {
8619  ModifiedSCEcha = 22;
8620  }
8621  if (n1SCEcha == 3) {
8622  ModifiedSCEcha = 23;
8623  }
8624  if (n1SCEcha == 6) {
8625  ModifiedSCEcha = 24;
8626  }
8627  if (n1SCEcha == 7) {
8628  ModifiedSCEcha = 25;
8629  }
8630  }
8631  if (nSCCons == 268) {
8632  if (n1SCEcha == 11) {
8633  ModifiedSCEcha = 21;
8634  }
8635  }
8636  }
8637 
8638  //========================================================================================== D2,D4 ======
8639  // (D4,S4), (D2,S6) SC_in_DS = 14, n1DeeSCEcna = 29 -> 112a for construction bottom/left
8640  // (D4,S4), (D2,S6) SC_in_DS = 21, n1DeeSCEcna = 29 -> 119a for construction bottom/left
8641  // For n1DeeSCEcna = 29: ONLY "14" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
8642  // fT2d_DSSC[dee-1][29-1] = 14; // also 21; // ( (261a, 112a) also (268a, 119a) for construction)
8643  // is recovered from number for construction
8644  //=======================================================================================================
8645  if (n1DeeSCEcna == 29 && TypQuad == "BL") {
8646  if (nSCCons == 119) {
8647  if (n1SCEcha == 11) {
8648  ModifiedSCEcha = 21;
8649  }
8650  }
8651  if (nSCCons == 112) {
8652  if (n1SCEcha == 1) {
8653  ModifiedSCEcha = 21;
8654  }
8655  if (n1SCEcha == 2) {
8656  ModifiedSCEcha = 22;
8657  }
8658  if (n1SCEcha == 3) {
8659  ModifiedSCEcha = 23;
8660  }
8661  if (n1SCEcha == 6) {
8662  ModifiedSCEcha = 24;
8663  }
8664  if (n1SCEcha == 7) {
8665  ModifiedSCEcha = 25;
8666  }
8667  }
8668  }
8669 
8670  // ****************************************************************************************************
8671 
8672  //..... (D1,S3), (D3,S7) SC_in_DS = 34, n1DeeSCEcna = 188 -> 298a for construction bottom/right
8673  //..... (D1,S4), (D3,S6) SC_in_DS = 14, n1DeeSCEcna = 165 -> 261b for construction bottom/right
8674  if ((SC_in_DS == 34 && n1DeeSCEcna == 188 && TypQuad == "BR") ||
8675  (SC_in_DS == 14 && n1DeeSCEcna == 165 && TypQuad == "BR")) {
8676  if (n1SCEcha > 15) {
8677  ModifiedSCEcha = n1SCEcha - 15;
8678  }
8679  }
8680 
8681  //..... (D4,S3), (D2,S7) SC_in_DS = 34, n1DeeSCEcna = 188 -> 149a for construction bottom/left
8682  //..... (D4,S4), (D2,S6) SC_in_DS = 14, n1DeeSCEcna = 165 -> 112b for construction bottom/left
8683  if ((SC_in_DS == 34 && n1DeeSCEcna == 188 && TypQuad == "BL") ||
8684  (SC_in_DS == 14 && n1DeeSCEcna == 165 && TypQuad == "BL")) {
8685  if (n1SCEcha == 4) {
8686  ModifiedSCEcha = 1;
8687  }
8688  if (n1SCEcha == 5) {
8689  ModifiedSCEcha = 2;
8690  }
8691  if (n1SCEcha == 9) {
8692  ModifiedSCEcha = 3;
8693  }
8694  if (n1SCEcha == 10) {
8695  ModifiedSCEcha = 4;
8696  }
8697  if (n1SCEcha == 14) {
8698  ModifiedSCEcha = 5;
8699  }
8700  if (n1SCEcha == 15) {
8701  ModifiedSCEcha = 6;
8702  }
8703  if (n1SCEcha == 19) {
8704  ModifiedSCEcha = 7;
8705  }
8706  if (n1SCEcha == 20) {
8707  ModifiedSCEcha = 8;
8708  }
8709  if (n1SCEcha == 24) {
8710  ModifiedSCEcha = 9;
8711  }
8712  if (n1SCEcha == 25) {
8713  ModifiedSCEcha = 10;
8714  }
8715  }
8716 
8717  //..... (D1,S3), (D3,S7) SC_in_DS = 10, n1DeeSCEcna = 50 -> 224 for construction bottom/right
8718  if (SC_in_DS == 10 && n1DeeSCEcna == 50 && TypQuad == "BR") {
8719  ModifiedSCEcha = n1SCEcha;
8720  }
8721 
8722  //..... (D4,S3), (D2,S7) SC_in_DS = 10, n1DeeSCEcna = 50 -> 75 for construction bottom/left
8723  if (SC_in_DS == 10 && n1DeeSCEcna == 50 && TypQuad == "BL") {
8724  if (n1SCEcha >= 1 && n1SCEcha <= 4) {
8725  ModifiedSCEcha = n1SCEcha;
8726  }
8727  if (n1SCEcha >= 6 && n1SCEcha <= 9) {
8728  ModifiedSCEcha = n1SCEcha - 1;
8729  }
8730  if (n1SCEcha >= 11 && n1SCEcha <= 14) {
8731  ModifiedSCEcha = n1SCEcha - 2;
8732  }
8733  if (n1SCEcha >= 16 && n1SCEcha <= 19) {
8734  ModifiedSCEcha = n1SCEcha - 3;
8735  }
8736  if (n1SCEcha >= 21 && n1SCEcha <= 24) {
8737  ModifiedSCEcha = n1SCEcha - 4;
8738  }
8739  }
8740 
8741  //..... (D1,S4), (D3,S6) SC_in_DS = 14, n1DeeSCEcna = 144 -> 261c for construction bottom/right
8742  if (SC_in_DS == 14 && n1DeeSCEcna == 144 && TypQuad == "BR") {
8743  if (n1SCEcha > 5) {
8744  ModifiedSCEcha = n1SCEcha - 5;
8745  }
8746  }
8747 
8748  //..... (D4,S4), (D2,S6) SC_in_DS = 14, n1DeeSCEcna = 144 -> 112c for construction bottom/left
8749  if (SC_in_DS == 14 && n1DeeSCEcna == 144 && TypQuad == "BL") {
8750  if (n1SCEcha == 4) {
8751  ModifiedSCEcha = 11;
8752  }
8753  if (n1SCEcha == 5) {
8754  ModifiedSCEcha = 12;
8755  }
8756  if (n1SCEcha == 9) {
8757  ModifiedSCEcha = 13;
8758  }
8759  if (n1SCEcha == 10) {
8760  ModifiedSCEcha = 14;
8761  }
8762  if (n1SCEcha == 14) {
8763  ModifiedSCEcha = 15;
8764  }
8765  if (n1SCEcha == 15) {
8766  ModifiedSCEcha = 16;
8767  }
8768  if (n1SCEcha == 19) {
8769  ModifiedSCEcha = 17;
8770  }
8771  if (n1SCEcha == 20) {
8772  ModifiedSCEcha = 18;
8773  }
8774  if (n1SCEcha == 24) {
8775  ModifiedSCEcha = 19;
8776  }
8777  if (n1SCEcha == 25) {
8778  ModifiedSCEcha = 20;
8779  }
8780  }
8781 
8782  //..... (D1,S4), (D3,S6) SC_in_DS = 21, n1DeeSCEcna = 123 -> 268b for construction bottom/right
8783  //..... (D1,S5), (D3,S5) SC_in_DS = 20, n1DeeSCEcna = 21 -> 281a for construction bottom/right
8784  if ((SC_in_DS == 21 && n1DeeSCEcna == 123 && TypQuad == "BR") ||
8785  (SC_in_DS == 20 && n1DeeSCEcna == 41 && TypQuad == "BR")) {
8786  if (n1SCEcha == 4) {
8787  ModifiedSCEcha = 1;
8788  }
8789  if (n1SCEcha == 5) {
8790  ModifiedSCEcha = 2;
8791  }
8792  if (n1SCEcha == 9) {
8793  ModifiedSCEcha = 3;
8794  }
8795  if (n1SCEcha == 10) {
8796  ModifiedSCEcha = 4;
8797  }
8798  if (n1SCEcha == 14) {
8799  ModifiedSCEcha = 5;
8800  }
8801  if (n1SCEcha == 15) {
8802  ModifiedSCEcha = 6;
8803  }
8804  if (n1SCEcha == 19) {
8805  ModifiedSCEcha = 7;
8806  }
8807  if (n1SCEcha == 20) {
8808  ModifiedSCEcha = 8;
8809  }
8810  if (n1SCEcha == 24) {
8811  ModifiedSCEcha = 9;
8812  }
8813  if (n1SCEcha == 25) {
8814  ModifiedSCEcha = 10;
8815  }
8816  }
8817 
8818  //..... (D4,S4), (D2,S6) SC_in_DS = 21, n1DeeSCEcna = 123 -> 119b for construction bottom/left
8819  //..... (D4,S5), (D2,S5) SC_in_DS = 3, n1DeeSCEcna = 41 -> 132a for construction bottom/left
8820  if ((SC_in_DS == 21 && n1DeeSCEcna == 123 && TypQuad == "BL") ||
8821  (SC_in_DS == 3 && n1DeeSCEcna == 41 && TypQuad == "BL")) {
8822  if (n1SCEcha > 15) {
8823  ModifiedSCEcha = n1SCEcha - 15;
8824  }
8825  }
8826 
8827  //..... (D1,S4), (D3,S6) SC_in_DS = 21, n1DeeSCEcna = 102 -> 268c for construction bottom/right
8828  if (SC_in_DS == 21 && n1DeeSCEcna == 102 && TypQuad == "BR") {
8829  if (n1SCEcha == 4) {
8830  ModifiedSCEcha = 11;
8831  }
8832  if (n1SCEcha == 5) {
8833  ModifiedSCEcha = 12;
8834  }
8835  if (n1SCEcha == 9) {
8836  ModifiedSCEcha = 13;
8837  }
8838  if (n1SCEcha == 10) {
8839  ModifiedSCEcha = 14;
8840  }
8841  if (n1SCEcha == 14) {
8842  ModifiedSCEcha = 15;
8843  }
8844  if (n1SCEcha == 15) {
8845  ModifiedSCEcha = 16;
8846  }
8847  if (n1SCEcha == 19) {
8848  ModifiedSCEcha = 17;
8849  }
8850  if (n1SCEcha == 20) {
8851  ModifiedSCEcha = 18;
8852  }
8853  if (n1SCEcha == 24) {
8854  ModifiedSCEcha = 19;
8855  }
8856  if (n1SCEcha == 25) {
8857  ModifiedSCEcha = 20;
8858  }
8859  }
8860 
8861  //..... (D4,S4), (D2,S6) SC_in_DS = 21, n1DeeSCEcna = 102 -> 119c for construction bottom/left
8862  if (SC_in_DS == 21 && n1DeeSCEcna == 102 && TypQuad == "BL") {
8863  if (n1SCEcha == 16) {
8864  ModifiedSCEcha = 11;
8865  }
8866  if (n1SCEcha == 21) {
8867  ModifiedSCEcha = 12;
8868  }
8869  if (n1SCEcha == 17) {
8870  ModifiedSCEcha = 13;
8871  }
8872  if (n1SCEcha == 22) {
8873  ModifiedSCEcha = 14;
8874  }
8875  if (n1SCEcha == 18) {
8876  ModifiedSCEcha = 15;
8877  }
8878  if (n1SCEcha == 23) {
8879  ModifiedSCEcha = 16;
8880  }
8881  if (n1SCEcha == 19) {
8882  ModifiedSCEcha = 17;
8883  }
8884  if (n1SCEcha == 24) {
8885  ModifiedSCEcha = 18;
8886  }
8887  if (n1SCEcha == 20) {
8888  ModifiedSCEcha = 19;
8889  }
8890  if (n1SCEcha == 25) {
8891  ModifiedSCEcha = 20;
8892  }
8893  }
8894 
8895  //..... (D1,S5), (D3,S5) SC_in_DS = 23, n1DeeSCEcna = 8 -> 286 for construction bottom/right
8896  if (SC_in_DS == 23 && n1DeeSCEcna == 8 && TypQuad == "BR") {
8897  if (n1SCEcha >= 1 && n1SCEcha <= 4) {
8898  ModifiedSCEcha = n1SCEcha;
8899  }
8900  if (n1SCEcha >= 6 && n1SCEcha <= 9) {
8901  ModifiedSCEcha = n1SCEcha - 1;
8902  }
8903  if (n1SCEcha >= 11 && n1SCEcha <= 14) {
8904  ModifiedSCEcha = n1SCEcha - 2;
8905  }
8906  if (n1SCEcha >= 16 && n1SCEcha <= 19) {
8907  ModifiedSCEcha = n1SCEcha - 3;
8908  }
8909  if (n1SCEcha >= 21 && n1SCEcha <= 24) {
8910  ModifiedSCEcha = n1SCEcha - 4;
8911  }
8912  }
8913 
8914  //..... (D4,S5), (D2,S5) SC_in_DS = 6, n1DeeSCEcna = 8 -> 137 for construction bottom/left
8915  if (SC_in_DS == 6 && n1DeeSCEcna == 8 && TypQuad == "BL") {
8916  ModifiedSCEcha = n1SCEcha;
8917  }
8918 
8919  //======================= ERROR message if ModifiedSCEcha is not correct
8920  if (ModifiedSCEcha < 1 || ModifiedSCEcha > fEcal->MaxCrysInSC()) {
8921  std::cout << "! *** ERROR *** > ModifiedSCEcha = " << ModifiedSCEcha << ", SC_in_DS = " << SC_in_DS
8922  << ", nSCCons = " << nSCCons << ", n1DeeSCEcna = " << n1DeeSCEcna << ", n1SCEcha = " << n1SCEcha
8923  << ", ModifiedSCEcha = " << ModifiedSCEcha << ", TypQuad = " << TypQuad << fTTBELL << std::endl;
8924  }
8925 
8926  return ModifiedSCEcha;
8927 }
8928 // end of ModifiedSCEchaForNotConnectedSCs(...)
8929 
8930 //======================================================================================
8931 //
8932 // ViewHistime: evolution in time
8933 //
8934 //======================================================================================
8935 
8936 //======================================================================================
8937 //
8938 // ViewHistime: time evolution
8939 //
8940 //======================================================================================
8941 void TEcnaHistos::ViewHistime(const TString& list_of_run_file_name,
8942  const Int_t& StexStin_A,
8943  const Int_t& i0StinEcha,
8944  const TString& HistoCode,
8945  const TString& opt_plot_arg) {
8946  //Histogram of the quantities as a function of time (several runs)
8947 
8948  TString opt_plot = opt_plot_arg;
8949  TString HistoType = fCnaParHistos->GetHistoType(HistoCode);
8950 
8951  if (opt_plot_arg == "ONLYONE") {
8952  opt_plot = fOnlyOnePlot;
8953  }
8954  if (opt_plot_arg == "SEVERAL") {
8955  opt_plot = fSeveralPlot;
8956  }
8957  if (opt_plot_arg == "SAMEONE") {
8958  opt_plot = fSameOnePlot;
8959  }
8960 
8961  Int_t OKHisto = 0;
8962 
8963  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Canvas already closed in option SAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8964  Int_t xCanvasExists = 1; // a priori ==> SAME plot // (ViewHistime)
8965  if (opt_plot != fOnlyOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy") {
8966  TVirtualPad* main_subpad = nullptr;
8967  //---------------- Call to ActivePad
8968  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
8969  if (main_subpad == nullptr) {
8970  std::cout << "*TEcnaHistos::ViewHistime(...)> WARNING ===> Canvas has been closed in option SAME or SAME n."
8971  << std::endl
8972  << " Please, restart with a new canvas." << fTTBELL << std::endl;
8973 
8974  ReInitCanvas(HistoCode, opt_plot);
8975  xCanvasExists = 0;
8976  }
8977  }
8978  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8979 
8980  //%%%%%%%%%%%%%%%%%%%%% Change of X variable in option SAME n with no proj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8981  Int_t SameXVarMemo = 1; // a priori ==> SAME n option: X variable OK (ViewHistime)
8982  if (!(HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj" || HistoType == "EvolProj")) {
8983  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
8984  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
8985 
8986  if ((opt_plot == fSameOnePlot) && GetMemoFlag(HistoCode, opt_plot) == "Free") {
8987  SetXVarMemo(HistoCode, opt_plot, XVarHisto);
8988  SetYVarMemo(HistoCode, opt_plot, YVarHisto);
8989  SameXVarMemo = 1;
8990  }
8991  if ((opt_plot == fSameOnePlot) && GetMemoFlag(HistoCode, opt_plot) == "Busy") {
8992  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
8993  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
8994 
8995  if (XVarHisto != XVariableMemo) {
8996  std::cout << "!TEcnaHistos::ViewHistime(...)> *** ERROR *** ===> X coordinate changed in option SAME n."
8997  << std::endl
8998  << " Present X = " << XVarHisto << std::endl
8999  << " Present Y = " << YVarHisto << std::endl
9000  << " Previous X = " << XVariableMemo << std::endl
9001  << " Previous Y = " << YVariableMemo << fTTBELL << std::endl;
9002  SameXVarMemo = 0;
9003  } else {
9004  SetYVarMemo(HistoCode, opt_plot, YVarHisto);
9005  }
9006  }
9007  }
9008  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9009 
9010  //%%%%%%%%%%%%%%%%%%%%%%% Change of Y variable in option SAME n with proj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9011  Int_t SameYVarMemo = 1; // a priori ==> SAME n option: Y variable OK (ViewHistime)
9012  if (HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj" || HistoType == "EvolProj") {
9013  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
9014  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
9015 
9016  if ((opt_plot == fSameOnePlot) && GetMemoFlag(HistoCode, opt_plot) == "Free") {
9017  SetYVarMemo(HistoCode, opt_plot, YVarHisto);
9018  SetYVarMemo(HistoCode, opt_plot, YVarHisto);
9019  SameYVarMemo = 1;
9020  }
9021  if ((opt_plot == fSameOnePlot) && GetMemoFlag(HistoCode, opt_plot) == "Busy") {
9022  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
9023  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
9024 
9025  if (YVarHisto != YVariableMemo) {
9026  std::cout << "!TEcnaHistos::ViewHistime(...)> *** ERROR *** ===> Y coordinate changed in option SAME n."
9027  << std::endl
9028  << " Present X = " << XVarHisto << std::endl
9029  << " Present Y = " << YVarHisto << std::endl
9030  << " Previous X = " << XVariableMemo << std::endl
9031  << " Previous Y = " << YVariableMemo << fTTBELL << std::endl;
9032  SameYVarMemo = 0;
9033  } else {
9034  SetYVarMemo(HistoCode, opt_plot, YVarHisto);
9035  }
9036  }
9037  }
9038  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9039  if (xCanvasExists == 1 && SameXVarMemo == 1 && SameYVarMemo == 1) {
9040  OKHisto = 1;
9041  }
9042 
9043  //======================== Histime accepted
9044  if (OKHisto == 1) {
9045  // fMyRootFile->PrintNoComment();
9046 
9048 
9049  //................................. Init YMin and YMax of histo // (ViewHistime)
9050  if ((opt_plot == fOnlyOnePlot) || (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
9051  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free")) {
9052  SetYminMemoFromPreviousMemo(HistoCode);
9053  SetYmaxMemoFromPreviousMemo(HistoCode);
9054  }
9055 
9056  //........ GetHistoryRunListParameters(...) : performs the allocation of the array fT1DRunNumber[]
9057  // at first call of the present method ViewHistime
9058  // increments the number of read file (fNbOfListFileEvolXXX) for option SAME
9059  // and read the values fT1DRunNumber[0 to max] from the file list_of_run_file_name
9060  // return the number of runs in the list of the file
9061  //............... Get the run parameters
9062 
9063  Int_t nb_of_runs_in_list = GetHistoryRunListParameters(list_of_run_file_name.Data(), HistoCode);
9064 
9065  if (nb_of_runs_in_list > 0) {
9066  //.............................. prepa x axis: time in hours
9067  //Double_t sec_in_day = (Double_t)86400.; //===> (number of seconds in a day)
9068  Double_t margin_frame_xaxis = (Double_t)25.; //===> margin in x coordinates
9069 
9070  Double_t thstart_evol = (Double_t)0.;
9071  Double_t thstop_evol = (Double_t)0.;
9072 
9073  Int_t* exist_indic = new Int_t[nb_of_runs_in_list];
9074  fCnew++;
9075 
9076  //===================================== FIRST LOOP BEGINNING ===================================
9077  //-------------------------------------------------------------------------------- (ViewHistime)
9078  //
9079  // FIRST LOOP: read the "HistoryRunList" file. Check the existence of the runs
9080  // and determine the number of existing runs.
9081  //
9082  //--------------------------------------------------------------------------------
9083 
9084  fNbOfExistingRuns = (Int_t)0;
9085 
9086  if (fFapStexNumber > 0) {
9087  for (Int_t i_run = 0; i_run < nb_of_runs_in_list; i_run++) {
9088  exist_indic[i_run] = 0;
9089  // ==> set the attribute value relative to the run (fFapRunNumber)
9090  SetRunNumberFromList(i_run, nb_of_runs_in_list);
9091 
9095  fT1DRunNumber[i_run],
9100  fCfgResultsRootFilePath.Data());
9101 
9102  if (fMyRootFile->LookAtRootFile() == kTRUE) // (ViewHistime, 1rst loop)
9103  {
9104  fStatusFileFound = kTRUE;
9105 
9106  //------ At first HistoryRunList file: set fStartEvol... and fStopEvol... quantities
9107  if (GetListFileNumber(HistoCode) == 1) {
9108  if (fNbOfExistingRuns == 0) {
9109  // start time of the first existing run of the list
9112  fStartEvolRun = fT1DRunNumber[i_run];
9113  // start time of the last existing run of the list
9114  // (in case of only one existing run in the list)
9117  fStopEvolRun = fT1DRunNumber[i_run];
9118  } else {
9119  // start time of the last existing run of the list
9122  fStopEvolRun = fT1DRunNumber[i_run];
9123  }
9124  }
9125  //---- set flag of run existence and increase number of existing runs
9126  // (for the first HistoryRunList file)
9127  exist_indic[i_run] = 1;
9129  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
9130  else {
9131  fStatusFileFound = kFALSE;
9132 
9133  std::cout << "!TEcnaHistos::ViewHistime(...)> *ERROR* =====> "
9134  << " ROOT file not found for run " << fT1DRunNumber[i_run] << fTTBELL << std::endl
9135  << std::endl;
9136  }
9137  } // end of for(Int_t i_run = 0; i_run < nb_of_runs_in_list; i_run++)
9138 
9139  //===================================== FIRST LOOP END =========================== (ViewHistime)
9140  if (fNbOfExistingRuns > 0) {
9141  //-------------------- recover the array after removing non existing ROOT files
9142  Int_t i_existing_run = (Int_t)0;
9143 
9144  for (Int_t i_run = 0; i_run < nb_of_runs_in_list; i_run++) {
9145  if (exist_indic[i_run] == 1) {
9146  fT1DRunNumber[i_existing_run] = fT1DRunNumber[i_run];
9147  i_existing_run++;
9148  }
9149  }
9150 
9151  //---------------------- Get start and stop time values to set the axis limits (ViewHistime)
9152 
9153  thstart_evol = (Double_t)fStartEvolTime;
9154  thstop_evol = (Double_t)fStopEvolTime;
9155 
9156  Double_t xinf_lim = thstart_evol - (thstop_evol - thstart_evol) / margin_frame_xaxis;
9157  Double_t xsup_lim = thstop_evol + (thstop_evol - thstart_evol) / margin_frame_xaxis;
9158 
9159  Axis_t xinf_his = (Axis_t)(xinf_lim);
9160  Axis_t xsup_his = (Axis_t)(xsup_lim);
9161 
9162  //............................. i0StexEcha, i0Sample
9163  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha);
9164  Int_t i0Sample = 0;
9165 
9166  Double_t* time_coordx = new Double_t[fNbOfExistingRuns];
9167  fCnew++;
9168  Double_t* hval_coordy = new Double_t[fNbOfExistingRuns];
9169  fCnew++;
9170 
9171  //........... Set values to -1
9172 
9173  for (Int_t i_run = 0; i_run < fNbOfExistingRuns; i_run++) {
9174  time_coordx[i_run] = (Double_t)(-1);
9175  hval_coordy[i_run] = (Double_t)(-1);
9176  }
9177 
9178  //========================== SECOND LOOP BEGINNING =====================================
9179  //----------------------------------------------------------------------- (ViewHistime)
9180  //
9181  // SECOND LOOP OVER THE EXISTING RUNS : FILL THE GRAPH COORDINATES
9182  //
9183  //-----------------------------------------------------------------------
9184  for (Int_t i_run = 0; i_run < fNbOfExistingRuns; i_run++) {
9185  // => set the attribute value relative to the run (fFapRunNumber)
9187 
9191  fT1DRunNumber[i_run],
9196  fCfgResultsRootFilePath.Data());
9197 
9198  if (fMyRootFile->LookAtRootFile() == kTRUE) // (ViewHistime, 2nd loop)
9199  {
9200  fStatusFileFound = kTRUE;
9201 
9202  Bool_t ok_view_histo = GetOkViewHisto(fMyRootFile, StexStin_A, i0StinEcha, i0Sample, HistoCode);
9203 
9204  //............... F I L L G R A P H C O O R D I N A T E S (ViewHistime)
9205  if (ok_view_histo == kTRUE) {
9206  //................................................. x coordinate
9207  time_t xStartTime = fMyRootFile->GetStartTime();
9208  Double_t thstart = (Double_t)xStartTime;
9209  time_coordx[i_run] = (Double_t)(thstart - xinf_lim);
9210  //................................................. y coordinate
9211  TVectorD read_histo(fEcal->MaxCrysEcnaInStex());
9212  for (Int_t i = 0; i < fEcal->MaxCrysEcnaInStex(); i++) {
9213  read_histo(i) = (Double_t)0.;
9214  }
9215 
9216  if (HistoCode == "H_Ped_Date" || HistoCode == "H_Ped_RuDs") {
9218  }
9219  if (HistoCode == "H_TNo_Date" || HistoCode == "H_TNo_RuDs") {
9221  }
9222  if (HistoCode == "H_MCs_Date" || HistoCode == "H_MCs_RuDs") {
9224  }
9225 
9226  if (HistoCode == "H_LFN_Date" || HistoCode == "H_LFN_RuDs") {
9228  }
9229  if (HistoCode == "H_HFN_Date" || HistoCode == "H_HFN_RuDs") {
9231  }
9232  if (HistoCode == "H_SCs_Date" || HistoCode == "H_SCs_RuDs") {
9234  }
9235  hval_coordy[i_run] = (Double_t)read_histo(i0StexEcha);
9236  } else {
9237  std::cout << "!TEcnaHistos::ViewHistime(...)> Histo not available. " << fTTBELL << std::endl;
9238  }
9239  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
9240  else {
9241  fStatusFileFound = kFALSE;
9242  }
9243  }
9244  //========================== END OF SECOND LOOP ===========================================
9245 
9246  //.................................................................... SCALE x and y
9247  Int_t opt_scale_x = fOptScaleLinx;
9248  if (fFlagScaleX == "LIN") {
9249  opt_scale_x = fOptScaleLinx;
9250  }
9251  if (fFlagScaleX == "LOG") {
9252  opt_scale_x = fOptScaleLogx;
9253  }
9254 
9255  Int_t opt_scale_y = fOptScaleLiny;
9256  if (fFlagScaleY == "LIN") {
9257  opt_scale_y = fOptScaleLiny;
9258  }
9259  if (fFlagScaleY == "LOG") {
9260  opt_scale_y = fOptScaleLogy;
9261  }
9262 
9263  //------------------------------------------------- G R A P H (ViewHistime)
9264  TGraph* g_graph0 = new TGraph(fNbOfExistingRuns, time_coordx, hval_coordy);
9265  fCnewRoot++;
9266  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
9267  g_graph0->SetTitle(fCnaParHistos->GetQuantityName(HistoCode));
9268  }
9269  if (opt_plot == fSameOnePlot) {
9270  g_graph0->SetTitle(";");
9271  }
9272 
9273  //... Ymin and ymax default values will be taken if fFlagUserHistoMin/Max = "OFF"
9274  // (and if "Free" for "SAME" and "SAME n" options)
9275  if ((opt_plot == fOnlyOnePlot) || (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
9276  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free")) {
9277  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
9278  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
9279  }
9280 
9281  //................................ Put min max values (ViewHistime)
9282  //.......... default if flag not set to "ON"
9283  //SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
9284  //SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
9285 
9286  g_graph0->Set(fNbOfExistingRuns);
9287  Double_t graph_ymin = GetYminFromGraphFrameAndMarginValue(g_graph0, fCnaParHistos->GetMarginAutoMinMax());
9288  Double_t graph_ymax = GetYmaxFromGraphFrameAndMarginValue(g_graph0, fCnaParHistos->GetMarginAutoMinMax());
9289 
9290  //---------------------------------- G R A P H P L O T ---------------------------- (ViewHistime)
9291  if (HistoType == "Evol") {
9292  //----------------- G R A P H Y M I N / Y M A X M A N A G E M E N T
9293  if ((opt_plot == fOnlyOnePlot) ||
9294  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
9295  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free")) {
9296  if (opt_plot == fSameOnePlot) {
9297  fHistoCodeFirst = HistoCode;
9298  } // registration of first HistoCode
9299 
9300  if (fUserHistoMin >= fUserHistoMax) {
9301  fFlagUserHistoMin = "AUTO";
9302  fFlagUserHistoMax = "AUTO";
9303  }
9304  //.......... user's value if flag set to "ON"
9305  if (fFlagUserHistoMin == "ON") {
9306  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
9307  fFlagUserHistoMin = "OFF";
9308  }
9309  if (fFlagUserHistoMax == "ON") {
9310  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
9311  fFlagUserHistoMax = "OFF";
9312  }
9313  //................................. automatic min and/or max
9314  if (fFlagUserHistoMin == "AUTO") {
9315  SetYminMemoFromValue(HistoCode.Data(), graph_ymin);
9316  fFlagUserHistoMin = "OFF";
9317  }
9318  if (fFlagUserHistoMax == "AUTO") {
9319  SetYmaxMemoFromValue(HistoCode.Data(), graph_ymax);
9320  fFlagUserHistoMax = "OFF";
9321  }
9322 
9323  //................................. Init Ymin and Ymax for graph
9324  SetYminMemoFromPreviousMemo(HistoCode);
9325  SetYmaxMemoFromPreviousMemo(HistoCode);
9326  }
9327  //--- Set ymin and ymax to the first HistoCode values for option SAME n
9328  if (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy") {
9329  Double_t ymin = GetYminValueFromMemo(fHistoCodeFirst.Data());
9330  SetYminMemoFromValue(HistoCode.Data(), ymin);
9331 
9332  Double_t ymax = GetYmaxValueFromMemo(fHistoCodeFirst.Data());
9333  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
9334  }
9335 
9336  //..... graph set ymin and ymax and consequently margin at top of the plot
9337  Int_t xFlagAutoYsupMargin = SetGraphFrameYminYmaxFromMemo(g_graph0, HistoCode);
9338 
9339  HistimePlot(g_graph0,
9340  xinf_his,
9341  xsup_his,
9342  HistoCode.Data(),
9343  HistoType.Data(),
9344  StexStin_A,
9345  i0StinEcha,
9346  i0Sample,
9347  opt_scale_x,
9348  opt_scale_y,
9349  opt_plot,
9350  xFlagAutoYsupMargin);
9351  // g_graph0->Delete(); fCdeleteRoot++; // *===> NE PAS DELETER LE GRAPH SINON CA EFFACE TOUT!
9352 
9353  //--- Recover ymin and ymax from user's values in option SAME n
9354  if (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy") {
9355  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
9356  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
9357  }
9358  }
9359 
9360  //---------- H I S T O Y P R O J E C T I O N P L O T ---------------------- (ViewHistime)
9361 
9362  //====== G R A P H P R O J X I N F / X S U P M A N A G E M E N T ======= (ViewHistime)
9363  //
9364  // must be done before booking because of the x <-> y permutation in case of "Proj"
9365  //
9366  //-----------------------------------------------------------------------------------------
9367  //
9368  // CASE: HistoType == "Proj" OR HistoType == "SampProj"
9369  //
9370  // Xinf and Xsup must be calculated from ymin and ymax
9371  // of the direct graph
9372  //
9373  //-----------------------------------------------------------------------------------------
9374 
9375  if (HistoType == "EvolProj") {
9376  Int_t HisSizeEvolProj = fNbBinsProj;
9377  TVectorD histo_for_plot(HisSizeEvolProj);
9378  for (Int_t i = 0; i < HisSizeEvolProj; i++) {
9379  histo_for_plot[i] = (Double_t)0.;
9380  }
9381 
9382  //graph_ymin = GetYminValueFromMemo(HistoCode.Data());
9383  //graph_ymax = GetYmaxValueFromMemo(HistoCode.Data());
9384 
9385  TString HistoCodi = HistoCode; // HistoCodi = direct histo
9386 
9387  if (HistoCode == "H_Ped_RuDs") {
9388  HistoCodi = "H_Ped_Date";
9389  }
9390  if (HistoCode == "H_TNo_RuDs") {
9391  HistoCodi = "H_TNo_Date";
9392  }
9393  if (HistoCode == "H_LFN_RuDs") {
9394  HistoCodi = "H_LFN_Date";
9395  }
9396  if (HistoCode == "H_HFN_RuDs") {
9397  HistoCodi = "H_HFN_Date";
9398  }
9399  if (HistoCode == "H_MCs_RuDs") {
9400  HistoCodi = "H_MCs_Date";
9401  }
9402  if (HistoCode == "H_SCs_RuDs") {
9403  HistoCodi = "H_SCs_Date";
9404  }
9405 
9406  if (fUserHistoMin >= fUserHistoMax) {
9407  fFlagUserHistoMin = "AUTO";
9408  fFlagUserHistoMax = "AUTO";
9409  }
9410 
9411  //--------------------------------------------------------------------------- (ViewHistime)
9412  //
9413  // fOnlyOnePlot => compute Xinf and Xsup at each time
9414  // fSeveralPlot => compute Xinf and Xsup once when flag = "Free" for each HistoCode
9415  // fSameOnePlot => compute Xinf and Xsup once
9416  //
9417  //--------------------------------------------------------------------------------------
9418  if ((opt_plot == fOnlyOnePlot) ||
9419  ((opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, fSeveralPlot) == "Free") ||
9420  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, fSameOnePlot) == "Free"))) {
9421  Double_t XinfProj = (Double_t)0;
9422  Double_t XsupProj = (Double_t)0;
9423 
9424  //...................................................................... (ViewHistime)
9425  if (fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO") {
9426  //... Get direct graph ymin and/or ymax and keep them as xinf and xsup
9427  // in memo for the plotted histo
9428  XinfProj = fUserHistoMin;
9429  XsupProj = fUserHistoMax;
9430  if (fFlagUserHistoMin == "AUTO") {
9431  XinfProj = GetYminValueFromMemo(HistoCodi.Data());
9432  }
9433  if (fFlagUserHistoMax == "AUTO") {
9434  XsupProj = GetYmaxValueFromMemo(HistoCodi.Data());
9435  }
9436  } // end of if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
9437  else {
9438  if (fFlagUserHistoMin == "OFF") {
9439  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
9440  XinfProj = GetYminValueFromMemo(HistoCode.Data());
9441  }
9442 
9443  if (fFlagUserHistoMax == "OFF") {
9444  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
9445  XsupProj = GetYmaxValueFromMemo(HistoCode.Data());
9446  }
9447  if (fFlagUserHistoMin == "ON") {
9448  XinfProj = fUserHistoMin;
9449  }
9450  if (fFlagUserHistoMax == "ON") {
9451  XsupProj = fUserHistoMax;
9452  }
9453  }
9454 
9455  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
9456  SetXinfMemoFromValue(HistoCode.Data(), XinfProj);
9457  SetXsupMemoFromValue(HistoCode.Data(), XsupProj);
9458  } else {
9459  SetXinfMemoFromValue(XinfProj);
9460  SetXsupMemoFromValue(XsupProj);
9461  }
9462  } // end of if( (opt_plot == fOnlyOnePlot) ||
9463  // (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
9464  // (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
9465 
9466  Double_t cXinf = (Double_t)0.;
9467  Double_t cXsup = (Double_t)0.;
9468 
9469  //.......... Set Xinf and Xsup at each time because of simultaneous SAME options (ViewHistime)
9470  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
9471  cXinf = GetXinfValueFromMemo(HistoCode.Data());
9472  cXsup = GetXsupValueFromMemo(HistoCode.Data());
9473  } else {
9474  cXinf = GetXinfValueFromMemo();
9475  cXsup = GetXsupValueFromMemo();
9476  }
9477  //....... In case of only one run: in order to have cXinf < cXsup for "EvolProj" plot
9478  if (cXinf >= cXsup) {
9479  cXinf -= 1.;
9480  cXsup += 1.;
9481  }
9482 
9483  //.............................. histogram booking (ViewHisto)
9484  Axis_t xinf_his = cXinf; // ancillary variables since no const in arguments of TH1D
9485  Axis_t xsup_his = cXsup;
9486 
9487  TString TitleHisto = ";";
9488  if (opt_plot != fSameOnePlot) {
9489  TitleHisto = fCnaParHistos->GetQuantityName(HistoCode.Data());
9490  }
9491 
9492  //........ fill array histo_for_plot from hval_coordy (ViewHistime)
9493  for (Int_t i_run = 0; i_run < fNbOfExistingRuns; i_run++) {
9494  Double_t XFromYGraph = hval_coordy[i_run];
9495  Double_t binXProjY = (Double_t)HisSizeEvolProj * (XFromYGraph - cXinf) / (cXsup - cXinf);
9496  Int_t ibinXProjY = (Int_t)binXProjY;
9497  if (ibinXProjY >= 0 && ibinXProjY < HisSizeEvolProj) {
9498  histo_for_plot[ibinXProjY]++;
9499  }
9500  }
9501 
9502  TH1D* h_his_evol_proj = new TH1D("histevolproj", TitleHisto.Data(), HisSizeEvolProj, xinf_his, xsup_his);
9503  fCnewRoot++;
9504 
9505  h_his_evol_proj->Reset();
9506 
9507  //.... direct histogram filling (ViewHistime)
9508  for (Int_t i = 0; i < HisSizeEvolProj; i++) {
9509  Double_t yi = (Double_t)i / (Double_t)HisSizeEvolProj * (cXsup - cXinf) + cXinf;
9510  Double_t his_val = (Double_t)histo_for_plot[i];
9511  h_his_evol_proj->Fill(yi, his_val);
9512  }
9513 
9514  //------- H I S T O P R O J Y M I N / Y M A X M A N A G E M E N T
9515  if (fUserHistoMin >= fUserHistoMax) {
9516  fFlagUserHistoMin = "AUTO";
9517  fFlagUserHistoMax = "AUTO";
9518  }
9519  //.......... user's value if flag set to "ON"
9520  if (fFlagUserHistoMin == "ON") {
9521  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
9522  fFlagUserHistoMin = "OFF";
9523  }
9524  if (fFlagUserHistoMax == "ON") {
9525  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
9526  fFlagUserHistoMax = "OFF";
9527  }
9528  //................................. automatic min and/or max
9529  if (fFlagUserHistoMin == "AUTO") {
9530  SetYminMemoFromValue(HistoCode.Data(), graph_ymin);
9531  fFlagUserHistoMin = "OFF";
9532  }
9533  if (fFlagUserHistoMax == "AUTO") {
9534  SetYmaxMemoFromValue(HistoCode.Data(), graph_ymax);
9535  fFlagUserHistoMax = "OFF";
9536  }
9537 
9538  //................................. Init Ymin and Ymax for graph
9539  SetYminMemoFromPreviousMemo(HistoCode);
9540  SetYmaxMemoFromPreviousMemo(HistoCode);
9541 
9542  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9543  //.......... Find maximum in case of Proj (LIN scale only) // PS: EvolProj => in ViewHistime
9544  if (fFlagScaleY == "LIN") {
9546  HistoCode.Data(),
9548  }
9549 
9550  //--- Set ymin and ymax to the first HistoCode values for option SAME n
9551  if (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy") {
9552  Double_t ymin = GetYminValueFromMemo(fHistoCodeFirst.Data());
9553  SetYminMemoFromValue(HistoCode.Data(), ymin);
9554 
9555  Double_t ymax = GetYmaxValueFromMemo(fHistoCodeFirst.Data());
9556  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
9557  }
9558  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9559 
9560  //..... graph set ymin and ymax and consequently margin at top of the plot
9561  Int_t xFlagAutoYsupMargin = SetGraphFrameYminYmaxFromMemo(g_graph0, HistoCode);
9562  Int_t arg_AlreadyRead = 0;
9563 
9564  HistoPlot(h_his_evol_proj,
9565  HisSizeEvolProj,
9566  xinf_his,
9567  xsup_his,
9568  HistoCode.Data(),
9569  HistoType.Data(),
9570  StexStin_A,
9571  i0StinEcha,
9572  i0Sample,
9573  opt_scale_x,
9574  opt_scale_y,
9575  opt_plot,
9576  arg_AlreadyRead,
9577  xFlagAutoYsupMargin);
9578 
9579  h_his_evol_proj->Delete();
9580  h_his_evol_proj = nullptr;
9581  fCdeleteRoot++;
9582  //*===> deleter l'histo sinon "Replacing existing histo (potential memory leak)" a l'execution
9583 
9584  } // end of if( HistoType == "EvolProj" )
9585  //---------------------------------------------------------------------------------- (ViewHistime)
9586 
9587  delete[] time_coordx;
9588  time_coordx = nullptr;
9589  fCdelete++;
9590  delete[] hval_coordy;
9591  hval_coordy = nullptr;
9592  fCdelete++;
9593  } else {
9594  std::cout << "!TEcnaHistos::ViewHistime(...)> The list of runs in file: " << list_of_run_file_name << " has "
9595  << nb_of_runs_in_list << " run numbers" << std::endl
9596  << " but none of them correspond to an existing ROOT file." << fTTBELL << std::endl;
9597  }
9598  } // end of if( fFapStexNumber > 0 )
9599  else {
9600  std::cout << "!TEcnaHistos::ViewHistime(...)> *ERROR* =====> " << fFapStexName << " number = " << fFapStexNumber
9601  << ". " << fFapStexName << " number must be in range [1," << fEcal->MaxStexInStas() << "] ";
9602  if (fFlagSubDet == "EB") {
9603  std::cout << " (or [-18,+18])";
9604  }
9605  std::cout << fTTBELL << std::endl;
9606  }
9607  delete[] exist_indic;
9608  exist_indic = nullptr;
9609  fCdelete++;
9610  } // end of if( nb_of_runs_in_list > 0 )
9611  else {
9612  if (nb_of_runs_in_list == 0) {
9613  std::cout << "!TEcnaHistos::ViewHistime(...)> The list of runs in file: " << list_of_run_file_name
9614  << " is empty !" << fTTBELL << std::endl;
9615  }
9616  if (nb_of_runs_in_list < 0) {
9617  std::cout << "!TEcnaHistos::ViewHistime(...)> " << list_of_run_file_name
9618  << ": file not found in directory: " << fCfgHistoryRunListFilePath.Data() << fTTBELL << std::endl;
9619  }
9620  }
9621  } // end of if( OKHisto == 1 )
9622 } // end of ViewHistime
9623 
9624 //------------------------------------------------------------------------------------
9625 //
9626 // GetHistoryRunListParameters(...), AllocArraysForEvol(), GetListFileNumber(...)
9627 //
9628 //------------------------------------------------------------------------------------
9629 
9630 Int_t TEcnaHistos::GetHistoryRunListParameters(const TString& list_of_run_file_name, const TString& HistoCode) {
9631  // Build the array of run numbers from the list-of-runs .ascii file.
9632  // Return the list size
9633  // *=====> list_of_run_file_name is the name of the ASCII file containing the list of the runs
9634  //
9635  // SYNTAX OF THE FILE:
9636  //
9637  // HistoryRunList_EB_SM6_Analysis_1.ascii <- 1rst line: comment (file name for example)
9638  // 73677 <- 2nd line and others: run numbers (empty lines accepted)
9639  // 73688
9640  // 73689
9641  //
9642  // 73690
9643  // 73692
9644  //
9645  // In option SAME (of TEcnaHistos), several lists of runs can be called and these lists can have
9646  // DIFFERENT sizes (here the "size" is the number of runs of the list). In addition,
9647  // some runs in some lists may not exist in reality. So, we must adopt a convention which is
9648  // the following: the number of runs corresponds to the number of EXISTING runs
9649  // of the FIRST read list. Let be N1 this number.
9650  // If another list has more runs than N1 runs, we read only the first N1 runs.
9651  // If another list has less runs than N1 runs, we read all the runs of this list.
9652  //
9653  //--------------------------------------------------------------------------------------------------
9654 
9655  Int_t nb_of_runs_in_list = 0;
9656 
9657  //========= immediate return if file name is an empty string
9658  if (!strcmp(list_of_run_file_name.Data(), "\0")) {
9659  std::cout << "!TEcnaHistos::GetHistoryRunListParameters(...)> *** ERROR *** =====> "
9660  << " EMPTY STRING for list of run file name." << fTTBELL << std::endl;
9661  } else {
9662  // ===> increase the HistoryRunList file number
9663  if (HistoCode == "H_Ped_Date") {
9665  }
9666  if (HistoCode == "H_TNo_Date") {
9668  }
9669  if (HistoCode == "H_MCs_Date") {
9671  }
9672  if (HistoCode == "H_LFN_Date") {
9674  }
9675  if (HistoCode == "H_HFN_Date") {
9677  }
9678  if (HistoCode == "H_SCs_Date") {
9680  }
9681 
9682  if (HistoCode == "H_Ped_RuDs") {
9684  }
9685  if (HistoCode == "H_TNo_RuDs") {
9687  }
9688  if (HistoCode == "H_MCs_RuDs") {
9690  }
9691  if (HistoCode == "H_LFN_RuDs") {
9693  }
9694  if (HistoCode == "H_HFN_RuDs") {
9696  }
9697  if (HistoCode == "H_SCs_RuDs") {
9699  }
9700 
9701  fFapFileRuns = list_of_run_file_name.Data(); // (short name)
9702 
9703  //........... Add the path to the file name ( GetHistoryRunListParameters )
9704  TString xFileNameRunList = list_of_run_file_name.Data();
9705  const Text_t* t_file_name = (const Text_t*)xFileNameRunList.Data();
9706 
9707  //.............. replace the string "$HOME" by the true $HOME path
9708  if (fCfgHistoryRunListFilePath.BeginsWith("$HOME")) {
9709  fCfgHistoryRunListFilePath.Remove(0, 5);
9710  const Text_t* t_file_nohome = (const Text_t*)fCfgHistoryRunListFilePath.Data(); // /scratch0/cna/...
9711 
9712  TString home_path = gSystem->Getenv("HOME");
9713  fCfgHistoryRunListFilePath = home_path; // /afs/cern.ch/u/USER
9714  fCfgHistoryRunListFilePath.Append(t_file_nohome); // /afs/cern.ch/u/USER/scratch0/cna/...
9715  }
9716 
9717  xFileNameRunList = fCfgHistoryRunListFilePath.Data();
9718 
9719  xFileNameRunList.Append('/');
9720  xFileNameRunList.Append(t_file_name);
9721 
9722  fFcin_f.open(xFileNameRunList.Data());
9723 
9724  //....................................... ( GetHistoryRunListParameters )
9725  if (fFcin_f.fail() == kFALSE) {
9726  //...................................... first reading to get the number of runs in the list
9727  fFcin_f.clear();
9728  std::string xHeadComment;
9729  fFcin_f >> xHeadComment;
9730  Int_t cRunNumber;
9731  Int_t list_size_read = 0;
9732 
9733  while (!fFcin_f.eof()) {
9734  fFcin_f >> cRunNumber;
9735  list_size_read++;
9736  }
9737  fFapNbOfRuns = list_size_read - 1;
9738 
9739  //...................................... second reading to get the run numbers
9740 
9741  //====== Return to the beginning of the file =====
9742  fFcin_f.clear();
9743  fFcin_f.seekg(0, std::ios::beg);
9744  //================================================
9745 
9746  std::string yHeadComment;
9747  fFcin_f >> yHeadComment;
9748 
9749  //....................... Set fFapMaxNbOfRuns to -1 at first call (first read file)
9750  //
9751  // fNbOfListFileEvolXXX is initialized to 0 in Init()
9752  // It is incremented once here above
9753  // So, at first call fNbOfListFileEvolXXX = 1
9754  // then fFapMaxNbOfRuns = -1
9755  //.......................................................................... (GetHistoryRunListParameters)
9756  if ((HistoCode == "H_Ped_Date" && fNbOfListFileH_Ped_Date == 1) ||
9757  (HistoCode == "H_TNo_Date" && fNbOfListFileH_TNo_Date == 1) ||
9758  (HistoCode == "H_MCs_Date" && fNbOfListFileH_MCs_Date == 1) ||
9759  (HistoCode == "H_LFN_Date" && fNbOfListFileH_LFN_Date == 1) ||
9760  (HistoCode == "H_HFN_Date" && fNbOfListFileH_HFN_Date == 1) ||
9761  (HistoCode == "H_SCs_Date" && fNbOfListFileH_SCs_Date == 1) ||
9762  (HistoCode == "H_Ped_RuDs" && fNbOfListFileH_Ped_RuDs == 1) ||
9763  (HistoCode == "H_TNo_RuDs" && fNbOfListFileH_TNo_RuDs == 1) ||
9764  (HistoCode == "H_MCs_RuDs" && fNbOfListFileH_MCs_RuDs == 1) ||
9765  (HistoCode == "H_LFN_RuDs" && fNbOfListFileH_LFN_RuDs == 1) ||
9766  (HistoCode == "H_HFN_RuDs" && fNbOfListFileH_HFN_RuDs == 1) ||
9767  (HistoCode == "H_SCs_RuDs" && fNbOfListFileH_SCs_RuDs == 1)) {
9768  fFapMaxNbOfRuns = -1;
9769  }
9770 
9771  // first call: fFapMaxNbOfRuns = fFapNbOfRuns = nb of run from the first reading
9772  if (fFapMaxNbOfRuns == -1) {
9774  }
9775  // next calls: fFapNbOfRuns must not be greater than fFapMaxNbOfRuns found at first time
9776  else {
9777  if (fFapNbOfRuns > fFapMaxNbOfRuns) {
9779  }
9780  }
9781 
9782  // Allocation and initialization of the array fT1DRunNumber[].
9783  //................. check maximum value for allocation
9785  std::cout << "TEcnaHistos::GetHistoryRunListParameters(...)> Max number of runs in HistoryRunList = "
9786  << fFapMaxNbOfRuns << " too large, forced to parameter TEcnaParHistos->fMaxNbOfRunsInLists value (= "
9787  << fCnaParHistos->MaxNbOfRunsInLists() << "). Please, set this parameter to a larger value than "
9788  << fFapMaxNbOfRuns << fTTBELL << std::endl;
9790  }
9791  //................................. Alloc of the array and init
9792  if (fT1DRunNumber == nullptr) {
9793  if (fFapMaxNbOfRuns > 0) {
9794  fT1DRunNumber = new Int_t[fFapMaxNbOfRuns];
9795  fCnew++;
9796  } else {
9797  std::cout << "!TEcnaHistos::GetHistoryRunListParameters(...)> *** ERROR *** =====> fFapMaxNbOfRuns = "
9798  << fFapMaxNbOfRuns << ". Forced to 1." << fTTBELL << std::endl;
9799  fFapMaxNbOfRuns = 1;
9800  fT1DRunNumber = new Int_t[fFapMaxNbOfRuns];
9801  fCnew++;
9802  }
9803  }
9804 
9805  //.................................... Init the list of runs
9806  for (Int_t i_run = 0; i_run < fFapMaxNbOfRuns; i_run++) {
9807  fT1DRunNumber[i_run] = -1;
9808  }
9809  //.................................... read the list of runs
9810  for (Int_t i_list = 0; i_list < fFapNbOfRuns; i_list++) {
9811  fFcin_f >> cRunNumber;
9812  fT1DRunNumber[i_list] = cRunNumber;
9813  }
9814  //........................................ ( GetHistoryRunListParameters )
9815  nb_of_runs_in_list = fFapNbOfRuns;
9816  fFcin_f.close();
9817  } else {
9818  fFcin_f.clear();
9819  std::cout << "!TEcnaHistos::GetHistoryRunListParameters(...)> *** ERROR *** =====> " << xFileNameRunList.Data()
9820  << " : file not found." << fTTBELL << std::endl;
9821  nb_of_runs_in_list = -1;
9822  }
9823  }
9824  return nb_of_runs_in_list;
9825 }
9826 // end of GetHistoryRunListParameters(...)
9827 
9828 //------------------------------------------------------------------------------------------------
9829 
9830 Int_t TEcnaHistos::GetListFileNumber(const TString& HistoCode) {
9831  // Get the number of the read list file
9832 
9833  Int_t number = 0;
9834 
9835  if (HistoCode == "H_Ped_Date") {
9837  }
9838  if (HistoCode == "H_TNo_Date") {
9840  }
9841  if (HistoCode == "H_MCs_Date") {
9843  }
9844  if (HistoCode == "H_LFN_Date") {
9846  }
9847  if (HistoCode == "H_HFN_Date") {
9849  }
9850  if (HistoCode == "H_SCs_Date") {
9852  }
9853  if (HistoCode == "H_Ped_RuDs") {
9855  }
9856  if (HistoCode == "H_TNo_RuDs") {
9858  }
9859  if (HistoCode == "H_MCs_RuDs") {
9861  }
9862  if (HistoCode == "H_LFN_RuDs") {
9864  }
9865  if (HistoCode == "H_HFN_RuDs") {
9867  }
9868  if (HistoCode == "H_SCs_RuDs") {
9870  }
9871  return number;
9872 }
9873 
9874 //--------------------------------------------------------------------------------------------------
9875 void TEcnaHistos::SetRunNumberFromList(const Int_t& xArgIndexRun, const Int_t& MaxNbOfRuns) {
9876  // Set run number for the xArgIndexRun_th run in the list of runs (evolution plots)
9877  // The array fT1DRunNumber[] have been obtained from a previous call
9878  // to GetHistoryRunListParameters(xFileNameRunList, HistoCode)
9879 
9880  if (xArgIndexRun >= 0 && xArgIndexRun < MaxNbOfRuns) {
9881  fFapRunNumber = fT1DRunNumber[xArgIndexRun];
9882  if (xArgIndexRun == 0) {
9884  } // SpecPar = Special Parameters (dates, times, run types)
9885  } else {
9886  std::cout << "!TEcnaHistos::SetRunNumberFromList(...)> **** ERROR **** Run index out of range in list of runs. "
9887  "xArgIndexRun = "
9888  << xArgIndexRun << " (MaxNbOfRuns = " << MaxNbOfRuns << ")" << std::endl;
9889  }
9890 }
9891 
9892 //--------------------------------------------------------------------------------------------------
9894  // Init parameters that will be set by reading the info which are in the results ROOT file
9895  // SpecPar = Special Parameters (dates, times, run types)
9896 
9897  fStartDate.Resize(charArrLen);
9898  fStartDate = "(date not found)";
9899 
9900  fStopDate.Resize(charArrLen);
9901  fStopDate = "(date not found)";
9902 
9903  fStartTime = (time_t)0;
9904  fStopTime = (time_t)0;
9905 
9906  fRunType = "(run type not found)";
9907 
9908 } // ------------- ( end of InitSpecParBeforeFileReading() ) -------------
9909 
9910 //======================================================================================
9911 //
9912 // C O M M E N T S / I N F O S P A V E S M E T H O D S
9913 //
9914 //======================================================================================
9915 
9917  const Int_t& StexStin_A,
9918  const Int_t& i0StinEcha,
9919  const Int_t& i0Sample,
9920  const TString& HistoCode) {
9921  // Check possibility to plot the histo
9922 
9923  Bool_t ok_view_histo = kFALSE;
9924 
9925  TString HistoType = fCnaParHistos->GetHistoType(HistoCode);
9926 
9927  TString root_file_name = aMyRootFile->GetRootFileNameShort();
9928 
9929  TVectorD vStin(fEcal->MaxStinEcnaInStex());
9930  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
9931  vStin(i) = (Double_t)0.;
9932  }
9933  vStin = aMyRootFile->ReadStinNumbers(fEcal->MaxStinEcnaInStex());
9934 
9935  if (aMyRootFile->DataExist() == kTRUE) {
9936  fStatusDataExist = kTRUE;
9937 
9938  Int_t Stin_ok = 0;
9939  for (Int_t index_Stin = 0; index_Stin < fEcal->MaxStinEcnaInStex(); index_Stin++) {
9940  if (vStin(index_Stin) == StexStin_A) {
9941  Stin_ok++;
9942  };
9943  }
9944 
9945  //.............................................. ok_view
9946  Int_t ok_view = 1;
9947 
9948  if (!(HistoType == "Global" || HistoType == "Proj")) {
9949  if (Stin_ok != 1) {
9950  Int_t StinNumber = StexStin_A;
9951  if (fFlagSubDet == "EE") {
9952  StinNumber = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A);
9953  }
9954  std::cout << "!TEcnaHistos::GetOkViewHisto(...)> *ERROR* =====> "
9955  << "File: " << root_file_name << ", " << fFapStinName.Data() << " " << StinNumber
9956  << " not found. Available numbers = ";
9957  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++) {
9958  if (vStin(i) > 0) {
9959  if (fFlagSubDet == "EB") {
9960  std::cout << vStin(i) << ", ";
9961  }
9962  if (fFlagSubDet == "EE") {
9964  }
9965  }
9966  }
9967  std::cout << fTTBELL << std::endl;
9968  ok_view = -1;
9969  } else {
9970  ok_view = 1;
9971  }
9972  }
9973 
9974  //.............................................. ok_max_elt ( GetOkViewHisto(...) )
9975  Int_t ok_max_elt = 1;
9976 
9977  if ((((HistoType == "H1Basic") || (HistoType == "Evol") || (HistoType == "EvolProj")) && (i0StinEcha >= 0) &&
9978  (i0StinEcha < fEcal->MaxCrysInStin()) && (i0Sample >= 0) && (i0Sample < fFapNbOfSamples)) ||
9979  !((HistoType == "H1Basic") || (HistoType == "Evol") || (HistoType == "EvolProj"))) {
9980  ok_max_elt = 1;
9981  } else {
9982  Int_t Choffset = 0;
9983  if (fFlagSubDet == "EE") {
9984  Choffset = 1;
9985  }
9986  if (((HistoType == "H1Basic") || (HistoType == "Evol") || (HistoType == "EvolProj")) &&
9987  !((i0StinEcha >= 0) && (i0StinEcha < fEcal->MaxCrysInStin()))) {
9988  std::cout << "!TEcnaHistos::GetOkViewHisto(...)> *ERROR* =====> "
9989  << "File: " << root_file_name << ". Wrong channel number. Value = " << i0StinEcha
9990  << " (required range: [" << Choffset << ", " << fEcal->MaxCrysInStin() - 1 + Choffset << "] )"
9991  << fTTBELL << std::endl;
9992  }
9993  if ((HistoCode == "D_Adc_EvDs" || HistoCode == "D_Adc_EvNb") &&
9994  !((i0Sample >= 0) && (i0Sample < fFapNbOfSamples))) {
9995  std::cout << "!TEcnaHistos::GetOkViewHisto(...)> *ERROR* =====> "
9996  << "File: " << root_file_name << ". Wrong sample index. Value = " << i0Sample
9997  << " (required range: [0, " << fFapNbOfSamples - 1 << "] )" << fTTBELL << std::endl;
9998  }
9999  ok_max_elt = -1;
10000  }
10001 
10002  if ((ok_view == 1) && (ok_max_elt == 1)) {
10003  ok_view_histo = kTRUE;
10004  } else {
10005  std::cout << "!TEcnaHistos::GetOkViewHisto(...)> At least one ERROR has been detected. ok_view = " << ok_view
10006  << ", ok_max_elt = " << ok_max_elt << fTTBELL << std::endl;
10007  }
10008  } else {
10009  fStatusDataExist = kFALSE;
10010 
10011  std::cout << "!TEcnaHistos::GetOkViewHisto(...)> No data in ROOT file "
10012  << ", aMyRootFile->DataExist() = " << aMyRootFile->DataExist() << fTTBELL << std::endl;
10013  }
10014  return ok_view_histo;
10015 }
10016 //..............................................................................................
10017 
10018 Int_t TEcnaHistos::SetHistoFrameYminYmaxFromMemo(TH1D* h_his0, const TString& HistoCode) {
10019  // Set min and max according to HistoCode
10020 
10021  // if Ymin = Ymax (or Ymin > Ymax): nothing done here
10022  // return xFlagAutoYsupMargin = 1
10023  //
10024  // if Ymin < Ymax: min and max calculated by h_his0->SetMinimum() and h_his0->SetMaximum()
10025  // return xFlagAutoYsupMargin = 0
10026 
10027  Int_t xFlagAutoYsupMargin = 1; // (SetHistoFrameYminYmaxFromMemo)
10028 
10029  if (HistoCode == "D_NOE_ChNb") {
10031  xFlagAutoYsupMargin = 0;
10032  h_his0->SetMinimum(fD_NOE_ChNbYmin);
10033  h_his0->SetMaximum(fD_NOE_ChNbYmax);
10034  }
10035  }
10036 
10037  if (HistoCode == "D_NOE_ChDs") {
10039  xFlagAutoYsupMargin = 0;
10040  h_his0->SetMinimum(fD_NOE_ChDsYmin);
10041  h_his0->SetMaximum(fD_NOE_ChDsYmax);
10042  }
10043  }
10044 
10045  if (HistoCode == "D_Ped_ChNb") {
10047  xFlagAutoYsupMargin = 0;
10048  h_his0->SetMinimum(fD_Ped_ChNbYmin);
10049  h_his0->SetMaximum(fD_Ped_ChNbYmax);
10050  }
10051  }
10052 
10053  if (HistoCode == "D_Ped_ChDs") {
10055  xFlagAutoYsupMargin = 0;
10056  h_his0->SetMinimum(fD_Ped_ChDsYmin);
10057  h_his0->SetMaximum(fD_Ped_ChDsYmax);
10058  }
10059  }
10060 
10061  if (HistoCode == "D_TNo_ChNb") {
10063  xFlagAutoYsupMargin = 0;
10064  h_his0->SetMinimum(fD_TNo_ChNbYmin);
10065  h_his0->SetMaximum(fD_TNo_ChNbYmax);
10066  }
10067  }
10068 
10069  if (HistoCode == "D_TNo_ChDs") {
10071  xFlagAutoYsupMargin = 0;
10072  h_his0->SetMinimum(fD_TNo_ChDsYmin);
10073  h_his0->SetMaximum(fD_TNo_ChDsYmax);
10074  }
10075  }
10076 
10077  if (HistoCode == "D_MCs_ChNb") {
10079  xFlagAutoYsupMargin = 0;
10080  h_his0->SetMinimum(fD_MCs_ChNbYmin);
10081  h_his0->SetMaximum(fD_MCs_ChNbYmax);
10082  }
10083  }
10084 
10085  if (HistoCode == "D_MCs_ChDs") {
10087  xFlagAutoYsupMargin = 0;
10088  h_his0->SetMinimum(fD_MCs_ChDsYmin);
10089  h_his0->SetMaximum(fD_MCs_ChDsYmax);
10090  }
10091  }
10092 
10093  if (HistoCode == "D_LFN_ChNb") {
10095  xFlagAutoYsupMargin = 0;
10096  h_his0->SetMinimum(fD_LFN_ChNbYmin);
10097  h_his0->SetMaximum(fD_LFN_ChNbYmax);
10098  }
10099  }
10100 
10101  if (HistoCode == "D_LFN_ChDs") {
10103  xFlagAutoYsupMargin = 0;
10104  h_his0->SetMinimum(fD_LFN_ChDsYmin);
10105  h_his0->SetMaximum(fD_LFN_ChDsYmax);
10106  }
10107  }
10108 
10109  if (HistoCode == "D_HFN_ChNb") {
10111  xFlagAutoYsupMargin = 0;
10112  h_his0->SetMinimum(fD_HFN_ChNbYmin);
10113  h_his0->SetMaximum(fD_HFN_ChNbYmax);
10114  }
10115  }
10116 
10117  if (HistoCode == "D_HFN_ChDs") {
10119  xFlagAutoYsupMargin = 0;
10120  h_his0->SetMinimum(fD_HFN_ChDsYmin);
10121  h_his0->SetMaximum(fD_HFN_ChDsYmax);
10122  }
10123  }
10124 
10125  if (HistoCode == "D_SCs_ChNb") {
10127  xFlagAutoYsupMargin = 0;
10128  h_his0->SetMinimum(fD_SCs_ChNbYmin);
10129  h_his0->SetMaximum(fD_SCs_ChNbYmax);
10130  }
10131  }
10132 
10133  if (HistoCode == "D_SCs_ChDs") {
10135  xFlagAutoYsupMargin = 0;
10136  h_his0->SetMinimum(fD_SCs_ChDsYmin);
10137  h_his0->SetMaximum(fD_SCs_ChDsYmax);
10138  }
10139  }
10140 
10141  if (HistoCode == "D_MSp_SpNb") {
10143  xFlagAutoYsupMargin = 0;
10144  h_his0->SetMinimum(fD_MSp_SpNbYmin);
10145  h_his0->SetMaximum(fD_MSp_SpNbYmax);
10146  }
10147  }
10148 
10149  if (HistoCode == "D_MSp_SpDs") {
10151  xFlagAutoYsupMargin = 0;
10152  h_his0->SetMinimum(fD_MSp_SpDsYmin);
10153  h_his0->SetMaximum(fD_MSp_SpDsYmax);
10154  }
10155  }
10156 
10157  if (HistoCode == "D_SSp_SpNb") {
10159  xFlagAutoYsupMargin = 0;
10160  h_his0->SetMinimum(fD_SSp_SpNbYmin);
10161  h_his0->SetMaximum(fD_SSp_SpNbYmax);
10162  }
10163  }
10164 
10165  if (HistoCode == "D_SSp_SpDs") {
10167  xFlagAutoYsupMargin = 0;
10168  h_his0->SetMinimum(fD_SSp_SpDsYmin);
10169  h_his0->SetMaximum(fD_SSp_SpDsYmax);
10170  }
10171  }
10172 
10173  if (HistoCode == "D_Adc_EvNb") {
10175  xFlagAutoYsupMargin = 0;
10176  h_his0->SetMinimum(fD_Adc_EvNbYmin);
10177  h_his0->SetMaximum(fD_Adc_EvNbYmax);
10178  }
10179  }
10180 
10181  if (HistoCode == "D_Adc_EvDs") {
10183  xFlagAutoYsupMargin = 0;
10184  h_his0->SetMinimum(fD_Adc_EvDsYmin);
10185  h_his0->SetMaximum(fD_Adc_EvDsYmax);
10186  }
10187  }
10188 
10189  if (HistoCode == "H2CorccInStins") {
10191  xFlagAutoYsupMargin = 0;
10192  h_his0->SetMinimum(fH2CorccInStinsYmin);
10193  h_his0->SetMaximum(fH2CorccInStinsYmax);
10194  }
10195  }
10196 
10197  if (HistoCode == "H2LFccMosMatrix") {
10199  xFlagAutoYsupMargin = 0;
10200  h_his0->SetMinimum(fH2LFccMosMatrixYmin);
10201  h_his0->SetMaximum(fH2LFccMosMatrixYmax);
10202  }
10203  }
10204 
10205  if (HistoCode == "H2HFccMosMatrix") {
10207  xFlagAutoYsupMargin = 0;
10208  h_his0->SetMinimum(fH2HFccMosMatrixYmin);
10209  h_his0->SetMaximum(fH2HFccMosMatrixYmax);
10210  }
10211  }
10212 
10213  if (HistoCode == "H_Ped_RuDs") {
10215  xFlagAutoYsupMargin = 0;
10216  h_his0->SetMinimum(fH_Ped_RuDsYmin);
10217  h_his0->SetMaximum(fH_Ped_RuDsYmax);
10218  }
10219  }
10220 
10221  if (HistoCode == "H_TNo_RuDs") {
10223  xFlagAutoYsupMargin = 0;
10224  h_his0->SetMinimum(fH_TNo_RuDsYmin);
10225  h_his0->SetMaximum(fH_TNo_RuDsYmax);
10226  }
10227  }
10228 
10229  if (HistoCode == "H_MCs_RuDs") {
10231  xFlagAutoYsupMargin = 0;
10232  h_his0->SetMinimum(fH_MCs_RuDsYmin);
10233  h_his0->SetMaximum(fH_MCs_RuDsYmax);
10234  }
10235  }
10236 
10237  if (HistoCode == "H_LFN_RuDs") {
10239  xFlagAutoYsupMargin = 0;
10240  h_his0->SetMinimum(fH_LFN_RuDsYmin);
10241  h_his0->SetMaximum(fH_LFN_RuDsYmax);
10242  }
10243  }
10244 
10245  if (HistoCode == "H_HFN_RuDs") {
10247  xFlagAutoYsupMargin = 0;
10248  h_his0->SetMinimum(fH_HFN_RuDsYmin);
10249  h_his0->SetMaximum(fH_HFN_RuDsYmax);
10250  }
10251  }
10252 
10253  if (HistoCode == "H_SCs_RuDs") {
10255  xFlagAutoYsupMargin = 0;
10256  h_his0->SetMinimum(fH_SCs_RuDsYmin);
10257  h_his0->SetMaximum(fH_SCs_RuDsYmax);
10258  }
10259  }
10260 
10261  return xFlagAutoYsupMargin;
10262 } // end of SetHistoFrameYminYmaxFromMemo
10263 
10264 Int_t TEcnaHistos::SetGraphFrameYminYmaxFromMemo(TGraph* g_graph0, const TString& HistoCode) {
10265  // Set min and max according to HistoCode
10266 
10267  Int_t xFlagAutoYsupMargin = 1; // DEFAULT: 1 = min and max calulated by ROOT, 0 = by this code
10268 
10269  if (HistoCode == "H_Ped_Date") {
10271  xFlagAutoYsupMargin = 0;
10272  g_graph0->SetMinimum(fH_Ped_DateYmin);
10273  g_graph0->SetMaximum(fH_Ped_DateYmax);
10274  }
10275  }
10276 
10277  if (HistoCode == "H_TNo_Date") {
10279  xFlagAutoYsupMargin = 0;
10280  g_graph0->SetMinimum(fH_TNo_DateYmin);
10281  g_graph0->SetMaximum(fH_TNo_DateYmax);
10282  }
10283  }
10284 
10285  if (HistoCode == "H_MCs_Date") {
10287  xFlagAutoYsupMargin = 0;
10288  g_graph0->SetMinimum(fH_MCs_DateYmin);
10289  g_graph0->SetMaximum(fH_MCs_DateYmax);
10290  }
10291  }
10292 
10293  if (HistoCode == "H_LFN_Date") {
10295  xFlagAutoYsupMargin = 0;
10296  g_graph0->SetMinimum(fH_LFN_DateYmin);
10297  g_graph0->SetMaximum(fH_LFN_DateYmax);
10298  }
10299  }
10300 
10301  if (HistoCode == "H_HFN_Date") {
10303  xFlagAutoYsupMargin = 0;
10304  g_graph0->SetMinimum(fH_HFN_DateYmin);
10305  g_graph0->SetMaximum(fH_HFN_DateYmax);
10306  }
10307  }
10308 
10309  if (HistoCode == "H_SCs_Date") {
10311  xFlagAutoYsupMargin = 0;
10312  g_graph0->SetMinimum(fH_SCs_DateYmin);
10313  g_graph0->SetMaximum(fH_SCs_DateYmax);
10314  }
10315  }
10316 
10317  return xFlagAutoYsupMargin;
10318 } // end of SetGraphFrameYminYmaxFromMemo
10319 
10320 //..............................................................................................
10321 Double_t TEcnaHistos::GetYminFromHistoFrameAndMarginValue(TH1D* h_his0, const Double_t margin_factor) {
10322  //Calculation for automatic minimum with margin
10323  Double_t minproj = h_his0->GetMinimum();
10324  Double_t maxproj = h_his0->GetMaximum();
10325  minproj = minproj - (maxproj - minproj) * margin_factor;
10326  return minproj;
10327 }
10328 
10329 Double_t TEcnaHistos::GetYmaxFromHistoFrameAndMarginValue(TH1D* h_his0, const Double_t margin_factor) {
10330  //Calculation for automatic maximum with margin
10331  Double_t minproj = h_his0->GetMinimum();
10332  Double_t maxproj = h_his0->GetMaximum();
10333  maxproj = maxproj + (maxproj - minproj) * margin_factor;
10334  return maxproj;
10335 }
10336 
10337 Double_t TEcnaHistos::GetYminFromGraphFrameAndMarginValue(TGraph* g_graph0, const Double_t margin_factor) {
10338  //Calculation for automatic minimum with margin
10339  Double_t graph_ymin = g_graph0->GetY()[0];
10340  for (Int_t i = 1; i < g_graph0->GetN(); i++) {
10341  if (g_graph0->GetY()[i] < graph_ymin) {
10342  graph_ymin = g_graph0->GetY()[i];
10343  }
10344  }
10345 
10346  Double_t graph_ymax = g_graph0->GetY()[0];
10347  for (Int_t i = 1; i < g_graph0->GetN(); i++) {
10348  if (g_graph0->GetY()[i] > graph_ymax) {
10349  graph_ymax = g_graph0->GetY()[i];
10350  }
10351  }
10352 
10353  graph_ymin = graph_ymin - (graph_ymax - graph_ymin) * margin_factor;
10354  return graph_ymin;
10355 }
10356 Double_t TEcnaHistos::GetYmaxFromGraphFrameAndMarginValue(TGraph* g_graph0, const Double_t margin_factor) {
10357  //Calculation for automatic maximum with margin
10358  Double_t graph_ymin = g_graph0->GetY()[0];
10359  for (Int_t i = 1; i < g_graph0->GetN(); i++) {
10360  if (g_graph0->GetY()[i] < graph_ymin) {
10361  graph_ymin = g_graph0->GetY()[i];
10362  }
10363  }
10364 
10365  Double_t graph_ymax = g_graph0->GetY()[0];
10366  for (Int_t i = 1; i < g_graph0->GetN(); i++) {
10367  if (g_graph0->GetY()[i] > graph_ymax) {
10368  graph_ymax = g_graph0->GetY()[i];
10369  }
10370  }
10371 
10372  graph_ymax = graph_ymax + (graph_ymax - graph_ymin) * margin_factor;
10373  return graph_ymax;
10374 }
10375 //----------------------------------------------- HistoPlot
10376 
10377 void TEcnaHistos::HistoPlot(TH1D* h_his0,
10378  const Int_t& HisSize,
10379  const Axis_t& xinf_his,
10380  const Axis_t& xsup_his,
10381  const TString& HistoCode,
10382  const TString& HistoType,
10383  const Int_t& StexStin_A,
10384  const Int_t& i0StinEcha,
10385  const Int_t& i0Sample,
10386  const Int_t& opt_scale_x,
10387  const Int_t& opt_scale_y,
10388  const TString& opt_plot,
10389  const Int_t& arg_AlreadyRead,
10390  const Int_t& xFlagAutoYsupMargin) {
10391  // Plot 1D histogram
10392 
10393  UInt_t canv_w = fCnaParHistos->SetCanvasWidth(HistoCode.Data(), opt_plot);
10394  UInt_t canv_h = fCnaParHistos->SetCanvasHeight(HistoCode.Data(), opt_plot);
10395 
10396  TString QuantityName = " ";
10397  QuantityName.Resize(charArrLen);
10398  QuantityName = fCnaParHistos->GetQuantityName(HistoCode.Data());
10399 
10400  if (arg_AlreadyRead == 0 || arg_AlreadyRead == 1) {
10401  SetHistoPresentation(h_his0, HistoType.Data(), opt_plot); // (gStyle parameters)
10402  //.................................................. prepa paves commentaires (HistoPlot)
10403  SetAllPavesViewHisto(HistoCode.Data(), StexStin_A, i0StinEcha, i0Sample, opt_plot.Data(), arg_AlreadyRead);
10404  }
10405 
10406  //..................................................... Canvas name (HistoPlot)
10407  TString canvas_name = SetCanvasName(
10408  HistoCode.Data(), opt_scale_x, opt_scale_y, opt_plot.Data(), arg_AlreadyRead, StexStin_A, i0StinEcha, i0Sample);
10409  //..................................................... Canvas allocations (HistoPlot)
10410  TCanvas* MainCanvas = nullptr;
10411 
10412  if (opt_plot == fOnlyOnePlot && (arg_AlreadyRead == 0 || arg_AlreadyRead == 1)) {
10413  MainCanvas = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
10414  fCnewRoot++;
10415  fCurrentPad = gPad;
10416  fCurrentCanvas = MainCanvas;
10417  fCurrentCanvasName = canvas_name.Data();
10418  }
10419 
10420  if (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) {
10421  if (GetMemoFlag(HistoCode, opt_plot) == "Free") {
10422  MainCanvas = CreateCanvas(HistoCode, opt_plot, canvas_name, canv_w, canv_h);
10423  fCurrentPad = gPad;
10424  fCurrentCanvas = MainCanvas;
10425  fCurrentCanvasName = canvas_name.Data();
10426  }
10427  }
10428 
10429  // std::cout << "*TEcnaHistos::HistoPlot(...)> Plot is displayed on canvas ----> " << canvas_name.Data() << std::endl;
10430 
10431  //--------------- EE => SC for construction, EB => Xtal in SM (default: Stin ECNA number, i0StinEcha)
10432  Int_t Stex_StinCons = StexStin_A; // Stex_StinCons = Tower for EB, SC for construction for EE
10433  Int_t n1StexCrys = i0StinEcha + 1; // n1StexCrys = Crys in SM for EB, ECNA
10434 
10435  if (StexStin_A >= 1 && StexStin_A <= fEcal->MaxStinEcnaInStex()) {
10436  if (fFlagSubDet == "EB") {
10437  n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
10438  }
10439  if (fFlagSubDet == "EE") {
10440  Stex_StinCons = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A);
10441  }
10442  }
10443 
10444  //------ String for StexNumber ( to display "EB" or "EE" if Stex = 0 )
10445  TString sFapStexNumber = StexNumberToString(fFapStexNumber);
10446 
10447  //============================================================================= (HistoPlot)
10448  //
10449  // 1st OPERATIONS: Pave texts preparation and first Draw.
10450  // SetParametersCanvas
10451  // Set Memo Flags.
10452  // Set main_subpad and main_pavtxt
10453  //
10454  //=============================================================================
10455  TVirtualPad* main_subpad = nullptr; // main_subpad: Pad for the histo
10456  TPaveText* main_pavtxt = nullptr; // Pave for the "Several Changing" parameters (options SAME and SAME n)
10457 
10458  Int_t xMemoPlotSame = 1; // a priori ==> SAME plot
10459 
10460  //========================================= Option ONLYONE (HistoPlot)
10461  if (opt_plot == fOnlyOnePlot) {
10462  if (arg_AlreadyRead == 0 || arg_AlreadyRead == 1) {
10463  //.................................... Draw titles and paves (pad = main canvas)
10464  if (fPavComGeneralTitle != nullptr) {
10465  fPavComGeneralTitle->Draw();
10466  }
10467  fPavComStex->Draw();
10468  if (!(HistoType == "Global" || HistoType == "Proj")) {
10469  fPavComStin->Draw();
10470  fPavComXtal->Draw();
10471  }
10472 
10473  if (HistoType == "EvolProj") {
10474  fPavComEvolRuns->Draw();
10475  fPavComEvolNbOfEvtsAna->Draw();
10476  } else {
10477  fPavComAnaRun->Draw();
10478  fPavComNbOfEvts->Draw();
10479  }
10480 
10481  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
10482  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
10483  Double_t y_low = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
10484  Double_t y_up = fCnaParHistos->BoxBottomY("top_right_box_EB") - 0.005;
10485  Color_t fond_pad = fCnaParHistos->ColorDefinition("blanc");
10486 
10487  Double_t x_margin = x_low;
10488  Double_t y_margin = y_low;
10489  MainCanvas->Divide(1, 1, x_margin, y_margin, fond_pad);
10490  // Divide(nx, ny, x_margin, y_margin, color);
10491 
10492  gPad->cd(1);
10493  main_subpad = gPad;
10494  main_subpad->SetPad(x_low, y_low, x_up, y_up);
10495 
10496  xMemoPlotSame = 0;
10497  }
10498  if (arg_AlreadyRead > 1) {
10499  main_subpad = fCurrentPad;
10500  }
10501 
10502  } // end of if(opt_plot == fOnlyOnePlot && (arg_AlreadyRead == 0 || arg_AlreadyRead == 1 ) )
10503 
10504  //========================================= Options SAME and SAME n (HistoPlot)
10505  if ((opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot)) {
10506  //..................... First call in options SAME and SAME n
10507  if (GetMemoFlag(HistoCode, opt_plot) == "Free") {
10508  //Call to SetParametersPavTxt
10509  //fPavTxt<HISTOCODE> = fPavComSeveralChanging; => come from SetAllPavesViewHisto
10510  SetParametersPavTxt(HistoCode, opt_plot);
10511 
10512  //---------------- Call to ActivePavTxt
10513  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
10514  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
10515 
10516  //---------------------------- Set texts for pave "several changing", options SAME and SAME n
10517  if (fPavComGeneralTitle != nullptr) {
10518  fPavComGeneralTitle->Draw();
10519  }
10520 
10521  main_pavtxt->SetTextAlign(fTextPaveAlign);
10522  main_pavtxt->SetTextFont(fTextPaveFont);
10523  main_pavtxt->SetBorderSize(fTextBorderSize);
10524  Float_t cTextPaveSize = 0.025;
10525  if (HistoType == "H1Basic" || HistoType == "SampProj" || HistoType == "H1BasicProj" || HistoType == "Proj" ||
10526  HistoType == "EvolProj") {
10527  cTextPaveSize = 0.025;
10528  }
10529  main_pavtxt->SetTextSize(cTextPaveSize);
10530 
10531  char f_in[charArrLen];
10532 
10533  //------------------------------------------------------------ titles pave "several" (HistoPlot)
10534  TString DecalStexName = "";
10535  if (fFlagSubDet == "EB") {
10536  DecalStexName = " ";
10537  }
10538  TString DecalStinName = "";
10539  if (fFlagSubDet == "EE") {
10540  DecalStinName = " ";
10541  }
10542 
10543  TString sStexOrStasName = "";
10544  if (fFapStexNumber == 0) {
10545  sStexOrStasName = " ";
10546  }
10547  if (fFapStexNumber != 0) {
10548  sStexOrStasName = fFapStexName;
10549  }
10550 
10551  if (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) {
10552  if (HistoType == "SampGlobal") {
10553  sprintf(f_in,
10554  "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s %s%s %s %s Sample",
10555  DecalStexName.Data(),
10556  sStexOrStasName.Data(),
10557  DecalStinName.Data(),
10558  fFapStinName.Data(),
10559  fFapXtalName.Data(),
10560  fFapEchaName.Data());
10561  }
10562  if (HistoType == "SampProj") {
10563  sprintf(f_in,
10564  "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s %s%s %s %s Sample",
10565  DecalStexName.Data(),
10566  sStexOrStasName.Data(),
10567  DecalStinName.Data(),
10568  fFapStinName.Data(),
10569  fFapXtalName.Data(),
10570  fFapEchaName.Data());
10571  }
10572  if (HistoType == "H1Basic" || HistoType == "H1BasicProj") {
10573  sprintf(f_in,
10574  "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s %s%s %s %s",
10575  DecalStexName.Data(),
10576  sStexOrStasName.Data(),
10577  DecalStinName.Data(),
10578  fFapStinName.Data(),
10579  fFapXtalName.Data(),
10580  fFapEchaName.Data());
10581  }
10582  if ((HistoType == "Global") || (HistoType == "Proj")) {
10583  sprintf(f_in,
10584  "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s",
10585  DecalStexName.Data(),
10586  sStexOrStasName.Data());
10587  }
10588 
10589  if (HistoType == "EvolProj") {
10590  sprintf(f_in,
10591  "Analysis Samp Evts range Nb Evts %s%s %s%s %s %s",
10592  DecalStexName.Data(),
10593  sStexOrStasName.Data(),
10594  DecalStinName.Data(),
10595  fFapStinName.Data(),
10596  fFapXtalName.Data(),
10597  fFapEchaName.Data());
10598  }
10599  }
10600 
10601  TText* ttit = main_pavtxt->AddText(f_in);
10602  ttit->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10603 
10604  //------------------------------------------------------------ values pave "several" (HistoPlot)
10605 
10606  //.................................... option SAME n only (HistoPlot)
10607  if (opt_plot == fSameOnePlot) {
10608  if ((HistoType == "Global") || (HistoType == "Proj") || (HistoType == "H1BasicProj")) {
10609  sprintf(f_in,
10610  "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s %-25s",
10611  fFapAnaType.Data(),
10613  fFapRunNumber,
10614  fRunType.Data(),
10618  sFapStexNumber.Data(),
10619  QuantityName.Data());
10620  }
10621 
10622  if (HistoType == "EvolProj") {
10623  sprintf(f_in,
10624  "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%7d %-25s",
10625  fFapAnaType.Data(),
10630  sFapStexNumber.Data(),
10631  Stex_StinCons,
10632  n1StexCrys,
10633  i0StinEcha,
10634  QuantityName.Data());
10635  }
10636 
10637  } // end of if for option SAME n only
10638 
10639  //..................................... option SAME (HistoPlot)
10640  if (opt_plot == fSeveralPlot) {
10641  Int_t kSample = i0Sample + 1; // Sample number range = [1,n<=10]
10642 
10643  if (HistoType == "SampGlobal") {
10644  sprintf(f_in,
10645  "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d%6d",
10646  fFapAnaType.Data(),
10648  fFapRunNumber,
10649  fRunType.Data(),
10653  sFapStexNumber.Data(),
10654  Stex_StinCons,
10655  n1StexCrys,
10656  i0StinEcha,
10657  kSample);
10658  }
10659  if (HistoType == "SampProj") {
10660  sprintf(f_in,
10661  "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d%6d",
10662  fFapAnaType.Data(),
10664  fFapRunNumber,
10665  fRunType.Data(),
10669  sFapStexNumber.Data(),
10670  Stex_StinCons,
10671  n1StexCrys,
10672  i0StinEcha,
10673  kSample);
10674  }
10675  if (HistoType == "H1Basic" || HistoType == "H1BasicProj") {
10676  sprintf(f_in,
10677  "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d",
10678  fFapAnaType.Data(),
10680  fFapRunNumber,
10681  fRunType.Data(),
10685  sFapStexNumber.Data(),
10686  Stex_StinCons,
10687  n1StexCrys,
10688  i0StinEcha);
10689  }
10690  if ((HistoType == "Global") || (HistoType == "Proj")) {
10691  sprintf(f_in,
10692  "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s",
10693  fFapAnaType.Data(),
10695  fFapRunNumber,
10696  fRunType.Data(),
10700  sFapStexNumber.Data());
10701  }
10702 
10703  if (HistoType == "EvolProj") {
10704  sprintf(f_in,
10705  "%-10s 1-%2d %5d-%5d %7d %4s%7d%5d%5d",
10706  fFapAnaType.Data(),
10711  sFapStexNumber.Data(),
10712  Stex_StinCons,
10713  n1StexCrys,
10714  i0StinEcha);
10715  }
10716  }
10717 
10718  TText* tt = main_pavtxt->AddText(f_in);
10719  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
10720 
10721  //---------------- Draw the "several changing" pave with its text in the Canvas (AT FIRST TIME)
10722  main_pavtxt->Draw();
10723  //---------------- Draw evol run pave if "EvolProj" (AT FIRST TIME)
10724  if (HistoType == "EvolProj") {
10725  fPavComEvolRuns->Draw();
10726  }
10727 
10728  //---------------- Call to SetParametersCanvas
10729  //fImp<HISTOCODE> = (TCanvasImp*)fCanv<HISTOCODE>->GetCanvasImp();
10730  //fCanv<HISTOCODE>->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
10731  //fPad<HISTOCODE> = gPad;
10732  //fMemoPlot<HISTOCODE> = 1; =======> set MemoFlag to "Buzy"
10733  //fMemoColor<HISTOCODE> = 0;
10734  SetParametersCanvas(HistoCode, opt_plot);
10735 
10736  //---------------- Set xMemoPlotSame to 0
10737  xMemoPlotSame = 0;
10738  } // end of if( GetMemoFlag(HistoCode, opt_plot) == "Free" ) (HistoPlot)
10739 
10740  //.......... First and further calls in options SAME and SAME n (fMemoPlot<HISTOCODE> = 1)
10741  if (GetMemoFlag(HistoCode, opt_plot) == "Busy") {
10742  //---------------- Call to ActivePavTxt
10743  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
10744  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
10745 
10746  //---------------- Call to ActivePad
10747  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
10748 
10749  //---------------- Recover pointer to the current canvas
10750  MainCanvas = GetCurrentCanvas(HistoCode.Data(), opt_plot.Data());
10751  }
10752  } // end of if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
10753 
10754  //============================================================================= (HistoPlot)
10755  //
10756  // 2nd OPERATIONS: Write and Draw the parameter values in the
10757  // "several changing" pave (options SAME and SAME n)
10758  // and Draw Histo
10759  //=============================================================================
10760  if (main_subpad != nullptr) {
10761  if ((opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot)) {
10762  //------------------------------------------------------------ values
10763  if (xMemoPlotSame != 0) {
10764  // main_pavtxt = fPavComSeveralChanging = fPavTxt<HISTOCODE>
10765  main_pavtxt->SetTextAlign(fTextPaveAlign);
10766  main_pavtxt->SetTextFont(fTextPaveFont);
10767  main_pavtxt->SetBorderSize(fTextBorderSize);
10768  Float_t cTextPaveSize = 0.025;
10769  if (HistoType == "H1Basic" || HistoType == "SampProj" || HistoType == "Proj" || HistoType == "EvolProj" ||
10770  HistoType == "H1BasicProj") {
10771  cTextPaveSize = 0.025;
10772  }
10773  main_pavtxt->SetTextSize(cTextPaveSize);
10774 
10775  char f_in[charArrLen];
10776 
10777  if (opt_plot == fSameOnePlot) {
10778  if ((HistoType == "Global") || (HistoType == "Proj")) {
10779  sprintf(f_in,
10780  "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s %-25s",
10781  fFapAnaType.Data(),
10783  fFapRunNumber,
10784  fRunType.Data(),
10788  sFapStexNumber.Data(),
10789  QuantityName.Data());
10790  }
10791 
10792  if (HistoType == "EvolProj") {
10793  sprintf(f_in,
10794  "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%7d %-25s",
10795  fFapAnaType.Data(),
10800  sFapStexNumber.Data(),
10801  Stex_StinCons,
10802  n1StexCrys,
10803  i0StinEcha,
10804  QuantityName.Data());
10805  }
10806  }
10807 
10808  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
10809  Int_t kSample = i0Sample + 1; // Sample number range = [1,n<=10] (HistoPlot)
10810 
10811  if (HistoType == "SampGlobal") {
10812  sprintf(f_in,
10813  "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d%6d",
10814  fFapAnaType.Data(),
10816  fFapRunNumber,
10817  fRunType.Data(),
10821  sFapStexNumber.Data(),
10822  Stex_StinCons,
10823  n1StexCrys,
10824  i0StinEcha,
10825  kSample);
10826  }
10827  if (HistoType == "SampProj") {
10828  sprintf(f_in,
10829  "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d%6d",
10830  fFapAnaType.Data(),
10832  fFapRunNumber,
10833  fRunType.Data(),
10837  sFapStexNumber.Data(),
10838  Stex_StinCons,
10839  n1StexCrys,
10840  i0StinEcha,
10841  kSample);
10842  }
10843  if (HistoType == "H1Basic" || HistoType == "H1BasicProj") {
10844  sprintf(f_in,
10845  "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d",
10846  fFapAnaType.Data(),
10848  fFapRunNumber,
10849  fRunType.Data(),
10853  sFapStexNumber.Data(),
10854  Stex_StinCons,
10855  n1StexCrys,
10856  i0StinEcha);
10857  }
10858  if ((HistoType == "Global") || (HistoType == "Proj")) {
10859  sprintf(f_in,
10860  "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s",
10861  fFapAnaType.Data(),
10863  fFapRunNumber,
10864  fRunType.Data(),
10868  sFapStexNumber.Data());
10869  }
10870 
10871  if (HistoType == "EvolProj") {
10872  sprintf(f_in,
10873  "%-10s 1-%2d %5d-%5d %7d %4s%7d%5d%5d",
10874  fFapAnaType.Data(),
10879  sFapStexNumber.Data(),
10880  Stex_StinCons,
10881  n1StexCrys,
10882  i0StinEcha);
10883  }
10884  }
10885 
10886  TText* tt = main_pavtxt->AddText(f_in);
10887  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
10888  MainCanvas->cd();
10889  gStyle->SetOptDate(0);
10890  main_pavtxt->Draw();
10891  }
10892 
10893  main_subpad->cd();
10894  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
10895  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
10896  Double_t y_low = fCnaParHistos->BoxTopY("several_plots_box") + 0.005;
10897  Double_t y_up = fCnaParHistos->BoxBottomY("general_comment") - 0.005;
10898  if (opt_plot == fSameOnePlot && HistoType == "EvolProj") {
10899  y_up = fCnaParHistos->BoxBottomY("top_left_box_EB") - 0.005;
10900  }
10901  main_subpad->SetPad(x_low, y_low, x_up, y_up);
10902  } // end of if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
10903 
10904  //............................................ Style (HistoPlot)
10905  SetViewHistoColors(h_his0, HistoCode.Data(), opt_plot, arg_AlreadyRead);
10906 
10907  //................................. Set axis titles
10908  TString axis_x_var_name = SetHistoXAxisTitle(HistoCode);
10909  TString axis_y_var_name = SetHistoYAxisTitle(HistoCode);
10910  h_his0->GetXaxis()->SetTitle(axis_x_var_name);
10911  h_his0->GetYaxis()->SetTitle(axis_y_var_name);
10912 
10913  Int_t lin_scale = 0;
10914  Int_t log_scale = 1;
10915 
10916  if (opt_scale_x == fOptScaleLinx) {
10917  gPad->SetLogx(lin_scale);
10918  }
10919  if (opt_scale_x == fOptScaleLogx) {
10920  gPad->SetLogx(log_scale);
10921  }
10922  if (opt_scale_y == fOptScaleLiny) {
10923  gPad->SetLogy(lin_scale);
10924  }
10925  if (opt_scale_y == fOptScaleLogy) {
10926  gPad->SetLogy(log_scale);
10927  }
10928 
10929  //---------------------------------------------------------------- Draw histo (HistoPlot)
10930  if (opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) {
10931  h_his0->DrawCopy();
10932  }
10933  if (opt_plot == fOnlyOnePlot && arg_AlreadyRead == 1) {
10934  h_his0->DrawCopy();
10935  }
10936  if (opt_plot == fOnlyOnePlot && arg_AlreadyRead > 1) {
10937  h_his0->DrawCopy("AHSAME");
10938  }
10939 
10940  if (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) {
10941  if (xMemoPlotSame == 0) {
10942  h_his0->DrawCopy();
10943  }
10944  if (xMemoPlotSame != 0) {
10945  h_his0->DrawCopy("SAME");
10946  }
10947  }
10948  //----------------------------------------------------------------
10949 
10950  //.................... Horizontal line at y=0 (HistoPlot)
10951  if (!(HistoCode == "D_Adc_EvDs" || HistoCode == "D_Adc_EvNb" || HistoType == "Proj" || HistoType == "SampProj" ||
10952  HistoType == "EvolProj" || HistoType == "H1BasicProj") &&
10953  !(HistoType == "H1Basic" && arg_AlreadyRead == 0)) {
10954  Double_t yinf = h_his0->GetMinimum();
10955  Double_t ysup = h_his0->GetMaximum();
10956  if (yinf <= (Double_t)0. && ysup >= (Double_t)0.) {
10957  TLine* lin = new TLine(0., 0., (Double_t)HisSize, 0.);
10958  fCnewRoot++;
10959  lin->Draw();
10960  }
10961  }
10962 
10963  if ((opt_plot == fOnlyOnePlot) || ((opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) && xMemoPlotSame == 0)) {
10964  Double_t yinf = (Double_t)h_his0->GetMinimum();
10965  Double_t ysup = (Double_t)h_his0->GetMaximum();
10966 
10967  if (xFlagAutoYsupMargin == 1) {
10968  if (yinf >= ysup) {
10969  yinf = (Double_t)0.;
10970  ysup += ysup;
10971  } // ROOT default if ymin >= ymax
10972  Double_t MaxMarginFactor = (Double_t)0.05; // frame top line = 5% above the maximum
10973  ysup += (ysup - yinf) * MaxMarginFactor; // ROOT default if ymin < ymax
10974  }
10975 
10976  char f_in[charArrLen];
10977 
10978  //.................... Vertical lines for Data sectors (EE Global plot only)
10979  if (fFlagSubDet == "EE" && fFapStexNumber == 0) {
10980  //............................................................. Data Sectors (HistoPlot)
10981  Color_t coul_DS = fCnaParHistos->ColorDefinition("noir");
10982  Int_t DeeOffset = 0;
10983  for (Int_t n1Dee = 1; n1Dee <= 4; n1Dee++) {
10984  if (n1Dee == 4) {
10985  DeeOffset = 0;
10986  }
10987  if (n1Dee == 3) {
10988  DeeOffset = fEcal->MaxSCForConsInDee();
10989  } // 149
10990  if (n1Dee == 2) {
10991  DeeOffset = 2 * fEcal->MaxSCForConsInDee();
10992  } // 446
10993  if (n1Dee == 1) {
10994  DeeOffset = 3 * fEcal->MaxSCForConsInDee();
10995  } // 595
10996 
10997  Double_t ydee = ysup + (ysup - yinf) / (Double_t)15.;
10998  Double_t xBinDee = DeeOffset + fEcal->MaxSCForConsInDee() / (Double_t)2.;
10999  sprintf(f_in, "D%d", n1Dee);
11000  TText* text_Dee = new TText(xBinDee, ydee, f_in);
11001  fCnewRoot++;
11002  text_Dee->SetTextColor(coul_DS);
11003  text_Dee->SetTextSize((Double_t)0.04);
11004  text_Dee->Draw("SAME");
11005 
11006  Double_t DSLabelOffset = (Double_t)12;
11007 
11008  for (Int_t i = 1; i < 5; i++) {
11009  Int_t iDS = 0;
11010  if (n1Dee == 1) {
11011  iDS = i;
11012  }
11013  if (n1Dee == 2) {
11014  iDS = i + 4;
11015  }
11016  if (n1Dee == 3) {
11017  iDS = i + 5;
11018  }
11019  if (n1Dee == 4) {
11020  iDS = i + 1;
11021  }
11022 
11023  Double_t xBinDS = DeeOffset + (Double_t)GetDSOffset(n1Dee, iDS) / fEcal->MaxCrysInSC();
11024  TLine* lin_DS = new TLine(xBinDS, yinf, xBinDS, ysup);
11025  fCnewRoot++;
11026  lin_DS->SetLineColor(coul_DS);
11027  lin_DS->SetLineWidth(1);
11028  lin_DS->SetLineStyle(2);
11029  lin_DS->Draw();
11030 
11031  if (n1Dee == 2 && i == 4) {
11032  TLine* lin_DSp = new TLine(DeeOffset, yinf, DeeOffset, ysup);
11033  fCnewRoot++;
11034  lin_DSp->SetLineColor(coul_DS);
11035  lin_DSp->SetLineWidth(1);
11036  lin_DSp->SetLineStyle(2);
11037  lin_DSp->Draw();
11038  }
11039 
11040  Double_t yds = ysup + (ysup - yinf) / (Double_t)50.;
11041  Double_t xBinDSp = xBinDS + DSLabelOffset;
11042  Int_t nDS = iDS;
11043 
11044  sprintf(f_in, "S%d", nDS);
11045  TText* text_DS = new TText(xBinDSp, yds, f_in);
11046  fCnewRoot++;
11047  text_DS->SetTextColor(coul_DS);
11048  text_DS->SetTextSize((Double_t)0.03);
11049  text_DS->Draw("SAME");
11050  if ((n1Dee == 4 && i == 1) || (n1Dee == 2 && i == 4)) {
11051  if (n1Dee == 4) {
11052  nDS = iDS - 1;
11053  }
11054  if (n1Dee == 2) {
11055  nDS = iDS + 1;
11056  }
11057  sprintf(f_in, "S%d", nDS);
11058  TText* text_DS = new TText(xBinDS - 1.75 * DSLabelOffset, yds, f_in);
11059  fCnewRoot++;
11060  text_DS->SetTextColor(coul_DS);
11061  text_DS->SetTextSize((Double_t)0.03);
11062  text_DS->Draw("SAME");
11063  }
11064  }
11065  }
11066  }
11067 
11068  //........... Vertical lines for Data sectors and special SC's (EE only, Dee's Global plots) (HistoPlot)
11069  if (fFlagSubDet == "EE" && fFapStexNumber > 0) {
11070  if (HistoType == "Global") {
11071  Double_t ytext = yinf - (ysup - yinf) / 8.5;
11072  //............................................................. Data Sectors
11073  Color_t coul_DS = fCnaParHistos->ColorDefinition("noir");
11074  for (Int_t i = 1; i < 5; i++) {
11075  Int_t iDS = 0;
11076  if (fFapStexNumber == 1) {
11077  iDS = i;
11078  }
11079  if (fFapStexNumber == 2) {
11080  iDS = i + 4;
11081  }
11082  if (fFapStexNumber == 3) {
11083  iDS = i + 5;
11084  }
11085  if (fFapStexNumber == 4) {
11086  iDS = i + 1;
11087  }
11088 
11089  Double_t xBinDS = (Double_t)GetDSOffset(fFapStexNumber, iDS);
11090  TLine* lin_DS = new TLine(xBinDS, yinf, xBinDS, ysup);
11091  fCnewRoot++;
11092  lin_DS->SetLineColor(coul_DS);
11093  lin_DS->SetLineWidth(2);
11094  lin_DS->SetLineStyle(2);
11095  lin_DS->Draw();
11096  Double_t ytextds = ysup + (ysup - yinf) / 30.;
11097  Double_t xBinDSNumber = xBinDS + fEcalNumbering->GetMaxSCInDS(iDS) * fEcal->MaxCrysInSC() / (Double_t)2.25;
11098  sprintf(f_in, "S%d", iDS);
11099  TText* text_DS = new TText(xBinDSNumber, ytextds, f_in);
11100  fCnewRoot++;
11101  text_DS->SetTextColor(coul_DS);
11102  text_DS->SetTextSize((Double_t)0.04);
11103  text_DS->Draw("SAME");
11104  if (((fFapStexNumber == 1 || fFapStexNumber == 2) && i == 4) ||
11105  ((fFapStexNumber == 3 || fFapStexNumber == 4) && i == 1)) {
11106  Int_t iDSp = iDS;
11107  if (i == 4) {
11108  iDSp = iDS + 1;
11109  }
11110  if (i == 1) {
11111  iDSp = iDS - 1;
11112  }
11113  sprintf(f_in, "S%d", iDSp);
11114  Double_t xBinpDSNumber = xBinDSNumber - fEcalNumbering->GetMaxSCInDS(iDS) * fEcal->MaxCrysInSC();
11115  TText* text_DSp = new TText(xBinpDSNumber, ytextds, f_in);
11116  fCnewRoot++;
11117  text_DSp->SetTextColor(coul_DS);
11118  text_DSp->SetTextSize((Double_t)0.04);
11119  text_DSp->Draw("SAME");
11120  }
11121  }
11122  //.............................................................. Vertical lines for SC's
11123  // Trop serre. A garder en reserve.
11124  //for(Int_t i=0; i<fEcal->MaxSCForConsInDee(); i++)
11125  // {
11126  // Double_t xBinSC =(Double_t)(fEcal->MaxCrysInSC()*i);
11127  // TLine* lin_SC = new TLine(xBinSC, yinf, xBinSC, ysup); fCnewRoot++;
11128  // lin_SC->SetLineColor(coul_DS);
11129  // lin_SC->SetLineStyle(3);
11130  // lin_SC->Draw();
11131  // }
11132  //............................................................... Not connected SC's
11133  Color_t coul_notconnected = fCnaParHistos->ColorDefinition("bleu_fonce");
11134  for (Int_t i = 1; i <= fEcal->NumberOfNotConnectedSCs(); i++) {
11135  Int_t index = 0;
11136  if (fFapStexNumber == 1 || fFapStexNumber == 3) {
11137  index = 2 * i - 1;
11138  }
11139  if (fFapStexNumber == 2 || fFapStexNumber == 4) {
11140  index = 2 * i;
11141  }
11142  //................. display of the not connected SC's numbers (+ vertical line)
11143  Double_t xBinNotConnectedSC = NotConnectedSCH1DBin(index);
11144  TLine* lin_notconnected = new TLine(xBinNotConnectedSC, yinf, xBinNotConnectedSC, ysup);
11145  fCnewRoot++;
11146  lin_notconnected->SetLineColor(coul_notconnected);
11147  lin_notconnected->SetLineStyle(3);
11148  lin_notconnected->Draw();
11149 
11150  Double_t xBinNotConnectedSCEnd = NotConnectedSCH1DBin(index) + fEcal->MaxCrysInSC();
11151  TLine* lin_notconnected_end = new TLine(xBinNotConnectedSCEnd, yinf, xBinNotConnectedSCEnd, ysup);
11152  fCnewRoot++;
11153  lin_notconnected_end->SetLineColor(coul_notconnected);
11154  lin_notconnected_end->SetLineStyle(3);
11155  lin_notconnected_end->Draw();
11156 
11157  //sprintf( f_in, "%d", GetNotConnectedSCForConsFromIndex(index) );
11158  sprintf(f_in, "%d", GetNotConnectedDSSCFromIndex(index));
11159  TText* text_SC_NotConnected = new TText(xBinNotConnectedSC, ytext, f_in);
11160  fCnewRoot++;
11161  text_SC_NotConnected->SetTextAngle((Double_t)45.);
11162  text_SC_NotConnected->SetTextColor(coul_notconnected);
11163  text_SC_NotConnected->SetTextFont(42);
11164  text_SC_NotConnected->SetTextSize((Double_t)0.03);
11165  text_SC_NotConnected->Draw("SAME");
11166  }
11167  //Double_t xtext = xinf_his - (xsup_his-xinf_his)/8.;
11168  //Double_t ytextp = yinf - (ysup-yinf)/6.;
11169  //sprintf( f_in, "Special SC => ");
11170  //TText *text_legend_NotConnected = new TText(xtext, ytext, f_in); fCnewRoot++;
11171  //text_legend_NotConnected->SetTextColor(coul_notconnected);
11172  //text_legend_NotConnected->SetTextSize((Double_t)0.03);
11173  //text_legend_NotConnected->Draw("SAME");
11174 
11175  //............................................................... Not complete SC's
11176  Color_t coul_notcomplete = fCnaParHistos->ColorDefinition("rouge40");
11177  for (Int_t i = 1; i <= fEcal->NumberOfNotCompleteSCs(); i++) {
11178  Int_t index = 0;
11179  if (fFapStexNumber == 1 || fFapStexNumber == 3) {
11180  index = 2 * i - 1;
11181  }
11182  if (fFapStexNumber == 2 || fFapStexNumber == 4) {
11183  index = 2 * i;
11184  }
11185  //................. display of the not complete SC's numbers (+ vertical line)
11186  Double_t xBinNotCompleteSC = NotCompleteSCH1DBin(index);
11187  TLine* lin_notcomplete = new TLine(xBinNotCompleteSC, yinf, xBinNotCompleteSC, ysup);
11188  fCnewRoot++;
11189  lin_notcomplete->SetLineColor(coul_notcomplete);
11190  lin_notcomplete->SetLineStyle(3);
11191  lin_notcomplete->Draw();
11192 
11193  Double_t xBinNotCompleteSCEnd = NotCompleteSCH1DBin(index) + fEcal->MaxCrysInSC();
11194  ;
11195  TLine* lin_notcomplete_end = new TLine(xBinNotCompleteSCEnd, yinf, xBinNotCompleteSCEnd, ysup);
11196  fCnewRoot++;
11197  lin_notcomplete_end->SetLineColor(coul_notcomplete);
11198  lin_notcomplete_end->SetLineStyle(3);
11199  lin_notcomplete_end->Draw();
11200 
11201  sprintf(f_in, "%d", GetNotCompleteDSSCFromIndex(index));
11202  // sprintf( f_in, "%d", GetNotCompleteSCForConsFromIndex(index) );
11203  TText* text_SC_NotComplete = new TText(xBinNotCompleteSC, ytext, f_in);
11204  fCnewRoot++;
11205  text_SC_NotComplete->SetTextAngle((Double_t)45.);
11206  text_SC_NotComplete->SetTextColor(coul_notcomplete);
11207  text_SC_NotComplete->SetTextFont(42);
11208  text_SC_NotComplete->SetTextSize((Double_t)0.03);
11209  text_SC_NotComplete->Draw("SAME");
11210  }
11211  //Double_t xtextp = xinf_his + (xsup_his-xinf_his)/15.;
11212  //sprintf( f_in, "Not complete SC");
11213  //TText *text_legend_NotComplete = new TText(xtextp, ytextp, f_in); fCnewRoot++;
11214  //text_legend_NotComplete->SetTextColor(coul_notcomplete);
11215  //text_legend_NotComplete->SetTextSize((Double_t)0.03);
11216  //text_legend_NotComplete->Draw("SAME");
11217  }
11218  }
11219  } // end of if( ( opt_plot == fOnlyOnePlot )
11220  // || ( (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) && xMemoPlotSame == 0 ) )
11221 
11222  //..............................................Top Axis (HistoPlot)
11223  Int_t min_value = 0;
11224  Int_t max_value = 0;
11225  if (HistoType == "Global") {
11226  if (fFapStexNumber > 0) {
11227  //.......................... Axis for the Stin numbers and Data sectors (EE) numbers
11228  if (fFlagSubDet == "EB") {
11229  min_value = 0;
11231  }
11232  if (fFlagSubDet == "EE") {
11233  if (fFapStexNumber == 1) {
11234  min_value = 1;
11235  max_value = 5;
11236  }
11237  if (fFapStexNumber == 2) {
11238  min_value = 5;
11239  max_value = 9;
11240  }
11241  if (fFapStexNumber == 3) {
11242  min_value = 5;
11243  max_value = 9;
11244  }
11245  if (fFapStexNumber == 4) {
11246  min_value = 1;
11247  max_value = 5;
11248  }
11249  }
11250  }
11251  if (fFapStexNumber == 0) {
11252  //.......................... Axis for the SM (EB) and Dee numbers (EE)
11253  if (fFlagSubDet == "EB") {
11254  min_value = 0;
11255  max_value = fEcal->MaxStexInStas() - 1;
11256  }
11257  if (fFlagSubDet == "EE") {
11258  min_value = 1;
11260  }
11261  }
11262  TopAxisForHistos(h_his0, opt_plot, xMemoPlotSame, min_value, max_value, xFlagAutoYsupMargin, HisSize);
11263  } // end of if (HistoType == "Global")
11264 
11265  if (!((HistoType == "H1Basic" || HistoType == "H1BasicProj") &&
11266  (arg_AlreadyRead > 1 && arg_AlreadyRead < fEcal->MaxCrysInStin()))) {
11267  gPad->Update();
11268  }
11269  } else // else du if(main_subpad !=0)
11270  {
11271  std::cout << "*TEcnaHistos::HistoPlot(...)> Canvas not found. Previously closed in option SAME." << fTTBELL
11272  << std::endl;
11273 
11274  ReInitCanvas(HistoCode, opt_plot);
11275  xMemoPlotSame = 0;
11276  }
11277 
11278  // delete MainCanvas; fCdeleteRoot++;
11279 
11280 } // end of HistoPlot
11281 
11282 TString TEcnaHistos::StexNumberToString(const Int_t& StexNumber) {
11283  // Convert Int_t StexNumber into TString: "StexNumber" if StexNumber in [-18,36]
11284  // or into TString: "EB" or "EE" if StexNumber = 0.
11285 
11286  TString sFapStexNumber = "?";
11287  if (StexNumber == -1) {
11288  sFapStexNumber = " -1";
11289  }
11290  if (StexNumber == -2) {
11291  sFapStexNumber = " -2";
11292  }
11293  if (StexNumber == -3) {
11294  sFapStexNumber = " -3";
11295  }
11296  if (StexNumber == -4) {
11297  sFapStexNumber = " -4";
11298  }
11299  if (StexNumber == -5) {
11300  sFapStexNumber = " -5";
11301  }
11302  if (StexNumber == -6) {
11303  sFapStexNumber = " -6";
11304  }
11305  if (StexNumber == -7) {
11306  sFapStexNumber = " -7";
11307  }
11308  if (StexNumber == -8) {
11309  sFapStexNumber = " -8";
11310  }
11311  if (StexNumber == -9) {
11312  sFapStexNumber = " -9";
11313  }
11314  if (StexNumber == -10) {
11315  sFapStexNumber = "-10";
11316  }
11317  if (StexNumber == -11) {
11318  sFapStexNumber = "-11";
11319  }
11320  if (StexNumber == -12) {
11321  sFapStexNumber = "-12";
11322  }
11323  if (StexNumber == -13) {
11324  sFapStexNumber = "-13";
11325  }
11326  if (StexNumber == -14) {
11327  sFapStexNumber = "-14";
11328  }
11329  if (StexNumber == -15) {
11330  sFapStexNumber = "-15";
11331  }
11332  if (StexNumber == -16) {
11333  sFapStexNumber = "-16";
11334  }
11335  if (StexNumber == -17) {
11336  sFapStexNumber = "-17";
11337  }
11338  if (StexNumber == -18) {
11339  sFapStexNumber = "-18";
11340  }
11341  if (StexNumber == 0) {
11342  sFapStexNumber = fFlagSubDet;
11343  }
11344  if (StexNumber == 1) {
11345  sFapStexNumber = " 1";
11346  }
11347  if (StexNumber == 2) {
11348  sFapStexNumber = " 2";
11349  }
11350  if (StexNumber == 3) {
11351  sFapStexNumber = " 3";
11352  }
11353  if (StexNumber == 4) {
11354  sFapStexNumber = " 4";
11355  }
11356  if (StexNumber == 5) {
11357  sFapStexNumber = " 5";
11358  }
11359  if (StexNumber == 6) {
11360  sFapStexNumber = " 6";
11361  }
11362  if (StexNumber == 7) {
11363  sFapStexNumber = " 7";
11364  }
11365  if (StexNumber == 8) {
11366  sFapStexNumber = " 8";
11367  }
11368  if (StexNumber == 9) {
11369  sFapStexNumber = " 9";
11370  }
11371  if (StexNumber == 10) {
11372  sFapStexNumber = " 10";
11373  }
11374  if (StexNumber == 11) {
11375  sFapStexNumber = " 11";
11376  }
11377  if (StexNumber == 12) {
11378  sFapStexNumber = " 12";
11379  }
11380  if (StexNumber == 13) {
11381  sFapStexNumber = " 13";
11382  }
11383  if (StexNumber == 14) {
11384  sFapStexNumber = " 14";
11385  }
11386  if (StexNumber == 15) {
11387  sFapStexNumber = " 15";
11388  }
11389  if (StexNumber == 16) {
11390  sFapStexNumber = " 16";
11391  }
11392  if (StexNumber == 17) {
11393  sFapStexNumber = " 17";
11394  }
11395  if (StexNumber == 18) {
11396  sFapStexNumber = " 18";
11397  }
11398  if (StexNumber == 19) {
11399  sFapStexNumber = " -1";
11400  }
11401  if (StexNumber == 20) {
11402  sFapStexNumber = " -2";
11403  }
11404  if (StexNumber == 21) {
11405  sFapStexNumber = " -3";
11406  }
11407  if (StexNumber == 22) {
11408  sFapStexNumber = " -4";
11409  }
11410  if (StexNumber == 23) {
11411  sFapStexNumber = " -5";
11412  }
11413  if (StexNumber == 24) {
11414  sFapStexNumber = " -6";
11415  }
11416  if (StexNumber == 25) {
11417  sFapStexNumber = " -7";
11418  }
11419  if (StexNumber == 26) {
11420  sFapStexNumber = " -8";
11421  }
11422  if (StexNumber == 27) {
11423  sFapStexNumber = " -9";
11424  }
11425  if (StexNumber == 28) {
11426  sFapStexNumber = "-10";
11427  }
11428  if (StexNumber == 29) {
11429  sFapStexNumber = "-11";
11430  }
11431  if (StexNumber == 30) {
11432  sFapStexNumber = "-12";
11433  }
11434  if (StexNumber == 31) {
11435  sFapStexNumber = "-13";
11436  }
11437  if (StexNumber == 32) {
11438  sFapStexNumber = "-14";
11439  }
11440  if (StexNumber == 33) {
11441  sFapStexNumber = "-15";
11442  }
11443  if (StexNumber == 34) {
11444  sFapStexNumber = "-16";
11445  }
11446  if (StexNumber == 35) {
11447  sFapStexNumber = "-17";
11448  }
11449  if (StexNumber == 36) {
11450  sFapStexNumber = "-18";
11451  }
11452  return sFapStexNumber;
11453 }
11454 
11456  // gives the x coordinate for the i_th NotConnected SC
11457  // GetDSOffset(DeeNumber, DataSector) , GetSCOffset(DeeNumber, DataSector, SC_in_DS)
11458 
11459  Double_t xbin = (Double_t)(-1);
11460 
11461  if (index == 1) {
11462  xbin = GetDSOffset(1, 1) + GetSCOffset(1, 1, 30);
11463  } // nb_for_cons == 182 (D1,S1) (D3,S9)
11464  if (index == 2) {
11465  xbin = GetDSOffset(2, 9) + GetSCOffset(2, 9, 30);
11466  } // nb_for_cons == 33 (D2,S9) (D4,S1)
11467 
11468  if (index == 3) {
11469  xbin = GetDSOffset(1, 2) + GetSCOffset(1, 2, 3);
11470  } // nb_for_cons == 178 (D1,S2) (D3,S8)
11471  if (index == 4) {
11472  xbin = GetDSOffset(2, 8) + GetSCOffset(2, 8, 3);
11473  } // nb_for_cons == 29 (D2,S8) (D4,S2)
11474 
11475  if (index == 5) {
11476  xbin = GetDSOffset(1, 2) + GetSCOffset(1, 2, 25);
11477  } // nb_for_cons == 207 (D1,S2) (D3,S8)
11478  if (index == 6) {
11479  xbin = GetDSOffset(2, 8) + GetSCOffset(2, 8, 25);
11480  } // nb_for_cons == 58 (D2,S8) (D4,S2)
11481 
11482  if (index == 7) {
11483  xbin = GetDSOffset(1, 3) + GetSCOffset(1, 3, 34);
11484  } // nb_for_cons == 298 (D1,S3) (D3,S7)
11485  if (index == 8) {
11486  xbin = GetDSOffset(2, 7) + GetSCOffset(2, 7, 34);
11487  } // nb_for_cons == 149 (D2,S7) (D4,S3)
11488 
11489  if (index == 9) {
11490  xbin = GetDSOffset(1, 4) + GetSCOffset(1, 4, 14);
11491  } // nb_for_cons == 261 (D1,S4) (D3,S6)
11492  if (index == 10) {
11493  xbin = GetDSOffset(2, 6) + GetSCOffset(2, 6, 14);
11494  } // nb_for_cons == 112 (D2,S6) (D4,S4)
11495  if (index == 11) {
11496  xbin = GetDSOffset(1, 4) + GetSCOffset(1, 4, 21);
11497  } // nb_for_cons == 268 (D1,S4) (D3,S6)
11498  if (index == 12) {
11499  xbin = GetDSOffset(2, 6) + GetSCOffset(2, 6, 21);
11500  } // nb_for_cons == 119 (D2,S6) (D4,S4)
11501 
11502  if (index == 13) {
11503  xbin = GetDSOffset(1, 5) + GetSCOffset(1, 5, 20);
11504  } // nb_for_cons == 281 (D1,S5) (D3,S5)
11505  if (index == 14) {
11506  xbin = GetDSOffset(2, 5) + GetSCOffset(2, 5, 3);
11507  } // nb_for_cons == 132 (D2,S5) (D4,S5)
11508 
11509  return xbin;
11510 }
11511 
11512 Double_t TEcnaHistos::NotCompleteSCH1DBin(const Int_t& index) {
11513  // gives the x coordinate for the i_th NotConnected SC
11514 
11515  Double_t xbin = (Double_t)(-1);
11516 
11517  if (index == 1) {
11518  xbin = GetDSOffset(1, 1) + GetSCOffset(1, 1, 12);
11519  } // nb_for_cons == 161 (D1,S1) (D3,S9)
11520  if (index == 2) {
11521  xbin = GetDSOffset(2, 9) + GetSCOffset(2, 9, 12);
11522  } // nb_for_cons == 12 (D2,S9) (D4,S1)
11523 
11524  if (index == 3) {
11525  xbin = GetDSOffset(1, 2) + GetSCOffset(1, 2, 32);
11526  } // nb_for_cons == 216 (D1,S2) (D3,S8)
11527  if (index == 4) {
11528  xbin = GetDSOffset(2, 8) + GetSCOffset(2, 8, 32);
11529  } // nb_for_cons == 67 (D2,S8) (D4,S2)
11530 
11531  if (index == 5) {
11532  xbin = GetDSOffset(1, 3) + GetSCOffset(1, 3, 10);
11533  } // nb_for_cons == 224 (D1,S3) (D3,S7)
11534  if (index == 6) {
11535  xbin = GetDSOffset(2, 7) + GetSCOffset(2, 7, 10);
11536  } // nb_for_cons == 75 (D2,S7) (D4,S3)
11537 
11538  if (index == 7) {
11539  xbin = GetDSOffset(1, 5) + GetSCOffset(1, 5, 23);
11540  } // nb_for_cons == 286 (D1,S5) (D3,S5)
11541  if (index == 8) {
11542  xbin = GetDSOffset(2, 5) + GetSCOffset(2, 5, 6);
11543  } // nb_for_cons == 137 (D2,S5) (D4,S5)
11544 
11545  return xbin;
11546 }
11547 
11549  Int_t SCForCons = 0;
11550  if (index == 1) {
11551  SCForCons = 182;
11552  } // (D1,S1) (D3,S9)
11553  if (index == 2) {
11554  SCForCons = 33;
11555  } // (D2,S9) (D4,S1)
11556 
11557  if (index == 3) {
11558  SCForCons = 178;
11559  } // (D1,S2) (D3,S8)
11560  if (index == 4) {
11561  SCForCons = 29;
11562  } // (D2,S8) (D4,S2)
11563  if (index == 5) {
11564  SCForCons = 207;
11565  } // (D1,S2) (D3,S8)
11566  if (index == 6) {
11567  SCForCons = 58;
11568  } // (D2,S8) (D4,S2)
11569 
11570  if (index == 7) {
11571  SCForCons = 298;
11572  } // (D1,S3) (D3,S7)
11573  if (index == 8) {
11574  SCForCons = 149;
11575  } // (D2,S7) (D4,S3)
11576 
11577  if (index == 9) {
11578  SCForCons = 261;
11579  } // (D1,S4) (D3,S6)
11580  if (index == 10) {
11581  SCForCons = 112;
11582  } // (D2,S6) (D4,S4)
11583  if (index == 11) {
11584  SCForCons = 268;
11585  } // (D1,S4) (D3,S6)
11586  if (index == 12) {
11587  SCForCons = 119;
11588  } // (D2,S6) (D4,S4)
11589 
11590  if (index == 13) {
11591  SCForCons = 281;
11592  } // (D1,S5) (D3,S5)
11593  if (index == 14) {
11594  SCForCons = 132;
11595  } // (D2,S5) (D4,S5)
11596  return SCForCons;
11597 }
11598 
11600  Int_t DSSC = 0;
11601  if (index == 1) {
11602  DSSC = 30;
11603  } // (D1,S1) (D3,S9)
11604  if (index == 2) {
11605  DSSC = 30;
11606  } // (D2,S9) (D4,S1)
11607 
11608  if (index == 3) {
11609  DSSC = 3;
11610  } // (D1,S2) (D3,S8)
11611  if (index == 4) {
11612  DSSC = 3;
11613  } // (D2,S8) (D4,S2)
11614  if (index == 5) {
11615  DSSC = 25;
11616  } // (D1,S2) (D3,S8)
11617  if (index == 6) {
11618  DSSC = 25;
11619  } // (D2,S8) (D4,S2)
11620 
11621  if (index == 7) {
11622  DSSC = 34;
11623  } // (D1,S3) (D3,S7)
11624  if (index == 8) {
11625  DSSC = 34;
11626  } // (D2,S7) (D4,S3)
11627 
11628  if (index == 9) {
11629  DSSC = 14;
11630  } // (D1,S4) (D3,S6)
11631  if (index == 10) {
11632  DSSC = 14;
11633  } // (D2,S6) (D4,S4)
11634  if (index == 11) {
11635  DSSC = 21;
11636  } // (D1,S4) (D3,S6)
11637  if (index == 12) {
11638  DSSC = 21;
11639  } // (D2,S6) (D4,S4)
11640 
11641  if (index == 13) {
11642  DSSC = 20;
11643  } // (D1,S5) (D3,S5)
11644  if (index == 14) {
11645  DSSC = 3;
11646  } // (D2,S5) (D4,S5)
11647  return DSSC;
11648 }
11649 
11651  Int_t DSSC = 0;
11652  if (index == 1) {
11653  DSSC = 161;
11654  } // (D1,S1) (D3,S9)
11655  if (index == 2) {
11656  DSSC = 12;
11657  } // (D2,S9) (D4,S1)
11658 
11659  if (index == 3) {
11660  DSSC = 216;
11661  } // (D1,S2) (D3,S8)
11662  if (index == 4) {
11663  DSSC = 67;
11664  } // (D2,S8) (D4,S2)
11665 
11666  if (index == 5) {
11667  DSSC = 224;
11668  } // (D1,S3) (D3,S7)
11669  if (index == 6) {
11670  DSSC = 75;
11671  } // (D2,S7) (D4,S3)
11672 
11673  if (index == 7) {
11674  DSSC = 286;
11675  } // (D1,S5) (D3,S5)
11676  if (index == 8) {
11677  DSSC = 137;
11678  } // (D2,S5) (D4,S5)
11679  return DSSC;
11680 }
11681 
11683  Int_t DSSC = 0;
11684  if (index == 1) {
11685  DSSC = 12;
11686  } // (D1,S1) (D3,S9)
11687  if (index == 2) {
11688  DSSC = 12;
11689  } // (D2,S9) (D4,S1)
11690 
11691  if (index == 3) {
11692  DSSC = 32;
11693  } // (D1,S2) (D3,S8)
11694  if (index == 4) {
11695  DSSC = 32;
11696  } // (D2,S8) (D4,S2)
11697 
11698  if (index == 5) {
11699  DSSC = 10;
11700  } // (D1,S3) (D3,S7)
11701  if (index == 6) {
11702  DSSC = 10;
11703  } // (D2,S7) (D4,S3)
11704 
11705  if (index == 7) {
11706  DSSC = 23;
11707  } // (D1,S5) (D3,S5)
11708  if (index == 8) {
11709  DSSC = 6;
11710  } // (D2,S5) (D4,S5)
11711  return DSSC;
11712 }
11713 //----------------------------------------------- HistimePlot
11714 void TEcnaHistos::HistimePlot(TGraph* g_graph0,
11715  Axis_t xinf,
11716  Axis_t xsup,
11717  const TString& HistoCode,
11718  const TString& HistoType,
11719  const Int_t& StexStin_A,
11720  const Int_t& i0StinEcha,
11721  const Int_t& i0Sample,
11722  const Int_t& opt_scale_x,
11723  const Int_t& opt_scale_y,
11724  const TString& opt_plot,
11725  const Int_t& xFlagAutoYsupMargin) {
11726  // Plot 1D histogram for evolution in time
11727 
11728  UInt_t canv_w = fCnaParHistos->SetCanvasWidth(HistoCode, opt_plot);
11729  UInt_t canv_h = fCnaParHistos->SetCanvasHeight(HistoCode, opt_plot);
11730 
11731  SetGraphPresentation(g_graph0, HistoType.Data(), opt_plot.Data()); // (gStyle parameters)}
11732 
11733  //...................................................... paves commentaires (HistimePlot)
11734  SetAllPavesViewHisto(HistoCode, StexStin_A, i0StinEcha, i0Sample, opt_plot);
11735 
11736  //..................................................... Canvas name (HistimePlot)
11737  Int_t arg_AlreadyRead = 0;
11738  TString canvas_name = SetCanvasName(
11739  HistoCode.Data(), opt_scale_x, opt_scale_y, opt_plot, arg_AlreadyRead, StexStin_A, i0StinEcha, i0Sample);
11740 
11741  //------------------------------------------------ Canvas allocation (HistimePlot)
11742  //......................................... declarations canvas et pad
11743  TCanvas* MainCanvas = nullptr;
11744 
11745  if (opt_plot == fOnlyOnePlot) {
11746  MainCanvas = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
11747  fCnewRoot++;
11748  fCurrentPad = gPad;
11749  fCurrentCanvas = MainCanvas;
11750  fCurrentCanvasName = canvas_name.Data();
11751  }
11752 
11753  if (opt_plot == fSeveralPlot) {
11754  if (GetMemoFlag(HistoCode, opt_plot) == "Free") {
11755  MainCanvas = CreateCanvas(HistoCode, opt_plot, canvas_name, canv_w, canv_h);
11756  fCurrentPad = gPad;
11757  fCurrentCanvas = MainCanvas;
11758  fCurrentCanvasName = canvas_name.Data();
11759  }
11760  }
11761 
11762  if (opt_plot == fSameOnePlot) {
11763  if (GetMemoFlag(HistoCode, opt_plot) == "Free") {
11764  MainCanvas = CreateCanvas(HistoCode, opt_plot, canvas_name, canv_w, canv_h);
11765  fCurrentPad = gPad;
11766  fCurrentCanvas = MainCanvas;
11767  fCurrentCanvasName = canvas_name.Data();
11768  }
11769  }
11770 
11771  // std::cout << "*TEcnaHistos::HistimePlot(...)> Plot is displayed on canvas ----> " << canvas_name.Data() << std::endl;
11772 
11773  //--------------- EE => SC for construction, EB => Xtal in SM (default: Stin ECNA number, i0StinEcha)
11774  Int_t Stex_StinCons = StexStin_A; // Stex_StinCons = Tower for EB, SC for construction for EE
11775  Int_t n1StexCrys = i0StinEcha + 1; // n1StexCrys = Crys in SM for EB
11776 
11777  if (StexStin_A >= 1 && StexStin_A <= fEcal->MaxStinEcnaInStex()) {
11778  if (fFlagSubDet == "EB") {
11779  n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
11780  }
11781  if (fFlagSubDet == "EE") {
11782  Stex_StinCons = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A);
11783  }
11784  }
11785 
11786  //------ String for StexNumber ( to display "EB" or "EE" if Stex = 0 )
11787  TString sFapStexNumber = StexNumberToString(fFapStexNumber);
11788 
11789  //============================================================================= (HistimePlot)
11790  //
11791  // 1st OPERATIONS: Pave texts preparation and first Draw.
11792  // SetParametersCanvas
11793  // Set Memo Flags.
11794  // Set main_subpad and main_pavtxt
11795  //
11796  //=============================================================================
11797  TVirtualPad* main_subpad = nullptr; // main_subpad: Pad for the histo
11798  TPaveText* main_pavtxt = nullptr; // main_pavtxt: pave for changing parameters
11799 
11800  Int_t xMemoPlotSame = 1; // a priori ==> SAME plot
11801 
11802  TString QuantityName = fCnaParHistos->GetQuantityName(HistoCode.Data());
11803 
11804  //========================================= Option ONLYONE (HistimePlot)
11805  if (opt_plot == fOnlyOnePlot) {
11806  //................................. Draw titles and paves (pad = main canvas)
11807  if (fPavComGeneralTitle != nullptr) {
11808  fPavComGeneralTitle->Draw();
11809  }
11810  fPavComStex->Draw();
11811 
11812  if (!(HistoType == "Global" || HistoType == "Proj")) {
11813  fPavComStin->Draw();
11814  fPavComXtal->Draw();
11815  }
11816  fPavComEvolNbOfEvtsAna->Draw();
11817  fPavComEvolRuns->Draw();
11818 
11819  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
11820  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
11821  Double_t y_low = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
11822  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_EB") - 0.005;
11823 
11824  Double_t x_margin = x_low;
11825  Double_t y_margin = y_low;
11826 
11827  Color_t fond_pad = fCnaParHistos->ColorDefinition("gris18");
11828 
11829  MainCanvas->Divide(1, 1, x_margin, y_margin, fond_pad);
11830  // Divide(nx, ny, x_margin, y_margin, color);
11831 
11832  gPad->cd(1);
11833  main_subpad = gPad;
11834  main_subpad->SetPad(x_low, y_low, x_up, y_up);
11835 
11836  xMemoPlotSame = 0;
11837  }
11838  //========================================= Options SAME and SAME n (HistimePlot)
11839  if (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) {
11840  if (GetMemoFlag(HistoCode, opt_plot) == "Free") {
11841  if (fPavComGeneralTitle != nullptr) {
11842  fPavComGeneralTitle->Draw();
11843  }
11844  fPavComSeveralChanging->Draw();
11845 
11846  fPavComEvolRuns->Draw();
11847 
11848  if (!(HistoType == "Global" || HistoType == "Proj" || HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" ||
11849  HistoCode == "H_MCs_Date" || HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" ||
11850  HistoCode == "H_SCs_Date")) {
11851  fPavComStin->Draw();
11852  fPavComXtal->Draw();
11853  }
11854 
11855  if (!(HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
11856  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date")) {
11857  fPavComXtal->Draw();
11858  }
11859  //Call to SetParametersPavTxt
11860  //fPavTxt<HISTOCODE> = fPavComSeveralChanging; => come from SetAllPavesViewHisto
11861  SetParametersPavTxt(HistoCode, opt_plot);
11862 
11863  //---------------- Call to ActivePavTxt
11864  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
11865  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
11866 
11867  //-------------------- Set texts for pave "several changing", options SAME and SAME n (HistimePlot)
11868  main_pavtxt->SetTextAlign(fTextPaveAlign);
11869  main_pavtxt->SetTextFont(fTextPaveFont);
11870  main_pavtxt->SetTextSize(fTextPaveSize);
11871  main_pavtxt->SetBorderSize(fTextBorderSize);
11872 
11873  char f_in[charArrLen];
11874 
11875  TString DecalStexName = "";
11876  if (fFlagSubDet == "EB") {
11877  DecalStexName = " ";
11878  }
11879  TString DecalStinName = "";
11880  if (fFlagSubDet == "EE") {
11881  DecalStinName = " ";
11882  }
11883 
11884  TString sStexOrStasName = "";
11885  if (fFapStexNumber == 0) {
11886  sStexOrStasName = " ";
11887  }
11888  if (fFapStexNumber != 0) {
11889  sStexOrStasName = fFapStexName;
11890  }
11891 
11892  //-----------------------------> HistoType = "EvolProj" => treated in HistoPlot, not here.
11893  if (opt_plot == fSeveralPlot) {
11894  sprintf(f_in,
11895  "Analysis Samp Evts range Nb Evts %s%s %s%s %s %s",
11896  DecalStexName.Data(),
11897  sStexOrStasName.Data(),
11898  DecalStinName.Data(),
11899  fFapStinName.Data(),
11900  fFapXtalName.Data(),
11901  fFapEchaName.Data());
11902  }
11903  if (opt_plot == fSameOnePlot) {
11904  sprintf(f_in,
11905  "Analysis Samp Evts range Nb Evts %s%s %s%s %s %s",
11906  DecalStexName.Data(),
11907  sStexOrStasName.Data(),
11908  DecalStinName.Data(),
11909  fFapStinName.Data(),
11910  fFapXtalName.Data(),
11911  fFapEchaName.Data());
11912  }
11913 
11914  //................................................................... (HistimePlot)
11915  TText* ttit = main_pavtxt->AddText(f_in);
11916  ttit->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
11917 
11918  if (opt_plot == fSeveralPlot) {
11919  sprintf(f_in,
11920  "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%6d",
11921  fFapAnaType.Data(),
11926  sFapStexNumber.Data(),
11927  Stex_StinCons,
11928  n1StexCrys,
11929  i0StinEcha);
11930  }
11931  if (opt_plot == fSameOnePlot) {
11932  sprintf(f_in,
11933  "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%6d %-25s",
11934  fFapAnaType.Data(),
11939  sFapStexNumber.Data(),
11940  Stex_StinCons,
11941  n1StexCrys,
11942  i0StinEcha,
11943  QuantityName.Data());
11944  }
11945 
11946  TText* tt = main_pavtxt->AddText(f_in);
11947  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
11948 
11949  //---------- Draw the "several changing" pave with its text in the Canvas (FIRST TIME) (HistimePlot)
11950  main_pavtxt->Draw();
11951 
11952  //---------------- Call to SetParametersCanvas
11953  //fImp<HISTOCODE> = (TCanvasImp*)fCanv<HISTOCODE>->GetCanvasImp();
11954  //fCanv<HISTOCODE>->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
11955  //fPad<HISTOCODE> = gPad;
11956  //fMemoPlot<HISTOCODE> = 1; =======> set MemoFlag to "Buzy"
11957  //fMemoColor<HISTOCODE> = 0;
11958  SetParametersCanvas(HistoCode, opt_plot);
11959 
11960  //---------------- Set xMemoPlotSame to 0
11961  xMemoPlotSame = 0;
11962  }
11963 
11964  //............................ cases fMemoPlotxxx = 1 (HistimePlot)
11965  if (GetMemoFlag(HistoCode, opt_plot) == "Busy") {
11966  //---------------- Call to ActivePavTxt
11967  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
11968  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
11969 
11970  //---------------- Call to ActivePad
11971  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
11972 
11973  //---------------- Recover pointer to the current canvas
11974  MainCanvas = GetCurrentCanvas(HistoCode.Data(), opt_plot.Data());
11975  }
11976  }
11977 
11978  //============================================================================= (HistimePlot)
11979  //
11980  // 2nd OPERATIONS: Write and Draw the parameter values in the
11981  // "several changing" pave (options SAME and SAME n)
11982  // Draw Histo
11983  //=============================================================================
11984  if (main_subpad != nullptr) {
11985  if (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) {
11986  if (xMemoPlotSame != 0) {
11987  main_pavtxt->SetTextAlign(fTextPaveAlign);
11988  main_pavtxt->SetTextFont(fTextPaveFont);
11989  main_pavtxt->SetTextSize(fTextPaveSize);
11990  main_pavtxt->SetBorderSize(fTextBorderSize);
11991 
11992  char f_in[charArrLen];
11993 
11994  if (opt_plot == fSeveralPlot) {
11995  sprintf(f_in,
11996  "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%6d",
11997  fFapAnaType.Data(),
12002  sFapStexNumber.Data(),
12003  Stex_StinCons,
12004  n1StexCrys,
12005  i0StinEcha);
12006  }
12007  if (opt_plot == fSameOnePlot) {
12008  sprintf(f_in,
12009  "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%6d %-25s",
12010  fFapAnaType.Data(),
12015  sFapStexNumber.Data(),
12016  Stex_StinCons,
12017  n1StexCrys,
12018  i0StinEcha,
12019  QuantityName.Data());
12020  }
12021 
12022  TText* tt = main_pavtxt->AddText(f_in);
12023  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
12024  MainCanvas->cd();
12025  gStyle->SetOptDate(0);
12026  main_pavtxt->Draw();
12027  }
12028  main_subpad->cd();
12029  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
12030  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
12031  Double_t y_low = fCnaParHistos->BoxTopY("several_evol_box") + 0.005;
12032  Double_t y_up = fCnaParHistos->BoxBottomY("general_comment") - 0.005;
12033  if (opt_plot == fSameOnePlot) {
12034  y_up = fCnaParHistos->BoxBottomY("top_left_box_EB") - 0.005;
12035  }
12036  main_subpad->SetPad(x_low, y_low, x_up, y_up);
12037  }
12038 
12039  //............................................ Style (HistimePlot)
12040  SetViewGraphColors(g_graph0, HistoCode, opt_plot);
12041 
12042  //................................. Set axis titles
12043  TString axis_x_var_name = SetHistoXAxisTitle(HistoCode);
12044  TString axis_y_var_name = SetHistoYAxisTitle(HistoCode);
12045  g_graph0->GetXaxis()->SetTitle(axis_x_var_name);
12046  g_graph0->GetYaxis()->SetTitle(axis_y_var_name);
12047 
12048  //................................. Xaxis is a time axis
12049  g_graph0->GetXaxis()->SetTimeDisplay(1);
12050  g_graph0->GetXaxis()->SetTimeFormat("%d %b-%Hh");
12051 
12052  g_graph0->GetXaxis()->SetTimeOffset(xinf);
12053 
12054  Int_t nb_displayed = fCnaParHistos->GetNbOfRunsDisplayed(); // max nb of run numbers displayed
12055 
12056  //........................................................................... (HistimePlot)
12057  Int_t liny = 0;
12058  Int_t logy = 1;
12059 
12060  if (opt_plot == fOnlyOnePlot) {
12061  fXinf = (Double_t)xinf;
12062  fXsup = (Double_t)xsup;
12063  fYinf = (Double_t)GetYminValueFromMemo(HistoCode);
12064  fYsup = (Double_t)GetYmaxValueFromMemo(HistoCode);
12065 
12066  gPad->RangeAxis(fXinf, fYinf, fXsup, fYsup);
12067 
12068  //if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(liny);}
12069  if (opt_scale_y == fOptScaleLogy) {
12070  gPad->SetLogy(logy);
12071  g_graph0->Draw("ALP");
12072  }
12073 
12074  if (opt_scale_y == fOptScaleLiny) {
12075  gPad->SetLogy(liny);
12076  g_graph0->Draw("ALP");
12077  Int_t nb_pts = g_graph0->GetN();
12078  Double_t* coord_x = g_graph0->GetX();
12079  Double_t* coord_y = g_graph0->GetY();
12080 
12081  char f_in[charArrLen];
12082 
12083  //................. display of the run numbers (HistimePlot)
12084  Double_t interv_displayed = (coord_x[nb_pts - 1] - coord_x[0]) / (Double_t)nb_displayed;
12085  Double_t last_drawn_coordx = coord_x[0] - 1.5 * interv_displayed;
12086 
12087  for (Int_t i_run = 0; i_run < nb_pts; i_run++) {
12088  if ((coord_x[i_run] - last_drawn_coordx) > interv_displayed) {
12089  Double_t joinYinf = fYinf;
12090  Double_t joinYsup = fYsup;
12091  if (joinYsup <= joinYinf) {
12094  joinYsup = joinYsup + (joinYsup - joinYinf) / 20.;
12095  }
12096 
12097  sprintf(f_in, "R%d", fT1DRunNumber[i_run]);
12098  TText* text_run_num = new TText(coord_x[i_run], joinYsup, f_in);
12099  fCnewRoot++;
12100  text_run_num->SetTextAngle((Double_t)45.);
12101  text_run_num->SetTextSize((Double_t)0.035);
12102  text_run_num->Draw("SAME");
12103  // delete text_StexStin_num; fCdeleteRoot++;
12104 
12105  TLine* jointlign;
12106  jointlign = new TLine(coord_x[i_run], joinYsup, coord_x[i_run], coord_y[i_run]);
12107  fCnewRoot++;
12108  jointlign->SetLineWidth(1);
12109  jointlign->SetLineStyle(2);
12110  jointlign->Draw("SAME");
12111  // delete jointlign; fCdeleteRoot++;
12112 
12113  last_drawn_coordx = coord_x[i_run]; // (HistimePlot)
12114  }
12115  }
12116  }
12117  if (opt_scale_y == fOptScaleLogy) {
12118  gPad->SetLogy(logy);
12119  g_graph0->Draw("ALP");
12120  }
12121  }
12122 
12123  //...................................................................... (HistimePlot)
12124  if (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) {
12125  if (xMemoPlotSame == 0) {
12126  if (opt_scale_y == fOptScaleLiny) {
12127  gPad->SetLogy(liny);
12128  }
12129  if (opt_scale_y == fOptScaleLogy) {
12130  gPad->SetLogy(logy);
12131  }
12132  g_graph0->Draw("ALP");
12133 
12134  fXinf = (Double_t)xinf;
12135  fXsup = (Double_t)xsup;
12136  fYinf = (Double_t)GetYminValueFromMemo(HistoCode);
12137  fYsup = (Double_t)GetYmaxValueFromMemo(HistoCode);
12138 
12139  gPad->RangeAxis(fXinf, fYinf, fXsup, fYsup);
12140  }
12141 
12142  if (xMemoPlotSame != 0) // (HistimePlot)
12143  {
12144  if (opt_scale_y == fOptScaleLiny) {
12145  gPad->SetLogy(liny);
12146  }
12147  if (opt_scale_y == fOptScaleLogy) {
12148  gPad->SetLogy(logy);
12149  }
12150 
12151  g_graph0->Draw("LP");
12152  }
12153  }
12154  gPad->Update();
12155  } else // else du if(main_subpad !=0)
12156  {
12157  std::cout << "*TEcnaHistos::HistimePlot(...)> Canvas not found. Previously closed in option SAME." << fTTBELL
12158  << std::endl;
12159 
12160  ReInitCanvas(HistoCode, opt_plot);
12161  xMemoPlotSame = 0;
12162  }
12163 
12164  // delete MainCanvas; fCdeleteRoot++;
12165 
12166 } // end of HistimePlot
12167 
12168 //------------------------------------------------------------------------------------------------------
12170  const TString& opt_plot,
12171  const Int_t& xMemoPlotSame,
12172  const Int_t& min_value,
12173  const Int_t& max_value,
12174  const Int_t& xFlagAutoYsupMargin,
12175  const Int_t& HisSize) {
12176  // Axis on top of the plot to indicate the Stin numbers
12177 
12178  if (opt_plot == fOnlyOnePlot || ((opt_plot == fSeveralPlot) && (xMemoPlotSame == 0)) ||
12179  ((opt_plot == fSameOnePlot) && (xMemoPlotSame == 0))) {
12180  Double_t Maxih = (Double_t)h_his0->GetMaximum();
12181  Double_t Minih = (Double_t)h_his0->GetMinimum();
12182 
12183  if (xFlagAutoYsupMargin == 1) {
12184  if (Minih >= Maxih) {
12185  Minih = (Double_t)0.;
12186  Maxih += Maxih;
12187  } // ROOT default if ymin >= ymax
12188  Double_t MaxMarginFactor = (Double_t)0.05; // frame top line = 5% above the maximum
12189  Maxih += (Maxih - Minih) * MaxMarginFactor; // ROOT default if ymin < ymax
12190  }
12191 
12192  Double_t v_min = min_value;
12193  Double_t v_max = max_value + (Double_t)1.;
12194  Double_t v_min_p = v_min + (Double_t)1.;
12195  Double_t v_max_p = v_max + (Double_t)1.;
12196 
12197  Int_t ndiv = 50207;
12198  TString opt = "B-";
12199  Double_t Xbegin = 0.;
12200  Double_t Xend = (Double_t)HisSize;
12201  Double_t ticks = 0.05;
12202 
12203  if (fFapStexNumber == 0 && fFlagSubDet == "EE") {
12204  v_min = 0;
12205  v_max = max_value;
12206  ndiv = 4;
12207  opt = "CSU"; // first draw axis with ticksize and no label
12208  Xbegin = (Double_t)HisSize;
12209  Xend = 0.;
12210  }
12211 
12212  if (fFapStexNumber > 0 && fFlagSubDet == "EE") {
12213  ticks = 0;
12214  if (fFapStexNumber == 1) {
12215  v_min = min_value;
12216  v_max = max_value + 0.5;
12217  Xbegin = (Double_t)HisSize;
12218  Xend = 0.;
12219  opt = "CSU"; // first draw axis with no ticksize and no label
12220  }
12221  if (fFapStexNumber == 2) {
12222  v_min = min_value + 0.5;
12223  v_max = max_value + 1.;
12224  Xbegin = (Double_t)HisSize;
12225  Xend = 0.;
12226  opt = "CSU"; // first draw axis with no ticksize and no label
12227  }
12228  if (fFapStexNumber == 3) {
12229  v_min = min_value + 0.5;
12230  v_max = max_value + 1.;
12231  Xbegin = 0.;
12232  Xend = (Double_t)HisSize;
12233  opt = "-CSU"; // first draw axis with no ticksize and no label
12234  }
12235  if (fFapStexNumber == 4) {
12236  v_min = min_value;
12237  v_max = max_value + 0.5;
12238  Xbegin = 0.;
12239  Xend = (Double_t)HisSize;
12240  opt = "-CSU"; // first draw axis with no ticksize and no label
12241  }
12242  v_min -= 1;
12243  v_max -= 1;
12244  ndiv = 5;
12245  }
12246 
12247  TGaxis* top_axis_x = nullptr;
12248 
12249  top_axis_x = new TGaxis(Xbegin, Maxih, Xend, Maxih, v_min, v_max, ndiv, opt, 0.);
12250  fCnewRoot++;
12251 
12252  top_axis_x->SetTickSize(ticks);
12253  top_axis_x->SetTitleOffset((Float_t)(1.2));
12254  top_axis_x->SetLabelOffset((Float_t)(0.005));
12255 
12256  TString x_var_name = "?";
12257  x_var_name.Resize(charArrLen);
12258  if (fFapStexNumber > 0) {
12259  if (fFlagSubDet == "EB") {
12260  x_var_name = "Tower number";
12261  }
12262  if (fFlagSubDet == "EE") {
12263  x_var_name = " ";
12264  // x_var_name = " Data sector"; // don't remove the space characters !
12265  }
12266  }
12267  if (fFapStexNumber == 0) {
12268  if (fFlagSubDet == "EB") {
12269  x_var_name = "SM number";
12270  }
12271  if (fFlagSubDet == "EE") {
12272  x_var_name = " ";
12273  }
12274  }
12275  top_axis_x->SetTitle(x_var_name);
12276  top_axis_x->Draw("SAME");
12277 
12278  if (fFlagSubDet == "EE") {
12279  // redraw axis with ticksize = 0, with labelOffset<0 or >0 and div centered in middle division
12280  opt = "-MS";
12281  if (fFapStexNumber == 1 || fFapStexNumber == 2) {
12282  opt = "-MS";
12283  }
12284  if (fFapStexNumber == 3 || fFapStexNumber == 4) {
12285  opt = "MS";
12286  }
12287  ndiv = 4;
12288  if (fFapStexNumber > 0) {
12289  ndiv = 5;
12290  }
12291  TGaxis* top_axis_x_bis = nullptr;
12292  top_axis_x_bis = new TGaxis(Xbegin, Maxih, Xend, Maxih, v_min_p, v_max_p, ndiv, opt, 0.);
12293  fCnewRoot++;
12294  top_axis_x_bis->SetTickSize(0.);
12295  Float_t lab_siz_x = top_axis_x->GetLabelSize();
12296  top_axis_x_bis->SetLabelSize(lab_siz_x);
12297  top_axis_x_bis->SetLabelOffset(-0.1);
12298 
12299  top_axis_x_bis->SetLabelOffset((Float_t)(9999.));
12300  // if(fFapStexNumber == 1 || fFapStexNumber == 2 ){top_axis_x_bis->SetLabelOffset(-0.07);}
12301  // if(fFapStexNumber == 3 || fFapStexNumber == 4 ){top_axis_x_bis->SetLabelOffset(-0.05);}
12302  // if(fFapStexNumber == 0 )
12303  // {top_axis_x_bis->SetLabelOffset((Float_t)(9999.));} // keep the tick and remove the value
12304  top_axis_x_bis->Draw("SAME");
12305  }
12306  }
12307 } // end of TopAxisForHistos
12308 
12309 //............................................................................................
12310 void TEcnaHistos::SetAllPavesViewMatrix(const TString& BetweenWhat,
12311  const Int_t& StexStin_A,
12312  const Int_t& StexStin_B,
12313  const Int_t& i0StinEcha) {
12314  // Put all the paves of a matrix view
12315 
12317 
12319 
12320  if (BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels) {
12321  fPavComStin = fCnaParHistos->SetPaveStinsXY(StexStin_A, StexStin_B);
12322  }
12323  if (BetweenWhat == fBetweenSamples) {
12325 
12326  if (fFlagSubDet == "EB") {
12327  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
12328  fPavComXtal = fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha);
12329  }
12330  if (fFlagSubDet == "EE") {
12332  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
12333  fPavComXtal = fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha);
12334  }
12335  }
12336 
12340 }
12341 
12342 void TEcnaHistos::SetAllPavesViewStin(const Int_t& StexStin_A) {
12343  // Put all the paves of a Stin view
12344 
12347 
12349 
12353 }
12354 
12355 void TEcnaHistos::SetAllPavesViewStinCrysNb(const Int_t& StexNumber, const Int_t& StexStin_A) {
12356  // Put all the paves of a crystal numbering Stin view
12357 
12358  fPavComStex = fCnaParHistos->SetPaveStex("standard", StexNumber);
12359  fPavComStin = fCnaParHistos->SetPaveStin(StexStin_A, StexNumber);
12360 
12361  if (fFlagSubDet == "EB") {
12362  fPavComLVRB = fCnaParHistos->SetPaveLVRB(StexNumber, StexStin_A);
12363  }
12364  if (fFlagSubDet == "EE") {
12365  fPavComCxyz = fCnaParHistos->SetPaveCxyz(StexNumber);
12366  }
12367 }
12368 
12369 void TEcnaHistos::SetAllPavesViewStex(const TString& chopt, const Int_t& StexNumber) {
12370  if (chopt == "Numbering") {
12371  fCnaParHistos->SetViewHistoStyle("Stex2DEENb");
12372  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
12373  fPavComStex = fCnaParHistos->SetPaveStex("standStex", StexNumber);
12374  if (fFlagSubDet == "EE") {
12375  fPavComCxyz = fCnaParHistos->SetPaveCxyz(StexNumber);
12376  }
12377  } else {
12378  SetAllPavesViewStex(StexNumber);
12379  }
12380 }
12381 // end of SetAllPavesViewStex(...,...)
12382 
12383 void TEcnaHistos::SetAllPavesViewStex(const Int_t& StexNumber) {
12384  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
12386  fPavComStex = fCnaParHistos->SetPaveStex("standStex", StexNumber);
12387 
12388  TString opt_pave_nbcol = "OneCol";
12389  if (fFapStexName == "SM") {
12390  opt_pave_nbcol = "TwoCol";
12391  }
12392 
12395  fFapRunNumber,
12396  fRunType,
12399  opt_pave_nbcol);
12401 }
12402 // end of SetAllPavesViewStex(...)
12403 
12405  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
12408 
12412 }
12413 // end of SetAllPavesViewStas
12414 
12415 void TEcnaHistos::SetAllPavesViewHisto(const TString& HistoCode,
12416  const Int_t& StexStin_A,
12417  const Int_t& i0StinEcha,
12418  const Int_t& i0Sample,
12419  const TString& opt_plot) {
12420  Int_t arg_AlreadyRead = 0;
12421  SetAllPavesViewHisto(HistoCode, StexStin_A, i0StinEcha, i0Sample, opt_plot, arg_AlreadyRead);
12422 }
12423 
12424 void TEcnaHistos::SetAllPavesViewHisto(const TString& HistoCode,
12425  const Int_t& StexStin_A,
12426  const Int_t& i0StinEcha,
12427  const Int_t& i0Sample,
12428  const TString& opt_plot,
12429  const Int_t& arg_AlreadyRead) {
12430  // Put all the paves of a histo view according to HistoCode
12431 
12432  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
12433 
12434  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
12435 
12437 
12438  if (opt_plot == fOnlyOnePlot) {
12439  if (!(HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" || HistoCode == "D_Ped_ChNb" ||
12440  HistoCode == "D_Ped_ChDs" || HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" ||
12441  HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs" || HistoCode == "D_HFN_ChNb" ||
12442  HistoCode == "D_HFN_ChDs" || HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" ||
12443  HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs")) {
12446  } else {
12447  if (HistoCode == "D_NOE_ChNb" || HistoCode == "D_Ped_ChNb" || HistoCode == "D_TNo_ChNb" ||
12448  HistoCode == "D_MCs_ChNb" || HistoCode == "D_LFN_ChNb" || HistoCode == "D_HFN_ChNb" ||
12449  HistoCode == "D_SCs_ChNb") {
12451  } else {
12453  }
12454  }
12455  //.................................................... (SetAllPavesViewHisto)
12456 
12457  if (HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
12458  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
12459  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
12460  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs") {
12461  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
12462  fPavComXtal = fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha);
12463  }
12464 
12465  if (HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" || HistoCode == "D_MSp_SpDs" ||
12466  HistoCode == "D_SSp_SpDs") {
12467  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
12468  fPavComXtal =
12469  fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha, arg_AlreadyRead, fPlotAllXtalsInStin);
12470  }
12471 
12472  if (HistoCode == "D_Adc_EvDs" || HistoCode == "D_Adc_EvNb") {
12473  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
12474  fPavComXtal = fCnaParHistos->SetPaveCrystalSample(n1StexCrys, StexStin_A, i0StinEcha, i0Sample);
12475  }
12476 
12477  if (HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
12478  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
12479  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
12480  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs") {
12485  } else {
12489  }
12490  }
12491 
12492  //.................................................... (SetAllPavesViewHisto)
12493 
12494  if (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") {
12495  if (HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
12496  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
12497  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
12498  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs") {
12502  } else {
12504  }
12505  }
12506 
12507  if (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") {
12509  fPavComEvolRuns =
12511  }
12512 }
12513 // end of SetAllPavesViewHisto
12514 
12515 TString TEcnaHistos::SetCanvasName(const TString& HistoCode,
12516  const Int_t& opt_scale_x,
12517  const Int_t& opt_scale_y,
12518  const TString& opt_plot,
12519  const Int_t& arg_AlreadyRead,
12520  const Int_t& StexStin_A,
12521  const Int_t& i0StinEcha,
12522  const Int_t& i0Sample) {
12523  //......... Set Canvas name *===> FOR 1D HISTO ONLY
12524  // (for 2D histos, see inside ViewMatrix, ViewStex,...)
12525 
12526  TString canvas_name;
12527  canvas_name.Resize(charArrLen);
12528  canvas_name = "?";
12529 
12530  char f_in[charArrLen];
12531 
12532  //......................... name_ opt_plot (Set Canvas name)
12533  TString name_opt_plot;
12534  name_opt_plot.Resize(charArrLen);
12535  name_opt_plot = "?";
12536 
12537  //if(opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0){name_opt_plot = "P0";} // Only one plot
12538  //if(opt_plot == fOnlyOnePlot && arg_AlreadyRead == 1){name_opt_plot = "P1";} // SAME in Stin plot
12539  //if(opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1){name_opt_plot = "Pn";} // SAME in Stin plot
12540 
12541  if (opt_plot == fOnlyOnePlot) {
12542  sprintf(f_in, "P%d", arg_AlreadyRead);
12543  name_opt_plot = f_in;
12544  }
12545 
12546  if (opt_plot == fSeveralPlot) {
12547  name_opt_plot = "SAME_N";
12548  //...................................... name_same (opt_plot = fSeveralPlot)
12549  Int_t name_same = -1;
12550 
12551  if (HistoCode == "D_NOE_ChNb") {
12552  name_same = fCanvSameD_NOE_ChNb;
12553  }
12554  if (HistoCode == "D_NOE_ChDs") {
12555  name_same = fCanvSameD_NOE_ChDs;
12556  }
12557  if (HistoCode == "D_Ped_ChNb") {
12558  name_same = fCanvSameD_Ped_ChNb;
12559  }
12560  if (HistoCode == "D_Ped_ChDs") {
12561  name_same = fCanvSameD_Ped_ChDs;
12562  }
12563  if (HistoCode == "D_TNo_ChNb") {
12564  name_same = fCanvSameD_TNo_ChNb;
12565  }
12566  if (HistoCode == "D_TNo_ChDs") {
12567  name_same = fCanvSameD_TNo_ChDs;
12568  }
12569  if (HistoCode == "D_MCs_ChNb") {
12570  name_same = fCanvSameD_MCs_ChNb;
12571  }
12572  if (HistoCode == "D_MCs_ChDs") {
12573  name_same = fCanvSameD_MCs_ChDs;
12574  }
12575  if (HistoCode == "D_LFN_ChNb") {
12576  name_same = fCanvSameD_LFN_ChNb;
12577  }
12578  if (HistoCode == "D_LFN_ChDs") {
12579  name_same = fCanvSameD_LFN_ChDs;
12580  }
12581  if (HistoCode == "D_HFN_ChNb") {
12582  name_same = fCanvSameD_HFN_ChNb;
12583  }
12584  if (HistoCode == "D_HFN_ChDs") {
12585  name_same = fCanvSameD_HFN_ChDs;
12586  }
12587  if (HistoCode == "D_SCs_ChNb") {
12588  name_same = fCanvSameD_SCs_ChNb;
12589  }
12590  if (HistoCode == "D_SCs_ChDs") {
12591  name_same = fCanvSameD_SCs_ChDs;
12592  }
12593  if (HistoCode == "D_MSp_SpNb") {
12594  name_same = fCanvSameD_MSp_SpNb;
12595  }
12596  if (HistoCode == "D_MSp_SpDs") {
12597  name_same = fCanvSameD_MSp_SpDs;
12598  }
12599  if (HistoCode == "D_SSp_SpNb") {
12600  name_same = fCanvSameD_SSp_SpNb;
12601  }
12602  if (HistoCode == "D_SSp_SpDs") {
12603  name_same = fCanvSameD_SSp_SpDs;
12604  }
12605  if (HistoCode == "D_Adc_EvDs") {
12606  name_same = fCanvSameD_Adc_EvDs;
12607  }
12608  if (HistoCode == "D_Adc_EvNb") {
12609  name_same = fCanvSameD_Adc_EvNb;
12610  }
12611  if (HistoCode == "H_Ped_Date") {
12612  name_same = fCanvSameH_Ped_Date;
12613  }
12614  if (HistoCode == "H_TNo_Date") {
12615  name_same = fCanvSameH_TNo_Date;
12616  }
12617  if (HistoCode == "H_MCs_Date") {
12618  name_same = fCanvSameH_MCs_Date;
12619  }
12620  if (HistoCode == "H_LFN_Date") {
12621  name_same = fCanvSameH_LFN_Date;
12622  }
12623  if (HistoCode == "H_HFN_Date") {
12624  name_same = fCanvSameH_HFN_Date;
12625  }
12626  if (HistoCode == "H_SCs_Date") {
12627  name_same = fCanvSameH_SCs_Date;
12628  }
12629  if (HistoCode == "H_Ped_RuDs") {
12630  name_same = fCanvSameH_Ped_RuDs;
12631  }
12632  if (HistoCode == "H_TNo_RuDs") {
12633  name_same = fCanvSameH_TNo_RuDs;
12634  }
12635  if (HistoCode == "H_MCs_RuDs") {
12636  name_same = fCanvSameH_MCs_RuDs;
12637  }
12638  if (HistoCode == "H_LFN_RuDs") {
12639  name_same = fCanvSameH_LFN_RuDs;
12640  }
12641  if (HistoCode == "H_HFN_RuDs") {
12642  name_same = fCanvSameH_HFN_RuDs;
12643  }
12644  if (HistoCode == "H_SCs_RuDs") {
12645  name_same = fCanvSameH_SCs_RuDs;
12646  }
12647 
12648  sprintf(f_in, "%d", name_same);
12649  TString s_name_same = f_in;
12650  const Text_t* t_name_same = (const Text_t*)s_name_same.Data();
12651  name_opt_plot.Append(t_name_same);
12652  }
12653  if (opt_plot == fSameOnePlot) {
12654  name_opt_plot = "SAME_Plus_N";
12655  //...................................... name_same (opt_plot = fSeveralPlot)
12656  Int_t name_same = fCanvSameH1SamePlus;
12657  sprintf(f_in, "%d", name_same);
12658  TString s_name_same = f_in;
12659  const Text_t* t_name_same = (const Text_t*)s_name_same.Data();
12660  name_opt_plot.Append(t_name_same);
12661  }
12662 
12663  //......................... name_visu (Set Canvas name)
12664  TString name_visu;
12665  name_visu.Resize(charArrLen);
12666  name_visu = "";
12667 
12668  TString name_line;
12669  name_line.Resize(charArrLen);
12670  name_line = "Line_";
12671  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
12672  if (HistoType == "Global" && (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)) {
12673  name_line = "Polm_";
12674  }
12675 
12676  // if(opt_visu == fOptVisLine){name_line = "Line_";}
12677  // if(opt_visu == fOptVisPolm){name_line = "Poly_";}
12678 
12679  const Text_t* t_line = (const Text_t*)name_line.Data();
12680  name_visu.Append(t_line);
12681 
12682  TString name_scale_x;
12683  name_scale_x.Resize(charArrLen);
12684  name_scale_x = "?";
12685  if (opt_scale_x == fOptScaleLinx) {
12686  name_scale_x = "LinX_";
12687  }
12688  if (opt_scale_x == fOptScaleLogx) {
12689  name_scale_x = "LogX_";
12690  }
12691  const Text_t* t_scale_x = (const Text_t*)name_scale_x.Data();
12692  name_visu.Append(t_scale_x);
12693 
12694  TString name_scale_y;
12695  name_scale_y.Resize(charArrLen);
12696  name_scale_y = "?";
12697  if (opt_scale_y == fOptScaleLiny) {
12698  name_scale_y = "LinY";
12699  }
12700  if (opt_scale_y == fOptScaleLogy) {
12701  name_scale_y = "LogY";
12702  }
12703  const Text_t* t_scale_y = (const Text_t*)name_scale_y.Data();
12704  name_visu.Append(t_scale_y);
12705 
12706  //...................................... name quantity (Set Canvas name)
12707  TString name_quantity;
12708  name_quantity.Resize(charArrLen);
12709  name_quantity = "?";
12710 
12711  if (HistoCode == "D_NOE_ChNb") {
12712  name_quantity = "Nb_of_evts_as_func_of_Xtal";
12713  }
12714  if (HistoCode == "D_NOE_ChDs") {
12715  name_quantity = "Nb_of_evts_Xtal_distrib";
12716  }
12717  if (HistoCode == "D_Ped_ChNb") {
12718  name_quantity = "Pedestals_as_func_of_Xtal";
12719  }
12720  if (HistoCode == "D_Ped_ChDs") {
12721  name_quantity = "Pedestals_Xtal_distrib";
12722  }
12723  if (HistoCode == "D_TNo_ChNb") {
12724  name_quantity = "Total_Noise_as_func_of_Xtal";
12725  }
12726  if (HistoCode == "D_TNo_ChDs") {
12727  name_quantity = "Total_Noise_Xtal_distrib";
12728  }
12729  if (HistoCode == "D_MCs_ChNb") {
12730  name_quantity = "Mean_Corss_as_func_of_Xtal";
12731  }
12732  if (HistoCode == "D_MCs_ChDs") {
12733  name_quantity = "Mean_Corss_Xtal_distrib";
12734  }
12735  if (HistoCode == "D_LFN_ChNb") {
12736  name_quantity = "Low_Fq_Noise_as_func_of_Xtal";
12737  }
12738  if (HistoCode == "D_LFN_ChDs") {
12739  name_quantity = "Low_Fq_Noise_Xtal_distrib";
12740  }
12741  if (HistoCode == "D_HFN_ChNb") {
12742  name_quantity = "High_Fq_Noise_as_func_of_Xtal";
12743  }
12744  if (HistoCode == "D_HFN_ChDs") {
12745  name_quantity = "High_Fq_Noise_Xtal_distrib";
12746  }
12747  if (HistoCode == "D_SCs_ChNb") {
12748  name_quantity = "Sigma_Corss_as_func_of_Xtal";
12749  }
12750  if (HistoCode == "D_SCs_ChDs") {
12751  name_quantity = "Sigma_Corss_Xtal_distrib";
12752  }
12753  if (HistoCode == "D_MSp_SpNb") {
12754  name_quantity = "ExpValue_of_samples";
12755  }
12756  if (HistoCode == "D_MSp_SpDs") {
12757  name_quantity = "ExpValue_of_samples_distrib";
12758  }
12759  if (HistoCode == "D_SSp_SpNb") {
12760  name_quantity = "Sigma_of_samples";
12761  }
12762  if (HistoCode == "D_SSp_SpDs") {
12763  name_quantity = "Sigma_of_samples_distrib";
12764  }
12765  if (HistoCode == "D_Adc_EvDs") {
12766  name_quantity = "hevt";
12767  }
12768  if (HistoCode == "D_Adc_EvNb") {
12769  name_quantity = "ADC_as_func_of_Event";
12770  }
12771  if (HistoCode == "H_Ped_Date") {
12772  name_quantity = "Pedestal_history";
12773  }
12774  if (HistoCode == "H_TNo_Date") {
12775  name_quantity = "Total_Noise_history";
12776  }
12777  if (HistoCode == "H_MCs_Date") {
12778  name_quantity = "Mean_Corss_history";
12779  }
12780  if (HistoCode == "H_LFN_Date") {
12781  name_quantity = "Low_Fq_Noise_history";
12782  }
12783  if (HistoCode == "H_HFN_Date") {
12784  name_quantity = "High_Fq_Noise_history";
12785  }
12786  if (HistoCode == "H_SCs_Date") {
12787  name_quantity = "Sigma_Corss_history";
12788  }
12789  if (HistoCode == "H_Ped_RuDs") {
12790  name_quantity = "Pedestal_run_distribution";
12791  }
12792  if (HistoCode == "H_TNo_RuDs") {
12793  name_quantity = "Total_Noise_run_distribution";
12794  }
12795  if (HistoCode == "H_MCs_RuDs") {
12796  name_quantity = "Mean_Corss_run_distribution";
12797  }
12798  if (HistoCode == "H_LFN_RuDs") {
12799  name_quantity = "Low_Fq_Noise_run_distribution";
12800  }
12801  if (HistoCode == "H_HFN_RuDs") {
12802  name_quantity = "High_Fq_Noise_run_distribution";
12803  }
12804  if (HistoCode == "H_SCs_RuDs") {
12805  name_quantity = "Sigma_Corss_run_distribution";
12806  }
12807 
12808  Int_t num_crys = -1;
12809  if (HistoCode == "D_MSp_SpNb") {
12810  num_crys = i0StinEcha;
12811  }
12812  if (HistoCode == "D_MSp_SpDs") {
12813  num_crys = i0StinEcha;
12814  }
12815  if (HistoCode == "D_SSp_SpNb") {
12816  num_crys = i0StinEcha;
12817  }
12818  if (HistoCode == "D_SSp_SpDs") {
12819  num_crys = i0StinEcha;
12820  }
12821  if (HistoCode == "D_Adc_EvDs") {
12822  num_crys = i0StinEcha;
12823  }
12824  if (HistoCode == "D_Adc_EvNb") {
12825  num_crys = i0StinEcha;
12826  }
12827  if (HistoCode == "H_Ped_Date") {
12828  num_crys = i0StinEcha;
12829  }
12830  if (HistoCode == "H_TNo_Date") {
12831  num_crys = i0StinEcha;
12832  }
12833  if (HistoCode == "H_MCs_Date") {
12834  num_crys = i0StinEcha;
12835  }
12836  if (HistoCode == "H_LFN_Date") {
12837  num_crys = i0StinEcha;
12838  }
12839  if (HistoCode == "H_HFN_Date") {
12840  num_crys = i0StinEcha;
12841  }
12842  if (HistoCode == "H_SCs_Date") {
12843  num_crys = i0StinEcha;
12844  }
12845  if (HistoCode == "H_Ped_RuDs") {
12846  num_crys = i0StinEcha;
12847  }
12848  if (HistoCode == "H_TNo_RuDs") {
12849  num_crys = i0StinEcha;
12850  }
12851  if (HistoCode == "H_MCs_RuDs") {
12852  num_crys = i0StinEcha;
12853  }
12854  if (HistoCode == "H_LFN_RuDs") {
12855  num_crys = i0StinEcha;
12856  }
12857  if (HistoCode == "H_HFN_RuDs") {
12858  num_crys = i0StinEcha;
12859  }
12860  if (HistoCode == "H_SCs_RuDs") {
12861  num_crys = i0StinEcha;
12862  }
12863 
12864  Int_t num_samp = -1;
12865  if (HistoCode == "D_Adc_EvDs") {
12866  num_samp = i0Sample;
12867  }
12868  if (HistoCode == "D_Adc_EvNb") {
12869  num_samp = i0Sample;
12870  }
12871 
12872  //........................................................... (Set Canvas name)
12873 
12874  if (HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" || HistoCode == "D_Ped_ChNb" ||
12875  HistoCode == "D_Ped_ChDs" || HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs" ||
12876  HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" || HistoCode == "D_LFN_ChNb" ||
12877  HistoCode == "D_LFN_ChDs" || HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" ||
12878  HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs") {
12879  sprintf(f_in,
12880  "%s_%s_S1_%d_R%d_%d_%d_%d_%s%d_%s_%s",
12881  name_quantity.Data(),
12882  fFapAnaType.Data(),
12884  fFapRunNumber,
12888  fFapStexName.Data(),
12890  name_opt_plot.Data(),
12891  name_visu.Data());
12892  }
12893 
12894  if (HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" || HistoCode == "H_Ped_Date" ||
12895  HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" || HistoCode == "H_LFN_Date" ||
12896  HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" || HistoCode == "D_MSp_SpDs" ||
12897  HistoCode == "D_SSp_SpDs" || HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" ||
12898  HistoCode == "H_MCs_RuDs" || HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" ||
12899  HistoCode == "H_SCs_RuDs") {
12900  sprintf(f_in,
12901  "%s_%s_S1_%d_R%d_%d_%d_%d_%s%d_%s%d_Xtal%d_%s_%s",
12902  name_quantity.Data(),
12903  fFapAnaType.Data(),
12905  fFapRunNumber,
12909  fFapStexName.Data(),
12911  fFapStinName.Data(),
12912  StexStin_A,
12913  num_crys,
12914  name_opt_plot.Data(),
12915  name_visu.Data());
12916  }
12917 
12918  if (HistoCode == "D_Adc_EvNb" || HistoCode == "D_Adc_EvDs") {
12919  sprintf(f_in,
12920  "%s_%s_S1_%d_R%d_%d_%d_%d_%s%d_%s%d_Xtal%d_Samp%d_%s_%s",
12921  name_quantity.Data(),
12922  fFapAnaType.Data(),
12924  fFapRunNumber,
12928  fFapStexName.Data(),
12930  fFapStinName.Data(),
12931  StexStin_A,
12932  num_crys,
12933  num_samp,
12934  name_opt_plot.Data(),
12935  name_visu.Data());
12936  }
12937 
12938  canvas_name = f_in;
12939  return canvas_name.Data();
12940 
12941 } // end of CanvasName()
12942 
12943 //-----------------------------------------------------------------------------
12944 //
12945 // M I S C E L L A N E O U S P A R A M E T E R S
12946 //
12947 // C O N C E R N I N G T H E D I S P L A Y
12948 //
12949 //-----------------------------------------------------------------------------
12950 
12951 //===========================================================================
12952 //
12953 // GetHistoSize, GetHistoValues, SetHistoXAxisTitle, SetHistoYAxisTitle,
12954 // GetHistoXinf, GetHistoXsup, GetHistoNumberOfBins, FillHisto
12955 //
12956 //===========================================================================
12957 Int_t TEcnaHistos::GetHistoSize(const TString& chqcode, const TString& opt_plot_read) {
12958  // Histo size as a function of the quantity code
12959 
12960  // VERY IMPORTANT: in some cases the number of bins must be strictly related to the parameters values
12961  // (number of crystals, number of samples, etc...). See below comments "===> ONE BIN BY..."
12962 
12963  Int_t HisSize = fNbBinsProj; // default value
12964 
12965  //............ histo with sample number as x coordinate => HisSize depends on option "plot" or "read"
12966  // because of nb of samples in file: size for plot = 10 even if nb of samples in file < 10
12967  if (chqcode == "D_MSp_SpNb" || chqcode == "D_SSp_SpNb" || chqcode == "D_MSp_SpDs" || chqcode == "D_SSp_SpDs") {
12968  if (opt_plot_read == "read") {
12969  HisSize = fFapNbOfSamples;
12970  }
12971  if (opt_plot_read == "plot") {
12972  HisSize = fEcal->MaxSampADC();
12973  }
12974  } // ===> ONE BIN BY SAMPLE
12975 
12976  //............ histo with event number as x coordinate. (==> "D_Adc_EvDs" option: obsolete, to be confirmed)
12977  if (chqcode == "D_Adc_EvNb" || chqcode == "D_Adc_EvDs") {
12978  HisSize = fFapReqNbOfEvts;
12979  } // ===> ONE BIN BY EVENT
12980 
12981  //............
12982  if (chqcode == "D_NOE_ChNb" || chqcode == "D_Ped_ChNb" || chqcode == "D_TNo_ChNb" || chqcode == "D_MCs_ChNb" ||
12983  chqcode == "D_LFN_ChNb" || chqcode == "D_HFN_ChNb" || chqcode == "D_SCs_ChNb" || chqcode == "D_NOE_ChDs" ||
12984  chqcode == "D_Ped_ChDs" || chqcode == "D_TNo_ChDs" || chqcode == "D_MCs_ChDs" || chqcode == "D_LFN_ChDs" ||
12985  chqcode == "D_HFN_ChDs" || chqcode == "D_SCs_ChDs") {
12986  if (fFlagSubDet == "EB") {
12987  if (fFapStexNumber > 0) {
12988  HisSize = fEcal->MaxCrysEcnaInStex();
12989  } // ===> ONE BIN BY Xtal
12990  if (fFapStexNumber == 0) {
12991  HisSize = fEcal->MaxSMInEB() * fEcal->MaxTowInSM();
12992  } // ===> ONE BIN BY Tower
12993  }
12994  if (fFlagSubDet == "EE") {
12995  if (fFapStexNumber > 0) {
12996  if (opt_plot_read == "read") {
12997  HisSize = fEcal->MaxCrysEcnaInDee();
12998  }
12999  if (opt_plot_read == "plot") {
13000  HisSize = fEcal->MaxCrysForConsInDee();
13001  }
13002  } // ===> ONE BIN BY Xtal
13003  if (fFapStexNumber == 0) {
13004  HisSize = fEcal->MaxDeeInEE() * fEcal->MaxSCForConsInDee();
13005  } // ===> ONE BIN BY SC
13006  }
13007  }
13008 
13009  if (chqcode == "H_Ped_RuDs" || chqcode == "H_TNo_RuDs" || chqcode == "H_MCs_RuDs" || chqcode == "H_LFN_RuDs" ||
13010  chqcode == "H_HFN_RuDs" || chqcode == "H_SCs_RuDs") {
13011  HisSize = fNbBinsProj;
13012  }
13013 
13014  return HisSize;
13015 }
13016 
13017 TVectorD TEcnaHistos::GetHistoValues(const TVectorD& arg_read_histo,
13018  const Int_t& arg_AlreadyRead,
13019  TEcnaRead* aMyRootFile,
13020  const TString& HistoCode,
13021  const Int_t& HisSizePlot,
13022  const Int_t& HisSizeRead,
13023  const Int_t& StexStin_A,
13024  const Int_t& i0StinEcha,
13025  const Int_t& i0Sample,
13026  Int_t& i_data_exist) {
13027  // Histo values in a TVectorD. i_data_exist entry value = 0. Incremented in this method.
13028 
13029  TVectorD plot_histo(HisSizePlot);
13030  for (Int_t i = 0; i < HisSizePlot; i++) {
13031  plot_histo(i) = (Double_t)0.;
13032  }
13033 
13034  fStatusDataExist = kFALSE;
13035 
13036  if (arg_AlreadyRead >= 1) {
13037  //std::cout << "*TEcnaHistos::GetHistoValues(...)> arg_AlreadyRead = " << arg_AlreadyRead << std::endl;
13038  for (Int_t i = 0; i < HisSizeRead; i++) {
13039  plot_histo(i) = arg_read_histo(i);
13040  }
13041  fStatusDataExist = kTRUE;
13042  i_data_exist++;
13043  }
13044 
13045  if (arg_AlreadyRead == 0) {
13046  //std::cout << "*TEcnaHistos::GetHistoValues(...)> arg_AlreadyRead = " << arg_AlreadyRead << std::endl;
13047  TVectorD read_histo(HisSizeRead);
13048  for (Int_t i = 0; i < HisSizeRead; i++) {
13049  read_histo(i) = (Double_t)0.;
13050  }
13051 
13052  if (HistoCode == "D_MSp_SpNb" || HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpNb" ||
13053  HistoCode == "D_SSp_SpDs") {
13054  //====> For plots as a function of Sample# (read10->plot10, read3->plot10)
13055  if (HisSizeRead <= HisSizePlot) {
13056  if (HistoCode == "D_MSp_SpNb" || HistoCode == "D_MSp_SpDs") {
13057  read_histo = aMyRootFile->ReadSampleMeans(StexStin_A, i0StinEcha, HisSizeRead);
13058  if (aMyRootFile->DataExist() == kTRUE) {
13059  fStatusDataExist = kTRUE;
13060  i_data_exist++;
13061  }
13062  for (Int_t i = 0; i < HisSizeRead; i++) {
13063  plot_histo(i) = read_histo(i);
13064  }
13065  }
13066 
13067  if (HistoCode == "D_SSp_SpNb" || HistoCode == "D_SSp_SpDs") {
13068  read_histo = aMyRootFile->ReadSampleSigmas(StexStin_A, i0StinEcha, HisSizeRead);
13069  if (aMyRootFile->DataExist() == kTRUE) {
13070  fStatusDataExist = kTRUE;
13071  i_data_exist++;
13072  }
13073  for (Int_t i = 0; i < HisSizeRead; i++) {
13074  plot_histo(i) = read_histo(i);
13075  }
13076  }
13077  } else {
13078  std::cout << "!TEcnaHistos::GetHistoValues(...)> *** ERROR *** > HisSizeRead greater than HisSizePlot"
13079  << " for plot as a function of sample#. HisSizeRead = " << HisSizeRead
13080  << ", HisSizePlot = " << HisSizePlot << fTTBELL << std::endl;
13081  }
13082  } // end of if( HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" " ||
13083  // HistoCode == "D_SSp_SpNb" || HistoCode == "D_SSp_SpDs" )
13084 
13085  if (!(HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" || HistoCode == "D_MSp_SpDs" ||
13086  HistoCode == "D_SSp_SpDs")) // = else of previous if
13087  {
13088  //====> For other plots
13089  if (HisSizeRead == HisSizePlot) {
13090  //========> for EE, HisSizeRead > HisSizePlot but readEcna#->plotForCons# will be build in the calling method
13091  // HisSizeRead = fEcal->MaxCrysEcnaInStex() (GetHistoValues)
13092 
13093  if (HistoCode == "D_Adc_EvNb" || HistoCode == "D_Adc_EvDs") {
13094  read_histo = aMyRootFile->ReadSampleAdcValues(StexStin_A, i0StinEcha, i0Sample, HisSizeRead);
13095  if (aMyRootFile->DataExist() == kTRUE) {
13096  fStatusDataExist = kTRUE;
13097  i_data_exist++;
13098  }
13099  }
13100 
13101  if (HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs") {
13102  read_histo = aMyRootFile->ReadNumberOfEvents(HisSizeRead);
13103  if (aMyRootFile->DataExist() == kTRUE) {
13104  fStatusDataExist = kTRUE;
13105  i_data_exist++;
13106  }
13107  }
13108 
13109  if (HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs") {
13110  read_histo = aMyRootFile->ReadPedestals(HisSizeRead);
13111  if (aMyRootFile->DataExist() == kTRUE) {
13112  fStatusDataExist = kTRUE;
13113  i_data_exist++;
13114  }
13115  }
13116 
13117  //...................................................... (GetHistoValues)
13118  if (HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs") {
13119  read_histo = aMyRootFile->ReadTotalNoise(HisSizeRead);
13120  if (aMyRootFile->DataExist() == kTRUE) {
13121  fStatusDataExist = kTRUE;
13122  i_data_exist++;
13123  }
13124  }
13125 
13126  if (HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs") {
13127  read_histo = aMyRootFile->ReadLowFrequencyNoise(HisSizeRead);
13128  if (aMyRootFile->DataExist() == kTRUE) {
13129  fStatusDataExist = kTRUE;
13130  i_data_exist++;
13131  }
13132  }
13133 
13134  if (HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs") {
13135  read_histo = aMyRootFile->ReadHighFrequencyNoise(HisSizeRead);
13136  if (aMyRootFile->DataExist() == kTRUE) {
13137  fStatusDataExist = kTRUE;
13138  i_data_exist++;
13139  }
13140  }
13141 
13142  if (HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs") {
13143  read_histo = aMyRootFile->ReadMeanCorrelationsBetweenSamples(HisSizeRead);
13144  if (aMyRootFile->DataExist() == kTRUE) {
13145  fStatusDataExist = kTRUE;
13146  i_data_exist++;
13147  }
13148  }
13149 
13150  if (HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs") {
13151  read_histo = aMyRootFile->ReadSigmaOfCorrelationsBetweenSamples(HisSizeRead);
13152  if (aMyRootFile->DataExist() == kTRUE) {
13153  fStatusDataExist = kTRUE;
13154  i_data_exist++;
13155  }
13156  }
13157 
13158  for (Int_t i = 0; i < HisSizeRead; i++) {
13159  plot_histo(i) = read_histo(i);
13160  }
13161 
13162  } else {
13163  std::cout << "!TEcnaHistos::GetHistoValues(...)> *** ERROR *** > HisSizeRead not equal to HisSizePlot."
13164  << " HisSizeRead = " << HisSizeRead << ", HisSizePlot = " << HisSizePlot << fTTBELL << std::endl;
13165  }
13166  } // end of if( !(HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb") )
13167  } // end of if( arg_AlreadyRead == 0 )
13168 
13169  if (i_data_exist == 0) {
13170  std::cout << "!TEcnaHistos::GetHistoValues(...)> Histo not found." << fTTBELL << std::endl;
13171  }
13172 
13173  return plot_histo;
13174 }
13175 //------- (end of GetHistoValues) -------------
13176 
13177 TString TEcnaHistos::SetHistoXAxisTitle(const TString& HistoCode) {
13178  // Set histo X axis title
13179 
13180  TString axis_x_var_name;
13181 
13182  if (HistoCode == "D_NOE_ChNb" || HistoCode == "D_Ped_ChNb" || HistoCode == "D_TNo_ChNb" ||
13183  HistoCode == "D_MCs_ChNb" || HistoCode == "D_LFN_ChNb" || HistoCode == "D_HFN_ChNb" ||
13184  HistoCode == "D_SCs_ChNb") {
13185  if (fFapStexNumber > 0) {
13186  if (fFlagSubDet == "EB") {
13187  axis_x_var_name = "Xtal (electronic channel number)";
13188  }
13189  if (fFlagSubDet == "EE") {
13190  axis_x_var_name = "Xtal";
13191  }
13192  }
13193  if (fFapStexNumber == 0) {
13194  if (fFlagSubDet == "EB") {
13195  axis_x_var_name = "Tower number";
13196  }
13197  if (fFlagSubDet == "EE") {
13198  axis_x_var_name = "SC number";
13199  }
13200  }
13201  }
13202 
13203  if (HistoCode == "D_NOE_ChDs") {
13204  axis_x_var_name = "Number of events";
13205  }
13206  if (HistoCode == "D_Ped_ChDs") {
13207  axis_x_var_name = "Pedestal";
13208  }
13209  if (HistoCode == "D_TNo_ChDs") {
13210  axis_x_var_name = "Total noise";
13211  }
13212  if (HistoCode == "D_MCs_ChDs") {
13213  axis_x_var_name = "Mean cor(s,s')";
13214  }
13215  if (HistoCode == "D_LFN_ChDs") {
13216  axis_x_var_name = "Low frequency noise";
13217  }
13218  if (HistoCode == "D_HFN_ChDs") {
13219  axis_x_var_name = "High frequency noise";
13220  }
13221  if (HistoCode == "D_SCs_ChDs") {
13222  axis_x_var_name = "Sigmas cor(s,s')";
13223  }
13224  if (HistoCode == "D_MSp_SpNb") {
13225  axis_x_var_name = "Sample";
13226  }
13227  if (HistoCode == "D_MSp_SpDs") {
13228  axis_x_var_name = "Pedestal";
13229  }
13230  if (HistoCode == "D_SSp_SpNb") {
13231  axis_x_var_name = "Sample";
13232  }
13233  if (HistoCode == "D_SSp_SpDs") {
13234  axis_x_var_name = "Total noise";
13235  }
13236  if (HistoCode == "D_Adc_EvDs") {
13237  axis_x_var_name = "ADC";
13238  }
13239  if (HistoCode == "D_Adc_EvNb") {
13240  axis_x_var_name = "Event number";
13241  }
13242  if (HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
13243  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date") {
13244  axis_x_var_name = "Time";
13245  }
13246  if (HistoCode == "H_Ped_RuDs") {
13247  axis_x_var_name = "Pedestal";
13248  }
13249  if (HistoCode == "H_TNo_RuDs") {
13250  axis_x_var_name = "Total noise";
13251  }
13252  if (HistoCode == "H_MCs_RuDs") {
13253  axis_x_var_name = "Mean cor(s,s')";
13254  }
13255  if (HistoCode == "H_LFN_RuDs") {
13256  axis_x_var_name = "Low frequency noise";
13257  }
13258  if (HistoCode == "H_HFN_RuDs") {
13259  axis_x_var_name = "High frequency noise";
13260  }
13261  if (HistoCode == "H_SCs_RuDs") {
13262  axis_x_var_name = "Sigmas cor(s,s')";
13263  }
13264 
13265  return axis_x_var_name;
13266 }
13267 
13268 TString TEcnaHistos::SetHistoYAxisTitle(const TString& HistoCode) {
13269  // Set histo Y axis title
13270 
13271  TString axis_y_var_name;
13272 
13273  if (HistoCode == "D_NOE_ChNb") {
13274  axis_y_var_name = "Number of events";
13275  }
13276  if (HistoCode == "D_Ped_ChNb") {
13277  axis_y_var_name = "Pedestal";
13278  }
13279  if (HistoCode == "D_TNo_ChNb") {
13280  axis_y_var_name = "Total noise";
13281  }
13282  if (HistoCode == "D_MCs_ChNb") {
13283  axis_y_var_name = "Mean cor(s,s')";
13284  }
13285  if (HistoCode == "D_LFN_ChNb") {
13286  axis_y_var_name = "Low frequency noise";
13287  }
13288  if (HistoCode == "D_HFN_ChNb") {
13289  axis_y_var_name = "High frequency noise";
13290  }
13291  if (HistoCode == "D_SCs_ChNb") {
13292  axis_y_var_name = "Sigma of cor(s,s')";
13293  }
13294 
13295  if (HistoCode == "D_NOE_ChDs" || HistoCode == "D_Ped_ChDs" || HistoCode == "D_TNo_ChDs" ||
13296  HistoCode == "D_MCs_ChDs" || HistoCode == "D_LFN_ChDs" || HistoCode == "D_HFN_ChDs" ||
13297  HistoCode == "D_SCs_ChDs") {
13298  if (fFapStexNumber > 0) {
13299  axis_y_var_name = "number of crystals";
13300  }
13301  if (fFapStexNumber == 0) {
13302  if (fFlagSubDet == "EB") {
13303  axis_y_var_name = "number of towers";
13304  }
13305  if (fFlagSubDet == "EE") {
13306  axis_y_var_name = "number of SC's";
13307  }
13308  }
13309  }
13310 
13311  if (HistoCode == "D_MSp_SpNb") {
13312  axis_y_var_name = "Sample mean";
13313  }
13314  if (HistoCode == "D_MSp_SpDs") {
13315  axis_y_var_name = "Number of samples";
13316  }
13317  if (HistoCode == "D_SSp_SpNb") {
13318  axis_y_var_name = "Sample sigma";
13319  }
13320  if (HistoCode == "D_SSp_SpDs") {
13321  axis_y_var_name = "Number of samples";
13322  }
13323  if (HistoCode == "D_Adc_EvNb") {
13324  axis_y_var_name = "Sample ADC value";
13325  }
13326  if (HistoCode == "D_Adc_EvDs") {
13327  axis_y_var_name = "Number of events";
13328  }
13329  if (HistoCode == "H_Ped_Date") {
13330  axis_y_var_name = "Pedestal";
13331  }
13332  if (HistoCode == "H_TNo_Date") {
13333  axis_y_var_name = "Total noise";
13334  }
13335  if (HistoCode == "H_MCs_Date") {
13336  axis_y_var_name = "Mean cor(s,s')";
13337  }
13338  if (HistoCode == "H_LFN_Date") {
13339  axis_y_var_name = "Low frequency noise";
13340  }
13341  if (HistoCode == "H_HFN_Date") {
13342  axis_y_var_name = "High frequency noise";
13343  }
13344  if (HistoCode == "H_SCs_Date") {
13345  axis_y_var_name = "Sigma cor(s,s')";
13346  }
13347 
13348  if (HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
13349  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs") {
13350  axis_y_var_name = "number of runs";
13351  }
13352 
13353  return axis_y_var_name;
13354 }
13355 //-------------------------------------------------------------------------------
13356 Axis_t TEcnaHistos::GetHistoXinf(const TString& HistoCode, const Int_t& HisSize, const TString& opt_plot) {
13357  // Set histo Xinf
13358 
13359  Axis_t xinf_his = (Axis_t)0;
13360 
13361  if (HistoCode == "D_NOE_ChNb") {
13362  xinf_his = (Axis_t)0.;
13363  }
13364  if (HistoCode == "D_Ped_ChNb") {
13365  xinf_his = (Axis_t)0.;
13366  }
13367  if (HistoCode == "D_TNo_ChNb") {
13368  xinf_his = (Axis_t)0.;
13369  }
13370  if (HistoCode == "D_MCs_ChNb") {
13371  xinf_his = (Axis_t)0.;
13372  }
13373  if (HistoCode == "D_LFN_ChNb") {
13374  xinf_his = (Axis_t)0.;
13375  }
13376  if (HistoCode == "D_HFN_ChNb") {
13377  xinf_his = (Axis_t)0.;
13378  }
13379  if (HistoCode == "D_SCs_ChNb") {
13380  xinf_his = (Axis_t)0.;
13381  }
13382  if (HistoCode == "D_MSp_SpNb") {
13383  xinf_his = (Axis_t)0.;
13384  }
13385  if (HistoCode == "D_SSp_SpNb") {
13386  xinf_his = (Axis_t)0.;
13387  }
13388  if (HistoCode == "D_Adc_EvNb") {
13389  xinf_his = (Axis_t)0.;
13390  }
13391 
13392  if (HistoCode == "D_NOE_ChDs") {
13393  xinf_his = (Axis_t)fD_NOE_ChNbYmin;
13394  } // D_XXX_YYDs = projection of D_XXX_YYNb
13395  if (HistoCode == "D_Ped_ChDs") {
13396  xinf_his = (Axis_t)fD_Ped_ChNbYmin;
13397  }
13398  if (HistoCode == "D_TNo_ChDs") {
13399  xinf_his = (Axis_t)fD_TNo_ChNbYmin;
13400  }
13401  if (HistoCode == "D_MCs_ChDs") {
13402  xinf_his = (Axis_t)fD_MCs_ChNbYmin;
13403  }
13404  if (HistoCode == "D_LFN_ChDs") {
13405  xinf_his = (Axis_t)fD_LFN_ChNbYmin;
13406  }
13407  if (HistoCode == "D_HFN_ChDs") {
13408  xinf_his = (Axis_t)fD_HFN_ChNbYmin;
13409  }
13410  if (HistoCode == "D_SCs_ChDs") {
13411  xinf_his = (Axis_t)fD_SCs_ChNbYmin;
13412  }
13413  if (HistoCode == "D_MSp_SpDs") {
13414  xinf_his = (Axis_t)fD_MSp_SpNbYmin;
13415  }
13416  if (HistoCode == "D_SSp_SpDs") {
13417  xinf_his = (Axis_t)fD_SSp_SpNbYmin;
13418  }
13419  if (HistoCode == "D_Adc_EvDs") {
13420  xinf_his = (Axis_t)fD_Adc_EvNbYmin;
13421  }
13422 
13423  if (HistoCode == "H_Ped_Date") {
13424  xinf_his = (Axis_t)0.;
13425  }
13426  if (HistoCode == "H_TNo_Date") {
13427  xinf_his = (Axis_t)0.;
13428  }
13429  if (HistoCode == "H_MCs_Date") {
13430  xinf_his = (Axis_t)0.;
13431  }
13432  if (HistoCode == "H_LFN_Date") {
13433  xinf_his = (Axis_t)0.;
13434  }
13435  if (HistoCode == "H_HFN_Date") {
13436  xinf_his = (Axis_t)0.;
13437  }
13438  if (HistoCode == "H_SCs_Date") {
13439  xinf_his = (Axis_t)0.;
13440  }
13441 
13442  if (HistoCode == "H_Ped_RuDs") {
13443  xinf_his = (Axis_t)fH_Ped_RuDsYmin;
13444  }
13445  if (HistoCode == "H_TNo_RuDs") {
13446  xinf_his = (Axis_t)fH_TNo_RuDsYmin;
13447  }
13448  if (HistoCode == "H_MCs_RuDs") {
13449  xinf_his = (Axis_t)fH_MCs_RuDsYmin;
13450  }
13451  if (HistoCode == "H_LFN_RuDs") {
13452  xinf_his = (Axis_t)fH_LFN_RuDsYmin;
13453  }
13454  if (HistoCode == "H_HFN_RuDs") {
13455  xinf_his = (Axis_t)fH_HFN_RuDsYmin;
13456  }
13457  if (HistoCode == "H_SCs_RuDs") {
13458  xinf_his = (Axis_t)fH_SCs_RuDsYmin;
13459  }
13460 
13461  return xinf_his;
13462 }
13463 
13464 Axis_t TEcnaHistos::GetHistoXsup(const TString& HistoCode, const Int_t& HisSize, const TString& opt_plot) {
13465  // Set histo Xsup
13466 
13467  Axis_t xsup_his = (Axis_t)0;
13468 
13469  if (HistoCode == "D_NOE_ChNb") {
13470  xsup_his = (Axis_t)HisSize;
13471  }
13472  if (HistoCode == "D_Ped_ChNb") {
13473  xsup_his = (Axis_t)HisSize;
13474  }
13475  if (HistoCode == "D_TNo_ChNb") {
13476  xsup_his = (Axis_t)HisSize;
13477  }
13478  if (HistoCode == "D_MCs_ChNb") {
13479  xsup_his = (Axis_t)HisSize;
13480  }
13481  if (HistoCode == "D_LFN_ChNb") {
13482  xsup_his = (Axis_t)HisSize;
13483  }
13484  if (HistoCode == "D_HFN_ChNb") {
13485  xsup_his = (Axis_t)HisSize;
13486  }
13487  if (HistoCode == "D_SCs_ChNb") {
13488  xsup_his = (Axis_t)HisSize;
13489  }
13490  if (HistoCode == "D_MSp_SpNb") {
13491  xsup_his = (Axis_t)HisSize;
13492  }
13493  if (HistoCode == "D_SSp_SpNb") {
13494  xsup_his = (Axis_t)HisSize;
13495  }
13496  if (HistoCode == "D_Adc_EvNb") {
13497  xsup_his = (Axis_t)(fFapReqNbOfEvts);
13498  }
13499 
13500  if (HistoCode == "D_NOE_ChDs") {
13501  xsup_his = (Axis_t)fD_NOE_ChNbYmax;
13502  }
13503  if (HistoCode == "D_Ped_ChDs") {
13504  xsup_his = (Axis_t)fD_Ped_ChNbYmax;
13505  }
13506  if (HistoCode == "D_TNo_ChDs") {
13507  xsup_his = (Axis_t)fD_TNo_ChNbYmax;
13508  }
13509  if (HistoCode == "D_MCs_ChDs") {
13510  xsup_his = (Axis_t)fD_MCs_ChNbYmax;
13511  }
13512  if (HistoCode == "D_LFN_ChDs") {
13513  xsup_his = (Axis_t)fD_LFN_ChNbYmax;
13514  }
13515  if (HistoCode == "D_HFN_ChDs") {
13516  xsup_his = (Axis_t)fD_HFN_ChNbYmax;
13517  }
13518  if (HistoCode == "D_SCs_ChDs") {
13519  xsup_his = (Axis_t)fD_SCs_ChNbYmax;
13520  }
13521  if (HistoCode == "D_MSp_SpDs") {
13522  xsup_his = (Axis_t)fD_MSp_SpNbYmax;
13523  }
13524  if (HistoCode == "D_SSp_SpDs") {
13525  xsup_his = (Axis_t)fD_SSp_SpNbYmax;
13526  }
13527  if (HistoCode == "D_Adc_EvDs") {
13528  xsup_his = (Axis_t)fD_Adc_EvNbYmax;
13529  }
13530 
13531  if (HistoCode == "H_Ped_Date") {
13532  xsup_his = (Axis_t)0.;
13533  }
13534  if (HistoCode == "H_TNo_Date") {
13535  xsup_his = (Axis_t)0.;
13536  }
13537  if (HistoCode == "H_MCs_Date") {
13538  xsup_his = (Axis_t)0.;
13539  }
13540  if (HistoCode == "H_LFN_Date") {
13541  xsup_his = (Axis_t)0.;
13542  }
13543  if (HistoCode == "H_HFN_Date") {
13544  xsup_his = (Axis_t)0.;
13545  }
13546  if (HistoCode == "H_SCs_Date") {
13547  xsup_his = (Axis_t)0.;
13548  }
13549 
13550  if (HistoCode == "H_Ped_RuDs") {
13551  xsup_his = (Axis_t)fH_Ped_RuDsYmax;
13552  }
13553  if (HistoCode == "H_TNo_RuDs") {
13554  xsup_his = (Axis_t)fH_TNo_RuDsYmax;
13555  }
13556  if (HistoCode == "H_MCs_RuDs") {
13557  xsup_his = (Axis_t)fH_MCs_RuDsYmax;
13558  }
13559  if (HistoCode == "H_LFN_RuDs") {
13560  xsup_his = (Axis_t)fH_LFN_RuDsYmax;
13561  }
13562  if (HistoCode == "H_HFN_RuDs") {
13563  xsup_his = (Axis_t)fH_HFN_RuDsYmax;
13564  }
13565  if (HistoCode == "H_SCs_RuDs") {
13566  xsup_his = (Axis_t)fH_SCs_RuDsYmax;
13567  }
13568 
13569  return xsup_his;
13570 }
13571 //-----------------------------------------------------------------------------------
13572 Int_t TEcnaHistos::GetHistoNumberOfBins(const TString& HistoCode, const Int_t& HisSize) {
13573  // Set histo number of bins
13574 
13575  Int_t nb_binx = HisSize;
13576  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
13577  if (HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj" || HistoType == "H1BasicProj") {
13578  nb_binx = fNbBinsProj;
13579  }
13580 
13581  return nb_binx;
13582 }
13583 //-----------------------------------------------------------------------------------
13584 void TEcnaHistos::FillHisto(TH1D* h_his0, const TVectorD& read_histo, const TString& HistoCode, const Int_t& HisSize) {
13585  // Fill histo
13586 
13587  h_his0->Reset();
13588 
13589  for (Int_t i = 0; i < HisSize; i++) {
13590  Double_t his_val = (Double_t)0;
13591  Double_t xi = (Double_t)0;
13592  //................................................... Basic + Global
13593  if (HistoCode == "D_NOE_ChNb" || HistoCode == "D_Ped_ChNb" || HistoCode == "D_LFN_ChNb" ||
13594  HistoCode == "D_TNo_ChNb" || HistoCode == "D_HFN_ChNb" || HistoCode == "D_MCs_ChNb" ||
13595  HistoCode == "D_SCs_ChNb" || HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb") {
13596  xi = (Double_t)i;
13597  his_val = (Double_t)read_histo[i];
13598  h_his0->Fill(xi, his_val);
13599  }
13600 
13601  //................................................... D_Adc_EvNb option
13602  if (HistoCode == "D_Adc_EvNb") {
13603  xi = (Double_t)i;
13604  his_val = (Double_t)read_histo[i];
13605  h_his0->Fill(xi, his_val);
13606  }
13607  //................................................... Proj
13608  if (HistoCode == "D_NOE_ChDs" || HistoCode == "D_Ped_ChDs" || HistoCode == "D_LFN_ChDs" ||
13609  HistoCode == "D_TNo_ChDs" || HistoCode == "D_HFN_ChDs" || HistoCode == "D_MCs_ChDs" ||
13610  HistoCode == "D_SCs_ChDs" || HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpDs" ||
13611  HistoCode == "D_Adc_EvDs") {
13612  his_val = (Double_t)read_histo[i];
13613  Double_t increment = (Double_t)1;
13614  h_his0->Fill(his_val, increment);
13615  }
13616 
13617  //................................................... EvolProj
13618  //
13619  // *=======> direct Fill in ViewHistime(...)
13620  //
13621  }
13622 }
13623 
13624 //===========================================================================
13625 //
13626 // SetXinfMemoFromValue(...), SetXsupMemoFromValue(...)
13627 // GetXsupValueFromMemo(...), GetXsupValueFromMemo(...)
13628 //
13629 //===========================================================================
13630 void TEcnaHistos::SetXinfMemoFromValue(const TString& HistoCode, const Double_t& value) {
13631  if (HistoCode == "D_NOE_ChNb") {
13633  }
13634  if (HistoCode == "D_NOE_ChDs") {
13636  }
13637  if (HistoCode == "D_Ped_ChNb") {
13639  }
13640  if (HistoCode == "D_Ped_ChDs") {
13642  }
13643  if (HistoCode == "D_TNo_ChNb") {
13645  }
13646  if (HistoCode == "D_TNo_ChDs") {
13648  }
13649  if (HistoCode == "D_MCs_ChNb") {
13651  }
13652  if (HistoCode == "D_MCs_ChDs") {
13654  }
13655  if (HistoCode == "D_LFN_ChNb") {
13657  }
13658  if (HistoCode == "D_LFN_ChDs") {
13660  }
13661  if (HistoCode == "D_HFN_ChNb") {
13663  }
13664  if (HistoCode == "D_HFN_ChDs") {
13666  }
13667  if (HistoCode == "D_SCs_ChNb") {
13669  }
13670  if (HistoCode == "D_SCs_ChDs") {
13672  }
13673  if (HistoCode == "D_MSp_SpNb") {
13675  }
13676  if (HistoCode == "D_MSp_SpDs") {
13678  }
13679  if (HistoCode == "D_SSp_SpNb") {
13681  }
13682  if (HistoCode == "D_SSp_SpDs") {
13684  }
13685  if (HistoCode == "D_Adc_EvNb") {
13687  }
13688  if (HistoCode == "D_Adc_EvDs") {
13690  }
13691  if (HistoCode == "H_Ped_Date") {
13693  }
13694  if (HistoCode == "H_TNo_Date") {
13696  }
13697  if (HistoCode == "H_MCs_Date") {
13699  }
13700  if (HistoCode == "H_LFN_Date") {
13702  }
13703  if (HistoCode == "H_HFN_Date") {
13705  }
13706  if (HistoCode == "H_SCs_Date") {
13708  }
13709  if (HistoCode == "H_Ped_RuDs") {
13711  }
13712  if (HistoCode == "H_TNo_RuDs") {
13714  }
13715  if (HistoCode == "H_MCs_RuDs") {
13717  }
13718  if (HistoCode == "H_LFN_RuDs") {
13720  }
13721  if (HistoCode == "H_HFN_RuDs") {
13723  }
13724  if (HistoCode == "H_SCs_RuDs") {
13726  }
13727 } // end of SetXinfMemoFromValue(...)
13728 
13730 
13731 void TEcnaHistos::SetXsupMemoFromValue(const TString& HistoCode, const Double_t& value) {
13732  if (HistoCode == "D_NOE_ChNb") {
13734  }
13735  if (HistoCode == "D_NOE_ChDs") {
13737  }
13738  if (HistoCode == "D_Ped_ChNb") {
13740  }
13741  if (HistoCode == "D_Ped_ChDs") {
13743  }
13744  if (HistoCode == "D_TNo_ChNb") {
13746  }
13747  if (HistoCode == "D_TNo_ChDs") {
13749  }
13750  if (HistoCode == "D_MCs_ChNb") {
13752  }
13753  if (HistoCode == "D_MCs_ChDs") {
13755  }
13756  if (HistoCode == "D_LFN_ChNb") {
13758  }
13759  if (HistoCode == "D_LFN_ChDs") {
13761  }
13762  if (HistoCode == "D_HFN_ChNb") {
13764  }
13765  if (HistoCode == "D_HFN_ChDs") {
13767  }
13768  if (HistoCode == "D_SCs_ChNb") {
13770  }
13771  if (HistoCode == "D_SCs_ChDs") {
13773  }
13774  if (HistoCode == "D_MSp_SpNb") {
13776  }
13777  if (HistoCode == "D_MSp_SpDs") {
13779  }
13780  if (HistoCode == "D_SSp_SpNb") {
13782  }
13783  if (HistoCode == "D_SSp_SpDs") {
13785  }
13786  if (HistoCode == "D_Adc_EvNb") {
13788  }
13789  if (HistoCode == "D_Adc_EvDs") {
13791  }
13792  if (HistoCode == "H_Ped_Date") {
13794  }
13795  if (HistoCode == "H_TNo_Date") {
13797  }
13798  if (HistoCode == "H_MCs_Date") {
13800  }
13801  if (HistoCode == "H_LFN_Date") {
13803  }
13804  if (HistoCode == "H_HFN_Date") {
13806  }
13807  if (HistoCode == "H_SCs_Date") {
13809  }
13810  if (HistoCode == "H_Ped_RuDs") {
13812  }
13813  if (HistoCode == "H_TNo_RuDs") {
13815  }
13816  if (HistoCode == "H_MCs_RuDs") {
13818  }
13819  if (HistoCode == "H_LFN_RuDs") {
13821  }
13822  if (HistoCode == "H_HFN_RuDs") {
13824  }
13825  if (HistoCode == "H_SCs_RuDs") {
13827  }
13828 } // end of SetXsupMemoFromValue(...)
13829 
13831 
13832 Double_t TEcnaHistos::GetXinfValueFromMemo(const TString& HistoCode) {
13833  Double_t val_inf = (Double_t)0.;
13834 
13835  if (HistoCode == "D_NOE_ChNb") {
13836  val_inf = fD_NOE_ChNbXinf;
13837  }
13838  if (HistoCode == "D_NOE_ChDs") {
13839  val_inf = fD_NOE_ChDsXinf;
13840  }
13841  if (HistoCode == "D_Ped_ChNb") {
13842  val_inf = fD_Ped_ChNbXinf;
13843  }
13844  if (HistoCode == "D_Ped_ChDs") {
13845  val_inf = fD_Ped_ChDsXinf;
13846  }
13847  if (HistoCode == "D_TNo_ChNb") {
13848  val_inf = fD_TNo_ChNbXinf;
13849  }
13850  if (HistoCode == "D_TNo_ChDs") {
13851  val_inf = fD_TNo_ChDsXinf;
13852  }
13853  if (HistoCode == "D_MCs_ChNb") {
13854  val_inf = fD_MCs_ChNbXinf;
13855  }
13856  if (HistoCode == "D_MCs_ChDs") {
13857  val_inf = fD_MCs_ChDsXinf;
13858  }
13859  if (HistoCode == "D_LFN_ChNb") {
13860  val_inf = fD_LFN_ChNbXinf;
13861  }
13862  if (HistoCode == "D_LFN_ChDs") {
13863  val_inf = fD_LFN_ChDsXinf;
13864  }
13865  if (HistoCode == "D_HFN_ChNb") {
13866  val_inf = fD_HFN_ChNbXinf;
13867  }
13868  if (HistoCode == "D_HFN_ChDs") {
13869  val_inf = fD_HFN_ChDsXinf;
13870  }
13871  if (HistoCode == "D_SCs_ChNb") {
13872  val_inf = fD_SCs_ChNbXinf;
13873  }
13874  if (HistoCode == "D_SCs_ChDs") {
13875  val_inf = fD_SCs_ChDsXinf;
13876  }
13877  if (HistoCode == "D_MSp_SpNb") {
13878  val_inf = fD_Ped_ChNbXinf;
13879  }
13880  if (HistoCode == "D_MSp_SpDs") {
13881  val_inf = fD_Ped_ChDsXinf;
13882  }
13883  if (HistoCode == "D_SSp_SpNb") {
13884  val_inf = fD_TNo_ChNbXinf;
13885  }
13886  if (HistoCode == "D_SSp_SpDs") {
13887  val_inf = fD_TNo_ChDsXinf;
13888  }
13889  if (HistoCode == "D_Adc_EvNb") {
13890  val_inf = fD_Adc_EvNbXinf;
13891  }
13892  if (HistoCode == "D_Adc_EvDs") {
13893  val_inf = fD_Adc_EvDsXinf;
13894  }
13895  if (HistoCode == "H_Ped_Date") {
13896  val_inf = fH_Ped_DateXinf;
13897  }
13898  if (HistoCode == "H_TNo_Date") {
13899  val_inf = fH_TNo_DateXinf;
13900  }
13901  if (HistoCode == "H_MCs_Date") {
13902  val_inf = fH_MCs_DateXinf;
13903  }
13904  if (HistoCode == "H_LFN_Date") {
13905  val_inf = fH_LFN_DateXinf;
13906  }
13907  if (HistoCode == "H_HFN_Date") {
13908  val_inf = fH_HFN_DateXinf;
13909  }
13910  if (HistoCode == "H_SCs_Date") {
13911  val_inf = fH_SCs_DateXinf;
13912  }
13913  if (HistoCode == "H_Ped_RuDs") {
13914  val_inf = fH_Ped_RuDsXinf;
13915  }
13916  if (HistoCode == "H_TNo_RuDs") {
13917  val_inf = fH_TNo_RuDsXinf;
13918  }
13919  if (HistoCode == "H_MCs_RuDs") {
13920  val_inf = fH_MCs_RuDsXinf;
13921  }
13922  if (HistoCode == "H_LFN_RuDs") {
13923  val_inf = fH_LFN_RuDsXinf;
13924  }
13925  if (HistoCode == "H_HFN_RuDs") {
13926  val_inf = fH_HFN_RuDsXinf;
13927  }
13928  if (HistoCode == "H_SCs_RuDs") {
13929  val_inf = fH_SCs_RuDsXinf;
13930  }
13931  return val_inf;
13932 } // end of GetXinfValueFromMemo(...)
13933 
13935 
13936 Double_t TEcnaHistos::GetXsupValueFromMemo(const TString& HistoCode) {
13937  Double_t val_sup = (Double_t)0.;
13938 
13939  if (HistoCode == "D_NOE_ChNb") {
13940  val_sup = fD_NOE_ChNbXsup;
13941  }
13942  if (HistoCode == "D_NOE_ChDs") {
13943  val_sup = fD_NOE_ChDsXsup;
13944  }
13945  if (HistoCode == "D_Ped_ChNb") {
13946  val_sup = fD_Ped_ChNbXsup;
13947  }
13948  if (HistoCode == "D_Ped_ChDs") {
13949  val_sup = fD_Ped_ChDsXsup;
13950  }
13951  if (HistoCode == "D_TNo_ChNb") {
13952  val_sup = fD_TNo_ChNbXsup;
13953  }
13954  if (HistoCode == "D_TNo_ChDs") {
13955  val_sup = fD_TNo_ChDsXsup;
13956  }
13957  if (HistoCode == "D_MCs_ChNb") {
13958  val_sup = fD_MCs_ChNbXsup;
13959  }
13960  if (HistoCode == "D_MCs_ChDs") {
13961  val_sup = fD_MCs_ChDsXsup;
13962  }
13963  if (HistoCode == "D_LFN_ChNb") {
13964  val_sup = fD_LFN_ChNbXsup;
13965  }
13966  if (HistoCode == "D_LFN_ChDs") {
13967  val_sup = fD_LFN_ChDsXsup;
13968  }
13969  if (HistoCode == "D_HFN_ChNb") {
13970  val_sup = fD_HFN_ChNbXsup;
13971  }
13972  if (HistoCode == "D_HFN_ChDs") {
13973  val_sup = fD_HFN_ChDsXsup;
13974  }
13975  if (HistoCode == "D_SCs_ChNb") {
13976  val_sup = fD_SCs_ChNbXsup;
13977  }
13978  if (HistoCode == "D_SCs_ChDs") {
13979  val_sup = fD_SCs_ChDsXsup;
13980  }
13981  if (HistoCode == "D_MSp_SpNb") {
13982  val_sup = fD_Ped_ChNbXsup;
13983  }
13984  if (HistoCode == "D_MSp_SpDs") {
13985  val_sup = fD_Ped_ChDsXsup;
13986  }
13987  if (HistoCode == "D_SSp_SpNb") {
13988  val_sup = fD_TNo_ChNbXsup;
13989  }
13990  if (HistoCode == "D_SSp_SpDs") {
13991  val_sup = fD_TNo_ChDsXsup;
13992  }
13993  if (HistoCode == "D_Adc_EvNb") {
13994  val_sup = fD_Adc_EvNbXsup;
13995  }
13996  if (HistoCode == "D_Adc_EvDs") {
13997  val_sup = fD_Adc_EvDsXsup;
13998  }
13999  if (HistoCode == "H_Ped_Date") {
14000  val_sup = fH_Ped_DateXsup;
14001  }
14002  if (HistoCode == "H_TNo_Date") {
14003  val_sup = fH_TNo_DateXsup;
14004  }
14005  if (HistoCode == "H_MCs_Date") {
14006  val_sup = fH_MCs_DateXsup;
14007  }
14008  if (HistoCode == "H_LFN_Date") {
14009  val_sup = fH_LFN_DateXsup;
14010  }
14011  if (HistoCode == "H_HFN_Date") {
14012  val_sup = fH_HFN_DateXsup;
14013  }
14014  if (HistoCode == "H_SCs_Date") {
14015  val_sup = fH_SCs_DateXsup;
14016  }
14017  if (HistoCode == "H_Ped_RuDs") {
14018  val_sup = fH_Ped_RuDsXsup;
14019  }
14020  if (HistoCode == "H_TNo_RuDs") {
14021  val_sup = fH_TNo_RuDsXsup;
14022  }
14023  if (HistoCode == "H_MCs_RuDs") {
14024  val_sup = fH_MCs_RuDsXsup;
14025  }
14026  if (HistoCode == "H_LFN_RuDs") {
14027  val_sup = fH_LFN_RuDsXsup;
14028  }
14029  if (HistoCode == "H_HFN_RuDs") {
14030  val_sup = fH_HFN_RuDsXsup;
14031  }
14032  if (HistoCode == "H_SCs_RuDs") {
14033  val_sup = fH_SCs_RuDsXsup;
14034  }
14035  return val_sup;
14036 } // end of GetXsupValueFromMemo(...)
14037 
14039 
14040 //-------------------------------------------------------------------------------------------
14041 //
14042 // SetHistoMin, SetHistoMax, SetAllYminYmaxMemoFromDefaultValues
14043 //
14044 //-------------------------------------------------------------------------------------------
14045 void TEcnaHistos::SetHistoMin(const Double_t& value) {
14046  fUserHistoMin = value;
14047  fFlagUserHistoMin = "ON";
14048 }
14049 void TEcnaHistos::SetHistoMax(const Double_t& value) {
14050  fUserHistoMax = value;
14051  fFlagUserHistoMax = "ON";
14052 }
14053 
14056 
14058  //.......... Default values for histo min and max
14059 
14060  SetYminMemoFromValue("D_NOE_ChNb", fCnaParHistos->GetYminDefaultValue("D_NOE_ChNb"));
14061  SetYmaxMemoFromValue("D_NOE_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_NOE_ChNb"));
14062 
14063  SetYminMemoFromValue("D_NOE_ChDs", fCnaParHistos->GetYminDefaultValue("D_NOE_ChDs"));
14064  SetYmaxMemoFromValue("D_NOE_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_NOE_ChDs"));
14065 
14066  SetYminMemoFromValue("D_Ped_ChNb", fCnaParHistos->GetYminDefaultValue("D_Ped_ChNb"));
14067  SetYmaxMemoFromValue("D_Ped_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_Ped_ChNb"));
14068 
14069  SetYminMemoFromValue("D_Ped_ChDs", fCnaParHistos->GetYminDefaultValue("D_Ped_ChDs"));
14070  SetYmaxMemoFromValue("D_Ped_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_Ped_ChDs"));
14071 
14072  SetYminMemoFromValue("D_TNo_ChNb", fCnaParHistos->GetYminDefaultValue("D_TNo_ChNb"));
14073  SetYmaxMemoFromValue("D_TNo_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_TNo_ChNb"));
14074 
14075  SetYminMemoFromValue("D_TNo_ChDs", fCnaParHistos->GetYminDefaultValue("D_TNo_ChDs"));
14076  SetYmaxMemoFromValue("D_TNo_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_TNo_ChDs"));
14077 
14078  SetYminMemoFromValue("D_MCs_ChNb", fCnaParHistos->GetYminDefaultValue("D_MCs_ChNb"));
14079  SetYmaxMemoFromValue("D_MCs_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_MCs_ChNb"));
14080 
14081  SetYminMemoFromValue("D_MCs_ChDs", fCnaParHistos->GetYminDefaultValue("D_MCs_ChDs"));
14082  SetYmaxMemoFromValue("D_MCs_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_MCs_ChDs"));
14083 
14084  SetYminMemoFromValue("D_LFN_ChNb", fCnaParHistos->GetYminDefaultValue("D_LFN_ChNb"));
14085  SetYmaxMemoFromValue("D_LFN_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_LFN_ChNb"));
14086 
14087  SetYminMemoFromValue("D_LFN_ChDs", fCnaParHistos->GetYminDefaultValue("D_LFN_ChDs"));
14088  SetYmaxMemoFromValue("D_LFN_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_LFN_ChDs"));
14089 
14090  SetYminMemoFromValue("D_HFN_ChNb", fCnaParHistos->GetYminDefaultValue("D_HFN_ChNb"));
14091  SetYmaxMemoFromValue("D_HFN_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_HFN_ChNb"));
14092 
14093  SetYminMemoFromValue("D_HFN_ChDs", fCnaParHistos->GetYminDefaultValue("D_HFN_ChDs"));
14094  SetYmaxMemoFromValue("D_HFN_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_HFN_ChDs"));
14095 
14096  SetYminMemoFromValue("D_SCs_ChNb", fCnaParHistos->GetYminDefaultValue("D_SCs_ChNb"));
14097  SetYmaxMemoFromValue("D_SCs_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_SCs_ChNb"));
14098 
14099  SetYminMemoFromValue("D_SCs_ChDs", fCnaParHistos->GetYminDefaultValue("D_SCs_ChDs"));
14100  SetYmaxMemoFromValue("D_SCs_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_SCs_ChDs"));
14101 
14102  SetYminMemoFromValue("D_MSp_SpNb", fCnaParHistos->GetYminDefaultValue("D_MSp_SpNb"));
14103  SetYmaxMemoFromValue("D_MSp_SpNb", fCnaParHistos->GetYmaxDefaultValue("D_MSp_SpNb"));
14104 
14105  SetYminMemoFromValue("D_MSp_SpDs", fCnaParHistos->GetYminDefaultValue("D_MSp_SpDs"));
14106  SetYmaxMemoFromValue("D_MSp_SpDs", fCnaParHistos->GetYmaxDefaultValue("D_MSp_SpDs"));
14107 
14108  SetYminMemoFromValue("D_SSp_SpNb", fCnaParHistos->GetYminDefaultValue("D_SSp_SpNb"));
14109  SetYmaxMemoFromValue("D_SSp_SpNb", fCnaParHistos->GetYmaxDefaultValue("D_SSp_SpNb"));
14110 
14111  SetYminMemoFromValue("D_SSp_SpDs", fCnaParHistos->GetYminDefaultValue("D_SSp_SpDs"));
14112  SetYmaxMemoFromValue("D_SSp_SpDs", fCnaParHistos->GetYmaxDefaultValue("D_SSp_SpDs"));
14113 
14114  SetYminMemoFromValue("D_Adc_EvDs", fCnaParHistos->GetYminDefaultValue("D_Adc_EvDs"));
14115  SetYmaxMemoFromValue("D_Adc_EvDs", fCnaParHistos->GetYmaxDefaultValue("D_Adc_EvDs"));
14116 
14117  SetYminMemoFromValue("D_Adc_EvNb", fCnaParHistos->GetYminDefaultValue("D_Adc_EvNb"));
14118  SetYmaxMemoFromValue("D_Adc_EvNb", fCnaParHistos->GetYmaxDefaultValue("D_Adc_EvNb"));
14119 
14120  SetYminMemoFromValue("H_Ped_Date", fCnaParHistos->GetYminDefaultValue("H_Ped_Date"));
14121  SetYmaxMemoFromValue("H_Ped_Date", fCnaParHistos->GetYmaxDefaultValue("H_Ped_Date"));
14122 
14123  SetYminMemoFromValue("H_TNo_Date", fCnaParHistos->GetYminDefaultValue("H_TNo_Date"));
14124  SetYmaxMemoFromValue("H_TNo_Date", fCnaParHistos->GetYmaxDefaultValue("H_TNo_Date"));
14125 
14126  SetYminMemoFromValue("H_LFN_Date", fCnaParHistos->GetYminDefaultValue("H_LFN_Date"));
14127  SetYmaxMemoFromValue("H_LFN_Date", fCnaParHistos->GetYmaxDefaultValue("H_LFN_Date"));
14128 
14129  SetYminMemoFromValue("H_HFN_Date", fCnaParHistos->GetYminDefaultValue("H_HFN_Date"));
14130  SetYmaxMemoFromValue("H_HFN_Date", fCnaParHistos->GetYmaxDefaultValue("H_HFN_Date"));
14131 
14132  SetYminMemoFromValue("H_MCs_Date", fCnaParHistos->GetYminDefaultValue("H_MCs_Date"));
14133  SetYmaxMemoFromValue("H_MCs_Date", fCnaParHistos->GetYmaxDefaultValue("H_MCs_Date"));
14134 
14135  SetYminMemoFromValue("H_SCs_Date", fCnaParHistos->GetYminDefaultValue("H_SCs_Date"));
14136  SetYmaxMemoFromValue("H_SCs_Date", fCnaParHistos->GetYmaxDefaultValue("H_SCs_Date"));
14137 
14138  SetYminMemoFromValue("H_Ped_RuDs", fCnaParHistos->GetYminDefaultValue("H_Ped_RuDs"));
14139  SetYmaxMemoFromValue("H_Ped_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_Ped_RuDs"));
14140 
14141  SetYminMemoFromValue("H_TNo_RuDs", fCnaParHistos->GetYminDefaultValue("H_TNo_RuDs"));
14142  SetYmaxMemoFromValue("H_TNo_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_TNo_RuDs"));
14143 
14144  SetYminMemoFromValue("H_LFN_RuDs", fCnaParHistos->GetYminDefaultValue("H_LFN_RuDs"));
14145  SetYmaxMemoFromValue("H_LFN_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_LFN_RuDs"));
14146 
14147  SetYminMemoFromValue("H_HFN_RuDs", fCnaParHistos->GetYminDefaultValue("H_HFN_RuDs"));
14148  SetYmaxMemoFromValue("H_HFN_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_HFN_RuDs"));
14149 
14150  SetYminMemoFromValue("H_MCs_RuDs", fCnaParHistos->GetYminDefaultValue("H_MCs_RuDs"));
14151  SetYmaxMemoFromValue("H_MCs_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_MCs_RuDs"));
14152 
14153  SetYminMemoFromValue("H_SCs_RuDs", fCnaParHistos->GetYminDefaultValue("H_SCs_RuDs"));
14154  SetYmaxMemoFromValue("H_SCs_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_SCs_RuDs"));
14155 
14156  SetYminMemoFromValue("H2LFccMosMatrix", fCnaParHistos->GetYminDefaultValue("H2LFccMosMatrix"));
14157  SetYmaxMemoFromValue("H2LFccMosMatrix", fCnaParHistos->GetYmaxDefaultValue("H2LFccMosMatrix"));
14158 
14159  SetYminMemoFromValue("H2HFccMosMatrix", fCnaParHistos->GetYminDefaultValue("H2HFccMosMatrix"));
14160  SetYmaxMemoFromValue("H2HFccMosMatrix", fCnaParHistos->GetYmaxDefaultValue("H2HFccMosMatrix"));
14161 
14162  SetYminMemoFromValue("H2CorccInStins", fCnaParHistos->GetYminDefaultValue("H2CorccInStins"));
14163  SetYmaxMemoFromValue("H2CorccInStins", fCnaParHistos->GetYmaxDefaultValue("H2CorccInStins"));
14164 
14165  //........... set user's min and max flags to "OFF" and values to -1 and +1 (just to have fUserHistoMin < fUserHistoMax)
14166  fUserHistoMin = -1.;
14167  fFlagUserHistoMin = "OFF";
14168  fUserHistoMax = 1.;
14169  fFlagUserHistoMax = "OFF";
14170 } // end of SetAllYminYmaxMemoFromDefaultValues()
14171 
14172 //===========================================================================
14173 //
14174 // SetYminMemoFromValue(...), SetYmaxMemoFromValue(...)
14175 // GetYminValueFromMemo(...), GetYmaxValueFromMemo(...)
14176 //
14177 //===========================================================================
14178 void TEcnaHistos::SetYminMemoFromValue(const TString& HistoCode, const Double_t& value) {
14179  if (HistoCode == "D_NOE_ChNb") {
14181  }
14182  if (HistoCode == "D_NOE_ChDs") {
14184  }
14185  if (HistoCode == "D_Ped_ChNb") {
14187  }
14188  if (HistoCode == "D_Ped_ChDs") {
14190  }
14191  if (HistoCode == "D_TNo_ChNb") {
14193  }
14194  if (HistoCode == "D_TNo_ChDs") {
14196  }
14197  if (HistoCode == "D_MCs_ChNb") {
14199  }
14200  if (HistoCode == "D_MCs_ChDs") {
14202  }
14203  if (HistoCode == "D_LFN_ChNb") {
14205  }
14206  if (HistoCode == "D_LFN_ChDs") {
14208  }
14209  if (HistoCode == "D_HFN_ChNb") {
14211  }
14212  if (HistoCode == "D_HFN_ChDs") {
14214  }
14215  if (HistoCode == "D_SCs_ChNb") {
14217  }
14218  if (HistoCode == "D_SCs_ChDs") {
14220  }
14221  if (HistoCode == "D_MSp_SpNb") {
14223  }
14224  if (HistoCode == "D_MSp_SpDs") {
14226  }
14227  if (HistoCode == "D_SSp_SpNb") {
14229  }
14230  if (HistoCode == "D_SSp_SpDs") {
14232  }
14233  if (HistoCode == "D_Adc_EvNb") {
14235  }
14236  if (HistoCode == "D_Adc_EvDs") {
14238  }
14239  if (HistoCode == "H_Ped_Date") {
14241  }
14242  if (HistoCode == "H_TNo_Date") {
14244  }
14245  if (HistoCode == "H_MCs_Date") {
14247  }
14248  if (HistoCode == "H_LFN_Date") {
14250  }
14251  if (HistoCode == "H_HFN_Date") {
14253  }
14254  if (HistoCode == "H_SCs_Date") {
14256  }
14257  if (HistoCode == "H_Ped_RuDs") {
14259  }
14260  if (HistoCode == "H_TNo_RuDs") {
14262  }
14263  if (HistoCode == "H_MCs_RuDs") {
14265  }
14266  if (HistoCode == "H_LFN_RuDs") {
14268  }
14269  if (HistoCode == "H_HFN_RuDs") {
14271  }
14272  if (HistoCode == "H_SCs_RuDs") {
14274  }
14275  if (HistoCode == "H2LFccMosMatrix") {
14277  }
14278  if (HistoCode == "H2HFccMosMatrix") {
14280  }
14281  if (HistoCode == "H2CorccInStins") {
14283  }
14284 } // end of SetYminMemoFromValue(...)
14285 
14286 void TEcnaHistos::SetYmaxMemoFromValue(const TString& HistoCode, const Double_t& value) {
14287  if (HistoCode == "D_NOE_ChNb") {
14289  }
14290  if (HistoCode == "D_NOE_ChDs") {
14292  }
14293  if (HistoCode == "D_Ped_ChNb") {
14295  }
14296  if (HistoCode == "D_Ped_ChDs") {
14298  }
14299  if (HistoCode == "D_TNo_ChNb") {
14301  }
14302  if (HistoCode == "D_TNo_ChDs") {
14304  }
14305  if (HistoCode == "D_MCs_ChNb") {
14307  }
14308  if (HistoCode == "D_MCs_ChDs") {
14310  }
14311  if (HistoCode == "D_LFN_ChNb") {
14313  }
14314  if (HistoCode == "D_LFN_ChDs") {
14316  }
14317  if (HistoCode == "D_HFN_ChNb") {
14319  }
14320  if (HistoCode == "D_HFN_ChDs") {
14322  }
14323  if (HistoCode == "D_SCs_ChNb") {
14325  }
14326  if (HistoCode == "D_SCs_ChDs") {
14328  }
14329  if (HistoCode == "D_MSp_SpNb") {
14331  }
14332  if (HistoCode == "D_MSp_SpDs") {
14334  }
14335  if (HistoCode == "D_SSp_SpNb") {
14337  }
14338  if (HistoCode == "D_SSp_SpDs") {
14340  }
14341  if (HistoCode == "D_Adc_EvNb") {
14343  }
14344  if (HistoCode == "D_Adc_EvDs") {
14346  }
14347  if (HistoCode == "H_Ped_Date") {
14349  }
14350  if (HistoCode == "H_TNo_Date") {
14352  }
14353  if (HistoCode == "H_MCs_Date") {
14355  }
14356  if (HistoCode == "H_LFN_Date") {
14358  }
14359  if (HistoCode == "H_HFN_Date") {
14361  }
14362  if (HistoCode == "H_SCs_Date") {
14364  }
14365  if (HistoCode == "H_Ped_RuDs") {
14367  }
14368  if (HistoCode == "H_TNo_RuDs") {
14370  }
14371  if (HistoCode == "H_MCs_RuDs") {
14373  }
14374  if (HistoCode == "H_LFN_RuDs") {
14376  }
14377  if (HistoCode == "H_HFN_RuDs") {
14379  }
14380  if (HistoCode == "H_SCs_RuDs") {
14382  }
14383  if (HistoCode == "H2LFccMosMatrix") {
14385  }
14386  if (HistoCode == "H2HFccMosMatrix") {
14388  }
14389  if (HistoCode == "H2CorccInStins") {
14391  }
14392 } // end of SetYmaxMemoFromValue(...)
14393 
14394 Double_t TEcnaHistos::GetYminValueFromMemo(const TString& HistoCode) {
14395  Double_t val_min = (Double_t)0.;
14396  Double_t val_min_proj = (Double_t)0.1;
14397 
14398  if (HistoCode == "D_NOE_ChNb") {
14399  val_min = fD_NOE_ChNbYmin;
14400  }
14401  if (HistoCode == "D_NOE_ChDs") {
14402  val_min = val_min_proj;
14403  }
14404  if (HistoCode == "D_Ped_ChNb") {
14405  val_min = fD_Ped_ChNbYmin;
14406  }
14407  if (HistoCode == "D_Ped_ChDs") {
14408  val_min = val_min_proj;
14409  }
14410  if (HistoCode == "D_TNo_ChNb") {
14411  val_min = fD_TNo_ChNbYmin;
14412  }
14413  if (HistoCode == "D_TNo_ChDs") {
14414  val_min = val_min_proj;
14415  }
14416  if (HistoCode == "D_MCs_ChNb") {
14417  val_min = fD_MCs_ChNbYmin;
14418  }
14419  if (HistoCode == "D_MCs_ChDs") {
14420  val_min = val_min_proj;
14421  }
14422  if (HistoCode == "D_LFN_ChNb") {
14423  val_min = fD_LFN_ChNbYmin;
14424  }
14425  if (HistoCode == "D_LFN_ChDs") {
14426  val_min = val_min_proj;
14427  }
14428  if (HistoCode == "D_HFN_ChNb") {
14429  val_min = fD_HFN_ChNbYmin;
14430  }
14431  if (HistoCode == "D_HFN_ChDs") {
14432  val_min = val_min_proj;
14433  }
14434  if (HistoCode == "D_SCs_ChNb") {
14435  val_min = fD_SCs_ChNbYmin;
14436  }
14437  if (HistoCode == "D_SCs_ChDs") {
14438  val_min = val_min_proj;
14439  }
14440  if (HistoCode == "D_MSp_SpNb") {
14441  val_min = fD_Ped_ChNbYmin;
14442  }
14443  if (HistoCode == "D_MSp_SpDs") {
14444  val_min = val_min_proj;
14445  }
14446  if (HistoCode == "D_SSp_SpNb") {
14447  val_min = fD_TNo_ChNbYmin;
14448  }
14449  if (HistoCode == "D_SSp_SpDs") {
14450  val_min = val_min_proj;
14451  }
14452  if (HistoCode == "D_Adc_EvNb") {
14453  val_min = fD_Ped_ChNbYmin;
14454  }
14455  if (HistoCode == "D_Adc_EvDs") {
14456  val_min = val_min_proj;
14457  }
14458  if (HistoCode == "H_Ped_Date") {
14459  val_min = fH_Ped_DateYmin;
14460  }
14461  if (HistoCode == "H_TNo_Date") {
14462  val_min = fH_TNo_DateYmin;
14463  }
14464  if (HistoCode == "H_MCs_Date") {
14465  val_min = fH_MCs_DateYmin;
14466  }
14467  if (HistoCode == "H_LFN_Date") {
14468  val_min = fH_LFN_DateYmin;
14469  }
14470  if (HistoCode == "H_HFN_Date") {
14471  val_min = fH_HFN_DateYmin;
14472  }
14473  if (HistoCode == "H_SCs_Date") {
14474  val_min = fH_SCs_DateYmin;
14475  }
14476  if (HistoCode == "H_Ped_RuDs") {
14477  val_min = fH_Ped_RuDsYmin;
14478  }
14479  if (HistoCode == "H_TNo_RuDs") {
14480  val_min = fH_TNo_RuDsYmin;
14481  }
14482  if (HistoCode == "H_MCs_RuDs") {
14483  val_min = fH_MCs_RuDsYmin;
14484  }
14485  if (HistoCode == "H_LFN_RuDs") {
14486  val_min = fH_LFN_RuDsYmin;
14487  }
14488  if (HistoCode == "H_HFN_RuDs") {
14489  val_min = fH_HFN_RuDsYmin;
14490  }
14491  if (HistoCode == "H_SCs_RuDs") {
14492  val_min = fH_SCs_RuDsYmin;
14493  }
14494  if (HistoCode == "H2LFccMosMatrix") {
14495  val_min = fH2LFccMosMatrixYmin;
14496  }
14497  if (HistoCode == "H2HFccMosMatrix") {
14498  val_min = fH2HFccMosMatrixYmin;
14499  }
14500  if (HistoCode == "H2CorccInStins") {
14501  val_min = fH2CorccInStinsYmin;
14502  }
14503  return val_min;
14504 } // end of GetYminValueFromMemo(...)
14505 
14506 Double_t TEcnaHistos::GetYmaxValueFromMemo(const TString& HistoCode) {
14507  Double_t val_max = (Double_t)0.;
14508  Double_t val_max_proj = (Double_t)2000.;
14509 
14510  if (HistoCode == "D_NOE_ChNb") {
14511  val_max = fD_NOE_ChNbYmax;
14512  }
14513  if (HistoCode == "D_NOE_ChDs") {
14514  val_max = val_max_proj;
14515  }
14516  if (HistoCode == "D_Ped_ChNb") {
14517  val_max = fD_Ped_ChNbYmax;
14518  }
14519  if (HistoCode == "D_Ped_ChDs") {
14520  val_max = val_max_proj;
14521  }
14522  if (HistoCode == "D_TNo_ChNb") {
14523  val_max = fD_TNo_ChNbYmax;
14524  }
14525  if (HistoCode == "D_TNo_ChDs") {
14526  val_max = val_max_proj;
14527  }
14528  if (HistoCode == "D_MCs_ChNb") {
14529  val_max = fD_MCs_ChNbYmax;
14530  }
14531  if (HistoCode == "D_MCs_ChDs") {
14532  val_max = val_max_proj;
14533  }
14534  if (HistoCode == "D_LFN_ChNb") {
14535  val_max = fD_LFN_ChNbYmax;
14536  }
14537  if (HistoCode == "D_LFN_ChDs") {
14538  val_max = val_max_proj;
14539  }
14540  if (HistoCode == "D_HFN_ChNb") {
14541  val_max = fD_HFN_ChNbYmax;
14542  }
14543  if (HistoCode == "D_HFN_ChDs") {
14544  val_max = val_max_proj;
14545  }
14546  if (HistoCode == "D_SCs_ChNb") {
14547  val_max = fD_SCs_ChNbYmax;
14548  }
14549  if (HistoCode == "D_SCs_ChDs") {
14550  val_max = val_max_proj;
14551  }
14552  if (HistoCode == "D_MSp_SpNb") {
14553  val_max = fD_Ped_ChNbYmax;
14554  }
14555  if (HistoCode == "D_MSp_SpDs") {
14556  val_max = val_max_proj;
14557  }
14558  if (HistoCode == "D_SSp_SpNb") {
14559  val_max = fD_TNo_ChNbYmax;
14560  }
14561  if (HistoCode == "D_SSp_SpDs") {
14562  val_max = val_max_proj;
14563  }
14564  if (HistoCode == "D_Adc_EvNb") {
14565  val_max = fD_Ped_ChNbYmax;
14566  }
14567  if (HistoCode == "D_Adc_EvDs") {
14568  val_max = val_max_proj;
14569  }
14570  if (HistoCode == "H_Ped_Date") {
14571  val_max = fH_Ped_DateYmax;
14572  }
14573  if (HistoCode == "H_TNo_Date") {
14574  val_max = fH_TNo_DateYmax;
14575  }
14576  if (HistoCode == "H_MCs_Date") {
14577  val_max = fH_MCs_DateYmax;
14578  }
14579  if (HistoCode == "H_LFN_Date") {
14580  val_max = fH_LFN_DateYmax;
14581  }
14582  if (HistoCode == "H_HFN_Date") {
14583  val_max = fH_HFN_DateYmax;
14584  }
14585  if (HistoCode == "H_SCs_Date") {
14586  val_max = fH_SCs_DateYmax;
14587  }
14588  if (HistoCode == "H_Ped_RuDs") {
14589  val_max = fH_Ped_RuDsYmax;
14590  }
14591  if (HistoCode == "H_TNo_RuDs") {
14592  val_max = fH_TNo_RuDsYmax;
14593  }
14594  if (HistoCode == "H_MCs_RuDs") {
14595  val_max = fH_MCs_RuDsYmax;
14596  }
14597  if (HistoCode == "H_LFN_RuDs") {
14598  val_max = fH_LFN_RuDsYmax;
14599  }
14600  if (HistoCode == "H_HFN_RuDs") {
14601  val_max = fH_HFN_RuDsYmax;
14602  }
14603  if (HistoCode == "H_SCs_RuDs") {
14604  val_max = fH_SCs_RuDsYmax;
14605  }
14606  if (HistoCode == "H2LFccMosMatrix") {
14607  val_max = fH2LFccMosMatrixYmax;
14608  }
14609  if (HistoCode == "H2HFccMosMatrix") {
14610  val_max = fH2HFccMosMatrixYmax;
14611  }
14612  if (HistoCode == "H2CorccInStins") {
14613  val_max = fH2CorccInStinsYmax;
14614  }
14615  return val_max;
14616 } // end of GetYmaxValueFromMemo(...)
14617 
14618 void TEcnaHistos::SetYminMemoFromPreviousMemo(const TString& HistoCode) {
14619  // InitQuantity Ymin
14620 
14621  if (HistoCode == "D_NOE_ChNb") {
14622  fD_NOE_ChNbYmin = GetYminValueFromMemo("D_NOE_ChNb");
14623  }
14624  if (HistoCode == "D_NOE_ChDs") {
14625  fD_NOE_ChDsYmin = GetYminValueFromMemo("D_NOE_ChDs");
14626  }
14627  if (HistoCode == "D_Ped_ChNb") {
14628  fD_Ped_ChNbYmin = GetYminValueFromMemo("D_Ped_ChNb");
14629  }
14630  if (HistoCode == "D_Ped_ChDs") {
14631  fD_Ped_ChDsYmin = GetYminValueFromMemo("D_Ped_ChDs");
14632  }
14633  if (HistoCode == "D_TNo_ChNb") {
14634  fD_TNo_ChNbYmin = GetYminValueFromMemo("D_TNo_ChNb");
14635  }
14636  if (HistoCode == "D_TNo_ChDs") {
14637  fD_TNo_ChDsYmin = GetYminValueFromMemo("D_TNo_ChDs");
14638  }
14639  if (HistoCode == "D_MCs_ChNb") {
14640  fD_MCs_ChNbYmin = GetYminValueFromMemo("D_MCs_ChNb");
14641  }
14642  if (HistoCode == "D_MCs_ChDs") {
14643  fD_MCs_ChDsYmin = GetYminValueFromMemo("D_MCs_ChDs");
14644  }
14645  if (HistoCode == "D_LFN_ChNb") {
14646  fD_LFN_ChNbYmin = GetYminValueFromMemo("D_LFN_ChNb");
14647  }
14648  if (HistoCode == "D_LFN_ChDs") {
14649  fD_LFN_ChDsYmin = GetYminValueFromMemo("D_LFN_ChDs");
14650  }
14651  if (HistoCode == "D_HFN_ChNb") {
14652  fD_HFN_ChNbYmin = GetYminValueFromMemo("D_HFN_ChNb");
14653  }
14654  if (HistoCode == "D_HFN_ChDs") {
14655  fD_HFN_ChDsYmin = GetYminValueFromMemo("D_HFN_ChDs");
14656  }
14657  if (HistoCode == "D_SCs_ChNb") {
14658  fD_SCs_ChNbYmin = GetYminValueFromMemo("D_SCs_ChNb");
14659  }
14660  if (HistoCode == "D_SCs_ChDs") {
14661  fD_SCs_ChDsYmin = GetYminValueFromMemo("D_SCs_ChDs");
14662  }
14663  if (HistoCode == "D_MSp_SpNb") {
14664  fD_MSp_SpNbYmin = GetYminValueFromMemo("D_MSp_SpNb");
14665  }
14666  if (HistoCode == "D_MSp_SpDs") {
14667  fD_MSp_SpDsYmin = GetYminValueFromMemo("D_MSp_SpDs");
14668  }
14669  if (HistoCode == "D_SSp_SpNb") {
14670  fD_SSp_SpNbYmin = GetYminValueFromMemo("D_SSp_SpNb");
14671  }
14672  if (HistoCode == "D_SSp_SpDs") {
14673  fD_SSp_SpDsYmin = GetYminValueFromMemo("D_SSp_SpDs");
14674  }
14675  if (HistoCode == "D_Adc_EvNb") {
14676  fD_Adc_EvNbYmin = GetYminValueFromMemo("D_Adc_EvNb");
14677  }
14678  if (HistoCode == "D_Adc_EvDs") {
14679  fD_Adc_EvDsYmin = GetYminValueFromMemo("D_Adc_EvDs");
14680  }
14681  if (HistoCode == "H_Ped_Date") {
14682  fH_Ped_DateYmin = GetYminValueFromMemo("H_Ped_Date");
14683  }
14684  if (HistoCode == "H_TNo_Date") {
14685  fH_TNo_DateYmin = GetYminValueFromMemo("H_TNo_Date");
14686  }
14687  if (HistoCode == "H_MCs_Date") {
14688  fH_MCs_DateYmin = GetYminValueFromMemo("H_MCs_Date");
14689  }
14690  if (HistoCode == "H_LFN_Date") {
14691  fH_LFN_DateYmin = GetYminValueFromMemo("H_LFN_Date");
14692  }
14693  if (HistoCode == "H_HFN_Date") {
14694  fH_HFN_DateYmin = GetYminValueFromMemo("H_HFN_Date");
14695  }
14696  if (HistoCode == "H_SCs_Date") {
14697  fH_SCs_DateYmin = GetYminValueFromMemo("H_SCs_Date");
14698  }
14699  if (HistoCode == "H_Ped_RuDs") {
14700  fH_Ped_RuDsYmin = GetYminValueFromMemo("H_Ped_RuDs");
14701  }
14702  if (HistoCode == "H_TNo_RuDs") {
14703  fH_TNo_RuDsYmin = GetYminValueFromMemo("H_TNo_RuDs");
14704  }
14705  if (HistoCode == "H_MCs_RuDs") {
14706  fH_MCs_RuDsYmin = GetYminValueFromMemo("H_MCs_RuDs");
14707  }
14708  if (HistoCode == "H_LFN_RuDs") {
14709  fH_LFN_RuDsYmin = GetYminValueFromMemo("H_LFN_RuDs");
14710  }
14711  if (HistoCode == "H_HFN_RuDs") {
14712  fH_HFN_RuDsYmin = GetYminValueFromMemo("H_HFN_RuDs");
14713  }
14714  if (HistoCode == "H_SCs_RuDs") {
14715  fH_SCs_RuDsYmin = GetYminValueFromMemo("H_SCs_RuDs");
14716  }
14717  if (HistoCode == "H2LFccMosMatrix") {
14718  fH2LFccMosMatrixYmin = GetYminValueFromMemo("H2LFccMosMatrix");
14719  }
14720  if (HistoCode == "H2HFccMosMatrix") {
14721  fH2HFccMosMatrixYmin = GetYminValueFromMemo("H2HFccMosMatrix");
14722  }
14723  if (HistoCode == "H2CorccInStins") {
14724  fH2CorccInStinsYmin = GetYminValueFromMemo("H2CorccInStins");
14725  }
14726 } // end of SetYminMemoFromPreviousMemo(...)
14727 
14728 void TEcnaHistos::SetYmaxMemoFromPreviousMemo(const TString& HistoCode) {
14729  // InitQuantity Ymax
14730 
14731  if (HistoCode == "D_NOE_ChNb") {
14732  fD_NOE_ChNbYmax = GetYmaxValueFromMemo("D_NOE_ChNb");
14733  }
14734  if (HistoCode == "D_NOE_ChDs") {
14735  fD_NOE_ChDsYmax = GetYmaxValueFromMemo("D_NOE_ChDs");
14736  }
14737  if (HistoCode == "D_Ped_ChNb") {
14738  fD_Ped_ChNbYmax = GetYmaxValueFromMemo("D_Ped_ChNb");
14739  }
14740  if (HistoCode == "D_Ped_ChDs") {
14741  fD_Ped_ChDsYmax = GetYmaxValueFromMemo("D_Ped_ChDs");
14742  }
14743  if (HistoCode == "D_TNo_ChNb") {
14744  fD_TNo_ChNbYmax = GetYmaxValueFromMemo("D_TNo_ChNb");
14745  }
14746  if (HistoCode == "D_TNo_ChDs") {
14747  fD_TNo_ChDsYmax = GetYmaxValueFromMemo("D_TNo_ChDs");
14748  }
14749  if (HistoCode == "D_MCs_ChNb") {
14750  fD_MCs_ChNbYmax = GetYmaxValueFromMemo("D_MCs_ChNb");
14751  }
14752  if (HistoCode == "D_MCs_ChDs") {
14753  fD_MCs_ChDsYmax = GetYmaxValueFromMemo("D_MCs_ChDs");
14754  }
14755  if (HistoCode == "D_LFN_ChNb") {
14756  fD_LFN_ChNbYmax = GetYmaxValueFromMemo("D_LFN_ChNb");
14757  }
14758  if (HistoCode == "D_LFN_ChDs") {
14759  fD_LFN_ChDsYmax = GetYmaxValueFromMemo("D_LFN_ChDs");
14760  }
14761  if (HistoCode == "D_HFN_ChNb") {
14762  fD_HFN_ChNbYmax = GetYmaxValueFromMemo("D_HFN_ChNb");
14763  }
14764  if (HistoCode == "D_HFN_ChDs") {
14765  fD_HFN_ChDsYmax = GetYmaxValueFromMemo("D_HFN_ChDs");
14766  }
14767  if (HistoCode == "D_SCs_ChNb") {
14768  fD_SCs_ChNbYmax = GetYmaxValueFromMemo("D_SCs_ChNb");
14769  }
14770  if (HistoCode == "D_SCs_ChDs") {
14771  fD_SCs_ChDsYmax = GetYmaxValueFromMemo("D_SCs_ChDs");
14772  }
14773  if (HistoCode == "D_MSp_SpNb") {
14774  fD_MSp_SpNbYmax = GetYmaxValueFromMemo("D_MSp_SpNb");
14775  }
14776  if (HistoCode == "D_MSp_SpDs") {
14777  fD_MSp_SpDsYmax = GetYmaxValueFromMemo("D_MSp_SpDs");
14778  }
14779  if (HistoCode == "D_SSp_SpNb") {
14780  fD_SSp_SpNbYmax = GetYmaxValueFromMemo("D_SSp_SpNb");
14781  }
14782  if (HistoCode == "D_SSp_SpDs") {
14783  fD_SSp_SpDsYmax = GetYmaxValueFromMemo("D_SSp_SpDs");
14784  }
14785  if (HistoCode == "D_Adc_EvNb") {
14786  fD_Adc_EvNbYmax = GetYmaxValueFromMemo("D_Adc_EvNb");
14787  }
14788  if (HistoCode == "D_Adc_EvDs") {
14789  fD_Adc_EvDsYmax = GetYmaxValueFromMemo("D_Adc_EvDs");
14790  }
14791  if (HistoCode == "H_Ped_Date") {
14792  fH_Ped_DateYmax = GetYmaxValueFromMemo("H_Ped_Date");
14793  }
14794  if (HistoCode == "H_TNo_Date") {
14795  fH_TNo_DateYmax = GetYmaxValueFromMemo("H_TNo_Date");
14796  }
14797  if (HistoCode == "H_MCs_Date") {
14798  fH_MCs_DateYmax = GetYmaxValueFromMemo("H_MCs_Date");
14799  }
14800  if (HistoCode == "H_LFN_Date") {
14801  fH_LFN_DateYmax = GetYmaxValueFromMemo("H_LFN_Date");
14802  }
14803  if (HistoCode == "H_HFN_Date") {
14804  fH_HFN_DateYmax = GetYmaxValueFromMemo("H_HFN_Date");
14805  }
14806  if (HistoCode == "H_SCs_Date") {
14807  fH_SCs_DateYmax = GetYmaxValueFromMemo("H_SCs_Date");
14808  }
14809  if (HistoCode == "H_Ped_RuDs") {
14810  fH_Ped_RuDsYmax = GetYmaxValueFromMemo("H_Ped_RuDs");
14811  }
14812  if (HistoCode == "H_TNo_RuDs") {
14813  fH_TNo_RuDsYmax = GetYmaxValueFromMemo("H_TNo_RuDs");
14814  }
14815  if (HistoCode == "H_MCs_RuDs") {
14816  fH_MCs_RuDsYmax = GetYmaxValueFromMemo("H_MCs_RuDs");
14817  }
14818  if (HistoCode == "H_LFN_RuDs") {
14819  fH_LFN_RuDsYmax = GetYmaxValueFromMemo("H_LFN_RuDs");
14820  }
14821  if (HistoCode == "H_HFN_RuDs") {
14822  fH_HFN_RuDsYmax = GetYmaxValueFromMemo("H_HFN_RuDs");
14823  }
14824  if (HistoCode == "H_SCs_RuDs") {
14825  fH_SCs_RuDsYmax = GetYmaxValueFromMemo("H_SCs_RuDs");
14826  }
14827  if (HistoCode == "H2LFccMosMatrix") {
14828  fH2LFccMosMatrixYmax = GetYmaxValueFromMemo("H2LFccMosMatrix");
14829  }
14830  if (HistoCode == "H2HFccMosMatrix") {
14831  fH2HFccMosMatrixYmax = GetYmaxValueFromMemo("H2HFccMosMatrix");
14832  }
14833  if (HistoCode == "H2CorccInStins") {
14834  fH2CorccInStinsYmax = GetYmaxValueFromMemo("H2CorccInStins");
14835  }
14836 } // end of SetYmaxMemoFromPreviousMemo(...)
14837 
14838 //------------------------------------------------------------------------------------------------------
14839 void TEcnaHistos::SetXVarMemo(const TString& HistoCode, const TString& opt_plot, const TString& xvar) {
14840  if (opt_plot == fSameOnePlot) {
14841  fXMemoH1SamePlus = xvar;
14842  }
14843 
14844  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
14845  if (HistoCode == "D_NOE_ChNb") {
14846  fXMemoD_NOE_ChNb = xvar;
14847  }
14848  if (HistoCode == "D_NOE_ChDs") {
14849  fXMemoD_NOE_ChDs = xvar;
14850  }
14851  if (HistoCode == "D_Ped_ChNb") {
14852  fXMemoD_Ped_ChNb = xvar;
14853  }
14854  if (HistoCode == "D_Ped_ChDs") {
14855  fXMemoD_Ped_ChDs = xvar;
14856  }
14857  if (HistoCode == "D_TNo_ChNb") {
14858  fXMemoD_TNo_ChNb = xvar;
14859  }
14860  if (HistoCode == "D_TNo_ChDs") {
14861  fXMemoD_TNo_ChDs = xvar;
14862  }
14863  if (HistoCode == "D_MCs_ChNb") {
14864  fXMemoD_MCs_ChNb = xvar;
14865  }
14866  if (HistoCode == "D_MCs_ChDs") {
14867  fXMemoD_MCs_ChDs = xvar;
14868  }
14869  if (HistoCode == "D_LFN_ChNb") {
14870  fXMemoD_LFN_ChNb = xvar;
14871  }
14872  if (HistoCode == "D_LFN_ChDs") {
14873  fXMemoD_LFN_ChDs = xvar;
14874  }
14875  if (HistoCode == "D_HFN_ChNb") {
14876  fXMemoD_HFN_ChNb = xvar;
14877  }
14878  if (HistoCode == "D_HFN_ChDs") {
14879  fXMemoD_HFN_ChDs = xvar;
14880  }
14881  if (HistoCode == "D_SCs_ChNb") {
14882  fXMemoD_SCs_ChNb = xvar;
14883  }
14884  if (HistoCode == "D_SCs_ChDs") {
14885  fXMemoD_SCs_ChDs = xvar;
14886  }
14887  if (HistoCode == "D_MSp_SpNb") {
14888  fXMemoD_MSp_SpNb = xvar;
14889  }
14890  if (HistoCode == "D_MSp_SpDs") {
14891  fXMemoD_MSp_SpDs = xvar;
14892  }
14893  if (HistoCode == "D_SSp_SpNb") {
14894  fXMemoD_SSp_SpNb = xvar;
14895  }
14896  if (HistoCode == "D_SSp_SpDs") {
14897  fXMemoD_SSp_SpDs = xvar;
14898  }
14899  if (HistoCode == "D_Adc_EvNb") {
14900  fXMemoD_Adc_EvNb = xvar;
14901  }
14902  if (HistoCode == "D_Adc_EvDs") {
14903  fXMemoD_Adc_EvDs = xvar;
14904  }
14905  if (HistoCode == "H_Ped_Date") {
14906  fXMemoH_Ped_Date = xvar;
14907  }
14908  if (HistoCode == "H_TNo_Date") {
14909  fXMemoH_TNo_Date = xvar;
14910  }
14911  if (HistoCode == "H_MCs_Date") {
14912  fXMemoH_MCs_Date = xvar;
14913  }
14914  if (HistoCode == "H_LFN_Date") {
14915  fXMemoH_LFN_Date = xvar;
14916  }
14917  if (HistoCode == "H_HFN_Date") {
14918  fXMemoH_HFN_Date = xvar;
14919  }
14920  if (HistoCode == "H_SCs_Date") {
14921  fXMemoH_SCs_Date = xvar;
14922  }
14923  if (HistoCode == "H_Ped_RuDs") {
14924  fXMemoH_Ped_RuDs = xvar;
14925  }
14926  if (HistoCode == "H_TNo_RuDs") {
14927  fXMemoH_TNo_RuDs = xvar;
14928  }
14929  if (HistoCode == "H_MCs_RuDs") {
14930  fXMemoH_MCs_RuDs = xvar;
14931  }
14932  if (HistoCode == "H_LFN_RuDs") {
14933  fXMemoH_LFN_RuDs = xvar;
14934  }
14935  if (HistoCode == "H_HFN_RuDs") {
14936  fXMemoH_HFN_RuDs = xvar;
14937  }
14938  if (HistoCode == "H_SCs_RuDs") {
14939  fXMemoH_SCs_RuDs = xvar;
14940  }
14941  }
14942 } // end of SetXVarMemo(...)
14943 
14944 TString TEcnaHistos::GetXVarFromMemo(const TString& HistoCode, const TString& opt_plot) {
14945  TString xvar = "(xvar not found)";
14946 
14947  if (opt_plot == fSameOnePlot) {
14948  xvar = fXMemoH1SamePlus;
14949  }
14950 
14951  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
14952  if (HistoCode == "D_NOE_ChNb") {
14953  xvar = fXMemoD_NOE_ChNb;
14954  }
14955  if (HistoCode == "D_NOE_ChDs") {
14956  xvar = fXMemoD_NOE_ChDs;
14957  }
14958  if (HistoCode == "D_Ped_ChNb") {
14959  xvar = fXMemoD_Ped_ChNb;
14960  }
14961  if (HistoCode == "D_Ped_ChDs") {
14962  xvar = fXMemoD_Ped_ChDs;
14963  }
14964  if (HistoCode == "D_TNo_ChNb") {
14965  xvar = fXMemoD_TNo_ChNb;
14966  }
14967  if (HistoCode == "D_TNo_ChDs") {
14968  xvar = fXMemoD_TNo_ChDs;
14969  }
14970  if (HistoCode == "D_MCs_ChNb") {
14971  xvar = fXMemoD_MCs_ChNb;
14972  }
14973  if (HistoCode == "D_MCs_ChDs") {
14974  xvar = fXMemoD_MCs_ChDs;
14975  }
14976  if (HistoCode == "D_LFN_ChNb") {
14977  xvar = fXMemoD_LFN_ChNb;
14978  }
14979  if (HistoCode == "D_LFN_ChDs") {
14980  xvar = fXMemoD_LFN_ChDs;
14981  }
14982  if (HistoCode == "D_HFN_ChNb") {
14983  xvar = fXMemoD_HFN_ChNb;
14984  }
14985  if (HistoCode == "D_HFN_ChDs") {
14986  xvar = fXMemoD_HFN_ChDs;
14987  }
14988  if (HistoCode == "D_SCs_ChNb") {
14989  xvar = fXMemoD_SCs_ChNb;
14990  }
14991  if (HistoCode == "D_SCs_ChDs") {
14992  xvar = fXMemoD_SCs_ChDs;
14993  }
14994  if (HistoCode == "D_MSp_SpNb") {
14995  xvar = fXMemoD_MSp_SpNb;
14996  }
14997  if (HistoCode == "D_MSp_SpDs") {
14998  xvar = fXMemoD_MSp_SpDs;
14999  }
15000  if (HistoCode == "D_SSp_SpNb") {
15001  xvar = fXMemoD_SSp_SpNb;
15002  }
15003  if (HistoCode == "D_SSp_SpDs") {
15004  xvar = fXMemoD_SSp_SpDs;
15005  }
15006  if (HistoCode == "D_Adc_EvNb") {
15007  xvar = fXMemoD_Adc_EvNb;
15008  }
15009  if (HistoCode == "D_Adc_EvDs") {
15010  xvar = fXMemoD_Adc_EvDs;
15011  }
15012  if (HistoCode == "H_Ped_Date") {
15013  xvar = fXMemoH_Ped_Date;
15014  }
15015  if (HistoCode == "H_TNo_Date") {
15016  xvar = fXMemoH_TNo_Date;
15017  }
15018  if (HistoCode == "H_MCs_Date") {
15019  xvar = fXMemoH_MCs_Date;
15020  }
15021  if (HistoCode == "H_LFN_Date") {
15022  xvar = fXMemoH_LFN_Date;
15023  }
15024  if (HistoCode == "H_HFN_Date") {
15025  xvar = fXMemoH_HFN_Date;
15026  }
15027  if (HistoCode == "H_SCs_Date") {
15028  xvar = fXMemoH_SCs_Date;
15029  }
15030  if (HistoCode == "H_Ped_RuDs") {
15031  xvar = fXMemoH_Ped_RuDs;
15032  }
15033  if (HistoCode == "H_TNo_RuDs") {
15034  xvar = fXMemoH_TNo_RuDs;
15035  }
15036  if (HistoCode == "H_MCs_RuDs") {
15037  xvar = fXMemoH_MCs_RuDs;
15038  }
15039  if (HistoCode == "H_LFN_RuDs") {
15040  xvar = fXMemoH_LFN_RuDs;
15041  }
15042  if (HistoCode == "H_HFN_RuDs") {
15043  xvar = fXMemoH_HFN_RuDs;
15044  }
15045  if (HistoCode == "H_SCs_RuDs") {
15046  xvar = fXMemoH_SCs_RuDs;
15047  }
15048  }
15049  return xvar;
15050 } // end of GetXVarFromMemo(...)
15051 
15052 void TEcnaHistos::SetYVarMemo(const TString& HistoCode, const TString& opt_plot, const TString& yvar) {
15053  if (opt_plot == fSameOnePlot) {
15054  fYMemoH1SamePlus = yvar;
15055  }
15056 
15057  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
15058  if (HistoCode == "D_NOE_ChNb") {
15059  fYMemoD_NOE_ChNb = yvar;
15060  }
15061  if (HistoCode == "D_NOE_ChDs") {
15062  fYMemoD_NOE_ChDs = yvar;
15063  }
15064  if (HistoCode == "D_Ped_ChNb") {
15065  fYMemoD_Ped_ChNb = yvar;
15066  }
15067  if (HistoCode == "D_Ped_ChDs") {
15068  fYMemoD_Ped_ChDs = yvar;
15069  }
15070  if (HistoCode == "D_TNo_ChNb") {
15071  fYMemoD_TNo_ChNb = yvar;
15072  }
15073  if (HistoCode == "D_TNo_ChDs") {
15074  fYMemoD_TNo_ChDs = yvar;
15075  }
15076  if (HistoCode == "D_MCs_ChNb") {
15077  fYMemoD_MCs_ChNb = yvar;
15078  }
15079  if (HistoCode == "D_MCs_ChDs") {
15080  fYMemoD_MCs_ChDs = yvar;
15081  }
15082  if (HistoCode == "D_LFN_ChNb") {
15083  fYMemoD_LFN_ChNb = yvar;
15084  }
15085  if (HistoCode == "D_LFN_ChDs") {
15086  fYMemoD_LFN_ChDs = yvar;
15087  }
15088  if (HistoCode == "D_HFN_ChNb") {
15089  fYMemoD_HFN_ChNb = yvar;
15090  }
15091  if (HistoCode == "D_HFN_ChDs") {
15092  fYMemoD_HFN_ChDs = yvar;
15093  }
15094  if (HistoCode == "D_SCs_ChNb") {
15095  fYMemoD_SCs_ChNb = yvar;
15096  }
15097  if (HistoCode == "D_SCs_ChDs") {
15098  fYMemoD_SCs_ChDs = yvar;
15099  }
15100  if (HistoCode == "D_MSp_SpNb") {
15101  fYMemoD_MSp_SpNb = yvar;
15102  }
15103  if (HistoCode == "D_MSp_SpDs") {
15104  fYMemoD_MSp_SpDs = yvar;
15105  }
15106  if (HistoCode == "D_SSp_SpNb") {
15107  fYMemoD_SSp_SpNb = yvar;
15108  }
15109  if (HistoCode == "D_Adc_EvDs") {
15110  fYMemoD_Adc_EvDs = yvar;
15111  }
15112  if (HistoCode == "D_SSp_SpDs") {
15113  fYMemoD_SSp_SpDs = yvar;
15114  }
15115  if (HistoCode == "D_Adc_EvNb") {
15116  fYMemoD_Adc_EvNb = yvar;
15117  }
15118  if (HistoCode == "H_Ped_Date") {
15119  fYMemoH_Ped_Date = yvar;
15120  }
15121  if (HistoCode == "H_TNo_Date") {
15122  fYMemoH_TNo_Date = yvar;
15123  }
15124  if (HistoCode == "H_MCs_Date") {
15125  fYMemoH_MCs_Date = yvar;
15126  }
15127  if (HistoCode == "H_LFN_Date") {
15128  fYMemoH_LFN_Date = yvar;
15129  }
15130  if (HistoCode == "H_HFN_Date") {
15131  fYMemoH_HFN_Date = yvar;
15132  }
15133  if (HistoCode == "H_SCs_Date") {
15134  fYMemoH_SCs_Date = yvar;
15135  }
15136  if (HistoCode == "H_Ped_RuDs") {
15137  fYMemoH_Ped_RuDs = yvar;
15138  }
15139  if (HistoCode == "H_TNo_RuDs") {
15140  fYMemoH_TNo_RuDs = yvar;
15141  }
15142  if (HistoCode == "H_MCs_RuDs") {
15143  fYMemoH_MCs_RuDs = yvar;
15144  }
15145  if (HistoCode == "H_LFN_RuDs") {
15146  fYMemoH_LFN_RuDs = yvar;
15147  }
15148  if (HistoCode == "H_HFN_RuDs") {
15149  fYMemoH_HFN_RuDs = yvar;
15150  }
15151  if (HistoCode == "H_SCs_RuDs") {
15152  fYMemoH_SCs_RuDs = yvar;
15153  }
15154  }
15155 } // end of SetYVarMemo(...)
15156 
15157 TString TEcnaHistos::GetYVarFromMemo(const TString& HistoCode, const TString& opt_plot) {
15158  TString yvar = "(yvar not found)";
15159 
15160  if (opt_plot == fSameOnePlot) {
15161  yvar = fYMemoH1SamePlus;
15162  }
15163 
15164  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
15165  if (HistoCode == "D_NOE_ChNb") {
15166  yvar = fYMemoD_NOE_ChNb;
15167  }
15168  if (HistoCode == "D_NOE_ChDs") {
15169  yvar = fYMemoD_NOE_ChDs;
15170  }
15171  if (HistoCode == "D_Ped_ChNb") {
15172  yvar = fYMemoD_Ped_ChNb;
15173  }
15174  if (HistoCode == "D_Ped_ChDs") {
15175  yvar = fYMemoD_Ped_ChDs;
15176  }
15177  if (HistoCode == "D_TNo_ChNb") {
15178  yvar = fYMemoD_TNo_ChNb;
15179  }
15180  if (HistoCode == "D_TNo_ChDs") {
15181  yvar = fYMemoD_TNo_ChDs;
15182  }
15183  if (HistoCode == "D_MCs_ChNb") {
15184  yvar = fYMemoD_MCs_ChNb;
15185  }
15186  if (HistoCode == "D_MCs_ChDs") {
15187  yvar = fYMemoD_MCs_ChDs;
15188  }
15189  if (HistoCode == "D_LFN_ChNb") {
15190  yvar = fYMemoD_LFN_ChNb;
15191  }
15192  if (HistoCode == "D_LFN_ChDs") {
15193  yvar = fYMemoD_LFN_ChDs;
15194  }
15195  if (HistoCode == "D_HFN_ChNb") {
15196  yvar = fYMemoD_HFN_ChNb;
15197  }
15198  if (HistoCode == "D_HFN_ChDs") {
15199  yvar = fYMemoD_HFN_ChDs;
15200  }
15201  if (HistoCode == "D_SCs_ChNb") {
15202  yvar = fYMemoD_SCs_ChNb;
15203  }
15204  if (HistoCode == "D_SCs_ChDs") {
15205  yvar = fYMemoD_SCs_ChDs;
15206  }
15207  if (HistoCode == "D_MSp_SpNb") {
15208  yvar = fYMemoD_MSp_SpNb;
15209  }
15210  if (HistoCode == "D_MSp_SpDs") {
15211  yvar = fYMemoD_MSp_SpDs;
15212  }
15213  if (HistoCode == "D_SSp_SpNb") {
15214  yvar = fYMemoD_SSp_SpNb;
15215  }
15216  if (HistoCode == "D_SSp_SpDs") {
15217  yvar = fYMemoD_SSp_SpDs;
15218  }
15219  if (HistoCode == "D_Adc_EvNb") {
15220  yvar = fYMemoD_Adc_EvNb;
15221  }
15222  if (HistoCode == "D_Adc_EvDs") {
15223  yvar = fYMemoD_Adc_EvDs;
15224  }
15225  if (HistoCode == "H_Ped_Date") {
15226  yvar = fYMemoH_Ped_Date;
15227  }
15228  if (HistoCode == "H_TNo_Date") {
15229  yvar = fYMemoH_TNo_Date;
15230  }
15231  if (HistoCode == "H_MCs_Date") {
15232  yvar = fYMemoH_MCs_Date;
15233  }
15234  if (HistoCode == "H_LFN_Date") {
15235  yvar = fYMemoH_LFN_Date;
15236  }
15237  if (HistoCode == "H_HFN_Date") {
15238  yvar = fYMemoH_HFN_Date;
15239  }
15240  if (HistoCode == "H_SCs_Date") {
15241  yvar = fYMemoH_SCs_Date;
15242  }
15243  if (HistoCode == "H_Ped_RuDs") {
15244  yvar = fYMemoH_Ped_RuDs;
15245  }
15246  if (HistoCode == "H_TNo_RuDs") {
15247  yvar = fYMemoH_TNo_RuDs;
15248  }
15249  if (HistoCode == "H_MCs_RuDs") {
15250  yvar = fYMemoH_MCs_RuDs;
15251  }
15252  if (HistoCode == "H_LFN_RuDs") {
15253  yvar = fYMemoH_LFN_RuDs;
15254  }
15255  if (HistoCode == "H_HFN_RuDs") {
15256  yvar = fYMemoH_HFN_RuDs;
15257  }
15258  if (HistoCode == "H_SCs_RuDs") {
15259  yvar = fYMemoH_SCs_RuDs;
15260  }
15261  }
15262  return yvar;
15263 } // end of GetYVarFromMemo(...)
15264 
15265 void TEcnaHistos::SetNbBinsMemo(const TString& HistoCode, const TString& opt_plot, const Int_t& nb_bins) {
15266  if (opt_plot == fSameOnePlot) {
15267  fNbBinsMemoH1SamePlus = nb_bins;
15268  }
15269 
15270  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
15271  if (HistoCode == "D_NOE_ChNb") {
15272  fNbBinsMemoD_NOE_ChNb = nb_bins;
15273  }
15274  if (HistoCode == "D_NOE_ChDs") {
15275  fNbBinsMemoD_NOE_ChDs = nb_bins;
15276  }
15277  if (HistoCode == "D_Ped_ChNb") {
15278  fNbBinsMemoD_Ped_ChNb = nb_bins;
15279  }
15280  if (HistoCode == "D_Ped_ChDs") {
15281  fNbBinsMemoD_Ped_ChDs = nb_bins;
15282  }
15283  if (HistoCode == "D_TNo_ChNb") {
15284  fNbBinsMemoD_TNo_ChNb = nb_bins;
15285  }
15286  if (HistoCode == "D_TNo_ChDs") {
15287  fNbBinsMemoD_TNo_ChDs = nb_bins;
15288  }
15289  if (HistoCode == "D_MCs_ChNb") {
15290  fNbBinsMemoD_MCs_ChNb = nb_bins;
15291  }
15292  if (HistoCode == "D_MCs_ChDs") {
15293  fNbBinsMemoD_MCs_ChDs = nb_bins;
15294  }
15295  if (HistoCode == "D_LFN_ChNb") {
15296  fNbBinsMemoD_LFN_ChNb = nb_bins;
15297  }
15298  if (HistoCode == "D_LFN_ChDs") {
15299  fNbBinsMemoD_LFN_ChDs = nb_bins;
15300  }
15301  if (HistoCode == "D_HFN_ChNb") {
15302  fNbBinsMemoD_HFN_ChNb = nb_bins;
15303  }
15304  if (HistoCode == "D_HFN_ChDs") {
15305  fNbBinsMemoD_HFN_ChDs = nb_bins;
15306  }
15307  if (HistoCode == "D_SCs_ChNb") {
15308  fNbBinsMemoD_SCs_ChNb = nb_bins;
15309  }
15310  if (HistoCode == "D_SCs_ChDs") {
15311  fNbBinsMemoD_SCs_ChDs = nb_bins;
15312  }
15313  if (HistoCode == "D_MSp_SpNb") {
15314  fNbBinsMemoD_MSp_SpNb = nb_bins;
15315  }
15316  if (HistoCode == "D_MSp_SpDs") {
15317  fNbBinsMemoD_MSp_SpDs = nb_bins;
15318  }
15319  if (HistoCode == "D_SSp_SpNb") {
15320  fNbBinsMemoD_SSp_SpNb = nb_bins;
15321  }
15322  if (HistoCode == "D_SSp_SpDs") {
15323  fNbBinsMemoD_SSp_SpDs = nb_bins;
15324  }
15325  if (HistoCode == "D_Adc_EvNb") {
15326  fNbBinsMemoD_Adc_EvNb = nb_bins;
15327  }
15328  if (HistoCode == "D_Adc_EvDs") {
15329  fNbBinsMemoD_Adc_EvDs = nb_bins;
15330  }
15331  if (HistoCode == "H_Ped_Date") {
15332  fNbBinsMemoH_Ped_Date = nb_bins;
15333  }
15334  if (HistoCode == "H_TNo_Date") {
15335  fNbBinsMemoH_TNo_Date = nb_bins;
15336  }
15337  if (HistoCode == "H_MCs_Date") {
15338  fNbBinsMemoH_MCs_Date = nb_bins;
15339  }
15340  if (HistoCode == "H_LFN_Date") {
15341  fNbBinsMemoH_LFN_Date = nb_bins;
15342  }
15343  if (HistoCode == "H_HFN_Date") {
15344  fNbBinsMemoH_HFN_Date = nb_bins;
15345  }
15346  if (HistoCode == "H_SCs_Date") {
15347  fNbBinsMemoH_SCs_Date = nb_bins;
15348  }
15349  if (HistoCode == "H_Ped_RuDs") {
15350  fNbBinsMemoH_Ped_RuDs = nb_bins;
15351  }
15352  if (HistoCode == "H_TNo_RuDs") {
15353  fNbBinsMemoH_TNo_RuDs = nb_bins;
15354  }
15355  if (HistoCode == "H_MCs_RuDs") {
15356  fNbBinsMemoH_MCs_RuDs = nb_bins;
15357  }
15358  if (HistoCode == "H_LFN_RuDs") {
15359  fNbBinsMemoH_LFN_RuDs = nb_bins;
15360  }
15361  if (HistoCode == "H_HFN_RuDs") {
15362  fNbBinsMemoH_HFN_RuDs = nb_bins;
15363  }
15364  if (HistoCode == "H_SCs_RuDs") {
15365  fNbBinsMemoH_SCs_RuDs = nb_bins;
15366  }
15367  }
15368 } // end of SetNbBinsMemo(...)
15369 
15370 Int_t TEcnaHistos::GetNbBinsFromMemo(const TString& HistoCode, const TString& opt_plot) {
15371  Int_t nb_bins = 0;
15372 
15373  if (opt_plot == fSameOnePlot) {
15374  nb_bins = fNbBinsMemoH1SamePlus;
15375  }
15376 
15377  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
15378  if (HistoCode == "D_NOE_ChNb") {
15379  nb_bins = fNbBinsMemoD_NOE_ChNb;
15380  }
15381  if (HistoCode == "D_NOE_ChDs") {
15382  nb_bins = fNbBinsMemoD_NOE_ChDs;
15383  }
15384  if (HistoCode == "D_Ped_ChNb") {
15385  nb_bins = fNbBinsMemoD_Ped_ChNb;
15386  }
15387  if (HistoCode == "D_Ped_ChDs") {
15388  nb_bins = fNbBinsMemoD_Ped_ChDs;
15389  }
15390  if (HistoCode == "D_TNo_ChNb") {
15391  nb_bins = fNbBinsMemoD_TNo_ChNb;
15392  }
15393  if (HistoCode == "D_TNo_ChDs") {
15394  nb_bins = fNbBinsMemoD_TNo_ChDs;
15395  }
15396  if (HistoCode == "D_MCs_ChNb") {
15397  nb_bins = fNbBinsMemoD_MCs_ChNb;
15398  }
15399  if (HistoCode == "D_MCs_ChDs") {
15400  nb_bins = fNbBinsMemoD_MCs_ChDs;
15401  }
15402  if (HistoCode == "D_LFN_ChNb") {
15403  nb_bins = fNbBinsMemoD_LFN_ChNb;
15404  }
15405  if (HistoCode == "D_LFN_ChDs") {
15406  nb_bins = fNbBinsMemoD_LFN_ChDs;
15407  }
15408  if (HistoCode == "D_HFN_ChNb") {
15409  nb_bins = fNbBinsMemoD_HFN_ChNb;
15410  }
15411  if (HistoCode == "D_HFN_ChDs") {
15412  nb_bins = fNbBinsMemoD_HFN_ChDs;
15413  }
15414  if (HistoCode == "D_SCs_ChNb") {
15415  nb_bins = fNbBinsMemoD_SCs_ChNb;
15416  }
15417  if (HistoCode == "D_SCs_ChDs") {
15418  nb_bins = fNbBinsMemoD_SCs_ChDs;
15419  }
15420  if (HistoCode == "D_MSp_SpNb") {
15421  nb_bins = fNbBinsMemoD_MSp_SpNb;
15422  }
15423  if (HistoCode == "D_MSp_SpDs") {
15424  nb_bins = fNbBinsMemoD_MSp_SpDs;
15425  }
15426  if (HistoCode == "D_SSp_SpNb") {
15427  nb_bins = fNbBinsMemoD_SSp_SpNb;
15428  }
15429  if (HistoCode == "D_SSp_SpDs") {
15430  nb_bins = fNbBinsMemoD_SSp_SpDs;
15431  }
15432  if (HistoCode == "D_Adc_EvNb") {
15433  nb_bins = fNbBinsMemoD_Adc_EvNb;
15434  }
15435  if (HistoCode == "D_Adc_EvDs") {
15436  nb_bins = fNbBinsMemoD_Adc_EvDs;
15437  }
15438  if (HistoCode == "H_Ped_Date") {
15439  nb_bins = fNbBinsMemoH_Ped_Date;
15440  }
15441  if (HistoCode == "H_TNo_Date") {
15442  nb_bins = fNbBinsMemoH_TNo_Date;
15443  }
15444  if (HistoCode == "H_MCs_Date") {
15445  nb_bins = fNbBinsMemoH_MCs_Date;
15446  }
15447  if (HistoCode == "H_LFN_Date") {
15448  nb_bins = fNbBinsMemoH_LFN_Date;
15449  }
15450  if (HistoCode == "H_HFN_Date") {
15451  nb_bins = fNbBinsMemoH_HFN_Date;
15452  }
15453  if (HistoCode == "H_SCs_Date") {
15454  nb_bins = fNbBinsMemoH_SCs_Date;
15455  }
15456  if (HistoCode == "H_Ped_RuDs") {
15457  nb_bins = fNbBinsMemoH_Ped_RuDs;
15458  }
15459  if (HistoCode == "H_TNo_RuDs") {
15460  nb_bins = fNbBinsMemoH_TNo_RuDs;
15461  }
15462  if (HistoCode == "H_MCs_RuDs") {
15463  nb_bins = fNbBinsMemoH_MCs_RuDs;
15464  }
15465  if (HistoCode == "H_LFN_RuDs") {
15466  nb_bins = fNbBinsMemoH_LFN_RuDs;
15467  }
15468  if (HistoCode == "H_HFN_RuDs") {
15469  nb_bins = fNbBinsMemoH_HFN_RuDs;
15470  }
15471  if (HistoCode == "H_SCs_RuDs") {
15472  nb_bins = fNbBinsMemoH_SCs_RuDs;
15473  }
15474  }
15475  return nb_bins;
15476 } // end of GetNbBinsFromMemo(...)
15477 
15478 TString TEcnaHistos::GetMemoFlag(const TString& opt_plot) {
15479  TString memo_flag;
15480  memo_flag.Resize(charArrLen);
15481  memo_flag = "(no memo_flag info)";
15482 
15483  Int_t memo_flag_number = -1;
15484 
15485  if (opt_plot == fSameOnePlot) {
15486  memo_flag_number = fMemoPlotH1SamePlus;
15487  }
15488 
15489  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
15490  memo_flag_number =
15492  }
15493 
15494  if (memo_flag_number == 0) {
15495  memo_flag = "Free";
15496  }
15497  if (memo_flag_number >= 1) {
15498  memo_flag = "Busy";
15499  }
15500 
15501  return memo_flag;
15502 }
15503 
15504 TString TEcnaHistos::GetMemoFlag(const TString& HistoCode, const TString& opt_plot) {
15505  // Get Memo Flag
15506 
15507  TString memo_flag;
15508  memo_flag.Resize(charArrLen);
15509  memo_flag = "(no memo_flag info)";
15510 
15511  Int_t memo_flag_number = -1;
15512 
15513  if (opt_plot == fSameOnePlot) {
15514  memo_flag_number = fMemoPlotH1SamePlus;
15515  }
15516 
15517  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
15518  if (HistoCode == "D_NOE_ChNb") {
15519  memo_flag_number = fMemoPlotD_NOE_ChNb;
15520  }
15521  if (HistoCode == "D_NOE_ChDs") {
15522  memo_flag_number = fMemoPlotD_NOE_ChDs;
15523  }
15524  if (HistoCode == "D_Ped_ChNb") {
15525  memo_flag_number = fMemoPlotD_Ped_ChNb;
15526  }
15527  if (HistoCode == "D_Ped_ChDs") {
15528  memo_flag_number = fMemoPlotD_Ped_ChDs;
15529  }
15530  if (HistoCode == "D_TNo_ChNb") {
15531  memo_flag_number = fMemoPlotD_TNo_ChNb;
15532  }
15533  if (HistoCode == "D_TNo_ChDs") {
15534  memo_flag_number = fMemoPlotD_TNo_ChDs;
15535  }
15536  if (HistoCode == "D_MCs_ChNb") {
15537  memo_flag_number = fMemoPlotD_MCs_ChNb;
15538  }
15539  if (HistoCode == "D_MCs_ChDs") {
15540  memo_flag_number = fMemoPlotD_MCs_ChDs;
15541  }
15542  if (HistoCode == "D_LFN_ChNb") {
15543  memo_flag_number = fMemoPlotD_LFN_ChNb;
15544  }
15545  if (HistoCode == "D_LFN_ChDs") {
15546  memo_flag_number = fMemoPlotD_LFN_ChDs;
15547  }
15548  if (HistoCode == "D_HFN_ChNb") {
15549  memo_flag_number = fMemoPlotD_HFN_ChNb;
15550  }
15551  if (HistoCode == "D_HFN_ChDs") {
15552  memo_flag_number = fMemoPlotD_HFN_ChDs;
15553  }
15554  if (HistoCode == "D_SCs_ChNb") {
15555  memo_flag_number = fMemoPlotD_SCs_ChNb;
15556  }
15557  if (HistoCode == "D_SCs_ChDs") {
15558  memo_flag_number = fMemoPlotD_SCs_ChDs;
15559  }
15560  if (HistoCode == "D_MSp_SpNb") {
15561  memo_flag_number = fMemoPlotD_MSp_SpNb;
15562  }
15563  if (HistoCode == "D_MSp_SpDs") {
15564  memo_flag_number = fMemoPlotD_MSp_SpDs;
15565  }
15566  if (HistoCode == "D_SSp_SpNb") {
15567  memo_flag_number = fMemoPlotD_SSp_SpNb;
15568  }
15569  if (HistoCode == "D_SSp_SpDs") {
15570  memo_flag_number = fMemoPlotD_SSp_SpDs;
15571  }
15572  if (HistoCode == "D_Adc_EvNb") {
15573  memo_flag_number = fMemoPlotD_Adc_EvNb;
15574  }
15575  if (HistoCode == "D_Adc_EvDs") {
15576  memo_flag_number = fMemoPlotD_Adc_EvDs;
15577  }
15578  if (HistoCode == "H_Ped_Date") {
15579  memo_flag_number = fMemoPlotH_Ped_Date;
15580  }
15581  if (HistoCode == "H_TNo_Date") {
15582  memo_flag_number = fMemoPlotH_TNo_Date;
15583  }
15584  if (HistoCode == "H_MCs_Date") {
15585  memo_flag_number = fMemoPlotH_MCs_Date;
15586  }
15587  if (HistoCode == "H_LFN_Date") {
15588  memo_flag_number = fMemoPlotH_LFN_Date;
15589  }
15590  if (HistoCode == "H_HFN_Date") {
15591  memo_flag_number = fMemoPlotH_HFN_Date;
15592  }
15593  if (HistoCode == "H_SCs_Date") {
15594  memo_flag_number = fMemoPlotH_SCs_Date;
15595  }
15596  if (HistoCode == "H_Ped_RuDs") {
15597  memo_flag_number = fMemoPlotH_Ped_RuDs;
15598  }
15599  if (HistoCode == "H_TNo_RuDs") {
15600  memo_flag_number = fMemoPlotH_TNo_RuDs;
15601  }
15602  if (HistoCode == "H_MCs_RuDs") {
15603  memo_flag_number = fMemoPlotH_MCs_RuDs;
15604  }
15605  if (HistoCode == "H_LFN_RuDs") {
15606  memo_flag_number = fMemoPlotH_LFN_RuDs;
15607  }
15608  if (HistoCode == "H_HFN_RuDs") {
15609  memo_flag_number = fMemoPlotH_HFN_RuDs;
15610  }
15611  if (HistoCode == "H_SCs_RuDs") {
15612  memo_flag_number = fMemoPlotH_SCs_RuDs;
15613  }
15614  }
15615 
15616  if (memo_flag_number == 0) {
15617  memo_flag = "Free";
15618  }
15619  if (memo_flag_number == 1) {
15620  memo_flag = "Busy";
15621  }
15622 
15623  return memo_flag;
15624 }
15625 
15627  const TString& HistoCode, const TString& opt_plot, const TString& canvas_name, UInt_t canv_w, UInt_t canv_h) {
15628  // Create canvas according to HistoCode
15629 
15630  TCanvas* main_canvas = nullptr;
15631 
15632  if (opt_plot == fSameOnePlot) {
15633  fCanvH1SamePlus = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15634  fCnewRoot++;
15635  main_canvas = fCanvH1SamePlus;
15636  }
15637  if (opt_plot == fSeveralPlot || opt_plot == fOnlyOnePlot) {
15638  if (HistoCode == "D_NOE_ChNb") {
15639  fCanvD_NOE_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15640  fCnewRoot++;
15641  main_canvas = fCanvD_NOE_ChNb;
15642  }
15643  if (HistoCode == "D_NOE_ChDs") {
15644  fCanvD_NOE_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15645  fCnewRoot++;
15646  main_canvas = fCanvD_NOE_ChDs;
15647  }
15648  if (HistoCode == "D_Ped_ChNb") {
15649  fCanvD_Ped_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15650  fCnewRoot++;
15651  main_canvas = fCanvD_Ped_ChNb;
15652  }
15653  if (HistoCode == "D_Ped_ChDs") {
15654  fCanvD_Ped_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15655  fCnewRoot++;
15656  main_canvas = fCanvD_Ped_ChDs;
15657  }
15658  if (HistoCode == "D_TNo_ChNb") {
15659  fCanvD_TNo_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15660  fCnewRoot++;
15661  main_canvas = fCanvD_TNo_ChNb;
15662  }
15663  if (HistoCode == "D_TNo_ChDs") {
15664  fCanvD_TNo_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15665  fCnewRoot++;
15666  main_canvas = fCanvD_TNo_ChDs;
15667  }
15668  if (HistoCode == "D_MCs_ChNb") {
15669  fCanvD_MCs_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15670  fCnewRoot++;
15671  main_canvas = fCanvD_MCs_ChNb;
15672  }
15673  if (HistoCode == "D_MCs_ChDs") {
15674  fCanvD_MCs_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15675  fCnewRoot++;
15676  main_canvas = fCanvD_MCs_ChDs;
15677  }
15678  if (HistoCode == "D_LFN_ChNb") {
15679  fCanvD_LFN_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15680  fCnewRoot++;
15681  main_canvas = fCanvD_LFN_ChNb;
15682  }
15683  if (HistoCode == "D_LFN_ChDs") {
15684  fCanvD_LFN_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15685  fCnewRoot++;
15686  main_canvas = fCanvD_LFN_ChDs;
15687  }
15688  if (HistoCode == "D_HFN_ChNb") {
15689  fCanvD_HFN_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15690  fCnewRoot++;
15691  main_canvas = fCanvD_HFN_ChNb;
15692  }
15693  if (HistoCode == "D_HFN_ChDs") {
15694  fCanvD_HFN_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15695  fCnewRoot++;
15696  main_canvas = fCanvD_HFN_ChDs;
15697  }
15698  if (HistoCode == "D_SCs_ChNb") {
15699  fCanvD_SCs_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15700  fCnewRoot++;
15701  main_canvas = fCanvD_SCs_ChNb;
15702  }
15703  if (HistoCode == "D_SCs_ChDs") {
15704  fCanvD_SCs_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15705  fCnewRoot++;
15706  main_canvas = fCanvD_SCs_ChDs;
15707  }
15708 
15709  if (HistoCode == "D_MSp_SpNb") {
15710  fCanvD_MSp_SpNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15711  fCnewRoot++;
15712  main_canvas = fCanvD_MSp_SpNb;
15713  }
15714  if (HistoCode == "D_MSp_SpDs") {
15715  fCanvD_MSp_SpDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15716  fCnewRoot++;
15717  main_canvas = fCanvD_MSp_SpDs;
15718  }
15719  if (HistoCode == "D_SSp_SpNb") {
15720  fCanvD_SSp_SpNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15721  fCnewRoot++;
15722  main_canvas = fCanvD_SSp_SpNb;
15723  }
15724  if (HistoCode == "D_SSp_SpDs") {
15725  fCanvD_SSp_SpDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15726  fCnewRoot++;
15727  main_canvas = fCanvD_SSp_SpDs;
15728  }
15729 
15730  if (HistoCode == "D_Adc_EvNb") {
15731  fCanvD_Adc_EvNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15732  fCnewRoot++;
15733  main_canvas = fCanvD_Adc_EvNb;
15734  }
15735  if (HistoCode == "D_Adc_EvDs") {
15736  fCanvD_Adc_EvDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15737  fCnewRoot++;
15738  main_canvas = fCanvD_Adc_EvDs;
15739  }
15740 
15741  if (HistoCode == "H_Ped_Date") {
15742  fCanvH_Ped_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15743  fCnewRoot++;
15744  main_canvas = fCanvH_Ped_Date;
15745  }
15746  if (HistoCode == "H_TNo_Date") {
15747  fCanvH_TNo_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15748  fCnewRoot++;
15749  main_canvas = fCanvH_TNo_Date;
15750  }
15751  if (HistoCode == "H_MCs_Date") {
15752  fCanvH_MCs_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15753  fCnewRoot++;
15754  main_canvas = fCanvH_MCs_Date;
15755  }
15756  if (HistoCode == "H_LFN_Date") {
15757  fCanvH_LFN_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15758  fCnewRoot++;
15759  main_canvas = fCanvH_LFN_Date;
15760  }
15761  if (HistoCode == "H_HFN_Date") {
15762  fCanvH_HFN_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15763  fCnewRoot++;
15764  main_canvas = fCanvH_HFN_Date;
15765  }
15766  if (HistoCode == "H_SCs_Date") {
15767  fCanvH_SCs_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15768  fCnewRoot++;
15769  main_canvas = fCanvH_SCs_Date;
15770  }
15771 
15772  if (HistoCode == "H_Ped_RuDs") {
15773  fCanvH_Ped_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15774  fCnewRoot++;
15775  main_canvas = fCanvH_Ped_RuDs;
15776  }
15777  if (HistoCode == "H_TNo_RuDs") {
15778  fCanvH_TNo_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15779  fCnewRoot++;
15780  main_canvas = fCanvH_TNo_RuDs;
15781  }
15782  if (HistoCode == "H_MCs_RuDs") {
15783  fCanvH_MCs_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15784  fCnewRoot++;
15785  main_canvas = fCanvH_MCs_RuDs;
15786  }
15787  if (HistoCode == "H_LFN_RuDs") {
15788  fCanvH_LFN_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15789  fCnewRoot++;
15790  main_canvas = fCanvH_LFN_RuDs;
15791  }
15792  if (HistoCode == "H_HFN_RuDs") {
15793  fCanvH_HFN_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15794  fCnewRoot++;
15795  main_canvas = fCanvH_HFN_RuDs;
15796  }
15797  if (HistoCode == "H_SCs_RuDs") {
15798  fCanvH_SCs_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h);
15799  fCnewRoot++;
15800  main_canvas = fCanvH_SCs_RuDs;
15801  }
15802  }
15803  return main_canvas;
15804 }
15805 // end of CreateCanvas
15806 
15807 void TEcnaHistos::SetParametersCanvas(const TString& HistoCode, const TString& opt_plot) {
15808  // Set parameters canvas according to HistoCode
15809 
15810  Double_t x_margin_factor = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
15811  Double_t y_margin_factor = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
15812 
15813  if (opt_plot == fSameOnePlot) {
15814  fImpH1SamePlus = (TCanvasImp*)fCanvH1SamePlus->GetCanvasImp();
15815  fCanvH1SamePlus->Divide(1, 1, x_margin_factor, y_margin_factor);
15816  gPad->cd(1);
15817  fPadH1SamePlus = gPad;
15818  fClosedH1SamePlus = kFALSE;
15819  fMemoPlotH1SamePlus = 1;
15821  }
15822 
15823  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
15824  if (HistoCode == "D_NOE_ChNb") {
15825  fImpD_NOE_ChNb = (TCanvasImp*)fCanvD_NOE_ChNb->GetCanvasImp();
15826  fCanvD_NOE_ChNb->Divide(1, 1, x_margin_factor, y_margin_factor);
15827  gPad->cd(1);
15828  fPadD_NOE_ChNb = gPad;
15829  fClosedD_NOE_ChNb = kFALSE;
15830  fMemoPlotD_NOE_ChNb = 1;
15832  }
15833 
15834  if (HistoCode == "D_NOE_ChDs") // (SetParametersCanvas)
15835  {
15836  fImpD_NOE_ChDs = (TCanvasImp*)fCanvD_NOE_ChDs->GetCanvasImp();
15837  fCanvD_NOE_ChDs->Divide(1, 1, x_margin_factor, y_margin_factor);
15838  gPad->cd(1);
15839  fPadD_NOE_ChDs = gPad;
15840  fClosedD_NOE_ChDs = kFALSE;
15841  fMemoPlotD_NOE_ChDs = 1;
15843  }
15844 
15845  if (HistoCode == "D_Ped_ChNb") {
15846  fImpD_Ped_ChNb = (TCanvasImp*)fCanvD_Ped_ChNb->GetCanvasImp();
15847  fCanvD_Ped_ChNb->Divide(1, 1, x_margin_factor, y_margin_factor);
15848  gPad->cd(1);
15849  fPadD_Ped_ChNb = gPad;
15850  fClosedD_Ped_ChNb = kFALSE;
15851  fMemoPlotD_Ped_ChNb = 1;
15853  }
15854 
15855  if (HistoCode == "D_Ped_ChDs") {
15856  fImpD_Ped_ChDs = (TCanvasImp*)fCanvD_Ped_ChDs->GetCanvasImp();
15857  fCanvD_Ped_ChDs->Divide(1, 1, x_margin_factor, y_margin_factor);
15858  gPad->cd(1);
15859  fPadD_Ped_ChDs = gPad;
15860  fClosedD_Ped_ChDs = kFALSE;
15861  fMemoPlotD_Ped_ChDs = 1;
15863  }
15864 
15865  if (HistoCode == "D_TNo_ChNb") {
15866  fImpD_TNo_ChNb = (TCanvasImp*)fCanvD_TNo_ChNb->GetCanvasImp();
15867  fCanvD_TNo_ChNb->Divide(1, 1, x_margin_factor, y_margin_factor);
15868  gPad->cd(1);
15869  fPadD_TNo_ChNb = gPad;
15870  fClosedD_TNo_ChNb = kFALSE;
15871  fMemoPlotD_TNo_ChNb = 1;
15873  }
15874 
15875  if (HistoCode == "D_TNo_ChDs") // (SetParametersCanvas)
15876  {
15877  fImpD_TNo_ChDs = (TCanvasImp*)fCanvD_TNo_ChDs->GetCanvasImp();
15878  fCanvD_TNo_ChDs->Divide(1, 1, x_margin_factor, y_margin_factor);
15879  gPad->cd(1);
15880  fPadD_TNo_ChDs = gPad;
15881  fClosedD_TNo_ChDs = kFALSE;
15882  fMemoPlotD_TNo_ChDs = 1;
15884  }
15885 
15886  if (HistoCode == "D_MCs_ChNb") {
15887  fImpD_MCs_ChNb = (TCanvasImp*)fCanvD_MCs_ChNb->GetCanvasImp();
15888  fCanvD_MCs_ChNb->Divide(1, 1, x_margin_factor, y_margin_factor);
15889  gPad->cd(1);
15890  fPadD_MCs_ChNb = gPad;
15891  fClosedD_MCs_ChNb = kFALSE;
15892  fMemoPlotD_MCs_ChNb = 1;
15894  }
15895 
15896  if (HistoCode == "D_MCs_ChDs") {
15897  fImpD_MCs_ChDs = (TCanvasImp*)fCanvD_MCs_ChDs->GetCanvasImp();
15898  fCanvD_MCs_ChDs->Divide(1, 1, x_margin_factor, y_margin_factor);
15899  gPad->cd(1);
15900  fPadD_MCs_ChDs = gPad;
15901  fClosedD_MCs_ChDs = kFALSE;
15902  fMemoPlotD_MCs_ChDs = 1;
15904  }
15905 
15906  if (HistoCode == "D_LFN_ChNb") // (SetParametersCanvas)
15907  {
15908  fImpD_LFN_ChNb = (TCanvasImp*)fCanvD_LFN_ChNb->GetCanvasImp();
15909  fCanvD_LFN_ChNb->Divide(1, 1, x_margin_factor, y_margin_factor);
15910  gPad->cd(1);
15911  fPadD_LFN_ChNb = gPad;
15912  fClosedD_LFN_ChNb = kFALSE;
15913  fMemoPlotD_LFN_ChNb = 1;
15915  }
15916 
15917  if (HistoCode == "D_LFN_ChDs") {
15918  fImpD_LFN_ChDs = (TCanvasImp*)fCanvD_LFN_ChDs->GetCanvasImp();
15919  fCanvD_LFN_ChDs->Divide(1, 1, x_margin_factor, y_margin_factor);
15920  gPad->cd(1);
15921  fPadD_LFN_ChDs = gPad;
15922  fClosedD_LFN_ChDs = kFALSE;
15923  fMemoPlotD_LFN_ChDs = 1;
15925  }
15926 
15927  if (HistoCode == "D_HFN_ChNb") {
15928  fImpD_HFN_ChNb = (TCanvasImp*)fCanvD_HFN_ChNb->GetCanvasImp();
15929  fCanvD_HFN_ChNb->Divide(1, 1, x_margin_factor, y_margin_factor);
15930  gPad->cd(1);
15931  fPadD_HFN_ChNb = gPad;
15932  fClosedD_HFN_ChNb = kFALSE;
15933  fMemoPlotD_HFN_ChNb = 1;
15935  }
15936 
15937  if (HistoCode == "D_HFN_ChDs") {
15938  fImpD_HFN_ChDs = (TCanvasImp*)fCanvD_HFN_ChDs->GetCanvasImp();
15939  fCanvD_HFN_ChDs->Divide(1, 1, x_margin_factor, y_margin_factor);
15940  gPad->cd(1);
15941  fPadD_HFN_ChDs = gPad;
15942  fClosedD_HFN_ChDs = kFALSE;
15943  fMemoPlotD_HFN_ChDs = 1;
15945  }
15946 
15947  if (HistoCode == "D_SCs_ChNb") // (SetParametersCanvas)
15948  {
15949  fImpD_SCs_ChNb = (TCanvasImp*)fCanvD_SCs_ChNb->GetCanvasImp();
15950  fCanvD_SCs_ChNb->Divide(1, 1, x_margin_factor, y_margin_factor);
15951  gPad->cd(1);
15952  fPadD_SCs_ChNb = gPad;
15953  fClosedD_SCs_ChNb = kFALSE;
15954  fMemoPlotD_SCs_ChNb = 1;
15956  }
15957 
15958  if (HistoCode == "D_SCs_ChDs") {
15959  fImpD_SCs_ChDs = (TCanvasImp*)fCanvD_SCs_ChDs->GetCanvasImp();
15960  fCanvD_SCs_ChDs->Divide(1, 1, x_margin_factor, y_margin_factor);
15961  gPad->cd(1);
15962  fPadD_SCs_ChDs = gPad;
15963  fClosedD_SCs_ChDs = kFALSE;
15964  fMemoPlotD_SCs_ChDs = 1;
15966  }
15967 
15968  if (HistoCode == "D_MSp_SpNb") {
15969  fImpD_MSp_SpNb = (TCanvasImp*)fCanvD_MSp_SpNb->GetCanvasImp();
15970  fCanvD_MSp_SpNb->Divide(1, 1, x_margin_factor, y_margin_factor);
15971  gPad->cd(1);
15972  fPadD_MSp_SpNb = gPad;
15973  fClosedD_MSp_SpNb = kFALSE;
15974  fMemoPlotD_MSp_SpNb = 1;
15976  }
15977 
15978  if (HistoCode == "D_MSp_SpDs") {
15979  fImpD_MSp_SpDs = (TCanvasImp*)fCanvD_MSp_SpDs->GetCanvasImp();
15980  fCanvD_MSp_SpDs->Divide(1, 1, x_margin_factor, y_margin_factor);
15981  gPad->cd(1);
15982  fPadD_MSp_SpDs = gPad;
15983  fClosedD_MSp_SpDs = kFALSE;
15984  fMemoPlotD_MSp_SpDs = 1;
15986  }
15987 
15988  if (HistoCode == "D_SSp_SpNb") // (SetParametersCanvas)
15989  {
15990  fImpD_SSp_SpNb = (TCanvasImp*)fCanvD_SSp_SpNb->GetCanvasImp();
15991  fCanvD_SSp_SpNb->Divide(1, 1, x_margin_factor, y_margin_factor);
15992  gPad->cd(1);
15993  fPadD_SSp_SpNb = gPad;
15994  fClosedD_SSp_SpNb = kFALSE;
15995  fMemoPlotD_SSp_SpNb = 1;
15997  }
15998 
15999  if (HistoCode == "D_SSp_SpDs") // (SetParametersCanvas)
16000  {
16001  fImpD_SSp_SpDs = (TCanvasImp*)fCanvD_SSp_SpDs->GetCanvasImp();
16002  fCanvD_SSp_SpDs->Divide(1, 1, x_margin_factor, y_margin_factor);
16003  gPad->cd(1);
16004  fPadD_SSp_SpDs = gPad;
16005  fClosedD_SSp_SpDs = kFALSE;
16006  fMemoPlotD_SSp_SpDs = 1;
16008  }
16009 
16010  if (HistoCode == "D_Adc_EvDs") {
16011  fImpD_Adc_EvDs = (TCanvasImp*)fCanvD_Adc_EvDs->GetCanvasImp();
16012  fCanvD_Adc_EvDs->Divide(1, 1, x_margin_factor, y_margin_factor);
16013  gPad->cd(1);
16014  fPadD_Adc_EvDs = gPad;
16015  fClosedD_Adc_EvDs = kFALSE;
16016  fMemoPlotD_Adc_EvDs = 1;
16018  }
16019 
16020  if (HistoCode == "D_Adc_EvNb") {
16021  fImpD_Adc_EvNb = (TCanvasImp*)fCanvD_Adc_EvNb->GetCanvasImp();
16022  fCanvD_Adc_EvNb->Divide(1, 1, x_margin_factor, y_margin_factor);
16023  gPad->cd(1);
16024  fPadD_Adc_EvNb = gPad;
16025  fClosedD_Adc_EvNb = kFALSE;
16026  fMemoPlotD_Adc_EvNb = 1;
16028  }
16029 
16030  if (HistoCode == "H_Ped_Date") // (SetParametersCanvas)
16031  {
16032  fImpH_Ped_Date = (TCanvasImp*)fCanvH_Ped_Date->GetCanvasImp();
16033  fCanvH_Ped_Date->Divide(1, 1, x_margin_factor, y_margin_factor);
16034  gPad->cd(1);
16035  fPadH_Ped_Date = gPad;
16036  fClosedH_Ped_Date = kFALSE;
16037  fMemoPlotH_Ped_Date = 1;
16039  }
16040  if (HistoCode == "H_TNo_Date") {
16041  fImpH_TNo_Date = (TCanvasImp*)fCanvH_TNo_Date->GetCanvasImp();
16042  fCanvH_TNo_Date->Divide(1, 1, x_margin_factor, y_margin_factor);
16043  gPad->cd(1);
16044  fPadH_TNo_Date = gPad;
16045  fClosedH_TNo_Date = kFALSE;
16046  fMemoPlotH_TNo_Date = 1;
16048  }
16049  if (HistoCode == "H_MCs_Date") {
16050  fImpH_MCs_Date = (TCanvasImp*)fCanvH_MCs_Date->GetCanvasImp();
16051  fCanvH_MCs_Date->Divide(1, 1, x_margin_factor, y_margin_factor);
16052  gPad->cd(1);
16053  fPadH_MCs_Date = gPad;
16054  fClosedH_MCs_Date = kFALSE;
16055  fMemoPlotH_MCs_Date = 1;
16057  }
16058 
16059  if (HistoCode == "H_LFN_Date") // (SetParametersCanvas)
16060  {
16061  fImpH_LFN_Date = (TCanvasImp*)fCanvH_LFN_Date->GetCanvasImp();
16062  fCanvH_LFN_Date->Divide(1, 1, x_margin_factor, y_margin_factor);
16063  gPad->cd(1);
16064  fPadH_LFN_Date = gPad;
16065  fClosedH_LFN_Date = kFALSE;
16066  fMemoPlotH_LFN_Date = 1;
16068  }
16069  if (HistoCode == "H_HFN_Date") {
16070  fImpH_HFN_Date = (TCanvasImp*)fCanvH_HFN_Date->GetCanvasImp();
16071  fCanvH_HFN_Date->Divide(1, 1, x_margin_factor, y_margin_factor);
16072  gPad->cd(1);
16073  fPadH_HFN_Date = gPad;
16074  fClosedH_HFN_Date = kFALSE;
16075  fMemoPlotH_HFN_Date = 1;
16077  }
16078  if (HistoCode == "H_SCs_Date") {
16079  fImpH_SCs_Date = (TCanvasImp*)fCanvH_SCs_Date->GetCanvasImp();
16080  fCanvH_SCs_Date->Divide(1, 1, x_margin_factor, y_margin_factor);
16081  gPad->cd(1);
16082  fPadH_SCs_Date = gPad;
16083  fClosedH_SCs_Date = kFALSE;
16084  fMemoPlotH_SCs_Date = 1;
16086  }
16087 
16088  if (HistoCode == "H_Ped_RuDs") // (SetParametersCanvas)
16089  {
16090  fImpH_Ped_RuDs = (TCanvasImp*)fCanvH_Ped_RuDs->GetCanvasImp();
16091  fCanvH_Ped_RuDs->Divide(1, 1, x_margin_factor, y_margin_factor);
16092  gPad->cd(1);
16093  fPadH_Ped_RuDs = gPad;
16094  fClosedH_Ped_RuDs = kFALSE;
16095  fMemoPlotH_Ped_RuDs = 1;
16097  }
16098  if (HistoCode == "H_TNo_RuDs") {
16099  fImpH_TNo_RuDs = (TCanvasImp*)fCanvH_TNo_RuDs->GetCanvasImp();
16100  fCanvH_TNo_RuDs->Divide(1, 1, x_margin_factor, y_margin_factor);
16101  gPad->cd(1);
16102  fPadH_TNo_RuDs = gPad;
16103  fClosedH_TNo_RuDs = kFALSE;
16104  fMemoPlotH_TNo_RuDs = 1;
16106  }
16107  if (HistoCode == "H_MCs_RuDs") {
16108  fImpH_MCs_RuDs = (TCanvasImp*)fCanvH_MCs_RuDs->GetCanvasImp();
16109  fCanvH_MCs_RuDs->Divide(1, 1, x_margin_factor, y_margin_factor);
16110  gPad->cd(1);
16111  fPadH_MCs_RuDs = gPad;
16112  fClosedH_MCs_RuDs = kFALSE;
16113  fMemoPlotH_MCs_RuDs = 1;
16115  }
16116 
16117  if (HistoCode == "H_LFN_RuDs") // (SetParametersCanvas)
16118  {
16119  fImpH_LFN_RuDs = (TCanvasImp*)fCanvH_LFN_RuDs->GetCanvasImp();
16120  fCanvH_LFN_RuDs->Divide(1, 1, x_margin_factor, y_margin_factor);
16121  gPad->cd(1);
16122  fPadH_LFN_RuDs = gPad;
16123  fClosedH_LFN_RuDs = kFALSE;
16124  fMemoPlotH_LFN_RuDs = 1;
16126  }
16127  if (HistoCode == "H_HFN_RuDs") {
16128  fImpH_HFN_RuDs = (TCanvasImp*)fCanvH_HFN_RuDs->GetCanvasImp();
16129  fCanvH_HFN_RuDs->Divide(1, 1, x_margin_factor, y_margin_factor);
16130  gPad->cd(1);
16131  fPadH_HFN_RuDs = gPad;
16132  fClosedH_HFN_RuDs = kFALSE;
16133  fMemoPlotH_HFN_RuDs = 1;
16135  }
16136  if (HistoCode == "H_SCs_RuDs") {
16137  fImpH_SCs_RuDs = (TCanvasImp*)fCanvH_SCs_RuDs->GetCanvasImp();
16138  fCanvH_SCs_RuDs->Divide(1, 1, x_margin_factor, y_margin_factor);
16139  gPad->cd(1);
16140  fPadH_SCs_RuDs = gPad;
16141  fClosedH_SCs_RuDs = kFALSE;
16142  fMemoPlotH_SCs_RuDs = 1;
16144  }
16145  }
16146 }
16147 // end of SetParametersCanvas
16148 
16149 TCanvas* TEcnaHistos::GetCurrentCanvas(const TString& HistoCode, const TString& opt_plot) {
16150  TCanvas* main_canvas = nullptr;
16151 
16152  if (opt_plot == fSameOnePlot) {
16153  main_canvas = fCanvH1SamePlus;
16154  }
16155 
16156  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
16157  if (HistoCode == "D_NOE_ChNb") {
16158  main_canvas = fCanvD_NOE_ChNb;
16159  }
16160  if (HistoCode == "D_NOE_ChDs") {
16161  main_canvas = fCanvD_NOE_ChDs;
16162  }
16163  if (HistoCode == "D_Ped_ChNb") {
16164  main_canvas = fCanvD_Ped_ChNb;
16165  }
16166  if (HistoCode == "D_Ped_ChDs") {
16167  main_canvas = fCanvD_Ped_ChDs;
16168  }
16169  if (HistoCode == "D_TNo_ChNb") {
16170  main_canvas = fCanvD_TNo_ChNb;
16171  }
16172  if (HistoCode == "D_TNo_ChDs") {
16173  main_canvas = fCanvD_TNo_ChDs;
16174  }
16175  if (HistoCode == "D_MCs_ChNb") {
16176  main_canvas = fCanvD_MCs_ChNb;
16177  }
16178  if (HistoCode == "D_MCs_ChDs") {
16179  main_canvas = fCanvD_MCs_ChDs;
16180  }
16181  if (HistoCode == "D_LFN_ChNb") {
16182  main_canvas = fCanvD_LFN_ChNb;
16183  }
16184  if (HistoCode == "D_LFN_ChDs") {
16185  main_canvas = fCanvD_LFN_ChDs;
16186  }
16187  if (HistoCode == "D_HFN_ChNb") {
16188  main_canvas = fCanvD_HFN_ChNb;
16189  }
16190  if (HistoCode == "D_HFN_ChDs") {
16191  main_canvas = fCanvD_HFN_ChDs;
16192  }
16193  if (HistoCode == "D_SCs_ChNb") {
16194  main_canvas = fCanvD_SCs_ChNb;
16195  }
16196  if (HistoCode == "D_SCs_ChDs") {
16197  main_canvas = fCanvD_SCs_ChDs;
16198  }
16199  if (HistoCode == "D_MSp_SpNb") {
16200  main_canvas = fCanvD_MSp_SpNb;
16201  }
16202  if (HistoCode == "D_MSp_SpDs") {
16203  main_canvas = fCanvD_MSp_SpDs;
16204  }
16205  if (HistoCode == "D_SSp_SpNb") {
16206  main_canvas = fCanvD_SSp_SpNb;
16207  }
16208  if (HistoCode == "D_SSp_SpDs") {
16209  main_canvas = fCanvD_SSp_SpDs;
16210  }
16211  if (HistoCode == "D_Adc_EvNb") {
16212  main_canvas = fCanvD_Adc_EvNb;
16213  }
16214  if (HistoCode == "D_Adc_EvDs") {
16215  main_canvas = fCanvD_Adc_EvDs;
16216  }
16217  if (HistoCode == "H_Ped_Date") {
16218  main_canvas = fCanvH_Ped_Date;
16219  }
16220  if (HistoCode == "H_TNo_Date") {
16221  main_canvas = fCanvH_TNo_Date;
16222  }
16223  if (HistoCode == "H_MCs_Date") {
16224  main_canvas = fCanvH_MCs_Date;
16225  }
16226  if (HistoCode == "H_LFN_Date") {
16227  main_canvas = fCanvH_LFN_Date;
16228  }
16229  if (HistoCode == "H_HFN_Date") {
16230  main_canvas = fCanvH_HFN_Date;
16231  }
16232  if (HistoCode == "H_SCs_Date") {
16233  main_canvas = fCanvH_SCs_Date;
16234  }
16235  if (HistoCode == "H_Ped_RuDs") {
16236  main_canvas = fCanvH_Ped_RuDs;
16237  }
16238  if (HistoCode == "H_TNo_RuDs") {
16239  main_canvas = fCanvH_TNo_RuDs;
16240  }
16241  if (HistoCode == "H_MCs_RuDs") {
16242  main_canvas = fCanvH_MCs_RuDs;
16243  }
16244  if (HistoCode == "H_LFN_RuDs") {
16245  main_canvas = fCanvH_LFN_RuDs;
16246  }
16247  if (HistoCode == "H_HFN_RuDs") {
16248  main_canvas = fCanvH_HFN_RuDs;
16249  }
16250  if (HistoCode == "H_SCs_RuDs") {
16251  main_canvas = fCanvH_SCs_RuDs;
16252  }
16253  }
16254  return main_canvas;
16255 }
16256 // end of GetCurrentCanvas(...)
16257 
16260 
16262  if (fCurrentCanvas != nullptr) {
16263  if ((TCanvasImp*)fCurrentCanvas->GetCanvasImp() != nullptr) {
16264  static_cast<TCanvas*>(fCurrentCanvas)->DrawClone();
16265  } else {
16266  std::cout << "TEcnaHistos::PlotCloneOfCurrentCanvas()> Last canvas has been removed. No clone can be done."
16267  << std::endl
16268  << " Please, display the canvas again." << fTTBELL << std::endl;
16269  }
16270  } else {
16271  std::cout << "TEcnaHistos::PlotCloneOfCurrentCanvas()> No canvas has been created. No clone can be done." << fTTBELL
16272  << std::endl;
16273  }
16274 }
16275 
16276 //--------------------------------------------------------------------------------------------
16277 TVirtualPad* TEcnaHistos::ActivePad(const TString& HistoCode, const TString& opt_plot) {
16278  // Active Pad for Same plot option
16279 
16280  TVirtualPad* main_subpad = nullptr;
16281 
16282  fCurrentHistoCode = HistoCode;
16283  fCurrentOptPlot = opt_plot;
16284 
16285  if (opt_plot == fSameOnePlot) {
16286  fCanvH1SamePlus->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16287  if (fClosedH1SamePlus == kFALSE) {
16288  main_subpad = fPadH1SamePlus;
16289  }
16290  }
16291 
16292  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
16293  if (HistoCode == "D_NOE_ChNb") {
16294  fCanvD_NOE_ChNb->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16295  if (fClosedD_NOE_ChNb == kFALSE) {
16296  main_subpad = fPadD_NOE_ChNb;
16297  }
16298  }
16299 
16300  if (HistoCode == "D_NOE_ChDs") {
16301  fCanvD_NOE_ChDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16302  if (fClosedD_NOE_ChDs == kFALSE) {
16303  main_subpad = fPadD_NOE_ChDs;
16304  }
16305  }
16306 
16307  if (HistoCode == "D_Ped_ChNb") {
16308  fCanvD_Ped_ChNb->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16309  if (fClosedD_Ped_ChNb == kFALSE) {
16310  main_subpad = fPadD_Ped_ChNb;
16311  }
16312  }
16313 
16314  if (HistoCode == "D_Ped_ChDs") {
16315  fCanvD_Ped_ChDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16316  if (fClosedD_Ped_ChDs == kFALSE) {
16317  main_subpad = fPadD_Ped_ChDs;
16318  }
16319  }
16320 
16321  if (HistoCode == "D_TNo_ChNb") {
16322  fCanvD_TNo_ChNb->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16323  if (fClosedD_TNo_ChNb == kFALSE) {
16324  main_subpad = fPadD_TNo_ChNb;
16325  }
16326  }
16327 
16328  if (HistoCode == "D_TNo_ChDs") {
16329  fCanvD_TNo_ChDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16330  if (fClosedD_TNo_ChDs == kFALSE) {
16331  main_subpad = fPadD_TNo_ChDs;
16332  }
16333  }
16334 
16335  if (HistoCode == "D_MCs_ChNb") {
16336  fCanvD_MCs_ChNb->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16337  if (fClosedD_MCs_ChNb == kFALSE) {
16338  main_subpad = fPadD_MCs_ChNb;
16339  }
16340  }
16341 
16342  if (HistoCode == "D_MCs_ChDs") {
16343  fCanvD_MCs_ChDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16344  if (fClosedD_MCs_ChDs == kFALSE) {
16345  main_subpad = fPadD_MCs_ChDs;
16346  }
16347  }
16348 
16349  if (HistoCode == "D_LFN_ChNb") {
16350  fCanvD_LFN_ChNb->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16351  if (fClosedD_LFN_ChNb == kFALSE) {
16352  main_subpad = fPadD_LFN_ChNb;
16353  }
16354  }
16355 
16356  if (HistoCode == "D_LFN_ChDs") {
16357  fCanvD_LFN_ChDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16358  if (fClosedD_LFN_ChDs == kFALSE) {
16359  main_subpad = fPadD_LFN_ChDs;
16360  }
16361  }
16362 
16363  if (HistoCode == "D_HFN_ChNb") {
16364  fCanvD_HFN_ChNb->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16365  if (fClosedD_HFN_ChNb == kFALSE) {
16366  main_subpad = fPadD_HFN_ChNb;
16367  }
16368  }
16369 
16370  if (HistoCode == "D_HFN_ChDs") {
16371  fCanvD_HFN_ChDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16372  if (fClosedD_HFN_ChDs == kFALSE) {
16373  main_subpad = fPadD_HFN_ChDs;
16374  }
16375  }
16376 
16377  if (HistoCode == "D_SCs_ChNb") {
16378  fCanvD_SCs_ChNb->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16379  if (fClosedD_SCs_ChNb == kFALSE) {
16380  main_subpad = fPadD_SCs_ChNb;
16381  }
16382  }
16383 
16384  if (HistoCode == "D_SCs_ChDs") {
16385  fCanvD_SCs_ChDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16386  if (fClosedD_SCs_ChDs == kFALSE) {
16387  main_subpad = fPadD_SCs_ChDs;
16388  }
16389  }
16390 
16391  if (HistoCode == "D_MSp_SpNb") {
16392  fCanvD_MSp_SpNb->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16393  if (fClosedD_MSp_SpNb == kFALSE) {
16394  main_subpad = fPadD_MSp_SpNb;
16395  }
16396  }
16397 
16398  if (HistoCode == "D_MSp_SpDs") {
16399  fCanvD_MSp_SpDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16400  if (fClosedD_MSp_SpDs == kFALSE) {
16401  main_subpad = fPadD_MSp_SpDs;
16402  }
16403  }
16404 
16405  if (HistoCode == "D_SSp_SpNb") {
16406  fCanvD_SSp_SpNb->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16407  if (fClosedD_SSp_SpNb == kFALSE) {
16408  main_subpad = fPadD_SSp_SpNb;
16409  }
16410  }
16411 
16412  if (HistoCode == "D_SSp_SpDs") {
16413  fCanvD_SSp_SpDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16414  if (fClosedD_SSp_SpDs == kFALSE) {
16415  main_subpad = fPadD_SSp_SpDs;
16416  }
16417  }
16418 
16419  if (HistoCode == "D_Adc_EvNb") {
16420  fCanvD_Adc_EvNb->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16421  if (fClosedD_Adc_EvNb == kFALSE) {
16422  main_subpad = fPadD_Adc_EvNb;
16423  }
16424  }
16425 
16426  if (HistoCode == "D_Adc_EvDs") {
16427  fCanvD_Adc_EvDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16428  if (fClosedD_Adc_EvDs == kFALSE) {
16429  main_subpad = fPadD_Adc_EvDs;
16430  }
16431  }
16432 
16433  if (HistoCode == "H_Ped_Date") {
16434  fCanvH_Ped_Date->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16435  if (fClosedH_Ped_Date == kFALSE) {
16436  main_subpad = fPadH_Ped_Date;
16437  }
16438  }
16439 
16440  if (HistoCode == "H_TNo_Date") {
16441  fCanvH_TNo_Date->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16442  if (fClosedH_TNo_Date == kFALSE) {
16443  main_subpad = fPadH_TNo_Date;
16444  }
16445  }
16446 
16447  if (HistoCode == "H_MCs_Date") {
16448  fCanvH_MCs_Date->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16449  if (fClosedH_MCs_Date == kFALSE) {
16450  main_subpad = fPadH_MCs_Date;
16451  }
16452  }
16453 
16454  if (HistoCode == "H_LFN_Date") {
16455  fCanvH_LFN_Date->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16456  if (fClosedH_LFN_Date == kFALSE) {
16457  main_subpad = fPadH_LFN_Date;
16458  }
16459  }
16460 
16461  if (HistoCode == "H_HFN_Date") {
16462  fCanvH_HFN_Date->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16463  if (fClosedH_HFN_Date == kFALSE) {
16464  main_subpad = fPadH_HFN_Date;
16465  }
16466  }
16467 
16468  if (HistoCode == "H_SCs_Date") {
16469  fCanvH_SCs_Date->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16470  if (fClosedH_SCs_Date == kFALSE) {
16471  main_subpad = fPadH_SCs_Date;
16472  }
16473  }
16474 
16475  if (HistoCode == "H_Ped_RuDs") {
16476  fCanvH_Ped_RuDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16477  if (fClosedH_Ped_RuDs == kFALSE) {
16478  main_subpad = fPadH_Ped_RuDs;
16479  }
16480  }
16481 
16482  if (HistoCode == "H_TNo_RuDs") {
16483  fCanvH_TNo_RuDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16484  if (fClosedH_TNo_RuDs == kFALSE) {
16485  main_subpad = fPadH_TNo_RuDs;
16486  }
16487  }
16488 
16489  if (HistoCode == "H_MCs_RuDs") {
16490  fCanvH_MCs_RuDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16491  if (fClosedH_MCs_RuDs == kFALSE) {
16492  main_subpad = fPadH_MCs_RuDs;
16493  }
16494  }
16495 
16496  if (HistoCode == "H_LFN_RuDs") {
16497  fCanvH_LFN_RuDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16498  if (fClosedH_LFN_RuDs == kFALSE) {
16499  main_subpad = fPadH_LFN_RuDs;
16500  }
16501  }
16502 
16503  if (HistoCode == "H_HFN_RuDs") {
16504  fCanvH_HFN_RuDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16505  if (fClosedH_HFN_RuDs == kFALSE) {
16506  main_subpad = fPadH_HFN_RuDs;
16507  }
16508  }
16509 
16510  if (HistoCode == "H_SCs_RuDs") {
16511  fCanvH_SCs_RuDs->Connect("Closed()", "TEcnaHistos", this, "DoCanvasClosed()");
16512  if (fClosedH_SCs_RuDs == kFALSE) {
16513  main_subpad = fPadH_SCs_RuDs;
16514  }
16515  }
16516  }
16517 
16518  if (main_subpad == nullptr) {
16519  std::cout << "*TEcnaHistos::ActivePad(...)> main_subpad = " << main_subpad << ". This canvas has been closed."
16520  << std::endl;
16521  }
16522 
16523  return main_subpad;
16524 }
16525 // end of ActivePad
16526 
16528  if (fCurrentOptPlot == fSameOnePlot) {
16529  fClosedH1SamePlus = kTRUE;
16530  }
16532  if (fCurrentHistoCode == "D_NOE_ChNb") {
16533  fClosedD_NOE_ChNb = kTRUE;
16534  }
16535  if (fCurrentHistoCode == "D_NOE_ChDs") {
16536  fClosedD_NOE_ChDs = kTRUE;
16537  }
16538  if (fCurrentHistoCode == "D_Ped_ChNb") {
16539  fClosedD_Ped_ChNb = kTRUE;
16540  }
16541  if (fCurrentHistoCode == "D_Ped_ChDs") {
16542  fClosedD_Ped_ChDs = kTRUE;
16543  }
16544  if (fCurrentHistoCode == "D_TNo_ChNb") {
16545  fClosedD_TNo_ChNb = kTRUE;
16546  }
16547  if (fCurrentHistoCode == "D_TNo_ChDs") {
16548  fClosedD_TNo_ChDs = kTRUE;
16549  }
16550  if (fCurrentHistoCode == "D_MCs_ChNb") {
16551  fClosedD_MCs_ChNb = kTRUE;
16552  }
16553  if (fCurrentHistoCode == "D_MCs_ChDs") {
16554  fClosedD_MCs_ChDs = kTRUE;
16555  }
16556  if (fCurrentHistoCode == "D_LFN_ChNb") {
16557  fClosedD_LFN_ChNb = kTRUE;
16558  }
16559  if (fCurrentHistoCode == "D_LFN_ChDs") {
16560  fClosedD_LFN_ChDs = kTRUE;
16561  }
16562  if (fCurrentHistoCode == "D_HFN_ChNb") {
16563  fClosedD_HFN_ChNb = kTRUE;
16564  }
16565  if (fCurrentHistoCode == "D_HFN_ChDs") {
16566  fClosedD_HFN_ChDs = kTRUE;
16567  }
16568  if (fCurrentHistoCode == "D_SCs_ChNb") {
16569  fClosedD_SCs_ChNb = kTRUE;
16570  }
16571  if (fCurrentHistoCode == "D_SCs_ChDs") {
16572  fClosedD_SCs_ChDs = kTRUE;
16573  }
16574  if (fCurrentHistoCode == "D_MSp_SpNb") {
16575  fClosedD_MSp_SpNb = kTRUE;
16576  }
16577  if (fCurrentHistoCode == "D_MSp_SpDs") {
16578  fClosedD_MSp_SpDs = kTRUE;
16579  }
16580  if (fCurrentHistoCode == "D_SSp_SpNb") {
16581  fClosedD_SSp_SpNb = kTRUE;
16582  }
16583  if (fCurrentHistoCode == "D_SSp_SpDs") {
16584  fClosedD_SSp_SpDs = kTRUE;
16585  }
16586  if (fCurrentHistoCode == "D_Adc_EvNb") {
16587  fClosedD_Adc_EvNb = kTRUE;
16588  }
16589  if (fCurrentHistoCode == "D_Adc_EvDs") {
16590  fClosedD_Adc_EvDs = kTRUE;
16591  }
16592  if (fCurrentHistoCode == "H_Ped_Date") {
16593  fClosedH_Ped_Date = kTRUE;
16594  }
16595  if (fCurrentHistoCode == "H_TNo_Date") {
16596  fClosedH_TNo_Date = kTRUE;
16597  }
16598  if (fCurrentHistoCode == "H_MCs_Date") {
16599  fClosedH_MCs_Date = kTRUE;
16600  }
16601  if (fCurrentHistoCode == "H_LFN_Date") {
16602  fClosedH_LFN_Date = kTRUE;
16603  }
16604  if (fCurrentHistoCode == "H_HFN_Date") {
16605  fClosedH_HFN_Date = kTRUE;
16606  }
16607  if (fCurrentHistoCode == "H_SCs_Date") {
16608  fClosedH_SCs_Date = kTRUE;
16609  }
16610  if (fCurrentHistoCode == "H_Ped_RuDs") {
16611  fClosedH_Ped_RuDs = kTRUE;
16612  }
16613  if (fCurrentHistoCode == "H_TNo_RuDs") {
16614  fClosedH_TNo_RuDs = kTRUE;
16615  }
16616  if (fCurrentHistoCode == "H_MCs_RuDs") {
16617  fClosedH_MCs_RuDs = kTRUE;
16618  }
16619  if (fCurrentHistoCode == "H_LFN_RuDs") {
16620  fClosedH_LFN_RuDs = kTRUE;
16621  }
16622  if (fCurrentHistoCode == "H_HFN_RuDs") {
16623  fClosedH_HFN_RuDs = kTRUE;
16624  }
16625  if (fCurrentHistoCode == "H_SCs_RuDs") {
16626  fClosedH_SCs_RuDs = kTRUE;
16627  }
16628  }
16629 
16630  fCurrentOptPlot = "NADA"; // to avoid fClosed... = kTRUE if other canvas than those above Closed (i.e. 2D plots)
16631  fCurrentHistoCode = "NADA";
16632 
16633  std::cout << "!TEcnaHistos::DoCanvasClosed(...)> WARNING: canvas has been closed." << std::endl;
16634 }
16635 
16636 void TEcnaHistos::SetParametersPavTxt(const TString& HistoCode, const TString& opt_plot) {
16637  // Set parameters pave "sevearl changing" according to HistoCode
16638 
16639  if (opt_plot == fSameOnePlot) {
16641  }
16642 
16643  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
16644  if (HistoCode == "D_NOE_ChNb") {
16646  }
16647  if (HistoCode == "D_NOE_ChDs") {
16649  }
16650  if (HistoCode == "D_Ped_ChNb") {
16652  }
16653  if (HistoCode == "D_Ped_ChDs") {
16655  }
16656  if (HistoCode == "D_TNo_ChNb") {
16658  }
16659  if (HistoCode == "D_TNo_ChDs") {
16661  }
16662  if (HistoCode == "D_MCs_ChNb") {
16664  }
16665  if (HistoCode == "D_MCs_ChDs") {
16667  }
16668  if (HistoCode == "D_LFN_ChNb") {
16670  }
16671  if (HistoCode == "D_LFN_ChDs") {
16673  }
16674  if (HistoCode == "D_HFN_ChNb") {
16676  }
16677  if (HistoCode == "D_HFN_ChDs") {
16679  }
16680  if (HistoCode == "D_SCs_ChNb") {
16682  }
16683  if (HistoCode == "D_SCs_ChDs") {
16685  }
16686  if (HistoCode == "D_MSp_SpNb") {
16688  }
16689  if (HistoCode == "D_MSp_SpDs") {
16691  }
16692  if (HistoCode == "D_SSp_SpNb") {
16694  }
16695  if (HistoCode == "D_SSp_SpDs") {
16697  }
16698  if (HistoCode == "D_Adc_EvNb") {
16700  }
16701  if (HistoCode == "D_Adc_EvDs") {
16703  }
16704  if (HistoCode == "H_Ped_Date") {
16706  }
16707  if (HistoCode == "H_TNo_Date") {
16709  }
16710  if (HistoCode == "H_MCs_Date") {
16712  }
16713  if (HistoCode == "H_LFN_Date") {
16715  }
16716  if (HistoCode == "H_HFN_Date") {
16718  }
16719  if (HistoCode == "H_SCs_Date") {
16721  }
16722  if (HistoCode == "H_Ped_RuDs") {
16724  }
16725  if (HistoCode == "H_TNo_RuDs") {
16727  }
16728  if (HistoCode == "H_MCs_RuDs") {
16730  }
16731  if (HistoCode == "H_LFN_RuDs") {
16733  }
16734  if (HistoCode == "H_HFN_RuDs") {
16736  }
16737  if (HistoCode == "H_SCs_RuDs") {
16739  }
16740  }
16741 }
16742 // end of SetParametersPavTxt
16743 
16744 TPaveText* TEcnaHistos::ActivePavTxt(const TString& HistoCode, const TString& opt_plot) {
16745  // Active Pad for Same plot option
16746 
16747  TPaveText* main_pavtxt = nullptr;
16748 
16749  if (opt_plot == fSameOnePlot) {
16750  main_pavtxt = fPavTxtH1SamePlus;
16751  }
16752 
16753  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
16754  if (HistoCode == "D_NOE_ChNb") {
16755  main_pavtxt = fPavTxtD_NOE_ChNb;
16756  }
16757  if (HistoCode == "D_NOE_ChDs") {
16758  main_pavtxt = fPavTxtD_NOE_ChDs;
16759  }
16760  if (HistoCode == "D_Ped_ChNb") {
16761  main_pavtxt = fPavTxtD_Ped_ChNb;
16762  }
16763  if (HistoCode == "D_Ped_ChDs") {
16764  main_pavtxt = fPavTxtD_Ped_ChDs;
16765  }
16766  if (HistoCode == "D_TNo_ChNb") {
16767  main_pavtxt = fPavTxtD_TNo_ChNb;
16768  }
16769  if (HistoCode == "D_TNo_ChDs") {
16770  main_pavtxt = fPavTxtD_TNo_ChDs;
16771  }
16772  if (HistoCode == "D_MCs_ChNb") {
16773  main_pavtxt = fPavTxtD_MCs_ChNb;
16774  }
16775  if (HistoCode == "D_MCs_ChDs") {
16776  main_pavtxt = fPavTxtD_MCs_ChDs;
16777  }
16778  if (HistoCode == "D_LFN_ChNb") {
16779  main_pavtxt = fPavTxtD_LFN_ChNb;
16780  }
16781  if (HistoCode == "D_LFN_ChDs") {
16782  main_pavtxt = fPavTxtD_LFN_ChDs;
16783  }
16784  if (HistoCode == "D_HFN_ChNb") {
16785  main_pavtxt = fPavTxtD_HFN_ChNb;
16786  }
16787  if (HistoCode == "D_HFN_ChDs") {
16788  main_pavtxt = fPavTxtD_HFN_ChDs;
16789  }
16790  if (HistoCode == "D_SCs_ChNb") {
16791  main_pavtxt = fPavTxtD_SCs_ChNb;
16792  }
16793  if (HistoCode == "D_SCs_ChDs") {
16794  main_pavtxt = fPavTxtD_SCs_ChDs;
16795  }
16796  if (HistoCode == "D_MSp_SpNb") {
16797  main_pavtxt = fPavTxtD_MSp_SpNb;
16798  }
16799  if (HistoCode == "D_MSp_SpDs") {
16800  main_pavtxt = fPavTxtD_MSp_SpDs;
16801  }
16802  if (HistoCode == "D_SSp_SpNb") {
16803  main_pavtxt = fPavTxtD_SSp_SpNb;
16804  }
16805  if (HistoCode == "D_SSp_SpDs") {
16806  main_pavtxt = fPavTxtD_SSp_SpDs;
16807  }
16808  if (HistoCode == "D_Adc_EvNb") {
16809  main_pavtxt = fPavTxtD_Adc_EvNb;
16810  }
16811  if (HistoCode == "D_Adc_EvDs") {
16812  main_pavtxt = fPavTxtD_Adc_EvDs;
16813  }
16814  if (HistoCode == "H_Ped_Date") {
16815  main_pavtxt = fPavTxtH_Ped_Date;
16816  }
16817  if (HistoCode == "H_TNo_Date") {
16818  main_pavtxt = fPavTxtH_TNo_Date;
16819  }
16820  if (HistoCode == "H_MCs_Date") {
16821  main_pavtxt = fPavTxtH_MCs_Date;
16822  }
16823  if (HistoCode == "H_LFN_Date") {
16824  main_pavtxt = fPavTxtH_LFN_Date;
16825  }
16826  if (HistoCode == "H_HFN_Date") {
16827  main_pavtxt = fPavTxtH_HFN_Date;
16828  }
16829  if (HistoCode == "H_SCs_Date") {
16830  main_pavtxt = fPavTxtH_SCs_Date;
16831  }
16832  if (HistoCode == "H_Ped_RuDs") {
16833  main_pavtxt = fPavTxtH_Ped_RuDs;
16834  }
16835  if (HistoCode == "H_TNo_RuDs") {
16836  main_pavtxt = fPavTxtH_TNo_RuDs;
16837  }
16838  if (HistoCode == "H_MCs_RuDs") {
16839  main_pavtxt = fPavTxtH_MCs_RuDs;
16840  }
16841  if (HistoCode == "H_LFN_RuDs") {
16842  main_pavtxt = fPavTxtH_LFN_RuDs;
16843  }
16844  if (HistoCode == "H_HFN_RuDs") {
16845  main_pavtxt = fPavTxtH_HFN_RuDs;
16846  }
16847  if (HistoCode == "H_SCs_RuDs") {
16848  main_pavtxt = fPavTxtH_SCs_RuDs;
16849  }
16850  }
16851 
16852  if (main_pavtxt == nullptr) {
16853  std::cout << "*TEcnaHistos::ActivePavTxt(...)> ERROR: main_pavtxt = " << main_pavtxt << std::endl;
16854  }
16855 
16856  return main_pavtxt;
16857 }
16858 // end of ActivePavTxt
16859 
16860 //void TEcnaHistos::SetViewHistoMarkerAndLine(TH1D* h_his0, const TString& HistoCode, const TString& opt_plot)
16861 //{
16863 //
16864 // TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
16865 //
16866 // //............................... Marker
16867 // h_his0->SetMarkerStyle(1); // default
16868 //
16869 // if( HistoType == "Global" && ( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot ) )
16870 // {h_his0->SetMarkerStyle(7); }
16871 //
16872 // //............................... Line
16873 // h_his0->SetLineWidth(1); // default
16874 //
16875 // if( HistoType == "Global" && ( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot ) )
16876 // {h_his0->SetLineWidth(0);}
16877 //
16878 //}
16879 
16881  const TString& HistoCode,
16882  const TString& opt_plot,
16883  const Int_t& arg_AlreadyRead) {
16884  // Set colors, fill, marker, line style for histo view
16885 
16886  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
16887  if (HistoType == "Global") {
16888  h_his0->SetMarkerStyle(1);
16889  }
16890 
16891  Int_t MaxNbOfColors = fCnaParHistos->GetMaxNbOfColors();
16892 
16893  if (opt_plot == fSameOnePlot) {
16894  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
16895  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
16897  if (fMemoColorH1SamePlus > MaxNbOfColors) {
16899  }
16900  }
16901 
16902  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
16903  if (HistoCode == "D_NOE_ChNb") {
16904  if (opt_plot == fOnlyOnePlot) {
16905  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rose"));
16906  }
16907  if (opt_plot == fSeveralPlot) {
16908  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChNb));
16909  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChNb));
16911  if (fMemoColorD_NOE_ChNb > MaxNbOfColors) {
16913  }
16914  }
16915  }
16916  if (HistoCode == "D_NOE_ChDs") {
16917  if (opt_plot == fOnlyOnePlot) {
16918  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rose"));
16919  }
16920  if (opt_plot == fSeveralPlot) {
16921  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChDs));
16922  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChDs));
16924  if (fMemoColorD_NOE_ChDs > MaxNbOfColors) {
16926  }
16927  }
16928  }
16929  if (HistoCode == "D_Ped_ChNb") {
16930  if (opt_plot == fOnlyOnePlot) {
16931  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));
16932  }
16933  if (opt_plot == fSeveralPlot) {
16934  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChNb));
16935  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChNb));
16937  if (fMemoColorD_Ped_ChNb > MaxNbOfColors) {
16939  }
16940  }
16941  }
16942  if (HistoCode == "D_Ped_ChDs") {
16943  if (opt_plot == fOnlyOnePlot) {
16944  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));
16945  }
16946  if (opt_plot == fSeveralPlot) {
16947  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChDs));
16948  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChDs));
16950  if (fMemoColorD_Ped_ChDs > MaxNbOfColors) {
16952  }
16953  }
16954  }
16955  if (HistoCode == "D_TNo_ChNb") {
16956  if (opt_plot == fOnlyOnePlot) {
16957  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge48"));
16958  }
16959  if (opt_plot == fSeveralPlot) {
16960  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChNb));
16961  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChNb));
16963  if (fMemoColorD_TNo_ChNb > MaxNbOfColors) {
16965  }
16966  }
16967  }
16968  if (HistoCode == "D_TNo_ChDs") {
16969  if (opt_plot == fOnlyOnePlot) {
16970  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge48"));
16971  }
16972  if (opt_plot == fSeveralPlot) {
16973  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChDs));
16974  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChDs));
16976  if (fMemoColorD_TNo_ChDs > MaxNbOfColors) {
16978  }
16979  }
16980  }
16981 
16982  if (HistoCode == "D_MCs_ChNb") {
16983  if (opt_plot == fOnlyOnePlot) {
16984  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("vert31"));
16985  }
16986  if (opt_plot == fSeveralPlot) {
16987  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChNb));
16988  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChNb));
16990  if (fMemoColorD_MCs_ChNb > MaxNbOfColors) {
16992  }
16993  }
16994  }
16995  if (HistoCode == "D_MCs_ChDs") {
16996  if (opt_plot == fOnlyOnePlot) {
16997  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("vert31"));
16998  }
16999  if (opt_plot == fSeveralPlot) {
17000  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChDs));
17001  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChDs));
17003  if (fMemoColorD_MCs_ChDs > MaxNbOfColors) {
17005  }
17006  }
17007  }
17008  if (HistoCode == "D_LFN_ChNb") {
17009  if (opt_plot == fOnlyOnePlot) {
17010  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge44"));
17011  }
17012  if (opt_plot == fSeveralPlot) {
17013  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChNb));
17014  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChNb));
17016  if (fMemoColorD_LFN_ChNb > MaxNbOfColors) {
17018  }
17019  }
17020  }
17021  if (HistoCode == "D_LFN_ChDs") {
17022  if (opt_plot == fOnlyOnePlot) {
17023  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge44"));
17024  }
17025  if (opt_plot == fSeveralPlot) {
17026  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChDs));
17027  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChDs));
17029  if (fMemoColorD_LFN_ChDs > MaxNbOfColors) {
17031  }
17032  }
17033  }
17034  if (HistoCode == "D_HFN_ChNb") {
17035  if (opt_plot == fOnlyOnePlot) {
17036  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));
17037  }
17038  if (opt_plot == fSeveralPlot) {
17039  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChNb));
17040  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChNb));
17042  if (fMemoColorD_HFN_ChNb > MaxNbOfColors) {
17044  }
17045  }
17046  }
17047  if (HistoCode == "D_HFN_ChDs") {
17048  if (opt_plot == fOnlyOnePlot) {
17049  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));
17050  }
17051  if (opt_plot == fSeveralPlot) {
17052  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChDs));
17053  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChDs));
17055  if (fMemoColorD_HFN_ChDs > MaxNbOfColors) {
17057  }
17058  }
17059  }
17060 
17061  if (HistoCode == "D_SCs_ChNb") {
17062  if (opt_plot == fOnlyOnePlot) {
17063  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("marron23"));
17064  }
17065  if (opt_plot == fSeveralPlot) {
17066  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChNb));
17067  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChNb));
17069  if (fMemoColorD_SCs_ChNb > MaxNbOfColors) {
17071  }
17072  }
17073  }
17074  if (HistoCode == "D_SCs_ChDs") {
17075  if (opt_plot == fOnlyOnePlot) {
17076  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("marron23"));
17077  }
17078  if (opt_plot == fSeveralPlot) {
17079  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChDs));
17080  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChDs));
17082  if (fMemoColorD_SCs_ChDs > MaxNbOfColors) {
17084  }
17085  }
17086  }
17087 
17088  if (HistoCode == "D_MSp_SpNb") {
17089  if ((opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) ||
17090  (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1 && fPlotAllXtalsInStin == 0)) {
17091  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));
17092  }
17093 
17094  if (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 0 && fPlotAllXtalsInStin == 1) {
17095  h_his0->SetFillColor((Color_t)0);
17096  }
17097 
17098  if (opt_plot == fSeveralPlot) {
17099  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_SpNb));
17100  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_SpNb));
17102  if (fMemoColorD_MSp_SpNb > MaxNbOfColors) {
17104  }
17105  }
17106  }
17107 
17108  if (HistoCode == "D_MSp_SpDs") {
17109  if ((opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) ||
17110  (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1 && fPlotAllXtalsInStin == 0)) {
17111  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));
17112  }
17113 
17114  if (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 0 && fPlotAllXtalsInStin == 1) {
17115  h_his0->SetFillColor((Color_t)0);
17116  }
17117 
17118  if (opt_plot == fSeveralPlot) {
17119  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_SpDs));
17120  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_SpDs));
17122  if (fMemoColorD_MSp_SpDs > MaxNbOfColors) {
17124  }
17125  }
17126  }
17127 
17128  if (HistoCode == "D_SSp_SpNb") {
17129  if ((opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) ||
17130  (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1 && fPlotAllXtalsInStin == 0)) {
17131  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));
17132  }
17133 
17134  if (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 0 && fPlotAllXtalsInStin == 1) {
17135  h_his0->SetFillColor((Color_t)0);
17136  }
17137 
17138  if (opt_plot == fSeveralPlot) {
17139  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_SpNb));
17140  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_SpNb));
17142  if (fMemoColorD_SSp_SpNb > MaxNbOfColors) {
17144  }
17145  }
17146  }
17147 
17148  if (HistoCode == "D_SSp_SpDs") {
17149  if ((opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) ||
17150  (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1 && fPlotAllXtalsInStin == 0)) {
17151  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));
17152  }
17153 
17154  if (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 0 && fPlotAllXtalsInStin == 1) {
17155  h_his0->SetFillColor((Color_t)0);
17156  }
17157 
17158  if (opt_plot == fSeveralPlot) {
17159  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_SpDs));
17160  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_SpDs));
17162  if (fMemoColorD_SSp_SpDs > MaxNbOfColors) {
17164  }
17165  }
17166  }
17167 
17168  if (HistoCode == "D_Adc_EvNb") {
17169  if (opt_plot == fOnlyOnePlot) {
17170  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("orange42"));
17171  }
17172  if (opt_plot == fSeveralPlot) {
17173  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvNb));
17174  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvNb));
17176  if (fMemoColorD_Adc_EvNb > MaxNbOfColors) {
17178  }
17179  }
17180  gPad->SetGrid(1, 0);
17181  }
17182 
17183  if (HistoCode == "D_Adc_EvDs") {
17184  if (opt_plot == fOnlyOnePlot) {
17185  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("orange42"));
17186  }
17187  if (opt_plot == fSeveralPlot) {
17188  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvDs));
17189  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvDs));
17191  if (fMemoColorD_Adc_EvDs > MaxNbOfColors) {
17193  }
17194  }
17195  }
17196 
17197  if (HistoCode == "H_Ped_RuDs") {
17198  if (opt_plot == fOnlyOnePlot) {
17199  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));
17200  }
17201  if (opt_plot == fSeveralPlot) {
17202  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_RuDs));
17203  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_RuDs));
17205  if (fMemoColorH_Ped_RuDs > MaxNbOfColors) {
17207  }
17208  }
17209  gPad->SetGrid(1, 1);
17210  }
17211 
17212  if (HistoCode == "H_TNo_RuDs") {
17213  if (opt_plot == fOnlyOnePlot) {
17214  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge48"));
17215  }
17216  if (opt_plot == fSeveralPlot) {
17217  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_RuDs));
17218  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_RuDs));
17220  if (fMemoColorH_TNo_RuDs > MaxNbOfColors) {
17222  }
17223  }
17224  gPad->SetGrid(1, 1);
17225  }
17226 
17227  if (HistoCode == "H_MCs_RuDs") {
17228  if (opt_plot == fOnlyOnePlot) {
17229  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("vert31"));
17230  }
17231  if (opt_plot == fSeveralPlot) {
17232  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_RuDs));
17233  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_RuDs));
17235  if (fMemoColorH_MCs_RuDs > MaxNbOfColors) {
17237  }
17238  }
17239  gPad->SetGrid(1, 1);
17240  }
17241 
17242  if (HistoCode == "H_LFN_RuDs") {
17243  if (opt_plot == fOnlyOnePlot) {
17244  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge44"));
17245  }
17246  if (opt_plot == fSeveralPlot) {
17247  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_RuDs));
17248  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_RuDs));
17250  if (fMemoColorH_LFN_RuDs > MaxNbOfColors) {
17252  }
17253  }
17254  gPad->SetGrid(1, 1);
17255  }
17256 
17257  if (HistoCode == "H_HFN_RuDs") {
17258  if (opt_plot == fOnlyOnePlot) {
17259  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));
17260  }
17261  if (opt_plot == fSeveralPlot) {
17262  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_RuDs));
17263  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_RuDs));
17265  if (fMemoColorH_HFN_RuDs > MaxNbOfColors) {
17267  }
17268  }
17269  gPad->SetGrid(1, 1);
17270  }
17271 
17272  if (HistoCode == "H_SCs_RuDs") {
17273  if (opt_plot == fOnlyOnePlot) {
17274  h_his0->SetFillColor(fCnaParHistos->ColorDefinition("marron23"));
17275  }
17276  if (opt_plot == fSeveralPlot) {
17277  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_RuDs));
17278  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_RuDs));
17280  if (fMemoColorH_SCs_RuDs > MaxNbOfColors) {
17282  }
17283  }
17284  gPad->SetGrid(1, 1);
17285  }
17286  }
17287 
17288  // if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot){h_his0->SetLineWidth(2);}
17289 }
17290 // end of SetViewHistoColors
17291 
17292 void TEcnaHistos::SetViewGraphColors(TGraph* g_graph0, const TString& HistoCode, const TString& opt_plot) {
17293  // Set colors for histo view
17294 
17295  Int_t MaxNbOfColors = fCnaParHistos->GetMaxNbOfColors();
17296 
17297  if (opt_plot == fSameOnePlot) {
17298  g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
17299  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
17301  if (fMemoColorH1SamePlus > MaxNbOfColors) {
17303  }
17304  gPad->SetGrid(1, 1);
17305  }
17306 
17307  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
17308  if (HistoCode == "H_Ped_Date") {
17309  if (opt_plot == fOnlyOnePlot) {
17310  g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("bleu38"));
17311  }
17312  if (opt_plot == fSeveralPlot) {
17313  g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_Date));
17314  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_Date));
17316  if (fMemoColorH_Ped_Date > MaxNbOfColors) {
17318  }
17319  }
17320  gPad->SetGrid(1, 1);
17321  }
17322 
17323  if (HistoCode == "H_TNo_Date") {
17324  if (opt_plot == fOnlyOnePlot) {
17325  g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("rouge48"));
17326  }
17327  if (opt_plot == fSeveralPlot) {
17328  g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_Date));
17329  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_Date));
17331  if (fMemoColorH_TNo_Date > MaxNbOfColors) {
17333  }
17334  }
17335  gPad->SetGrid(1, 1);
17336  }
17337 
17338  if (HistoCode == "H_MCs_Date") {
17339  if (opt_plot == fOnlyOnePlot) {
17340  g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("vert31"));
17341  }
17342  if (opt_plot == fSeveralPlot) {
17343  g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_Date));
17344  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_Date));
17346  if (fMemoColorH_MCs_Date > MaxNbOfColors) {
17348  }
17349  }
17350  gPad->SetGrid(1, 1);
17351  }
17352 
17353  if (HistoCode == "H_LFN_Date") {
17354  if (opt_plot == fOnlyOnePlot) {
17355  g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("bleu38"));
17356  }
17357  if (opt_plot == fSeveralPlot) {
17358  g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_Date));
17359  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_Date));
17361  if (fMemoColorH_LFN_Date > MaxNbOfColors) {
17363  }
17364  }
17365  gPad->SetGrid(1, 1);
17366  }
17367 
17368  if (HistoCode == "H_HFN_Date") {
17369  if (opt_plot == fOnlyOnePlot) {
17370  g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("rouge48"));
17371  }
17372  if (opt_plot == fSeveralPlot) {
17373  g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_Date));
17374  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_Date));
17376  if (fMemoColorH_HFN_Date > MaxNbOfColors) {
17378  }
17379  }
17380  gPad->SetGrid(1, 1);
17381  }
17382 
17383  if (HistoCode == "H_SCs_Date") {
17384  if (opt_plot == fOnlyOnePlot) {
17385  g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("vert31"));
17386  }
17387  if (opt_plot == fSeveralPlot) {
17388  g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_Date));
17389  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_Date));
17391  if (fMemoColorH_SCs_Date > MaxNbOfColors) {
17393  }
17394  }
17395  gPad->SetGrid(1, 1);
17396  }
17397  }
17398  //if(opt_plot == fSeveralPlot){g_graph0->SetLineWidth(2);}
17399 }
17400 // end of SetViewGraphColors
17401 
17402 Color_t TEcnaHistos::GetViewHistoColor(const TString& HistoCode, const TString& opt_plot) {
17403  Color_t couleur = fCnaParHistos->ColorDefinition("noir"); // a priori = "noir"
17404 
17405  if (opt_plot == fSameOnePlot) {
17407  }
17408 
17409  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
17410  if (HistoCode == "D_NOE_ChNb") {
17412  }
17413  if (HistoCode == "D_NOE_ChDs") {
17415  }
17416  if (HistoCode == "D_Ped_ChNb") {
17418  }
17419  if (HistoCode == "D_Ped_ChDs") {
17421  }
17422  if (HistoCode == "D_TNo_ChNb") {
17424  }
17425  if (HistoCode == "D_TNo_ChDs") {
17427  }
17428  if (HistoCode == "D_MCs_ChNb") {
17430  }
17431  if (HistoCode == "D_MCs_ChDs") {
17433  }
17434  if (HistoCode == "D_LFN_ChNb") {
17436  }
17437  if (HistoCode == "D_LFN_ChDs") {
17439  }
17440  if (HistoCode == "D_HFN_ChNb") {
17442  }
17443  if (HistoCode == "D_HFN_ChDs") {
17445  }
17446  if (HistoCode == "D_SCs_ChNb") {
17448  }
17449  if (HistoCode == "D_SCs_ChDs") {
17451  }
17452  if (HistoCode == "D_MSp_SpNb") {
17454  }
17455  if (HistoCode == "D_MSp_SpDs") {
17457  }
17458  if (HistoCode == "D_SSp_SpNb") {
17460  }
17461  if (HistoCode == "D_SSp_SpDs") {
17463  }
17464  if (HistoCode == "D_Adc_EvNb") {
17466  }
17467  if (HistoCode == "D_Adc_EvDs") {
17469  }
17470  if (HistoCode == "H_Ped_Date") {
17472  }
17473  if (HistoCode == "H_TNo_Date") {
17475  }
17476  if (HistoCode == "H_MCs_Date") {
17478  }
17479  if (HistoCode == "H_LFN_Date") {
17481  }
17482  if (HistoCode == "H_HFN_Date") {
17484  }
17485  if (HistoCode == "H_SCs_Date") {
17487  }
17488  if (HistoCode == "H_Ped_RuDs") {
17490  }
17491  if (HistoCode == "H_TNo_RuDs") {
17493  }
17494  if (HistoCode == "H_MCs_RuDs") {
17496  }
17497  if (HistoCode == "H_LFN_RuDs") {
17499  }
17500  if (HistoCode == "H_HFN_RuDs") {
17502  }
17503  if (HistoCode == "H_SCs_RuDs") {
17505  }
17506  }
17507  return couleur;
17508 }
17509 // end of GetViewHistoColor
17510 
17511 Color_t TEcnaHistos::GetSCColor(const TString& DeeEndcap, const TString& DeeDir, const TString& QuadType) {
17512  //gives the SC color for the numbering plots
17513  TColor* my_color = new TColor();
17514  Color_t couleur = fCnaParHistos->ColorDefinition("noir"); // default = "noir"
17515 
17516  if (DeeEndcap == "EE+") {
17517  if (DeeDir == "right" && QuadType == "top") {
17518  couleur = fCnaParHistos->ColorDefinition("rouge");
17519  }
17520  if (DeeDir == "right" && QuadType == "bottom") {
17521  couleur = fCnaParHistos->ColorDefinition("bleu_fonce");
17522  }
17523  if (DeeDir == "left" && QuadType == "top") {
17524  couleur = (Color_t)my_color->GetColor("#006600");
17525  }
17526  if (DeeDir == "left" && QuadType == "bottom") {
17527  couleur = (Color_t)my_color->GetColor("#CC3300");
17528  }
17529  }
17530  if (DeeEndcap == "EE-") {
17531  if (DeeDir == "right" && QuadType == "top") {
17532  couleur = (Color_t)my_color->GetColor("#008800");
17533  }
17534  if (DeeDir == "right" && QuadType == "bottom") {
17535  couleur = (Color_t)my_color->GetColor("#EE5500");
17536  }
17537  if (DeeDir == "left" && QuadType == "top") {
17538  couleur = fCnaParHistos->ColorDefinition("rouge");
17539  }
17540  if (DeeDir == "left" && QuadType == "bottom") {
17541  couleur = fCnaParHistos->ColorDefinition("bleu_fonce");
17542  }
17543  }
17544 
17545  return couleur;
17546 }
17548  // Set presentation (axis title offsets, title size, label size, etc...
17549 
17554 }
17555 void TEcnaHistos::SetHistoPresentation(TH1D* histo, const TString& HistoType, const TString& opt_plot) {
17556  // Set presentation (axis title offsets, title size, label size, etc...
17557 
17559  fCnaParHistos->SetViewHistoPadMargins(HistoType.Data(), opt_plot.Data());
17560  fCnaParHistos->SetViewHistoOffsets(histo, HistoType.Data(), opt_plot.Data());
17562 }
17563 
17564 void TEcnaHistos::SetGraphPresentation(TGraph* graph, const TString& HistoType, const TString& opt_plot) {
17565  // Set presentation (axis title offsets, title size, label size, etc...
17566 
17568  fCnaParHistos->SetViewHistoPadMargins(HistoType.Data(), opt_plot);
17570 
17571  //............................... Graph marker
17572  graph->SetMarkerStyle(1);
17573  if (HistoType == "Evol") {
17574  graph->SetMarkerStyle(20);
17575  }
17576 }
17577 
17578 //=====================================================================
17579 //
17580 // NewCanvas, ReInitCanvas
17581 //
17582 //=====================================================================
17583 void TEcnaHistos::NewCanvas(const TString& opt_plot) {
17584  // ReInit canvas in option SAME n in order to restart a new SAME n plot
17585  // (called by user only for option Same n)
17586 
17587  if (opt_plot == fSameOnePlot) {
17588  fImpH1SamePlus = nullptr;
17589  fCanvH1SamePlus = nullptr;
17590  fPadH1SamePlus = nullptr;
17591  fMemoPlotH1SamePlus = 0;
17594  fPavTxtH1SamePlus = nullptr;
17595  fClosedH1SamePlus = kFALSE;
17596  } else {
17597  std::cout << "TEcnaHistos::NewCanvas(...)> *** ERROR *** " << opt_plot.Data() << ": "
17598  << "unknown option for NewCanvas. Only " << fSameOnePlot << " option is accepted." << fTTBELL
17599  << std::endl;
17600  }
17601 }
17602 
17603 void TEcnaHistos::ReInitCanvas(const TString& HistoCode, const TString& opt_plot) {
17604  // ReInit canvas in option SAME and SAME n
17605 
17606  if (opt_plot == fSameOnePlot) {
17607  fImpH1SamePlus = nullptr;
17608  fCanvH1SamePlus = nullptr;
17609  fPadH1SamePlus = nullptr;
17610  fMemoPlotH1SamePlus = 0;
17613  fPavTxtH1SamePlus = nullptr;
17614  fClosedH1SamePlus = kFALSE;
17615  }
17616 
17617  if (opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot) {
17618  if (HistoCode == "D_NOE_ChNb") {
17619  fImpD_NOE_ChNb = nullptr;
17620  fCanvD_NOE_ChNb = nullptr;
17621  fPadD_NOE_ChNb = nullptr;
17622  fMemoPlotD_NOE_ChNb = 0;
17625  fPavTxtD_NOE_ChNb = nullptr;
17626  fClosedD_NOE_ChNb = kFALSE;
17627  }
17628 
17629  if (HistoCode == "D_NOE_ChDs") {
17630  fImpD_NOE_ChDs = nullptr;
17631  fCanvD_NOE_ChDs = nullptr;
17632  fPadD_NOE_ChDs = nullptr;
17633  fMemoPlotD_NOE_ChDs = 0;
17636  fPavTxtD_NOE_ChDs = nullptr;
17637  fClosedD_NOE_ChDs = kFALSE;
17638  }
17639 
17640  if (HistoCode == "D_Ped_ChNb") // (ReInitCanvas)
17641  {
17642  fImpD_Ped_ChNb = nullptr;
17643  fCanvD_Ped_ChNb = nullptr;
17644  fPadD_Ped_ChNb = nullptr;
17645  fMemoPlotD_Ped_ChNb = 0;
17648  fPavTxtD_Ped_ChNb = nullptr;
17649  fClosedD_Ped_ChNb = kFALSE;
17650  }
17651 
17652  if (HistoCode == "D_Ped_ChDs") {
17653  fImpD_Ped_ChDs = nullptr;
17654  fCanvD_Ped_ChDs = nullptr;
17655  fPadD_Ped_ChDs = nullptr;
17656  fMemoPlotD_Ped_ChDs = 0;
17659  fPavTxtD_Ped_ChDs = nullptr;
17660  fClosedD_Ped_ChDs = kFALSE;
17661  }
17662 
17663  if (HistoCode == "D_TNo_ChNb") {
17664  fImpD_TNo_ChNb = nullptr;
17665  fCanvD_TNo_ChNb = nullptr;
17666  fPadD_TNo_ChNb = nullptr;
17667  fMemoPlotD_TNo_ChNb = 0;
17670  fPavTxtD_TNo_ChNb = nullptr;
17671  fClosedD_TNo_ChNb = kFALSE;
17672  }
17673 
17674  if (HistoCode == "D_TNo_ChDs") {
17675  fImpD_TNo_ChDs = nullptr;
17676  fCanvD_TNo_ChDs = nullptr;
17677  fPadD_TNo_ChDs = nullptr;
17678  fMemoPlotD_TNo_ChDs = 0;
17681  fPavTxtD_TNo_ChDs = nullptr;
17682  fClosedD_TNo_ChDs = kFALSE;
17683  }
17684 
17685  if (HistoCode == "D_MCs_ChNb") // (ReInitCanvas)
17686  {
17687  fImpD_MCs_ChNb = nullptr;
17688  fCanvD_MCs_ChNb = nullptr;
17689  fPadD_MCs_ChNb = nullptr;
17690  fMemoPlotD_MCs_ChNb = 0;
17693  fPavTxtD_MCs_ChNb = nullptr;
17694  fClosedD_MCs_ChNb = kFALSE;
17695  }
17696 
17697  if (HistoCode == "D_MCs_ChDs") {
17698  fImpD_MCs_ChDs = nullptr;
17699  fCanvD_MCs_ChDs = nullptr;
17700  fPadD_MCs_ChDs = nullptr;
17701  fMemoPlotD_MCs_ChDs = 0;
17704  fPavTxtD_MCs_ChDs = nullptr;
17705  fClosedD_MCs_ChDs = kFALSE;
17706  }
17707 
17708  if (HistoCode == "D_LFN_ChNb") {
17709  fImpD_LFN_ChNb = nullptr;
17710  fCanvD_LFN_ChNb = nullptr;
17711  fPadD_LFN_ChNb = nullptr;
17712  fMemoPlotD_LFN_ChNb = 0;
17715  fPavTxtD_LFN_ChNb = nullptr;
17716  fClosedD_LFN_ChNb = kFALSE;
17717  }
17718 
17719  if (HistoCode == "D_LFN_ChDs") // (ReInitCanvas)
17720  {
17721  fImpD_LFN_ChDs = nullptr;
17722  fCanvD_LFN_ChDs = nullptr;
17723  fPadD_LFN_ChDs = nullptr;
17724  fMemoPlotD_LFN_ChDs = 0;
17727  fPavTxtD_LFN_ChDs = nullptr;
17728  fClosedD_LFN_ChDs = kFALSE;
17729  }
17730 
17731  if (HistoCode == "D_HFN_ChNb") {
17732  fImpD_HFN_ChNb = nullptr;
17733  fCanvD_HFN_ChNb = nullptr;
17734  fPadD_HFN_ChNb = nullptr;
17735  fMemoPlotD_HFN_ChNb = 0;
17738  fPavTxtD_HFN_ChNb = nullptr;
17739  fClosedD_HFN_ChNb = kFALSE;
17740  }
17741 
17742  if (HistoCode == "D_HFN_ChDs") {
17743  fImpD_HFN_ChDs = nullptr;
17744  fCanvD_HFN_ChDs = nullptr;
17745  fPadD_HFN_ChDs = nullptr;
17746  fMemoPlotD_HFN_ChDs = 0;
17749  fPavTxtD_HFN_ChDs = nullptr;
17750  fClosedD_HFN_ChDs = kFALSE;
17751  }
17752 
17753  if (HistoCode == "D_SCs_ChNb") {
17754  fImpD_SCs_ChNb = nullptr;
17755  fCanvD_SCs_ChNb = nullptr;
17756  fPadD_SCs_ChNb = nullptr;
17757  fMemoPlotD_SCs_ChNb = 0;
17760  fPavTxtD_SCs_ChNb = nullptr;
17761  fClosedD_SCs_ChNb = kFALSE;
17762  }
17763 
17764  if (HistoCode == "D_SCs_ChDs") // (ReInitCanvas)
17765  {
17766  fImpD_SCs_ChDs = nullptr;
17767  fCanvD_SCs_ChDs = nullptr;
17768  fPadD_SCs_ChDs = nullptr;
17769  fMemoPlotD_SCs_ChDs = 0;
17772  fPavTxtD_SCs_ChDs = nullptr;
17773  fClosedD_SCs_ChDs = kFALSE;
17774  }
17775 
17776  if (HistoCode == "D_MSp_SpNb") {
17777  fImpD_MSp_SpNb = nullptr;
17778  fCanvD_MSp_SpNb = nullptr;
17779  fPadD_MSp_SpNb = nullptr;
17780  fMemoPlotD_MSp_SpNb = 0;
17783  fPavTxtD_MSp_SpNb = nullptr;
17784  fClosedD_MSp_SpNb = kFALSE;
17785  }
17786 
17787  if (HistoCode == "D_MSp_SpDs") {
17788  fImpD_MSp_SpDs = nullptr;
17789  fCanvD_MSp_SpDs = nullptr;
17790  fPadD_MSp_SpDs = nullptr;
17791  fMemoPlotD_MSp_SpDs = 0;
17794  fPavTxtD_MSp_SpDs = nullptr;
17795  fClosedD_MSp_SpDs = kFALSE;
17796  }
17797 
17798  if (HistoCode == "D_SSp_SpNb") {
17799  fImpD_SSp_SpNb = nullptr;
17800  fCanvD_SSp_SpNb = nullptr;
17801  fPadD_SSp_SpNb = nullptr;
17802  fMemoPlotD_SSp_SpNb = 0;
17805  fPavTxtD_SSp_SpNb = nullptr;
17806  fClosedD_SSp_SpNb = kFALSE;
17807  }
17808 
17809  if (HistoCode == "D_SSp_SpDs") {
17810  fImpD_SSp_SpDs = nullptr;
17811  fCanvD_SSp_SpDs = nullptr;
17812  fPadD_SSp_SpDs = nullptr;
17813  fMemoPlotD_SSp_SpDs = 0;
17816  fPavTxtD_SSp_SpDs = nullptr;
17817  fClosedD_SSp_SpDs = kFALSE;
17818  }
17819 
17820  if (HistoCode == "D_Adc_EvNb") // (ReInitCanvas)
17821  {
17822  fImpD_Adc_EvNb = nullptr;
17823  fCanvD_Adc_EvNb = nullptr;
17824  fPadD_Adc_EvNb = nullptr;
17825  fMemoPlotD_Adc_EvNb = 0;
17828  fPavTxtD_Adc_EvNb = nullptr;
17829  fClosedD_Adc_EvNb = kFALSE;
17830  }
17831 
17832  if (HistoCode == "D_Adc_EvDs") {
17833  fImpD_Adc_EvDs = nullptr;
17834  fCanvD_Adc_EvDs = nullptr;
17835  fPadD_Adc_EvDs = nullptr;
17836  fMemoPlotD_Adc_EvDs = 0;
17839  fPavTxtD_Adc_EvDs = nullptr;
17840  fClosedD_Adc_EvDs = kFALSE;
17841  }
17842 
17843  if (HistoCode == "H_Ped_Date") {
17844  fImpH_Ped_Date = nullptr;
17845  fCanvH_Ped_Date = nullptr;
17846  fPadH_Ped_Date = nullptr;
17847  fMemoPlotH_Ped_Date = 0;
17851  fClosedH_Ped_Date = kFALSE;
17852  }
17853 
17854  if (HistoCode == "H_TNo_Date") {
17855  fImpH_TNo_Date = nullptr;
17856  fCanvH_TNo_Date = nullptr;
17857  fPadH_TNo_Date = nullptr;
17858  fMemoPlotH_TNo_Date = 0;
17862  fClosedH_TNo_Date = kFALSE;
17863  }
17864 
17865  if (HistoCode == "H_MCs_Date") // (ReInitCanvas)
17866  {
17867  fImpH_MCs_Date = nullptr;
17868  fCanvH_MCs_Date = nullptr;
17869  fPadH_MCs_Date = nullptr;
17870  fMemoPlotH_MCs_Date = 0;
17874  fClosedH_MCs_Date = kFALSE;
17875  }
17876 
17877  if (HistoCode == "H_LFN_Date") {
17878  fImpH_LFN_Date = nullptr;
17879  fCanvH_LFN_Date = nullptr;
17880  fPadH_LFN_Date = nullptr;
17881  fMemoPlotH_LFN_Date = 0;
17885  fClosedH_LFN_Date = kFALSE;
17886  }
17887 
17888  if (HistoCode == "H_HFN_Date") {
17889  fImpH_HFN_Date = nullptr;
17890  fCanvH_HFN_Date = nullptr;
17891  fPadH_HFN_Date = nullptr;
17892  fMemoPlotH_HFN_Date = 0;
17896  fClosedH_HFN_Date = kFALSE;
17897  }
17898 
17899  if (HistoCode == "H_SCs_Date") {
17900  fImpH_SCs_Date = nullptr;
17901  fCanvH_SCs_Date = nullptr;
17902  fPadH_SCs_Date = nullptr;
17903  fMemoPlotH_SCs_Date = 0;
17907  fClosedH_SCs_Date = kFALSE;
17908  }
17909 
17910  if (HistoCode == "H_Ped_RuDs") {
17911  fImpH_Ped_RuDs = nullptr;
17912  fCanvH_Ped_RuDs = nullptr;
17913  fPadH_Ped_RuDs = nullptr;
17914  fMemoPlotH_Ped_RuDs = 0;
17918  fClosedH_Ped_RuDs = kFALSE;
17919  }
17920 
17921  if (HistoCode == "H_TNo_RuDs") {
17922  fImpH_TNo_RuDs = nullptr;
17923  fCanvH_TNo_RuDs = nullptr;
17924  fPadH_TNo_RuDs = nullptr;
17925  fMemoPlotH_TNo_RuDs = 0;
17929  fClosedH_TNo_RuDs = kFALSE;
17930  }
17931 
17932  if (HistoCode == "H_MCs_RuDs") // (ReInitCanvas)
17933  {
17934  fImpH_MCs_RuDs = nullptr;
17935  fCanvH_MCs_RuDs = nullptr;
17936  fPadH_MCs_RuDs = nullptr;
17937  fMemoPlotH_MCs_RuDs = 0;
17941  fClosedH_MCs_RuDs = kFALSE;
17942  }
17943 
17944  if (HistoCode == "H_LFN_RuDs") {
17945  fImpH_LFN_RuDs = nullptr;
17946  fCanvH_LFN_RuDs = nullptr;
17947  fPadH_LFN_RuDs = nullptr;
17948  fMemoPlotH_LFN_RuDs = 0;
17952  fClosedH_LFN_RuDs = kFALSE;
17953  }
17954 
17955  if (HistoCode == "H_HFN_RuDs") {
17956  fImpH_HFN_RuDs = nullptr;
17957  fCanvH_HFN_RuDs = nullptr;
17958  fPadH_HFN_RuDs = nullptr;
17959  fMemoPlotH_HFN_RuDs = 0;
17963  fClosedH_HFN_RuDs = kFALSE;
17964  }
17965 
17966  if (HistoCode == "H_SCs_RuDs") {
17967  fImpH_SCs_RuDs = nullptr;
17968  fCanvH_SCs_RuDs = nullptr;
17969  fPadH_SCs_RuDs = nullptr;
17970  fMemoPlotH_SCs_RuDs = 0;
17974  fClosedH_SCs_RuDs = kFALSE;
17975  }
17976  }
17977 }
17978 // ------- end of ReInitCanvas(...) ------------
17979 
17980 //==========================================================================================
17981 void TEcnaHistos::WriteMatrixAscii(const TString& BetweenWhat,
17982  const TString& CorOrCov,
17983  const Int_t& StexStinEcna,
17984  const Int_t& MatrixBinIndex,
17985  const Int_t& MatSize,
17986  const TMatrixD& read_matrix) {
17987  // write matrix in ascii file
17988 
17989  Int_t ChanNumber = MatrixBinIndex;
17990 
17993  fFapRunNumber,
17998  fStartDate,
17999  fStopDate,
18000  fStartTime,
18001  fStopTime);
18002 
18003  if (BetweenWhat == fBetweenSamples && CorOrCov == fCorrelationMatrix) {
18004  fCnaWrite->WriteAsciiCorrelationsBetweenSamples(StexStinEcna, ChanNumber, MatSize, read_matrix);
18006  }
18007 
18008  if (BetweenWhat == fBetweenSamples && CorOrCov == fCovarianceMatrix) {
18009  fCnaWrite->WriteAsciiCovariancesBetweenSamples(StexStinEcna, ChanNumber, MatSize, read_matrix);
18011  }
18012 }
18013 //...............................................................................................
18014 void TEcnaHistos::WriteHistoAscii(const TString& HistoCode, const Int_t& HisSize, const TVectorD& read_histo) {
18015  // write matrix in ascii file
18016 
18019  fFapRunNumber,
18024  fStartDate,
18025  fStopDate,
18026  fStartTime,
18027  fStopTime);
18028 
18029  fCnaWrite->WriteAsciiHisto(HistoCode, HisSize, read_histo);
18031 }
18032 
18033 TString TEcnaHistos::AsciiFileName() { return fAsciiFileName.Data(); }
18034 
18035 //---------------> messages de rappel pour l'auteur:
18036 //
18037 //======= A T T E N T I O N ========= A T T E N T I O N ========= A T T E N T I O N ==============!!!!
18038 // A EVITER ABSOLUMENT quand on est sous TEcnaGui CAR LE cin >> BLOQUE X11
18039 // puisqu'on n'a pas la main dans la fenetre de compte-rendu de la CNA
18040 // {Int_t cintoto; std::cout << "taper 0 pour continuer" << std::endl; cin >> cintoto;}
18041 // *=================================================*
18042 // | |
18043 //++++++++++++++++++++++++| A T T E N T I O N: PAS DE TEST "cintoto" ici! |+++++++++++++++++++++!!!!
18044 // | |
18045 // *=================================================*
18046 //
18047 // INFO: When "new" fails to allocate the memory for an object, or "new[]" fails to allocate the memory
18048 // for an object array, a std::bad_alloc object is thrown.
18049 // "In GCC, the RTTI mangled name of std::bad_alloc is, I'm guessing, St9bad_alloc."
TCanvasImp * fImpH_TNo_Date
Definition: TEcnaHistos.h:936
Double_t fD_TNo_ChDsYmin
Definition: TEcnaHistos.h:546
Bool_t fClosedH_LFN_RuDs
Definition: TEcnaHistos.h:837
Int_t fMemoPlotD_HFN_ChDs
Definition: TEcnaHistos.h:636
Axis_t fD_TNo_ChDsXinf
Definition: TEcnaHistos.h:476
TVirtualPad * fPadD_NOE_ChDs
Definition: TEcnaHistos.h:848
TPaveText * fPavTxtD_MSp_SpNb
Definition: TEcnaHistos.h:895
Bool_t fClosedH1SamePlus
Definition: TEcnaHistos.h:807
TString fFapStexType
Definition: TEcnaHistos.h:403
Int_t MaxCrysPhiInTow()
Int_t fNbOfListFileH_MCs_Date
Definition: TEcnaHistos.h:966
Double_t fH_LFN_RuDsYmin
Definition: TEcnaHistos.h:596
Bool_t fClosedD_SSp_SpNb
Definition: TEcnaHistos.h:824
Int_t MaxCrysHocoInStex()
void HistimePlot(TGraph *, Axis_t, Axis_t, const TString &, const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &, const Int_t &)
Int_t fMemoPlotH_HFN_Date
Definition: TEcnaHistos.h:644
TString fXMemoH_TNo_RuDs
Definition: TEcnaHistos.h:696
Bool_t fClosedD_Ped_ChNb
Definition: TEcnaHistos.h:810
TCanvas * CreateCanvas(const TString &, const TString &, const TString &, UInt_t, UInt_t)
Axis_t fH_Ped_RuDsXinf
Definition: TEcnaHistos.h:520
Int_t fAlreadyRead
Definition: TEcnaHistos.h:374
TPaveText * fPavTxtH_TNo_RuDs
Definition: TEcnaHistos.h:908
static constexpr int charArrLen
Definition: TEcnaHistos.h:349
Double_t fD_SCs_ChNbYmin
Definition: TEcnaHistos.h:560
TEcnaNumbering * fEcalNumbering
Definition: TEcnaHistos.h:370
Int_t fMemoColorH_LFN_RuDs
Definition: TEcnaHistos.h:661
Axis_t fD_Adc_EvDsXsup
Definition: TEcnaHistos.h:504
Int_t MaxCrysIYInDee()
Int_t MaxSCIYInDee()
TString fSameOnePlot
Definition: TEcnaHistos.h:626
TPaveText * fPavTxtD_Ped_ChNb
Definition: TEcnaHistos.h:883
TString fStartDate
Definition: TEcnaHistos.h:423
TString SetHistoXAxisTitle(const TString &)
Int_t fCanvSameD_MCs_ChNb
Definition: TEcnaHistos.h:952
void PlotDetector(const TVectorD &, const TString &, const TString &)
void SCCrystalNumbering(const Int_t &, const Int_t &)
TCanvas * fCanvH_SCs_RuDs
Definition: TEcnaHistos.h:805
Axis_t fH_TNo_RuDsXinf
Definition: TEcnaHistos.h:522
Double_t fH_TNo_DateYmax
Definition: TEcnaHistos.h:580
Int_t fCdeleteRoot
Definition: TEcnaHistos.h:355
void XtalSamplesSigma(const TVectorD &, const Int_t &, const Int_t &, const Int_t &, const TString &)
TPaveText * fPavTxtH_HFN_RuDs
Definition: TEcnaHistos.h:911
TVectorD ReadLowFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2070
Int_t MaxCrysEtaInTow()
Int_t fNbBinsMemoH_LFN_Date
Definition: TEcnaHistos.h:760
void SetViewHistoStats(TH1D *, const TString &)
TCanvasImp * fImpD_Ped_ChDs
Definition: TEcnaHistos.h:918
Double_t fH_Ped_RuDsYmax
Definition: TEcnaHistos.h:591
Int_t fNbBinsMemoH_MCs_Date
Definition: TEcnaHistos.h:759
Axis_t fD_Ped_ChDsXsup
Definition: TEcnaHistos.h:473
TString fFapStexDir
Definition: TEcnaHistos.h:404
Int_t GetRunNumber()
Definition: TEcnaRead.cc:823
TVirtualPad * fPadD_LFN_ChNb
Definition: TEcnaHistos.h:855
TString fYMemoH_LFN_RuDs
Definition: TEcnaHistos.h:732
Double_t fH_LFN_DateYmin
Definition: TEcnaHistos.h:583
TString fXMemoD_MCs_ChNb
Definition: TEcnaHistos.h:675
Int_t fMemoColorD_TNo_ChNb
Definition: TEcnaHistos.h:651
Int_t fNbBinsMemoD_HFN_ChNb
Definition: TEcnaHistos.h:747
Int_t * fT1DRunNumber
Definition: TEcnaHistos.h:427
Color_t SetColorsForNumbers(const TString &)
Int_t fMemoColorH_TNo_Date
Definition: TEcnaHistos.h:660
TVectorD ReadAverageHighFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2585
Int_t fMemoColorD_SCs_ChNb
Definition: TEcnaHistos.h:655
Double_t fD_LFN_ChNbYmax
Definition: TEcnaHistos.h:553
TString BuildStandard1DHistoCodeX(const TString &, const TString &)
Int_t fMemoColorH_SCs_Date
Definition: TEcnaHistos.h:664
TPaveText * SetPaveStinsXY(const Int_t &, const Int_t &)
TString GetSCQuadFrom1DeeSCEcna(const Int_t &)
TPaveText * fPavComAnaRun
Definition: TEcnaHistos.h:616
Int_t GetNotConnectedDSSCFromIndex(const Int_t &)
TPaveText * fPavComStex
Definition: TEcnaHistos.h:613
Int_t GetLastReqEvtNumber()
Definition: TEcnaRead.cc:825
Int_t MaxCrysEcnaInDee()
Int_t GetHistoNumberOfBins(const TString &, const Int_t &)
Int_t fOptVisPolm
Definition: TEcnaHistos.h:443
Axis_t fD_Adc_EvNbXsup
Definition: TEcnaHistos.h:506
TString fCorrelationMatrix
Definition: TEcnaHistos.h:447
Int_t fNbBinsMemoD_SSp_SpNb
Definition: TEcnaHistos.h:753
Int_t fFapMaxNbOfRuns
Definition: TEcnaHistos.h:392
TString fFlagScaleX
Definition: TEcnaHistos.h:434
TString fStartEvolDate
Definition: TEcnaHistos.h:400
void InitSpecParBeforeFileReading()
TString fXMemoD_MCs_ChDs
Definition: TEcnaHistos.h:676
TCanvasImp * fImpH_MCs_Date
Definition: TEcnaHistos.h:937
Int_t fMemoColorH_HFN_RuDs
Definition: TEcnaHistos.h:662
TPaveText * fPavComStas
Definition: TEcnaHistos.h:612
void ViewStex(const TVectorD &, const Int_t &, const TString &)
TString fYMemoD_HFN_ChDs
Definition: TEcnaHistos.h:714
Int_t GetHistoryRunListParameters(const TString &, const TString &)
TPaveText * fPavTxtH_MCs_Date
Definition: TEcnaHistos.h:903
Int_t Get0SMEchaFrom1SMTowAnd0TowEcha(const Int_t &, const Int_t &)
TString GetMemoFlag(const TString &)
TString fRunType
Definition: TEcnaHistos.h:424
Int_t Get1DeeSCEcnaFromDeeSCCons(const Int_t &, const Int_t &)
TString BuildStandardPlotOption(const TString &, const TString &)
Int_t fMemoColorH_MCs_RuDs
Definition: TEcnaHistos.h:663
TString fYMemoD_Ped_ChNb
Definition: TEcnaHistos.h:705
TString fYMemoH_MCs_Date
Definition: TEcnaHistos.h:725
TPaveText * fPavTxtH_SCs_RuDs
Definition: TEcnaHistos.h:912
void SetNbBinsMemo(const TString &, const TString &, const Int_t &)
Float_t AxisTitleOffset()
Int_t fMemoPlotD_Adc_EvNb
Definition: TEcnaHistos.h:640
TString GetXVarFromMemo(const TString &, const TString &)
Int_t fMemoPlotD_NOE_ChDs
Definition: TEcnaHistos.h:631
void SetXsupMemoFromValue(const TString &, const Double_t &)
Int_t GetCodePlotAllXtalsInStin()
TCanvasImp * fImpD_MSp_SpDs
Definition: TEcnaHistos.h:930
void SetViewHistoPadMargins(const TString &, const TString &)
void ViewStinGrid(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &)
TString GetCodeSameOnePlot()
Bool_t fStatusDataExist
Definition: TEcnaHistos.h:420
void WriteAsciiCovariancesBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1723
Double_t GetPhiMin(const Int_t &, const Int_t &)
TCanvas * fCanvD_NOE_ChNb
Definition: TEcnaHistos.h:774
Int_t fNbBinsMemoD_TNo_ChNb
Definition: TEcnaHistos.h:741
TCanvas * fCanvH_HFN_Date
Definition: TEcnaHistos.h:798
Double_t GetXinfValueFromMemo()
TVirtualPad * fPadD_HFN_ChDs
Definition: TEcnaHistos.h:858
TVirtualPad * fPadH_Ped_Date
Definition: TEcnaHistos.h:867
Int_t fTextPaveAlign
Definition: TEcnaHistos.h:453
TCanvas * fCanvD_SCs_ChDs
Definition: TEcnaHistos.h:787
Axis_t fH_TNo_DateXinf
Definition: TEcnaHistos.h:509
Int_t GetNotCompleteDSSCFromIndex(const Int_t &)
Int_t fNbBinsMemoH_TNo_RuDs
Definition: TEcnaHistos.h:764
Int_t MaxCrysVecoInStin()
Axis_t fH_LFN_DateXinf
Definition: TEcnaHistos.h:513
TString GetYVarFromMemo(const TString &, const TString &)
Int_t fCanvSameD_SSp_SpDs
Definition: TEcnaHistos.h:957
TString BuildStandard1DHistoCodeY(const TString &, const TString &)
Int_t GetYStinInStas(const Int_t &, const Int_t &)
Int_t fMemoPlotD_MSp_SpNb
Definition: TEcnaHistos.h:638
TMatrixD ReadCovariancesBetweenSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:2816
TCanvas * fCanvD_Adc_EvDs
Definition: TEcnaHistos.h:792
Float_t DeeNameOffsetX(const Int_t &)
void CorrelationsBetweenSamples(const Int_t &)
void PlotMatrix(const TMatrixD &, const TString &, const TString &)
Definition: TEcnaHistos.cc:902
Double_t fH_MCs_DateYmax
Definition: TEcnaHistos.h:582
void RegisterFileParameters(const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &, const TString &, const time_t, const time_t)
Definition: TEcnaWrite.cc:597
TString fXMemoD_NOE_ChNb
Definition: TEcnaHistos.h:669
Int_t fCanvSameD_SCs_ChNb
Definition: TEcnaHistos.h:955
Int_t fNbBinsMemoH_Ped_RuDs
Definition: TEcnaHistos.h:763
Double_t fD_MSp_SpNbYmax
Definition: TEcnaHistos.h:566
TString fStopEvolDate
Definition: TEcnaHistos.h:400
Int_t fOptVisLine
Definition: TEcnaHistos.h:443
TString GetYDirectionEB(const Int_t &)
TString GetSMHalfBarrel(const Int_t &)
Int_t MaxStinVecoInStex()
Bool_t GetOkViewHisto(TEcnaRead *, const Int_t &, const Int_t &, const Int_t &, const TString &)
Int_t fCanvSameH_MCs_Date
Definition: TEcnaHistos.h:963
Axis_t fD_Ped_ChDsXinf
Definition: TEcnaHistos.h:472
TVirtualPad * ActivePad(const TString &, const TString &)
TString fFapStinName
Definition: TEcnaHistos.h:408
Int_t fNbBinsMemoD_LFN_ChDs
Definition: TEcnaHistos.h:746
void ViewSMGrid(const Int_t &, const TString &)
Int_t fMemoColorD_MCs_ChDs
Definition: TEcnaHistos.h:652
void ViewStin(const Int_t &, const TString &)
Double_t fD_TNo_ChDsYmax
Definition: TEcnaHistos.h:547
Double_t GetYmaxFromHistoFrameAndMarginValue(TH1D *, const Double_t)
TPaveText * fPavTxtH_TNo_Date
Definition: TEcnaHistos.h:902
TString fXMemoD_SCs_ChNb
Definition: TEcnaHistos.h:681
TVectorD ReadSampleAdcValues(const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1347
Double_t fYsup
Definition: TEcnaHistos.h:458
TString fYMemoH_TNo_Date
Definition: TEcnaHistos.h:724
void PlotHistory(const TString &, const TString &, const TString &, const Int_t &, const Int_t &)
TVirtualPad * fPadD_TNo_ChDs
Definition: TEcnaHistos.h:852
TVirtualPad * fPadD_HFN_ChNb
Definition: TEcnaHistos.h:857
TEcnaWrite * fCnaWrite
Definition: TEcnaHistos.h:368
Axis_t fH_SCs_RuDsXinf
Definition: TEcnaHistos.h:530
TPaveText * fPavTxtH_Ped_RuDs
Definition: TEcnaHistos.h:907
TVirtualPad * fPadD_MSp_SpDs
Definition: TEcnaHistos.h:862
TCanvas * fCurrentCanvas
Definition: TEcnaHistos.h:771
TString fYMemoD_MCs_ChDs
Definition: TEcnaHistos.h:710
Double_t GetYmaxFromGraphFrameAndMarginValue(TGraph *, const Double_t)
TString fYMemoD_Adc_EvDs
Definition: TEcnaHistos.h:721
Int_t fCanvSameH_TNo_RuDs
Definition: TEcnaHistos.h:960
Int_t GetNumberOfEvents(const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:4108
TString fHistoCodeFirst
Definition: TEcnaHistos.h:535
Double_t fD_TNo_ChNbYmax
Definition: TEcnaHistos.h:545
Double_t GetXsupValueFromMemo()
TVirtualPad * fPadD_SSp_SpNb
Definition: TEcnaHistos.h:863
TCanvasImp * fImpD_LFN_ChDs
Definition: TEcnaHistos.h:924
Int_t fNbBinsMemoH_SCs_RuDs
Definition: TEcnaHistos.h:768
TString GetStartDate()
Definition: TEcnaRead.cc:835
Int_t fNbBinsMemoH_HFN_RuDs
Definition: TEcnaHistos.h:767
TVirtualPad * fPadD_NOE_ChNb
Definition: TEcnaHistos.h:847
Bool_t fClosedH_TNo_RuDs
Definition: TEcnaHistos.h:835
TString GetDeeDirViewedFromIP(const Int_t &)
Int_t fFapNbOfRuns
Definition: TEcnaHistos.h:393
Double_t fH_TNo_DateYmin
Definition: TEcnaHistos.h:579
TString GetJYDirectionEB(const Int_t &)
Int_t fFapLastReqEvtNumber
Definition: TEcnaHistos.h:386
Int_t fCanvSameH_HFN_RuDs
Definition: TEcnaHistos.h:962
Int_t fMemoColorH_Ped_RuDs
Definition: TEcnaHistos.h:659
Double_t fH_Ped_DateYmax
Definition: TEcnaHistos.h:578
Double_t fXsup
Definition: TEcnaHistos.h:458
Double_t GetJPhiMax(const Int_t &, const Int_t &)
TCanvas * fCanvH_MCs_RuDs
Definition: TEcnaHistos.h:802
TString GetEEDeeType(const Int_t &)
TMatrixD ReadLowFrequencyCorrelationsBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:3147
Double_t fD_Ped_ChNbYmin
Definition: TEcnaHistos.h:540
Int_t fStopEvolRun
Definition: TEcnaHistos.h:396
TString fYMemoH_HFN_RuDs
Definition: TEcnaHistos.h:733
TString GetStinLvrbType(const Int_t &)
Int_t fMemoColorD_MCs_ChNb
Definition: TEcnaHistos.h:652
void SetAllPavesViewStex(const TString &, const Int_t &)
Int_t fCnewRoot
Definition: TEcnaHistos.h:355
Double_t GetPhiMax(const Int_t &, const Int_t &)
Int_t MaxStinInStex()
TPaveText * fPavTxtH_LFN_Date
Definition: TEcnaHistos.h:904
Double_t fD_HFN_ChDsYmin
Definition: TEcnaHistos.h:558
void ReInitCanvas(const TString &, const TString &)
UInt_t CanvasFormatH(const TString &)
TVectorD ReadSigmaOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2216
Int_t MaxStinHocoInStas()
Int_t fOptScaleLogx
Definition: TEcnaHistos.h:445
Axis_t fH_HFN_DateXinf
Definition: TEcnaHistos.h:515
void SetViewHistoColors(TH1D *, const TString &, const TString &, const Int_t &)
TPaveText * SetPaveEvolRuns(const Int_t &, const TString &, const Int_t &, const TString &, const TString &, const TString &)
TCanvasImp * fImpH1SamePlus
Definition: TEcnaHistos.h:914
Int_t fCanvSameD_LFN_ChNb
Definition: TEcnaHistos.h:953
Axis_t fH_HFN_RuDsXsup
Definition: TEcnaHistos.h:529
Int_t Get1SCEchaFrom0DeeEcha(const Int_t &)
TPaveText * fPavComGeneralTitle
Definition: TEcnaHistos.h:611
TCanvasImp * fImpD_LFN_ChNb
Definition: TEcnaHistos.h:923
Double_t GetYminDefaultValue(const TString &)
Axis_t fD_SCs_ChNbXsup
Definition: TEcnaHistos.h:491
TString fYMemoD_SCs_ChDs
Definition: TEcnaHistos.h:716
TString HistoryRunListFilePath()
Int_t fCanvSameD_NOE_ChDs
Definition: TEcnaHistos.h:949
void XtalSamplesEv(const TVectorD &, const Int_t &, const Int_t &, const Int_t &, const TString &)
TVirtualPad * fPadH_MCs_RuDs
Definition: TEcnaHistos.h:875
TString GetRootFileNameShort()
Definition: TEcnaRead.cc:4247
Int_t fCanvSameH_LFN_Date
Definition: TEcnaHistos.h:961
Double_t fD_TNo_ChNbYmin
Definition: TEcnaHistos.h:544
Double_t BoxLeftX(const TString &)
TVectorD ReadAverageNumberOfEvents(const Int_t &)
Definition: TEcnaRead.cc:2294
time_t GetStopTime()
Definition: TEcnaRead.cc:834
TCanvasImp * fImpH_Ped_RuDs
Definition: TEcnaHistos.h:941
TEcnaParCout * fCnaParCout
Definition: TEcnaHistos.h:367
void SetRunNumberFromList(const Int_t &, const Int_t &)
Int_t fCanvSameH_MCs_RuDs
Definition: TEcnaHistos.h:963
TString fXMemoH_SCs_Date
Definition: TEcnaHistos.h:694
TCanvas * fCanvH1SamePlus
Definition: TEcnaHistos.h:773
Bool_t fClosedH_LFN_Date
Definition: TEcnaHistos.h:831
Int_t fFapStexNumber
Definition: TEcnaHistos.h:388
Int_t fFapNbOfSamples
Definition: TEcnaHistos.h:383
TString fCovarianceMatrix
Definition: TEcnaHistos.h:447
TString fXMemoD_NOE_ChDs
Definition: TEcnaHistos.h:670
Int_t fCanvSameD_LFN_ChDs
Definition: TEcnaHistos.h:953
void SetYmaxMemoFromPreviousMemo(const TString &)
Int_t fNbBinsMemoD_TNo_ChDs
Definition: TEcnaHistos.h:742
TPaveText * fPavTxtH1SamePlus
Definition: TEcnaHistos.h:880
Int_t fTextBorderSize
Definition: TEcnaHistos.h:456
TCanvasImp * fImpD_Adc_EvDs
Definition: TEcnaHistos.h:933
TCanvasImp * fImpH_SCs_RuDs
Definition: TEcnaHistos.h:946
Int_t fMemoPlotD_MSp_SpDs
Definition: TEcnaHistos.h:639
Int_t MaxTowPhiInSM()
time_t fStopEvolTime
Definition: TEcnaHistos.h:399
TVirtualPad * fPadH_MCs_Date
Definition: TEcnaHistos.h:869
TCanvasImp * fImpD_NOE_ChDs
Definition: TEcnaHistos.h:916
UInt_t SetCanvasWidth(const TString &, const TString &)
void SetViewHistoOffsets(TH1D *, const TString &, const TString &)
TString fYMemoH_HFN_Date
Definition: TEcnaHistos.h:727
Bool_t fClosedH_TNo_Date
Definition: TEcnaHistos.h:829
TString fYMemoD_SSp_SpNb
Definition: TEcnaHistos.h:719
Double_t fH2HFccMosMatrixYmax
Definition: TEcnaHistos.h:606
TPaveText * fPavTxtD_NOE_ChDs
Definition: TEcnaHistos.h:882
TString fBetweenSamples
Definition: TEcnaHistos.h:449
Int_t fMemoColorH_LFN_Date
Definition: TEcnaHistos.h:661
void SetParametersPavTxt(const TString &, const TString &)
TCanvas * fCanvH_HFN_RuDs
Definition: TEcnaHistos.h:804
TString fXMemoD_Ped_ChDs
Definition: TEcnaHistos.h:672
Double_t fD_HFN_ChDsYmax
Definition: TEcnaHistos.h:559
TPaveText * SetPaveLVRB(const Int_t &, const Int_t &)
Int_t SetGraphFrameYminYmaxFromMemo(TGraph *, const TString &)
TString StexNumberToString(const Int_t &)
void CovariancesBetweenSamples(const Int_t &)
Int_t fMemoPlotD_TNo_ChNb
Definition: TEcnaHistos.h:633
TString fXMemoH_SCs_RuDs
Definition: TEcnaHistos.h:700
void SetHistoScaleY(const TString &)
Definition: TEcnaHistos.cc:820
void SetViewHistoStyle(const TString &)
TString GetXVarHisto(const TString &, const TString &, const Int_t &)
Bool_t fClosedD_MSp_SpNb
Definition: TEcnaHistos.h:822
TMatrixD fReadMatrixDummy
Definition: TEcnaHistos.h:378
Bool_t fClosedD_HFN_ChDs
Definition: TEcnaHistos.h:819
TString fFapAnaType
Definition: TEcnaHistos.h:382
Double_t fD_LFN_ChDsYmin
Definition: TEcnaHistos.h:554
TMatrixD ReadHighFrequencyMeanCorrelationsBetweenStins(const Int_t &)
Definition: TEcnaRead.cc:3906
Double_t GetYmaxDefaultValue(const TString &)
TVirtualPad * fPadH_Ped_RuDs
Definition: TEcnaHistos.h:873
Double_t fD_SCs_ChNbYmax
Definition: TEcnaHistos.h:561
Int_t fMemoColorH_SCs_RuDs
Definition: TEcnaHistos.h:664
TString fYMemoH_Ped_Date
Definition: TEcnaHistos.h:723
Double_t fD_MSp_SpDsYmax
Definition: TEcnaHistos.h:568
Double_t fUserHistoMin
Definition: TEcnaHistos.h:439
Axis_t fD_LFN_ChNbXsup
Definition: TEcnaHistos.h:483
Int_t fMemoColorD_Adc_EvNb
Definition: TEcnaHistos.h:658
TPaveText * fPavTxtD_HFN_ChNb
Definition: TEcnaHistos.h:891
Int_t MaxSCIXInDee()
const std::map< ValueQuantityType, double > min_value
Int_t fNbBinsMemoD_Adc_EvDs
Definition: TEcnaHistos.h:755
void DeeSCNumbering(const Int_t &)
TCanvasImp * fImpD_Adc_EvNb
Definition: TEcnaHistos.h:934
void SetHistoMin()
TString fAllXtalsInStinPlot
Definition: TEcnaHistos.h:627
void SetAllPavesViewStinCrysNb(const Int_t &, const Int_t &)
TPaveText * fPavTxtH_LFN_RuDs
Definition: TEcnaHistos.h:910
Int_t fMemoPlotH_MCs_Date
Definition: TEcnaHistos.h:645
void ViewStexStinNumberingPad(const Int_t &)
Float_t DeeNumberOffsetX(const TString &, const Int_t &)
TCanvasImp * fImpD_SSp_SpNb
Definition: TEcnaHistos.h:931
Bool_t fClosedD_Adc_EvNb
Definition: TEcnaHistos.h:826
Axis_t fD_HFN_ChNbXsup
Definition: TEcnaHistos.h:487
Int_t GetHashedNumberFromIEtaAndIPhi(const Int_t &, const Int_t &)
TString BuildStandardBetweenWhatCode(const TString &, const TString &)
TCanvas * fCanvH_Ped_Date
Definition: TEcnaHistos.h:794
Float_t AxisTitleSize()
Int_t fCnaCommand
Definition: TEcnaHistos.h:353
Double_t GetIIXMin(const Int_t &)
Axis_t fD_TNo_ChNbXinf
Definition: TEcnaHistos.h:474
Int_t fMemoPlotH_TNo_Date
Definition: TEcnaHistos.h:642
void FillHisto(TH1D *, const TVectorD &, const TString &, const Int_t &)
void TowerCrystalNumbering(const Int_t &, const Int_t &)
Axis_t fH_TNo_RuDsXsup
Definition: TEcnaHistos.h:523
void StexHocoVecoLHFCorcc(const TString &)
Int_t fCanvSameD_NOE_ChNb
Definition: TEcnaHistos.h:949
void WriteHistoAscii(const TString &, const Int_t &, const TVectorD &)
TPaveText * SetPaveNbOfEvts(const Int_t &, const TString &, const TString &, const TString &)
Bool_t RegisterPointer(const TString &, const Long_t &)
Definition: TEcnaObject.cc:100
TString fXMemoH_TNo_Date
Definition: TEcnaHistos.h:690
Double_t fH2LFccMosMatrixYmax
Definition: TEcnaHistos.h:604
void ViewStas(const TVectorD &, const Int_t &, const TString &)
TMatrixD ReadLowFrequencyMeanCorrelationsBetweenStins(const Int_t &)
Definition: TEcnaRead.cc:3813
TVectorD ReadAverageTotalNoise(const Int_t &)
Definition: TEcnaRead.cc:2437
Int_t fMemoPlotH_TNo_RuDs
Definition: TEcnaHistos.h:642
Bool_t fClosedD_Adc_EvDs
Definition: TEcnaHistos.h:827
Bool_t fClosedD_NOE_ChNb
Definition: TEcnaHistos.h:808
Bool_t fClosedH_Ped_RuDs
Definition: TEcnaHistos.h:834
TCanvas * fCanvD_SSp_SpDs
Definition: TEcnaHistos.h:791
Bool_t fClosedH_HFN_Date
Definition: TEcnaHistos.h:832
void ViewEBGrid()
Double_t fD_HFN_ChNbYmax
Definition: TEcnaHistos.h:557
Int_t fNbOfListFileH_SCs_RuDs
Definition: TEcnaHistos.h:969
Int_t fMemoColorD_LFN_ChDs
Definition: TEcnaHistos.h:653
TString GetEtaPhiAxisTitle(const TString &)
TString fFlagColPal
Definition: TEcnaHistos.h:436
TString GetXDirectionEE(const Int_t &)
Int_t SetHistoFrameYminYmaxFromMemo(TH1D *, const TString &)
Axis_t fH1SameOnePlotXsup
Definition: TEcnaHistos.h:464
Axis_t fH_MCs_DateXsup
Definition: TEcnaHistos.h:512
TString fYMemoD_MSp_SpDs
Definition: TEcnaHistos.h:718
Double_t GetYmaxValueFromMemo(const TString &)
Int_t fCanvSameD_HFN_ChNb
Definition: TEcnaHistos.h:954
Int_t GetFirstReqEvtNumber()
Definition: TEcnaRead.cc:824
TString fXMemoH_Ped_Date
Definition: TEcnaHistos.h:689
Int_t fOptScaleLinx
Definition: TEcnaHistos.h:445
Axis_t fH_SCs_RuDsXsup
Definition: TEcnaHistos.h:531
Double_t GetYminValueFromMemo(const TString &)
TPaveText * fPavTxtD_Ped_ChDs
Definition: TEcnaHistos.h:884
Color_t GetViewHistoColor(const TString &, const TString &)
Int_t MaxCrysIXInDee()
Int_t fFapRunNumber
Definition: TEcnaHistos.h:384
Int_t MaxSMPhiInEB()
Double_t fD_HFN_ChNbYmin
Definition: TEcnaHistos.h:556
void ViewStexGrid(const Int_t &, const TString &)
TString fYMemoD_TNo_ChDs
Definition: TEcnaHistos.h:708
TString GetTowerLvrbType(const Int_t &)
void StexStinNumbering(const Int_t &)
TPaveText * ActivePavTxt(const TString &, const TString &)
TPaveText * SetPaveEvolNbOfEvtsAna(const TString &, const Int_t &, const Int_t &, const Int_t &, const TString &)
TString fXMemoD_Adc_EvNb
Definition: TEcnaHistos.h:688
Int_t fMemoPlotD_MCs_ChDs
Definition: TEcnaHistos.h:634
TPaveText * fPavTxtH_SCs_Date
Definition: TEcnaHistos.h:906
Int_t fFapFirstReqEvtNumber
Definition: TEcnaHistos.h:385
Double_t fD_SSp_SpNbYmax
Definition: TEcnaHistos.h:570
TPaveText * SetPaveStex(const TString &, const Int_t &)
Int_t fNbBinsMemoD_Adc_EvNb
Definition: TEcnaHistos.h:756
Int_t fCanvSameH_TNo_Date
Definition: TEcnaHistos.h:960
Int_t fNbOfListFileH_TNo_Date
Definition: TEcnaHistos.h:966
TString fXMemoH_MCs_Date
Definition: TEcnaHistos.h:691
TString BuildStandardDetectorCode(const TString &)
Double_t fH2CorccInStinsYmax
Definition: TEcnaHistos.h:608
Double_t fD_Adc_EvNbYmin
Definition: TEcnaHistos.h:575
Double_t fD_MSp_SpNbYmin
Definition: TEcnaHistos.h:565
Double_t fUserHistoMax
Definition: TEcnaHistos.h:439
TPaveText * fPavTxtD_Adc_EvNb
Definition: TEcnaHistos.h:900
TCanvas * fCanvD_Ped_ChDs
Definition: TEcnaHistos.h:777
Float_t AxisLabelOffset()
Int_t fMemoColorH_Ped_Date
Definition: TEcnaHistos.h:659
TString fFapFileRuns
Definition: TEcnaHistos.h:394
TString GetAsciiFileName()
Definition: TEcnaWrite.cc:387
TVirtualPad * fPadD_Ped_ChNb
Definition: TEcnaHistos.h:849
Axis_t fH_MCs_RuDsXinf
Definition: TEcnaHistos.h:524
TCanvasImp * fImpH_HFN_RuDs
Definition: TEcnaHistos.h:945
Bool_t fClosedD_MCs_ChNb
Definition: TEcnaHistos.h:814
Int_t fMemoColorD_NOE_ChNb
Definition: TEcnaHistos.h:649
Axis_t fD_NOE_ChDsXsup
Definition: TEcnaHistos.h:469
Int_t fNbBinsMemoH1SamePlus
Definition: TEcnaHistos.h:736
Int_t MaxCrysIXInSC()
Int_t fCanvSameD_Adc_EvNb
Definition: TEcnaHistos.h:958
TVirtualPad * fPadH_HFN_RuDs
Definition: TEcnaHistos.h:877
Float_t fTextPaveSize
Definition: TEcnaHistos.h:455
Int_t fMemoColorD_Ped_ChDs
Definition: TEcnaHistos.h:650
time_t fStopTime
Definition: TEcnaHistos.h:422
void RunType(const TString &)
Definition: TEcnaHistos.cc:839
Int_t fMemoPlotH_LFN_Date
Definition: TEcnaHistos.h:643
UInt_t CanvasFormatW(const TString &)
Double_t fD_SSp_SpDsYmax
Definition: TEcnaHistos.h:572
TString fTTBELL
Definition: TEcnaHistos.h:357
Axis_t fD_SCs_ChDsXinf
Definition: TEcnaHistos.h:492
void HistoPlot(TH1D *, const Int_t &, const Axis_t &, const Axis_t &, const TString &, const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &, const Int_t &, const Int_t &)
Int_t fNbBinsMemoD_SSp_SpDs
Definition: TEcnaHistos.h:754
Int_t fMemoPlotD_LFN_ChNb
Definition: TEcnaHistos.h:635
TString fSeveralPlot
Definition: TEcnaHistos.h:625
TVectorD GetHistoValues(const TVectorD &, const Int_t &, TEcnaRead *, const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, Int_t &)
Double_t fH_HFN_DateYmin
Definition: TEcnaHistos.h:585
TPaveText * fPavComLVRB
Definition: TEcnaHistos.h:619
Int_t fMemoColorD_TNo_ChDs
Definition: TEcnaHistos.h:651
Int_t fFapNbOfEvts
Definition: TEcnaHistos.h:390
Int_t fMemoColorH_HFN_Date
Definition: TEcnaHistos.h:662
Double_t GetJIYMax(const Int_t &, const Int_t &)
Int_t GetXSampInStin(const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Axis_t fD_Adc_EvDsXinf
Definition: TEcnaHistos.h:503
Bool_t fClosedD_SCs_ChDs
Definition: TEcnaHistos.h:821
Int_t GetJYCrysInDee(const Int_t &, const Int_t &, const Int_t &)
void SetHistoMax()
TVirtualPad * fPadD_MCs_ChDs
Definition: TEcnaHistos.h:854
Double_t fH_HFN_RuDsYmax
Definition: TEcnaHistos.h:599
Double_t fH_TNo_RuDsYmin
Definition: TEcnaHistos.h:592
TString fYMemoH1SamePlus
Definition: TEcnaHistos.h:702
Int_t fNbBinsMemoD_MSp_SpDs
Definition: TEcnaHistos.h:752
TString GetCodeSeveralPlot()
Bool_t fClosedH_MCs_RuDs
Definition: TEcnaHistos.h:836
Int_t fCanvSameD_TNo_ChDs
Definition: TEcnaHistos.h:951
Int_t MaxNbOfRunsInLists()
Double_t GetIIXMax(const Int_t &)
TString GetCodeAllXtalsInStinPlot()
TPaveText * fPavComXtal
Definition: TEcnaHistos.h:615
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:1243
Color_t ColorTab(const Int_t &)
Int_t fMemoPlotH_LFN_RuDs
Definition: TEcnaHistos.h:643
ClassImp(TEcnaHistos)
TString fXMemoH_HFN_RuDs
Definition: TEcnaHistos.h:699
Int_t fMemoPlotD_SCs_ChNb
Definition: TEcnaHistos.h:637
Double_t fD_Ped_ChNbYmax
Definition: TEcnaHistos.h:541
Int_t MaxStinVecoInStas()
Int_t fNbOfListFileH_SCs_Date
Definition: TEcnaHistos.h:967
TCanvas * fCanvD_HFN_ChNb
Definition: TEcnaHistos.h:784
TPaveText * fPavTxtH_Ped_Date
Definition: TEcnaHistos.h:901
Double_t fH2CorccInStinsYmin
Definition: TEcnaHistos.h:607
TVectorD ReadSampleSigmas(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1580
TCanvas * fCanvD_Adc_EvNb
Definition: TEcnaHistos.h:793
TString fYMemoD_MCs_ChNb
Definition: TEcnaHistos.h:709
Int_t fNbBinsMemoD_SCs_ChNb
Definition: TEcnaHistos.h:749
Axis_t fH_MCs_RuDsXsup
Definition: TEcnaHistos.h:525
TPaveText * fPavComNbOfEvts
Definition: TEcnaHistos.h:617
Int_t fCanvSameH_HFN_Date
Definition: TEcnaHistos.h:962
TCanvas * fCanvD_MSp_SpNb
Definition: TEcnaHistos.h:788
TCanvas * fCanvD_HFN_ChDs
Definition: TEcnaHistos.h:785
TCanvas * fCanvH_Ped_RuDs
Definition: TEcnaHistos.h:800
TCanvasImp * fImpD_SCs_ChNb
Definition: TEcnaHistos.h:927
Int_t fNbBinsMemoD_MSp_SpNb
Definition: TEcnaHistos.h:751
TString fXMemoH_Ped_RuDs
Definition: TEcnaHistos.h:695
Double_t fD_SCs_ChDsYmin
Definition: TEcnaHistos.h:562
Int_t fNbBinsMemoH_SCs_Date
Definition: TEcnaHistos.h:762
Double_t fH_SCs_DateYmax
Definition: TEcnaHistos.h:588
Double_t fD_MCs_ChDsYmax
Definition: TEcnaHistos.h:551
Int_t fNbBinsMemoD_MCs_ChDs
Definition: TEcnaHistos.h:744
TPaveText * SetPaveCxyz(const Int_t &)
TVirtualPad * fPadD_MSp_SpNb
Definition: TEcnaHistos.h:861
void SetYminMemoFromValue(const TString &, const Double_t &)
void ViewTowerGrid(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &)
Double_t fD_NOE_ChDsYmin
Definition: TEcnaHistos.h:538
Int_t GetStexStinFromIndex(const Int_t &)
Definition: TEcnaRead.cc:4255
Double_t GetJPhiMin(const Int_t &, const Int_t &)
Double_t fXinf
Definition: TEcnaHistos.h:458
TString fHFBetweenStins
Definition: TEcnaHistos.h:451
TString GetHocoVecoAxisTitle(const TString &)
void SetYminMemoFromPreviousMemo(const TString &)
Axis_t fH_SCs_DateXinf
Definition: TEcnaHistos.h:517
TVirtualPad * fPadD_SCs_ChNb
Definition: TEcnaHistos.h:859
void SetAllYminYmaxMemoFromDefaultValues()
TString fYMemoD_LFN_ChDs
Definition: TEcnaHistos.h:712
Int_t fNbBinsMemoH_TNo_Date
Definition: TEcnaHistos.h:758
Int_t fMemoPlotD_NOE_ChNb
Definition: TEcnaHistos.h:631
Bool_t fClosedH_Ped_Date
Definition: TEcnaHistos.h:828
TString fYMemoD_Ped_ChDs
Definition: TEcnaHistos.h:706
Axis_t fD_NOE_ChNbXsup
Definition: TEcnaHistos.h:467
Int_t fCnaError
Definition: TEcnaHistos.h:353
TEcnaRead * fMyRootFile
Definition: TEcnaHistos.h:373
Bool_t fClosedD_TNo_ChDs
Definition: TEcnaHistos.h:813
Int_t fMemoPlotH_SCs_Date
Definition: TEcnaHistos.h:646
Double_t GetYminFromHistoFrameAndMarginValue(TH1D *, const Double_t)
UInt_t SetCanvasHeight(const TString &, const TString &)
TString GetQuantityName(const TString &)
Int_t fNbBinsMemoH_LFN_RuDs
Definition: TEcnaHistos.h:766
Int_t fCanvSameD_SCs_ChDs
Definition: TEcnaHistos.h:955
Int_t fOptScaleLiny
Definition: TEcnaHistos.h:445
Double_t fD_Adc_EvDsYmin
Definition: TEcnaHistos.h:573
Int_t fMemoColorD_SSp_SpDs
Definition: TEcnaHistos.h:657
TCanvasImp * fImpD_NOE_ChNb
Definition: TEcnaHistos.h:915
TPaveText * fPavTxtD_TNo_ChDs
Definition: TEcnaHistos.h:886
TString fCfgResultsRootFilePath
Definition: TEcnaHistos.h:414
Double_t fD_MCs_ChDsYmin
Definition: TEcnaHistos.h:550
void ViewHistime(const TString &, const Int_t &, const Int_t &, const TString &, const TString &)
TVectorD ReadTotalNoise(const Int_t &)
Definition: TEcnaRead.cc:1925
TString fYMemoH_Ped_RuDs
Definition: TEcnaHistos.h:729
void SetXinfMemoFromValue(const TString &, const Double_t &)
Bool_t fClosedD_SSp_SpDs
Definition: TEcnaHistos.h:825
Float_t DeeOffsetX(const TString &, const Int_t &)
TCanvasImp * fImpD_SSp_SpDs
Definition: TEcnaHistos.h:932
Int_t fNbBinsMemoD_HFN_ChDs
Definition: TEcnaHistos.h:748
TPaveText * fPavComStin
Definition: TEcnaHistos.h:614
Bool_t fClosedD_SCs_ChNb
Definition: TEcnaHistos.h:820
void SetHistoColorPalette(const TString &)
Definition: TEcnaHistos.cc:826
Double_t fD_Adc_EvDsYmax
Definition: TEcnaHistos.h:574
Bool_t StatusFileFound()
Definition: TEcnaHistos.cc:842
TString fYMemoH_LFN_Date
Definition: TEcnaHistos.h:726
Bool_t fClosedH_HFN_RuDs
Definition: TEcnaHistos.h:838
TString fFlagSubDet
Definition: TEcnaHistos.h:360
Double_t fH_HFN_DateYmax
Definition: TEcnaHistos.h:586
Int_t fNbBinsMemoH_HFN_Date
Definition: TEcnaHistos.h:761
TString fYMemoH_MCs_RuDs
Definition: TEcnaHistos.h:731
Axis_t fH_HFN_DateXsup
Definition: TEcnaHistos.h:516
TString fCurrentHistoCode
Definition: TEcnaHistos.h:841
Int_t GetDSSCFrom1DeeSCEcna(const Int_t &, const Int_t &, const Int_t &)
TString fXMemoD_SSp_SpNb
Definition: TEcnaHistos.h:685
TCanvas * fCanvD_LFN_ChDs
Definition: TEcnaHistos.h:783
Bool_t fClosedH_SCs_Date
Definition: TEcnaHistos.h:833
TString fFapStexName
Definition: TEcnaHistos.h:407
TPaveText * SetPaveGeneralComment(const TString &)
Int_t fMemoColorH1SamePlus
Definition: TEcnaHistos.h:648
Double_t fH_MCs_DateYmin
Definition: TEcnaHistos.h:581
TVirtualPad * fPadH_LFN_RuDs
Definition: TEcnaHistos.h:876
Int_t fNbOfExistingRuns
Definition: TEcnaHistos.h:397
TString fYMemoD_SSp_SpDs
Definition: TEcnaHistos.h:720
TString fCfgHistoryRunListFilePath
Definition: TEcnaHistos.h:415
void ViewSMTowerNumberingPad(const Int_t &)
Axis_t fD_Ped_ChNbXinf
Definition: TEcnaHistos.h:470
TVectorD ReadAveragePedestals(const Int_t &)
Definition: TEcnaRead.cc:2363
TString GetStopDate()
Definition: TEcnaRead.cc:836
Float_t AxisTickSize()
Double_t fD_SSp_SpDsYmin
Definition: TEcnaHistos.h:571
Int_t GetNotCompleteSCForConsFromIndex(const Int_t &)
Int_t fNbOfListFileH_LFN_Date
Definition: TEcnaHistos.h:967
Definition: value.py:1
void SetAllPavesViewStas()
TPaveText * fPavTxtD_HFN_ChDs
Definition: TEcnaHistos.h:892
Int_t fMemoColorD_HFN_ChDs
Definition: TEcnaHistos.h:654
TString GetHistoType(const TString &)
Axis_t fD_Ped_ChNbXsup
Definition: TEcnaHistos.h:471
TCanvasImp * fImpH_Ped_Date
Definition: TEcnaHistos.h:935
void SetAllPavesViewHisto(const TString &, const Int_t &, const Int_t &, const Int_t &, const TString &)
Bool_t fStatusFileFound
Definition: TEcnaHistos.h:419
TString fYMemoH_SCs_Date
Definition: TEcnaHistos.h:728
TCanvasImp * fImpD_Ped_ChNb
Definition: TEcnaHistos.h:917
Int_t fMemoPlotD_SSp_SpNb
Definition: TEcnaHistos.h:638
void ViewHisto(const TVectorD &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &, const TString &)
Int_t GetListFileNumber(const TString &)
TString fXMemoD_TNo_ChDs
Definition: TEcnaHistos.h:674
Axis_t fD_SCs_ChNbXinf
Definition: TEcnaHistos.h:490
Axis_t fH_Ped_DateXsup
Definition: TEcnaHistos.h:508
TVirtualPad * fPadH_SCs_Date
Definition: TEcnaHistos.h:872
void DoCanvasClosed()
Int_t fMemoPlotD_SCs_ChDs
Definition: TEcnaHistos.h:637
Int_t fMemoPlotH_MCs_RuDs
Definition: TEcnaHistos.h:645
TString fXMemoD_SSp_SpDs
Definition: TEcnaHistos.h:686
void ViewDeeSCNumberingPad(const Int_t &)
Int_t fCanvSameH_Ped_Date
Definition: TEcnaHistos.h:959
TString fXMemoD_HFN_ChDs
Definition: TEcnaHistos.h:680
Double_t fD_LFN_ChDsYmax
Definition: TEcnaHistos.h:555
TPaveText * fPavComEvolNbOfEvtsAna
Definition: TEcnaHistos.h:622
void PrintNoComment()
Definition: TEcnaRead.cc:4353
Axis_t fD_HFN_ChNbXinf
Definition: TEcnaHistos.h:486
TString fXMemoD_TNo_ChNb
Definition: TEcnaHistos.h:673
Int_t MaxCrysInStin()
TVectorD ReadPedestals(const Int_t &)
Definition: TEcnaRead.cc:1852
TMatrixD ReadLowFrequencyCovariancesBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:3059
TString GetCurrentCanvasName()
void SetParametersCanvas(const TString &, const TString &)
Axis_t fD_Adc_EvNbXinf
Definition: TEcnaHistos.h:505
TString fStopDate
Definition: TEcnaHistos.h:423
Double_t fH_SCs_DateYmin
Definition: TEcnaHistos.h:587
Axis_t fH_Ped_RuDsXsup
Definition: TEcnaHistos.h:521
Int_t fNbBinsMemoH_Ped_Date
Definition: TEcnaHistos.h:757
TString fYMemoD_SCs_ChNb
Definition: TEcnaHistos.h:715
TPaveText * fPavTxtD_LFN_ChNb
Definition: TEcnaHistos.h:889
void EEGridAxis(const Int_t &, const TString &, const TString &)
Int_t MaxTowEtaInSM()
Double_t fD_MSp_SpDsYmin
Definition: TEcnaHistos.h:567
Int_t fNbBinsMemoD_MCs_ChNb
Definition: TEcnaHistos.h:743
TPaveText * fPavTxtD_MCs_ChNb
Definition: TEcnaHistos.h:887
Int_t fCanvSameD_MCs_ChDs
Definition: TEcnaHistos.h:952
Double_t GetJIYMin(const Int_t &, const Int_t &)
TString fFlagGeneralTitle
Definition: TEcnaHistos.h:437
Int_t MaxSCEcnaInDee()
Bool_t DataExist()
Definition: TEcnaRead.cc:1100
Int_t GetDSFrom1DeeSCEcna(const Int_t &, const Int_t &)
TCanvas * fCanvD_Ped_ChNb
Definition: TEcnaHistos.h:776
Axis_t GetHistoXsup(const TString &, const Int_t &, const TString &)
TString fFlagScaleY
Definition: TEcnaHistos.h:435
Bool_t fClosedD_NOE_ChDs
Definition: TEcnaHistos.h:809
Int_t MaxSMEtaInEB()
TCanvasImp * fImpH_MCs_RuDs
Definition: TEcnaHistos.h:943
TPaveText * fPavComEvolRuns
Definition: TEcnaHistos.h:621
TCanvas * fCanvH_SCs_Date
Definition: TEcnaHistos.h:799
Int_t GetNbOfSamples()
Definition: TEcnaRead.cc:822
void ViewEEGrid(const Int_t &)
Int_t fNbOfListFileH_HFN_RuDs
Definition: TEcnaHistos.h:969
Int_t fCanvSameD_MSp_SpDs
Definition: TEcnaHistos.h:957
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)
~TEcnaHistos() override
Definition: TEcnaHistos.cc:47
Int_t fNbOfListFileH_Ped_Date
Definition: TEcnaHistos.h:966
Int_t fMemoPlotH_Ped_Date
Definition: TEcnaHistos.h:641
Int_t fNbOfListFileH_Ped_RuDs
Definition: TEcnaHistos.h:968
TString fXMemoH_HFN_Date
Definition: TEcnaHistos.h:693
void Plot1DHisto(const TVectorD &, const TString &, const TString &, const TString &)
Int_t fNbBinsMemoD_SCs_ChDs
Definition: TEcnaHistos.h:750
void WriteAsciiHisto(const TString &, const Int_t &, const TVectorD &)
Definition: TEcnaWrite.cc:1485
TCanvas * fCanvH_TNo_Date
Definition: TEcnaHistos.h:795
TPaveText * SetPaveCrystal(const Int_t &, const Int_t &, const Int_t &)
void SetEcalSubDetector(const TString &)
Definition: TEcnaHistos.cc:705
TCanvasImp * fImpD_MSp_SpNb
Definition: TEcnaHistos.h:929
TCanvas * fCanvD_NOE_ChDs
Definition: TEcnaHistos.h:775
TString GetAnalysisName()
Definition: TEcnaRead.cc:821
Int_t GetXCrysInStex(const Int_t &, const Int_t &, const Int_t &)
TString GetYVarHisto(const TString &, const TString &, const Int_t &)
Int_t fMemoColorD_SCs_ChDs
Definition: TEcnaHistos.h:655
void SetAllPavesViewMatrix(const TString &, const Int_t &, const Int_t &, const Int_t &)
Bool_t fClosedD_MCs_ChDs
Definition: TEcnaHistos.h:815
Int_t fMemoPlotD_MCs_ChNb
Definition: TEcnaHistos.h:634
TVirtualPad * fPadH_SCs_RuDs
Definition: TEcnaHistos.h:878
TString fXMemoH_LFN_Date
Definition: TEcnaHistos.h:692
Axis_t fH_LFN_RuDsXinf
Definition: TEcnaHistos.h:526
Double_t fH2LFccMosMatrixYmin
Definition: TEcnaHistos.h:603
Int_t MaxCrysIYInSC()
TCanvasImp * fImpD_HFN_ChNb
Definition: TEcnaHistos.h:925
Double_t fD_Ped_ChDsYmin
Definition: TEcnaHistos.h:542
TVirtualPad * fPadD_SCs_ChDs
Definition: TEcnaHistos.h:860
TVirtualPad * fPadH_LFN_Date
Definition: TEcnaHistos.h:870
Axis_t fD_HFN_ChDsXsup
Definition: TEcnaHistos.h:489
Axis_t fH_LFN_RuDsXsup
Definition: TEcnaHistos.h:527
Bool_t fClosedH_MCs_Date
Definition: TEcnaHistos.h:830
Double_t GetEta(const Int_t &, const Int_t &, const Int_t &)
Int_t Get1SMCrysFrom1SMTowAnd0TowEcha(const Int_t &, const Int_t &)
TString fFapXtalName
Definition: TEcnaHistos.h:409
Axis_t fH_SCs_DateXsup
Definition: TEcnaHistos.h:518
Double_t fD_MCs_ChNbYmin
Definition: TEcnaHistos.h:548
Color_t ColorDefinition(const TString &)
TPaveText * fPavTxtD_SCs_ChNb
Definition: TEcnaHistos.h:893
TMatrixD ReadHighFrequencyCorrelationsBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:3324
Int_t fMemoPlotD_Ped_ChDs
Definition: TEcnaHistos.h:632
Int_t fCanvSameH1SamePlus
Definition: TEcnaHistos.h:948
Int_t fMemoPlotD_TNo_ChDs
Definition: TEcnaHistos.h:633
TString fXMemoD_MSp_SpNb
Definition: TEcnaHistos.h:683
Bool_t fClosedD_LFN_ChDs
Definition: TEcnaHistos.h:817
Int_t fMemoColorH_MCs_Date
Definition: TEcnaHistos.h:663
Axis_t fD_MCs_ChDsXsup
Definition: TEcnaHistos.h:481
TPaveText * fPavTxtH_MCs_RuDs
Definition: TEcnaHistos.h:909
Double_t fH_LFN_DateYmax
Definition: TEcnaHistos.h:584
void SetViewGraphColors(TGraph *, const TString &, const TString &)
Int_t MaxCrysInTow()
TCanvasImp * fImpD_TNo_ChNb
Definition: TEcnaHistos.h:919
TPaveText * SetPaveStin(const Int_t &, const Int_t &)
Int_t NumberOfNotConnectedSCs()
TVirtualPad * fPadH_TNo_RuDs
Definition: TEcnaHistos.h:874
Int_t fMemoColorD_MSp_SpNb
Definition: TEcnaHistos.h:656
TVectorD ReadHighFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2143
TPaveText * SetPaveAnalysisRun(const TString &, const Int_t &, const Int_t &, const TString &, const Int_t &, const Int_t &, const TString &)
TString fYMemoD_MSp_SpNb
Definition: TEcnaHistos.h:717
Double_t GetIEtaMin(const Int_t &, const Int_t &)
Int_t GetIXCrysInSC(const Int_t &, const Int_t &, const Int_t &)
TString fXMemoD_LFN_ChNb
Definition: TEcnaHistos.h:677
Double_t fH_MCs_RuDsYmax
Definition: TEcnaHistos.h:595
void StinCrystalNumbering(const Int_t &, const Int_t &)
TCanvas * fCanvD_MCs_ChNb
Definition: TEcnaHistos.h:780
Int_t GetYCrysInStex(const Int_t &, const Int_t &, const Int_t &)
TCanvasImp * fImpD_TNo_ChDs
Definition: TEcnaHistos.h:920
Int_t GetMaxSCInDS(const Int_t &)
TString GetTechHistoCode(const TString &)
Double_t BoxTopY(const TString &)
void SetAllPavesViewStin(const Int_t &)
Color_t GetSCColor(const TString &, const TString &, const TString &)
Double_t fD_NOE_ChNbYmax
Definition: TEcnaHistos.h:537
TString fYMemoD_NOE_ChNb
Definition: TEcnaHistos.h:703
TString BuildStandardCovOrCorCode(const TString &, const TString &)
Int_t MaxStexInStasMinus()
Axis_t fH1SameOnePlotXinf
Definition: TEcnaHistos.h:463
Axis_t fD_TNo_ChNbXsup
Definition: TEcnaHistos.h:475
void SetXVarMemo(const TString &, const TString &, const TString &)
TString fXMemoH1SamePlus
Definition: TEcnaHistos.h:668
TString fCurrentOptPlot
Definition: TEcnaHistos.h:842
Int_t MaxStexInStas()
TEcnaParPaths * fCnaParPaths
Definition: TEcnaHistos.h:366
Int_t GetSCOffset(const Int_t &, const Int_t &, const Int_t &)
TVirtualPad * fPadH_HFN_Date
Definition: TEcnaHistos.h:871
TPaveText * fPavComSeveralChanging
Definition: TEcnaHistos.h:618
TCanvasImp * fImpH_TNo_RuDs
Definition: TEcnaHistos.h:942
TVirtualPad * fPadD_LFN_ChDs
Definition: TEcnaHistos.h:856
void SMTowerNumbering(const Int_t &)
void EvSamplesXtals(const TVectorD &, const Int_t &, const Int_t &, const Int_t &, const TString &)
Axis_t fD_MCs_ChNbXinf
Definition: TEcnaHistos.h:478
Double_t fH_Ped_RuDsYmin
Definition: TEcnaHistos.h:590
Double_t fH_HFN_RuDsYmin
Definition: TEcnaHistos.h:598
TCanvas * fCanvD_TNo_ChNb
Definition: TEcnaHistos.h:778
TPaveText * fPavComCxyz
Definition: TEcnaHistos.h:620
TPaveText * fPavTxtD_MSp_SpDs
Definition: TEcnaHistos.h:896
Double_t fD_LFN_ChNbYmin
Definition: TEcnaHistos.h:552
TString fXMemoH_MCs_RuDs
Definition: TEcnaHistos.h:697
Int_t ModifiedSCEchaForNotConnectedSCs(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
void SetColorPalette(const TString &)
Int_t fNbOfListFileH_TNo_RuDs
Definition: TEcnaHistos.h:968
TPaveText * fPavTxtD_SSp_SpDs
Definition: TEcnaHistos.h:898
TEcnaParEcal * fEcal
Definition: TEcnaHistos.h:369
TString fLFBetweenChannels
Definition: TEcnaHistos.h:450
time_t fStartEvolTime
Definition: TEcnaHistos.h:399
Int_t fCanvSameD_TNo_ChNb
Definition: TEcnaHistos.h:951
TVectorD ReadAverageLowFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2511
Double_t fD_NOE_ChDsYmax
Definition: TEcnaHistos.h:539
Int_t MaxCrysVecoInStex()
TCanvasImp * fImpD_HFN_ChDs
Definition: TEcnaHistos.h:926
TPaveText * fPavTxtD_SSp_SpNb
Definition: TEcnaHistos.h:897
void FileParameters(const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &)
Definition: TEcnaRead.cc:732
Int_t fMemoColorD_HFN_ChNb
Definition: TEcnaHistos.h:654
void SetHistoScaleX(const TString &)
Definition: TEcnaHistos.cc:814
Int_t fCanvSameH_SCs_Date
Definition: TEcnaHistos.h:964
Int_t fNbBinsMemoD_Ped_ChDs
Definition: TEcnaHistos.h:740
TString fYMemoD_Adc_EvNb
Definition: TEcnaHistos.h:722
TString fFlagUserHistoMin
Definition: TEcnaHistos.h:440
Int_t fCanvSameD_HFN_ChDs
Definition: TEcnaHistos.h:954
Double_t fH_TNo_RuDsYmax
Definition: TEcnaHistos.h:593
Int_t MaxSCForConsInDee()
void NumberOfEvents(const Int_t &)
Definition: TEcnaHistos.cc:840
Int_t fOptScaleLogy
Definition: TEcnaHistos.h:445
void TopAxisForHistos(TH1D *, const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Int_t GetJYCrysInSC(const Int_t &, const Int_t &, const Int_t &)
void SqrtContourLevels(const Int_t &, Double_t *)
TCanvasImp * fImpH_SCs_Date
Definition: TEcnaHistos.h:940
Int_t fMemoPlotD_LFN_ChDs
Definition: TEcnaHistos.h:635
Int_t GetReqNbOfEvts()
Definition: TEcnaRead.cc:826
TString ResultsRootFilePath()
Int_t fCanvSameH_Ped_RuDs
Definition: TEcnaHistos.h:959
Int_t GetNbOfRunsDisplayed()
Int_t GetYSampInStin(const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Bool_t fClosedD_TNo_ChNb
Definition: TEcnaHistos.h:812
void SetGraphPresentation(TGraph *, const TString &, const TString &)
TPaveText * fPavTxtD_NOE_ChNb
Definition: TEcnaHistos.h:881
Double_t GetPhi(const Int_t &, const Int_t &, const Int_t &)
Int_t fNbBinsMemoD_Ped_ChNb
Definition: TEcnaHistos.h:739
Int_t fCanvSameD_Adc_EvDs
Definition: TEcnaHistos.h:958
TString fCurrentCanvasName
Definition: TEcnaHistos.h:770
TString fXMemoD_MSp_SpDs
Definition: TEcnaHistos.h:684
TCanvas * fCanvD_TNo_ChDs
Definition: TEcnaHistos.h:779
TString fYMemoD_LFN_ChNb
Definition: TEcnaHistos.h:711
Bool_t fClosedD_LFN_ChNb
Definition: TEcnaHistos.h:816
TCanvas * fCanvH_LFN_Date
Definition: TEcnaHistos.h:797
Int_t MaxCrysEcnaInStex()
Bool_t fClosedH_SCs_RuDs
Definition: TEcnaHistos.h:839
Int_t fCanvSameD_MSp_SpNb
Definition: TEcnaHistos.h:956
TString fFapEchaName
Definition: TEcnaHistos.h:410
Double_t fH_MCs_RuDsYmin
Definition: TEcnaHistos.h:594
Int_t fCdelete
Definition: TEcnaHistos.h:354
TCanvasImp * fImpD_MCs_ChDs
Definition: TEcnaHistos.h:922
TPaveText * fPavTxtD_MCs_ChDs
Definition: TEcnaHistos.h:888
Int_t GetDSOffset(const Int_t &, const Int_t &)
TString GetSCType(const Int_t &)
TVirtualPad * fPadH1SamePlus
Definition: TEcnaHistos.h:846
TString GetRunType()
Definition: TEcnaRead.cc:837
Int_t fMemoPlotH_Ped_RuDs
Definition: TEcnaHistos.h:641
TPaveText * SetPaveCrystalSample(const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Axis_t fD_LFN_ChDsXinf
Definition: TEcnaHistos.h:484
Int_t fMemoColorD_NOE_ChDs
Definition: TEcnaHistos.h:649
TCanvas * GetCurrentCanvas()
Int_t GetNbBinsFromMemo(const TString &, const TString &)
Int_t MaxCrysHocoInStin()
Int_t fMemoPlotH_SCs_RuDs
Definition: TEcnaHistos.h:646
TVirtualPad * fCurrentPad
Definition: TEcnaHistos.h:844
TCanvas * fCanvD_MCs_ChDs
Definition: TEcnaHistos.h:781
Int_t fMemoColorD_Adc_EvDs
Definition: TEcnaHistos.h:658
Int_t fCanvSameD_Ped_ChNb
Definition: TEcnaHistos.h:950
TVirtualPad * fPadD_Adc_EvDs
Definition: TEcnaHistos.h:865
TString AsciiFileName()
Axis_t fD_LFN_ChNbXinf
Definition: TEcnaHistos.h:482
Double_t fH_LFN_RuDsYmax
Definition: TEcnaHistos.h:597
Int_t MaxCrysInSC()
Int_t MaxSampADC()
TString fHFBetweenChannels
Definition: TEcnaHistos.h:450
Int_t GetNotConnectedSCForConsFromIndex(const Int_t &)
Axis_t fD_MCs_ChDsXinf
Definition: TEcnaHistos.h:480
TCanvas * fCanvD_LFN_ChNb
Definition: TEcnaHistos.h:782
Int_t fStartEvolRun
Definition: TEcnaHistos.h:396
Int_t fTextPaveFont
Definition: TEcnaHistos.h:454
TString fXMemoH_LFN_RuDs
Definition: TEcnaHistos.h:698
TString fLFBetweenStins
Definition: TEcnaHistos.h:451
TString fYMemoD_HFN_ChNb
Definition: TEcnaHistos.h:713
TPaveText * SetOptionSamePaveBorder(const TString &, const TString &)
Int_t fMemoAlreadyRead
Definition: TEcnaHistos.h:375
Int_t MaxDeeInEE()
void SetHistoPresentation(TH1D *, const TString &)
Int_t fCanvSameH_LFN_RuDs
Definition: TEcnaHistos.h:961
Axis_t fH_TNo_DateXsup
Definition: TEcnaHistos.h:510
void ViewDeeGrid(const Int_t &, const TString &)
TMatrixD ReadCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:2897
TPaveText * fPavTxtD_SCs_ChDs
Definition: TEcnaHistos.h:894
TCanvas * fCanvD_SSp_SpNb
Definition: TEcnaHistos.h:790
Int_t fMemoColorD_MSp_SpDs
Definition: TEcnaHistos.h:657
TString fAsciiFileName
Definition: TEcnaHistos.h:417
Int_t fMemoPlotD_Ped_ChNb
Definition: TEcnaHistos.h:632
Int_t GetIXCrysInDee(const Int_t &, const Int_t &, const Int_t &)
const std::map< ValueQuantityType, double > max_value
Int_t MaxSMInEB()
Int_t fMemoPlotH1SamePlus
Definition: TEcnaHistos.h:630
TString fYMemoH_SCs_RuDs
Definition: TEcnaHistos.h:734
TPaveText * fPavTxtD_TNo_ChNb
Definition: TEcnaHistos.h:885
TCanvas * fCanvH_MCs_Date
Definition: TEcnaHistos.h:796
Int_t fMemoColorH_TNo_RuDs
Definition: TEcnaHistos.h:660
void WriteAsciiCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1759
TPaveText * fPavTxtH_HFN_Date
Definition: TEcnaHistos.h:905
TString fXMemoD_HFN_ChNb
Definition: TEcnaHistos.h:679
TString fMyRootFileName
Definition: TEcnaHistos.h:412
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
TString GetCodeOnlyOnePlot()
Double_t GetMarginAutoMinMax()
Int_t fNbBinsMemoD_NOE_ChDs
Definition: TEcnaHistos.h:738
TPaveText * fPavTxtD_Adc_EvDs
Definition: TEcnaHistos.h:899
TVectorD ReadMeanCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:1996
Int_t GetXStinInStas(const Int_t &, const Int_t &, const Int_t &)
Bool_t LookAtRootFile()
Definition: TEcnaRead.cc:1043
Double_t GetIEtaMax(const Int_t &, const Int_t &)
TString GetStexHalfStas(const Int_t &)
TCanvas * fCanvD_MSp_SpDs
Definition: TEcnaHistos.h:789
Double_t NotConnectedSCH1DBin(const Int_t &)
TVirtualPad * fPadD_TNo_ChNb
Definition: TEcnaHistos.h:851
TString fOnlyOnePlot
Definition: TEcnaHistos.h:624
Int_t fCanvSameH_SCs_RuDs
Definition: TEcnaHistos.h:964
Double_t fD_SCs_ChDsYmax
Definition: TEcnaHistos.h:563
TString GetEEDeeEndcap(const Int_t &)
Int_t MaxStinEcnaInStex()
TString fFapStexBarrel
Definition: TEcnaHistos.h:402
Int_t fNbBinsMemoD_LFN_ChNb
Definition: TEcnaHistos.h:745
void NewCanvas(const TString &)
Axis_t fD_NOE_ChNbXinf
Definition: TEcnaHistos.h:466
TCanvasImp * fImpH_HFN_Date
Definition: TEcnaHistos.h:939
TMatrixD ReadHighFrequencyCovariancesBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:3236
TString SetHistoYAxisTitle(const TString &)
Bool_t fClosedD_Ped_ChDs
Definition: TEcnaHistos.h:811
Int_t fTobeRead
Definition: TEcnaHistos.h:376
TString fFapStinQuadType
Definition: TEcnaHistos.h:405
Axis_t fD_HFN_ChDsXinf
Definition: TEcnaHistos.h:488
Double_t fYinf
Definition: TEcnaHistos.h:458
Double_t GetYminFromGraphFrameAndMarginValue(TGraph *, const Double_t)
Double_t BoxRightX(const TString &)
TString GetEcalSubDetector()
Axis_t fH_HFN_RuDsXinf
Definition: TEcnaHistos.h:528
Int_t fNbBinsMemoH_MCs_RuDs
Definition: TEcnaHistos.h:765
TCanvas * fCanvD_SCs_ChNb
Definition: TEcnaHistos.h:786
Double_t fD_SSp_SpNbYmin
Definition: TEcnaHistos.h:569
TVirtualPad * fPadH_TNo_Date
Definition: TEcnaHistos.h:868
Axis_t fH_MCs_DateXinf
Definition: TEcnaHistos.h:511
Int_t GetStexNumber()
Definition: TEcnaRead.cc:827
Int_t GetMaxNbOfColors()
TString fYMemoD_TNo_ChNb
Definition: TEcnaHistos.h:707
Axis_t fD_TNo_ChDsXsup
Definition: TEcnaHistos.h:477
Int_t fNbOfListFileH_MCs_RuDs
Definition: TEcnaHistos.h:968
TString GetIXIYAxisTitle(const TString &)
Double_t fD_Adc_EvNbYmax
Definition: TEcnaHistos.h:576
Double_t fH2HFccMosMatrixYmin
Definition: TEcnaHistos.h:605
void SetYVarMemo(const TString &, const TString &, const TString &)
Int_t MaxStinHocoInStex()
TCanvasImp * fImpH_LFN_RuDs
Definition: TEcnaHistos.h:944
TVirtualPad * fPadD_MCs_ChNb
Definition: TEcnaHistos.h:853
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:49
TString GetJYDirectionEE(const Int_t &)
Axis_t GetHistoXinf(const TString &, const Int_t &, const TString &)
TCanvasImp * fImpD_SCs_ChDs
Definition: TEcnaHistos.h:928
TPaveText * fPavTxtD_LFN_ChDs
Definition: TEcnaHistos.h:890
Int_t NumberOfNotCompleteSCs()
Axis_t fD_LFN_ChDsXsup
Definition: TEcnaHistos.h:485
Double_t BoxBottomY(const TString &)
Bool_t fClosedD_MSp_SpDs
Definition: TEcnaHistos.h:823
void ViewStasGrid(const Int_t &)
TCanvasImp * fImpH_LFN_Date
Definition: TEcnaHistos.h:938
Int_t fNbOfListFileH_LFN_RuDs
Definition: TEcnaHistos.h:969
Int_t Get1StexCrysFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &, const Int_t &)
Int_t fNbOfListFileH_HFN_Date
Definition: TEcnaHistos.h:967
void SetViewGraphOffsets(TGraph *, const TString &)
TVectorD fReadHistoDummy
Definition: TEcnaHistos.h:377
TCanvasImp * fImpD_MCs_ChNb
Definition: TEcnaHistos.h:921
TString GetXDirectionEB(const Int_t &)
TString fXMemoD_Ped_ChNb
Definition: TEcnaHistos.h:671
Long_t GetPointerValue(const TString &)
Definition: TEcnaObject.cc:209
Double_t fD_Ped_ChDsYmax
Definition: TEcnaHistos.h:543
void EEDataSectors(const Float_t &, const Float_t &, const Int_t &, const TString &)
Double_t NotCompleteSCH1DBin(const Int_t &)
TVectorD ReadSampleMeans(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1426
TEcnaParHistos * fCnaParHistos
Definition: TEcnaHistos.h:365
TVectorD ReadAverageMeanCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2659
Int_t fNbBinsProj
Definition: TEcnaHistos.h:666
TString fXMemoD_LFN_ChDs
Definition: TEcnaHistos.h:678
TVirtualPad * fPadD_SSp_SpDs
Definition: TEcnaHistos.h:864
Axis_t fH_Ped_DateXinf
Definition: TEcnaHistos.h:507
Float_t AxisLabelSize()
TString fFlagUserHistoMax
Definition: TEcnaHistos.h:440
Axis_t fH_LFN_DateXsup
Definition: TEcnaHistos.h:514
void SetYmaxMemoFromValue(const TString &, const Double_t &)
Int_t fMemoPlotD_SSp_SpDs
Definition: TEcnaHistos.h:639
Axis_t fD_SCs_ChDsXsup
Definition: TEcnaHistos.h:493
TPaveText * SetPaveStas()
Int_t MaxCrysForConsInDee()
TString fXMemoD_SCs_ChDs
Definition: TEcnaHistos.h:682
Int_t GetHistoSize(const TString &, const TString &)
Int_t fPlotAllXtalsInStin
Definition: TEcnaHistos.h:628
TVectorD ReadAverageSigmaOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2735
void FileParameters(const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaHistos.cc:763
Double_t fH_SCs_RuDsYmax
Definition: TEcnaHistos.h:601
Int_t fNbBinsMemoD_NOE_ChNb
Definition: TEcnaHistos.h:737
Bool_t fClosedD_HFN_ChNb
Definition: TEcnaHistos.h:818
TString SetCanvasName(const TString &, const Int_t &, const Int_t &, const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
void ViewMatrix(const TMatrixD &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &, const TString &, const TString &)
void StartStopDate(const TString &, const TString &)
Definition: TEcnaHistos.cc:835
void SigmaSamplesXtals(const TVectorD &, const Int_t &, const Int_t &, const Int_t &, const TString &)
std::ifstream fFcin_f
Definition: TEcnaHistos.h:380
void ViewSCGrid(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &)
Double_t fH_Ped_DateYmin
Definition: TEcnaHistos.h:577
Int_t fMemoPlotD_Adc_EvDs
Definition: TEcnaHistos.h:640
Int_t MaxTowInSM()
Bool_t StatusDataExist()
Definition: TEcnaHistos.cc:843
Int_t fMemoColorD_SSp_SpNb
Definition: TEcnaHistos.h:656
Int_t fMemoColorD_Ped_ChNb
Definition: TEcnaHistos.h:650
TString fXMemoD_Adc_EvDs
Definition: TEcnaHistos.h:687
time_t GetStartTime()
Definition: TEcnaRead.cc:833
TVectorD ReadNumberOfEvents(const Int_t &)
Definition: TEcnaRead.cc:1719
Double_t fD_NOE_ChNbYmin
Definition: TEcnaHistos.h:536
void GeneralTitle(const TString &)
Definition: TEcnaHistos.cc:813
Axis_t fD_NOE_ChDsXinf
Definition: TEcnaHistos.h:468
void PlotCloneOfCurrentCanvas()
Int_t fMemoColorD_LFN_ChNb
Definition: TEcnaHistos.h:653
TVirtualPad * fPadD_Adc_EvNb
Definition: TEcnaHistos.h:866
void WriteMatrixAscii(const TString &, const TString &, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Axis_t fD_MCs_ChNbXsup
Definition: TEcnaHistos.h:479
TCanvas * fCanvH_LFN_RuDs
Definition: TEcnaHistos.h:803
time_t fStartTime
Definition: TEcnaHistos.h:422
Int_t fMemoPlotD_HFN_ChNb
Definition: TEcnaHistos.h:636
Int_t fMemoPlotH_HFN_RuDs
Definition: TEcnaHistos.h:644
Double_t fH_SCs_RuDsYmin
Definition: TEcnaHistos.h:600
TString fYMemoD_NOE_ChDs
Definition: TEcnaHistos.h:704
TVirtualPad * fPadD_Ped_ChDs
Definition: TEcnaHistos.h:850
Int_t fFapReqNbOfEvts
Definition: TEcnaHistos.h:387
Int_t fCanvSameD_SSp_SpNb
Definition: TEcnaHistos.h:956
TCanvas * fCanvH_TNo_RuDs
Definition: TEcnaHistos.h:801
Double_t fD_MCs_ChNbYmax
Definition: TEcnaHistos.h:549
TString fYMemoH_TNo_RuDs
Definition: TEcnaHistos.h:730
Int_t fCanvSameD_Ped_ChDs
Definition: TEcnaHistos.h:950