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 {
49  //destructor
50 
51  if (fT1DRunNumber != nullptr){delete [] fT1DRunNumber; fCdelete++;}
52 
53  //if (fCnaParHistos != 0){delete fCnaParHistos; fCdelete++;}
54  //if (fCnaParPaths != 0){delete fCnaParPaths; fCdelete++;}
55  //if (fCnaParCout != 0){delete fCnaParCout; fCdelete++;}
56  //if (fCnaWrite != 0){delete fCnaWrite; fCdelete++;}
57  //if (fEcal != 0){delete fEcal; fCdelete++;}
58  //if (fEcalNumbering != 0){delete fEcalNumbering; fCdelete++;}
59 
60  //if (fMyRootFile != 0){delete fMyRootFile; fCdelete++;}
61  //if (fReadHistoDummy != 0){delete fReadHistoDummy; fCdelete++;}
62 
63 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64 
65  if ( fCnew != fCdelete )
66  {
67  std::cout << "*TEcnaHistos> WRONG MANAGEMENT OF ALLOCATIONS: fCnew = "
68  << fCnew << ", fCdelete = " << fCdelete << fTTBELL << std::endl;
69  }
70  else
71  {
72  // std::cout << "*TEcnaHistos> BRAVO! GOOD MANAGEMENT OF ALLOCATIONS: fCnew = "
73  // << fCnew << ", fCdelete = " << fCdelete << std::endl;
74  }
75 
76 #define MGRA
77 #ifndef MGRA
78  if ( fCnewRoot != fCdeleteRoot )
79  {
80  std::cout << "*TEcnaHistos> WRONG MANAGEMENT OF ROOT ALLOCATIONS: fCnewRoot = "
81  << fCnewRoot << ", fCdeleteRoot = " << fCdeleteRoot << std::endl;
82  }
83  else
84  {
85  std::cout << "*TEcnaHistos> BRAVO! GOOD MANAGEMENT OF ROOT ALLOCATIONS:"
86  << " fCnewRoot = " << fCnewRoot <<", fCdeleteRoot = "
87  << fCdeleteRoot << std::endl;
88  }
89 #endif // MGRA
90 
91  // std::cout << "TEcnaHistos> Leaving destructor" << std::endl;
92  // std::cout << " fCnew = " << fCnew << ", fCdelete = " << fCdelete << std::endl;
93 
94  // std::cout << "[Info Management] CLASS: TEcnaHistos. DESTROY OBJECT: this = " << this << std::endl;
95 
96 }
97 
98 //===================================================================
99 //
100 // Constructors
101 //
102 //===================================================================
104 // Constructor without argument. Call to Init()
105 
106  // std::cout << "[Info Management] CLASS: TEcnaHistos. CREATE OBJECT: this = " << this << std::endl;
107 
108  Init();
109 }
110 
111 TEcnaHistos::TEcnaHistos(TEcnaObject* pObjectManager, const TString& SubDet)
112 {
113  // std::cout << "[Info Management] CLASS: TEcnaHistos. CREATE OBJECT: this = " << this << std::endl;
114 
115 
116  Long_t i_this = (Long_t)this;
117  pObjectManager->RegisterPointer("TEcnaHistos", i_this);
118 
119  Init();
120 
121  //----------------------- Object management
122 
123  //............................ fCnaParCout
124  fCnaParCout = nullptr;
125  Long_t iCnaParCout = pObjectManager->GetPointerValue("TEcnaParCout");
126  if( iCnaParCout == 0 )
127  {fCnaParCout = new TEcnaParCout(pObjectManager); /*fCnew++*/}
128  else
129  {fCnaParCout = (TEcnaParCout*)iCnaParCout;}
130 
131  //............................ fCnaParPaths
132  fCnaParPaths = nullptr;
133  Long_t iCnaParPaths = pObjectManager->GetPointerValue("TEcnaParPaths");
134  if( iCnaParPaths == 0 )
135  {fCnaParPaths = new TEcnaParPaths(pObjectManager); /*fCnew++*/}
136  else
137  {fCnaParPaths = (TEcnaParPaths*)iCnaParPaths;}
138 
141 
142  //............................ fEcal => to be changed in fParEcal
143  fEcal = nullptr;
144  Long_t iParEcal = pObjectManager->GetPointerValue("TEcnaParEcal");
145  if( iParEcal == 0 )
146  {fEcal = new TEcnaParEcal(pObjectManager, SubDet.Data()); /*fCnew++*/}
147  else
148  {fEcal = (TEcnaParEcal*)iParEcal;}
149 
150  //............................ fEcalNumbering
151  fEcalNumbering = nullptr;
152  Long_t iEcalNumbering = pObjectManager->GetPointerValue("TEcnaNumbering");
153  if( iEcalNumbering == 0 )
154  {fEcalNumbering = new TEcnaNumbering(pObjectManager, SubDet.Data()); /*fCnew++*/}
155  else
156  {fEcalNumbering = (TEcnaNumbering*)iEcalNumbering;}
157 
158  //............................ fCnaParHistos
159  fCnaParHistos = nullptr;
160  Long_t iCnaParHistos = pObjectManager->GetPointerValue("TEcnaParHistos");
161  if( iCnaParHistos == 0 )
162  {fCnaParHistos = new TEcnaParHistos(pObjectManager, SubDet.Data()); /*fCnew++*/}
163  else
164  {fCnaParHistos = (TEcnaParHistos*)iCnaParHistos;}
165 
166  //............................ fCnaWrite
167  fCnaWrite = nullptr;
168  Long_t iCnaWrite = pObjectManager->GetPointerValue("TEcnaWrite");
169  if( iCnaWrite == 0 )
170  {fCnaWrite = new TEcnaWrite(pObjectManager, SubDet.Data()); /*fCnew++*/}
171  else
172  {fCnaWrite = (TEcnaWrite*)iCnaWrite;}
173 
174  //............................ fMyRootFile
175  fMyRootFile = nullptr;
176  Long_t iMyRootFile = pObjectManager->GetPointerValue("TEcnaRead");
177  if( iMyRootFile == 0 )
178  {fMyRootFile = new TEcnaRead(pObjectManager, SubDet.Data()); /*fCnew++*/}
179  else
180  {fMyRootFile = (TEcnaRead*)iMyRootFile;}
181 
183 
184  //------------------- creation objet TEcnaRead fMyRootFile (a reprendre plus clairement)
185  //fFileHeader = 0;
186  //fMyRootFile = new TEcnaRead(fFlagSubDet.Data(), fCnaParPaths, fCnaParCout,
187  // fFileHeader, fEcalNumbering, fCnaWrite); fCnew++;
188  //fMyRootFile->PrintNoComment();
189 
190 
191  SetEcalSubDetector(SubDet.Data());
192  //......... init ymin,ymax histos -> Default values for Ymin and Ymax
194 }
195 
196 
198 {
199 //========================= GENERAL INITIALISATION
200  fCnew = 0;
201  fCdelete = 0;
202  fCnewRoot = 0;
203  fCdeleteRoot = 0;
204 
205  fCnaCommand = 0;
206  fCnaError = 0;
207 
208  fgMaxCar = (Int_t)512;
209  Int_t MaxCar = fgMaxCar;
210 
211  //------------------------------ initialisations ----------------------
212  fTTBELL = '\007';
213 
214  fT1DRunNumber = nullptr;
215 
216  //.......... init flags Same plot
234  //.......... init flags colors (Init)
252 
253  //.......... init counter Same canvas
271  //................. Flag Scale X anf Y set to "LIN" and flag color palete set to "Black/Red/Blue"
272 
273  MaxCar = fgMaxCar;
274  fFlagScaleX.Resize(MaxCar);
275  fFlagScaleX = "LIN";
276 
277  MaxCar = fgMaxCar; // (Init)
278  fFlagScaleY.Resize(MaxCar);
279  fFlagScaleY = "LIN";
280 
281  MaxCar = fgMaxCar;
282  fFlagColPal.Resize(MaxCar);
283  fFlagColPal = "Black/Red/Blue";
284 
285  //................. Flag General Title set to empty string
286  MaxCar = fgMaxCar;
287  fFlagGeneralTitle.Resize(MaxCar);
288  fFlagGeneralTitle = "";
289 
290  //................. Init codes Options
291  fOptScaleLinx = 31400;
292  fOptScaleLogx = 31401;
293  fOptScaleLiny = 31402;
294  fOptScaleLogy = 31403;
295 
296  fOptVisLine = 1101;
297  fOptVisPolm = 1102;
298 
299  //............................ (Init)
300  MaxCar = fgMaxCar;
301  fCovarianceMatrix.Resize(MaxCar);
302  fCovarianceMatrix = "Cov";
303  MaxCar = fgMaxCar;
304  fCorrelationMatrix.Resize(MaxCar);
305  fCorrelationMatrix = "Cor";
306 
307  MaxCar = fgMaxCar;
308  fLFBetweenStins.Resize(MaxCar);
309  fLFBetweenStins = "MttLF";
310  MaxCar = fgMaxCar;
311  fHFBetweenStins.Resize(MaxCar);
312  fHFBetweenStins = "MttHF";
313 
314  MaxCar = fgMaxCar;
315  fLFBetweenChannels.Resize(MaxCar);
316  fLFBetweenChannels = "MccLF";
317  MaxCar = fgMaxCar;
318  fHFBetweenChannels.Resize(MaxCar);
319  fHFBetweenChannels = "MccHF";
320 
321  MaxCar = fgMaxCar;
322  fBetweenSamples.Resize(MaxCar);
323  fBetweenSamples = "Mss";
324 
325  //.................................. text pave alignement for pave "SeveralChanging" (HistimePlot)
326  fTextPaveAlign = 12; // 1 = left adjusted, 2 = vertically centered
327  fTextPaveFont = 100; // 10*10 = 10*(ID10 = Courier New)
328  fTextPaveSize = (Float_t)0.025; // 0.0xxx = xxx% of the pave size
329  fTextBorderSize = 1; // Pave Border (=>Shadow)
330 
331  //................................. Init Xvar, Yvar, NbBins management for options SAME and SAME n
332  fXMemoH1SamePlus = "";
333  fXMemoD_NOE_ChNb = "";
334  fXMemoD_NOE_ChDs = "";
335  fXMemoD_Ped_ChNb = "";
336  fXMemoD_Ped_ChDs = "";
337  fXMemoD_TNo_ChNb = "";
338  fXMemoD_TNo_ChDs = "";
339  fXMemoD_MCs_ChNb = "";
340  fXMemoD_MCs_ChDs = "";
341  fXMemoD_LFN_ChNb = "";
342  fXMemoD_LFN_ChDs = "";
343  fXMemoD_HFN_ChNb = "";
344  fXMemoD_HFN_ChDs = "";
345  fXMemoD_SCs_ChNb = "";
346  fXMemoD_SCs_ChDs = "";
347  fXMemoD_MSp_SpNb = "";
348  fXMemoD_MSp_SpDs = "";
349  fXMemoD_SSp_SpNb = "";
350  fXMemoD_SSp_SpDs = "";
351  fXMemoD_Adc_EvDs = "";
352  fXMemoD_Adc_EvNb = "";
353  fXMemoH_Ped_Date = "";
354  fXMemoH_TNo_Date = "";
355  fXMemoH_MCs_Date = "";
356  fXMemoH_LFN_Date = "";
357  fXMemoH_HFN_Date = "";
358  fXMemoH_SCs_Date = "";
359  fXMemoH_Ped_RuDs = "";
360  fXMemoH_TNo_RuDs = "";
361  fXMemoH_MCs_RuDs = "";
362  fXMemoH_LFN_RuDs = "";
363  fXMemoH_HFN_RuDs = "";
364  fXMemoH_SCs_RuDs = "";
365 
366  fYMemoH1SamePlus = "";
367  fYMemoD_NOE_ChNb = "";
368  fYMemoD_NOE_ChDs = "";
369  fYMemoD_Ped_ChNb = "";
370  fYMemoD_Ped_ChDs = "";
371  fYMemoD_TNo_ChNb = "";
372  fYMemoD_TNo_ChDs = "";
373  fYMemoD_MCs_ChNb = "";
374  fYMemoD_MCs_ChDs = "";
375  fYMemoD_LFN_ChNb = "";
376  fYMemoD_LFN_ChDs = "";
377  fYMemoD_HFN_ChNb = "";
378  fYMemoD_HFN_ChDs = "";
379  fYMemoD_SCs_ChNb = "";
380  fYMemoD_SCs_ChDs = "";
381  fYMemoD_MSp_SpNb = "";
382  fYMemoD_MSp_SpDs = "";
383  fYMemoD_SSp_SpNb = "";
384  fYMemoD_SSp_SpDs = "";
385  fYMemoD_Adc_EvDs = "";
386  fYMemoD_Adc_EvNb = "";
387  fYMemoH_Ped_Date = "";
388  fYMemoH_TNo_Date = "";
389  fYMemoH_MCs_Date = "";
390  fYMemoH_LFN_Date = "";
391  fYMemoH_HFN_Date = "";
392  fYMemoH_SCs_Date = "";
393  fYMemoH_Ped_RuDs = "";
394  fYMemoH_TNo_RuDs = "";
395  fYMemoH_MCs_RuDs = "";
396  fYMemoH_LFN_RuDs = "";
397  fYMemoH_HFN_RuDs = "";
398  fYMemoH_SCs_RuDs = "";
399 
433 
434  //.................................. Init canvas/pad pointers (Init)
435  fCurrentCanvas = nullptr;
436 
437  fCurrentCanvasName = "?";
438 
439  fCanvH1SamePlus = nullptr;
440  fCanvD_NOE_ChNb = nullptr;
441  fCanvD_NOE_ChDs = nullptr;
442  fCanvD_Ped_ChNb = nullptr;
443  fCanvD_Ped_ChDs = nullptr;
444  fCanvD_TNo_ChNb = nullptr;
445  fCanvD_TNo_ChDs = nullptr;
446  fCanvD_MCs_ChNb = nullptr;
447  fCanvD_MCs_ChDs = nullptr;
448  fCanvD_LFN_ChNb = nullptr;
449  fCanvD_LFN_ChDs = nullptr;
450  fCanvD_HFN_ChNb = nullptr;
451  fCanvD_HFN_ChDs = nullptr;
452  fCanvD_SCs_ChNb = nullptr;
453  fCanvD_SCs_ChDs = nullptr;
454  fCanvD_MSp_SpNb = nullptr;
455  fCanvD_MSp_SpDs = nullptr;
456  fCanvD_SSp_SpNb = nullptr;
457  fCanvD_SSp_SpDs = nullptr;
458  fCanvD_Adc_EvDs = nullptr;
459  fCanvD_Adc_EvNb = nullptr;
460  fCanvH_Ped_Date = nullptr;
461  fCanvH_TNo_Date = nullptr;
462  fCanvH_MCs_Date = nullptr;
463  fCanvH_LFN_Date = nullptr;
464  fCanvH_HFN_Date = nullptr;
465  fCanvH_SCs_Date = nullptr;
466  fCanvH_Ped_RuDs = nullptr;
467  fCanvH_TNo_RuDs = nullptr;
468  fCanvH_MCs_RuDs = nullptr;
469  fCanvH_LFN_RuDs = nullptr;
470  fCanvH_HFN_RuDs = nullptr;
471  fCanvH_SCs_RuDs = nullptr;
472 
473 
474  fClosedH1SamePlus = kFALSE; // (Canvas Closed SIGNAL)
475  fClosedD_NOE_ChNb = kFALSE;
476  fClosedD_NOE_ChDs = kFALSE;
477  fClosedD_Ped_ChNb = kFALSE;
478  fClosedD_Ped_ChDs = kFALSE;
479  fClosedD_TNo_ChNb = kFALSE;
480  fClosedD_TNo_ChDs = kFALSE;
481  fClosedD_MCs_ChNb = kFALSE;
482  fClosedD_MCs_ChDs = kFALSE;
483  fClosedD_LFN_ChNb = kFALSE;
484  fClosedD_LFN_ChDs = kFALSE;
485  fClosedD_HFN_ChNb = kFALSE;
486  fClosedD_HFN_ChDs = kFALSE;
487  fClosedD_SCs_ChNb = kFALSE;
488  fClosedD_SCs_ChDs = kFALSE;
489  fClosedD_MSp_SpNb = kFALSE;
490  fClosedD_MSp_SpDs = kFALSE;
491  fClosedD_SSp_SpNb = kFALSE;
492  fClosedD_SSp_SpDs = kFALSE;
493  fClosedD_Adc_EvDs = kFALSE;
494  fClosedD_Adc_EvNb = kFALSE;
495  fClosedH_Ped_Date = kFALSE;
496  fClosedH_TNo_Date = kFALSE;
497  fClosedH_MCs_Date = kFALSE;
498  fClosedH_LFN_Date = kFALSE;
499  fClosedH_HFN_Date = kFALSE;
500  fClosedH_SCs_Date = kFALSE;
501  fClosedH_Ped_RuDs = kFALSE;
502  fClosedH_TNo_RuDs = kFALSE;
503  fClosedH_MCs_RuDs = kFALSE;
504  fClosedH_LFN_RuDs = kFALSE;
505  fClosedH_HFN_RuDs = kFALSE;
506  fClosedH_SCs_RuDs = kFALSE;
507 
508  fCurrentPad = nullptr; // (Init)
509 
510  fPadH1SamePlus = nullptr;
511  fPadD_NOE_ChNb = nullptr;
512  fPadD_NOE_ChDs = nullptr;
513  fPadD_Ped_ChNb = nullptr;
514  fPadD_Ped_ChDs = nullptr;
515  fPadD_TNo_ChNb = nullptr;
516  fPadD_TNo_ChDs = nullptr;
517  fPadD_MCs_ChNb = nullptr;
518  fPadD_MCs_ChDs = nullptr;
519  fPadD_LFN_ChNb = nullptr;
520  fPadD_LFN_ChDs = nullptr;
521  fPadD_HFN_ChNb = nullptr;
522  fPadD_HFN_ChDs = nullptr;
523  fPadD_SCs_ChNb = nullptr;
524  fPadD_SCs_ChDs = nullptr;
525  fPadD_MSp_SpNb = nullptr;
526  fPadD_MSp_SpDs = nullptr;
527  fPadD_SSp_SpNb = nullptr;
528  fPadD_SSp_SpDs = nullptr;
529  fPadD_Adc_EvDs = nullptr;
530  fPadD_Adc_EvNb = nullptr;
531  fPadH_Ped_Date = nullptr;
532  fPadH_TNo_Date = nullptr;
533  fPadH_MCs_Date = nullptr;
534  fPadH_LFN_Date = nullptr;
535  fPadH_HFN_Date = nullptr;
536  fPadH_SCs_Date = nullptr;
537  fPadH_Ped_RuDs = nullptr;
538  fPadH_TNo_RuDs = nullptr;
539  fPadH_MCs_RuDs = nullptr;
540  fPadH_LFN_RuDs = nullptr;
541  fPadH_HFN_RuDs = nullptr;
542  fPadH_SCs_RuDs = nullptr;
543 
544  fPavTxtH1SamePlus = nullptr; // (Init)
545  fPavTxtD_NOE_ChNb = nullptr;
546  fPavTxtD_NOE_ChDs = nullptr;
547  fPavTxtD_Ped_ChNb = nullptr;
548  fPavTxtD_Ped_ChDs = nullptr;
549  fPavTxtD_TNo_ChNb = nullptr;
550  fPavTxtD_TNo_ChDs = nullptr;
551  fPavTxtD_MCs_ChNb = nullptr;
552  fPavTxtD_MCs_ChDs = nullptr;
553  fPavTxtD_LFN_ChNb = nullptr;
554  fPavTxtD_LFN_ChDs = nullptr;
555  fPavTxtD_HFN_ChNb = nullptr;
556  fPavTxtD_HFN_ChDs = nullptr;
557  fPavTxtD_SCs_ChNb = nullptr;
558  fPavTxtD_SCs_ChDs = nullptr;
559  fPavTxtD_MSp_SpNb = nullptr;
560  fPavTxtD_MSp_SpDs = nullptr;
561  fPavTxtD_SSp_SpNb = nullptr;
562  fPavTxtD_SSp_SpDs = nullptr;
563  fPavTxtD_Adc_EvDs = nullptr;
564  fPavTxtD_Adc_EvNb = nullptr;
565  fPavTxtH_Ped_Date = nullptr;
566  fPavTxtH_TNo_Date = nullptr;
567  fPavTxtH_MCs_Date = nullptr;
568  fPavTxtH_LFN_Date = nullptr;
569  fPavTxtH_HFN_Date = nullptr;
570  fPavTxtH_SCs_Date = nullptr;
571  fPavTxtH_Ped_RuDs = nullptr;
572  fPavTxtH_TNo_RuDs = nullptr;
573  fPavTxtH_MCs_RuDs = nullptr;
574  fPavTxtH_LFN_RuDs = nullptr;
575  fPavTxtH_HFN_RuDs = nullptr;
576  fPavTxtH_SCs_RuDs = nullptr;
577 
578  fImpH1SamePlus = nullptr; // (Init)
579  fImpD_NOE_ChNb = nullptr;
580  fImpD_NOE_ChDs = nullptr;
581  fImpD_Ped_ChNb = nullptr;
582  fImpD_Ped_ChDs = nullptr;
583  fImpD_TNo_ChNb = nullptr;
584  fImpD_TNo_ChDs = nullptr;
585  fImpD_MCs_ChNb = nullptr;
586  fImpD_MCs_ChDs = nullptr;
587  fImpD_LFN_ChNb = nullptr;
588  fImpD_LFN_ChDs = nullptr;
589  fImpD_HFN_ChNb = nullptr;
590  fImpD_HFN_ChDs = nullptr;
591  fImpD_SCs_ChNb = nullptr;
592  fImpD_SCs_ChDs = nullptr;
593  fImpD_MSp_SpNb = nullptr;
594  fImpD_MSp_SpDs = nullptr;
595  fImpD_SSp_SpNb = nullptr;
596  fImpD_SSp_SpDs = nullptr;
597  fImpD_Adc_EvDs = nullptr;
598  fImpD_Adc_EvNb = nullptr;
599  fImpH_Ped_Date = nullptr;
600  fImpH_TNo_Date = nullptr;
601  fImpH_MCs_Date = nullptr;
602  fImpH_LFN_Date = nullptr;
603  fImpH_HFN_Date = nullptr;
604  fImpH_SCs_Date = nullptr;
605  fImpH_Ped_RuDs = nullptr;
606  fImpH_TNo_RuDs = nullptr;
607  fImpH_MCs_RuDs = nullptr;
608  fImpH_LFN_RuDs = nullptr;
609  fImpH_HFN_RuDs = nullptr;
610  fImpH_SCs_RuDs = nullptr;
611 
612  fNbBinsProj = 100; // number of bins for histos in option Projection
613 
614  //.................................... Miscellaneous parameters (Init)
615 
622 
629 
630  fNbOfExistingRuns = 0;
631 
632  fFapNbOfRuns = -1; // INIT NUMBER OF RUNS: set to -1
633  fFapMaxNbOfRuns = -1; // INIT MAXIMUM NUMBER OF RUNS: set to -1
634 
635  MaxCar = fgMaxCar;
636  fFapFileRuns.Resize(MaxCar);
637  fFapFileRuns = "(file with list of runs parameters: no info)";
638 
639  fStartEvolTime = 0;
640  fStopEvolTime = 0;
641  fStartEvolDate = "Start date: not known";
642  fStopEvolDate = "Stop date: not known";
643 
644  fStartEvolRun = 0;
645  fStopEvolRun = 0;
646 
647  fRunType = "Run type: not known";
648 
649  fFapNbOfEvts = 0;
650 
651  MaxCar = fgMaxCar;
652  fMyRootFileName.Resize(MaxCar);
653  fMyRootFileName = "No ROOT file name available (fMyRootFileName).";
654 
655  fFapAnaType = "Analysis name: not known"; // Init Type of analysis
656  fFapNbOfSamples = 0; // Init Nb of required samples
657  fFapRunNumber = 0; // Init Run number
658  fFapFirstReqEvtNumber = 0; // Init First requested event number
659  fFapLastReqEvtNumber = 0; // Init Last requested event number
660  fFapReqNbOfEvts = 0; // Init Requested number of events
661  fFapStexNumber = 0; // Init Stex number
662 
663  //------------------ Init read file flags
664  fAlreadyRead = 1;
665  fMemoAlreadyRead = 0;
666  fTobeRead = 0;
667  fZerv = 0;
668  fUnev = 1;
669  TVectorD fReadHistoDummy(fUnev);
670  TMatrixD fReadMatrixDummy(fUnev, fUnev);
671 
672  //------------------ Init fAsciiFileName
673  fAsciiFileName = "?";
674 
675 } // end of Init()
676 
677 //----------------------------------------------------------------------------------------
679 {
680  // Set Subdetector (EB or EE)
681 
682  Int_t MaxCar = fgMaxCar;
683  fFlagSubDet.Resize(MaxCar);
684  fFlagSubDet = fEcal->GetEcalSubDetector(); // fFlagSubDet = "EB" or "EE"
685 
686  //.................................. Init specific EB/EE parameters ( SetEcalSubDetector(...) )
687  MaxCar = fgMaxCar;
688  fFapStexName.Resize(MaxCar);
689  fFapStexName = "no info for Stex";
690  MaxCar = fgMaxCar;
691  fFapStinName.Resize(MaxCar);
692  fFapStinName = "no info for Stin";
693  MaxCar = fgMaxCar;
694  fFapXtalName.Resize(MaxCar);
695  fFapXtalName = "no info for Xtal";
696  MaxCar = fgMaxCar;
697  fFapEchaName.Resize(MaxCar);
698  fFapEchaName = "no info for Echa";
699 
700  if( fFlagSubDet == "EB" )
701  {
702  fFapStexName = "SM";
703  fFapStinName = "Tower";
704  fFapXtalName = "Xtal";
705  fFapEchaName = "Chan";
707  }
708 
709  if( fFlagSubDet == "EE" )
710  {
711  fFapStexName = "Dee";
712  fFapStinName = "SC";
713  fFapXtalName = "Xtal";
714  fFapEchaName = "Chan";
716  fFapStexDir = "right";
717  fFapStinQuadType = "top";
718  }
719 
720  //........................ init code plot type (SetEcalSubDetector)
721  MaxCar = fgMaxCar;
722  fOnlyOnePlot.Resize(MaxCar);
724 
725  MaxCar = fgMaxCar;
726  fSeveralPlot.Resize(MaxCar);
728 
729  MaxCar = fgMaxCar;
730  fSameOnePlot.Resize(MaxCar);
732 
733  MaxCar = fgMaxCar;
734  fAllXtalsInStinPlot.Resize(MaxCar);
736 
738 
739 } // ---------------- end of SetEcalSubDetector(...) ----------------
740 
741 //--------------------------------------------------------------------------------------------
742 //
743 // FileParameters(s)(...)
744 //
745 //--------------------------------------------------------------------------------------------
746 
747 //===> DON'T SUPPRESS: THESE METHODS ARE CALLED BY TEcnaGui and can be called by any other program
748 void TEcnaHistos::FileParameters(const TString& xArgAnaType, const Int_t& xArgNbOfSamples,
749  const Int_t& xArgRunNumber, const Int_t& xArgFirstReqEvtNumber,
750  const Int_t& xArgLastReqEvtNumber, const Int_t& xArgReqNbOfEvts,
751  const Int_t& xArgStexNumber)
752 {
753 // Set parameters for reading the right ECNA results file
754 
755  fFapAnaType = xArgAnaType;
756  fFapNbOfSamples = xArgNbOfSamples;
757  fFapRunNumber = xArgRunNumber;
758  fFapFirstReqEvtNumber = xArgFirstReqEvtNumber;
759  fFapLastReqEvtNumber = xArgLastReqEvtNumber;
760  fFapReqNbOfEvts = xArgReqNbOfEvts;
761  fFapStexNumber = xArgStexNumber;
762 
763  InitSpecParBeforeFileReading(); // SpecPar = Special Parameters (dates, times, run types)
764 }
765 
767 {
768 // Set parameters for reading the right ECNA results file
769 
770  InitSpecParBeforeFileReading(); // SpecPar = Special Parameters (dates, times, run types)
771 
772  //............... Filename parameter values
773  fFapAnaType = MyRootFile->GetAnalysisName();
774  fFapNbOfSamples = MyRootFile->GetNbOfSamples();
775  fFapRunNumber = MyRootFile->GetRunNumber();
778  fFapReqNbOfEvts = MyRootFile->GetReqNbOfEvts();
779  fFapStexNumber = MyRootFile->GetStexNumber();
780 
781  //............... parameter values from file contents
782  fStartDate = MyRootFile->GetStartDate();
783  fStopDate = MyRootFile->GetStopDate();
784  fRunType = MyRootFile->GetRunType();
785 
787 }
788 
789 //=============================================================================================
790 // Set general title
791 // Set lin or log scale on X or Y axis
792 // Set color palette
793 // Set start and stop date
794 // Set run type
795 //=============================================================================================
796 //............................................................................................
797 void TEcnaHistos::GeneralTitle(const TString& title)
798 {
799  fFlagGeneralTitle = title.Data();
800 }
801 void TEcnaHistos::SetHistoScaleX(const TString& option_scale)
802 {
803  fFlagScaleX = "LIN";
804  if ( option_scale == "LOG" ){fFlagScaleX = "LOG";}
805 }
806 void TEcnaHistos::SetHistoScaleY(const TString& option_scale)
807 {
808  fFlagScaleY = "LIN";
809  if ( option_scale == "LOG" ){fFlagScaleY = "LOG";}
810 }
811 void TEcnaHistos::SetHistoColorPalette (const TString& option_palette)
812 {
813  fFlagColPal = "Black/Red/Blue";
814  if ( !(option_palette == "Rainbow" || option_palette == "rainbow") ){fFlagColPal = "Black/Red/Blue";}
815  if ( option_palette == "Rainbow" || option_palette == "rainbow" ){fFlagColPal = "Rainbow";}
816 }
817 void TEcnaHistos::StartStopDate(const TString& start_date, const TString& stop_date)
818 {
819  fStartDate = start_date.Data();
820  fStopDate = stop_date.Data();
821 }
822 void TEcnaHistos::RunType(const TString& run_type)
823 {
824  fRunType = run_type.Data();
825 }
826 void TEcnaHistos::NumberOfEvents(const Int_t& nb_of_evts)
827 {
828  fFapNbOfEvts = nb_of_evts;
829 }
830 //====================== return status for root file and data existence
833 
834 //=======================================================================================
835 //
836 // ( R e a d A n d ) P l o t (1D , 2D , History)
837 //
838 //=======================================================================================
839 //---------------------------------------------------------------------------------------------
840 // TechHistoCode list modification (06/10/09)
841 //
842 // D = Detector Plot ChNb = Channel Number
843 // ChDs = Channel Distribution (Y projection)
844 //
845 // H = History Plot Date = date in format YYMMJJ hhmmss
846 // RuDs = Run distribution
847 //
848 // old code new code std code X std code Y (std = standard)
849 //
850 // * 1 H1NbOfEvtsGlobal D_NOE_ChNb Xtal NOE NOE = Number Of Events
851 // * 2 H1NbOfEvtsProj D_NOE_ChDs NOE NOX NOX = Number Of Xtals
852 // * 3 H1EvEvGlobal D_Ped_ChNb Xtal Ped Ped = Pedestal
853 // * 4 H1EvEvProj D_Ped_ChDs Ped NOX
854 // * 5 H1EvSigGlobal D_TNo_ChNb Xtal TNo TNo = Total Noise
855 // * 6 H1EvSigProj D_TNo_ChDs TNo NOX
856 // * 7 H1SigEvGlobal D_LFN_ChNb Xtal LFN LFN = Low Frequency noise
857 // * 8 H1SigEvProj D_LFN_ChDs LFN NOX
858 // * 9 H1SigSigGlobal D_HFN_ChNb Xtal HFN HFN = High Frequency noise
859 // * 10 H1SigSigProj D_HFN_ChDs HFN NOX
860 // * 11 H1EvCorssGlobal D_MCs_ChNb Xtal MCs MCs = Mean correlations between samples
861 // * 12 H1EvCorssProj D_MCs_ChDs MCs NOX
862 // * 13 H1SigCorssGlobal D_SCs_ChNb Xtal SCs SCs = Sigma of the correlations between samples
863 // * 14 H1SigCorssProj D_SCs_ChDs SCs NOX
864 // * 15 Ev D_MSp_SpNb Sample MSp MSp = Means of the samples
865 // * 16 EvProj D_MSp_SpDs MSp NOS NOS = Number of samples
866 // * 17 Sigma D_SSp_SpNb Sample SSp SSp = Sigmas of the samples
867 // * 18 SigmaProj D_SSp_SpDs SSp NOS
868 // * 19 SampTime D_Adc_EvNb Event Adc Adc = ADC count as a function of Event number
869 // * 20 AdcProj D_Adc_EvDs Adc NOE EvDs = Event distribution
870 // * 21 EvolEvEv H_Ped_Date Time Ped Time = date YY/MM/DD hh:mm:ss
871 // * 22 EvolEvEvProj H_Ped_RuDs Ped NOR NOR = Number Of Runs
872 // * 23 EvolEvSig H_TNo_Date Time TNo
873 // * 24 EvolEvSigProj H_TNo_RuDs TNo NOR
874 // * 25 EvolSigEv H_LFN_Date Time LFN
875 // * 26 EvolSigEvProj H_LFN_RuDs LFN NOR
876 // * 27 EvolSigSig H_HFN_Date Time HFN
877 // * 28 EvolSigSigProj H_HFN_RuDs HFN NOR
878 // * 29 EvolEvCorss H_MCs_Date Time MCs
879 // * 30 EvolEvCorssProj H_MCs_RuDs MCs NOR
880 // * 31 EvolSigCorss H_SCs_Date Time SCs
881 // * 32 EvolSigCorssProj H_SCs_RuDs SCs NOR
882 //
883 //---------------------------------------------------------------------------------------------
884 
885 //---------------------------------------------------------------------------------------
886 //
887 // (ReadAnd)PlotMatrix
888 //
889 //---------------------------------------------------------------------------------------
890 //................................ Corcc[for 1 Stex] (big matrix), Cortt[for 1 Stex]
891 void TEcnaHistos::PlotMatrix(const TMatrixD& read_matrix_corcc,
892  const TString& UserCorOrCov, const TString& UserBetweenWhat)
893 {PlotMatrix(read_matrix_corcc, UserCorOrCov, UserBetweenWhat, "");}
894 
895 void TEcnaHistos::PlotMatrix(const TMatrixD& read_matrix_corcc,
896  const TString& UserCorOrCov, const TString& UserBetweenWhat,
897  const TString& UserPlotOption)
898 {
899  TString CallingMethod = "2D";
900 
901  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
902 
903  TString BetweenWhat = fCnaParHistos->BuildStandardBetweenWhatCode(CallingMethod, UserBetweenWhat);
904  TString CorOrCov = fCnaParHistos->BuildStandardCovOrCorCode(CallingMethod, UserCorOrCov);
905 
906  if( BetweenWhat != "?" && CorOrCov != "?" )
907  {
908  if( BetweenWhat == "MttLF" || BetweenWhat == "MttHF" )
909  {
910  fAlreadyRead = 1;
911  ViewMatrix(read_matrix_corcc, fAlreadyRead,
912  fZerv, fZerv, fZerv, CorOrCov, BetweenWhat, StandardPlotOption);
913  }
914  if( BetweenWhat == "MccLF" ){StexHocoVecoLHFCorcc("LF");} // forced to Read file and Plot
915  if( BetweenWhat == "MccHF" ){StexHocoVecoLHFCorcc("HF");} // forced to Read file and Plot
916  }
917  else
918  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
919  std::cout << "!TEcnaHistos::PlotMatrix(...)> Histo cannot be reached." << fTTBELL << std::endl;}
920 }
921 
922 void TEcnaHistos::PlotMatrix(const TString& UserCorOrCov, const TString& UserBetweenWhat)
923 {PlotMatrix(UserCorOrCov, UserBetweenWhat, "");}
924 
925 void TEcnaHistos::PlotMatrix(const TString& UserCorOrCov, const TString& UserBetweenWhat,
926  const TString& UserPlotOption)
927 {
928  TString CallingMethod = "2D";
929 
930  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
931 
932  TString BetweenWhat = fCnaParHistos->BuildStandardBetweenWhatCode(CallingMethod, UserBetweenWhat);
933  TString CorOrCov = fCnaParHistos->BuildStandardCovOrCorCode(CallingMethod, UserCorOrCov);
934 
935  if( BetweenWhat != "?" && CorOrCov != "?" )
936  {
937  if( BetweenWhat == "MttLF" || BetweenWhat == "MttHF" )
938  {
940  fZerv, fZerv, fZerv, CorOrCov, BetweenWhat, StandardPlotOption);
941  }
942  if( BetweenWhat == "MccLF" ){StexHocoVecoLHFCorcc("LF");} // Plot only
943  if( BetweenWhat == "MccHF" ){StexHocoVecoLHFCorcc("HF");} // Plot only
944  }
945  else
946  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
947  std::cout << "!TEcnaHistos::PlotMatrix(...)> Histo cannot be reached." << fTTBELL << std::endl;}
948 }
949 
950 //....................................... Corcc for channels (cStexStin_A, cStexStin_B)
951 // Corss, Covss for one channel (-> i0StinEcha)
952 void TEcnaHistos::PlotMatrix(const TMatrixD& read_matrix,
953  const TString& UserCorOrCov, const TString& UserBetweenWhat,
954  const Int_t& arg_n1, const Int_t& arg_n2)
955 {PlotMatrix(read_matrix, UserCorOrCov, UserBetweenWhat, arg_n1, arg_n2, "");}
956 
957 void TEcnaHistos::PlotMatrix(const TMatrixD& read_matrix,
958  const TString& UserCorOrCov, const TString& UserBetweenWhat,
959  const Int_t& arg_n1, const Int_t& arg_n2,
960  const TString& UserPlotOption)
961 {
962  TString CallingMethod = "2D";
963 
964  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
965 
966  TString BetweenWhat = fCnaParHistos->BuildStandardBetweenWhatCode(CallingMethod, UserBetweenWhat);
967  TString CorOrCov = fCnaParHistos->BuildStandardCovOrCorCode(CallingMethod, UserCorOrCov);
968 
969  if( BetweenWhat != "?" && CorOrCov != "?" )
970  {
971  if( BetweenWhat == "MccLF" || BetweenWhat == "MccHF" )
972  {
973  Int_t cStexStin_A = arg_n1;
974  Int_t cStexStin_B = arg_n2;
975  fAlreadyRead = 1;
976  ViewMatrix(read_matrix, fAlreadyRead,
977  cStexStin_A, cStexStin_B, fZerv, CorOrCov, BetweenWhat, StandardPlotOption);
978  }
979 
980  if( BetweenWhat == "Mss" )
981  {
982  Int_t n1StexStin = arg_n1;
983  Int_t i0StinEcha = arg_n2;
984  if( fFlagSubDet == "EE" ){n1StexStin = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, arg_n1);}
985  fAlreadyRead = 1;
986  ViewMatrix(read_matrix, fAlreadyRead,
987  n1StexStin, fZerv, i0StinEcha, CorOrCov, BetweenWhat, StandardPlotOption);
988  }
989  }
990  else
991  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
992  std::cout << "!TEcnaHistos::PlotMatrix(...)> Histo cannot be reached." << fTTBELL << std::endl;}
993 }
994 
995 void TEcnaHistos::PlotMatrix(const TString& UserCorOrCov, const TString& UserBetweenWhat,
996  const Int_t& arg_n1, const Int_t& arg_n2)
997 {PlotMatrix(UserCorOrCov, UserBetweenWhat, arg_n1, arg_n2, "");}
998 
999 void TEcnaHistos::PlotMatrix(const TString& UserCorOrCov, const TString& UserBetweenWhat,
1000  const Int_t& arg_n1, const Int_t& arg_n2,
1001  const TString& UserPlotOption)
1002 {
1003  TString CallingMethod = "2D";
1004 
1005  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1006 
1007  TString StandardBetweenWhat = fCnaParHistos->BuildStandardBetweenWhatCode(CallingMethod, UserBetweenWhat);
1008  TString StandardCorOrCov = fCnaParHistos->BuildStandardCovOrCorCode(CallingMethod, UserCorOrCov);
1009 
1010  if( StandardBetweenWhat != "?" && StandardCorOrCov != "?" )
1011  {
1012  if( StandardBetweenWhat == "MccLF" || StandardBetweenWhat == "MccHF" )
1013  {
1014  Int_t cStexStin_A = arg_n1;
1015  Int_t cStexStin_B = arg_n2;
1017  cStexStin_A, cStexStin_B, fZerv, StandardCorOrCov, StandardBetweenWhat, StandardPlotOption);
1018  }
1019 
1020  if( StandardBetweenWhat == "Mss" )
1021  {
1022  Int_t n1StexStin = arg_n1;
1023  Int_t i0StinEcha = arg_n2;
1024  if( fFlagSubDet == "EE" ){n1StexStin = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, arg_n1);}
1025 
1027  n1StexStin, fZerv, i0StinEcha, StandardCorOrCov, StandardBetweenWhat, StandardPlotOption);
1028  }
1029  }
1030  else
1031  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1032  std::cout << "!TEcnaHistos::PlotMatrix(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1033 }
1034 
1035 //---------------------------------------------------------------------------------------
1036 //
1037 // (ReadAnd)PlotDetector
1038 //
1039 //---------------------------------------------------------------------------------------
1040 //.................................... 2D plots for Stex OR Stas
1041 void TEcnaHistos::PlotDetector(const TString& UserHistoCode, const TString& UserDetector)
1042 {
1043  TString CallingMethod = "2DS";
1044 
1045  TString StandardHistoCode = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, UserHistoCode);
1046  if( StandardHistoCode != "?" )
1047  {
1048  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(StandardHistoCode);
1049  TString StandardDetectorCode = fCnaParHistos->BuildStandardDetectorCode(UserDetector);
1050  if( StandardDetectorCode != "?" )
1051  {
1052  //if( StandardDetectorCode == "SM" || StandardDetectorCode == "EB" )
1053  // {fEcal->SetEcalSubDetector("EB");}
1054  //if( StandardDetectorCode == "Dee" || StandardDetectorCode == "EE" )
1055  // {fEcal->SetEcalSubDetector("EE");}
1056 
1057  if( StandardDetectorCode == "SM" || StandardDetectorCode == "Dee" )
1058  {ViewStex(fReadHistoDummy, fTobeRead, TechHistoCode);}
1059  if( StandardDetectorCode == "EB" || StandardDetectorCode == "EE" )
1060  {ViewStas(fReadHistoDummy, fTobeRead, TechHistoCode);}
1061  }
1062  else
1063  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1064  std::cout << "!TEcnaHistos::PlotDetector(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1065  }
1066  else
1067  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1068  std::cout << "!TEcnaHistos::PlotDetector(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1069 }
1070 
1071 void TEcnaHistos::PlotDetector(const TVectorD& read_histo, const TString& UserHistoCode, const TString& UserDetector)
1072 {
1073  TString CallingMethod = "2DS";
1074 
1075  TString StandardHistoCode = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, UserHistoCode);
1076  if( StandardHistoCode != "?" )
1077  {
1078  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(StandardHistoCode);
1079  TString StandardDetectorCode = fCnaParHistos->BuildStandardDetectorCode(UserDetector);
1080  if( StandardDetectorCode != "?" )
1081  {
1082  fAlreadyRead = 1;
1083 
1084  //if( StandardDetectorCode == "SM" || StandardDetectorCode == "EB" )
1085  // {fEcal->SetEcalSubDetector("EB");}
1086  //if( StandardDetectorCode == "Dee" || StandardDetectorCode == "EE" )
1087  // {fEcal->SetEcalSubDetector("EE");}
1088 
1089  if( StandardDetectorCode == "SM" || StandardDetectorCode == "Dee" )
1090  {ViewStex(read_histo, fAlreadyRead, TechHistoCode);}
1091  if( StandardDetectorCode == "EB" || StandardDetectorCode == "EE" )
1092  {ViewStas(read_histo, fAlreadyRead, TechHistoCode);}
1093  }
1094  else
1095  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1096  std::cout << "!TEcnaHistos::PlotDetector(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1097  }
1098  else
1099  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1100  std::cout << "!TEcnaHistos::PlotDetector(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1101 }
1102 
1103 //---------------------------------------------------------------------------------------
1104 //
1105 // (ReadAnd)Plot1DHisto
1106 //
1107 //---------------------------------------------------------------------------------------
1108 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1109  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1110  const TString& UserDetector)
1111 {Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, UserDetector, "");}
1112 
1113 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1114  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1115  const TString& UserDetector,
1116  const TString& UserPlotOption)
1117 {
1118  TString CallingMethod = "1D";
1119 
1120  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1121 
1122  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1123  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1124 
1125  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1126  {
1127  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1128  if( fAlreadyRead > 1 ){fAlreadyRead = 1;}
1129  TString StandardDetectorCode = fCnaParHistos->BuildStandardDetectorCode(UserDetector);
1130  if( StandardDetectorCode != "?" )
1131  {
1132  if( StandardDetectorCode == "EB" || StandardDetectorCode == "EE" ){fFapStexNumber = 0;}
1133  ViewHisto(InputHisto, fAlreadyRead, fZerv, fZerv, fZerv, TechHistoCode, StandardPlotOption);
1134  }
1135  else
1136  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1137  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1138  }
1139  else
1140  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1141  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1142 }
1143 
1144 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1145  const TString& UserDetector)
1146 {Plot1DHisto(User_X_Quantity, User_Y_Quantity, UserDetector, "");}
1147 
1148 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1149  const TString& UserDetector, const TString& UserPlotOption)
1150 {
1151  TString CallingMethod = "1D";
1152 
1153  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1154 
1155  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1156  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1157 
1158  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1159  {
1160  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1161  TString StandardDetectorCode = fCnaParHistos->BuildStandardDetectorCode(UserDetector);
1162  if( StandardDetectorCode != "?" )
1163  {
1164  if( StandardDetectorCode == "EB" || StandardDetectorCode == "EE" ){fFapStexNumber = 0;}
1165  ViewHisto(fReadHistoDummy, fTobeRead, fZerv, fZerv, fZerv, TechHistoCode, StandardPlotOption);
1166  }
1167  else
1168  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1169  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1170  }
1171  else
1172  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1173  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1174 }
1175 
1176 
1177 
1178 //=> BUG SCRAM? Si on enleve la methode ci-dessous, ca passe a la compilation de test/EcnaHistosExample2.cc
1179 // (qui appelle cette methode) et ca se plante a l'execution (voir test/TEcnaHistosExample2.cc).
1180 #define PLUD
1181 #ifdef PLUD
1182 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1183  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1184  const Int_t& n1StexStin)
1185 {Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, n1StexStin, "");}
1186 
1187 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1188  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1189  const Int_t& n1StexStin,
1190  const TString& UserPlotOption)
1191 {
1192  TString CallingMethod = "1DX";
1193  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1194  Int_t i0StinEcha = 0;
1195  Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, StandardPlotOption);
1196 }
1197 #endif // PLUD
1198 
1199 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1200  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1201  const Int_t& n1StexStin, const Int_t& i0StinEcha)
1202 {Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, "");}
1203 
1204 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1205  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1206  const Int_t& n1StexStin, const Int_t& i0StinEcha,
1207  const TString& UserPlotOption)
1208 {
1209  TString CallingMethod = "1D";
1210  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1211  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1212  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1213 
1214  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1215 
1216  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1217  {
1218  fAlreadyRead = 1;
1219  if( StandardPlotOption != fAllXtalsInStinPlot )
1220  {
1221  ViewHisto(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, fZerv, TechHistoCode, StandardPlotOption);
1222  }
1223 
1224  if( StandardPlotOption == fAllXtalsInStinPlot && fAlreadyRead >= 1 && fAlreadyRead <= fEcal->MaxCrysInStin() )
1225  {
1226  if( Standard_X_Quantity == "Smp" && Standard_Y_Quantity == "MSp" )
1227  {XtalSamplesEv(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1228  if( Standard_X_Quantity == "MSp" && Standard_Y_Quantity == "NOS" )
1229  {EvSamplesXtals(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1230  if( Standard_X_Quantity == "Smp" && Standard_Y_Quantity == "SSp" )
1231  {XtalSamplesSigma(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1232  if( Standard_X_Quantity == "SSp" && Standard_Y_Quantity == "NOS" )
1233  {SigmaSamplesXtals(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1234  }
1235  }
1236  else
1237  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1238  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1239 }
1240 
1241 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1242  const Int_t& n1StexStin, const Int_t& i0StinEcha)
1243 {Plot1DHisto(User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, "");}
1244 
1245 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1246  const Int_t& n1StexStin, const Int_t& i0StinEcha,
1247  const TString& UserPlotOption)
1248 {
1249  TString CallingMethod = "1D";
1250 
1251  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1252 
1253  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1254  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1255 
1256  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1257  {
1258  if( StandardPlotOption != fAllXtalsInStinPlot )
1259  {
1260  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1261  ViewHisto(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, fZerv, TechHistoCode, StandardPlotOption);
1262  }
1263  if( StandardPlotOption == fAllXtalsInStinPlot && fAlreadyRead >= 1 && fAlreadyRead <= fEcal->MaxCrysInStin() )
1264  {
1265  if( Standard_X_Quantity == "Smp" && Standard_Y_Quantity == "MSp" )
1266  {XtalSamplesEv(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1267  if( Standard_X_Quantity == "MSp" && Standard_Y_Quantity == "NOS" )
1268  {EvSamplesXtals(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1269  if( Standard_X_Quantity == "Smp" && Standard_Y_Quantity == "SSp" )
1270  {XtalSamplesSigma(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1271  if( Standard_X_Quantity == "SSp" && Standard_Y_Quantity == "NOS" )
1272  {SigmaSamplesXtals(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1273  }
1274  }
1275  else
1276  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1277  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1278 }
1279 
1280 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1281  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1282  const Int_t& n1StexStin, const Int_t& i0StinEcha, const Int_t& n1Sample)
1283 {Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, n1Sample, "");}
1284 
1285 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1286  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1287  const Int_t& n1StexStin, const Int_t& i0StinEcha, const Int_t& n1Sample,
1288  const TString& UserPlotOption)
1289 {
1290  TString CallingMethod = "1D";
1291 
1292  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1293 
1294  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1295  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1296 
1297  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1298 
1299  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1300  {
1301  Int_t i0Sample = n1Sample-1;
1302  fAlreadyRead = 1;
1303  ViewHisto(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, i0Sample, TechHistoCode, StandardPlotOption);
1304  }
1305  else
1306  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1307  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1308 }
1309 
1310 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1311  const Int_t& n1StexStin, const Int_t& i0StinEcha, const Int_t& n1Sample)
1312 {Plot1DHisto(User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, n1Sample, "");}
1313 
1314 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1315  const Int_t& n1StexStin, const Int_t& i0StinEcha, const Int_t& n1Sample,
1316  const TString& UserPlotOption)
1317 {
1318  TString CallingMethod = "1D";
1319 
1320  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1321 
1322  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1323  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1324 
1325  Int_t i0Sample = n1Sample-1;
1326 
1327  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1328  {
1329  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1330  ViewHisto(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, i0Sample, TechHistoCode, StandardPlotOption);
1331  }
1332  else
1333  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1334  std::cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1335 }
1336 
1337 //---------------------------------------------------------------------------------------
1338 //
1339 // (ReadAnd)PlotHistory
1340 //
1341 //---------------------------------------------------------------------------------------
1342 void TEcnaHistos::PlotHistory(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1343  const TString& list_of_run_file_name,
1344  const Int_t& StexStin_A, const Int_t& i0StinEcha)
1345 {PlotHistory(User_X_Quantity, User_Y_Quantity, list_of_run_file_name, StexStin_A, i0StinEcha, "");}
1346 
1347 void TEcnaHistos::PlotHistory(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1348  const TString& list_of_run_file_name,
1349  const Int_t& StexStin_A, const Int_t& i0StinEcha,
1350  const TString& UserPlotOption)
1351 {
1352  TString CallingMethod = "Time";
1353 
1354  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1355 
1356  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1357  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1358 
1359  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1360  {
1361  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1362  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, TechHistoCode, StandardPlotOption);
1363  }
1364  else
1365  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1366  std::cout << "!TEcnaHistos::PlotHistory(...)> Histo cannot be reached." << fTTBELL << std::endl;}
1367 }
1368 
1369 //=============================================================================================
1370 //
1371 // " V I E W " M E T H O D S
1372 //
1373 //=============================================================================================
1374 
1375 //=============================================================================================================
1376 //
1377 // ViewMatrix(***)
1378 //
1379 // arg_read_matrix: 2D array
1380 // arg_AlreadyRead: =1 <=> use arg_read_matrix
1381 // =0 <=> read the 2D array in this method with TEcnaRead
1382 // StexStin_A: tower number in SM (if EB) OR SC "ECNA" number in Dee (if EE)
1383 // StexStin_B: tower' number in SM (if EB) OR SC' "ECNA" number in Dee (if EE)
1384 // MatrixBinIndex: channel number in tower (if EB) OR in SC (if EE)
1385 // CorOrCov: flag CORRELATION/COVARIANCE
1386 // BetweenWhat: flag BETWEEN SAMPLES / BETWEEN CHANNELS / BETWEEN TOWERS / BETWEEN SCs / LF, HF, ...
1387 // PlotOption: ROOT 2D histos draw options (COLZ, LEGO, ...) + additional (ASCII)
1388 //
1389 // MatrixBinIndex: = i0StinEcha if cov(s,s'), cor(s,s')
1390 // = 0 if cov(c,c'), cor(c,c'), cov(Stin,Stin'), cor(Stin,Stin')
1391 //
1392 // ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, CorOrCov, BetweenWhat, PlotOption)
1393 // ViewMatrix(StexStin_A, 0, i0StinEcha, CorOrCov, "Mss", PlotOption)
1394 // Output:
1395 // Plot of cov(s,s') or cor(s,s') matrix for i0StinEcha of StexStin_A
1396 //
1397 // ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, CorOrCov, BetweenWhat, PlotOption)
1398 // ViewMatrix(StexStin_A, StexStin_B, 0, CorOrCov, "Mcc", PlotOption)
1399 // Output:
1400 // Plot LF-HF Corcc matrix for Stins: (StexStin_A, StexStin_B)
1401 //
1402 // ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, CorOrCov, BetweenWhat, PlotOption)
1403 // ViewMatrix( 0, 0, 0, CorOrCov, "Mcc", PlotOption)
1404 // Output:
1405 // Plot of LF-HF Corcc matrix for Stex (big matrix)
1406 //
1407 // ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, CorOrCov, BetweenWhat, PlotOption)
1408 // ViewMatrix( 0, 0, 0, CorOrCov, "Mtt", PlotOption)
1409 // Output:
1410 // Plot of LF-HF Cortt matrix
1411 //
1412 //=============================================================================================================
1413 void TEcnaHistos::ViewMatrix(const TMatrixD& arg_read_matrix, const Int_t& arg_AlreadyRead,
1414  const Int_t& StexStin_A, const Int_t& StexStin_B,
1415  const Int_t& MatrixBinIndex, const TString& CorOrCov,
1416  const TString& BetweenWhat, const TString& PlotOption)
1417 {
1418  //Plot correlation or covariance matrix between samples or channels or Stins
1419 
1420  if( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) )
1421  {
1422  Bool_t OKArray = kFALSE;
1423  Bool_t OKData = kFALSE;
1424  TVectorD vStin(fEcal->MaxStinEcnaInStex());
1425 
1426  if( arg_AlreadyRead == fTobeRead )
1427  {
1433  OKArray = fMyRootFile->LookAtRootFile();
1434  if( OKArray == kTRUE )
1435  {
1437  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
1438  // std::cout << "*TEcnaHistos::ViewMatrix(...)> Data are analyzed from file ----> "
1439  // << fp_name_short << std::endl;
1440  //...................................................................... (ViewMatrix)
1441  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vStin(i)=(Double_t)0.;}
1443 
1447 
1448  if( fMyRootFile->DataExist() == kTRUE ){OKData = kTRUE;}
1449  }
1450 
1451  }
1452  if( arg_AlreadyRead >= 1 )
1453  {
1454  OKArray = kTRUE;
1455  OKData = kTRUE;
1456  if( fFlagSubDet == "EB")
1457  {
1458  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vStin(i)=i;}
1459  }
1460  if( fFlagSubDet == "EE")
1461  {
1462  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++)
1463  {vStin(i)= fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i));}
1464  }
1465  }
1466 
1467  if ( OKArray == kTRUE ) // (ViewMatrix)
1468  {
1469  fStatusFileFound = kTRUE;
1470 
1471  if( OKData == kTRUE )
1472  {
1473  fStatusDataExist = kTRUE;
1474 
1475  Int_t Stin_X_ok = 0;
1476  Int_t Stin_Y_ok = 0;
1477 
1478  if( (BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins) )
1479  {Stin_X_ok = 1; Stin_Y_ok = 1;}
1480  if( BetweenWhat == fBetweenSamples )
1481  {Stin_Y_ok = 1;}
1482 
1483  for (Int_t index_Stin = 0; index_Stin < fEcal->MaxStinEcnaInStex(); index_Stin++)
1484  {
1485  if ( vStin(index_Stin) == StexStin_A ){Stin_X_ok = 1;}
1486  if ( vStin(index_Stin) == StexStin_B ){Stin_Y_ok = 1;}
1487  }
1488  //................................................................. (ViewMatrix)
1489  if( Stin_X_ok == 1 && Stin_Y_ok == 1 )
1490  {
1491  Int_t MatSize = -1;
1492  Int_t ReadMatSize = -1;
1493  Int_t i0StinEcha = -1;
1494 
1495  //-------------------------- Set values of ReadMatSize, MatSize, i0StinEcha
1496  if( BetweenWhat == fBetweenSamples )
1497  {ReadMatSize = fFapNbOfSamples; MatSize = fEcal->MaxSampADC(); i0StinEcha=(Int_t)MatrixBinIndex;}
1498 
1499  if( BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels )
1500  {ReadMatSize = fEcal->MaxCrysInStin(); MatSize = fEcal->MaxCrysInStin(); /*i0Sample=MatrixBinIndex;*/}
1501 
1502  if( (BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins) )
1503  {ReadMatSize = fEcal->MaxStinEcnaInStex(); MatSize = fEcal->MaxStinInStex();}
1504 
1505  //------------------------------------------------------------------------------------- (ViewMatrix)
1506  if( ( BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins ) ||
1507  ( BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels
1508  /* && (i0Sample >= 0) && (i0Sample < fFapNbOfSamples ) */ ) ||
1509  ( (BetweenWhat == fBetweenSamples) && (i0StinEcha >= 0) && (i0StinEcha < fEcal->MaxCrysInStin()) ) )
1510  {
1511  TMatrixD read_matrix(ReadMatSize, ReadMatSize);
1512  for(Int_t i=0; i-ReadMatSize<0; i++)
1513  {for(Int_t j=0; j-ReadMatSize<0; j++){read_matrix(i,j)=(Double_t)0.;}}
1514 
1515  Bool_t OKData = kFALSE;
1516  if( arg_AlreadyRead == fTobeRead )
1517  {
1518  if( BetweenWhat == fBetweenSamples && CorOrCov == fCovarianceMatrix )
1519  {read_matrix =
1520  fMyRootFile->ReadCovariancesBetweenSamples(StexStin_A, i0StinEcha, ReadMatSize);}
1521 
1522  if( BetweenWhat == fBetweenSamples && CorOrCov == fCorrelationMatrix )
1523  {read_matrix =
1524  fMyRootFile->ReadCorrelationsBetweenSamples(StexStin_A, i0StinEcha, ReadMatSize);}
1525 
1526  if( BetweenWhat == fLFBetweenChannels && CorOrCov == fCovarianceMatrix )
1527  {read_matrix =
1528  fMyRootFile->ReadLowFrequencyCovariancesBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);}
1529 
1530  if( BetweenWhat == fLFBetweenChannels && CorOrCov == fCorrelationMatrix )
1531  {read_matrix =
1532  fMyRootFile->ReadLowFrequencyCorrelationsBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);}
1533 
1534  if( BetweenWhat == fHFBetweenChannels && CorOrCov == fCovarianceMatrix )
1535  {read_matrix =
1536  fMyRootFile->ReadHighFrequencyCovariancesBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);}
1537 
1538  if( BetweenWhat == fHFBetweenChannels && CorOrCov == fCorrelationMatrix )
1539  {read_matrix =
1540  fMyRootFile->ReadHighFrequencyCorrelationsBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);}
1541 
1542  if( BetweenWhat == fLFBetweenStins && CorOrCov == fCorrelationMatrix )
1543  {read_matrix =
1545 
1546  if( BetweenWhat == fHFBetweenStins && CorOrCov == fCorrelationMatrix )
1547  {read_matrix =
1549  }
1550 
1551  OKData = fMyRootFile->DataExist();
1552  }
1553  else
1554  {
1555  read_matrix = arg_read_matrix;
1556  OKData = kTRUE;
1557  }
1558  //.......................................................... (ViewMatrix)
1559  if( OKData == kTRUE )
1560  {
1561  fStatusDataExist = kTRUE;
1562 
1563  if( PlotOption == "ASCII" )
1564  {
1565  WriteMatrixAscii(BetweenWhat, CorOrCov,
1566  StexStin_A, MatrixBinIndex, ReadMatSize, read_matrix);
1567  }
1568  else
1569  {
1570  //......................... matrix title (ViewMatrix)
1571  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
1572 
1573  if( BetweenWhat == fBetweenSamples && CorOrCov == fCovarianceMatrix )
1574  {sprintf(f_in_mat_tit, "Covariance(Sample, Sample')");}
1575  if( BetweenWhat == fBetweenSamples && CorOrCov == fCorrelationMatrix )
1576  {sprintf(f_in_mat_tit, "Correlation(Sample, Sample')");}
1577 
1578  if(fFlagSubDet == "EB" )
1579  {
1580  if( BetweenWhat == fLFBetweenStins && CorOrCov == fCorrelationMatrix )
1581  {sprintf(f_in_mat_tit,
1582  "Mean LF |Cor(Xtal,Xtal')| for each (Tower,Tower')");}
1583  if( BetweenWhat == fHFBetweenStins && CorOrCov == fCorrelationMatrix )
1584  {sprintf(f_in_mat_tit,
1585  "Mean HF |Cor(Xtal,Xtal')| for each (Tower,Tower')");}
1586  }
1587  if(fFlagSubDet == "EE" )
1588  {
1589  if( BetweenWhat == fLFBetweenStins && CorOrCov == fCorrelationMatrix )
1590  {sprintf(f_in_mat_tit,
1591  "Mean LF |Cor(Xtal,Xtal')| for each (SC,SC')");}
1592  if( BetweenWhat == fHFBetweenStins && CorOrCov == fCorrelationMatrix )
1593  {sprintf(f_in_mat_tit,
1594  "Mean HF |Cor(Xtal,Xtal')| for each (SC,SC')");}
1595  }
1596 
1597  if( BetweenWhat == fLFBetweenChannels && CorOrCov == fCorrelationMatrix )
1598  {
1599  if( fFlagSubDet == "EB" )
1600  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') matrix elts for (Tow,Tow')");}
1601  if( fFlagSubDet == "EE" )
1602  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') matrix elts for (SC,SC')");}
1603  }
1604  if( BetweenWhat == fHFBetweenChannels && CorOrCov == fCorrelationMatrix )
1605  {
1606  if( fFlagSubDet == "EB" )
1607  {sprintf(f_in_mat_tit, "HF Cor(Xtal,Xtal') matrix elts for (Tow,Tow')");}
1608  if( fFlagSubDet == "EE" )
1609  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') matrix elts for (SC,SC')");}
1610  }
1611 
1612  //................................. Axis parameters (ViewMatrix)
1613  TString axis_x_var_name;
1614  TString axis_y_var_name;
1615 
1616  char* f_in_axis_x = new char[fgMaxCar]; fCnew++;
1617  char* f_in_axis_y = new char[fgMaxCar]; fCnew++;
1618 
1619  if( BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins )
1620  {
1621  if( fFlagSubDet == "EB" )
1622  {sprintf(f_in_axis_x, " %s number ", fFapStinName.Data());}
1623  if( fFlagSubDet == "EE" )
1624  {sprintf(f_in_axis_x, " %s number for construction ", fFapStinName.Data());}
1625 
1626  axis_x_var_name = f_in_axis_x; axis_y_var_name = f_in_axis_x;
1627  }
1628  if( BetweenWhat == fBetweenSamples)
1629  {
1630  axis_x_var_name = " Sample "; axis_y_var_name = " Sample ";
1631  }
1632  if( BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels ){
1633  sprintf(f_in_axis_x, " Crystal %s %d ", fFapStinName.Data(), StexStin_A);
1634  sprintf(f_in_axis_y, " Crystal %s %d ", fFapStinName.Data(),StexStin_B);
1635  axis_x_var_name = f_in_axis_x; axis_y_var_name = f_in_axis_y;}
1636 
1637  Int_t nb_binx = MatSize;
1638  Int_t nb_biny = MatSize;
1639  Axis_t xinf_bid = (Axis_t)0.;
1640  Axis_t xsup_bid = (Axis_t)MatSize;
1641  Axis_t yinf_bid = (Axis_t)0.;
1642  Axis_t ysup_bid = (Axis_t)MatSize;
1643 
1644  if( (fFlagSubDet == "EE") &&
1645  (BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins) )
1646  {
1647  if( fFapStexNumber == 1 || fFapStexNumber == 3 )
1648  {
1649  xinf_bid += fEcal->MaxStinInStex();
1650  xsup_bid += fEcal->MaxStinInStex();
1651  yinf_bid += fEcal->MaxStinInStex();
1652  ysup_bid += fEcal->MaxStinInStex();
1653  }
1654  }
1655  //................................................... histogram booking (ViewMatrix)
1656  TH2D* h_fbid0 = new TH2D("bidim", f_in_mat_tit,
1657  nb_binx, xinf_bid, xsup_bid,
1658  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
1659  h_fbid0->Reset();
1660 
1661  h_fbid0->GetXaxis()->SetTitle(axis_x_var_name);
1662  h_fbid0->GetYaxis()->SetTitle(axis_y_var_name);
1663 
1664  //------------------------------------------------ F I L L H I S T O (ViewMatrix)
1665  if( (fFlagSubDet == "EE") &&
1666  (BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins) )
1667  {
1668  for(Int_t i = 0 ; i < ReadMatSize ; i++)
1669  {
1670  for(Int_t j = 0 ; j < ReadMatSize ; j++)
1671  {
1672  Int_t ip = i+1;
1673  Double_t xi_bid =
1675  Int_t jp = j+1;
1676  Double_t xj_bid =
1678  if( xi_bid > 0 && xj_bid > 0 )
1679  {
1680  Int_t xi_bid_m = xi_bid-1;
1681  Int_t xj_bid_m = xj_bid-1;
1682  h_fbid0->Fill(xi_bid_m, xj_bid_m, read_matrix(i,j));
1683  }
1684  }
1685  }
1686  }
1687  else
1688  {
1689  for(Int_t i = 0 ; i - ReadMatSize < 0 ; i++)
1690  {
1691  Double_t xi = (Double_t)i;
1692  for(Int_t j = 0 ; j < ReadMatSize ; j++)
1693  {
1694  Double_t xj = (Double_t)j;
1695  Double_t mat_val = (Double_t)read_matrix(i,j);
1696  h_fbid0->Fill(xi, xj, (Double_t)mat_val);
1697  }
1698  }
1699  }
1700  //--------------- H I S T O M I N / M A X M A N A G E M E N T (ViewMatrix)
1701 
1702  //................................ Put histo min max values
1703  TString quantity_code = "D_MCs_ChNb";
1704  if ( CorOrCov == fCorrelationMatrix )
1705  {
1706  if( BetweenWhat == fBetweenSamples ){quantity_code = "D_MCs_ChNb";}
1707 
1708  if( BetweenWhat == fLFBetweenChannels ){quantity_code = "H2LFccMosMatrix";}
1709  if( BetweenWhat == fHFBetweenChannels ){quantity_code = "H2HFccMosMatrix";}
1710 
1711  if( BetweenWhat == fLFBetweenStins ){quantity_code = "H2LFccMosMatrix";}
1712  if( BetweenWhat == fHFBetweenStins ){quantity_code = "H2HFccMosMatrix";}
1713  }
1714  if( CorOrCov == fCovarianceMatrix ){quantity_code = "H2HFccMosMatrix";}
1715  //.......... default if flag not set to "ON"
1716  SetYminMemoFromValue(quantity_code, fCnaParHistos->GetYminDefaultValue(quantity_code));
1717  SetYmaxMemoFromValue(quantity_code, fCnaParHistos->GetYmaxDefaultValue(quantity_code));
1718 
1719  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
1720  //................................. User's min and/or max (ViewMatrix)
1721  if( fFlagUserHistoMin == "ON" )
1722  {SetYminMemoFromValue(quantity_code, fUserHistoMin); fFlagUserHistoMin = "OFF";}
1723  if( fFlagUserHistoMax == "ON" )
1724  {SetYmaxMemoFromValue(quantity_code, fUserHistoMax); fFlagUserHistoMax = "OFF";}
1725  //................................. automatic min and/or max
1726  if( fFlagUserHistoMin == "AUTO" )
1727  {SetYminMemoFromValue(quantity_code, h_fbid0->GetMinimum()); fFlagUserHistoMin = "OFF";}
1728  if( fFlagUserHistoMax == "AUTO" )
1729  {SetYmaxMemoFromValue(quantity_code, h_fbid0->GetMaximum()); fFlagUserHistoMax = "OFF";}
1730  //...................................... histo set ymin and ymax (ViewMatrix)
1731  if( CorOrCov == fCorrelationMatrix )
1732  {
1733  if(BetweenWhat == fBetweenSamples)
1734  {SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "D_MCs_ChNb");}
1735  if( BetweenWhat == fLFBetweenStins || BetweenWhat == fLFBetweenChannels )
1736  {SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "H2LFccMosMatrix");}
1737  if( BetweenWhat == fHFBetweenStins || BetweenWhat == fHFBetweenChannels )
1738  {SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "H2HFccMosMatrix");}
1739  //************************** A GARDER EN RESERVE ******************************
1740  //............. special contour level for correlations (square root wise scale)
1741  // Int_t nb_niv = 9;
1742  // Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
1743  // SqrtContourLevels(nb_niv, &cont_niv[0]);
1744  // h_fbid0->SetContour(nb_niv, &cont_niv[0]);
1745  // delete [] cont_niv; fCdelete++;
1746  //******************************** (FIN RESERVE) ******************************
1747  }
1748  if( CorOrCov == fCovarianceMatrix )
1749  {
1750  if (BetweenWhat == fBetweenSamples)
1751  {SetYminMemoFromPreviousMemo("D_TNo_ChNb"); // covariance => same level as sigmas
1752  SetYmaxMemoFromPreviousMemo("D_TNo_ChNb");
1753  SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "D_TNo_ChNb");}
1754  if ( BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins ||
1755  BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels )
1756  {SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "H2HFccMosMatrix");}
1757  }
1758 
1759  // ----------------------------------------------- P L O T S (ViewMatrix)
1760  char* f_in = new char[fgMaxCar]; fCnew++;
1761  //...................... Taille/format canvas
1762  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
1763  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
1764 
1765  //............................. options generales
1766  TString HistoType;
1767  Int_t MaxCar = fgMaxCar;
1768  HistoType.Resize(MaxCar);
1769  HistoType = "(no quantity type info)";
1770 
1771  if (PlotOption == "COLZ" ){HistoType = "colz";}
1772  if (PlotOption == "BOX" ){HistoType = "colz";}
1773  if (PlotOption == "TEXT" ){HistoType = "colz";}
1774  if (PlotOption == "CONTZ" ){HistoType = "colz";}
1775  if (PlotOption == "LEGO2Z"){HistoType = "lego";}
1776  if (PlotOption == "SURF1Z"){HistoType = "surf";}
1777  if (PlotOption == "SURF2Z"){HistoType = "surf";}
1778  if (PlotOption == "SURF3Z"){HistoType = "surf";}
1779  if (PlotOption == "SURF4" ){HistoType = "surf";}
1780 
1781  if( fFlagSubDet == "EB" )
1782  {
1784  SetAllPavesViewMatrix(BetweenWhat.Data(), StexStin_A, StexStin_B, i0StinEcha);
1785  }
1786  if( fFlagSubDet == "EE" )
1787  {
1790  SetAllPavesViewMatrix(BetweenWhat.Data(), StexStin_A, StexStin_B, i0StinEcha);
1791  }
1792 
1793  //---------------------------------------- Canvas name (ViewMatrix)
1794  TString name_cov_cor;
1795  MaxCar = fgMaxCar;
1796  name_cov_cor.Resize(MaxCar);
1797  name_cov_cor = "?";
1798  if( CorOrCov == fCovarianceMatrix){name_cov_cor = "Covariance";}
1799  if( CorOrCov == fCorrelationMatrix){name_cov_cor = "Correlation";}
1800 
1801  TString name_chan_samp;
1802  MaxCar = fgMaxCar;
1803  name_chan_samp.Resize(MaxCar);
1804  name_chan_samp = "?";
1805 
1806  if( BetweenWhat == fLFBetweenStins ){name_chan_samp = "LFccMos";}
1807  if( BetweenWhat == fHFBetweenStins ){name_chan_samp = "HFccMos"; }
1808 
1809  if( BetweenWhat == fLFBetweenChannels ){name_chan_samp = "LF_cc";}
1810  if( BetweenWhat == fHFBetweenChannels ){name_chan_samp = "HF_cc";}
1811 
1812  if(BetweenWhat == fBetweenSamples)
1813  {
1814  name_chan_samp = "Between_Samples"; // MatrixBinIndex = i0StinEcha
1815  }
1816 
1817  TString name_visu;
1818  MaxCar = fgMaxCar;
1819  name_visu.Resize(MaxCar);
1820  name_visu = "?";
1821 
1822  name_visu = PlotOption;
1823 
1824  if( (BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins) ){
1825  sprintf(f_in, "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%s",
1826  name_cov_cor.Data(), name_chan_samp.Data(),
1829  fFapStexName.Data(), fFapStexNumber,
1830  name_visu.Data());}
1831 
1832  if( BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels ){
1833  sprintf(f_in, "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%sX%d_%sY%d_%s",
1834  name_cov_cor.Data(), name_chan_samp.Data(),
1837  fFapStexName.Data(), fFapStexNumber,
1838  fFapStexName.Data(), StexStin_A, fFapStexName.Data(), StexStin_B,
1839  name_visu.Data());}
1840 
1841  if( BetweenWhat == fBetweenSamples ){
1842  sprintf(f_in, "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%sX%d_%sY%d_ElecChannel_%d_%s",
1843  name_cov_cor.Data(), name_chan_samp.Data(),
1846  fFapStexName.Data(), fFapStexNumber,
1847  fFapStexName.Data(), StexStin_A, fFapStexName.Data(), StexStin_B,
1848  MatrixBinIndex,
1849  name_visu.Data());}
1850 
1851  //---------------------------------------------------------- (ViewMatrix)
1852 
1853  SetHistoPresentation((TH1D*)h_fbid0, HistoType);
1854  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w , canv_h); fCnewRoot++;
1855  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
1856 
1857  // std::cout << "*TEcnaHistos::ViewMatrix(...)> Plot is displayed on canvas ----> "
1858  // << fCurrentCanvasName << std::endl;
1859  // std::cout << "*TEcnaHistos::ViewMatrix(...)> fCurrentCanvas = " << fCurrentCanvas << std::endl;
1860 
1861  delete [] f_in; f_in = nullptr; fCdelete++;
1862 
1863  if( fPavComGeneralTitle != nullptr ){fPavComGeneralTitle->Draw();}
1864  fPavComStex->Draw();
1865 
1866  if(BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels)
1867  {fPavComStin->Draw();}
1868  if(BetweenWhat == fBetweenSamples)
1869  {fPavComStin->Draw(); fPavComXtal->Draw();}
1870 
1871  fPavComAnaRun->Draw();
1872  fPavComNbOfEvts->Draw();
1873 
1874  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
1875  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
1876  MainCanvas->Divide(1, 1, x_margin, y_margin);
1877  gPad->cd(1);
1878 
1879  //---------------------------------------------------------- (ViewMatrix)
1880  Int_t logy = 0;
1881  gPad->SetLogy(logy);
1882  if( (BetweenWhat == fLFBetweenStins) ||
1883  (BetweenWhat == fHFBetweenStins) ){gPad->SetGrid(1,1);}
1884  h_fbid0->DrawCopy(PlotOption);
1885  h_fbid0->SetStats(true);
1886  gPad->Update();
1887  h_fbid0->Delete(); h_fbid0 = nullptr; fCdeleteRoot++;
1888 
1889  //MainCanvas->Delete(); fCdeleteRoot++;
1890  delete [] f_in_axis_x; f_in_axis_x = nullptr; fCdelete++;
1891  delete [] f_in_axis_y; f_in_axis_y = nullptr; fCdelete++;
1892  delete [] f_in_mat_tit; f_in_mat_tit = nullptr; fCdelete++;
1893  }
1894  } // end of if ( OKData == kTRUE )
1895  else
1896  {
1897  fStatusDataExist = kFALSE;
1898  }
1899  } // end of if ((BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins) ) ||
1900  //( (BetweenWhat == fBetweenSamples) && (i0StinEcha>= 0) && (i0StinEcha<fEcal->MaxCrysInStin())) ||
1901  //( (BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels)
1902  // /* && (i0Sample >= 0) && (i0Sample < fFapNbOfSamples ) */ ) )
1903  else
1904  {
1905  if(BetweenWhat == fBetweenSamples)
1906  {
1907  std::cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* ==> Wrong channel number in "
1908  << fFapStinName.Data() << ". Value = "
1909  << i0StinEcha << " (required range: [0, "
1910  << fEcal->MaxCrysInStin()-1 << "] )"
1911  << fTTBELL << std::endl;
1912  }
1913 
1914  // if( BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels )
1915  // {
1916  // std::cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* ==> Wrong sample index. Value = "
1917  // << i0Sample << " (required range: [0, "
1918  // << fFapNbOfSamples-1 << "] )"
1919  // << fTTBELL << std::endl;
1920  //}
1921  }
1922  }
1923  else // else of the if ( Stin_X_ok ==1 && Stin_Y_ok ==1 )
1924  {
1925  //---------------------------------------------------------- (ViewMatrix)
1926  if ( Stin_X_ok != 1 )
1927  {
1928  if( fFlagSubDet == "EB")
1929  {
1930  std::cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
1931  << fFapStinName.Data() << " "
1932  << StexStin_A << ", "
1933  << fFapStinName.Data() << " not found. Available numbers = ";
1934  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
1935  {
1936  if( vStin(i) > 0 )
1937  {
1938  std::cout << vStin(i) << ", ";
1939  }
1940  }
1941  }
1942 
1943  if( fFlagSubDet == "EE")
1944  {
1945  std::cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
1946  << fFapStinName.Data() << " "
1948  << fFapStinName.Data() << " not found. Available numbers = ";
1949  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
1950  {
1951  if( vStin(i) > 0 )
1952  {
1954  }
1955  }
1956  }
1957  std::cout << fTTBELL << std::endl;
1958  }
1959  if ( Stin_Y_ok != 1 )
1960  {
1961 
1962  if( fFlagSubDet == "EB")
1963  {
1964  std::cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
1965  << fFapStinName.Data() << " "
1966  << StexStin_B << ", "
1967  << fFapStinName.Data() << " not found. Available numbers = ";
1968  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
1969  {
1970  if( vStin(i) > 0 )
1971  {
1972  std::cout << vStin(i) << ", ";
1973  }
1974  }
1975  }
1976 
1977  if( fFlagSubDet == "EE")
1978  {
1979  std::cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
1980  << fFapStinName.Data() << " "
1982  << fFapStinName.Data() << " not found. Available numbers = ";
1983  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
1984  {
1985  if( vStin(i) > 0 )
1986  {
1988  }
1989  }
1990  }
1991  std::cout << fTTBELL << std::endl;
1992  }
1993  }
1994  } // end of if ( fMyRootFile->DataExist() == kTRUE )
1995  else
1996  {
1997  fStatusDataExist = kFALSE;
1998  std::cout << "!TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
1999  << " Histo not available." << fTTBELL << std::endl;
2000  fFlagUserHistoMin = "OFF";
2001  fFlagUserHistoMax = "OFF";
2002  }
2003  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
2004  else
2005  {
2006  fStatusFileFound = kFALSE;
2007  std::cout << "!TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
2008  << " ROOT file not found" << fTTBELL << std::endl;
2009  }
2010  } // ---- end of if( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) ) -----
2011  else
2012  {
2013  std::cout << "!TEcnaHistos::ViewMatrix(...)> " << fFapStexName.Data()
2014  << " = " << fFapStexNumber << ". Out of range (range = [1,"
2015  << fEcal->MaxStexInStas() << "]) " << fTTBELL << std::endl;
2016  }
2017 } // end of ViewMatrix(...)
2018 
2019 //==========================================================================
2020 //
2021 // ViewStin ( => option COLZ )
2022 //
2023 //==========================================================================
2024 
2025 void TEcnaHistos::CorrelationsBetweenSamples(const Int_t& StinNumber)
2026 {
2027  TString CorOrCov = fCorrelationMatrix;
2028  ViewStin(StinNumber, CorOrCov);
2029 }
2030 
2031 void TEcnaHistos::CovariancesBetweenSamples(const Int_t& StinNumber)
2032 {
2033  TString CorOrCov = fCovarianceMatrix;
2034  ViewStin(StinNumber, CorOrCov);
2035 }
2036 
2037 //==========================================================================
2038 //
2039 // ViewStin ( => option COLZ )
2040 //
2041 // StexStin ==>
2042 // (sample,sample) cor or cov matrices for all the crystal of StexStin
2043 //
2044 //
2045 //==========================================================================
2046 void TEcnaHistos::ViewStin(const Int_t& cStexStin, const TString& CorOrCov)
2047 {
2048  //cor(s,s') or cov(s,s') matrices for all the crystals of one given Stin. Option COLZ mandatory.
2049 
2050  // cStexStin = number for cons (in case of EE)
2051  // StexStin = ECNA number
2052 
2053  if( (fFapStexNumber > 0) && fFapStexNumber <= fEcal->MaxStexInStas() )
2054  {
2055  Int_t StexStin = cStexStin;
2056  if(fFlagSubDet == "EE" )
2057  {StexStin = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, cStexStin);}
2058 
2064 
2065  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewStin)
2066  {
2067  fStatusFileFound = kTRUE;
2068 
2070  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
2071  // std::cout << "*TEcnaHistos::ViewStin(...)> Data are analyzed from file ----> "
2072  // << fp_name_short << std::endl;
2073 
2074  TVectorD vStin(fEcal->MaxStinEcnaInStex());
2075  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vStin(i)=(Double_t)0.;}
2077 
2078  if ( fMyRootFile->DataExist() == kTRUE )
2079  {
2080  fStatusDataExist = kTRUE;
2081 
2082  Int_t Stin_ok = 0;
2083  for (Int_t index_Stin = 0; index_Stin < fEcal->MaxStinEcnaInStex(); index_Stin++)
2084  {
2085  if ( vStin(index_Stin) == StexStin ){Stin_ok++;}
2086  }
2087 
2088  if( Stin_ok == 1)
2089  {
2093 
2094  //......................... matrix title (ViewStin)
2095  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
2096 
2097  if ( CorOrCov == fCovarianceMatrix )
2098  {sprintf(f_in_mat_tit, "Xtal's Cov(s,s') matrices in %s.",
2099  fFapStinName.Data());}
2100  if ( CorOrCov == fCorrelationMatrix )
2101  {sprintf(f_in_mat_tit, "Xtal's Cor(s,s') matrices in %s.",
2102  fFapStinName.Data());}
2103 
2104  //................................. Bidim parameters
2105  Int_t GeoBidSize = fEcal->MaxSampADC()*fEcal->MaxCrysHocoInStin();
2106  Int_t nb_binx = GeoBidSize;
2107  Int_t nb_biny = GeoBidSize;
2108  Axis_t xinf_bid = (Axis_t)0.;
2109  Axis_t xsup_bid = (Axis_t)GeoBidSize;
2110  Axis_t yinf_bid = (Axis_t)0.;
2111  Axis_t ysup_bid = (Axis_t)GeoBidSize;
2112 
2113  //--------------------------------------------------------- (ViewStin)
2114  //............. matrices reading and histogram filling
2115 
2116  TH2D* h_geo_bid = new TH2D("geobidim_ViewStin", f_in_mat_tit,
2117  nb_binx, xinf_bid, xsup_bid,
2118  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
2119 
2120  h_geo_bid->Reset();
2121 
2122  //======================================================== (ViewStin)
2123 
2124  //----------------------------------------------- Geographical bidim filling
2125  Int_t ReadMatSize = fFapNbOfSamples;
2126  Int_t MatSize = fEcal->MaxSampADC();
2127  TMatrixD read_matrix(ReadMatSize, ReadMatSize);
2128  for(Int_t i=0; i-ReadMatSize < 0; i++){for(Int_t j=0; j-ReadMatSize < 0; j++)
2129  {read_matrix(i,j)=(Double_t)0.;}}
2130 
2131  Int_t i_data_exist = 0;
2132 
2133  for(Int_t n_crys = 0; n_crys < fEcal->MaxCrysInStin(); n_crys++)
2134  {
2135  if( CorOrCov == fCovarianceMatrix )
2136  {read_matrix = fMyRootFile->ReadCovariancesBetweenSamples(StexStin, n_crys, ReadMatSize);}
2137  if ( CorOrCov == fCorrelationMatrix )
2138  {read_matrix = fMyRootFile->ReadCorrelationsBetweenSamples(StexStin, n_crys, ReadMatSize);}
2139 
2140  if( fMyRootFile->DataExist() == kFALSE )
2141  {
2142  fStatusDataExist = kFALSE;
2143  break; // <= if no data: exiting loop over the channels
2144  }
2145  else
2146  {
2147  fStatusDataExist = kTRUE;
2148  i_data_exist++;
2149 
2150  for(Int_t i_samp = 0 ; i_samp < ReadMatSize ; i_samp++)
2151  {
2152  Int_t i_xgeo = GetXSampInStin(fFapStexNumber, StexStin, n_crys, i_samp);
2153  for(Int_t j_samp = 0; j_samp < ReadMatSize ; j_samp++)
2154  {
2155  Int_t j_ygeo = GetYSampInStin(fFapStexNumber,
2156  StexStin, n_crys, j_samp);
2157  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)j_ygeo,
2158  (Double_t)read_matrix(i_samp, j_samp));
2159  }
2160  }
2161  }
2162  }
2163 
2164  //=========== H I S T O M I N / M A X M A N A G E M E N T ======== (ViewStin)
2165  //................................ Put histo min max values
2166  TString quantity_code = "D_MCs_ChNb";
2167  if( CorOrCov == fCorrelationMatrix ){quantity_code = "D_MCs_ChNb";}
2168  if( CorOrCov == fCovarianceMatrix ){quantity_code = "H2HFccMosMatrix";}
2169 
2170  //.......... default if flag not set to "ON"
2171  SetYminMemoFromValue(quantity_code, fCnaParHistos->GetYminDefaultValue(quantity_code));
2172  SetYmaxMemoFromValue(quantity_code, fCnaParHistos->GetYmaxDefaultValue(quantity_code));
2173 
2174  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
2175  //.......... user's min and/or max values
2176  if( fFlagUserHistoMin == "ON" )
2177  {SetYminMemoFromValue(quantity_code, fUserHistoMin); fFlagUserHistoMin = "OFF";}
2178  if( fFlagUserHistoMax == "ON" )
2179  {SetYmaxMemoFromValue(quantity_code, fUserHistoMax); fFlagUserHistoMax = "OFF";}
2180  //................................. automatic min and/or max
2181  if( fFlagUserHistoMin == "AUTO" )
2182  {SetYminMemoFromValue(quantity_code, h_geo_bid->GetMinimum()); fFlagUserHistoMin = "OFF";}
2183  if( fFlagUserHistoMax == "AUTO" )
2184  {SetYmaxMemoFromValue(quantity_code, h_geo_bid->GetMaximum()); fFlagUserHistoMax = "OFF";}
2185  //...................................... histo set ymin and ymax (ViewStin)
2186  if ( CorOrCov == fCorrelationMatrix )
2187  {SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, "D_MCs_ChNb");
2188 
2189  // ************************** A GARDER EN RESERVE *******************************
2190  //............. special contour level for correlations (square root wise scale)
2191  //Int_t nb_niv = 9;
2192  //Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
2193  //SqrtContourLevels(nb_niv, &cont_niv[0]);
2194  //h_geo_bid->SetContour(nb_niv, &cont_niv[0]);
2195  //delete [] cont_niv; fCdelete++;
2196  // ******************************** (FIN RESERVE) *******************************
2197  }
2198  if ( CorOrCov == fCovarianceMatrix )
2199  {SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, "D_TNo_ChNb");}
2200 
2201  // =================================== P L O T S ======================== (ViewStin)
2202  if( i_data_exist > 0 )
2203  {
2204  char* f_in = new char[fgMaxCar]; fCnew++;
2205 
2206  //...................... Taille/format canvas
2207  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
2208  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
2209 
2210  //.................................................. paves commentaires (ViewStin)
2211  SetAllPavesViewStin(StexStin);
2212 
2213  //------------------------------------ Canvas name ----------------- (ViewStin)
2214  TString name_cov_cor;
2215  Int_t MaxCar = fgMaxCar;
2216  name_cov_cor.Resize(MaxCar);
2217  name_cov_cor = "?";
2218  if( CorOrCov == fCovarianceMatrix ){name_cov_cor = "CovSS_Matrices_in_";}
2219  if( CorOrCov == fCorrelationMatrix){name_cov_cor = "CorSS_Matrices_in_";}
2220 
2221  TString name_visu;
2222  MaxCar = fgMaxCar;
2223  name_visu.Resize(MaxCar);
2224  name_visu = "colz";
2225 
2226  sprintf(f_in, "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%s%d_%s",
2227  name_cov_cor.Data(), fFapStinName.Data(),
2230  fFapStexName.Data(), fFapStexNumber,
2231  fFapStinName.Data(), StexStin, name_visu.Data());
2232 
2233  SetHistoPresentation((TH1D*)h_geo_bid, "Stin");
2234 
2235  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
2236  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
2237 
2238  // std::cout << "*TEcnaHistos::ViewStin(...)> Plot is displayed on canvas ----> " << f_in << std::endl;
2239 
2240  delete [] f_in; f_in = nullptr; fCdelete++;
2241 
2242  //------------------------ Canvas draw and update ------------ (ViewStin)
2243  if( fPavComGeneralTitle != nullptr ){fPavComGeneralTitle->Draw();}
2244  fPavComStex->Draw();
2245  fPavComStin->Draw();
2246  fPavComAnaRun->Draw();
2247  fPavComNbOfEvts->Draw();
2248 
2249  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
2250  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
2251  MainCanvas->Divide(1, 1, x_margin, y_margin);
2252  gPad->cd(1);
2253 
2254  Int_t logy = 0;
2255  gPad->SetLogy(logy);
2256 
2257  h_geo_bid->DrawCopy("COLZ");
2258 
2259  //--------------------------------------------------------------------------- (ViewStin)
2260  Int_t size_Hoco = fEcal->MaxCrysHocoInStin();
2261  Int_t size_Veco = fEcal->MaxCrysVecoInStin();
2262 
2263  ViewStinGrid(fFapStexNumber, StexStin, MatSize, size_Hoco, size_Veco, " ");
2264 
2265  gPad->Update();
2266 
2267  h_geo_bid->SetStats(true);
2268 
2269  // delete MainCanvas; fCdeleteRoot++;
2270  }
2271  delete [] f_in_mat_tit; f_in_mat_tit = nullptr; fCdelete++;
2272 
2273  h_geo_bid->Delete(); h_geo_bid = nullptr; fCdeleteRoot++;
2274  }
2275  else
2276  {
2277  std::cout << "!TEcnaHistos::ViewStin(...)> *ERROR* =====> "
2278  << fFapStinName.Data() << " "
2279  << cStexStin << " not found."
2280  << " Available numbers = ";
2281  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
2282  {
2283  if( vStin(i) > 0 )
2284  {
2285  if( fFlagSubDet == "EB" ){std::cout << (Int_t)vStin(i) << ", ";}
2286  if( fFlagSubDet == "EE" )
2287  {std::cout << fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i)) << ", ";}
2288  }
2289  }
2290  std::cout << fTTBELL << std::endl;
2291  }
2292  } // end of if ( myRootFile->DataExist() == kTRUE )
2293  else
2294  {
2295  fStatusDataExist = kFALSE;
2296  }
2297  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
2298  else
2299  {
2300  fStatusFileFound = kFALSE;
2301 
2302  std::cout << "!TEcnaHistos::ViewStin(...)> *ERROR* =====> "
2303  << " ROOT file not found" << fTTBELL << std::endl;
2304  }
2305  }
2306  else
2307  {
2308  std::cout << "!TEcnaHistos::ViewStin(...)> " << fFapStexName.Data()
2309  << " = " << fFapStexNumber << ". Out of range (range = [1,"
2310  << fEcal->MaxStexInStas() << "]) " << fTTBELL << std::endl;
2311  }
2312 } // end of ViewStin(...)
2313 
2314 //====================================================================================
2315 //
2316 // StinCrystalNumbering
2317 // independent of the ROOT file => StexNumber as argument
2318 //
2319 //====================================================================================
2320 void TEcnaHistos::StinCrystalNumbering(const Int_t& StexNumber, const Int_t& cStexStin)
2321 {
2322 //display the crystal numbering of one Stin
2323 // cStexStin = Tower number in case of EB or SC number for construction in case of EE
2324 
2325  if( fFlagSubDet == "EB" ){TowerCrystalNumbering(StexNumber, cStexStin);}
2326  if( fFlagSubDet == "EE" ){SCCrystalNumbering(StexNumber, cStexStin);}
2327 }
2328 //----------------> end of StinCrystalNumbering()
2329 
2330 //====================================================================================
2331 //
2332 // TowerCrystalNumbering
2333 // independent of the ROOT file => SMNumber as argument
2334 //
2335 //====================================================================================
2336 void TEcnaHistos::TowerCrystalNumbering(const Int_t& SMNumber, const Int_t& n1SMTow)
2337 {
2338  //display the crystal numbering of one tower
2339 
2340  if( (SMNumber > 0) && (SMNumber <= fEcal->MaxSMInEB()) )
2341  {
2343 
2344  Int_t MatSize = fEcal->MaxSampADC();
2345  Int_t size_eta = fEcal->MaxCrysEtaInTow();
2346  Int_t size_phi = fEcal->MaxCrysPhiInTow();
2347 
2348  //---------------------------------- bidim
2349 
2350  Int_t nb_bins = fEcal->MaxSampADC();
2351  Int_t nx_gbins = nb_bins*size_eta;
2352  Int_t ny_gbins = nb_bins*size_phi;
2353 
2354  Axis_t xinf_gbid = (Axis_t)0.;
2355  Axis_t xsup_gbid = (Axis_t)fEcal->MaxSampADC()*size_eta;
2356  Axis_t yinf_gbid = (Axis_t)0.;
2357  Axis_t ysup_gbid = (Axis_t)fEcal->MaxSampADC()*size_phi;
2358 
2359  TString fg_name = "M0' crystals";
2360  TString fg_tit = "Xtal numbering (chan. in tow, chan. in SM, Xtal in SM, hashed)";
2361 
2362  //----------------------- empty 2D histo for pave coordinates registration
2363  TH2D *h_gbid;
2364  h_gbid = new TH2D(fg_name.Data(), fg_tit.Data(),
2365  nx_gbins, xinf_gbid, xsup_gbid,
2366  ny_gbins, yinf_gbid, ysup_gbid); fCnewRoot++;
2367  h_gbid->Reset();
2368 
2369  //----------------- T R A C E D E S P L O T S ------ (TowerCrystalNumbering)
2370 
2371  char* f_in = new char[fgMaxCar]; fCnew++;
2372 
2373  //...................... Taille/format canvas
2374 
2375  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
2376  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
2377 
2378  //........................................ couleurs
2379  Color_t couleur_noir = fCnaParHistos->SetColorsForNumbers("crystal");
2380  Color_t couleur_rouge = fCnaParHistos->SetColorsForNumbers("lvrb_top");
2381  Color_t couleur_bleu_fonce = fCnaParHistos->SetColorsForNumbers("lvrb_bottom");
2382 
2383  gStyle->SetPalette(1,nullptr); // Rainbow spectrum
2384 
2385  //.................................... options generales
2387 
2388  //.................................... paves commentaires (TowerCrystalNumbering)
2389 
2390  SetAllPavesViewStinCrysNb(SMNumber, n1SMTow);
2391 
2392  //---------------------------------------------- (TowerCrystalNumbering)
2393 
2394  //..................... Canvas name
2395  sprintf(f_in, "Crystal_Numbering_for_%s_X_%d_%s%d",
2396  fFapStinName.Data(), n1SMTow, fFapStexName.Data(), SMNumber);
2397 
2398  SetHistoPresentation((TH1D*)h_gbid, "Stin");
2399 
2400  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w , canv_h); fCnewRoot++;
2401  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
2402 
2403  // std::cout << "*TEcnaHistosEB::TowerCrystalNumbering(...)> Plot is displayed on canvas ----> "
2404  // << f_in << std::endl;
2405 
2406  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
2407  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
2408  MainCanvas->Divide(1, 1, x_margin, y_margin);
2409 
2410  fPavComStex->Draw();
2411  fPavComStin->Draw();
2412  fPavComLVRB->Draw();
2413 
2414  Bool_t b_true = true;
2415  Bool_t b_false = false;
2416  gPad->cd(1);
2417 
2418  gStyle->SetMarkerColor(couleur_rouge);
2419 
2420  Int_t logy = 0;
2421  gPad->SetLogy(logy);
2422 
2423  //............................... bidim .......... (TowerCrystalNumbering)
2424 
2425  h_gbid->SetStats(b_false);
2426  h_gbid->DrawCopy("COLZ");
2427 
2428  //..... Ecriture des numeros de channels dans la grille..... (TowerCrystalNumbering)
2429  // et des numeros SM des cristaux
2430 
2431  //............... prepa arguments fixes appels [TText]->DrawText()
2432  char* f_in_elec = new char[fgMaxCar]; fCnew++;
2433  TString TowerLvrbType = fEcalNumbering->GetTowerLvrbType(n1SMTow) ;
2434  TText *text_elec_num = new TText(); fCnewRoot++;
2435  if ( TowerLvrbType == "top" ){text_elec_num->SetTextColor(couleur_rouge);}
2436  if ( TowerLvrbType == "bottom" ){text_elec_num->SetTextColor(couleur_bleu_fonce);}
2437  text_elec_num->SetTextSize(0.04);
2438 
2439  char* f_in_sme = new char[fgMaxCar]; fCnew++;
2440  TText *text_sme_num = new TText(); fCnewRoot++;
2441  if ( TowerLvrbType == "top" ){text_sme_num->SetTextColor(couleur_rouge);}
2442  if ( TowerLvrbType == "bottom" ){text_sme_num->SetTextColor(couleur_bleu_fonce);}
2443  text_sme_num->SetTextSize(0.03);
2444 
2445  char* f_in_sm = new char[fgMaxCar]; fCnew++;
2446  TText *text_sm_num = new TText(); fCnewRoot++;
2447  text_sm_num->SetTextColor(couleur_noir);
2448  text_sm_num->SetTextSize(0.03);
2449 
2450  char* f_in_hsd = new char[fgMaxCar]; fCnew++;
2451  TText *text_hsd_num = new TText(); fCnewRoot++;
2452  text_hsd_num->SetTextColor(couleur_noir);
2453  text_hsd_num->SetTextSize(0.03);
2454 
2455  //............... prepa arguments fixes appels GetXGeo(...) et GetYGeo(...)
2456  Int_t i_samp = 0;
2457  //Double_t off_set = (Double_t)(fEcal->MaxSampADC()/4);
2458  Double_t off_set = (Double_t)1.;
2459 
2460  //------------------ LOOP ON THE CRYSTAL ELECTRONIC CHANNEL NUMBER (TowerCrystalNumbering)
2461 
2462  for (Int_t i_chan = 0; i_chan < fEcal->MaxCrysInTow(); i_chan++)
2463  {
2464  Int_t i_xgeo = GetXSampInStin(SMNumber, n1SMTow, i_chan, i_samp);
2465  Int_t i_ygeo = GetYSampInStin(SMNumber, n1SMTow, i_chan, i_samp);
2466 
2467  Double_t xgi = i_xgeo + 3.*off_set;
2468  Double_t ygj = i_ygeo + 7.*off_set;
2469 
2470  Double_t xgi_sme = i_xgeo + 3.*off_set;
2471  Double_t ygj_sme = i_ygeo + 5.*off_set;
2472 
2473  Double_t xgi_sm = i_xgeo + 3.*off_set;
2474  Double_t ygj_sm = i_ygeo + 3.*off_set;
2475 
2476  Double_t xgi_hsd = i_xgeo + 3.*off_set;
2477  Double_t ygj_hsd = i_ygeo + 1.*off_set;
2478 
2479  Int_t i_crys_sme = fEcalNumbering->Get0SMEchaFrom1SMTowAnd0TowEcha(n1SMTow, i_chan);
2480  Int_t i_crys_sm = fEcalNumbering->Get1SMCrysFrom1SMTowAnd0TowEcha(n1SMTow, i_chan);
2481 
2482  Double_t Eta = fEcalNumbering->GetEta(SMNumber, n1SMTow, i_chan);
2483  Double_t Phi = fEcalNumbering->GetPhi(SMNumber, n1SMTow, i_chan);
2484 
2485  Int_t i_crys_hsd = fEcalNumbering->GetHashedNumberFromIEtaAndIPhi((Int_t)Eta, (Int_t)Phi);
2486 
2487  //------------------------------------------------------- TowerCrystalNumbering
2488 
2489  sprintf(f_in_elec, "%d", i_chan);
2490  text_elec_num->DrawText(xgi, ygj, f_in_elec);
2491 
2492  sprintf(f_in_sme, "%d", i_crys_sme);
2493  text_sme_num->DrawText(xgi_sme, ygj_sme, f_in_sme);
2494 
2495  sprintf(f_in_sm, "%d", i_crys_sm);
2496  text_sm_num->DrawText(xgi_sm, ygj_sm, f_in_sm);
2497 
2498  sprintf(f_in_hsd, "%d", i_crys_hsd);
2499  text_sm_num->DrawText(xgi_hsd, ygj_hsd, f_in_hsd);
2500  }
2501  text_sm_num->Delete(); text_sm_num = nullptr; fCdeleteRoot++;
2502  text_sme_num->Delete(); text_sme_num = nullptr; fCdeleteRoot++;
2503  text_elec_num->Delete(); text_elec_num = nullptr; fCdeleteRoot++;
2504  text_hsd_num->Delete(); text_hsd_num = nullptr; fCdeleteRoot++;
2505 
2506  ViewStinGrid(SMNumber, n1SMTow, MatSize, size_eta, size_phi, "CrystalNumbering");
2507 
2508  gPad->Update();
2509  h_gbid->SetStats(b_true);
2510 
2511  h_gbid->Delete(); h_gbid = nullptr; fCdeleteRoot++;
2512 
2513  delete [] f_in; f_in = nullptr; fCdelete++;
2514  delete [] f_in_sm; f_in_sm = nullptr; fCdelete++;
2515  delete [] f_in_sme; f_in_sme = nullptr; fCdelete++;
2516  delete [] f_in_elec; f_in_elec = nullptr; fCdelete++;
2517  }
2518  else
2519  {
2520  std::cout << "!TEcnaHistos::TowerCrystalNumbering(...)> SM = " << SMNumber
2521  << ". Out of range ( range = [1," << fEcal->MaxSMInEB() << "] )" << fTTBELL << std::endl;
2522  }
2523 }
2524 //----------------> end of TowerCrystalNumbering()
2525 
2526 //====================================================================================
2527 //
2528 // SCCrystalNumbering
2529 // independent of the ROOT file => DeeNumber and n1DeeSCEcna as argument
2530 //
2531 //====================================================================================
2532 void TEcnaHistos::SCCrystalNumbering(const Int_t& DeeNumber, const Int_t& n1DeeSCCons)
2533 {
2534  //display the crystal numbering of one SC
2535 
2536  if( (DeeNumber > 0) && (DeeNumber <= fEcal->MaxDeeInEE()) )
2537  {
2538  Int_t n1DeeSCEcna = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(DeeNumber, n1DeeSCCons);
2541 
2542  //Int_t MatSize = fEcal->MaxSampADC();
2543  Int_t size_IX = fEcal->MaxCrysIXInSC();
2544  Int_t size_IY = fEcal->MaxCrysIYInSC();
2545 
2546  //---------------------------------- bidim
2547 
2548  Int_t nb_bins = fEcal->MaxSampADC();
2549  Int_t nx_gbins = nb_bins*size_IX;
2550  Int_t ny_gbins = nb_bins*size_IY;
2551 
2552  Axis_t xinf_gbid = (Axis_t)0.;
2553  Axis_t xsup_gbid = (Axis_t)fEcal->MaxSampADC()*size_IX;
2554  Axis_t yinf_gbid = (Axis_t)0.;
2555  Axis_t ysup_gbid = (Axis_t)fEcal->MaxSampADC()*size_IY;
2556 
2557  TString fg_name = "crystalnbring";
2558  TString fg_tit = "Xtal numbering for construction";
2559 
2560  TH2D *h_gbid;
2561  h_gbid = new TH2D(fg_name.Data(), fg_tit.Data(),
2562  nx_gbins, xinf_gbid, xsup_gbid,
2563  ny_gbins, yinf_gbid, ysup_gbid); fCnewRoot++;
2564  h_gbid->Reset();
2565 
2566  //----------------- T R A C E D E S P L O T S ------ (SCCrystalNumbering)
2567 
2568  char* f_in = new char[fgMaxCar]; fCnew++;
2569 
2570  //...................... Taille/format canvas
2571 
2572  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
2573  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
2574  //........................................ couleurs
2575  // Color_t couleur_noir = fCnaParHistos->ColorDefinition("noir");
2576  Color_t couleur_rouge = fCnaParHistos->ColorDefinition("rouge");
2577  // Color_t couleur_bleu_fonce = fCnaParHistos->ColorDefinition("bleu_fonce");
2578 
2579  gStyle->SetPalette(1,nullptr); // Rainbow spectrum
2580  //.................................... options generales
2582 
2583  //.................................... paves commentaires (SCCrystalNumbering)
2584  SetAllPavesViewStinCrysNb(DeeNumber, n1DeeSCEcna);
2585 
2586  //---------------------------------------------- (SCCrystalNumbering)
2587  //..................... Canvas name
2588  sprintf(f_in, "Crystal_Numbering_for_%s_X_%d_%s%d",
2589  fFapStinName.Data(), n1DeeSCEcna, fFapStexName.Data(), DeeNumber);
2590 
2591  SetHistoPresentation((TH1D*)h_gbid, "Stin");
2592 
2593  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w , canv_h); fCnewRoot++;
2594  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
2595 
2596  // std::cout << "*TEcnaHistosEE::SCCrystalNumbering(...)> Plot is displayed on canvas ----> "
2597  // << f_in << std::endl;
2598 
2599  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
2600  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
2601 
2602  MainCanvas->Divide(1, 1, x_margin, y_margin);
2603 
2604  fPavComStex->Draw();
2605  fPavComStin->Draw();
2606  fPavComCxyz->Draw();
2607 
2608  Bool_t b_true = true;
2609  Bool_t b_false = false;
2610  gPad->cd(1);
2611 
2612  gStyle->SetMarkerColor(couleur_rouge);
2613 
2614  Int_t logy = 0;
2615  gPad->SetLogy(logy);
2616 
2617  //............................... bidim .......... (SCCrystalNumbering)
2618  h_gbid->SetStats(b_false);
2619  fCnaParHistos->SetViewHistoOffsets((TH1D*)h_gbid, "Stin", " ");
2620  h_gbid->DrawCopy("COLZ");
2621 
2622  //..... Ecriture des numeros de channels dans la grille..... (SCCrystalNumbering)
2623  // et des numeros Dee des cristaux
2624  TString SCQuadType = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna);
2625  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
2626  TString DeeEndcap = fEcalNumbering->GetEEDeeEndcap(DeeNumber);
2627  Color_t couleur_SC = GetSCColor(DeeEndcap, DeeDir, SCQuadType);
2628  //............... prepa arguments fixes appels [TText]->DrawText()
2629  char* f_in_elec = new char[fgMaxCar]; fCnew++;
2630  TText *text_elec_num = new TText(); fCnewRoot++;
2631  text_elec_num->SetTextColor(couleur_SC);
2632  text_elec_num->SetTextSize(0.06);
2633 
2634  //............... prepa arguments fixes appels GetXGeo(...) et GetYGeo(...)
2635  Int_t i_samp = 0;
2636  Double_t off_set = (Double_t)(fEcal->MaxSampADC()/3);
2637 
2638  //------------------ LOOP ON THE CRYSTAL ELECTRONIC CHANNEL NUMBER (SCCrystalNumbering)
2639 
2640  for (Int_t i_chan = 0; i_chan < fEcal->MaxCrysInSC(); i_chan++)
2641  {
2642  Int_t i_xgeo = GetXSampInStin(DeeNumber, n1DeeSCEcna, i_chan, i_samp);
2643  Int_t i_ygeo = GetYSampInStin(DeeNumber, n1DeeSCEcna, i_chan, i_samp);
2644 
2645  Double_t xgi = i_xgeo + off_set;
2646  Double_t ygj = i_ygeo + 2*off_set;
2647 
2648  //------------------------------------------------------- SCCrystalNumbering
2649  Int_t i_chan_p = i_chan+1;
2650  sprintf(f_in_elec, "%d", i_chan_p); // offset = +1 (Xtal for construction numbering, CMS NOTE 2006/027)
2651  text_elec_num->DrawText(xgi, ygj, f_in_elec);
2652  }
2653  text_elec_num->Delete(); text_elec_num = nullptr; fCdeleteRoot++;
2654 
2655  ViewStinGrid(DeeNumber, n1DeeSCEcna, fEcal->MaxSampADC(), size_IX, size_IY, "CrystalNumbering");
2656 
2657  gPad->Update();
2658  h_gbid->SetStats(b_true);
2659 
2660  h_gbid->Delete(); h_gbid = nullptr; fCdeleteRoot++;
2661 
2662  delete [] f_in; f_in = nullptr; fCdelete++;
2663  delete [] f_in_elec; f_in_elec = nullptr; fCdelete++;
2664  }
2665  else
2666  {
2667  std::cout << "!TEcnaHistos::SCCrystalNumbering(...)> Dee = " << DeeNumber
2668  << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )" << fTTBELL << std::endl;
2669  }
2670 }
2671 //----------------> end of SCCrystalNumbering()
2672 
2673 //==================================================================================
2674 //
2675 // GetXSampInStin, GetYSampInStin
2676 //
2677 //==================================================================================
2678 Int_t TEcnaHistos::GetXSampInStin(const Int_t& StexNumber, const Int_t& StexStin,
2679  const Int_t& i0StinEcha, const Int_t& i_samp)
2680 {
2681 //Gives the X coordinate in the geographic view of one Stin
2682 
2683  Int_t ix_geo = -1;
2684 
2685  if( fFlagSubDet == "EB" )
2686  {TString ctype = fEcalNumbering->GetStinLvrbType(StexStin);
2687  TString btype = fEcalNumbering->GetStexHalfStas(StexNumber);
2688  if( (btype == "EB+" && ctype == "bottom") || (btype == "EB-" && ctype == "top") )
2689  {ix_geo = ( (fEcal->MaxCrysHocoInStin()-1)-(i0StinEcha/fEcal->MaxCrysHocoInStin()) )
2690  *fEcal->MaxSampADC() + i_samp;}
2691  if( (btype == "EB+" && ctype == "top") || (btype == "EB-" && ctype == "bottom") )
2692  {ix_geo = ( i0StinEcha/fEcal->MaxCrysHocoInStin() )*fEcal->MaxSampADC() + i_samp;}}
2693 
2694  if( fFlagSubDet == "EE" )
2695  { TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(StexNumber);
2696  if( DeeDir == "right" )
2697  {ix_geo = (fEcalNumbering->GetIXCrysInSC(StexNumber, StexStin, i0StinEcha)-1)*fEcal->MaxSampADC() + i_samp;}
2698  if( DeeDir == "left" )
2699  {ix_geo = (fEcal->MaxCrysHocoInStin() - fEcalNumbering->GetIXCrysInSC(StexNumber, StexStin, i0StinEcha))*
2700  fEcal->MaxSampADC() + i_samp;}}
2701 
2702  return ix_geo;
2703 }
2704 //--------------------------------------------------------------------------------------------
2705 Int_t TEcnaHistos::GetYSampInStin(const Int_t& StexNumber, const Int_t& StexStin,
2706  const Int_t& i0StinEcha, const Int_t& j_samp)
2707 {
2708 //Gives the Y coordinate in the geographic view of one Stin
2709 
2710  Int_t jy_geo = -1;
2711 
2712  if( fFlagSubDet == "EB" )
2713  {
2714  TString ctype = fEcalNumbering->GetStinLvrbType(StexStin);
2715  TString btype = fEcalNumbering->GetStexHalfStas(StexNumber);
2716 
2717  //.......................... jy_geo for the EB+ (and beginning for the EB-)
2718 
2719  if( (btype == "EB+" && ctype == "top") || (btype == "EB-" && ctype == "bottom") )
2720  {
2721  if( i0StinEcha >= 0 && i0StinEcha <= 4 ) {jy_geo = (i0StinEcha - 0)*fEcal->MaxSampADC() + j_samp;}
2722  if( i0StinEcha >= 5 && i0StinEcha <= 9 ) {jy_geo = -(i0StinEcha - 9)*fEcal->MaxSampADC() + j_samp;}
2723  if( i0StinEcha >= 10 && i0StinEcha <= 14 ) {jy_geo = (i0StinEcha - 10)*fEcal->MaxSampADC() + j_samp;}
2724  if( i0StinEcha >= 15 && i0StinEcha <= 19 ) {jy_geo = -(i0StinEcha - 19)*fEcal->MaxSampADC() + j_samp;}
2725  if( i0StinEcha >= 20 && i0StinEcha <= 24 ) {jy_geo = (i0StinEcha - 20)*fEcal->MaxSampADC() + j_samp;}
2726  }
2727 
2728  if( (btype == "EB+" && ctype == "bottom") || (btype == "EB-" && ctype == "top") )
2729  {
2730  if( i0StinEcha >= 0 && i0StinEcha <= 4 )
2731  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) - (i0StinEcha- 0))*fEcal->MaxSampADC() + j_samp;}
2732  if( i0StinEcha >= 5 && i0StinEcha <= 9 )
2733  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) + (i0StinEcha- 9))*fEcal->MaxSampADC() + j_samp;}
2734  if( i0StinEcha >= 10 && i0StinEcha <= 14 )
2735  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) - (i0StinEcha-10))*fEcal->MaxSampADC() + j_samp;}
2736  if( i0StinEcha >= 15 && i0StinEcha <= 19 )
2737  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) + (i0StinEcha-19))*fEcal->MaxSampADC() + j_samp;}
2738  if( i0StinEcha >= 20 && i0StinEcha <= 24 )
2739  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) - (i0StinEcha-20))*fEcal->MaxSampADC() + j_samp;}
2740  }
2741  }
2742 
2743  if( fFlagSubDet == "EE" )
2744  {jy_geo =
2745  (fEcalNumbering->GetJYCrysInSC(StexNumber, StexStin, i0StinEcha) - 1)*fEcal->MaxSampADC() + j_samp;}
2746 
2747  return jy_geo;
2748 }
2749 
2750 //===============================================================================
2751 //
2752 // ViewStinGrid
2753 // independent of the ROOT file => StexNumber as argument
2754 //
2755 //===============================================================================
2756 void TEcnaHistos::ViewStinGrid(const Int_t& StexNumber,
2757  const Int_t& StexStin, const Int_t& MatSize,
2758  const Int_t& size_Hoco, const Int_t& size_Veco,
2759  const TString& chopt)
2760 {
2761  //Grid of one Stin with axis Hoco and Veco
2762 
2763  if( fFlagSubDet == "EB"){ViewTowerGrid(StexNumber, StexStin, MatSize,
2764  size_Hoco, size_Veco, chopt);}
2765  if( fFlagSubDet == "EE"){ViewSCGrid(StexNumber, StexStin, MatSize,
2766  size_Hoco, size_Veco, chopt);}
2767 
2768 } // end of ViewStinGrid
2769 
2770 //===============================================================================
2771 //
2772 // ViewTowerGrid
2773 // independent of the ROOT file => SMNumber as argument
2774 //
2775 //===============================================================================
2776 void TEcnaHistos::ViewTowerGrid(const Int_t& SMNumber,
2777  const Int_t& n1SMTow, const Int_t& MatSize,
2778  const Int_t& size_eta, const Int_t& size_phi,
2779  const TString& chopt)
2780 {
2781  //Grid of one tower with axis eta and phi
2782  //.......................... lignes verticales
2783  Double_t xline = 0.;
2784 
2785  Double_t yline_bot = 0.;
2786  Double_t yline_top = (Double_t)(MatSize*size_eta);
2787 
2788  for( Int_t i = 0 ; i < size_eta ; i++)
2789  {
2790  xline = xline + (Double_t)MatSize;
2791  TLine *lin;
2792  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
2793  lin->Draw();
2794  // delete lin; fCdeleteRoot++;
2795  }
2796  //............................. lignes horizontales
2797  Double_t xline_left = 0;
2798  Double_t xline_right = (Double_t)(MatSize*size_eta);
2799 
2800  Double_t yline = -(Double_t)MatSize;
2801 
2802  for( Int_t j = 0 ; j < size_eta+1 ; j++)
2803  {
2804  yline = yline + (Double_t)MatSize;
2805  TLine *lin;
2806  lin = new TLine(xline_left, yline, xline_right, yline); fCnewRoot++;
2807  lin->Draw();
2808  // delete lin; fCdeleteRoot++;
2809  }
2810 
2811  //------------------ trace axes en eta et phi --------------- ViewTowerGrid
2812 
2813  //...................................................... Axe i(eta) (x bottom) (ViewTowerGrid)
2814 
2815  Double_t eta_min = fEcalNumbering->GetIEtaMin(SMNumber, n1SMTow);
2816  Double_t eta_max = fEcalNumbering->GetIEtaMax(SMNumber, n1SMTow);
2817 
2818  TString x_var_name = GetEtaPhiAxisTitle("ietaTow");
2819  TString x_direction = fEcalNumbering->GetXDirectionEB(SMNumber);
2820 
2821  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
2822  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize();
2823  Float_t tic_siz_x = fCnaParHistos->AxisTickSize();
2824  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("Towx");
2825  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("Towx");
2826 
2827  new TF1("f1", x_direction.Data(), eta_min, eta_max); fCnewRoot++;
2828 
2829  TGaxis* sup_axis_x = nullptr;
2830 
2831  if ( x_direction == "-x" ) // NEVER IN THIS CASE: xmin->xmax <=> right->left ("-x") direction
2832  {sup_axis_x = new TGaxis( -(Float_t)MatSize, (Float_t)0, (Float_t)(size_eta*MatSize), (Float_t)0.,
2833  "f1", size_eta, "BCS" , 0.); fCnewRoot++;
2834  std::cout << "TEcnaHistosEB::ViewTowerGrid()> non foreseen case. eta with -x direction." << fTTBELL << std::endl;}
2835 
2836  if ( x_direction == "x" ) // ALWAYS IN THIS CASE: xmin->xmax <=> left->right ("x") direction
2837  {sup_axis_x = new TGaxis( (Float_t)0. , (Float_t)0., (Float_t)(size_eta*MatSize), (Float_t)0.,
2838  "f1", size_eta, "CS" , 0.); fCnewRoot++;}
2839 
2840  sup_axis_x->SetTitle(x_var_name);
2841  sup_axis_x->SetTitleSize(tit_siz_x);
2842  sup_axis_x->SetTitleOffset(tit_off_x);
2843  sup_axis_x->SetLabelSize(lab_siz_x);
2844  sup_axis_x->SetLabelOffset(lab_off_x);
2845  sup_axis_x->SetTickSize(tic_siz_x);
2846  sup_axis_x->Draw("SAME");
2847 
2848  //...................................................... Axe phi (y right) (ViewTowerGrid)
2849  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
2850  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
2851  Float_t tic_siz_y = fCnaParHistos->AxisTickSize();
2852  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("Towy");
2853  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("Towy");
2854 
2855  if( chopt == "CrystalNumbering" )
2856  {
2857  Double_t phi_min = fEcalNumbering->GetPhiMin(SMNumber, n1SMTow);
2858  Double_t phi_max = fEcalNumbering->GetPhiMax(SMNumber, n1SMTow);
2859 
2860  TString y_var_name = GetEtaPhiAxisTitle("phi");
2861  TString y_direction = fEcalNumbering->GetYDirectionEB(SMNumber);
2862 
2863  new TF1("f2", y_direction.Data(), phi_min, phi_max); fCnewRoot++;
2864  TGaxis* sup_axis_y = nullptr;
2865 
2866  if ( y_direction == "-x" ) // ALWAYS IN THIS CASE: ymin->ymax <=> top->bottom ("-x") direction
2867  {sup_axis_y = new TGaxis( (Float_t)(size_eta*MatSize), (Float_t)0.,
2868  (Float_t)(size_eta*MatSize), (Float_t)(size_phi*MatSize),
2869  "f2", size_phi, "+CS", 0.); fCnewRoot++;}
2870 
2871  if ( y_direction == "x" ) // NEVER IN THIS CASE: ymin->ymax <=> bottom->top ("x") direction
2872  {sup_axis_y = new TGaxis( (Float_t)0., (Float_t)0., (Float_t) 0., (Float_t)(size_phi*MatSize),
2873  "f2", size_phi, "BCS", 0.); fCnewRoot++;}
2874 
2875  sup_axis_y->SetTitle(y_var_name);
2876  sup_axis_y->SetTitleSize(tit_siz_y);
2877  sup_axis_y->SetTitleOffset(tit_off_y);
2878  sup_axis_y->SetLabelSize(lab_siz_y);
2879  sup_axis_y->SetLabelOffset(lab_off_y);
2880  sup_axis_y->SetTickSize(tic_siz_y);
2881  sup_axis_y->Draw("SAME");
2882  }
2883  //...................................................... Axe j(phi) (y left) (ViewTowerGrid)
2884 
2885  Double_t j_phi_min = fEcalNumbering->GetJPhiMin(SMNumber, n1SMTow);
2886  Double_t j_phi_max = fEcalNumbering->GetJPhiMax(SMNumber, n1SMTow);
2887 
2888  TString jy_var_name = GetEtaPhiAxisTitle("jphiTow");
2889  TString jy_direction = fEcalNumbering->GetJYDirectionEB(SMNumber);
2890 
2891  new TF1("f3", jy_direction.Data(), j_phi_min, j_phi_max); fCnewRoot++;
2892  TGaxis* sup_axis_jy = nullptr;
2893 
2894  sup_axis_jy = new TGaxis( (Float_t)0., (Float_t)0.,
2895  (Float_t)0., (Float_t)(size_phi*MatSize),
2896  "f3", size_phi, "SC", 0.); fCnewRoot++;
2897 
2898  sup_axis_jy->SetTitle(jy_var_name);
2899  sup_axis_jy->SetTitleSize(tit_siz_y);
2900  sup_axis_jy->SetTitleOffset(tit_off_y);
2901  sup_axis_jy->SetLabelSize(lab_siz_y);
2902  sup_axis_jy->SetLabelOffset(lab_off_y);
2903  sup_axis_jy->SetTickSize(tic_siz_y);
2904  sup_axis_jy->Draw("SAME");
2905 } // end of ViewTowerGrid
2906 
2907 //===============================================================================
2908 //
2909 // ViewSCGrid
2910 // independent of the ROOT file => DeeNumber as argument
2911 //
2912 //===============================================================================
2913 void TEcnaHistos::ViewSCGrid(const Int_t& DeeNumber, const Int_t& n1DeeSCEcna,
2914  const Int_t& MatSize, const Int_t& size_IX,
2915  const Int_t& size_IY, const TString& chopt)
2916 {
2917  //Grid of one SC with axis IX and IY
2918  //.......................... lignes verticales
2919  Double_t xline = 0.;
2920 
2921  Double_t yline_bot = 0.;
2922  Double_t yline_top = (Double_t)(MatSize*size_IX);
2923 
2924  for( Int_t i = 0 ; i < size_IX ; i++)
2925  {
2926  xline = xline + (Double_t)MatSize;
2927  TLine *lin;
2928  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
2929  lin->Draw();
2930  // delete lin; fCdeleteRoot++;
2931  }
2932  //............................. lignes horizontales
2933  Double_t xline_left = 0;
2934  Double_t xline_right = (Double_t)(MatSize*size_IX);
2935 
2936  Double_t yline = -(Double_t)MatSize;
2937 
2938  for( Int_t j = 0 ; j < size_IX+1 ; j++)
2939  {
2940  yline = yline + (Double_t)MatSize;
2941  TLine *lin;
2942  lin = new TLine(xline_left, yline, xline_right, yline); fCnewRoot++;
2943  lin->Draw();
2944  // delete lin; fCdeleteRoot++;
2945  }
2946 
2947  //------------------ trace axes en IX et IY --------------- ViewSCGrid
2948 
2949  //...................................................... Axe i(IX) (x bottom) (ViewSCGrid)
2950 
2951  Double_t IX_min = fEcalNumbering->GetIIXMin(n1DeeSCEcna) - 0.5;
2952  Double_t IX_max = fEcalNumbering->GetIIXMax(n1DeeSCEcna) + 0.5;
2953 
2954  Float_t axis_x_inf = 0;
2955  Float_t axis_x_sup = 0;
2956  Float_t axis_y_inf = 0;
2957  Float_t axis_y_sup = 0;
2958  Int_t axis_nb_div = 1;
2959  Double_t IX_values_min = 0;
2960  Double_t IX_values_max = 0;
2961  Option_t* axis_chopt = "CS";
2962 
2963  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
2964  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize();
2965  Float_t tic_siz_x = fCnaParHistos->AxisTickSize();
2966  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("SCx");
2967  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("SCx");
2968 
2969  TString StrDee = "iIXSC";
2970  if( DeeNumber == 1 ){StrDee = "iIXDee1";}
2971  if( DeeNumber == 2 ){StrDee = "iIXDee2";}
2972  if( DeeNumber == 3 ){StrDee = "iIXDee3";}
2973  if( DeeNumber == 4 ){StrDee = "iIXDee4";}
2974 
2975  TString x_var_name = GetIXIYAxisTitle(StrDee.Data());
2976  TString x_direction = fEcalNumbering->GetXDirectionEE(DeeNumber);
2977 
2978  TGaxis* sup_axis_x = nullptr;
2979 
2980  if( DeeNumber == 1 ) // -xmin -> -xmax <=> left->right
2981  {
2982  axis_x_inf = 0; axis_y_inf = 0; axis_x_sup = size_IX*MatSize; axis_y_sup = 0;
2983  axis_nb_div = size_IX;
2984  IX_values_min = -IX_min ; IX_values_max = -IX_max; axis_chopt = "CS";
2985  }
2986  if( DeeNumber == 2 ) // xmin -> xmax <=> right->left
2987  {
2988  axis_x_inf = 0; axis_y_inf = 0; axis_x_sup = size_IX*MatSize; axis_y_sup = 0;
2989  axis_nb_div = size_IX;
2990  IX_values_min = IX_min ; IX_values_max = IX_max; axis_chopt = "CS";
2991  }
2992  if( DeeNumber == 3 ) // xmin -> xmax <=> left->right
2993  {
2994  axis_x_inf = 0; axis_y_inf = 0; axis_x_sup = size_IX*MatSize; axis_y_sup = 0;
2995  axis_nb_div = size_IX;
2996  IX_values_min = IX_min ; IX_values_max = IX_max; axis_chopt = "CS";
2997  }
2998  if( DeeNumber == 4 ) // -xmin -> -xmax <=> right->left
2999  {
3000  axis_x_inf = 0; axis_y_inf = 0; axis_x_sup = size_IX*MatSize; axis_y_sup = 0;
3001  axis_nb_div = size_IX;
3002  IX_values_min = -IX_min ; IX_values_max = -IX_max; axis_chopt = "CS";
3003  }
3004 
3005  new TF1("f1", x_direction.Data(), IX_values_min, IX_values_max); fCnewRoot++;
3006  sup_axis_x = new TGaxis( axis_x_inf, axis_y_inf, axis_x_sup, axis_y_sup,
3007  "f1", axis_nb_div, axis_chopt , 0.); fCnewRoot++;
3008 
3009  sup_axis_x->SetTitle(x_var_name);
3010  sup_axis_x->SetTitleSize(tit_siz_x);
3011  sup_axis_x->SetTitleOffset(tit_off_x);
3012  sup_axis_x->SetLabelSize(lab_siz_x);
3013  sup_axis_x->SetLabelOffset(lab_off_x);
3014  sup_axis_x->SetTickSize(tic_siz_x); // <===== NE MARCHE QU'AVEC L'OPTION "S"
3015  sup_axis_x->Draw("SAME");
3016 
3017  //...................................................... Axe j(IY) (ViewSCGrid)
3018 
3019  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
3020  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
3021  Float_t tic_siz_y = fCnaParHistos->AxisTickSize();
3022  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("SCy");
3023  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("SCy");
3024 
3025  Double_t j_IY_min = fEcalNumbering->GetJIYMin(DeeNumber, n1DeeSCEcna) - 0.5;
3026  Double_t j_IY_max = fEcalNumbering->GetJIYMax(DeeNumber, n1DeeSCEcna) + 0.5;
3027 
3028  TString jy_var_name = GetIXIYAxisTitle("jIYSC");
3029  TString jy_direction = fEcalNumbering->GetJYDirectionEE(DeeNumber);
3030 
3031  new TF1("f2", jy_direction.Data(), j_IY_min, j_IY_max); fCnewRoot++;
3032 
3033  TGaxis* sup_axis_jy = new TGaxis( (Float_t)0., (Float_t)0.,
3034  (Float_t)0., (Float_t)(size_IY*MatSize),
3035  "f2", size_IY, "CS", 0.); fCnewRoot++;
3036 
3037  sup_axis_jy->SetTitle(jy_var_name);
3038  sup_axis_jy->SetTitleSize(tit_siz_y);
3039  sup_axis_jy->SetTitleOffset(tit_off_y);
3040  sup_axis_jy->SetLabelSize(lab_siz_y);
3041  sup_axis_jy->SetLabelOffset(lab_off_y);
3042  sup_axis_jy->SetTickSize(tic_siz_y); // <===== NE MARCHE QU'AVEC L'OPTION "S"
3043  sup_axis_jy->Draw();
3044 
3045 } // end of ViewSCGrid
3046 
3047 //=======================================================================================
3048 //
3049 // ViewStex(***)
3050 //
3051 // (Hoco,Veco) matrices for all the Stins of a Stex
3052 //
3053 // arg_read_histo: 1D array containing the quantity for each channel in the Stex
3054 // (dim = MaxCrysInStex())
3055 // arg_AlreadyRead: =1 <=> arg_read_histo
3056 // =0 <=> read the 1D array in this method with TEcnaRead
3057 //
3058 // HistoCode: code for the plotted quantity
3059 //
3060 //=======================================================================================
3061 void TEcnaHistos::ViewStex(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
3062  const TString& HistoCode)
3063 {
3064 // (Hoco, Veco) matrices for all the Stins of a Stex
3065 
3066  Bool_t OKFileExists = kFALSE;
3067  Bool_t OKData = kFALSE;
3068 
3069  Int_t n1StexStin = -1;
3070 
3071  if( arg_AlreadyRead == fTobeRead )
3072  {
3078 
3079  if( fMyRootFile->LookAtRootFile() == kTRUE ){OKFileExists = kTRUE;}
3080 
3081  if( OKFileExists == kTRUE )
3082  {
3084  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
3085  // std::cout << "*TEcnaHistos::ViewStex(...)> Data are analyzed from file ----> "
3086  // << fp_name_short << std::endl;
3087 
3091  }
3092  }
3093  if( arg_AlreadyRead >= 1 )
3094  {
3095  OKFileExists = kTRUE;
3096  }
3097 
3098  if( OKFileExists == kTRUE )
3099  {
3100  fStatusFileFound = kTRUE;
3101 
3102  //......................... matrix title (ViewStex)
3103  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
3104  sprintf(f_in_mat_tit, "?");
3105 
3106  if (HistoCode == "D_NOE_ChNb") {sprintf(f_in_mat_tit, "Number of events");}
3107  if (HistoCode == "D_Ped_ChNb") {sprintf(f_in_mat_tit, "Pedestals");}
3108  if (HistoCode == "D_TNo_ChNb") {sprintf(f_in_mat_tit, "Total noise");}
3109  if (HistoCode == "D_MCs_ChNb") {sprintf(f_in_mat_tit, "Mean cor(s,s')");}
3110  if (HistoCode == "D_LFN_ChNb") {sprintf(f_in_mat_tit, "Low frequency noise");}
3111  if (HistoCode == "D_HFN_ChNb") {sprintf(f_in_mat_tit, "High frequency noise");}
3112  if (HistoCode == "D_SCs_ChNb") {sprintf(f_in_mat_tit, "Sigma of cor(s,s')");}
3113 
3114  //................................. Axis parameters
3115  Int_t GeoBidSizeHoco = fEcal->MaxStinHocoInStex()*fEcal->MaxCrysHocoInStin();
3116  Int_t GeoBidSizeVeco = fEcal->MaxStinVecoInStex()*fEcal->MaxCrysVecoInStin();
3117 
3118  Int_t nb_binx = GeoBidSizeHoco;
3119  Int_t nb_biny = GeoBidSizeVeco;
3120  Axis_t xinf_bid = (Axis_t)0.;
3121  Axis_t xsup_bid = (Axis_t)GeoBidSizeHoco;
3122  Axis_t yinf_bid = (Axis_t)0.;
3123  Axis_t ysup_bid = (Axis_t)GeoBidSizeVeco;
3124 
3125  TString axis_x_var_name = " #Hoco ";
3126  TString axis_y_var_name = " #Veco ";
3127 
3128  //............. matrices reading and histogram filling (ViewStex)
3129 
3130  TH2D* h_geo_bid = new TH2D("geobidim_ViewStex", f_in_mat_tit,
3131  nb_binx, xinf_bid, xsup_bid,
3132  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
3133 
3134  h_geo_bid->Reset();
3135 
3136  //............................................... 1D histo reading (ViewStex)
3137  TVectorD partial_histp(fEcal->MaxCrysEcnaInStex());
3138  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++){partial_histp(i)=(Double_t)0.;}
3139 
3140  if( arg_AlreadyRead == fTobeRead )
3141  {
3142  if (HistoCode == "D_NOE_ChNb" ){partial_histp = fMyRootFile->ReadNumberOfEvents(fEcal->MaxCrysEcnaInStex());}
3143  if (HistoCode == "D_Ped_ChNb" ){
3144  partial_histp = fMyRootFile->ReadPedestals(fEcal->MaxCrysEcnaInStex());}
3145  if (HistoCode == "D_TNo_ChNb" ){
3146  partial_histp = fMyRootFile->ReadTotalNoise(fEcal->MaxCrysEcnaInStex());}
3147  if (HistoCode == "D_MCs_ChNb" ){
3149  if (HistoCode == "D_LFN_ChNb" ){
3151  if (HistoCode == "D_HFN_ChNb" ){
3153  if (HistoCode == "D_SCs_ChNb" ){
3155 
3156  OKData = fMyRootFile->DataExist();
3157  }
3158 
3159  if( arg_AlreadyRead >= 1 )
3160  {
3161  partial_histp = arg_read_histo;
3162  OKData = kTRUE;
3163  }
3164 
3165  //------------------------------- Build 2D matrix to be ploted from 1D read histo (ViewStex)
3166  TMatrixD read_matrix(nb_binx, nb_biny);
3167  for(Int_t i=0; i<nb_binx; i++)
3168  {for(Int_t j=0; j<nb_biny; j++){read_matrix(i,j)=(Double_t)0.;}}
3169 
3170  if ( OKData == kTRUE )
3171  {
3172  fStatusDataExist = kTRUE;
3173 
3174  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
3175  {
3176  if( arg_AlreadyRead == fTobeRead )
3177  {n1StexStin = fMyRootFile->GetStexStinFromIndex(i0StexStinEcna);}
3178  if( arg_AlreadyRead >= 1 )
3179  {n1StexStin = i0StexStinEcna+1;}
3180 
3181  if (n1StexStin != -1)
3182  {
3183  //------------------ Geographical bidim filling (ViewStex)
3184  for(Int_t i0StinEcha=0; i0StinEcha<fEcal->MaxCrysInStin(); i0StinEcha++)
3185  {
3186  Int_t iStexEcha = (n1StexStin-1)*fEcal->MaxCrysInStin() + i0StinEcha;
3187  Int_t i_xgeo = GetXCrysInStex(fFapStexNumber, n1StexStin, i0StinEcha);
3188  Int_t i_ygeo = GetYCrysInStex(fFapStexNumber, n1StexStin, i0StinEcha);
3189 
3190  if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
3191  {
3192  read_matrix(i_xgeo, i_ygeo) = partial_histp(iStexEcha);
3193  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
3194  (Double_t)read_matrix(i_xgeo, i_ygeo));
3195  }
3196  }
3197  }
3198  }
3199 
3200  //=============== H I S T O M I N / M A X M A N A G E M E N T ============ (ViewStex)
3201 
3202  //................................ Put histo min max values
3203  //.......... default if flag not set to "ON"
3204  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
3205  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
3206 
3207  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
3208  //.......... user's value if flag set to "ON"
3209  if( fFlagUserHistoMin == "ON" )
3210  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
3211  if( fFlagUserHistoMax == "ON" )
3212  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
3213  //................................. automatic min and/or max
3214  if( fFlagUserHistoMin == "AUTO" )
3215  {SetYminMemoFromValue(HistoCode.Data(), h_geo_bid->GetMinimum()); fFlagUserHistoMin = "OFF";}
3216  if( fFlagUserHistoMax == "AUTO" )
3217  {SetYmaxMemoFromValue(HistoCode.Data(), h_geo_bid->GetMaximum()); fFlagUserHistoMax = "OFF";}
3218  //...................................... histo set ymin and ymax
3219  SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, HistoCode);
3220 
3221  // ************************** A GARDER EN RESERVE *******************************
3222  //............. special contour level for correlations (square root wise scale)
3223  //if ( HistoCode == "D_MCs_ChNb" )
3224  //{
3225  // Int_t nb_niv = 9;
3226  // Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
3227  // SqrtContourLevels(nb_niv, &cont_niv[0]);
3228  // h_geo_bid->SetContour(nb_niv, &cont_niv[0]);
3229  // delete [] cont_niv; fCdelete++;
3230  //}
3231  // ******************************** (FIN RESERVE) *******************************
3232 
3233  // =================================== P L O T S ======================== (ViewStex)
3234 
3235  char* f_in = new char[fgMaxCar]; fCnew++;
3236 
3237  //...................... Taille/format canvas
3238  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
3239  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
3240 
3241  if( fFlagSubDet == "EB")
3242  {canv_h = fCnaParHistos->CanvasFormatH("etaphiSM");
3243  canv_w = fCnaParHistos->CanvasFormatW("etaphiSM");}
3244  if( fFlagSubDet == "EE")
3245  {canv_h = fCnaParHistos->CanvasFormatH("IXIYDee");
3246  canv_w = fCnaParHistos->CanvasFormatW("IXIYDee");}
3247 
3248  //............................................... paves commentaires (ViewStex)
3250 
3251  //------------------------------------ Canvas name ----------------- (ViewStex)
3252  TString name_cov_cor;
3253  Int_t MaxCar = fgMaxCar;
3254  name_cov_cor.Resize(MaxCar);
3255  name_cov_cor = "?";
3256 
3257  if( HistoCode == "D_NOE_ChNb"){name_cov_cor = "Nb_Of_D_Adc_EvDs";}
3258  if( HistoCode == "D_Ped_ChNb"){name_cov_cor = "Pedestals";}
3259  if( HistoCode == "D_TNo_ChNb"){name_cov_cor = "Total_noise";}
3260  if( HistoCode == "D_MCs_ChNb"){name_cov_cor = "Mean_Corss";}
3261  if( HistoCode == "D_LFN_ChNb"){name_cov_cor = "Low_Fq_Noise";}
3262  if( HistoCode == "D_HFN_ChNb"){name_cov_cor = "High_Fq_Noise";}
3263  if( HistoCode == "D_SCs_ChNb"){name_cov_cor = "Sigma_Corss";}
3264 
3265  TString name_visu;
3266  MaxCar = fgMaxCar;
3267  name_visu.Resize(MaxCar);
3268  name_visu = "colz";
3269 
3270  TString flag_already_read;
3271  MaxCar = fgMaxCar;
3272  flag_already_read.Resize(MaxCar);
3273  flag_already_read = "?";
3274  sprintf(f_in,"M%d", arg_AlreadyRead); flag_already_read = f_in;
3275 
3276  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%s%d_%s_HocoVeco_R%s",
3277  name_cov_cor.Data(), fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
3279  name_visu.Data(), flag_already_read.Data());
3280 
3281  if( fFlagSubDet == "EB" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEB");}
3282  if( fFlagSubDet == "EE" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEE");}
3283 
3284  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
3285  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
3286 
3287  // std::cout << "*TEcnaHistos::ViewStex(...)> Plot is displayed on canvas ----> " << f_in << std::endl;
3288 
3289  delete [] f_in; f_in = nullptr; fCdelete++;
3290 
3291  //------------------------ Canvas draw and update ------------ (ViewStex)
3292  if( fPavComGeneralTitle != nullptr ){fPavComGeneralTitle->Draw();}
3293  fPavComStex->Draw();
3294  fPavComAnaRun->Draw();
3295  fPavComNbOfEvts->Draw();
3296 
3297  //----------------------------------------------------------- pad margins
3298  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3299  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
3300  Double_t x_margin = x_low;
3301  Double_t y_margin = y_low;
3302  MainCanvas->Divide( 1, 1, x_margin, y_margin);
3303  // Divide(nx, ny, x_margin, y_margin, color);
3304  gPad->cd(1);
3305  //........................... specific EE
3306  if( fFlagSubDet == "EE" )
3307  {Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
3308  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_Dee") - 0.005;
3309  TVirtualPad* main_subpad = gPad;
3310  main_subpad->SetPad(x_low, y_low, x_up, y_up);}
3311 
3312  //------------------------------------------------------------
3313  h_geo_bid->GetXaxis()->SetTitle(axis_x_var_name);
3314  h_geo_bid->GetYaxis()->SetTitle(axis_y_var_name);
3315 
3316  h_geo_bid->DrawCopy("COLZ");
3317 
3318  // trace de la grille: un rectangle = une tour ou un SC ---------------- (ViewStex)
3320  gPad->Draw();
3321  gPad->Update();
3322 
3323  //..................... retour aux options standard
3324  Bool_t b_true = true;
3325  h_geo_bid->SetStats(b_true);
3326  h_geo_bid->Delete(); h_geo_bid = nullptr; fCdeleteRoot++;
3327 
3328  // delete MainCanvas; fCdeleteRoot++;
3329  } // end of if OKData == kTRUE )
3330  delete [] f_in_mat_tit; f_in_mat_tit = nullptr; fCdelete++;
3331  } // end of if OKFileExists == kTRUE )
3332  else
3333  {
3334  fStatusFileFound = kFALSE;
3335 
3336  std::cout << "!TEcnaHistos::ViewStex(...)> *ERROR* =====> "
3337  << " ROOT file not found" << fTTBELL << std::endl;
3338  }
3339 } // end of ViewStex(...)
3340 
3341 //===========================================================================
3342 //
3343 // StexHocoVecoLHFCorcc(***)
3344 //
3345 // Geographical view of the cor(c,c) matrices (mean over samples) of
3346 // all (Stin_A,Stin_A) [case A=B only] of a given Stex (BIG MATRIX)
3347 //
3348 //===========================================================================
3349 void TEcnaHistos::StexHocoVecoLHFCorcc(const TString& Freq)
3350 {
3351 // (Hoco, Veco) matrices for all the Stins of a Stex
3352 
3358 
3359  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (StexHocoVecoLHFCorcc)
3360  {
3361  fStatusFileFound = kTRUE;
3362 
3364  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
3365  //std::cout << "*TEcnaHistos::StexHocoVecoLHFCorcc(...)> Data are analyzed from file ----> "
3366  // << fp_name_short << std::endl;
3367 
3371 
3372  //......................... matrix title
3373  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
3374 
3375  if( fFlagSubDet == "EB" && Freq == "LF" )
3376  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') for each tower in SM");}
3377  if( fFlagSubDet == "EB" && Freq == "HF" )
3378  {sprintf(f_in_mat_tit, "HF Cor(Xtal,Xtal') for each tower in SM");}
3379  if( fFlagSubDet == "EE" && Freq == "LF" )
3380  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') for each SC in Dee");}
3381  if( fFlagSubDet == "EE" && Freq == "HF" )
3382  {sprintf(f_in_mat_tit, "HF Cor(Xtal,Xtal') for each SC in Dee");}
3383 
3384  //................................. Axis parameters
3385  Int_t GeoBidSizeHoco = fEcal->MaxStinHocoInStex()*fEcal->MaxCrysInStin();
3386  Int_t GeoBidSizeVeco = fEcal->MaxStinVecoInStex()*fEcal->MaxCrysInStin();
3387 
3388  Int_t nb_binx = GeoBidSizeHoco;
3389  Int_t nb_biny = GeoBidSizeVeco;
3390  Axis_t xinf_bid = (Axis_t)0.;
3391  Axis_t xsup_bid = (Axis_t)GeoBidSizeHoco;
3392  Axis_t yinf_bid = (Axis_t)0.;
3393  Axis_t ysup_bid = (Axis_t)GeoBidSizeVeco;
3394 
3395  TString axis_x_var_name = " #Hoco ";
3396  TString axis_y_var_name = " #varVeco ";
3397 
3398  //======================================================== (StexHocoVecoLHFCorcc)
3399  TVectorD Stin_numbers(fEcal->MaxStinEcnaInStex());
3400  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){Stin_numbers(i)=(Double_t)0.;}
3401  Stin_numbers = fMyRootFile->ReadStinNumbers(fEcal->MaxStinEcnaInStex());
3402 
3403  if ( fMyRootFile->DataExist() == kTRUE )
3404  {
3405  fStatusDataExist = kTRUE;
3406 
3407  //............. matrices reading and histogram filling
3408  TMatrixD partial_matrix(fEcal->MaxCrysEcnaInStex(), fEcal->MaxCrysEcnaInStex());
3409  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++)
3410  {for(Int_t j=0; j<fEcal->MaxCrysEcnaInStex(); j++){partial_matrix(i,j)=(Double_t)0.;}}
3411 
3412  if( Freq == "LF")
3413  {
3415  }
3416  if( Freq == "HF")
3417  {
3419  }
3420 
3421  if ( fMyRootFile->DataExist() == kTRUE )
3422  {
3423  fStatusDataExist = kTRUE;
3424 
3425  //............................... 2D histo booking
3426  TH2D* h_geo_bid = new TH2D("geobidim_HocoVecoLHFCorcc", f_in_mat_tit,
3427  nb_binx, xinf_bid, xsup_bid,
3428  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
3429  h_geo_bid->Reset();
3430 
3432 
3433  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
3434  {
3435  Int_t n1StexStin = (Int_t)Stin_numbers(i0StexStinEcna);
3436  Int_t offset_x = ((n1StexStin-1)/fEcal->MaxStinVecoInStex())*fEcal->MaxCrysInStin();
3437  Int_t offset_y = ((n1StexStin-1)%fEcal->MaxStinVecoInStex())*fEcal->MaxCrysInStin();
3438 
3439  if (n1StexStin != -1)
3440  {
3441  //================================================= (StexHocoVecoLHFCorcc)
3442  //------------------ Geographical bidim filling
3443  for(Int_t i0StinEcha=0; i0StinEcha<fEcal->MaxCrysInStin(); i0StinEcha++)
3444  {
3445  for(Int_t j0StinEcha=0; j0StinEcha<fEcal->MaxCrysInStin(); j0StinEcha++)
3446  {
3447  Int_t i_xgeo = offset_x + i0StinEcha;
3448  Int_t i_ygeo = offset_y + j0StinEcha;
3449 
3450  if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
3451  {
3452  Int_t iEcha = (n1StexStin-1)*fEcal->MaxCrysInStin() + i0StinEcha;
3453  Int_t jEcha = (n1StexStin-1)*fEcal->MaxCrysInStin() + j0StinEcha;
3454 
3455  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
3456  (Double_t)partial_matrix(iEcha, jEcha));
3457  }
3458  }
3459  }
3460  }
3461  }
3462 
3463  //=============== H I S T O M I N / M A X M A N A G E M E N T ============ (StexHocoVecoLHFCorcc)
3464 
3465  TString HistoCode = "H2CorccInStins";
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 ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
3473  //.......... user's value if flag set to "ON"
3474  if( fFlagUserHistoMin == "ON" )
3475  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
3476  if( fFlagUserHistoMax == "ON" )
3477  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
3478  //................................. automatic min and/or max
3479  if( fFlagUserHistoMin == "AUTO" )
3480  {SetYminMemoFromValue(HistoCode.Data(), h_geo_bid->GetMinimum()); fFlagUserHistoMin = "OFF";}
3481  if( fFlagUserHistoMax == "AUTO" )
3482  {SetYmaxMemoFromValue(HistoCode.Data(), h_geo_bid->GetMaximum()); fFlagUserHistoMax = "OFF";}
3483  //...................................... histo set ymin and ymax
3484  SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, HistoCode);
3485 
3486  // ----------------------------------- P L O T S (StexHocoVecoLHFCorcc)
3487 
3488  char* f_in = new char[fgMaxCar]; fCnew++;
3489 
3490  //...................... Taille/format canvas
3491 
3492  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
3493  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
3494 
3495  if( fFlagSubDet == "EB")
3496  {canv_h = fCnaParHistos->CanvasFormatH("etaphiSM");
3497  canv_w = fCnaParHistos->CanvasFormatW("etaphiSM");}
3498  if( fFlagSubDet == "EE")
3499  {canv_h = fCnaParHistos->CanvasFormatH("IXIYDee");
3500  canv_w = fCnaParHistos->CanvasFormatW("IXIYDee");}
3501 
3502  //..................................... paves commentaires (StexHocoVecoLHFCorcc)
3504 
3505  //----------------- Canvas name ------- (StexHocoVecoLHFCorcc)
3506  TString name_cov_cor;
3507  Int_t MaxCar = fgMaxCar;
3508  name_cov_cor.Resize(MaxCar);
3509  if( Freq == "LF" ){name_cov_cor = "StexLFCorcc";}
3510  if( Freq == "HF" ){name_cov_cor = "StexHFCorcc";}
3511 
3512  TString name_visu;
3513  MaxCar = fgMaxCar;
3514  name_visu.Resize(MaxCar);
3515  name_visu = "colz";
3516 
3517  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_Stex%s%d_%s_HocoVeco",
3518  name_cov_cor.Data(), fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
3520  name_visu.Data());
3521 
3522  if( fFlagSubDet == "EB" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEB");}
3523  if( fFlagSubDet == "EE" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEE");}
3524 
3525  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
3526  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
3527 
3528  // std::cout << "*TEcnaHistos::StexHocoVecoLHFCorcc(...)> Plot is displayed on canvas ----> "
3529  // << f_in << std::endl;
3530 
3531  delete [] f_in; f_in = nullptr; fCdelete++;
3532 
3533  //------------ Canvas draw and update ------ (StexHocoVecoLHFCorcc)
3534  if( fPavComGeneralTitle != nullptr ){fPavComGeneralTitle->Draw();}
3535  fPavComStex->Draw();
3536  fPavComAnaRun->Draw();
3537  fPavComNbOfEvts->Draw();
3538 
3539  //----------------------------------------------------------- pad margins
3540  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3541  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
3542  Double_t x_margin = x_low;
3543  Double_t y_margin = y_low;
3544  MainCanvas->Divide( 1, 1, x_margin, y_margin);
3545  // Divide(nx, ny, x_margin, y_margin, color);
3546  gPad->cd(1);
3547  //........................... specific EE
3548  if( fFlagSubDet == "EE" )
3549  {
3550  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
3551  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_Dee") - 0.005;
3552  TVirtualPad* main_subpad = gPad;
3553  main_subpad->SetPad(x_low, y_low, x_up, y_up);
3554  }
3555 
3556  h_geo_bid->GetXaxis()->SetTitle(axis_x_var_name);
3557  h_geo_bid->GetYaxis()->SetTitle(axis_y_var_name);
3558 
3559  h_geo_bid->DrawCopy("COLZ");
3560 
3561  // trace de la grille: un rectangle = une tour (StexHocoVecoLHFCorcc)
3562  ViewStexGrid(fFapStexNumber, "corcc");
3563  gPad->Draw();
3564  gPad->Update();
3565 
3566  //..................... retour aux options standard
3567  Bool_t b_true = true;
3568  h_geo_bid->SetStats(b_true);
3569  h_geo_bid->Delete(); h_geo_bid = nullptr; fCdeleteRoot++;
3570 
3571  // delete MainCanvas; fCdeleteRoot++;
3572  }
3573  }
3574  delete [] f_in_mat_tit; f_in_mat_tit = nullptr; fCdelete++;
3575  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
3576  else
3577  {
3578  fStatusFileFound = kFALSE;
3579 
3580  std::cout << "!TEcnaHistos::StexHocoVecoLHFCorcc(...)> *ERROR* =====> "
3581  << " ROOT file not found" << fTTBELL << std::endl;
3582  }
3583 } // end of StexHocoVecoLHFCorcc
3584 
3585 //==================================================================================
3586 //
3587 // GetXCrysInStex, GetYCrysInStex
3588 //
3589 //==================================================================================
3590 Int_t TEcnaHistos::GetXCrysInStex(const Int_t& StexNumber, const Int_t& n1StexStin,
3591  const Int_t& i0StinEcha)
3592 {
3593 //Gives the X crystal coordinate in the geographic view of one Stex
3594 // (X = 0 to MaxStinHocoInStex*NbCrysHocoInStin - 1)
3595 
3596  Int_t ix_geo = 0;
3597 
3598  if( fFlagSubDet == "EB")
3599  {TString ctype = fEcalNumbering->GetStexHalfStas(StexNumber);
3600  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha, StexNumber);
3601  ix_geo = (n1StexCrys-1)/fEcal->MaxCrysVecoInStex(); // ix_geo for EB+
3602  if( ctype == "EB-"){ix_geo = fEcal->MaxCrysHocoInStex() - ix_geo - 1;}}
3603 
3604  if( fFlagSubDet == "EE")
3605  {TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(StexNumber);
3606  ix_geo = 0;
3607  if( DeeDir == "right" )
3608  {ix_geo = fEcalNumbering->GetIXCrysInDee(StexNumber, n1StexStin, i0StinEcha) - 1;}
3609  if( DeeDir == "left" )
3610  {ix_geo = fEcal->MaxCrysIXInDee() - fEcalNumbering->GetIXCrysInDee(StexNumber, n1StexStin, i0StinEcha);}}
3611 
3612  return ix_geo;
3613 }
3614 
3615 Int_t TEcnaHistos::GetYCrysInStex(const Int_t& StexNumber, const Int_t& n1StexStin,
3616  const Int_t& j0StinEcha)
3617 {
3618 //Gives the Y crystal coordinate in the geographic view of one Stex
3619 // (Y = 0 to MaxStinVecoInStex*NbCrysVecoInStin - 1)
3620 
3621  Int_t iy_geo = 0;
3622 
3623  if( fFlagSubDet == "EB")
3624  {TString ctype = fEcalNumbering->GetStexHalfStas(StexNumber);
3625  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(n1StexStin, j0StinEcha, StexNumber);
3626  Int_t ix_geo = (n1StexCrys-1)/fEcal->MaxCrysVecoInStex(); // ix_geo for EB+
3627  iy_geo = n1StexCrys - 1 - ix_geo*fEcal->MaxCrysVecoInStex(); // iy_geo for EB+
3628  if( ctype == "EB-"){iy_geo = fEcal->MaxCrysVecoInStex() - iy_geo - 1;}}
3629 
3630  if( fFlagSubDet == "EE")
3631  {iy_geo = fEcalNumbering->GetJYCrysInDee(StexNumber, n1StexStin, j0StinEcha) - 1;}
3632 
3633  return iy_geo;
3634 }
3635 
3636 //===========================================================================
3637 //
3638 // StexStinNumbering, ViewStexStinNumberingPad
3639 //
3640 // independent of the ROOT file => StexNumber as argument
3641 //
3642 //===========================================================================
3643 void TEcnaHistos::StexStinNumbering(const Int_t& StexNumber)
3644 {
3645 //display the Stin numbering of the Stex
3646 
3647  if( fFlagSubDet == "EB" ){SMTowerNumbering(StexNumber);}
3648  if( fFlagSubDet == "EE" ){DeeSCNumbering(StexNumber);}
3649 }
3650 // end of StexStinNumbering
3651 
3652 //=============================================================================
3653 //
3654 // ViewStexStinNumberingPad
3655 // independent of the ROOT file => StexNumber as argument
3656 //
3657 //=============================================================================
3658 void TEcnaHistos::ViewStexStinNumberingPad(const Int_t& StexNumber)
3659 {
3660 //display the Stin numbering of the Stex in a Pad
3661 
3662  if( fFlagSubDet == "EB"){ViewSMTowerNumberingPad(StexNumber);}
3663  if( fFlagSubDet == "EE"){ViewDeeSCNumberingPad(StexNumber);}
3664 }
3665 //----------------> end of ViewStexStinNumberingPad()
3666 
3667 //==========================================================================
3668 //
3669 // ViewStexGrid
3670 // independent of the ROOT file => StexNumber as argument
3671 //
3672 //==========================================================================
3673 void TEcnaHistos::ViewStexGrid(const Int_t& StexNumber, const TString& c_option)
3674 {
3675  //Grid of one Stex with axis Hoco and Veco
3676 
3677  if( fFlagSubDet == "EB"){ViewSMGrid(StexNumber, c_option);}
3678  if( fFlagSubDet == "EE"){ViewDeeGrid(StexNumber, c_option);}
3679 
3680 } // end of ViewStexGrid
3681 
3682 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& S P E C I F I C &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
3683 
3684 //======================================= BARREL ===============================
3685 void TEcnaHistos::SMTowerNumbering(const Int_t& SMNumber)
3686 {
3687  //display the tower numbering of the super-module
3688 
3689  if( (SMNumber > 0) && (SMNumber <= fEcal->MaxSMInEB()) )
3690  {
3691  Int_t GeoBidSizeEta = fEcal->MaxTowEtaInSM()*fEcal->MaxCrysEtaInTow();
3692  Int_t GeoBidSizePhi = fEcal->MaxTowPhiInSM()*fEcal->MaxCrysPhiInTow();
3693 
3694  Int_t nb_binx = GeoBidSizeEta;
3695  Int_t nb_biny = GeoBidSizePhi;
3696  Axis_t xinf_bid = (Axis_t)0.;
3697  Axis_t xsup_bid = (Axis_t)GeoBidSizeEta;
3698  Axis_t yinf_bid = (Axis_t)0.;
3699  Axis_t ysup_bid = (Axis_t)GeoBidSizePhi;
3700 
3701  TString axis_x_var_name = " #eta ";
3702  TString axis_y_var_name = " #varphi ";
3703 
3704  //------------------------------------------------------------------- SMTowerNumbering
3705 
3706  //............. matrices reading and histogram filling
3707  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
3708 
3709  if( SMNumber <= fEcal->MaxSMPhiInEB() )
3710  {sprintf(f_in_mat_tit, " SM tower numbering");}
3711  if( SMNumber > fEcal->MaxSMPhiInEB() )
3712  {sprintf(f_in_mat_tit, " SM tower numbering ");}
3713 
3714  // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
3715 
3716  TH2D* h_empty_bid = new TH2D("grid_bidim_eta_phi", f_in_mat_tit,
3717  nb_binx, xinf_bid, xsup_bid,
3718  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
3719  h_empty_bid->Reset();
3720 
3721  h_empty_bid->GetXaxis()->SetTitle(axis_x_var_name);
3722  h_empty_bid->GetYaxis()->SetTitle(axis_y_var_name);
3723 
3724  // ------------------------------------------------ P L O T S (SMTowerNumbering)
3725 
3726  char* f_in = new char[fgMaxCar]; fCnew++;
3727 
3728  //...................... Taille/format canvas
3729 
3730  UInt_t canv_h = fCnaParHistos->CanvasFormatH("etaphiSM");
3731  UInt_t canv_w = fCnaParHistos->CanvasFormatW("etaphiSM");
3732 
3733  //............................................... options generales
3734 
3736 
3737  //............................................... paves commentaires (SMTowerNumbering)
3738  SetAllPavesViewStex("Numbering", SMNumber);
3739 
3740  //------------------------------------ Canvas name ----------------- (SMTowerNumbering)
3741 
3742  sprintf(f_in, "tower_numbering_for_SuperModule_SM%d", SMNumber);
3743 
3744  SetHistoPresentation((TH1D*)h_empty_bid,"Stex2DEB");
3745 
3746  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
3747  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
3748 
3749  // std::cout << "*TEcnaHistosEB::ViewSM(...)> Plot is displayed on canvas ----> " << f_in << std::endl;
3750 
3751  delete [] f_in; f_in = nullptr; fCdelete++;
3752 
3753  //------------------------ Canvas draw and update ------------ (SMTowerNumbering)
3754  fPavComStex->Draw();
3755 
3756  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3757  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
3758  MainCanvas->Divide(1, 1, x_margin, y_margin);
3759  gPad->cd(1);
3760 
3761  h_empty_bid->DrawCopy("COL"); // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
3762 
3763  ViewSMTowerNumberingPad(SMNumber);
3764  gPad->Update();
3765 
3766  //..................... retour aux options standard
3767  Bool_t b_true = true;
3768  h_empty_bid->SetStats(b_true);
3769 
3770  h_empty_bid->Delete(); h_empty_bid = nullptr; fCdeleteRoot++;
3771 
3772  // delete MainCanvas; fCdeleteRoot++;
3773 
3774  delete [] f_in_mat_tit; f_in_mat_tit = nullptr; fCdelete++;
3775  }
3776  else
3777  {
3778  std::cout << "!TEcnaHistos::SMTowerNumbering(...)> SM = " << SMNumber
3779  << ". Out of range ( range = [1," << fEcal->MaxSMInEB() << "] )" << fTTBELL << std::endl;
3780  }
3781 }
3782 // end of SMTowerNumbering
3783 
3784 void TEcnaHistos::ViewSMTowerNumberingPad(const Int_t& SMNumber)
3785 {
3786  //display the tower numbering of the super-module in a Pad
3787 
3788  gStyle->SetTitleW(0.2); // taille titre histos
3789  gStyle->SetTitleH(0.07);
3790 
3791  ViewSMGrid(SMNumber, " ");
3792 
3793  Color_t couleur_rouge = fCnaParHistos->SetColorsForNumbers("lvrb_top");
3794  Color_t couleur_bleu_fonce = fCnaParHistos->SetColorsForNumbers("lvrb_bottom");
3795 
3796  //..... Ecriture des numeros de tours dans la grille..... (ViewSMTowerNumberingPad)
3797 
3798  char* f_in = new char[fgMaxCar]; fCnew++;
3799  gStyle->SetTextSize(0.075);
3800 
3801  // x_channel, y_channel: coordinates of the text "Txx"
3802  Int_t y_channel = 12;
3803  Int_t x_channel = 12;
3804 
3805  Int_t max_tow_phi = fEcal->MaxTowPhiInSM()*fEcal->MaxCrysPhiInTow();
3806 
3807  //------------------ LOOP ON THE SM_TOWER NUMBER (ViewSMTowerNumberingPad)
3808 
3809  TText *text_SMtow_num = new TText(); fCnewRoot++;
3810 
3811  for (Int_t i_SMtow = 1; i_SMtow <= fEcal->MaxTowInSM(); i_SMtow++)
3812  {
3813  if(fEcalNumbering->GetTowerLvrbType(i_SMtow) == "top")
3814  {text_SMtow_num->SetTextColor(couleur_rouge);}
3815  if(fEcalNumbering->GetTowerLvrbType(i_SMtow) == "bottom")
3816  {text_SMtow_num->SetTextColor(couleur_bleu_fonce);}
3817 
3818  //................................ x from eta
3819  Double_t x_from_eta = fEcalNumbering->GetEta(SMNumber, i_SMtow, x_channel) - (Double_t)1;
3820  if(fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-")
3821  {x_from_eta = fEcal->MaxTowEtaInSM()*fEcal->MaxCrysEtaInTow() + x_from_eta + (Double_t)1;}
3822 
3823  //................................ y from phi
3824  Double_t y_from_phi = max_tow_phi - 1
3825  - (fEcalNumbering->GetPhi(SMNumber, i_SMtow, y_channel) - fEcalNumbering->GetPhiMin(SMNumber));
3826  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-")
3827  {y_from_phi = - y_from_phi + fEcal->MaxTowPhiInSM()*fEcal->MaxCrysPhiInTow() - (Double_t)1;}
3828 
3829  sprintf(f_in, "%d", i_SMtow);
3830  text_SMtow_num->DrawText(x_from_eta, y_from_phi, f_in); // <=== prend du temps si on mets "T%d" dans le sprintf
3831  }
3832 
3833  text_SMtow_num->Delete(); text_SMtow_num = nullptr; fCdeleteRoot++;
3834 
3835  //.................................................... legende (ViewSMTowerNumberingPad)
3836  Double_t offset_tow_tex_eta = (Double_t)8.;
3837  Double_t offset_tow_tex_phi = (Double_t)15.;
3838 
3839  Color_t couleur_noir = fCnaParHistos->ColorDefinition("noir");
3840  Double_t x_legend = (Double_t)0.;
3841  Double_t y_legend = (Double_t)0.;
3842 
3843  Int_t ref_tower = fEcal->MaxTowInSM();
3844 
3845  //................................................. LVRB TOP (ViewSMTowerNumberingPad)
3846  gStyle->SetTextSize(0.075);
3847  gStyle->SetTextColor(couleur_rouge);
3848  x_legend = fEcalNumbering->GetEta(SMNumber, ref_tower, x_channel);
3849  y_legend = fEcalNumbering->GetPhi(SMNumber, ref_tower, y_channel) - fEcalNumbering->GetPhiMin(SMNumber);
3850 
3851  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+" )
3852  {
3853  x_legend = x_legend + offset_tow_tex_eta;
3854  y_legend = y_legend + offset_tow_tex_phi;
3855  }
3856  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-" )
3857  {
3858  x_legend = -x_legend + offset_tow_tex_eta;
3859  y_legend = y_legend + offset_tow_tex_phi;
3860  }
3861 
3862  sprintf( f_in, "xx");
3863  TText *text_legend_rouge = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3864  text_legend_rouge->Draw();
3865  gStyle->SetTextSize(0.05);
3866  x_legend = x_legend - (Double_t)3.5;
3867  y_legend = y_legend - (Double_t)2.;
3868  sprintf(f_in, " LVRB ");
3869  TText *text_legend_rouge_expl = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3870  text_legend_rouge_expl->Draw();
3871  y_legend = y_legend - (Double_t)1.75;
3872  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+" ){sprintf(f_in, " <--- ");}
3873  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-" ){sprintf(f_in, " ---> ");}
3874  TText *text_legend_rouge_expm = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3875  text_legend_rouge_expm->Draw();
3876  //text_legend_rouge_expl->Delete(); text_legend_rouge_expl = 0; fCdeleteRoot++;
3877 
3878  //................................................. LVRB BOTTOM (ViewSMTowerNumberingPad)
3879  gStyle->SetTextSize(0.075);
3880  gStyle->SetTextColor(couleur_bleu_fonce);
3881  x_legend = fEcalNumbering->GetEta(SMNumber, ref_tower, x_channel);
3882  y_legend = fEcalNumbering->GetPhi(SMNumber, ref_tower, y_channel) - fEcalNumbering->GetPhiMin(SMNumber);
3883 
3884  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+" )
3885  {
3886  x_legend = x_legend + offset_tow_tex_eta;
3887  y_legend = y_legend + offset_tow_tex_phi/3;
3888  }
3889  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-" )
3890  {
3891  x_legend = -x_legend + offset_tow_tex_eta;
3892  y_legend = y_legend + offset_tow_tex_phi/3;
3893  }
3894 
3895  sprintf(f_in, "xx");
3896  TText *text_legend_bleu = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3897  text_legend_bleu->Draw();
3898  //text_legend_bleu->Delete(); text_legend_bleu = 0; fCdeleteRoot++;
3899  gStyle->SetTextSize(0.05);
3900  x_legend = x_legend - (Double_t)3.5;
3901  y_legend = y_legend - (Double_t)2.;
3902  sprintf( f_in, " LVRB ");
3903  TText *text_legend_bleu_expl = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3904  text_legend_bleu_expl->Draw();
3905  y_legend = y_legend - (Double_t)1.75;
3906  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+" ){sprintf( f_in, " ---> ");}
3907  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-" ){sprintf( f_in, " <--- ");}
3908  TText *text_legend_bleu_expm = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3909  text_legend_bleu_expm->Draw();
3910  //text_legend_bleu_expl->Delete(); text_legend_bleu_expl = 0; fCdeleteRoot++;
3911 
3912  delete [] f_in; f_in = nullptr; fCdelete++;
3913 
3914  gStyle->SetTextColor(couleur_noir);
3915 }
3916 //----------------> end of ViewSMTowerNumberingPad()
3917 
3918 void TEcnaHistos::ViewSMGrid(const Int_t& SMNumber, const TString& c_option)
3919 {
3920  //Grid of one supermodule with axis eta and phi
3921 
3922  Int_t GeoBidSizeEta = fEcal->MaxTowEtaInSM()*fEcal->MaxCrysEtaInTow();
3923  Int_t GeoBidSizePhi = fEcal->MaxTowPhiInSM()*fEcal->MaxCrysPhiInTow();
3924 
3925  if ( c_option == "corcc")
3926  {
3927  GeoBidSizeEta = fEcal->MaxTowEtaInSM()*fEcal->MaxCrysInTow();
3928  GeoBidSizePhi = fEcal->MaxTowPhiInSM()*fEcal->MaxCrysInTow();
3929  }
3930 
3931  Int_t nb_binx = GeoBidSizeEta;
3932  Int_t nb_biny = GeoBidSizePhi;
3933  Axis_t xinf_bid = (Axis_t)0.;
3934  Axis_t xsup_bid = (Axis_t)GeoBidSizeEta;
3935  Axis_t yinf_bid = (Axis_t)0.;
3936  Axis_t ysup_bid = (Axis_t)GeoBidSizePhi;
3937 
3938  //---------------- trace de la grille: un rectangle = une tour
3939 
3940  Int_t size_eta = fEcal->MaxCrysEtaInTow();
3941  Int_t size_phi = fEcal->MaxCrysPhiInTow();
3942  if ( c_option == "corcc")
3943  {
3944  size_eta = fEcal->MaxCrysInTow();
3945  size_phi = fEcal->MaxCrysInTow();
3946  }
3947  Int_t max_x = nb_binx/size_eta;
3948  Int_t max_y = nb_biny/size_phi;
3949 
3950  //............................. lignes horizontales
3951  Double_t yline = (Double_t)yinf_bid;
3952 
3953  Double_t xline_left = (Double_t)xinf_bid;
3954  Double_t xline_right = (Double_t)xsup_bid;
3955 
3956  for( Int_t j = 0 ; j < max_y ; j++)
3957  {
3958  yline = yline + (Double_t)size_phi;
3959  TLine *lin;
3960  lin = new TLine(xline_left, yline, xline_right, yline); fCnewRoot++;
3961  lin->Draw();
3962  // delete lin; fCdeleteRoot++;
3963  }
3964 
3965  //.......................... lignes verticales
3966  Double_t xline = (Double_t)xinf_bid - (Double_t)size_eta;
3967 
3968  Double_t yline_bot = (Double_t)yinf_bid;
3969  Double_t yline_top = (Double_t)ysup_bid;
3970 
3971  Color_t coul_surligne = fCnaParHistos->ColorDefinition("noir");
3972  Color_t coul_textmodu = fCnaParHistos->ColorDefinition("vert36");
3973 
3974  //............................ Mj text
3975  gStyle->SetTextColor(coul_textmodu);
3976  gStyle->SetTextSize(0.075);
3977 
3978  char* f_in = new char[fgMaxCar]; fCnew++;
3979 
3980  for( Int_t i = 0 ; i < max_x ; i++)
3981  {
3982  xline = xline + (Double_t)size_eta;
3983  TLine *lin;
3984  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
3985 
3986  //............. Surlignage separateur des modules
3987  if( (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") && (i == 4 || i == 8 || i == 12) )
3988  {lin->SetLineWidth(2); lin->SetLineColor(coul_surligne);}
3989  if( (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+") && (i == 5 || i == 9 || i == 13) )
3990  {lin->SetLineWidth(2); lin->SetLineColor(coul_surligne);}
3991 
3992  lin->Draw();
3993  // delete lin; fCdeleteRoot++;
3994 
3995  //............. Numeros des modules
3996  if( (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") && (i == 2 || i == 6 || i == 10 || i == 14) )
3997  {
3998  if( i == 2 ){sprintf( f_in, "M4");}
3999  if( i == 6 ){sprintf( f_in, "M3");}
4000  if( i == 10 ){sprintf( f_in, "M2");}
4001  if( i == 14 ){sprintf( f_in, "M1");}
4002 
4003  TText *text_num_module = new TText(xline + 1, yline_top + 1, f_in); fCnewRoot++;
4004  text_num_module->Draw();
4005  //text_num_module->Delete(); text_num_module = 0; fCdeleteRoot++;
4006  }
4007  if( (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+") && (i == 3 || i == 7 || i == 11 || i == 15) )
4008  {
4009  if( i == 3 ){sprintf( f_in, "M1");}
4010  if( i == 7 ){sprintf( f_in, "M2");}
4011  if( i == 11 ){sprintf( f_in, "M3");}
4012  if( i == 15 ){sprintf( f_in, "M4");}
4013 
4014  TText *text_num_module = new TText(xline, yline_top + 1, f_in); fCnewRoot++;
4015  text_num_module->Draw();
4016  //text_num_module->Delete(); text_num_module = 0; fCdeleteRoot++;
4017  }
4018  }
4019  delete [] f_in; f_in = nullptr; fCdelete++;
4020 
4021  //------------------ trace axes en eta et phi --------------- ViewSMGrid
4022 
4023  Int_t MatSize = fEcal->MaxCrysEtaInTow();
4024  if ( c_option == "corcc"){MatSize = fEcal->MaxCrysInTow();}
4025 
4026  Int_t size_eta_sm = fEcal->MaxTowEtaInSM();
4027  Int_t size_phi_sm = fEcal->MaxTowPhiInSM();
4028 
4029  //...................................................... Axe i(eta) (bottom x) ViewSMGrid
4030  Double_t eta_min = fEcalNumbering->GetIEtaMin(SMNumber);
4031  Double_t eta_max = fEcalNumbering->GetIEtaMax(SMNumber);
4032 
4033  TString x_var_name = GetHocoVecoAxisTitle("ietaSM");;
4034  TString x_direction = fEcalNumbering->GetXDirectionEB(SMNumber);
4035 
4036  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
4037  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize("SMx");
4038  Float_t tic_siz_x = fCnaParHistos->AxisTickSize("SMx");
4039  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("SMx");
4040  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("SMx");
4041 
4042  new TF1("f1", x_direction.Data(), eta_min, eta_max); fCnewRoot++;
4043  TGaxis* sup_axis_x = nullptr;
4044 
4045  if( x_direction == "-x" ) // NEVER IN THIS CASE: xmin->xmax <=> right->left ("-x") direction
4046  {sup_axis_x = new TGaxis( (Float_t)0., (Float_t)0., (Float_t)(size_eta_sm*MatSize), (Float_t)0.,
4047  "f1", size_eta_sm, "SC" , 0.); fCnewRoot++;}
4048 
4049  if( x_direction == "x" ) // ALWAYS IN THIS CASE: xmin->xmax <=> left->right ("x") direction
4050  {sup_axis_x = new TGaxis( (Float_t)0., (Float_t)0., (Float_t)(size_eta_sm*MatSize), (Float_t)0.,
4051  "f1", size_eta_sm, "SC" , 0.); fCnewRoot++;}
4052 
4053  sup_axis_x->SetTitle(x_var_name);
4054  sup_axis_x->SetTitleSize(tit_siz_x);
4055  sup_axis_x->SetTitleOffset(tit_off_x);
4056  sup_axis_x->SetLabelSize(lab_siz_x);
4057  sup_axis_x->SetLabelOffset(lab_off_x);
4058  sup_axis_x->SetTickSize(tic_siz_x);
4059  sup_axis_x->Draw("SAME");
4060 
4061  //...................................................... Axe phi (y) ViewSMGrid
4062  Double_t phi_min = fEcalNumbering->GetPhiMin(SMNumber);
4063  Double_t phi_max = fEcalNumbering->GetPhiMax(SMNumber);
4064 
4065  TString y_var_name = GetHocoVecoAxisTitle("phi");
4066  TString y_direction = fEcalNumbering->GetYDirectionEB(SMNumber);
4067 
4068  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
4069  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize("SMy");
4070  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("SMy");
4071  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("SMy");
4072  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("SMy");
4073 
4074  new TF1("f2", y_direction.Data(), phi_min, phi_max); fCnewRoot++;
4075  TGaxis* sup_axis_y = nullptr;
4076 
4077  if ( y_direction == "-x" ) // ALWAYS IN THIS CASE: ymin->ymax <=> top->bottom ("-x") direction
4078  {sup_axis_y = new TGaxis(-(Float_t)1.5*(Float_t)size_eta, (Float_t)0.,
4079  -(Float_t)1.5*(Float_t)size_eta, (Float_t)(size_phi_sm*MatSize),
4080  "f2", (Int_t)size_phi_sm, "SC", 0.); fCnewRoot++;}
4081 
4082  if ( y_direction == "x" ) // NEVER IN THIS CASE: ymin->ymax <=> bottom->top ("x") direction
4083  {sup_axis_y = new TGaxis(-(Float_t)1.5*(Float_t)size_eta, (Float_t)0.,
4084  -(Float_t)1.5*(Float_t)size_eta, (Float_t)(size_phi_sm*MatSize),
4085  "f2", (Int_t)size_phi_sm, "SC", 0.); fCnewRoot++;}
4086 
4087  sup_axis_y->SetTitle(y_var_name);
4088  sup_axis_y->SetTitleSize(tit_siz_y);
4089  sup_axis_y->SetTitleOffset(tit_off_y);
4090  sup_axis_y->SetLabelSize(lab_siz_y);
4091  sup_axis_y->SetLabelOffset(lab_off_y);
4092  sup_axis_y->SetTickSize(tic_siz_y);
4093  sup_axis_y->Draw("SAME");
4094 
4095  //...................................................... Axe jphi (jy) ViewSMGrid
4096  Double_t jphi_min = fEcalNumbering->GetJPhiMin(SMNumber);
4097  Double_t jphi_max = fEcalNumbering->GetJPhiMax(SMNumber);
4098 
4099  TString jy_var_name = " ";
4100  TString jy_direction = fEcalNumbering->GetJYDirectionEB(SMNumber);
4101 
4102  new TF1("f3", jy_direction.Data(), jphi_min, jphi_max); fCnewRoot++;
4103  TGaxis* sup_axis_jy = nullptr;
4104 
4105  //............; essai
4106  sup_axis_jy = new TGaxis((Float_t)0., (Float_t)0.,
4107  (Float_t)0., (Float_t)(size_phi_sm*MatSize),
4108  "f3", (Int_t)size_phi_sm, "SC", 0.); fCnewRoot++;
4109 
4110  if ( jy_direction == "-x" ) // IN THIS CASE FOR EB+: ymin->ymax <=> top->bottom ("-x") direction
4111  {jy_var_name = GetEtaPhiAxisTitle("jphiSMB+");}
4112 
4113  if ( jy_direction == "x" ) // IN THIS CASE FOR EB-: ymin->ymax <=> bottom->top ("x") direction
4114  {jy_var_name = GetEtaPhiAxisTitle("jphiSMB-");}
4115 
4116  lab_off_y = fCnaParHistos->AxisLabelOffset("SMyInEB");
4117 
4118  sup_axis_jy->SetTitle(jy_var_name);
4119  sup_axis_jy->SetTitleSize(tit_siz_y);
4120  sup_axis_jy->SetTitleOffset(tit_off_y);
4121  sup_axis_jy->SetLabelSize(lab_siz_y);
4122  sup_axis_jy->SetLabelOffset(lab_off_y);
4123  sup_axis_jy->SetTickSize(tic_siz_y);
4124  sup_axis_jy->Draw("SAME");
4125 
4126  //--------------------------- ViewSMGrid
4127 
4128  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
4129 
4130 } // end of ViewSMGrid
4131 
4132 //======================================= ENDCAP ===============================
4133 void TEcnaHistos::DeeSCNumbering(const Int_t& DeeNumber)
4134 {
4135  //display the SC numbering of the Dee
4136 
4137  if( (DeeNumber > 0) && (DeeNumber <= fEcal->MaxDeeInEE()) )
4138  {
4139  Int_t GeoBidSizeIX = fEcal->MaxSCIXInDee()*fEcal->MaxCrysIXInSC();
4140  Int_t GeoBidSizeIY = fEcal->MaxSCIYInDee()*fEcal->MaxCrysIYInSC();
4141 
4142  Int_t nb_binx = GeoBidSizeIX;
4143  Int_t nb_biny = GeoBidSizeIY;
4144  Axis_t xinf_bid = (Axis_t)0.;
4145  Axis_t xsup_bid = (Axis_t)GeoBidSizeIX;
4146  Axis_t yinf_bid = (Axis_t)0.;
4147  Axis_t ysup_bid = (Axis_t)GeoBidSizeIY;
4148 
4149  TString axis_x_var_name = " IX ";
4150  TString axis_y_var_name = " IY ";
4151 
4152  //------------------------------------------------------------------- DeeSCNumbering
4153 
4154  //........................................... empty histogram filling
4155  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
4156 
4157  sprintf(f_in_mat_tit, " Dee SC numbering ");
4158 
4159  // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
4160 
4161  TH2D* h_empty_bid = new TH2D("grid_bidim_IX_IY", f_in_mat_tit,
4162  nb_binx, xinf_bid, xsup_bid,
4163  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
4164 
4165  delete [] f_in_mat_tit; f_in_mat_tit = nullptr; fCdelete++;
4166 
4167  h_empty_bid->Reset();
4168 
4169  h_empty_bid->GetXaxis()->SetTitle(axis_x_var_name);
4170  h_empty_bid->GetYaxis()->SetTitle(axis_y_var_name);
4171 
4172  // ------------------------------------------------ P L O T S (DeeSCNumbering)
4173 
4174  char* f_in = new char[fgMaxCar]; fCnew++;
4175 
4176  //...................... Taille/format canvas
4177 
4178  UInt_t canv_h = fCnaParHistos->CanvasFormatH("IXIYDee");
4179  UInt_t canv_w = fCnaParHistos->CanvasFormatW("IXIYDee");
4180 
4181  //............................................... options generales
4183 
4184  //............................................... paves commentaires (DeeSCNumbering)
4185  SetAllPavesViewStex("Numbering", DeeNumber);
4186 
4187  //------------------------------------ Canvas name ----------------- (DeeSCNumbering)
4188 
4189  sprintf(f_in, "SC_numbering_for_Dee_Dee%d", DeeNumber);
4190  SetHistoPresentation((TH1D*)h_empty_bid,"Stex2DEENb");
4191  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
4192  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
4193 
4194  // std::cout << "*TEcnaHistosEE::ViewDee(...)> Plot is displayed on canvas ----> " << f_in << std::endl;
4195 
4196  delete [] f_in; f_in = nullptr; fCdelete++;
4197 
4198  //------------------------ Canvas draw and update ------------ (DeeSCNumbering)
4199  fPavComStex->Draw();
4200  fPavComCxyz->Draw();
4201 
4202  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
4203  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
4204  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
4205  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_Dee") - 0.005;
4206 
4207  Double_t x_margin = x_low;
4208  Double_t y_margin = y_low;
4209 
4210  MainCanvas->Divide( 1, 1, x_margin, y_margin);
4211  // Divide(nx, ny, x_margin, y_margin, color);
4212 
4213  gPad->cd(1);
4214  TVirtualPad* main_subpad = gPad;
4215  main_subpad->SetPad(x_low, y_low, x_up, y_up);
4216 
4217  h_empty_bid->DrawCopy("COL"); // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
4218 
4219  ViewDeeSCNumberingPad(DeeNumber);
4220 
4221  gPad->Update(); // prend beaucoup de temps...
4222 
4223  //..................... retour aux options standard
4224  Bool_t b_true = true;
4225  h_empty_bid->SetStats(b_true);
4226 
4227  h_empty_bid->Delete(); h_empty_bid = nullptr; fCdeleteRoot++;
4228 
4229  // delete MainCanvas; fCdeleteRoot++;
4230  }
4231  else
4232  {
4233  std::cout << "!TEcnaHistos::DeeSCNumbering(...)> Dee = " << DeeNumber
4234  << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )" << fTTBELL << std::endl;
4235  }
4236 }
4237 // end of DeeSCNumbering
4238 
4239 void TEcnaHistos::ViewDeeSCNumberingPad(const Int_t& DeeNumber)
4240 {
4241 //display the SC numbering of the Dee in a Pad
4242 
4243  gStyle->SetTitleW(0.4); // taille titre histos
4244  gStyle->SetTitleH(0.08);
4245 
4246  ViewDeeGrid(DeeNumber, " ");
4247 
4248  //..... SC numbers writing in the grid .... (ViewDeeSCNumberingPad)
4249 
4250  char* f_in = new char[fgMaxCar]; fCnew++;
4251  gStyle->SetTextSize(0.0325);
4252 
4253  //------------------ LOOP ON THE Dee_SC NUMBER (ViewDeeSCNumberingPad)
4254  Int_t x_channel = 0; // => defined here after according to DeeDir and SCQuadType
4255  TText *text_DSSC_num = new TText(); fCnewRoot++;
4256  TText *text_DeeSCCons_num = new TText(); fCnewRoot++;
4257 
4258  for (Int_t n1DeeSCEcna = 1; n1DeeSCEcna <= fEcal->MaxSCEcnaInDee(); n1DeeSCEcna++)
4259  {
4260  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
4261  TString SCQuadType = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna);
4262  if( SCQuadType == "top" && DeeDir == "right"){x_channel = 13;}
4263  if( SCQuadType == "top" && DeeDir == "left" ){x_channel = 7;}
4264  if( SCQuadType == "bottom" && DeeDir == "left" ){x_channel = 11;}
4265  if( SCQuadType == "bottom" && DeeDir == "right"){x_channel = 17;}
4266  Int_t i_SCEcha = (Int_t)x_channel;
4267 
4268  Double_t x_from_IX = (Double_t)GetXCrysInStex(DeeNumber, n1DeeSCEcna, i_SCEcha);
4269  Double_t y_from_IY = (Double_t)GetYCrysInStex(DeeNumber, n1DeeSCEcna, i_SCEcha);
4270  Double_t y_from_IYp = y_from_IY + (Double_t)1.;
4271  Double_t y_from_IYm = y_from_IY - (Double_t)1.;
4272 
4273  TString DeeEndcap = fEcalNumbering->GetEEDeeEndcap(DeeNumber);
4274  Color_t couleur_SC = GetSCColor(DeeEndcap, DeeDir, SCQuadType);
4275  text_DSSC_num->SetTextColor(couleur_SC);
4276  text_DeeSCCons_num->SetTextColor((Color_t)1);
4277 
4278  Int_t i_DSSC = fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
4279  Int_t i_DeeSCCons = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
4280  if( i_DSSC > 0 )
4281  {
4282  if(
4283  //.................................................... (D2,S9) , (D4,S1)
4284  !(i_DeeSCCons == 33 && n1DeeSCEcna == 60) &&
4285  !(i_DeeSCCons == 33 && n1DeeSCEcna == 119) &&
4286  //................................................... (D2,S8) , (D4,S2)
4287  !(i_DeeSCCons == 29 && n1DeeSCEcna == 32) && // !(29c and 58c)
4288  !(i_DeeSCCons == 29 && n1DeeSCEcna == 138) &&
4289  !(i_DeeSCCons == 29 && n1DeeSCEcna == 157) &&
4290  !(i_DeeSCCons == 58 && n1DeeSCEcna == 176) &&
4291  !(i_DeeSCCons == 58 && n1DeeSCEcna == 193) &&
4292  //.................................................... (D2,S7) , (D4,S3)
4293  !(i_DeeSCCons == 149 && n1DeeSCEcna == 188) &&
4294  //.................................................... (D2,S6) , (D4,S4)
4295  !(i_DeeSCCons == 112 && n1DeeSCEcna == 29) &&
4296  !(i_DeeSCCons == 112 && n1DeeSCEcna == 144) &&
4297  !(i_DeeSCCons == 112 && n1DeeSCEcna == 165) &&
4298  !(i_DeeSCCons == 119 && n1DeeSCEcna == 102) &&
4299  !(i_DeeSCCons == 119 && n1DeeSCEcna == 123) &&
4300  //.................................................... (D2,S5) , (D4,S5)
4301  !(i_DeeSCCons == 132 && n1DeeSCEcna == 41) &&
4302  //----------------------------------------------------------------------
4303  //.................................................... (D1,S1) , (D3,S9)
4304  !(i_DeeSCCons == 182 && n1DeeSCEcna == 60) &&
4305  !(i_DeeSCCons == 182 && n1DeeSCEcna == 119) &&
4306  //.................................................... (D1,S2) , (D3,S8)
4307  !(i_DeeSCCons == 178 && n1DeeSCEcna == 32) && // !(178c and 207c)
4308  !(i_DeeSCCons == 178 && n1DeeSCEcna == 138) &&
4309  !(i_DeeSCCons == 178 && n1DeeSCEcna == 157) &&
4310  !(i_DeeSCCons == 207 && n1DeeSCEcna == 176) &&
4311  !(i_DeeSCCons == 207 && n1DeeSCEcna == 193) &&
4312  //.................................................... (D1,S3) , (D3,S7)
4313  !(i_DeeSCCons == 298 && n1DeeSCEcna == 188) &&
4314  //.................................................... (D1,S4) , (D3,S6)
4315  !(i_DeeSCCons == 261 && n1DeeSCEcna == 29) && // !(261a and 268a)
4316  !(i_DeeSCCons == 261 && n1DeeSCEcna == 144) &&
4317  !(i_DeeSCCons == 261 && n1DeeSCEcna == 165) &&
4318  !(i_DeeSCCons == 268 && n1DeeSCEcna == 102) &&
4319  !(i_DeeSCCons == 268 && n1DeeSCEcna == 123) &&
4320  //.................................................... (D1,S5) , (D3,S5)
4321  !(i_DeeSCCons == 281 && n1DeeSCEcna == 41)
4322  )
4323  {
4324  sprintf(f_in, "%d", i_DSSC);
4325  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in); // <=== DrawText: prend du temps
4326  sprintf(f_in, "%d", i_DeeSCCons);
4327  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in); // <=== DrawText: prend du temps
4328  }
4329 
4330  //.................................................... (D2,S9) , (D4,S1)
4331 
4332  if( i_DeeSCCons == 33 && n1DeeSCEcna == 60 )
4333  {
4334  sprintf(f_in, "30a");
4335  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4336  sprintf(f_in, "33a");
4337  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4338  }
4339  if( i_DeeSCCons == 33 && n1DeeSCEcna == 119 )
4340  {
4341  sprintf(f_in, "30b");
4342  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4343  sprintf(f_in, "33b");
4344  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4345  }
4346  //.................................................... (D2,S8) , (D4,S2)
4347  if( i_DeeSCCons == 29 && n1DeeSCEcna == 32 )
4348  {
4349  sprintf(f_in, " 3c-25c");
4350  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4351  sprintf(f_in, "29c-58c");
4352  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4353  }
4354  if( i_DeeSCCons == 29 && n1DeeSCEcna == 138 )
4355  {
4356  sprintf(f_in, "3a");
4357  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4358  sprintf(f_in, "29a");
4359  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4360  }
4361  if( i_DeeSCCons == 29 && n1DeeSCEcna == 157 )
4362  {
4363  sprintf(f_in, "3b");
4364  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4365  sprintf(f_in, "29b");
4366  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4367  }
4368 
4369  if( i_DeeSCCons == 58 && n1DeeSCEcna == 176 )
4370  {
4371  sprintf(f_in, "25a");
4372  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4373  sprintf(f_in, "58a");
4374  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4375  }
4376  if( i_DeeSCCons == 58 && n1DeeSCEcna == 193 )
4377  {
4378  sprintf(f_in, "25b");
4379  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4380  sprintf(f_in, "58b");
4381  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4382  }
4383  //.................................................... (D2,S7) , (D4,S3)
4384  if( i_DeeSCCons == 149 && n1DeeSCEcna == 188 )
4385  {
4386  sprintf(f_in, "34a");
4387  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4388  sprintf(f_in, "149a");
4389  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4390  }
4391  //.................................................... (D2,S6) , (D4,S4)
4392  if( i_DeeSCCons == 112 && n1DeeSCEcna == 29 )
4393  {
4394  sprintf(f_in, " 14a-21a");
4395  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4396  sprintf(f_in, "112a-119a");
4397  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4398  }
4399  if( i_DeeSCCons == 112 && n1DeeSCEcna == 144 )
4400  {
4401  sprintf(f_in, "14c");
4402  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4403  sprintf(f_in, "112c");
4404  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4405  }
4406  if( i_DeeSCCons == 112 && n1DeeSCEcna == 165 )
4407  {
4408  sprintf(f_in, "14b");
4409  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4410  sprintf(f_in, "112b");
4411  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4412  }
4413 
4414  if( i_DeeSCCons == 119 && n1DeeSCEcna == 102 )
4415  {
4416  sprintf(f_in, "21c");
4417  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4418  sprintf(f_in, "119c");
4419  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4420  }
4421  if( i_DeeSCCons == 119 && n1DeeSCEcna == 123 )
4422  {
4423  sprintf(f_in, "21b");
4424  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4425  sprintf(f_in, "119b");
4426  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4427  }
4428  //.................................................... (D2,S5) , (D4,S5)
4429  if( i_DeeSCCons == 132 && n1DeeSCEcna == 41 )
4430  {
4431  sprintf(f_in, "3a");
4432  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4433  sprintf(f_in, "132a");
4434  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4435  }
4436 
4437  //.................................................... (D1,S1) , (D3,S9)
4438  if( i_DeeSCCons == 182 && n1DeeSCEcna == 60 )
4439  {
4440  sprintf(f_in, "30a");
4441  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4442  sprintf(f_in, "182a");
4443  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4444  }
4445  if( i_DeeSCCons == 182 && n1DeeSCEcna == 119 )
4446  {
4447  sprintf(f_in, "30b");
4448  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4449  sprintf(f_in, "182b");
4450  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4451  }
4452  //.................................................... (D1,S2) , (D3,S8)
4453  if( i_DeeSCCons == 178 && n1DeeSCEcna == 32 )
4454  {
4455  sprintf(f_in, " 3c-25c");
4456  text_DSSC_num->DrawText(x_from_IX-6, y_from_IYp, f_in);
4457  sprintf(f_in, "178c-207c");
4458  text_DeeSCCons_num->DrawText(x_from_IX-6, y_from_IYm, f_in);
4459  }
4460  if( i_DeeSCCons == 178 && n1DeeSCEcna == 138 )
4461  {
4462  sprintf(f_in, "3a");
4463  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4464  sprintf(f_in, "178a");
4465  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4466  }
4467  if( i_DeeSCCons == 178 && n1DeeSCEcna == 157 )
4468  {
4469  sprintf(f_in, "3b");
4470  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4471  sprintf(f_in, "178b");
4472  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4473  }
4474 
4475  if( i_DeeSCCons == 207 && n1DeeSCEcna == 176 )
4476  {
4477  sprintf(f_in, "25a");
4478  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4479  sprintf(f_in, "207a");
4480  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4481  }
4482  if( i_DeeSCCons == 207 && n1DeeSCEcna == 193 )
4483  {
4484  sprintf(f_in, "25b");
4485  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4486  sprintf(f_in, "207b");
4487  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4488  }
4489  //.................................................... (D1,S3) , (D3,S7)
4490  if( i_DeeSCCons == 298 && n1DeeSCEcna == 188 )
4491  {
4492  sprintf(f_in, "34a");
4493  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4494  sprintf(f_in, "298a");
4495  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4496  }
4497  //.................................................... (D1,S4) , (D3,S6)
4498  if( i_DeeSCCons == 261 && n1DeeSCEcna == 29 )
4499  {
4500  sprintf(f_in, " 14a-21a");
4501  text_DSSC_num->DrawText(x_from_IX-6, y_from_IYp, f_in);
4502  sprintf(f_in, "261a-268a");
4503  text_DeeSCCons_num->DrawText(x_from_IX-6, y_from_IYm, f_in);
4504  }
4505  if( i_DeeSCCons == 261 && n1DeeSCEcna == 144 )
4506  {
4507  sprintf(f_in, "14c");
4508  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4509  sprintf(f_in, "261c");
4510  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4511  }
4512  if( i_DeeSCCons == 261 && n1DeeSCEcna == 165 )
4513  {
4514  sprintf(f_in, "14b");
4515  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4516  sprintf(f_in, "261b");
4517  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4518  }
4519 
4520  if( i_DeeSCCons == 268 && n1DeeSCEcna == 102 )
4521  {
4522  sprintf(f_in, "21c");
4523  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4524  sprintf(f_in, "268c");
4525  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4526  }
4527  if( i_DeeSCCons == 268 && n1DeeSCEcna == 123 )
4528  {
4529  sprintf(f_in, "21b");
4530  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4531  sprintf(f_in, "268b");
4532  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4533  }
4534  //.................................................... (D1,S5) , (D3,S5)
4535  if( i_DeeSCCons == 281 && n1DeeSCEcna == 41 )
4536  {
4537  sprintf(f_in, "20a");
4538  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4539  sprintf(f_in, "281a");
4540  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4541  }
4542  }
4543  }
4544 
4545  // delete text_DSSC_num; fCdeleteRoot++;
4546 
4547  //......................... mention "color, black"
4548  Color_t coul_textcolors = fCnaParHistos->ColorDefinition("noir");
4549  sprintf( f_in, "color: nb in Data Sector, black: nb for construction");
4550  Int_t x_colors = 3;
4551  Int_t y_colors = -14;
4552 
4553  TText *text_colors = new TText(x_colors, y_colors, f_in); fCnewRoot++;
4554  text_colors->SetTextSize(0.03);
4555  text_colors->SetTextColor(coul_textcolors);
4556  text_colors->Draw();
4557 
4558  delete [] f_in; f_in = nullptr; fCdelete++;
4559 
4560  Color_t couleur_noir = fCnaParHistos->ColorDefinition("noir");
4561  gStyle->SetTextColor(couleur_noir);
4562 }
4563 //----------------> end of ViewDeeSCNumberingPad()
4564 
4565 void TEcnaHistos::ViewDeeGrid(const Int_t& DeeNumber, const TString& c_option)
4566 {
4567  //Grid of one Dee with axis IX and IY
4568 
4569  Int_t GeoBidSizeIX = fEcal->MaxSCIXInDee()*fEcal->MaxCrysIXInSC();
4570  Int_t GeoBidSizeIY = fEcal->MaxSCIYInDee()*fEcal->MaxCrysIYInSC();
4571 
4572  if ( c_option == "corcc")
4573  {
4574  GeoBidSizeIX = fEcal->MaxSCIXInDee()*fEcal->MaxCrysInSC();
4575  GeoBidSizeIY = fEcal->MaxSCIYInDee()*fEcal->MaxCrysInSC();
4576  }
4577 
4578  Int_t nb_binx = GeoBidSizeIX;
4579  Int_t nb_biny = GeoBidSizeIY;
4580  Axis_t xinf_bid = (Axis_t)0.;
4581  Axis_t xsup_bid = (Axis_t)GeoBidSizeIX;
4582 
4583  Axis_t yinf_bid = (Axis_t)0.;
4584  Axis_t ysup_bid = (Axis_t)GeoBidSizeIY;
4585  Double_t ymid_bid = (Double_t)(ysup_bid-yinf_bid)/2.;
4586 
4587  //---------------- trace de la grille: un rectangle = un super-cristal
4588 
4589  Int_t size_IX = fEcal->MaxCrysIXInSC();
4590  Int_t size_IY = fEcal->MaxCrysIYInSC();
4591 
4592  if ( c_option == "corcc"){size_IX = fEcal->MaxCrysInSC(); size_IY = fEcal->MaxCrysInSC();}
4593 
4594  Int_t max_x = nb_binx/size_IX;
4595  Int_t max_y = nb_biny/size_IY;
4596  Int_t max_yd = max_y/2;
4597 
4598  //= SURLIGNAGES (unite de coordonnees: le cristal ou 5 fois le cristal si option corcc)
4599  //........................... multplicative coefficient for corcc option
4600  Int_t coefcc_x = (Int_t)1;
4601  Int_t coefcc_y = (Int_t)1;
4602  if ( c_option == "corcc"){coefcc_x = fEcal->MaxCrysIXInSC(); coefcc_y = fEcal->MaxCrysIYInSC();}
4603 
4604  //............................. lignes horizontales
4605  Double_t yline = (Double_t)yinf_bid - (Double_t)size_IY;
4606 
4607  Double_t xline_beg = (Double_t)xinf_bid;
4608  Double_t xline_end = (Double_t)xsup_bid;
4609 
4610  // k = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10
4611  Int_t x_min[11] = {11,11, 7, 0, 0, 0, 0, 0, 0, 0, 0};
4612  Int_t x_max[11] = {50,50,47,45,45,42,37,35,30,15,50};
4613  for(Int_t i=0;i<11;i++){x_min[i] = coefcc_x*x_min[i]; x_max[i] = coefcc_x*x_max[i];}
4614 
4615  for( Int_t j = 0 ; j < max_y ; j++)
4616  {
4617  if( j < max_yd ) // j = 0,1,2,3,4,5,6,7,8,9
4618  {
4619  if( DeeNumber == 1 || DeeNumber == 3 )
4620  {
4621  xline_beg = xinf_bid + (Double_t)x_min[10-j];
4622  xline_end = xinf_bid + (Double_t)x_max[10-j];
4623  }
4624  if( DeeNumber == 2 || DeeNumber == 4 )
4625  {
4626  xline_beg = xsup_bid - (Double_t)x_max[10-j];
4627  xline_end = xsup_bid - (Double_t)x_min[10-j];
4628  }
4629  }
4630 
4631  if( j == max_yd ) // j = 10
4632  {
4633  if( DeeNumber == 1 || DeeNumber == 3 )
4634  {
4635  xline_beg = xinf_bid + (Double_t)x_min[0];
4636  xline_end = xinf_bid + (Double_t)x_max[0];
4637  }
4638  if( DeeNumber == 2 || DeeNumber == 4 )
4639  {
4640  xline_beg = xsup_bid - (Double_t)x_max[0];
4641  xline_end = xsup_bid - (Double_t)x_min[0];
4642  }
4643  }
4644 
4645  if( j > max_yd ) // j = 11,12,13,14,15,16,17,18,19,20
4646  {
4647  if( DeeNumber == 1 || DeeNumber == 3 )
4648  {
4649  xline_beg = xinf_bid + (Double_t)x_min[j-10];
4650  xline_end = xinf_bid + (Double_t)x_max[j-10];
4651  }
4652  if( DeeNumber == 2 || DeeNumber == 4 )
4653  {
4654  xline_beg = xsup_bid - (Double_t)x_max[j-10];
4655  xline_end = xsup_bid - (Double_t)x_min[j-10];
4656  }
4657  }
4658 
4659  yline = yline + (Double_t)size_IY;
4660  TLine *lin;
4661  lin = new TLine(xline_beg, yline, xline_end, yline); fCnewRoot++;
4662  lin->Draw();
4663  //lin->Delete(); // => si on delete, pas de trace de la ligne
4664  // delete lin; fCdeleteRoot++;
4665  }
4666 
4667  //.......................... lignes verticales
4668  Double_t xline = (Double_t)xinf_bid - (Double_t)size_IX;
4669 
4670  Double_t yline_haut_bot = (Double_t)ymid_bid;
4671  Double_t yline_haut_top = (Double_t)ysup_bid;
4672 
4673  Double_t yline_bas_bot = (Double_t)yinf_bid;
4674  Double_t yline_bas_top = (Double_t)ymid_bid;
4675 
4676  // coordonnees demi-lignes
4677  // l = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10
4678  Int_t y_min[11] = { 0,11, 7, 0, 0, 0, 0, 0, 0, 0, 0};
4679  Int_t y_max[11] = {50,50,47,45,45,42,38,35,30,15,10};
4680  for(Int_t i=0;i<11;i++){y_min[i] = coefcc_y*y_min[i]; y_max[i] = coefcc_y*y_max[i];}
4681 
4682  gStyle->SetTextSize(0.075); // ===> pourquoi pas avant?
4683 
4684  for( Int_t i = 0 ; i <= max_x ; i++)
4685  {
4686  if( DeeNumber == 1 || DeeNumber == 3 )
4687  {
4688  yline_haut_bot = ymid_bid + (Double_t)y_min[i];
4689  yline_haut_top = ymid_bid + (Double_t)y_max[i];
4690  }
4691  if( DeeNumber == 2 || DeeNumber == 4 )
4692  {
4693  yline_haut_bot = ymid_bid + (Double_t)y_min[10-i];
4694  yline_haut_top = ymid_bid + (Double_t)y_max[10-i];
4695  }
4696  yline_bas_bot = ysup_bid - yline_haut_top;
4697  yline_bas_top = ysup_bid - yline_haut_bot;
4698 
4699  xline = xline + (Double_t)size_IX;
4700  TLine *lin_haut;
4701  lin_haut = new TLine(xline, yline_haut_bot, xline, yline_haut_top); fCnewRoot++;
4702  lin_haut->Draw();
4703  // delete lin_haut; fCdeleteRoot++;
4704  TLine *lin_bas;
4705  lin_bas = new TLine(xline, yline_bas_bot, xline, yline_bas_top); fCnewRoot++;
4706  lin_bas->Draw();
4707  // delete lin_bas; fCdeleteRoot++;
4708  }
4709 
4710 
4711  Float_t fcoefcc_x = (Float_t)coefcc_x;
4712  Float_t fcoefcc_y = (Float_t)coefcc_y;
4713 
4714  EEDataSectors(fcoefcc_x, fcoefcc_y, DeeNumber, "Dee");
4715  EEGridAxis(DeeNumber, "Dee", c_option);
4716 
4717 } // end of ViewDeeGrid
4718 
4719 //=================================================================================
4720 //
4721 // SqrtContourLevels(const Int_t& nb_niv, Double_t* cont_niv)
4722 //
4723 //=================================================================================
4724 void TEcnaHistos::SqrtContourLevels(const Int_t& nb_niv, Double_t* cont_niv)
4725 {
4726 //Calculation of levels in z coordinate for 3D plots. Square root scale
4727 
4728  Int_t nb_niv2 = (nb_niv+1)/2;
4729 
4730  for (Int_t num_niv = 0; num_niv < nb_niv2; num_niv++)
4731  {
4732  Int_t ind_niv = num_niv + nb_niv2 - 1;
4733  if ( ind_niv < 0 || ind_niv > nb_niv )
4734  {
4735  std::cout << "!TEcnaHistos::ContourLevels(...)> *** ERROR *** "
4736  << "wrong contour levels for correlation matrix"
4737  << fTTBELL << std::endl;
4738  }
4739  else
4740  {
4741  cont_niv[ind_niv] =
4742  (Double_t)(num_niv*num_niv)/
4743  ((Double_t)((nb_niv2-1)*(nb_niv2-1)));
4744  }
4745  }
4746  for (Int_t num_niv = -1; num_niv > -nb_niv2; num_niv--)
4747  {
4748  Int_t ind_niv = num_niv + nb_niv2 - 1;
4749  if ( ind_niv < 0 || ind_niv > nb_niv )
4750  {
4751  std::cout << "!TEcnaHistos::ContourLevels(...)> *** ERROR *** "
4752  << "wrong contour levels for correlation matrix"
4753  << fTTBELL << std::endl;
4754  }
4755  else
4756  {
4757  cont_niv[ind_niv] =
4758  -(Double_t)(num_niv*num_niv)/
4759  ((Double_t)((nb_niv2-1)*(nb_niv2-1)));
4760  }
4761  }
4762 }
4763 
4764 //==========================================================================
4765 //
4766 // GetHocoVecoAxisTitle
4767 //
4768 //==========================================================================
4769 TString TEcnaHistos::GetHocoVecoAxisTitle(const TString& chcode)
4770 {
4771  TString xname = " ";
4772 
4773  if ( fFlagSubDet == "EB" ){xname = GetEtaPhiAxisTitle(chcode);}
4774  if ( fFlagSubDet == "EE" ){xname = GetIXIYAxisTitle(chcode);}
4775 
4776  return xname;
4777 }
4778 
4779 TString TEcnaHistos::GetEtaPhiAxisTitle(const TString& chcode)
4780 {
4781  TString xname = " ";
4782 
4783  if ( chcode == "ietaEB" ){xname = "i#eta Xtal ";}
4784  if ( chcode == "ietaSM" ){xname = "i#eta Xtal ";}
4785  if ( chcode == "ietaTow"){xname = "i#eta Xtal ";}
4786 
4787  if ( chcode == "iphiEB" ){xname = " i#varphi Xtal";}
4788  if ( chcode == "jphiEB+" ){xname = " i#varphi Xtal";}
4789  if ( chcode == "jphiEB-" ){xname = " i#varphi Xtal";}
4790  if ( chcode == "jphiSMB+" ){xname = " i#varphi Xtal";}
4791  if ( chcode == "jphiSMB-" ){xname = "i#varphi Xtal ";}
4792  if ( chcode == "jphiTow" ){xname = "i#varphi Xtal in SM ";}
4793  if ( chcode == "phi" ){xname = "i#varphi Xtal in EB ";}
4794 
4795  return xname;
4796 }
4797 
4798 TString TEcnaHistos::GetIXIYAxisTitle(const TString& chcode)
4799 {
4800  TString xname = " ";
4801 
4802  if ( chcode == "iIXDee" ){xname = "IX(SC)";}
4803 
4804  if ( chcode == "iIXDee1" ){xname = " -IX Xtal";}
4805  if ( chcode == "iIXDee2" ){xname = " IX Xtal ";}
4806  if ( chcode == "iIXDee3" ){xname = " IX Xtal";}
4807  if ( chcode == "iIXDee4" ){xname = "-IX Xtal ";}
4808 
4809  if ( chcode == "iIXEE" ){xname = " IX Xtal";}
4810 
4811  if ( chcode == "iIXSC" ){xname = "IX Xtal";}
4812 
4813  if ( chcode == "jIYDee" ){xname = "IY Xtal";}
4814  if ( chcode == "jIYSC" ){xname = "IY Xtal";}
4815  if ( chcode == "IY" ){xname = "IY";}
4816 
4817  return xname;
4818 }
4819 
4820 //=======================================================================================
4821 //
4822 // ViewStas(***)
4823 //
4824 // (Hoco,Veco) matrices for all the Stex's of a Stas
4825 // Stas = EB or EE
4826 //
4827 //=======================================================================================
4828 void TEcnaHistos::ViewStas(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
4829  const TString& HistoCode)
4830 {
4831 // (Hoco, Veco) matrices for all the Stex's of a Stas
4832 
4833  //......................... matrix title
4834  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
4835 
4836  if (HistoCode == "D_NOE_ChNb"){sprintf(f_in_mat_tit, "Number of Events");}
4837  if (HistoCode == "D_Ped_ChNb"){sprintf(f_in_mat_tit, "Pedestals");}
4838  if (HistoCode == "D_TNo_ChNb"){sprintf(f_in_mat_tit, "Total noise");}
4839  if (HistoCode == "D_MCs_ChNb"){sprintf(f_in_mat_tit, "Mean cor(s,s')");}
4840  if (HistoCode == "D_LFN_ChNb"){sprintf(f_in_mat_tit, "Low frequency noise");}
4841  if (HistoCode == "D_HFN_ChNb"){sprintf(f_in_mat_tit, "High frequency noise");}
4842  if (HistoCode == "D_SCs_ChNb"){sprintf(f_in_mat_tit, "Sigma of cor(s,s')");}
4843 
4844  //.... Axis parameters: *** WARNING *** EB ===> x (Bid Hoco) = phi (StinVeco), y (Bid Veco) = eta (StinHoco)
4845  Int_t GeoBidSizeHoco = fEcal->MaxStinVecoInStas();
4846  Int_t GeoBidSizeVeco = fEcal->MaxStinHocoInStas();
4847 
4848  Int_t vertic_empty_strips = 3;
4849  Int_t vertic_empty_strip_1 = 1;
4850 
4851  if ( fFlagSubDet == "EE" )
4852  {
4853  // for empty vertical strips: before EE-, between EE- and EE+, after EE+ on plot
4854  GeoBidSizeHoco = fEcal->MaxStinHocoInStas() + vertic_empty_strips;
4855  GeoBidSizeVeco = fEcal->MaxStinVecoInStas();
4856  }
4857 
4858  Int_t nb_binx = GeoBidSizeHoco;
4859  Int_t nb_biny = GeoBidSizeVeco;
4860  Axis_t xinf_bid = (Axis_t)0.;
4861  Axis_t xsup_bid = (Axis_t)GeoBidSizeHoco;
4862  Axis_t yinf_bid = (Axis_t)0.;
4863  Axis_t ysup_bid = (Axis_t)GeoBidSizeVeco;
4864 
4865  TString axis_x_var_name = " #Hoco ";
4866  TString axis_y_var_name = " #varVeco ";
4867 
4868  //............. matrices reading and histogram filling (ViewStas)
4869 
4870  TH2D* h_geo_bid = new TH2D("geobidim_ViewStas", f_in_mat_tit,
4871  nb_binx, xinf_bid, xsup_bid,
4872  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
4873  h_geo_bid->Reset();
4874 
4875  Int_t CounterExistingFile = 0;
4876  Int_t CounterDataExist = 0;
4877 
4878  Int_t* xFapNbOfEvts = new Int_t[fEcal->MaxStexInStas()]; fCnew++;
4879  for(Int_t i=0; i<fEcal->MaxStexInStas(); i++){xFapNbOfEvts[i]=0;}
4880 
4881  //Int_t* NOFE_int = new Int_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
4882 
4883  //......................................................................... (ViewStas)
4884  for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
4885  {
4886  TVectorD partial_histp(fEcal->MaxStinEcnaInStex());
4887  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){partial_histp(i)=(Double_t)0.;}
4888 
4889  Bool_t OKFileExists = kFALSE;
4890  Bool_t OKDataExist = kFALSE;
4891 
4892  if( arg_AlreadyRead == fTobeRead )
4893  {
4895  Int_t n1StasStex = iStasStex+1;
4899  n1StasStex, fCfgResultsRootFilePath.Data());
4900 
4901  if ( fMyRootFile->LookAtRootFile() == kTRUE ){OKFileExists = kTRUE;} // (ViewStas)
4902 
4903  if( OKFileExists == kTRUE )
4904  {
4905  xFapNbOfEvts[iStasStex] = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, n1StasStex);
4906  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
4907  // std::cout << "*TEcnaHistos::ViewStas(...)> Data are analyzed from file ----> "
4908  // << fp_name_short << std::endl;
4909 
4910  //....................... search for first and last dates
4911  if( iStasStex == 0 )
4912  {
4917  }
4918 
4919  time_t xStartTime = fMyRootFile->GetStartTime();
4920  time_t xStopTime = fMyRootFile->GetStopTime();
4921  TString xStartDate = fMyRootFile->GetStartDate();
4922  TString xStopDate = fMyRootFile->GetStopDate();
4923 
4924  if( xStartTime < fStartTime ){fStartTime = xStartTime; fStartDate = xStartDate;}
4925  if( xStopTime > fStopTime ){fStopTime = xStopTime; fStopDate = xStopDate;}
4926 
4928 
4929  //----------------------------------------------------------------------------- file reading (ViewStas)
4930  if( HistoCode == "D_NOE_ChNb" ){
4932  if( HistoCode == "D_Ped_ChNb" ){
4934  if (HistoCode == "D_TNo_ChNb" ){
4936  if( HistoCode == "D_MCs_ChNb" ){
4938  if( HistoCode == "D_LFN_ChNb" ){
4940  if( HistoCode == "D_HFN_ChNb" ){
4942  if( HistoCode == "D_SCs_ChNb" ){
4944 
4945  if ( fMyRootFile->DataExist() == kTRUE ){OKDataExist = kTRUE;}
4946  }
4947  else
4948  {
4949  fStatusFileFound = kFALSE;
4950  std::cout << "!TEcnaHistos::ViewStas(...)> *ERROR* =====> "
4951  << " ROOT file not found" << fTTBELL << std::endl;
4952  }
4953  }
4954 
4955  if( arg_AlreadyRead == 1 )
4956  {
4957  OKDataExist = kTRUE;
4958  for(Int_t i0Stin=0; i0Stin<fEcal->MaxStinEcnaInStex(); i0Stin++)
4959  {
4960  partial_histp(i0Stin) = arg_read_histo(fEcal->MaxStinEcnaInStex()*iStasStex+i0Stin);
4961  }
4962  }
4963 
4964  if( OKDataExist == kTRUE)
4965  {
4966  fStatusFileFound = kTRUE;
4967  CounterExistingFile++;
4968 
4969  //................................................................. (ViewStas)
4970  TMatrixD read_matrix(nb_binx, nb_biny);
4971  for(Int_t i=0; i<nb_binx; i++)
4972  {for(Int_t j=0; j<nb_biny; j++){read_matrix(i,j)=(Double_t)0.;}}
4973 
4974  if ( OKDataExist == kTRUE )
4975  {
4976  fStatusDataExist = kTRUE;
4977  CounterDataExist++;
4978 
4979  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
4980  {
4981  //-------------------------------------- Geographical bidim filling (ViewStas)
4982  Int_t i_xgeo = GetXStinInStas(iStasStex, i0StexStinEcna, vertic_empty_strip_1);
4983  Int_t i_ygeo = GetYStinInStas(iStasStex, i0StexStinEcna);
4984 
4985  if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
4986  {
4987  Int_t n1StexStinEcna = i0StexStinEcna+1;
4988 
4989  if( fFlagSubDet == "EB" )
4990  {
4991  read_matrix(i_xgeo, i_ygeo) = partial_histp(i0StexStinEcna);
4992  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
4993  (Double_t)read_matrix(i_xgeo, i_ygeo));
4994  }
4995 
4996  if( fFlagSubDet == "EE" )
4997  {
4998  //---------------------> do not draw bin for SCEcna = 10 or 11 (ViewStas)
4999  if( !( (n1StexStinEcna == 10 || n1StexStinEcna == 11 ||
5000  n1StexStinEcna == 29 || n1StexStinEcna == 32) ) )
5001  {
5002  read_matrix(i_xgeo, i_ygeo) = partial_histp(i0StexStinEcna);
5003  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
5004  (Double_t)read_matrix(i_xgeo, i_ygeo));
5005  }
5006  if( n1StexStinEcna == 29 )
5007  {
5008  //----------------------------------------------------------------- (ViewStas)
5009  // Average on SCEcna 29 (x1+x2+x3+x6+x7) and SCEcna 10: (x11)
5010  // (x = Xtal# in SC; see CMS NOTE 2006/027, p.10)
5011  //
5012  // (x1+x2+x3+x6+x7)/5 = partial_histp(29-1) ; x11 = partial_histp(10-1)
5013  //
5014  // => (x1+x2+x3+x6+x7+x11)/6 = partial_histp(29-1)*5/6 + partial_histp(10-1)/6
5015  //
5016  // // except for "D_NOE_ChNb" because average done in ReadAverageNumberOfEvents
5017  // // (no averaged NbOfEvts in root file)
5018  //---------------------------------------------------------------------------------
5019  read_matrix(i_xgeo, i_ygeo) =
5020  partial_histp(i0StexStinEcna)*(Double_t)(5./6.) + partial_histp(9)/(Double_t)6.;
5021  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
5022  (Double_t)read_matrix(i_xgeo, i_ygeo));
5023  }
5024  //if( n1StexStinEcna == 32 && HistoCode != "D_NOE_ChNb" ) (ViewStas)
5025  if( n1StexStinEcna == 32 )
5026  {
5027  //---- same as previous case: replace SCEcna 29 by 32 AND SCEcna 10 by 11
5028  //----> (x1+x2+x3+x6+x7+x11)/6 = partial_histp(32-1)*5/6 + partial_histp(11-1)/6
5029  read_matrix(i_xgeo, i_ygeo) =
5030  partial_histp(i0StexStinEcna)*(Double_t)(5./6.) + partial_histp(10)/(Double_t)6.;
5031  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
5032  (Double_t)read_matrix(i_xgeo, i_ygeo));
5033  }
5034  } // end of if( fFlagSubDet == "EE" )
5035  } // end of if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
5036  } // end of for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
5037  } // end of if ( fMyRootFile->DataExist() == kTRUE )
5038  else
5039  {
5040  fStatusDataExist = kFALSE;
5041 
5042  std::cout << "!TEcnaHistos::ViewStas(...)> "
5043  << " Data not available for " << fFapStexName << " " << iStasStex+1
5044  << " (Quantity not present in the ROOT file)" << fTTBELL << std::endl;
5045  }
5046  } // end of if( fMyRootFile->LookAtRootFile() == kTRUE ) (ViewStas)
5047  else
5048  {
5049  fStatusFileFound = kFALSE;
5050 
5051  std::cout << "!TEcnaHistos::ViewStas(...)> "
5052  << " Data not available for " << fFapStexName << " " << iStasStex+1
5053  << " (ROOT file not found)" << fTTBELL << std::endl;
5054  }
5055 
5056  if( fFapNbOfEvts <= xFapNbOfEvts[iStasStex] ){fFapNbOfEvts = xFapNbOfEvts[iStasStex];}
5057 
5058  } // end of for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
5059 
5060  //delete [] NOFE_int; NOFE_int = 0; fCdelete++;
5061  delete [] xFapNbOfEvts; xFapNbOfEvts = nullptr; fCdelete++;
5062 
5063  if( CounterExistingFile > 0 && CounterDataExist > 0 )
5064  {
5065  //=============== H I S T O M I N / M A X M A N A G E M E N T ============ (ViewStas)
5066  //................................ Put histo min max values
5067  //.......... default if flag not set to "ON"
5068  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
5069  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
5070 
5071  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
5072  //.......... user's value if flag set to "ON"
5073  if( fFlagUserHistoMin == "ON" )
5074  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
5075  if( fFlagUserHistoMax == "ON" )
5076  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
5077  //................................. automatic min and/or max
5078  if( fFlagUserHistoMin == "AUTO" )
5079  {SetYminMemoFromValue(HistoCode.Data(), h_geo_bid->GetMinimum()); fFlagUserHistoMin = "OFF";}
5080  if( fFlagUserHistoMax == "AUTO" )
5081  {SetYmaxMemoFromValue(HistoCode.Data(), h_geo_bid->GetMaximum()); fFlagUserHistoMax = "OFF";}
5082  //...................................... histo set ymin and ymax
5083  SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, HistoCode);
5084 
5085  // ************************** A GARDER EN RESERVE *******************************
5086  //............. special contour level for correlations (square root wise scale)
5087  //if ( HistoCode == "D_MCs_ChNb" )
5088  //{
5089  // Int_t nb_niv = 9;
5090  // Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
5091  // SqrtContourLevels(nb_niv, &cont_niv[0]);
5092  // h_geo_bid->SetContour(nb_niv, &cont_niv[0]);
5093  // delete [] cont_niv; fCdelete++;
5094  //}
5095  // ******************************** (FIN RESERVE) *******************************
5096 
5097  // =================================== P L O T S ======================== (ViewStas)
5098 
5099  char* f_in = new char[fgMaxCar]; fCnew++;
5100 
5101  //...................... Taille/format canvas
5102  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
5103  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
5104 
5105  if( fFlagSubDet == "EB")
5106  {canv_w = fCnaParHistos->CanvasFormatW("phietaEB");
5107  canv_h = fCnaParHistos->CanvasFormatH("phietaEB");}
5108  if( fFlagSubDet == "EE")
5109  {canv_w = fCnaParHistos->CanvasFormatW("IYIXEE");
5110  canv_h = fCnaParHistos->CanvasFormatH("IYIXEE");}
5111 
5112  //............................................... paves commentaires (ViewStas)
5114 
5115  //------------------------------------ Canvas name ----------------- (ViewStas)
5116  TString name_cov_cor;
5117  Int_t MaxCar = fgMaxCar;
5118  name_cov_cor.Resize(MaxCar);
5119  name_cov_cor = "?";
5120 
5121  if( HistoCode == "D_NOE_ChNb"){name_cov_cor = "Number_of_Events";}
5122  if( HistoCode == "D_Ped_ChNb"){name_cov_cor = "Pedestals";}
5123  if( HistoCode == "D_TNo_ChNb"){name_cov_cor = "Total_noise";}
5124  if( HistoCode == "D_MCs_ChNb"){name_cov_cor = "Mean_Corss";}
5125  if( HistoCode == "D_LFN_ChNb"){name_cov_cor = "Low_Fq_Noise";}
5126  if( HistoCode == "D_HFN_ChNb"){name_cov_cor = "High_Fq_Noise";}
5127  if( HistoCode == "D_SCs_ChNb"){name_cov_cor = "Sigma_Corss";}
5128 
5129  TString name_visu;
5130  MaxCar = fgMaxCar;
5131  name_visu.Resize(MaxCar);
5132  name_visu = "colz";
5133 
5134  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%s_%s_HocoVeco_R%d",
5135  name_cov_cor.Data(), fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
5137  name_visu.Data(), arg_AlreadyRead);
5138 
5139  if( fFlagSubDet == "EB" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stas2DEB");}
5140  if( fFlagSubDet == "EE" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stas2DEE");}
5141 
5142  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
5143  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
5144 
5145  // std::cout << "*TEcnaHistos::ViewStas(...)> Plot is displayed on canvas ----> " << f_in << std::endl;
5146 
5147  delete [] f_in; f_in = nullptr; fCdelete++;
5148 
5149  //------------------------ Canvas draw and update ------------ (ViewStas)
5150  if( fPavComGeneralTitle != nullptr ){fPavComGeneralTitle->Draw();}
5151 
5152  fPavComStas->Draw();
5153  fPavComAnaRun->Draw();
5154  fPavComNbOfEvts->Draw();
5155 
5156  //----------------------------------------------------------- pad margins
5157  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
5158  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
5159  Double_t x_margin = x_low;
5160  Double_t y_margin = y_low;
5161  MainCanvas->Divide( 1, 1, x_margin, y_margin);
5162  // Divide(nx, ny, x_margin, y_margin, color);
5163  gPad->cd(1);
5164  //........................... specific EE
5165  if( fFlagSubDet == "EE" ){
5166  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
5167  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_EE") - 0.005;
5168  TVirtualPad* main_subpad = gPad;
5169  main_subpad->SetPad(x_low, y_low, x_up, y_up);}
5170 
5171  //------------------------------------------------------------
5172  h_geo_bid->GetXaxis()->SetTitle(axis_x_var_name);
5173  h_geo_bid->GetYaxis()->SetTitle(axis_y_var_name);
5174 
5175  h_geo_bid->DrawCopy("COLZ");
5176 
5177  // trace de la grille ---------------- (ViewStas)
5178  ViewStasGrid(vertic_empty_strips);
5179  gPad->Draw();
5180  gPad->Update();
5181 
5182  // delete MainCanvas; fCdeleteRoot++;
5183  }
5184  //..................... retour aux options standard
5185 
5186  Bool_t b_true = true;
5187  h_geo_bid->SetStats(b_true);
5188  h_geo_bid->Delete(); h_geo_bid = nullptr; fCdeleteRoot++;
5189 
5190  delete [] f_in_mat_tit; f_in_mat_tit = nullptr; fCdelete++;
5191 
5192 } // end of ViewStas(...)
5193 
5194 //==================================================================================
5195 //
5196 // GetXStinInStas , GetYStinInStas
5197 //
5198 //==================================================================================
5199 Int_t TEcnaHistos::GetXStinInStas(const Int_t& iStasStex, const Int_t& StexStinEcna,
5200  const Int_t& vertic_empty_strip_1)
5201 {
5202 //Gives the X Stin coordinate in the geographic view of the Stas
5203 // (X = 0 to MaxStexHocoInStas*MaxStinHocoInStex - 1 + vertic_empty_strips(EE only))
5204 
5205  Int_t ix_geo = 0;
5206  Int_t n1StasStex = iStasStex+1;
5207  TString ctype = fEcalNumbering->GetStexHalfStas(n1StasStex);
5208 
5209  if( fFlagSubDet == "EB")
5210  {
5211  if( ctype == "EB-")
5212  {
5213  ix_geo = (iStasStex - fEcal->MaxStexInStasMinus())*fEcal->MaxStinVecoInStex()
5214  + StexStinEcna%fEcal->MaxStinVecoInStex();
5215  }
5216  if( ctype == "EB+")
5217  {
5218  ix_geo = iStasStex*fEcal->MaxStinVecoInStex()
5219  + fEcal->MaxStinVecoInStex()- 1 - StexStinEcna%fEcal->MaxStinVecoInStex();
5220  }
5221  }
5222 
5223  if( fFlagSubDet == "EE")
5224  {
5225  TString LeftRightFromIP = fEcalNumbering->GetDeeDirViewedFromIP(n1StasStex);
5226 
5227  if( ctype == "EE-" && LeftRightFromIP == "left" )
5228  {
5229  ix_geo = fEcal->MaxStinHocoInStex() - StexStinEcna/fEcal->MaxStinVecoInStex() - 1 + vertic_empty_strip_1;
5230  }
5231  if( ctype == "EE-" && LeftRightFromIP == "right" )
5232  {
5233  ix_geo = fEcal->MaxStinHocoInStex() + StexStinEcna/fEcal->MaxStinVecoInStex() + vertic_empty_strip_1;
5234  }
5235  if( ctype == "EE+" && LeftRightFromIP == "left" )
5236  {
5237  ix_geo = (Int_t)fCnaParHistos->DeeOffsetX(fFlagSubDet, n1StasStex)
5238  + fEcal->MaxStinHocoInStex() - StexStinEcna/fEcal->MaxStinVecoInStex() - 1;
5239  }
5240  if( ctype == "EE+" && LeftRightFromIP == "right" )
5241  {
5242  ix_geo = (Int_t)fCnaParHistos->DeeOffsetX(fFlagSubDet, n1StasStex)
5243  + StexStinEcna/fEcal->MaxStinVecoInStex();
5244  }
5245  }
5246  return ix_geo;
5247 }
5248 
5249 Int_t TEcnaHistos::GetYStinInStas(const Int_t& iStasStex, const Int_t& StexStinEcna)
5250 {
5251 //Gives the Y crystal coordinate in the geographic view of one Stex
5252 // (Y = 0 to MaxStexVecoInStas*MaxStinVecoInStex - 1)
5253 
5254  Int_t iy_geo = 0;
5255 
5256  if( fFlagSubDet == "EB")
5257  {
5258  Int_t n1StasStex = iStasStex+1;
5259  TString ctype = fEcalNumbering->GetStexHalfStas(n1StasStex);
5260  if( ctype == "EB+")
5261  {iy_geo = StexStinEcna/fEcal->MaxStinVecoInStex() + fEcal->MaxStinHocoInStex(); }
5262  if( ctype == "EB-")
5263  {iy_geo = fEcal->MaxStinHocoInStex() - 1 - StexStinEcna/fEcal->MaxStinVecoInStex();}
5264  }
5265 
5266  if( fFlagSubDet == "EE")
5267  {iy_geo = StexStinEcna%fEcal->MaxStinVecoInStex();}
5268  return iy_geo;
5269 }
5270 
5271 //==========================================================================
5272 //
5273 // ViewStasGrid
5274 // independent of the ROOT file
5275 //
5276 //==========================================================================
5277 void TEcnaHistos::ViewStasGrid(const Int_t & vertic_empty_strips)
5278 {
5279  //Grid of Stas with axis Hoco and Veco
5280 
5281  if( fFlagSubDet == "EB"){ViewEBGrid();}
5282  if( fFlagSubDet == "EE"){ViewEEGrid(vertic_empty_strips);}
5283 
5284 } // end of ViewStasGrid
5285 
5287 {
5288  //Grid of EB with axis Hoco and Veco
5289 
5290  Int_t GeoBidSizeEta = fEcal->MaxSMEtaInEB()*fEcal->MaxTowEtaInSM();
5291  Int_t GeoBidSizePhi = fEcal->MaxSMPhiInEB()*fEcal->MaxTowPhiInSM();
5292 
5293  Int_t size_y = fEcal->MaxTowEtaInSM();
5294  Int_t size_x = fEcal->MaxTowPhiInSM();
5295 
5296  Int_t nb_binx = GeoBidSizePhi;
5297  Int_t nb_biny = GeoBidSizeEta;
5298  Axis_t xinf_bid = (Axis_t)0.;
5299  Axis_t xsup_bid = (Axis_t)nb_binx;
5300  Axis_t yinf_bid = (Axis_t)0.;
5301  Axis_t ysup_bid = (Axis_t)nb_biny;
5302 
5303  //---------------- trace de la grille: un rectangle = un SM
5304 
5305  Int_t max_x = nb_binx/size_x; // = fEcal->MaxSMPhiInEB()
5306  Int_t max_y = nb_biny/size_y; // = fEcal->MaxSMEtaInEB()
5307 
5308  //............................. lignes horizontales (ViewEBGrid)
5309  Double_t yline = (Double_t)yinf_bid;
5310 
5311  Double_t xline_left = (Double_t)xinf_bid;
5312  Double_t xline_right = (Double_t)xsup_bid;
5313 
5314  for( Int_t j = 0 ; j < max_y ; j++)
5315  {
5316  yline = yline + (Double_t)size_y;
5317  TLine *lin;
5318  lin = new TLine(xline_left, yline, xline_right, yline); fCnewRoot++;
5319  lin->Draw();
5320  // delete lin; fCdeleteRoot++;
5321  }
5322 
5323  //-------------------------------- lignes verticales
5324  Double_t xline = (Double_t)xinf_bid - (Double_t)size_x;
5325 
5326  Double_t yline_bot = (Double_t)yinf_bid;
5327  Double_t yline_top = (Double_t)ysup_bid;
5328 
5329  for( Int_t i = 0 ; i < max_x ; i++)
5330  {
5331  xline = xline + (Double_t)size_x;
5332  TLine *lin;
5333  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
5334  lin->Draw();
5335  }
5336 
5337  //-------------------------------- Numeros des SM
5338  Double_t yTextBot = yline_bot - (yline_top - yline_bot)/25.;
5339  Double_t yTextTop = yline_top + (yline_top - yline_bot)/120.;
5340  xline = (Double_t)xinf_bid - (Double_t)size_x;
5341 
5342  char* f_in = new char[fgMaxCar]; fCnew++;
5343  TText *text_SM = new TText(); fCnewRoot++;
5344  for( Int_t i = 0 ; i < max_x ; i++)
5345  {
5346  xline = xline + (Double_t)size_x;
5347  text_SM->SetTextColor(fCnaParHistos->ColorDefinition("bleu_fonce"));
5348  text_SM->SetTextSize((Double_t)0.03);
5349  sprintf( f_in, " +%d", i+1 );
5350  text_SM->DrawText(xline, yTextTop, f_in);
5351  sprintf( f_in, " %d", -i-1 );
5352  text_SM->DrawText(xline, yTextBot, f_in);
5353  }
5354  delete [] f_in; fCdelete++;
5355 
5356  //------------------ trace axes en eta et phi --------------- ViewEBGrid
5357 
5358  Int_t SMNumber = 1;
5359 
5360  //...................................................... Axe i(phi) (bottom x) ViewEBGrid
5361  Int_t MatSize = fEcal->MaxTowPhiInSM();
5362  Int_t size_x_eb = fEcal->MaxSMPhiInEB();
5363  Double_t phi_min = 0;
5364  Double_t phi_max = 360;
5365 
5366  TString x_var_name = GetHocoVecoAxisTitle("iphiEB");;
5367  TString x_direction = fEcalNumbering->GetXDirectionEB(SMNumber);
5368 
5369  new TF1("f1", x_direction.Data(), phi_min, phi_max); fCnewRoot++;
5370  TGaxis* sup_axis_x = nullptr;
5371 
5372  if( x_direction == "-x" ) // NEVER IN THIS CASE: xmin->xmax <=> right->left ("-x") direction
5373  {sup_axis_x = new TGaxis( (Float_t)0., (Float_t)0., (Float_t)(size_x_eb*MatSize), (Float_t)0.,
5374  "f1", size_x_eb, "SC" , 0.); fCnewRoot++;}
5375 
5376  if( x_direction == "x" ) // ALWAYS IN THIS CASE: xmin->xmax <=> left->right ("x") direction
5377  {sup_axis_x = new TGaxis( (Float_t)0., (Float_t)0., (Float_t)(size_x_eb*MatSize), (Float_t)0.,
5378  "f1", size_x_eb, "SC" , 0.); fCnewRoot++;}
5379 
5380  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
5381  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize("EBx");
5382  Float_t tic_siz_x = fCnaParHistos->AxisTickSize("SMx");
5383  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("EBx");
5384  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("EBx");
5385 
5386  sup_axis_x->SetTitle(x_var_name);
5387  sup_axis_x->SetTitleSize(tit_siz_x);
5388  sup_axis_x->SetTitleOffset(tit_off_x);
5389  sup_axis_x->SetLabelSize(lab_siz_x);
5390  sup_axis_x->SetLabelOffset(lab_off_x);
5391  sup_axis_x->SetTickSize(tic_siz_x);
5392  sup_axis_x->Draw("SAME");
5393 
5394  //...................................................... Axe eta (y) ViewEBGrid
5395  MatSize = fEcal->MaxTowEtaInSM();
5396  Int_t size_y_eb = fEcal->MaxSMEtaInEB();
5397 
5398  Double_t eta_min = (Double_t)(-85.);
5399  Double_t eta_max = (Double_t)85.;
5400 
5401  TString y_var_name = GetHocoVecoAxisTitle("ietaEB");
5402 
5403  TGaxis* sup_axis_y = nullptr;
5404  sup_axis_y = new TGaxis((Float_t)0., (Float_t)0.,
5405  (Float_t)0., (Float_t)(size_y_eb*MatSize),
5406  eta_min, eta_max, MatSize/2, "SC", 0.); fCnewRoot++;
5407 
5408  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
5409  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize("EBy");
5410  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("SMy");
5411  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("EBy");
5412  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("EBy");
5413 
5414  sup_axis_y->SetTitle(y_var_name);
5415  sup_axis_y->SetTitleSize(tit_siz_y);
5416  sup_axis_y->SetTitleOffset(tit_off_y);
5417  sup_axis_y->SetLabelColor(1);
5418  sup_axis_y->SetLabelSize(lab_siz_y);
5419  sup_axis_y->SetLabelOffset(lab_off_y);
5420  sup_axis_y->SetTickSize(tic_siz_y);
5421  sup_axis_y->Draw("SAME");
5422 
5423  //f2 = 0;
5424 
5425  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
5426 
5427 } // end of ViewEBGrid
5428 //---------------------------------------------------------------------
5429 void TEcnaHistos::ViewEEGrid(const Int_t& vertic_empty_strips)
5430 {
5431  //Grid of EE with axis Hoco and Veco
5432 
5433  Float_t coefcc_x = (Float_t)1./(Float_t)5.;
5434  Float_t coefcc_y = (Float_t)1./(Float_t)5.;
5435 
5436  for( Int_t DeeNumber = 1; DeeNumber <= 4; DeeNumber++)
5437  {
5438  EEDataSectors(coefcc_x, coefcc_y, DeeNumber, "EE");
5439  EEGridAxis(DeeNumber, "EE", " ");
5440  }
5441 
5442  // vertical line between the two endcaps
5443  Double_t xline = (Double_t)coefcc_x*( (Double_t)2.*fEcal->MaxCrysIXInDee()
5444  + ((Double_t)vertic_empty_strips)/(Double_t)2.*fEcal->MaxCrysIXInSC() );
5445 
5446  Double_t yline_bot = (Double_t)coefcc_y*(Double_t)0.;
5447  Double_t yline_top = (Double_t)coefcc_y*(Double_t)fEcal->MaxCrysIYInDee();
5448 
5449  TLine *lin;
5450  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
5451  lin->Draw();
5452 
5453  // vertical line in the midles of the two endcaps
5454  // xline = xline + coefcc_x*( fEcal->MaxCrysIXInDee()+ 0.5*fEcal->MaxCrysIXInSC() );
5455  xline = (Double_t)coefcc_x*(3*fEcal->MaxCrysIXInDee()
5456  + ((Double_t)vertic_empty_strips-1.)*fEcal->MaxCrysIXInSC() );
5457  TLine *lin12;
5458  lin12 = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
5459  lin12->SetLineStyle(2);
5460  lin12->Draw();
5461 
5462  xline = (Double_t)coefcc_x*(fEcal->MaxCrysIXInDee()
5463  + ((Double_t)vertic_empty_strips)/3.*fEcal->MaxCrysIXInSC() );
5464  TLine *lin34;
5465  lin34 = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
5466  lin34->SetLineStyle(2);
5467  lin34->Draw();
5468 
5469  // horizontal line at IY = 50
5470  Double_t xline_end = (Double_t)coefcc_x*( 4*fEcal->MaxCrysIXInDee() + vertic_empty_strips*fEcal->MaxCrysIXInSC());
5471  Double_t yline_mid = (Double_t)coefcc_x*fEcal->MaxCrysIYInDee()/2;
5472 
5473  TLine *linh;
5474  linh = new TLine( 0., yline_mid, xline_end, yline_mid); fCnewRoot++;
5475  linh->SetLineStyle(2);
5476  linh->Draw();
5477 
5478 } // end of ViewEEGrid
5479 
5480 //==================================================================================================
5481 void TEcnaHistos::EEDataSectors(const Float_t& coefcc_x, const Float_t& coefcc_y,
5482  const Int_t& DeeNumber, const TString& opt_plot)
5483 {
5484  //Surlignage des bords du Dee et des Data Sectors. Numeros des secteurs.
5485 
5486  // Epaisseur du trait selon option
5487  Int_t LineWidth = 2; // DEFAULT => option "EE"
5488  if( opt_plot == "Dee" ){LineWidth = 3;}
5489 
5490  Int_t ngmax = 0;
5491  // surlignage du bord interne du Dee (unite de coordonnees: le cristal)
5492  ngmax = 13;
5493  Float_t xg_dee_int_bot[13] = { 0, 5, 5, 7, 7, 8, 8, 9, 9,10,10,11,11};
5494  Float_t yg_dee_int_bot[13] = {39,39,40,40,41,41,42,42,43,43,45,45,50};
5495 
5496  for(Int_t i=0;i<ngmax;i++){
5497  xg_dee_int_bot[i] = coefcc_x*xg_dee_int_bot[i];
5498  yg_dee_int_bot[i] = coefcc_y*yg_dee_int_bot[i];}
5499 
5500  Float_t XgDeeIntBotRight[13]; Float_t YgDeeIntBotRight[13];
5501  Float_t XgDeeIntTopRight[13]; Float_t YgDeeIntTopRight[13];
5502 
5503  for( Int_t i=0; i<ngmax; i++)
5504  {
5505  XgDeeIntBotRight[i] = xg_dee_int_bot[i];
5506  YgDeeIntBotRight[i] = yg_dee_int_bot[i];
5507  XgDeeIntTopRight[i] = XgDeeIntBotRight[i];
5508  YgDeeIntTopRight[i] = coefcc_y*fEcal->MaxCrysIYInDee() - YgDeeIntBotRight[i];
5509  if ( DeeNumber == 2 || DeeNumber == 4 )
5510  {
5511  XgDeeIntBotRight[i] = -XgDeeIntBotRight[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5512  XgDeeIntTopRight[i] = -XgDeeIntTopRight[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5513  }
5514  XgDeeIntBotRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5515  XgDeeIntTopRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5516  }
5517 
5518  TGraph *BDeeIntBotRight = new TGraph(ngmax, XgDeeIntBotRight, YgDeeIntBotRight);
5519  BDeeIntBotRight->SetLineWidth(LineWidth);
5520  BDeeIntBotRight->DrawGraph(ngmax, XgDeeIntBotRight, YgDeeIntBotRight);
5521 
5522  TGraph *BDeeIntTopRight = new TGraph(ngmax, XgDeeIntTopRight, YgDeeIntTopRight);
5523  BDeeIntTopRight->SetLineWidth(LineWidth);
5524  BDeeIntTopRight->DrawGraph(ngmax, XgDeeIntTopRight, YgDeeIntTopRight);
5525 
5526  // surlignage du bord externe du Dee (unite de coordonnees: le cristal)
5527  ngmax = 21;
5528  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};
5529  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};
5530  for(Int_t i=0;i<ngmax;i++){
5531  xg_dee_ext_bot[i] = coefcc_x*xg_dee_ext_bot[i];
5532  yg_dee_ext_bot[i] = coefcc_y*yg_dee_ext_bot[i];}
5533 
5534  Float_t XgDeeExtBotRight[21]; Float_t YgDeeExtBotRight[21];
5535  Float_t XgDeeExtTopRight[21]; Float_t YgDeeExtTopRight[21];
5536 
5537  for( Int_t i=0; i<ngmax; i++)
5538  {
5539  XgDeeExtBotRight[i] = xg_dee_ext_bot[i];
5540  YgDeeExtBotRight[i] = yg_dee_ext_bot[i];
5541  XgDeeExtTopRight[i] = XgDeeExtBotRight[i];
5542  YgDeeExtTopRight[i] = coefcc_y*fEcal->MaxCrysIYInDee() - YgDeeExtBotRight[i];
5543  if ( DeeNumber == 2 || DeeNumber == 4 )
5544  {
5545  XgDeeExtBotRight[i] = -XgDeeExtBotRight[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5546  XgDeeExtTopRight[i] = -XgDeeExtTopRight[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5547  }
5548  XgDeeExtBotRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5549  XgDeeExtTopRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5550  }
5551 
5552  TGraph *BDeeExtBotRight = new TGraph(ngmax, XgDeeExtBotRight, YgDeeExtBotRight);
5553  BDeeExtBotRight->SetLineWidth(LineWidth);
5554  BDeeExtBotRight->DrawGraph(ngmax, XgDeeExtBotRight, YgDeeExtBotRight);
5555 
5556  TGraph *BDeeExtTopRight = new TGraph(ngmax, XgDeeExtTopRight, YgDeeExtTopRight);
5557  BDeeExtTopRight->SetLineWidth(LineWidth);
5558  BDeeExtTopRight->DrawGraph(ngmax, XgDeeExtTopRight, YgDeeExtTopRight);
5559 
5560  char* f_in = new char[fgMaxCar]; fCnew++;
5561 
5562  //............. Surlignage separateurs des secteurs en phi (Data sectors)
5563 
5564  //================== S9 -> S1 (EE-) option "EE" seulement
5565  if( opt_plot == "EE" )
5566  {
5567  ngmax = 2;
5568  Float_t xg_dee_data_sec9[2] = { 0, 0};
5569  Float_t yg_dee_data_sec9[2] = {61,100};
5570  for(Int_t i=0;i<ngmax;i++){
5571  xg_dee_data_sec9[i] = coefcc_x*xg_dee_data_sec9[i];
5572  yg_dee_data_sec9[i] = coefcc_y*yg_dee_data_sec9[i];}
5573 
5574  Float_t XgDeeDataSec9[11]; Float_t YgDeeDataSec9[11];
5575  for( Int_t i=0; i<ngmax; i++)
5576  {
5577  XgDeeDataSec9[i] = xg_dee_data_sec9[i]; YgDeeDataSec9[i] = yg_dee_data_sec9[i];
5578  if ( DeeNumber == 2 || DeeNumber == 4 )
5579  {
5580  XgDeeDataSec9[i] = -XgDeeDataSec9[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5581  }
5582  XgDeeDataSec9[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5583  }
5584  TGraph *BDeeDataSec9 = new TGraph(ngmax, XgDeeDataSec9, YgDeeDataSec9);
5585  BDeeDataSec9->SetLineWidth(LineWidth);
5586  BDeeDataSec9->DrawGraph(ngmax, XgDeeDataSec9, YgDeeDataSec9);
5587  }
5588 
5589  //================= S1->S2(EE-)
5590  ngmax = 11;
5591  Float_t xg_dee_data_sec1[11] = { 7,10,10,15,15,20,20,25,25,30,30};
5592  Float_t yg_dee_data_sec1[11] = {60,60,65,65,70,70,75,75,85,85,87};
5593  for(Int_t i=0;i<ngmax;i++){
5594  xg_dee_data_sec1[i] = coefcc_x*xg_dee_data_sec1[i];
5595  yg_dee_data_sec1[i] = coefcc_y*yg_dee_data_sec1[i];}
5596 
5597  Float_t XgDeeDataSec1[11]; Float_t YgDeeDataSec1[11];
5598  for( Int_t i=0; i<ngmax; i++)
5599  {
5600  XgDeeDataSec1[i] = xg_dee_data_sec1[i]; YgDeeDataSec1[i] = yg_dee_data_sec1[i];
5601  if ( DeeNumber == 2 || DeeNumber == 4 )
5602  {
5603  XgDeeDataSec1[i] = -XgDeeDataSec1[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5604  }
5605  XgDeeDataSec1[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5606  }
5607 
5608  TGraph *BDeeDataSec1 = new TGraph(ngmax, XgDeeDataSec1, YgDeeDataSec1);
5609  BDeeDataSec1->SetLineWidth(LineWidth);
5610  BDeeDataSec1->DrawGraph(ngmax, XgDeeDataSec1, YgDeeDataSec1);
5611 
5612  //================= S2->S3(EE-)
5613  ngmax = 6;
5614  Float_t xg_dee_data_sec2[6] = {11,15,15,40,40,47};
5615  Float_t yg_dee_data_sec2[6] = {50,50,55,55,60,60};
5616  for(Int_t i=0;i<ngmax;i++){
5617  xg_dee_data_sec2[i] = coefcc_x*xg_dee_data_sec2[i];
5618  yg_dee_data_sec2[i] = coefcc_y*yg_dee_data_sec2[i];}
5619 
5620  Float_t XgDeeDataSec2[6]; Float_t YgDeeDataSec2[6];
5621  for( Int_t i=0; i<ngmax; i++)
5622  {
5623  XgDeeDataSec2[i] = xg_dee_data_sec2[i]; YgDeeDataSec2[i] = yg_dee_data_sec2[i];
5624  if ( DeeNumber == 2 || DeeNumber == 4 )
5625  {
5626  XgDeeDataSec2[i] = -XgDeeDataSec2[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5627  }
5628  XgDeeDataSec2[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5629  }
5630  TGraph *BDeeDataSec2 = new TGraph(ngmax, XgDeeDataSec2, YgDeeDataSec2);
5631  BDeeDataSec2->SetLineWidth(LineWidth);
5632  BDeeDataSec2->DrawGraph(ngmax, XgDeeDataSec2, YgDeeDataSec2);
5633 
5634  //================= S3->S4(EE-)
5635  ngmax = 10;
5636  Float_t xg_dee_data_sec3[10] = {10,15,15,20,20,30,30,40,40,42};
5637  Float_t yg_dee_data_sec3[10] = {45,45,40,40,35,35,30,30,25,25};
5638  for(Int_t i=0;i<ngmax;i++){
5639  xg_dee_data_sec3[i] = coefcc_x*xg_dee_data_sec3[i];
5640  yg_dee_data_sec3[i] = coefcc_y*yg_dee_data_sec3[i];}
5641 
5642  Float_t XgDeeDataSec3[10]; Float_t YgDeeDataSec3[10];
5643  for( Int_t i=0; i<ngmax; i++)
5644  {
5645  XgDeeDataSec3[i] = xg_dee_data_sec3[i]; YgDeeDataSec3[i] = yg_dee_data_sec3[i];
5646  if ( DeeNumber == 2 || DeeNumber == 4 )
5647  {
5648  XgDeeDataSec3[i] = -XgDeeDataSec3[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5649  }
5650  XgDeeDataSec3[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5651  }
5652  TGraph *BDeeDataSec3 = new TGraph(ngmax, XgDeeDataSec3, YgDeeDataSec3);
5653  BDeeDataSec3->SetLineWidth(LineWidth);
5654  BDeeDataSec3->DrawGraph(ngmax, XgDeeDataSec3, YgDeeDataSec3);
5655 
5656  //================= S4->S5(EE-)
5657  ngmax = 6;
5658  Float_t xg_dee_data_sec4[6] = { 5, 5,10,10,15,15};
5659  Float_t yg_dee_data_sec4[6] = {40,30,30,15,15, 5};
5660  for(Int_t i=0;i<ngmax;i++){
5661  xg_dee_data_sec4[i] = coefcc_x*xg_dee_data_sec4[i];
5662  yg_dee_data_sec4[i] = coefcc_y*yg_dee_data_sec4[i];}
5663 
5664  Float_t XgDeeDataSec4[6]; Float_t YgDeeDataSec4[6];
5665  for( Int_t i=0; i<ngmax; i++)
5666  {
5667  XgDeeDataSec4[i] = xg_dee_data_sec4[i]; YgDeeDataSec4[i] = yg_dee_data_sec4[i];
5668  if ( DeeNumber == 2 || DeeNumber == 4 )
5669  {
5670  XgDeeDataSec4[i] = -XgDeeDataSec4[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5671  }
5672  XgDeeDataSec4[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5673  }
5674  TGraph *BDeeDataSec4 = new TGraph(ngmax, XgDeeDataSec4, YgDeeDataSec4);
5675  BDeeDataSec4->SetLineWidth(LineWidth);
5676  BDeeDataSec4->DrawGraph(ngmax, XgDeeDataSec4, YgDeeDataSec4);
5677 
5678 
5679  //..................................... Numeros des secteurs S_i (option "Dee" seulement)
5680  if( opt_plot == "Dee" || opt_plot == "EE" )
5681  {
5682  //............. Coordonnees des numeros de secteurs
5683  ngmax = 5;
5684  Float_t xg_coord_sector[5] = { 16, 41, 45, 33, -2};
5685  Float_t yg_coord_sector[5] = { 96, 83, 30, 5, -8};
5686 
5687  //....... Reprise secteurs 3 et 7
5688  if(opt_plot == "Dee" && (DeeNumber == 1) ){xg_coord_sector[2] += 0.5;}
5689  if(opt_plot == "Dee" && (DeeNumber == 2) ){xg_coord_sector[2] -= 1. ;}
5690  if(opt_plot == "Dee" && (DeeNumber == 3) ){xg_coord_sector[2] += 0.7;}
5691  if(opt_plot == "Dee" && (DeeNumber == 4) ){xg_coord_sector[2] -= 1.2;}
5692 
5693  if(opt_plot == "EE" && (DeeNumber == 2 || DeeNumber == 3) ){xg_coord_sector[2] += 0.55;}
5694  if(opt_plot == "EE" && (DeeNumber == 4 ) ){xg_coord_sector[2] -= 0.2;}
5695 
5696  for(Int_t i=0;i<ngmax;i++){
5697  xg_coord_sector[i] = coefcc_x*xg_coord_sector[i];
5698  yg_coord_sector[i] = coefcc_y*yg_coord_sector[i];}
5699 
5700  Float_t xg_sector[9];
5701  Float_t yg_sector[9];
5702  Int_t ns1 = 1;
5703  Int_t ns2 = 5;
5704  Float_t xinv_d2d4 = coefcc_x*44;
5705 
5706  if( DeeNumber == 1 )
5707  {
5708  ns1 = 1; ns2 = 5;
5709  xg_sector[1-ns1] = xg_coord_sector[1-ns1]; yg_sector[1-ns1] = yg_coord_sector[1-ns1];
5710  xg_sector[2-ns1] = xg_coord_sector[2-ns1]; yg_sector[2-ns1] = yg_coord_sector[2-ns1];
5711  xg_sector[3-ns1] = xg_coord_sector[3-ns1]; yg_sector[3-ns1] = yg_coord_sector[3-ns1];
5712  xg_sector[4-ns1] = xg_coord_sector[4-ns1]; yg_sector[4-ns1] = yg_coord_sector[4-ns1];
5713  xg_sector[5-ns1] = xg_coord_sector[5-ns1]; yg_sector[5-ns1] = yg_coord_sector[5-ns1];
5714  }
5715 
5716  if( DeeNumber == 2 )
5717  {
5718  ns1 = 5; ns2 = 9;
5719  xg_sector[ns2-1] = xinv_d2d4-xg_coord_sector[1-1]; yg_sector[ns2-1] = yg_coord_sector[1-1];
5720  xg_sector[ns2-2] = xinv_d2d4-xg_coord_sector[2-1]; yg_sector[ns2-2] = yg_coord_sector[2-1];
5721  xg_sector[ns2-3] = xinv_d2d4-xg_coord_sector[3-1]; yg_sector[ns2-3] = yg_coord_sector[3-1];
5722  xg_sector[ns2-4] = xinv_d2d4-xg_coord_sector[4-1]; yg_sector[ns2-4] = yg_coord_sector[4-1];
5723  xg_sector[ns2-5] = xinv_d2d4-xg_coord_sector[5-1]; yg_sector[ns2-5] = yg_coord_sector[5-1];
5724  }
5725  if( DeeNumber == 3 )
5726  {
5727  ns1 = 5; ns2 = 9;
5728  xg_sector[ns2-1]= xg_coord_sector[1-1]; yg_sector[ns2-1] = yg_coord_sector[1-1];
5729  xg_sector[ns2-2]= xg_coord_sector[2-1]; yg_sector[ns2-2] = yg_coord_sector[2-1];
5730  xg_sector[ns2-3]= xg_coord_sector[3-1]; yg_sector[ns2-3] = yg_coord_sector[3-1];
5731  xg_sector[ns2-4]= xg_coord_sector[4-1]; yg_sector[ns2-4] = yg_coord_sector[4-1];
5732  xg_sector[ns2-5]= xg_coord_sector[5-1]; yg_sector[ns2-5] = yg_coord_sector[5-1];
5733  }
5734  if( DeeNumber == 4 )
5735  {
5736  ns1 = 1; ns2 = 5;
5737  xg_sector[1-ns1]= xinv_d2d4-xg_coord_sector[1-ns1]; yg_sector[1-ns1] = yg_coord_sector[1-ns1];
5738  xg_sector[2-ns1]= xinv_d2d4-xg_coord_sector[2-ns1]; yg_sector[2-ns1] = yg_coord_sector[2-ns1];
5739  xg_sector[3-ns1]= xinv_d2d4-xg_coord_sector[3-ns1]; yg_sector[3-ns1] = yg_coord_sector[3-ns1];
5740  xg_sector[4-ns1]= xinv_d2d4-xg_coord_sector[4-ns1]; yg_sector[4-ns1] = yg_coord_sector[4-ns1];
5741  xg_sector[5-ns1]= xinv_d2d4-xg_coord_sector[5-ns1]; yg_sector[5-ns1] = yg_coord_sector[5-ns1];
5742  }
5743 
5744  Color_t coul_textsector = fCnaParHistos->ColorDefinition("vert37");
5745  for(Int_t ns=ns1; ns<= ns2; ns++)
5746  {
5747  xg_sector[ns-1] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5748  if( DeeNumber == 1 || DeeNumber == 2 ){sprintf( f_in, "+%d", ns);}
5749  if( DeeNumber == 3 || DeeNumber == 4 ){sprintf( f_in, "-%d", ns);}
5750  TText *text_num_module = new TText(xg_sector[ns-1], yg_sector[ns-1], f_in); fCnewRoot++;
5751  if(opt_plot == "Dee"){text_num_module->SetTextSize(0.065);}
5752  if(opt_plot == "EE" ){text_num_module->SetTextSize(0.045);}
5753  text_num_module->SetTextColor(coul_textsector);
5754  if( opt_plot == "Dee" ||
5755  ( opt_plot == "EE" && !( (DeeNumber == 3 && ns == 5) || (DeeNumber == 1 && ns == 5) ) ) )
5756  {text_num_module->Draw();}
5757 
5758  // text_num_module->Delete(); text_num_module = 0; fCdeleteRoot++;
5759  }
5760 
5761  //............................ numeros des dee's
5762  ngmax = 4;
5763  Float_t xg_coord_dee[4] = { 0, 0, 0, 0};
5764  Float_t yg_coord_dee[4] = {48, 48, 48, 48};
5765 
5766  xg_coord_dee[DeeNumber-1] = coefcc_x*xg_coord_dee[DeeNumber-1];
5767  yg_coord_dee[DeeNumber-1] = coefcc_y*yg_coord_dee[DeeNumber-1];
5768 
5769  Float_t xg_dee = xg_coord_dee[DeeNumber-1];
5770  Float_t yg_dee = yg_coord_dee[DeeNumber-1];
5771 
5772  Color_t coul_textdee = fCnaParHistos->ColorDefinition("noir");
5773 
5774  xg_dee += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber)
5775  + fCnaParHistos->DeeNumberOffsetX(opt_plot, DeeNumber);
5776 
5777  if( DeeNumber == 1 ){sprintf( f_in, "D1");}
5778  if( DeeNumber == 2 ){sprintf( f_in, "D2");}
5779  if( DeeNumber == 3 ){sprintf( f_in, "D3");}
5780  if( DeeNumber == 4 ){sprintf( f_in, "D4");}
5781 
5782  TText *text_num_module = new TText(xg_dee, yg_dee, f_in); fCnewRoot++;
5783  if( opt_plot == "EE" ){text_num_module->SetTextSize(0.045);}
5784  if( opt_plot == "Dee"){text_num_module->SetTextSize(0.085);}
5785  text_num_module->SetTextColor(coul_textdee);
5786  text_num_module->Draw();
5787  }
5788 
5789  //..................................... Numeros des Dee et indication EE+- (option "EE" seulement)
5790  if( opt_plot == "EE" )
5791  {
5792  //............................ indication EE+-
5793  ngmax = 4;
5794  Float_t xg_coord_eepm[4] = { 0, 0, 0, 0};
5795  Float_t yg_coord_eepm[4] = {95, 95, 95, 95};
5796 
5797  xg_coord_eepm[DeeNumber-1] = coefcc_x*xg_coord_eepm[DeeNumber-1];
5798  yg_coord_eepm[DeeNumber-1] = coefcc_y*yg_coord_eepm[DeeNumber-1];
5799 
5800  Float_t xg_eepm = xg_coord_eepm[DeeNumber-1];
5801  Float_t yg_eepm = yg_coord_eepm[DeeNumber-1];
5802 
5803  Color_t coul_texteepm = fCnaParHistos->ColorDefinition("noir");
5804 
5805  xg_eepm += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber)
5806  + fCnaParHistos->DeeNameOffsetX(DeeNumber);
5807 
5808  if( DeeNumber == 1 ){sprintf( f_in, "EE+F");}
5809  if( DeeNumber == 2 ){sprintf( f_in, "EE+N");}
5810  if( DeeNumber == 3 ){sprintf( f_in, "EE-N");}
5811  if( DeeNumber == 4 ){sprintf( f_in, "EE-F");}
5812 
5813  TText *text_num_eepm = new TText(xg_eepm, yg_eepm, f_in); fCnewRoot++;
5814  text_num_eepm->SetTextSize(0.04);
5815  text_num_eepm->SetTextColor(coul_texteepm);
5816  text_num_eepm->Draw();
5817  }
5818 
5819  //......................... mention "viewed from IP"
5820  Color_t coul_textfromIP = fCnaParHistos->ColorDefinition("rouge49");
5821  sprintf( f_in, "viewed from IP");
5822  Float_t x_from_ip = 15.;
5823  Float_t y_from_ip = -10.;
5824  if( opt_plot == "EE" ){y_from_ip = -16.;}
5825  x_from_ip = coefcc_x*x_from_ip;
5826  y_from_ip = coefcc_x*y_from_ip;
5827  if( opt_plot == "EE" && DeeNumber == 3 ){x_from_ip += 1.4*fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);}
5828  TText *text_from_ip = new TText(x_from_ip, y_from_ip, f_in); fCnewRoot++;
5829  text_from_ip->SetTextSize(0.045);
5830  if( opt_plot == "EE" ){text_from_ip->SetTextSize(0.035);}
5831  text_from_ip->SetTextColor(coul_textfromIP);
5832  if( opt_plot == "Dee" || (opt_plot == "EE" && DeeNumber == 3) ){text_from_ip->Draw();}
5833 
5834  delete [] f_in; f_in = nullptr; fCdelete++;
5835 
5836 } // ------ end of EEDataSectors() ------
5837 
5838 //==========================================================================================
5839 
5840 void TEcnaHistos::EEGridAxis( const Int_t& DeeNumber, const TString& opt_plot, const TString& c_option)
5841 {
5842  //------------------ trace axes en IX et IY --------------- EEGridAxis
5843  //=============================================================================== Axe IX
5844  Int_t size_IX_dee = fEcal->MaxSCIXInDee();
5845 
5846  Double_t IX_min = fEcalNumbering->GetIIXMin(1) - 0.5; // IX_min = 0.5 pour les 4 dee's
5847  Double_t IX_max = fEcalNumbering->GetIIXMax()*fEcal->MaxCrysIXInSC() + 0.5; // IX_max = 50.5 pour les 4 dee's
5848 
5849  Int_t MatSize = 1;
5850  if( opt_plot == "Dee" && c_option == "corcc" )
5851  {
5852  MatSize = fEcal->MaxCrysInSC();
5853  IX_min = fEcalNumbering->GetIIXMin() - 0.5;
5854  IX_max = fEcalNumbering->GetIIXMax() + 0.5;
5855  }
5856  if( opt_plot == "EE" && c_option == "corcc" ){return;} // => a voir...
5857 
5858  if( opt_plot == "Dee" && c_option != "corcc" ){MatSize = fEcal->MaxCrysIXInSC();}
5859  if( opt_plot == "EE" && c_option != "corcc" ){MatSize = 1;}
5860 
5861  TString x_var_name = " ";
5862 
5863  Float_t axis_x_inf = 0;
5864  Float_t axis_x_sup = 0;
5865  Float_t axis_y_inf = 0;
5866  Float_t axis_y_sup = 0;
5867  Int_t axis_nb_div = 205; // DEFAULT: option "EE"
5868  Double_t IX_values_min = 0;
5869  Double_t IX_values_max = 0;
5870  Option_t* chopt = "C";
5871 
5872  //........................................................................EEGridAxis
5873  if( DeeNumber == 1 ) // xmin -> xmax <=> right->left
5874  {
5875  //.....axis min->max/left->right: first draw axis with -ticksize and no label
5876  axis_x_inf = size_IX_dee*MatSize;
5877  axis_x_sup = 0;
5878  axis_y_inf = 0;
5879  axis_y_sup = 0;
5880  IX_values_min = -IX_max; // -50.5 right
5881  IX_values_max = -IX_min; // - 0.5 left
5882  if( opt_plot == "Dee" ){x_var_name = GetIXIYAxisTitle("iIXDee1");}
5883  if( opt_plot == "EE" ){x_var_name = GetIXIYAxisTitle("iIXEE");}
5884  if( opt_plot == "Dee" ){axis_nb_div = size_IX_dee;}
5885  chopt = "-CSU";
5886  }
5887  if( DeeNumber == 2 ) // xmin -> xmax <=> right->left
5888  {
5889  //.....axis min->max/left->right: first draw axis with -ticksize and no label
5890  axis_x_inf = size_IX_dee*MatSize;
5891  axis_x_sup = 0;
5892  axis_y_inf = 0;
5893  axis_y_sup = 0;
5894  IX_values_min = IX_min; // + 0.5 right
5895  IX_values_max = IX_max; // +50.5 left
5896  if( opt_plot == "Dee" ){x_var_name = GetIXIYAxisTitle("iIXDee2");}
5897  if( opt_plot == "EE" ){x_var_name = " ";}
5898  if( opt_plot == "Dee" ){axis_nb_div = size_IX_dee;}
5899  chopt = "-CSU";
5900  }
5901  if( DeeNumber == 3 ) // xmin -> xmax <=> left->right
5902  {
5903  axis_x_inf = 0;
5904  axis_x_sup = size_IX_dee*MatSize;
5905  axis_y_inf = 0;
5906  axis_y_sup = 0;
5907  IX_values_min = IX_min; // + 0.5 left
5908  IX_values_max = IX_max; // +50.5 right
5909  if( opt_plot == "Dee" ){x_var_name = GetIXIYAxisTitle("iIXDee3");}
5910  if( opt_plot == "EE" ){x_var_name = " ";}
5911  if( opt_plot == "Dee" ){axis_nb_div = size_IX_dee;}
5912  chopt = "CS";
5913  }
5914  if( DeeNumber == 4 ) // xmin -> xmax <=> left->right
5915  {
5916  axis_x_inf = 0;
5917  axis_x_sup = size_IX_dee*MatSize;
5918  axis_y_inf = 0;
5919  axis_y_sup = 0;
5920  IX_values_min = -IX_max; // -50.5 left
5921  IX_values_max = -IX_min; // - 0.5 right
5922  if( opt_plot == "Dee" ){x_var_name = GetIXIYAxisTitle("iIXDee4");}
5923  if( opt_plot == "EE" ){x_var_name = " ";}
5924  if( opt_plot == "Dee" ){axis_nb_div = size_IX_dee;}
5925  chopt = "CS";
5926  }
5927 
5928  //.................................................................... EEGridAxis
5929  axis_x_inf += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5930  axis_x_sup += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5931 
5932  TGaxis* sup_axis_x = nullptr;
5933  sup_axis_x = new TGaxis(axis_x_inf, axis_y_inf, axis_x_sup, axis_y_sup,
5934  IX_values_min, IX_values_max, axis_nb_div, chopt, 0.); fCnewRoot++;
5935 
5936  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
5937  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize();
5938 
5939  Float_t tic_siz_x = fCnaParHistos->AxisTickSize("Deex");
5940  if(opt_plot == "EE"){tic_siz_x = fCnaParHistos->AxisTickSize("EEx");}
5941 
5942  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("Deex");
5943  if(opt_plot == "EE"){tit_off_x = fCnaParHistos->AxisTitleOffset("EEx");}
5944 
5945  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("Deex");
5946  if(opt_plot == "EE"){lab_off_x = fCnaParHistos->AxisLabelOffset("EEx");}
5947 
5948  sup_axis_x->SetTitle(x_var_name);
5949  sup_axis_x->SetTitleSize(tit_siz_x);
5950  sup_axis_x->SetTitleOffset(tit_off_x);
5951  sup_axis_x->SetLabelSize(lab_siz_x);
5952  sup_axis_x->SetLabelOffset(lab_off_x);
5953  sup_axis_x->SetTickSize(tic_siz_x);
5954  sup_axis_x->Draw("SAME");
5955 
5956  //.....axis min->max/right->left: redraw axis with ticksize = 0 and with -labelOffset
5957  if( DeeNumber == 1 || DeeNumber == 2 )
5958  {
5959  chopt = "CS";
5960  TGaxis* sup_axis_x_bis = nullptr;
5961  sup_axis_x_bis = new TGaxis(axis_x_inf, axis_y_inf, axis_x_sup, axis_y_sup,
5962  IX_values_min, IX_values_max, axis_nb_div, chopt, 0.); fCnewRoot++;
5963  sup_axis_x_bis->SetTickSize(0.);
5964  lab_siz_x = sup_axis_x->GetLabelSize();
5965  sup_axis_x_bis->SetLabelSize(lab_siz_x);
5966  lab_off_x = sup_axis_x->GetLabelOffset();
5967  sup_axis_x_bis->SetLabelOffset(-lab_off_x);
5968  sup_axis_x_bis->Draw("SAME");
5969  }
5970 
5971  //================================================================== Axe IY EEGridAxis
5972 
5973  if( opt_plot == "Dee" || (opt_plot == "EE" && DeeNumber == 4) )
5974  {
5975  Int_t size_IY_dee = fEcal->MaxSCIYInDee();
5976  Int_t size_IY_axis = size_IY_dee;
5977 
5978  if( opt_plot == "Dee" ){axis_nb_div = size_IY_axis;}
5979  if( opt_plot == "EE" ){axis_nb_div = 210;}
5980 
5981  Double_t jIY_min = fEcalNumbering->GetJIYMin(DeeNumber, 1) - 0.5;
5982  Double_t jIY_max = fEcalNumbering->GetJIYMax(DeeNumber)*fEcal->MaxCrysIYInSC() + 0.5;
5983 
5984  TString jy_var_name = " ";
5985  TString jy_direction = "x";
5986 
5987  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
5988  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
5989 
5990  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("Deey");
5991  if(opt_plot == "EE"){tic_siz_y = fCnaParHistos->AxisTickSize("EEy");}
5992 
5993  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("Deey");
5994  if(opt_plot == "EE"){tit_off_y = fCnaParHistos->AxisTitleOffset("EEy");}
5995 
5996  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("Deey");
5997  if(opt_plot == "EE"){lab_off_y = fCnaParHistos->AxisLabelOffset("EEy");}
5998 
5999  TGaxis* axis_jy_plus = nullptr;
6000  axis_jy_plus = new TGaxis((Float_t)0., (Float_t)0.,
6001  (Float_t)0., (Float_t)(size_IY_axis*MatSize),
6002  jIY_min, jIY_max, axis_nb_div, "SC", 0.); fCnewRoot++;
6003 
6004  jy_var_name = GetIXIYAxisTitle("jIYDee");
6005  axis_jy_plus->SetTitle(jy_var_name);
6006  axis_jy_plus->SetTitleSize(tit_siz_y);
6007  axis_jy_plus->SetTitleOffset(tit_off_y);
6008  axis_jy_plus->SetLabelSize(lab_siz_y);
6009  axis_jy_plus->SetLabelOffset(lab_off_y);
6010  axis_jy_plus->SetTickSize(tic_siz_y);
6011  axis_jy_plus->Draw("SAME");
6012  }
6013 
6014 //---------------------------------- 2 axes (0,50) et (0,-50)
6015 #define IYAX
6016 #ifndef IYAX
6017  if( opt_plot == "Dee" || (opt_plot == "EE" && DeeNumber == 4) )
6018  {
6019  Int_t size_IY_dee = fEcal->MaxSCIYInDee();
6020  Int_t size_IY_axis = size_IY_dee/2;
6021 
6022  if( opt_plot == "Dee" ){axis_nb_div = (Int_t)size_IY_axis;}
6023  if( opt_plot == "EE" ){axis_nb_div = 5;}
6024 
6025  Double_t jIY_min = fEcalNumbering->GetJIYMin(DeeNumber, 1) - 0.5;
6026  Double_t jIY_max = (fEcalNumbering->GetJIYMax(DeeNumber)/2)*fEcal->MaxCrysIYInSC() + 0.5;
6027 
6028  TString jy_var_name = " ";
6029  TString jy_direction = "x";
6030 
6031  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
6032  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
6033 
6034  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("Deey");
6035  if(opt_plot == "EE"){tic_siz_y = fCnaParHistos->AxisTickSize("EEy");}
6036 
6037  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("Deey");
6038  if(opt_plot == "EE"){tit_off_y = fCnaParHistos->AxisTitleOffset("EEy");}
6039 
6040  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("Deey");
6041  if(opt_plot == "EE"){lab_off_y = fCnaParHistos->AxisLabelOffset("EEy");}
6042 
6043  TGaxis* axis_jy_plus = 0;
6044  axis_jy_plus = new TGaxis((Float_t)0., (Float_t)(size_IY_dee*MatSize/2),
6045  (Float_t)0., (Float_t)(2*size_IY_dee*MatSize/2),
6046  jIY_min, jIY_max, axis_nb_div, "SC", 0.); fCnewRoot++;
6047 
6048  jy_var_name = GetIXIYAxisTitle("jIYDee");
6049  axis_jy_plus->SetTitle(jy_var_name);
6050  axis_jy_plus->SetTitleSize(tit_siz_y);
6051  axis_jy_plus->SetTitleOffset(tit_off_y);
6052  axis_jy_plus->SetLabelSize(lab_siz_y);
6053  axis_jy_plus->SetLabelOffset(lab_off_y);
6054  axis_jy_plus->SetTickSize(tic_siz_y);
6055  axis_jy_plus->Draw("SAME");
6056 
6057  TGaxis* axis_jy_minus = 0;
6058  axis_jy_minus = new TGaxis((Float_t)0., (Float_t)(size_IY_dee*MatSize/2),
6059  (Float_t)0., (Float_t)0.,
6060  -jIY_min, -jIY_max, axis_nb_div, "-SC", 0.); fCnewRoot++;
6061 
6062  jy_var_name = GetIXIYAxisTitle("jIYDee");
6063  axis_jy_minus->SetTitle(jy_var_name);
6064  axis_jy_minus->SetTitleSize(tit_siz_y);
6065  axis_jy_minus->SetTitleOffset(tit_off_y);
6066  axis_jy_minus->SetLabelSize(lab_siz_y);
6067  axis_jy_minus->SetLabelOffset(lab_off_y);
6068  axis_jy_minus->SetTickSize(tic_siz_y);
6069  axis_jy_minus->Draw("SAME");
6070  }
6071 #endif // IYAX
6072 
6073 } // ------------- end of EEGridAxis(...) --------------
6074 
6075 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6076 //
6077 // ViewHisto(***)
6078 //
6079 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6080 //======================== D_MSp_SpNb
6081 void TEcnaHistos::XtalSamplesEv(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6082  const Int_t& n1StexStin, const Int_t& i0StinEcha)
6083 {XtalSamplesEv(arg_read_histo, arg_AlreadyRead, n1StexStin, i0StinEcha, "ONLYONE");}
6084 void TEcnaHistos::XtalSamplesEv(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6085  const Int_t& n1StexStin, const Int_t& i0StinEcha,
6086  const TString& PlotOption)
6087 {
6088  if( fFapStexNumber > 0 )
6089  {
6090  if( PlotOption == fAllXtalsInStinPlot )
6091  {
6092  Int_t StexStin_A = n1StexStin;
6093  if( fFlagSubDet == "EE" )
6094  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6095 
6096  Bool_t aOKData = kFALSE;
6097  TVectorD read_histo(fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6098 
6099  if( arg_AlreadyRead == fTobeRead )
6100  {
6106 
6107  if ( fMyRootFile->LookAtRootFile() == kTRUE )
6108  {
6109  fStatusFileFound = kTRUE;
6110  read_histo = fMyRootFile->ReadSampleMeans(StexStin_A, fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6111  if( fMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE;}
6112  }
6113  else
6114  {
6115  fStatusFileFound = kFALSE;
6116  std::cout << "!TEcnaHistos::XtalSamplesEv(...)> Data not available (ROOT file not found)." << std::endl;
6117  }
6118  if( fStatusFileFound == kTRUE && fStatusDataExist == kTRUE ){aOKData = kTRUE;}
6119  }
6120  if( arg_AlreadyRead >= 1 )
6121  {
6122  for(Int_t i=0; i<fEcal->MaxCrysInStin()*fEcal->MaxSampADC(); i++){read_histo[i] = arg_read_histo[i];}
6123  fStatusDataExist = kTRUE;
6124  aOKData = kTRUE;
6125  }
6126 
6127  if( aOKData == kTRUE )
6128  {
6129  TVectorD read_histo_samps(fFapNbOfSamples);
6130 
6131  Int_t xAlreadyRead = 1;
6132  for( Int_t i0_stin_echa=0; i0_stin_echa<fEcal->MaxCrysInStin(); i0_stin_echa++)
6133  {
6134  if( fFapStexName == "SM" )
6135  {std::cout << "*TEcnaHistos::XtalSamplesEv(...)> channel " << std::setw(2) << i0_stin_echa << ": ";}
6136  if( fFapStexName == "Dee" )
6137  {std::cout << "*TEcnaHistos::XtalSamplesEv(...)> Xtal " << std::setw(2) << i0_stin_echa+1 << ": ";}
6138 
6139  for( Int_t i0_samp=0; i0_samp<fFapNbOfSamples; i0_samp++ )
6140  {
6141  read_histo_samps(i0_samp) = read_histo(i0_stin_echa*fFapNbOfSamples+i0_samp);
6142  std::cout << std::setprecision(4) << std::setw(8) << read_histo_samps(i0_samp) << ", " ;
6143  }
6144  std::cout << std::endl;
6145  ViewHisto(read_histo_samps, xAlreadyRead,
6146  StexStin_A, i0_stin_echa, fZerv, "D_MSp_SpNb", fAllXtalsInStinPlot);
6147  xAlreadyRead++;
6148  }
6149  xAlreadyRead = 0;
6150  }
6151  else
6152  {
6153  std::cout << "!TEcnaHistos::XtalSamplesEv(...)> Data not available." << std::endl;
6154  }
6155  }
6156 
6157  if( !(PlotOption == fAllXtalsInStinPlot) )
6158  {
6159  Int_t StexStin_A = n1StexStin;
6160  if( fFlagSubDet == "EE" )
6161  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6162  ViewHisto(fReadHistoDummy, fTobeRead, StexStin_A, i0StinEcha, fZerv, "D_MSp_SpNb", PlotOption);
6163  }
6164  }
6165  else
6166  {
6167  std::cout << "!TEcnaHistos::XtalSamplesEv(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6168  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << std::endl;
6169  }
6170 }
6171 
6172 //======================== D_MSp_SpDs
6173 void TEcnaHistos::EvSamplesXtals(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6174  const Int_t& n1StexStin, const Int_t& i0StinEcha)
6175 {EvSamplesXtals(arg_read_histo, arg_AlreadyRead, n1StexStin, i0StinEcha, "ONLYONE");}
6176 void TEcnaHistos::EvSamplesXtals(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6177  const Int_t& n1StexStin, const Int_t& i0StinEcha,
6178  const TString& PlotOption)
6179 {
6180  if( fFapStexNumber > 0 )
6181  {
6182  if( PlotOption == fAllXtalsInStinPlot )
6183  {
6184  Int_t StexStin_A = n1StexStin;
6185  if( fFlagSubDet == "EE" )
6186  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6187 
6188  Bool_t aOKData = kFALSE;
6189  TVectorD read_histo(fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6190 
6191  if( arg_AlreadyRead == fTobeRead )
6192  {
6198 
6199  if ( fMyRootFile->LookAtRootFile() == kTRUE )
6200  {
6201  fStatusFileFound = kTRUE;
6202  read_histo = fMyRootFile->ReadSampleMeans(StexStin_A, fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6203  if( fMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE;}
6204  }
6205  else
6206  {
6207  fStatusFileFound = kFALSE;
6208  std::cout << "!TEcnaHistos::EvSamplesXtals(...)> Data not available (ROOT file not found)." << std::endl;
6209  }
6210  if( fStatusFileFound == kTRUE && fStatusDataExist == kTRUE ){aOKData = kTRUE;}
6211  }
6212  if( arg_AlreadyRead >= 1 )
6213  {
6214  for(Int_t i=0; i<fEcal->MaxCrysInStin()*fEcal->MaxSampADC(); i++){read_histo[i] = arg_read_histo[i];}
6215  fStatusDataExist = kTRUE;
6216  aOKData = kTRUE;
6217  }
6218  if( aOKData == kTRUE )
6219  {
6220  TVectorD read_histo_samps(fFapNbOfSamples);
6221 
6222  Int_t xAlreadyRead = 1;
6223  for( Int_t i0_stin_echa=0; i0_stin_echa<fEcal->MaxCrysInStin(); i0_stin_echa++)
6224  {
6225  if( fFapStexName == "SM" )
6226  {std::cout << "*TEcnaHistos::EvSamplesXtals(...)> channel " << std::setw(2) << i0_stin_echa << ": ";}
6227  if( fFapStexName == "Dee" )
6228  {std::cout << "*TEcnaHistos::EvSamplesXtals(...)> Xtal " << std::setw(2) << i0_stin_echa+1 << ": ";}
6229 
6230  for( Int_t i0_samp=0; i0_samp<fFapNbOfSamples; i0_samp++ )
6231  {
6232  read_histo_samps(i0_samp) = read_histo(i0_stin_echa*fFapNbOfSamples+i0_samp);
6233  std::cout << std::setprecision(4) << std::setw(8) << read_histo_samps(i0_samp) << ", " ;
6234  }
6235  std::cout << std::endl;
6236  ViewHisto(read_histo_samps, xAlreadyRead,
6237  StexStin_A, i0_stin_echa, fZerv, "D_MSp_SpDs", fAllXtalsInStinPlot);
6238  xAlreadyRead++;
6239  }
6240  xAlreadyRead = 0;
6241  }
6242  else
6243  {
6244  std::cout << "!TEcnaHistos::EvSamplesXtals(...)> Data not available." << std::endl;
6245  }
6246  }
6247 
6248  if( !(PlotOption == fAllXtalsInStinPlot) )
6249  {
6250  Int_t StexStin_A = n1StexStin;
6251  if( fFlagSubDet == "EE" )
6252  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6253  ViewHisto(fReadHistoDummy, fTobeRead, StexStin_A, i0StinEcha, fZerv, "D_MSp_SpDs", PlotOption);
6254  }
6255  }
6256  else
6257  {
6258  std::cout << "!TEcnaHistos::EvSamplesXtals(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6259  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << std::endl;
6260  }
6261 } // end of EvSamplesXtals(...)
6262 
6263 //======================== D_SSp_SpNb
6264 void TEcnaHistos::XtalSamplesSigma(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6265  const Int_t& n1StexStin, const Int_t& i0StinEcha)
6266 {XtalSamplesSigma(arg_read_histo, arg_AlreadyRead, n1StexStin, i0StinEcha, "ONLYONE");}
6267 void TEcnaHistos::XtalSamplesSigma(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6268  const Int_t& n1StexStin, const Int_t& i0StinEcha,
6269  const TString& PlotOption)
6270 {
6271  if( fFapStexNumber > 0 )
6272  {
6273  if( PlotOption == fAllXtalsInStinPlot )
6274  {
6275  Int_t StexStin_A = n1StexStin;
6276  if( fFlagSubDet == "EE" )
6277  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6278 
6279  Bool_t aOKData = kFALSE;
6280  TVectorD read_histo(fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6281 
6282  if( arg_AlreadyRead == fTobeRead )
6283  {
6289 
6290  if ( fMyRootFile->LookAtRootFile() == kTRUE )
6291  {
6292  fStatusFileFound = kTRUE;
6293  read_histo = fMyRootFile->ReadSampleSigmas(StexStin_A, fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6294  if( fMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE;}
6295  }
6296  else
6297  {
6298  fStatusFileFound = kFALSE;
6299  std::cout << "!TEcnaHistos::XtalSamplesSigma(...)> Data not available (ROOT file not found)." << std::endl;
6300  }
6301  if( fStatusFileFound == kTRUE && fStatusDataExist == kTRUE ){aOKData = kTRUE;}
6302  }
6303  if( arg_AlreadyRead >= 1 )
6304  {
6305  for(Int_t i=0; i<fEcal->MaxCrysInStin()*fEcal->MaxSampADC(); i++){read_histo[i] = arg_read_histo[i];}
6306  fStatusDataExist = kTRUE;
6307  aOKData = kTRUE;
6308  }
6309  if( aOKData == kTRUE )
6310  {
6311  TVectorD read_histo_samps(fFapNbOfSamples);
6312 
6313  Int_t xAlreadyRead = 1;
6314  for( Int_t i0_stin_echa=0; i0_stin_echa<fEcal->MaxCrysInStin(); i0_stin_echa++)
6315  {
6316  if( fFapStexName == "SM" )
6317  {std::cout << "*TEcnaHistos::XtalSamplesSigma(...)> channel " << std::setw(2) << i0_stin_echa << ": ";}
6318  if( fFapStexName == "Dee" )
6319  {std::cout << "*TEcnaHistos::XtalSamplesSigma(...)> Xtal " << std::setw(2) << i0_stin_echa+1 << ": ";}
6320 
6321  for( Int_t i0_samp=0; i0_samp<fFapNbOfSamples; i0_samp++ )
6322  {
6323  read_histo_samps(i0_samp) = read_histo(i0_stin_echa*fFapNbOfSamples+i0_samp);
6324  std::cout << std::setprecision(3) << std::setw(6) << read_histo_samps(i0_samp) << ", " ;
6325  }
6326  std::cout << std::endl;
6327  ViewHisto(read_histo_samps, xAlreadyRead,
6328  StexStin_A, i0StinEcha, fZerv, "D_SSp_SpNb", fAllXtalsInStinPlot);
6329  xAlreadyRead++;
6330  }
6331  xAlreadyRead = 0;
6332  }
6333  else
6334  {
6335  std::cout << "!TEcnaHistos::XtalSamplesSigma(...)> Data not available." << std::endl;
6336  }
6337  }
6338 
6339  if( !(PlotOption == fAllXtalsInStinPlot) )
6340  {
6341  Int_t StexStin_A = n1StexStin;
6342  if( fFlagSubDet == "EE" )
6343  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6344  ViewHisto(fReadHistoDummy, fTobeRead, StexStin_A, i0StinEcha, fZerv, "D_SSp_SpNb", PlotOption);
6345  }
6346  }
6347  else
6348  {
6349  std::cout << "!TEcnaHistos::XtalSamplesSigma(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6350  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << std::endl;
6351  }
6352 }
6353 
6354 
6355 //======================== D_SSp_SpDs
6356 void TEcnaHistos::SigmaSamplesXtals(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6357  const Int_t& n1StexStin, const Int_t& i0StinEcha)
6358 {SigmaSamplesXtals(arg_read_histo, arg_AlreadyRead, n1StexStin, i0StinEcha, "ONLYONE");}
6359 void TEcnaHistos::SigmaSamplesXtals(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6360  const Int_t& n1StexStin, const Int_t& i0StinEcha,
6361  const TString& PlotOption)
6362 {
6363  if( fFapStexNumber > 0 )
6364  {
6365  if( PlotOption == fAllXtalsInStinPlot )
6366  {
6367  Int_t StexStin_A = n1StexStin;
6368  if( fFlagSubDet == "EE" )
6369  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6370 
6371  Bool_t aOKData = kFALSE;
6372  TVectorD read_histo(fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6373 
6374  if( arg_AlreadyRead == fTobeRead )
6375  {
6381  if ( fMyRootFile->LookAtRootFile() == kTRUE )
6382  {
6383  fStatusFileFound = kTRUE;
6384  read_histo = fMyRootFile->ReadSampleSigmas(StexStin_A, fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6385  if( fMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE;}
6386  }
6387  else
6388  {
6389  fStatusFileFound = kFALSE;
6390  std::cout << "!TEcnaHistos::SigmaSamplesXtals(...)> Data not available (ROOT file not found)." << std::endl;
6391  }
6392  if( fStatusFileFound == kTRUE && fStatusDataExist == kTRUE ){aOKData = kTRUE;}
6393  }
6394 
6395  if( arg_AlreadyRead >= 1 )
6396  {
6397  for(Int_t i=0; i<fEcal->MaxCrysInStin()*fEcal->MaxSampADC(); i++){read_histo[i] = arg_read_histo[i];}
6398  fStatusDataExist = kTRUE;
6399  aOKData = kTRUE;
6400  }
6401  if( aOKData == kTRUE )
6402  {
6403  TVectorD read_histo_samps(fFapNbOfSamples);
6404 
6405  Int_t xAlreadyRead = 1;
6406  for( Int_t i0_stin_echa=0; i0_stin_echa<fEcal->MaxCrysInStin(); i0_stin_echa++)
6407  {
6408  if( fFapStexName == "SM" )
6409  {std::cout << "*TEcnaHistos::SigmaSamplesXtals(...)> channel " << std::setw(2) << i0_stin_echa << ": ";}
6410  if( fFapStexName == "Dee" )
6411  {std::cout << "*TEcnaHistos::SigmaSamplesXtals(...)> Xtal " << std::setw(2) << i0_stin_echa+1 << ": ";}
6412 
6413  for( Int_t i0_samp=0; i0_samp<fFapNbOfSamples; i0_samp++ )
6414  {
6415  read_histo_samps(i0_samp) = read_histo(i0_stin_echa*fFapNbOfSamples+i0_samp);
6416  std::cout << std::setprecision(3) << std::setw(6) << read_histo_samps(i0_samp) << ", " ;
6417  }
6418  std::cout << std::endl;
6419  ViewHisto(read_histo_samps, xAlreadyRead,
6420  StexStin_A, i0StinEcha, fZerv, "D_SSp_SpDs", fAllXtalsInStinPlot);
6421  xAlreadyRead++;
6422  }
6423  xAlreadyRead = 0;
6424  }
6425  else
6426  {
6427  std::cout << "!TEcnaHistos::SigmaSamplesXtals(...)> Data not available." << std::endl;
6428  }
6429  }
6430 
6431  if( !(PlotOption == fAllXtalsInStinPlot) )
6432  {
6433  Int_t StexStin_A = n1StexStin;
6434  if( fFlagSubDet == "EE" )
6435  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6436  ViewHisto(fReadHistoDummy, fTobeRead, StexStin_A, i0StinEcha, fZerv, "D_SSp_SpDs", PlotOption);
6437  }
6438  }
6439  else
6440  {
6441  std::cout << "!TEcnaHistos::SigmaSamplesXtals(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6442  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << std::endl;
6443  }
6444 } // end of SigmaSamplesXtals(...)
6445 
6446 //==========================================================================================
6447 //
6448 // ViewHisto
6449 //
6450 // arg_read_histo = array containing the values
6451 // arg_AlreadyRead = histo flag: =1 => arg_read_histo exists,
6452 // =0 => values will be read by internal
6453 // call to TEcnaRead inside ViewHisto
6454 // StexStin_A = [1,68] or [1,150] ==> tower# if EB, SC# if EE
6455 // i0StinEcha = [0,24] = Electronic channel# in tower (if EB) or SC (if EE)
6456 // i0Sample = [0,9] = sample#
6457 // HistoCode = String for histo type (pedestal, total noise, mean cor(s,s), ...)
6458 // opt_plot_arg = String for plot option (SAME or not SAME)
6459 //
6460 //===========================================================================================
6461 void TEcnaHistos::ViewHisto(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6462  const Int_t& StexStin_A, const Int_t& i0StinEcha,
6463  const Int_t& i0Sample, const TString& HistoCode,
6464  const TString& opt_plot_arg)
6465 {
6466  //Histogram of the quantities (one run)
6467 
6468  TString opt_plot = opt_plot_arg;
6469  fPlotAllXtalsInStin = 0;
6470 
6471  if( opt_plot_arg == fAllXtalsInStinPlot ){opt_plot = fOnlyOnePlot; fPlotAllXtalsInStin = 1;}
6472 
6473  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
6474 
6475  Int_t OKHisto = 0;
6476 
6477  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Canvas already closed in option SAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6478  Int_t xCanvasExists = 1; // a priori ==> Canvas exists // (ViewHisto)
6479  if( opt_plot != fOnlyOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
6480  {
6481  TVirtualPad* main_subpad = nullptr;
6482  //---------------- Call to ActivePad
6483  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
6484  if( main_subpad == nullptr )
6485  {
6486  std::cout << "*TEcnaHistos::ViewHisto(...)> WARNING ===> Canvas has been closed in option SAME or SAME n."
6487  << std::endl
6488  << " Please, restart with a new canvas."
6489  << fTTBELL << std::endl;
6490 
6491  ReInitCanvas(HistoCode, opt_plot);
6492  xCanvasExists = 0;
6493  }
6494  }
6495  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6496 
6497  //%%%%%%%%%%%%%%%%%%%%%%%% Change of X variable in option SAME n with no proj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6498  Int_t SameXVarMemo = 1; // a priori ==> SAME n option: X variable OK (ViewHisto)
6499  if( !(HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj") &&
6500  !(arg_AlreadyRead >= 1) )
6501  {
6502  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
6503  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
6504  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
6505  {
6506  SetXVarMemo(HistoCode, opt_plot, XVarHisto); SetYVarMemo(HistoCode, opt_plot, YVarHisto); SameXVarMemo = 1;
6507  }
6508  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
6509  {
6510  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
6511  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
6512 
6513  if( XVarHisto != XVariableMemo )
6514  {
6515  std::cout << "!TEcnaHistos::ViewHisto(...)> *** ERROR *** ===> X coordinate changed in option SAME n." << std::endl
6516  << " Present X = " << XVarHisto << std::endl
6517  << " Present Y = " << YVarHisto << std::endl
6518  << " Previous X = " << XVariableMemo << std::endl
6519  << " Previous Y = " << YVariableMemo
6520  << fTTBELL << std::endl;
6521  SameXVarMemo = 0;
6522  }
6523  else
6524  {SetYVarMemo(HistoCode, opt_plot, YVarHisto);}
6525  }
6526  }
6527  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6528 
6529  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Change of Y variable in option SAME n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6530  Int_t SameYVarMemo = 1; // a priori ==> SAME n option: Y variable OK (ViewHisto)
6531  if( (HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj") &&
6532  !(arg_AlreadyRead >= 1) )
6533  {
6534  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
6535  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
6536  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
6537  {
6538  SetYVarMemo(HistoCode, opt_plot, YVarHisto); SetYVarMemo(HistoCode, opt_plot, YVarHisto); SameYVarMemo = 1;
6539  }
6540  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
6541  {
6542  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
6543  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
6544 
6545  if( YVarHisto != YVariableMemo )
6546  {
6547  std::cout << "!TEcnaHistos::ViewHisto(...)> *** ERROR *** ===> Y coordinate changed in option SAME n." << std::endl
6548  << " Present X = " << XVarHisto << std::endl
6549  << " Present Y = " << YVarHisto << std::endl
6550  << " Previous X = " << XVariableMemo << std::endl
6551  << " Previous Y = " << YVariableMemo
6552  << fTTBELL << std::endl;
6553  SameYVarMemo = 0;
6554  }
6555  else
6556  {SetYVarMemo(HistoCode, opt_plot, YVarHisto);}
6557  }
6558  }
6559  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6560 
6561  //%%%%%%%%%%%%%%%%%%%%%%%%%%% Number of bins change in option SAME or SAME n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6562  Int_t OkBinsMemoSameOne = 1; // a priori ==> SAME n option: Nb bins OK (ViewHisto)
6563 
6564  Int_t SizeForPlot = GetHistoSize(HistoCode.Data(), "plot");
6565  Int_t xNbBins = GetHistoNumberOfBins(HistoCode.Data(), SizeForPlot);
6566 
6567  if( (opt_plot == fSameOnePlot || opt_plot == fSeveralPlot) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
6568  {
6569  SetNbBinsMemo(HistoCode, opt_plot, xNbBins); OkBinsMemoSameOne = 1;
6570  }
6571 
6572  if( (opt_plot == fSameOnePlot || opt_plot == fSeveralPlot) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
6573  {
6574  Int_t NbBinsMemo = GetNbBinsFromMemo(HistoCode, opt_plot);
6575  if( xNbBins != NbBinsMemo )
6576  {
6577  std::cout << "!TEcnaHistos::ViewHisto(...)> *** ERROR *** ===> Number of bins changed in option SAME or SAME n."
6578  << " Present number = " << xNbBins << ", requested number = " << NbBinsMemo << fTTBELL << std::endl;
6579  OkBinsMemoSameOne = 0;
6580  }
6581  }
6582 
6583  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6584 
6585  if( xCanvasExists == 1 && SameXVarMemo == 1 && SameYVarMemo == 1 && OkBinsMemoSameOne == 1 ){OKHisto = 1;}
6586 
6587  //======================== Histo accepted (ViewHisto)
6588  if( OKHisto == 1 )
6589  {
6590  Int_t opt_scale_x = fOptScaleLinx;
6591  if (fFlagScaleX == "LIN" ){opt_scale_x = fOptScaleLinx;}
6592  if (fFlagScaleX == "LOG" ){opt_scale_x = fOptScaleLogx;}
6593 
6594  Int_t opt_scale_y = fOptScaleLiny;
6595  if (fFlagScaleY == "LIN" ){opt_scale_y = fOptScaleLiny;}
6596  if (fFlagScaleY == "LOG" ){opt_scale_y = fOptScaleLogy;}
6597 
6599  TString fp_name_short = " ";
6600 
6601  //-------------------- read_histo size
6602  Int_t SizeForRead = GetHistoSize(HistoCode.Data(), "read");
6603 
6604  //............................................... allocation/init_histo
6605  TVectorD histo_for_plot(SizeForPlot);
6606  for(Int_t i=0; i<SizeForPlot; i++){histo_for_plot[i]=(Double_t)0;}
6607 
6608  TVectorD histo_for_plot_memo(SizeForPlot);
6609  for(Int_t i=0; i<SizeForPlot; i++){histo_for_plot_memo[i]=(Double_t)0;}
6610 
6611  Int_t i_data_exist = 0;
6612  Int_t OKPlot = 0;
6613 
6614  //------------------------------------- histos Global, (Global)Proj, SampGlobal and SampProj
6615  if( HistoType == "Global" || HistoType == "Proj" || HistoType == "SampGlobal" ||
6616  HistoType == "SampProj" )
6617  {
6618  if( fFapStexNumber == 0 )
6619  {
6620  Bool_t ok_view_histo = kFALSE;
6621 
6622  //--------------------------------------------------------------------- Stas Histo (ViewHisto)
6623  Int_t CounterExistingFile = 0;
6624  Int_t CounterDataExist = 0;
6625 
6626  Int_t* xFapNbOfEvts = new Int_t[fEcal->MaxStexInStas()]; fCnew++;
6627  for(Int_t i=0; i<fEcal->MaxStexInStas(); i++){xFapNbOfEvts[i]=0;}
6628 
6629  //Int_t* NOFE_int = new Int_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
6630 
6631  for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
6632  {
6633  Bool_t OKFileExists = kFALSE;
6634  Bool_t ok_data_exists = kFALSE;
6635 
6636  TVectorD read_histo(fEcal->MaxStinEcnaInStex());
6637  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){read_histo(i)=(Double_t)0.;}
6638 
6639  if( arg_AlreadyRead == 0 )
6640  {
6641  //----------------------------------------------------------------------------- file reading
6643  Int_t n1StasStex = iStasStex+1;
6647  n1StasStex, fCfgResultsRootFilePath.Data());
6648 
6649  if( fMyRootFile->LookAtRootFile() == kTRUE ){OKFileExists = kTRUE;} // (ViewHisto, Stas)
6650  if( OKFileExists == kTRUE )
6651  {
6652  xFapNbOfEvts[iStasStex] = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, n1StasStex);
6653  fp_name_short = fMyRootFile->GetRootFileNameShort();
6654  // std::cout << "*TEcnaHistos::ViewHisto(...)> Data are analyzed from file ----> "
6655  // << fp_name_short << std::endl;
6656  //....................... search for first and last dates
6657  if( iStasStex == 0 )
6658  {
6663  }
6664 
6665  time_t xStartTime = fMyRootFile->GetStartTime();
6666  time_t xStopTime = fMyRootFile->GetStopTime();
6667  TString xStartDate = fMyRootFile->GetStartDate();
6668  TString xStopDate = fMyRootFile->GetStopDate();
6669 
6670  if( xStartTime < fStartTime ){fStartTime = xStartTime; fStartDate = xStartDate;}
6671  if( xStopTime > fStopTime ){fStopTime = xStopTime; fStopDate = xStopDate;}
6672 
6674  ok_view_histo =
6675  GetOkViewHisto(fMyRootFile, StexStin_A, i0StinEcha, i0Sample, HistoCode.Data());
6676 
6677  if( ok_view_histo == kTRUE )
6678  {
6679  //............................................... histo reading (ViewHisto, Stas)
6680  if( HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" ){
6682  if( HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs" ){
6684  if( HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs" ){
6686  if( HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" ){
6688  if( HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" ){
6690  if( HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" ){
6692  if( HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs" ){
6694  if( fMyRootFile->DataExist() == kTRUE ){ok_data_exists = kTRUE;}
6695  }
6696  }
6697  }
6698 
6699  if( arg_AlreadyRead >= 1 )
6700  {
6701  ok_data_exists = kTRUE;
6702  for(Int_t i0Stin=0; i0Stin<fEcal->MaxStinEcnaInStex(); i0Stin++ )
6703  {read_histo(i0Stin) = arg_read_histo(fEcal->MaxStinEcnaInStex()*iStasStex+i0Stin);}
6704  }
6705 
6706  if( ok_data_exists == kTRUE )
6707  {
6708  fStatusFileFound = kTRUE;
6709  CounterExistingFile++;
6710 
6711 
6712  //...........................................................
6713  if( ok_data_exists == kTRUE )
6714  {
6715  fStatusDataExist = kTRUE;
6716  CounterDataExist++;
6717 
6718  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
6719  {
6720  //Int_t n1StexStinEcna = i0StexStinEcna+1;
6721  //-------------------------------------- Stas histo filling (ViewHisto, Stas)
6722  Int_t i_xgeo = -1;
6723  //...................................... EB
6724  if( fFlagSubDet == "EB" )
6725  {
6726  i_xgeo = iStasStex*fEcal->MaxStinEcnaInStex() + i0StexStinEcna;
6727  if( i_xgeo >= 0 && i_xgeo < SizeForPlot )
6728  {
6729  histo_for_plot[i_xgeo] = read_histo[i0StexStinEcna];
6730  }
6731  else
6732  {
6733  std::cout << "!TEcnaHistos::ViewHisto(...)> <EB> i_xgeo = " << i_xgeo
6734  << ". OUT OF RANGE ( range = [0,"<< SizeForPlot << "] " << std::endl;
6735  }
6736  }
6737  //...................................... EE (ViewHisto)
6738  //-------> Dee order: D4, D3, D2, D1
6739  if( fFlagSubDet == "EE" )
6740  {
6741  Int_t DeeOffset = 0;
6742  Int_t DSOffset = 0;
6743 
6744  Int_t DeeNumber = iStasStex+1;
6745  Int_t n1DeeSCEcna = i0StexStinEcna+1;
6746 
6747  //................................................ Dee offset
6748  if( DeeNumber == 3 ){DeeOffset += fEcal->MaxSCForConsInDee();} // 149
6749  if( DeeNumber == 2 ){DeeOffset += 3*fEcal->MaxSCForConsInDee()-1;} // 446
6750  if( DeeNumber == 1 ){DeeOffset += 4*fEcal->MaxSCForConsInDee()-1;} // 595
6751 
6752  //................................................ Data Sector offset (ViewHisto, Stas)
6753  Int_t StexDataSector = fEcalNumbering->GetDSFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
6754  //.... returns 0 if n1DeeSCEcna corresponds to an empty "ECNA-SC"
6755 
6756  //................................................ SC final coordinate (ViewHisto, Stas)
6757  Int_t StexDSStin = fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
6758  //--> return StexDSStin = 25 (not 3) for n1DeeSCEcna = 32
6759  //--> return StexDSStin = 14 (not 21) for n1DeeSCEcna = 29
6760  //--> return StexDSStin = -1 for n1DeeSCEcna = 10 and n1DeeSCEcna = 11
6761 
6762  if( StexDataSector >= 1 && StexDataSector <= 9 )
6763  {
6764  if( DeeNumber == 4 ) // Sectors 1,2,3,4,5a
6765  {
6766  for(Int_t is=2; is<=5; is++)
6767  { if( StexDataSector >= is )
6768  {Int_t ism = is-1; DSOffset += fEcalNumbering->GetMaxSCInDS(ism);}}
6769  }
6770 
6771  if( DeeNumber == 3 ) // Sectors 5b,6,7,8,9
6772  {
6773  if( StexDataSector >= 6 )
6774  {DSOffset += fEcalNumbering->GetMaxSCInDS(5)/2;}
6775  for(Int_t is=7; is<=9; is++)
6776  { if( StexDataSector >= is )
6777  {Int_t ism = is-1; DSOffset += fEcalNumbering->GetMaxSCInDS(ism);}}
6778  }
6779 
6780  if( DeeNumber == 2 ) // Sectors 9,8,7,6,5a
6781  {
6782  if( StexDataSector >= 6 )
6783  {DSOffset -= fEcalNumbering->GetMaxSCInDS(5)/2;}
6784  for(Int_t is=7; is<=9; is++)
6785  {if( StexDataSector >= is )
6786  {Int_t ism = is-1; DSOffset -= fEcalNumbering->GetMaxSCInDS(ism);}}
6787  }
6788 
6789  if( DeeNumber == 1 ) // Sectors 5b,4,3,2,1
6790  {
6791  for(Int_t is=2; is<=5; is++)
6792  { if( StexDataSector >= is )
6793  {Int_t ism = is-1; DSOffset -= fEcalNumbering->GetMaxSCInDS(ism);}}
6794  }
6795 
6796  if( StexDSStin >=1 && StexDSStin <= fEcalNumbering->GetMaxSCInDS(StexDataSector) )
6797  {
6798  if( DeeNumber == 4 ) // Sectors 1,2,3,4,5a
6799  {
6800  if(StexDataSector != 5)
6801  {i_xgeo = DeeOffset + DSOffset + (StexDSStin - 1);}
6802  if( StexDataSector == 5)
6803  {i_xgeo = DeeOffset + DSOffset + (StexDSStin - 1);}
6804  }
6805  if( DeeNumber == 3 ) // Sectors 5b,6,7,8,9
6806  {
6807  if(StexDataSector != 5)
6808  {i_xgeo = DeeOffset + DSOffset + (StexDSStin - 1);}
6809  if( StexDataSector == 5)
6810  {i_xgeo = DeeOffset + DSOffset + (StexDSStin-17) - 1;}
6811  }
6812  if( DeeNumber == 2 ) // Sectors 5a,6,7,8,9
6813  {
6814  if(StexDataSector != 5)
6815  {i_xgeo = DeeOffset + DSOffset
6816  - fEcalNumbering->GetMaxSCInDS(StexDataSector) + StexDSStin;}
6817  if( StexDataSector == 5)
6818  {i_xgeo = DeeOffset + DSOffset
6819  - fEcalNumbering->GetMaxSCInDS(StexDataSector)/2 + StexDSStin;}
6820  }
6821  if( DeeNumber == 1 ) // Sectors 1,2,3,4,5b
6822  {
6823  if(StexDataSector != 5)
6824  {i_xgeo = DeeOffset + DSOffset
6825  - fEcalNumbering->GetMaxSCInDS(StexDataSector) + StexDSStin;}
6826  if( StexDataSector == 5)
6827  {i_xgeo = DeeOffset + DSOffset
6828  - fEcalNumbering->GetMaxSCInDS(StexDataSector)/2 +(StexDSStin-17);}
6829  }
6830 
6831  }// end of if(StexDSStin >=1 && StexDSStin <= fEcalNumbering->GetMaxSCInDS(StexDataSector))
6832  else
6833  {
6834  std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> StexDSStin = " << StexDSStin
6835  << ". OUT OF RANGE ( range = [1,"
6836  << fEcalNumbering->GetMaxSCInDS(StexDataSector)
6837  << "]. DeeNumber = " << DeeNumber
6838  << ", n1DeeSCEcna = " << n1DeeSCEcna
6839  << ", StexDataSector = " << StexDataSector
6840  << ", i_xgeo = " << i_xgeo << std::endl;
6841  }
6842  }// end of if( StexDataSector >= 1 && StexDataSector <= 9 )
6843  else
6844  {
6845  //std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> StexDataSector = " << StexDataSector
6846  // << ". OUT OF RANGE ( range = [1,9]. DeeNumber = " << DeeNumber
6847  // << ", n1DeeSCEcna = " << n1DeeSCEcna
6848  // << ", i_xgeo = " << i_xgeo << std::endl;
6849  }
6850  //......................................... transfert read_histo -> histo_for_plot
6851  if( i_xgeo >= -1 && i_xgeo < SizeForPlot )
6852  {
6853  // special treatement for not connected & mixed SC's
6854  if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 || // 261a, 207c, 268a, 178c
6855  // [ 14a, 25c, 21a, 3c]
6856  n1DeeSCEcna == 144 || n1DeeSCEcna == 165 || // 261c, 261b [14c, 14b]
6857  n1DeeSCEcna == 176 || n1DeeSCEcna == 193 || // 207a, 207b [25a, 25b]
6858  n1DeeSCEcna == 60 || n1DeeSCEcna == 119 || // 182a, 182b [30a, 30b]
6859  n1DeeSCEcna == 102 || n1DeeSCEcna == 123 || // 268c, 268b [21c, 21b]
6860  n1DeeSCEcna == 138 || n1DeeSCEcna == 157 ) // 178a, 178b [ 3a, 3b]
6861  {
6862  //--------------- DSSC 14
6863  if( n1DeeSCEcna == 29 && i_xgeo >= 0 )
6864  {histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna]/(Double_t)5.;}
6865  if( (n1DeeSCEcna == 144 || n1DeeSCEcna == 165) && i_xgeo >= 0 )
6866  {histo_for_plot[i_xgeo] +=
6867  read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)25.;}
6868 
6869  //--------------- DSSC 25
6870  if( n1DeeSCEcna == 32 && i_xgeo >= 0 )
6871  {histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna]/(Double_t)5.;}
6872  if( (n1DeeSCEcna == 176 || n1DeeSCEcna == 193) && i_xgeo >= 0 )
6873  {histo_for_plot[i_xgeo] +=
6874  read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)25.;}
6875 
6876  //--------------- DSSC 30
6877  if( (n1DeeSCEcna == 60 || n1DeeSCEcna == 119) && i_xgeo >= 0 )
6878  {histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna]/(Double_t)2.;}
6879 
6880  //--------------- DSSC 21 (Add SC translated at 10-1 only once, i_xgeo = -1 accepted)
6881  if( n1DeeSCEcna == 102 )
6882  {histo_for_plot[i_xgeo] += read_histo[9]/(Double_t)21.
6883  + read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)21.;}
6884  if( n1DeeSCEcna == 123 && i_xgeo >= 0 )
6885  {histo_for_plot[i_xgeo] +=
6886  read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)21.;}
6887 
6888  //--------------- DSSC 3 (Add SC translated at 11-1 only once, i_xgeo = -1 accepted)
6889  if( n1DeeSCEcna == 138 )
6890  {histo_for_plot[i_xgeo] += read_histo[10]/(Double_t)21.
6891  + read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)21.;}
6892  if( n1DeeSCEcna == 157 && i_xgeo >= 0 )
6893  {histo_for_plot[i_xgeo] +=
6894  read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)21.;}
6895  }
6896  else
6897  {
6898  if( i_xgeo >= 0 )
6899  {histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna];} // standard treatment
6900  }
6901  } // end of if( i_xgeo >= -1 && i_xgeo < SizeForPlot )
6902  else
6903  {
6904  //std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> i_xgeo = " << i_xgeo
6905  // << ". OUT OF RANGE ( range = [0,"<< SizeForPlot << "] " << std::endl;
6906  }
6907  }// end of if( fFlagSubDet == "EE" )
6908  }// end of for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
6909  }
6910  else
6911  {
6912  std::cout << "!TEcnaHistos::ViewHisto(...)> "
6913  << " Data not available for " << fFapStexName << " " << iStasStex+1
6914  << " (Quantity not present in the ROOT file)" << std::endl;
6915  }
6916  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE ) (ViewHisto/Stas)
6917  else
6918  {
6919  fStatusFileFound = kFALSE;
6920 
6921  std::cout << "!TEcnaHistos::ViewHisto(...)> "
6922  << " Data not available for " << fFapStexName << " " << iStasStex+1
6923  << " (ROOT file not found)" << std::endl;
6924  }
6925 
6926  if( fFapNbOfEvts <= xFapNbOfEvts[iStasStex] ){fFapNbOfEvts = xFapNbOfEvts[iStasStex];}
6927 
6928  } // end of for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
6929 
6930  //delete [] NOFE_int; NOFE_int = 0; fCdelete++;
6931  delete [] xFapNbOfEvts; xFapNbOfEvts = nullptr; fCdelete++;
6932 
6933  if( CounterExistingFile > 0 && CounterDataExist > 0 ){OKPlot = 1;}
6934 
6935  } // end of if( fFapStexNumber == 0 )
6936 
6937  //---------------------------------------------------------------------------- (ViewHisto [Stex])
6938 
6939  if( fFapStexNumber > 0 )
6940  {
6941  Bool_t OKFileExists = kFALSE ;
6942  Bool_t ok_view_histo = kFALSE;
6943 
6944  if( arg_AlreadyRead == 0 )
6945  {
6951 
6952  if ( fMyRootFile->LookAtRootFile() == kTRUE ){OKFileExists = kTRUE;} // (ViewHisto, Stex)
6953 
6954  if( OKFileExists == kTRUE )
6955  {
6957  fp_name_short = fMyRootFile->GetRootFileNameShort();
6958  // std::cout << "*TEcnaHistos::ViewHisto(...)> Data are analyzed from file ----> "
6959  // << fp_name_short << std::endl;
6960 
6964 
6965  ok_view_histo =
6966  GetOkViewHisto(fMyRootFile, StexStin_A, i0StinEcha, i0Sample, HistoCode.Data());
6967  }
6968  }
6969 
6970  if( arg_AlreadyRead >= 1 )
6971  {
6972  OKFileExists = kTRUE; ok_view_histo = kTRUE;
6973  }
6974 
6975  if( OKFileExists == kTRUE )
6976  {
6977  fStatusFileFound = kTRUE;
6978  //---------------------------------------------------------------------------- (ViewHisto [Stex])
6979 
6980  if( ok_view_histo == kTRUE )
6981  {
6982  //------------ EB or EE with SampGlobal or SampProj (histo_for_plot = read_histo)
6983  if( fFlagSubDet == "EB" ||
6984  ( fFlagSubDet == "EE" && ( HistoType == "SampGlobal" || HistoType == "SampProj" ) ) )
6985  {
6986  histo_for_plot = GetHistoValues(arg_read_histo, arg_AlreadyRead, fMyRootFile, HistoCode.Data(),
6987  SizeForPlot, SizeForRead,
6988  StexStin_A, i0StinEcha, i0Sample, i_data_exist);
6989  if( i_data_exist > 0 ){OKPlot = 1;}
6990  if( OKPlot == 1 && opt_plot == "ASCII" && ( HistoType == "Global" || HistoType == "Proj" ) )
6991  {WriteHistoAscii(HistoCode.Data(), SizeForPlot, histo_for_plot);}
6992  }
6993 
6994  //------------ EE except for SampGlobal and SampProj) (histo_for_plot # read_histo)
6995  if( fFlagSubDet == "EE" && !( HistoType == "SampGlobal" || HistoType == "SampProj" ) )
6996  {
6997  TVectorD read_histo(SizeForRead);
6998  for(Int_t i=0; i<SizeForRead; i++){read_histo(i)=(Double_t)0.;}
6999 
7000  read_histo = GetHistoValues(arg_read_histo, arg_AlreadyRead, fMyRootFile, HistoCode.Data(),
7001  SizeForRead, SizeForRead,
7002  StexStin_A, i0StinEcha, i0Sample, i_data_exist);
7003  if( i_data_exist > 0 ){OKPlot = 1;}
7004  if( OKPlot == 1 && opt_plot == "ASCII" )
7005  {
7006  WriteHistoAscii(HistoCode.Data(), fEcal->MaxCrysEcnaInDee(), read_histo);
7007  }
7008  if( OKPlot == 1 && opt_plot != "ASCII" )
7009  {
7010  //..................... Build histo_for_plot from read_histo (ViewHisto [Stex])
7011  Int_t DeeNumber = fFapStexNumber;
7012  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
7013 
7014  //%%%%%%%%%%%%%%%%%%%%%%%%%%%% LOOP ON Echa (Ecna) %%%%%%%%%%%%%%%%%%%%%%%%%% (ViewHisto [Stex])
7015  for(Int_t i0DeeEcha=0; i0DeeEcha<fEcal->MaxCrysEcnaInDee(); i0DeeEcha++)
7016  {
7017  Int_t n1SCEcha = fEcalNumbering->Get1SCEchaFrom0DeeEcha(i0DeeEcha);
7018  Int_t n1DeeSCEcna = i0DeeEcha/fEcal->MaxCrysInSC()+1;
7019 
7020  Int_t DataSector = fEcalNumbering->GetDSFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
7021  Int_t SC_in_DS = fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna, n1SCEcha);
7022 
7023  Int_t i_xgeo = -1;
7024 
7025  if( n1SCEcha >= 1 && n1SCEcha <= fEcal->MaxCrysInSC() )
7026  {
7027  if( n1DeeSCEcna >= 1 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
7028  {
7029  if( DataSector >= 1 && DataSector <= 9 )
7030  {
7031  if( SC_in_DS >= 1 && SC_in_DS <= fEcalNumbering->GetMaxSCInDS(DataSector) )
7032  {
7033  if( read_histo[i0DeeEcha] != 0 )
7034  {
7035  //................................... Data Sector offset
7036  Int_t DSOffset = GetDSOffset(DeeNumber, DataSector);
7037 
7038  //........................ Super-Crystal (SC) offset (ViewHisto [Stex])
7039  Int_t SCOffset = GetSCOffset(DeeNumber, DataSector, SC_in_DS);
7040 
7041  //........................ Xtal final bin
7042  Int_t nSCCons = fEcalNumbering->
7043  GetDeeSCConsFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna, n1SCEcha);
7044 
7045  Int_t n1FinalSCEcha = n1SCEcha;
7046 
7047  if( fEcalNumbering->GetSCType(nSCCons) == "NotConnected" ||
7048  fEcalNumbering->GetSCType(nSCCons) == "NotComplete" )
7049  { //----- not complete and not connected SC's
7050  // no i_xgeo value if SC = 14 or 25 and channel 11
7051  if( !( (SC_in_DS == 14 || SC_in_DS == 25 ) && n1SCEcha == 11 ) )
7052  {
7053  n1FinalSCEcha =
7054  ModifiedSCEchaForNotConnectedSCs(DeeNumber, nSCCons, SC_in_DS,
7055  n1DeeSCEcna, n1SCEcha);
7056  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha-1);
7057  }
7058  // change SC 14 -> 21 and channel 11 -> 21
7059  if( SC_in_DS == 14 && n1SCEcha == 11 )
7060  {
7061  SCOffset = GetSCOffset(DeeNumber, DataSector, 21);
7062  n1FinalSCEcha = 21;
7063  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha-1);
7064  }
7065  // change SC 25 -> 3 for channel 11 -> 21
7066  if( SC_in_DS == 25 && n1SCEcha == 11 )
7067  {
7068  SCOffset = GetSCOffset(DeeNumber, DataSector, 3);
7069  n1FinalSCEcha = 21;
7070  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha-1);
7071  }
7072  }
7073  else
7074  { //----------- Complete SCs
7075  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha-1);
7076  }
7077 
7078  histo_for_plot_memo[i_xgeo]++;
7079  if( histo_for_plot_memo[i_xgeo] >= 2 )
7080  {
7081  std::cout << "! histo_memo[" << i_xgeo
7082  << "] = " << histo_for_plot_memo[i_xgeo]
7083  << ", nSCCons = " << nSCCons
7084  << ", SC_in_DS = " << SC_in_DS
7085  << ", DSOffset = " << DSOffset
7086  << ", SCOffset = " << SCOffset
7087  << ", n1DeeSCEcna = " << n1DeeSCEcna
7088  << ", n1SCEcha = " << n1SCEcha
7089  << ", n1FinalSCEcha = " << n1FinalSCEcha << std::endl;
7090  }
7091  //.............................. transfert read_histo -> histo_for_plot
7092  if( i_xgeo >= 0 && i_xgeo < SizeForPlot )
7093  {
7094  if( n1FinalSCEcha > 0 )
7095  {histo_for_plot[i_xgeo] += read_histo[i0DeeEcha];}
7096  }
7097  else
7098  {
7099  std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> i_xgeo = " << i_xgeo
7100  << ". OUT OF RANGE ( range = [0,"<< SizeForPlot << "] " << std::endl;
7101  }
7102  } // end of if( read_histo[i0DeeEcha] > 0 )
7103  } // end of if( SC_in_DS >= 1 && SC_in_DS <= fEcalNumbering->GetMaxSCInDS(DataSector) )
7104  else
7105  {
7106  std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> SC_in_DS = " << SC_in_DS
7107  << ". OUT OF RANGE ( range = [1,"
7108  << fEcalNumbering->GetMaxSCInDS(DataSector) << "] "
7109  << ", DataSector = " << DataSector
7110  << ", n1DeeSCEcna = " << n1DeeSCEcna
7111  << ", n1SCEcha = " << n1SCEcha
7112  << ", i0DeeEcha = " << i0DeeEcha
7113  << std::endl;
7114  }
7115  } // end of if( DataSector >= 1 && DataSector <= 9 )
7116  else
7117  {
7118  if( DataSector != 0 )
7119  {
7120  std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> DataSector = " << DataSector
7121  << ". OUT OF RANGE ( range = [1,9] "
7122  << ", n1DeeSCEcna = " << n1DeeSCEcna
7123  << ", n1SCEcha = " << n1SCEcha
7124  << ", i0DeeEcha = " << i0DeeEcha
7125  << std::endl;
7126  }
7127  }
7128  } // end of if( n1DeeSCEcna >= 1 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
7129  else
7130  {
7131  std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> n1DeeSCEcna = " << n1DeeSCEcna
7132  << ". OUT OF RANGE ( range = [1,"<< fEcal->MaxSCEcnaInDee() << "] "
7133  << ", n1SCEcha = " << n1SCEcha
7134  << ", i0DeeEcha = " << i0DeeEcha
7135  << std::endl;
7136  }
7137  } // end of if(n1SCEcha >= 1 && n1SCEcha <= fEcal->MaxCrysInSC() )
7138  else
7139  {
7140  std::cout << "!TEcnaHistos::ViewHisto(...)> <EE> n1SCEcha = " << n1SCEcha
7141  << ". OUT OF RANGE ( range = [1,"<< fEcal->MaxCrysInSC() << "] "
7142  << ", i0DeeEcha = " << i0DeeEcha
7143  << std::endl;
7144  }
7145  }
7146  } // end of if( OKPlot == 1 && opt_plot != "ASCII" )
7147  } // end of if(fFlagSubDet == "EE")
7148  } // end of if(ok_view_histo == kTRUE)
7149  else
7150  {
7151  std::cout << "!TEcnaHistos::ViewHisto(...)> *ERROR* =====> "
7152  << " ok_view_histo != kTRUE " << fTTBELL << std::endl;
7153  }
7154  } // end of if(fMyRootFile->LookAtRootFile() == kTRUE)
7155  else
7156  {
7157  fStatusFileFound = kFALSE;
7158 
7159  std::cout << "!TEcnaHistos::ViewHisto(...)> *ERROR* =====> "
7160  << " ROOT file not found" << fTTBELL << std::endl;
7161  }
7162  } // end of if(fFapStexNumber > 0)
7163  } // end of if( HistoType == "Global" || HistoType == "Proj" || HistoType == "SampGlobal" || HistoType == "SampProj" )
7164  else
7165  {
7166  //--------------------------------------------------------------------- not Global-Proj Histo
7167  if( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) )
7168  {
7169  Bool_t OKFileExists = kFALSE;
7170 
7171  if( !(arg_AlreadyRead > 1) )
7172  {
7178  OKFileExists = fMyRootFile->LookAtRootFile();
7179  if( OKFileExists == kTRUE ){fFapNbOfEvts = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, fFapStexNumber);}
7180  }
7181  else
7182  {
7183  OKFileExists = kTRUE;
7184  }
7185 
7186  if( OKFileExists == kTRUE ) // (ViewHisto, not Global-Proj)
7187  {
7188  fStatusFileFound = kTRUE;
7189 
7190  for(Int_t i=0; i<SizeForPlot; i++){histo_for_plot[i]=(Double_t)0;}
7191 
7192  histo_for_plot = GetHistoValues(arg_read_histo, arg_AlreadyRead, fMyRootFile, HistoCode.Data(),
7193  SizeForPlot, SizeForRead,
7194  StexStin_A, i0StinEcha, i0Sample, i_data_exist);
7195 
7200 
7201  if( i_data_exist > 0 ){OKPlot = 1;}
7202  }
7203  else
7204  {
7205  std::cout << "!TEcnaHistos::ViewHisto(...)> *ERROR* =====> "
7206  << " ROOT file not found" << fTTBELL << std::endl;
7207  }
7208  }
7209  else
7210  {
7211  std::cout << "!TEcnaHistos::ViewHisto(...)> " << fFapStexName.Data()
7212  << " = " << fFapStexNumber << ". Out of range (range = [1,"
7213  << fEcal->MaxStexInStas() << "]) " << fTTBELL << std::endl;
7214  }
7215  }
7216 
7217  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PLOT accepted
7218 
7219  if( ( HistoType == "Global" || HistoType == "Proj" ||
7220  HistoType == "SampGlobal" || HistoType == "SampProj" ||
7221  HistoType == "H1Basic" || HistoType == "H1BasicProj" ) ||
7222  ( !( HistoType == "Global" || HistoType == "Proj" ||
7223  HistoType == "SampGlobal" || HistoType == "SampProj" ||
7224  HistoType == "H1Basic" || HistoType == "H1BasicProj" ) &&
7225  ( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) ) ) )
7226  {
7227  if( opt_plot != "ASCII" )
7228  {
7229  if( OKPlot > 0 )
7230  {
7231  //... Ymin and ymax default values will be taken if fFlagUserHistoMin/Max = "OFF"
7232  // and if "Free" for "SAME" and "SAME n" options
7233  if( (opt_plot == fOnlyOnePlot && ( arg_AlreadyRead == 0 || arg_AlreadyRead == 1 ) ) ||
7234  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
7235  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
7236  {
7237  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
7238  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
7239  }
7240 
7241  //==== 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)
7242  //
7243  // must be done before booking because of the x <-> y permutation in case of "Proj"
7244  //
7245  //-----------------------------------------------------------------------------------------
7246  //
7247  // CASE: HistoType == "Proj" OR HistoType == "SampProj"
7248  //
7249  // Xinf and Xsup must be calculated from ymin and ymax
7250  // of the direct ("Global") histo
7251  //
7252  //-----------------------------------------------------------------------------------------
7253  if( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj" )
7254  {
7255  TString HistoCodi = HistoCode; // HistoCodi = direct histo
7256 
7257  if( HistoCode == "D_NOE_ChDs" ){HistoCodi = "D_NOE_ChNb";}
7258  if( HistoCode == "D_Ped_ChDs" ){HistoCodi = "D_Ped_ChNb";}
7259  if( HistoCode == "D_TNo_ChDs" ){HistoCodi = "D_TNo_ChNb";}
7260  if( HistoCode == "D_MCs_ChDs" ){HistoCodi = "D_MCs_ChNb";}
7261  if( HistoCode == "D_LFN_ChDs" ){HistoCodi = "D_LFN_ChNb";}
7262  if( HistoCode == "D_HFN_ChDs" ){HistoCodi = "D_HFN_ChNb";}
7263  if( HistoCode == "D_SCs_ChDs" ){HistoCodi = "D_SCs_ChNb";}
7264  if( HistoCode == "D_MSp_SpDs" ){HistoCodi = "D_MSp_SpNb";}
7265  if( HistoCode == "D_SSp_SpDs" ){HistoCodi = "D_SSp_SpNb";}
7266  if( HistoCode == "D_Adc_EvDs" ){HistoCodi = "D_Adc_EvNb";}
7267 
7268  TString TitleHisto = ";";
7269  if( opt_plot != fSameOnePlot )
7270  {TitleHisto = fCnaParHistos->GetQuantityName(HistoCodi);}
7271 
7272  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
7273 
7274  //--------------------------------------------------------------------------- (ViewHisto)
7275  //
7276  // fOnlyOnePlot => compute Xinf and Xsup at each time
7277  // fSeveralPlot => compute Xinf and Xsup once when flag = "Free" for each HistoCode
7278  // fSameOnePlot => compute Xinf and Xsup once
7279  //
7280  //--------------------------------------------------------------------------------------
7281  if( (opt_plot == fOnlyOnePlot && ( arg_AlreadyRead == 0 || arg_AlreadyRead == 1 ) ) ||
7282  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, fSeveralPlot) == "Free" ) ||
7283  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, fSameOnePlot) == "Free" ) )
7284  {
7285  Double_t XinfProj =(Double_t)0;
7286  Double_t XsupProj =(Double_t)0;
7287 
7288  //...................................................................... (ViewHisto)
7289  if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
7290  {
7291  Int_t HisSiza = GetHistoSize(HistoCodi.Data(), "plot");
7292  Int_t ReadHisSiza = HisSiza;
7293  //.............................. prepa direct histogram booking (ViewHisto)
7294  Axis_t xinf_hisa = GetHistoXinf(HistoCodi.Data(), HisSiza, opt_plot);
7295  Axis_t xsup_hisa = GetHistoXsup(HistoCodi.Data(), HisSiza, opt_plot);
7296  Int_t nb_binxa = GetHistoNumberOfBins(HistoCodi.Data(), HisSiza);
7297  //.............................. direct ("Global") histogram booking (ViewHisto)
7298  TH1D* h_hisa =
7299  new TH1D("histoa", TitleHisto.Data(), nb_binxa, xinf_hisa, xsup_hisa); fCnewRoot++;
7300  h_hisa->Reset();
7301  //.... direct histogram filling to get its ymin (=> xminProj) and ymax (=> xmaxProj)
7302  FillHisto(h_hisa, histo_for_plot, HistoCodi.Data(), ReadHisSiza);
7303  //... Get direct histo ymin and/or ymax and keep them as xinf and xsup
7304  // in memo for the plotted histo
7305  XinfProj = fUserHistoMin;
7306  XsupProj = fUserHistoMax;
7307  if( fFlagUserHistoMin == "AUTO" ){XinfProj = h_hisa->GetMinimum();}
7308  if( fFlagUserHistoMax == "AUTO" ){XsupProj = h_hisa->GetMaximum();}
7309  XsupProj += (XsupProj-XinfProj)*fCnaParHistos->GetMarginAutoMinMax(); // to see the last bin
7310  h_hisa->Delete(); h_hisa = nullptr; fCdeleteRoot++;
7311  } // end of if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
7312  else
7313  {
7314  if( fFlagUserHistoMin == "OFF" )
7315  {
7316  SetYminMemoFromValue(HistoCode.Data(),
7317  fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
7318  XinfProj = GetYminValueFromMemo(HistoCode.Data());
7319  }
7320 
7321  if( fFlagUserHistoMax == "OFF" )
7322  {
7323  SetYmaxMemoFromValue(HistoCode.Data(),
7324  fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
7325  XsupProj = GetYmaxValueFromMemo(HistoCode.Data());
7326  }
7327  if( fFlagUserHistoMin == "ON" ){XinfProj = fUserHistoMin;}
7328  if( fFlagUserHistoMax == "ON" ){XsupProj = fUserHistoMax;}
7329  }
7330 
7331  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
7332  {
7333  SetXinfMemoFromValue(HistoCode.Data(), XinfProj);
7334  SetXsupMemoFromValue(HistoCode.Data(), XsupProj);
7335  }
7336  else
7337  {
7338  SetXinfMemoFromValue(XinfProj);
7339  SetXsupMemoFromValue(XsupProj);
7340  }
7341  } // end of if( (opt_plot == fOnlyOnePlot) ||
7342  // (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
7343  // (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
7344  } // end of if( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj" )
7345 
7346  //=============== H I S T O B O O K I N G A N D F I L L I N G ======== (ViewHisto)
7347  //.............................. prepa histogram booking (ViewHisto)
7348 
7349  //.......... Set number of bins: forcing to fNbBinsProj if "HistoType" == "Proj"
7350  Int_t xNbBins = GetHistoNumberOfBins(HistoCode.Data(), SizeForPlot);
7351 
7352  Double_t cXinf = (Double_t)0.;
7353  Double_t cXsup = (Double_t)0.;
7354 
7355  //.......... Set Xinf and Xsup at each time because of simultaneous SAME options
7356  if( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj")
7357  {
7358  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
7359  {
7360  cXinf = GetXinfValueFromMemo(HistoCode.Data());
7361  cXsup = GetXsupValueFromMemo(HistoCode.Data());
7362  }
7363  else
7364  {
7365  cXinf = GetXinfValueFromMemo();
7366  cXsup = GetXsupValueFromMemo();
7367  }
7368  }
7369  else
7370  {
7371  cXinf = GetHistoXinf(HistoCode.Data(), SizeForPlot, opt_plot);
7372  cXsup = GetHistoXsup(HistoCode.Data(), SizeForPlot, opt_plot);
7373  }
7374 
7375  //.............................. histogram booking (ViewHisto)
7376  Axis_t xinf_his = cXinf; // ancillary variables since no const in arguments of TH1D
7377  Axis_t xsup_his = cXsup;
7378  Int_t nb_binx = xNbBins;
7379 
7380  TString TitleHisto = ";";
7381  if( opt_plot != fSameOnePlot )
7382  {TitleHisto = fCnaParHistos->GetQuantityName(HistoCode.Data());}
7383  TH1D* h_his0 = new TH1D("histo", TitleHisto.Data(), nb_binx, xinf_his, xsup_his); fCnewRoot++;
7384  h_his0->Reset();
7385  //............................... histogram filling
7386  FillHisto(h_his0, histo_for_plot, HistoCode.Data(), SizeForPlot);
7387 
7388  //=============== H I S T O Y M I N / Y M A X M A N A G E M E N T =========== (ViewHisto)
7389  if( opt_plot == fOnlyOnePlot ||
7390  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
7391  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
7392  {
7393  if( opt_plot == fSameOnePlot ){fHistoCodeFirst = HistoCode;} // registration of first HistoCode
7394  //................................. Automatic min and/or max for other options than "Proj"
7395  if( HistoType != "Proj" && HistoType != "SampProj" && HistoType != "H1BasicProj" )
7396  {
7397  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
7398  //................................. user's min and/or max
7399  if( fFlagUserHistoMin == "ON" )
7400  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
7401  if( fFlagUserHistoMax == "ON" )
7402  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
7403  //................................. automatic min and/or max
7404  if( fFlagUserHistoMin == "AUTO" )
7405  {
7406  //.............. no bottom margin if ymin = 0
7407  Double_t ymin = GetYminFromHistoFrameAndMarginValue(h_his0, (Double_t)0.);
7408  if( ymin != (Double_t)0. )
7409  {ymin =
7411  SetYminMemoFromValue(HistoCode.Data(),ymin);
7412  fFlagUserHistoMin = "OFF";
7413  }
7414  if( fFlagUserHistoMax == "AUTO" )
7415  {
7416  Double_t ymax =
7418  SetYmaxMemoFromValue(HistoCode.Data(),ymax);
7419  fFlagUserHistoMax = "OFF";
7420  }
7421  //................................. Set YMin and YMax of histo (ViewHisto)
7422  SetYminMemoFromPreviousMemo(HistoCode);
7423  SetYmaxMemoFromPreviousMemo(HistoCode);
7424  } // end of if( HistoType != "Proj" && HistoType != "SampProj" && HistoType != "H1BasicProj" )
7425 
7426  //.......... Find maximum in case of Proj (LIN scale only) // PS: EvolProj => in ViewHistime
7427  if( ( HistoType == "Proj" || HistoType == "SampProj" ||
7428  HistoType == "H1BasicProj" ) && fFlagScaleY == "LIN" )
7429  {
7431  (HistoCode.Data(),
7433  }
7434  } // end of if( opt_plot == fOnlyOnePlot ||
7435  // (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
7436  // (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
7437 
7438  //--- Set ymin and ymax to the first HistoCode values for option SAME n
7439  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
7440  {
7441  Double_t ymin = GetYminValueFromMemo(fHistoCodeFirst.Data());
7442  SetYminMemoFromValue(HistoCode.Data(), ymin);
7443 
7444  Double_t ymax = GetYmaxValueFromMemo(fHistoCodeFirst.Data());
7445  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
7446  }
7447 
7448  //... histogram set ymin and ymax and consequently margin at top of the plot
7449  Int_t xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo(h_his0, HistoCode);
7450 
7451  //==================================== P L O T ============================== (ViewHisto)
7452  HistoPlot(h_his0, SizeForPlot, xinf_his, xsup_his,
7453  HistoCode.Data(), HistoType.Data(),
7454  StexStin_A, i0StinEcha, i0Sample,
7455  opt_scale_x, opt_scale_y, opt_plot, arg_AlreadyRead,
7456  xFlagAutoYsupMargin);
7457  h_his0->Delete(); h_his0 = nullptr; fCdeleteRoot++;
7458  //===========================================================================
7459 
7460  //--- Recover ymin and ymax from user's values in option SAME n
7461  if( (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy") )
7462  {
7463  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
7464  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
7465  }
7466  } // end of if( OKPlot > 0 )
7467  else
7468  {
7469  std::cout << "!TEcnaHistos::ViewHisto(...)> Histo not available."
7470  << fTTBELL << std::endl;
7471  }
7472  }
7473  }
7474  } // end of if( OKHisto == 1 )
7475 
7476 } // end of ViewHisto(...)
7477 
7478 //------------------------------------------------------------------------------------
7479 Int_t TEcnaHistos::GetDSOffset(const Int_t& DeeNumber, const Int_t& DataSector)
7480 {
7481  // gives the DataSector Offset on 1D histos for option "Global"
7482 
7483  Int_t DSOffset = 0;
7484 
7485  if( DeeNumber == 4 )
7486  {
7487  if( DataSector >= 1 ){}
7488  if( DataSector >= 2 ){DSOffset += fEcalNumbering->GetMaxSCInDS(1)*fEcal->MaxCrysInSC();}
7489  if( DataSector >= 3 ){DSOffset += fEcalNumbering->GetMaxSCInDS(2)*fEcal->MaxCrysInSC();}
7490  if( DataSector >= 4 ){DSOffset += fEcalNumbering->GetMaxSCInDS(3)*fEcal->MaxCrysInSC();}
7491  if( DataSector >= 5 ){DSOffset += fEcalNumbering->GetMaxSCInDS(4)*fEcal->MaxCrysInSC();}
7492  }
7493  if( DeeNumber == 3 )
7494  {
7495  if( DataSector >= 5 ){}
7496  if( DataSector >= 6 ){DSOffset += (fEcalNumbering->GetMaxSCInDS(5)/2)*fEcal->MaxCrysInSC();}
7497  if( DataSector >= 7 ){DSOffset += fEcalNumbering->GetMaxSCInDS(6)*fEcal->MaxCrysInSC();}
7498  if( DataSector >= 8 ){DSOffset += fEcalNumbering->GetMaxSCInDS(7)*fEcal->MaxCrysInSC();}
7499  if( DataSector >= 9 ){DSOffset += fEcalNumbering->GetMaxSCInDS(8)*fEcal->MaxCrysInSC();}
7500  }
7501  if( DeeNumber == 2 )
7502  {
7503  if( DataSector <= 9 ){}
7504  if( DataSector <= 8 ){DSOffset += fEcalNumbering->GetMaxSCInDS(9)*fEcal->MaxCrysInSC();}
7505  if( DataSector <= 7 ){DSOffset += fEcalNumbering->GetMaxSCInDS(8)*fEcal->MaxCrysInSC();}
7506  if( DataSector <= 6 ){DSOffset += fEcalNumbering->GetMaxSCInDS(7)*fEcal->MaxCrysInSC();}
7507  if( DataSector <= 5 ){DSOffset += fEcalNumbering->GetMaxSCInDS(6)*fEcal->MaxCrysInSC();}
7508  }
7509  if( DeeNumber == 1 )
7510  {
7511  if( DataSector <= 5 ){}
7512  if( DataSector <= 4 ){DSOffset += (fEcalNumbering->GetMaxSCInDS(5)/2)*fEcal->MaxCrysInSC();}
7513  if( DataSector <= 3 ){DSOffset += fEcalNumbering->GetMaxSCInDS(4)*fEcal->MaxCrysInSC();}
7514  if( DataSector <= 2 ){DSOffset += fEcalNumbering->GetMaxSCInDS(3)*fEcal->MaxCrysInSC();}
7515  if( DataSector <= 1 ){DSOffset += fEcalNumbering->GetMaxSCInDS(2)*fEcal->MaxCrysInSC();}
7516  }
7517  return DSOffset;
7518 }
7519 //------------------------------------------------------------------------------------
7520 Int_t TEcnaHistos::GetSCOffset(const Int_t& DeeNumber, const Int_t& DataSector, const Int_t& SC_in_DS)
7521 {
7522  // gives the SC (Super-Crystal) Offset on 1D histos for option "Global"
7523 
7524  Int_t SCOffset = 0;
7525 
7526  if( DeeNumber == 1 || DeeNumber == 3 )
7527  {
7528  if( DataSector == 5 ){SCOffset += ((SC_in_DS-17)-1)*fEcal->MaxCrysInSC();}
7529  if( DataSector != 5 ){SCOffset += (SC_in_DS-1)*fEcal->MaxCrysInSC();}
7530  }
7531 
7532  if( DeeNumber == 2 || DeeNumber == 4 ){SCOffset += (SC_in_DS-1)*fEcal->MaxCrysInSC();}
7533 
7534  return SCOffset;
7535 }
7536 //------------------------------------------------------------------------------------
7537 Int_t TEcnaHistos::ModifiedSCEchaForNotConnectedSCs(const Int_t& n1DeeNumber,
7538  const Int_t& nSCCons, const Int_t& SC_in_DS,
7539  const Int_t& n1DeeSCEcna, const Int_t& n1SCEcha)
7540 {
7541  //------------------------ Modification of n1SCEcha number for not connected SC's
7542 
7543  Int_t ModifiedSCEcha = -1;
7544  TString SCQuad = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna); // SCQuad = top OR bottom
7545  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(n1DeeNumber); // DeeDir = left OR right
7546 
7547  TString TypQuad = "?";
7548  if( SCQuad == "top" && DeeDir == "right" ){TypQuad = "TR";}
7549  if( SCQuad == "top" && DeeDir == "left" ){TypQuad = "TL";}
7550  if( SCQuad == "bottom" && DeeDir == "left" ){TypQuad = "BL";}
7551  if( SCQuad == "bottom" && DeeDir == "right" ){TypQuad = "BR";}
7552 
7553  //------------------------------------------------------------------------------------------- top
7554 
7555  //..... (D1,S1), (D3,S9) SC_in_DS = 30, n1DeeSCEcna = 60 -> 182a for construction top/right
7556  //..... (D1,S2), (D3,S8) SC_in_DS = 3, n1DeeSCEcna = 138 -> 178a for construction top/right
7557  if( (SC_in_DS == 30 && n1DeeSCEcna == 60 && TypQuad == "TR") ||
7558  (SC_in_DS == 3 && n1DeeSCEcna == 138 && TypQuad == "TR") ){if(n1SCEcha > 15){ModifiedSCEcha = n1SCEcha - 15;}}
7559 
7560  //..... (D4,S1), (D2,S9) SC_in_DS = 30, n1DeeSCEcna = 60 -> 33a for construction top/left
7561  //..... (D4,S2), (D2,S8) SC_in_DS = 3, n1DeeSCEcna = 138 -> 29a for construction top/left
7562  if( (SC_in_DS == 30 && n1DeeSCEcna == 60 && TypQuad == "TL") ||
7563  (SC_in_DS == 3 && n1DeeSCEcna == 138 && TypQuad == "TL") )
7564  {
7565  if(n1SCEcha == 4){ModifiedSCEcha = 1;}
7566  if(n1SCEcha == 5){ModifiedSCEcha = 2;}
7567  if(n1SCEcha == 9){ModifiedSCEcha = 3;}
7568  if(n1SCEcha == 10){ModifiedSCEcha = 4;}
7569  if(n1SCEcha == 14){ModifiedSCEcha = 5;}
7570  if(n1SCEcha == 15){ModifiedSCEcha = 6;}
7571  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7572  if(n1SCEcha == 20){ModifiedSCEcha = 8;}
7573  if(n1SCEcha == 24){ModifiedSCEcha = 9;}
7574  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7575  }
7576 
7577  //..... (D1,S1), (D3,S9) SC_in_DS = 30, n1DeeSCEcna = 119 -> 182b for construction top/right
7578  if( SC_in_DS == 30 && n1DeeSCEcna == 119 && TypQuad == "TR" ){if(n1SCEcha > 5){ModifiedSCEcha = n1SCEcha - 5;}}
7579 
7580  //..... (D4,S1), (D2,S9) SC_in_DS = 30, n1DeeSCEcna = 119 -> 33b for construction top/left
7581  if( SC_in_DS == 30 && n1DeeSCEcna == 119 && TypQuad == "TL" )
7582  {
7583  if(n1SCEcha == 4){ModifiedSCEcha = 11;}
7584  if(n1SCEcha == 5){ModifiedSCEcha = 12;}
7585  if(n1SCEcha == 9){ModifiedSCEcha = 13;}
7586  if(n1SCEcha == 10){ModifiedSCEcha = 14;}
7587  if(n1SCEcha == 14){ModifiedSCEcha = 15;}
7588  if(n1SCEcha == 15){ModifiedSCEcha = 16;}
7589  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7590  if(n1SCEcha == 20){ModifiedSCEcha = 18;}
7591  if(n1SCEcha == 24){ModifiedSCEcha = 19;}
7592  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7593  }
7594 
7595  //..... (D1,S1), (D3,S9) SC_in_DS = 12, n1DeeSCEcna = 13 -> 161 for construction top/right
7596  //..... (D4,S1), (D2,S9) SC_in_DS = 12, n1DeeSCEcna = 13 -> 12 for construction top/left
7597  if( SC_in_DS == 12 && n1DeeSCEcna == 13 && TypQuad == "TR" )
7598  {
7599  ModifiedSCEcha = n1SCEcha;
7600  }
7601  if( SC_in_DS == 12 && n1DeeSCEcna == 13 && TypQuad == "TL" )
7602  {
7603  if( n1SCEcha >= 1 && n1SCEcha <= 4 ){ModifiedSCEcha = n1SCEcha;}
7604  if( n1SCEcha >= 6 && n1SCEcha <= 9 ){ModifiedSCEcha = n1SCEcha-1;}
7605  if( n1SCEcha >= 11 && n1SCEcha <= 14 ){ModifiedSCEcha = n1SCEcha-2;}
7606  if( n1SCEcha >= 16 && n1SCEcha <= 19 ){ModifiedSCEcha = n1SCEcha-3;}
7607  if( n1SCEcha >= 21 && n1SCEcha <= 24 ){ModifiedSCEcha = n1SCEcha-4;}
7608  }
7609 
7610  //..... (D1,S2), (D3,S8) SC_in_DS = 25, n1DeeSCEcna = 176 -> 207a for construction top/right
7611  if( SC_in_DS == 25 && n1DeeSCEcna == 176 && TypQuad == "TR" )
7612  {
7613  if(n1SCEcha == 4){ModifiedSCEcha = 1;}
7614  if(n1SCEcha == 5){ModifiedSCEcha = 2;}
7615  if(n1SCEcha == 9){ModifiedSCEcha = 3;}
7616  if(n1SCEcha == 10){ModifiedSCEcha = 4;}
7617  if(n1SCEcha == 14){ModifiedSCEcha = 5;}
7618  if(n1SCEcha == 15){ModifiedSCEcha = 6;}
7619  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7620  if(n1SCEcha == 20){ModifiedSCEcha = 8;}
7621  if(n1SCEcha == 24){ModifiedSCEcha = 9;}
7622  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7623  }
7624 
7625  //..... (D4,S2), (D2,S8) SC_in_DS = 25, n1DeeSCEcna = 176 -> 58a for construction top/left
7626  if( SC_in_DS == 25 && n1DeeSCEcna == 176 && TypQuad == "TL" )
7627  {
7628  if(n1SCEcha == 16){ModifiedSCEcha = 1;}
7629  if(n1SCEcha == 21){ModifiedSCEcha = 2;}
7630  if(n1SCEcha == 17){ModifiedSCEcha = 3;}
7631  if(n1SCEcha == 22){ModifiedSCEcha = 4;}
7632  if(n1SCEcha == 18){ModifiedSCEcha = 5;}
7633  if(n1SCEcha == 23){ModifiedSCEcha = 6;}
7634  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7635  if(n1SCEcha == 24){ModifiedSCEcha = 8;}
7636  if(n1SCEcha == 20){ModifiedSCEcha = 9;}
7637  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7638  }
7639 
7640  //..... (D1,S2), (D3,S8) SC_in_DS = 3, n1DeeSCEcna = 157 -> 178b for construction top/right
7641  //..... (D1,S2), (D3,S8) SC_in_DS = 25, n1DeeSCEcna = 193 -> 207b for construction top/right
7642  if( (SC_in_DS == 3 && n1DeeSCEcna == 157 && TypQuad == "TR") ||
7643  (SC_in_DS == 25 && n1DeeSCEcna == 193 && TypQuad == "TR") )
7644  {
7645  if(n1SCEcha == 4){ModifiedSCEcha = 11;}
7646  if(n1SCEcha == 5){ModifiedSCEcha = 12;}
7647  if(n1SCEcha == 9){ModifiedSCEcha = 13;}
7648  if(n1SCEcha == 10){ModifiedSCEcha = 14;}
7649  if(n1SCEcha == 14){ModifiedSCEcha = 15;}
7650  if(n1SCEcha == 15){ModifiedSCEcha = 16;}
7651  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7652  if(n1SCEcha == 20){ModifiedSCEcha = 18;}
7653  if(n1SCEcha == 24){ModifiedSCEcha = 19;}
7654  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7655  }
7656 
7657  //..... (D4,S2), (D2,S8) SC_in_DS = 3, n1DeeSCEcna = 157 -> 29b for construction top/left
7658  //..... (D4,S2), (D2,S8) SC_in_DS = 25, n1DeeSCEcna = 193 -> 58b for construction top/left
7659  if( (SC_in_DS == 3 && n1DeeSCEcna == 157 && TypQuad == "TL") ||
7660  (SC_in_DS == 25 && n1DeeSCEcna == 193 && TypQuad == "TL") )
7661  {
7662  if(n1SCEcha == 16){ModifiedSCEcha = 11;}
7663  if(n1SCEcha == 21){ModifiedSCEcha = 12;}
7664  if(n1SCEcha == 17){ModifiedSCEcha = 13;}
7665  if(n1SCEcha == 22){ModifiedSCEcha = 14;}
7666  if(n1SCEcha == 18){ModifiedSCEcha = 15;}
7667  if(n1SCEcha == 23){ModifiedSCEcha = 16;}
7668  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7669  if(n1SCEcha == 24){ModifiedSCEcha = 18;}
7670  if(n1SCEcha == 20){ModifiedSCEcha = 19;}
7671  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7672  }
7673 
7674  //..... (D1,S2), (D3,S8) SC_in_DS = 32, n1DeeSCEcna = 51 -> 216 for construction top/right
7675  if( SC_in_DS == 32 && n1DeeSCEcna == 51 && TypQuad == "TR" )
7676  {
7677  if( n1SCEcha >= 1 && n1SCEcha <= 4 ){ModifiedSCEcha = n1SCEcha;}
7678  if( n1SCEcha >= 6 && n1SCEcha <= 9 ){ModifiedSCEcha = n1SCEcha-1;}
7679  if( n1SCEcha >= 11 && n1SCEcha <= 14 ){ModifiedSCEcha = n1SCEcha-2;}
7680  if( n1SCEcha >= 16 && n1SCEcha <= 19 ){ModifiedSCEcha = n1SCEcha-3;}
7681  if( n1SCEcha >= 21 && n1SCEcha <= 24 ){ModifiedSCEcha = n1SCEcha-4;}
7682  }
7683 
7684  //..... (D4,S2), (D2,S8) SC_in_DS = 32, n1DeeSCEcna = 51 -> 67 for construction top/left
7685  if( SC_in_DS == 32 && n1DeeSCEcna == 51 && TypQuad == "TL" )
7686  {
7687  ModifiedSCEcha = n1SCEcha;
7688  }
7689 
7690  // **************************** Special case: TWO SC's IN THE SAME SC-Ecna place *************************
7691  //========================================================================================== D1,D3 ======
7692  // (D1,S2), (D3,S8) SC_in_DS = 3, n1DeeSCEcna = 32 -> 178c for construction top/right
7693  // (D1,S2), (D3,S8) SC_in_DS = 25, n1DeeSCEcna = 32 -> 207c for construction top/right
7694  // For n1DeeSCEcna = 32: ONLY "25" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
7695  // fT2d_DSSC[dee-1][32-1] = 25; // also 3; // ( (207c, 58c) also (178c, 29c) for construction)
7696  // is recovered from number for construction
7697  //=======================================================================================================
7698  if( n1DeeSCEcna == 32 && TypQuad == "TR" )
7699  {
7700  if( nSCCons == 207 )
7701  {
7702  if(n1SCEcha == 1){ModifiedSCEcha = 21;}
7703  if(n1SCEcha == 2){ModifiedSCEcha = 22;}
7704  if(n1SCEcha == 3){ModifiedSCEcha = 23;}
7705  if(n1SCEcha == 6){ModifiedSCEcha = 24;}
7706  if(n1SCEcha == 7){ModifiedSCEcha = 25;}
7707  }
7708  if( nSCCons == 178 )
7709  {
7710  if(n1SCEcha == 11){ModifiedSCEcha = 21;}
7711  }
7712  }
7713 
7714  //========================================================================================== D2,D4 ======
7715  // (D4,S2), (D2,S8) SC_in_DS = 3, n1DeeSCEcna = 32 -> 29c for construction top/left
7716  // (D4,S2), (D2,S8) SC_in_DS = 25, n1DeeSCEcna = 32 -> 58c for construction top/left
7717  // For n1DeeSCEcna = 32: ONLY "25" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
7718  // fT2d_DSSC[dee-1][32-1] = 25; // also 3; // ( (207c, 58c) also (178c, 29c) for construction)
7719  // is recovered from number for construction
7720  //=======================================================================================================
7721  if( n1DeeSCEcna == 32 && TypQuad == "TL" )
7722  {
7723  if( nSCCons == 58 )
7724  {
7725  if(n1SCEcha == 1){ModifiedSCEcha = 21;}
7726  if(n1SCEcha == 2){ModifiedSCEcha = 22;}
7727  if(n1SCEcha == 3){ModifiedSCEcha = 23;}
7728  if(n1SCEcha == 6){ModifiedSCEcha = 24;}
7729  if(n1SCEcha == 7){ModifiedSCEcha = 25;}
7730  }
7731  if( nSCCons == 29 )
7732  {
7733  if(n1SCEcha == 11){ModifiedSCEcha = 21;}
7734  }
7735  }
7736  //****************************************************************************************************
7737 
7738  //------------------------------------------------------------------------------------------- bottom
7739 
7740  // **************************** Special case: TWO SC's IN THE SAME SC-Ecna place *************************
7741  //========================================================================================== D1,D3 ======
7742  // (D1,S4), (D3,S6) SC_in_DS = 14, n1DeeSCEcna = 29 -> 261a for construction bottom/right
7743  // (D1,S4), (D3,S6) SC_in_DS = 21, n1DeeSCEcna = 29 -> 268a for construction bottom/right
7744  // For n1DeeSCEcna = 29: ONLY "14" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
7745  // fT2d_DSSC[dee-1][29-1] = 14; // also 21; // ( (261a, 112a) also (268a, 119a) for construction)
7746  // is recovered from number for construction
7747  //=======================================================================================================
7748  if( n1DeeSCEcna == 29 && TypQuad == "BR" )
7749  {
7750  if( nSCCons == 261 )
7751  {
7752  if(n1SCEcha == 1){ModifiedSCEcha = 21;}
7753  if(n1SCEcha == 2){ModifiedSCEcha = 22;}
7754  if(n1SCEcha == 3){ModifiedSCEcha = 23;}
7755  if(n1SCEcha == 6){ModifiedSCEcha = 24;}
7756  if(n1SCEcha == 7){ModifiedSCEcha = 25;}
7757  }
7758  if( nSCCons == 268 )
7759  {
7760  if(n1SCEcha == 11){ModifiedSCEcha = 21;}
7761  }
7762  }
7763 
7764  //========================================================================================== D2,D4 ======
7765  // (D4,S4), (D2,S6) SC_in_DS = 14, n1DeeSCEcna = 29 -> 112a for construction bottom/left
7766  // (D4,S4), (D2,S6) SC_in_DS = 21, n1DeeSCEcna = 29 -> 119a for construction bottom/left
7767  // For n1DeeSCEcna = 29: ONLY "14" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
7768  // fT2d_DSSC[dee-1][29-1] = 14; // also 21; // ( (261a, 112a) also (268a, 119a) for construction)
7769  // is recovered from number for construction
7770  //=======================================================================================================
7771  if( n1DeeSCEcna == 29 && TypQuad == "BL" )
7772  {
7773  if( nSCCons == 119 )
7774  {
7775  if(n1SCEcha == 11){ModifiedSCEcha = 21;}
7776  }
7777  if( nSCCons == 112 )
7778  {
7779  if(n1SCEcha == 1){ModifiedSCEcha = 21;}
7780  if(n1SCEcha == 2){ModifiedSCEcha = 22;}
7781  if(n1SCEcha == 3){ModifiedSCEcha = 23;}
7782  if(n1SCEcha == 6){ModifiedSCEcha = 24;}
7783  if(n1SCEcha == 7){ModifiedSCEcha = 25;}
7784  }
7785  }
7786 
7787  // ****************************************************************************************************
7788 
7789  //..... (D1,S3), (D3,S7) SC_in_DS = 34, n1DeeSCEcna = 188 -> 298a for construction bottom/right
7790  //..... (D1,S4), (D3,S6) SC_in_DS = 14, n1DeeSCEcna = 165 -> 261b for construction bottom/right
7791  if( (SC_in_DS == 34 && n1DeeSCEcna == 188 && TypQuad == "BR") ||
7792  (SC_in_DS == 14 && n1DeeSCEcna == 165 && TypQuad == "BR") ){if(n1SCEcha > 15){ModifiedSCEcha = n1SCEcha - 15;}}
7793 
7794  //..... (D4,S3), (D2,S7) SC_in_DS = 34, n1DeeSCEcna = 188 -> 149a for construction bottom/left
7795  //..... (D4,S4), (D2,S6) SC_in_DS = 14, n1DeeSCEcna = 165 -> 112b for construction bottom/left
7796  if( (SC_in_DS == 34 && n1DeeSCEcna == 188 && TypQuad == "BL") ||
7797  (SC_in_DS == 14 && n1DeeSCEcna == 165 && TypQuad == "BL") )
7798  {
7799  if(n1SCEcha == 4){ModifiedSCEcha = 1;}
7800  if(n1SCEcha == 5){ModifiedSCEcha = 2;}
7801  if(n1SCEcha == 9){ModifiedSCEcha = 3;}
7802  if(n1SCEcha == 10){ModifiedSCEcha = 4;}
7803  if(n1SCEcha == 14){ModifiedSCEcha = 5;}
7804  if(n1SCEcha == 15){ModifiedSCEcha = 6;}
7805  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7806  if(n1SCEcha == 20){ModifiedSCEcha = 8;}
7807  if(n1SCEcha == 24){ModifiedSCEcha = 9;}
7808  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7809  }
7810 
7811  //..... (D1,S3), (D3,S7) SC_in_DS = 10, n1DeeSCEcna = 50 -> 224 for construction bottom/right
7812  if( SC_in_DS == 10 && n1DeeSCEcna == 50 && TypQuad == "BR" )
7813  {
7814  ModifiedSCEcha = n1SCEcha;
7815  }
7816 
7817  //..... (D4,S3), (D2,S7) SC_in_DS = 10, n1DeeSCEcna = 50 -> 75 for construction bottom/left
7818  if( SC_in_DS == 10 && n1DeeSCEcna == 50 && TypQuad == "BL")
7819  {
7820  if( n1SCEcha >= 1 && n1SCEcha <= 4 ){ModifiedSCEcha = n1SCEcha;}
7821  if( n1SCEcha >= 6 && n1SCEcha <= 9 ){ModifiedSCEcha = n1SCEcha-1;}
7822  if( n1SCEcha >= 11 && n1SCEcha <= 14 ){ModifiedSCEcha = n1SCEcha-2;}
7823  if( n1SCEcha >= 16 && n1SCEcha <= 19 ){ModifiedSCEcha = n1SCEcha-3;}
7824  if( n1SCEcha >= 21 && n1SCEcha <= 24 ){ModifiedSCEcha = n1SCEcha-4;}
7825  }
7826 
7827  //..... (D1,S4), (D3,S6) SC_in_DS = 14, n1DeeSCEcna = 144 -> 261c for construction bottom/right
7828  if( SC_in_DS == 14 && n1DeeSCEcna == 144 && TypQuad == "BR" ){if(n1SCEcha > 5){ModifiedSCEcha = n1SCEcha - 5;}}
7829 
7830  //..... (D4,S4), (D2,S6) SC_in_DS = 14, n1DeeSCEcna = 144 -> 112c for construction bottom/left
7831  if( SC_in_DS == 14 && n1DeeSCEcna == 144 && TypQuad == "BL" )
7832  {
7833  if(n1SCEcha == 4){ModifiedSCEcha = 11;}
7834  if(n1SCEcha == 5){ModifiedSCEcha = 12;}
7835  if(n1SCEcha == 9){ModifiedSCEcha = 13;}
7836  if(n1SCEcha == 10){ModifiedSCEcha = 14;}
7837  if(n1SCEcha == 14){ModifiedSCEcha = 15;}
7838  if(n1SCEcha == 15){ModifiedSCEcha = 16;}
7839  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7840  if(n1SCEcha == 20){ModifiedSCEcha = 18;}
7841  if(n1SCEcha == 24){ModifiedSCEcha = 19;}
7842  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7843  }
7844 
7845  //..... (D1,S4), (D3,S6) SC_in_DS = 21, n1DeeSCEcna = 123 -> 268b for construction bottom/right
7846  //..... (D1,S5), (D3,S5) SC_in_DS = 20, n1DeeSCEcna = 21 -> 281a for construction bottom/right
7847  if( (SC_in_DS == 21 && n1DeeSCEcna == 123 && TypQuad == "BR") ||
7848  (SC_in_DS == 20 && n1DeeSCEcna == 41 && TypQuad == "BR") )
7849  {
7850  if(n1SCEcha == 4){ModifiedSCEcha = 1;}
7851  if(n1SCEcha == 5){ModifiedSCEcha = 2;}
7852  if(n1SCEcha == 9){ModifiedSCEcha = 3;}
7853  if(n1SCEcha == 10){ModifiedSCEcha = 4;}
7854  if(n1SCEcha == 14){ModifiedSCEcha = 5;}
7855  if(n1SCEcha == 15){ModifiedSCEcha = 6;}
7856  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7857  if(n1SCEcha == 20){ModifiedSCEcha = 8;}
7858  if(n1SCEcha == 24){ModifiedSCEcha = 9;}
7859  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7860  }
7861 
7862  //..... (D4,S4), (D2,S6) SC_in_DS = 21, n1DeeSCEcna = 123 -> 119b for construction bottom/left
7863  //..... (D4,S5), (D2,S5) SC_in_DS = 3, n1DeeSCEcna = 41 -> 132a for construction bottom/left
7864  if( (SC_in_DS == 21 && n1DeeSCEcna == 123 && TypQuad == "BL") ||
7865  (SC_in_DS == 3 && n1DeeSCEcna == 41 && TypQuad == "BL") ){if(n1SCEcha > 15){ModifiedSCEcha = n1SCEcha - 15;}}
7866 
7867 
7868  //..... (D1,S4), (D3,S6) SC_in_DS = 21, n1DeeSCEcna = 102 -> 268c for construction bottom/right
7869  if( SC_in_DS == 21 && n1DeeSCEcna == 102 && TypQuad == "BR" )
7870  {
7871  if(n1SCEcha == 4){ModifiedSCEcha = 11;}
7872  if(n1SCEcha == 5){ModifiedSCEcha = 12;}
7873  if(n1SCEcha == 9){ModifiedSCEcha = 13;}
7874  if(n1SCEcha == 10){ModifiedSCEcha = 14;}
7875  if(n1SCEcha == 14){ModifiedSCEcha = 15;}
7876  if(n1SCEcha == 15){ModifiedSCEcha = 16;}
7877  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7878  if(n1SCEcha == 20){ModifiedSCEcha = 18;}
7879  if(n1SCEcha == 24){ModifiedSCEcha = 19;}
7880  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7881  }
7882 
7883  //..... (D4,S4), (D2,S6) SC_in_DS = 21, n1DeeSCEcna = 102 -> 119c for construction bottom/left
7884  if( SC_in_DS == 21 && n1DeeSCEcna == 102 && TypQuad == "BL" )
7885  {
7886  if(n1SCEcha == 16){ModifiedSCEcha = 11;}
7887  if(n1SCEcha == 21){ModifiedSCEcha = 12;}
7888  if(n1SCEcha == 17){ModifiedSCEcha = 13;}
7889  if(n1SCEcha == 22){ModifiedSCEcha = 14;}
7890  if(n1SCEcha == 18){ModifiedSCEcha = 15;}
7891  if(n1SCEcha == 23){ModifiedSCEcha = 16;}
7892  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7893  if(n1SCEcha == 24){ModifiedSCEcha = 18;}
7894  if(n1SCEcha == 20){ModifiedSCEcha = 19;}
7895  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7896  }
7897 
7898  //..... (D1,S5), (D3,S5) SC_in_DS = 23, n1DeeSCEcna = 8 -> 286 for construction bottom/right
7899  if( SC_in_DS == 23 && n1DeeSCEcna == 8 && TypQuad == "BR" )
7900  {
7901  if( n1SCEcha >= 1 && n1SCEcha <= 4 ){ModifiedSCEcha = n1SCEcha;}
7902  if( n1SCEcha >= 6 && n1SCEcha <= 9 ){ModifiedSCEcha = n1SCEcha-1;}
7903  if( n1SCEcha >= 11 && n1SCEcha <= 14 ){ModifiedSCEcha = n1SCEcha-2;}
7904  if( n1SCEcha >= 16 && n1SCEcha <= 19 ){ModifiedSCEcha = n1SCEcha-3;}
7905  if( n1SCEcha >= 21 && n1SCEcha <= 24 ){ModifiedSCEcha = n1SCEcha-4;}
7906  }
7907 
7908  //..... (D4,S5), (D2,S5) SC_in_DS = 6, n1DeeSCEcna = 8 -> 137 for construction bottom/left
7909  if( SC_in_DS == 6 && n1DeeSCEcna == 8 && TypQuad == "BL" )
7910  {
7911  ModifiedSCEcha = n1SCEcha;
7912  }
7913 
7914  //======================= ERROR message if ModifiedSCEcha is not correct
7915  if( ModifiedSCEcha < 1 || ModifiedSCEcha > fEcal->MaxCrysInSC() )
7916  {
7917  std::cout << "! *** ERROR *** > ModifiedSCEcha = " << ModifiedSCEcha
7918  << ", SC_in_DS = " << SC_in_DS
7919  << ", nSCCons = " << nSCCons
7920  << ", n1DeeSCEcna = " << n1DeeSCEcna
7921  << ", n1SCEcha = " << n1SCEcha
7922  << ", ModifiedSCEcha = " << ModifiedSCEcha
7923  << ", TypQuad = " << TypQuad
7924  << fTTBELL << std::endl;
7925  }
7926 
7927 
7928  return ModifiedSCEcha;
7929 }
7930 // end of ModifiedSCEchaForNotConnectedSCs(...)
7931 
7932 //======================================================================================
7933 //
7934 // ViewHistime: evolution in time
7935 //
7936 //======================================================================================
7937 
7938 //======================================================================================
7939 //
7940 // ViewHistime: time evolution
7941 //
7942 //======================================================================================
7943 void TEcnaHistos::ViewHistime(const TString& list_of_run_file_name,
7944  const Int_t& StexStin_A, const Int_t& i0StinEcha,
7945  const TString& HistoCode, const TString& opt_plot_arg)
7946 {
7947  //Histogram of the quantities as a function of time (several runs)
7948 
7949  TString opt_plot = opt_plot_arg;
7950  TString HistoType = fCnaParHistos->GetHistoType(HistoCode);
7951 
7952  if( opt_plot_arg == "ONLYONE" ){opt_plot = fOnlyOnePlot;}
7953  if( opt_plot_arg == "SEVERAL" ){opt_plot = fSeveralPlot;}
7954  if( opt_plot_arg == "SAMEONE" ){opt_plot = fSameOnePlot;}
7955 
7956  Int_t OKHisto = 0;
7957 
7958  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Canvas already closed in option SAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7959  Int_t xCanvasExists = 1; // a priori ==> SAME plot // (ViewHistime)
7960  if( opt_plot != fOnlyOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
7961  {
7962  TVirtualPad* main_subpad = nullptr;
7963  //---------------- Call to ActivePad
7964  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
7965  if( main_subpad == nullptr )
7966  {
7967  std::cout << "*TEcnaHistos::ViewHistime(...)> WARNING ===> Canvas has been closed in option SAME or SAME n."
7968  << std::endl
7969  << " Please, restart with a new canvas."
7970  << fTTBELL << std::endl;
7971 
7972  ReInitCanvas(HistoCode, opt_plot);
7973  xCanvasExists = 0;
7974  }
7975  }
7976  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7977 
7978  //%%%%%%%%%%%%%%%%%%%%% Change of X variable in option SAME n with no proj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7979  Int_t SameXVarMemo = 1; // a priori ==> SAME n option: X variable OK (ViewHistime)
7980  if( !( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj" || HistoType == "EvolProj" ) )
7981  {
7982  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
7983  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
7984 
7985  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
7986  {
7987  SetXVarMemo(HistoCode, opt_plot, XVarHisto); SetYVarMemo(HistoCode, opt_plot, YVarHisto); SameXVarMemo = 1;
7988  }
7989  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
7990  {
7991  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
7992  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
7993 
7994  if( XVarHisto != XVariableMemo )
7995  {
7996  std::cout << "!TEcnaHistos::ViewHistime(...)> *** ERROR *** ===> X coordinate changed in option SAME n." << std::endl
7997  << " Present X = " << XVarHisto << std::endl
7998  << " Present Y = " << YVarHisto << std::endl
7999  << " Previous X = " << XVariableMemo << std::endl
8000  << " Previous Y = " << YVariableMemo
8001  << fTTBELL << std::endl;
8002  SameXVarMemo = 0;
8003  }
8004  else
8005  {SetYVarMemo(HistoCode, opt_plot, YVarHisto);}
8006  }
8007  }
8008  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8009 
8010  //%%%%%%%%%%%%%%%%%%%%%%% Change of Y variable in option SAME n with proj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8011  Int_t SameYVarMemo = 1; // a priori ==> SAME n option: Y variable OK (ViewHistime)
8012  if( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj" || HistoType == "EvolProj" )
8013  {
8014  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
8015  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
8016 
8017  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
8018  {
8019  SetYVarMemo(HistoCode, opt_plot, YVarHisto); SetYVarMemo(HistoCode, opt_plot, YVarHisto); SameYVarMemo = 1;
8020  }
8021  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
8022  {
8023  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
8024  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
8025 
8026  if( YVarHisto != YVariableMemo )
8027  {
8028  std::cout << "!TEcnaHistos::ViewHistime(...)> *** ERROR *** ===> Y coordinate changed in option SAME n." << std::endl
8029  << " Present X = " << XVarHisto << std::endl
8030  << " Present Y = " << YVarHisto << std::endl
8031  << " Previous X = " << XVariableMemo << std::endl
8032  << " Previous Y = " << YVariableMemo
8033  << fTTBELL << std::endl;
8034  SameYVarMemo = 0;
8035  }
8036  else
8037  {SetYVarMemo(HistoCode, opt_plot, YVarHisto);}
8038  }
8039  }
8040  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8041  if( xCanvasExists == 1 && SameXVarMemo == 1 && SameYVarMemo == 1 ){OKHisto = 1;}
8042 
8043  //======================== Histime accepted
8044  if( OKHisto == 1 )
8045  {
8046  // fMyRootFile->PrintNoComment();
8047 
8049 
8050  //................................. Init YMin and YMax of histo // (ViewHistime)
8051  if((opt_plot == fOnlyOnePlot) ||
8052  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8053  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free"))
8055 
8056  //........ GetHistoryRunListParameters(...) : performs the allocation of the array fT1DRunNumber[]
8057  // at first call of the present method ViewHistime
8058  // increments the number of read file (fNbOfListFileEvolXXX) for option SAME
8059  // and read the values fT1DRunNumber[0 to max] from the file list_of_run_file_name
8060  // return the number of runs in the list of the file
8061  //............... Get the run parameters
8062 
8063  Int_t nb_of_runs_in_list = GetHistoryRunListParameters(list_of_run_file_name.Data(), HistoCode);
8064 
8065  if( nb_of_runs_in_list > 0 )
8066  {
8067  //.............................. prepa x axis: time in hours
8068  //Double_t sec_in_day = (Double_t)86400.; //===> (number of seconds in a day)
8069  Double_t margin_frame_xaxis = (Double_t)25.; //===> margin in x coordinates
8070 
8071  Double_t thstart_evol = (Double_t)0.;
8072  Double_t thstop_evol = (Double_t)0.;
8073 
8074  Int_t* exist_indic = new Int_t[nb_of_runs_in_list]; fCnew++;
8075 
8076  //===================================== FIRST LOOP BEGINNING ===================================
8077  //-------------------------------------------------------------------------------- (ViewHistime)
8078  //
8079  // FIRST LOOP: read the "HistoryRunList" file. Check the existence of the runs
8080  // and determine the number of existing runs.
8081  //
8082  //--------------------------------------------------------------------------------
8083 
8084  fNbOfExistingRuns = (Int_t)0;
8085 
8086  if( fFapStexNumber > 0 )
8087  {
8088  for(Int_t i_run = 0; i_run < nb_of_runs_in_list; i_run++)
8089  {
8090  exist_indic[i_run] = 0;
8091  // ==> set the attribute value relative to the run (fFapRunNumber)
8092  SetRunNumberFromList(i_run, nb_of_runs_in_list);
8093 
8099 
8100  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewHistime, 1rst loop)
8101  {
8102  fStatusFileFound = kTRUE;
8103 
8104  //------ At first HistoryRunList file: set fStartEvol... and fStopEvol... quantities
8105  if( GetListFileNumber(HistoCode) == 1 )
8106  {
8107  if( fNbOfExistingRuns == 0 )
8108  {
8109  // start time of the first existing run of the list
8112  fStartEvolRun = fT1DRunNumber[i_run];
8113  // start time of the last existing run of the list
8114  // (in case of only one existing run in the list)
8117  fStopEvolRun = fT1DRunNumber[i_run];
8118  }
8119  else
8120  {
8121  // start time of the last existing run of the list
8124  fStopEvolRun = fT1DRunNumber[i_run];
8125  }
8126  }
8127  //---- set flag of run existence and increase number of existing runs
8128  // (for the first HistoryRunList file)
8129  exist_indic[i_run] = 1;
8131  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
8132  else
8133  {
8134  fStatusFileFound = kFALSE;
8135 
8136  std::cout << "!TEcnaHistos::ViewHistime(...)> *ERROR* =====> "
8137  << " ROOT file not found for run " << fT1DRunNumber[i_run]
8138  << fTTBELL << std::endl << std::endl;
8139  }
8140  } // end of for(Int_t i_run = 0; i_run < nb_of_runs_in_list; i_run++)
8141 
8142  //===================================== FIRST LOOP END =========================== (ViewHistime)
8143  if( fNbOfExistingRuns > 0 )
8144  {
8145  //-------------------- recover the array after removing non existing ROOT files
8146  Int_t i_existing_run = (Int_t)0;
8147 
8148  for( Int_t i_run = 0; i_run < nb_of_runs_in_list; i_run++)
8149  {
8150  if( exist_indic[i_run] == 1 )
8151  {
8152  fT1DRunNumber[i_existing_run] = fT1DRunNumber[i_run];
8153  i_existing_run++;
8154  }
8155  }
8156 
8157  //---------------------- Get start and stop time values to set the axis limits (ViewHistime)
8158 
8159  thstart_evol = (Double_t)fStartEvolTime;
8160  thstop_evol = (Double_t)fStopEvolTime;
8161 
8162  Double_t xinf_lim = thstart_evol-(thstop_evol-thstart_evol)/margin_frame_xaxis;
8163  Double_t xsup_lim = thstop_evol +(thstop_evol-thstart_evol)/margin_frame_xaxis;
8164 
8165  Axis_t xinf_his = (Axis_t)(xinf_lim);
8166  Axis_t xsup_his = (Axis_t)(xsup_lim);
8167 
8168  //............................. i0StexEcha, i0Sample
8169  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha);
8170  Int_t i0Sample = 0;
8171 
8172  Double_t* time_coordx = new Double_t[fNbOfExistingRuns]; fCnew++;
8173  Double_t* hval_coordy = new Double_t[fNbOfExistingRuns]; fCnew++;
8174 
8175  //........... Set values to -1
8176 
8177  for( Int_t i_run = 0; i_run < fNbOfExistingRuns; i_run++)
8178  {
8179  time_coordx[i_run] = (Double_t)(-1);
8180  hval_coordy[i_run] = (Double_t)(-1);
8181  }
8182 
8183  //========================== SECOND LOOP BEGINNING =====================================
8184  //----------------------------------------------------------------------- (ViewHistime)
8185  //
8186  // SECOND LOOP OVER THE EXISTING RUNS : FILL THE GRAPH COORDINATES
8187  //
8188  //-----------------------------------------------------------------------
8189  for (Int_t i_run = 0; i_run < fNbOfExistingRuns; i_run++)
8190  {
8191  // => set the attribute value relative to the run (fFapRunNumber)
8192  SetRunNumberFromList(i_run, fNbOfExistingRuns);
8193 
8199 
8200  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewHistime, 2nd loop)
8201  {
8202  fStatusFileFound = kTRUE;
8203 
8204  Bool_t ok_view_histo = GetOkViewHisto(fMyRootFile, StexStin_A, i0StinEcha, i0Sample, HistoCode);
8205 
8206  //............... F I L L G R A P H C O O R D I N A T E S (ViewHistime)
8207  if( ok_view_histo == kTRUE )
8208  {
8209  //................................................. x coordinate
8210  time_t xStartTime = fMyRootFile->GetStartTime();
8211  Double_t thstart = (Double_t)xStartTime;
8212  time_coordx[i_run] = (Double_t)(thstart - xinf_lim);
8213  //................................................. y coordinate
8214  TVectorD read_histo(fEcal->MaxCrysEcnaInStex());
8215  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++){read_histo(i)=(Double_t)0.;}
8216 
8217  if(HistoCode == "H_Ped_Date" || HistoCode == "H_Ped_RuDs")
8218  {read_histo = fMyRootFile->ReadPedestals(fEcal->MaxCrysEcnaInStex());}
8219  if(HistoCode == "H_TNo_Date" || HistoCode == "H_TNo_RuDs")
8220  {read_histo = fMyRootFile->ReadTotalNoise(fEcal->MaxCrysEcnaInStex());}
8221  if(HistoCode == "H_MCs_Date" || HistoCode == "H_MCs_RuDs")
8223 
8224  if(HistoCode == "H_LFN_Date" || HistoCode == "H_LFN_RuDs")
8226  if(HistoCode == "H_HFN_Date" || HistoCode == "H_HFN_RuDs")
8228  if(HistoCode == "H_SCs_Date" || HistoCode == "H_SCs_RuDs")
8230  hval_coordy[i_run] = (Double_t)read_histo(i0StexEcha);
8231  }
8232  else
8233  {
8234  std::cout << "!TEcnaHistos::ViewHistime(...)> Histo not available. "
8235  << fTTBELL << std::endl;
8236  }
8237  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
8238  else
8239  {
8240  fStatusFileFound = kFALSE;
8241  }
8242  }
8243  //========================== END OF SECOND LOOP ===========================================
8244 
8245  //.................................................................... SCALE x and y
8246  Int_t opt_scale_x = fOptScaleLinx;
8247  if (fFlagScaleX == "LIN" ){opt_scale_x = fOptScaleLinx;}
8248  if (fFlagScaleX == "LOG" ){opt_scale_x = fOptScaleLogx;}
8249 
8250  Int_t opt_scale_y = fOptScaleLiny;
8251  if (fFlagScaleY == "LIN" ){opt_scale_y = fOptScaleLiny;}
8252  if (fFlagScaleY == "LOG" ){opt_scale_y = fOptScaleLogy;}
8253 
8254  //------------------------------------------------- G R A P H (ViewHistime)
8255  TGraph* g_graph0 = new TGraph(fNbOfExistingRuns, time_coordx, hval_coordy); fCnewRoot++;
8256  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
8257  {g_graph0->SetTitle(fCnaParHistos->GetQuantityName(HistoCode));}
8258  if( opt_plot == fSameOnePlot )
8259  {g_graph0->SetTitle(";");}
8260 
8261  //... Ymin and ymax default values will be taken if fFlagUserHistoMin/Max = "OFF"
8262  // (and if "Free" for "SAME" and "SAME n" options)
8263  if((opt_plot == fOnlyOnePlot) ||
8264  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8265  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
8266  {
8267  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
8268  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
8269  }
8270 
8271  //................................ Put min max values (ViewHistime)
8272  //.......... default if flag not set to "ON"
8273  //SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
8274  //SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
8275 
8276  g_graph0->Set(fNbOfExistingRuns);
8277  Double_t graph_ymin =
8279  Double_t graph_ymax =
8281 
8282  //---------------------------------- G R A P H P L O T ---------------------------- (ViewHistime)
8283  if( HistoType == "Evol" )
8284  {
8285  //----------------- G R A P H Y M I N / Y M A X M A N A G E M E N T
8286  if((opt_plot == fOnlyOnePlot) ||
8287  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8288  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
8289  {
8290  if( opt_plot == fSameOnePlot ){fHistoCodeFirst = HistoCode;} // registration of first HistoCode
8291 
8292  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
8293  //.......... user's value if flag set to "ON"
8294  if( fFlagUserHistoMin == "ON" )
8295  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
8296  if( fFlagUserHistoMax == "ON" )
8297  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
8298  //................................. automatic min and/or max
8299  if( fFlagUserHistoMin == "AUTO" )
8300  {SetYminMemoFromValue(HistoCode.Data(), graph_ymin); fFlagUserHistoMin = "OFF";}
8301  if( fFlagUserHistoMax == "AUTO" )
8302  {SetYmaxMemoFromValue(HistoCode.Data(), graph_ymax); fFlagUserHistoMax = "OFF";}
8303 
8304  //................................. Init Ymin and Ymax for graph
8305  SetYminMemoFromPreviousMemo(HistoCode);
8306  SetYmaxMemoFromPreviousMemo(HistoCode);
8307  }
8308  //--- Set ymin and ymax to the first HistoCode values for option SAME n
8309  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
8310  {
8311  Double_t ymin = GetYminValueFromMemo(fHistoCodeFirst.Data());
8312  SetYminMemoFromValue(HistoCode.Data(), ymin);
8313 
8314  Double_t ymax = GetYmaxValueFromMemo(fHistoCodeFirst.Data());
8315  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
8316  }
8317 
8318  //..... graph set ymin and ymax and consequently margin at top of the plot
8319  Int_t xFlagAutoYsupMargin = SetGraphFrameYminYmaxFromMemo(g_graph0, HistoCode);
8320 
8321  HistimePlot(g_graph0, xinf_his, xsup_his,
8322  HistoCode.Data(), HistoType.Data(),
8323  StexStin_A, i0StinEcha, i0Sample,
8324  opt_scale_x, opt_scale_y, opt_plot, xFlagAutoYsupMargin);
8325  // g_graph0->Delete(); fCdeleteRoot++; // *===> NE PAS DELETER LE GRAPH SINON CA EFFACE TOUT!
8326 
8327  //--- Recover ymin and ymax from user's values in option SAME n
8328  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
8329  {
8330  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
8331  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
8332  }
8333  }
8334 
8335  //---------- H I S T O Y P R O J E C T I O N P L O T ---------------------- (ViewHistime)
8336 
8337  //====== 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)
8338  //
8339  // must be done before booking because of the x <-> y permutation in case of "Proj"
8340  //
8341  //-----------------------------------------------------------------------------------------
8342  //
8343  // CASE: HistoType == "Proj" OR HistoType == "SampProj"
8344  //
8345  // Xinf and Xsup must be calculated from ymin and ymax
8346  // of the direct graph
8347  //
8348  //-----------------------------------------------------------------------------------------
8349 
8350  if( HistoType == "EvolProj" )
8351  {
8352  Int_t HisSizeEvolProj = fNbBinsProj;
8353  TVectorD histo_for_plot(HisSizeEvolProj);
8354  for(Int_t i=0; i<HisSizeEvolProj; i++){histo_for_plot[i]=(Double_t)0.;}
8355 
8356  //graph_ymin = GetYminValueFromMemo(HistoCode.Data());
8357  //graph_ymax = GetYmaxValueFromMemo(HistoCode.Data());
8358 
8359  TString HistoCodi = HistoCode; // HistoCodi = direct histo
8360 
8361  if( HistoCode == "H_Ped_RuDs" ){HistoCodi = "H_Ped_Date";}
8362  if( HistoCode == "H_TNo_RuDs" ){HistoCodi = "H_TNo_Date";}
8363  if( HistoCode == "H_LFN_RuDs" ){HistoCodi = "H_LFN_Date";}
8364  if( HistoCode == "H_HFN_RuDs" ){HistoCodi = "H_HFN_Date";}
8365  if( HistoCode == "H_MCs_RuDs" ){HistoCodi = "H_MCs_Date";}
8366  if( HistoCode == "H_SCs_RuDs" ){HistoCodi = "H_SCs_Date";}
8367 
8368  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
8369 
8370  //--------------------------------------------------------------------------- (ViewHistime)
8371  //
8372  // fOnlyOnePlot => compute Xinf and Xsup at each time
8373  // fSeveralPlot => compute Xinf and Xsup once when flag = "Free" for each HistoCode
8374  // fSameOnePlot => compute Xinf and Xsup once
8375  //
8376  //--------------------------------------------------------------------------------------
8377  if( (opt_plot == fOnlyOnePlot) ||
8378  ( (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, fSeveralPlot) == "Free" ) ||
8379  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, fSameOnePlot) == "Free" ) ) )
8380  {
8381  Double_t XinfProj =(Double_t)0;
8382  Double_t XsupProj =(Double_t)0;
8383 
8384  //...................................................................... (ViewHistime)
8385  if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
8386  {
8387  //... Get direct graph ymin and/or ymax and keep them as xinf and xsup
8388  // in memo for the plotted histo
8389  XinfProj = fUserHistoMin;
8390  XsupProj = fUserHistoMax;
8391  if( fFlagUserHistoMin == "AUTO" ){XinfProj = GetYminValueFromMemo(HistoCodi.Data());}
8392  if( fFlagUserHistoMax == "AUTO" ){XsupProj = GetYmaxValueFromMemo(HistoCodi.Data());}
8393  } // end of if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
8394  else
8395  {
8396  if( fFlagUserHistoMin == "OFF" )
8397  {
8398  SetYminMemoFromValue(HistoCode.Data(),
8399  fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
8400  XinfProj = GetYminValueFromMemo(HistoCode.Data());
8401  }
8402 
8403  if( fFlagUserHistoMax == "OFF" )
8404  {
8405  SetYmaxMemoFromValue(HistoCode.Data(),
8406  fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
8407  XsupProj = GetYmaxValueFromMemo(HistoCode.Data());
8408  }
8409  if( fFlagUserHistoMin == "ON" ){XinfProj = fUserHistoMin;}
8410  if( fFlagUserHistoMax == "ON" ){XsupProj = fUserHistoMax;}
8411  }
8412 
8413  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
8414  {
8415  SetXinfMemoFromValue(HistoCode.Data(), XinfProj);
8416  SetXsupMemoFromValue(HistoCode.Data(), XsupProj);
8417  }
8418  else
8419  {
8420  SetXinfMemoFromValue(XinfProj);
8421  SetXsupMemoFromValue(XsupProj);
8422  }
8423  } // end of if( (opt_plot == fOnlyOnePlot) ||
8424  // (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8425  // (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
8426 
8427  Double_t cXinf = (Double_t)0.;
8428  Double_t cXsup = (Double_t)0.;
8429 
8430  //.......... Set Xinf and Xsup at each time because of simultaneous SAME options (ViewHistime)
8431  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
8432  {
8433  cXinf = GetXinfValueFromMemo(HistoCode.Data());
8434  cXsup = GetXsupValueFromMemo(HistoCode.Data());
8435  }
8436  else
8437  {
8438  cXinf = GetXinfValueFromMemo();
8439  cXsup = GetXsupValueFromMemo();
8440  }
8441  //....... In case of only one run: in order to have cXinf < cXsup for "EvolProj" plot
8442  if( cXinf >= cXsup ){cXinf -= 1.; cXsup +=1.;}
8443 
8444  //.............................. histogram booking (ViewHisto)
8445  Axis_t xinf_his = cXinf; // ancillary variables since no const in arguments of TH1D
8446  Axis_t xsup_his = cXsup;
8447 
8448  TString TitleHisto = ";";
8449  if( opt_plot != fSameOnePlot )
8450  {TitleHisto = fCnaParHistos->GetQuantityName(HistoCode.Data());}
8451 
8452  //........ fill array histo_for_plot from hval_coordy (ViewHistime)
8453  for(Int_t i_run=0; i_run<fNbOfExistingRuns; i_run++)
8454  {
8455  Double_t XFromYGraph = hval_coordy[i_run];
8456  Double_t binXProjY = (Double_t)HisSizeEvolProj*(XFromYGraph - cXinf)/(cXsup - cXinf);
8457  Int_t ibinXProjY = (Int_t)binXProjY;
8458  if( ibinXProjY >= 0 && ibinXProjY<HisSizeEvolProj ){histo_for_plot[ibinXProjY]++;}
8459  }
8460 
8461  TH1D* h_his_evol_proj = new TH1D("histevolproj", TitleHisto.Data(),
8462  HisSizeEvolProj, xinf_his, xsup_his); fCnewRoot++;
8463 
8464  h_his_evol_proj->Reset();
8465 
8466  //.... direct histogram filling (ViewHistime)
8467  for(Int_t i=0; i<HisSizeEvolProj; i++)
8468  {
8469  Double_t yi = (Double_t)i/(Double_t)HisSizeEvolProj*(cXsup-cXinf) + cXinf;
8470  Double_t his_val = (Double_t)histo_for_plot[i];
8471  h_his_evol_proj->Fill(yi, his_val);
8472  }
8473 
8474  //------- 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
8475  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
8476  //.......... user's value if flag set to "ON"
8477  if( fFlagUserHistoMin == "ON" )
8478  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
8479  if( fFlagUserHistoMax == "ON" )
8480  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
8481  //................................. automatic min and/or max
8482  if( fFlagUserHistoMin == "AUTO" )
8483  {SetYminMemoFromValue(HistoCode.Data(), graph_ymin); fFlagUserHistoMin = "OFF";}
8484  if( fFlagUserHistoMax == "AUTO" )
8485  {SetYmaxMemoFromValue(HistoCode.Data(), graph_ymax); fFlagUserHistoMax = "OFF";}
8486 
8487  //................................. Init Ymin and Ymax for graph
8488  SetYminMemoFromPreviousMemo(HistoCode);
8489  SetYmaxMemoFromPreviousMemo(HistoCode);
8490 
8491  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8492  //.......... Find maximum in case of Proj (LIN scale only) // PS: EvolProj => in ViewHistime
8493  if( fFlagScaleY == "LIN" )
8494  {
8496  (HistoCode.Data(),
8498  }
8499 
8500  //--- Set ymin and ymax to the first HistoCode values for option SAME n
8501  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
8502  {
8503  Double_t ymin = GetYminValueFromMemo(fHistoCodeFirst.Data());
8504  SetYminMemoFromValue(HistoCode.Data(), ymin);
8505 
8506  Double_t ymax = GetYmaxValueFromMemo(fHistoCodeFirst.Data());
8507  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
8508  }
8509  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8510 
8511  //..... graph set ymin and ymax and consequently margin at top of the plot
8512  Int_t xFlagAutoYsupMargin = SetGraphFrameYminYmaxFromMemo(g_graph0, HistoCode);
8513  Int_t arg_AlreadyRead = 0;
8514 
8515  HistoPlot(h_his_evol_proj, HisSizeEvolProj,
8516  xinf_his, xsup_his,
8517  HistoCode.Data(), HistoType.Data(),
8518  StexStin_A, i0StinEcha, i0Sample,
8519  opt_scale_x, opt_scale_y, opt_plot, arg_AlreadyRead,
8520  xFlagAutoYsupMargin);
8521 
8522  h_his_evol_proj->Delete(); h_his_evol_proj = nullptr; fCdeleteRoot++;
8523  //*===> deleter l'histo sinon "Replacing existing histo (potential memory leak)" a l'execution
8524 
8525  } // end of if( HistoType == "EvolProj" )
8526  //---------------------------------------------------------------------------------- (ViewHistime)
8527 
8528  delete [] time_coordx; time_coordx = nullptr; fCdelete++;
8529  delete [] hval_coordy; hval_coordy = nullptr; fCdelete++;
8530  }
8531  else
8532  {
8533  std::cout << "!TEcnaHistos::ViewHistime(...)> The list of runs in file: " << list_of_run_file_name
8534  << " has " << nb_of_runs_in_list << " run numbers" << std::endl
8535  << " but none of them correspond to an existing ROOT file."
8536  << fTTBELL << std::endl;
8537  }
8538  } // end of if( fFapStexNumber > 0 )
8539  else
8540  {
8541  std::cout << "!TEcnaHistos::ViewHistime(...)> *ERROR* =====> "
8542  << fFapStexName << " number = " << fFapStexNumber << ". "
8543  << fFapStexName << " number must be in range [1," << fEcal->MaxStexInStas() << "] ";
8544  if( fFlagSubDet == "EB" ){std::cout << " (or [-18,+18])";}
8545  std::cout << fTTBELL << std::endl;
8546  }
8547  delete [] exist_indic; exist_indic = nullptr; fCdelete++;
8548  } // end of if( nb_of_runs_in_list > 0 )
8549  else
8550  {
8551  if( nb_of_runs_in_list == 0 )
8552  {
8553  std::cout << "!TEcnaHistos::ViewHistime(...)> The list of runs in file: " << list_of_run_file_name
8554  << " is empty !" << fTTBELL << std::endl;
8555  }
8556  if( nb_of_runs_in_list < 0 )
8557  {
8558  std::cout << "!TEcnaHistos::ViewHistime(...)> " << list_of_run_file_name
8559  << ": file not found in directory: " << fCfgHistoryRunListFilePath.Data() << fTTBELL << std::endl;
8560  }
8561  }
8562  } // end of if( OKHisto == 1 )
8563 } // end of ViewHistime
8564 
8565 //------------------------------------------------------------------------------------
8566 //
8567 // GetHistoryRunListParameters(...), AllocArraysForEvol(), GetListFileNumber(...)
8568 //
8569 //------------------------------------------------------------------------------------
8570 
8571 Int_t TEcnaHistos::GetHistoryRunListParameters(const TString& list_of_run_file_name, const TString& HistoCode)
8572 {
8573  // Build the array of run numbers from the list-of-runs .ascii file.
8574  // Return the list size
8575  // *=====> list_of_run_file_name is the name of the ASCII file containing the list of the runs
8576  //
8577  // SYNTAX OF THE FILE:
8578  //
8579  // HistoryRunList_EB_SM6_Analysis_1.ascii <- 1rst line: comment (file name for example)
8580  // 73677 <- 2nd line and others: run numbers (empty lines accepted)
8581  // 73688
8582  // 73689
8583  //
8584  // 73690
8585  // 73692
8586  //
8587  // In option SAME (of TEcnaHistos), several lists of runs can be called and these lists can have
8588  // DIFFERENT sizes (here the "size" is the number of runs of the list). In addition,
8589  // some runs in some lists may not exist in reality. So, we must adopt a convention which is
8590  // the following: the number of runs corresponds to the number of EXISTING runs
8591  // of the FIRST read list. Let be N1 this number.
8592  // If another list has more runs than N1 runs, we read only the first N1 runs.
8593  // If another list has less runs than N1 runs, we read all the runs of this list.
8594  //
8595  //--------------------------------------------------------------------------------------------------
8596 
8597  Int_t nb_of_runs_in_list = 0;
8598 
8599  //========= immediate return if file name is an empty string
8600  if( !strcmp(list_of_run_file_name.Data(), "\0") )
8601  {
8602  std::cout << "!TEcnaHistos::GetHistoryRunListParameters(...)> *** ERROR *** =====> "
8603  << " EMPTY STRING for list of run file name." << fTTBELL << std::endl;
8604  }
8605  else
8606  {
8607  // ===> increase the HistoryRunList file number
8608  if ( HistoCode == "H_Ped_Date" ){fNbOfListFileH_Ped_Date++;}
8609  if ( HistoCode == "H_TNo_Date" ){fNbOfListFileH_TNo_Date++;}
8610  if ( HistoCode == "H_MCs_Date" ){fNbOfListFileH_MCs_Date++;}
8611  if ( HistoCode == "H_LFN_Date" ){fNbOfListFileH_LFN_Date++;}
8612  if ( HistoCode == "H_HFN_Date" ){fNbOfListFileH_HFN_Date++;}
8613  if ( HistoCode == "H_SCs_Date" ){fNbOfListFileH_SCs_Date++;}
8614 
8615  if ( HistoCode == "H_Ped_RuDs" ){fNbOfListFileH_Ped_RuDs++;}
8616  if ( HistoCode == "H_TNo_RuDs" ){fNbOfListFileH_TNo_RuDs++;}
8617  if ( HistoCode == "H_MCs_RuDs" ){fNbOfListFileH_MCs_RuDs++;}
8618  if ( HistoCode == "H_LFN_RuDs" ){fNbOfListFileH_LFN_RuDs++;}
8619  if ( HistoCode == "H_HFN_RuDs" ){fNbOfListFileH_HFN_RuDs++;}
8620  if ( HistoCode == "H_SCs_RuDs" ){fNbOfListFileH_SCs_RuDs++;}
8621 
8622  fFapFileRuns = list_of_run_file_name.Data(); // (short name)
8623 
8624  //........... Add the path to the file name ( GetHistoryRunListParameters )
8625  TString xFileNameRunList = list_of_run_file_name.Data();
8626  const Text_t *t_file_name = (const Text_t *)xFileNameRunList.Data();
8627 
8628  //.............. replace the string "$HOME" by the true $HOME path
8629  if(fCfgHistoryRunListFilePath.BeginsWith("$HOME"))
8630  {
8631  fCfgHistoryRunListFilePath.Remove(0,5);
8632  const Text_t *t_file_nohome = (const Text_t *)fCfgHistoryRunListFilePath.Data(); // /scratch0/cna/...
8633 
8634  TString home_path = gSystem->Getenv("HOME");
8635  fCfgHistoryRunListFilePath = home_path; // /afs/cern.ch/u/USER
8636  fCfgHistoryRunListFilePath.Append(t_file_nohome); // /afs/cern.ch/u/USER/scratch0/cna/...
8637  }
8638 
8639  xFileNameRunList = fCfgHistoryRunListFilePath.Data();
8640 
8641  xFileNameRunList.Append('/');
8642  xFileNameRunList.Append(t_file_name);
8643 
8644  fFcin_f.open(xFileNameRunList.Data());
8645 
8646  //....................................... ( GetHistoryRunListParameters )
8647  if( fFcin_f.fail() == kFALSE )
8648  {
8649  //...................................... first reading to get the number of runs in the list
8650  fFcin_f.clear();
8651  std::string xHeadComment;
8652  fFcin_f >> xHeadComment;
8653  Int_t cRunNumber;
8654  Int_t list_size_read = 0;
8655 
8656  while( !fFcin_f.eof() ){fFcin_f >> cRunNumber; list_size_read++;}
8657  fFapNbOfRuns = list_size_read - 1;
8658 
8659  //...................................... second reading to get the run numbers
8660 
8661  //====== Return to the beginning of the file =====
8662  fFcin_f.clear();
8663  fFcin_f.seekg(0, std::ios::beg);
8664  //================================================
8665 
8666  std::string yHeadComment;
8667  fFcin_f >> yHeadComment;
8668 
8669  //....................... Set fFapMaxNbOfRuns to -1 at first call (first read file)
8670  //
8671  // fNbOfListFileEvolXXX is initialized to 0 in Init()
8672  // It is incremented once here above
8673  // So, at first call fNbOfListFileEvolXXX = 1
8674  // then fFapMaxNbOfRuns = -1
8675  //.......................................................................... (GetHistoryRunListParameters)
8676  if( (HistoCode == "H_Ped_Date" && fNbOfListFileH_Ped_Date == 1) ||
8677  (HistoCode == "H_TNo_Date" && fNbOfListFileH_TNo_Date == 1) ||
8678  (HistoCode == "H_MCs_Date" && fNbOfListFileH_MCs_Date == 1) ||
8679  (HistoCode == "H_LFN_Date" && fNbOfListFileH_LFN_Date == 1) ||
8680  (HistoCode == "H_HFN_Date" && fNbOfListFileH_HFN_Date == 1) ||
8681  (HistoCode == "H_SCs_Date" && fNbOfListFileH_SCs_Date == 1) ||
8682  (HistoCode == "H_Ped_RuDs" && fNbOfListFileH_Ped_RuDs == 1) ||
8683  (HistoCode == "H_TNo_RuDs" && fNbOfListFileH_TNo_RuDs == 1) ||
8684  (HistoCode == "H_MCs_RuDs" && fNbOfListFileH_MCs_RuDs == 1) ||
8685  (HistoCode == "H_LFN_RuDs" && fNbOfListFileH_LFN_RuDs == 1) ||
8686  (HistoCode == "H_HFN_RuDs" && fNbOfListFileH_HFN_RuDs == 1) ||
8687  (HistoCode == "H_SCs_RuDs" && fNbOfListFileH_SCs_RuDs == 1)){fFapMaxNbOfRuns = -1;}
8688 
8689  // first call: fFapMaxNbOfRuns = fFapNbOfRuns = nb of run from the first reading
8691  // next calls: fFapNbOfRuns must not be greater than fFapMaxNbOfRuns found at first time
8693 
8694  // Allocation and initialization of the array fT1DRunNumber[].
8695  //................. check maximum value for allocation
8697  {
8698  std::cout << "TEcnaHistos::GetHistoryRunListParameters(...)> Max number of runs in HistoryRunList = "
8699  << fFapMaxNbOfRuns
8700  << " too large, forced to parameter TEcnaParHistos->fMaxNbOfRunsInLists value (= "
8702  << "). Please, set this parameter to a larger value than " << fFapMaxNbOfRuns
8703  << fTTBELL << std::endl;
8705  }
8706  //................................. Alloc of the array and init
8707  if( fT1DRunNumber == nullptr )
8708  {
8709  if( fFapMaxNbOfRuns > 0 )
8710  {
8711  fT1DRunNumber = new Int_t[fFapMaxNbOfRuns]; fCnew++;
8712  }
8713  else
8714  {
8715  std::cout << "!TEcnaHistos::GetHistoryRunListParameters(...)> *** ERROR *** =====> fFapMaxNbOfRuns = "
8716  << fFapMaxNbOfRuns << ". Forced to 1." << fTTBELL << std::endl;
8717  fFapMaxNbOfRuns = 1;
8718  fT1DRunNumber = new Int_t[fFapMaxNbOfRuns]; fCnew++;
8719  }
8720  }
8721 
8722 
8723  //.................................... Init the list of runs
8724  for ( Int_t i_run = 0; i_run < fFapMaxNbOfRuns; i_run++ ){fT1DRunNumber[i_run] = -1;}
8725  //.................................... read the list of runs
8726  for (Int_t i_list = 0; i_list < fFapNbOfRuns; i_list++)
8727  {
8728  fFcin_f >> cRunNumber;
8729  fT1DRunNumber[i_list] = cRunNumber;
8730  }
8731  //........................................ ( GetHistoryRunListParameters )
8732  nb_of_runs_in_list = fFapNbOfRuns;
8733  fFcin_f.close();
8734  }
8735  else
8736  {
8737  fFcin_f.clear();
8738  std::cout << "!TEcnaHistos::GetHistoryRunListParameters(...)> *** ERROR *** =====> "
8739  << xFileNameRunList.Data() << " : file not found." << fTTBELL << std::endl;
8740  nb_of_runs_in_list = -1;
8741  }
8742  }
8743  return nb_of_runs_in_list;
8744 }
8745 // end of GetHistoryRunListParameters(...)
8746 
8747 //------------------------------------------------------------------------------------------------
8748 
8749 Int_t TEcnaHistos::GetListFileNumber(const TString& HistoCode)
8750 {
8751 // Get the number of the read list file
8752 
8753  Int_t number = 0;
8754 
8755  if ( HistoCode == "H_Ped_Date"){number = fNbOfListFileH_Ped_Date;}
8756  if ( HistoCode == "H_TNo_Date"){number = fNbOfListFileH_TNo_Date;}
8757  if ( HistoCode == "H_MCs_Date"){number = fNbOfListFileH_MCs_Date;}
8758  if ( HistoCode == "H_LFN_Date"){number = fNbOfListFileH_LFN_Date;}
8759  if ( HistoCode == "H_HFN_Date"){number = fNbOfListFileH_HFN_Date;}
8760  if ( HistoCode == "H_SCs_Date"){number = fNbOfListFileH_SCs_Date;}
8761  if ( HistoCode == "H_Ped_RuDs"){number = fNbOfListFileH_Ped_RuDs;}
8762  if ( HistoCode == "H_TNo_RuDs"){number = fNbOfListFileH_TNo_RuDs;}
8763  if ( HistoCode == "H_MCs_RuDs"){number = fNbOfListFileH_MCs_RuDs;}
8764  if ( HistoCode == "H_LFN_RuDs"){number = fNbOfListFileH_LFN_RuDs;}
8765  if ( HistoCode == "H_HFN_RuDs"){number = fNbOfListFileH_HFN_RuDs;}
8766  if ( HistoCode == "H_SCs_RuDs"){number = fNbOfListFileH_SCs_RuDs;}
8767  return number;
8768 }
8769 
8770 //--------------------------------------------------------------------------------------------------
8771 void TEcnaHistos::SetRunNumberFromList(const Int_t& xArgIndexRun, const Int_t& MaxNbOfRuns)
8772 {
8773  // Set run number for the xArgIndexRun_th run in the list of runs (evolution plots)
8774  // The array fT1DRunNumber[] have been obtained from a previous call
8775  // to GetHistoryRunListParameters(xFileNameRunList, HistoCode)
8776 
8777  if( xArgIndexRun >= 0 && xArgIndexRun < MaxNbOfRuns)
8778  {
8779  fFapRunNumber = fT1DRunNumber[xArgIndexRun];
8780  if( xArgIndexRun == 0 ){InitSpecParBeforeFileReading();} // SpecPar = Special Parameters (dates, times, run types)
8781  }
8782  else
8783  {
8784  std::cout << "!TEcnaHistos::SetRunNumberFromList(...)> **** ERROR **** Run index out of range in list of runs. xArgIndexRun = "
8785  << xArgIndexRun << " (MaxNbOfRuns = "<< MaxNbOfRuns << ")" << std::endl;
8786  }
8787 }
8788 
8789 //--------------------------------------------------------------------------------------------------
8791 {
8792  // Init parameters that will be set by reading the info which are in the results ROOT file
8793  // SpecPar = Special Parameters (dates, times, run types)
8794 
8795  Int_t MaxCar = fgMaxCar;
8796  fStartDate.Resize(MaxCar);
8797  fStartDate = "(date not found)";
8798 
8799  MaxCar = fgMaxCar;
8800  fStopDate.Resize(MaxCar);
8801  fStopDate = "(date not found)";
8802 
8803  fStartTime = (time_t)0;
8804  fStopTime = (time_t)0;
8805 
8806  fRunType = "(run type not found)";
8807 
8808 } // ------------- ( end of InitSpecParBeforeFileReading() ) -------------
8809 
8810 //======================================================================================
8811 //
8812 // 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
8813 //
8814 //======================================================================================
8815 
8817  const Int_t& StexStin_A, const Int_t& i0StinEcha, const Int_t& i0Sample,
8818  const TString& HistoCode)
8819 {
8820 // Check possibility to plot the histo
8821 
8822  Bool_t ok_view_histo = kFALSE;
8823 
8824  TString HistoType = fCnaParHistos->GetHistoType(HistoCode);
8825 
8826  TString root_file_name = aMyRootFile->GetRootFileNameShort();
8827 
8828  TVectorD vStin(fEcal->MaxStinEcnaInStex());
8829  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex() ; i++){vStin(i)=(Double_t)0.;}
8830  vStin = aMyRootFile->ReadStinNumbers(fEcal->MaxStinEcnaInStex());
8831 
8832  if( aMyRootFile->DataExist() == kTRUE )
8833  {
8834  fStatusDataExist = kTRUE;
8835 
8836  Int_t Stin_ok = 0;
8837  for (Int_t index_Stin = 0; index_Stin < fEcal->MaxStinEcnaInStex(); index_Stin++)
8838  {
8839  if ( vStin(index_Stin) == StexStin_A ){Stin_ok++;};
8840  }
8841 
8842  //.............................................. ok_view
8843  Int_t ok_view = 1;
8844 
8845  if( !( HistoType == "Global" || HistoType == "Proj" ) )
8846  {
8847  if( Stin_ok != 1)
8848  {
8849  Int_t StinNumber = StexStin_A;
8850  if( fFlagSubDet == "EE" )
8851  {StinNumber = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A);}
8852  std::cout << "!TEcnaHistos::GetOkViewHisto(...)> *ERROR* =====> " << "File: " << root_file_name
8853  << ", " << fFapStinName.Data() << " "
8854  << StinNumber
8855  << " not found. Available numbers = ";
8856  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
8857  {
8858  if( vStin(i) > 0 )
8859  {
8860  if( fFlagSubDet == "EB" ){std::cout << vStin(i) << ", ";}
8861  if( fFlagSubDet == "EE" )
8862  {std::cout << fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i)) << ", ";}
8863  }
8864  }
8865  std::cout << fTTBELL << std::endl;
8866  ok_view = -1;
8867  }
8868  else
8869  {
8870  ok_view = 1;
8871  }
8872  }
8873 
8874  //.............................................. ok_max_elt ( GetOkViewHisto(...) )
8875  Int_t ok_max_elt = 1;
8876 
8877  if( ( ( (HistoType == "H1Basic") || (HistoType == "Evol") || (HistoType == "EvolProj") )
8878  && (i0StinEcha >= 0) && (i0StinEcha<fEcal->MaxCrysInStin())
8879  && (i0Sample >= 0) && (i0Sample <fFapNbOfSamples ) ) ||
8880  !( (HistoType == "H1Basic") || (HistoType == "Evol") || (HistoType == "EvolProj") ))
8881  {ok_max_elt = 1;}
8882  else
8883  {
8884  Int_t Choffset = 0;
8885  if( fFlagSubDet == "EE" ){Choffset = 1;}
8886  if( ( (HistoType == "H1Basic") || (HistoType == "Evol") || (HistoType == "EvolProj") )
8887  && !( (i0StinEcha >= 0) && (i0StinEcha<fEcal->MaxCrysInStin()) ) )
8888  {std::cout << "!TEcnaHistos::GetOkViewHisto(...)> *ERROR* =====> " << "File: " << root_file_name
8889  << ". Wrong channel number. Value = " << i0StinEcha << " (required range: [" << Choffset << ", "
8890  << fEcal->MaxCrysInStin()-1+Choffset << "] )"
8891  << fTTBELL << std::endl;}
8892  if( (HistoCode == "D_Adc_EvDs" || HistoCode == "D_Adc_EvNb") &&
8893  !((i0Sample >= 0) && (i0Sample <fFapNbOfSamples)) )
8894  {std::cout << "!TEcnaHistos::GetOkViewHisto(...)> *ERROR* =====> " << "File: " << root_file_name
8895  << ". Wrong sample index. Value = " << i0Sample << " (required range: [0, "
8896  << fFapNbOfSamples-1 << "] )"
8897  << fTTBELL << std::endl;}
8898  ok_max_elt = -1;
8899  }
8900 
8901  if( (ok_view == 1) && (ok_max_elt == 1) )
8902  {
8903  ok_view_histo = kTRUE;
8904  }
8905  else
8906  {
8907  std::cout << "!TEcnaHistos::GetOkViewHisto(...)> At least one ERROR has been detected. ok_view = " << ok_view
8908  << ", ok_max_elt = " << ok_max_elt << fTTBELL << std::endl;
8909  }
8910  }
8911  else
8912  {
8913  fStatusDataExist = kFALSE;
8914 
8915  std::cout << "!TEcnaHistos::GetOkViewHisto(...)> No data in ROOT file "
8916  << ", aMyRootFile->DataExist() = " << aMyRootFile->DataExist() << fTTBELL << std::endl;
8917  }
8918  return ok_view_histo;
8919 }
8920 //..............................................................................................
8921 
8922 Int_t TEcnaHistos::SetHistoFrameYminYmaxFromMemo(TH1D* h_his0, const TString& HistoCode)
8923 {
8924 // Set min and max according to HistoCode
8925 
8926  // if Ymin = Ymax (or Ymin > Ymax): nothing done here
8927  // return xFlagAutoYsupMargin = 1
8928  //
8929  // if Ymin < Ymax: min and max calculated by h_his0->SetMinimum() and h_his0->SetMaximum()
8930  // return xFlagAutoYsupMargin = 0
8931 
8932  Int_t xFlagAutoYsupMargin = 1; // (SetHistoFrameYminYmaxFromMemo)
8933 
8934  if(HistoCode == "D_NOE_ChNb"){
8935  if(fD_NOE_ChNbYmin < fD_NOE_ChNbYmax){xFlagAutoYsupMargin = 0;
8936  h_his0->SetMinimum(fD_NOE_ChNbYmin); h_his0->SetMaximum(fD_NOE_ChNbYmax);}}
8937 
8938  if(HistoCode == "D_NOE_ChDs"){
8939  if(fD_NOE_ChDsYmin < fD_NOE_ChDsYmax){xFlagAutoYsupMargin = 0;
8940  h_his0->SetMinimum(fD_NOE_ChDsYmin); h_his0->SetMaximum(fD_NOE_ChDsYmax);}}
8941 
8942  if(HistoCode == "D_Ped_ChNb"){
8943  if(fD_Ped_ChNbYmin < fD_Ped_ChNbYmax){xFlagAutoYsupMargin = 0;
8944  h_his0->SetMinimum(fD_Ped_ChNbYmin); h_his0->SetMaximum(fD_Ped_ChNbYmax);}}
8945 
8946  if(HistoCode == "D_Ped_ChDs"){
8947  if(fD_Ped_ChDsYmin < fD_Ped_ChDsYmax){xFlagAutoYsupMargin = 0;
8948  h_his0->SetMinimum(fD_Ped_ChDsYmin); h_his0->SetMaximum(fD_Ped_ChDsYmax);}}
8949 
8950  if(HistoCode == "D_TNo_ChNb"){
8951  if(fD_TNo_ChNbYmin < fD_TNo_ChNbYmax){xFlagAutoYsupMargin = 0;
8952  h_his0->SetMinimum(fD_TNo_ChNbYmin); h_his0->SetMaximum(fD_TNo_ChNbYmax);}}
8953 
8954  if(HistoCode == "D_TNo_ChDs"){
8955  if(fD_TNo_ChDsYmin < fD_TNo_ChDsYmax){xFlagAutoYsupMargin = 0;
8956  h_his0->SetMinimum(fD_TNo_ChDsYmin); h_his0->SetMaximum(fD_TNo_ChDsYmax);}}
8957 
8958  if(HistoCode == "D_MCs_ChNb"){
8959  if(fD_MCs_ChNbYmin < fD_MCs_ChNbYmax){xFlagAutoYsupMargin = 0;
8960  h_his0->SetMinimum(fD_MCs_ChNbYmin); h_his0->SetMaximum(fD_MCs_ChNbYmax);}}
8961 
8962  if(HistoCode == "D_MCs_ChDs"){
8963  if(fD_MCs_ChDsYmin < fD_MCs_ChDsYmax){xFlagAutoYsupMargin = 0;
8964  h_his0->SetMinimum(fD_MCs_ChDsYmin); h_his0->SetMaximum(fD_MCs_ChDsYmax);}}
8965 
8966  if(HistoCode == "D_LFN_ChNb"){
8967  if(fD_LFN_ChNbYmin < fD_LFN_ChNbYmax){xFlagAutoYsupMargin = 0;
8968  h_his0->SetMinimum(fD_LFN_ChNbYmin); h_his0->SetMaximum(fD_LFN_ChNbYmax);}}
8969 
8970  if(HistoCode == "D_LFN_ChDs"){
8971  if(fD_LFN_ChDsYmin < fD_LFN_ChDsYmax){xFlagAutoYsupMargin = 0;
8972  h_his0->SetMinimum(fD_LFN_ChDsYmin); h_his0->SetMaximum(fD_LFN_ChDsYmax);}}
8973 
8974  if(HistoCode == "D_HFN_ChNb"){
8975  if(fD_HFN_ChNbYmin < fD_HFN_ChNbYmax){xFlagAutoYsupMargin = 0;
8976  h_his0->SetMinimum(fD_HFN_ChNbYmin); h_his0->SetMaximum(fD_HFN_ChNbYmax);}}
8977 
8978  if(HistoCode == "D_HFN_ChDs"){
8979  if(fD_HFN_ChDsYmin < fD_HFN_ChDsYmax){xFlagAutoYsupMargin = 0;
8980  h_his0->SetMinimum(fD_HFN_ChDsYmin); h_his0->SetMaximum(fD_HFN_ChDsYmax);}}
8981 
8982  if(HistoCode == "D_SCs_ChNb"){
8983  if(fD_SCs_ChNbYmin < fD_SCs_ChNbYmax){xFlagAutoYsupMargin = 0;
8984  h_his0->SetMinimum(fD_SCs_ChNbYmin); h_his0->SetMaximum(fD_SCs_ChNbYmax);}}
8985 
8986  if(HistoCode == "D_SCs_ChDs"){
8987  if(fD_SCs_ChDsYmin < fD_SCs_ChDsYmax){xFlagAutoYsupMargin = 0;
8988  h_his0->SetMinimum(fD_SCs_ChDsYmin); h_his0->SetMaximum(fD_SCs_ChDsYmax);}}
8989 
8990  if(HistoCode == "D_MSp_SpNb"){
8991  if(fD_MSp_SpNbYmin < fD_MSp_SpNbYmax){xFlagAutoYsupMargin = 0;
8992  h_his0->SetMinimum(fD_MSp_SpNbYmin); h_his0->SetMaximum(fD_MSp_SpNbYmax);}}
8993 
8994  if(HistoCode == "D_MSp_SpDs"){
8995  if(fD_MSp_SpDsYmin < fD_MSp_SpDsYmax){xFlagAutoYsupMargin = 0;
8996  h_his0->SetMinimum(fD_MSp_SpDsYmin); h_his0->SetMaximum(fD_MSp_SpDsYmax);}}
8997 
8998  if(HistoCode == "D_SSp_SpNb"){
8999  if(fD_SSp_SpNbYmin < fD_SSp_SpNbYmax){xFlagAutoYsupMargin = 0;
9000  h_his0->SetMinimum(fD_SSp_SpNbYmin); h_his0->SetMaximum(fD_SSp_SpNbYmax);}}
9001 
9002  if(HistoCode == "D_SSp_SpDs"){
9003  if(fD_SSp_SpDsYmin < fD_SSp_SpDsYmax){xFlagAutoYsupMargin = 0;
9004  h_his0->SetMinimum(fD_SSp_SpDsYmin); h_his0->SetMaximum(fD_SSp_SpDsYmax);}}
9005 
9006  if(HistoCode == "D_Adc_EvNb"){
9007  if(fD_Adc_EvNbYmin < fD_Adc_EvNbYmax){xFlagAutoYsupMargin = 0;
9008  h_his0->SetMinimum(fD_Adc_EvNbYmin); h_his0->SetMaximum(fD_Adc_EvNbYmax);}}
9009 
9010  if(HistoCode == "D_Adc_EvDs"){
9011  if(fD_Adc_EvDsYmin < fD_Adc_EvDsYmax){xFlagAutoYsupMargin = 0;
9012  h_his0->SetMinimum(fD_Adc_EvDsYmin); h_his0->SetMaximum(fD_Adc_EvDsYmax);}}
9013 
9014  if(HistoCode == "H2CorccInStins"){
9015  if(fH2CorccInStinsYmin < fH2CorccInStinsYmax){xFlagAutoYsupMargin = 0;
9016  h_his0->SetMinimum(fH2CorccInStinsYmin); h_his0->SetMaximum(fH2CorccInStinsYmax);}}
9017 
9018  if(HistoCode == "H2LFccMosMatrix"){
9019  if(fH2LFccMosMatrixYmin < fH2LFccMosMatrixYmax){xFlagAutoYsupMargin = 0;
9020  h_his0->SetMinimum(fH2LFccMosMatrixYmin); h_his0->SetMaximum(fH2LFccMosMatrixYmax);}}
9021 
9022  if(HistoCode == "H2HFccMosMatrix"){
9023  if(fH2HFccMosMatrixYmin < fH2HFccMosMatrixYmax){xFlagAutoYsupMargin = 0;
9024  h_his0->SetMinimum(fH2HFccMosMatrixYmin); h_his0->SetMaximum(fH2HFccMosMatrixYmax);}}
9025 
9026  if(HistoCode == "H_Ped_RuDs"){
9027  if(fH_Ped_RuDsYmin < fH_Ped_RuDsYmax){xFlagAutoYsupMargin = 0;
9028  h_his0->SetMinimum(fH_Ped_RuDsYmin); h_his0->SetMaximum(fH_Ped_RuDsYmax);}}
9029 
9030  if(HistoCode == "H_TNo_RuDs"){
9031  if(fH_TNo_RuDsYmin < fH_TNo_RuDsYmax){xFlagAutoYsupMargin = 0;
9032  h_his0->SetMinimum(fH_TNo_RuDsYmin); h_his0->SetMaximum(fH_TNo_RuDsYmax);}}
9033 
9034  if(HistoCode == "H_MCs_RuDs"){
9035  if(fH_MCs_RuDsYmin < fH_MCs_RuDsYmax){xFlagAutoYsupMargin = 0;
9036  h_his0->SetMinimum(fH_MCs_RuDsYmin); h_his0->SetMaximum(fH_MCs_RuDsYmax);}}
9037 
9038  if(HistoCode == "H_LFN_RuDs"){
9039  if(fH_LFN_RuDsYmin < fH_LFN_RuDsYmax){xFlagAutoYsupMargin = 0;
9040  h_his0->SetMinimum(fH_LFN_RuDsYmin); h_his0->SetMaximum(fH_LFN_RuDsYmax);}}
9041 
9042  if(HistoCode == "H_HFN_RuDs"){
9043  if(fH_HFN_RuDsYmin < fH_HFN_RuDsYmax){xFlagAutoYsupMargin = 0;
9044  h_his0->SetMinimum(fH_HFN_RuDsYmin); h_his0->SetMaximum(fH_HFN_RuDsYmax);}}
9045 
9046  if(HistoCode == "H_SCs_RuDs"){
9047  if(fH_SCs_RuDsYmin < fH_SCs_RuDsYmax){xFlagAutoYsupMargin = 0;
9048  h_his0->SetMinimum(fH_SCs_RuDsYmin); h_his0->SetMaximum(fH_SCs_RuDsYmax);}}
9049 
9050  return xFlagAutoYsupMargin;
9051 } // end of SetHistoFrameYminYmaxFromMemo
9052 
9053 Int_t TEcnaHistos::SetGraphFrameYminYmaxFromMemo(TGraph* g_graph0, const TString& HistoCode)
9054 {
9055 // Set min and max according to HistoCode
9056 
9057  Int_t xFlagAutoYsupMargin = 1; // DEFAULT: 1 = min and max calulated by ROOT, 0 = by this code
9058 
9059  if(HistoCode == "H_Ped_Date"){
9060  if(fH_Ped_DateYmin < fH_Ped_DateYmax){xFlagAutoYsupMargin = 0;
9061  g_graph0->SetMinimum(fH_Ped_DateYmin); g_graph0->SetMaximum(fH_Ped_DateYmax);}}
9062 
9063  if(HistoCode == "H_TNo_Date"){
9064  if(fH_TNo_DateYmin < fH_TNo_DateYmax){xFlagAutoYsupMargin = 0;
9065  g_graph0->SetMinimum(fH_TNo_DateYmin); g_graph0->SetMaximum(fH_TNo_DateYmax);}}
9066 
9067  if(HistoCode == "H_MCs_Date"){
9068  if(fH_MCs_DateYmin < fH_MCs_DateYmax){xFlagAutoYsupMargin = 0;
9069  g_graph0->SetMinimum(fH_MCs_DateYmin); g_graph0->SetMaximum(fH_MCs_DateYmax);}}
9070 
9071  if(HistoCode == "H_LFN_Date"){
9072  if(fH_LFN_DateYmin < fH_LFN_DateYmax){xFlagAutoYsupMargin = 0;
9073  g_graph0->SetMinimum(fH_LFN_DateYmin); g_graph0->SetMaximum(fH_LFN_DateYmax);}}
9074 
9075  if(HistoCode == "H_HFN_Date"){
9076  if(fH_HFN_DateYmin < fH_HFN_DateYmax){xFlagAutoYsupMargin = 0;
9077  g_graph0->SetMinimum(fH_HFN_DateYmin); g_graph0->SetMaximum(fH_HFN_DateYmax);}}
9078 
9079  if(HistoCode == "H_SCs_Date"){
9080  if(fH_SCs_DateYmin < fH_SCs_DateYmax){xFlagAutoYsupMargin = 0;
9081  g_graph0->SetMinimum(fH_SCs_DateYmin); g_graph0->SetMaximum(fH_SCs_DateYmax);}}
9082 
9083  return xFlagAutoYsupMargin;
9084 } // end of SetGraphFrameYminYmaxFromMemo
9085 
9086 //..............................................................................................
9087 Double_t TEcnaHistos::GetYminFromHistoFrameAndMarginValue(TH1D* h_his0, const Double_t margin_factor)
9088 {
9089 //Calculation for automatic minimum with margin
9090  Double_t minproj = h_his0->GetMinimum();
9091  Double_t maxproj = h_his0->GetMaximum();
9092  minproj = minproj - (maxproj-minproj)*margin_factor;
9093  return minproj;
9094 }
9095 
9096 Double_t TEcnaHistos::GetYmaxFromHistoFrameAndMarginValue(TH1D* h_his0, const Double_t margin_factor)
9097 {
9098 //Calculation for automatic maximum with margin
9099  Double_t minproj = h_his0->GetMinimum();
9100  Double_t maxproj = h_his0->GetMaximum();
9101  maxproj = maxproj + (maxproj-minproj)*margin_factor;
9102  return maxproj;
9103 }
9104 
9105 Double_t TEcnaHistos::GetYminFromGraphFrameAndMarginValue(TGraph* g_graph0, const Double_t margin_factor)
9106 {
9107 //Calculation for automatic minimum with margin
9108  Double_t graph_ymin = g_graph0->GetY()[0];
9109  for(Int_t i=1; i<g_graph0->GetN(); i++)
9110  {if( g_graph0->GetY()[i] < graph_ymin ){graph_ymin = g_graph0->GetY()[i];}}
9111 
9112  Double_t graph_ymax = g_graph0->GetY()[0];
9113  for(Int_t i=1; i<g_graph0->GetN(); i++)
9114  {if( g_graph0->GetY()[i] > graph_ymax ){graph_ymax = g_graph0->GetY()[i];}}
9115 
9116  graph_ymin = graph_ymin - (graph_ymax-graph_ymin)*margin_factor;
9117  return graph_ymin;
9118 }
9119 Double_t TEcnaHistos::GetYmaxFromGraphFrameAndMarginValue(TGraph* g_graph0, const Double_t margin_factor)
9120 {
9121 //Calculation for automatic maximum with margin
9122  Double_t graph_ymin = g_graph0->GetY()[0];
9123  for(Int_t i=1; i<g_graph0->GetN(); i++)
9124  {if( g_graph0->GetY()[i] < graph_ymin ){graph_ymin = g_graph0->GetY()[i];}}
9125 
9126  Double_t graph_ymax = g_graph0->GetY()[0];
9127  for(Int_t i=1; i<g_graph0->GetN(); i++)
9128  {if( g_graph0->GetY()[i] > graph_ymax ){graph_ymax = g_graph0->GetY()[i];}}
9129 
9130  graph_ymax = graph_ymax + (graph_ymax-graph_ymin)*margin_factor;
9131  return graph_ymax;
9132 }
9133 //----------------------------------------------- HistoPlot
9134 
9135 void TEcnaHistos::HistoPlot(TH1D* h_his0, const Int_t& HisSize,
9136  const Axis_t& xinf_his, const Axis_t& xsup_his,
9137  const TString& HistoCode, const TString& HistoType,
9138  const Int_t& StexStin_A, const Int_t& i0StinEcha, const Int_t& i0Sample,
9139  const Int_t& opt_scale_x, const Int_t& opt_scale_y,
9140  const TString& opt_plot, const Int_t& arg_AlreadyRead,
9141  const Int_t& xFlagAutoYsupMargin)
9142 {
9143  // Plot 1D histogram
9144 
9145  UInt_t canv_w = fCnaParHistos->SetCanvasWidth(HistoCode.Data(), opt_plot);
9146  UInt_t canv_h = fCnaParHistos->SetCanvasHeight(HistoCode.Data(), opt_plot);
9147 
9148  TString QuantityName = " ";
9149  Int_t MaxCar = fgMaxCar;
9150  QuantityName.Resize(MaxCar);
9151  QuantityName = fCnaParHistos->GetQuantityName(HistoCode.Data());
9152 
9153 
9154  if( arg_AlreadyRead == 0 || arg_AlreadyRead == 1 )
9155  {
9156  SetHistoPresentation(h_his0, HistoType.Data(), opt_plot); // (gStyle parameters)
9157  //.................................................. prepa paves commentaires (HistoPlot)
9158  SetAllPavesViewHisto(HistoCode.Data(), StexStin_A, i0StinEcha, i0Sample, opt_plot.Data(), arg_AlreadyRead);
9159  }
9160 
9161  //..................................................... Canvas name (HistoPlot)
9162  TString canvas_name = SetCanvasName(HistoCode.Data(), opt_scale_x, opt_scale_y,
9163  opt_plot.Data(), arg_AlreadyRead,
9164  StexStin_A, i0StinEcha, i0Sample);
9165  //..................................................... Canvas allocations (HistoPlot)
9166  TCanvas* MainCanvas = nullptr;
9167 
9168  if(opt_plot == fOnlyOnePlot && (arg_AlreadyRead == 0 || arg_AlreadyRead == 1 ) )
9169  {
9170  MainCanvas = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w , canv_h); fCnewRoot++;
9171  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();
9172  }
9173 
9174  if( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
9175  {if(GetMemoFlag(HistoCode, opt_plot) == "Free")
9176  {MainCanvas = CreateCanvas(HistoCode, opt_plot, canvas_name, canv_w, canv_h);
9177  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();}}
9178 
9179  // std::cout << "*TEcnaHistos::HistoPlot(...)> Plot is displayed on canvas ----> " << canvas_name.Data() << std::endl;
9180 
9181  //--------------- EE => SC for construction, EB => Xtal in SM (default: Stin ECNA number, i0StinEcha)
9182  Int_t Stex_StinCons = StexStin_A; // Stex_StinCons = Tower for EB, SC for construction for EE
9183  Int_t n1StexCrys = i0StinEcha+1; // n1StexCrys = Crys in SM for EB, ECNA
9184 
9185  if( StexStin_A >= 1 && StexStin_A <= fEcal->MaxStinEcnaInStex() )
9186  {
9187  if( fFlagSubDet == "EB" )
9188  {n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);}
9189  if( fFlagSubDet == "EE" )
9190  {Stex_StinCons = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A);}
9191  }
9192 
9193  //------ String for StexNumber ( to display "EB" or "EE" if Stex = 0 )
9194  TString sFapStexNumber = StexNumberToString(fFapStexNumber);
9195 
9196  //============================================================================= (HistoPlot)
9197  //
9198  // 1st OPERATIONS: Pave texts preparation and first Draw.
9199  // SetParametersCanvas
9200  // Set Memo Flags.
9201  // Set main_subpad and main_pavtxt
9202  //
9203  //=============================================================================
9204  TVirtualPad* main_subpad = nullptr; // main_subpad: Pad for the histo
9205  TPaveText* main_pavtxt = nullptr; // Pave for the "Several Changing" parameters (options SAME and SAME n)
9206 
9207  Int_t xMemoPlotSame = 1; // a priori ==> SAME plot
9208 
9209  //========================================= Option ONLYONE (HistoPlot)
9210  if( opt_plot == fOnlyOnePlot )
9211  {
9212  if( arg_AlreadyRead == 0 || arg_AlreadyRead == 1 )
9213  {
9214  //.................................... Draw titles and paves (pad = main canvas)
9215  if( fPavComGeneralTitle != nullptr ){fPavComGeneralTitle->Draw();}
9216  fPavComStex->Draw();
9217  if( !( HistoType == "Global" || HistoType == "Proj" ) ){fPavComStin->Draw(); fPavComXtal->Draw();}
9218 
9219  if( HistoType == "EvolProj" )
9220  {
9221  fPavComEvolRuns->Draw();
9222  fPavComEvolNbOfEvtsAna->Draw();
9223  }
9224  else
9225  {
9226  fPavComAnaRun->Draw();
9227  fPavComNbOfEvts->Draw();
9228  }
9229 
9230  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
9231  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
9232  Double_t y_low = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
9233  Double_t y_up = fCnaParHistos->BoxBottomY("top_right_box_EB") - 0.005;
9234  Color_t fond_pad = fCnaParHistos->ColorDefinition("blanc");
9235 
9236  Double_t x_margin = x_low;
9237  Double_t y_margin = y_low;
9238  MainCanvas->Divide( 1, 1, x_margin, y_margin, fond_pad);
9239  // Divide(nx, ny, x_margin, y_margin, color);
9240 
9241  gPad->cd(1);
9242  main_subpad = gPad;
9243  main_subpad->SetPad(x_low, y_low, x_up, y_up);
9244 
9245  xMemoPlotSame = 0;
9246  }
9247  if (arg_AlreadyRead > 1 )
9248  {main_subpad = fCurrentPad;}
9249 
9250  } // end of if(opt_plot == fOnlyOnePlot && (arg_AlreadyRead == 0 || arg_AlreadyRead == 1 ) )
9251 
9252  //========================================= Options SAME and SAME n (HistoPlot)
9253  if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
9254  {
9255  //..................... First call in options SAME and SAME n
9256  if( GetMemoFlag(HistoCode, opt_plot) == "Free" )
9257  {
9258  //Call to SetParametersPavTxt
9259  //fPavTxt<HISTOCODE> = fPavComSeveralChanging; => come from SetAllPavesViewHisto
9260  SetParametersPavTxt(HistoCode, opt_plot);
9261 
9262  //---------------- Call to ActivePavTxt
9263  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
9264  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
9265 
9266  //---------------------------- Set texts for pave "several changing", options SAME and SAME n
9267  if( fPavComGeneralTitle != nullptr ){fPavComGeneralTitle->Draw();}
9268 
9269  main_pavtxt->SetTextAlign(fTextPaveAlign);
9270  main_pavtxt->SetTextFont(fTextPaveFont);
9271  main_pavtxt->SetBorderSize(fTextBorderSize);
9272  Float_t cTextPaveSize = 0.025;
9273  if( HistoType == "H1Basic" || HistoType == "SampProj" || HistoType == "H1BasicProj" ||
9274  HistoType == "Proj" || HistoType == "EvolProj" )
9275  {cTextPaveSize = 0.025;}
9276  main_pavtxt->SetTextSize(cTextPaveSize);
9277 
9278  char* f_in = new char[fgMaxCar]; fCnew++;
9279 
9280  //------------------------------------------------------------ titles pave "several" (HistoPlot)
9281  TString DecalStexName = "";
9282  if( fFlagSubDet == "EB" ){DecalStexName = " ";}
9283  TString DecalStinName = "";
9284  if( fFlagSubDet == "EE" ){DecalStinName = " ";}
9285 
9286  TString sStexOrStasName = "";
9287  if( fFapStexNumber == 0 ){sStexOrStasName = " ";}
9288  if( fFapStexNumber != 0 ){sStexOrStasName = fFapStexName;}
9289 
9290  if( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot )
9291  {
9292  if( HistoType == "SampGlobal" )
9293  {sprintf(f_in, "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s %s%s %s %s Sample",
9294  DecalStexName.Data(), sStexOrStasName.Data(),
9295  DecalStinName.Data(), fFapStinName.Data(), fFapXtalName.Data(), fFapEchaName.Data());}
9296  if( HistoType == "SampProj" )
9297  {sprintf(f_in, "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s %s%s %s %s Sample",
9298  DecalStexName.Data(), sStexOrStasName.Data(),
9299  DecalStinName.Data(), fFapStinName.Data(), fFapXtalName.Data(), fFapEchaName.Data());}
9300  if( HistoType == "H1Basic" || HistoType == "H1BasicProj" )
9301  {sprintf(f_in, "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s %s%s %s %s",
9302  DecalStexName.Data(), sStexOrStasName.Data(),
9303  DecalStinName.Data(), fFapStinName.Data(), fFapXtalName.Data(), fFapEchaName.Data());}
9304  if((HistoType == "Global") || (HistoType == "Proj") )
9305  {sprintf(f_in, "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s",
9306  DecalStexName.Data(), sStexOrStasName.Data());}
9307 
9308  if( HistoType == "EvolProj" )
9309  {sprintf(f_in, "Analysis Samp Evts range Nb Evts %s%s %s%s %s %s",
9310  DecalStexName.Data(), sStexOrStasName.Data(),
9311  DecalStinName.Data(), fFapStinName.Data(), fFapXtalName.Data(), fFapEchaName.Data());}
9312  }
9313 
9314  TText* ttit = main_pavtxt->AddText(f_in);
9315  ttit->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
9316 
9317  //------------------------------------------------------------ values pave "several" (HistoPlot)
9318 
9319  //.................................... option SAME n only (HistoPlot)
9320  if( opt_plot == fSameOnePlot)
9321  {
9322  if( (HistoType == "Global") || (HistoType == "Proj") || (HistoType == "H1BasicProj") )
9323  {
9324  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s %-25s",
9327  sFapStexNumber.Data(), QuantityName.Data());
9328  }
9329 
9330  if( HistoType == "EvolProj" )
9331  {
9332  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%7d %-25s",
9334  sFapStexNumber.Data(), Stex_StinCons, n1StexCrys, i0StinEcha, QuantityName.Data());
9335  }
9336 
9337  } // end of if for option SAME n only
9338 
9339  //..................................... option SAME (HistoPlot)
9340  if( opt_plot == fSeveralPlot )
9341  {
9342  Int_t kSample = i0Sample+1; // Sample number range = [1,n<=10]
9343 
9344  if( HistoType == "SampGlobal" )
9345  {
9346  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d%6d",
9349  Stex_StinCons, n1StexCrys, i0StinEcha, kSample);
9350  }
9351  if( HistoType == "SampProj" )
9352  {
9353  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d%6d",
9356  Stex_StinCons, n1StexCrys, i0StinEcha, kSample);
9357  }
9358  if( HistoType == "H1Basic" || HistoType == "H1BasicProj" )
9359  {
9360  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d",
9363  Stex_StinCons, n1StexCrys, i0StinEcha);
9364  }
9365  if( (HistoType == "Global") || (HistoType == "Proj") )
9366  {
9367  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s",
9370  }
9371 
9372  if( HistoType == "EvolProj" )
9373  {
9374  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %4s%7d%5d%5d",
9375  fFapAnaType.Data(), fFapNbOfSamples,
9377  Stex_StinCons, n1StexCrys, i0StinEcha);
9378  }
9379  }
9380 
9381  TText* tt = main_pavtxt->AddText(f_in);
9382  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
9383 
9384  delete [] f_in; f_in = nullptr; fCdelete++;
9385 
9386  //---------------- Draw the "several changing" pave with its text in the Canvas (AT FIRST TIME)
9387  main_pavtxt->Draw();
9388  //---------------- Draw evol run pave if "EvolProj" (AT FIRST TIME)
9389  if( HistoType == "EvolProj" ){fPavComEvolRuns->Draw();}
9390 
9391  //---------------- Call to SetParametersCanvas
9392  //fImp<HISTOCODE> = (TCanvasImp*)fCanv<HISTOCODE>->GetCanvasImp();
9393  //fCanv<HISTOCODE>->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
9394  //fPad<HISTOCODE> = gPad;
9395  //fMemoPlot<HISTOCODE> = 1; =======> set MemoFlag to "Buzy"
9396  //fMemoColor<HISTOCODE> = 0;
9397  SetParametersCanvas(HistoCode, opt_plot);
9398 
9399  //---------------- Set xMemoPlotSame to 0
9400  xMemoPlotSame = 0;
9401  } // end of if( GetMemoFlag(HistoCode, opt_plot) == "Free" ) (HistoPlot)
9402 
9403  //.......... First and further calls in options SAME and SAME n (fMemoPlot<HISTOCODE> = 1)
9404  if(GetMemoFlag(HistoCode, opt_plot) == "Busy")
9405  {
9406  //---------------- Call to ActivePavTxt
9407  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
9408  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
9409 
9410  //---------------- Call to ActivePad
9411  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
9412 
9413  //---------------- Recover pointer to the current canvas
9414  MainCanvas = GetCurrentCanvas(HistoCode.Data(), opt_plot.Data());
9415  }
9416  } // end of if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
9417 
9418 
9419  //============================================================================= (HistoPlot)
9420  //
9421  // 2nd OPERATIONS: Write and Draw the parameter values in the
9422  // "several changing" pave (options SAME and SAME n)
9423  // and Draw Histo
9424  //=============================================================================
9425  if(main_subpad != nullptr)
9426  {
9427  if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
9428  {
9429  //------------------------------------------------------------ values
9430  if(xMemoPlotSame != 0)
9431  {
9432  // main_pavtxt = fPavComSeveralChanging = fPavTxt<HISTOCODE>
9433  main_pavtxt->SetTextAlign(fTextPaveAlign);
9434  main_pavtxt->SetTextFont(fTextPaveFont);
9435  main_pavtxt->SetBorderSize(fTextBorderSize);
9436  Float_t cTextPaveSize = 0.025;
9437  if( HistoType == "H1Basic" || HistoType == "SampProj"
9438  || HistoType == "Proj" || HistoType == "EvolProj" || HistoType == "H1BasicProj" )
9439  {cTextPaveSize = 0.025;}
9440  main_pavtxt->SetTextSize(cTextPaveSize);
9441 
9442  char* f_in = new char[fgMaxCar]; fCnew++;
9443 
9444  if( opt_plot == fSameOnePlot )
9445  {
9446  if( (HistoType == "Global") || (HistoType == "Proj") )
9447  {
9448  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s %-25s",
9451  sFapStexNumber.Data(), QuantityName.Data());
9452  }
9453 
9454  if( HistoType == "EvolProj" )
9455  {
9456  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%7d %-25s",
9457  fFapAnaType.Data(), fFapNbOfSamples,
9459  Stex_StinCons, n1StexCrys, i0StinEcha, QuantityName.Data());
9460  }
9461  }
9462 
9463  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
9464  {
9465  Int_t kSample = i0Sample+1; // Sample number range = [1,n<=10] (HistoPlot)
9466 
9467  if(HistoType == "SampGlobal" )
9468  {
9469  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d%6d",
9472  Stex_StinCons, n1StexCrys, i0StinEcha, kSample);
9473  }
9474  if( HistoType == "SampProj" )
9475  {
9476  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d%6d",
9479  Stex_StinCons, n1StexCrys, i0StinEcha, kSample);
9480  }
9481  if( HistoType == "H1Basic" || HistoType == "H1BasicProj")
9482  {
9483  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d",
9486  Stex_StinCons, n1StexCrys, i0StinEcha);
9487  }
9488  if( (HistoType == "Global") || (HistoType == "Proj") )
9489  {
9490  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s",
9493  }
9494 
9495  if( HistoType == "EvolProj" )
9496  {
9497  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %4s%7d%5d%5d",
9498  fFapAnaType.Data(), fFapNbOfSamples,
9500  sFapStexNumber.Data(), Stex_StinCons, n1StexCrys, i0StinEcha);
9501  }
9502  }
9503 
9504  TText *tt = main_pavtxt->AddText(f_in);
9505  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
9506  MainCanvas->cd(); gStyle->SetOptDate(0);
9507  main_pavtxt->Draw();
9508 
9509  delete [] f_in; f_in = nullptr; fCdelete++;
9510  }
9511 
9512  main_subpad->cd();
9513  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
9514  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
9515  Double_t y_low = fCnaParHistos->BoxTopY("several_plots_box") + 0.005;
9516  Double_t y_up = fCnaParHistos->BoxBottomY("general_comment") - 0.005;
9517  if( opt_plot == fSameOnePlot && HistoType == "EvolProj" )
9518  {y_up = fCnaParHistos->BoxBottomY("top_left_box_EB") - 0.005;}
9519  main_subpad->SetPad(x_low, y_low, x_up, y_up);
9520  } // end of if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
9521 
9522  //............................................ Style (HistoPlot)
9523  SetViewHistoColors(h_his0, HistoCode.Data(), opt_plot, arg_AlreadyRead);
9524 
9525  //................................. Set axis titles
9526  TString axis_x_var_name = SetHistoXAxisTitle(HistoCode);
9527  TString axis_y_var_name = SetHistoYAxisTitle(HistoCode);
9528  h_his0->GetXaxis()->SetTitle(axis_x_var_name);
9529  h_his0->GetYaxis()->SetTitle(axis_y_var_name);
9530 
9531  Int_t lin_scale = 0;
9532  Int_t log_scale = 1;
9533 
9534  if(opt_scale_x == fOptScaleLinx){gPad->SetLogx(lin_scale);}
9535  if(opt_scale_x == fOptScaleLogx){gPad->SetLogx(log_scale);}
9536  if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(lin_scale);}
9537  if(opt_scale_y == fOptScaleLogy){gPad->SetLogy(log_scale);}
9538 
9539  //---------------------------------------------------------------- Draw histo (HistoPlot)
9540  if(opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0 ){h_his0->DrawCopy();}
9541  if(opt_plot == fOnlyOnePlot && arg_AlreadyRead == 1 ){h_his0->DrawCopy();}
9542  if(opt_plot == fOnlyOnePlot && arg_AlreadyRead > 1 ){h_his0->DrawCopy("AHSAME");}
9543 
9544  if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
9545  {
9546  if(xMemoPlotSame == 0){h_his0->DrawCopy();}
9547  if(xMemoPlotSame != 0){h_his0->DrawCopy("SAME");}
9548  }
9549  //----------------------------------------------------------------
9550 
9551  //.................... Horizontal line at y=0 (HistoPlot)
9552  if( !( HistoCode == "D_Adc_EvDs" || HistoCode == "D_Adc_EvNb" ||
9553  HistoType == "Proj" || HistoType == "SampProj" ||
9554  HistoType == "EvolProj" || HistoType == "H1BasicProj" ) &&
9555  !( HistoType == "H1Basic" && arg_AlreadyRead == 0 ) )
9556  {
9557  Double_t yinf = h_his0->GetMinimum();
9558  Double_t ysup = h_his0->GetMaximum();
9559  if( yinf <= (Double_t)0. && ysup >= (Double_t)0. )
9560  {TLine* lin = new TLine(0.,0.,(Double_t)HisSize, 0.); fCnewRoot++;
9561  lin->Draw();}
9562  }
9563 
9564  if( ( opt_plot == fOnlyOnePlot )
9565  || ( (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) && xMemoPlotSame == 0 ) )
9566  {
9567  Double_t yinf = (Double_t)h_his0->GetMinimum();
9568  Double_t ysup = (Double_t)h_his0->GetMaximum();
9569 
9570  if(xFlagAutoYsupMargin == 1)
9571  {
9572  if( yinf >= ysup ){yinf = (Double_t)0.; ysup += ysup;} // ROOT default if ymin >= ymax
9573  Double_t MaxMarginFactor = (Double_t)0.05; // frame top line = 5% above the maximum
9574  ysup += (ysup-yinf)*MaxMarginFactor; // ROOT default if ymin < ymax
9575  }
9576 
9577  char* f_in = new char[fgMaxCar]; fCnew++;
9578 
9579  //.................... Vertical lines for Data sectors (EE Global plot only)
9580  if( fFlagSubDet == "EE" && fFapStexNumber == 0 )
9581  {
9582  //............................................................. Data Sectors (HistoPlot)
9583  Color_t coul_DS = fCnaParHistos->ColorDefinition("noir");
9584  Int_t DeeOffset = 0;
9585  for(Int_t n1Dee=1; n1Dee<=4; n1Dee++)
9586  {
9587  if( n1Dee == 4 ){DeeOffset = 0;}
9588  if( n1Dee == 3 ){DeeOffset = fEcal->MaxSCForConsInDee();} // 149
9589  if( n1Dee == 2 ){DeeOffset = 2*fEcal->MaxSCForConsInDee();} // 446
9590  if( n1Dee == 1 ){DeeOffset = 3*fEcal->MaxSCForConsInDee();} // 595
9591 
9592  Double_t ydee = ysup + (ysup-yinf)/(Double_t)15.;
9593  Double_t xBinDee = DeeOffset + fEcal->MaxSCForConsInDee()/(Double_t)2.;
9594  sprintf( f_in, "D%d", n1Dee );
9595  TText *text_Dee = new TText(xBinDee, ydee, f_in); fCnewRoot++;
9596  text_Dee->SetTextColor(coul_DS);
9597  text_Dee->SetTextSize((Double_t)0.04);
9598  text_Dee->Draw("SAME");
9599 
9600  Double_t DSLabelOffset = (Double_t)12;
9601 
9602  for(Int_t i=1; i<5; i++)
9603  {
9604  Int_t iDS = 0;
9605  if( n1Dee == 1 ){iDS = i;}
9606  if( n1Dee == 2 ){iDS = i+4;}
9607  if( n1Dee == 3 ){iDS = i+5;}
9608  if( n1Dee == 4 ){iDS = i+1;}
9609 
9610  Double_t xBinDS = DeeOffset + (Double_t)GetDSOffset(n1Dee, iDS)/fEcal->MaxCrysInSC();
9611  TLine* lin_DS = new TLine(xBinDS, yinf, xBinDS, ysup); fCnewRoot++;
9612  lin_DS->SetLineColor(coul_DS);
9613  lin_DS->SetLineWidth(1);
9614  lin_DS->SetLineStyle(2);
9615  lin_DS->Draw();
9616 
9617  if( n1Dee == 2 && i == 4 )
9618  {
9619  TLine* lin_DSp = new TLine(DeeOffset, yinf, DeeOffset, ysup); fCnewRoot++;
9620  lin_DSp->SetLineColor(coul_DS);
9621  lin_DSp->SetLineWidth(1);
9622  lin_DSp->SetLineStyle(2);
9623  lin_DSp->Draw();
9624  }
9625 
9626  Double_t yds = ysup + (ysup-yinf)/(Double_t)50.;
9627  Double_t xBinDSp = xBinDS + DSLabelOffset;
9628  Int_t nDS = iDS;
9629 
9630  sprintf( f_in, "S%d", nDS );
9631  TText *text_DS = new TText(xBinDSp, yds, f_in); fCnewRoot++;
9632  text_DS->SetTextColor(coul_DS);
9633  text_DS->SetTextSize((Double_t)0.03);
9634  text_DS->Draw("SAME");
9635  if( (n1Dee == 4 && i == 1) || (n1Dee == 2 && i == 4) )
9636  {
9637  if(n1Dee == 4){nDS = iDS-1;}
9638  if(n1Dee == 2){nDS = iDS+1;}
9639  sprintf( f_in, "S%d", nDS );
9640  TText *text_DS = new TText(xBinDS-1.75*DSLabelOffset, yds, f_in); fCnewRoot++;
9641  text_DS->SetTextColor(coul_DS);
9642  text_DS->SetTextSize((Double_t)0.03);
9643  text_DS->Draw("SAME");
9644  }
9645  }
9646  }
9647  }
9648 
9649  //........... Vertical lines for Data sectors and special SC's (EE only, Dee's Global plots) (HistoPlot)
9650  if( fFlagSubDet == "EE" && fFapStexNumber > 0 )
9651  {
9652  if( HistoType == "Global" )
9653  {
9654  Double_t ytext = yinf - (ysup-yinf)/8.5;
9655  //............................................................. Data Sectors
9656  Color_t coul_DS = fCnaParHistos->ColorDefinition("noir");
9657  for(Int_t i=1; i<5; i++)
9658  {
9659  Int_t iDS = 0;
9660  if( fFapStexNumber == 1 ){iDS = i;}
9661  if( fFapStexNumber == 2 ){iDS = i+4;}
9662  if( fFapStexNumber == 3 ){iDS = i+5;}
9663  if( fFapStexNumber == 4 ){iDS = i+1;}
9664 
9665  Double_t xBinDS = (Double_t)GetDSOffset(fFapStexNumber, iDS);
9666  TLine* lin_DS = new TLine(xBinDS, yinf, xBinDS, ysup); fCnewRoot++;
9667  lin_DS->SetLineColor(coul_DS);
9668  lin_DS->SetLineWidth(2);
9669  lin_DS->SetLineStyle(2);
9670  lin_DS->Draw();
9671  Double_t ytextds = ysup + (ysup-yinf)/30.;
9672  Double_t xBinDSNumber =
9673  xBinDS + fEcalNumbering->GetMaxSCInDS(iDS)*fEcal->MaxCrysInSC()/(Double_t)2.25;
9674  sprintf( f_in, "S%d", iDS );
9675  TText *text_DS = new TText(xBinDSNumber, ytextds, f_in); fCnewRoot++;
9676  text_DS->SetTextColor(coul_DS);
9677  text_DS->SetTextSize((Double_t)0.04);
9678  text_DS->Draw("SAME");
9679  if( ( (fFapStexNumber == 1 || fFapStexNumber == 2 ) && i == 4 ) ||
9680  ( (fFapStexNumber == 3 || fFapStexNumber == 4 ) && i == 1 ) )
9681  {
9682  Int_t iDSp = iDS;
9683  if( i == 4 ){iDSp = iDS+1;}
9684  if( i == 1 ){iDSp = iDS-1;}
9685  sprintf( f_in, "S%d", iDSp);
9686  Double_t xBinpDSNumber =
9687  xBinDSNumber - fEcalNumbering->GetMaxSCInDS(iDS)*fEcal->MaxCrysInSC();
9688  TText *text_DSp = new TText(xBinpDSNumber, ytextds, f_in); fCnewRoot++;
9689  text_DSp->SetTextColor(coul_DS);
9690  text_DSp->SetTextSize((Double_t)0.04);
9691  text_DSp->Draw("SAME");
9692  }
9693  }
9694  //.............................................................. Vertical lines for SC's
9695  // Trop serre. A garder en reserve.
9696  //for(Int_t i=0; i<fEcal->MaxSCForConsInDee(); i++)
9697  // {
9698  // Double_t xBinSC =(Double_t)(fEcal->MaxCrysInSC()*i);
9699  // TLine* lin_SC = new TLine(xBinSC, yinf, xBinSC, ysup); fCnewRoot++;
9700  // lin_SC->SetLineColor(coul_DS);
9701  // lin_SC->SetLineStyle(3);
9702  // lin_SC->Draw();
9703  // }
9704  //............................................................... Not connected SC's
9705  Color_t coul_notconnected = fCnaParHistos->ColorDefinition("bleu_fonce");
9706  for(Int_t i=1; i<=fEcal->NumberOfNotConnectedSCs(); i++)
9707  {
9708  Int_t index = 0;
9709  if( fFapStexNumber == 1 || fFapStexNumber == 3 ){index = 2*i - 1;}
9710  if( fFapStexNumber == 2 || fFapStexNumber == 4 ){index = 2*i;}
9711  //................. display of the not connected SC's numbers (+ vertical line)
9712  Double_t xBinNotConnectedSC = NotConnectedSCH1DBin(index);
9713  TLine* lin_notconnected =
9714  new TLine(xBinNotConnectedSC, yinf, xBinNotConnectedSC, ysup); fCnewRoot++;
9715  lin_notconnected->SetLineColor(coul_notconnected);
9716  lin_notconnected->SetLineStyle(3);
9717  lin_notconnected->Draw();
9718 
9719  Double_t xBinNotConnectedSCEnd = NotConnectedSCH1DBin(index)+fEcal->MaxCrysInSC();
9720  TLine* lin_notconnected_end =
9721  new TLine(xBinNotConnectedSCEnd, yinf, xBinNotConnectedSCEnd, ysup); fCnewRoot++;
9722  lin_notconnected_end->SetLineColor(coul_notconnected);
9723  lin_notconnected_end->SetLineStyle(3);
9724  lin_notconnected_end->Draw();
9725 
9726  //sprintf( f_in, "%d", GetNotConnectedSCForConsFromIndex(index) );
9727  sprintf( f_in, "%d", GetNotConnectedDSSCFromIndex(index) );
9728  TText *text_SC_NotConnected = new TText(xBinNotConnectedSC, ytext, f_in); fCnewRoot++;
9729  text_SC_NotConnected->SetTextAngle((Double_t)45.);
9730  text_SC_NotConnected->SetTextColor(coul_notconnected);
9731  text_SC_NotConnected->SetTextFont(42);
9732  text_SC_NotConnected->SetTextSize((Double_t)0.03);
9733  text_SC_NotConnected->Draw("SAME");
9734  }
9735  //Double_t xtext = xinf_his - (xsup_his-xinf_his)/8.;
9736  //Double_t ytextp = yinf - (ysup-yinf)/6.;
9737  //sprintf( f_in, "Special SC => ");
9738  //TText *text_legend_NotConnected = new TText(xtext, ytext, f_in); fCnewRoot++;
9739  //text_legend_NotConnected->SetTextColor(coul_notconnected);
9740  //text_legend_NotConnected->SetTextSize((Double_t)0.03);
9741  //text_legend_NotConnected->Draw("SAME");
9742 
9743  //............................................................... Not complete SC's
9744  Color_t coul_notcomplete = fCnaParHistos->ColorDefinition("rouge40");
9745  for(Int_t i=1; i<=fEcal->NumberOfNotCompleteSCs(); i++)
9746  {
9747  Int_t index = 0;
9748  if( fFapStexNumber == 1 || fFapStexNumber == 3 ){index = 2*i - 1;}
9749  if( fFapStexNumber == 2 || fFapStexNumber == 4 ){index = 2*i;}
9750  //................. display of the not complete SC's numbers (+ vertical line)
9751  Double_t xBinNotCompleteSC = NotCompleteSCH1DBin(index);
9752  TLine* lin_notcomplete =
9753  new TLine(xBinNotCompleteSC, yinf, xBinNotCompleteSC, ysup); fCnewRoot++;
9754  lin_notcomplete->SetLineColor(coul_notcomplete);
9755  lin_notcomplete->SetLineStyle(3);
9756  lin_notcomplete->Draw();
9757 
9758  Double_t xBinNotCompleteSCEnd = NotCompleteSCH1DBin(index)+fEcal->MaxCrysInSC();;
9759  TLine* lin_notcomplete_end =
9760  new TLine(xBinNotCompleteSCEnd, yinf, xBinNotCompleteSCEnd, ysup); fCnewRoot++;
9761  lin_notcomplete_end->SetLineColor(coul_notcomplete);
9762  lin_notcomplete_end->SetLineStyle(3);
9763  lin_notcomplete_end->Draw();
9764 
9765  sprintf( f_in, "%d", GetNotCompleteDSSCFromIndex(index) );
9766  // sprintf( f_in, "%d", GetNotCompleteSCForConsFromIndex(index) );
9767  TText *text_SC_NotComplete = new TText(xBinNotCompleteSC, ytext, f_in); fCnewRoot++;
9768  text_SC_NotComplete->SetTextAngle((Double_t)45.);
9769  text_SC_NotComplete->SetTextColor(coul_notcomplete);
9770  text_SC_NotComplete->SetTextFont(42);
9771  text_SC_NotComplete->SetTextSize((Double_t)0.03);
9772  text_SC_NotComplete->Draw("SAME");
9773  }
9774  //Double_t xtextp = xinf_his + (xsup_his-xinf_his)/15.;
9775  //sprintf( f_in, "Not complete SC");
9776  //TText *text_legend_NotComplete = new TText(xtextp, ytextp, f_in); fCnewRoot++;
9777  //text_legend_NotComplete->SetTextColor(coul_notcomplete);
9778  //text_legend_NotComplete->SetTextSize((Double_t)0.03);
9779  //text_legend_NotComplete->Draw("SAME");
9780  }
9781  }
9782  delete [] f_in; f_in = nullptr; fCdelete++;
9783  } // end of if( ( opt_plot == fOnlyOnePlot )
9784  // || ( (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) && xMemoPlotSame == 0 ) )
9785 
9786  //..............................................Top Axis (HistoPlot)
9787  Int_t min_value = 0;
9788  Int_t max_value = 0;
9789  if(HistoType == "Global")
9790  {
9791  if( fFapStexNumber > 0 )
9792  {
9793  //.......................... Axis for the Stin numbers and Data sectors (EE) numbers
9794  if( fFlagSubDet == "EB" )
9795  {
9796  min_value = 0;
9797  max_value = fEcal->MaxStinEcnaInStex() - 1;
9798  }
9799  if( fFlagSubDet == "EE" )
9800  {
9801  if( fFapStexNumber == 1 ){min_value = 1; max_value = 5;}
9802  if( fFapStexNumber == 2 ){min_value = 5; max_value = 9;}
9803  if( fFapStexNumber == 3 ){min_value = 5; max_value = 9;}
9804  if( fFapStexNumber == 4 ){min_value = 1; max_value = 5;}
9805  }
9806  }
9807  if( fFapStexNumber == 0 )
9808  {
9809  //.......................... Axis for the SM (EB) and Dee numbers (EE)
9810  if( fFlagSubDet == "EB" )
9811  {
9812  min_value = 0;
9813  max_value = fEcal->MaxStexInStas() - 1;
9814  }
9815  if( fFlagSubDet == "EE" )
9816  {
9817  min_value = 1;
9818  max_value = fEcal->MaxStexInStas();
9819  }
9820  }
9821  TopAxisForHistos(h_his0, opt_plot, xMemoPlotSame, min_value, max_value,
9822  xFlagAutoYsupMargin, HisSize);
9823  } // end of if (HistoType == "Global")
9824 
9825  if( !( (HistoType == "H1Basic" || HistoType == "H1BasicProj")
9826  && ( arg_AlreadyRead > 1 && arg_AlreadyRead < fEcal->MaxCrysInStin() ) ) )
9827  {
9828  gPad->Update();
9829  }
9830  }
9831  else // else du if(main_subpad !=0)
9832  {
9833  std::cout << "*TEcnaHistos::HistoPlot(...)> Canvas not found. Previously closed in option SAME."
9834  << fTTBELL << std::endl;
9835 
9836  ReInitCanvas(HistoCode, opt_plot);
9837  xMemoPlotSame = 0;
9838  }
9839 
9840  // delete MainCanvas; fCdeleteRoot++;
9841 
9842 } // end of HistoPlot
9843 
9844 
9845 TString TEcnaHistos::StexNumberToString(const Int_t& StexNumber)
9846 {
9847  // Convert Int_t StexNumber into TString: "StexNumber" if StexNumber in [-18,36]
9848  // or into TString: "EB" or "EE" if StexNumber = 0.
9849 
9850  TString sFapStexNumber = "?";
9851  if( StexNumber == -1 ){sFapStexNumber = " -1";}
9852  if( StexNumber == -2 ){sFapStexNumber = " -2";}
9853  if( StexNumber == -3 ){sFapStexNumber = " -3";}
9854  if( StexNumber == -4 ){sFapStexNumber = " -4";}
9855  if( StexNumber == -5 ){sFapStexNumber = " -5";}
9856  if( StexNumber == -6 ){sFapStexNumber = " -6";}
9857  if( StexNumber == -7 ){sFapStexNumber = " -7";}
9858  if( StexNumber == -8 ){sFapStexNumber = " -8";}
9859  if( StexNumber == -9 ){sFapStexNumber = " -9";}
9860  if( StexNumber == -10 ){sFapStexNumber = "-10";}
9861  if( StexNumber == -11 ){sFapStexNumber = "-11";}
9862  if( StexNumber == -12 ){sFapStexNumber = "-12";}
9863  if( StexNumber == -13 ){sFapStexNumber = "-13";}
9864  if( StexNumber == -14 ){sFapStexNumber = "-14";}
9865  if( StexNumber == -15 ){sFapStexNumber = "-15";}
9866  if( StexNumber == -16 ){sFapStexNumber = "-16";}
9867  if( StexNumber == -17 ){sFapStexNumber = "-17";}
9868  if( StexNumber == -18 ){sFapStexNumber = "-18";}
9869  if( StexNumber == 0 ){sFapStexNumber = fFlagSubDet;}
9870  if( StexNumber == 1 ){sFapStexNumber = " 1";}
9871  if( StexNumber == 2 ){sFapStexNumber = " 2";}
9872  if( StexNumber == 3 ){sFapStexNumber = " 3";}
9873  if( StexNumber == 4 ){sFapStexNumber = " 4";}
9874  if( StexNumber == 5 ){sFapStexNumber = " 5";}
9875  if( StexNumber == 6 ){sFapStexNumber = " 6";}
9876  if( StexNumber == 7 ){sFapStexNumber = " 7";}
9877  if( StexNumber == 8 ){sFapStexNumber = " 8";}
9878  if( StexNumber == 9 ){sFapStexNumber = " 9";}
9879  if( StexNumber == 10 ){sFapStexNumber = " 10";}
9880  if( StexNumber == 11 ){sFapStexNumber = " 11";}
9881  if( StexNumber == 12 ){sFapStexNumber = " 12";}
9882  if( StexNumber == 13 ){sFapStexNumber = " 13";}
9883  if( StexNumber == 14 ){sFapStexNumber = " 14";}
9884  if( StexNumber == 15 ){sFapStexNumber = " 15";}
9885  if( StexNumber == 16 ){sFapStexNumber = " 16";}
9886  if( StexNumber == 17 ){sFapStexNumber = " 17";}
9887  if( StexNumber == 18 ){sFapStexNumber = " 18";}
9888  if( StexNumber == 19 ){sFapStexNumber = " -1";}
9889  if( StexNumber == 20 ){sFapStexNumber = " -2";}
9890  if( StexNumber == 21 ){sFapStexNumber = " -3";}
9891  if( StexNumber == 22 ){sFapStexNumber = " -4";}
9892  if( StexNumber == 23 ){sFapStexNumber = " -5";}
9893  if( StexNumber == 24 ){sFapStexNumber = " -6";}
9894  if( StexNumber == 25 ){sFapStexNumber = " -7";}
9895  if( StexNumber == 26 ){sFapStexNumber = " -8";}
9896  if( StexNumber == 27 ){sFapStexNumber = " -9";}
9897  if( StexNumber == 28 ){sFapStexNumber = "-10";}
9898  if( StexNumber == 29 ){sFapStexNumber = "-11";}
9899  if( StexNumber == 30 ){sFapStexNumber = "-12";}
9900  if( StexNumber == 31 ){sFapStexNumber = "-13";}
9901  if( StexNumber == 32 ){sFapStexNumber = "-14";}
9902  if( StexNumber == 33 ){sFapStexNumber = "-15";}
9903  if( StexNumber == 34 ){sFapStexNumber = "-16";}
9904  if( StexNumber == 35 ){sFapStexNumber = "-17";}
9905  if( StexNumber == 36 ){sFapStexNumber = "-18";}
9906  return sFapStexNumber;
9907 }
9908 
9910 {
9911  // gives the x coordinate for the i_th NotConnected SC
9912  // GetDSOffset(DeeNumber, DataSector) , GetSCOffset(DeeNumber, DataSector, SC_in_DS)
9913 
9914  Double_t xbin = (Double_t)(-1);
9915 
9916  if( index == 1 ){xbin = GetDSOffset(1,1)+GetSCOffset(1,1, 30);} // nb_for_cons == 182 (D1,S1) (D3,S9)
9917  if( index == 2 ){xbin = GetDSOffset(2,9)+GetSCOffset(2,9, 30);} // nb_for_cons == 33 (D2,S9) (D4,S1)
9918 
9919  if( index == 3 ){xbin = GetDSOffset(1,2)+GetSCOffset(1,2, 3);} // nb_for_cons == 178 (D1,S2) (D3,S8)
9920  if( index == 4 ){xbin = GetDSOffset(2,8)+GetSCOffset(2,8, 3);} // nb_for_cons == 29 (D2,S8) (D4,S2)
9921 
9922  if( index == 5 ){xbin = GetDSOffset(1,2)+GetSCOffset(1,2, 25);} // nb_for_cons == 207 (D1,S2) (D3,S8)
9923  if( index == 6 ){xbin = GetDSOffset(2,8)+GetSCOffset(2,8, 25);} // nb_for_cons == 58 (D2,S8) (D4,S2)
9924 
9925  if( index == 7 ){xbin = GetDSOffset(1,3)+GetSCOffset(1,3, 34);} // nb_for_cons == 298 (D1,S3) (D3,S7)
9926  if( index == 8 ){xbin = GetDSOffset(2,7)+GetSCOffset(2,7, 34);} // nb_for_cons == 149 (D2,S7) (D4,S3)
9927 
9928  if( index == 9 ){xbin = GetDSOffset(1,4)+GetSCOffset(1,4, 14);} // nb_for_cons == 261 (D1,S4) (D3,S6)
9929  if( index == 10 ){xbin = GetDSOffset(2,6)+GetSCOffset(2,6, 14);} // nb_for_cons == 112 (D2,S6) (D4,S4)
9930  if( index == 11 ){xbin = GetDSOffset(1,4)+GetSCOffset(1,4, 21);} // nb_for_cons == 268 (D1,S4) (D3,S6)
9931  if( index == 12 ){xbin = GetDSOffset(2,6)+GetSCOffset(2,6, 21);} // nb_for_cons == 119 (D2,S6) (D4,S4)
9932 
9933  if( index == 13 ){xbin = GetDSOffset(1,5)+GetSCOffset(1,5, 20);} // nb_for_cons == 281 (D1,S5) (D3,S5)
9934  if( index == 14 ){xbin = GetDSOffset(2,5)+GetSCOffset(2,5, 3);} // nb_for_cons == 132 (D2,S5) (D4,S5)
9935 
9936  return xbin;
9937 }
9938 
9940 {
9941  // gives the x coordinate for the i_th NotConnected SC
9942 
9943  Double_t xbin = (Double_t)(-1);
9944 
9945  if( index == 1 ){xbin = GetDSOffset(1,1)+GetSCOffset(1,1, 12);} // nb_for_cons == 161 (D1,S1) (D3,S9)
9946  if( index == 2 ){xbin = GetDSOffset(2,9)+GetSCOffset(2,9, 12);} // nb_for_cons == 12 (D2,S9) (D4,S1)
9947 
9948  if( index == 3 ){xbin = GetDSOffset(1,2)+GetSCOffset(1,2, 32);} // nb_for_cons == 216 (D1,S2) (D3,S8)
9949  if( index == 4 ){xbin = GetDSOffset(2,8)+GetSCOffset(2,8, 32);} // nb_for_cons == 67 (D2,S8) (D4,S2)
9950 
9951  if( index == 5 ){xbin = GetDSOffset(1,3)+GetSCOffset(1,3, 10);} // nb_for_cons == 224 (D1,S3) (D3,S7)
9952  if( index == 6 ){xbin = GetDSOffset(2,7)+GetSCOffset(2,7, 10);} // nb_for_cons == 75 (D2,S7) (D4,S3)
9953 
9954  if( index == 7 ){xbin = GetDSOffset(1,5)+GetSCOffset(1,5, 23);} // nb_for_cons == 286 (D1,S5) (D3,S5)
9955  if( index == 8 ){xbin = GetDSOffset(2,5)+GetSCOffset(2,5, 6);} // nb_for_cons == 137 (D2,S5) (D4,S5)
9956 
9957  return xbin;
9958 }
9959 
9961 {
9962 
9963  Int_t SCForCons = 0;
9964  if( index == 1 ){SCForCons = 182;} // (D1,S1) (D3,S9)
9965  if( index == 2 ){SCForCons = 33;} // (D2,S9) (D4,S1)
9966 
9967  if( index == 3 ){SCForCons = 178;} // (D1,S2) (D3,S8)
9968  if( index == 4 ){SCForCons = 29;} // (D2,S8) (D4,S2)
9969  if( index == 5 ){SCForCons = 207;} // (D1,S2) (D3,S8)
9970  if( index == 6 ){SCForCons = 58;} // (D2,S8) (D4,S2)
9971 
9972  if( index == 7 ){SCForCons = 298;} // (D1,S3) (D3,S7)
9973  if( index == 8 ){SCForCons = 149;} // (D2,S7) (D4,S3)
9974 
9975  if( index == 9 ){SCForCons = 261;} // (D1,S4) (D3,S6)
9976  if( index == 10 ){SCForCons = 112;} // (D2,S6) (D4,S4)
9977  if( index == 11 ){SCForCons = 268;} // (D1,S4) (D3,S6)
9978  if( index == 12 ){SCForCons = 119;} // (D2,S6) (D4,S4)
9979 
9980  if( index == 13 ){SCForCons = 281;} // (D1,S5) (D3,S5)
9981  if( index == 14 ){SCForCons = 132;} // (D2,S5) (D4,S5)
9982  return SCForCons;
9983 }
9984 
9986 {
9987 
9988  Int_t DSSC = 0;
9989  if( index == 1 ){DSSC = 30;} // (D1,S1) (D3,S9)
9990  if( index == 2 ){DSSC = 30;} // (D2,S9) (D4,S1)
9991 
9992  if( index == 3 ){DSSC = 3;} // (D1,S2) (D3,S8)
9993  if( index == 4 ){DSSC = 3;} // (D2,S8) (D4,S2)
9994  if( index == 5 ){DSSC = 25;} // (D1,S2) (D3,S8)
9995  if( index == 6 ){DSSC = 25;} // (D2,S8) (D4,S2)
9996 
9997  if( index == 7 ){DSSC = 34;} // (D1,S3) (D3,S7)
9998  if( index == 8 ){DSSC = 34;} // (D2,S7) (D4,S3)
9999 
10000  if( index == 9 ){DSSC = 14;} // (D1,S4) (D3,S6)
10001  if( index == 10 ){DSSC = 14;} // (D2,S6) (D4,S4)
10002  if( index == 11 ){DSSC = 21;} // (D1,S4) (D3,S6)
10003  if( index == 12 ){DSSC = 21;} // (D2,S6) (D4,S4)
10004 
10005  if( index == 13 ){DSSC = 20;} // (D1,S5) (D3,S5)
10006  if( index == 14 ){DSSC = 3;} // (D2,S5) (D4,S5)
10007  return DSSC;
10008 }
10009 
10010 
10012 {
10013 
10014  Int_t DSSC = 0;
10015  if( index == 1 ){DSSC = 161;} // (D1,S1) (D3,S9)
10016  if( index == 2 ){DSSC = 12;} // (D2,S9) (D4,S1)
10017 
10018  if( index == 3 ){DSSC = 216;} // (D1,S2) (D3,S8)
10019  if( index == 4 ){DSSC = 67;} // (D2,S8) (D4,S2)
10020 
10021  if( index == 5 ){DSSC = 224;} // (D1,S3) (D3,S7)
10022  if( index == 6 ){DSSC = 75;} // (D2,S7) (D4,S3)
10023 
10024  if( index == 7 ){DSSC = 286;} // (D1,S5) (D3,S5)
10025  if( index == 8 ){DSSC = 137;} // (D2,S5) (D4,S5)
10026  return DSSC;
10027 }
10028 
10030 {
10031 
10032  Int_t DSSC = 0;
10033  if( index == 1 ){DSSC = 12;} // (D1,S1) (D3,S9)
10034  if( index == 2 ){DSSC = 12;} // (D2,S9) (D4,S1)
10035 
10036  if( index == 3 ){DSSC = 32;} // (D1,S2) (D3,S8)
10037  if( index == 4 ){DSSC = 32;} // (D2,S8) (D4,S2)
10038 
10039  if( index == 5 ){DSSC = 10;} // (D1,S3) (D3,S7)
10040  if( index == 6 ){DSSC = 10;} // (D2,S7) (D4,S3)
10041 
10042  if( index == 7 ){DSSC = 23;} // (D1,S5) (D3,S5)
10043  if( index == 8 ){DSSC = 6;} // (D2,S5) (D4,S5)
10044  return DSSC;
10045 }
10046 //----------------------------------------------- HistimePlot
10047 void TEcnaHistos::HistimePlot(TGraph* g_graph0,
10048  Axis_t xinf, Axis_t xsup,
10049  const TString& HistoCode, const TString& HistoType,
10050  const Int_t& StexStin_A, const Int_t& i0StinEcha, const Int_t& i0Sample,
10051  const Int_t& opt_scale_x, const Int_t& opt_scale_y,
10052  const TString& opt_plot, const Int_t& xFlagAutoYsupMargin)
10053 {
10054  // Plot 1D histogram for evolution in time
10055 
10056  UInt_t canv_w = fCnaParHistos->SetCanvasWidth(HistoCode, opt_plot);
10057  UInt_t canv_h = fCnaParHistos->SetCanvasHeight(HistoCode, opt_plot);
10058 
10059  SetGraphPresentation(g_graph0, HistoType.Data(), opt_plot.Data()); // (gStyle parameters)}
10060 
10061  //...................................................... paves commentaires (HistimePlot)
10062  SetAllPavesViewHisto(HistoCode, StexStin_A, i0StinEcha, i0Sample, opt_plot);
10063 
10064  //..................................................... Canvas name (HistimePlot)
10065  Int_t arg_AlreadyRead = 0;
10066  TString canvas_name = SetCanvasName(HistoCode.Data(), opt_scale_x, opt_scale_y, opt_plot, arg_AlreadyRead,
10067  StexStin_A, i0StinEcha, i0Sample);
10068 
10069  //------------------------------------------------ Canvas allocation (HistimePlot)
10070  //......................................... declarations canvas et pad
10071  TCanvas* MainCanvas = nullptr;
10072 
10073  if( opt_plot == fOnlyOnePlot )
10074  {MainCanvas = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w , canv_h); fCnewRoot++;
10075  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();}
10076 
10077  if( opt_plot == fSeveralPlot )
10078  {
10079  if(GetMemoFlag(HistoCode, opt_plot) == "Free")
10080  {
10081  MainCanvas = CreateCanvas(HistoCode, opt_plot, canvas_name, canv_w, canv_h);
10082  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();
10083  }
10084  }
10085 
10086  if( opt_plot == fSameOnePlot )
10087  {
10088  if(GetMemoFlag(HistoCode, opt_plot) == "Free")
10089  {
10090  MainCanvas = CreateCanvas(HistoCode, opt_plot, canvas_name, canv_w, canv_h);
10091  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();
10092  }
10093  }
10094 
10095  // std::cout << "*TEcnaHistos::HistimePlot(...)> Plot is displayed on canvas ----> " << canvas_name.Data() << std::endl;
10096 
10097  //--------------- EE => SC for construction, EB => Xtal in SM (default: Stin ECNA number, i0StinEcha)
10098  Int_t Stex_StinCons = StexStin_A; // Stex_StinCons = Tower for EB, SC for construction for EE
10099  Int_t n1StexCrys = i0StinEcha+1; // n1StexCrys = Crys in SM for EB
10100 
10101  if( StexStin_A >= 1 && StexStin_A <= fEcal->MaxStinEcnaInStex() )
10102  {
10103  if( fFlagSubDet == "EB" )
10104  {n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);}
10105  if( fFlagSubDet == "EE" )
10106  {Stex_StinCons = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A);}
10107  }
10108 
10109  //------ String for StexNumber ( to display "EB" or "EE" if Stex = 0 )
10110  TString sFapStexNumber = StexNumberToString(fFapStexNumber);
10111 
10112  //============================================================================= (HistimePlot)
10113  //
10114  // 1st OPERATIONS: Pave texts preparation and first Draw.
10115  // SetParametersCanvas
10116  // Set Memo Flags.
10117  // Set main_subpad and main_pavtxt
10118  //
10119  //=============================================================================
10120  TVirtualPad* main_subpad = nullptr; // main_subpad: Pad for the histo
10121  TPaveText* main_pavtxt = nullptr; // main_pavtxt: pave for changing parameters
10122 
10123  Int_t xMemoPlotSame = 1; // a priori ==> SAME plot
10124 
10125  TString QuantityName = fCnaParHistos->GetQuantityName(HistoCode.Data());
10126 
10127  //========================================= Option ONLYONE (HistimePlot)
10128  if( opt_plot == fOnlyOnePlot )
10129  {
10130  //................................. Draw titles and paves (pad = main canvas)
10131  if( fPavComGeneralTitle != nullptr ){fPavComGeneralTitle->Draw();}
10132  fPavComStex->Draw();
10133 
10134  if( !( HistoType == "Global" || HistoType == "Proj" ) )
10135  {
10136  fPavComStin->Draw();
10137  fPavComXtal->Draw();
10138  }
10139  fPavComEvolNbOfEvtsAna->Draw();
10140  fPavComEvolRuns->Draw();
10141 
10142  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
10143  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
10144  Double_t y_low = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
10145  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_EB") - 0.005;
10146 
10147  Double_t x_margin = x_low;
10148  Double_t y_margin = y_low;
10149 
10150  Color_t fond_pad = fCnaParHistos->ColorDefinition("gris18");
10151 
10152  MainCanvas->Divide( 1, 1, x_margin, y_margin, fond_pad);
10153  // Divide(nx, ny, x_margin, y_margin, color);
10154 
10155  gPad->cd(1);
10156  main_subpad = gPad;
10157  main_subpad->SetPad(x_low, y_low, x_up, y_up);
10158 
10159  xMemoPlotSame = 0;
10160  }
10161  //========================================= Options SAME and SAME n (HistimePlot)
10162  if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
10163  {
10164  if(GetMemoFlag(HistoCode, opt_plot) == "Free")
10165  {
10166  if( fPavComGeneralTitle != nullptr ){fPavComGeneralTitle->Draw();}
10167  fPavComSeveralChanging->Draw();
10168 
10169  fPavComEvolRuns->Draw();
10170 
10171  if( !( HistoType == "Global" || HistoType == "Proj" ||
10172  HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10173  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date") )
10174  {
10175  fPavComStin->Draw();
10176  fPavComXtal->Draw();
10177  }
10178 
10179  if( !( HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10180  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ) )
10181  {
10182  fPavComXtal->Draw();
10183  }
10184  //Call to SetParametersPavTxt
10185  //fPavTxt<HISTOCODE> = fPavComSeveralChanging; => come from SetAllPavesViewHisto
10186  SetParametersPavTxt(HistoCode, opt_plot);
10187 
10188  //---------------- Call to ActivePavTxt
10189  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
10190  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
10191 
10192  //-------------------- Set texts for pave "several changing", options SAME and SAME n (HistimePlot)
10193  main_pavtxt->SetTextAlign(fTextPaveAlign);
10194  main_pavtxt->SetTextFont(fTextPaveFont);
10195  main_pavtxt->SetTextSize(fTextPaveSize);
10196  main_pavtxt->SetBorderSize(fTextBorderSize);
10197 
10198  char* f_in = new char[fgMaxCar]; fCnew++;
10199 
10200  TString DecalStexName = "";
10201  if( fFlagSubDet == "EB" ){DecalStexName = " ";}
10202  TString DecalStinName = "";
10203  if( fFlagSubDet == "EE" ){DecalStinName = " ";}
10204 
10205  TString sStexOrStasName = "";
10206  if( fFapStexNumber == 0 ){sStexOrStasName = " ";}
10207  if( fFapStexNumber != 0 ){sStexOrStasName = fFapStexName;}
10208 
10209 
10210  //-----------------------------> HistoType = "EvolProj" => treated in HistoPlot, not here.
10211  if(opt_plot == fSeveralPlot)
10212  {
10213  sprintf(f_in, "Analysis Samp Evts range Nb Evts %s%s %s%s %s %s",
10214  DecalStexName.Data(), sStexOrStasName.Data(),
10215  DecalStinName.Data(), fFapStinName.Data(), fFapXtalName.Data(), fFapEchaName.Data());
10216  }
10217  if(opt_plot == fSameOnePlot)
10218  {
10219  sprintf(f_in, "Analysis Samp Evts range Nb Evts %s%s %s%s %s %s",
10220  DecalStexName.Data(), sStexOrStasName.Data(),
10221  DecalStinName.Data(), fFapStinName.Data(), fFapXtalName.Data(), fFapEchaName.Data());
10222  }
10223 
10224  //................................................................... (HistimePlot)
10225  TText* ttit = main_pavtxt->AddText(f_in);
10226  ttit->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10227 
10228  if(opt_plot == fSeveralPlot)
10229  {
10230  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%6d",
10231  fFapAnaType.Data(), fFapNbOfSamples,
10233  Stex_StinCons, n1StexCrys, i0StinEcha);
10234  }
10235  if(opt_plot == fSameOnePlot)
10236  {
10237  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%6d %-25s",
10238  fFapAnaType.Data(), fFapNbOfSamples,
10240  Stex_StinCons, n1StexCrys, i0StinEcha, QuantityName.Data());
10241  }
10242 
10243  TText* tt = main_pavtxt->AddText(f_in);
10244  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
10245 
10246  delete [] f_in; f_in = nullptr; fCdelete++;
10247 
10248  //---------- Draw the "several changing" pave with its text in the Canvas (FIRST TIME) (HistimePlot)
10249  main_pavtxt->Draw();
10250 
10251  //---------------- Call to SetParametersCanvas
10252  //fImp<HISTOCODE> = (TCanvasImp*)fCanv<HISTOCODE>->GetCanvasImp();
10253  //fCanv<HISTOCODE>->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
10254  //fPad<HISTOCODE> = gPad;
10255  //fMemoPlot<HISTOCODE> = 1; =======> set MemoFlag to "Buzy"
10256  //fMemoColor<HISTOCODE> = 0;
10257  SetParametersCanvas(HistoCode, opt_plot);
10258 
10259  //---------------- Set xMemoPlotSame to 0
10260  xMemoPlotSame = 0;
10261  }
10262 
10263  //............................ cases fMemoPlotxxx = 1 (HistimePlot)
10264  if(GetMemoFlag(HistoCode, opt_plot) == "Busy")
10265  {
10266  //---------------- Call to ActivePavTxt
10267  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
10268  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
10269 
10270  //---------------- Call to ActivePad
10271  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
10272 
10273  //---------------- Recover pointer to the current canvas
10274  MainCanvas = GetCurrentCanvas(HistoCode.Data(), opt_plot.Data());
10275  }
10276  }
10277 
10278  //============================================================================= (HistimePlot)
10279  //
10280  // 2nd OPERATIONS: Write and Draw the parameter values in the
10281  // "several changing" pave (options SAME and SAME n)
10282  // Draw Histo
10283  //=============================================================================
10284  if(main_subpad != nullptr)
10285  {
10286  if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
10287  {
10288  if(xMemoPlotSame != 0)
10289  {
10290  main_pavtxt->SetTextAlign(fTextPaveAlign);
10291  main_pavtxt->SetTextFont(fTextPaveFont);
10292  main_pavtxt->SetTextSize(fTextPaveSize);
10293  main_pavtxt->SetBorderSize(fTextBorderSize);
10294 
10295  char* f_in = new char[fgMaxCar]; fCnew++;
10296 
10297  if(opt_plot == fSeveralPlot )
10298  {sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%6d",
10300  sFapStexNumber.Data(), Stex_StinCons, n1StexCrys, i0StinEcha);}
10301  if(opt_plot == fSameOnePlot )
10302  {sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%6d %-25s",
10304  sFapStexNumber.Data(), Stex_StinCons, n1StexCrys, i0StinEcha, QuantityName.Data());}
10305 
10306  TText *tt = main_pavtxt->AddText(f_in);
10307  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
10308  MainCanvas->cd(); gStyle->SetOptDate(0);
10309  main_pavtxt->Draw();
10310 
10311  delete [] f_in; f_in = nullptr; fCdelete++;
10312  }
10313  main_subpad->cd();
10314  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
10315  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
10316  Double_t y_low = fCnaParHistos->BoxTopY("several_evol_box") + 0.005;
10317  Double_t y_up = fCnaParHistos->BoxBottomY("general_comment") - 0.005;
10318  if( opt_plot == fSameOnePlot ){y_up = fCnaParHistos->BoxBottomY("top_left_box_EB") - 0.005;}
10319  main_subpad->SetPad(x_low, y_low, x_up, y_up);
10320  }
10321 
10322  //............................................ Style (HistimePlot)
10323  SetViewGraphColors(g_graph0, HistoCode, opt_plot);
10324 
10325  //................................. Set axis titles
10326  TString axis_x_var_name = SetHistoXAxisTitle(HistoCode);
10327  TString axis_y_var_name = SetHistoYAxisTitle(HistoCode);
10328  g_graph0->GetXaxis()->SetTitle(axis_x_var_name);
10329  g_graph0->GetYaxis()->SetTitle(axis_y_var_name);
10330 
10331  //................................. Xaxis is a time axis
10332  g_graph0->GetXaxis()->SetTimeDisplay(1);
10333  g_graph0->GetXaxis()->SetTimeFormat("%d %b-%Hh");
10334 
10335  g_graph0->GetXaxis()->SetTimeOffset(xinf);
10336 
10337  Int_t nb_displayed = fCnaParHistos->GetNbOfRunsDisplayed(); // max nb of run numbers displayed
10338 
10339  //........................................................................... (HistimePlot)
10340  Int_t liny = 0;
10341  Int_t logy = 1;
10342 
10343  if(opt_plot == fOnlyOnePlot)
10344  {
10345  fXinf = (Double_t)xinf;
10346  fXsup = (Double_t)xsup;
10347  fYinf = (Double_t)GetYminValueFromMemo(HistoCode);
10348  fYsup = (Double_t)GetYmaxValueFromMemo(HistoCode);
10349 
10350  gPad->RangeAxis(fXinf, fYinf, fXsup, fYsup);
10351 
10352  //if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(liny);}
10353  if(opt_scale_y == fOptScaleLogy){gPad->SetLogy(logy); g_graph0->Draw("ALP");}
10354 
10355  if(opt_scale_y == fOptScaleLiny)
10356  {
10357  gPad->SetLogy(liny);
10358  g_graph0->Draw("ALP");
10359  Int_t nb_pts = g_graph0->GetN();
10360  Double_t* coord_x = g_graph0->GetX();
10361  Double_t* coord_y = g_graph0->GetY();
10362 
10363  char* f_in = new char[fgMaxCar]; fCnew++;
10364 
10365  //................. display of the run numbers (HistimePlot)
10366  Double_t interv_displayed = (coord_x[nb_pts-1] - coord_x[0])/(Double_t)nb_displayed;
10367  Double_t last_drawn_coordx = coord_x[0] - 1.5*interv_displayed;
10368 
10369  for(Int_t i_run=0; i_run<nb_pts; i_run++)
10370  {
10371  if ( (coord_x[i_run] - last_drawn_coordx) > interv_displayed )
10372  {
10373  Double_t joinYinf = fYinf;
10374  Double_t joinYsup = fYsup;
10375  if( joinYsup <= joinYinf )
10376  {
10377  joinYinf =
10379  joinYsup =
10381  joinYsup = joinYsup + (joinYsup-joinYinf)/20.;
10382  }
10383 
10384  sprintf( f_in, "R%d", fT1DRunNumber[i_run]);
10385  TText *text_run_num = new TText(coord_x[i_run], joinYsup, f_in); fCnewRoot++;
10386  text_run_num->SetTextAngle((Double_t)45.);
10387  text_run_num->SetTextSize((Double_t)0.035);
10388  text_run_num->Draw("SAME");
10389  // delete text_StexStin_num; fCdeleteRoot++;
10390 
10391  TLine *jointlign;
10392  jointlign = new TLine(coord_x[i_run], joinYsup, coord_x[i_run], coord_y[i_run]); fCnewRoot++;
10393  jointlign->SetLineWidth(1);
10394  jointlign->SetLineStyle(2);
10395  jointlign->Draw("SAME");
10396  // delete jointlign; fCdeleteRoot++;
10397 
10398  last_drawn_coordx = coord_x[i_run]; // (HistimePlot)
10399  }
10400  }
10401 
10402  delete [] f_in; f_in = nullptr; fCdelete++;
10403 
10404  }
10405  if(opt_scale_y == fOptScaleLogy)
10406  {
10407  gPad->SetLogy(logy);
10408  g_graph0->Draw("ALP");
10409  }
10410  }
10411 
10412  //...................................................................... (HistimePlot)
10413  if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
10414  {
10415  if(xMemoPlotSame == 0)
10416  {
10417  if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(liny);}
10418  if(opt_scale_y == fOptScaleLogy){gPad->SetLogy(logy);
10419 }
10420  g_graph0->Draw("ALP");
10421 
10422  fXinf = (Double_t)xinf;
10423  fXsup = (Double_t)xsup;
10424  fYinf = (Double_t)GetYminValueFromMemo(HistoCode);
10425  fYsup = (Double_t)GetYmaxValueFromMemo(HistoCode);
10426 
10427  gPad->RangeAxis(fXinf, fYinf, fXsup, fYsup);
10428  }
10429 
10430  if(xMemoPlotSame != 0) // (HistimePlot)
10431  {
10432  if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(liny);}
10433  if(opt_scale_y == fOptScaleLogy){gPad->SetLogy(logy);}
10434 
10435  g_graph0->Draw("LP");
10436  }
10437  }
10438  gPad->Update();
10439  }
10440  else // else du if(main_subpad !=0)
10441  {
10442  std::cout << "*TEcnaHistos::HistimePlot(...)> Canvas not found. Previously closed in option SAME."
10443  << fTTBELL << std::endl;
10444 
10445  ReInitCanvas(HistoCode, opt_plot);
10446  xMemoPlotSame = 0;
10447  }
10448 
10449  // delete MainCanvas; fCdeleteRoot++;
10450 
10451 } // end of HistimePlot
10452 
10453 //------------------------------------------------------------------------------------------------------
10454 void TEcnaHistos::TopAxisForHistos(TH1D* h_his0, const TString& opt_plot,
10455  const Int_t& xMemoPlotSame, const Int_t& min_value, const Int_t& max_value,
10456  const Int_t& xFlagAutoYsupMargin, const Int_t& HisSize)
10457 {
10458 // Axis on top of the plot to indicate the Stin numbers
10459 
10460  if( opt_plot == fOnlyOnePlot ||
10461  ( (opt_plot == fSeveralPlot) && (xMemoPlotSame == 0) ) ||
10462  ( (opt_plot == fSameOnePlot) && (xMemoPlotSame == 0) ) )
10463  {
10464  Double_t Maxih = (Double_t)h_his0->GetMaximum();
10465  Double_t Minih = (Double_t)h_his0->GetMinimum();
10466 
10467  if(xFlagAutoYsupMargin == 1)
10468  {
10469  if( Minih >= Maxih ){Minih = (Double_t)0.; Maxih += Maxih;} // ROOT default if ymin >= ymax
10470  Double_t MaxMarginFactor = (Double_t)0.05; // frame top line = 5% above the maximum
10471  Maxih += (Maxih-Minih)*MaxMarginFactor; // ROOT default if ymin < ymax
10472  }
10473 
10474  Double_t v_min = min_value;
10475  Double_t v_max = max_value+(Double_t)1.;
10476  Double_t v_min_p = v_min+(Double_t)1.;
10477  Double_t v_max_p = v_max+(Double_t)1.;
10478 
10479  Int_t ndiv = 50207;
10480  TString opt = "B-";
10481  Double_t Xbegin = 0.;
10482  Double_t Xend = (Double_t)HisSize;
10483  Double_t ticks = 0.05;
10484 
10485  if( fFapStexNumber == 0 && fFlagSubDet == "EE" )
10486  {
10487  v_min = 0;
10488  v_max = max_value;
10489  ndiv = 4;
10490  opt = "CSU"; // first draw axis with ticksize and no label
10491  Xbegin = (Double_t)HisSize;
10492  Xend = 0.;
10493  }
10494 
10495  if( fFapStexNumber > 0 && fFlagSubDet == "EE" )
10496  {
10497  ticks = 0;
10498  if( fFapStexNumber == 1 )
10499  {
10500  v_min = min_value;
10501  v_max = max_value+0.5;
10502  Xbegin = (Double_t)HisSize;
10503  Xend = 0.;
10504  opt = "CSU"; // first draw axis with no ticksize and no label
10505  }
10506  if( fFapStexNumber == 2 )
10507  {
10508  v_min = min_value+0.5;
10509  v_max = max_value+1.;
10510  Xbegin = (Double_t)HisSize;
10511  Xend = 0.;
10512  opt = "CSU"; // first draw axis with no ticksize and no label
10513  }
10514  if( fFapStexNumber == 3 )
10515  {
10516  v_min = min_value+0.5;
10517  v_max = max_value+1.;
10518  Xbegin = 0.;
10519  Xend = (Double_t)HisSize;
10520  opt = "-CSU"; // first draw axis with no ticksize and no label
10521  }
10522  if( fFapStexNumber == 4 )
10523  {
10524  v_min = min_value;
10525  v_max = max_value+0.5;
10526  Xbegin = 0.;
10527  Xend = (Double_t)HisSize;
10528  opt = "-CSU"; // first draw axis with no ticksize and no label
10529  }
10530  v_min -= 1;
10531  v_max -= 1;
10532  ndiv = 5;
10533  }
10534 
10535  TGaxis* top_axis_x = nullptr;
10536 
10537  top_axis_x = new TGaxis(Xbegin, Maxih, Xend, Maxih,
10538  v_min, v_max, ndiv, opt, 0.); fCnewRoot++;
10539 
10540  top_axis_x->SetTickSize(ticks);
10541  top_axis_x->SetTitleOffset((Float_t)(1.2));
10542  top_axis_x->SetLabelOffset((Float_t)(0.005));
10543 
10544  TString x_var_name = "?";
10545  Int_t MaxCar = fgMaxCar;
10546  x_var_name.Resize(MaxCar);
10547  if( fFapStexNumber > 0 )
10548  {
10549  if( fFlagSubDet == "EB"){x_var_name = "Tower number";}
10550  if( fFlagSubDet == "EE")
10551  {
10552  x_var_name = " ";
10553  // x_var_name = " Data sector"; // don't remove the space characters !
10554  }
10555  }
10556  if( fFapStexNumber == 0 )
10557  {
10558  if( fFlagSubDet == "EB"){x_var_name = "SM number";}
10559  if( fFlagSubDet == "EE"){x_var_name = " ";}
10560  }
10561  top_axis_x->SetTitle(x_var_name);
10562  top_axis_x->Draw("SAME");
10563 
10564  if( fFlagSubDet == "EE" )
10565  {
10566  // redraw axis with ticksize = 0, with labelOffset<0 or >0 and div centered in middle division
10567  opt = "-MS";
10568  if(fFapStexNumber == 1 || fFapStexNumber == 2 ){opt = "-MS";}
10569  if(fFapStexNumber == 3 || fFapStexNumber == 4 ){opt = "MS";}
10570  ndiv = 4;
10571  if( fFapStexNumber > 0 ){ndiv = 5;}
10572  TGaxis* top_axis_x_bis = nullptr;
10573  top_axis_x_bis = new TGaxis(Xbegin, Maxih, Xend, Maxih,
10574  v_min_p, v_max_p, ndiv, opt, 0.); fCnewRoot++;
10575  top_axis_x_bis->SetTickSize(0.);
10576  Float_t lab_siz_x = top_axis_x->GetLabelSize();
10577  top_axis_x_bis->SetLabelSize(lab_siz_x);
10578  top_axis_x_bis->SetLabelOffset(-0.1);
10579 
10580  top_axis_x_bis->SetLabelOffset((Float_t)(9999.));
10581  // if(fFapStexNumber == 1 || fFapStexNumber == 2 ){top_axis_x_bis->SetLabelOffset(-0.07);}
10582  // if(fFapStexNumber == 3 || fFapStexNumber == 4 ){top_axis_x_bis->SetLabelOffset(-0.05);}
10583  // if(fFapStexNumber == 0 )
10584  // {top_axis_x_bis->SetLabelOffset((Float_t)(9999.));} // keep the tick and remove the value
10585  top_axis_x_bis->Draw("SAME");
10586  }
10587  }
10588 } // end of TopAxisForHistos
10589 
10590 //............................................................................................
10591 void TEcnaHistos::SetAllPavesViewMatrix(const TString& BetweenWhat,
10592  const Int_t& StexStin_A, const Int_t& StexStin_B,
10593  const Int_t& i0StinEcha)
10594 {
10595 // Put all the paves of a matrix view
10596 
10598 
10600 
10601  if(BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels)
10602  {fPavComStin = fCnaParHistos->SetPaveStinsXY(StexStin_A, StexStin_B);}
10603  if(BetweenWhat == fBetweenSamples)
10604  {
10606 
10607  if( fFlagSubDet == "EB" )
10608  {Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
10609  fPavComXtal = fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha);}
10610  if( fFlagSubDet == "EE" )
10612  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
10613  fPavComXtal = fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha);}
10614  }
10615 
10619 }
10620 
10621 void TEcnaHistos::SetAllPavesViewStin(const Int_t& StexStin_A)
10622 {
10623 // Put all the paves of a Stin view
10624 
10627 
10629 
10633 }
10634 
10635 void TEcnaHistos::SetAllPavesViewStinCrysNb(const Int_t& StexNumber, const Int_t& StexStin_A)
10636 {
10637 // Put all the paves of a crystal numbering Stin view
10638 
10639  fPavComStex = fCnaParHistos->SetPaveStex("standard", StexNumber);
10640  fPavComStin = fCnaParHistos->SetPaveStin(StexStin_A, StexNumber);
10641 
10642  if( fFlagSubDet == "EB")
10643  {fPavComLVRB = fCnaParHistos->SetPaveLVRB(StexNumber, StexStin_A);}
10644  if( fFlagSubDet == "EE")
10645  {fPavComCxyz = fCnaParHistos->SetPaveCxyz(StexNumber);}
10646 }
10647 
10648 void TEcnaHistos::SetAllPavesViewStex(const TString& chopt, const Int_t& StexNumber)
10649 {
10650  if( chopt == "Numbering" )
10651  {
10652  fCnaParHistos->SetViewHistoStyle("Stex2DEENb");
10653  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10654  fPavComStex = fCnaParHistos->SetPaveStex("standStex", StexNumber);
10655  if( fFlagSubDet == "EE" ){fPavComCxyz = fCnaParHistos->SetPaveCxyz(StexNumber);}
10656  }
10657  else
10658  {
10659  SetAllPavesViewStex(StexNumber);
10660  }
10661 }
10662 // end of SetAllPavesViewStex(...,...)
10663 
10664 void TEcnaHistos::SetAllPavesViewStex(const Int_t& StexNumber)
10665 {
10666  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10668  fPavComStex = fCnaParHistos->SetPaveStex("standStex", StexNumber);
10669 
10670  TString opt_pave_nbcol = "OneCol";
10671  if( fFapStexName == "SM"){opt_pave_nbcol = "TwoCol";}
10672 
10676 }
10677 // end of SetAllPavesViewStex(...)
10678 
10680 {
10681  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10684 
10688 }
10689 // end of SetAllPavesViewStas
10690 
10691 void TEcnaHistos::SetAllPavesViewHisto(const TString& HistoCode, const Int_t& StexStin_A,
10692  const Int_t& i0StinEcha, const Int_t& i0Sample,
10693  const TString& opt_plot)
10694 {
10695  Int_t arg_AlreadyRead = 0;
10696  SetAllPavesViewHisto(HistoCode, StexStin_A, i0StinEcha, i0Sample, opt_plot, arg_AlreadyRead);
10697 }
10698 
10699 void TEcnaHistos::SetAllPavesViewHisto(const TString& HistoCode, const Int_t& StexStin_A,
10700  const Int_t& i0StinEcha, const Int_t& i0Sample,
10701  const TString& opt_plot, const Int_t& arg_AlreadyRead)
10702 {
10703 // Put all the paves of a histo view according to HistoCode
10704 
10705  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10706 
10707  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
10708 
10710 
10711  if(opt_plot == fOnlyOnePlot)
10712  {
10713  if( !( HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" ||
10714  HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs" ||
10715  HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" ||
10716  HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs" ||
10717  HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" ||
10718  HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" ||
10719  HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs" ) )
10720  {
10723  }
10724  else
10725  {
10726  if( HistoCode == "D_NOE_ChNb" ||
10727  HistoCode == "D_Ped_ChNb" || HistoCode == "D_TNo_ChNb" ||
10728  HistoCode == "D_MCs_ChNb" || HistoCode == "D_LFN_ChNb" ||
10729  HistoCode == "D_HFN_ChNb" || HistoCode == "D_SCs_ChNb" )
10731  else
10733  }
10734  //.................................................... (SetAllPavesViewHisto)
10735 
10736  if( HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10737  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
10738  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
10739  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
10740  {
10741  Int_t n1StexCrys =
10743  fPavComXtal = fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha);
10744  }
10745 
10746  if( HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" ||
10747  HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpDs" )
10748  {
10749  Int_t n1StexCrys =
10751  fPavComXtal =
10752  fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha, arg_AlreadyRead, fPlotAllXtalsInStin);
10753  }
10754 
10755  if( HistoCode == "D_Adc_EvDs" || HistoCode == "D_Adc_EvNb")
10756  {
10757  Int_t n1StexCrys =
10759  fPavComXtal = fCnaParHistos->SetPaveCrystalSample(n1StexCrys, StexStin_A, i0StinEcha, i0Sample);
10760  }
10761 
10762  if( HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10763  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
10764  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
10765  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
10766  {
10771  fStopEvolRun, fStopEvolDate, opt_plot, HistoType);
10772  }
10773  else
10774  {
10778  }
10779  }
10780 
10781  //.................................................... (SetAllPavesViewHisto)
10782 
10783  if( opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free" )
10784  {
10785  if( HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10786  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
10787  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
10788  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
10789  {
10792  fStopEvolRun, fStopEvolDate, opt_plot, HistoType);
10793  }
10794  else
10795  {
10797  }
10798  }
10799 
10800  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free" )
10801  {
10804  fStopEvolRun, fStopEvolDate, opt_plot, HistoType);
10805  }
10806 
10807 }
10808 // end of SetAllPavesViewHisto
10809 
10810 TString TEcnaHistos::SetCanvasName(const TString& HistoCode,
10811  const Int_t& opt_scale_x, const Int_t& opt_scale_y,
10812  const TString& opt_plot, const Int_t& arg_AlreadyRead,
10813  const Int_t& StexStin_A, const Int_t& i0StinEcha, const Int_t& i0Sample)
10814 {
10815  //......... Set Canvas name *===> FOR 1D HISTO ONLY
10816  // (for 2D histos, see inside ViewMatrix, ViewStex,...)
10817 
10818  TString canvas_name;
10819  Int_t MaxCar = fgMaxCar;
10820  canvas_name.Resize(MaxCar);
10821  canvas_name = "?";
10822 
10823  char* f_in = new char[fgMaxCar]; fCnew++;
10824 
10825  //......................... name_ opt_plot (Set Canvas name)
10826  TString name_opt_plot;
10827  MaxCar = fgMaxCar;
10828  name_opt_plot.Resize(MaxCar);
10829  name_opt_plot = "?";
10830 
10831  //if(opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0){name_opt_plot = "P0";} // Only one plot
10832  //if(opt_plot == fOnlyOnePlot && arg_AlreadyRead == 1){name_opt_plot = "P1";} // SAME in Stin plot
10833  //if(opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1){name_opt_plot = "Pn";} // SAME in Stin plot
10834 
10835  if( opt_plot == fOnlyOnePlot ){sprintf(f_in,"P%d", arg_AlreadyRead); name_opt_plot = f_in;}
10836 
10837  if(opt_plot == fSeveralPlot)
10838  {
10839  name_opt_plot = "SAME_N";
10840  //...................................... name_same (opt_plot = fSeveralPlot)
10841  Int_t name_same = -1;
10842 
10843  if(HistoCode == "D_NOE_ChNb"){name_same = fCanvSameD_NOE_ChNb;}
10844  if(HistoCode == "D_NOE_ChDs"){name_same = fCanvSameD_NOE_ChDs;}
10845  if(HistoCode == "D_Ped_ChNb"){name_same = fCanvSameD_Ped_ChNb;}
10846  if(HistoCode == "D_Ped_ChDs"){name_same = fCanvSameD_Ped_ChDs;}
10847  if(HistoCode == "D_TNo_ChNb"){name_same = fCanvSameD_TNo_ChNb;}
10848  if(HistoCode == "D_TNo_ChDs"){name_same = fCanvSameD_TNo_ChDs;}
10849  if(HistoCode == "D_MCs_ChNb"){name_same = fCanvSameD_MCs_ChNb;}
10850  if(HistoCode == "D_MCs_ChDs"){name_same = fCanvSameD_MCs_ChDs;}
10851  if(HistoCode == "D_LFN_ChNb"){name_same = fCanvSameD_LFN_ChNb;}
10852  if(HistoCode == "D_LFN_ChDs"){name_same = fCanvSameD_LFN_ChDs;}
10853  if(HistoCode == "D_HFN_ChNb"){name_same = fCanvSameD_HFN_ChNb;}
10854  if(HistoCode == "D_HFN_ChDs"){name_same = fCanvSameD_HFN_ChDs;}
10855  if(HistoCode == "D_SCs_ChNb"){name_same = fCanvSameD_SCs_ChNb;}
10856  if(HistoCode == "D_SCs_ChDs"){name_same = fCanvSameD_SCs_ChDs;}
10857  if(HistoCode == "D_MSp_SpNb"){name_same = fCanvSameD_MSp_SpNb;}
10858  if(HistoCode == "D_MSp_SpDs"){name_same = fCanvSameD_MSp_SpDs;}
10859  if(HistoCode == "D_SSp_SpNb"){name_same = fCanvSameD_SSp_SpNb;}
10860  if(HistoCode == "D_SSp_SpDs"){name_same = fCanvSameD_SSp_SpDs;}
10861  if(HistoCode == "D_Adc_EvDs"){name_same = fCanvSameD_Adc_EvDs;}
10862  if(HistoCode == "D_Adc_EvNb"){name_same = fCanvSameD_Adc_EvNb;}
10863  if(HistoCode == "H_Ped_Date"){name_same = fCanvSameH_Ped_Date;}
10864  if(HistoCode == "H_TNo_Date"){name_same = fCanvSameH_TNo_Date;}
10865  if(HistoCode == "H_MCs_Date"){name_same = fCanvSameH_MCs_Date;}
10866  if(HistoCode == "H_LFN_Date"){name_same = fCanvSameH_LFN_Date;}
10867  if(HistoCode == "H_HFN_Date"){name_same = fCanvSameH_HFN_Date;}
10868  if(HistoCode == "H_SCs_Date"){name_same = fCanvSameH_SCs_Date;}
10869  if(HistoCode == "H_Ped_RuDs"){name_same = fCanvSameH_Ped_RuDs;}
10870  if(HistoCode == "H_TNo_RuDs"){name_same = fCanvSameH_TNo_RuDs;}
10871  if(HistoCode == "H_MCs_RuDs"){name_same = fCanvSameH_MCs_RuDs;}
10872  if(HistoCode == "H_LFN_RuDs"){name_same = fCanvSameH_LFN_RuDs;}
10873  if(HistoCode == "H_HFN_RuDs"){name_same = fCanvSameH_HFN_RuDs;}
10874  if(HistoCode == "H_SCs_RuDs"){name_same = fCanvSameH_SCs_RuDs;}
10875 
10876  sprintf(f_in,"%d", name_same);
10877  TString s_name_same = f_in;
10878  const Text_t *t_name_same = (const Text_t *)s_name_same.Data();
10879  name_opt_plot.Append(t_name_same);
10880  }
10881  if(opt_plot == fSameOnePlot)
10882  {
10883  name_opt_plot = "SAME_Plus_N";
10884  //...................................... name_same (opt_plot = fSeveralPlot)
10885  Int_t name_same = fCanvSameH1SamePlus;
10886  sprintf(f_in,"%d", name_same);
10887  TString s_name_same = f_in;
10888  const Text_t *t_name_same = (const Text_t *)s_name_same.Data();
10889  name_opt_plot.Append(t_name_same);
10890  }
10891 
10892  //......................... name_visu (Set Canvas name)
10893  TString name_visu;
10894  MaxCar = fgMaxCar;
10895  name_visu.Resize(MaxCar);
10896  name_visu = "";
10897 
10898  TString name_line;
10899  MaxCar = fgMaxCar;
10900  name_line.Resize(MaxCar);
10901  name_line = "Line_";
10902  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
10903  if( HistoType == "Global" && (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) ){name_line = "Polm_";}
10904 
10905  // if(opt_visu == fOptVisLine){name_line = "Line_";}
10906  // if(opt_visu == fOptVisPolm){name_line = "Poly_";}
10907 
10908  const Text_t *t_line = (const Text_t *)name_line.Data();
10909  name_visu.Append(t_line);
10910 
10911  TString name_scale_x;
10912  MaxCar = fgMaxCar;
10913  name_scale_x.Resize(MaxCar);
10914  name_scale_x = "?";
10915  if(opt_scale_x == fOptScaleLinx){name_scale_x = "LinX_";}
10916  if(opt_scale_x == fOptScaleLogx){name_scale_x = "LogX_";}
10917  const Text_t *t_scale_x = (const Text_t *)name_scale_x.Data();
10918  name_visu.Append(t_scale_x);
10919 
10920  TString name_scale_y;
10921  MaxCar = fgMaxCar;
10922  name_scale_y.Resize(MaxCar);
10923  name_scale_y = "?";
10924  if(opt_scale_y == fOptScaleLiny){name_scale_y = "LinY";}
10925  if(opt_scale_y == fOptScaleLogy){name_scale_y = "LogY";}
10926  const Text_t *t_scale_y = (const Text_t *)name_scale_y.Data();
10927  name_visu.Append(t_scale_y);
10928 
10929  //...................................... name quantity (Set Canvas name)
10930  TString name_quantity;
10931  MaxCar = fgMaxCar;
10932  name_quantity.Resize(MaxCar);
10933  name_quantity = "?";
10934 
10935  if(HistoCode == "D_NOE_ChNb"){name_quantity = "Nb_of_evts_as_func_of_Xtal";}
10936  if(HistoCode == "D_NOE_ChDs"){name_quantity = "Nb_of_evts_Xtal_distrib";}
10937  if(HistoCode == "D_Ped_ChNb"){name_quantity = "Pedestals_as_func_of_Xtal";}
10938  if(HistoCode == "D_Ped_ChDs"){name_quantity = "Pedestals_Xtal_distrib";}
10939  if(HistoCode == "D_TNo_ChNb"){name_quantity = "Total_Noise_as_func_of_Xtal";}
10940  if(HistoCode == "D_TNo_ChDs"){name_quantity = "Total_Noise_Xtal_distrib";}
10941  if(HistoCode == "D_MCs_ChNb"){name_quantity = "Mean_Corss_as_func_of_Xtal";}
10942  if(HistoCode == "D_MCs_ChDs"){name_quantity = "Mean_Corss_Xtal_distrib";}
10943  if(HistoCode == "D_LFN_ChNb"){name_quantity = "Low_Fq_Noise_as_func_of_Xtal";}
10944  if(HistoCode == "D_LFN_ChDs"){name_quantity = "Low_Fq_Noise_Xtal_distrib";}
10945  if(HistoCode == "D_HFN_ChNb"){name_quantity = "High_Fq_Noise_as_func_of_Xtal";}
10946  if(HistoCode == "D_HFN_ChDs"){name_quantity = "High_Fq_Noise_Xtal_distrib";}
10947  if(HistoCode == "D_SCs_ChNb"){name_quantity = "Sigma_Corss_as_func_of_Xtal";}
10948  if(HistoCode == "D_SCs_ChDs"){name_quantity = "Sigma_Corss_Xtal_distrib";}
10949  if(HistoCode == "D_MSp_SpNb"){name_quantity = "ExpValue_of_samples";}
10950  if(HistoCode == "D_MSp_SpDs"){name_quantity = "ExpValue_of_samples_distrib";}
10951  if(HistoCode == "D_SSp_SpNb"){name_quantity = "Sigma_of_samples";}
10952  if(HistoCode == "D_SSp_SpDs"){name_quantity = "Sigma_of_samples_distrib";}
10953  if(HistoCode == "D_Adc_EvDs"){name_quantity = "hevt";}
10954  if(HistoCode == "D_Adc_EvNb"){name_quantity = "ADC_as_func_of_Event";}
10955  if(HistoCode == "H_Ped_Date"){name_quantity = "Pedestal_history";}
10956  if(HistoCode == "H_TNo_Date"){name_quantity = "Total_Noise_history";}
10957  if(HistoCode == "H_MCs_Date"){name_quantity = "Mean_Corss_history";}
10958  if(HistoCode == "H_LFN_Date"){name_quantity = "Low_Fq_Noise_history";}
10959  if(HistoCode == "H_HFN_Date"){name_quantity = "High_Fq_Noise_history";}
10960  if(HistoCode == "H_SCs_Date"){name_quantity = "Sigma_Corss_history";}
10961  if(HistoCode == "H_Ped_RuDs"){name_quantity = "Pedestal_run_distribution";}
10962  if(HistoCode == "H_TNo_RuDs"){name_quantity = "Total_Noise_run_distribution";}
10963  if(HistoCode == "H_MCs_RuDs"){name_quantity = "Mean_Corss_run_distribution";}
10964  if(HistoCode == "H_LFN_RuDs"){name_quantity = "Low_Fq_Noise_run_distribution";}
10965  if(HistoCode == "H_HFN_RuDs"){name_quantity = "High_Fq_Noise_run_distribution";}
10966  if(HistoCode == "H_SCs_RuDs"){name_quantity = "Sigma_Corss_run_distribution";}
10967 
10968  Int_t num_crys = -1;
10969  if(HistoCode == "D_MSp_SpNb"){num_crys = i0StinEcha;}
10970  if(HistoCode == "D_MSp_SpDs"){num_crys = i0StinEcha;}
10971  if(HistoCode == "D_SSp_SpNb"){num_crys = i0StinEcha;}
10972  if(HistoCode == "D_SSp_SpDs"){num_crys = i0StinEcha;}
10973  if(HistoCode == "D_Adc_EvDs"){num_crys = i0StinEcha;}
10974  if(HistoCode == "D_Adc_EvNb"){num_crys = i0StinEcha;}
10975  if(HistoCode == "H_Ped_Date"){num_crys = i0StinEcha;}
10976  if(HistoCode == "H_TNo_Date"){num_crys = i0StinEcha;}
10977  if(HistoCode == "H_MCs_Date"){num_crys = i0StinEcha;}
10978  if(HistoCode == "H_LFN_Date"){num_crys = i0StinEcha;}
10979  if(HistoCode == "H_HFN_Date"){num_crys = i0StinEcha;}
10980  if(HistoCode == "H_SCs_Date"){num_crys = i0StinEcha;}
10981  if(HistoCode == "H_Ped_RuDs"){num_crys = i0StinEcha;}
10982  if(HistoCode == "H_TNo_RuDs"){num_crys = i0StinEcha;}
10983  if(HistoCode == "H_MCs_RuDs"){num_crys = i0StinEcha;}
10984  if(HistoCode == "H_LFN_RuDs"){num_crys = i0StinEcha;}
10985  if(HistoCode == "H_HFN_RuDs"){num_crys = i0StinEcha;}
10986  if(HistoCode == "H_SCs_RuDs"){num_crys = i0StinEcha;}
10987 
10988  Int_t num_samp = -1;
10989  if(HistoCode == "D_Adc_EvDs"){num_samp = i0Sample;}
10990  if(HistoCode == "D_Adc_EvNb"){num_samp = i0Sample;}
10991 
10992  //........................................................... (Set Canvas name)
10993 
10994  if (HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" ||
10995  HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs" ||
10996  HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs" ||
10997  HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" ||
10998  HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" ||
10999  HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" ||
11000  HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs" )
11001  {
11002  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%d_%s%d_%s_%s",
11003  name_quantity.Data(), fFapAnaType.Data(),
11005  fFapStexName.Data(), fFapStexNumber,
11006  name_opt_plot.Data(), name_visu.Data());
11007  }
11008 
11009  if (HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" ||
11010  HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
11011  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
11012  HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpDs" ||
11013  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
11014  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs")
11015  {
11016  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%d_%s%d_%s%d_Xtal%d_%s_%s",
11017  name_quantity.Data(), fFapAnaType.Data(),
11019  fFapStexName.Data(), fFapStexNumber, fFapStinName.Data(), StexStin_A, num_crys,
11020  name_opt_plot.Data(), name_visu.Data());
11021  }
11022 
11023  if (HistoCode == "D_Adc_EvNb" || HistoCode == "D_Adc_EvDs")
11024  {
11025  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%d_%s%d_%s%d_Xtal%d_Samp%d_%s_%s",
11026  name_quantity.Data(), fFapAnaType.Data(),
11028  fFapStexName.Data(), fFapStexNumber, fFapStinName.Data(), StexStin_A, num_crys, num_samp,
11029  name_opt_plot.Data(), name_visu.Data());
11030  }
11031 
11032  canvas_name = f_in;
11033  delete [] f_in; f_in = nullptr; fCdelete++;
11034  return canvas_name.Data();
11035 
11036 } // end of CanvasName()
11037 
11038 //-----------------------------------------------------------------------------
11039 //
11040 // M I S C E L L A N E O U S P A R A M E T E R S
11041 //
11042 // C O N C E R N I N G T H E D I S P L A Y
11043 //
11044 //-----------------------------------------------------------------------------
11045 
11046 //===========================================================================
11047 //
11048 // GetHistoSize, GetHistoValues, SetHistoXAxisTitle, SetHistoYAxisTitle,
11049 // GetHistoXinf, GetHistoXsup, GetHistoNumberOfBins, FillHisto
11050 //
11051 //===========================================================================
11052 Int_t TEcnaHistos::GetHistoSize(const TString& chqcode, const TString& opt_plot_read)
11053 {
11054 // Histo size as a function of the quantity code
11055 
11056 // VERY IMPORTANT: in some cases the number of bins must be strictly related to the parameters values
11057 // (number of crystals, number of samples, etc...). See below comments "===> ONE BIN BY..."
11058 
11059  Int_t HisSize = fNbBinsProj; // default value
11060 
11061  //............ histo with sample number as x coordinate => HisSize depends on option "plot" or "read"
11062  // because of nb of samples in file: size for plot = 10 even if nb of samples in file < 10
11063  if( chqcode == "D_MSp_SpNb" || chqcode == "D_SSp_SpNb" ||
11064  chqcode == "D_MSp_SpDs" || chqcode == "D_SSp_SpDs" )
11065  {
11066  if( opt_plot_read == "read" ){HisSize = fFapNbOfSamples;}
11067  if( opt_plot_read == "plot" ){HisSize = fEcal->MaxSampADC();}
11068  } // ===> ONE BIN BY SAMPLE
11069 
11070  //............ histo with event number as x coordinate. (==> "D_Adc_EvDs" option: obsolete, to be confirmed)
11071  if(chqcode == "D_Adc_EvNb" || chqcode == "D_Adc_EvDs"){HisSize = fFapReqNbOfEvts;} // ===> ONE BIN BY EVENT
11072 
11073  //............
11074  if(chqcode == "D_NOE_ChNb" ||
11075  chqcode == "D_Ped_ChNb" || chqcode == "D_TNo_ChNb" || chqcode == "D_MCs_ChNb" ||
11076  chqcode == "D_LFN_ChNb" || chqcode == "D_HFN_ChNb" || chqcode == "D_SCs_ChNb" ||
11077  chqcode == "D_NOE_ChDs" ||
11078  chqcode == "D_Ped_ChDs" || chqcode == "D_TNo_ChDs" || chqcode == "D_MCs_ChDs" ||
11079  chqcode == "D_LFN_ChDs" || chqcode == "D_HFN_ChDs" || chqcode == "D_SCs_ChDs" )
11080  {
11081  if( fFlagSubDet == "EB" )
11082  {
11083  if( fFapStexNumber > 0 ){HisSize = fEcal->MaxCrysEcnaInStex();} // ===> ONE BIN BY Xtal
11084  if( fFapStexNumber == 0 ){HisSize = fEcal->MaxSMInEB()*fEcal->MaxTowInSM();} // ===> ONE BIN BY Tower
11085  }
11086  if( fFlagSubDet == "EE" )
11087  {
11088  if( fFapStexNumber > 0 )
11089  {
11090  if( opt_plot_read == "read" ){HisSize = fEcal->MaxCrysEcnaInDee();}
11091  if( opt_plot_read == "plot" ){HisSize = fEcal->MaxCrysForConsInDee();}
11092  } // ===> ONE BIN BY Xtal
11093  if( fFapStexNumber == 0 )
11094  {HisSize = fEcal->MaxDeeInEE()*fEcal->MaxSCForConsInDee();} // ===> ONE BIN BY SC
11095  }
11096  }
11097 
11098  if( chqcode == "H_Ped_RuDs" || chqcode == "H_TNo_RuDs" || chqcode == "H_MCs_RuDs" ||
11099  chqcode == "H_LFN_RuDs" || chqcode == "H_HFN_RuDs" || chqcode == "H_SCs_RuDs" )
11100  {
11101  HisSize = fNbBinsProj;
11102  }
11103 
11104  return HisSize;
11105 }
11106 
11107 TVectorD TEcnaHistos::GetHistoValues(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
11108  TEcnaRead* aMyRootFile, const TString& HistoCode,
11109  const Int_t& HisSizePlot, const Int_t& HisSizeRead,
11110  const Int_t& StexStin_A, const Int_t& i0StinEcha,
11111  const Int_t& i0Sample, Int_t& i_data_exist)
11112 {
11113  // Histo values in a TVectorD. i_data_exist entry value = 0. Incremented in this method.
11114 
11115  TVectorD plot_histo(HisSizePlot); for(Int_t i=0; i<HisSizePlot; i++){plot_histo(i)=(Double_t)0.;}
11116 
11117  fStatusDataExist = kFALSE;
11118 
11119  if( arg_AlreadyRead >= 1 )
11120  {
11121  //std::cout << "*TEcnaHistos::GetHistoValues(...)> arg_AlreadyRead = " << arg_AlreadyRead << std::endl;
11122  for(Int_t i=0; i<HisSizeRead; i++){plot_histo(i)=arg_read_histo(i);}
11123  fStatusDataExist = kTRUE; i_data_exist++;
11124  }
11125 
11126  if( arg_AlreadyRead == 0 )
11127  {
11128  //std::cout << "*TEcnaHistos::GetHistoValues(...)> arg_AlreadyRead = " << arg_AlreadyRead << std::endl;
11129  TVectorD read_histo(HisSizeRead); for(Int_t i=0; i<HisSizeRead; i++){read_histo(i)=(Double_t)0.;}
11130 
11131  if( HistoCode == "D_MSp_SpNb" || HistoCode == "D_MSp_SpDs" ||
11132  HistoCode == "D_SSp_SpNb" || HistoCode == "D_SSp_SpDs" )
11133  {
11134  //====> For plots as a function of Sample# (read10->plot10, read3->plot10)
11135  if( HisSizeRead <= HisSizePlot )
11136  {
11137  if (HistoCode == "D_MSp_SpNb" || HistoCode == "D_MSp_SpDs" )
11138  {
11139  read_histo = aMyRootFile->ReadSampleMeans(StexStin_A, i0StinEcha, HisSizeRead);
11140  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11141  for(Int_t i=0; i<HisSizeRead; i++){plot_histo(i)=read_histo(i);}
11142  }
11143 
11144  if (HistoCode == "D_SSp_SpNb" || HistoCode == "D_SSp_SpDs" )
11145  {
11146  read_histo = aMyRootFile->ReadSampleSigmas(StexStin_A, i0StinEcha, HisSizeRead);
11147  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11148  for(Int_t i=0; i<HisSizeRead; i++){plot_histo(i)=read_histo(i);}
11149  }
11150  }
11151  else
11152  {
11153  std::cout << "!TEcnaHistos::GetHistoValues(...)> *** ERROR *** > HisSizeRead greater than HisSizePlot"
11154  << " for plot as a function of sample#. HisSizeRead = " << HisSizeRead
11155  << ", HisSizePlot = " << HisSizePlot << fTTBELL << std::endl;
11156  }
11157  } // end of if( HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" " ||
11158  // HistoCode == "D_SSp_SpNb" || HistoCode == "D_SSp_SpDs" )
11159 
11160  if( !(HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" ||
11161  HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpDs" ) ) // = else of previous if
11162  {
11163  //====> For other plots
11164  if( HisSizeRead == HisSizePlot )
11165  {
11166  //========> for EE, HisSizeRead > HisSizePlot but readEcna#->plotForCons# will be build in the calling method
11167  // HisSizeRead = fEcal->MaxCrysEcnaInStex() (GetHistoValues)
11168 
11169  if( HistoCode == "D_Adc_EvNb" || HistoCode == "D_Adc_EvDs" )
11170  {
11171  read_histo = aMyRootFile->ReadSampleAdcValues(StexStin_A, i0StinEcha, i0Sample, HisSizeRead);
11172  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11173  }
11174 
11175  if( HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" )
11176  {
11177  read_histo = aMyRootFile->ReadNumberOfEvents(HisSizeRead);
11178  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11179  }
11180 
11181  if( HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs" )
11182  {
11183  read_histo = aMyRootFile->ReadPedestals(HisSizeRead);
11184  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11185  }
11186 
11187  //...................................................... (GetHistoValues)
11188  if( HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs")
11189  {
11190  read_histo = aMyRootFile->ReadTotalNoise(HisSizeRead);
11191  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11192  }
11193 
11194  if( HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" )
11195  {
11196  read_histo = aMyRootFile->ReadLowFrequencyNoise(HisSizeRead);
11197  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11198 
11199  }
11200 
11201  if( HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" )
11202  {
11203  read_histo = aMyRootFile->ReadHighFrequencyNoise(HisSizeRead);
11204  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11205 
11206  }
11207 
11208  if( HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" )
11209  {
11210  read_histo = aMyRootFile->ReadMeanCorrelationsBetweenSamples(HisSizeRead);
11211  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11212  }
11213 
11214  if( HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs" )
11215  {
11216  read_histo = aMyRootFile->ReadSigmaOfCorrelationsBetweenSamples(HisSizeRead);
11217  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11218  }
11219 
11220  for(Int_t i=0; i<HisSizeRead; i++){plot_histo(i)=read_histo(i);}
11221 
11222  }
11223  else
11224  {
11225  std::cout << "!TEcnaHistos::GetHistoValues(...)> *** ERROR *** > HisSizeRead not equal to HisSizePlot."
11226  << " HisSizeRead = " << HisSizeRead
11227  << ", HisSizePlot = " << HisSizePlot << fTTBELL << std::endl;
11228  }
11229  } // end of if( !(HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb") )
11230  } // end of if( arg_AlreadyRead == 0 )
11231 
11232  if( i_data_exist == 0 )
11233  {
11234  std::cout << "!TEcnaHistos::GetHistoValues(...)> Histo not found." << fTTBELL << std::endl;
11235  }
11236 
11237  return plot_histo;
11238 }
11239 //------- (end of GetHistoValues) -------------
11240 
11241 TString TEcnaHistos::SetHistoXAxisTitle(const TString& HistoCode)
11242 {
11243  // Set histo X axis title
11244 
11245  TString axis_x_var_name;
11246 
11247  if(HistoCode == "D_NOE_ChNb" || HistoCode == "D_Ped_ChNb" ||
11248  HistoCode == "D_TNo_ChNb" || HistoCode == "D_MCs_ChNb" ||
11249  HistoCode == "D_LFN_ChNb" || HistoCode == "D_HFN_ChNb" ||
11250  HistoCode == "D_SCs_ChNb" )
11251  {
11252  if( fFapStexNumber > 0 )
11253  {
11254  if( fFlagSubDet == "EB" ){axis_x_var_name = "Xtal (electronic channel number)";}
11255  if( fFlagSubDet == "EE" ){axis_x_var_name = "Xtal";}
11256  }
11257  if( fFapStexNumber == 0 )
11258  {
11259  if( fFlagSubDet == "EB" ){axis_x_var_name = "Tower number";}
11260  if( fFlagSubDet == "EE" ){axis_x_var_name = "SC number";}
11261  }
11262  }
11263 
11264  if(HistoCode == "D_NOE_ChDs"){axis_x_var_name = "Number of events";}
11265  if(HistoCode == "D_Ped_ChDs"){axis_x_var_name = "Pedestal";}
11266  if(HistoCode == "D_TNo_ChDs"){axis_x_var_name = "Total noise";}
11267  if(HistoCode == "D_MCs_ChDs"){axis_x_var_name = "Mean cor(s,s')";}
11268  if(HistoCode == "D_LFN_ChDs"){axis_x_var_name = "Low frequency noise";}
11269  if(HistoCode == "D_HFN_ChDs"){axis_x_var_name = "High frequency noise";}
11270  if(HistoCode == "D_SCs_ChDs"){axis_x_var_name = "Sigmas cor(s,s')";}
11271  if(HistoCode == "D_MSp_SpNb"){axis_x_var_name = "Sample";}
11272  if(HistoCode == "D_MSp_SpDs"){axis_x_var_name = "Pedestal";}
11273  if(HistoCode == "D_SSp_SpNb"){axis_x_var_name = "Sample";}
11274  if(HistoCode == "D_SSp_SpDs"){axis_x_var_name = "Total noise";}
11275  if(HistoCode == "D_Adc_EvDs"){axis_x_var_name = "ADC";}
11276  if(HistoCode == "D_Adc_EvNb"){axis_x_var_name = "Event number";}
11277  if(HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
11278  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date")
11279  {axis_x_var_name = "Time";}
11280  if(HistoCode == "H_Ped_RuDs"){axis_x_var_name = "Pedestal";}
11281  if(HistoCode == "H_TNo_RuDs"){axis_x_var_name = "Total noise";}
11282  if(HistoCode == "H_MCs_RuDs"){axis_x_var_name = "Mean cor(s,s')";}
11283  if(HistoCode == "H_LFN_RuDs"){axis_x_var_name = "Low frequency noise";}
11284  if(HistoCode == "H_HFN_RuDs"){axis_x_var_name = "High frequency noise";}
11285  if(HistoCode == "H_SCs_RuDs"){axis_x_var_name = "Sigmas cor(s,s')";}
11286 
11287  return axis_x_var_name;
11288 }
11289 
11290 TString TEcnaHistos::SetHistoYAxisTitle(const TString& HistoCode)
11291 {
11292 // Set histo Y axis title
11293 
11294  TString axis_y_var_name;
11295 
11296  if(HistoCode == "D_NOE_ChNb"){axis_y_var_name = "Number of events";}
11297  if(HistoCode == "D_Ped_ChNb"){axis_y_var_name = "Pedestal";}
11298  if(HistoCode == "D_TNo_ChNb"){axis_y_var_name = "Total noise";}
11299  if(HistoCode == "D_MCs_ChNb"){axis_y_var_name = "Mean cor(s,s')";}
11300  if(HistoCode == "D_LFN_ChNb"){axis_y_var_name = "Low frequency noise";}
11301  if(HistoCode == "D_HFN_ChNb"){axis_y_var_name = "High frequency noise";}
11302  if(HistoCode == "D_SCs_ChNb"){axis_y_var_name = "Sigma of cor(s,s')";}
11303 
11304  if(HistoCode == "D_NOE_ChDs" ||
11305  HistoCode == "D_Ped_ChDs" || HistoCode == "D_TNo_ChDs" || HistoCode == "D_MCs_ChDs" ||
11306  HistoCode == "D_LFN_ChDs" || HistoCode == "D_HFN_ChDs" || HistoCode == "D_SCs_ChDs" )
11307  {
11308  if( fFapStexNumber > 0 ){axis_y_var_name = "number of crystals";}
11309  if( fFapStexNumber == 0 )
11310  {
11311  if( fFlagSubDet == "EB" ){axis_y_var_name = "number of towers";}
11312  if( fFlagSubDet == "EE" ){axis_y_var_name = "number of SC's";}
11313  }
11314  }
11315 
11316  if(HistoCode == "D_MSp_SpNb"){axis_y_var_name = "Sample mean";}
11317  if(HistoCode == "D_MSp_SpDs"){axis_y_var_name = "Number of samples";}
11318  if(HistoCode == "D_SSp_SpNb"){axis_y_var_name = "Sample sigma";}
11319  if(HistoCode == "D_SSp_SpDs"){axis_y_var_name = "Number of samples";}
11320  if(HistoCode == "D_Adc_EvNb"){axis_y_var_name = "Sample ADC value";}
11321  if(HistoCode == "D_Adc_EvDs"){axis_y_var_name = "Number of events";}
11322  if(HistoCode == "H_Ped_Date"){axis_y_var_name = "Pedestal";}
11323  if(HistoCode == "H_TNo_Date"){axis_y_var_name = "Total noise";}
11324  if(HistoCode == "H_MCs_Date"){axis_y_var_name = "Mean cor(s,s')";}
11325  if(HistoCode == "H_LFN_Date"){axis_y_var_name = "Low frequency noise";}
11326  if(HistoCode == "H_HFN_Date"){axis_y_var_name = "High frequency noise";}
11327  if(HistoCode == "H_SCs_Date"){axis_y_var_name = "Sigma cor(s,s')";}
11328 
11329  if(HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
11330  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
11331  {axis_y_var_name = "number of runs";}
11332 
11333  return axis_y_var_name;
11334 }
11335 //-------------------------------------------------------------------------------
11336 Axis_t TEcnaHistos::GetHistoXinf(const TString& HistoCode, const Int_t& HisSize, const TString& opt_plot)
11337 {
11338 // Set histo Xinf
11339 
11340  Axis_t xinf_his = (Axis_t)0;
11341 
11342  if(HistoCode == "D_NOE_ChNb"){xinf_his = (Axis_t)0.;}
11343  if(HistoCode == "D_Ped_ChNb"){xinf_his = (Axis_t)0.;}
11344  if(HistoCode == "D_TNo_ChNb"){xinf_his = (Axis_t)0.;}
11345  if(HistoCode == "D_MCs_ChNb"){xinf_his = (Axis_t)0.;}
11346  if(HistoCode == "D_LFN_ChNb"){xinf_his = (Axis_t)0.;}
11347  if(HistoCode == "D_HFN_ChNb"){xinf_his = (Axis_t)0.;}
11348  if(HistoCode == "D_SCs_ChNb"){xinf_his = (Axis_t)0.;}
11349  if(HistoCode == "D_MSp_SpNb"){xinf_his = (Axis_t)0.;}
11350  if(HistoCode == "D_SSp_SpNb"){xinf_his = (Axis_t)0.;}
11351  if(HistoCode == "D_Adc_EvNb"){xinf_his = (Axis_t)0.;}
11352 
11353  if(HistoCode == "D_NOE_ChDs"){xinf_his = (Axis_t)fD_NOE_ChNbYmin;} // D_XXX_YYDs = projection of D_XXX_YYNb
11354  if(HistoCode == "D_Ped_ChDs"){xinf_his = (Axis_t)fD_Ped_ChNbYmin;}
11355  if(HistoCode == "D_TNo_ChDs"){xinf_his = (Axis_t)fD_TNo_ChNbYmin;}
11356  if(HistoCode == "D_MCs_ChDs"){xinf_his = (Axis_t)fD_MCs_ChNbYmin;}
11357  if(HistoCode == "D_LFN_ChDs"){xinf_his = (Axis_t)fD_LFN_ChNbYmin;}
11358  if(HistoCode == "D_HFN_ChDs"){xinf_his = (Axis_t)fD_HFN_ChNbYmin;}
11359  if(HistoCode == "D_SCs_ChDs"){xinf_his = (Axis_t)fD_SCs_ChNbYmin;}
11360  if(HistoCode == "D_MSp_SpDs"){xinf_his = (Axis_t)fD_MSp_SpNbYmin;}
11361  if(HistoCode == "D_SSp_SpDs"){xinf_his = (Axis_t)fD_SSp_SpNbYmin;}
11362  if(HistoCode == "D_Adc_EvDs"){xinf_his = (Axis_t)fD_Adc_EvNbYmin;}
11363 
11364  if(HistoCode == "H_Ped_Date"){xinf_his = (Axis_t)0.;}
11365  if(HistoCode == "H_TNo_Date"){xinf_his = (Axis_t)0.;}
11366  if(HistoCode == "H_MCs_Date"){xinf_his = (Axis_t)0.;}
11367  if(HistoCode == "H_LFN_Date"){xinf_his = (Axis_t)0.;}
11368  if(HistoCode == "H_HFN_Date"){xinf_his = (Axis_t)0.;}
11369  if(HistoCode == "H_SCs_Date"){xinf_his = (Axis_t)0.;}
11370 
11371  if(HistoCode == "H_Ped_RuDs"){xinf_his = (Axis_t)fH_Ped_RuDsYmin;}
11372  if(HistoCode == "H_TNo_RuDs"){xinf_his = (Axis_t)fH_TNo_RuDsYmin;}
11373  if(HistoCode == "H_MCs_RuDs"){xinf_his = (Axis_t)fH_MCs_RuDsYmin;}
11374  if(HistoCode == "H_LFN_RuDs"){xinf_his = (Axis_t)fH_LFN_RuDsYmin;}
11375  if(HistoCode == "H_HFN_RuDs"){xinf_his = (Axis_t)fH_HFN_RuDsYmin;}
11376  if(HistoCode == "H_SCs_RuDs"){xinf_his = (Axis_t)fH_SCs_RuDsYmin;}
11377 
11378  return xinf_his;
11379 }
11380 
11381 Axis_t TEcnaHistos::GetHistoXsup(const TString& HistoCode, const Int_t& HisSize, const TString& opt_plot)
11382 {
11383 // Set histo Xsup
11384 
11385  Axis_t xsup_his = (Axis_t)0;
11386 
11387  if(HistoCode == "D_NOE_ChNb"){xsup_his = (Axis_t)HisSize;}
11388  if(HistoCode == "D_Ped_ChNb"){xsup_his = (Axis_t)HisSize;}
11389  if(HistoCode == "D_TNo_ChNb"){xsup_his = (Axis_t)HisSize;}
11390  if(HistoCode == "D_MCs_ChNb"){xsup_his = (Axis_t)HisSize;}
11391  if(HistoCode == "D_LFN_ChNb"){xsup_his = (Axis_t)HisSize;}
11392  if(HistoCode == "D_HFN_ChNb"){xsup_his = (Axis_t)HisSize;}
11393  if(HistoCode == "D_SCs_ChNb"){xsup_his = (Axis_t)HisSize;}
11394  if(HistoCode == "D_MSp_SpNb"){xsup_his = (Axis_t)HisSize;}
11395  if(HistoCode == "D_SSp_SpNb"){xsup_his = (Axis_t)HisSize;}
11396  if(HistoCode == "D_Adc_EvNb"){xsup_his = (Axis_t)(fFapReqNbOfEvts);}
11397 
11398  if(HistoCode == "D_NOE_ChDs"){xsup_his = (Axis_t)fD_NOE_ChNbYmax;}
11399  if(HistoCode == "D_Ped_ChDs"){xsup_his = (Axis_t)fD_Ped_ChNbYmax;}
11400  if(HistoCode == "D_TNo_ChDs"){xsup_his = (Axis_t)fD_TNo_ChNbYmax;}
11401  if(HistoCode == "D_MCs_ChDs"){xsup_his = (Axis_t)fD_MCs_ChNbYmax;}
11402  if(HistoCode == "D_LFN_ChDs"){xsup_his = (Axis_t)fD_LFN_ChNbYmax;}
11403  if(HistoCode == "D_HFN_ChDs"){xsup_his = (Axis_t)fD_HFN_ChNbYmax;}
11404  if(HistoCode == "D_SCs_ChDs"){xsup_his = (Axis_t)fD_SCs_ChNbYmax;}
11405  if(HistoCode == "D_MSp_SpDs"){xsup_his = (Axis_t)fD_MSp_SpNbYmax;}
11406  if(HistoCode == "D_SSp_SpDs"){xsup_his = (Axis_t)fD_SSp_SpNbYmax;}
11407  if(HistoCode == "D_Adc_EvDs"){xsup_his = (Axis_t)fD_Adc_EvNbYmax;}
11408 
11409  if(HistoCode == "H_Ped_Date"){xsup_his = (Axis_t)0.;}
11410  if(HistoCode == "H_TNo_Date"){xsup_his = (Axis_t)0.;}
11411  if(HistoCode == "H_MCs_Date"){xsup_his = (Axis_t)0.;}
11412  if(HistoCode == "H_LFN_Date"){xsup_his = (Axis_t)0.;}
11413  if(HistoCode == "H_HFN_Date"){xsup_his = (Axis_t)0.;}
11414  if(HistoCode == "H_SCs_Date"){xsup_his = (Axis_t)0.;}
11415 
11416  if(HistoCode == "H_Ped_RuDs"){xsup_his = (Axis_t)fH_Ped_RuDsYmax;}
11417  if(HistoCode == "H_TNo_RuDs"){xsup_his = (Axis_t)fH_TNo_RuDsYmax;}
11418  if(HistoCode == "H_MCs_RuDs"){xsup_his = (Axis_t)fH_MCs_RuDsYmax;}
11419  if(HistoCode == "H_LFN_RuDs"){xsup_his = (Axis_t)fH_LFN_RuDsYmax;}
11420  if(HistoCode == "H_HFN_RuDs"){xsup_his = (Axis_t)fH_HFN_RuDsYmax;}
11421  if(HistoCode == "H_SCs_RuDs"){xsup_his = (Axis_t)fH_SCs_RuDsYmax;}
11422 
11423  return xsup_his;
11424 }
11425 //-----------------------------------------------------------------------------------
11426 Int_t TEcnaHistos::GetHistoNumberOfBins(const TString& HistoCode, const Int_t& HisSize)
11427 {
11428 // Set histo number of bins
11429 
11430  Int_t nb_binx = HisSize;
11431  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
11432  if ( HistoType == "Proj" || HistoType == "SampProj" ||
11433  HistoType == "EvolProj" || HistoType == "H1BasicProj" )
11434  {nb_binx = fNbBinsProj;}
11435 
11436  return nb_binx;
11437 }
11438 //-----------------------------------------------------------------------------------
11439 void TEcnaHistos::FillHisto(TH1D* h_his0, const TVectorD& read_histo, const TString& HistoCode,
11440  const Int_t& HisSize)
11441 {
11442 // Fill histo
11443 
11444  h_his0->Reset();
11445 
11446  for(Int_t i=0; i<HisSize; i++)
11447  {
11448  Double_t his_val = (Double_t)0;
11449  Double_t xi = (Double_t)0;
11450  //................................................... Basic + Global
11451  if (HistoCode == "D_NOE_ChNb" || HistoCode == "D_Ped_ChNb" ||
11452  HistoCode == "D_LFN_ChNb" || HistoCode == "D_TNo_ChNb" ||
11453  HistoCode == "D_HFN_ChNb" || HistoCode == "D_MCs_ChNb" ||
11454  HistoCode == "D_SCs_ChNb" || HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" )
11455  {
11456  xi = (Double_t)i;
11457  his_val = (Double_t)read_histo[i];
11458  h_his0->Fill(xi, his_val);
11459  }
11460 
11461  //................................................... D_Adc_EvNb option
11462  if (HistoCode == "D_Adc_EvNb" )
11463  {
11464  xi = (Double_t)i;
11465  his_val = (Double_t)read_histo[i];
11466  h_his0->Fill(xi, his_val);
11467  }
11468  //................................................... Proj
11469  if (HistoCode == "D_NOE_ChDs" ||
11470  HistoCode == "D_Ped_ChDs" || HistoCode == "D_LFN_ChDs" ||
11471  HistoCode == "D_TNo_ChDs" || HistoCode == "D_HFN_ChDs" ||
11472  HistoCode == "D_MCs_ChDs" || HistoCode == "D_SCs_ChDs" ||
11473  HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpDs" ||
11474  HistoCode == "D_Adc_EvDs" )
11475  {
11476  his_val = (Double_t)read_histo[i];
11477  Double_t increment = (Double_t)1;
11478  h_his0->Fill(his_val, increment);
11479  }
11480 
11481  //................................................... EvolProj
11482  //
11483  // *=======> direct Fill in ViewHistime(...)
11484  //
11485  }
11486 }
11487 
11488 //===========================================================================
11489 //
11490 // SetXinfMemoFromValue(...), SetXsupMemoFromValue(...)
11491 // GetXsupValueFromMemo(...), GetXsupValueFromMemo(...)
11492 //
11493 //===========================================================================
11494 void TEcnaHistos::SetXinfMemoFromValue(const TString& HistoCode, const Double_t& value)
11495 {
11496  if( HistoCode == "D_NOE_ChNb"){fD_NOE_ChNbXinf = value;}
11497  if( HistoCode == "D_NOE_ChDs"){fD_NOE_ChDsXinf = value;}
11498  if( HistoCode == "D_Ped_ChNb"){fD_Ped_ChNbXinf = value;}
11499  if( HistoCode == "D_Ped_ChDs"){fD_Ped_ChDsXinf = value;}
11500  if( HistoCode == "D_TNo_ChNb"){fD_TNo_ChNbXinf = value;}
11501  if( HistoCode == "D_TNo_ChDs"){fD_TNo_ChDsXinf = value;}
11502  if( HistoCode == "D_MCs_ChNb"){fD_MCs_ChNbXinf = value;}
11503  if( HistoCode == "D_MCs_ChDs"){fD_MCs_ChDsXinf = value;}
11504  if( HistoCode == "D_LFN_ChNb"){fD_LFN_ChNbXinf = value;}
11505  if( HistoCode == "D_LFN_ChDs"){fD_LFN_ChDsXinf = value;}
11506  if( HistoCode == "D_HFN_ChNb"){fD_HFN_ChNbXinf = value;}
11507  if( HistoCode == "D_HFN_ChDs"){fD_HFN_ChDsXinf = value;}
11508  if( HistoCode == "D_SCs_ChNb"){fD_SCs_ChNbXinf = value;}
11509  if( HistoCode == "D_SCs_ChDs"){fD_SCs_ChDsXinf = value;}
11510  if( HistoCode == "D_MSp_SpNb"){fD_Ped_ChNbXinf = value;}
11511  if( HistoCode == "D_MSp_SpDs"){fD_Ped_ChDsXinf = value;}
11512  if( HistoCode == "D_SSp_SpNb"){fD_TNo_ChNbXinf = value;}
11513  if( HistoCode == "D_SSp_SpDs"){fD_TNo_ChDsXinf = value;}
11514  if( HistoCode == "D_Adc_EvNb"){fD_Ped_ChNbXinf = value;}
11515  if( HistoCode == "D_Adc_EvDs"){fD_Adc_EvDsXinf = value;}
11516  if( HistoCode == "H_Ped_Date"){fH_Ped_DateXinf = value;}
11517  if( HistoCode == "H_TNo_Date"){fH_TNo_DateXinf = value;}
11518  if( HistoCode == "H_MCs_Date"){fH_MCs_DateXinf = value;}
11519  if( HistoCode == "H_LFN_Date"){fH_LFN_DateXinf = value;}
11520  if( HistoCode == "H_HFN_Date"){fH_HFN_DateXinf = value;}
11521  if( HistoCode == "H_SCs_Date"){fH_SCs_DateXinf = value;}
11522  if( HistoCode == "H_Ped_RuDs"){fH_Ped_RuDsXinf = value;}
11523  if( HistoCode == "H_TNo_RuDs"){fH_TNo_RuDsXinf = value;}
11524  if( HistoCode == "H_MCs_RuDs"){fH_MCs_RuDsXinf = value;}
11525  if( HistoCode == "H_LFN_RuDs"){fH_LFN_RuDsXinf = value;}
11526  if( HistoCode == "H_HFN_RuDs"){fH_HFN_RuDsXinf = value;}
11527  if( HistoCode == "H_SCs_RuDs"){fH_SCs_RuDsXinf = value;}
11528 }// end of SetXinfMemoFromValue(...)
11529 
11532 
11533 void TEcnaHistos::SetXsupMemoFromValue(const TString& HistoCode, const Double_t& value)
11534 {
11535  if( HistoCode == "D_NOE_ChNb"){fD_NOE_ChNbXsup = value;}
11536  if( HistoCode == "D_NOE_ChDs"){fD_NOE_ChDsXsup = value;}
11537  if( HistoCode == "D_Ped_ChNb"){fD_Ped_ChNbXsup = value;}
11538  if( HistoCode == "D_Ped_ChDs"){fD_Ped_ChDsXsup = value;}
11539  if( HistoCode == "D_TNo_ChNb"){fD_TNo_ChNbXsup = value;}
11540  if( HistoCode == "D_TNo_ChDs"){fD_TNo_ChDsXsup = value;}
11541  if( HistoCode == "D_MCs_ChNb"){fD_MCs_ChNbXsup = value;}
11542  if( HistoCode == "D_MCs_ChDs"){fD_MCs_ChDsXsup = value;}
11543  if( HistoCode == "D_LFN_ChNb"){fD_LFN_ChNbXsup = value;}
11544  if( HistoCode == "D_LFN_ChDs"){fD_LFN_ChDsXsup = value;}
11545  if( HistoCode == "D_HFN_ChNb"){fD_HFN_ChNbXsup = value;}
11546  if( HistoCode == "D_HFN_ChDs"){fD_HFN_ChDsXsup = value;}
11547  if( HistoCode == "D_SCs_ChNb"){fD_SCs_ChNbXsup = value;}
11548  if( HistoCode == "D_SCs_ChDs"){fD_SCs_ChDsXsup = value;}
11549  if( HistoCode == "D_MSp_SpNb"){fD_Ped_ChNbXsup = value;}
11550  if( HistoCode == "D_MSp_SpDs"){fD_Ped_ChDsXsup = value;}
11551  if( HistoCode == "D_SSp_SpNb"){fD_TNo_ChNbXsup = value;}
11552  if( HistoCode == "D_SSp_SpDs"){fD_TNo_ChDsXsup = value;}
11553  if( HistoCode == "D_Adc_EvNb"){fD_Ped_ChNbXsup = value;}
11554  if( HistoCode == "D_Adc_EvDs"){fD_Adc_EvDsXsup = value;}
11555  if( HistoCode == "H_Ped_Date"){fH_Ped_DateXsup = value;}
11556  if( HistoCode == "H_TNo_Date"){fH_TNo_DateXsup = value;}
11557  if( HistoCode == "H_MCs_Date"){fH_MCs_DateXsup = value;}
11558  if( HistoCode == "H_LFN_Date"){fH_LFN_DateXsup = value;}
11559  if( HistoCode == "H_HFN_Date"){fH_HFN_DateXsup = value;}
11560  if( HistoCode == "H_SCs_Date"){fH_SCs_DateXsup = value;}
11561  if( HistoCode == "H_Ped_RuDs"){fH_Ped_RuDsXsup = value;}
11562  if( HistoCode == "H_TNo_RuDs"){fH_TNo_RuDsXsup = value;}
11563  if( HistoCode == "H_MCs_RuDs"){fH_MCs_RuDsXsup = value;}
11564  if( HistoCode == "H_LFN_RuDs"){fH_LFN_RuDsXsup = value;}
11565  if( HistoCode == "H_HFN_RuDs"){fH_HFN_RuDsXsup = value;}
11566  if( HistoCode == "H_SCs_RuDs"){fH_SCs_RuDsXsup = value;}
11567 }// end of SetXsupMemoFromValue(...)
11568 
11571 
11572 Double_t TEcnaHistos::GetXinfValueFromMemo(const TString& HistoCode)
11573 {
11574  Double_t val_inf = (Double_t)0.;
11575 
11576  if( HistoCode == "D_NOE_ChNb"){val_inf = fD_NOE_ChNbXinf;}
11577  if( HistoCode == "D_NOE_ChDs"){val_inf = fD_NOE_ChDsXinf;}
11578  if( HistoCode == "D_Ped_ChNb"){val_inf = fD_Ped_ChNbXinf;}
11579  if( HistoCode == "D_Ped_ChDs"){val_inf = fD_Ped_ChDsXinf;}
11580  if( HistoCode == "D_TNo_ChNb"){val_inf = fD_TNo_ChNbXinf;}
11581  if( HistoCode == "D_TNo_ChDs"){val_inf = fD_TNo_ChDsXinf;}
11582  if( HistoCode == "D_MCs_ChNb"){val_inf = fD_MCs_ChNbXinf;}
11583  if( HistoCode == "D_MCs_ChDs"){val_inf = fD_MCs_ChDsXinf;}
11584  if( HistoCode == "D_LFN_ChNb"){val_inf = fD_LFN_ChNbXinf;}
11585  if( HistoCode == "D_LFN_ChDs"){val_inf = fD_LFN_ChDsXinf;}
11586  if( HistoCode == "D_HFN_ChNb"){val_inf = fD_HFN_ChNbXinf;}
11587  if( HistoCode == "D_HFN_ChDs"){val_inf = fD_HFN_ChDsXinf;}
11588  if( HistoCode == "D_SCs_ChNb"){val_inf = fD_SCs_ChNbXinf;}
11589  if( HistoCode == "D_SCs_ChDs"){val_inf = fD_SCs_ChDsXinf;}
11590  if( HistoCode == "D_MSp_SpNb"){val_inf = fD_Ped_ChNbXinf;}
11591  if( HistoCode == "D_MSp_SpDs"){val_inf = fD_Ped_ChDsXinf;}
11592  if( HistoCode == "D_SSp_SpNb"){val_inf = fD_TNo_ChNbXinf;}
11593  if( HistoCode == "D_SSp_SpDs"){val_inf = fD_TNo_ChDsXinf;}
11594  if( HistoCode == "D_Adc_EvNb"){val_inf = fD_Adc_EvNbXinf;}
11595  if( HistoCode == "D_Adc_EvDs"){val_inf = fD_Adc_EvDsXinf;}
11596  if( HistoCode == "H_Ped_Date"){val_inf = fH_Ped_DateXinf;}
11597  if( HistoCode == "H_TNo_Date"){val_inf = fH_TNo_DateXinf;}
11598  if( HistoCode == "H_MCs_Date"){val_inf = fH_MCs_DateXinf;}
11599  if( HistoCode == "H_LFN_Date"){val_inf = fH_LFN_DateXinf;}
11600  if( HistoCode == "H_HFN_Date"){val_inf = fH_HFN_DateXinf;}
11601  if( HistoCode == "H_SCs_Date"){val_inf = fH_SCs_DateXinf;}
11602  if( HistoCode == "H_Ped_RuDs"){val_inf = fH_Ped_RuDsXinf;}
11603  if( HistoCode == "H_TNo_RuDs"){val_inf = fH_TNo_RuDsXinf;}
11604  if( HistoCode == "H_MCs_RuDs"){val_inf = fH_MCs_RuDsXinf;}
11605  if( HistoCode == "H_LFN_RuDs"){val_inf = fH_LFN_RuDsXinf;}
11606  if( HistoCode == "H_HFN_RuDs"){val_inf = fH_HFN_RuDsXinf;}
11607  if( HistoCode == "H_SCs_RuDs"){val_inf = fH_SCs_RuDsXinf;}
11608  return val_inf;
11609 }// end of GetXinfValueFromMemo(...)
11610 
11612 {return fH1SameOnePlotXinf;}
11613 
11614 Double_t TEcnaHistos::GetXsupValueFromMemo(const TString& HistoCode)
11615 {
11616  Double_t val_sup = (Double_t)0.;
11617 
11618  if( HistoCode == "D_NOE_ChNb"){val_sup = fD_NOE_ChNbXsup;}
11619  if( HistoCode == "D_NOE_ChDs"){val_sup = fD_NOE_ChDsXsup;}
11620  if( HistoCode == "D_Ped_ChNb"){val_sup = fD_Ped_ChNbXsup;}
11621  if( HistoCode == "D_Ped_ChDs"){val_sup = fD_Ped_ChDsXsup;}
11622  if( HistoCode == "D_TNo_ChNb"){val_sup = fD_TNo_ChNbXsup;}
11623  if( HistoCode == "D_TNo_ChDs"){val_sup = fD_TNo_ChDsXsup;}
11624  if( HistoCode == "D_MCs_ChNb"){val_sup = fD_MCs_ChNbXsup;}
11625  if( HistoCode == "D_MCs_ChDs"){val_sup = fD_MCs_ChDsXsup;}
11626  if( HistoCode == "D_LFN_ChNb"){val_sup = fD_LFN_ChNbXsup;}
11627  if( HistoCode == "D_LFN_ChDs"){val_sup = fD_LFN_ChDsXsup;}
11628  if( HistoCode == "D_HFN_ChNb"){val_sup = fD_HFN_ChNbXsup;}
11629  if( HistoCode == "D_HFN_ChDs"){val_sup = fD_HFN_ChDsXsup;}
11630  if( HistoCode == "D_SCs_ChNb"){val_sup = fD_SCs_ChNbXsup;}
11631  if( HistoCode == "D_SCs_ChDs"){val_sup = fD_SCs_ChDsXsup;}
11632  if( HistoCode == "D_MSp_SpNb"){val_sup = fD_Ped_ChNbXsup;}
11633  if( HistoCode == "D_MSp_SpDs"){val_sup = fD_Ped_ChDsXsup;}
11634  if( HistoCode == "D_SSp_SpNb"){val_sup = fD_TNo_ChNbXsup;}
11635  if( HistoCode == "D_SSp_SpDs"){val_sup = fD_TNo_ChDsXsup;}
11636  if( HistoCode == "D_Adc_EvNb"){val_sup = fD_Adc_EvNbXsup;}
11637  if( HistoCode == "D_Adc_EvDs"){val_sup = fD_Adc_EvDsXsup;}
11638  if( HistoCode == "H_Ped_Date"){val_sup = fH_Ped_DateXsup;}
11639  if( HistoCode == "H_TNo_Date"){val_sup = fH_TNo_DateXsup;}
11640  if( HistoCode == "H_MCs_Date"){val_sup = fH_MCs_DateXsup;}
11641  if( HistoCode == "H_LFN_Date"){val_sup = fH_LFN_DateXsup;}
11642  if( HistoCode == "H_HFN_Date"){val_sup = fH_HFN_DateXsup;}
11643  if( HistoCode == "H_SCs_Date"){val_sup = fH_SCs_DateXsup;}
11644  if( HistoCode == "H_Ped_RuDs"){val_sup = fH_Ped_RuDsXsup;}
11645  if( HistoCode == "H_TNo_RuDs"){val_sup = fH_TNo_RuDsXsup;}
11646  if( HistoCode == "H_MCs_RuDs"){val_sup = fH_MCs_RuDsXsup;}
11647  if( HistoCode == "H_LFN_RuDs"){val_sup = fH_LFN_RuDsXsup;}
11648  if( HistoCode == "H_HFN_RuDs"){val_sup = fH_HFN_RuDsXsup;}
11649  if( HistoCode == "H_SCs_RuDs"){val_sup = fH_SCs_RuDsXsup;}
11650  return val_sup;
11651 }// end of GetXsupValueFromMemo(...)
11652 
11654 {return fH1SameOnePlotXsup;}
11655 
11656 //-------------------------------------------------------------------------------------------
11657 //
11658 // SetHistoMin, SetHistoMax, SetAllYminYmaxMemoFromDefaultValues
11659 //
11660 //-------------------------------------------------------------------------------------------
11663 
11666 
11668 {
11669 //.......... Default values for histo min and max
11670 
11671  SetYminMemoFromValue("D_NOE_ChNb", fCnaParHistos->GetYminDefaultValue("D_NOE_ChNb"));
11672  SetYmaxMemoFromValue("D_NOE_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_NOE_ChNb"));
11673 
11674  SetYminMemoFromValue("D_NOE_ChDs", fCnaParHistos->GetYminDefaultValue("D_NOE_ChDs"));
11675  SetYmaxMemoFromValue("D_NOE_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_NOE_ChDs"));
11676 
11677  SetYminMemoFromValue("D_Ped_ChNb", fCnaParHistos->GetYminDefaultValue("D_Ped_ChNb"));
11678  SetYmaxMemoFromValue("D_Ped_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_Ped_ChNb"));
11679 
11680  SetYminMemoFromValue("D_Ped_ChDs", fCnaParHistos->GetYminDefaultValue("D_Ped_ChDs"));
11681  SetYmaxMemoFromValue("D_Ped_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_Ped_ChDs"));
11682 
11683  SetYminMemoFromValue("D_TNo_ChNb", fCnaParHistos->GetYminDefaultValue("D_TNo_ChNb"));
11684  SetYmaxMemoFromValue("D_TNo_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_TNo_ChNb"));
11685 
11686  SetYminMemoFromValue("D_TNo_ChDs", fCnaParHistos->GetYminDefaultValue("D_TNo_ChDs"));
11687  SetYmaxMemoFromValue("D_TNo_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_TNo_ChDs"));
11688 
11689  SetYminMemoFromValue("D_MCs_ChNb", fCnaParHistos->GetYminDefaultValue("D_MCs_ChNb"));
11690  SetYmaxMemoFromValue("D_MCs_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_MCs_ChNb"));
11691 
11692  SetYminMemoFromValue("D_MCs_ChDs", fCnaParHistos->GetYminDefaultValue("D_MCs_ChDs"));
11693  SetYmaxMemoFromValue("D_MCs_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_MCs_ChDs"));
11694 
11695  SetYminMemoFromValue("D_LFN_ChNb", fCnaParHistos->GetYminDefaultValue("D_LFN_ChNb"));
11696  SetYmaxMemoFromValue("D_LFN_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_LFN_ChNb"));
11697 
11698  SetYminMemoFromValue("D_LFN_ChDs", fCnaParHistos->GetYminDefaultValue("D_LFN_ChDs"));
11699  SetYmaxMemoFromValue("D_LFN_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_LFN_ChDs"));
11700 
11701  SetYminMemoFromValue("D_HFN_ChNb", fCnaParHistos->GetYminDefaultValue("D_HFN_ChNb"));
11702  SetYmaxMemoFromValue("D_HFN_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_HFN_ChNb"));
11703 
11704  SetYminMemoFromValue("D_HFN_ChDs", fCnaParHistos->GetYminDefaultValue("D_HFN_ChDs"));
11705  SetYmaxMemoFromValue("D_HFN_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_HFN_ChDs"));
11706 
11707  SetYminMemoFromValue("D_SCs_ChNb", fCnaParHistos->GetYminDefaultValue("D_SCs_ChNb"));
11708  SetYmaxMemoFromValue("D_SCs_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_SCs_ChNb"));
11709 
11710  SetYminMemoFromValue("D_SCs_ChDs", fCnaParHistos->GetYminDefaultValue("D_SCs_ChDs"));
11711  SetYmaxMemoFromValue("D_SCs_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_SCs_ChDs"));
11712 
11713  SetYminMemoFromValue("D_MSp_SpNb", fCnaParHistos->GetYminDefaultValue("D_MSp_SpNb"));
11714  SetYmaxMemoFromValue("D_MSp_SpNb", fCnaParHistos->GetYmaxDefaultValue("D_MSp_SpNb"));
11715 
11716  SetYminMemoFromValue("D_MSp_SpDs", fCnaParHistos->GetYminDefaultValue("D_MSp_SpDs"));
11717  SetYmaxMemoFromValue("D_MSp_SpDs", fCnaParHistos->GetYmaxDefaultValue("D_MSp_SpDs"));
11718 
11719  SetYminMemoFromValue("D_SSp_SpNb", fCnaParHistos->GetYminDefaultValue("D_SSp_SpNb"));
11720  SetYmaxMemoFromValue("D_SSp_SpNb", fCnaParHistos->GetYmaxDefaultValue("D_SSp_SpNb"));
11721 
11722  SetYminMemoFromValue("D_SSp_SpDs", fCnaParHistos->GetYminDefaultValue("D_SSp_SpDs"));
11723  SetYmaxMemoFromValue("D_SSp_SpDs", fCnaParHistos->GetYmaxDefaultValue("D_SSp_SpDs"));
11724 
11725  SetYminMemoFromValue("D_Adc_EvDs", fCnaParHistos->GetYminDefaultValue("D_Adc_EvDs"));
11726  SetYmaxMemoFromValue("D_Adc_EvDs", fCnaParHistos->GetYmaxDefaultValue("D_Adc_EvDs"));
11727 
11728  SetYminMemoFromValue("D_Adc_EvNb", fCnaParHistos->GetYminDefaultValue("D_Adc_EvNb"));
11729  SetYmaxMemoFromValue("D_Adc_EvNb", fCnaParHistos->GetYmaxDefaultValue("D_Adc_EvNb"));
11730 
11731  SetYminMemoFromValue("H_Ped_Date", fCnaParHistos->GetYminDefaultValue("H_Ped_Date"));
11732  SetYmaxMemoFromValue("H_Ped_Date", fCnaParHistos->GetYmaxDefaultValue("H_Ped_Date"));
11733 
11734  SetYminMemoFromValue("H_TNo_Date", fCnaParHistos->GetYminDefaultValue("H_TNo_Date"));
11735  SetYmaxMemoFromValue("H_TNo_Date", fCnaParHistos->GetYmaxDefaultValue("H_TNo_Date"));
11736 
11737  SetYminMemoFromValue("H_LFN_Date", fCnaParHistos->GetYminDefaultValue("H_LFN_Date"));
11738  SetYmaxMemoFromValue("H_LFN_Date", fCnaParHistos->GetYmaxDefaultValue("H_LFN_Date"));
11739 
11740  SetYminMemoFromValue("H_HFN_Date", fCnaParHistos->GetYminDefaultValue("H_HFN_Date"));
11741  SetYmaxMemoFromValue("H_HFN_Date", fCnaParHistos->GetYmaxDefaultValue("H_HFN_Date"));
11742 
11743  SetYminMemoFromValue("H_MCs_Date", fCnaParHistos->GetYminDefaultValue("H_MCs_Date"));
11744  SetYmaxMemoFromValue("H_MCs_Date", fCnaParHistos->GetYmaxDefaultValue("H_MCs_Date"));
11745 
11746  SetYminMemoFromValue("H_SCs_Date", fCnaParHistos->GetYminDefaultValue("H_SCs_Date"));
11747  SetYmaxMemoFromValue("H_SCs_Date", fCnaParHistos->GetYmaxDefaultValue("H_SCs_Date"));
11748 
11749  SetYminMemoFromValue("H_Ped_RuDs", fCnaParHistos->GetYminDefaultValue("H_Ped_RuDs"));
11750  SetYmaxMemoFromValue("H_Ped_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_Ped_RuDs"));
11751 
11752  SetYminMemoFromValue("H_TNo_RuDs", fCnaParHistos->GetYminDefaultValue("H_TNo_RuDs"));
11753  SetYmaxMemoFromValue("H_TNo_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_TNo_RuDs"));
11754 
11755  SetYminMemoFromValue("H_LFN_RuDs", fCnaParHistos->GetYminDefaultValue("H_LFN_RuDs"));
11756  SetYmaxMemoFromValue("H_LFN_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_LFN_RuDs"));
11757 
11758  SetYminMemoFromValue("H_HFN_RuDs", fCnaParHistos->GetYminDefaultValue("H_HFN_RuDs"));
11759  SetYmaxMemoFromValue("H_HFN_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_HFN_RuDs"));
11760 
11761  SetYminMemoFromValue("H_MCs_RuDs", fCnaParHistos->GetYminDefaultValue("H_MCs_RuDs"));
11762  SetYmaxMemoFromValue("H_MCs_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_MCs_RuDs"));
11763 
11764  SetYminMemoFromValue("H_SCs_RuDs", fCnaParHistos->GetYminDefaultValue("H_SCs_RuDs"));
11765  SetYmaxMemoFromValue("H_SCs_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_SCs_RuDs"));
11766 
11767  SetYminMemoFromValue("H2LFccMosMatrix", fCnaParHistos->GetYminDefaultValue("H2LFccMosMatrix"));
11768  SetYmaxMemoFromValue("H2LFccMosMatrix", fCnaParHistos->GetYmaxDefaultValue("H2LFccMosMatrix"));
11769 
11770  SetYminMemoFromValue("H2HFccMosMatrix", fCnaParHistos->GetYminDefaultValue("H2HFccMosMatrix"));
11771  SetYmaxMemoFromValue("H2HFccMosMatrix", fCnaParHistos->GetYmaxDefaultValue("H2HFccMosMatrix"));
11772 
11773  SetYminMemoFromValue("H2CorccInStins", fCnaParHistos->GetYminDefaultValue("H2CorccInStins"));
11774  SetYmaxMemoFromValue("H2CorccInStins", fCnaParHistos->GetYmaxDefaultValue("H2CorccInStins"));
11775 
11776  //........... set user's min and max flags to "OFF" and values to -1 and +1 (just to have fUserHistoMin < fUserHistoMax)
11777  fUserHistoMin = -1.; fFlagUserHistoMin = "OFF";
11778  fUserHistoMax = 1.; fFlagUserHistoMax = "OFF";
11779 } // end of SetAllYminYmaxMemoFromDefaultValues()
11780 
11781 //===========================================================================
11782 //
11783 // SetYminMemoFromValue(...), SetYmaxMemoFromValue(...)
11784 // GetYminValueFromMemo(...), GetYmaxValueFromMemo(...)
11785 //
11786 //===========================================================================
11787 void TEcnaHistos::SetYminMemoFromValue(const TString& HistoCode, const Double_t& value)
11788 {
11789  if( HistoCode == "D_NOE_ChNb" ){fD_NOE_ChNbYmin = value;}
11790  if( HistoCode == "D_NOE_ChDs" ){fD_NOE_ChDsYmin = value;}
11791  if( HistoCode == "D_Ped_ChNb" ){fD_Ped_ChNbYmin = value;}
11792  if( HistoCode == "D_Ped_ChDs" ){fD_Ped_ChDsYmin = value;}
11793  if( HistoCode == "D_TNo_ChNb" ){fD_TNo_ChNbYmin = value;}
11794  if( HistoCode == "D_TNo_ChDs" ){fD_TNo_ChDsYmin = value;}
11795  if( HistoCode == "D_MCs_ChNb" ){fD_MCs_ChNbYmin = value;}
11796  if( HistoCode == "D_MCs_ChDs" ){fD_MCs_ChDsYmin = value;}
11797  if( HistoCode == "D_LFN_ChNb" ){fD_LFN_ChNbYmin = value;}
11798  if( HistoCode == "D_LFN_ChDs" ){fD_LFN_ChDsYmin = value;}
11799  if( HistoCode == "D_HFN_ChNb" ){fD_HFN_ChNbYmin = value;}
11800  if( HistoCode == "D_HFN_ChDs" ){fD_HFN_ChDsYmin = value;}
11801  if( HistoCode == "D_SCs_ChNb" ){fD_SCs_ChNbYmin = value;}
11802  if( HistoCode == "D_SCs_ChDs" ){fD_SCs_ChDsYmin = value;}
11803  if( HistoCode == "D_MSp_SpNb" ){fD_Ped_ChNbYmin = value;}
11804  if( HistoCode == "D_MSp_SpDs" ){fD_Ped_ChDsYmin = value;}
11805  if( HistoCode == "D_SSp_SpNb" ){fD_TNo_ChNbYmin = value;}
11806  if( HistoCode == "D_SSp_SpDs" ){fD_TNo_ChDsYmin = value;}
11807  if( HistoCode == "D_Adc_EvNb" ){fD_Ped_ChNbYmin = value;}
11808  if( HistoCode == "D_Adc_EvDs" ){fD_Adc_EvDsYmin = value;}
11809  if( HistoCode == "H_Ped_Date" ){fH_Ped_DateYmin = value;}
11810  if( HistoCode == "H_TNo_Date" ){fH_TNo_DateYmin = value;}
11811  if( HistoCode == "H_MCs_Date" ){fH_MCs_DateYmin = value;}
11812  if( HistoCode == "H_LFN_Date" ){fH_LFN_DateYmin = value;}
11813  if( HistoCode == "H_HFN_Date" ){fH_HFN_DateYmin = value;}
11814  if( HistoCode == "H_SCs_Date" ){fH_SCs_DateYmin = value;}
11815  if( HistoCode == "H_Ped_RuDs" ){fH_Ped_RuDsYmin = value;}
11816  if( HistoCode == "H_TNo_RuDs" ){fH_TNo_RuDsYmin = value;}
11817  if( HistoCode == "H_MCs_RuDs" ){fH_MCs_RuDsYmin = value;}
11818  if( HistoCode == "H_LFN_RuDs" ){fH_LFN_RuDsYmin = value;}
11819  if( HistoCode == "H_HFN_RuDs" ){fH_HFN_RuDsYmin = value;}
11820  if( HistoCode == "H_SCs_RuDs" ){fH_SCs_RuDsYmin = value;}
11821  if( HistoCode == "H2LFccMosMatrix" ){fH2LFccMosMatrixYmin = value;}
11822  if( HistoCode == "H2HFccMosMatrix" ){fH2HFccMosMatrixYmin = value;}
11823  if( HistoCode == "H2CorccInStins" ){fH2CorccInStinsYmin = value;}
11824 }// end of SetYminMemoFromValue(...)
11825 
11826 void TEcnaHistos::SetYmaxMemoFromValue(const TString& HistoCode, const Double_t& value)
11827 {
11828  if( HistoCode == "D_NOE_ChNb" ){fD_NOE_ChNbYmax = value;}
11829  if( HistoCode == "D_NOE_ChDs" ){fD_NOE_ChDsYmax = value;}
11830  if( HistoCode == "D_Ped_ChNb" ){fD_Ped_ChNbYmax = value;}
11831  if( HistoCode == "D_Ped_ChDs" ){fD_Ped_ChDsYmax = value;}
11832  if( HistoCode == "D_TNo_ChNb" ){fD_TNo_ChNbYmax = value;}
11833  if( HistoCode == "D_TNo_ChDs" ){fD_TNo_ChDsYmax = value;}
11834  if( HistoCode == "D_MCs_ChNb" ){fD_MCs_ChNbYmax = value;}
11835  if( HistoCode == "D_MCs_ChDs" ){fD_MCs_ChDsYmax = value;}
11836  if( HistoCode == "D_LFN_ChNb" ){fD_LFN_ChNbYmax = value;}
11837  if( HistoCode == "D_LFN_ChDs" ){fD_LFN_ChDsYmax = value;}
11838  if( HistoCode == "D_HFN_ChNb" ){fD_HFN_ChNbYmax = value;}
11839  if( HistoCode == "D_HFN_ChDs" ){fD_HFN_ChDsYmax = value;}
11840  if( HistoCode == "D_SCs_ChNb" ){fD_SCs_ChNbYmax = value;}
11841  if( HistoCode == "D_SCs_ChDs" ){fD_SCs_ChDsYmax = value;}
11842  if( HistoCode == "D_MSp_SpNb" ){fD_Ped_ChNbYmax = value;}
11843  if( HistoCode == "D_MSp_SpDs" ){fD_Ped_ChDsYmax = value;}
11844  if( HistoCode == "D_SSp_SpNb" ){fD_TNo_ChNbYmax = value;}
11845  if( HistoCode == "D_SSp_SpDs" ){fD_TNo_ChDsYmax = value;}
11846  if( HistoCode == "D_Adc_EvNb" ){fD_Ped_ChNbYmax = value;}
11847  if( HistoCode == "D_Adc_EvDs" ){fD_Ped_ChDsYmax = value;}
11848  if( HistoCode == "H_Ped_Date" ){fH_Ped_DateYmax = value;}
11849  if( HistoCode == "H_TNo_Date" ){fH_TNo_DateYmax = value;}
11850  if( HistoCode == "H_MCs_Date" ){fH_MCs_DateYmax = value;}
11851  if( HistoCode == "H_LFN_Date" ){fH_LFN_DateYmax = value;}
11852  if( HistoCode == "H_HFN_Date" ){fH_HFN_DateYmax = value;}
11853  if( HistoCode == "H_SCs_Date" ){fH_SCs_DateYmax = value;}
11854  if( HistoCode == "H_Ped_RuDs" ){fH_Ped_RuDsYmax = value;}
11855  if( HistoCode == "H_TNo_RuDs" ){fH_TNo_RuDsYmax = value;}
11856  if( HistoCode == "H_MCs_RuDs" ){fH_MCs_RuDsYmax = value;}
11857  if( HistoCode == "H_LFN_RuDs" ){fH_LFN_RuDsYmax = value;}
11858  if( HistoCode == "H_HFN_RuDs" ){fH_HFN_RuDsYmax = value;}
11859  if( HistoCode == "H_SCs_RuDs" ){fH_SCs_RuDsYmax = value;}
11860  if( HistoCode == "H2LFccMosMatrix" ){fH2LFccMosMatrixYmax = value;}
11861  if( HistoCode == "H2HFccMosMatrix" ){fH2HFccMosMatrixYmax = value;}
11862  if( HistoCode == "H2CorccInStins" ){fH2CorccInStinsYmax = value;}
11863 }// end of SetYmaxMemoFromValue(...)
11864 
11865 Double_t TEcnaHistos::GetYminValueFromMemo(const TString& HistoCode)
11866 {
11867  Double_t val_min = (Double_t)0.;
11868  Double_t val_min_proj = (Double_t)0.1;
11869 
11870  if( HistoCode == "D_NOE_ChNb" ){val_min = fD_NOE_ChNbYmin;}
11871  if( HistoCode == "D_NOE_ChDs" ){val_min = val_min_proj;}
11872  if( HistoCode == "D_Ped_ChNb" ){val_min = fD_Ped_ChNbYmin;}
11873  if( HistoCode == "D_Ped_ChDs" ){val_min = val_min_proj;}
11874  if( HistoCode == "D_TNo_ChNb" ){val_min = fD_TNo_ChNbYmin;}
11875  if( HistoCode == "D_TNo_ChDs" ){val_min = val_min_proj;}
11876  if( HistoCode == "D_MCs_ChNb" ){val_min = fD_MCs_ChNbYmin;}
11877  if( HistoCode == "D_MCs_ChDs" ){val_min = val_min_proj;}
11878  if( HistoCode == "D_LFN_ChNb" ){val_min = fD_LFN_ChNbYmin;}
11879  if( HistoCode == "D_LFN_ChDs" ){val_min = val_min_proj;}
11880  if( HistoCode == "D_HFN_ChNb" ){val_min = fD_HFN_ChNbYmin;}
11881  if( HistoCode == "D_HFN_ChDs" ){val_min = val_min_proj;}
11882  if( HistoCode == "D_SCs_ChNb" ){val_min = fD_SCs_ChNbYmin;}
11883  if( HistoCode == "D_SCs_ChDs" ){val_min = val_min_proj;}
11884  if( HistoCode == "D_MSp_SpNb" ){val_min = fD_Ped_ChNbYmin;}
11885  if( HistoCode == "D_MSp_SpDs" ){val_min = val_min_proj;}
11886  if( HistoCode == "D_SSp_SpNb" ){val_min = fD_TNo_ChNbYmin;}
11887  if( HistoCode == "D_SSp_SpDs" ){val_min = val_min_proj;}
11888  if( HistoCode == "D_Adc_EvNb" ){val_min = fD_Ped_ChNbYmin;}
11889  if( HistoCode == "D_Adc_EvDs" ){val_min = val_min_proj;}
11890  if( HistoCode == "H_Ped_Date" ){val_min = fH_Ped_DateYmin;}
11891  if( HistoCode == "H_TNo_Date" ){val_min = fH_TNo_DateYmin;}
11892  if( HistoCode == "H_MCs_Date" ){val_min = fH_MCs_DateYmin;}
11893  if( HistoCode == "H_LFN_Date" ){val_min = fH_LFN_DateYmin;}
11894  if( HistoCode == "H_HFN_Date" ){val_min = fH_HFN_DateYmin;}
11895  if( HistoCode == "H_SCs_Date" ){val_min = fH_SCs_DateYmin;}
11896  if( HistoCode == "H_Ped_RuDs" ){val_min = fH_Ped_RuDsYmin;}
11897  if( HistoCode == "H_TNo_RuDs" ){val_min = fH_TNo_RuDsYmin;}
11898  if( HistoCode == "H_MCs_RuDs" ){val_min = fH_MCs_RuDsYmin;}
11899  if( HistoCode == "H_LFN_RuDs" ){val_min = fH_LFN_RuDsYmin;}
11900  if( HistoCode == "H_HFN_RuDs" ){val_min = fH_HFN_RuDsYmin;}
11901  if( HistoCode == "H_SCs_RuDs" ){val_min = fH_SCs_RuDsYmin;}
11902  if( HistoCode == "H2LFccMosMatrix" ){val_min = fH2LFccMosMatrixYmin;}
11903  if( HistoCode == "H2HFccMosMatrix" ){val_min = fH2HFccMosMatrixYmin;}
11904  if( HistoCode == "H2CorccInStins" ){val_min = fH2CorccInStinsYmin;}
11905  return val_min;
11906 }// end of GetYminValueFromMemo(...)
11907 
11908 Double_t TEcnaHistos::GetYmaxValueFromMemo(const TString& HistoCode)
11909 {
11910  Double_t val_max = (Double_t)0.;
11911  Double_t val_max_proj = (Double_t)2000.;
11912 
11913  if( HistoCode == "D_NOE_ChNb" ){val_max = fD_NOE_ChNbYmax;}
11914  if( HistoCode == "D_NOE_ChDs" ){val_max = val_max_proj;}
11915  if( HistoCode == "D_Ped_ChNb" ){val_max = fD_Ped_ChNbYmax;}
11916  if( HistoCode == "D_Ped_ChDs" ){val_max = val_max_proj;}
11917  if( HistoCode == "D_TNo_ChNb" ){val_max = fD_TNo_ChNbYmax;}
11918  if( HistoCode == "D_TNo_ChDs" ){val_max = val_max_proj;}
11919  if( HistoCode == "D_MCs_ChNb" ){val_max = fD_MCs_ChNbYmax;}
11920  if( HistoCode == "D_MCs_ChDs" ){val_max = val_max_proj;}
11921  if( HistoCode == "D_LFN_ChNb" ){val_max = fD_LFN_ChNbYmax;}
11922  if( HistoCode == "D_LFN_ChDs" ){val_max = val_max_proj;}
11923  if( HistoCode == "D_HFN_ChNb" ){val_max = fD_HFN_ChNbYmax;}
11924  if( HistoCode == "D_HFN_ChDs" ){val_max = val_max_proj;}
11925  if( HistoCode == "D_SCs_ChNb" ){val_max = fD_SCs_ChNbYmax;}
11926  if( HistoCode == "D_SCs_ChDs" ){val_max = val_max_proj;}
11927  if( HistoCode == "D_MSp_SpNb" ){val_max = fD_Ped_ChNbYmax;}
11928  if( HistoCode == "D_MSp_SpDs" ){val_max = val_max_proj;}
11929  if( HistoCode == "D_SSp_SpNb" ){val_max = fD_TNo_ChNbYmax;}
11930  if( HistoCode == "D_SSp_SpDs" ){val_max = val_max_proj;}
11931  if( HistoCode == "D_Adc_EvNb" ){val_max = fD_Ped_ChNbYmax;}
11932  if( HistoCode == "D_Adc_EvDs" ){val_max = val_max_proj;}
11933  if( HistoCode == "H_Ped_Date" ){val_max = fH_Ped_DateYmax;}
11934  if( HistoCode == "H_TNo_Date" ){val_max = fH_TNo_DateYmax;}
11935  if( HistoCode == "H_MCs_Date" ){val_max = fH_MCs_DateYmax;}
11936  if( HistoCode == "H_LFN_Date" ){val_max = fH_LFN_DateYmax;}
11937  if( HistoCode == "H_HFN_Date" ){val_max = fH_HFN_DateYmax;}
11938  if( HistoCode == "H_SCs_Date" ){val_max = fH_SCs_DateYmax;}
11939  if( HistoCode == "H_Ped_RuDs" ){val_max = fH_Ped_RuDsYmax;}
11940  if( HistoCode == "H_TNo_RuDs" ){val_max = fH_TNo_RuDsYmax;}
11941  if( HistoCode == "H_MCs_RuDs" ){val_max = fH_MCs_RuDsYmax;}
11942  if( HistoCode == "H_LFN_RuDs" ){val_max = fH_LFN_RuDsYmax;}
11943  if( HistoCode == "H_HFN_RuDs" ){val_max = fH_HFN_RuDsYmax;}
11944  if( HistoCode == "H_SCs_RuDs" ){val_max = fH_SCs_RuDsYmax;}
11945  if( HistoCode == "H2LFccMosMatrix" ){val_max = fH2LFccMosMatrixYmax;}
11946  if( HistoCode == "H2HFccMosMatrix" ){val_max = fH2HFccMosMatrixYmax;}
11947  if( HistoCode == "H2CorccInStins" ){val_max = fH2CorccInStinsYmax;}
11948  return val_max;
11949 }// end of GetYmaxValueFromMemo(...)
11950 
11951 void TEcnaHistos::SetYminMemoFromPreviousMemo(const TString& HistoCode)
11952 {
11953 // InitQuantity Ymin
11954 
11955  if( HistoCode == "D_NOE_ChNb" ){fD_NOE_ChNbYmin = GetYminValueFromMemo("D_NOE_ChNb");}
11956  if( HistoCode == "D_NOE_ChDs" ){fD_NOE_ChDsYmin = GetYminValueFromMemo("D_NOE_ChDs");}
11957  if( HistoCode == "D_Ped_ChNb" ){fD_Ped_ChNbYmin = GetYminValueFromMemo("D_Ped_ChNb");}
11958  if( HistoCode == "D_Ped_ChDs" ){fD_Ped_ChDsYmin = GetYminValueFromMemo("D_Ped_ChDs");}
11959  if( HistoCode == "D_TNo_ChNb" ){fD_TNo_ChNbYmin = GetYminValueFromMemo("D_TNo_ChNb");}
11960  if( HistoCode == "D_TNo_ChDs" ){fD_TNo_ChDsYmin = GetYminValueFromMemo("D_TNo_ChDs");}
11961  if( HistoCode == "D_MCs_ChNb" ){fD_MCs_ChNbYmin = GetYminValueFromMemo("D_MCs_ChNb");}
11962  if( HistoCode == "D_MCs_ChDs" ){fD_MCs_ChDsYmin = GetYminValueFromMemo("D_MCs_ChDs");}
11963  if( HistoCode == "D_LFN_ChNb" ){fD_LFN_ChNbYmin = GetYminValueFromMemo("D_LFN_ChNb");}
11964  if( HistoCode == "D_LFN_ChDs" ){fD_LFN_ChDsYmin = GetYminValueFromMemo("D_LFN_ChDs");}
11965  if( HistoCode == "D_HFN_ChNb" ){fD_HFN_ChNbYmin = GetYminValueFromMemo("D_HFN_ChNb");}
11966  if( HistoCode == "D_HFN_ChDs" ){fD_HFN_ChDsYmin = GetYminValueFromMemo("D_HFN_ChDs");}
11967  if( HistoCode == "D_SCs_ChNb" ){fD_SCs_ChNbYmin = GetYminValueFromMemo("D_SCs_ChNb");}
11968  if( HistoCode == "D_SCs_ChDs" ){fD_SCs_ChDsYmin = GetYminValueFromMemo("D_SCs_ChDs");}
11969  if( HistoCode == "D_MSp_SpNb" ){fD_MSp_SpNbYmin = GetYminValueFromMemo("D_MSp_SpNb");}
11970  if( HistoCode == "D_MSp_SpDs" ){fD_MSp_SpDsYmin = GetYminValueFromMemo("D_MSp_SpDs");}
11971  if( HistoCode == "D_SSp_SpNb" ){fD_SSp_SpNbYmin = GetYminValueFromMemo("D_SSp_SpNb");}
11972  if( HistoCode == "D_SSp_SpDs" ){fD_SSp_SpDsYmin = GetYminValueFromMemo("D_SSp_SpDs");}
11973  if( HistoCode == "D_Adc_EvNb" ){fD_Adc_EvNbYmin = GetYminValueFromMemo("D_Adc_EvNb");}
11974  if( HistoCode == "D_Adc_EvDs" ){fD_Adc_EvDsYmin = GetYminValueFromMemo("D_Adc_EvDs");}
11975  if( HistoCode == "H_Ped_Date" ){fH_Ped_DateYmin = GetYminValueFromMemo("H_Ped_Date");}
11976  if( HistoCode == "H_TNo_Date" ){fH_TNo_DateYmin = GetYminValueFromMemo("H_TNo_Date");}
11977  if( HistoCode == "H_MCs_Date" ){fH_MCs_DateYmin = GetYminValueFromMemo("H_MCs_Date");}
11978  if( HistoCode == "H_LFN_Date" ){fH_LFN_DateYmin = GetYminValueFromMemo("H_LFN_Date");}
11979  if( HistoCode == "H_HFN_Date" ){fH_HFN_DateYmin = GetYminValueFromMemo("H_HFN_Date");}
11980  if( HistoCode == "H_SCs_Date" ){fH_SCs_DateYmin = GetYminValueFromMemo("H_SCs_Date");}
11981  if( HistoCode == "H_Ped_RuDs" ){fH_Ped_RuDsYmin = GetYminValueFromMemo("H_Ped_RuDs");}
11982  if( HistoCode == "H_TNo_RuDs" ){fH_TNo_RuDsYmin = GetYminValueFromMemo("H_TNo_RuDs");}
11983  if( HistoCode == "H_MCs_RuDs" ){fH_MCs_RuDsYmin = GetYminValueFromMemo("H_MCs_RuDs");}
11984  if( HistoCode == "H_LFN_RuDs" ){fH_LFN_RuDsYmin = GetYminValueFromMemo("H_LFN_RuDs");}
11985  if( HistoCode == "H_HFN_RuDs" ){fH_HFN_RuDsYmin = GetYminValueFromMemo("H_HFN_RuDs");}
11986  if( HistoCode == "H_SCs_RuDs" ){fH_SCs_RuDsYmin = GetYminValueFromMemo("H_SCs_RuDs");}
11987  if( HistoCode == "H2LFccMosMatrix" ){fH2LFccMosMatrixYmin = GetYminValueFromMemo("H2LFccMosMatrix");}
11988  if( HistoCode == "H2HFccMosMatrix" ){fH2HFccMosMatrixYmin = GetYminValueFromMemo("H2HFccMosMatrix");}
11989  if( HistoCode == "H2CorccInStins" ){fH2CorccInStinsYmin = GetYminValueFromMemo("H2CorccInStins");}
11990 }// end of SetYminMemoFromPreviousMemo(...)
11991 
11992 void TEcnaHistos::SetYmaxMemoFromPreviousMemo(const TString& HistoCode)
11993 {
11994 // InitQuantity Ymax
11995 
11996  if( HistoCode == "D_NOE_ChNb" ){fD_NOE_ChNbYmax = GetYmaxValueFromMemo("D_NOE_ChNb");}
11997  if( HistoCode == "D_NOE_ChDs" ){fD_NOE_ChDsYmax = GetYmaxValueFromMemo("D_NOE_ChDs");}
11998  if( HistoCode == "D_Ped_ChNb" ){fD_Ped_ChNbYmax = GetYmaxValueFromMemo("D_Ped_ChNb");}
11999  if( HistoCode == "D_Ped_ChDs" ){fD_Ped_ChDsYmax = GetYmaxValueFromMemo("D_Ped_ChDs");}
12000  if( HistoCode == "D_TNo_ChNb" ){fD_TNo_ChNbYmax = GetYmaxValueFromMemo("D_TNo_ChNb");}
12001  if( HistoCode == "D_TNo_ChDs" ){fD_TNo_ChDsYmax = GetYmaxValueFromMemo("D_TNo_ChDs");}
12002  if( HistoCode == "D_MCs_ChNb" ){fD_MCs_ChNbYmax = GetYmaxValueFromMemo("D_MCs_ChNb");}
12003  if( HistoCode == "D_MCs_ChDs" ){fD_MCs_ChDsYmax = GetYmaxValueFromMemo("D_MCs_ChDs");}
12004  if( HistoCode == "D_LFN_ChNb" ){fD_LFN_ChNbYmax = GetYmaxValueFromMemo("D_LFN_ChNb");}
12005  if( HistoCode == "D_LFN_ChDs" ){fD_LFN_ChDsYmax = GetYmaxValueFromMemo("D_LFN_ChDs");}
12006  if( HistoCode == "D_HFN_ChNb" ){fD_HFN_ChNbYmax = GetYmaxValueFromMemo("D_HFN_ChNb");}
12007  if( HistoCode == "D_HFN_ChDs" ){fD_HFN_ChDsYmax = GetYmaxValueFromMemo("D_HFN_ChDs");}
12008  if( HistoCode == "D_SCs_ChNb" ){fD_SCs_ChNbYmax = GetYmaxValueFromMemo("D_SCs_ChNb");}
12009  if( HistoCode == "D_SCs_ChDs" ){fD_SCs_ChDsYmax = GetYmaxValueFromMemo("D_SCs_ChDs");}
12010  if( HistoCode == "D_MSp_SpNb" ){fD_MSp_SpNbYmax = GetYmaxValueFromMemo("D_MSp_SpNb");}
12011  if( HistoCode == "D_MSp_SpDs" ){fD_MSp_SpDsYmax = GetYmaxValueFromMemo("D_MSp_SpDs");}
12012  if( HistoCode == "D_SSp_SpNb" ){fD_SSp_SpNbYmax = GetYmaxValueFromMemo("D_SSp_SpNb");}
12013  if( HistoCode == "D_SSp_SpDs" ){fD_SSp_SpDsYmax = GetYmaxValueFromMemo("D_SSp_SpDs");}
12014  if( HistoCode == "D_Adc_EvNb" ){fD_Adc_EvNbYmax = GetYmaxValueFromMemo("D_Adc_EvNb");}
12015  if( HistoCode == "D_Adc_EvDs" ){fD_Adc_EvDsYmax = GetYmaxValueFromMemo("D_Adc_EvDs");}
12016  if( HistoCode == "H_Ped_Date" ){fH_Ped_DateYmax = GetYmaxValueFromMemo("H_Ped_Date");}
12017  if( HistoCode == "H_TNo_Date" ){fH_TNo_DateYmax = GetYmaxValueFromMemo("H_TNo_Date");}
12018  if( HistoCode == "H_MCs_Date" ){fH_MCs_DateYmax = GetYmaxValueFromMemo("H_MCs_Date");}
12019  if( HistoCode == "H_LFN_Date" ){fH_LFN_DateYmax = GetYmaxValueFromMemo("H_LFN_Date");}
12020  if( HistoCode == "H_HFN_Date" ){fH_HFN_DateYmax = GetYmaxValueFromMemo("H_HFN_Date");}
12021  if( HistoCode == "H_SCs_Date" ){fH_SCs_DateYmax = GetYmaxValueFromMemo("H_SCs_Date");}
12022  if( HistoCode == "H_Ped_RuDs" ){fH_Ped_RuDsYmax = GetYmaxValueFromMemo("H_Ped_RuDs");}
12023  if( HistoCode == "H_TNo_RuDs" ){fH_TNo_RuDsYmax = GetYmaxValueFromMemo("H_TNo_RuDs");}
12024  if( HistoCode == "H_MCs_RuDs" ){fH_MCs_RuDsYmax = GetYmaxValueFromMemo("H_MCs_RuDs");}
12025  if( HistoCode == "H_LFN_RuDs" ){fH_LFN_RuDsYmax = GetYmaxValueFromMemo("H_LFN_RuDs");}
12026  if( HistoCode == "H_HFN_RuDs" ){fH_HFN_RuDsYmax = GetYmaxValueFromMemo("H_HFN_RuDs");}
12027  if( HistoCode == "H_SCs_RuDs" ){fH_SCs_RuDsYmax = GetYmaxValueFromMemo("H_SCs_RuDs");}
12028  if( HistoCode == "H2LFccMosMatrix" ){fH2LFccMosMatrixYmax = GetYmaxValueFromMemo("H2LFccMosMatrix");}
12029  if( HistoCode == "H2HFccMosMatrix" ){fH2HFccMosMatrixYmax = GetYmaxValueFromMemo("H2HFccMosMatrix");}
12030  if( HistoCode == "H2CorccInStins" ){fH2CorccInStinsYmax = GetYmaxValueFromMemo("H2CorccInStins");}
12031 }// end of SetYmaxMemoFromPreviousMemo(...)
12032 
12033 //------------------------------------------------------------------------------------------------------
12034 void TEcnaHistos::SetXVarMemo(const TString& HistoCode, const TString& opt_plot, const TString& xvar)
12035 {
12036 
12037  if( opt_plot == fSameOnePlot ){fXMemoH1SamePlus = xvar;}
12038 
12039  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12040  {
12041  if( HistoCode == "D_NOE_ChNb"){fXMemoD_NOE_ChNb = xvar;}
12042  if( HistoCode == "D_NOE_ChDs"){fXMemoD_NOE_ChDs = xvar;}
12043  if( HistoCode == "D_Ped_ChNb"){fXMemoD_Ped_ChNb = xvar;}
12044  if( HistoCode == "D_Ped_ChDs"){fXMemoD_Ped_ChDs = xvar;}
12045  if( HistoCode == "D_TNo_ChNb"){fXMemoD_TNo_ChNb = xvar;}
12046  if( HistoCode == "D_TNo_ChDs"){fXMemoD_TNo_ChDs = xvar;}
12047  if( HistoCode == "D_MCs_ChNb"){fXMemoD_MCs_ChNb = xvar;}
12048  if( HistoCode == "D_MCs_ChDs"){fXMemoD_MCs_ChDs = xvar;}
12049  if( HistoCode == "D_LFN_ChNb"){fXMemoD_LFN_ChNb = xvar;}
12050  if( HistoCode == "D_LFN_ChDs"){fXMemoD_LFN_ChDs = xvar;}
12051  if( HistoCode == "D_HFN_ChNb"){fXMemoD_HFN_ChNb = xvar;}
12052  if( HistoCode == "D_HFN_ChDs"){fXMemoD_HFN_ChDs = xvar;}
12053  if( HistoCode == "D_SCs_ChNb"){fXMemoD_SCs_ChNb = xvar;}
12054  if( HistoCode == "D_SCs_ChDs"){fXMemoD_SCs_ChDs = xvar;}
12055  if( HistoCode == "D_MSp_SpNb"){fXMemoD_MSp_SpNb = xvar;}
12056  if( HistoCode == "D_MSp_SpDs"){fXMemoD_MSp_SpDs = xvar;}
12057  if( HistoCode == "D_SSp_SpNb"){fXMemoD_SSp_SpNb = xvar;}
12058  if( HistoCode == "D_SSp_SpDs"){fXMemoD_SSp_SpDs = xvar;}
12059  if( HistoCode == "D_Adc_EvNb"){fXMemoD_Adc_EvNb = xvar;}
12060  if( HistoCode == "D_Adc_EvDs"){fXMemoD_Adc_EvDs = xvar;}
12061  if( HistoCode == "H_Ped_Date"){fXMemoH_Ped_Date = xvar;}
12062  if( HistoCode == "H_TNo_Date"){fXMemoH_TNo_Date = xvar;}
12063  if( HistoCode == "H_MCs_Date"){fXMemoH_MCs_Date = xvar;}
12064  if( HistoCode == "H_LFN_Date"){fXMemoH_LFN_Date = xvar;}
12065  if( HistoCode == "H_HFN_Date"){fXMemoH_HFN_Date = xvar;}
12066  if( HistoCode == "H_SCs_Date"){fXMemoH_SCs_Date = xvar;}
12067  if( HistoCode == "H_Ped_RuDs"){fXMemoH_Ped_RuDs = xvar;}
12068  if( HistoCode == "H_TNo_RuDs"){fXMemoH_TNo_RuDs = xvar;}
12069  if( HistoCode == "H_MCs_RuDs"){fXMemoH_MCs_RuDs = xvar;}
12070  if( HistoCode == "H_LFN_RuDs"){fXMemoH_LFN_RuDs = xvar;}
12071  if( HistoCode == "H_HFN_RuDs"){fXMemoH_HFN_RuDs = xvar;}
12072  if( HistoCode == "H_SCs_RuDs"){fXMemoH_SCs_RuDs = xvar;}
12073  }
12074 }// end of SetXVarMemo(...)
12075 
12076 TString TEcnaHistos::GetXVarFromMemo(const TString& HistoCode, const TString& opt_plot)
12077 {
12078  TString xvar = "(xvar not found)";
12079 
12080  if( opt_plot == fSameOnePlot ){xvar = fXMemoH1SamePlus;}
12081 
12082  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12083  {
12084  if( HistoCode == "D_NOE_ChNb"){xvar = fXMemoD_NOE_ChNb;}
12085  if( HistoCode == "D_NOE_ChDs"){xvar = fXMemoD_NOE_ChDs;}
12086  if( HistoCode == "D_Ped_ChNb"){xvar = fXMemoD_Ped_ChNb;}
12087  if( HistoCode == "D_Ped_ChDs"){xvar = fXMemoD_Ped_ChDs;}
12088  if( HistoCode == "D_TNo_ChNb"){xvar = fXMemoD_TNo_ChNb;}
12089  if( HistoCode == "D_TNo_ChDs"){xvar = fXMemoD_TNo_ChDs;}
12090  if( HistoCode == "D_MCs_ChNb"){xvar = fXMemoD_MCs_ChNb;}
12091  if( HistoCode == "D_MCs_ChDs"){xvar = fXMemoD_MCs_ChDs;}
12092  if( HistoCode == "D_LFN_ChNb"){xvar = fXMemoD_LFN_ChNb;}
12093  if( HistoCode == "D_LFN_ChDs"){xvar = fXMemoD_LFN_ChDs;}
12094  if( HistoCode == "D_HFN_ChNb"){xvar = fXMemoD_HFN_ChNb;}
12095  if( HistoCode == "D_HFN_ChDs"){xvar = fXMemoD_HFN_ChDs;}
12096  if( HistoCode == "D_SCs_ChNb"){xvar = fXMemoD_SCs_ChNb;}
12097  if( HistoCode == "D_SCs_ChDs"){xvar = fXMemoD_SCs_ChDs;}
12098  if( HistoCode == "D_MSp_SpNb"){xvar = fXMemoD_MSp_SpNb;}
12099  if( HistoCode == "D_MSp_SpDs"){xvar = fXMemoD_MSp_SpDs;}
12100  if( HistoCode == "D_SSp_SpNb"){xvar = fXMemoD_SSp_SpNb;}
12101  if( HistoCode == "D_SSp_SpDs"){xvar = fXMemoD_SSp_SpDs;}
12102  if( HistoCode == "D_Adc_EvNb"){xvar = fXMemoD_Adc_EvNb;}
12103  if( HistoCode == "D_Adc_EvDs"){xvar = fXMemoD_Adc_EvDs;}
12104  if( HistoCode == "H_Ped_Date"){xvar = fXMemoH_Ped_Date;}
12105  if( HistoCode == "H_TNo_Date"){xvar = fXMemoH_TNo_Date;}
12106  if( HistoCode == "H_MCs_Date"){xvar = fXMemoH_MCs_Date;}
12107  if( HistoCode == "H_LFN_Date"){xvar = fXMemoH_LFN_Date;}
12108  if( HistoCode == "H_HFN_Date"){xvar = fXMemoH_HFN_Date;}
12109  if( HistoCode == "H_SCs_Date"){xvar = fXMemoH_SCs_Date;}
12110  if( HistoCode == "H_Ped_RuDs"){xvar = fXMemoH_Ped_RuDs;}
12111  if( HistoCode == "H_TNo_RuDs"){xvar = fXMemoH_TNo_RuDs;}
12112  if( HistoCode == "H_MCs_RuDs"){xvar = fXMemoH_MCs_RuDs;}
12113  if( HistoCode == "H_LFN_RuDs"){xvar = fXMemoH_LFN_RuDs;}
12114  if( HistoCode == "H_HFN_RuDs"){xvar = fXMemoH_HFN_RuDs;}
12115  if( HistoCode == "H_SCs_RuDs"){xvar = fXMemoH_SCs_RuDs;}
12116  }
12117  return xvar;
12118 }// end of GetXVarFromMemo(...)
12119 
12120 
12121 void TEcnaHistos::SetYVarMemo(const TString& HistoCode, const TString& opt_plot, const TString& yvar)
12122 {
12123  if( opt_plot == fSameOnePlot ){fYMemoH1SamePlus = yvar;}
12124 
12125  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12126  {
12127  if( HistoCode == "D_NOE_ChNb"){fYMemoD_NOE_ChNb = yvar;}
12128  if( HistoCode == "D_NOE_ChDs"){fYMemoD_NOE_ChDs = yvar;}
12129  if( HistoCode == "D_Ped_ChNb"){fYMemoD_Ped_ChNb = yvar;}
12130  if( HistoCode == "D_Ped_ChDs"){fYMemoD_Ped_ChDs = yvar;}
12131  if( HistoCode == "D_TNo_ChNb"){fYMemoD_TNo_ChNb = yvar;}
12132  if( HistoCode == "D_TNo_ChDs"){fYMemoD_TNo_ChDs = yvar;}
12133  if( HistoCode == "D_MCs_ChNb"){fYMemoD_MCs_ChNb = yvar;}
12134  if( HistoCode == "D_MCs_ChDs"){fYMemoD_MCs_ChDs = yvar;}
12135  if( HistoCode == "D_LFN_ChNb"){fYMemoD_LFN_ChNb = yvar;}
12136  if( HistoCode == "D_LFN_ChDs"){fYMemoD_LFN_ChDs = yvar;}
12137  if( HistoCode == "D_HFN_ChNb"){fYMemoD_HFN_ChNb = yvar;}
12138  if( HistoCode == "D_HFN_ChDs"){fYMemoD_HFN_ChDs = yvar;}
12139  if( HistoCode == "D_SCs_ChNb"){fYMemoD_SCs_ChNb = yvar;}
12140  if( HistoCode == "D_SCs_ChDs"){fYMemoD_SCs_ChDs = yvar;}
12141  if( HistoCode == "D_MSp_SpNb"){fYMemoD_MSp_SpNb = yvar;}
12142  if( HistoCode == "D_MSp_SpDs"){fYMemoD_MSp_SpDs = yvar;}
12143  if( HistoCode == "D_SSp_SpNb"){fYMemoD_SSp_SpNb = yvar;}
12144  if( HistoCode == "D_Adc_EvDs"){fYMemoD_Adc_EvDs = yvar;}
12145  if( HistoCode == "D_SSp_SpDs"){fYMemoD_SSp_SpDs = yvar;}
12146  if( HistoCode == "D_Adc_EvNb"){fYMemoD_Adc_EvNb = yvar;}
12147  if( HistoCode == "H_Ped_Date"){fYMemoH_Ped_Date = yvar;}
12148  if( HistoCode == "H_TNo_Date"){fYMemoH_TNo_Date = yvar;}
12149  if( HistoCode == "H_MCs_Date"){fYMemoH_MCs_Date = yvar;}
12150  if( HistoCode == "H_LFN_Date"){fYMemoH_LFN_Date = yvar;}
12151  if( HistoCode == "H_HFN_Date"){fYMemoH_HFN_Date = yvar;}
12152  if( HistoCode == "H_SCs_Date"){fYMemoH_SCs_Date = yvar;}
12153  if( HistoCode == "H_Ped_RuDs"){fYMemoH_Ped_RuDs = yvar;}
12154  if( HistoCode == "H_TNo_RuDs"){fYMemoH_TNo_RuDs = yvar;}
12155  if( HistoCode == "H_MCs_RuDs"){fYMemoH_MCs_RuDs = yvar;}
12156  if( HistoCode == "H_LFN_RuDs"){fYMemoH_LFN_RuDs = yvar;}
12157  if( HistoCode == "H_HFN_RuDs"){fYMemoH_HFN_RuDs = yvar;}
12158  if( HistoCode == "H_SCs_RuDs"){fYMemoH_SCs_RuDs = yvar;}
12159  }
12160 }// end of SetYVarMemo(...)
12161 
12162 TString TEcnaHistos::GetYVarFromMemo(const TString& HistoCode, const TString& opt_plot)
12163 {
12164  TString yvar = "(yvar not found)";
12165 
12166  if( opt_plot == fSameOnePlot ){yvar = fYMemoH1SamePlus;}
12167 
12168  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12169  {
12170  if( HistoCode == "D_NOE_ChNb"){yvar = fYMemoD_NOE_ChNb;}
12171  if( HistoCode == "D_NOE_ChDs"){yvar = fYMemoD_NOE_ChDs;}
12172  if( HistoCode == "D_Ped_ChNb"){yvar = fYMemoD_Ped_ChNb;}
12173  if( HistoCode == "D_Ped_ChDs"){yvar = fYMemoD_Ped_ChDs;}
12174  if( HistoCode == "D_TNo_ChNb"){yvar = fYMemoD_TNo_ChNb;}
12175  if( HistoCode == "D_TNo_ChDs"){yvar = fYMemoD_TNo_ChDs;}
12176  if( HistoCode == "D_MCs_ChNb"){yvar = fYMemoD_MCs_ChNb;}
12177  if( HistoCode == "D_MCs_ChDs"){yvar = fYMemoD_MCs_ChDs;}
12178  if( HistoCode == "D_LFN_ChNb"){yvar = fYMemoD_LFN_ChNb;}
12179  if( HistoCode == "D_LFN_ChDs"){yvar = fYMemoD_LFN_ChDs;}
12180  if( HistoCode == "D_HFN_ChNb"){yvar = fYMemoD_HFN_ChNb;}
12181  if( HistoCode == "D_HFN_ChDs"){yvar = fYMemoD_HFN_ChDs;}
12182  if( HistoCode == "D_SCs_ChNb"){yvar = fYMemoD_SCs_ChNb;}
12183  if( HistoCode == "D_SCs_ChDs"){yvar = fYMemoD_SCs_ChDs;}
12184  if( HistoCode == "D_MSp_SpNb"){yvar = fYMemoD_MSp_SpNb;}
12185  if( HistoCode == "D_MSp_SpDs"){yvar = fYMemoD_MSp_SpDs;}
12186  if( HistoCode == "D_SSp_SpNb"){yvar = fYMemoD_SSp_SpNb;}
12187  if( HistoCode == "D_SSp_SpDs"){yvar = fYMemoD_SSp_SpDs;}
12188  if( HistoCode == "D_Adc_EvNb"){yvar = fYMemoD_Adc_EvNb;}
12189  if( HistoCode == "D_Adc_EvDs"){yvar = fYMemoD_Adc_EvDs;}
12190  if( HistoCode == "H_Ped_Date"){yvar = fYMemoH_Ped_Date;}
12191  if( HistoCode == "H_TNo_Date"){yvar = fYMemoH_TNo_Date;}
12192  if( HistoCode == "H_MCs_Date"){yvar = fYMemoH_MCs_Date;}
12193  if( HistoCode == "H_LFN_Date"){yvar = fYMemoH_LFN_Date;}
12194  if( HistoCode == "H_HFN_Date"){yvar = fYMemoH_HFN_Date;}
12195  if( HistoCode == "H_SCs_Date"){yvar = fYMemoH_SCs_Date;}
12196  if( HistoCode == "H_Ped_RuDs"){yvar = fYMemoH_Ped_RuDs;}
12197  if( HistoCode == "H_TNo_RuDs"){yvar = fYMemoH_TNo_RuDs;}
12198  if( HistoCode == "H_MCs_RuDs"){yvar = fYMemoH_MCs_RuDs;}
12199  if( HistoCode == "H_LFN_RuDs"){yvar = fYMemoH_LFN_RuDs;}
12200  if( HistoCode == "H_HFN_RuDs"){yvar = fYMemoH_HFN_RuDs;}
12201  if( HistoCode == "H_SCs_RuDs"){yvar = fYMemoH_SCs_RuDs;}
12202  }
12203  return yvar;
12204 }// end of GetYVarFromMemo(...)
12205 
12206 void TEcnaHistos::SetNbBinsMemo(const TString& HistoCode, const TString& opt_plot, const Int_t& nb_bins)
12207 {
12208 
12209  if( opt_plot == fSameOnePlot ){fNbBinsMemoH1SamePlus = nb_bins;}
12210 
12211  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12212  {
12213  if( HistoCode == "D_NOE_ChNb"){fNbBinsMemoD_NOE_ChNb = nb_bins;}
12214  if( HistoCode == "D_NOE_ChDs"){fNbBinsMemoD_NOE_ChDs = nb_bins;}
12215  if( HistoCode == "D_Ped_ChNb"){fNbBinsMemoD_Ped_ChNb = nb_bins;}
12216  if( HistoCode == "D_Ped_ChDs"){fNbBinsMemoD_Ped_ChDs = nb_bins;}
12217  if( HistoCode == "D_TNo_ChNb"){fNbBinsMemoD_TNo_ChNb = nb_bins;}
12218  if( HistoCode == "D_TNo_ChDs"){fNbBinsMemoD_TNo_ChDs = nb_bins;}
12219  if( HistoCode == "D_MCs_ChNb"){fNbBinsMemoD_MCs_ChNb = nb_bins;}
12220  if( HistoCode == "D_MCs_ChDs"){fNbBinsMemoD_MCs_ChDs = nb_bins;}
12221  if( HistoCode == "D_LFN_ChNb"){fNbBinsMemoD_LFN_ChNb = nb_bins;}
12222  if( HistoCode == "D_LFN_ChDs"){fNbBinsMemoD_LFN_ChDs = nb_bins;}
12223  if( HistoCode == "D_HFN_ChNb"){fNbBinsMemoD_HFN_ChNb = nb_bins;}
12224  if( HistoCode == "D_HFN_ChDs"){fNbBinsMemoD_HFN_ChDs = nb_bins;}
12225  if( HistoCode == "D_SCs_ChNb"){fNbBinsMemoD_SCs_ChNb = nb_bins;}
12226  if( HistoCode == "D_SCs_ChDs"){fNbBinsMemoD_SCs_ChDs = nb_bins;}
12227  if( HistoCode == "D_MSp_SpNb"){fNbBinsMemoD_MSp_SpNb = nb_bins;}
12228  if( HistoCode == "D_MSp_SpDs"){fNbBinsMemoD_MSp_SpDs = nb_bins;}
12229  if( HistoCode == "D_SSp_SpNb"){fNbBinsMemoD_SSp_SpNb = nb_bins;}
12230  if( HistoCode == "D_SSp_SpDs"){fNbBinsMemoD_SSp_SpDs = nb_bins;}
12231  if( HistoCode == "D_Adc_EvNb"){fNbBinsMemoD_Adc_EvNb = nb_bins;}
12232  if( HistoCode == "D_Adc_EvDs"){fNbBinsMemoD_Adc_EvDs = nb_bins;}
12233  if( HistoCode == "H_Ped_Date"){fNbBinsMemoH_Ped_Date = nb_bins;}
12234  if( HistoCode == "H_TNo_Date"){fNbBinsMemoH_TNo_Date = nb_bins;}
12235  if( HistoCode == "H_MCs_Date"){fNbBinsMemoH_MCs_Date = nb_bins;}
12236  if( HistoCode == "H_LFN_Date"){fNbBinsMemoH_LFN_Date = nb_bins;}
12237  if( HistoCode == "H_HFN_Date"){fNbBinsMemoH_HFN_Date = nb_bins;}
12238  if( HistoCode == "H_SCs_Date"){fNbBinsMemoH_SCs_Date = nb_bins;}
12239  if( HistoCode == "H_Ped_RuDs"){fNbBinsMemoH_Ped_RuDs = nb_bins;}
12240  if( HistoCode == "H_TNo_RuDs"){fNbBinsMemoH_TNo_RuDs = nb_bins;}
12241  if( HistoCode == "H_MCs_RuDs"){fNbBinsMemoH_MCs_RuDs = nb_bins;}
12242  if( HistoCode == "H_LFN_RuDs"){fNbBinsMemoH_LFN_RuDs = nb_bins;}
12243  if( HistoCode == "H_HFN_RuDs"){fNbBinsMemoH_HFN_RuDs = nb_bins;}
12244  if( HistoCode == "H_SCs_RuDs"){fNbBinsMemoH_SCs_RuDs = nb_bins;}
12245  }
12246 }// end of SetNbBinsMemo(...)
12247 
12248 Int_t TEcnaHistos::GetNbBinsFromMemo(const TString& HistoCode, const TString& opt_plot)
12249 {
12250  Int_t nb_bins = 0;
12251 
12252  if( opt_plot == fSameOnePlot ){nb_bins = fNbBinsMemoH1SamePlus;}
12253 
12254  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12255  {
12256  if( HistoCode == "D_NOE_ChNb"){nb_bins = fNbBinsMemoD_NOE_ChNb;}
12257  if( HistoCode == "D_NOE_ChDs"){nb_bins = fNbBinsMemoD_NOE_ChDs;}
12258  if( HistoCode == "D_Ped_ChNb"){nb_bins = fNbBinsMemoD_Ped_ChNb;}
12259  if( HistoCode == "D_Ped_ChDs"){nb_bins = fNbBinsMemoD_Ped_ChDs;}
12260  if( HistoCode == "D_TNo_ChNb"){nb_bins = fNbBinsMemoD_TNo_ChNb;}
12261  if( HistoCode == "D_TNo_ChDs"){nb_bins = fNbBinsMemoD_TNo_ChDs;}
12262  if( HistoCode == "D_MCs_ChNb"){nb_bins = fNbBinsMemoD_MCs_ChNb;}
12263  if( HistoCode == "D_MCs_ChDs"){nb_bins = fNbBinsMemoD_MCs_ChDs;}
12264  if( HistoCode == "D_LFN_ChNb"){nb_bins = fNbBinsMemoD_LFN_ChNb;}
12265  if( HistoCode == "D_LFN_ChDs"){nb_bins = fNbBinsMemoD_LFN_ChDs;}
12266  if( HistoCode == "D_HFN_ChNb"){nb_bins = fNbBinsMemoD_HFN_ChNb;}
12267  if( HistoCode == "D_HFN_ChDs"){nb_bins = fNbBinsMemoD_HFN_ChDs;}
12268  if( HistoCode == "D_SCs_ChNb"){nb_bins = fNbBinsMemoD_SCs_ChNb;}
12269  if( HistoCode == "D_SCs_ChDs"){nb_bins = fNbBinsMemoD_SCs_ChDs;}
12270  if( HistoCode == "D_MSp_SpNb"){nb_bins = fNbBinsMemoD_MSp_SpNb;}
12271  if( HistoCode == "D_MSp_SpDs"){nb_bins = fNbBinsMemoD_MSp_SpDs;}
12272  if( HistoCode == "D_SSp_SpNb"){nb_bins = fNbBinsMemoD_SSp_SpNb;}
12273  if( HistoCode == "D_SSp_SpDs"){nb_bins = fNbBinsMemoD_SSp_SpDs;}
12274  if( HistoCode == "D_Adc_EvNb"){nb_bins = fNbBinsMemoD_Adc_EvNb;}
12275  if( HistoCode == "D_Adc_EvDs"){nb_bins = fNbBinsMemoD_Adc_EvDs;}
12276  if( HistoCode == "H_Ped_Date"){nb_bins = fNbBinsMemoH_Ped_Date;}
12277  if( HistoCode == "H_TNo_Date"){nb_bins = fNbBinsMemoH_TNo_Date;}
12278  if( HistoCode == "H_MCs_Date"){nb_bins = fNbBinsMemoH_MCs_Date;}
12279  if( HistoCode == "H_LFN_Date"){nb_bins = fNbBinsMemoH_LFN_Date;}
12280  if( HistoCode == "H_HFN_Date"){nb_bins = fNbBinsMemoH_HFN_Date;}
12281  if( HistoCode == "H_SCs_Date"){nb_bins = fNbBinsMemoH_SCs_Date;}
12282  if( HistoCode == "H_Ped_RuDs"){nb_bins = fNbBinsMemoH_Ped_RuDs;}
12283  if( HistoCode == "H_TNo_RuDs"){nb_bins = fNbBinsMemoH_TNo_RuDs;}
12284  if( HistoCode == "H_MCs_RuDs"){nb_bins = fNbBinsMemoH_MCs_RuDs;}
12285  if( HistoCode == "H_LFN_RuDs"){nb_bins = fNbBinsMemoH_LFN_RuDs;}
12286  if( HistoCode == "H_HFN_RuDs"){nb_bins = fNbBinsMemoH_HFN_RuDs;}
12287  if( HistoCode == "H_SCs_RuDs"){nb_bins = fNbBinsMemoH_SCs_RuDs;}
12288  }
12289  return nb_bins;
12290 }// end of GetNbBinsFromMemo(...)
12291 
12292 TString TEcnaHistos::GetMemoFlag(const TString& opt_plot)
12293 {
12294  TString memo_flag;
12295  Int_t MaxCar = fgMaxCar;
12296  memo_flag.Resize(MaxCar);
12297  memo_flag = "(no memo_flag info)";
12298 
12299  Int_t memo_flag_number = -1;
12300 
12301  if( opt_plot == fSameOnePlot ){memo_flag_number = fMemoPlotH1SamePlus;}
12302 
12303  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12304  {
12305  memo_flag_number = fMemoPlotD_TNo_ChDs+fMemoPlotD_MCs_ChDs
12307  }
12308 
12309  if(memo_flag_number == 0){memo_flag = "Free";}
12310  if(memo_flag_number >= 1){memo_flag = "Busy";}
12311 
12312  return memo_flag;
12313 }
12314 
12315 TString TEcnaHistos::GetMemoFlag(const TString& HistoCode, const TString& opt_plot)
12316 {
12317 // Get Memo Flag
12318 
12319  TString memo_flag;
12320  Int_t MaxCar = fgMaxCar;
12321  memo_flag.Resize(MaxCar);
12322  memo_flag = "(no memo_flag info)";
12323 
12324  Int_t memo_flag_number = -1;
12325 
12326  if( opt_plot == fSameOnePlot ){memo_flag_number = fMemoPlotH1SamePlus;}
12327 
12328  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12329  {
12330  if(HistoCode == "D_NOE_ChNb"){memo_flag_number = fMemoPlotD_NOE_ChNb;}
12331  if(HistoCode == "D_NOE_ChDs"){memo_flag_number = fMemoPlotD_NOE_ChDs;}
12332  if(HistoCode == "D_Ped_ChNb"){memo_flag_number = fMemoPlotD_Ped_ChNb;}
12333  if(HistoCode == "D_Ped_ChDs"){memo_flag_number = fMemoPlotD_Ped_ChDs;}
12334  if(HistoCode == "D_TNo_ChNb"){memo_flag_number = fMemoPlotD_TNo_ChNb;}
12335  if(HistoCode == "D_TNo_ChDs"){memo_flag_number = fMemoPlotD_TNo_ChDs;}
12336  if(HistoCode == "D_MCs_ChNb"){memo_flag_number = fMemoPlotD_MCs_ChNb;}
12337  if(HistoCode == "D_MCs_ChDs"){memo_flag_number = fMemoPlotD_MCs_ChDs;}
12338  if(HistoCode == "D_LFN_ChNb"){memo_flag_number = fMemoPlotD_LFN_ChNb;}
12339  if(HistoCode == "D_LFN_ChDs"){memo_flag_number = fMemoPlotD_LFN_ChDs;}
12340  if(HistoCode == "D_HFN_ChNb"){memo_flag_number = fMemoPlotD_HFN_ChNb;}
12341  if(HistoCode == "D_HFN_ChDs"){memo_flag_number = fMemoPlotD_HFN_ChDs;}
12342  if(HistoCode == "D_SCs_ChNb"){memo_flag_number = fMemoPlotD_SCs_ChNb;}
12343  if(HistoCode == "D_SCs_ChDs"){memo_flag_number = fMemoPlotD_SCs_ChDs;}
12344  if(HistoCode == "D_MSp_SpNb"){memo_flag_number = fMemoPlotD_MSp_SpNb;}
12345  if(HistoCode == "D_MSp_SpDs"){memo_flag_number = fMemoPlotD_MSp_SpDs;}
12346  if(HistoCode == "D_SSp_SpNb"){memo_flag_number = fMemoPlotD_SSp_SpNb;}
12347  if(HistoCode == "D_SSp_SpDs"){memo_flag_number = fMemoPlotD_SSp_SpDs;}
12348  if(HistoCode == "D_Adc_EvNb"){memo_flag_number = fMemoPlotD_Adc_EvNb;}
12349  if(HistoCode == "D_Adc_EvDs"){memo_flag_number = fMemoPlotD_Adc_EvDs;}
12350  if(HistoCode == "H_Ped_Date"){memo_flag_number = fMemoPlotH_Ped_Date;}
12351  if(HistoCode == "H_TNo_Date"){memo_flag_number = fMemoPlotH_TNo_Date;}
12352  if(HistoCode == "H_MCs_Date"){memo_flag_number = fMemoPlotH_MCs_Date;}
12353  if(HistoCode == "H_LFN_Date"){memo_flag_number = fMemoPlotH_LFN_Date;}
12354  if(HistoCode == "H_HFN_Date"){memo_flag_number = fMemoPlotH_HFN_Date;}
12355  if(HistoCode == "H_SCs_Date"){memo_flag_number = fMemoPlotH_SCs_Date;}
12356  if(HistoCode == "H_Ped_RuDs"){memo_flag_number = fMemoPlotH_Ped_RuDs;}
12357  if(HistoCode == "H_TNo_RuDs"){memo_flag_number = fMemoPlotH_TNo_RuDs;}
12358  if(HistoCode == "H_MCs_RuDs"){memo_flag_number = fMemoPlotH_MCs_RuDs;}
12359  if(HistoCode == "H_LFN_RuDs"){memo_flag_number = fMemoPlotH_LFN_RuDs;}
12360  if(HistoCode == "H_HFN_RuDs"){memo_flag_number = fMemoPlotH_HFN_RuDs;}
12361  if(HistoCode == "H_SCs_RuDs"){memo_flag_number = fMemoPlotH_SCs_RuDs;}
12362  }
12363 
12364  if(memo_flag_number == 0){memo_flag = "Free";}
12365  if(memo_flag_number == 1){memo_flag = "Busy";}
12366 
12367  return memo_flag;
12368 }
12369 
12370 TCanvas* TEcnaHistos::CreateCanvas(const TString& HistoCode, const TString& opt_plot, const TString& canvas_name,
12371  UInt_t canv_w, UInt_t canv_h)
12372 {
12373 // Create canvas according to HistoCode
12374 
12375  TCanvas* main_canvas = nullptr;
12376 
12377  if( opt_plot == fSameOnePlot )
12378  {
12379  fCanvH1SamePlus = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12380  main_canvas = fCanvH1SamePlus;
12381  }
12382  if( opt_plot == fSeveralPlot || opt_plot == fOnlyOnePlot )
12383  {
12384  if(HistoCode == "D_NOE_ChNb"){
12385  fCanvD_NOE_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12386  main_canvas = fCanvD_NOE_ChNb;}
12387  if(HistoCode == "D_NOE_ChDs"){
12388  fCanvD_NOE_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12389  main_canvas = fCanvD_NOE_ChDs;}
12390  if(HistoCode == "D_Ped_ChNb"){
12391  fCanvD_Ped_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12392  main_canvas = fCanvD_Ped_ChNb;}
12393  if(HistoCode == "D_Ped_ChDs"){
12394  fCanvD_Ped_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12395  main_canvas = fCanvD_Ped_ChDs;}
12396  if(HistoCode == "D_TNo_ChNb"){
12397  fCanvD_TNo_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12398  main_canvas = fCanvD_TNo_ChNb;}
12399  if(HistoCode == "D_TNo_ChDs"){
12400  fCanvD_TNo_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12401  main_canvas = fCanvD_TNo_ChDs;}
12402  if(HistoCode == "D_MCs_ChNb"){
12403  fCanvD_MCs_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12404  main_canvas = fCanvD_MCs_ChNb;}
12405  if(HistoCode == "D_MCs_ChDs"){
12406  fCanvD_MCs_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12407  main_canvas = fCanvD_MCs_ChDs;}
12408  if(HistoCode == "D_LFN_ChNb"){
12409  fCanvD_LFN_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12410  main_canvas = fCanvD_LFN_ChNb;}
12411  if(HistoCode == "D_LFN_ChDs"){
12412  fCanvD_LFN_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12413  main_canvas = fCanvD_LFN_ChDs;}
12414  if(HistoCode == "D_HFN_ChNb"){
12415  fCanvD_HFN_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12416  main_canvas = fCanvD_HFN_ChNb;}
12417  if(HistoCode == "D_HFN_ChDs"){
12418  fCanvD_HFN_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12419  main_canvas = fCanvD_HFN_ChDs;}
12420  if(HistoCode == "D_SCs_ChNb"){
12421  fCanvD_SCs_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12422  main_canvas = fCanvD_SCs_ChNb;}
12423  if(HistoCode == "D_SCs_ChDs"){
12424  fCanvD_SCs_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12425  main_canvas = fCanvD_SCs_ChDs;}
12426 
12427  if(HistoCode == "D_MSp_SpNb" ){
12428  fCanvD_MSp_SpNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12429  main_canvas = fCanvD_MSp_SpNb;}
12430  if(HistoCode == "D_MSp_SpDs" ){
12431  fCanvD_MSp_SpDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12432  main_canvas = fCanvD_MSp_SpDs;}
12433  if(HistoCode =="D_SSp_SpNb" ){
12434  fCanvD_SSp_SpNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12435  main_canvas = fCanvD_SSp_SpNb;}
12436  if(HistoCode =="D_SSp_SpDs" ){
12437  fCanvD_SSp_SpDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12438  main_canvas = fCanvD_SSp_SpDs;}
12439 
12440  if(HistoCode == "D_Adc_EvNb"){
12441  fCanvD_Adc_EvNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12442  main_canvas = fCanvD_Adc_EvNb;}
12443  if(HistoCode == "D_Adc_EvDs"){
12444  fCanvD_Adc_EvDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12445  main_canvas = fCanvD_Adc_EvDs;}
12446 
12447  if(HistoCode == "H_Ped_Date"){
12448  fCanvH_Ped_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12449  main_canvas = fCanvH_Ped_Date;}
12450  if(HistoCode == "H_TNo_Date"){
12451  fCanvH_TNo_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12452  main_canvas = fCanvH_TNo_Date;}
12453  if(HistoCode == "H_MCs_Date"){
12454  fCanvH_MCs_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12455  main_canvas = fCanvH_MCs_Date;}
12456  if(HistoCode == "H_LFN_Date"){
12457  fCanvH_LFN_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12458  main_canvas = fCanvH_LFN_Date;}
12459  if(HistoCode == "H_HFN_Date"){
12460  fCanvH_HFN_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12461  main_canvas = fCanvH_HFN_Date;}
12462  if(HistoCode == "H_SCs_Date"){
12463  fCanvH_SCs_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12464  main_canvas = fCanvH_SCs_Date;}
12465 
12466  if(HistoCode == "H_Ped_RuDs"){
12467  fCanvH_Ped_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12468  main_canvas = fCanvH_Ped_RuDs;}
12469  if(HistoCode == "H_TNo_RuDs"){
12470  fCanvH_TNo_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12471  main_canvas = fCanvH_TNo_RuDs;}
12472  if(HistoCode == "H_MCs_RuDs"){
12473  fCanvH_MCs_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12474  main_canvas = fCanvH_MCs_RuDs;}
12475  if(HistoCode == "H_LFN_RuDs"){
12476  fCanvH_LFN_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12477  main_canvas = fCanvH_LFN_RuDs;}
12478  if(HistoCode == "H_HFN_RuDs"){
12479  fCanvH_HFN_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12480  main_canvas = fCanvH_HFN_RuDs;}
12481  if(HistoCode == "H_SCs_RuDs"){
12482  fCanvH_SCs_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12483  main_canvas = fCanvH_SCs_RuDs;}
12484 
12485  }
12486  return main_canvas;
12487 }
12488 // end of CreateCanvas
12489 
12490 void TEcnaHistos::SetParametersCanvas(const TString& HistoCode, const TString& opt_plot)
12491 {
12492 // Set parameters canvas according to HistoCode
12493 
12494  Double_t x_margin_factor = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
12495  Double_t y_margin_factor = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
12496 
12497  if( opt_plot == fSameOnePlot )
12498  {
12499  fImpH1SamePlus = (TCanvasImp*)fCanvH1SamePlus->GetCanvasImp();
12500  fCanvH1SamePlus->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12501  fPadH1SamePlus = gPad; fClosedH1SamePlus = kFALSE;
12503  }
12504 
12505  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
12506  {
12507  if(HistoCode == "D_NOE_ChNb")
12508  {
12509  fImpD_NOE_ChNb = (TCanvasImp*)fCanvD_NOE_ChNb->GetCanvasImp();
12510  fCanvD_NOE_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12511  fPadD_NOE_ChNb = gPad; fClosedD_NOE_ChNb = kFALSE;
12513  }
12514 
12515  if(HistoCode == "D_NOE_ChDs") // (SetParametersCanvas)
12516  {
12517  fImpD_NOE_ChDs = (TCanvasImp*)fCanvD_NOE_ChDs->GetCanvasImp();
12518  fCanvD_NOE_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12519  fPadD_NOE_ChDs = gPad; fClosedD_NOE_ChDs = kFALSE;
12521  }
12522 
12523  if(HistoCode == "D_Ped_ChNb")
12524  {
12525  fImpD_Ped_ChNb = (TCanvasImp*)fCanvD_Ped_ChNb->GetCanvasImp();
12526  fCanvD_Ped_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12527  fPadD_Ped_ChNb = gPad; fClosedD_Ped_ChNb = kFALSE;
12529  }
12530 
12531  if(HistoCode == "D_Ped_ChDs")
12532  {
12533  fImpD_Ped_ChDs = (TCanvasImp*)fCanvD_Ped_ChDs->GetCanvasImp();
12534  fCanvD_Ped_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12535  fPadD_Ped_ChDs = gPad; fClosedD_Ped_ChDs = kFALSE;
12537  }
12538 
12539  if(HistoCode == "D_TNo_ChNb")
12540  {
12541  fImpD_TNo_ChNb = (TCanvasImp*)fCanvD_TNo_ChNb->GetCanvasImp();
12542  fCanvD_TNo_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12543  fPadD_TNo_ChNb = gPad; fClosedD_TNo_ChNb = kFALSE;
12545  }
12546 
12547  if(HistoCode == "D_TNo_ChDs") // (SetParametersCanvas)
12548  {
12549  fImpD_TNo_ChDs = (TCanvasImp*)fCanvD_TNo_ChDs->GetCanvasImp();
12550  fCanvD_TNo_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12551  fPadD_TNo_ChDs = gPad; fClosedD_TNo_ChDs = kFALSE;
12553  }
12554 
12555  if(HistoCode == "D_MCs_ChNb")
12556  {
12557  fImpD_MCs_ChNb = (TCanvasImp*)fCanvD_MCs_ChNb->GetCanvasImp();
12558  fCanvD_MCs_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12559  fPadD_MCs_ChNb = gPad; fClosedD_MCs_ChNb = kFALSE;
12561  }
12562 
12563  if(HistoCode == "D_MCs_ChDs")
12564  {
12565  fImpD_MCs_ChDs = (TCanvasImp*)fCanvD_MCs_ChDs->GetCanvasImp();
12566  fCanvD_MCs_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12567  fPadD_MCs_ChDs = gPad; fClosedD_MCs_ChDs = kFALSE;
12569  }
12570 
12571  if(HistoCode == "D_LFN_ChNb") // (SetParametersCanvas)
12572  {
12573  fImpD_LFN_ChNb = (TCanvasImp*)fCanvD_LFN_ChNb->GetCanvasImp();
12574  fCanvD_LFN_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12575  fPadD_LFN_ChNb = gPad; fClosedD_LFN_ChNb = kFALSE;
12577  }
12578 
12579  if(HistoCode == "D_LFN_ChDs")
12580  {
12581  fImpD_LFN_ChDs = (TCanvasImp*)fCanvD_LFN_ChDs->GetCanvasImp();
12582  fCanvD_LFN_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12583  fPadD_LFN_ChDs = gPad; fClosedD_LFN_ChDs = kFALSE;
12585  }
12586 
12587  if(HistoCode == "D_HFN_ChNb")
12588  {
12589  fImpD_HFN_ChNb = (TCanvasImp*)fCanvD_HFN_ChNb->GetCanvasImp();
12590  fCanvD_HFN_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12591  fPadD_HFN_ChNb = gPad; fClosedD_HFN_ChNb = kFALSE;
12593  }
12594 
12595  if(HistoCode == "D_HFN_ChDs")
12596  {
12597  fImpD_HFN_ChDs = (TCanvasImp*)fCanvD_HFN_ChDs->GetCanvasImp();
12598  fCanvD_HFN_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12599  fPadD_HFN_ChDs = gPad; fClosedD_HFN_ChDs = kFALSE;
12601  }
12602 
12603  if(HistoCode == "D_SCs_ChNb") // (SetParametersCanvas)
12604  {
12605  fImpD_SCs_ChNb = (TCanvasImp*)fCanvD_SCs_ChNb->GetCanvasImp();
12606  fCanvD_SCs_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12607  fPadD_SCs_ChNb = gPad; fClosedD_SCs_ChNb = kFALSE;
12609  }
12610 
12611  if(HistoCode == "D_SCs_ChDs")
12612  {
12613  fImpD_SCs_ChDs = (TCanvasImp*)fCanvD_SCs_ChDs->GetCanvasImp();
12614  fCanvD_SCs_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12615  fPadD_SCs_ChDs = gPad; fClosedD_SCs_ChDs = kFALSE;
12617  }
12618 
12619  if(HistoCode == "D_MSp_SpNb")
12620  {
12621  fImpD_MSp_SpNb = (TCanvasImp*)fCanvD_MSp_SpNb->GetCanvasImp();
12622  fCanvD_MSp_SpNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12623  fPadD_MSp_SpNb = gPad; fClosedD_MSp_SpNb = kFALSE;
12625  }
12626 
12627  if(HistoCode == "D_MSp_SpDs")
12628  {
12629  fImpD_MSp_SpDs = (TCanvasImp*)fCanvD_MSp_SpDs->GetCanvasImp();
12630  fCanvD_MSp_SpDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12631  fPadD_MSp_SpDs = gPad; fClosedD_MSp_SpDs = kFALSE;
12633  }
12634 
12635  if(HistoCode == "D_SSp_SpNb") // (SetParametersCanvas)
12636  {
12637  fImpD_SSp_SpNb = (TCanvasImp*)fCanvD_SSp_SpNb->GetCanvasImp();
12638  fCanvD_SSp_SpNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12639  fPadD_SSp_SpNb = gPad; fClosedD_SSp_SpNb = kFALSE;
12641  }
12642 
12643  if(HistoCode == "D_SSp_SpDs") // (SetParametersCanvas)
12644  {
12645  fImpD_SSp_SpDs = (TCanvasImp*)fCanvD_SSp_SpDs->GetCanvasImp();
12646  fCanvD_SSp_SpDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12647  fPadD_SSp_SpDs = gPad; fClosedD_SSp_SpDs = kFALSE;
12649  }
12650 
12651  if(HistoCode == "D_Adc_EvDs")
12652  {
12653  fImpD_Adc_EvDs = (TCanvasImp*)fCanvD_Adc_EvDs->GetCanvasImp();
12654  fCanvD_Adc_EvDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12655  fPadD_Adc_EvDs = gPad; fClosedD_Adc_EvDs = kFALSE;
12657  }
12658 
12659  if(HistoCode == "D_Adc_EvNb")
12660  {
12661  fImpD_Adc_EvNb = (TCanvasImp*)fCanvD_Adc_EvNb->GetCanvasImp();
12662  fCanvD_Adc_EvNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12663  fPadD_Adc_EvNb = gPad; fClosedD_Adc_EvNb = kFALSE;
12665  }
12666 
12667  if(HistoCode == "H_Ped_Date") // (SetParametersCanvas)
12668  {
12669  fImpH_Ped_Date = (TCanvasImp*)fCanvH_Ped_Date->GetCanvasImp();
12670  fCanvH_Ped_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12671  fPadH_Ped_Date = gPad; fClosedH_Ped_Date = kFALSE;
12673  }
12674  if(HistoCode == "H_TNo_Date")
12675  {
12676  fImpH_TNo_Date = (TCanvasImp*)fCanvH_TNo_Date->GetCanvasImp();
12677  fCanvH_TNo_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12678  fPadH_TNo_Date = gPad; fClosedH_TNo_Date = kFALSE;
12680  }
12681  if(HistoCode == "H_MCs_Date")
12682  {
12683  fImpH_MCs_Date = (TCanvasImp*)fCanvH_MCs_Date->GetCanvasImp();
12684  fCanvH_MCs_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12685  fPadH_MCs_Date = gPad; fClosedH_MCs_Date = kFALSE;
12687  }
12688 
12689  if(HistoCode == "H_LFN_Date") // (SetParametersCanvas)
12690  {
12691  fImpH_LFN_Date = (TCanvasImp*)fCanvH_LFN_Date->GetCanvasImp();
12692  fCanvH_LFN_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12693  fPadH_LFN_Date = gPad; fClosedH_LFN_Date = kFALSE;
12695  }
12696  if(HistoCode == "H_HFN_Date")
12697  {
12698  fImpH_HFN_Date = (TCanvasImp*)fCanvH_HFN_Date->GetCanvasImp();
12699  fCanvH_HFN_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12700  fPadH_HFN_Date = gPad; fClosedH_HFN_Date = kFALSE;
12702  }
12703  if(HistoCode == "H_SCs_Date")
12704  {
12705  fImpH_SCs_Date = (TCanvasImp*)fCanvH_SCs_Date->GetCanvasImp();
12706  fCanvH_SCs_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12707  fPadH_SCs_Date = gPad; fClosedH_SCs_Date = kFALSE;
12709  }
12710 
12711  if(HistoCode == "H_Ped_RuDs") // (SetParametersCanvas)
12712  {
12713  fImpH_Ped_RuDs = (TCanvasImp*)fCanvH_Ped_RuDs->GetCanvasImp();
12714  fCanvH_Ped_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12715  fPadH_Ped_RuDs = gPad; fClosedH_Ped_RuDs = kFALSE;
12717  }
12718  if(HistoCode == "H_TNo_RuDs")
12719  {
12720  fImpH_TNo_RuDs = (TCanvasImp*)fCanvH_TNo_RuDs->GetCanvasImp();
12721  fCanvH_TNo_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12722  fPadH_TNo_RuDs = gPad; fClosedH_TNo_RuDs = kFALSE;
12724  }
12725  if(HistoCode == "H_MCs_RuDs")
12726  {
12727  fImpH_MCs_RuDs = (TCanvasImp*)fCanvH_MCs_RuDs->GetCanvasImp();
12728  fCanvH_MCs_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12729  fPadH_MCs_RuDs = gPad; fClosedH_MCs_RuDs = kFALSE;
12731  }
12732 
12733  if(HistoCode == "H_LFN_RuDs") // (SetParametersCanvas)
12734  {
12735  fImpH_LFN_RuDs = (TCanvasImp*)fCanvH_LFN_RuDs->GetCanvasImp();
12736  fCanvH_LFN_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12737  fPadH_LFN_RuDs = gPad; fClosedH_LFN_RuDs = kFALSE;
12739  }
12740  if(HistoCode == "H_HFN_RuDs")
12741  {
12742  fImpH_HFN_RuDs = (TCanvasImp*)fCanvH_HFN_RuDs->GetCanvasImp();
12743  fCanvH_HFN_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12744  fPadH_HFN_RuDs = gPad; fClosedH_HFN_RuDs = kFALSE;
12746  }
12747  if(HistoCode == "H_SCs_RuDs")
12748  {
12749  fImpH_SCs_RuDs = (TCanvasImp*)fCanvH_SCs_RuDs->GetCanvasImp();
12750  fCanvH_SCs_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12751  fPadH_SCs_RuDs = gPad; fClosedH_SCs_RuDs = kFALSE;
12753  }
12754  }
12755 }
12756 // end of SetParametersCanvas
12757 
12758 TCanvas* TEcnaHistos::GetCurrentCanvas(const TString& HistoCode, const TString& opt_plot)
12759 {
12760  TCanvas* main_canvas = nullptr;
12761 
12762  if( opt_plot == fSameOnePlot ){main_canvas = fCanvH1SamePlus;}
12763 
12764  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
12765  {
12766  if(HistoCode == "D_NOE_ChNb"){main_canvas = fCanvD_NOE_ChNb;}
12767  if(HistoCode == "D_NOE_ChDs"){main_canvas = fCanvD_NOE_ChDs;}
12768  if(HistoCode == "D_Ped_ChNb"){main_canvas = fCanvD_Ped_ChNb;}
12769  if(HistoCode == "D_Ped_ChDs"){main_canvas = fCanvD_Ped_ChDs;}
12770  if(HistoCode == "D_TNo_ChNb"){main_canvas = fCanvD_TNo_ChNb;}
12771  if(HistoCode == "D_TNo_ChDs"){main_canvas = fCanvD_TNo_ChDs;}
12772  if(HistoCode == "D_MCs_ChNb"){main_canvas = fCanvD_MCs_ChNb;}
12773  if(HistoCode == "D_MCs_ChDs"){main_canvas = fCanvD_MCs_ChDs;}
12774  if(HistoCode == "D_LFN_ChNb"){main_canvas = fCanvD_LFN_ChNb;}
12775  if(HistoCode == "D_LFN_ChDs"){main_canvas = fCanvD_LFN_ChDs;}
12776  if(HistoCode == "D_HFN_ChNb"){main_canvas = fCanvD_HFN_ChNb;}
12777  if(HistoCode == "D_HFN_ChDs"){main_canvas = fCanvD_HFN_ChDs;}
12778  if(HistoCode == "D_SCs_ChNb"){main_canvas = fCanvD_SCs_ChNb;}
12779  if(HistoCode == "D_SCs_ChDs"){main_canvas = fCanvD_SCs_ChDs;}
12780  if(HistoCode == "D_MSp_SpNb"){main_canvas = fCanvD_MSp_SpNb;}
12781  if(HistoCode == "D_MSp_SpDs"){main_canvas = fCanvD_MSp_SpDs;}
12782  if(HistoCode == "D_SSp_SpNb"){main_canvas = fCanvD_SSp_SpNb;}
12783  if(HistoCode == "D_SSp_SpDs"){main_canvas = fCanvD_SSp_SpDs;}
12784  if(HistoCode == "D_Adc_EvNb"){main_canvas = fCanvD_Adc_EvNb;}
12785  if(HistoCode == "D_Adc_EvDs"){main_canvas = fCanvD_Adc_EvDs;}
12786  if(HistoCode == "H_Ped_Date"){main_canvas = fCanvH_Ped_Date;}
12787  if(HistoCode == "H_TNo_Date"){main_canvas = fCanvH_TNo_Date;}
12788  if(HistoCode == "H_MCs_Date"){main_canvas = fCanvH_MCs_Date;}
12789  if(HistoCode == "H_LFN_Date"){main_canvas = fCanvH_LFN_Date;}
12790  if(HistoCode == "H_HFN_Date"){main_canvas = fCanvH_HFN_Date;}
12791  if(HistoCode == "H_SCs_Date"){main_canvas = fCanvH_SCs_Date;}
12792  if(HistoCode == "H_Ped_RuDs"){main_canvas = fCanvH_Ped_RuDs;}
12793  if(HistoCode == "H_TNo_RuDs"){main_canvas = fCanvH_TNo_RuDs;}
12794  if(HistoCode == "H_MCs_RuDs"){main_canvas = fCanvH_MCs_RuDs;}
12795  if(HistoCode == "H_LFN_RuDs"){main_canvas = fCanvH_LFN_RuDs;}
12796  if(HistoCode == "H_HFN_RuDs"){main_canvas = fCanvH_HFN_RuDs;}
12797  if(HistoCode == "H_SCs_RuDs"){main_canvas = fCanvH_SCs_RuDs;}
12798  }
12799  return main_canvas;
12800 }
12801 // end of GetCurrentCanvas(...)
12802 
12805 
12807 {
12808  if( fCurrentCanvas != nullptr)
12809  {
12810  if( (TCanvasImp*)fCurrentCanvas->GetCanvasImp() != nullptr )
12811  {
12812  static_cast<TCanvas*>(fCurrentCanvas)->DrawClone();
12813  }
12814  else
12815  {
12816  std::cout << "TEcnaHistos::PlotCloneOfCurrentCanvas()> Last canvas has been removed. No clone can be done."
12817  << std::endl << " Please, display the canvas again."
12818  << fTTBELL << std::endl;
12819  }
12820  }
12821  else
12822  {
12823  std::cout << "TEcnaHistos::PlotCloneOfCurrentCanvas()> No canvas has been created. No clone can be done."
12824  << fTTBELL << std::endl;
12825  }
12826 }
12827 
12828 //--------------------------------------------------------------------------------------------
12829 TVirtualPad* TEcnaHistos::ActivePad(const TString& HistoCode, const TString& opt_plot)
12830 {
12831 // Active Pad for Same plot option
12832 
12833  TVirtualPad* main_subpad = nullptr;
12834 
12835  fCurrentHistoCode = HistoCode;
12836  fCurrentOptPlot = opt_plot;
12837 
12838  if( opt_plot == fSameOnePlot )
12839  {
12840  fCanvH1SamePlus->
12841  Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12842  if( fClosedH1SamePlus == kFALSE ){main_subpad = fPadH1SamePlus;}
12843  }
12844 
12845  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12846  {
12847  if(HistoCode == "D_NOE_ChNb"){
12848  fCanvD_NOE_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12849  if( fClosedD_NOE_ChNb == kFALSE ){main_subpad = fPadD_NOE_ChNb;}}
12850 
12851  if(HistoCode == "D_NOE_ChDs"){
12852  fCanvD_NOE_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12853  if( fClosedD_NOE_ChDs == kFALSE ){main_subpad = fPadD_NOE_ChDs;}}
12854 
12855  if(HistoCode == "D_Ped_ChNb"){
12856  fCanvD_Ped_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12857  if( fClosedD_Ped_ChNb == kFALSE ){main_subpad = fPadD_Ped_ChNb;}}
12858 
12859  if(HistoCode == "D_Ped_ChDs"){
12860  fCanvD_Ped_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12861  if( fClosedD_Ped_ChDs == kFALSE ){main_subpad = fPadD_Ped_ChDs;}}
12862 
12863  if(HistoCode == "D_TNo_ChNb"){
12864  fCanvD_TNo_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12865  if( fClosedD_TNo_ChNb == kFALSE ){main_subpad = fPadD_TNo_ChNb;}}
12866 
12867  if(HistoCode == "D_TNo_ChDs"){
12868  fCanvD_TNo_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12869  if( fClosedD_TNo_ChDs == kFALSE ){main_subpad = fPadD_TNo_ChDs;}}
12870 
12871  if(HistoCode == "D_MCs_ChNb"){
12872  fCanvD_MCs_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12873  if( fClosedD_MCs_ChNb == kFALSE ){main_subpad = fPadD_MCs_ChNb;}}
12874 
12875  if(HistoCode == "D_MCs_ChDs"){
12876  fCanvD_MCs_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12877  if( fClosedD_MCs_ChDs == kFALSE ){main_subpad = fPadD_MCs_ChDs;}}
12878 
12879  if(HistoCode == "D_LFN_ChNb"){
12880  fCanvD_LFN_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12881  if( fClosedD_LFN_ChNb == kFALSE ){main_subpad = fPadD_LFN_ChNb;}}
12882 
12883  if(HistoCode == "D_LFN_ChDs"){
12884  fCanvD_LFN_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12885  if( fClosedD_LFN_ChDs == kFALSE ){main_subpad = fPadD_LFN_ChDs;}}
12886 
12887  if(HistoCode == "D_HFN_ChNb"){
12888  fCanvD_HFN_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12889  if( fClosedD_HFN_ChNb == kFALSE ){main_subpad = fPadD_HFN_ChNb;}}
12890 
12891  if(HistoCode == "D_HFN_ChDs"){
12892  fCanvD_HFN_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12893  if( fClosedD_HFN_ChDs == kFALSE ){main_subpad = fPadD_HFN_ChDs;}}
12894 
12895  if(HistoCode == "D_SCs_ChNb"){
12896  fCanvD_SCs_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12897  if( fClosedD_SCs_ChNb == kFALSE ){main_subpad = fPadD_SCs_ChNb;}}
12898 
12899  if(HistoCode == "D_SCs_ChDs"){
12900  fCanvD_SCs_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12901  if( fClosedD_SCs_ChDs == kFALSE ){main_subpad = fPadD_SCs_ChDs;}}
12902 
12903  if(HistoCode == "D_MSp_SpNb"){
12904  fCanvD_MSp_SpNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12905  if( fClosedD_MSp_SpNb == kFALSE ){main_subpad = fPadD_MSp_SpNb;}}
12906 
12907  if(HistoCode == "D_MSp_SpDs"){
12908  fCanvD_MSp_SpDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12909  if( fClosedD_MSp_SpDs == kFALSE ){main_subpad = fPadD_MSp_SpDs;}}
12910 
12911  if(HistoCode == "D_SSp_SpNb"){
12912  fCanvD_SSp_SpNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12913  if( fClosedD_SSp_SpNb == kFALSE ){main_subpad = fPadD_SSp_SpNb;}}
12914 
12915  if(HistoCode == "D_SSp_SpDs"){
12916  fCanvD_SSp_SpDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12917  if( fClosedD_SSp_SpDs == kFALSE ){main_subpad = fPadD_SSp_SpDs;}}
12918 
12919  if(HistoCode == "D_Adc_EvNb"){
12920  fCanvD_Adc_EvNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12921  if( fClosedD_Adc_EvNb == kFALSE ){main_subpad = fPadD_Adc_EvNb;}}
12922 
12923  if(HistoCode == "D_Adc_EvDs"){
12924  fCanvD_Adc_EvDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12925  if( fClosedD_Adc_EvDs == kFALSE ){main_subpad = fPadD_Adc_EvDs;}}
12926 
12927  if(HistoCode == "H_Ped_Date"){
12928  fCanvH_Ped_Date->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12929  if( fClosedH_Ped_Date == kFALSE ){main_subpad = fPadH_Ped_Date;}}
12930 
12931  if(HistoCode == "H_TNo_Date"){
12932  fCanvH_TNo_Date->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12933  if( fClosedH_TNo_Date == kFALSE ){main_subpad = fPadH_TNo_Date;}}
12934 
12935  if(HistoCode == "H_MCs_Date"){
12936  fCanvH_MCs_Date->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12937  if( fClosedH_MCs_Date == kFALSE ){main_subpad = fPadH_MCs_Date;}}
12938 
12939  if(HistoCode == "H_LFN_Date"){
12940  fCanvH_LFN_Date->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12941  if( fClosedH_LFN_Date == kFALSE ){main_subpad = fPadH_LFN_Date;}}
12942 
12943  if(HistoCode == "H_HFN_Date"){
12944  fCanvH_HFN_Date->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12945  if( fClosedH_HFN_Date == kFALSE ){main_subpad = fPadH_HFN_Date;}}
12946 
12947  if(HistoCode == "H_SCs_Date"){
12948  fCanvH_SCs_Date->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12949  if( fClosedH_SCs_Date == kFALSE ){main_subpad = fPadH_SCs_Date;}}
12950 
12951  if(HistoCode == "H_Ped_RuDs"){
12952  fCanvH_Ped_RuDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12953  if( fClosedH_Ped_RuDs == kFALSE ){main_subpad = fPadH_Ped_RuDs;}}
12954 
12955  if(HistoCode == "H_TNo_RuDs"){
12956  fCanvH_TNo_RuDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12957  if( fClosedH_TNo_RuDs == kFALSE ){main_subpad = fPadH_TNo_RuDs;}}
12958 
12959  if(HistoCode == "H_MCs_RuDs"){
12960  fCanvH_MCs_RuDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12961  if( fClosedH_MCs_RuDs == kFALSE ){main_subpad = fPadH_MCs_RuDs;}}
12962 
12963  if(HistoCode == "H_LFN_RuDs"){
12964  fCanvH_LFN_RuDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12965  if( fClosedH_LFN_RuDs == kFALSE ){main_subpad = fPadH_LFN_RuDs;}}
12966 
12967  if(HistoCode == "H_HFN_RuDs"){
12968  fCanvH_HFN_RuDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12969  if( fClosedH_HFN_RuDs == kFALSE ){main_subpad = fPadH_HFN_RuDs;}}
12970 
12971  if(HistoCode == "H_SCs_RuDs"){
12972  fCanvH_SCs_RuDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12973  if( fClosedH_SCs_RuDs == kFALSE ){main_subpad = fPadH_SCs_RuDs;}}
12974  }
12975 
12976  if( main_subpad == nullptr )
12977  {std::cout << "*TEcnaHistos::ActivePad(...)> main_subpad = "
12978  << main_subpad << ". This canvas has been closed." << std::endl;}
12979 
12980  return main_subpad;
12981 }
12982 // end of ActivePad
12983 
12985 {
12988  {
12989  if(fCurrentHistoCode == "D_NOE_ChNb"){fClosedD_NOE_ChNb = kTRUE;}
12990  if(fCurrentHistoCode == "D_NOE_ChDs"){fClosedD_NOE_ChDs = kTRUE;}
12991  if(fCurrentHistoCode == "D_Ped_ChNb"){fClosedD_Ped_ChNb = kTRUE;}
12992  if(fCurrentHistoCode == "D_Ped_ChDs"){fClosedD_Ped_ChDs = kTRUE;}
12993  if(fCurrentHistoCode == "D_TNo_ChNb"){fClosedD_TNo_ChNb = kTRUE;}
12994  if(fCurrentHistoCode == "D_TNo_ChDs"){fClosedD_TNo_ChDs = kTRUE;}
12995  if(fCurrentHistoCode == "D_MCs_ChNb"){fClosedD_MCs_ChNb = kTRUE;}
12996  if(fCurrentHistoCode == "D_MCs_ChDs"){fClosedD_MCs_ChDs = kTRUE;}
12997  if(fCurrentHistoCode == "D_LFN_ChNb"){fClosedD_LFN_ChNb = kTRUE;}
12998  if(fCurrentHistoCode == "D_LFN_ChDs"){fClosedD_LFN_ChDs = kTRUE;}
12999  if(fCurrentHistoCode == "D_HFN_ChNb"){fClosedD_HFN_ChNb = kTRUE;}
13000  if(fCurrentHistoCode == "D_HFN_ChDs"){fClosedD_HFN_ChDs = kTRUE;}
13001  if(fCurrentHistoCode == "D_SCs_ChNb"){fClosedD_SCs_ChNb = kTRUE;}
13002  if(fCurrentHistoCode == "D_SCs_ChDs"){fClosedD_SCs_ChDs = kTRUE;}
13003  if(fCurrentHistoCode == "D_MSp_SpNb"){fClosedD_MSp_SpNb = kTRUE;}
13004  if(fCurrentHistoCode == "D_MSp_SpDs"){fClosedD_MSp_SpDs = kTRUE;}
13005  if(fCurrentHistoCode == "D_SSp_SpNb"){fClosedD_SSp_SpNb = kTRUE;}
13006  if(fCurrentHistoCode == "D_SSp_SpDs"){fClosedD_SSp_SpDs = kTRUE;}
13007  if(fCurrentHistoCode == "D_Adc_EvNb"){fClosedD_Adc_EvNb = kTRUE;}
13008  if(fCurrentHistoCode == "D_Adc_EvDs"){fClosedD_Adc_EvDs = kTRUE;}
13009  if(fCurrentHistoCode == "H_Ped_Date"){fClosedH_Ped_Date = kTRUE;}
13010  if(fCurrentHistoCode == "H_TNo_Date"){fClosedH_TNo_Date = kTRUE;}
13011  if(fCurrentHistoCode == "H_MCs_Date"){fClosedH_MCs_Date = kTRUE;}
13012  if(fCurrentHistoCode == "H_LFN_Date"){fClosedH_LFN_Date = kTRUE;}
13013  if(fCurrentHistoCode == "H_HFN_Date"){fClosedH_HFN_Date = kTRUE;}
13014  if(fCurrentHistoCode == "H_SCs_Date"){fClosedH_SCs_Date = kTRUE;}
13015  if(fCurrentHistoCode == "H_Ped_RuDs"){fClosedH_Ped_RuDs = kTRUE;}
13016  if(fCurrentHistoCode == "H_TNo_RuDs"){fClosedH_TNo_RuDs = kTRUE;}
13017  if(fCurrentHistoCode == "H_MCs_RuDs"){fClosedH_MCs_RuDs = kTRUE;}
13018  if(fCurrentHistoCode == "H_LFN_RuDs"){fClosedH_LFN_RuDs = kTRUE;}
13019  if(fCurrentHistoCode == "H_HFN_RuDs"){fClosedH_HFN_RuDs = kTRUE;}
13020  if(fCurrentHistoCode == "H_SCs_RuDs"){fClosedH_SCs_RuDs = kTRUE;}
13021  }
13022 
13023  fCurrentOptPlot = "NADA"; // to avoid fClosed... = kTRUE if other canvas than those above Closed (i.e. 2D plots)
13024  fCurrentHistoCode = "NADA";
13025 
13026  std::cout << "!TEcnaHistos::DoCanvasClosed(...)> WARNING: canvas has been closed." << std::endl;
13027 }
13028 
13029 void TEcnaHistos::SetParametersPavTxt(const TString& HistoCode, const TString& opt_plot)
13030 {
13031 // Set parameters pave "sevearl changing" according to HistoCode
13032 
13034 
13035  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
13036  {
13037  if(HistoCode == "D_NOE_ChNb"){fPavTxtD_NOE_ChNb = fPavComSeveralChanging;}
13038  if(HistoCode == "D_NOE_ChDs"){fPavTxtD_NOE_ChDs = fPavComSeveralChanging;}
13039  if(HistoCode == "D_Ped_ChNb"){fPavTxtD_Ped_ChNb = fPavComSeveralChanging;}
13040  if(HistoCode == "D_Ped_ChDs"){fPavTxtD_Ped_ChDs = fPavComSeveralChanging;}
13041  if(HistoCode == "D_TNo_ChNb"){fPavTxtD_TNo_ChNb = fPavComSeveralChanging;}
13042  if(HistoCode == "D_TNo_ChDs"){fPavTxtD_TNo_ChDs = fPavComSeveralChanging;}
13043  if(HistoCode == "D_MCs_ChNb"){fPavTxtD_MCs_ChNb = fPavComSeveralChanging;}
13044  if(HistoCode == "D_MCs_ChDs"){fPavTxtD_MCs_ChDs = fPavComSeveralChanging;}
13045  if(HistoCode == "D_LFN_ChNb"){fPavTxtD_LFN_ChNb = fPavComSeveralChanging;}
13046  if(HistoCode == "D_LFN_ChDs"){fPavTxtD_LFN_ChDs = fPavComSeveralChanging;}
13047  if(HistoCode == "D_HFN_ChNb"){fPavTxtD_HFN_ChNb = fPavComSeveralChanging;}
13048  if(HistoCode == "D_HFN_ChDs"){fPavTxtD_HFN_ChDs = fPavComSeveralChanging;}
13049  if(HistoCode == "D_SCs_ChNb"){fPavTxtD_SCs_ChNb = fPavComSeveralChanging;}
13050  if(HistoCode == "D_SCs_ChDs"){fPavTxtD_SCs_ChDs = fPavComSeveralChanging;}
13051  if(HistoCode == "D_MSp_SpNb"){fPavTxtD_MSp_SpNb = fPavComSeveralChanging;}
13052  if(HistoCode == "D_MSp_SpDs"){fPavTxtD_MSp_SpDs = fPavComSeveralChanging;}
13053  if(HistoCode == "D_SSp_SpNb"){fPavTxtD_SSp_SpNb = fPavComSeveralChanging;}
13054  if(HistoCode == "D_SSp_SpDs"){fPavTxtD_SSp_SpDs = fPavComSeveralChanging;}
13055  if(HistoCode == "D_Adc_EvNb"){fPavTxtD_Adc_EvNb = fPavComSeveralChanging;}
13056  if(HistoCode == "D_Adc_EvDs"){fPavTxtD_Adc_EvDs = fPavComSeveralChanging;}
13057  if(HistoCode == "H_Ped_Date"){fPavTxtH_Ped_Date = fPavComSeveralChanging;}
13058  if(HistoCode == "H_TNo_Date"){fPavTxtH_TNo_Date = fPavComSeveralChanging;}
13059  if(HistoCode == "H_MCs_Date"){fPavTxtH_MCs_Date = fPavComSeveralChanging;}
13060  if(HistoCode == "H_LFN_Date"){fPavTxtH_LFN_Date = fPavComSeveralChanging;}
13061  if(HistoCode == "H_HFN_Date"){fPavTxtH_HFN_Date = fPavComSeveralChanging;}
13062  if(HistoCode == "H_SCs_Date"){fPavTxtH_SCs_Date = fPavComSeveralChanging;}
13063  if(HistoCode == "H_Ped_RuDs"){fPavTxtH_Ped_RuDs = fPavComSeveralChanging;}
13064  if(HistoCode == "H_TNo_RuDs"){fPavTxtH_TNo_RuDs = fPavComSeveralChanging;}
13065  if(HistoCode == "H_MCs_RuDs"){fPavTxtH_MCs_RuDs = fPavComSeveralChanging;}
13066  if(HistoCode == "H_LFN_RuDs"){fPavTxtH_LFN_RuDs = fPavComSeveralChanging;}
13067  if(HistoCode == "H_HFN_RuDs"){fPavTxtH_HFN_RuDs = fPavComSeveralChanging;}
13068  if(HistoCode == "H_SCs_RuDs"){fPavTxtH_SCs_RuDs = fPavComSeveralChanging;}
13069  }
13070 }
13071 // end of SetParametersPavTxt
13072 
13073 
13074 TPaveText* TEcnaHistos::ActivePavTxt(const TString& HistoCode, const TString& opt_plot)
13075 {
13076  // Active Pad for Same plot option
13077 
13078  TPaveText* main_pavtxt = nullptr;
13079 
13080  if( opt_plot == fSameOnePlot ){main_pavtxt = fPavTxtH1SamePlus;}
13081 
13082  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
13083  {
13084  if(HistoCode == "D_NOE_ChNb"){main_pavtxt = fPavTxtD_NOE_ChNb;}
13085  if(HistoCode == "D_NOE_ChDs"){main_pavtxt = fPavTxtD_NOE_ChDs;}
13086  if(HistoCode == "D_Ped_ChNb"){main_pavtxt = fPavTxtD_Ped_ChNb;}
13087  if(HistoCode == "D_Ped_ChDs"){main_pavtxt = fPavTxtD_Ped_ChDs;}
13088  if(HistoCode == "D_TNo_ChNb"){main_pavtxt = fPavTxtD_TNo_ChNb;}
13089  if(HistoCode == "D_TNo_ChDs"){main_pavtxt = fPavTxtD_TNo_ChDs;}
13090  if(HistoCode == "D_MCs_ChNb"){main_pavtxt = fPavTxtD_MCs_ChNb;}
13091  if(HistoCode == "D_MCs_ChDs"){main_pavtxt = fPavTxtD_MCs_ChDs;}
13092  if(HistoCode == "D_LFN_ChNb"){main_pavtxt = fPavTxtD_LFN_ChNb;}
13093  if(HistoCode == "D_LFN_ChDs"){main_pavtxt = fPavTxtD_LFN_ChDs;}
13094  if(HistoCode == "D_HFN_ChNb"){main_pavtxt = fPavTxtD_HFN_ChNb;}
13095  if(HistoCode == "D_HFN_ChDs"){main_pavtxt = fPavTxtD_HFN_ChDs;}
13096  if(HistoCode == "D_SCs_ChNb"){main_pavtxt = fPavTxtD_SCs_ChNb;}
13097  if(HistoCode == "D_SCs_ChDs"){main_pavtxt = fPavTxtD_SCs_ChDs;}
13098  if(HistoCode == "D_MSp_SpNb"){main_pavtxt = fPavTxtD_MSp_SpNb;}
13099  if(HistoCode == "D_MSp_SpDs"){main_pavtxt = fPavTxtD_MSp_SpDs;}
13100  if(HistoCode == "D_SSp_SpNb"){main_pavtxt = fPavTxtD_SSp_SpNb;}
13101  if(HistoCode == "D_SSp_SpDs"){main_pavtxt = fPavTxtD_SSp_SpDs;}
13102  if(HistoCode == "D_Adc_EvNb"){main_pavtxt = fPavTxtD_Adc_EvNb;}
13103  if(HistoCode == "D_Adc_EvDs"){main_pavtxt = fPavTxtD_Adc_EvDs;}
13104  if(HistoCode == "H_Ped_Date"){main_pavtxt = fPavTxtH_Ped_Date;}
13105  if(HistoCode == "H_TNo_Date"){main_pavtxt = fPavTxtH_TNo_Date;}
13106  if(HistoCode == "H_MCs_Date"){main_pavtxt = fPavTxtH_MCs_Date;}
13107  if(HistoCode == "H_LFN_Date"){main_pavtxt = fPavTxtH_LFN_Date;}
13108  if(HistoCode == "H_HFN_Date"){main_pavtxt = fPavTxtH_HFN_Date;}
13109  if(HistoCode == "H_SCs_Date"){main_pavtxt = fPavTxtH_SCs_Date;}
13110  if(HistoCode == "H_Ped_RuDs"){main_pavtxt = fPavTxtH_Ped_RuDs;}
13111  if(HistoCode == "H_TNo_RuDs"){main_pavtxt = fPavTxtH_TNo_RuDs;}
13112  if(HistoCode == "H_MCs_RuDs"){main_pavtxt = fPavTxtH_MCs_RuDs;}
13113  if(HistoCode == "H_LFN_RuDs"){main_pavtxt = fPavTxtH_LFN_RuDs;}
13114  if(HistoCode == "H_HFN_RuDs"){main_pavtxt = fPavTxtH_HFN_RuDs;}
13115  if(HistoCode == "H_SCs_RuDs"){main_pavtxt = fPavTxtH_SCs_RuDs;}
13116  }
13117 
13118  if( main_pavtxt == nullptr )
13119  {std::cout << "*TEcnaHistos::ActivePavTxt(...)> ERROR: main_pavtxt = " << main_pavtxt << std::endl;}
13120 
13121  return main_pavtxt;
13122 }
13123 // end of ActivePavTxt
13124 
13125 //void TEcnaHistos::SetViewHistoMarkerAndLine(TH1D* h_his0, const TString& HistoCode, const TString& opt_plot)
13126 //{
13128 //
13129 // TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
13130 //
13131 // //............................... Marker
13132 // h_his0->SetMarkerStyle(1); // default
13133 //
13134 // if( HistoType == "Global" && ( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot ) )
13135 // {h_his0->SetMarkerStyle(7); }
13136 //
13137 // //............................... Line
13138 // h_his0->SetLineWidth(1); // default
13139 //
13140 // if( HistoType == "Global" && ( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot ) )
13141 // {h_his0->SetLineWidth(0);}
13142 //
13143 //}
13144 
13145 void TEcnaHistos::SetViewHistoColors(TH1D* h_his0, const TString& HistoCode,
13146  const TString& opt_plot, const Int_t& arg_AlreadyRead)
13147 {
13148 // Set colors, fill, marker, line style for histo view
13149 
13150  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
13151  if( HistoType == "Global" ){h_his0->SetMarkerStyle(1);}
13152 
13153  Int_t MaxNbOfColors = fCnaParHistos->GetMaxNbOfColors();
13154 
13155  if( opt_plot == fSameOnePlot )
13156  {
13157  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
13158  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
13160  if(fMemoColorH1SamePlus>MaxNbOfColors){fMemoColorH1SamePlus = 0;}
13161  }
13162 
13163  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
13164  {
13165  if(HistoCode == "D_NOE_ChNb")
13166  {
13167  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rose"));}
13168  if(opt_plot == fSeveralPlot )
13169  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChNb));
13170  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChNb));
13172  if(fMemoColorD_NOE_ChNb>MaxNbOfColors){fMemoColorD_NOE_ChNb = 0;}}
13173  }
13174  if(HistoCode == "D_NOE_ChDs")
13175  {
13176  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rose"));}
13177  if(opt_plot == fSeveralPlot )
13178  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChDs));
13179  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChDs));
13181  if(fMemoColorD_NOE_ChDs>MaxNbOfColors){fMemoColorD_NOE_ChDs = 0;}}
13182  }
13183  if(HistoCode == "D_Ped_ChNb")
13184  {
13185  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
13186  if(opt_plot == fSeveralPlot )
13187  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChNb));
13188  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChNb));
13190  if(fMemoColorD_Ped_ChNb>MaxNbOfColors){fMemoColorD_Ped_ChNb = 0;}}
13191  }
13192  if(HistoCode == "D_Ped_ChDs")
13193  {
13194  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
13195  if(opt_plot == fSeveralPlot )
13196  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChDs));
13197  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChDs));
13199  if(fMemoColorD_Ped_ChDs>MaxNbOfColors){fMemoColorD_Ped_ChDs = 0;}}
13200  }
13201  if(HistoCode == "D_TNo_ChNb")
13202  {
13203  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge48"));}
13204  if(opt_plot == fSeveralPlot )
13205  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChNb));
13206  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChNb));
13208  if(fMemoColorD_TNo_ChNb>MaxNbOfColors){fMemoColorD_TNo_ChNb = 0;}}
13209  }
13210  if(HistoCode == "D_TNo_ChDs")
13211  {
13212  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge48"));}
13213  if(opt_plot == fSeveralPlot )
13214  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChDs));
13215  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChDs));
13217  if(fMemoColorD_TNo_ChDs>MaxNbOfColors){fMemoColorD_TNo_ChDs = 0;}}
13218  }
13219 
13220  if(HistoCode == "D_MCs_ChNb")
13221  {
13222  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("vert31"));}
13223  if(opt_plot == fSeveralPlot )
13224  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChNb));
13225  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChNb));
13227  if(fMemoColorD_MCs_ChNb>MaxNbOfColors){fMemoColorD_MCs_ChNb = 0;}}
13228  }
13229  if(HistoCode == "D_MCs_ChDs")
13230  {
13231  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("vert31"));}
13232  if(opt_plot == fSeveralPlot )
13233  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChDs));
13234  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChDs));
13236  if(fMemoColorD_MCs_ChDs>MaxNbOfColors){fMemoColorD_MCs_ChDs = 0;}}
13237  }
13238  if(HistoCode == "D_LFN_ChNb")
13239  {
13240  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge44"));}
13241  if(opt_plot == fSeveralPlot )
13242  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChNb));
13243  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChNb));
13245  if(fMemoColorD_LFN_ChNb>MaxNbOfColors){fMemoColorD_LFN_ChNb = 0;}}
13246  }
13247  if(HistoCode == "D_LFN_ChDs")
13248  {
13249  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge44"));}
13250  if(opt_plot == fSeveralPlot )
13251  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChDs));
13252  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChDs));
13254  if(fMemoColorD_LFN_ChDs>MaxNbOfColors){fMemoColorD_LFN_ChDs = 0;}}
13255  }
13256  if(HistoCode == "D_HFN_ChNb")
13257  {
13258  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
13259  if(opt_plot == fSeveralPlot )
13260  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChNb));
13261  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChNb));
13263  if(fMemoColorD_HFN_ChNb>MaxNbOfColors){fMemoColorD_HFN_ChNb = 0;}}
13264  }
13265  if(HistoCode == "D_HFN_ChDs")
13266  {
13267  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
13268  if(opt_plot == fSeveralPlot )
13269  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChDs));
13270  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChDs));
13272  if(fMemoColorD_HFN_ChDs>MaxNbOfColors){fMemoColorD_HFN_ChDs = 0;}}
13273  }
13274 
13275  if(HistoCode == "D_SCs_ChNb")
13276  {
13277  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("marron23"));}
13278  if(opt_plot == fSeveralPlot )
13279  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChNb));
13280  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChNb));
13282  if(fMemoColorD_SCs_ChNb>MaxNbOfColors){fMemoColorD_SCs_ChNb = 0;}}
13283  }
13284  if(HistoCode == "D_SCs_ChDs")
13285  {
13286  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("marron23"));}
13287  if(opt_plot == fSeveralPlot )
13288  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChDs));
13289  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChDs));
13291  if(fMemoColorD_SCs_ChDs>MaxNbOfColors){fMemoColorD_SCs_ChDs = 0;}}
13292  }
13293 
13294  if(HistoCode == "D_MSp_SpNb")
13295  {
13296  if( (opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) ||
13297  (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1 && fPlotAllXtalsInStin == 0 ) )
13298  {h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
13299 
13300  if( opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 0 && fPlotAllXtalsInStin == 1 )
13301  {h_his0->SetFillColor((Color_t)0);}
13302 
13303  if(opt_plot == fSeveralPlot )
13304  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_SpNb));
13305  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_SpNb));
13307  if(fMemoColorD_MSp_SpNb>MaxNbOfColors){fMemoColorD_MSp_SpNb = 0;}}
13308  }
13309 
13310  if(HistoCode == "D_MSp_SpDs")
13311  {
13312  if( (opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) ||
13313  (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1 && fPlotAllXtalsInStin == 0 ) )
13314  {h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
13315 
13316  if( opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 0 && fPlotAllXtalsInStin == 1 )
13317  {h_his0->SetFillColor((Color_t)0);}
13318 
13319  if(opt_plot == fSeveralPlot )
13320  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_SpDs));
13321  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_SpDs));
13323  if(fMemoColorD_MSp_SpDs>MaxNbOfColors){fMemoColorD_MSp_SpDs = 0;}}
13324  }
13325 
13326  if(HistoCode == "D_SSp_SpNb")
13327  {
13328  if( (opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) ||
13329  (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1 && fPlotAllXtalsInStin == 0 ) )
13330  {h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
13331 
13332  if(opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 0 && fPlotAllXtalsInStin == 1 )
13333  {h_his0->SetFillColor((Color_t)0);}
13334 
13335  if(opt_plot == fSeveralPlot )
13336  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_SpNb));
13337  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_SpNb));
13339  if(fMemoColorD_SSp_SpNb>MaxNbOfColors){fMemoColorD_SSp_SpNb = 0;}}
13340  }
13341 
13342  if(HistoCode == "D_SSp_SpDs")
13343  {
13344  if( (opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) ||
13345  (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1 && fPlotAllXtalsInStin == 0 ) )
13346  {h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
13347 
13348  if(opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 0 && fPlotAllXtalsInStin == 1 )
13349  {h_his0->SetFillColor((Color_t)0);}
13350 
13351  if(opt_plot == fSeveralPlot )
13352  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_SpDs));
13353  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_SpDs));
13355  if(fMemoColorD_SSp_SpDs>MaxNbOfColors){fMemoColorD_SSp_SpDs = 0;}}
13356  }
13357 
13358  if(HistoCode == "D_Adc_EvNb")
13359  {
13360  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("orange42"));}
13361  if(opt_plot == fSeveralPlot )
13362  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvNb));
13363  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvNb));
13365  if(fMemoColorD_Adc_EvNb>MaxNbOfColors){fMemoColorD_Adc_EvNb = 0;}}
13366  gPad->SetGrid(1,0);
13367  }
13368 
13369  if(HistoCode == "D_Adc_EvDs")
13370  {
13371  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("orange42"));}
13372  if(opt_plot == fSeveralPlot )
13373  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvDs));
13374  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvDs));
13376  if(fMemoColorD_Adc_EvDs>MaxNbOfColors){fMemoColorD_Adc_EvDs = 0;}}
13377  }
13378 
13379  if(HistoCode == "H_Ped_RuDs")
13380  {
13381  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
13382  if(opt_plot == fSeveralPlot )
13383  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_RuDs));
13384  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_RuDs));
13386  if(fMemoColorH_Ped_RuDs>MaxNbOfColors){fMemoColorH_Ped_RuDs = 0;}}
13387  gPad->SetGrid(1,1);
13388  }
13389 
13390  if(HistoCode == "H_TNo_RuDs")
13391  {
13392  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge48"));}
13393  if(opt_plot == fSeveralPlot )
13394  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_RuDs));
13395  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_RuDs));
13397  if(fMemoColorH_TNo_RuDs>MaxNbOfColors){fMemoColorH_TNo_RuDs = 0;}}
13398  gPad->SetGrid(1,1);
13399  }
13400 
13401  if(HistoCode == "H_MCs_RuDs")
13402  {
13403  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("vert31"));}
13404  if(opt_plot == fSeveralPlot )
13405  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_RuDs));
13406  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_RuDs));
13408  if(fMemoColorH_MCs_RuDs>MaxNbOfColors){fMemoColorH_MCs_RuDs = 0;}}
13409  gPad->SetGrid(1,1);
13410  }
13411 
13412  if(HistoCode == "H_LFN_RuDs")
13413  {
13414  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge44"));}
13415  if(opt_plot == fSeveralPlot )
13416  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_RuDs));
13417  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_RuDs));
13419  if(fMemoColorH_LFN_RuDs>MaxNbOfColors){fMemoColorH_LFN_RuDs = 0;}}
13420  gPad->SetGrid(1,1);
13421  }
13422 
13423  if(HistoCode == "H_HFN_RuDs")
13424  {
13425  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
13426  if(opt_plot == fSeveralPlot )
13427  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_RuDs));
13428  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_RuDs));
13430  if(fMemoColorH_HFN_RuDs>MaxNbOfColors){fMemoColorH_HFN_RuDs = 0;}}
13431  gPad->SetGrid(1,1);
13432  }
13433 
13434  if(HistoCode == "H_SCs_RuDs")
13435  {
13436  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("marron23"));}
13437  if(opt_plot == fSeveralPlot )
13438  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_RuDs));
13439  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_RuDs));
13441  if(fMemoColorH_SCs_RuDs>MaxNbOfColors){fMemoColorH_SCs_RuDs = 0;}}
13442  gPad->SetGrid(1,1);
13443  }
13444  }
13445 
13446  // if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot){h_his0->SetLineWidth(2);}
13447 }
13448 // end of SetViewHistoColors
13449 
13450 void TEcnaHistos::SetViewGraphColors(TGraph* g_graph0, const TString& HistoCode, const TString& opt_plot)
13451 {
13452 // Set colors for histo view
13453 
13454  Int_t MaxNbOfColors = fCnaParHistos->GetMaxNbOfColors();
13455 
13456  if( opt_plot == fSameOnePlot )
13457  {
13458  g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
13459  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
13461  if(fMemoColorH1SamePlus>MaxNbOfColors){fMemoColorH1SamePlus = 0;}
13462  gPad->SetGrid(1,1);
13463  }
13464 
13465  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
13466  {
13467  if(HistoCode == "H_Ped_Date")
13468  {
13469  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("bleu38"));}
13470  if(opt_plot == fSeveralPlot )
13471  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_Date));
13472  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_Date));
13474  if(fMemoColorH_Ped_Date>MaxNbOfColors){fMemoColorH_Ped_Date = 0;}}
13475  gPad->SetGrid(1,1);
13476  }
13477 
13478  if(HistoCode == "H_TNo_Date")
13479  {
13480  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("rouge48"));}
13481  if(opt_plot == fSeveralPlot)
13482  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_Date));
13483  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_Date));
13485  if(fMemoColorH_TNo_Date>MaxNbOfColors){fMemoColorH_TNo_Date = 0;}}
13486  gPad->SetGrid(1,1);
13487  }
13488 
13489  if(HistoCode == "H_MCs_Date")
13490  {
13491  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("vert31"));}
13492  if(opt_plot == fSeveralPlot)
13493  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_Date));
13494  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_Date));
13496  if(fMemoColorH_MCs_Date>MaxNbOfColors){fMemoColorH_MCs_Date = 0;}}
13497  gPad->SetGrid(1,1);
13498  }
13499 
13500  if(HistoCode == "H_LFN_Date")
13501  {
13502  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("bleu38"));}
13503  if(opt_plot == fSeveralPlot )
13504  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_Date));
13505  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_Date));
13507  if(fMemoColorH_LFN_Date>MaxNbOfColors){fMemoColorH_LFN_Date = 0;}}
13508  gPad->SetGrid(1,1);
13509  }
13510 
13511  if(HistoCode == "H_HFN_Date")
13512  {
13513  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("rouge48"));}
13514  if(opt_plot == fSeveralPlot)
13515  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_Date));
13516  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_Date));
13518  if(fMemoColorH_HFN_Date>MaxNbOfColors){fMemoColorH_HFN_Date = 0;}}
13519  gPad->SetGrid(1,1);
13520  }
13521 
13522  if(HistoCode == "H_SCs_Date")
13523  {
13524  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("vert31"));}
13525  if(opt_plot == fSeveralPlot)
13526  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_Date));
13527  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_Date));
13529  if(fMemoColorH_SCs_Date>MaxNbOfColors){fMemoColorH_SCs_Date = 0;}}
13530  gPad->SetGrid(1,1);
13531  }
13532  }
13533  //if(opt_plot == fSeveralPlot){g_graph0->SetLineWidth(2);}
13534 }
13535 // end of SetViewGraphColors
13536 
13537 Color_t TEcnaHistos::GetViewHistoColor(const TString& HistoCode, const TString& opt_plot)
13538 {
13539  Color_t couleur = fCnaParHistos->ColorDefinition("noir"); // a priori = "noir"
13540 
13541  if( opt_plot == fSameOnePlot ){couleur = fCnaParHistos->ColorTab(fMemoColorH1SamePlus);}
13542 
13543  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
13544  {
13545  if(HistoCode == "D_NOE_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_NOE_ChNb);}
13546  if(HistoCode == "D_NOE_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_NOE_ChDs);}
13547  if(HistoCode == "D_Ped_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_Ped_ChNb);}
13548  if(HistoCode == "D_Ped_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_Ped_ChDs);}
13549  if(HistoCode == "D_TNo_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_TNo_ChNb);}
13550  if(HistoCode == "D_TNo_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_TNo_ChDs);}
13551  if(HistoCode == "D_MCs_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_MCs_ChNb);}
13552  if(HistoCode == "D_MCs_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_MCs_ChDs);}
13553  if(HistoCode == "D_LFN_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_LFN_ChNb);}
13554  if(HistoCode == "D_LFN_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_LFN_ChDs);}
13555  if(HistoCode == "D_HFN_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_HFN_ChNb);}
13556  if(HistoCode == "D_HFN_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_HFN_ChDs);}
13557  if(HistoCode == "D_SCs_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_SCs_ChNb);}
13558  if(HistoCode == "D_SCs_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_SCs_ChDs);}
13559  if(HistoCode == "D_MSp_SpNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_MSp_SpNb);}
13560  if(HistoCode == "D_MSp_SpDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_MSp_SpDs);}
13561  if(HistoCode == "D_SSp_SpNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_SSp_SpNb);}
13562  if(HistoCode == "D_SSp_SpDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_SSp_SpDs);}
13563  if(HistoCode == "D_Adc_EvNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_Adc_EvNb);}
13564  if(HistoCode == "D_Adc_EvDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_Adc_EvDs);}
13565  if(HistoCode == "H_Ped_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_Ped_Date);}
13566  if(HistoCode == "H_TNo_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_TNo_Date);}
13567  if(HistoCode == "H_MCs_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_MCs_Date);}
13568  if(HistoCode == "H_LFN_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_LFN_Date);}
13569  if(HistoCode == "H_HFN_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_HFN_Date);}
13570  if(HistoCode == "H_SCs_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_SCs_Date);}
13571  if(HistoCode == "H_Ped_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_Ped_RuDs);}
13572  if(HistoCode == "H_TNo_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_TNo_RuDs);}
13573  if(HistoCode == "H_MCs_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_MCs_RuDs);}
13574  if(HistoCode == "H_LFN_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_LFN_RuDs);}
13575  if(HistoCode == "H_HFN_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_HFN_RuDs);}
13576  if(HistoCode == "H_SCs_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_SCs_RuDs);}
13577  }
13578  return couleur;
13579 }
13580 // end of GetViewHistoColor
13581 
13582 Color_t TEcnaHistos::GetSCColor(const TString& DeeEndcap, const TString& DeeDir, const TString& QuadType)
13583 {
13584  //gives the SC color for the numbering plots
13585  TColor* my_color = new TColor();
13586  Color_t couleur = fCnaParHistos->ColorDefinition("noir"); // default = "noir"
13587 
13588  if( DeeEndcap == "EE+" )
13589  {
13590  if ( DeeDir == "right" && QuadType == "top" ){couleur=fCnaParHistos->ColorDefinition("rouge");}
13591  if ( DeeDir == "right" && QuadType == "bottom" ){couleur=fCnaParHistos->ColorDefinition("bleu_fonce");}
13592  if ( DeeDir == "left" && QuadType == "top" ){couleur=(Color_t)my_color->GetColor("#006600");}
13593  if ( DeeDir == "left" && QuadType == "bottom" ){couleur=(Color_t)my_color->GetColor("#CC3300");}
13594  }
13595  if( DeeEndcap == "EE-" )
13596  {
13597  if ( DeeDir == "right" && QuadType == "top" ){couleur=(Color_t)my_color->GetColor("#008800");}
13598  if ( DeeDir == "right" && QuadType == "bottom" ){couleur=(Color_t)my_color->GetColor("#EE5500");}
13599  if ( DeeDir == "left" && QuadType == "top" ){couleur=fCnaParHistos->ColorDefinition("rouge");}
13600  if ( DeeDir == "left" && QuadType == "bottom" ){couleur=fCnaParHistos->ColorDefinition("bleu_fonce");}
13601  }
13602 
13603  return couleur;
13604 }
13606 {
13607  // Set presentation (axis title offsets, title size, label size, etc...
13608 
13609  fCnaParHistos->SetViewHistoStyle(HistoType.Data());
13610  fCnaParHistos->SetViewHistoPadMargins(HistoType.Data(), " ");
13611  fCnaParHistos->SetViewHistoOffsets(histo, HistoType.Data(), " ");
13612  fCnaParHistos->SetViewHistoStats(histo, HistoType.Data());
13613 }
13614 void TEcnaHistos::SetHistoPresentation(TH1D* histo, const TString& HistoType, const TString& opt_plot)
13615 {
13616 // Set presentation (axis title offsets, title size, label size, etc...
13617 
13618  fCnaParHistos->SetViewHistoStyle(HistoType.Data());
13619  fCnaParHistos->SetViewHistoPadMargins(HistoType.Data(), opt_plot.Data());
13620  fCnaParHistos->SetViewHistoOffsets(histo, HistoType.Data(), opt_plot.Data());
13621  fCnaParHistos->SetViewHistoStats(histo, HistoType.Data());
13622 }
13623 
13624 void TEcnaHistos::SetGraphPresentation(TGraph* graph, const TString& HistoType, const TString& opt_plot)
13625 {
13626 // Set presentation (axis title offsets, title size, label size, etc...
13627 
13628  fCnaParHistos->SetViewHistoStyle(HistoType.Data());
13629  fCnaParHistos->SetViewHistoPadMargins(HistoType.Data(), opt_plot);
13630  fCnaParHistos->SetViewGraphOffsets(graph, HistoType.Data());
13631 
13632  //............................... Graph marker
13633  graph->SetMarkerStyle(1);
13634  if( HistoType == "Evol" ){graph->SetMarkerStyle(20);}
13635 }
13636 
13637 //=====================================================================
13638 //
13639 // NewCanvas, ReInitCanvas
13640 //
13641 //=====================================================================
13642 void TEcnaHistos::NewCanvas(const TString& opt_plot)
13643 {
13644 // ReInit canvas in option SAME n in order to restart a new SAME n plot
13645 // (called by user only for option Same n)
13646 
13647  if( opt_plot == fSameOnePlot )
13648  {
13649  fImpH1SamePlus = nullptr; fCanvH1SamePlus = nullptr;
13650  fPadH1SamePlus = nullptr; fMemoPlotH1SamePlus = 0;
13652  fPavTxtH1SamePlus = nullptr; fClosedH1SamePlus = kFALSE;
13653  }
13654  else
13655  {
13656  std::cout << "TEcnaHistos::NewCanvas(...)> *** ERROR *** " << opt_plot.Data() << ": "
13657  << "unknown option for NewCanvas. Only " << fSameOnePlot << " option is accepted."
13658  << fTTBELL << std::endl;
13659  }
13660 }
13661 
13662 void TEcnaHistos::ReInitCanvas(const TString& HistoCode, const TString& opt_plot)
13663 {
13664 // ReInit canvas in option SAME and SAME n
13665 
13666  if( opt_plot == fSameOnePlot )
13667  {
13668  fImpH1SamePlus = nullptr; fCanvH1SamePlus = nullptr;
13669  fPadH1SamePlus = nullptr; fMemoPlotH1SamePlus = 0;
13671  fPavTxtH1SamePlus = nullptr; fClosedH1SamePlus = kFALSE;
13672  }
13673 
13674  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
13675  {
13676  if(HistoCode == "D_NOE_ChNb")
13677  {
13678  fImpD_NOE_ChNb = nullptr; fCanvD_NOE_ChNb = nullptr;
13679  fPadD_NOE_ChNb = nullptr; fMemoPlotD_NOE_ChNb = 0;
13681  fPavTxtD_NOE_ChNb = nullptr; fClosedD_NOE_ChNb = kFALSE;
13682  }
13683 
13684  if(HistoCode == "D_NOE_ChDs")
13685  {
13686  fImpD_NOE_ChDs = nullptr; fCanvD_NOE_ChDs = nullptr;
13687  fPadD_NOE_ChDs = nullptr; fMemoPlotD_NOE_ChDs = 0;
13689  fPavTxtD_NOE_ChDs = nullptr; fClosedD_NOE_ChDs = kFALSE;
13690  }
13691 
13692  if(HistoCode == "D_Ped_ChNb") // (ReInitCanvas)
13693  {
13694  fImpD_Ped_ChNb = nullptr; fCanvD_Ped_ChNb = nullptr;
13695  fPadD_Ped_ChNb = nullptr; fMemoPlotD_Ped_ChNb = 0;
13697  fPavTxtD_Ped_ChNb = nullptr; fClosedD_Ped_ChNb = kFALSE;
13698  }
13699 
13700  if(HistoCode == "D_Ped_ChDs")
13701  {
13702  fImpD_Ped_ChDs = nullptr; fCanvD_Ped_ChDs = nullptr;
13703  fPadD_Ped_ChDs = nullptr; fMemoPlotD_Ped_ChDs = 0;
13705  fPavTxtD_Ped_ChDs = nullptr; fClosedD_Ped_ChDs = kFALSE;
13706  }
13707 
13708  if(HistoCode == "D_TNo_ChNb")
13709  {
13710  fImpD_TNo_ChNb = nullptr; fCanvD_TNo_ChNb = nullptr;
13711  fPadD_TNo_ChNb = nullptr; fMemoPlotD_TNo_ChNb = 0;
13713  fPavTxtD_TNo_ChNb = nullptr; fClosedD_TNo_ChNb = kFALSE;
13714  }
13715 
13716  if(HistoCode == "D_TNo_ChDs")
13717  {
13718  fImpD_TNo_ChDs = nullptr; fCanvD_TNo_ChDs = nullptr;
13719  fPadD_TNo_ChDs = nullptr; fMemoPlotD_TNo_ChDs = 0;
13721  fPavTxtD_TNo_ChDs = nullptr; fClosedD_TNo_ChDs = kFALSE;
13722  }
13723 
13724  if(HistoCode == "D_MCs_ChNb") // (ReInitCanvas)
13725  {
13726  fImpD_MCs_ChNb = nullptr; fCanvD_MCs_ChNb = nullptr;
13727  fPadD_MCs_ChNb = nullptr; fMemoPlotD_MCs_ChNb = 0;
13729  fPavTxtD_MCs_ChNb = nullptr; fClosedD_MCs_ChNb = kFALSE;
13730  }
13731 
13732  if(HistoCode == "D_MCs_ChDs")
13733  {
13734  fImpD_MCs_ChDs = nullptr; fCanvD_MCs_ChDs = nullptr;
13735  fPadD_MCs_ChDs = nullptr; fMemoPlotD_MCs_ChDs = 0;
13737  fPavTxtD_MCs_ChDs = nullptr; fClosedD_MCs_ChDs = kFALSE;
13738  }
13739 
13740  if(HistoCode == "D_LFN_ChNb")
13741  {
13742  fImpD_LFN_ChNb = nullptr; fCanvD_LFN_ChNb = nullptr;
13743  fPadD_LFN_ChNb = nullptr; fMemoPlotD_LFN_ChNb = 0;
13745  fPavTxtD_LFN_ChNb = nullptr; fClosedD_LFN_ChNb = kFALSE;
13746  }
13747 
13748  if(HistoCode == "D_LFN_ChDs") // (ReInitCanvas)
13749  {
13750  fImpD_LFN_ChDs = nullptr; fCanvD_LFN_ChDs = nullptr;
13751  fPadD_LFN_ChDs= nullptr; fMemoPlotD_LFN_ChDs = 0;
13753  fPavTxtD_LFN_ChDs= nullptr; fClosedD_LFN_ChDs = kFALSE;
13754  }
13755 
13756  if(HistoCode == "D_HFN_ChNb")
13757  {
13758  fImpD_HFN_ChNb = nullptr; fCanvD_HFN_ChNb = nullptr;
13759  fPadD_HFN_ChNb = nullptr; fMemoPlotD_HFN_ChNb = 0;
13761  fPavTxtD_HFN_ChNb = nullptr; fClosedD_HFN_ChNb = kFALSE;
13762  }
13763 
13764  if(HistoCode == "D_HFN_ChDs")
13765  {
13766  fImpD_HFN_ChDs = nullptr; fCanvD_HFN_ChDs = nullptr;
13767  fPadD_HFN_ChDs = nullptr; fMemoPlotD_HFN_ChDs = 0;
13769  fPavTxtD_HFN_ChDs = nullptr; fClosedD_HFN_ChDs = kFALSE;
13770  }
13771 
13772  if(HistoCode == "D_SCs_ChNb")
13773  {
13774  fImpD_SCs_ChNb = nullptr; fCanvD_SCs_ChNb = nullptr;
13775  fPadD_SCs_ChNb = nullptr; fMemoPlotD_SCs_ChNb = 0;
13777  fPavTxtD_SCs_ChNb = nullptr; fClosedD_SCs_ChNb = kFALSE;
13778  }
13779 
13780  if(HistoCode == "D_SCs_ChDs") // (ReInitCanvas)
13781  {
13782  fImpD_SCs_ChDs = nullptr; fCanvD_SCs_ChDs = nullptr;
13783  fPadD_SCs_ChDs = nullptr; fMemoPlotD_SCs_ChDs = 0;
13785  fPavTxtD_SCs_ChDs = nullptr; fClosedD_SCs_ChDs = kFALSE;
13786  }
13787 
13788  if(HistoCode == "D_MSp_SpNb")
13789  {
13790  fImpD_MSp_SpNb = nullptr; fCanvD_MSp_SpNb = nullptr;
13791  fPadD_MSp_SpNb = nullptr; fMemoPlotD_MSp_SpNb = 0;
13793  fPavTxtD_MSp_SpNb = nullptr; fClosedD_MSp_SpNb = kFALSE;
13794  }
13795 
13796  if(HistoCode == "D_MSp_SpDs")
13797  {
13798  fImpD_MSp_SpDs = nullptr; fCanvD_MSp_SpDs = nullptr;
13799  fPadD_MSp_SpDs = nullptr; fMemoPlotD_MSp_SpDs = 0;
13801  fPavTxtD_MSp_SpDs = nullptr; fClosedD_MSp_SpDs = kFALSE;
13802  }
13803 
13804  if(HistoCode == "D_SSp_SpNb")
13805  {
13806  fImpD_SSp_SpNb = nullptr; fCanvD_SSp_SpNb = nullptr;
13807  fPadD_SSp_SpNb = nullptr; fMemoPlotD_SSp_SpNb= 0;
13809  fPavTxtD_SSp_SpNb = nullptr; fClosedD_SSp_SpNb = kFALSE;
13810  }
13811 
13812  if(HistoCode == "D_SSp_SpDs")
13813  {
13814  fImpD_SSp_SpDs = nullptr; fCanvD_SSp_SpDs = nullptr;
13815  fPadD_SSp_SpDs = nullptr; fMemoPlotD_SSp_SpDs= 0;
13817  fPavTxtD_SSp_SpDs = nullptr; fClosedD_SSp_SpDs = kFALSE;
13818  }
13819 
13820  if(HistoCode == "D_Adc_EvNb") // (ReInitCanvas)
13821  {
13822  fImpD_Adc_EvNb = nullptr; fCanvD_Adc_EvNb = nullptr;
13823  fPadD_Adc_EvNb = nullptr; fMemoPlotD_Adc_EvNb = 0;
13825  fPavTxtD_Adc_EvNb = nullptr; fClosedD_Adc_EvNb = kFALSE;
13826  }
13827 
13828  if(HistoCode == "D_Adc_EvDs")
13829  {
13830  fImpD_Adc_EvDs = nullptr; fCanvD_Adc_EvDs = nullptr;
13831  fPadD_Adc_EvDs = nullptr; fMemoPlotD_Adc_EvDs = 0;
13833  fPavTxtD_Adc_EvDs = nullptr; fClosedD_Adc_EvDs = kFALSE;
13834  }
13835 
13836 
13837  if(HistoCode == "H_Ped_Date")
13838  {
13839  fImpH_Ped_Date = nullptr; fCanvH_Ped_Date = nullptr;
13840  fPadH_Ped_Date = nullptr; fMemoPlotH_Ped_Date = 0;
13843  }
13844 
13845  if(HistoCode == "H_TNo_Date")
13846  {
13847  fImpH_TNo_Date = nullptr; fCanvH_TNo_Date = nullptr;
13848  fPadH_TNo_Date = nullptr; fMemoPlotH_TNo_Date = 0;
13851  }
13852 
13853  if(HistoCode == "H_MCs_Date") // (ReInitCanvas)
13854  {
13855  fImpH_MCs_Date = nullptr; fCanvH_MCs_Date = nullptr;
13856  fPadH_MCs_Date = nullptr; fMemoPlotH_MCs_Date = 0;
13859  }
13860 
13861 
13862  if(HistoCode == "H_LFN_Date")
13863  {
13864  fImpH_LFN_Date = nullptr; fCanvH_LFN_Date = nullptr;
13865  fPadH_LFN_Date = nullptr; fMemoPlotH_LFN_Date = 0;
13868  }
13869 
13870  if(HistoCode == "H_HFN_Date")
13871  {
13872  fImpH_HFN_Date = nullptr; fCanvH_HFN_Date = nullptr;
13873  fPadH_HFN_Date = nullptr; fMemoPlotH_HFN_Date = 0;
13876  }
13877 
13878  if(HistoCode == "H_SCs_Date")
13879  {
13880  fImpH_SCs_Date = nullptr; fCanvH_SCs_Date = nullptr;
13881  fPadH_SCs_Date = nullptr; fMemoPlotH_SCs_Date = 0;
13884  }
13885 
13886  if(HistoCode == "H_Ped_RuDs")
13887  {
13888  fImpH_Ped_RuDs = nullptr; fCanvH_Ped_RuDs = nullptr;
13889  fPadH_Ped_RuDs = nullptr; fMemoPlotH_Ped_RuDs = 0;
13892  }
13893 
13894  if(HistoCode == "H_TNo_RuDs")
13895  {
13896  fImpH_TNo_RuDs = nullptr; fCanvH_TNo_RuDs = nullptr;
13897  fPadH_TNo_RuDs = nullptr; fMemoPlotH_TNo_RuDs = 0;
13900  }
13901 
13902  if(HistoCode == "H_MCs_RuDs") // (ReInitCanvas)
13903  {
13904  fImpH_MCs_RuDs = nullptr; fCanvH_MCs_RuDs = nullptr;
13905  fPadH_MCs_RuDs = nullptr; fMemoPlotH_MCs_RuDs = 0;
13908  }
13909 
13910 
13911  if(HistoCode == "H_LFN_RuDs")
13912  {
13913  fImpH_LFN_RuDs = nullptr; fCanvH_LFN_RuDs = nullptr;
13914  fPadH_LFN_RuDs = nullptr; fMemoPlotH_LFN_RuDs = 0;
13917  }
13918 
13919  if(HistoCode == "H_HFN_RuDs")
13920  {
13921  fImpH_HFN_RuDs = nullptr; fCanvH_HFN_RuDs = nullptr;
13922  fPadH_HFN_RuDs = nullptr; fMemoPlotH_HFN_RuDs = 0;
13925  }
13926 
13927  if(HistoCode == "H_SCs_RuDs")
13928  {
13929  fImpH_SCs_RuDs = nullptr; fCanvH_SCs_RuDs = nullptr;
13930  fPadH_SCs_RuDs = nullptr; fMemoPlotH_SCs_RuDs = 0;
13933  }
13934  }
13935 }
13936 // ------- end of ReInitCanvas(...) ------------
13937 
13938 //==========================================================================================
13939 void TEcnaHistos::WriteMatrixAscii(const TString& BetweenWhat, const TString& CorOrCov,
13940  const Int_t& StexStinEcna, const Int_t& MatrixBinIndex,
13941  const Int_t& MatSize, const TMatrixD& read_matrix)
13942 {
13943 // write matrix in ascii file
13944 
13945  Int_t ChanNumber = MatrixBinIndex;
13946 
13950 
13951  if( BetweenWhat == fBetweenSamples && CorOrCov == fCorrelationMatrix )
13952  {
13953  fCnaWrite->WriteAsciiCorrelationsBetweenSamples(StexStinEcna, ChanNumber, MatSize, read_matrix);
13955  }
13956 
13957  if( BetweenWhat == fBetweenSamples && CorOrCov == fCovarianceMatrix )
13958  {
13959  fCnaWrite->WriteAsciiCovariancesBetweenSamples(StexStinEcna, ChanNumber, MatSize, read_matrix);
13961  }
13962 }
13963 //...............................................................................................
13964 void TEcnaHistos::WriteHistoAscii(const TString& HistoCode, const Int_t& HisSize,
13965  const TVectorD& read_histo)
13966 {
13967 // write matrix in ascii file
13968 
13973 
13974  fCnaWrite->WriteAsciiHisto(HistoCode, HisSize, read_histo);
13976 }
13977 
13979 
13980 //---------------> messages de rappel pour l'auteur:
13981 //
13982 //======= 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 ==============!!!!
13983 // A EVITER ABSOLUMENT quand on est sous TEcnaGui CAR LE cin >> BLOQUE X11
13984 // puisqu'on n'a pas la main dans la fenetre de compte-rendu de la CNA
13985 // {Int_t cintoto; std::cout << "taper 0 pour continuer" << std::endl; cin >> cintoto;}
13986 // *=================================================*
13987 // | |
13988 //++++++++++++++++++++++++| A T T E N T I O N: PAS DE TEST "cintoto" ici! |+++++++++++++++++++++!!!!
13989 // | |
13990 // *=================================================*
13991 //
13992 // INFO: When "new" fails to allocate the memory for an object, or "new[]" fails to allocate the memory
13993 // for an object array, a std::bad_alloc object is thrown.
13994 // "In GCC, the RTTI mangled name of std::bad_alloc is, I'm guessing, St9bad_alloc."
TCanvasImp * fImpH_TNo_Date
Definition: TEcnaHistos.h:941
Double_t fD_TNo_ChDsYmin
Definition: TEcnaHistos.h:551
Bool_t fClosedH_LFN_RuDs
Definition: TEcnaHistos.h:842
Int_t fMemoPlotD_HFN_ChDs
Definition: TEcnaHistos.h:641
Axis_t fD_TNo_ChDsXinf
Definition: TEcnaHistos.h:481
TVirtualPad * fPadD_NOE_ChDs
Definition: TEcnaHistos.h:853
TPaveText * fPavTxtD_MSp_SpNb
Definition: TEcnaHistos.h:900
Bool_t fClosedH1SamePlus
Definition: TEcnaHistos.h:812
TString fFapStexType
Definition: TEcnaHistos.h:408
Int_t MaxCrysPhiInTow()
Int_t fNbOfListFileH_MCs_Date
Definition: TEcnaHistos.h:971
Double_t fH_LFN_RuDsYmin
Definition: TEcnaHistos.h:601
Bool_t fClosedD_SSp_SpNb
Definition: TEcnaHistos.h:829
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:649
TString fXMemoH_TNo_RuDs
Definition: TEcnaHistos.h:701
Bool_t fClosedD_Ped_ChNb
Definition: TEcnaHistos.h:815
TCanvas * CreateCanvas(const TString &, const TString &, const TString &, UInt_t, UInt_t)
Axis_t fH_Ped_RuDsXinf
Definition: TEcnaHistos.h:525
Int_t fAlreadyRead
Definition: TEcnaHistos.h:379
TPaveText * fPavTxtH_TNo_RuDs
Definition: TEcnaHistos.h:913
Double_t fD_SCs_ChNbYmin
Definition: TEcnaHistos.h:565
TEcnaNumbering * fEcalNumbering
Definition: TEcnaHistos.h:375
Int_t fMemoColorH_LFN_RuDs
Definition: TEcnaHistos.h:666
Axis_t fD_Adc_EvDsXsup
Definition: TEcnaHistos.h:509
Int_t MaxCrysIYInDee()
Int_t MaxSCIYInDee()
TString fSameOnePlot
Definition: TEcnaHistos.h:631
TPaveText * fPavTxtD_Ped_ChNb
Definition: TEcnaHistos.h:888
TString fStartDate
Definition: TEcnaHistos.h:428
TString SetHistoXAxisTitle(const TString &)
Int_t fCanvSameD_MCs_ChNb
Definition: TEcnaHistos.h:957
void PlotDetector(const TVectorD &, const TString &, const TString &)
void SCCrystalNumbering(const Int_t &, const Int_t &)
TCanvas * fCanvH_SCs_RuDs
Definition: TEcnaHistos.h:810
Axis_t fH_TNo_RuDsXinf
Definition: TEcnaHistos.h:527
Double_t fH_TNo_DateYmax
Definition: TEcnaHistos.h:585
Int_t fCdeleteRoot
Definition: TEcnaHistos.h:360
void XtalSamplesSigma(const TVectorD &, const Int_t &, const Int_t &, const Int_t &, const TString &)
TPaveText * fPavTxtH_HFN_RuDs
Definition: TEcnaHistos.h:916
TVectorD ReadLowFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2049
Int_t MaxCrysEtaInTow()
Int_t fNbBinsMemoH_LFN_Date
Definition: TEcnaHistos.h:765
void SetViewHistoStats(TH1D *, const TString &)
TCanvasImp * fImpD_Ped_ChDs
Definition: TEcnaHistos.h:923
Double_t fH_Ped_RuDsYmax
Definition: TEcnaHistos.h:596
Int_t fNbBinsMemoH_MCs_Date
Definition: TEcnaHistos.h:764
Axis_t fD_Ped_ChDsXsup
Definition: TEcnaHistos.h:478
TString fFapStexDir
Definition: TEcnaHistos.h:409
Int_t GetRunNumber()
Definition: TEcnaRead.cc:744
TVirtualPad * fPadD_LFN_ChNb
Definition: TEcnaHistos.h:860
TString fYMemoH_LFN_RuDs
Definition: TEcnaHistos.h:737
Double_t fH_LFN_DateYmin
Definition: TEcnaHistos.h:588
TString fXMemoD_MCs_ChNb
Definition: TEcnaHistos.h:680
Int_t fMemoColorD_TNo_ChNb
Definition: TEcnaHistos.h:656
Int_t fNbBinsMemoD_HFN_ChNb
Definition: TEcnaHistos.h:752
Int_t * fT1DRunNumber
Definition: TEcnaHistos.h:432
Color_t SetColorsForNumbers(const TString &)
Int_t fMemoColorH_TNo_Date
Definition: TEcnaHistos.h:665
TVectorD ReadAverageHighFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2610
Int_t fMemoColorD_SCs_ChNb
Definition: TEcnaHistos.h:660
Double_t fD_LFN_ChNbYmax
Definition: TEcnaHistos.h:558
TString BuildStandard1DHistoCodeX(const TString &, const TString &)
Int_t fMemoColorH_SCs_Date
Definition: TEcnaHistos.h:669
TPaveText * SetPaveStinsXY(const Int_t &, const Int_t &)
TString GetSCQuadFrom1DeeSCEcna(const Int_t &)
TPaveText * fPavComAnaRun
Definition: TEcnaHistos.h:621
Int_t GetNotConnectedDSSCFromIndex(const Int_t &)
TPaveText * fPavComStex
Definition: TEcnaHistos.h:618
Int_t GetLastReqEvtNumber()
Definition: TEcnaRead.cc:746
Int_t MaxCrysEcnaInDee()
Int_t GetHistoNumberOfBins(const TString &, const Int_t &)
Int_t fOptVisPolm
Definition: TEcnaHistos.h:448
Axis_t fD_Adc_EvNbXsup
Definition: TEcnaHistos.h:511
TString fCorrelationMatrix
Definition: TEcnaHistos.h:452
Int_t fNbBinsMemoD_SSp_SpNb
Definition: TEcnaHistos.h:758
Int_t fFapMaxNbOfRuns
Definition: TEcnaHistos.h:397
TString fFlagScaleX
Definition: TEcnaHistos.h:439
TString fStartEvolDate
Definition: TEcnaHistos.h:405
void InitSpecParBeforeFileReading()
TString fXMemoD_MCs_ChDs
Definition: TEcnaHistos.h:681
TCanvasImp * fImpH_MCs_Date
Definition: TEcnaHistos.h:942
Int_t fMemoColorH_HFN_RuDs
Definition: TEcnaHistos.h:667
TPaveText * fPavComStas
Definition: TEcnaHistos.h:617
void ViewStex(const TVectorD &, const Int_t &, const TString &)
TString fYMemoD_HFN_ChDs
Definition: TEcnaHistos.h:719
Int_t GetHistoryRunListParameters(const TString &, const TString &)
TPaveText * fPavTxtH_MCs_Date
Definition: TEcnaHistos.h:908
Int_t Get0SMEchaFrom1SMTowAnd0TowEcha(const Int_t &, const Int_t &)
TString GetMemoFlag(const TString &)
TString fRunType
Definition: TEcnaHistos.h:429
Int_t Get1DeeSCEcnaFromDeeSCCons(const Int_t &, const Int_t &)
TString BuildStandardPlotOption(const TString &, const TString &)
Int_t fMemoColorH_MCs_RuDs
Definition: TEcnaHistos.h:668
TString fYMemoD_Ped_ChNb
Definition: TEcnaHistos.h:710
TString fYMemoH_MCs_Date
Definition: TEcnaHistos.h:730
TPaveText * fPavTxtH_SCs_RuDs
Definition: TEcnaHistos.h:917
void SetNbBinsMemo(const TString &, const TString &, const Int_t &)
Float_t AxisTitleOffset()
Int_t fMemoPlotD_Adc_EvNb
Definition: TEcnaHistos.h:645
TString GetXVarFromMemo(const TString &, const TString &)
Int_t fMemoPlotD_NOE_ChDs
Definition: TEcnaHistos.h:636
void SetXsupMemoFromValue(const TString &, const Double_t &)
Int_t GetCodePlotAllXtalsInStin()
TCanvasImp * fImpD_MSp_SpDs
Definition: TEcnaHistos.h:935
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:425
void WriteAsciiCovariancesBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1405
Double_t GetPhiMin(const Int_t &, const Int_t &)
TCanvas * fCanvD_NOE_ChNb
Definition: TEcnaHistos.h:779
Int_t fNbBinsMemoD_TNo_ChNb
Definition: TEcnaHistos.h:746
TCanvas * fCanvH_HFN_Date
Definition: TEcnaHistos.h:803
Double_t GetXinfValueFromMemo()
TVirtualPad * fPadD_HFN_ChDs
Definition: TEcnaHistos.h:863
TVirtualPad * fPadH_Ped_Date
Definition: TEcnaHistos.h:872
Int_t fTextPaveAlign
Definition: TEcnaHistos.h:458
TCanvas * fCanvD_SCs_ChDs
Definition: TEcnaHistos.h:792
Axis_t fH_TNo_DateXinf
Definition: TEcnaHistos.h:514
Int_t GetNotCompleteDSSCFromIndex(const Int_t &)
Int_t fNbBinsMemoH_TNo_RuDs
Definition: TEcnaHistos.h:769
Int_t MaxCrysVecoInStin()
Axis_t fH_LFN_DateXinf
Definition: TEcnaHistos.h:518
TString GetYVarFromMemo(const TString &, const TString &)
Int_t fCanvSameD_SSp_SpDs
Definition: TEcnaHistos.h:962
TString BuildStandard1DHistoCodeY(const TString &, const TString &)
Int_t GetYStinInStas(const Int_t &, const Int_t &)
Int_t fMemoPlotD_MSp_SpNb
Definition: TEcnaHistos.h:643
TMatrixD ReadCovariancesBetweenSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:2867
TCanvas * fCanvD_Adc_EvDs
Definition: TEcnaHistos.h:797
Float_t DeeNameOffsetX(const Int_t &)
void CorrelationsBetweenSamples(const Int_t &)
void PlotMatrix(const TMatrixD &, const TString &, const TString &)
Definition: TEcnaHistos.cc:891
Double_t fH_MCs_DateYmax
Definition: TEcnaHistos.h:587
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:610
TString fXMemoD_NOE_ChNb
Definition: TEcnaHistos.h:674
Int_t fCanvSameD_SCs_ChNb
Definition: TEcnaHistos.h:960
Int_t fNbBinsMemoH_Ped_RuDs
Definition: TEcnaHistos.h:768
Double_t fD_MSp_SpNbYmax
Definition: TEcnaHistos.h:571
TString fStopEvolDate
Definition: TEcnaHistos.h:405
Int_t fOptVisLine
Definition: TEcnaHistos.h:448
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:968
Axis_t fD_Ped_ChDsXinf
Definition: TEcnaHistos.h:477
TVirtualPad * ActivePad(const TString &, const TString &)
TString fFapStinName
Definition: TEcnaHistos.h:413
Int_t fNbBinsMemoD_LFN_ChDs
Definition: TEcnaHistos.h:751
void ViewSMGrid(const Int_t &, const TString &)
Int_t fMemoColorD_MCs_ChDs
Definition: TEcnaHistos.h:657
void ViewStin(const Int_t &, const TString &)
Double_t fD_TNo_ChDsYmax
Definition: TEcnaHistos.h:552
Double_t GetYmaxFromHistoFrameAndMarginValue(TH1D *, const Double_t)
TPaveText * fPavTxtH_TNo_Date
Definition: TEcnaHistos.h:907
TString fXMemoD_SCs_ChNb
Definition: TEcnaHistos.h:686
TVectorD ReadSampleAdcValues(const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1248
Double_t fYsup
Definition: TEcnaHistos.h:463
TString fYMemoH_TNo_Date
Definition: TEcnaHistos.h:729
void PlotHistory(const TString &, const TString &, const TString &, const Int_t &, const Int_t &)
TVirtualPad * fPadD_TNo_ChDs
Definition: TEcnaHistos.h:857
TVirtualPad * fPadD_HFN_ChNb
Definition: TEcnaHistos.h:862
TEcnaWrite * fCnaWrite
Definition: TEcnaHistos.h:373
Axis_t fH_SCs_RuDsXinf
Definition: TEcnaHistos.h:535
TPaveText * fPavTxtH_Ped_RuDs
Definition: TEcnaHistos.h:912
TVirtualPad * fPadD_MSp_SpDs
Definition: TEcnaHistos.h:867
TCanvas * fCurrentCanvas
Definition: TEcnaHistos.h:776
TString fYMemoD_MCs_ChDs
Definition: TEcnaHistos.h:715
Double_t GetYmaxFromGraphFrameAndMarginValue(TGraph *, const Double_t)
TString fYMemoD_Adc_EvDs
Definition: TEcnaHistos.h:726
Int_t fCanvSameH_TNo_RuDs
Definition: TEcnaHistos.h:965
Int_t GetNumberOfEvents(const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:4275
TString fHistoCodeFirst
Definition: TEcnaHistos.h:540
Double_t fD_TNo_ChNbYmax
Definition: TEcnaHistos.h:550
Double_t GetXsupValueFromMemo()
TVirtualPad * fPadD_SSp_SpNb
Definition: TEcnaHistos.h:868
TCanvasImp * fImpD_LFN_ChDs
Definition: TEcnaHistos.h:929
Int_t fNbBinsMemoH_SCs_RuDs
Definition: TEcnaHistos.h:773
TString GetStartDate()
Definition: TEcnaRead.cc:756
Int_t fNbBinsMemoH_HFN_RuDs
Definition: TEcnaHistos.h:772
TVirtualPad * fPadD_NOE_ChNb
Definition: TEcnaHistos.h:852
Bool_t fClosedH_TNo_RuDs
Definition: TEcnaHistos.h:840
TString GetDeeDirViewedFromIP(const Int_t &)
Int_t fFapNbOfRuns
Definition: TEcnaHistos.h:398
Double_t fH_TNo_DateYmin
Definition: TEcnaHistos.h:584
TString GetJYDirectionEB(const Int_t &)
Int_t fFapLastReqEvtNumber
Definition: TEcnaHistos.h:391
Int_t fCanvSameH_HFN_RuDs
Definition: TEcnaHistos.h:967
Int_t fMemoColorH_Ped_RuDs
Definition: TEcnaHistos.h:664
Double_t fH_Ped_DateYmax
Definition: TEcnaHistos.h:583
Double_t fXsup
Definition: TEcnaHistos.h:463
Double_t GetJPhiMax(const Int_t &, const Int_t &)
TCanvas * fCanvH_MCs_RuDs
Definition: TEcnaHistos.h:807
TString GetEEDeeType(const Int_t &)
TMatrixD ReadLowFrequencyCorrelationsBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:3221
Double_t fD_Ped_ChNbYmin
Definition: TEcnaHistos.h:545
Int_t fStopEvolRun
Definition: TEcnaHistos.h:401
TString fYMemoH_HFN_RuDs
Definition: TEcnaHistos.h:738
TString GetStinLvrbType(const Int_t &)
Int_t fMemoColorD_MCs_ChNb
Definition: TEcnaHistos.h:657
void SetAllPavesViewStex(const TString &, const Int_t &)
Int_t fCnewRoot
Definition: TEcnaHistos.h:360
Double_t GetPhiMax(const Int_t &, const Int_t &)
Int_t MaxStinInStex()
TPaveText * fPavTxtH_LFN_Date
Definition: TEcnaHistos.h:909
Double_t fD_HFN_ChDsYmin
Definition: TEcnaHistos.h:563
void ReInitCanvas(const TString &, const TString &)
UInt_t CanvasFormatH(const TString &)
TVectorD ReadSigmaOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2211
Int_t MaxStinHocoInStas()
Int_t fOptScaleLogx
Definition: TEcnaHistos.h:450
Axis_t fH_HFN_DateXinf
Definition: TEcnaHistos.h:520
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:919
Int_t fCanvSameD_LFN_ChNb
Definition: TEcnaHistos.h:958
Axis_t fH_HFN_RuDsXsup
Definition: TEcnaHistos.h:534
Int_t Get1SCEchaFrom0DeeEcha(const Int_t &)
TPaveText * fPavComGeneralTitle
Definition: TEcnaHistos.h:616
TCanvasImp * fImpD_LFN_ChNb
Definition: TEcnaHistos.h:928
Double_t GetYminDefaultValue(const TString &)
Axis_t fD_SCs_ChNbXsup
Definition: TEcnaHistos.h:496
TString fYMemoD_SCs_ChDs
Definition: TEcnaHistos.h:721
TString HistoryRunListFilePath()
Int_t fCanvSameD_NOE_ChDs
Definition: TEcnaHistos.h:954
void XtalSamplesEv(const TVectorD &, const Int_t &, const Int_t &, const Int_t &, const TString &)
TVirtualPad * fPadH_MCs_RuDs
Definition: TEcnaHistos.h:880
TString GetRootFileNameShort()
Definition: TEcnaRead.cc:4357
Int_t fCanvSameH_LFN_Date
Definition: TEcnaHistos.h:966
Double_t fD_TNo_ChNbYmin
Definition: TEcnaHistos.h:549
Double_t BoxLeftX(const TString &)
TVectorD ReadAverageNumberOfEvents(const Int_t &)
Definition: TEcnaRead.cc:2296
time_t GetStopTime()
Definition: TEcnaRead.cc:755
TCanvasImp * fImpH_Ped_RuDs
Definition: TEcnaHistos.h:946
TEcnaParCout * fCnaParCout
Definition: TEcnaHistos.h:372
void SetRunNumberFromList(const Int_t &, const Int_t &)
Int_t fCanvSameH_MCs_RuDs
Definition: TEcnaHistos.h:968
TString fXMemoH_SCs_Date
Definition: TEcnaHistos.h:699
TCanvas * fCanvH1SamePlus
Definition: TEcnaHistos.h:778
Bool_t fClosedH_LFN_Date
Definition: TEcnaHistos.h:836
Int_t fFapStexNumber
Definition: TEcnaHistos.h:393
Int_t fFapNbOfSamples
Definition: TEcnaHistos.h:388
TString fCovarianceMatrix
Definition: TEcnaHistos.h:452
TString fXMemoD_NOE_ChDs
Definition: TEcnaHistos.h:675
Int_t fCanvSameD_LFN_ChDs
Definition: TEcnaHistos.h:958
void SetYmaxMemoFromPreviousMemo(const TString &)
Int_t fNbBinsMemoD_TNo_ChDs
Definition: TEcnaHistos.h:747
TPaveText * fPavTxtH1SamePlus
Definition: TEcnaHistos.h:885
Int_t fTextBorderSize
Definition: TEcnaHistos.h:461
TCanvasImp * fImpD_Adc_EvDs
Definition: TEcnaHistos.h:938
TCanvasImp * fImpH_SCs_RuDs
Definition: TEcnaHistos.h:951
Int_t fMemoPlotD_MSp_SpDs
Definition: TEcnaHistos.h:644
Int_t MaxTowPhiInSM()
time_t fStopEvolTime
Definition: TEcnaHistos.h:404
TVirtualPad * fPadH_MCs_Date
Definition: TEcnaHistos.h:874
TCanvasImp * fImpD_NOE_ChDs
Definition: TEcnaHistos.h:921
UInt_t SetCanvasWidth(const TString &, const TString &)
void SetViewHistoOffsets(TH1D *, const TString &, const TString &)
TString fYMemoH_HFN_Date
Definition: TEcnaHistos.h:732
Bool_t fClosedH_TNo_Date
Definition: TEcnaHistos.h:834
TString fYMemoD_SSp_SpNb
Definition: TEcnaHistos.h:724
Double_t fH2HFccMosMatrixYmax
Definition: TEcnaHistos.h:611
TPaveText * fPavTxtD_NOE_ChDs
Definition: TEcnaHistos.h:887
TString fBetweenSamples
Definition: TEcnaHistos.h:454
Int_t fMemoColorH_LFN_Date
Definition: TEcnaHistos.h:666
void SetParametersPavTxt(const TString &, const TString &)
TCanvas * fCanvH_HFN_RuDs
Definition: TEcnaHistos.h:809
TString fXMemoD_Ped_ChDs
Definition: TEcnaHistos.h:677
Double_t fD_HFN_ChDsYmax
Definition: TEcnaHistos.h:564
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:638
TString fXMemoH_SCs_RuDs
Definition: TEcnaHistos.h:705
void SetHistoScaleY(const TString &)
Definition: TEcnaHistos.cc:806
void SetViewHistoStyle(const TString &)
TString GetXVarHisto(const TString &, const TString &, const Int_t &)
Bool_t fClosedD_MSp_SpNb
Definition: TEcnaHistos.h:827
TMatrixD fReadMatrixDummy
Definition: TEcnaHistos.h:383
Bool_t fClosedD_HFN_ChDs
Definition: TEcnaHistos.h:824
#define nullptr
TString fFapAnaType
Definition: TEcnaHistos.h:387
Double_t fD_LFN_ChDsYmin
Definition: TEcnaHistos.h:559
TMatrixD ReadHighFrequencyMeanCorrelationsBetweenStins(const Int_t &)
Definition: TEcnaRead.cc:4053
Double_t GetYmaxDefaultValue(const TString &)
TVirtualPad * fPadH_Ped_RuDs
Definition: TEcnaHistos.h:878
Double_t fD_SCs_ChNbYmax
Definition: TEcnaHistos.h:566
Int_t fMemoColorH_SCs_RuDs
Definition: TEcnaHistos.h:669
TString fYMemoH_Ped_Date
Definition: TEcnaHistos.h:728
Double_t fD_MSp_SpDsYmax
Definition: TEcnaHistos.h:573
Double_t fUserHistoMin
Definition: TEcnaHistos.h:444
Axis_t fD_LFN_ChNbXsup
Definition: TEcnaHistos.h:488
Int_t fMemoColorD_Adc_EvNb
Definition: TEcnaHistos.h:663
TPaveText * fPavTxtD_HFN_ChNb
Definition: TEcnaHistos.h:896
Int_t MaxSCIXInDee()
const std::map< ValueQuantityType, double > min_value
Int_t fNbBinsMemoD_Adc_EvDs
Definition: TEcnaHistos.h:760
void DeeSCNumbering(const Int_t &)
TCanvasImp * fImpD_Adc_EvNb
Definition: TEcnaHistos.h:939
void SetHistoMin()
TString fAllXtalsInStinPlot
Definition: TEcnaHistos.h:632
void SetAllPavesViewStinCrysNb(const Int_t &, const Int_t &)
TPaveText * fPavTxtH_LFN_RuDs
Definition: TEcnaHistos.h:915
Int_t fMemoPlotH_MCs_Date
Definition: TEcnaHistos.h:650
void ViewStexStinNumberingPad(const Int_t &)
Float_t DeeNumberOffsetX(const TString &, const Int_t &)
TCanvasImp * fImpD_SSp_SpNb
Definition: TEcnaHistos.h:936
Bool_t fClosedD_Adc_EvNb
Definition: TEcnaHistos.h:831
Axis_t fD_HFN_ChNbXsup
Definition: TEcnaHistos.h:492
Int_t GetHashedNumberFromIEtaAndIPhi(const Int_t &, const Int_t &)
TString BuildStandardBetweenWhatCode(const TString &, const TString &)
TCanvas * fCanvH_Ped_Date
Definition: TEcnaHistos.h:799
Float_t AxisTitleSize()
Int_t fCnaCommand
Definition: TEcnaHistos.h:358
Double_t GetIIXMin(const Int_t &)
Axis_t fD_TNo_ChNbXinf
Definition: TEcnaHistos.h:479
Int_t fMemoPlotH_TNo_Date
Definition: TEcnaHistos.h:647
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:528
void StexHocoVecoLHFCorcc(const TString &)
Int_t fCanvSameD_NOE_ChNb
Definition: TEcnaHistos.h:954
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:105
TString fXMemoH_TNo_Date
Definition: TEcnaHistos.h:695
Double_t fH2LFccMosMatrixYmax
Definition: TEcnaHistos.h:609
void ViewStas(const TVectorD &, const Int_t &, const TString &)
TMatrixD ReadLowFrequencyMeanCorrelationsBetweenStins(const Int_t &)
Definition: TEcnaRead.cc:3951
TVectorD ReadAverageTotalNoise(const Int_t &)
Definition: TEcnaRead.cc:2444
Int_t fMemoPlotH_TNo_RuDs
Definition: TEcnaHistos.h:647
Bool_t fClosedD_Adc_EvDs
Definition: TEcnaHistos.h:832
Bool_t fClosedD_NOE_ChNb
Definition: TEcnaHistos.h:813
Bool_t fClosedH_Ped_RuDs
Definition: TEcnaHistos.h:839
TCanvas * fCanvD_SSp_SpDs
Definition: TEcnaHistos.h:796
Bool_t fClosedH_HFN_Date
Definition: TEcnaHistos.h:837
void ViewEBGrid()
Double_t fD_HFN_ChNbYmax
Definition: TEcnaHistos.h:562
Int_t fNbOfListFileH_SCs_RuDs
Definition: TEcnaHistos.h:974
Int_t fMemoColorD_LFN_ChDs
Definition: TEcnaHistos.h:658
TString GetEtaPhiAxisTitle(const TString &)
TString fFlagColPal
Definition: TEcnaHistos.h:441
TString GetXDirectionEE(const Int_t &)
Int_t SetHistoFrameYminYmaxFromMemo(TH1D *, const TString &)
Axis_t fH1SameOnePlotXsup
Definition: TEcnaHistos.h:469
Axis_t fH_MCs_DateXsup
Definition: TEcnaHistos.h:517
TString fYMemoD_MSp_SpDs
Definition: TEcnaHistos.h:723
Double_t GetYmaxValueFromMemo(const TString &)
Int_t fCanvSameD_HFN_ChNb
Definition: TEcnaHistos.h:959
Int_t GetFirstReqEvtNumber()
Definition: TEcnaRead.cc:745
TString fXMemoH_Ped_Date
Definition: TEcnaHistos.h:694
Int_t fOptScaleLinx
Definition: TEcnaHistos.h:450
Axis_t fH_SCs_RuDsXsup
Definition: TEcnaHistos.h:536
Double_t GetYminValueFromMemo(const TString &)
TPaveText * fPavTxtD_Ped_ChDs
Definition: TEcnaHistos.h:889
Color_t GetViewHistoColor(const TString &, const TString &)
Int_t MaxCrysIXInDee()
Int_t fFapRunNumber
Definition: TEcnaHistos.h:389
Int_t MaxSMPhiInEB()
Double_t fD_HFN_ChNbYmin
Definition: TEcnaHistos.h:561
void ViewStexGrid(const Int_t &, const TString &)
TString fYMemoD_TNo_ChDs
Definition: TEcnaHistos.h:713
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:693
Int_t fMemoPlotD_MCs_ChDs
Definition: TEcnaHistos.h:639
TPaveText * fPavTxtH_SCs_Date
Definition: TEcnaHistos.h:911
Int_t fFapFirstReqEvtNumber
Definition: TEcnaHistos.h:390
Double_t fD_SSp_SpNbYmax
Definition: TEcnaHistos.h:575
TPaveText * SetPaveStex(const TString &, const Int_t &)
Int_t fNbBinsMemoD_Adc_EvNb
Definition: TEcnaHistos.h:761
Int_t fCanvSameH_TNo_Date
Definition: TEcnaHistos.h:965
Int_t fNbOfListFileH_TNo_Date
Definition: TEcnaHistos.h:971
TString fXMemoH_MCs_Date
Definition: TEcnaHistos.h:696
TString BuildStandardDetectorCode(const TString &)
Double_t fH2CorccInStinsYmax
Definition: TEcnaHistos.h:613
Double_t fD_Adc_EvNbYmin
Definition: TEcnaHistos.h:580
Double_t fD_MSp_SpNbYmin
Definition: TEcnaHistos.h:570
Double_t fUserHistoMax
Definition: TEcnaHistos.h:444
TPaveText * fPavTxtD_Adc_EvNb
Definition: TEcnaHistos.h:905
TCanvas * fCanvD_Ped_ChDs
Definition: TEcnaHistos.h:782
Float_t AxisLabelOffset()
Int_t fMemoColorH_Ped_Date
Definition: TEcnaHistos.h:664
TString fFapFileRuns
Definition: TEcnaHistos.h:399
TString GetAsciiFileName()
Definition: TEcnaWrite.cc:384
TVirtualPad * fPadD_Ped_ChNb
Definition: TEcnaHistos.h:854
Axis_t fH_MCs_RuDsXinf
Definition: TEcnaHistos.h:529
TCanvasImp * fImpH_HFN_RuDs
Definition: TEcnaHistos.h:950
Bool_t fClosedD_MCs_ChNb
Definition: TEcnaHistos.h:819
Int_t fMemoColorD_NOE_ChNb
Definition: TEcnaHistos.h:654
Axis_t fD_NOE_ChDsXsup
Definition: TEcnaHistos.h:474
Int_t fNbBinsMemoH1SamePlus
Definition: TEcnaHistos.h:741
Int_t MaxCrysIXInSC()
Int_t fCanvSameD_Adc_EvNb
Definition: TEcnaHistos.h:963
TVirtualPad * fPadH_HFN_RuDs
Definition: TEcnaHistos.h:882
Float_t fTextPaveSize
Definition: TEcnaHistos.h:460
Int_t fMemoColorD_Ped_ChDs
Definition: TEcnaHistos.h:655
time_t fStopTime
Definition: TEcnaHistos.h:427
void RunType(const TString &)
Definition: TEcnaHistos.cc:822
Int_t fMemoPlotH_LFN_Date
Definition: TEcnaHistos.h:648
UInt_t CanvasFormatW(const TString &)
Double_t fD_SSp_SpDsYmax
Definition: TEcnaHistos.h:577
TString fTTBELL
Definition: TEcnaHistos.h:362
Axis_t fD_SCs_ChDsXinf
Definition: TEcnaHistos.h:497
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:759
Int_t fMemoPlotD_LFN_ChNb
Definition: TEcnaHistos.h:640
TString fSeveralPlot
Definition: TEcnaHistos.h:630
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:590
TPaveText * fPavComLVRB
Definition: TEcnaHistos.h:624
Int_t fMemoColorD_TNo_ChDs
Definition: TEcnaHistos.h:656
Int_t fFapNbOfEvts
Definition: TEcnaHistos.h:395
Int_t fMemoColorH_HFN_Date
Definition: TEcnaHistos.h:667
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:508
Bool_t fClosedD_SCs_ChDs
Definition: TEcnaHistos.h:826
Int_t GetJYCrysInDee(const Int_t &, const Int_t &, const Int_t &)
void SetHistoMax()
TVirtualPad * fPadD_MCs_ChDs
Definition: TEcnaHistos.h:859
Double_t fH_HFN_RuDsYmax
Definition: TEcnaHistos.h:604
Double_t fH_TNo_RuDsYmin
Definition: TEcnaHistos.h:597
TString fYMemoH1SamePlus
Definition: TEcnaHistos.h:707
Int_t fNbBinsMemoD_MSp_SpDs
Definition: TEcnaHistos.h:757
TString GetCodeSeveralPlot()
Bool_t fClosedH_MCs_RuDs
Definition: TEcnaHistos.h:841
Int_t fCanvSameD_TNo_ChDs
Definition: TEcnaHistos.h:956
Int_t MaxNbOfRunsInLists()
Double_t GetIIXMax(const Int_t &)
TString GetCodeAllXtalsInStinPlot()
TPaveText * fPavComXtal
Definition: TEcnaHistos.h:620
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:1129
Color_t ColorTab(const Int_t &)
Int_t fMemoPlotH_LFN_RuDs
Definition: TEcnaHistos.h:648
TString fXMemoH_HFN_RuDs
Definition: TEcnaHistos.h:704
Int_t fMemoPlotD_SCs_ChNb
Definition: TEcnaHistos.h:642
Double_t fD_Ped_ChNbYmax
Definition: TEcnaHistos.h:546
Int_t MaxStinVecoInStas()
Int_t fNbOfListFileH_SCs_Date
Definition: TEcnaHistos.h:972
TCanvas * fCanvD_HFN_ChNb
Definition: TEcnaHistos.h:789
TPaveText * fPavTxtH_Ped_Date
Definition: TEcnaHistos.h:906
Double_t fH2CorccInStinsYmin
Definition: TEcnaHistos.h:612
TVectorD ReadSampleSigmas(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1507
TCanvas * fCanvD_Adc_EvNb
Definition: TEcnaHistos.h:798
TString fYMemoD_MCs_ChNb
Definition: TEcnaHistos.h:714
Int_t fNbBinsMemoD_SCs_ChNb
Definition: TEcnaHistos.h:754
Axis_t fH_MCs_RuDsXsup
Definition: TEcnaHistos.h:530
TPaveText * fPavComNbOfEvts
Definition: TEcnaHistos.h:622
Int_t fCanvSameH_HFN_Date
Definition: TEcnaHistos.h:967
TCanvas * fCanvD_MSp_SpNb
Definition: TEcnaHistos.h:793
TCanvas * fCanvD_HFN_ChDs
Definition: TEcnaHistos.h:790
TCanvas * fCanvH_Ped_RuDs
Definition: TEcnaHistos.h:805
TCanvasImp * fImpD_SCs_ChNb
Definition: TEcnaHistos.h:932
Int_t fNbBinsMemoD_MSp_SpNb
Definition: TEcnaHistos.h:756
TString fXMemoH_Ped_RuDs
Definition: TEcnaHistos.h:700
Double_t fD_SCs_ChDsYmin
Definition: TEcnaHistos.h:567
Int_t fNbBinsMemoH_SCs_Date
Definition: TEcnaHistos.h:767
Double_t fH_SCs_DateYmax
Definition: TEcnaHistos.h:593
Double_t fD_MCs_ChDsYmax
Definition: TEcnaHistos.h:556
Int_t fNbBinsMemoD_MCs_ChDs
Definition: TEcnaHistos.h:749
TPaveText * SetPaveCxyz(const Int_t &)
TVirtualPad * fPadD_MSp_SpNb
Definition: TEcnaHistos.h:866
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:543
Int_t GetStexStinFromIndex(const Int_t &)
Definition: TEcnaRead.cc:4365
Double_t GetJPhiMin(const Int_t &, const Int_t &)
Double_t fXinf
Definition: TEcnaHistos.h:463
TString fHFBetweenStins
Definition: TEcnaHistos.h:456
TString GetHocoVecoAxisTitle(const TString &)
void SetYminMemoFromPreviousMemo(const TString &)
Axis_t fH_SCs_DateXinf
Definition: TEcnaHistos.h:522
TVirtualPad * fPadD_SCs_ChNb
Definition: TEcnaHistos.h:864
void SetAllYminYmaxMemoFromDefaultValues()
TString fYMemoD_LFN_ChDs
Definition: TEcnaHistos.h:717
Int_t fNbBinsMemoH_TNo_Date
Definition: TEcnaHistos.h:763
Int_t fMemoPlotD_NOE_ChNb
Definition: TEcnaHistos.h:636
Bool_t fClosedH_Ped_Date
Definition: TEcnaHistos.h:833
TString fYMemoD_Ped_ChDs
Definition: TEcnaHistos.h:711
Axis_t fD_NOE_ChNbXsup
Definition: TEcnaHistos.h:472
Int_t fCnaError
Definition: TEcnaHistos.h:358
TEcnaRead * fMyRootFile
Definition: TEcnaHistos.h:378
Bool_t fClosedD_TNo_ChDs
Definition: TEcnaHistos.h:818
Int_t fMemoPlotH_SCs_Date
Definition: TEcnaHistos.h:651
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:771
Int_t fCanvSameD_SCs_ChDs
Definition: TEcnaHistos.h:960
Int_t fOptScaleLiny
Definition: TEcnaHistos.h:450
Double_t fD_Adc_EvDsYmin
Definition: TEcnaHistos.h:578
Int_t fMemoColorD_SSp_SpDs
Definition: TEcnaHistos.h:662
TCanvasImp * fImpD_NOE_ChNb
Definition: TEcnaHistos.h:920
TPaveText * fPavTxtD_TNo_ChDs
Definition: TEcnaHistos.h:891
TString fCfgResultsRootFilePath
Definition: TEcnaHistos.h:419
Double_t fD_MCs_ChDsYmin
Definition: TEcnaHistos.h:555
void ViewHistime(const TString &, const Int_t &, const Int_t &, const TString &, const TString &)
TVectorD ReadTotalNoise(const Int_t &)
Definition: TEcnaRead.cc:1889
TString fYMemoH_Ped_RuDs
Definition: TEcnaHistos.h:734
void SetXinfMemoFromValue(const TString &, const Double_t &)
Bool_t fClosedD_SSp_SpDs
Definition: TEcnaHistos.h:830
Float_t DeeOffsetX(const TString &, const Int_t &)
TCanvasImp * fImpD_SSp_SpDs
Definition: TEcnaHistos.h:937
Int_t fNbBinsMemoD_HFN_ChDs
Definition: TEcnaHistos.h:753
TPaveText * fPavComStin
Definition: TEcnaHistos.h:619
Bool_t fClosedD_SCs_ChNb
Definition: TEcnaHistos.h:825
void SetHistoColorPalette(const TString &)
Definition: TEcnaHistos.cc:811
Double_t fD_Adc_EvDsYmax
Definition: TEcnaHistos.h:579
Bool_t StatusFileFound()
Definition: TEcnaHistos.cc:831
TString fYMemoH_LFN_Date
Definition: TEcnaHistos.h:731
Bool_t fClosedH_HFN_RuDs
Definition: TEcnaHistos.h:843
TString fFlagSubDet
Definition: TEcnaHistos.h:365
Double_t fH_HFN_DateYmax
Definition: TEcnaHistos.h:591
Int_t fNbBinsMemoH_HFN_Date
Definition: TEcnaHistos.h:766
TString fYMemoH_MCs_RuDs
Definition: TEcnaHistos.h:736
Axis_t fH_HFN_DateXsup
Definition: TEcnaHistos.h:521
TString fCurrentHistoCode
Definition: TEcnaHistos.h:846
Int_t GetDSSCFrom1DeeSCEcna(const Int_t &, const Int_t &, const Int_t &)
TString fXMemoD_SSp_SpNb
Definition: TEcnaHistos.h:690
TCanvas * fCanvD_LFN_ChDs
Definition: TEcnaHistos.h:788
Bool_t fClosedH_SCs_Date
Definition: TEcnaHistos.h:838
TString fFapStexName
Definition: TEcnaHistos.h:412
TPaveText * SetPaveGeneralComment(const TString &)
Int_t fMemoColorH1SamePlus
Definition: TEcnaHistos.h:653
Double_t fH_MCs_DateYmin
Definition: TEcnaHistos.h:586
TVirtualPad * fPadH_LFN_RuDs
Definition: TEcnaHistos.h:881
Int_t fNbOfExistingRuns
Definition: TEcnaHistos.h:402
TString fYMemoD_SSp_SpDs
Definition: TEcnaHistos.h:725
TString fCfgHistoryRunListFilePath
Definition: TEcnaHistos.h:420
void ViewSMTowerNumberingPad(const Int_t &)
Axis_t fD_Ped_ChNbXinf
Definition: TEcnaHistos.h:475
TVectorD ReadAveragePedestals(const Int_t &)
Definition: TEcnaRead.cc:2361
TString GetStopDate()
Definition: TEcnaRead.cc:757
Float_t AxisTickSize()
Double_t fD_SSp_SpDsYmin
Definition: TEcnaHistos.h:576
Int_t GetNotCompleteSCForConsFromIndex(const Int_t &)
Int_t fNbOfListFileH_LFN_Date
Definition: TEcnaHistos.h:972
Definition: value.py:1
void SetAllPavesViewStas()
TPaveText * fPavTxtD_HFN_ChDs
Definition: TEcnaHistos.h:897
Int_t fMemoColorD_HFN_ChDs
Definition: TEcnaHistos.h:659
TString GetHistoType(const TString &)
Axis_t fD_Ped_ChNbXsup
Definition: TEcnaHistos.h:476
TCanvasImp * fImpH_Ped_Date
Definition: TEcnaHistos.h:940
void SetAllPavesViewHisto(const TString &, const Int_t &, const Int_t &, const Int_t &, const TString &)
Bool_t fStatusFileFound
Definition: TEcnaHistos.h:424
TString fYMemoH_SCs_Date
Definition: TEcnaHistos.h:733
TCanvasImp * fImpD_Ped_ChNb
Definition: TEcnaHistos.h:922
Int_t fMemoPlotD_SSp_SpNb
Definition: TEcnaHistos.h:643
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:679
Axis_t fD_SCs_ChNbXinf
Definition: TEcnaHistos.h:495
Axis_t fH_Ped_DateXsup
Definition: TEcnaHistos.h:513
TVirtualPad * fPadH_SCs_Date
Definition: TEcnaHistos.h:877
void DoCanvasClosed()
Int_t fMemoPlotD_SCs_ChDs
Definition: TEcnaHistos.h:642
Int_t fMemoPlotH_MCs_RuDs
Definition: TEcnaHistos.h:650
TString fXMemoD_SSp_SpDs
Definition: TEcnaHistos.h:691
void ViewDeeSCNumberingPad(const Int_t &)
Int_t fCanvSameH_Ped_Date
Definition: TEcnaHistos.h:964
TString fXMemoD_HFN_ChDs
Definition: TEcnaHistos.h:685
Double_t fD_LFN_ChDsYmax
Definition: TEcnaHistos.h:560
TPaveText * fPavComEvolNbOfEvtsAna
Definition: TEcnaHistos.h:627
Int_t fgMaxCar
Definition: TEcnaHistos.h:353
void PrintNoComment()
Definition: TEcnaRead.cc:4462
Axis_t fD_HFN_ChNbXinf
Definition: TEcnaHistos.h:491
TString fXMemoD_TNo_ChNb
Definition: TEcnaHistos.h:678
Int_t MaxCrysInStin()
TVectorD ReadPedestals(const Int_t &)
Definition: TEcnaRead.cc:1807
TMatrixD ReadLowFrequencyCovariancesBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:3125
TString GetCurrentCanvasName()
void SetParametersCanvas(const TString &, const TString &)
Axis_t fD_Adc_EvNbXinf
Definition: TEcnaHistos.h:510
TString fStopDate
Definition: TEcnaHistos.h:428
Double_t fH_SCs_DateYmin
Definition: TEcnaHistos.h:592
Axis_t fH_Ped_RuDsXsup
Definition: TEcnaHistos.h:526
Int_t fNbBinsMemoH_Ped_Date
Definition: TEcnaHistos.h:762
TString fYMemoD_SCs_ChNb
Definition: TEcnaHistos.h:720
TPaveText * fPavTxtD_LFN_ChNb
Definition: TEcnaHistos.h:894
void EEGridAxis(const Int_t &, const TString &, const TString &)
Int_t MaxTowEtaInSM()
Double_t fD_MSp_SpDsYmin
Definition: TEcnaHistos.h:572
Int_t fNbBinsMemoD_MCs_ChNb
Definition: TEcnaHistos.h:748
TPaveText * fPavTxtD_MCs_ChNb
Definition: TEcnaHistos.h:892
Int_t fCanvSameD_MCs_ChDs
Definition: TEcnaHistos.h:957
Double_t GetJIYMin(const Int_t &, const Int_t &)
TString fFlagGeneralTitle
Definition: TEcnaHistos.h:442
Int_t MaxSCEcnaInDee()
Bool_t DataExist()
Definition: TEcnaRead.cc:976
Int_t GetDSFrom1DeeSCEcna(const Int_t &, const Int_t &)
TCanvas * fCanvD_Ped_ChNb
Definition: TEcnaHistos.h:781
Axis_t GetHistoXsup(const TString &, const Int_t &, const TString &)
TString fFlagScaleY
Definition: TEcnaHistos.h:440
Bool_t fClosedD_NOE_ChDs
Definition: TEcnaHistos.h:814
Int_t MaxSMEtaInEB()
TCanvasImp * fImpH_MCs_RuDs
Definition: TEcnaHistos.h:948
TPaveText * fPavComEvolRuns
Definition: TEcnaHistos.h:626
TCanvas * fCanvH_SCs_Date
Definition: TEcnaHistos.h:804
Int_t GetNbOfSamples()
Definition: TEcnaRead.cc:743
void ViewEEGrid(const Int_t &)
Int_t fNbOfListFileH_HFN_RuDs
Definition: TEcnaHistos.h:974
Int_t fCanvSameD_MSp_SpDs
Definition: TEcnaHistos.h:962
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)
Int_t fNbOfListFileH_Ped_Date
Definition: TEcnaHistos.h:971
Int_t fMemoPlotH_Ped_Date
Definition: TEcnaHistos.h:646
Int_t fNbOfListFileH_Ped_RuDs
Definition: TEcnaHistos.h:973
TString fXMemoH_HFN_Date
Definition: TEcnaHistos.h:698
void Plot1DHisto(const TVectorD &, const TString &, const TString &, const TString &)
Int_t fNbBinsMemoD_SCs_ChDs
Definition: TEcnaHistos.h:755
void WriteAsciiHisto(const TString &, const Int_t &, const TVectorD &)
Definition: TEcnaWrite.cc:1188
TCanvas * fCanvH_TNo_Date
Definition: TEcnaHistos.h:800
TPaveText * SetPaveCrystal(const Int_t &, const Int_t &, const Int_t &)
void SetEcalSubDetector(const TString &)
Definition: TEcnaHistos.cc:678
TCanvasImp * fImpD_MSp_SpNb
Definition: TEcnaHistos.h:934
TCanvas * fCanvD_NOE_ChDs
Definition: TEcnaHistos.h:780
TString GetAnalysisName()
Definition: TEcnaRead.cc:742
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:660
void SetAllPavesViewMatrix(const TString &, const Int_t &, const Int_t &, const Int_t &)
Bool_t fClosedD_MCs_ChDs
Definition: TEcnaHistos.h:820
Int_t fMemoPlotD_MCs_ChNb
Definition: TEcnaHistos.h:639
TVirtualPad * fPadH_SCs_RuDs
Definition: TEcnaHistos.h:883
TString fXMemoH_LFN_Date
Definition: TEcnaHistos.h:697
Axis_t fH_LFN_RuDsXinf
Definition: TEcnaHistos.h:531
Double_t fH2LFccMosMatrixYmin
Definition: TEcnaHistos.h:608
Int_t MaxCrysIYInSC()
TCanvasImp * fImpD_HFN_ChNb
Definition: TEcnaHistos.h:930
Double_t fD_Ped_ChDsYmin
Definition: TEcnaHistos.h:547
TVirtualPad * fPadD_SCs_ChDs
Definition: TEcnaHistos.h:865
TVirtualPad * fPadH_LFN_Date
Definition: TEcnaHistos.h:875
Axis_t fD_HFN_ChDsXsup
Definition: TEcnaHistos.h:494
Axis_t fH_LFN_RuDsXsup
Definition: TEcnaHistos.h:532
Bool_t fClosedH_MCs_Date
Definition: TEcnaHistos.h:835
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:414
Axis_t fH_SCs_DateXsup
Definition: TEcnaHistos.h:523
Double_t fD_MCs_ChNbYmin
Definition: TEcnaHistos.h:553
Color_t ColorDefinition(const TString &)
TPaveText * fPavTxtD_SCs_ChNb
Definition: TEcnaHistos.h:898
TMatrixD ReadHighFrequencyCorrelationsBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:3413
Int_t fMemoPlotD_Ped_ChDs
Definition: TEcnaHistos.h:637
Int_t fCanvSameH1SamePlus
Definition: TEcnaHistos.h:953
Int_t fMemoPlotD_TNo_ChDs
Definition: TEcnaHistos.h:638
TString fXMemoD_MSp_SpNb
Definition: TEcnaHistos.h:688
Bool_t fClosedD_LFN_ChDs
Definition: TEcnaHistos.h:822
Int_t fMemoColorH_MCs_Date
Definition: TEcnaHistos.h:668
Axis_t fD_MCs_ChDsXsup
Definition: TEcnaHistos.h:486
TPaveText * fPavTxtH_MCs_RuDs
Definition: TEcnaHistos.h:914
Double_t fH_LFN_DateYmax
Definition: TEcnaHistos.h:589
void SetViewGraphColors(TGraph *, const TString &, const TString &)
Int_t MaxCrysInTow()
TCanvasImp * fImpD_TNo_ChNb
Definition: TEcnaHistos.h:924
TPaveText * SetPaveStin(const Int_t &, const Int_t &)
Int_t NumberOfNotConnectedSCs()
TVirtualPad * fPadH_TNo_RuDs
Definition: TEcnaHistos.h:879
Int_t fMemoColorD_MSp_SpNb
Definition: TEcnaHistos.h:661
TVectorD ReadHighFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2130
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:722
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:682
Double_t fH_MCs_RuDsYmax
Definition: TEcnaHistos.h:600
void StinCrystalNumbering(const Int_t &, const Int_t &)
TCanvas * fCanvD_MCs_ChNb
Definition: TEcnaHistos.h:785
Int_t GetYCrysInStex(const Int_t &, const Int_t &, const Int_t &)
TCanvasImp * fImpD_TNo_ChDs
Definition: TEcnaHistos.h:925
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:542
TString fYMemoD_NOE_ChNb
Definition: TEcnaHistos.h:708
TString BuildStandardCovOrCorCode(const TString &, const TString &)
Int_t MaxStexInStasMinus()
Axis_t fH1SameOnePlotXinf
Definition: TEcnaHistos.h:468
Axis_t fD_TNo_ChNbXsup
Definition: TEcnaHistos.h:480
void SetXVarMemo(const TString &, const TString &, const TString &)
TString fXMemoH1SamePlus
Definition: TEcnaHistos.h:673
TString fCurrentOptPlot
Definition: TEcnaHistos.h:847
Int_t MaxStexInStas()
TEcnaParPaths * fCnaParPaths
Definition: TEcnaHistos.h:371
Int_t GetSCOffset(const Int_t &, const Int_t &, const Int_t &)
TVirtualPad * fPadH_HFN_Date
Definition: TEcnaHistos.h:876
TPaveText * fPavComSeveralChanging
Definition: TEcnaHistos.h:623
TCanvasImp * fImpH_TNo_RuDs
Definition: TEcnaHistos.h:947
TVirtualPad * fPadD_LFN_ChDs
Definition: TEcnaHistos.h:861
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:483
Double_t fH_Ped_RuDsYmin
Definition: TEcnaHistos.h:595
Double_t fH_HFN_RuDsYmin
Definition: TEcnaHistos.h:603
TCanvas * fCanvD_TNo_ChNb
Definition: TEcnaHistos.h:783
TPaveText * fPavComCxyz
Definition: TEcnaHistos.h:625
TPaveText * fPavTxtD_MSp_SpDs
Definition: TEcnaHistos.h:901
Double_t fD_LFN_ChNbYmin
Definition: TEcnaHistos.h:557
TString fXMemoH_MCs_RuDs
Definition: TEcnaHistos.h:702
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:973
TPaveText * fPavTxtD_SSp_SpDs
Definition: TEcnaHistos.h:903
TEcnaParEcal * fEcal
Definition: TEcnaHistos.h:374
TString fLFBetweenChannels
Definition: TEcnaHistos.h:455
time_t fStartEvolTime
Definition: TEcnaHistos.h:404
Int_t fCanvSameD_TNo_ChNb
Definition: TEcnaHistos.h:956
TVectorD ReadAverageLowFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2527
Double_t fD_NOE_ChDsYmax
Definition: TEcnaHistos.h:544
Int_t MaxCrysVecoInStex()
TCanvasImp * fImpD_HFN_ChDs
Definition: TEcnaHistos.h:931
TPaveText * fPavTxtD_SSp_SpNb
Definition: TEcnaHistos.h:902
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:649
Int_t fMemoColorD_HFN_ChNb
Definition: TEcnaHistos.h:659
void SetHistoScaleX(const TString &)
Definition: TEcnaHistos.cc:801
Int_t fCanvSameH_SCs_Date
Definition: TEcnaHistos.h:969
Int_t fNbBinsMemoD_Ped_ChDs
Definition: TEcnaHistos.h:745
TString fYMemoD_Adc_EvNb
Definition: TEcnaHistos.h:727
TString fFlagUserHistoMin
Definition: TEcnaHistos.h:445
Int_t fCanvSameD_HFN_ChDs
Definition: TEcnaHistos.h:959
Double_t fH_TNo_RuDsYmax
Definition: TEcnaHistos.h:598
Int_t MaxSCForConsInDee()
void NumberOfEvents(const Int_t &)
Definition: TEcnaHistos.cc:826
Int_t fOptScaleLogy
Definition: TEcnaHistos.h:450
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:945
Int_t fMemoPlotD_LFN_ChDs
Definition: TEcnaHistos.h:640
Int_t GetReqNbOfEvts()
Definition: TEcnaRead.cc:747
TString ResultsRootFilePath()
Int_t fCanvSameH_Ped_RuDs
Definition: TEcnaHistos.h:964
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:817
void SetGraphPresentation(TGraph *, const TString &, const TString &)
TPaveText * fPavTxtD_NOE_ChNb
Definition: TEcnaHistos.h:886
Double_t GetPhi(const Int_t &, const Int_t &, const Int_t &)
Int_t fNbBinsMemoD_Ped_ChNb
Definition: TEcnaHistos.h:744
Int_t fCanvSameD_Adc_EvDs
Definition: TEcnaHistos.h:963
TString fCurrentCanvasName
Definition: TEcnaHistos.h:775
TString fXMemoD_MSp_SpDs
Definition: TEcnaHistos.h:689
TCanvas * fCanvD_TNo_ChDs
Definition: TEcnaHistos.h:784
TString fYMemoD_LFN_ChNb
Definition: TEcnaHistos.h:716
Bool_t fClosedD_LFN_ChNb
Definition: TEcnaHistos.h:821
TCanvas * fCanvH_LFN_Date
Definition: TEcnaHistos.h:802
Int_t MaxCrysEcnaInStex()
Bool_t fClosedH_SCs_RuDs
Definition: TEcnaHistos.h:844
Int_t fCanvSameD_MSp_SpNb
Definition: TEcnaHistos.h:961
TString fFapEchaName
Definition: TEcnaHistos.h:415
Double_t fH_MCs_RuDsYmin
Definition: TEcnaHistos.h:599
Int_t fCdelete
Definition: TEcnaHistos.h:359
TCanvasImp * fImpD_MCs_ChDs
Definition: TEcnaHistos.h:927
TPaveText * fPavTxtD_MCs_ChDs
Definition: TEcnaHistos.h:893
Int_t GetDSOffset(const Int_t &, const Int_t &)
TString GetSCType(const Int_t &)
TVirtualPad * fPadH1SamePlus
Definition: TEcnaHistos.h:851
TString GetRunType()
Definition: TEcnaRead.cc:758
Int_t fMemoPlotH_Ped_RuDs
Definition: TEcnaHistos.h:646
TPaveText * SetPaveCrystalSample(const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Axis_t fD_LFN_ChDsXinf
Definition: TEcnaHistos.h:489
Int_t fMemoColorD_NOE_ChDs
Definition: TEcnaHistos.h:654
TCanvas * GetCurrentCanvas()
Int_t GetNbBinsFromMemo(const TString &, const TString &)
Int_t MaxCrysHocoInStin()
Int_t fMemoPlotH_SCs_RuDs
Definition: TEcnaHistos.h:651
TVirtualPad * fCurrentPad
Definition: TEcnaHistos.h:849
TCanvas * fCanvD_MCs_ChDs
Definition: TEcnaHistos.h:786
Int_t fMemoColorD_Adc_EvDs
Definition: TEcnaHistos.h:663
Int_t fCanvSameD_Ped_ChNb
Definition: TEcnaHistos.h:955
TVirtualPad * fPadD_Adc_EvDs
Definition: TEcnaHistos.h:870
TString AsciiFileName()
Axis_t fD_LFN_ChNbXinf
Definition: TEcnaHistos.h:487
Double_t fH_LFN_RuDsYmax
Definition: TEcnaHistos.h:602
Int_t MaxCrysInSC()
Int_t MaxSampADC()
TString fHFBetweenChannels
Definition: TEcnaHistos.h:455
Int_t GetNotConnectedSCForConsFromIndex(const Int_t &)
Axis_t fD_MCs_ChDsXinf
Definition: TEcnaHistos.h:485
TCanvas * fCanvD_LFN_ChNb
Definition: TEcnaHistos.h:787
Int_t fStartEvolRun
Definition: TEcnaHistos.h:401
Int_t fTextPaveFont
Definition: TEcnaHistos.h:459
TString fXMemoH_LFN_RuDs
Definition: TEcnaHistos.h:703
TString fLFBetweenStins
Definition: TEcnaHistos.h:456
TString fYMemoD_HFN_ChNb
Definition: TEcnaHistos.h:718
TPaveText * SetOptionSamePaveBorder(const TString &, const TString &)
Int_t fMemoAlreadyRead
Definition: TEcnaHistos.h:380
Int_t MaxDeeInEE()
void SetHistoPresentation(TH1D *, const TString &)
Int_t fCanvSameH_LFN_RuDs
Definition: TEcnaHistos.h:966
Axis_t fH_TNo_DateXsup
Definition: TEcnaHistos.h:515
void ViewDeeGrid(const Int_t &, const TString &)
TMatrixD ReadCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:2956
TPaveText * fPavTxtD_SCs_ChDs
Definition: TEcnaHistos.h:899
TCanvas * fCanvD_SSp_SpNb
Definition: TEcnaHistos.h:795
Int_t fMemoColorD_MSp_SpDs
Definition: TEcnaHistos.h:662
TString fAsciiFileName
Definition: TEcnaHistos.h:422
Int_t fMemoPlotD_Ped_ChNb
Definition: TEcnaHistos.h:637
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:635
TString fYMemoH_SCs_RuDs
Definition: TEcnaHistos.h:739
TPaveText * fPavTxtD_TNo_ChNb
Definition: TEcnaHistos.h:890
TCanvas * fCanvH_MCs_Date
Definition: TEcnaHistos.h:801
Int_t fMemoColorH_TNo_RuDs
Definition: TEcnaHistos.h:665
void WriteAsciiCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1435
TPaveText * fPavTxtH_HFN_Date
Definition: TEcnaHistos.h:910
TString fXMemoD_HFN_ChNb
Definition: TEcnaHistos.h:684
TString fMyRootFileName
Definition: TEcnaHistos.h:417
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
TString GetCodeOnlyOnePlot()
Double_t GetMarginAutoMinMax()
Int_t fNbBinsMemoD_NOE_ChDs
Definition: TEcnaHistos.h:743
TPaveText * fPavTxtD_Adc_EvDs
Definition: TEcnaHistos.h:904
TVectorD ReadMeanCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:1968
Int_t GetXStinInStas(const Int_t &, const Int_t &, const Int_t &)
Bool_t LookAtRootFile()
Definition: TEcnaRead.cc:922
Double_t GetIEtaMax(const Int_t &, const Int_t &)
TString GetStexHalfStas(const Int_t &)
TCanvas * fCanvD_MSp_SpDs
Definition: TEcnaHistos.h:794
Double_t NotConnectedSCH1DBin(const Int_t &)
TVirtualPad * fPadD_TNo_ChNb
Definition: TEcnaHistos.h:856
TString fOnlyOnePlot
Definition: TEcnaHistos.h:629
Int_t fCanvSameH_SCs_RuDs
Definition: TEcnaHistos.h:969
Double_t fD_SCs_ChDsYmax
Definition: TEcnaHistos.h:568
TString GetEEDeeEndcap(const Int_t &)
Int_t MaxStinEcnaInStex()
TString fFapStexBarrel
Definition: TEcnaHistos.h:407
Int_t fNbBinsMemoD_LFN_ChNb
Definition: TEcnaHistos.h:750
void NewCanvas(const TString &)
Axis_t fD_NOE_ChNbXinf
Definition: TEcnaHistos.h:471
TCanvasImp * fImpH_HFN_Date
Definition: TEcnaHistos.h:944
TMatrixD ReadHighFrequencyCovariancesBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:3317
TString SetHistoYAxisTitle(const TString &)
Bool_t fClosedD_Ped_ChDs
Definition: TEcnaHistos.h:816
Int_t fTobeRead
Definition: TEcnaHistos.h:381
TString fFapStinQuadType
Definition: TEcnaHistos.h:410
Axis_t fD_HFN_ChDsXinf
Definition: TEcnaHistos.h:493
Double_t fYinf
Definition: TEcnaHistos.h:463
Double_t GetYminFromGraphFrameAndMarginValue(TGraph *, const Double_t)
Double_t BoxRightX(const TString &)
TString GetEcalSubDetector()
Axis_t fH_HFN_RuDsXinf
Definition: TEcnaHistos.h:533
Int_t fNbBinsMemoH_MCs_RuDs
Definition: TEcnaHistos.h:770
TCanvas * fCanvD_SCs_ChNb
Definition: TEcnaHistos.h:791
Double_t fD_SSp_SpNbYmin
Definition: TEcnaHistos.h:574
TVirtualPad * fPadH_TNo_Date
Definition: TEcnaHistos.h:873
Axis_t fH_MCs_DateXinf
Definition: TEcnaHistos.h:516
Int_t GetStexNumber()
Definition: TEcnaRead.cc:748
Int_t GetMaxNbOfColors()
TString fYMemoD_TNo_ChNb
Definition: TEcnaHistos.h:712
Axis_t fD_TNo_ChDsXsup
Definition: TEcnaHistos.h:482
Int_t fNbOfListFileH_MCs_RuDs
Definition: TEcnaHistos.h:973
TString GetIXIYAxisTitle(const TString &)
Double_t fD_Adc_EvNbYmax
Definition: TEcnaHistos.h:581
Double_t fH2HFccMosMatrixYmin
Definition: TEcnaHistos.h:610
void SetYVarMemo(const TString &, const TString &, const TString &)
Int_t MaxStinHocoInStex()
TCanvasImp * fImpH_LFN_RuDs
Definition: TEcnaHistos.h:949
TVirtualPad * fPadD_MCs_ChNb
Definition: TEcnaHistos.h:858
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
TString GetJYDirectionEE(const Int_t &)
Axis_t GetHistoXinf(const TString &, const Int_t &, const TString &)
TCanvasImp * fImpD_SCs_ChDs
Definition: TEcnaHistos.h:933
TPaveText * fPavTxtD_LFN_ChDs
Definition: TEcnaHistos.h:895
Int_t NumberOfNotCompleteSCs()
Axis_t fD_LFN_ChDsXsup
Definition: TEcnaHistos.h:490
Double_t BoxBottomY(const TString &)
Bool_t fClosedD_MSp_SpDs
Definition: TEcnaHistos.h:828
void ViewStasGrid(const Int_t &)
TCanvasImp * fImpH_LFN_Date
Definition: TEcnaHistos.h:943
Int_t fNbOfListFileH_LFN_RuDs
Definition: TEcnaHistos.h:974
Int_t Get1StexCrysFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &, const Int_t &)
Int_t fNbOfListFileH_HFN_Date
Definition: TEcnaHistos.h:972
void SetViewGraphOffsets(TGraph *, const TString &)
TVectorD fReadHistoDummy
Definition: TEcnaHistos.h:382
TCanvasImp * fImpD_MCs_ChNb
Definition: TEcnaHistos.h:926
TString GetXDirectionEB(const Int_t &)
TString fXMemoD_Ped_ChNb
Definition: TEcnaHistos.h:676
Long_t GetPointerValue(const TString &)
Definition: TEcnaObject.cc:232
Double_t fD_Ped_ChDsYmax
Definition: TEcnaHistos.h:548
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:1335
TEcnaParHistos * fCnaParHistos
Definition: TEcnaHistos.h:370
TVectorD ReadAverageMeanCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2693
Int_t fNbBinsProj
Definition: TEcnaHistos.h:671
TString fXMemoD_LFN_ChDs
Definition: TEcnaHistos.h:683
TVirtualPad * fPadD_SSp_SpDs
Definition: TEcnaHistos.h:869
Axis_t fH_Ped_DateXinf
Definition: TEcnaHistos.h:512
Float_t AxisLabelSize()
TString fFlagUserHistoMax
Definition: TEcnaHistos.h:445
Axis_t fH_LFN_DateXsup
Definition: TEcnaHistos.h:519
void SetYmaxMemoFromValue(const TString &, const Double_t &)
Int_t fMemoPlotD_SSp_SpDs
Definition: TEcnaHistos.h:644
Axis_t fD_SCs_ChDsXsup
Definition: TEcnaHistos.h:498
TPaveText * SetPaveStas()
Int_t MaxCrysForConsInDee()
TString fXMemoD_SCs_ChDs
Definition: TEcnaHistos.h:687
Int_t GetHistoSize(const TString &, const TString &)
Int_t fPlotAllXtalsInStin
Definition: TEcnaHistos.h:633
TVectorD ReadAverageSigmaOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2777
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:748
Double_t fH_SCs_RuDsYmax
Definition: TEcnaHistos.h:606
Int_t fNbBinsMemoD_NOE_ChNb
Definition: TEcnaHistos.h:742
Bool_t fClosedD_HFN_ChNb
Definition: TEcnaHistos.h:823
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:817
void SigmaSamplesXtals(const TVectorD &, const Int_t &, const Int_t &, const Int_t &, const TString &)
std::ifstream fFcin_f
Definition: TEcnaHistos.h:385
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:582
Int_t fMemoPlotD_Adc_EvDs
Definition: TEcnaHistos.h:645
Int_t MaxTowInSM()
Bool_t StatusDataExist()
Definition: TEcnaHistos.cc:832
ClassImp(TEcnaHistos) TEcnaHistos
Definition: TEcnaHistos.cc:13
Int_t fMemoColorD_SSp_SpNb
Definition: TEcnaHistos.h:661
Int_t fMemoColorD_Ped_ChNb
Definition: TEcnaHistos.h:655
TString fXMemoD_Adc_EvDs
Definition: TEcnaHistos.h:692
time_t GetStartTime()
Definition: TEcnaRead.cc:754
TVectorD ReadNumberOfEvents(const Int_t &)
Definition: TEcnaRead.cc:1662
Double_t fD_NOE_ChNbYmin
Definition: TEcnaHistos.h:541
void GeneralTitle(const TString &)
Definition: TEcnaHistos.cc:797
Axis_t fD_NOE_ChDsXinf
Definition: TEcnaHistos.h:473
void PlotCloneOfCurrentCanvas()
Int_t fMemoColorD_LFN_ChNb
Definition: TEcnaHistos.h:658
TVirtualPad * fPadD_Adc_EvNb
Definition: TEcnaHistos.h:871
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:484
TCanvas * fCanvH_LFN_RuDs
Definition: TEcnaHistos.h:808
time_t fStartTime
Definition: TEcnaHistos.h:427
Int_t fMemoPlotD_HFN_ChNb
Definition: TEcnaHistos.h:641
Int_t fMemoPlotH_HFN_RuDs
Definition: TEcnaHistos.h:649
Double_t fH_SCs_RuDsYmin
Definition: TEcnaHistos.h:605
TString fYMemoD_NOE_ChDs
Definition: TEcnaHistos.h:709
TVirtualPad * fPadD_Ped_ChDs
Definition: TEcnaHistos.h:855
Int_t fFapReqNbOfEvts
Definition: TEcnaHistos.h:392
Int_t fCanvSameD_SSp_SpNb
Definition: TEcnaHistos.h:961
TCanvas * fCanvH_TNo_RuDs
Definition: TEcnaHistos.h:806
Double_t fD_MCs_ChNbYmax
Definition: TEcnaHistos.h:554
TString fYMemoH_TNo_RuDs
Definition: TEcnaHistos.h:735
Int_t fCanvSameD_Ped_ChDs
Definition: TEcnaHistos.h:955