CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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: 04/07/2011
4 
6 using namespace std;
7 
8 //--------------------------------------
9 // TEcnaHistos.cc
10 // Class creation: 18 April 2005
11 // Documentation: see TEcnaHistos.h
12 //--------------------------------------
13 
14 ClassImp(TEcnaHistos)
15 //______________________________________________________________________________
16 //
17 
18 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
19 //
20 // (attributes) ===> TEcnaParPaths --->|
21 // TEcnaParEcal --->|
22 // TEcnaWrite ---> TEcnaParPaths --->|
23 // TEcnaParCout --->|
24 // TEcnaParEcal --->|
25 // TEcnaNumbering ---> TEcnaParEcal --->|
26 // TEcnaParHistos ---> TEcnaParEcal --->|
27 // TEcnaNumbering ---> TEcnaParEcal --->|
28 // TEcnaNumbering ---> TEcnaParEcal --->|
29 //
30 // TEcnaRead ---> TEcnaParCout --->|
31 // TEcnaParPaths --->|
32 // TEcnaHeader --->|
33 // TEcnaParEcal --->|
34 // TEcnaWrite ---> TEcnaParPaths --->|
35 // TEcnaParCout --->|
36 // TEcnaParEcal --->|
37 // TEcnaNumbering ---> TEcnaParEcal --->|
38 // TEcnaNumbering ---> TEcnaParEcal --->|
39 //
40 //
41 // Terminal classes: TEcnaParPaths, TEcnaParEcal, TEcnaParCout, TEcnaHeader, TEcnaNArrayD,
42 // TEcnaObject, TEcnaResultType, TEcnaRootFile
43 // Non terminal classes: TEcnaGui, TEcnaHistos, TEcnaParHistos, TEcnaNumbering, TEcnaRead,
44 // TEcnaRun, TEcnaWrite
45 //
46 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
47 
49 {
50  //destructor
51 
52  if (fT1DRunNumber != 0){delete [] fT1DRunNumber; fCdelete++;}
53 
54  //if (fCnaParHistos != 0){delete fCnaParHistos; fCdelete++;}
55  //if (fCnaParPaths != 0){delete fCnaParPaths; fCdelete++;}
56  //if (fCnaParCout != 0){delete fCnaParCout; fCdelete++;}
57  //if (fCnaWrite != 0){delete fCnaWrite; fCdelete++;}
58  //if (fEcal != 0){delete fEcal; fCdelete++;}
59  //if (fEcalNumbering != 0){delete fEcalNumbering; fCdelete++;}
60 
61  //if (fMyRootFile != 0){delete fMyRootFile; fCdelete++;}
62  //if (fReadHistoDummy != 0){delete fReadHistoDummy; fCdelete++;}
63 
64 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65 
66  if ( fCnew != fCdelete )
67  {
68  cout << "*TEcnaHistos> WRONG MANAGEMENT OF ALLOCATIONS: fCnew = "
69  << fCnew << ", fCdelete = " << fCdelete << fTTBELL << endl;
70  }
71  else
72  {
73  // cout << "*TEcnaHistos> BRAVO! GOOD MANAGEMENT OF ALLOCATIONS: fCnew = "
74  // << fCnew << ", fCdelete = " << fCdelete << endl;
75  }
76 
77 #define MGRA
78 #ifndef MGRA
79  if ( fCnewRoot != fCdeleteRoot )
80  {
81  cout << "*TEcnaHistos> WRONG MANAGEMENT OF ROOT ALLOCATIONS: fCnewRoot = "
82  << fCnewRoot << ", fCdeleteRoot = " << fCdeleteRoot << endl;
83  }
84  else
85  {
86  cout << "*TEcnaHistos> BRAVO! GOOD MANAGEMENT OF ROOT ALLOCATIONS:"
87  << " fCnewRoot = " << fCnewRoot <<", fCdeleteRoot = "
88  << fCdeleteRoot << endl;
89  }
90 #endif // MGRA
91 
92  // cout << "TEcnaHistos> Leaving destructor" << endl;
93  // cout << " fCnew = " << fCnew << ", fCdelete = " << fCdelete << endl;
94 
95  // cout << "[Info Management] CLASS: TEcnaHistos. DESTROY OBJECT: this = " << this << endl;
96 
97 }
98 
99 //===================================================================
100 //
101 // Constructors
102 //
103 //===================================================================
105 // Constructor without argument. Call to Init()
106 
107  // cout << "[Info Management] CLASS: TEcnaHistos. CREATE OBJECT: this = " << this << endl;
108 
109  Init();
110 }
111 
112 TEcnaHistos::TEcnaHistos(TEcnaObject* pObjectManager, const TString& SubDet)
113 {
114  // cout << "[Info Management] CLASS: TEcnaHistos. CREATE OBJECT: this = " << this << endl;
115 
116 
117  Long_t i_this = (Long_t)this;
118  pObjectManager->RegisterPointer("TEcnaHistos", i_this);
119 
120  Init();
121 
122  //----------------------- Object management
123 
124  //............................ fCnaParCout
125  fCnaParCout = 0;
126  Long_t iCnaParCout = pObjectManager->GetPointerValue("TEcnaParCout");
127  if( iCnaParCout == 0 )
128  {fCnaParCout = new TEcnaParCout(pObjectManager); /*fCnew++*/}
129  else
130  {fCnaParCout = (TEcnaParCout*)iCnaParCout;}
131 
132  //............................ fCnaParPaths
133  fCnaParPaths = 0;
134  Long_t iCnaParPaths = pObjectManager->GetPointerValue("TEcnaParPaths");
135  if( iCnaParPaths == 0 )
136  {fCnaParPaths = new TEcnaParPaths(pObjectManager); /*fCnew++*/}
137  else
138  {fCnaParPaths = (TEcnaParPaths*)iCnaParPaths;}
139 
140  fCfgResultsRootFilePath = fCnaParPaths->ResultsRootFilePath();
141  fCfgHistoryRunListFilePath = fCnaParPaths->HistoryRunListFilePath();
142 
143  //............................ fEcal => to be changed in fParEcal
144  fEcal = 0;
145  Long_t iParEcal = pObjectManager->GetPointerValue("TEcnaParEcal");
146  if( iParEcal == 0 )
147  {fEcal = new TEcnaParEcal(pObjectManager, SubDet.Data()); /*fCnew++*/}
148  else
149  {fEcal = (TEcnaParEcal*)iParEcal;}
150 
151  //............................ fEcalNumbering
152  fEcalNumbering = 0;
153  Long_t iEcalNumbering = pObjectManager->GetPointerValue("TEcnaNumbering");
154  if( iEcalNumbering == 0 )
155  {fEcalNumbering = new TEcnaNumbering(pObjectManager, SubDet.Data()); /*fCnew++*/}
156  else
157  {fEcalNumbering = (TEcnaNumbering*)iEcalNumbering;}
158 
159  //............................ fCnaParHistos
160  fCnaParHistos = 0;
161  Long_t iCnaParHistos = pObjectManager->GetPointerValue("TEcnaParHistos");
162  if( iCnaParHistos == 0 )
163  {fCnaParHistos = new TEcnaParHistos(pObjectManager, SubDet.Data()); /*fCnew++*/}
164  else
165  {fCnaParHistos = (TEcnaParHistos*)iCnaParHistos;}
166 
167  //............................ fCnaWrite
168  fCnaWrite = 0;
169  Long_t iCnaWrite = pObjectManager->GetPointerValue("TEcnaWrite");
170  if( iCnaWrite == 0 )
171  {fCnaWrite = new TEcnaWrite(pObjectManager, SubDet.Data()); /*fCnew++*/}
172  else
173  {fCnaWrite = (TEcnaWrite*)iCnaWrite;}
174 
175  //............................ fMyRootFile
176  fMyRootFile = 0;
177  Long_t iMyRootFile = pObjectManager->GetPointerValue("TEcnaRead");
178  if( iMyRootFile == 0 )
179  {fMyRootFile = new TEcnaRead(pObjectManager, SubDet.Data()); /*fCnew++*/}
180  else
181  {fMyRootFile = (TEcnaRead*)iMyRootFile;}
182 
183  fMyRootFile->PrintNoComment();
184 
185  //------------------- creation objet TEcnaRead fMyRootFile (a reprendre plus clairement)
186  //fFileHeader = 0;
187  //fMyRootFile = new TEcnaRead(fFlagSubDet.Data(), fCnaParPaths, fCnaParCout,
188  // fFileHeader, fEcalNumbering, fCnaWrite); fCnew++;
189  //fMyRootFile->PrintNoComment();
190 
191 
192  SetEcalSubDetector(SubDet.Data());
193  //......... init ymin,ymax histos -> Default values for Ymin and Ymax
194  SetAllYminYmaxMemoFromDefaultValues();
195 }
196 
197 
199 {
200 //========================= GENERAL INITIALISATION
201  fCnew = 0;
202  fCdelete = 0;
203  fCnewRoot = 0;
204  fCdeleteRoot = 0;
205 
206  fCnaCommand = 0;
207  fCnaError = 0;
208 
209  fgMaxCar = 512;
210  Int_t MaxCar = fgMaxCar;
211 
212  //------------------------------ initialisations ----------------------
213  fTTBELL = '\007';
214 
215  fT1DRunNumber = 0;
216 
217  //.......... init flags Same plot
218  fMemoPlotH1SamePlus = 0;
219  fMemoPlotD_NOE_ChNb = 0; fMemoPlotD_NOE_ChDs = 0;
220  fMemoPlotD_Ped_ChNb = 0; fMemoPlotD_Ped_ChDs = 0;
221  fMemoPlotD_TNo_ChNb = 0; fMemoPlotD_TNo_ChDs = 0;
222  fMemoPlotD_MCs_ChNb = 0; fMemoPlotD_MCs_ChDs = 0;
223  fMemoPlotD_LFN_ChNb = 0; fMemoPlotD_LFN_ChDs = 0;
224  fMemoPlotD_HFN_ChNb = 0; fMemoPlotD_HFN_ChDs = 0;
225  fMemoPlotD_SCs_ChNb = 0; fMemoPlotD_SCs_ChDs = 0;
226  fMemoPlotD_MSp_SpNb = 0; fMemoPlotD_SSp_SpNb = 0;
227  fMemoPlotD_MSp_SpDs = 0; fMemoPlotD_SSp_SpDs = 0;
228  fMemoPlotD_Adc_EvDs = 0; fMemoPlotD_Adc_EvNb = 0;
229  fMemoPlotH_Ped_Date = 0; fMemoPlotH_TNo_Date = 0;
230  fMemoPlotH_MCs_Date = 0; fMemoPlotH_LFN_Date = 0;
231  fMemoPlotH_HFN_Date = 0; fMemoPlotH_SCs_Date = 0;
232  fMemoPlotH_Ped_RuDs = 0; fMemoPlotH_TNo_RuDs = 0;
233  fMemoPlotH_MCs_RuDs = 0; fMemoPlotH_LFN_RuDs = 0;
234  fMemoPlotH_HFN_RuDs = 0; fMemoPlotH_SCs_RuDs = 0;
235  //.......... init flags colors (Init)
236  fMemoColorH1SamePlus = 0;
237  fMemoColorD_NOE_ChNb = 0; fMemoColorD_NOE_ChDs = 0;
238  fMemoColorD_Ped_ChNb = 0; fMemoColorD_Ped_ChDs = 0;
239  fMemoColorD_TNo_ChNb = 0; fMemoColorD_TNo_ChDs = 0;
240  fMemoColorD_MCs_ChNb = 0; fMemoColorD_MCs_ChDs = 0;
241  fMemoColorD_LFN_ChNb = 0; fMemoColorD_LFN_ChDs = 0;
242  fMemoColorD_HFN_ChNb = 0; fMemoColorD_HFN_ChDs = 0;
243  fMemoColorD_SCs_ChNb = 0; fMemoColorD_SCs_ChDs = 0;
244  fMemoColorD_MSp_SpNb = 0; fMemoColorD_SSp_SpNb = 0;
245  fMemoColorD_MSp_SpDs = 0; fMemoColorD_SSp_SpDs = 0;
246  fMemoColorD_Adc_EvDs = 0; fMemoColorD_Adc_EvNb = 0;
247  fMemoColorH_Ped_Date = 0; fMemoColorH_TNo_Date = 0;
248  fMemoColorH_MCs_Date = 0; fMemoColorH_LFN_Date = 0;
249  fMemoColorH_HFN_Date = 0; fMemoColorH_SCs_Date = 0;
250  fMemoColorH_Ped_RuDs = 0; fMemoColorH_TNo_RuDs = 0;
251  fMemoColorH_MCs_RuDs = 0; fMemoColorH_LFN_RuDs = 0;
252  fMemoColorH_HFN_RuDs = 0; fMemoColorH_SCs_RuDs = 0;
253 
254  //.......... init counter Same canvas
255  fCanvSameH1SamePlus = 0;
256  fCanvSameD_NOE_ChNb = 0; fCanvSameD_NOE_ChDs = 0;
257  fCanvSameD_Ped_ChNb = 0; fCanvSameD_Ped_ChDs = 0;
258  fCanvSameD_TNo_ChNb = 0; fCanvSameD_TNo_ChDs = 0;
259  fCanvSameD_MCs_ChNb = 0; fCanvSameD_MCs_ChDs = 0;
260  fCanvSameD_LFN_ChNb = 0; fCanvSameD_LFN_ChDs = 0;
261  fCanvSameD_HFN_ChNb = 0; fCanvSameD_HFN_ChDs = 0;
262  fCanvSameD_SCs_ChNb = 0; fCanvSameD_SCs_ChDs = 0;
263  fCanvSameD_MSp_SpNb = 0; fCanvSameD_SSp_SpNb = 0;
264  fCanvSameD_MSp_SpDs = 0; fCanvSameD_SSp_SpDs = 0;
265  fCanvSameD_Adc_EvDs = 0; fCanvSameD_Adc_EvNb = 0;
266  fCanvSameH_Ped_Date = 0; fCanvSameH_TNo_Date = 0;
267  fCanvSameH_MCs_Date = 0; fCanvSameH_LFN_Date = 0;
268  fCanvSameH_HFN_Date = 0; fCanvSameH_SCs_Date = 0;
269  fCanvSameH_Ped_RuDs = 0; fCanvSameH_TNo_RuDs = 0;
270  fCanvSameH_MCs_RuDs = 0; fCanvSameH_LFN_RuDs = 0;
271  fCanvSameH_HFN_RuDs = 0; fCanvSameH_SCs_RuDs = 0;
272  //................. Flag Scale X anf Y set to "LIN" and flag color palete set to "Black/Red/Blue"
273 
274  MaxCar = fgMaxCar;
275  fFlagScaleX.Resize(MaxCar);
276  fFlagScaleX = "LIN";
277 
278  MaxCar = fgMaxCar; // (Init)
279  fFlagScaleY.Resize(MaxCar);
280  fFlagScaleY = "LIN";
281 
282  MaxCar = fgMaxCar;
283  fFlagColPal.Resize(MaxCar);
284  fFlagColPal = "Black/Red/Blue";
285 
286  //................. Flag General Title set to empty string
287  MaxCar = fgMaxCar;
288  fFlagGeneralTitle.Resize(MaxCar);
289  fFlagGeneralTitle = "";
290 
291  //................. Init codes Options
292  fOptScaleLinx = 31400;
293  fOptScaleLogx = 31401;
294  fOptScaleLiny = 31402;
295  fOptScaleLogy = 31403;
296 
297  fOptVisLine = 1101;
298  fOptVisPolm = 1102;
299 
300  //............................ (Init)
301  MaxCar = fgMaxCar;
302  fCovarianceMatrix.Resize(MaxCar);
303  fCovarianceMatrix = "Cov";
304  MaxCar = fgMaxCar;
305  fCorrelationMatrix.Resize(MaxCar);
306  fCorrelationMatrix = "Cor";
307 
308  MaxCar = fgMaxCar;
309  fLFBetweenStins.Resize(MaxCar);
310  fLFBetweenStins = "MttLF";
311  MaxCar = fgMaxCar;
312  fHFBetweenStins.Resize(MaxCar);
313  fHFBetweenStins = "MttHF";
314 
315  MaxCar = fgMaxCar;
316  fLFBetweenChannels.Resize(MaxCar);
317  fLFBetweenChannels = "MccLF";
318  MaxCar = fgMaxCar;
319  fHFBetweenChannels.Resize(MaxCar);
320  fHFBetweenChannels = "MccHF";
321 
322  MaxCar = fgMaxCar;
323  fBetweenSamples.Resize(MaxCar);
324  fBetweenSamples = "Mss";
325 
326  //.................................. text pave alignement for pave "SeveralChanging" (HistimePlot)
327  fTextPaveAlign = 12; // 1 = left adjusted, 2 = vertically centered
328  fTextPaveFont = 100; // 10*10 = 10*(ID10 = Courier New)
329  fTextPaveSize = (Float_t)0.025; // 0.0xxx = xxx% of the pave size
330  fTextBorderSize = 1; // Pave Border (=>Shadow)
331 
332  //................................. Init Xvar, Yvar, NbBins management for options SAME and SAME n
333  fXMemoH1SamePlus = "";
334  fXMemoD_NOE_ChNb = "";
335  fXMemoD_NOE_ChDs = "";
336  fXMemoD_Ped_ChNb = "";
337  fXMemoD_Ped_ChDs = "";
338  fXMemoD_TNo_ChNb = "";
339  fXMemoD_TNo_ChDs = "";
340  fXMemoD_MCs_ChNb = "";
341  fXMemoD_MCs_ChDs = "";
342  fXMemoD_LFN_ChNb = "";
343  fXMemoD_LFN_ChDs = "";
344  fXMemoD_HFN_ChNb = "";
345  fXMemoD_HFN_ChDs = "";
346  fXMemoD_SCs_ChNb = "";
347  fXMemoD_SCs_ChDs = "";
348  fXMemoD_MSp_SpNb = "";
349  fXMemoD_MSp_SpDs = "";
350  fXMemoD_SSp_SpNb = "";
351  fXMemoD_SSp_SpDs = "";
352  fXMemoD_Adc_EvDs = "";
353  fXMemoD_Adc_EvNb = "";
354  fXMemoH_Ped_Date = "";
355  fXMemoH_TNo_Date = "";
356  fXMemoH_MCs_Date = "";
357  fXMemoH_LFN_Date = "";
358  fXMemoH_HFN_Date = "";
359  fXMemoH_SCs_Date = "";
360  fXMemoH_Ped_RuDs = "";
361  fXMemoH_TNo_RuDs = "";
362  fXMemoH_MCs_RuDs = "";
363  fXMemoH_LFN_RuDs = "";
364  fXMemoH_HFN_RuDs = "";
365  fXMemoH_SCs_RuDs = "";
366 
367  fYMemoH1SamePlus = "";
368  fYMemoD_NOE_ChNb = "";
369  fYMemoD_NOE_ChDs = "";
370  fYMemoD_Ped_ChNb = "";
371  fYMemoD_Ped_ChDs = "";
372  fYMemoD_TNo_ChNb = "";
373  fYMemoD_TNo_ChDs = "";
374  fYMemoD_MCs_ChNb = "";
375  fYMemoD_MCs_ChDs = "";
376  fYMemoD_LFN_ChNb = "";
377  fYMemoD_LFN_ChDs = "";
378  fYMemoD_HFN_ChNb = "";
379  fYMemoD_HFN_ChDs = "";
380  fYMemoD_SCs_ChNb = "";
381  fYMemoD_SCs_ChDs = "";
382  fYMemoD_MSp_SpNb = "";
383  fYMemoD_MSp_SpDs = "";
384  fYMemoD_SSp_SpNb = "";
385  fYMemoD_SSp_SpDs = "";
386  fYMemoD_Adc_EvDs = "";
387  fYMemoD_Adc_EvNb = "";
388  fYMemoH_Ped_Date = "";
389  fYMemoH_TNo_Date = "";
390  fYMemoH_MCs_Date = "";
391  fYMemoH_LFN_Date = "";
392  fYMemoH_HFN_Date = "";
393  fYMemoH_SCs_Date = "";
394  fYMemoH_Ped_RuDs = "";
395  fYMemoH_TNo_RuDs = "";
396  fYMemoH_MCs_RuDs = "";
397  fYMemoH_LFN_RuDs = "";
398  fYMemoH_HFN_RuDs = "";
399  fYMemoH_SCs_RuDs = "";
400 
401  fNbBinsMemoH1SamePlus = 0;
402  fNbBinsMemoD_NOE_ChNb = 0;
403  fNbBinsMemoD_NOE_ChDs = 0;
404  fNbBinsMemoD_Ped_ChNb = 0;
405  fNbBinsMemoD_Ped_ChDs = 0;
406  fNbBinsMemoD_TNo_ChNb = 0;
407  fNbBinsMemoD_TNo_ChDs = 0;
408  fNbBinsMemoD_MCs_ChNb = 0;
409  fNbBinsMemoD_MCs_ChDs = 0;
410  fNbBinsMemoD_LFN_ChNb = 0;
411  fNbBinsMemoD_LFN_ChDs = 0;
412  fNbBinsMemoD_HFN_ChNb = 0;
413  fNbBinsMemoD_HFN_ChDs = 0;
414  fNbBinsMemoD_SCs_ChNb = 0;
415  fNbBinsMemoD_SCs_ChDs = 0;
416  fNbBinsMemoD_MSp_SpNb = 0;
417  fNbBinsMemoD_MSp_SpDs = 0;
418  fNbBinsMemoD_SSp_SpNb = 0;
419  fNbBinsMemoD_SSp_SpDs = 0;
420  fNbBinsMemoD_Adc_EvDs = 0;
421  fNbBinsMemoD_Adc_EvNb = 0;
422  fNbBinsMemoH_Ped_Date = 0;
423  fNbBinsMemoH_TNo_Date = 0;
424  fNbBinsMemoH_MCs_Date = 0;
425  fNbBinsMemoH_LFN_Date = 0;
426  fNbBinsMemoH_HFN_Date = 0;
427  fNbBinsMemoH_SCs_Date = 0;
428  fNbBinsMemoH_Ped_RuDs = 0;
429  fNbBinsMemoH_TNo_RuDs = 0;
430  fNbBinsMemoH_MCs_RuDs = 0;
431  fNbBinsMemoH_LFN_RuDs = 0;
432  fNbBinsMemoH_HFN_RuDs = 0;
433  fNbBinsMemoH_SCs_RuDs = 0;
434 
435  //.................................. Init canvas/pad pointers (Init)
436  fCurrentCanvas = 0;
437 
438  fCurrentCanvasName = "?";
439 
440  fCanvH1SamePlus = 0;
441  fCanvD_NOE_ChNb = 0;
442  fCanvD_NOE_ChDs = 0;
443  fCanvD_Ped_ChNb = 0;
444  fCanvD_Ped_ChDs = 0;
445  fCanvD_TNo_ChNb = 0;
446  fCanvD_TNo_ChDs = 0;
447  fCanvD_MCs_ChNb = 0;
448  fCanvD_MCs_ChDs = 0;
449  fCanvD_LFN_ChNb = 0;
450  fCanvD_LFN_ChDs = 0;
451  fCanvD_HFN_ChNb = 0;
452  fCanvD_HFN_ChDs = 0;
453  fCanvD_SCs_ChNb = 0;
454  fCanvD_SCs_ChDs = 0;
455  fCanvD_MSp_SpNb = 0;
456  fCanvD_MSp_SpDs = 0;
457  fCanvD_SSp_SpNb = 0;
458  fCanvD_SSp_SpDs = 0;
459  fCanvD_Adc_EvDs = 0;
460  fCanvD_Adc_EvNb = 0;
461  fCanvH_Ped_Date = 0;
462  fCanvH_TNo_Date = 0;
463  fCanvH_MCs_Date = 0;
464  fCanvH_LFN_Date = 0;
465  fCanvH_HFN_Date = 0;
466  fCanvH_SCs_Date = 0;
467  fCanvH_Ped_RuDs = 0;
468  fCanvH_TNo_RuDs = 0;
469  fCanvH_MCs_RuDs = 0;
470  fCanvH_LFN_RuDs = 0;
471  fCanvH_HFN_RuDs = 0;
472  fCanvH_SCs_RuDs = 0;
473 
474 
475  fClosedH1SamePlus = kFALSE; // (Canvas Closed SIGNAL)
476  fClosedD_NOE_ChNb = kFALSE;
477  fClosedD_NOE_ChDs = kFALSE;
478  fClosedD_Ped_ChNb = kFALSE;
479  fClosedD_Ped_ChDs = kFALSE;
480  fClosedD_TNo_ChNb = kFALSE;
481  fClosedD_TNo_ChDs = kFALSE;
482  fClosedD_MCs_ChNb = kFALSE;
483  fClosedD_MCs_ChDs = kFALSE;
484  fClosedD_LFN_ChNb = kFALSE;
485  fClosedD_LFN_ChDs = kFALSE;
486  fClosedD_HFN_ChNb = kFALSE;
487  fClosedD_HFN_ChDs = kFALSE;
488  fClosedD_SCs_ChNb = kFALSE;
489  fClosedD_SCs_ChDs = kFALSE;
490  fClosedD_MSp_SpNb = kFALSE;
491  fClosedD_MSp_SpDs = kFALSE;
492  fClosedD_SSp_SpNb = kFALSE;
493  fClosedD_SSp_SpDs = kFALSE;
494  fClosedD_Adc_EvDs = kFALSE;
495  fClosedD_Adc_EvNb = kFALSE;
496  fClosedH_Ped_Date = kFALSE;
497  fClosedH_TNo_Date = kFALSE;
498  fClosedH_MCs_Date = kFALSE;
499  fClosedH_LFN_Date = kFALSE;
500  fClosedH_HFN_Date = kFALSE;
501  fClosedH_SCs_Date = kFALSE;
502  fClosedH_Ped_RuDs = kFALSE;
503  fClosedH_TNo_RuDs = kFALSE;
504  fClosedH_MCs_RuDs = kFALSE;
505  fClosedH_LFN_RuDs = kFALSE;
506  fClosedH_HFN_RuDs = kFALSE;
507  fClosedH_SCs_RuDs = kFALSE;
508 
509  fCurrentPad = 0; // (Init)
510 
511  fPadH1SamePlus = 0;
512  fPadD_NOE_ChNb = 0;
513  fPadD_NOE_ChDs = 0;
514  fPadD_Ped_ChNb = 0;
515  fPadD_Ped_ChDs = 0;
516  fPadD_TNo_ChNb = 0;
517  fPadD_TNo_ChDs = 0;
518  fPadD_MCs_ChNb = 0;
519  fPadD_MCs_ChDs = 0;
520  fPadD_LFN_ChNb = 0;
521  fPadD_LFN_ChDs = 0;
522  fPadD_HFN_ChNb = 0;
523  fPadD_HFN_ChDs = 0;
524  fPadD_SCs_ChNb = 0;
525  fPadD_SCs_ChDs = 0;
526  fPadD_MSp_SpNb = 0;
527  fPadD_MSp_SpDs = 0;
528  fPadD_SSp_SpNb = 0;
529  fPadD_SSp_SpDs = 0;
530  fPadD_Adc_EvDs = 0;
531  fPadD_Adc_EvNb = 0;
532  fPadH_Ped_Date = 0;
533  fPadH_TNo_Date = 0;
534  fPadH_MCs_Date = 0;
535  fPadH_LFN_Date = 0;
536  fPadH_HFN_Date = 0;
537  fPadH_SCs_Date = 0;
538  fPadH_Ped_RuDs = 0;
539  fPadH_TNo_RuDs = 0;
540  fPadH_MCs_RuDs = 0;
541  fPadH_LFN_RuDs = 0;
542  fPadH_HFN_RuDs = 0;
543  fPadH_SCs_RuDs = 0;
544 
545  fPavTxtH1SamePlus = 0; // (Init)
546  fPavTxtD_NOE_ChNb = 0;
547  fPavTxtD_NOE_ChDs = 0;
548  fPavTxtD_Ped_ChNb = 0;
549  fPavTxtD_Ped_ChDs = 0;
550  fPavTxtD_TNo_ChNb = 0;
551  fPavTxtD_TNo_ChDs = 0;
552  fPavTxtD_MCs_ChNb = 0;
553  fPavTxtD_MCs_ChDs = 0;
554  fPavTxtD_LFN_ChNb = 0;
555  fPavTxtD_LFN_ChDs = 0;
556  fPavTxtD_HFN_ChNb = 0;
557  fPavTxtD_HFN_ChDs = 0;
558  fPavTxtD_SCs_ChNb = 0;
559  fPavTxtD_SCs_ChDs = 0;
560  fPavTxtD_MSp_SpNb = 0;
561  fPavTxtD_MSp_SpDs = 0;
562  fPavTxtD_SSp_SpNb = 0;
563  fPavTxtD_SSp_SpDs = 0;
564  fPavTxtD_Adc_EvDs = 0;
565  fPavTxtD_Adc_EvNb = 0;
566  fPavTxtH_Ped_Date = 0;
567  fPavTxtH_TNo_Date = 0;
568  fPavTxtH_MCs_Date = 0;
569  fPavTxtH_LFN_Date = 0;
570  fPavTxtH_HFN_Date = 0;
571  fPavTxtH_SCs_Date = 0;
572  fPavTxtH_Ped_RuDs = 0;
573  fPavTxtH_TNo_RuDs = 0;
574  fPavTxtH_MCs_RuDs = 0;
575  fPavTxtH_LFN_RuDs = 0;
576  fPavTxtH_HFN_RuDs = 0;
577  fPavTxtH_SCs_RuDs = 0;
578 
579  fImpH1SamePlus = 0; // (Init)
580  fImpD_NOE_ChNb = 0;
581  fImpD_NOE_ChDs = 0;
582  fImpD_Ped_ChNb = 0;
583  fImpD_Ped_ChDs = 0;
584  fImpD_TNo_ChNb = 0;
585  fImpD_TNo_ChDs = 0;
586  fImpD_MCs_ChNb = 0;
587  fImpD_MCs_ChDs = 0;
588  fImpD_LFN_ChNb = 0;
589  fImpD_LFN_ChDs = 0;
590  fImpD_HFN_ChNb = 0;
591  fImpD_HFN_ChDs = 0;
592  fImpD_SCs_ChNb = 0;
593  fImpD_SCs_ChDs = 0;
594  fImpD_MSp_SpNb = 0;
595  fImpD_MSp_SpDs = 0;
596  fImpD_SSp_SpNb = 0;
597  fImpD_SSp_SpDs = 0;
598  fImpD_Adc_EvDs = 0;
599  fImpD_Adc_EvNb = 0;
600  fImpH_Ped_Date = 0;
601  fImpH_TNo_Date = 0;
602  fImpH_MCs_Date = 0;
603  fImpH_LFN_Date = 0;
604  fImpH_HFN_Date = 0;
605  fImpH_SCs_Date = 0;
606  fImpH_Ped_RuDs = 0;
607  fImpH_TNo_RuDs = 0;
608  fImpH_MCs_RuDs = 0;
609  fImpH_LFN_RuDs = 0;
610  fImpH_HFN_RuDs = 0;
611  fImpH_SCs_RuDs = 0;
612 
613  fNbBinsProj = 100; // number of bins for histos in option Projection
614 
615  //.................................... Miscellaneous parameters (Init)
616 
617  fNbOfListFileH_Ped_Date = 0;
618  fNbOfListFileH_TNo_Date = 0;
619  fNbOfListFileH_MCs_Date = 0;
620  fNbOfListFileH_LFN_Date = 0;
621  fNbOfListFileH_HFN_Date = 0;
622  fNbOfListFileH_SCs_Date = 0;
623 
624  fNbOfListFileH_Ped_RuDs = 0;
625  fNbOfListFileH_TNo_RuDs = 0;
626  fNbOfListFileH_MCs_RuDs = 0;
627  fNbOfListFileH_LFN_RuDs = 0;
628  fNbOfListFileH_HFN_RuDs = 0;
629  fNbOfListFileH_SCs_RuDs = 0;
630 
631  fNbOfExistingRuns = 0;
632 
633  fFapNbOfRuns = -1; // INIT NUMBER OF RUNS: set to -1
634  fFapMaxNbOfRuns = -1; // INIT MAXIMUM NUMBER OF RUNS: set to -1
635 
636  MaxCar = fgMaxCar;
637  fFapFileRuns.Resize(MaxCar);
638  fFapFileRuns = "(file with list of runs parameters: no info)";
639 
640  fStartEvolTime = 0;
641  fStopEvolTime = 0;
642  fStartEvolDate = "Start date: not known";
643  fStopEvolDate = "Stop date: not known";
644 
645  fStartEvolRun = 0;
646  fStopEvolRun = 0;
647 
648  fRunType = "Run type: not known";
649 
650  fFapNbOfEvts = 0;
651 
652  MaxCar = fgMaxCar;
653  fMyRootFileName.Resize(MaxCar);
654  fMyRootFileName = "No ROOT file name available (fMyRootFileName).";
655 
656  fFapAnaType = "Analysis name: not known"; // Init Type of analysis
657  fFapNbOfSamples = 0; // Init Nb of required samples
658  fFapRunNumber = 0; // Init Run number
659  fFapFirstReqEvtNumber = 0; // Init First requested event number
660  fFapLastReqEvtNumber = 0; // Init Last requested event number
661  fFapReqNbOfEvts = 0; // Init Requested number of events
662  fFapStexNumber = 0; // Init Stex number
663 
664  //------------------ Init read file flags
665  fAlreadyRead = 1;
666  fMemoAlreadyRead = 0;
667  fTobeRead = 0;
668  fZerv = 0;
669  fUnev = 1;
670  TVectorD fReadHistoDummy(fUnev);
671  TMatrixD fReadMatrixDummy(fUnev, fUnev);
672 
673  //------------------ Init fAsciiFileName
674  fAsciiFileName = "?";
675 
676 } // end of Init()
677 
678 //----------------------------------------------------------------------------------------
679 void TEcnaHistos::SetEcalSubDetector(const TString& SubDet)
680 {
681  // Set Subdetector (EB or EE)
682 
683  Int_t MaxCar = fgMaxCar;
684  fFlagSubDet.Resize(MaxCar);
685  fFlagSubDet = fEcal->GetEcalSubDetector(); // fFlagSubDet = "EB" or "EE"
686 
687  //.................................. Init specific EB/EE parameters ( SetEcalSubDetector(...) )
688  MaxCar = fgMaxCar;
689  fFapStexName.Resize(MaxCar);
690  fFapStexName = "no info for Stex";
691  MaxCar = fgMaxCar;
692  fFapStinName.Resize(MaxCar);
693  fFapStinName = "no info for Stin";
694  MaxCar = fgMaxCar;
695  fFapXtalName.Resize(MaxCar);
696  fFapXtalName = "no info for Xtal";
697  MaxCar = fgMaxCar;
698  fFapEchaName.Resize(MaxCar);
699  fFapEchaName = "no info for Echa";
700 
701  if( fFlagSubDet == "EB" )
702  {
703  fFapStexName = "SM";
704  fFapStinName = "Tower";
705  fFapXtalName = "Xtal";
706  fFapEchaName = "Chan";
707  fFapStexBarrel = fEcalNumbering->GetSMHalfBarrel(fFapStexNumber);
708  }
709 
710  if( fFlagSubDet == "EE" )
711  {
712  fFapStexName = "Dee";
713  fFapStinName = "SC";
714  fFapXtalName = "Xtal";
715  fFapEchaName = "Chan";
716  fFapStexType = fEcalNumbering->GetEEDeeType(fFapStexNumber);
717  fFapStexDir = "right";
718  fFapStinQuadType = "top";
719  }
720 
721  //........................ init code plot type (SetEcalSubDetector)
722  MaxCar = fgMaxCar;
723  fOnlyOnePlot.Resize(MaxCar);
724  fOnlyOnePlot = fCnaParHistos->GetCodeOnlyOnePlot(); // "ONLYONE"
725 
726  MaxCar = fgMaxCar;
727  fSeveralPlot.Resize(MaxCar);
728  fSeveralPlot = fCnaParHistos->GetCodeSeveralPlot(); // "SEVERAL"
729 
730  MaxCar = fgMaxCar;
731  fSameOnePlot.Resize(MaxCar);
732  fSameOnePlot = fCnaParHistos->GetCodeSameOnePlot(); // "SAME n";
733 
734  MaxCar = fgMaxCar;
735  fAllXtalsInStinPlot.Resize(MaxCar);
736  fAllXtalsInStinPlot = fCnaParHistos->GetCodeAllXtalsInStinPlot(); // "SAME in Stin";
737 
738  fPlotAllXtalsInStin = fCnaParHistos->GetCodePlotAllXtalsInStin(); // 0
739 
740 } // ---------------- end of SetEcalSubDetector(...) ----------------
741 
742 //--------------------------------------------------------------------------------------------
743 //
744 // FileParameters(s)(...)
745 //
746 //--------------------------------------------------------------------------------------------
747 
748 //===> DON'T SUPPRESS: THESE METHODS ARE CALLED BY TEcnaGui and can be called by any other program
749 void TEcnaHistos::FileParameters(const TString& xArgAnaType, const Int_t& xArgNbOfSamples,
750  const Int_t& xArgRunNumber, const Int_t& xArgFirstReqEvtNumber,
751  const Int_t& xArgLastReqEvtNumber, const Int_t& xArgReqNbOfEvts,
752  const Int_t& xArgStexNumber)
753 {
754 // Set parameters for reading the right ECNA results file
755 
756  fFapAnaType = xArgAnaType;
757  fFapNbOfSamples = xArgNbOfSamples;
758  fFapRunNumber = xArgRunNumber;
759  fFapFirstReqEvtNumber = xArgFirstReqEvtNumber;
760  fFapLastReqEvtNumber = xArgLastReqEvtNumber;
761  fFapReqNbOfEvts = xArgReqNbOfEvts;
762  fFapStexNumber = xArgStexNumber;
763 
764  InitSpecParBeforeFileReading(); // SpecPar = Special Parameters (dates, times, run types)
765 }
766 
768 {
769 // Set parameters for reading the right ECNA results file
770 
771  InitSpecParBeforeFileReading(); // SpecPar = Special Parameters (dates, times, run types)
772 
773  //............... Filename parameter values
774  fFapAnaType = MyRootFile->GetAnalysisName();
775  fFapNbOfSamples = MyRootFile->GetNbOfSamples();
776  fFapRunNumber = MyRootFile->GetRunNumber();
777  fFapFirstReqEvtNumber = MyRootFile->GetFirstReqEvtNumber();
778  fFapLastReqEvtNumber = MyRootFile->GetLastReqEvtNumber();
779  fFapReqNbOfEvts = MyRootFile->GetReqNbOfEvts();
780  fFapStexNumber = MyRootFile->GetStexNumber();
781 
782  //............... parameter values from file contents
783  fStartDate = MyRootFile->GetStartDate();
784  fStopDate = MyRootFile->GetStopDate();
785  fRunType = MyRootFile->GetRunType();
786 
787  fFapNbOfEvts = MyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, fFapStexNumber);
788 }
789 
790 //=============================================================================================
791 // Set general title
792 // Set lin or log scale on X or Y axis
793 // Set color palette
794 // Set start and stop date
795 // Set run type
796 //=============================================================================================
797 //............................................................................................
798 void TEcnaHistos::GeneralTitle(const TString& title)
799 {
800  fFlagGeneralTitle = title.Data();
801 }
802 void TEcnaHistos::SetHistoScaleX(const TString& option_scale)
803 {
804  fFlagScaleX = "LIN";
805  if ( option_scale == "LOG" ){fFlagScaleX = "LOG";}
806 }
807 void TEcnaHistos::SetHistoScaleY(const TString& option_scale)
808 {
809  fFlagScaleY = "LIN";
810  if ( option_scale == "LOG" ){fFlagScaleY = "LOG";}
811 }
812 void TEcnaHistos::SetHistoColorPalette (const TString& option_palette)
813 {
814  fFlagColPal = "Black/Red/Blue";
815  if ( !(option_palette == "Rainbow" || option_palette == "rainbow") ){fFlagColPal = "Black/Red/Blue";}
816  if ( option_palette == "Rainbow" || option_palette == "rainbow" ){fFlagColPal = "Rainbow";}
817 }
818 void TEcnaHistos::StartStopDate(const TString& start_date, const TString& stop_date)
819 {
820  fStartDate = start_date.Data();
821  fStopDate = stop_date.Data();
822 }
823 void TEcnaHistos::RunType(const TString& run_type)
824 {
825  fRunType = run_type.Data();
826 }
827 void TEcnaHistos::NumberOfEvents(const Int_t& nb_of_evts)
828 {
829  fFapNbOfEvts = nb_of_evts;
830 }
831 //====================== return status for root file and data existence
832 Bool_t TEcnaHistos::StatusFileFound(){return fStatusFileFound;}
833 Bool_t TEcnaHistos::StatusDataExist(){return fStatusDataExist;}
834 
835 //=======================================================================================
836 //
837 // ( R e a d A n d ) P l o t (1D , 2D , History)
838 //
839 //=======================================================================================
840 //---------------------------------------------------------------------------------------------
841 // TechHistoCode list modification (06/10/09)
842 //
843 // D = Detector Plot ChNb = Channel Number
844 // ChDs = Channel Distribution (Y projection)
845 //
846 // H = History Plot Date = date in format YYMMJJ hhmmss
847 // RuDs = Run distribution
848 //
849 // old code new code std code X std code Y (std = standard)
850 //
851 // * 1 H1NbOfEvtsGlobal D_NOE_ChNb Xtal NOE NOE = Number Of Events
852 // * 2 H1NbOfEvtsProj D_NOE_ChDs NOE NOX NOX = Number Of Xtals
853 // * 3 H1EvEvGlobal D_Ped_ChNb Xtal Ped Ped = Pedestal
854 // * 4 H1EvEvProj D_Ped_ChDs Ped NOX
855 // * 5 H1EvSigGlobal D_TNo_ChNb Xtal TNo TNo = Total Noise
856 // * 6 H1EvSigProj D_TNo_ChDs TNo NOX
857 // * 7 H1SigEvGlobal D_LFN_ChNb Xtal LFN LFN = Low Frequency noise
858 // * 8 H1SigEvProj D_LFN_ChDs LFN NOX
859 // * 9 H1SigSigGlobal D_HFN_ChNb Xtal HFN HFN = High Frequency noise
860 // * 10 H1SigSigProj D_HFN_ChDs HFN NOX
861 // * 11 H1EvCorssGlobal D_MCs_ChNb Xtal MCs MCs = Mean correlations between samples
862 // * 12 H1EvCorssProj D_MCs_ChDs MCs NOX
863 // * 13 H1SigCorssGlobal D_SCs_ChNb Xtal SCs SCs = Sigma of the correlations between samples
864 // * 14 H1SigCorssProj D_SCs_ChDs SCs NOX
865 // * 15 Ev D_MSp_SpNb Sample MSp MSp = Means of the samples
866 // * 16 EvProj D_MSp_SpDs MSp NOS NOS = Number of samples
867 // * 17 Sigma D_SSp_SpNb Sample SSp SSp = Sigmas of the samples
868 // * 18 SigmaProj D_SSp_SpDs SSp NOS
869 // * 19 SampTime D_Adc_EvNb Event Adc Adc = ADC count as a function of Event number
870 // * 20 AdcProj D_Adc_EvDs Adc NOE EvDs = Event distribution
871 // * 21 EvolEvEv H_Ped_Date Time Ped Time = date YY/MM/DD hh:mm:ss
872 // * 22 EvolEvEvProj H_Ped_RuDs Ped NOR NOR = Number Of Runs
873 // * 23 EvolEvSig H_TNo_Date Time TNo
874 // * 24 EvolEvSigProj H_TNo_RuDs TNo NOR
875 // * 25 EvolSigEv H_LFN_Date Time LFN
876 // * 26 EvolSigEvProj H_LFN_RuDs LFN NOR
877 // * 27 EvolSigSig H_HFN_Date Time HFN
878 // * 28 EvolSigSigProj H_HFN_RuDs HFN NOR
879 // * 29 EvolEvCorss H_MCs_Date Time MCs
880 // * 30 EvolEvCorssProj H_MCs_RuDs MCs NOR
881 // * 31 EvolSigCorss H_SCs_Date Time SCs
882 // * 32 EvolSigCorssProj H_SCs_RuDs SCs NOR
883 //
884 //---------------------------------------------------------------------------------------------
885 
886 //---------------------------------------------------------------------------------------
887 //
888 // (ReadAnd)PlotMatrix
889 //
890 //---------------------------------------------------------------------------------------
891 //................................ Corcc[for 1 Stex] (big matrix), Cortt[for 1 Stex]
892 void TEcnaHistos::PlotMatrix(const TMatrixD& read_matrix_corcc,
893  const TString& UserCorOrCov, const TString& UserBetweenWhat)
894 {PlotMatrix(read_matrix_corcc, UserCorOrCov, UserBetweenWhat, "");}
895 
896 void TEcnaHistos::PlotMatrix(const TMatrixD& read_matrix_corcc,
897  const TString& UserCorOrCov, const TString& UserBetweenWhat,
898  const TString& UserPlotOption)
899 {
900  TString CallingMethod = "2D";
901 
902  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
903 
904  TString BetweenWhat = fCnaParHistos->BuildStandardBetweenWhatCode(CallingMethod, UserBetweenWhat);
905  TString CorOrCov = fCnaParHistos->BuildStandardCovOrCorCode(CallingMethod, UserCorOrCov);
906 
907  if( BetweenWhat != "?" && CorOrCov != "?" )
908  {
909  if( BetweenWhat == "MttLF" || BetweenWhat == "MttHF" )
910  {
911  fAlreadyRead = 1;
912  ViewMatrix(read_matrix_corcc, fAlreadyRead,
913  fZerv, fZerv, fZerv, CorOrCov, BetweenWhat, StandardPlotOption);
914  }
915  if( BetweenWhat == "MccLF" ){StexHocoVecoLHFCorcc("LF");} // forced to Read file and Plot
916  if( BetweenWhat == "MccHF" ){StexHocoVecoLHFCorcc("HF");} // forced to Read file and Plot
917  }
918  else
919  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
920  cout << "!TEcnaHistos::PlotMatrix(...)> Histo cannot be reached." << fTTBELL << endl;}
921 }
922 
923 void TEcnaHistos::PlotMatrix(const TString& UserCorOrCov, const TString& UserBetweenWhat)
924 {PlotMatrix(UserCorOrCov, UserBetweenWhat, "");}
925 
926 void TEcnaHistos::PlotMatrix(const TString& UserCorOrCov, const TString& UserBetweenWhat,
927  const TString& UserPlotOption)
928 {
929  TString CallingMethod = "2D";
930 
931  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
932 
933  TString BetweenWhat = fCnaParHistos->BuildStandardBetweenWhatCode(CallingMethod, UserBetweenWhat);
934  TString CorOrCov = fCnaParHistos->BuildStandardCovOrCorCode(CallingMethod, UserCorOrCov);
935 
936  if( BetweenWhat != "?" && CorOrCov != "?" )
937  {
938  if( BetweenWhat == "MttLF" || BetweenWhat == "MttHF" )
939  {
940  ViewMatrix(fReadMatrixDummy, fTobeRead,
941  fZerv, fZerv, fZerv, CorOrCov, BetweenWhat, StandardPlotOption);
942  }
943  if( BetweenWhat == "MccLF" ){StexHocoVecoLHFCorcc("LF");} // Plot only
944  if( BetweenWhat == "MccHF" ){StexHocoVecoLHFCorcc("HF");} // Plot only
945  }
946  else
947  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
948  cout << "!TEcnaHistos::PlotMatrix(...)> Histo cannot be reached." << fTTBELL << endl;}
949 }
950 
951 //....................................... Corcc for channels (cStexStin_A, cStexStin_B)
952 // Corss, Covss for one channel (-> i0StinEcha)
953 void TEcnaHistos::PlotMatrix(const TMatrixD& read_matrix,
954  const TString& UserCorOrCov, const TString& UserBetweenWhat,
955  const Int_t& arg_n1, const Int_t& arg_n2)
956 {PlotMatrix(read_matrix, UserCorOrCov, UserBetweenWhat, arg_n1, arg_n2, "");}
957 
958 void TEcnaHistos::PlotMatrix(const TMatrixD& read_matrix,
959  const TString& UserCorOrCov, const TString& UserBetweenWhat,
960  const Int_t& arg_n1, const Int_t& arg_n2,
961  const TString& UserPlotOption)
962 {
963  TString CallingMethod = "2D";
964 
965  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
966 
967  TString BetweenWhat = fCnaParHistos->BuildStandardBetweenWhatCode(CallingMethod, UserBetweenWhat);
968  TString CorOrCov = fCnaParHistos->BuildStandardCovOrCorCode(CallingMethod, UserCorOrCov);
969 
970  if( BetweenWhat != "?" && CorOrCov != "?" )
971  {
972  if( BetweenWhat == "MccLF" || BetweenWhat == "MccHF" )
973  {
974  Int_t cStexStin_A = arg_n1;
975  Int_t cStexStin_B = arg_n2;
976  fAlreadyRead = 1;
977  ViewMatrix(read_matrix, fAlreadyRead,
978  cStexStin_A, cStexStin_B, fZerv, CorOrCov, BetweenWhat, StandardPlotOption);
979  }
980 
981  if( BetweenWhat == "Mss" )
982  {
983  Int_t n1StexStin = arg_n1;
984  Int_t i0StinEcha = arg_n2;
985  if( fFlagSubDet == "EE" ){n1StexStin = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, arg_n1);}
986  fAlreadyRead = 1;
987  ViewMatrix(read_matrix, fAlreadyRead,
988  n1StexStin, fZerv, i0StinEcha, CorOrCov, BetweenWhat, StandardPlotOption);
989  }
990  }
991  else
992  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
993  cout << "!TEcnaHistos::PlotMatrix(...)> Histo cannot be reached." << fTTBELL << endl;}
994 }
995 
996 void TEcnaHistos::PlotMatrix(const TString& UserCorOrCov, const TString& UserBetweenWhat,
997  const Int_t& arg_n1, const Int_t& arg_n2)
998 {PlotMatrix(UserCorOrCov, UserBetweenWhat, arg_n1, arg_n2, "");}
999 
1000 void TEcnaHistos::PlotMatrix(const TString& UserCorOrCov, const TString& UserBetweenWhat,
1001  const Int_t& arg_n1, const Int_t& arg_n2,
1002  const TString& UserPlotOption)
1003 {
1004  TString CallingMethod = "2D";
1005 
1006  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1007 
1008  TString StandardBetweenWhat = fCnaParHistos->BuildStandardBetweenWhatCode(CallingMethod, UserBetweenWhat);
1009  TString StandardCorOrCov = fCnaParHistos->BuildStandardCovOrCorCode(CallingMethod, UserCorOrCov);
1010 
1011  if( StandardBetweenWhat != "?" && StandardCorOrCov != "?" )
1012  {
1013  if( StandardBetweenWhat == "MccLF" || StandardBetweenWhat == "MccHF" )
1014  {
1015  Int_t cStexStin_A = arg_n1;
1016  Int_t cStexStin_B = arg_n2;
1017  ViewMatrix(fReadMatrixDummy, fTobeRead,
1018  cStexStin_A, cStexStin_B, fZerv, StandardCorOrCov, StandardBetweenWhat, StandardPlotOption);
1019  }
1020 
1021  if( StandardBetweenWhat == "Mss" )
1022  {
1023  Int_t n1StexStin = arg_n1;
1024  Int_t i0StinEcha = arg_n2;
1025  if( fFlagSubDet == "EE" ){n1StexStin = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, arg_n1);}
1026 
1027  ViewMatrix(fReadMatrixDummy, fTobeRead,
1028  n1StexStin, fZerv, i0StinEcha, StandardCorOrCov, StandardBetweenWhat, StandardPlotOption);
1029  }
1030  }
1031  else
1032  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1033  cout << "!TEcnaHistos::PlotMatrix(...)> Histo cannot be reached." << fTTBELL << endl;}
1034 }
1035 
1036 //---------------------------------------------------------------------------------------
1037 //
1038 // (ReadAnd)PlotDetector
1039 //
1040 //---------------------------------------------------------------------------------------
1041 //.................................... 2D plots for Stex OR Stas
1042 void TEcnaHistos::PlotDetector(const TString& UserHistoCode, const TString& UserDetector)
1043 {
1044  TString CallingMethod = "2DS";
1045 
1046  TString StandardHistoCode = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, UserHistoCode);
1047  if( StandardHistoCode != "?" )
1048  {
1049  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(StandardHistoCode);
1050  TString StandardDetectorCode = fCnaParHistos->BuildStandardDetectorCode(UserDetector);
1051  if( StandardDetectorCode != "?" )
1052  {
1053  //if( StandardDetectorCode == "SM" || StandardDetectorCode == "EB" )
1054  // {fEcal->SetEcalSubDetector("EB");}
1055  //if( StandardDetectorCode == "Dee" || StandardDetectorCode == "EE" )
1056  // {fEcal->SetEcalSubDetector("EE");}
1057 
1058  if( StandardDetectorCode == "SM" || StandardDetectorCode == "Dee" )
1059  {ViewStex(fReadHistoDummy, fTobeRead, TechHistoCode);}
1060  if( StandardDetectorCode == "EB" || StandardDetectorCode == "EE" )
1061  {ViewStas(fReadHistoDummy, fTobeRead, TechHistoCode);}
1062  }
1063  else
1064  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1065  cout << "!TEcnaHistos::PlotDetector(...)> Histo cannot be reached." << fTTBELL << endl;}
1066  }
1067  else
1068  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1069  cout << "!TEcnaHistos::PlotDetector(...)> Histo cannot be reached." << fTTBELL << endl;}
1070 }
1071 
1072 void TEcnaHistos::PlotDetector(const TVectorD& read_histo, const TString& UserHistoCode, const TString& UserDetector)
1073 {
1074  TString CallingMethod = "2DS";
1075 
1076  TString StandardHistoCode = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, UserHistoCode);
1077  if( StandardHistoCode != "?" )
1078  {
1079  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(StandardHistoCode);
1080  TString StandardDetectorCode = fCnaParHistos->BuildStandardDetectorCode(UserDetector);
1081  if( StandardDetectorCode != "?" )
1082  {
1083  fAlreadyRead = 1;
1084 
1085  //if( StandardDetectorCode == "SM" || StandardDetectorCode == "EB" )
1086  // {fEcal->SetEcalSubDetector("EB");}
1087  //if( StandardDetectorCode == "Dee" || StandardDetectorCode == "EE" )
1088  // {fEcal->SetEcalSubDetector("EE");}
1089 
1090  if( StandardDetectorCode == "SM" || StandardDetectorCode == "Dee" )
1091  {ViewStex(read_histo, fAlreadyRead, TechHistoCode);}
1092  if( StandardDetectorCode == "EB" || StandardDetectorCode == "EE" )
1093  {ViewStas(read_histo, fAlreadyRead, TechHistoCode);}
1094  }
1095  else
1096  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1097  cout << "!TEcnaHistos::PlotDetector(...)> Histo cannot be reached." << fTTBELL << endl;}
1098  }
1099  else
1100  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1101  cout << "!TEcnaHistos::PlotDetector(...)> Histo cannot be reached." << fTTBELL << endl;}
1102 }
1103 
1104 //---------------------------------------------------------------------------------------
1105 //
1106 // (ReadAnd)Plot1DHisto
1107 //
1108 //---------------------------------------------------------------------------------------
1109 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1110  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1111  const TString& UserDetector)
1112 {Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, UserDetector, "");}
1113 
1114 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1115  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1116  const TString& UserDetector,
1117  const TString& UserPlotOption)
1118 {
1119  TString CallingMethod = "1D";
1120 
1121  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1122 
1123  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1124  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1125 
1126  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1127  {
1128  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1129  if( fAlreadyRead > 1 ){fAlreadyRead = 1;}
1130  TString StandardDetectorCode = fCnaParHistos->BuildStandardDetectorCode(UserDetector);
1131  if( StandardDetectorCode != "?" )
1132  {
1133  if( StandardDetectorCode == "EB" || StandardDetectorCode == "EE" ){fFapStexNumber = 0;}
1134  ViewHisto(InputHisto, fAlreadyRead, fZerv, fZerv, fZerv, TechHistoCode, StandardPlotOption);
1135  }
1136  else
1137  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1138  cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << endl;}
1139  }
1140  else
1141  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1142  cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << endl;}
1143 }
1144 
1145 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1146  const TString& UserDetector)
1147 {Plot1DHisto(User_X_Quantity, User_Y_Quantity, UserDetector, "");}
1148 
1149 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1150  const TString& UserDetector, const TString& UserPlotOption)
1151 {
1152  TString CallingMethod = "1D";
1153 
1154  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1155 
1156  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1157  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1158 
1159  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1160  {
1161  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1162  TString StandardDetectorCode = fCnaParHistos->BuildStandardDetectorCode(UserDetector);
1163  if( StandardDetectorCode != "?" )
1164  {
1165  if( StandardDetectorCode == "EB" || StandardDetectorCode == "EE" ){fFapStexNumber = 0;}
1166  ViewHisto(fReadHistoDummy, fTobeRead, fZerv, fZerv, fZerv, TechHistoCode, StandardPlotOption);
1167  }
1168  else
1169  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1170  cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << endl;}
1171  }
1172  else
1173  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1174  cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << endl;}
1175 }
1176 
1177 
1178 
1179 //=> BUG SCRAM? Si on enleve la methode ci-dessous, ca passe a la compilation de test/EcnaHistosExample2.cc
1180 // (qui appelle cette methode) et ca se plante a l'execution (voir test/TEcnaHistosExample2.cc).
1181 #define PLUD
1182 #ifdef PLUD
1183 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1184  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1185  const Int_t& n1StexStin)
1186 {Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, n1StexStin, "");}
1187 
1188 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1189  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1190  const Int_t& n1StexStin,
1191  const TString& UserPlotOption)
1192 {
1193  TString CallingMethod = "1DX";
1194  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1195  Int_t i0StinEcha = 0;
1196  Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, StandardPlotOption);
1197 }
1198 #endif // PLUD
1199 
1200 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1201  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1202  const Int_t& n1StexStin, const Int_t& i0StinEcha)
1203 {Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, "");}
1204 
1205 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1206  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1207  const Int_t& n1StexStin, const Int_t& i0StinEcha,
1208  const TString& UserPlotOption)
1209 {
1210  TString CallingMethod = "1D";
1211  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1212  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1213  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1214 
1215  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1216 
1217  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1218  {
1219  fAlreadyRead = 1;
1220  if( StandardPlotOption != fAllXtalsInStinPlot )
1221  {
1222  ViewHisto(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, fZerv, TechHistoCode, StandardPlotOption);
1223  }
1224 
1225  if( StandardPlotOption == fAllXtalsInStinPlot && fAlreadyRead >= 1 && fAlreadyRead <= fEcal->MaxCrysInStin() )
1226  {
1227  if( Standard_X_Quantity == "Smp" && Standard_Y_Quantity == "MSp" )
1228  {XtalSamplesEv(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1229  if( Standard_X_Quantity == "MSp" && Standard_Y_Quantity == "NOS" )
1230  {EvSamplesXtals(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1231  if( Standard_X_Quantity == "Smp" && Standard_Y_Quantity == "SSp" )
1232  {XtalSamplesSigma(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1233  if( Standard_X_Quantity == "SSp" && Standard_Y_Quantity == "NOS" )
1234  {SigmaSamplesXtals(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1235  }
1236  }
1237  else
1238  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1239  cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << endl;}
1240 }
1241 
1242 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1243  const Int_t& n1StexStin, const Int_t& i0StinEcha)
1244 {Plot1DHisto(User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, "");}
1245 
1246 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1247  const Int_t& n1StexStin, const Int_t& i0StinEcha,
1248  const TString& UserPlotOption)
1249 {
1250  TString CallingMethod = "1D";
1251 
1252  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1253 
1254  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1255  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1256 
1257  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1258  {
1259  if( StandardPlotOption != fAllXtalsInStinPlot )
1260  {
1261  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1262  ViewHisto(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, fZerv, TechHistoCode, StandardPlotOption);
1263  }
1264  if( StandardPlotOption == fAllXtalsInStinPlot && fAlreadyRead >= 1 && fAlreadyRead <= fEcal->MaxCrysInStin() )
1265  {
1266  if( Standard_X_Quantity == "Smp" && Standard_Y_Quantity == "MSp" )
1267  {XtalSamplesEv(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1268  if( Standard_X_Quantity == "MSp" && Standard_Y_Quantity == "NOS" )
1269  {EvSamplesXtals(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1270  if( Standard_X_Quantity == "Smp" && Standard_Y_Quantity == "SSp" )
1271  {XtalSamplesSigma(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1272  if( Standard_X_Quantity == "SSp" && Standard_Y_Quantity == "NOS" )
1273  {SigmaSamplesXtals(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, StandardPlotOption);}
1274  }
1275  }
1276  else
1277  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1278  cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << endl;}
1279 }
1280 
1281 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1282  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1283  const Int_t& n1StexStin, const Int_t& i0StinEcha, const Int_t& n1Sample)
1284 {Plot1DHisto(InputHisto, User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, n1Sample, "");}
1285 
1286 void TEcnaHistos::Plot1DHisto(const TVectorD& InputHisto,
1287  const TString& User_X_Quantity, const TString& User_Y_Quantity,
1288  const Int_t& n1StexStin, const Int_t& i0StinEcha, const Int_t& n1Sample,
1289  const TString& UserPlotOption)
1290 {
1291  TString CallingMethod = "1D";
1292 
1293  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1294 
1295  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1296  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1297 
1298  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1299 
1300  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1301  {
1302  Int_t i0Sample = n1Sample-1;
1303  fAlreadyRead = 1;
1304  ViewHisto(InputHisto, fAlreadyRead, n1StexStin, i0StinEcha, i0Sample, TechHistoCode, StandardPlotOption);
1305  }
1306  else
1307  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1308  cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << endl;}
1309 }
1310 
1311 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1312  const Int_t& n1StexStin, const Int_t& i0StinEcha, const Int_t& n1Sample)
1313 {Plot1DHisto(User_X_Quantity, User_Y_Quantity, n1StexStin, i0StinEcha, n1Sample, "");}
1314 
1315 void TEcnaHistos::Plot1DHisto(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1316  const Int_t& n1StexStin, const Int_t& i0StinEcha, const Int_t& n1Sample,
1317  const TString& UserPlotOption)
1318 {
1319  TString CallingMethod = "1D";
1320 
1321  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1322 
1323  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1324  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1325 
1326  Int_t i0Sample = n1Sample-1;
1327 
1328  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1329  {
1330  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1331  ViewHisto(fReadHistoDummy, fTobeRead, n1StexStin, i0StinEcha, i0Sample, TechHistoCode, StandardPlotOption);
1332  }
1333  else
1334  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1335  cout << "!TEcnaHistos::Plot1DHisto(...)> Histo cannot be reached." << fTTBELL << endl;}
1336 }
1337 
1338 //---------------------------------------------------------------------------------------
1339 //
1340 // (ReadAnd)PlotHistory
1341 //
1342 //---------------------------------------------------------------------------------------
1343 void TEcnaHistos::PlotHistory(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1344  const TString& list_of_run_file_name,
1345  const Int_t& StexStin_A, const Int_t& i0StinEcha)
1346 {PlotHistory(User_X_Quantity, User_Y_Quantity, list_of_run_file_name, StexStin_A, i0StinEcha, "");}
1347 
1348 void TEcnaHistos::PlotHistory(const TString& User_X_Quantity, const TString& User_Y_Quantity,
1349  const TString& list_of_run_file_name,
1350  const Int_t& StexStin_A, const Int_t& i0StinEcha,
1351  const TString& UserPlotOption)
1352 {
1353  TString CallingMethod = "Time";
1354 
1355  TString StandardPlotOption = fCnaParHistos->BuildStandardPlotOption(CallingMethod, UserPlotOption);
1356 
1357  TString Standard_X_Quantity = fCnaParHistos->BuildStandard1DHistoCodeX(CallingMethod, User_X_Quantity);
1358  TString Standard_Y_Quantity = fCnaParHistos->BuildStandard1DHistoCodeY(CallingMethod, User_Y_Quantity);
1359 
1360  if( Standard_X_Quantity != "?" && Standard_Y_Quantity != "?" )
1361  {
1362  TString TechHistoCode = fCnaParHistos->GetTechHistoCode(Standard_X_Quantity, Standard_Y_Quantity);
1363  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, TechHistoCode, StandardPlotOption);
1364  }
1365  else
1366  {fFlagUserHistoMin = "OFF"; fFlagUserHistoMax = "OFF";
1367  cout << "!TEcnaHistos::PlotHistory(...)> Histo cannot be reached." << fTTBELL << endl;}
1368 }
1369 
1370 //=============================================================================================
1371 //
1372 // " V I E W " M E T H O D S
1373 //
1374 //=============================================================================================
1375 
1376 //=============================================================================================================
1377 //
1378 // ViewMatrix(***)
1379 //
1380 // arg_read_matrix: 2D array
1381 // arg_AlreadyRead: =1 <=> use arg_read_matrix
1382 // =0 <=> read the 2D array in this method with TEcnaRead
1383 // StexStin_A: tower number in SM (if EB) OR SC "ECNA" number in Dee (if EE)
1384 // StexStin_B: tower' number in SM (if EB) OR SC' "ECNA" number in Dee (if EE)
1385 // MatrixBinIndex: channel number in tower (if EB) OR in SC (if EE)
1386 // CorOrCov: flag CORRELATION/COVARIANCE
1387 // BetweenWhat: flag BETWEEN SAMPLES / BETWEEN CHANNELS / BETWEEN TOWERS / BETWEEN SCs / LF, HF, ...
1388 // PlotOption: ROOT 2D histos draw options (COLZ, LEGO, ...) + additional (ASCII)
1389 //
1390 // MatrixBinIndex: = i0StinEcha if cov(s,s'), cor(s,s')
1391 // = 0 if cov(c,c'), cor(c,c'), cov(Stin,Stin'), cor(Stin,Stin')
1392 //
1393 // ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, CorOrCov, BetweenWhat, PlotOption)
1394 // ViewMatrix(StexStin_A, 0, i0StinEcha, CorOrCov, "Mss", PlotOption)
1395 // Output:
1396 // Plot of cov(s,s') or cor(s,s') matrix for i0StinEcha of StexStin_A
1397 //
1398 // ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, CorOrCov, BetweenWhat, PlotOption)
1399 // ViewMatrix(StexStin_A, StexStin_B, 0, CorOrCov, "Mcc", PlotOption)
1400 // Output:
1401 // Plot LF-HF Corcc matrix for Stins: (StexStin_A, StexStin_B)
1402 //
1403 // ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, CorOrCov, BetweenWhat, PlotOption)
1404 // ViewMatrix( 0, 0, 0, CorOrCov, "Mcc", PlotOption)
1405 // Output:
1406 // Plot of LF-HF Corcc matrix for Stex (big matrix)
1407 //
1408 // ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, CorOrCov, BetweenWhat, PlotOption)
1409 // ViewMatrix( 0, 0, 0, CorOrCov, "Mtt", PlotOption)
1410 // Output:
1411 // Plot of LF-HF Cortt matrix
1412 //
1413 //=============================================================================================================
1414 void TEcnaHistos::ViewMatrix(const TMatrixD& arg_read_matrix, const Int_t& arg_AlreadyRead,
1415  const Int_t& StexStin_A, const Int_t& StexStin_B,
1416  const Int_t& MatrixBinIndex, const TString& CorOrCov,
1417  const TString& BetweenWhat, const TString& PlotOption)
1418 {
1419  //Plot correlation or covariance matrix between samples or channels or Stins
1420 
1421  if( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) )
1422  {
1423  Bool_t OKArray = kFALSE;
1424  Bool_t OKData = kFALSE;
1425  TVectorD vStin(fEcal->MaxStinEcnaInStex());
1426 
1427  if( arg_AlreadyRead == fTobeRead )
1428  {
1429  fMyRootFile->PrintNoComment();
1430  fMyRootFile->FileParameters(fFapAnaType, fFapNbOfSamples,
1431  fFapRunNumber, fFapFirstReqEvtNumber,
1432  fFapLastReqEvtNumber, fFapReqNbOfEvts,
1433  fFapStexNumber, fCfgResultsRootFilePath.Data());
1434  OKArray = fMyRootFile->LookAtRootFile();
1435  if( OKArray == kTRUE )
1436  {
1437  fFapNbOfEvts = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, fFapStexNumber);
1438  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
1439  // cout << "*TEcnaHistos::ViewMatrix(...)> Data are analyzed from file ----> "
1440  // << fp_name_short << endl;
1441  //...................................................................... (ViewMatrix)
1442  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vStin(i)=(Double_t)0.;}
1443  vStin = fMyRootFile->ReadStinNumbers(fEcal->MaxStinEcnaInStex());
1444 
1445  fStartDate = fMyRootFile->GetStartDate();
1446  fStopDate = fMyRootFile->GetStopDate();
1447  fRunType = fMyRootFile->GetRunType();
1448 
1449  if( fMyRootFile->DataExist() == kTRUE ){OKData = kTRUE;}
1450  }
1451 
1452  }
1453  if( arg_AlreadyRead >= 1 )
1454  {
1455  OKArray = kTRUE;
1456  OKData = kTRUE;
1457  if( fFlagSubDet == "EB")
1458  {
1459  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vStin(i)=i;}
1460  }
1461  if( fFlagSubDet == "EE")
1462  {
1463  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++)
1464  {vStin(i)= fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i));}
1465  }
1466  }
1467 
1468  if ( OKArray == kTRUE ) // (ViewMatrix)
1469  {
1470  fStatusFileFound = kTRUE;
1471 
1472  if( OKData == kTRUE )
1473  {
1474  fStatusDataExist = kTRUE;
1475 
1476  Int_t Stin_X_ok = 0;
1477  Int_t Stin_Y_ok = 0;
1478 
1479  if( (BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins) )
1480  {Stin_X_ok = 1; Stin_Y_ok = 1;}
1481  if( BetweenWhat == fBetweenSamples )
1482  {Stin_Y_ok = 1;}
1483 
1484  for (Int_t index_Stin = 0; index_Stin < fEcal->MaxStinEcnaInStex(); index_Stin++)
1485  {
1486  if ( vStin(index_Stin) == StexStin_A ){Stin_X_ok = 1;}
1487  if ( vStin(index_Stin) == StexStin_B ){Stin_Y_ok = 1;}
1488  }
1489  //................................................................. (ViewMatrix)
1490  if( Stin_X_ok == 1 && Stin_Y_ok == 1 )
1491  {
1492  Int_t MatSize = -1;
1493  Int_t ReadMatSize = -1;
1494  Int_t i0StinEcha = -1;
1495 
1496  //-------------------------- Set values of ReadMatSize, MatSize, i0StinEcha
1497  if( BetweenWhat == fBetweenSamples )
1498  {ReadMatSize = fFapNbOfSamples; MatSize = fEcal->MaxSampADC(); i0StinEcha=(Int_t)MatrixBinIndex;}
1499 
1500  if( BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels )
1501  {ReadMatSize = fEcal->MaxCrysInStin(); MatSize = fEcal->MaxCrysInStin(); /*i0Sample=MatrixBinIndex;*/}
1502 
1503  if( (BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins) )
1504  {ReadMatSize = fEcal->MaxStinEcnaInStex(); MatSize = fEcal->MaxStinInStex();}
1505 
1506  //------------------------------------------------------------------------------------- (ViewMatrix)
1507  if( ( BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins ) ||
1508  ( BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels
1509  /* && (i0Sample >= 0) && (i0Sample < fFapNbOfSamples ) */ ) ||
1510  ( (BetweenWhat == fBetweenSamples) && (i0StinEcha >= 0) && (i0StinEcha < fEcal->MaxCrysInStin()) ) )
1511  {
1512  TMatrixD read_matrix(ReadMatSize, ReadMatSize);
1513  for(Int_t i=0; i-ReadMatSize<0; i++)
1514  {for(Int_t j=0; j-ReadMatSize<0; j++){read_matrix(i,j)=(Double_t)0.;}}
1515 
1516  Bool_t OKData = kFALSE;
1517  if( arg_AlreadyRead == fTobeRead )
1518  {
1519  if( BetweenWhat == fBetweenSamples && CorOrCov == fCovarianceMatrix )
1520  {read_matrix =
1521  fMyRootFile->ReadCovariancesBetweenSamples(StexStin_A, i0StinEcha, ReadMatSize);}
1522 
1523  if( BetweenWhat == fBetweenSamples && CorOrCov == fCorrelationMatrix )
1524  {read_matrix =
1525  fMyRootFile->ReadCorrelationsBetweenSamples(StexStin_A, i0StinEcha, ReadMatSize);}
1526 
1527  if( BetweenWhat == fLFBetweenChannels && CorOrCov == fCovarianceMatrix )
1528  {read_matrix =
1529  fMyRootFile->ReadLowFrequencyCovariancesBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);}
1530 
1531  if( BetweenWhat == fLFBetweenChannels && CorOrCov == fCorrelationMatrix )
1532  {read_matrix =
1533  fMyRootFile->ReadLowFrequencyCorrelationsBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);}
1534 
1535  if( BetweenWhat == fHFBetweenChannels && CorOrCov == fCovarianceMatrix )
1536  {read_matrix =
1537  fMyRootFile->ReadHighFrequencyCovariancesBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);}
1538 
1539  if( BetweenWhat == fHFBetweenChannels && CorOrCov == fCorrelationMatrix )
1540  {read_matrix =
1541  fMyRootFile->ReadHighFrequencyCorrelationsBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);}
1542 
1543  if( BetweenWhat == fLFBetweenStins && CorOrCov == fCorrelationMatrix )
1544  {read_matrix =
1545  fMyRootFile->ReadLowFrequencyMeanCorrelationsBetweenStins(ReadMatSize);}
1546 
1547  if( BetweenWhat == fHFBetweenStins && CorOrCov == fCorrelationMatrix )
1548  {read_matrix =
1549  fMyRootFile->ReadHighFrequencyMeanCorrelationsBetweenStins(ReadMatSize);
1550  }
1551 
1552  OKData = fMyRootFile->DataExist();
1553  }
1554  else
1555  {
1556  read_matrix = arg_read_matrix;
1557  OKData = kTRUE;
1558  }
1559  //.......................................................... (ViewMatrix)
1560  if( OKData == kTRUE )
1561  {
1562  fStatusDataExist = kTRUE;
1563 
1564  if( PlotOption == "ASCII" )
1565  {
1566  WriteMatrixAscii(BetweenWhat, CorOrCov,
1567  StexStin_A, MatrixBinIndex, ReadMatSize, read_matrix);
1568  }
1569  else
1570  {
1571  //......................... matrix title (ViewMatrix)
1572  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
1573 
1574  if( BetweenWhat == fBetweenSamples && CorOrCov == fCovarianceMatrix )
1575  {sprintf(f_in_mat_tit, "Covariance(Sample, Sample')");}
1576  if( BetweenWhat == fBetweenSamples && CorOrCov == fCorrelationMatrix )
1577  {sprintf(f_in_mat_tit, "Correlation(Sample, Sample')");}
1578 
1579  if(fFlagSubDet == "EB" )
1580  {
1581  if( BetweenWhat == fLFBetweenStins && CorOrCov == fCorrelationMatrix )
1582  {sprintf(f_in_mat_tit,
1583  "Mean LF |Cor(Xtal,Xtal')| for each (Tower,Tower')");}
1584  if( BetweenWhat == fHFBetweenStins && CorOrCov == fCorrelationMatrix )
1585  {sprintf(f_in_mat_tit,
1586  "Mean HF |Cor(Xtal,Xtal')| for each (Tower,Tower')");}
1587  }
1588  if(fFlagSubDet == "EE" )
1589  {
1590  if( BetweenWhat == fLFBetweenStins && CorOrCov == fCorrelationMatrix )
1591  {sprintf(f_in_mat_tit,
1592  "Mean LF |Cor(Xtal,Xtal')| for each (SC,SC')");}
1593  if( BetweenWhat == fHFBetweenStins && CorOrCov == fCorrelationMatrix )
1594  {sprintf(f_in_mat_tit,
1595  "Mean HF |Cor(Xtal,Xtal')| for each (SC,SC')");}
1596  }
1597 
1598  if( BetweenWhat == fLFBetweenChannels && CorOrCov == fCorrelationMatrix )
1599  {
1600  if( fFlagSubDet == "EB" )
1601  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') matrix elts for (Tow,Tow')");}
1602  if( fFlagSubDet == "EE" )
1603  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') matrix elts for (SC,SC')");}
1604  }
1605  if( BetweenWhat == fHFBetweenChannels && CorOrCov == fCorrelationMatrix )
1606  {
1607  if( fFlagSubDet == "EB" )
1608  {sprintf(f_in_mat_tit, "HF Cor(Xtal,Xtal') matrix elts for (Tow,Tow')");}
1609  if( fFlagSubDet == "EE" )
1610  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') matrix elts for (SC,SC')");}
1611  }
1612 
1613  //................................. Axis parameters (ViewMatrix)
1614  TString axis_x_var_name;
1615  TString axis_y_var_name;
1616 
1617  char* f_in_axis_x = new char[fgMaxCar]; fCnew++;
1618  char* f_in_axis_y = new char[fgMaxCar]; fCnew++;
1619 
1620  if( BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins )
1621  {
1622  if( fFlagSubDet == "EB" )
1623  {sprintf(f_in_axis_x, " %s number ", fFapStinName.Data());}
1624  if( fFlagSubDet == "EE" )
1625  {sprintf(f_in_axis_x, " %s number for construction ", fFapStinName.Data());}
1626 
1627  axis_x_var_name = f_in_axis_x; axis_y_var_name = f_in_axis_x;
1628  }
1629  if( BetweenWhat == fBetweenSamples)
1630  {
1631  axis_x_var_name = " Sample "; axis_y_var_name = " Sample ";
1632  }
1633  if( BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels ){
1634  sprintf(f_in_axis_x, " Crystal %s %d ", fFapStinName.Data(), StexStin_A);
1635  sprintf(f_in_axis_y, " Crystal %s %d ", fFapStinName.Data(),StexStin_B);
1636  axis_x_var_name = f_in_axis_x; axis_y_var_name = f_in_axis_y;}
1637 
1638  Int_t nb_binx = MatSize;
1639  Int_t nb_biny = MatSize;
1640  Axis_t xinf_bid = (Axis_t)0.;
1641  Axis_t xsup_bid = (Axis_t)MatSize;
1642  Axis_t yinf_bid = (Axis_t)0.;
1643  Axis_t ysup_bid = (Axis_t)MatSize;
1644 
1645  if( (fFlagSubDet == "EE") &&
1646  (BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins) )
1647  {
1648  if( fFapStexNumber == 1 || fFapStexNumber == 3 )
1649  {
1650  xinf_bid += fEcal->MaxStinInStex();
1651  xsup_bid += fEcal->MaxStinInStex();
1652  yinf_bid += fEcal->MaxStinInStex();
1653  ysup_bid += fEcal->MaxStinInStex();
1654  }
1655  }
1656  //................................................... histogram booking (ViewMatrix)
1657  TH2D* h_fbid0 = new TH2D("bidim", f_in_mat_tit,
1658  nb_binx, xinf_bid, xsup_bid,
1659  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
1660  h_fbid0->Reset();
1661 
1662  h_fbid0->GetXaxis()->SetTitle(axis_x_var_name);
1663  h_fbid0->GetYaxis()->SetTitle(axis_y_var_name);
1664 
1665  //------------------------------------------------ F I L L H I S T O (ViewMatrix)
1666  if( (fFlagSubDet == "EE") &&
1667  (BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins) )
1668  {
1669  for(Int_t i = 0 ; i < ReadMatSize ; i++)
1670  {
1671  for(Int_t j = 0 ; j < ReadMatSize ; j++)
1672  {
1673  Int_t ip = i+1;
1674  Double_t xi_bid =
1675  (Double_t)fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, ip);
1676  Int_t jp = j+1;
1677  Double_t xj_bid =
1678  (Double_t)fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, jp);
1679  if( xi_bid > 0 && xj_bid > 0 )
1680  {
1681  Int_t xi_bid_m = xi_bid-1;
1682  Int_t xj_bid_m = xj_bid-1;
1683  h_fbid0->Fill(xi_bid_m, xj_bid_m, read_matrix(i,j));
1684  }
1685  }
1686  }
1687  }
1688  else
1689  {
1690  for(Int_t i = 0 ; i - ReadMatSize < 0 ; i++)
1691  {
1692  Double_t xi = (Double_t)i;
1693  for(Int_t j = 0 ; j < ReadMatSize ; j++)
1694  {
1695  Double_t xj = (Double_t)j;
1696  Double_t mat_val = (Double_t)read_matrix(i,j);
1697  h_fbid0->Fill(xi, xj, (Double_t)mat_val);
1698  }
1699  }
1700  }
1701  //--------------- H I S T O M I N / M A X M A N A G E M E N T (ViewMatrix)
1702 
1703  //................................ Put histo min max values
1704  TString quantity_code = "D_MCs_ChNb";
1705  if ( CorOrCov == fCorrelationMatrix )
1706  {
1707  if( BetweenWhat == fBetweenSamples ){quantity_code = "D_MCs_ChNb";}
1708 
1709  if( BetweenWhat == fLFBetweenChannels ){quantity_code = "H2LFccMosMatrix";}
1710  if( BetweenWhat == fHFBetweenChannels ){quantity_code = "H2HFccMosMatrix";}
1711 
1712  if( BetweenWhat == fLFBetweenStins ){quantity_code = "H2LFccMosMatrix";}
1713  if( BetweenWhat == fHFBetweenStins ){quantity_code = "H2HFccMosMatrix";}
1714  }
1715  if( CorOrCov == fCovarianceMatrix ){quantity_code = "H2HFccMosMatrix";}
1716  //.......... default if flag not set to "ON"
1717  SetYminMemoFromValue(quantity_code, fCnaParHistos->GetYminDefaultValue(quantity_code));
1718  SetYmaxMemoFromValue(quantity_code, fCnaParHistos->GetYmaxDefaultValue(quantity_code));
1719 
1720  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
1721  //................................. User's min and/or max (ViewMatrix)
1722  if( fFlagUserHistoMin == "ON" )
1723  {SetYminMemoFromValue(quantity_code, fUserHistoMin); fFlagUserHistoMin = "OFF";}
1724  if( fFlagUserHistoMax == "ON" )
1725  {SetYmaxMemoFromValue(quantity_code, fUserHistoMax); fFlagUserHistoMax = "OFF";}
1726  //................................. automatic min and/or max
1727  if( fFlagUserHistoMin == "AUTO" )
1728  {SetYminMemoFromValue(quantity_code, h_fbid0->GetMinimum()); fFlagUserHistoMin = "OFF";}
1729  if( fFlagUserHistoMax == "AUTO" )
1730  {SetYmaxMemoFromValue(quantity_code, h_fbid0->GetMaximum()); fFlagUserHistoMax = "OFF";}
1731  //...................................... histo set ymin and ymax (ViewMatrix)
1732  if( CorOrCov == fCorrelationMatrix )
1733  {
1734  if(BetweenWhat == fBetweenSamples)
1735  {SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "D_MCs_ChNb");}
1736  if( BetweenWhat == fLFBetweenStins || BetweenWhat == fLFBetweenChannels )
1737  {SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "H2LFccMosMatrix");}
1738  if( BetweenWhat == fHFBetweenStins || BetweenWhat == fHFBetweenChannels )
1739  {SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "H2HFccMosMatrix");}
1740  //************************** A GARDER EN RESERVE ******************************
1741  //............. special contour level for correlations (square root wise scale)
1742  // Int_t nb_niv = 9;
1743  // Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
1744  // SqrtContourLevels(nb_niv, &cont_niv[0]);
1745  // h_fbid0->SetContour(nb_niv, &cont_niv[0]);
1746  // delete [] cont_niv; fCdelete++;
1747  //******************************** (FIN RESERVE) ******************************
1748  }
1749  if( CorOrCov == fCovarianceMatrix )
1750  {
1751  if (BetweenWhat == fBetweenSamples)
1752  {SetYminMemoFromPreviousMemo("D_TNo_ChNb"); // covariance => same level as sigmas
1753  SetYmaxMemoFromPreviousMemo("D_TNo_ChNb");
1754  SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "D_TNo_ChNb");}
1755  if ( BetweenWhat == fLFBetweenStins || BetweenWhat == fHFBetweenStins ||
1756  BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels )
1757  {SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "H2HFccMosMatrix");}
1758  }
1759 
1760  // ----------------------------------------------- P L O T S (ViewMatrix)
1761  char* f_in = new char[fgMaxCar]; fCnew++;
1762  //...................... Taille/format canvas
1763  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
1764  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
1765 
1766  //............................. options generales
1767  TString HistoType;
1768  Int_t MaxCar = fgMaxCar;
1769  HistoType.Resize(MaxCar);
1770  HistoType = "(no quantity type info)";
1771 
1772  if (PlotOption == "COLZ" ){HistoType = "colz";}
1773  if (PlotOption == "BOX" ){HistoType = "colz";}
1774  if (PlotOption == "TEXT" ){HistoType = "colz";}
1775  if (PlotOption == "CONTZ" ){HistoType = "colz";}
1776  if (PlotOption == "LEGO2Z"){HistoType = "lego";}
1777  if (PlotOption == "SURF1Z"){HistoType = "surf";}
1778  if (PlotOption == "SURF2Z"){HistoType = "surf";}
1779  if (PlotOption == "SURF3Z"){HistoType = "surf";}
1780  if (PlotOption == "SURF4" ){HistoType = "surf";}
1781 
1782  if( fFlagSubDet == "EB" )
1783  {
1784  fFapStexBarrel = fEcalNumbering->GetSMHalfBarrel(fFapStexNumber);
1785  SetAllPavesViewMatrix(BetweenWhat.Data(), StexStin_A, StexStin_B, i0StinEcha);
1786  }
1787  if( fFlagSubDet == "EE" )
1788  {
1789  fFapStexType = fEcalNumbering->GetEEDeeType(fFapStexNumber);
1790  fFapStinQuadType = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(StexStin_A);
1791  SetAllPavesViewMatrix(BetweenWhat.Data(), StexStin_A, StexStin_B, i0StinEcha);
1792  }
1793 
1794  //---------------------------------------- Canvas name (ViewMatrix)
1795  TString name_cov_cor;
1796  MaxCar = fgMaxCar;
1797  name_cov_cor.Resize(MaxCar);
1798  name_cov_cor = "?";
1799  if( CorOrCov == fCovarianceMatrix){name_cov_cor = "Covariance";}
1800  if( CorOrCov == fCorrelationMatrix){name_cov_cor = "Correlation";}
1801 
1802  TString name_chan_samp;
1803  MaxCar = fgMaxCar;
1804  name_chan_samp.Resize(MaxCar);
1805  name_chan_samp = "?";
1806 
1807  if( BetweenWhat == fLFBetweenStins ){name_chan_samp = "LFccMos";}
1808  if( BetweenWhat == fHFBetweenStins ){name_chan_samp = "HFccMos"; }
1809 
1810  if( BetweenWhat == fLFBetweenChannels ){name_chan_samp = "LF_cc";}
1811  if( BetweenWhat == fHFBetweenChannels ){name_chan_samp = "HF_cc";}
1812 
1813  if(BetweenWhat == fBetweenSamples)
1814  {
1815  name_chan_samp = "Between_Samples"; // MatrixBinIndex = i0StinEcha
1816  }
1817 
1818  TString name_visu;
1819  MaxCar = fgMaxCar;
1820  name_visu.Resize(MaxCar);
1821  name_visu = "?";
1822 
1823  name_visu = PlotOption;
1824 
1825  if( (BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins) ){
1826  sprintf(f_in, "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%s",
1827  name_cov_cor.Data(), name_chan_samp.Data(),
1828  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
1829  fFapFirstReqEvtNumber, fFapLastReqEvtNumber,
1830  fFapStexName.Data(), fFapStexNumber,
1831  name_visu.Data());}
1832 
1833  if( BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels ){
1834  sprintf(f_in, "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%sX%d_%sY%d_%s",
1835  name_cov_cor.Data(), name_chan_samp.Data(),
1836  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
1837  fFapFirstReqEvtNumber, fFapLastReqEvtNumber,
1838  fFapStexName.Data(), fFapStexNumber,
1839  fFapStexName.Data(), StexStin_A, fFapStexName.Data(), StexStin_B,
1840  name_visu.Data());}
1841 
1842  if( BetweenWhat == fBetweenSamples ){
1843  sprintf(f_in, "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%sX%d_%sY%d_ElecChannel_%d_%s",
1844  name_cov_cor.Data(), name_chan_samp.Data(),
1845  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
1846  fFapFirstReqEvtNumber, fFapLastReqEvtNumber,
1847  fFapStexName.Data(), fFapStexNumber,
1848  fFapStexName.Data(), StexStin_A, fFapStexName.Data(), StexStin_B,
1849  MatrixBinIndex,
1850  name_visu.Data());}
1851 
1852  //---------------------------------------------------------- (ViewMatrix)
1853 
1854  SetHistoPresentation((TH1D*)h_fbid0, HistoType);
1855  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w , canv_h); fCnewRoot++;
1856  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
1857 
1858  // cout << "*TEcnaHistos::ViewMatrix(...)> Plot is displayed on canvas ----> "
1859  // << fCurrentCanvasName << endl;
1860  // cout << "*TEcnaHistos::ViewMatrix(...)> fCurrentCanvas = " << fCurrentCanvas << endl;
1861 
1862  delete [] f_in; f_in = 0; fCdelete++;
1863 
1864  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
1865  fPavComStex->Draw();
1866 
1867  if(BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels)
1868  {fPavComStin->Draw();}
1869  if(BetweenWhat == fBetweenSamples)
1870  {fPavComStin->Draw(); fPavComXtal->Draw();}
1871 
1872  fPavComAnaRun->Draw();
1873  fPavComNbOfEvts->Draw();
1874 
1875  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
1876  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
1877  MainCanvas->Divide(1, 1, x_margin, y_margin);
1878  gPad->cd(1);
1879 
1880  //---------------------------------------------------------- (ViewMatrix)
1881  Int_t logy = 0;
1882  gPad->SetLogy(logy);
1883  if( (BetweenWhat == fLFBetweenStins) ||
1884  (BetweenWhat == fHFBetweenStins) ){gPad->SetGrid(1,1);}
1885  h_fbid0->DrawCopy(PlotOption);
1886  h_fbid0->SetStats((Bool_t)1);
1887  gPad->Update();
1888  h_fbid0->Delete(); h_fbid0 = 0; fCdeleteRoot++;
1889 
1890  //MainCanvas->Delete(); fCdeleteRoot++;
1891  delete [] f_in_axis_x; f_in_axis_x = 0; fCdelete++;
1892  delete [] f_in_axis_y; f_in_axis_y = 0; fCdelete++;
1893  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
1894  }
1895  } // end of if ( OKData == kTRUE )
1896  else
1897  {
1898  fStatusDataExist = kFALSE;
1899  }
1900  } // end of if ((BetweenWhat == fLFBetweenStins) || (BetweenWhat == fHFBetweenStins) ) ||
1901  //( (BetweenWhat == fBetweenSamples) && (i0StinEcha>= 0) && (i0StinEcha<fEcal->MaxCrysInStin())) ||
1902  //( (BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels)
1903  // /* && (i0Sample >= 0) && (i0Sample < fFapNbOfSamples ) */ ) )
1904  else
1905  {
1906  if(BetweenWhat == fBetweenSamples)
1907  {
1908  cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* ==> Wrong channel number in "
1909  << fFapStinName.Data() << ". Value = "
1910  << i0StinEcha << " (required range: [0, "
1911  << fEcal->MaxCrysInStin()-1 << "] )"
1912  << fTTBELL << endl;
1913  }
1914 
1915  // if( BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels )
1916  // {
1917  // cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* ==> Wrong sample index. Value = "
1918  // << i0Sample << " (required range: [0, "
1919  // << fFapNbOfSamples-1 << "] )"
1920  // << fTTBELL << endl;
1921  //}
1922  }
1923  }
1924  else // else of the if ( Stin_X_ok ==1 && Stin_Y_ok ==1 )
1925  {
1926  //---------------------------------------------------------- (ViewMatrix)
1927  if ( Stin_X_ok != 1 )
1928  {
1929  if( fFlagSubDet == "EB")
1930  {
1931  cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
1932  << fFapStinName.Data() << " "
1933  << StexStin_A << ", "
1934  << fFapStinName.Data() << " not found. Available numbers = ";
1935  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
1936  {
1937  if( vStin(i) > 0 )
1938  {
1939  cout << vStin(i) << ", ";
1940  }
1941  }
1942  }
1943 
1944  if( fFlagSubDet == "EE")
1945  {
1946  cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
1947  << fFapStinName.Data() << " "
1948  << fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A) << ", "
1949  << fFapStinName.Data() << " not found. Available numbers = ";
1950  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
1951  {
1952  if( vStin(i) > 0 )
1953  {
1954  cout << fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i)) << ", ";
1955  }
1956  }
1957  }
1958  cout << fTTBELL << endl;
1959  }
1960  if ( Stin_Y_ok != 1 )
1961  {
1962 
1963  if( fFlagSubDet == "EB")
1964  {
1965  cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
1966  << fFapStinName.Data() << " "
1967  << StexStin_B << ", "
1968  << fFapStinName.Data() << " not found. Available numbers = ";
1969  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
1970  {
1971  if( vStin(i) > 0 )
1972  {
1973  cout << vStin(i) << ", ";
1974  }
1975  }
1976  }
1977 
1978  if( fFlagSubDet == "EE")
1979  {
1980  cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
1981  << fFapStinName.Data() << " "
1982  << fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_B) << ", "
1983  << fFapStinName.Data() << " not found. Available numbers = ";
1984  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
1985  {
1986  if( vStin(i) > 0 )
1987  {
1988  cout << fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i)) << ", ";
1989  }
1990  }
1991  }
1992  cout << fTTBELL << endl;
1993  }
1994  }
1995  } // end of if ( fMyRootFile->DataExist() == kTRUE )
1996  else
1997  {
1998  fStatusDataExist = kFALSE;
1999  cout << "!TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
2000  << " Histo not available." << fTTBELL << endl;
2001  fFlagUserHistoMin = "OFF";
2002  fFlagUserHistoMax = "OFF";
2003  }
2004  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
2005  else
2006  {
2007  fStatusFileFound = kFALSE;
2008  cout << "!TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
2009  << " ROOT file not found" << fTTBELL << endl;
2010  }
2011  } // ---- end of if( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) ) -----
2012  else
2013  {
2014  cout << "!TEcnaHistos::ViewMatrix(...)> " << fFapStexName.Data()
2015  << " = " << fFapStexNumber << ". Out of range (range = [1,"
2016  << fEcal->MaxStexInStas() << "]) " << fTTBELL << endl;
2017  }
2018 } // end of ViewMatrix(...)
2019 
2020 //==========================================================================
2021 //
2022 // ViewStin ( => option COLZ )
2023 //
2024 //==========================================================================
2025 
2026 void TEcnaHistos::CorrelationsBetweenSamples(const Int_t& StinNumber)
2027 {
2028  TString CorOrCov = fCorrelationMatrix;
2029  ViewStin(StinNumber, CorOrCov);
2030 }
2031 
2032 void TEcnaHistos::CovariancesBetweenSamples(const Int_t& StinNumber)
2033 {
2034  TString CorOrCov = fCovarianceMatrix;
2035  ViewStin(StinNumber, CorOrCov);
2036 }
2037 
2038 //==========================================================================
2039 //
2040 // ViewStin ( => option COLZ )
2041 //
2042 // StexStin ==>
2043 // (sample,sample) cor or cov matrices for all the crystal of StexStin
2044 //
2045 //
2046 //==========================================================================
2047 void TEcnaHistos::ViewStin(const Int_t& cStexStin, const TString& CorOrCov)
2048 {
2049  //cor(s,s') or cov(s,s') matrices for all the crystals of one given Stin. Option COLZ mandatory.
2050 
2051  // cStexStin = number for cons (in case of EE)
2052  // StexStin = ECNA number
2053 
2054  if( (fFapStexNumber > 0) && fFapStexNumber <= fEcal->MaxStexInStas() )
2055  {
2056  Int_t StexStin = cStexStin;
2057  if(fFlagSubDet == "EE" )
2058  {StexStin = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, cStexStin);}
2059 
2060  fMyRootFile->PrintNoComment();
2061  fMyRootFile->FileParameters(fFapAnaType, fFapNbOfSamples,
2062  fFapRunNumber, fFapFirstReqEvtNumber,
2063  fFapLastReqEvtNumber, fFapReqNbOfEvts,
2064  fFapStexNumber, fCfgResultsRootFilePath.Data());
2065 
2066  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewStin)
2067  {
2068  fStatusFileFound = kTRUE;
2069 
2070  fFapNbOfEvts = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, fFapStexNumber);
2071  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
2072  // cout << "*TEcnaHistos::ViewStin(...)> Data are analyzed from file ----> "
2073  // << fp_name_short << endl;
2074 
2075  TVectorD vStin(fEcal->MaxStinEcnaInStex());
2076  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vStin(i)=(Double_t)0.;}
2077  vStin = fMyRootFile->ReadStinNumbers(fEcal->MaxStinEcnaInStex());
2078 
2079  if ( fMyRootFile->DataExist() == kTRUE )
2080  {
2081  fStatusDataExist = kTRUE;
2082 
2083  Int_t Stin_ok = 0;
2084  for (Int_t index_Stin = 0; index_Stin < fEcal->MaxStinEcnaInStex(); index_Stin++)
2085  {
2086  if ( vStin(index_Stin) == StexStin ){Stin_ok++;}
2087  }
2088 
2089  if( Stin_ok == 1)
2090  {
2091  fStartDate = fMyRootFile->GetStartDate();
2092  fStopDate = fMyRootFile->GetStopDate();
2093  fRunType = fMyRootFile->GetRunType();
2094 
2095  //......................... matrix title (ViewStin)
2096  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
2097 
2098  if ( CorOrCov == fCovarianceMatrix )
2099  {sprintf(f_in_mat_tit, "Xtal's Cov(s,s') matrices in %s.",
2100  fFapStinName.Data());}
2101  if ( CorOrCov == fCorrelationMatrix )
2102  {sprintf(f_in_mat_tit, "Xtal's Cor(s,s') matrices in %s.",
2103  fFapStinName.Data());}
2104 
2105  //................................. Bidim parameters
2106  Int_t GeoBidSize = fEcal->MaxSampADC()*fEcal->MaxCrysHocoInStin();
2107  Int_t nb_binx = GeoBidSize;
2108  Int_t nb_biny = GeoBidSize;
2109  Axis_t xinf_bid = (Axis_t)0.;
2110  Axis_t xsup_bid = (Axis_t)GeoBidSize;
2111  Axis_t yinf_bid = (Axis_t)0.;
2112  Axis_t ysup_bid = (Axis_t)GeoBidSize;
2113 
2114  //--------------------------------------------------------- (ViewStin)
2115  //............. matrices reading and histogram filling
2116 
2117  TH2D* h_geo_bid = new TH2D("geobidim_ViewStin", f_in_mat_tit,
2118  nb_binx, xinf_bid, xsup_bid,
2119  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
2120 
2121  h_geo_bid->Reset();
2122 
2123  //======================================================== (ViewStin)
2124 
2125  //----------------------------------------------- Geographical bidim filling
2126  Int_t ReadMatSize = fFapNbOfSamples;
2127  Int_t MatSize = fEcal->MaxSampADC();
2128  TMatrixD read_matrix(ReadMatSize, ReadMatSize);
2129  for(Int_t i=0; i-ReadMatSize < 0; i++){for(Int_t j=0; j-ReadMatSize < 0; j++)
2130  {read_matrix(i,j)=(Double_t)0.;}}
2131 
2132  Int_t i_data_exist = 0;
2133 
2134  for(Int_t n_crys = 0; n_crys < fEcal->MaxCrysInStin(); n_crys++)
2135  {
2136  if( CorOrCov == fCovarianceMatrix )
2137  {read_matrix = fMyRootFile->ReadCovariancesBetweenSamples(StexStin, n_crys, ReadMatSize);}
2138  if ( CorOrCov == fCorrelationMatrix )
2139  {read_matrix = fMyRootFile->ReadCorrelationsBetweenSamples(StexStin, n_crys, ReadMatSize);}
2140 
2141  if( fMyRootFile->DataExist() == kFALSE )
2142  {
2143  fStatusDataExist = kFALSE;
2144  break; // <= if no data: exiting loop over the channels
2145  }
2146  else
2147  {
2148  fStatusDataExist = kTRUE;
2149  i_data_exist++;
2150 
2151  for(Int_t i_samp = 0 ; i_samp < ReadMatSize ; i_samp++)
2152  {
2153  Int_t i_xgeo = GetXSampInStin(fFapStexNumber, StexStin, n_crys, i_samp);
2154  for(Int_t j_samp = 0; j_samp < ReadMatSize ; j_samp++)
2155  {
2156  Int_t j_ygeo = GetYSampInStin(fFapStexNumber,
2157  StexStin, n_crys, j_samp);
2158  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)j_ygeo,
2159  (Double_t)read_matrix(i_samp, j_samp));
2160  }
2161  }
2162  }
2163  }
2164 
2165  //=========== H I S T O M I N / M A X M A N A G E M E N T ======== (ViewStin)
2166  //................................ Put histo min max values
2167  TString quantity_code = "D_MCs_ChNb";
2168  if( CorOrCov == fCorrelationMatrix ){quantity_code = "D_MCs_ChNb";}
2169  if( CorOrCov == fCovarianceMatrix ){quantity_code = "H2HFccMosMatrix";}
2170 
2171  //.......... default if flag not set to "ON"
2172  SetYminMemoFromValue(quantity_code, fCnaParHistos->GetYminDefaultValue(quantity_code));
2173  SetYmaxMemoFromValue(quantity_code, fCnaParHistos->GetYmaxDefaultValue(quantity_code));
2174 
2175  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
2176  //.......... user's min and/or max values
2177  if( fFlagUserHistoMin == "ON" )
2178  {SetYminMemoFromValue(quantity_code, fUserHistoMin); fFlagUserHistoMin = "OFF";}
2179  if( fFlagUserHistoMax == "ON" )
2180  {SetYmaxMemoFromValue(quantity_code, fUserHistoMax); fFlagUserHistoMax = "OFF";}
2181  //................................. automatic min and/or max
2182  if( fFlagUserHistoMin == "AUTO" )
2183  {SetYminMemoFromValue(quantity_code, h_geo_bid->GetMinimum()); fFlagUserHistoMin = "OFF";}
2184  if( fFlagUserHistoMax == "AUTO" )
2185  {SetYmaxMemoFromValue(quantity_code, h_geo_bid->GetMaximum()); fFlagUserHistoMax = "OFF";}
2186  //...................................... histo set ymin and ymax (ViewStin)
2187  if ( CorOrCov == fCorrelationMatrix )
2188  {SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, "D_MCs_ChNb");
2189 
2190  // ************************** A GARDER EN RESERVE *******************************
2191  //............. special contour level for correlations (square root wise scale)
2192  //Int_t nb_niv = 9;
2193  //Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
2194  //SqrtContourLevels(nb_niv, &cont_niv[0]);
2195  //h_geo_bid->SetContour(nb_niv, &cont_niv[0]);
2196  //delete [] cont_niv; fCdelete++;
2197  // ******************************** (FIN RESERVE) *******************************
2198  }
2199  if ( CorOrCov == fCovarianceMatrix )
2200  {SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, "D_TNo_ChNb");}
2201 
2202  // =================================== P L O T S ======================== (ViewStin)
2203  if( i_data_exist > 0 )
2204  {
2205  char* f_in = new char[fgMaxCar]; fCnew++;
2206 
2207  //...................... Taille/format canvas
2208  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
2209  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
2210 
2211  //.................................................. paves commentaires (ViewStin)
2212  SetAllPavesViewStin(StexStin);
2213 
2214  //------------------------------------ Canvas name ----------------- (ViewStin)
2215  TString name_cov_cor;
2216  Int_t MaxCar = fgMaxCar;
2217  name_cov_cor.Resize(MaxCar);
2218  name_cov_cor = "?";
2219  if( CorOrCov == fCovarianceMatrix ){name_cov_cor = "CovSS_Matrices_in_";}
2220  if( CorOrCov == fCorrelationMatrix){name_cov_cor = "CorSS_Matrices_in_";}
2221 
2222  TString name_visu;
2223  MaxCar = fgMaxCar;
2224  name_visu.Resize(MaxCar);
2225  name_visu = "colz";
2226 
2227  sprintf(f_in, "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%s%d_%s",
2228  name_cov_cor.Data(), fFapStinName.Data(),
2229  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
2230  fFapFirstReqEvtNumber, fFapLastReqEvtNumber,
2231  fFapStexName.Data(), fFapStexNumber,
2232  fFapStinName.Data(), StexStin, name_visu.Data());
2233 
2234  SetHistoPresentation((TH1D*)h_geo_bid, "Stin");
2235 
2236  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
2237  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
2238 
2239  // cout << "*TEcnaHistos::ViewStin(...)> Plot is displayed on canvas ----> " << f_in << endl;
2240 
2241  delete [] f_in; f_in = 0; fCdelete++;
2242 
2243  //------------------------ Canvas draw and update ------------ (ViewStin)
2244  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
2245  fPavComStex->Draw();
2246  fPavComStin->Draw();
2247  fPavComAnaRun->Draw();
2248  fPavComNbOfEvts->Draw();
2249 
2250  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
2251  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
2252  MainCanvas->Divide(1, 1, x_margin, y_margin);
2253  gPad->cd(1);
2254 
2255  Int_t logy = 0;
2256  gPad->SetLogy(logy);
2257 
2258  h_geo_bid->DrawCopy("COLZ");
2259 
2260  //--------------------------------------------------------------------------- (ViewStin)
2261  Int_t size_Hoco = fEcal->MaxCrysHocoInStin();
2262  Int_t size_Veco = fEcal->MaxCrysVecoInStin();
2263 
2264  ViewStinGrid(fFapStexNumber, StexStin, MatSize, size_Hoco, size_Veco, " ");
2265 
2266  gPad->Update();
2267 
2268  h_geo_bid->SetStats((Bool_t)1);
2269 
2270  // delete MainCanvas; fCdeleteRoot++;
2271  }
2272  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
2273 
2274  h_geo_bid->Delete(); h_geo_bid = 0; fCdeleteRoot++;
2275  }
2276  else
2277  {
2278  cout << "!TEcnaHistos::ViewStin(...)> *ERROR* =====> "
2279  << fFapStinName.Data() << " "
2280  << cStexStin << " not found."
2281  << " Available numbers = ";
2282  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
2283  {
2284  if( vStin(i) > 0 )
2285  {
2286  if( fFlagSubDet == "EB" ){cout << (Int_t)vStin(i) << ", ";}
2287  if( fFlagSubDet == "EE" )
2288  {cout << fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i)) << ", ";}
2289  }
2290  }
2291  cout << fTTBELL << endl;
2292  }
2293  } // end of if ( myRootFile->DataExist() == kTRUE )
2294  else
2295  {
2296  fStatusDataExist = kFALSE;
2297  }
2298  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
2299  else
2300  {
2301  fStatusFileFound = kFALSE;
2302 
2303  cout << "!TEcnaHistos::ViewStin(...)> *ERROR* =====> "
2304  << " ROOT file not found" << fTTBELL << endl;
2305  }
2306  }
2307  else
2308  {
2309  cout << "!TEcnaHistos::ViewStin(...)> " << fFapStexName.Data()
2310  << " = " << fFapStexNumber << ". Out of range (range = [1,"
2311  << fEcal->MaxStexInStas() << "]) " << fTTBELL << endl;
2312  }
2313 } // end of ViewStin(...)
2314 
2315 //====================================================================================
2316 //
2317 // StinCrystalNumbering
2318 // independent of the ROOT file => StexNumber as argument
2319 //
2320 //====================================================================================
2321 void TEcnaHistos::StinCrystalNumbering(const Int_t& StexNumber, const Int_t& cStexStin)
2322 {
2323 //display the crystal numbering of one Stin
2324 // cStexStin = Tower number in case of EB or SC number for construction in case of EE
2325 
2326  if( fFlagSubDet == "EB" ){TowerCrystalNumbering(StexNumber, cStexStin);}
2327  if( fFlagSubDet == "EE" ){SCCrystalNumbering(StexNumber, cStexStin);}
2328 }
2329 //----------------> end of StinCrystalNumbering()
2330 
2331 //====================================================================================
2332 //
2333 // TowerCrystalNumbering
2334 // independent of the ROOT file => SMNumber as argument
2335 //
2336 //====================================================================================
2337 void TEcnaHistos::TowerCrystalNumbering(const Int_t& SMNumber, const Int_t& n1SMTow)
2338 {
2339  //display the crystal numbering of one tower
2340 
2341  if( (SMNumber > 0) && (SMNumber <= fEcal->MaxSMInEB()) )
2342  {
2343  fFapStexBarrel = fEcalNumbering->GetSMHalfBarrel(SMNumber);
2344 
2345  Int_t MatSize = fEcal->MaxSampADC();
2346  Int_t size_eta = fEcal->MaxCrysEtaInTow();
2347  Int_t size_phi = fEcal->MaxCrysPhiInTow();
2348 
2349  //---------------------------------- bidim
2350 
2351  Int_t nb_bins = fEcal->MaxSampADC();
2352  Int_t nx_gbins = nb_bins*size_eta;
2353  Int_t ny_gbins = nb_bins*size_phi;
2354 
2355  Axis_t xinf_gbid = (Axis_t)0.;
2356  Axis_t xsup_gbid = (Axis_t)fEcal->MaxSampADC()*size_eta;
2357  Axis_t yinf_gbid = (Axis_t)0.;
2358  Axis_t ysup_gbid = (Axis_t)fEcal->MaxSampADC()*size_phi;
2359 
2360  TString fg_name = "M0' crystals";
2361  TString fg_tit = "Xtal numbering (chan. in tow, chan. in SM, Xtal in SM, hashed)";
2362 
2363  //----------------------- empty 2D histo for pave coordinates registration
2364  TH2D *h_gbid;
2365  h_gbid = new TH2D(fg_name.Data(), fg_tit.Data(),
2366  nx_gbins, xinf_gbid, xsup_gbid,
2367  ny_gbins, yinf_gbid, ysup_gbid); fCnewRoot++;
2368  h_gbid->Reset();
2369 
2370  //----------------- T R A C E D E S P L O T S ------ (TowerCrystalNumbering)
2371 
2372  char* f_in = new char[fgMaxCar]; fCnew++;
2373 
2374  //...................... Taille/format canvas
2375 
2376  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
2377  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
2378 
2379  //........................................ couleurs
2380  Color_t couleur_noir = fCnaParHistos->SetColorsForNumbers("crystal");
2381  Color_t couleur_rouge = fCnaParHistos->SetColorsForNumbers("lvrb_top");
2382  Color_t couleur_bleu_fonce = fCnaParHistos->SetColorsForNumbers("lvrb_bottom");
2383 
2384  gStyle->SetPalette(1,0); // Rainbow spectrum
2385 
2386  //.................................... options generales
2387  fCnaParHistos->SetViewHistoStyle("Stin");
2388 
2389  //.................................... paves commentaires (TowerCrystalNumbering)
2390 
2391  SetAllPavesViewStinCrysNb(SMNumber, n1SMTow);
2392 
2393  //---------------------------------------------- (TowerCrystalNumbering)
2394 
2395  //..................... Canvas name
2396  sprintf(f_in, "Crystal_Numbering_for_%s_X_%d_%s%d",
2397  fFapStinName.Data(), n1SMTow, fFapStexName.Data(), SMNumber);
2398 
2399  SetHistoPresentation((TH1D*)h_gbid, "Stin");
2400 
2401  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w , canv_h); fCnewRoot++;
2402  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
2403 
2404  // cout << "*TEcnaHistosEB::TowerCrystalNumbering(...)> Plot is displayed on canvas ----> "
2405  // << f_in << endl;
2406 
2407  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
2408  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
2409  MainCanvas->Divide(1, 1, x_margin, y_margin);
2410 
2411  fPavComStex->Draw();
2412  fPavComStin->Draw();
2413  fPavComLVRB->Draw();
2414 
2415  Bool_t b_true = 1;
2416  Bool_t b_false = 0;
2417  gPad->cd(1);
2418 
2419  gStyle->SetMarkerColor(couleur_rouge);
2420 
2421  Int_t logy = 0;
2422  gPad->SetLogy(logy);
2423 
2424  //............................... bidim .......... (TowerCrystalNumbering)
2425 
2426  h_gbid->SetStats(b_false);
2427  h_gbid->DrawCopy("COLZ");
2428 
2429  //..... Ecriture des numeros de channels dans la grille..... (TowerCrystalNumbering)
2430  // et des numeros SM des cristaux
2431 
2432  //............... prepa arguments fixes appels [TText]->DrawText()
2433  char* f_in_elec = new char[fgMaxCar]; fCnew++;
2434  TString TowerLvrbType = fEcalNumbering->GetTowerLvrbType(n1SMTow) ;
2435  TText *text_elec_num = new TText(); fCnewRoot++;
2436  if ( TowerLvrbType == "top" ){text_elec_num->SetTextColor(couleur_rouge);}
2437  if ( TowerLvrbType == "bottom" ){text_elec_num->SetTextColor(couleur_bleu_fonce);}
2438  text_elec_num->SetTextSize(0.04);
2439 
2440  char* f_in_sme = new char[fgMaxCar]; fCnew++;
2441  TText *text_sme_num = new TText(); fCnewRoot++;
2442  if ( TowerLvrbType == "top" ){text_sme_num->SetTextColor(couleur_rouge);}
2443  if ( TowerLvrbType == "bottom" ){text_sme_num->SetTextColor(couleur_bleu_fonce);}
2444  text_sme_num->SetTextSize(0.03);
2445 
2446  char* f_in_sm = new char[fgMaxCar]; fCnew++;
2447  TText *text_sm_num = new TText(); fCnewRoot++;
2448  text_sm_num->SetTextColor(couleur_noir);
2449  text_sm_num->SetTextSize(0.03);
2450 
2451  char* f_in_hsd = new char[fgMaxCar]; fCnew++;
2452  TText *text_hsd_num = new TText(); fCnewRoot++;
2453  text_hsd_num->SetTextColor(couleur_noir);
2454  text_hsd_num->SetTextSize(0.03);
2455 
2456  //............... prepa arguments fixes appels GetXGeo(...) et GetYGeo(...)
2457  Int_t i_samp = 0;
2458  //Double_t off_set = (Double_t)(fEcal->MaxSampADC()/4);
2459  Double_t off_set = (Double_t)1.;
2460 
2461  //------------------ LOOP ON THE CRYSTAL ELECTRONIC CHANNEL NUMBER (TowerCrystalNumbering)
2462 
2463  for (Int_t i_chan = 0; i_chan < fEcal->MaxCrysInTow(); i_chan++)
2464  {
2465  Int_t i_xgeo = GetXSampInStin(SMNumber, n1SMTow, i_chan, i_samp);
2466  Int_t i_ygeo = GetYSampInStin(SMNumber, n1SMTow, i_chan, i_samp);
2467 
2468  Double_t xgi = i_xgeo + 3.*off_set;
2469  Double_t ygj = i_ygeo + 7.*off_set;
2470 
2471  Double_t xgi_sme = i_xgeo + 3.*off_set;
2472  Double_t ygj_sme = i_ygeo + 5.*off_set;
2473 
2474  Double_t xgi_sm = i_xgeo + 3.*off_set;
2475  Double_t ygj_sm = i_ygeo + 3.*off_set;
2476 
2477  Double_t xgi_hsd = i_xgeo + 3.*off_set;
2478  Double_t ygj_hsd = i_ygeo + 1.*off_set;
2479 
2480  Int_t i_crys_sme = fEcalNumbering->Get0SMEchaFrom1SMTowAnd0TowEcha(n1SMTow, i_chan);
2481  Int_t i_crys_sm = fEcalNumbering->Get1SMCrysFrom1SMTowAnd0TowEcha(n1SMTow, i_chan);
2482 
2483  Double_t Eta = fEcalNumbering->GetEta(SMNumber, n1SMTow, i_chan);
2484  Double_t Phi = fEcalNumbering->GetPhi(SMNumber, n1SMTow, i_chan);
2485 
2486  Int_t i_crys_hsd = fEcalNumbering->GetHashedNumberFromIEtaAndIPhi((Int_t)Eta, (Int_t)Phi);
2487 
2488  //------------------------------------------------------- TowerCrystalNumbering
2489 
2490  sprintf(f_in_elec, "%d", i_chan);
2491  text_elec_num->DrawText(xgi, ygj, f_in_elec);
2492 
2493  sprintf(f_in_sme, "%d", i_crys_sme);
2494  text_sme_num->DrawText(xgi_sme, ygj_sme, f_in_sme);
2495 
2496  sprintf(f_in_sm, "%d", i_crys_sm);
2497  text_sm_num->DrawText(xgi_sm, ygj_sm, f_in_sm);
2498 
2499  sprintf(f_in_hsd, "%d", i_crys_hsd);
2500  text_sm_num->DrawText(xgi_hsd, ygj_hsd, f_in_hsd);
2501  }
2502  text_sm_num->Delete(); text_sm_num = 0; fCdeleteRoot++;
2503  text_sme_num->Delete(); text_sme_num = 0; fCdeleteRoot++;
2504  text_elec_num->Delete(); text_elec_num = 0; fCdeleteRoot++;
2505  text_hsd_num->Delete(); text_hsd_num = 0; fCdeleteRoot++;
2506 
2507  ViewStinGrid(SMNumber, n1SMTow, MatSize, size_eta, size_phi, "CrystalNumbering");
2508 
2509  gPad->Update();
2510  h_gbid->SetStats(b_true);
2511 
2512  h_gbid->Delete(); h_gbid = 0; fCdeleteRoot++;
2513 
2514  delete [] f_in; f_in = 0; fCdelete++;
2515  delete [] f_in_sm; f_in_sm = 0; fCdelete++;
2516  delete [] f_in_sme; f_in_sme = 0; fCdelete++;
2517  delete [] f_in_elec; f_in_elec = 0; fCdelete++;
2518  }
2519  else
2520  {
2521  cout << "!TEcnaHistos::TowerCrystalNumbering(...)> SM = " << SMNumber
2522  << ". Out of range ( range = [1," << fEcal->MaxSMInEB() << "] )" << fTTBELL << endl;
2523  }
2524 }
2525 //----------------> end of TowerCrystalNumbering()
2526 
2527 //====================================================================================
2528 //
2529 // SCCrystalNumbering
2530 // independent of the ROOT file => DeeNumber and n1DeeSCEcna as argument
2531 //
2532 //====================================================================================
2533 void TEcnaHistos::SCCrystalNumbering(const Int_t& DeeNumber, const Int_t& n1DeeSCCons)
2534 {
2535  //display the crystal numbering of one SC
2536 
2537  if( (DeeNumber > 0) && (DeeNumber <= fEcal->MaxDeeInEE()) )
2538  {
2539  Int_t n1DeeSCEcna = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(DeeNumber, n1DeeSCCons);
2540  fFapStexType = fEcalNumbering->GetEEDeeType(DeeNumber);
2541  fFapStinQuadType = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna);
2542 
2543  //Int_t MatSize = fEcal->MaxSampADC();
2544  Int_t size_IX = fEcal->MaxCrysIXInSC();
2545  Int_t size_IY = fEcal->MaxCrysIYInSC();
2546 
2547  //---------------------------------- bidim
2548 
2549  Int_t nb_bins = fEcal->MaxSampADC();
2550  Int_t nx_gbins = nb_bins*size_IX;
2551  Int_t ny_gbins = nb_bins*size_IY;
2552 
2553  Axis_t xinf_gbid = (Axis_t)0.;
2554  Axis_t xsup_gbid = (Axis_t)fEcal->MaxSampADC()*size_IX;
2555  Axis_t yinf_gbid = (Axis_t)0.;
2556  Axis_t ysup_gbid = (Axis_t)fEcal->MaxSampADC()*size_IY;
2557 
2558  TString fg_name = "crystalnbring";
2559  TString fg_tit = "Xtal numbering for construction";
2560 
2561  TH2D *h_gbid;
2562  h_gbid = new TH2D(fg_name.Data(), fg_tit.Data(),
2563  nx_gbins, xinf_gbid, xsup_gbid,
2564  ny_gbins, yinf_gbid, ysup_gbid); fCnewRoot++;
2565  h_gbid->Reset();
2566 
2567  //----------------- T R A C E D E S P L O T S ------ (SCCrystalNumbering)
2568 
2569  char* f_in = new char[fgMaxCar]; fCnew++;
2570 
2571  //...................... Taille/format canvas
2572 
2573  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
2574  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
2575  //........................................ couleurs
2576  // Color_t couleur_noir = fCnaParHistos->ColorDefinition("noir");
2577  Color_t couleur_rouge = fCnaParHistos->ColorDefinition("rouge");
2578  // Color_t couleur_bleu_fonce = fCnaParHistos->ColorDefinition("bleu_fonce");
2579 
2580  gStyle->SetPalette(1,0); // Rainbow spectrum
2581  //.................................... options generales
2582  fCnaParHistos->SetViewHistoStyle("Stin");
2583 
2584  //.................................... paves commentaires (SCCrystalNumbering)
2585  SetAllPavesViewStinCrysNb(DeeNumber, n1DeeSCEcna);
2586 
2587  //---------------------------------------------- (SCCrystalNumbering)
2588  //..................... Canvas name
2589  sprintf(f_in, "Crystal_Numbering_for_%s_X_%d_%s%d",
2590  fFapStinName.Data(), n1DeeSCEcna, fFapStexName.Data(), DeeNumber);
2591 
2592  SetHistoPresentation((TH1D*)h_gbid, "Stin");
2593 
2594  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w , canv_h); fCnewRoot++;
2595  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
2596 
2597  // cout << "*TEcnaHistosEE::SCCrystalNumbering(...)> Plot is displayed on canvas ----> "
2598  // << f_in << endl;
2599 
2600  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
2601  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
2602 
2603  MainCanvas->Divide(1, 1, x_margin, y_margin);
2604 
2605  fPavComStex->Draw();
2606  fPavComStin->Draw();
2607  fPavComCxyz->Draw();
2608 
2609  Bool_t b_true = 1;
2610  Bool_t b_false = 0;
2611  gPad->cd(1);
2612 
2613  gStyle->SetMarkerColor(couleur_rouge);
2614 
2615  Int_t logy = 0;
2616  gPad->SetLogy(logy);
2617 
2618  //............................... bidim .......... (SCCrystalNumbering)
2619  h_gbid->SetStats(b_false);
2620  fCnaParHistos->SetViewHistoOffsets((TH1D*)h_gbid, "Stin", " ");
2621  h_gbid->DrawCopy("COLZ");
2622 
2623  //..... Ecriture des numeros de channels dans la grille..... (SCCrystalNumbering)
2624  // et des numeros Dee des cristaux
2625  TString SCQuadType = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna);
2626  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
2627  TString DeeEndcap = fEcalNumbering->GetEEDeeEndcap(DeeNumber);
2628  Color_t couleur_SC = GetSCColor(DeeEndcap, DeeDir, SCQuadType);
2629  //............... prepa arguments fixes appels [TText]->DrawText()
2630  char* f_in_elec = new char[fgMaxCar]; fCnew++;
2631  TText *text_elec_num = new TText(); fCnewRoot++;
2632  text_elec_num->SetTextColor(couleur_SC);
2633  text_elec_num->SetTextSize(0.06);
2634 
2635  //............... prepa arguments fixes appels GetXGeo(...) et GetYGeo(...)
2636  Int_t i_samp = 0;
2637  Double_t off_set = (Double_t)(fEcal->MaxSampADC()/3);
2638 
2639  //------------------ LOOP ON THE CRYSTAL ELECTRONIC CHANNEL NUMBER (SCCrystalNumbering)
2640 
2641  for (Int_t i_chan = 0; i_chan < fEcal->MaxCrysInSC(); i_chan++)
2642  {
2643  Int_t i_xgeo = GetXSampInStin(DeeNumber, n1DeeSCEcna, i_chan, i_samp);
2644  Int_t i_ygeo = GetYSampInStin(DeeNumber, n1DeeSCEcna, i_chan, i_samp);
2645 
2646  Double_t xgi = i_xgeo + off_set;
2647  Double_t ygj = i_ygeo + 2*off_set;
2648 
2649  //------------------------------------------------------- SCCrystalNumbering
2650  Int_t i_chan_p = i_chan+1;
2651  sprintf(f_in_elec, "%d", i_chan_p); // offset = +1 (Xtal for construction numbering, CMS NOTE 2006/027)
2652  text_elec_num->DrawText(xgi, ygj, f_in_elec);
2653  }
2654  text_elec_num->Delete(); text_elec_num = 0; fCdeleteRoot++;
2655 
2656  ViewStinGrid(DeeNumber, n1DeeSCEcna, fEcal->MaxSampADC(), size_IX, size_IY, "CrystalNumbering");
2657 
2658  gPad->Update();
2659  h_gbid->SetStats(b_true);
2660 
2661  h_gbid->Delete(); h_gbid = 0; fCdeleteRoot++;
2662 
2663  delete [] f_in; f_in = 0; fCdelete++;
2664  delete [] f_in_elec; f_in_elec = 0; fCdelete++;
2665  }
2666  else
2667  {
2668  cout << "!TEcnaHistos::SCCrystalNumbering(...)> Dee = " << DeeNumber
2669  << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )" << fTTBELL << endl;
2670  }
2671 }
2672 //----------------> end of SCCrystalNumbering()
2673 
2674 //==================================================================================
2675 //
2676 // GetXSampInStin, GetYSampInStin
2677 //
2678 //==================================================================================
2679 Int_t TEcnaHistos::GetXSampInStin(const Int_t& StexNumber, const Int_t& StexStin,
2680  const Int_t& i0StinEcha, const Int_t& i_samp)
2681 {
2682 //Gives the X coordinate in the geographic view of one Stin
2683 
2684  Int_t ix_geo = -1;
2685 
2686  if( fFlagSubDet == "EB" )
2687  {TString ctype = fEcalNumbering->GetStinLvrbType(StexStin);
2688  TString btype = fEcalNumbering->GetStexHalfStas(StexNumber);
2689  if( (btype == "EB+" && ctype == "bottom") || (btype == "EB-" && ctype == "top") )
2690  {ix_geo = ( (fEcal->MaxCrysHocoInStin()-1)-(i0StinEcha/fEcal->MaxCrysHocoInStin()) )
2691  *fEcal->MaxSampADC() + i_samp;}
2692  if( (btype == "EB+" && ctype == "top") || (btype == "EB-" && ctype == "bottom") )
2693  {ix_geo = ( i0StinEcha/fEcal->MaxCrysHocoInStin() )*fEcal->MaxSampADC() + i_samp;}}
2694 
2695  if( fFlagSubDet == "EE" )
2696  { TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(StexNumber);
2697  if( DeeDir == "right" )
2698  {ix_geo = (fEcalNumbering->GetIXCrysInSC(StexNumber, StexStin, i0StinEcha)-1)*fEcal->MaxSampADC() + i_samp;}
2699  if( DeeDir == "left" )
2700  {ix_geo = (fEcal->MaxCrysHocoInStin() - fEcalNumbering->GetIXCrysInSC(StexNumber, StexStin, i0StinEcha))*
2701  fEcal->MaxSampADC() + i_samp;}}
2702 
2703  return ix_geo;
2704 }
2705 //--------------------------------------------------------------------------------------------
2706 Int_t TEcnaHistos::GetYSampInStin(const Int_t& StexNumber, const Int_t& StexStin,
2707  const Int_t& i0StinEcha, const Int_t& j_samp)
2708 {
2709 //Gives the Y coordinate in the geographic view of one Stin
2710 
2711  Int_t jy_geo = -1;
2712 
2713  if( fFlagSubDet == "EB" )
2714  {
2715  TString ctype = fEcalNumbering->GetStinLvrbType(StexStin);
2716  TString btype = fEcalNumbering->GetStexHalfStas(StexNumber);
2717 
2718  //.......................... jy_geo for the EB+ (and beginning for the EB-)
2719 
2720  if( (btype == "EB+" && ctype == "top") || (btype == "EB-" && ctype == "bottom") )
2721  {
2722  if( i0StinEcha >= 0 && i0StinEcha <= 4 ) {jy_geo = (i0StinEcha - 0)*fEcal->MaxSampADC() + j_samp;}
2723  if( i0StinEcha >= 5 && i0StinEcha <= 9 ) {jy_geo = -(i0StinEcha - 9)*fEcal->MaxSampADC() + j_samp;}
2724  if( i0StinEcha >= 10 && i0StinEcha <= 14 ) {jy_geo = (i0StinEcha - 10)*fEcal->MaxSampADC() + j_samp;}
2725  if( i0StinEcha >= 15 && i0StinEcha <= 19 ) {jy_geo = -(i0StinEcha - 19)*fEcal->MaxSampADC() + j_samp;}
2726  if( i0StinEcha >= 20 && i0StinEcha <= 24 ) {jy_geo = (i0StinEcha - 20)*fEcal->MaxSampADC() + j_samp;}
2727  }
2728 
2729  if( (btype == "EB+" && ctype == "bottom") || (btype == "EB-" && ctype == "top") )
2730  {
2731  if( i0StinEcha >= 0 && i0StinEcha <= 4 )
2732  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) - (i0StinEcha- 0))*fEcal->MaxSampADC() + j_samp;}
2733  if( i0StinEcha >= 5 && i0StinEcha <= 9 )
2734  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) + (i0StinEcha- 9))*fEcal->MaxSampADC() + j_samp;}
2735  if( i0StinEcha >= 10 && i0StinEcha <= 14 )
2736  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) - (i0StinEcha-10))*fEcal->MaxSampADC() + j_samp;}
2737  if( i0StinEcha >= 15 && i0StinEcha <= 19 )
2738  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) + (i0StinEcha-19))*fEcal->MaxSampADC() + j_samp;}
2739  if( i0StinEcha >= 20 && i0StinEcha <= 24 )
2740  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) - (i0StinEcha-20))*fEcal->MaxSampADC() + j_samp;}
2741  }
2742  }
2743 
2744  if( fFlagSubDet == "EE" )
2745  {jy_geo =
2746  (fEcalNumbering->GetJYCrysInSC(StexNumber, StexStin, i0StinEcha) - 1)*fEcal->MaxSampADC() + j_samp;}
2747 
2748  return jy_geo;
2749 }
2750 
2751 //===============================================================================
2752 //
2753 // ViewStinGrid
2754 // independent of the ROOT file => StexNumber as argument
2755 //
2756 //===============================================================================
2757 void TEcnaHistos::ViewStinGrid(const Int_t& StexNumber,
2758  const Int_t& StexStin, const Int_t& MatSize,
2759  const Int_t& size_Hoco, const Int_t& size_Veco,
2760  const TString& chopt)
2761 {
2762  //Grid of one Stin with axis Hoco and Veco
2763 
2764  if( fFlagSubDet == "EB"){ViewTowerGrid(StexNumber, StexStin, MatSize,
2765  size_Hoco, size_Veco, chopt);}
2766  if( fFlagSubDet == "EE"){ViewSCGrid(StexNumber, StexStin, MatSize,
2767  size_Hoco, size_Veco, chopt);}
2768 
2769 } // end of ViewStinGrid
2770 
2771 //===============================================================================
2772 //
2773 // ViewTowerGrid
2774 // independent of the ROOT file => SMNumber as argument
2775 //
2776 //===============================================================================
2777 void TEcnaHistos::ViewTowerGrid(const Int_t& SMNumber,
2778  const Int_t& n1SMTow, const Int_t& MatSize,
2779  const Int_t& size_eta, const Int_t& size_phi,
2780  const TString& chopt)
2781 {
2782  //Grid of one tower with axis eta and phi
2783  //.......................... lignes verticales
2784  Double_t xline = 0.;
2785 
2786  Double_t yline_bot = 0.;
2787  Double_t yline_top = (Double_t)(MatSize*size_eta);
2788 
2789  for( Int_t i = 0 ; i < size_eta ; i++)
2790  {
2791  xline = xline + (Double_t)MatSize;
2792  TLine *lin;
2793  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
2794  lin->Draw();
2795  // delete lin; fCdeleteRoot++;
2796  }
2797  //............................. lignes horizontales
2798  Double_t xline_left = 0;
2799  Double_t xline_right = (Double_t)(MatSize*size_eta);
2800 
2801  Double_t yline = -(Double_t)MatSize;
2802 
2803  for( Int_t j = 0 ; j < size_eta+1 ; j++)
2804  {
2805  yline = yline + (Double_t)MatSize;
2806  TLine *lin;
2807  lin = new TLine(xline_left, yline, xline_right, yline); fCnewRoot++;
2808  lin->Draw();
2809  // delete lin; fCdeleteRoot++;
2810  }
2811 
2812  //------------------ trace axes en eta et phi --------------- ViewTowerGrid
2813 
2814  //...................................................... Axe i(eta) (x bottom) (ViewTowerGrid)
2815 
2816  Double_t eta_min = fEcalNumbering->GetIEtaMin(SMNumber, n1SMTow);
2817  Double_t eta_max = fEcalNumbering->GetIEtaMax(SMNumber, n1SMTow);
2818 
2819  TString x_var_name = GetEtaPhiAxisTitle("ietaTow");
2820  TString x_direction = fEcalNumbering->GetXDirectionEB(SMNumber);
2821 
2822  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
2823  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize();
2824  Float_t tic_siz_x = fCnaParHistos->AxisTickSize();
2825  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("Towx");
2826  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("Towx");
2827 
2828  new TF1("f1", x_direction.Data(), eta_min, eta_max); fCnewRoot++;
2829 
2830  TGaxis* sup_axis_x = 0;
2831 
2832  if ( x_direction == "-x" ) // NEVER IN THIS CASE: xmin->xmax <=> right->left ("-x") direction
2833  {sup_axis_x = new TGaxis( -(Float_t)MatSize, (Float_t)0, (Float_t)(size_eta*MatSize), (Float_t)0.,
2834  "f1", size_eta, "BCS" , 0.); fCnewRoot++;
2835  cout << "TEcnaHistosEB::ViewTowerGrid()> non foreseen case. eta with -x direction." << fTTBELL << endl;}
2836 
2837  if ( x_direction == "x" ) // ALWAYS IN THIS CASE: xmin->xmax <=> left->right ("x") direction
2838  {sup_axis_x = new TGaxis( (Float_t)0. , (Float_t)0., (Float_t)(size_eta*MatSize), (Float_t)0.,
2839  "f1", size_eta, "CS" , 0.); fCnewRoot++;}
2840 
2841  sup_axis_x->SetTitle(x_var_name);
2842  sup_axis_x->SetTitleSize(tit_siz_x);
2843  sup_axis_x->SetTitleOffset(tit_off_x);
2844  sup_axis_x->SetLabelSize(lab_siz_x);
2845  sup_axis_x->SetLabelOffset(lab_off_x);
2846  sup_axis_x->SetTickSize(tic_siz_x);
2847  sup_axis_x->Draw("SAME");
2848 
2849  //...................................................... Axe phi (y right) (ViewTowerGrid)
2850  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
2851  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
2852  Float_t tic_siz_y = fCnaParHistos->AxisTickSize();
2853  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("Towy");
2854  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("Towy");
2855 
2856  if( chopt == "CrystalNumbering" )
2857  {
2858  Double_t phi_min = fEcalNumbering->GetPhiMin(SMNumber, n1SMTow);
2859  Double_t phi_max = fEcalNumbering->GetPhiMax(SMNumber, n1SMTow);
2860 
2861  TString y_var_name = GetEtaPhiAxisTitle("phi");
2862  TString y_direction = fEcalNumbering->GetYDirectionEB(SMNumber);
2863 
2864  new TF1("f2", y_direction.Data(), phi_min, phi_max); fCnewRoot++;
2865  TGaxis* sup_axis_y = 0;
2866 
2867  if ( y_direction == "-x" ) // ALWAYS IN THIS CASE: ymin->ymax <=> top->bottom ("-x") direction
2868  {sup_axis_y = new TGaxis( (Float_t)(size_eta*MatSize), (Float_t)0.,
2869  (Float_t)(size_eta*MatSize), (Float_t)(size_phi*MatSize),
2870  "f2", size_phi, "+CS", 0.); fCnewRoot++;}
2871 
2872  if ( y_direction == "x" ) // NEVER IN THIS CASE: ymin->ymax <=> bottom->top ("x") direction
2873  {sup_axis_y = new TGaxis( (Float_t)0., (Float_t)0., (Float_t) 0., (Float_t)(size_phi*MatSize),
2874  "f2", size_phi, "BCS", 0.); fCnewRoot++;}
2875 
2876  sup_axis_y->SetTitle(y_var_name);
2877  sup_axis_y->SetTitleSize(tit_siz_y);
2878  sup_axis_y->SetTitleOffset(tit_off_y);
2879  sup_axis_y->SetLabelSize(lab_siz_y);
2880  sup_axis_y->SetLabelOffset(lab_off_y);
2881  sup_axis_y->SetTickSize(tic_siz_y);
2882  sup_axis_y->Draw("SAME");
2883  }
2884  //...................................................... Axe j(phi) (y left) (ViewTowerGrid)
2885 
2886  Double_t j_phi_min = fEcalNumbering->GetJPhiMin(SMNumber, n1SMTow);
2887  Double_t j_phi_max = fEcalNumbering->GetJPhiMax(SMNumber, n1SMTow);
2888 
2889  TString jy_var_name = GetEtaPhiAxisTitle("jphiTow");
2890  TString jy_direction = fEcalNumbering->GetJYDirectionEB(SMNumber);
2891 
2892  new TF1("f3", jy_direction.Data(), j_phi_min, j_phi_max); fCnewRoot++;
2893  TGaxis* sup_axis_jy = 0;
2894 
2895  sup_axis_jy = new TGaxis( (Float_t)0., (Float_t)0.,
2896  (Float_t)0., (Float_t)(size_phi*MatSize),
2897  "f3", size_phi, "SC", 0.); fCnewRoot++;
2898 
2899  sup_axis_jy->SetTitle(jy_var_name);
2900  sup_axis_jy->SetTitleSize(tit_siz_y);
2901  sup_axis_jy->SetTitleOffset(tit_off_y);
2902  sup_axis_jy->SetLabelSize(lab_siz_y);
2903  sup_axis_jy->SetLabelOffset(lab_off_y);
2904  sup_axis_jy->SetTickSize(tic_siz_y);
2905  sup_axis_jy->Draw("SAME");
2906 } // end of ViewTowerGrid
2907 
2908 //===============================================================================
2909 //
2910 // ViewSCGrid
2911 // independent of the ROOT file => DeeNumber as argument
2912 //
2913 //===============================================================================
2914 void TEcnaHistos::ViewSCGrid(const Int_t& DeeNumber, const Int_t& n1DeeSCEcna,
2915  const Int_t& MatSize, const Int_t& size_IX,
2916  const Int_t& size_IY, const TString& chopt)
2917 {
2918  //Grid of one SC with axis IX and IY
2919  //.......................... lignes verticales
2920  Double_t xline = 0.;
2921 
2922  Double_t yline_bot = 0.;
2923  Double_t yline_top = (Double_t)(MatSize*size_IX);
2924 
2925  for( Int_t i = 0 ; i < size_IX ; i++)
2926  {
2927  xline = xline + (Double_t)MatSize;
2928  TLine *lin;
2929  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
2930  lin->Draw();
2931  // delete lin; fCdeleteRoot++;
2932  }
2933  //............................. lignes horizontales
2934  Double_t xline_left = 0;
2935  Double_t xline_right = (Double_t)(MatSize*size_IX);
2936 
2937  Double_t yline = -(Double_t)MatSize;
2938 
2939  for( Int_t j = 0 ; j < size_IX+1 ; j++)
2940  {
2941  yline = yline + (Double_t)MatSize;
2942  TLine *lin;
2943  lin = new TLine(xline_left, yline, xline_right, yline); fCnewRoot++;
2944  lin->Draw();
2945  // delete lin; fCdeleteRoot++;
2946  }
2947 
2948  //------------------ trace axes en IX et IY --------------- ViewSCGrid
2949 
2950  //...................................................... Axe i(IX) (x bottom) (ViewSCGrid)
2951 
2952  Double_t IX_min = fEcalNumbering->GetIIXMin(n1DeeSCEcna) - 0.5;
2953  Double_t IX_max = fEcalNumbering->GetIIXMax(n1DeeSCEcna) + 0.5;
2954 
2955  Float_t axis_x_inf = 0;
2956  Float_t axis_x_sup = 0;
2957  Float_t axis_y_inf = 0;
2958  Float_t axis_y_sup = 0;
2959  Int_t axis_nb_div = 1;
2960  Double_t IX_values_min = 0;
2961  Double_t IX_values_max = 0;
2962  Option_t* axis_chopt = "CS";
2963 
2964  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
2965  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize();
2966  Float_t tic_siz_x = fCnaParHistos->AxisTickSize();
2967  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("SCx");
2968  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("SCx");
2969 
2970  TString StrDee = "iIXSC";
2971  if( DeeNumber == 1 ){StrDee = "iIXDee1";}
2972  if( DeeNumber == 2 ){StrDee = "iIXDee2";}
2973  if( DeeNumber == 3 ){StrDee = "iIXDee3";}
2974  if( DeeNumber == 4 ){StrDee = "iIXDee4";}
2975 
2976  TString x_var_name = GetIXIYAxisTitle(StrDee.Data());
2977  TString x_direction = fEcalNumbering->GetXDirectionEE(DeeNumber);
2978 
2979  TGaxis* sup_axis_x = 0;
2980 
2981  if( DeeNumber == 1 ) // -xmin -> -xmax <=> left->right
2982  {
2983  axis_x_inf = 0; axis_y_inf = 0; axis_x_sup = size_IX*MatSize; axis_y_sup = 0;
2984  axis_nb_div = size_IX;
2985  IX_values_min = -IX_min ; IX_values_max = -IX_max; axis_chopt = "CS";
2986  }
2987  if( DeeNumber == 2 ) // xmin -> xmax <=> right->left
2988  {
2989  axis_x_inf = 0; axis_y_inf = 0; axis_x_sup = size_IX*MatSize; axis_y_sup = 0;
2990  axis_nb_div = size_IX;
2991  IX_values_min = IX_min ; IX_values_max = IX_max; axis_chopt = "CS";
2992  }
2993  if( DeeNumber == 3 ) // xmin -> xmax <=> left->right
2994  {
2995  axis_x_inf = 0; axis_y_inf = 0; axis_x_sup = size_IX*MatSize; axis_y_sup = 0;
2996  axis_nb_div = size_IX;
2997  IX_values_min = IX_min ; IX_values_max = IX_max; axis_chopt = "CS";
2998  }
2999  if( DeeNumber == 4 ) // -xmin -> -xmax <=> right->left
3000  {
3001  axis_x_inf = 0; axis_y_inf = 0; axis_x_sup = size_IX*MatSize; axis_y_sup = 0;
3002  axis_nb_div = size_IX;
3003  IX_values_min = -IX_min ; IX_values_max = -IX_max; axis_chopt = "CS";
3004  }
3005 
3006  new TF1("f1", x_direction.Data(), IX_values_min, IX_values_max); fCnewRoot++;
3007  sup_axis_x = new TGaxis( axis_x_inf, axis_y_inf, axis_x_sup, axis_y_sup,
3008  "f1", axis_nb_div, axis_chopt , 0.); fCnewRoot++;
3009 
3010  sup_axis_x->SetTitle(x_var_name);
3011  sup_axis_x->SetTitleSize(tit_siz_x);
3012  sup_axis_x->SetTitleOffset(tit_off_x);
3013  sup_axis_x->SetLabelSize(lab_siz_x);
3014  sup_axis_x->SetLabelOffset(lab_off_x);
3015  sup_axis_x->SetTickSize(tic_siz_x); // <===== NE MARCHE QU'AVEC L'OPTION "S"
3016  sup_axis_x->Draw("SAME");
3017 
3018  //...................................................... Axe j(IY) (ViewSCGrid)
3019 
3020  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
3021  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
3022  Float_t tic_siz_y = fCnaParHistos->AxisTickSize();
3023  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("SCy");
3024  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("SCy");
3025 
3026  Double_t j_IY_min = fEcalNumbering->GetJIYMin(DeeNumber, n1DeeSCEcna) - 0.5;
3027  Double_t j_IY_max = fEcalNumbering->GetJIYMax(DeeNumber, n1DeeSCEcna) + 0.5;
3028 
3029  TString jy_var_name = GetIXIYAxisTitle("jIYSC");
3030  TString jy_direction = fEcalNumbering->GetJYDirectionEE(DeeNumber);
3031 
3032  new TF1("f2", jy_direction.Data(), j_IY_min, j_IY_max); fCnewRoot++;
3033 
3034  TGaxis* sup_axis_jy = new TGaxis( (Float_t)0., (Float_t)0.,
3035  (Float_t)0., (Float_t)(size_IY*MatSize),
3036  "f2", size_IY, "CS", 0.); fCnewRoot++;
3037 
3038  sup_axis_jy->SetTitle(jy_var_name);
3039  sup_axis_jy->SetTitleSize(tit_siz_y);
3040  sup_axis_jy->SetTitleOffset(tit_off_y);
3041  sup_axis_jy->SetLabelSize(lab_siz_y);
3042  sup_axis_jy->SetLabelOffset(lab_off_y);
3043  sup_axis_jy->SetTickSize(tic_siz_y); // <===== NE MARCHE QU'AVEC L'OPTION "S"
3044  sup_axis_jy->Draw();
3045 
3046 } // end of ViewSCGrid
3047 
3048 //=======================================================================================
3049 //
3050 // ViewStex(***)
3051 //
3052 // (Hoco,Veco) matrices for all the Stins of a Stex
3053 //
3054 // arg_read_histo: 1D array containing the quantity for each channel in the Stex
3055 // (dim = MaxCrysInStex())
3056 // arg_AlreadyRead: =1 <=> arg_read_histo
3057 // =0 <=> read the 1D array in this method with TEcnaRead
3058 //
3059 // HistoCode: code for the plotted quantity
3060 //
3061 //=======================================================================================
3062 void TEcnaHistos::ViewStex(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
3063  const TString& HistoCode)
3064 {
3065 // (Hoco, Veco) matrices for all the Stins of a Stex
3066 
3067  Bool_t OKFileExists = kFALSE;
3068  Bool_t OKData = kFALSE;
3069 
3070  Int_t n1StexStin = -1;
3071 
3072  if( arg_AlreadyRead == fTobeRead )
3073  {
3074  fMyRootFile->PrintNoComment();
3075  fMyRootFile->FileParameters(fFapAnaType, fFapNbOfSamples,
3076  fFapRunNumber, fFapFirstReqEvtNumber,
3077  fFapLastReqEvtNumber, fFapReqNbOfEvts,
3078  fFapStexNumber, fCfgResultsRootFilePath.Data());
3079 
3080  if( fMyRootFile->LookAtRootFile() == kTRUE ){OKFileExists = kTRUE;}
3081 
3082  if( OKFileExists == kTRUE )
3083  {
3084  fFapNbOfEvts = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, fFapStexNumber);
3085  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
3086  // cout << "*TEcnaHistos::ViewStex(...)> Data are analyzed from file ----> "
3087  // << fp_name_short << endl;
3088 
3089  fStartDate = fMyRootFile->GetStartDate();
3090  fStopDate = fMyRootFile->GetStopDate();
3091  fRunType = fMyRootFile->GetRunType();
3092  }
3093  }
3094  if( arg_AlreadyRead >= 1 )
3095  {
3096  OKFileExists = kTRUE;
3097  }
3098 
3099  if( OKFileExists == kTRUE )
3100  {
3101  fStatusFileFound = kTRUE;
3102 
3103  //......................... matrix title (ViewStex)
3104  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
3105  sprintf(f_in_mat_tit, "?");
3106 
3107  if (HistoCode == "D_NOE_ChNb") {sprintf(f_in_mat_tit, "Number of events");}
3108  if (HistoCode == "D_Ped_ChNb") {sprintf(f_in_mat_tit, "Pedestals");}
3109  if (HistoCode == "D_TNo_ChNb") {sprintf(f_in_mat_tit, "Total noise");}
3110  if (HistoCode == "D_MCs_ChNb") {sprintf(f_in_mat_tit, "Mean cor(s,s')");}
3111  if (HistoCode == "D_LFN_ChNb") {sprintf(f_in_mat_tit, "Low frequency noise");}
3112  if (HistoCode == "D_HFN_ChNb") {sprintf(f_in_mat_tit, "High frequency noise");}
3113  if (HistoCode == "D_SCs_ChNb") {sprintf(f_in_mat_tit, "Sigma of cor(s,s')");}
3114 
3115  //................................. Axis parameters
3116  Int_t GeoBidSizeHoco = fEcal->MaxStinHocoInStex()*fEcal->MaxCrysHocoInStin();
3117  Int_t GeoBidSizeVeco = fEcal->MaxStinVecoInStex()*fEcal->MaxCrysVecoInStin();
3118 
3119  Int_t nb_binx = GeoBidSizeHoco;
3120  Int_t nb_biny = GeoBidSizeVeco;
3121  Axis_t xinf_bid = (Axis_t)0.;
3122  Axis_t xsup_bid = (Axis_t)GeoBidSizeHoco;
3123  Axis_t yinf_bid = (Axis_t)0.;
3124  Axis_t ysup_bid = (Axis_t)GeoBidSizeVeco;
3125 
3126  TString axis_x_var_name = " #Hoco ";
3127  TString axis_y_var_name = " #Veco ";
3128 
3129  //............. matrices reading and histogram filling (ViewStex)
3130 
3131  TH2D* h_geo_bid = new TH2D("geobidim_ViewStex", f_in_mat_tit,
3132  nb_binx, xinf_bid, xsup_bid,
3133  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
3134 
3135  h_geo_bid->Reset();
3136 
3137  //............................................... 1D histo reading (ViewStex)
3138  TVectorD partial_histp(fEcal->MaxCrysEcnaInStex());
3139  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++){partial_histp(i)=(Double_t)0.;}
3140 
3141  if( arg_AlreadyRead == fTobeRead )
3142  {
3143  if (HistoCode == "D_NOE_ChNb" ){partial_histp = fMyRootFile->ReadNumberOfEvents(fEcal->MaxCrysEcnaInStex());}
3144  if (HistoCode == "D_Ped_ChNb" ){
3145  partial_histp = fMyRootFile->ReadPedestals(fEcal->MaxCrysEcnaInStex());}
3146  if (HistoCode == "D_TNo_ChNb" ){
3147  partial_histp = fMyRootFile->ReadTotalNoise(fEcal->MaxCrysEcnaInStex());}
3148  if (HistoCode == "D_MCs_ChNb" ){
3149  partial_histp = fMyRootFile->ReadMeanCorrelationsBetweenSamples(fEcal->MaxCrysEcnaInStex());}
3150  if (HistoCode == "D_LFN_ChNb" ){
3151  partial_histp = fMyRootFile->ReadLowFrequencyNoise(fEcal->MaxCrysEcnaInStex());}
3152  if (HistoCode == "D_HFN_ChNb" ){
3153  partial_histp = fMyRootFile->ReadHighFrequencyNoise(fEcal->MaxCrysEcnaInStex());}
3154  if (HistoCode == "D_SCs_ChNb" ){
3155  partial_histp = fMyRootFile->ReadSigmaOfCorrelationsBetweenSamples(fEcal->MaxCrysEcnaInStex());}
3156 
3157  OKData = fMyRootFile->DataExist();
3158  }
3159 
3160  if( arg_AlreadyRead >= 1 )
3161  {
3162  partial_histp = arg_read_histo;
3163  OKData = kTRUE;
3164  }
3165 
3166  //------------------------------- Build 2D matrix to be ploted from 1D read histo (ViewStex)
3167  TMatrixD read_matrix(nb_binx, nb_biny);
3168  for(Int_t i=0; i<nb_binx; i++)
3169  {for(Int_t j=0; j<nb_biny; j++){read_matrix(i,j)=(Double_t)0.;}}
3170 
3171  if ( OKData == kTRUE )
3172  {
3173  fStatusDataExist = kTRUE;
3174 
3175  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
3176  {
3177  if( arg_AlreadyRead == fTobeRead )
3178  {n1StexStin = fMyRootFile->GetStexStinFromIndex(i0StexStinEcna);}
3179  if( arg_AlreadyRead >= 1 )
3180  {n1StexStin = i0StexStinEcna+1;}
3181 
3182  if (n1StexStin != -1)
3183  {
3184  //------------------ Geographical bidim filling (ViewStex)
3185  for(Int_t i0StinEcha=0; i0StinEcha<fEcal->MaxCrysInStin(); i0StinEcha++)
3186  {
3187  Int_t iStexEcha = (n1StexStin-1)*fEcal->MaxCrysInStin() + i0StinEcha;
3188  Int_t i_xgeo = GetXCrysInStex(fFapStexNumber, n1StexStin, i0StinEcha);
3189  Int_t i_ygeo = GetYCrysInStex(fFapStexNumber, n1StexStin, i0StinEcha);
3190 
3191  if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
3192  {
3193  read_matrix(i_xgeo, i_ygeo) = partial_histp(iStexEcha);
3194  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
3195  (Double_t)read_matrix(i_xgeo, i_ygeo));
3196  }
3197  }
3198  }
3199  }
3200 
3201  //=============== H I S T O M I N / M A X M A N A G E M E N T ============ (ViewStex)
3202 
3203  //................................ Put histo min max values
3204  //.......... default if flag not set to "ON"
3205  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
3206  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
3207 
3208  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
3209  //.......... user's value if flag set to "ON"
3210  if( fFlagUserHistoMin == "ON" )
3211  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
3212  if( fFlagUserHistoMax == "ON" )
3213  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
3214  //................................. automatic min and/or max
3215  if( fFlagUserHistoMin == "AUTO" )
3216  {SetYminMemoFromValue(HistoCode.Data(), h_geo_bid->GetMinimum()); fFlagUserHistoMin = "OFF";}
3217  if( fFlagUserHistoMax == "AUTO" )
3218  {SetYmaxMemoFromValue(HistoCode.Data(), h_geo_bid->GetMaximum()); fFlagUserHistoMax = "OFF";}
3219  //...................................... histo set ymin and ymax
3220  SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, HistoCode);
3221 
3222  // ************************** A GARDER EN RESERVE *******************************
3223  //............. special contour level for correlations (square root wise scale)
3224  //if ( HistoCode == "D_MCs_ChNb" )
3225  //{
3226  // Int_t nb_niv = 9;
3227  // Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
3228  // SqrtContourLevels(nb_niv, &cont_niv[0]);
3229  // h_geo_bid->SetContour(nb_niv, &cont_niv[0]);
3230  // delete [] cont_niv; fCdelete++;
3231  //}
3232  // ******************************** (FIN RESERVE) *******************************
3233 
3234  // =================================== P L O T S ======================== (ViewStex)
3235 
3236  char* f_in = new char[fgMaxCar]; fCnew++;
3237 
3238  //...................... Taille/format canvas
3239  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
3240  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
3241 
3242  if( fFlagSubDet == "EB")
3243  {canv_h = fCnaParHistos->CanvasFormatH("etaphiSM");
3244  canv_w = fCnaParHistos->CanvasFormatW("etaphiSM");}
3245  if( fFlagSubDet == "EE")
3246  {canv_h = fCnaParHistos->CanvasFormatH("IXIYDee");
3247  canv_w = fCnaParHistos->CanvasFormatW("IXIYDee");}
3248 
3249  //............................................... paves commentaires (ViewStex)
3250  SetAllPavesViewStex(fFapStexNumber);
3251 
3252  //------------------------------------ Canvas name ----------------- (ViewStex)
3253  TString name_cov_cor;
3254  Int_t MaxCar = fgMaxCar;
3255  name_cov_cor.Resize(MaxCar);
3256  name_cov_cor = "?";
3257 
3258  if( HistoCode == "D_NOE_ChNb"){name_cov_cor = "Nb_Of_D_Adc_EvDs";}
3259  if( HistoCode == "D_Ped_ChNb"){name_cov_cor = "Pedestals";}
3260  if( HistoCode == "D_TNo_ChNb"){name_cov_cor = "Total_noise";}
3261  if( HistoCode == "D_MCs_ChNb"){name_cov_cor = "Mean_Corss";}
3262  if( HistoCode == "D_LFN_ChNb"){name_cov_cor = "Low_Fq_Noise";}
3263  if( HistoCode == "D_HFN_ChNb"){name_cov_cor = "High_Fq_Noise";}
3264  if( HistoCode == "D_SCs_ChNb"){name_cov_cor = "Sigma_Corss";}
3265 
3266  TString name_visu;
3267  MaxCar = fgMaxCar;
3268  name_visu.Resize(MaxCar);
3269  name_visu = "colz";
3270 
3271  TString flag_already_read;
3272  MaxCar = fgMaxCar;
3273  flag_already_read.Resize(MaxCar);
3274  flag_already_read = "?";
3275  sprintf(f_in,"M%d", arg_AlreadyRead); flag_already_read = f_in;
3276 
3277  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%s%d_%s_HocoVeco_R%s",
3278  name_cov_cor.Data(), fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
3279  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapStexName.Data(), fFapStexNumber,
3280  name_visu.Data(), flag_already_read.Data());
3281 
3282  if( fFlagSubDet == "EB" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEB");}
3283  if( fFlagSubDet == "EE" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEE");}
3284 
3285  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
3286  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
3287 
3288  // cout << "*TEcnaHistos::ViewStex(...)> Plot is displayed on canvas ----> " << f_in << endl;
3289 
3290  delete [] f_in; f_in = 0; fCdelete++;
3291 
3292  //------------------------ Canvas draw and update ------------ (ViewStex)
3293  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
3294  fPavComStex->Draw();
3295  fPavComAnaRun->Draw();
3296  fPavComNbOfEvts->Draw();
3297 
3298  //----------------------------------------------------------- pad margins
3299  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3300  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
3301  Double_t x_margin = x_low;
3302  Double_t y_margin = y_low;
3303  MainCanvas->Divide( 1, 1, x_margin, y_margin);
3304  // Divide(nx, ny, x_margin, y_margin, color);
3305  gPad->cd(1);
3306  //........................... specific EE
3307  if( fFlagSubDet == "EE" )
3308  {Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
3309  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_Dee") - 0.005;
3310  TVirtualPad* main_subpad = gPad;
3311  main_subpad->SetPad(x_low, y_low, x_up, y_up);}
3312 
3313  //------------------------------------------------------------
3314  h_geo_bid->GetXaxis()->SetTitle(axis_x_var_name);
3315  h_geo_bid->GetYaxis()->SetTitle(axis_y_var_name);
3316 
3317  h_geo_bid->DrawCopy("COLZ");
3318 
3319  // trace de la grille: un rectangle = une tour ou un SC ---------------- (ViewStex)
3320  ViewStexGrid(fFapStexNumber, " ");
3321  gPad->Draw();
3322  gPad->Update();
3323 
3324  //..................... retour aux options standard
3325  Bool_t b_true = 1;
3326  h_geo_bid->SetStats(b_true);
3327  h_geo_bid->Delete(); h_geo_bid = 0; fCdeleteRoot++;
3328 
3329  // delete MainCanvas; fCdeleteRoot++;
3330  } // end of if OKData == kTRUE )
3331  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
3332  } // end of if OKFileExists == kTRUE )
3333  else
3334  {
3335  fStatusFileFound = kFALSE;
3336 
3337  cout << "!TEcnaHistos::ViewStex(...)> *ERROR* =====> "
3338  << " ROOT file not found" << fTTBELL << endl;
3339  }
3340 } // end of ViewStex(...)
3341 
3342 //===========================================================================
3343 //
3344 // StexHocoVecoLHFCorcc(***)
3345 //
3346 // Geographical view of the cor(c,c) matrices (mean over samples) of
3347 // all (Stin_A,Stin_A) [case A=B only] of a given Stex (BIG MATRIX)
3348 //
3349 //===========================================================================
3350 void TEcnaHistos::StexHocoVecoLHFCorcc(const TString& Freq)
3351 {
3352 // (Hoco, Veco) matrices for all the Stins of a Stex
3353 
3354  fMyRootFile->PrintNoComment();
3355  fMyRootFile->FileParameters(fFapAnaType, fFapNbOfSamples,
3356  fFapRunNumber, fFapFirstReqEvtNumber,
3357  fFapLastReqEvtNumber, fFapReqNbOfEvts,
3358  fFapStexNumber, fCfgResultsRootFilePath.Data());
3359 
3360  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (StexHocoVecoLHFCorcc)
3361  {
3362  fStatusFileFound = kTRUE;
3363 
3364  fFapNbOfEvts = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, fFapStexNumber);
3365  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
3366  //cout << "*TEcnaHistos::StexHocoVecoLHFCorcc(...)> Data are analyzed from file ----> "
3367  // << fp_name_short << endl;
3368 
3369  fStartDate = fMyRootFile->GetStartDate();
3370  fStopDate = fMyRootFile->GetStopDate();
3371  fRunType = fMyRootFile->GetRunType();
3372 
3373  //......................... matrix title
3374  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
3375 
3376  if( fFlagSubDet == "EB" && Freq == "LF" )
3377  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') for each tower in SM");}
3378  if( fFlagSubDet == "EB" && Freq == "HF" )
3379  {sprintf(f_in_mat_tit, "HF Cor(Xtal,Xtal') for each tower in SM");}
3380  if( fFlagSubDet == "EE" && Freq == "LF" )
3381  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') for each SC in Dee");}
3382  if( fFlagSubDet == "EE" && Freq == "HF" )
3383  {sprintf(f_in_mat_tit, "HF Cor(Xtal,Xtal') for each SC in Dee");}
3384 
3385  //................................. Axis parameters
3386  Int_t GeoBidSizeHoco = fEcal->MaxStinHocoInStex()*fEcal->MaxCrysInStin();
3387  Int_t GeoBidSizeVeco = fEcal->MaxStinVecoInStex()*fEcal->MaxCrysInStin();
3388 
3389  Int_t nb_binx = GeoBidSizeHoco;
3390  Int_t nb_biny = GeoBidSizeVeco;
3391  Axis_t xinf_bid = (Axis_t)0.;
3392  Axis_t xsup_bid = (Axis_t)GeoBidSizeHoco;
3393  Axis_t yinf_bid = (Axis_t)0.;
3394  Axis_t ysup_bid = (Axis_t)GeoBidSizeVeco;
3395 
3396  TString axis_x_var_name = " #Hoco ";
3397  TString axis_y_var_name = " #varVeco ";
3398 
3399  //======================================================== (StexHocoVecoLHFCorcc)
3400  TVectorD Stin_numbers(fEcal->MaxStinEcnaInStex());
3401  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){Stin_numbers(i)=(Double_t)0.;}
3402  Stin_numbers = fMyRootFile->ReadStinNumbers(fEcal->MaxStinEcnaInStex());
3403 
3404  if ( fMyRootFile->DataExist() == kTRUE )
3405  {
3406  fStatusDataExist = kTRUE;
3407 
3408  //............. matrices reading and histogram filling
3409  TMatrixD partial_matrix(fEcal->MaxCrysEcnaInStex(), fEcal->MaxCrysEcnaInStex());
3410  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++)
3411  {for(Int_t j=0; j<fEcal->MaxCrysEcnaInStex(); j++){partial_matrix(i,j)=(Double_t)0.;}}
3412 
3413  if( Freq == "LF")
3414  {
3415  partial_matrix = fMyRootFile->ReadLowFrequencyCorrelationsBetweenChannels(fEcal->MaxCrysEcnaInStex());
3416  }
3417  if( Freq == "HF")
3418  {
3419  partial_matrix = fMyRootFile->ReadHighFrequencyCorrelationsBetweenChannels(fEcal->MaxCrysEcnaInStex());
3420  }
3421 
3422  if ( fMyRootFile->DataExist() == kTRUE )
3423  {
3424  fStatusDataExist = kTRUE;
3425 
3426  //............................... 2D histo booking
3427  TH2D* h_geo_bid = new TH2D("geobidim_HocoVecoLHFCorcc", f_in_mat_tit,
3428  nb_binx, xinf_bid, xsup_bid,
3429  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
3430  h_geo_bid->Reset();
3431 
3432  fFapStexBarrel = fEcalNumbering->GetStexHalfStas(fFapStexNumber);
3433 
3434  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
3435  {
3436  Int_t n1StexStin = (Int_t)Stin_numbers(i0StexStinEcna);
3437  Int_t offset_x = ((n1StexStin-1)/fEcal->MaxStinVecoInStex())*fEcal->MaxCrysInStin();
3438  Int_t offset_y = ((n1StexStin-1)%fEcal->MaxStinVecoInStex())*fEcal->MaxCrysInStin();
3439 
3440  if (n1StexStin != -1)
3441  {
3442  //================================================= (StexHocoVecoLHFCorcc)
3443  //------------------ Geographical bidim filling
3444  for(Int_t i0StinEcha=0; i0StinEcha<fEcal->MaxCrysInStin(); i0StinEcha++)
3445  {
3446  for(Int_t j0StinEcha=0; j0StinEcha<fEcal->MaxCrysInStin(); j0StinEcha++)
3447  {
3448  Int_t i_xgeo = offset_x + i0StinEcha;
3449  Int_t i_ygeo = offset_y + j0StinEcha;
3450 
3451  if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
3452  {
3453  Int_t iEcha = (n1StexStin-1)*fEcal->MaxCrysInStin() + i0StinEcha;
3454  Int_t jEcha = (n1StexStin-1)*fEcal->MaxCrysInStin() + j0StinEcha;
3455 
3456  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
3457  (Double_t)partial_matrix(iEcha, jEcha));
3458  }
3459  }
3460  }
3461  }
3462  }
3463 
3464  //=============== H I S T O M I N / M A X M A N A G E M E N T ============ (StexHocoVecoLHFCorcc)
3465 
3466  TString HistoCode = "H2CorccInStins";
3467 
3468  //................................ Put histo min max values
3469  //.......... default if flag not set to "ON"
3470  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
3471  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
3472 
3473  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
3474  //.......... user's value if flag set to "ON"
3475  if( fFlagUserHistoMin == "ON" )
3476  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
3477  if( fFlagUserHistoMax == "ON" )
3478  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
3479  //................................. automatic min and/or max
3480  if( fFlagUserHistoMin == "AUTO" )
3481  {SetYminMemoFromValue(HistoCode.Data(), h_geo_bid->GetMinimum()); fFlagUserHistoMin = "OFF";}
3482  if( fFlagUserHistoMax == "AUTO" )
3483  {SetYmaxMemoFromValue(HistoCode.Data(), h_geo_bid->GetMaximum()); fFlagUserHistoMax = "OFF";}
3484  //...................................... histo set ymin and ymax
3485  SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, HistoCode);
3486 
3487  // ----------------------------------- P L O T S (StexHocoVecoLHFCorcc)
3488 
3489  char* f_in = new char[fgMaxCar]; fCnew++;
3490 
3491  //...................... Taille/format canvas
3492 
3493  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
3494  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
3495 
3496  if( fFlagSubDet == "EB")
3497  {canv_h = fCnaParHistos->CanvasFormatH("etaphiSM");
3498  canv_w = fCnaParHistos->CanvasFormatW("etaphiSM");}
3499  if( fFlagSubDet == "EE")
3500  {canv_h = fCnaParHistos->CanvasFormatH("IXIYDee");
3501  canv_w = fCnaParHistos->CanvasFormatW("IXIYDee");}
3502 
3503  //..................................... paves commentaires (StexHocoVecoLHFCorcc)
3504  SetAllPavesViewStex(fFapStexNumber);
3505 
3506  //----------------- Canvas name ------- (StexHocoVecoLHFCorcc)
3507  TString name_cov_cor;
3508  Int_t MaxCar = fgMaxCar;
3509  name_cov_cor.Resize(MaxCar);
3510  if( Freq == "LF" ){name_cov_cor = "StexLFCorcc";}
3511  if( Freq == "HF" ){name_cov_cor = "StexHFCorcc";}
3512 
3513  TString name_visu;
3514  MaxCar = fgMaxCar;
3515  name_visu.Resize(MaxCar);
3516  name_visu = "colz";
3517 
3518  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_Stex%s%d_%s_HocoVeco",
3519  name_cov_cor.Data(), fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
3520  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapStexName.Data(), fFapStexNumber,
3521  name_visu.Data());
3522 
3523  if( fFlagSubDet == "EB" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEB");}
3524  if( fFlagSubDet == "EE" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEE");}
3525 
3526  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
3527  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
3528 
3529  // cout << "*TEcnaHistos::StexHocoVecoLHFCorcc(...)> Plot is displayed on canvas ----> "
3530  // << f_in << endl;
3531 
3532  delete [] f_in; f_in = 0; fCdelete++;
3533 
3534  //------------ Canvas draw and update ------ (StexHocoVecoLHFCorcc)
3535  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
3536  fPavComStex->Draw();
3537  fPavComAnaRun->Draw();
3538  fPavComNbOfEvts->Draw();
3539 
3540  //----------------------------------------------------------- pad margins
3541  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3542  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
3543  Double_t x_margin = x_low;
3544  Double_t y_margin = y_low;
3545  MainCanvas->Divide( 1, 1, x_margin, y_margin);
3546  // Divide(nx, ny, x_margin, y_margin, color);
3547  gPad->cd(1);
3548  //........................... specific EE
3549  if( fFlagSubDet == "EE" )
3550  {
3551  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
3552  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_Dee") - 0.005;
3553  TVirtualPad* main_subpad = gPad;
3554  main_subpad->SetPad(x_low, y_low, x_up, y_up);
3555  }
3556 
3557  h_geo_bid->GetXaxis()->SetTitle(axis_x_var_name);
3558  h_geo_bid->GetYaxis()->SetTitle(axis_y_var_name);
3559 
3560  h_geo_bid->DrawCopy("COLZ");
3561 
3562  // trace de la grille: un rectangle = une tour (StexHocoVecoLHFCorcc)
3563  ViewStexGrid(fFapStexNumber, "corcc");
3564  gPad->Draw();
3565  gPad->Update();
3566 
3567  //..................... retour aux options standard
3568  Bool_t b_true = 1;
3569  h_geo_bid->SetStats(b_true);
3570  h_geo_bid->Delete(); h_geo_bid = 0; fCdeleteRoot++;
3571 
3572  // delete MainCanvas; fCdeleteRoot++;
3573  }
3574  }
3575  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
3576  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
3577  else
3578  {
3579  fStatusFileFound = kFALSE;
3580 
3581  cout << "!TEcnaHistos::StexHocoVecoLHFCorcc(...)> *ERROR* =====> "
3582  << " ROOT file not found" << fTTBELL << endl;
3583  }
3584 } // end of StexHocoVecoLHFCorcc
3585 
3586 //==================================================================================
3587 //
3588 // GetXCrysInStex, GetYCrysInStex
3589 //
3590 //==================================================================================
3591 Int_t TEcnaHistos::GetXCrysInStex(const Int_t& StexNumber, const Int_t& n1StexStin,
3592  const Int_t& i0StinEcha)
3593 {
3594 //Gives the X crystal coordinate in the geographic view of one Stex
3595 // (X = 0 to MaxStinHocoInStex*NbCrysHocoInStin - 1)
3596 
3597  Int_t ix_geo = 0;
3598 
3599  if( fFlagSubDet == "EB")
3600  {TString ctype = fEcalNumbering->GetStexHalfStas(StexNumber);
3601  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha, StexNumber);
3602  ix_geo = (n1StexCrys-1)/fEcal->MaxCrysVecoInStex(); // ix_geo for EB+
3603  if( ctype == "EB-"){ix_geo = fEcal->MaxCrysHocoInStex() - ix_geo - 1;}}
3604 
3605  if( fFlagSubDet == "EE")
3606  {TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(StexNumber);
3607  ix_geo = 0;
3608  if( DeeDir == "right" )
3609  {ix_geo = fEcalNumbering->GetIXCrysInDee(StexNumber, n1StexStin, i0StinEcha) - 1;}
3610  if( DeeDir == "left" )
3611  {ix_geo = fEcal->MaxCrysIXInDee() - fEcalNumbering->GetIXCrysInDee(StexNumber, n1StexStin, i0StinEcha);}}
3612 
3613  return ix_geo;
3614 }
3615 
3616 Int_t TEcnaHistos::GetYCrysInStex(const Int_t& StexNumber, const Int_t& n1StexStin,
3617  const Int_t& j0StinEcha)
3618 {
3619 //Gives the Y crystal coordinate in the geographic view of one Stex
3620 // (Y = 0 to MaxStinVecoInStex*NbCrysVecoInStin - 1)
3621 
3622  Int_t iy_geo = 0;
3623 
3624  if( fFlagSubDet == "EB")
3625  {TString ctype = fEcalNumbering->GetStexHalfStas(StexNumber);
3626  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(n1StexStin, j0StinEcha, StexNumber);
3627  Int_t ix_geo = (n1StexCrys-1)/fEcal->MaxCrysVecoInStex(); // ix_geo for EB+
3628  iy_geo = n1StexCrys - 1 - ix_geo*fEcal->MaxCrysVecoInStex(); // iy_geo for EB+
3629  if( ctype == "EB-"){iy_geo = fEcal->MaxCrysVecoInStex() - iy_geo - 1;}}
3630 
3631  if( fFlagSubDet == "EE")
3632  {iy_geo = fEcalNumbering->GetJYCrysInDee(StexNumber, n1StexStin, j0StinEcha) - 1;}
3633 
3634  return iy_geo;
3635 }
3636 
3637 //===========================================================================
3638 //
3639 // StexStinNumbering, ViewStexStinNumberingPad
3640 //
3641 // independent of the ROOT file => StexNumber as argument
3642 //
3643 //===========================================================================
3644 void TEcnaHistos::StexStinNumbering(const Int_t& StexNumber)
3645 {
3646 //display the Stin numbering of the Stex
3647 
3648  if( fFlagSubDet == "EB" ){SMTowerNumbering(StexNumber);}
3649  if( fFlagSubDet == "EE" ){DeeSCNumbering(StexNumber);}
3650 }
3651 // end of StexStinNumbering
3652 
3653 //=============================================================================
3654 //
3655 // ViewStexStinNumberingPad
3656 // independent of the ROOT file => StexNumber as argument
3657 //
3658 //=============================================================================
3659 void TEcnaHistos::ViewStexStinNumberingPad(const Int_t& StexNumber)
3660 {
3661 //display the Stin numbering of the Stex in a Pad
3662 
3663  if( fFlagSubDet == "EB"){ViewSMTowerNumberingPad(StexNumber);}
3664  if( fFlagSubDet == "EE"){ViewDeeSCNumberingPad(StexNumber);}
3665 }
3666 //----------------> end of ViewStexStinNumberingPad()
3667 
3668 //==========================================================================
3669 //
3670 // ViewStexGrid
3671 // independent of the ROOT file => StexNumber as argument
3672 //
3673 //==========================================================================
3674 void TEcnaHistos::ViewStexGrid(const Int_t& StexNumber, const TString& c_option)
3675 {
3676  //Grid of one Stex with axis Hoco and Veco
3677 
3678  if( fFlagSubDet == "EB"){ViewSMGrid(StexNumber, c_option);}
3679  if( fFlagSubDet == "EE"){ViewDeeGrid(StexNumber, c_option);}
3680 
3681 } // end of ViewStexGrid
3682 
3683 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& S P E C I F I C &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
3684 
3685 //======================================= BARREL ===============================
3686 void TEcnaHistos::SMTowerNumbering(const Int_t& SMNumber)
3687 {
3688  //display the tower numbering of the super-module
3689 
3690  if( (SMNumber > 0) && (SMNumber <= fEcal->MaxSMInEB()) )
3691  {
3692  Int_t GeoBidSizeEta = fEcal->MaxTowEtaInSM()*fEcal->MaxCrysEtaInTow();
3693  Int_t GeoBidSizePhi = fEcal->MaxTowPhiInSM()*fEcal->MaxCrysPhiInTow();
3694 
3695  Int_t nb_binx = GeoBidSizeEta;
3696  Int_t nb_biny = GeoBidSizePhi;
3697  Axis_t xinf_bid = (Axis_t)0.;
3698  Axis_t xsup_bid = (Axis_t)GeoBidSizeEta;
3699  Axis_t yinf_bid = (Axis_t)0.;
3700  Axis_t ysup_bid = (Axis_t)GeoBidSizePhi;
3701 
3702  TString axis_x_var_name = " #eta ";
3703  TString axis_y_var_name = " #varphi ";
3704 
3705  //------------------------------------------------------------------- SMTowerNumbering
3706 
3707  //............. matrices reading and histogram filling
3708  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
3709 
3710  sprintf(f_in_mat_tit, "SM tower numbering");
3711 
3712  // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
3713 
3714  TH2D* h_empty_bid = new TH2D("grid_bidim_eta_phi", f_in_mat_tit,
3715  nb_binx, xinf_bid, xsup_bid,
3716  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
3717  h_empty_bid->Reset();
3718 
3719  h_empty_bid->GetXaxis()->SetTitle(axis_x_var_name);
3720  h_empty_bid->GetYaxis()->SetTitle(axis_y_var_name);
3721 
3722  // ------------------------------------------------ P L O T S (SMTowerNumbering)
3723 
3724  char* f_in = new char[fgMaxCar]; fCnew++;
3725 
3726  //...................... Taille/format canvas
3727 
3728  UInt_t canv_h = fCnaParHistos->CanvasFormatH("etaphiSM");
3729  UInt_t canv_w = fCnaParHistos->CanvasFormatW("etaphiSM");
3730 
3731  //............................................... options generales
3732 
3733  fFapStexBarrel = fEcalNumbering->GetSMHalfBarrel(SMNumber);
3734 
3735  //............................................... paves commentaires (SMTowerNumbering)
3736  SetAllPavesViewStex("Numbering", SMNumber);
3737 
3738  //------------------------------------ Canvas name ----------------- (SMTowerNumbering)
3739 
3740  sprintf(f_in, "tower_numbering_for_SuperModule_SM%d", SMNumber);
3741 
3742  SetHistoPresentation((TH1D*)h_empty_bid,"Stex2DEB");
3743 
3744  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
3745  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
3746 
3747  // cout << "*TEcnaHistosEB::ViewSM(...)> Plot is displayed on canvas ----> " << f_in << endl;
3748 
3749  delete [] f_in; f_in = 0; fCdelete++;
3750 
3751  //------------------------ Canvas draw and update ------------ (SMTowerNumbering)
3752  fPavComStex->Draw();
3753 
3754  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3755  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
3756  MainCanvas->Divide(1, 1, x_margin, y_margin);
3757  gPad->cd(1);
3758 
3759  h_empty_bid->DrawCopy("COL"); // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
3760 
3761  ViewSMTowerNumberingPad(SMNumber);
3762  gPad->Update();
3763 
3764  //..................... retour aux options standard
3765  Bool_t b_true = 1;
3766  h_empty_bid->SetStats(b_true);
3767 
3768  h_empty_bid->Delete(); h_empty_bid = 0; fCdeleteRoot++;
3769 
3770  // delete MainCanvas; fCdeleteRoot++;
3771 
3772  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
3773  }
3774  else
3775  {
3776  cout << "!TEcnaHistos::SMTowerNumbering(...)> SM = " << SMNumber
3777  << ". Out of range ( range = [1," << fEcal->MaxSMInEB() << "] )" << fTTBELL << endl;
3778  }
3779 }
3780 // end of SMTowerNumbering
3781 
3782 void TEcnaHistos::ViewSMTowerNumberingPad(const Int_t& SMNumber)
3783 {
3784  //display the tower numbering of the super-module in a Pad
3785 
3786  gStyle->SetTitleW(0.2); // taille titre histos
3787  gStyle->SetTitleH(0.07);
3788 
3789  ViewSMGrid(SMNumber, " ");
3790 
3791  Color_t couleur_rouge = fCnaParHistos->SetColorsForNumbers("lvrb_top");
3792  Color_t couleur_bleu_fonce = fCnaParHistos->SetColorsForNumbers("lvrb_bottom");
3793 
3794  //..... Ecriture des numeros de tours dans la grille..... (ViewSMTowerNumberingPad)
3795 
3796  char* f_in = new char[fgMaxCar]; fCnew++;
3797  gStyle->SetTextSize(0.075);
3798 
3799  // x_channel, y_channel: coordinates of the text "Txx"
3800  Int_t y_channel = 12;
3801  Int_t x_channel = 12;
3802 
3803  Int_t max_tow_phi = fEcal->MaxTowPhiInSM()*fEcal->MaxCrysPhiInTow();
3804 
3805  //------------------ LOOP ON THE SM_TOWER NUMBER (ViewSMTowerNumberingPad)
3806 
3807  TText *text_SMtow_num = new TText(); fCnewRoot++;
3808 
3809  for (Int_t i_SMtow = 1; i_SMtow <= fEcal->MaxTowInSM(); i_SMtow++)
3810  {
3811  if(fEcalNumbering->GetTowerLvrbType(i_SMtow) == "top")
3812  {text_SMtow_num->SetTextColor(couleur_rouge);}
3813  if(fEcalNumbering->GetTowerLvrbType(i_SMtow) == "bottom")
3814  {text_SMtow_num->SetTextColor(couleur_bleu_fonce);}
3815 
3816  //................................ x from eta
3817  Double_t x_from_eta = fEcalNumbering->GetEta(SMNumber, i_SMtow, x_channel) - (Double_t)1;
3818  if(fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-")
3819  {x_from_eta = fEcal->MaxTowEtaInSM()*fEcal->MaxCrysEtaInTow() + x_from_eta + (Double_t)1;}
3820 
3821  //................................ y from phi
3822  Double_t y_from_phi = max_tow_phi - 1
3823  - (fEcalNumbering->GetPhi(SMNumber, i_SMtow, y_channel) - fEcalNumbering->GetPhiMin(SMNumber));
3824  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-")
3825  {y_from_phi = - y_from_phi + fEcal->MaxTowPhiInSM()*fEcal->MaxCrysPhiInTow() - (Double_t)1;}
3826 
3827  sprintf(f_in, "%d", i_SMtow);
3828  text_SMtow_num->DrawText(x_from_eta, y_from_phi, f_in); // <=== prend du temps si on mets "T%d" dans le sprintf
3829  }
3830 
3831  text_SMtow_num->Delete(); text_SMtow_num = 0; fCdeleteRoot++;
3832 
3833  //.................................................... legende (ViewSMTowerNumberingPad)
3834  Double_t offset_tow_tex_eta = (Double_t)8.;
3835  Double_t offset_tow_tex_phi = (Double_t)15.;
3836 
3837  Color_t couleur_noir = fCnaParHistos->ColorDefinition("noir");
3838  Double_t x_legend = (Double_t)0.;
3839  Double_t y_legend = (Double_t)0.;
3840 
3841  Int_t ref_tower = fEcal->MaxTowInSM();
3842 
3843  //................................................. LVRB TOP (ViewSMTowerNumberingPad)
3844  gStyle->SetTextSize(0.075);
3845  gStyle->SetTextColor(couleur_rouge);
3846  x_legend = fEcalNumbering->GetEta(SMNumber, ref_tower, x_channel);
3847  y_legend = fEcalNumbering->GetPhi(SMNumber, ref_tower, y_channel) - fEcalNumbering->GetPhiMin(SMNumber);
3848 
3849  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+" )
3850  {
3851  x_legend = x_legend + offset_tow_tex_eta;
3852  y_legend = y_legend + offset_tow_tex_phi;
3853  }
3854  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-" )
3855  {
3856  x_legend = -x_legend + offset_tow_tex_eta;
3857  y_legend = y_legend + offset_tow_tex_phi;
3858  }
3859 
3860  sprintf( f_in, "xx");
3861  TText *text_legend_rouge = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3862  text_legend_rouge->Draw();
3863  gStyle->SetTextSize(0.05);
3864  x_legend = x_legend - (Double_t)3.5;
3865  y_legend = y_legend - (Double_t)2.;
3866  sprintf(f_in, " LVRB ");
3867  TText *text_legend_rouge_expl = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3868  text_legend_rouge_expl->Draw();
3869  y_legend = y_legend - (Double_t)1.75;
3870  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+" ){sprintf(f_in, " <--- ");}
3871  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-" ){sprintf(f_in, " ---> ");}
3872  TText *text_legend_rouge_expm = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3873  text_legend_rouge_expm->Draw();
3874  //text_legend_rouge_expl->Delete(); text_legend_rouge_expl = 0; fCdeleteRoot++;
3875 
3876  //................................................. LVRB BOTTOM (ViewSMTowerNumberingPad)
3877  gStyle->SetTextSize(0.075);
3878  gStyle->SetTextColor(couleur_bleu_fonce);
3879  x_legend = fEcalNumbering->GetEta(SMNumber, ref_tower, x_channel);
3880  y_legend = fEcalNumbering->GetPhi(SMNumber, ref_tower, y_channel) - fEcalNumbering->GetPhiMin(SMNumber);
3881 
3882  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+" )
3883  {
3884  x_legend = x_legend + offset_tow_tex_eta;
3885  y_legend = y_legend + offset_tow_tex_phi/3;
3886  }
3887  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-" )
3888  {
3889  x_legend = -x_legend + offset_tow_tex_eta;
3890  y_legend = y_legend + offset_tow_tex_phi/3;
3891  }
3892 
3893  sprintf(f_in, "xx");
3894  TText *text_legend_bleu = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3895  text_legend_bleu->Draw();
3896  //text_legend_bleu->Delete(); text_legend_bleu = 0; fCdeleteRoot++;
3897  gStyle->SetTextSize(0.05);
3898  x_legend = x_legend - (Double_t)3.5;
3899  y_legend = y_legend - (Double_t)2.;
3900  sprintf( f_in, " LVRB ");
3901  TText *text_legend_bleu_expl = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3902  text_legend_bleu_expl->Draw();
3903  y_legend = y_legend - (Double_t)1.75;
3904  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+" ){sprintf( f_in, " ---> ");}
3905  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-" ){sprintf( f_in, " <--- ");}
3906  TText *text_legend_bleu_expm = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3907  text_legend_bleu_expm->Draw();
3908  //text_legend_bleu_expl->Delete(); text_legend_bleu_expl = 0; fCdeleteRoot++;
3909 
3910  delete [] f_in; f_in = 0; fCdelete++;
3911 
3912  gStyle->SetTextColor(couleur_noir);
3913 }
3914 //----------------> end of ViewSMTowerNumberingPad()
3915 
3916 void TEcnaHistos::ViewSMGrid(const Int_t& SMNumber, const TString& c_option)
3917 {
3918  //Grid of one supermodule with axis eta and phi
3919 
3920  Int_t GeoBidSizeEta = fEcal->MaxTowEtaInSM()*fEcal->MaxCrysEtaInTow();
3921  Int_t GeoBidSizePhi = fEcal->MaxTowPhiInSM()*fEcal->MaxCrysPhiInTow();
3922 
3923  if ( c_option == "corcc")
3924  {
3925  GeoBidSizeEta = fEcal->MaxTowEtaInSM()*fEcal->MaxCrysInTow();
3926  GeoBidSizePhi = fEcal->MaxTowPhiInSM()*fEcal->MaxCrysInTow();
3927  }
3928 
3929  Int_t nb_binx = GeoBidSizeEta;
3930  Int_t nb_biny = GeoBidSizePhi;
3931  Axis_t xinf_bid = (Axis_t)0.;
3932  Axis_t xsup_bid = (Axis_t)GeoBidSizeEta;
3933  Axis_t yinf_bid = (Axis_t)0.;
3934  Axis_t ysup_bid = (Axis_t)GeoBidSizePhi;
3935 
3936  //---------------- trace de la grille: un rectangle = une tour
3937 
3938  Int_t size_eta = fEcal->MaxCrysEtaInTow();
3939  Int_t size_phi = fEcal->MaxCrysPhiInTow();
3940  if ( c_option == "corcc")
3941  {
3942  size_eta = fEcal->MaxCrysInTow();
3943  size_phi = fEcal->MaxCrysInTow();
3944  }
3945  Int_t max_x = nb_binx/size_eta;
3946  Int_t max_y = nb_biny/size_phi;
3947 
3948  //............................. lignes horizontales
3949  Double_t yline = (Double_t)yinf_bid;
3950 
3951  Double_t xline_left = (Double_t)xinf_bid;
3952  Double_t xline_right = (Double_t)xsup_bid;
3953 
3954  for( Int_t j = 0 ; j < max_y ; j++)
3955  {
3956  yline = yline + (Double_t)size_phi;
3957  TLine *lin;
3958  lin = new TLine(xline_left, yline, xline_right, yline); fCnewRoot++;
3959  lin->Draw();
3960  // delete lin; fCdeleteRoot++;
3961  }
3962 
3963  //.......................... lignes verticales
3964  Double_t xline = (Double_t)xinf_bid - (Double_t)size_eta;
3965 
3966  Double_t yline_bot = (Double_t)yinf_bid;
3967  Double_t yline_top = (Double_t)ysup_bid;
3968 
3969  Color_t coul_surligne = fCnaParHistos->ColorDefinition("noir");
3970  Color_t coul_textmodu = fCnaParHistos->ColorDefinition("vert36");
3971 
3972  //............................ Mj text
3973  gStyle->SetTextColor(coul_textmodu);
3974  gStyle->SetTextSize(0.075);
3975 
3976  char* f_in = new char[fgMaxCar]; fCnew++;
3977 
3978  for( Int_t i = 0 ; i < max_x ; i++)
3979  {
3980  xline = xline + (Double_t)size_eta;
3981  TLine *lin;
3982  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
3983 
3984  //............. Surlignage separateur des modules
3985  if( (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") && (i == 4 || i == 8 || i == 12) )
3986  {lin->SetLineWidth(2); lin->SetLineColor(coul_surligne);}
3987  if( (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+") && (i == 5 || i == 9 || i == 13) )
3988  {lin->SetLineWidth(2); lin->SetLineColor(coul_surligne);}
3989 
3990  lin->Draw();
3991  // delete lin; fCdeleteRoot++;
3992 
3993  //............. Numeros des modules
3994  if( (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") && (i == 2 || i == 6 || i == 10 || i == 14) )
3995  {
3996  if( i == 2 ){sprintf( f_in, "M4");}
3997  if( i == 6 ){sprintf( f_in, "M3");}
3998  if( i == 10 ){sprintf( f_in, "M2");}
3999  if( i == 14 ){sprintf( f_in, "M1");}
4000 
4001  TText *text_num_module = new TText(xline + 1, yline_top + 1, f_in); fCnewRoot++;
4002  text_num_module->Draw();
4003  //text_num_module->Delete(); text_num_module = 0; fCdeleteRoot++;
4004  }
4005  if( (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+") && (i == 3 || i == 7 || i == 11 || i == 15) )
4006  {
4007  if( i == 3 ){sprintf( f_in, "M1");}
4008  if( i == 7 ){sprintf( f_in, "M2");}
4009  if( i == 11 ){sprintf( f_in, "M3");}
4010  if( i == 15 ){sprintf( f_in, "M4");}
4011 
4012  TText *text_num_module = new TText(xline, yline_top + 1, f_in); fCnewRoot++;
4013  text_num_module->Draw();
4014  //text_num_module->Delete(); text_num_module = 0; fCdeleteRoot++;
4015  }
4016  }
4017  delete [] f_in; f_in = 0; fCdelete++;
4018 
4019  //------------------ trace axes en eta et phi --------------- ViewSMGrid
4020 
4021  Int_t MatSize = fEcal->MaxCrysEtaInTow();
4022  if ( c_option == "corcc"){MatSize = fEcal->MaxCrysInTow();}
4023 
4024  Int_t size_eta_sm = fEcal->MaxTowEtaInSM();
4025  Int_t size_phi_sm = fEcal->MaxTowPhiInSM();
4026 
4027  //...................................................... Axe i(eta) (bottom x) ViewSMGrid
4028  Double_t eta_min = fEcalNumbering->GetIEtaMin(SMNumber);
4029  Double_t eta_max = fEcalNumbering->GetIEtaMax(SMNumber);
4030 
4031  TString x_var_name = GetHocoVecoAxisTitle("ietaSM");;
4032  TString x_direction = fEcalNumbering->GetXDirectionEB(SMNumber);
4033 
4034  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
4035  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize("SMx");
4036  Float_t tic_siz_x = fCnaParHistos->AxisTickSize("SMx");
4037  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("SMx");
4038  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("SMx");
4039 
4040  new TF1("f1", x_direction.Data(), eta_min, eta_max); fCnewRoot++;
4041  TGaxis* sup_axis_x = 0;
4042 
4043  if( x_direction == "-x" ) // NEVER IN THIS CASE: xmin->xmax <=> right->left ("-x") direction
4044  {sup_axis_x = new TGaxis( (Float_t)0., (Float_t)0., (Float_t)(size_eta_sm*MatSize), (Float_t)0.,
4045  "f1", size_eta_sm, "SC" , 0.); fCnewRoot++;}
4046 
4047  if( x_direction == "x" ) // ALWAYS IN THIS CASE: xmin->xmax <=> left->right ("x") direction
4048  {sup_axis_x = new TGaxis( (Float_t)0., (Float_t)0., (Float_t)(size_eta_sm*MatSize), (Float_t)0.,
4049  "f1", size_eta_sm, "SC" , 0.); fCnewRoot++;}
4050 
4051  sup_axis_x->SetTitle(x_var_name);
4052  sup_axis_x->SetTitleSize(tit_siz_x);
4053  sup_axis_x->SetTitleOffset(tit_off_x);
4054  sup_axis_x->SetLabelSize(lab_siz_x);
4055  sup_axis_x->SetLabelOffset(lab_off_x);
4056  sup_axis_x->SetTickSize(tic_siz_x);
4057  sup_axis_x->Draw("SAME");
4058 
4059  //...................................................... Axe phi (y) ViewSMGrid
4060  Double_t phi_min = fEcalNumbering->GetPhiMin(SMNumber);
4061  Double_t phi_max = fEcalNumbering->GetPhiMax(SMNumber);
4062 
4063  TString y_var_name = GetHocoVecoAxisTitle("phi");
4064  TString y_direction = fEcalNumbering->GetYDirectionEB(SMNumber);
4065 
4066  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
4067  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize("SMy");
4068  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("SMy");
4069  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("SMy");
4070  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("SMy");
4071 
4072  new TF1("f2", y_direction.Data(), phi_min, phi_max); fCnewRoot++;
4073  TGaxis* sup_axis_y = 0;
4074 
4075  if ( y_direction == "-x" ) // ALWAYS IN THIS CASE: ymin->ymax <=> top->bottom ("-x") direction
4076  {sup_axis_y = new TGaxis(-(Float_t)1.5*(Float_t)size_eta, (Float_t)0.,
4077  -(Float_t)1.5*(Float_t)size_eta, (Float_t)(size_phi_sm*MatSize),
4078  "f2", (Int_t)size_phi_sm, "SC", 0.); fCnewRoot++;}
4079 
4080  if ( y_direction == "x" ) // NEVER IN THIS CASE: ymin->ymax <=> bottom->top ("x") direction
4081  {sup_axis_y = new TGaxis(-(Float_t)1.5*(Float_t)size_eta, (Float_t)0.,
4082  -(Float_t)1.5*(Float_t)size_eta, (Float_t)(size_phi_sm*MatSize),
4083  "f2", (Int_t)size_phi_sm, "SC", 0.); fCnewRoot++;}
4084 
4085  sup_axis_y->SetTitle(y_var_name);
4086  sup_axis_y->SetTitleSize(tit_siz_y);
4087  sup_axis_y->SetTitleOffset(tit_off_y);
4088  sup_axis_y->SetLabelSize(lab_siz_y);
4089  sup_axis_y->SetLabelOffset(lab_off_y);
4090  sup_axis_y->SetTickSize(tic_siz_y);
4091  sup_axis_y->Draw("SAME");
4092 
4093  //...................................................... Axe jphi (jy) ViewSMGrid
4094  Double_t jphi_min = fEcalNumbering->GetJPhiMin(SMNumber);
4095  Double_t jphi_max = fEcalNumbering->GetJPhiMax(SMNumber);
4096 
4097  TString jy_var_name = " ";
4098  TString jy_direction = fEcalNumbering->GetJYDirectionEB(SMNumber);
4099 
4100  new TF1("f3", jy_direction.Data(), jphi_min, jphi_max); fCnewRoot++;
4101  TGaxis* sup_axis_jy = 0;
4102 
4103  //............; essai
4104  sup_axis_jy = new TGaxis((Float_t)0., (Float_t)0.,
4105  (Float_t)0., (Float_t)(size_phi_sm*MatSize),
4106  "f3", (Int_t)size_phi_sm, "SC", 0.); fCnewRoot++;
4107 
4108  if ( jy_direction == "-x" ) // IN THIS CASE FOR EB+: ymin->ymax <=> top->bottom ("-x") direction
4109  {jy_var_name = GetEtaPhiAxisTitle("jphiSMB+");}
4110 
4111  if ( jy_direction == "x" ) // IN THIS CASE FOR EB-: ymin->ymax <=> bottom->top ("x") direction
4112  {jy_var_name = GetEtaPhiAxisTitle("jphiSMB-");}
4113 
4114  lab_off_y = fCnaParHistos->AxisLabelOffset("SMyInEB");
4115 
4116  sup_axis_jy->SetTitle(jy_var_name);
4117  sup_axis_jy->SetTitleSize(tit_siz_y);
4118  sup_axis_jy->SetTitleOffset(tit_off_y);
4119  sup_axis_jy->SetLabelSize(lab_siz_y);
4120  sup_axis_jy->SetLabelOffset(lab_off_y);
4121  sup_axis_jy->SetTickSize(tic_siz_y);
4122  sup_axis_jy->Draw("SAME");
4123 
4124  //--------------------------- ViewSMGrid
4125 
4126  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
4127 
4128 } // end of ViewSMGrid
4129 
4130 //======================================= ENDCAP ===============================
4131 void TEcnaHistos::DeeSCNumbering(const Int_t& DeeNumber)
4132 {
4133  //display the SC numbering of the Dee
4134 
4135  if( (DeeNumber > 0) && (DeeNumber <= fEcal->MaxDeeInEE()) )
4136  {
4137  Int_t GeoBidSizeIX = fEcal->MaxSCIXInDee()*fEcal->MaxCrysIXInSC();
4138  Int_t GeoBidSizeIY = fEcal->MaxSCIYInDee()*fEcal->MaxCrysIYInSC();
4139 
4140  Int_t nb_binx = GeoBidSizeIX;
4141  Int_t nb_biny = GeoBidSizeIY;
4142  Axis_t xinf_bid = (Axis_t)0.;
4143  Axis_t xsup_bid = (Axis_t)GeoBidSizeIX;
4144  Axis_t yinf_bid = (Axis_t)0.;
4145  Axis_t ysup_bid = (Axis_t)GeoBidSizeIY;
4146 
4147  TString axis_x_var_name = " IX ";
4148  TString axis_y_var_name = " IY ";
4149 
4150  //------------------------------------------------------------------- DeeSCNumbering
4151  //........................................... empty histogram filling
4152  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
4153 
4154  sprintf(f_in_mat_tit, " Dee SC numbering ");
4155 
4156  // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
4157 
4158  TH2D* h_empty_bid = new TH2D("grid_bidim_IX_IY", f_in_mat_tit,
4159  nb_binx, xinf_bid, xsup_bid,
4160  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
4161  h_empty_bid->Reset();
4162 
4163  h_empty_bid->GetXaxis()->SetTitle(axis_x_var_name);
4164  h_empty_bid->GetYaxis()->SetTitle(axis_y_var_name);
4165 
4166  // ------------------------------------------------ P L O T S (DeeSCNumbering)
4167 
4168  char* f_in = new char[fgMaxCar]; fCnew++;
4169 
4170  //...................... Taille/format canvas
4171 
4172  UInt_t canv_h = fCnaParHistos->CanvasFormatH("IXIYDee");
4173  UInt_t canv_w = fCnaParHistos->CanvasFormatW("IXIYDee");
4174 
4175  //............................................... options generales
4176  fFapStexType = fEcalNumbering->GetEEDeeType(DeeNumber);
4177 
4178  //............................................... paves commentaires (DeeSCNumbering)
4179  SetAllPavesViewStex("Numbering", DeeNumber);
4180 
4181  //------------------------------------ Canvas name ----------------- (DeeSCNumbering)
4182 
4183  sprintf(f_in, "SC_numbering_for_Dee_Dee%d", DeeNumber);
4184  SetHistoPresentation((TH1D*)h_empty_bid,"Stex2DEENb");
4185  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
4186  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
4187 
4188  // cout << "*TEcnaHistosEE::ViewDee(...)> Plot is displayed on canvas ----> " << f_in << endl;
4189 
4190  delete [] f_in; f_in = 0; fCdelete++;
4191 
4192  //------------------------ Canvas draw and update ------------ (DeeSCNumbering)
4193  fPavComStex->Draw();
4194  fPavComCxyz->Draw();
4195 
4196  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
4197  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
4198  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
4199  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_Dee") - 0.005;
4200 
4201  Double_t x_margin = x_low;
4202  Double_t y_margin = y_low;
4203 
4204  MainCanvas->Divide( 1, 1, x_margin, y_margin);
4205  // Divide(nx, ny, x_margin, y_margin, color);
4206 
4207  gPad->cd(1);
4208  TVirtualPad* main_subpad = gPad;
4209  main_subpad->SetPad(x_low, y_low, x_up, y_up);
4210 
4211  h_empty_bid->DrawCopy("COL"); // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
4212  ViewDeeSCNumberingPad(DeeNumber);
4213  gPad->Update(); // prend beaucoup de temps...
4214 
4215  //..................... retour aux options standard
4216  Bool_t b_true = 1;
4217  h_empty_bid->SetStats(b_true);
4218 
4219  h_empty_bid->Delete(); h_empty_bid = 0; fCdeleteRoot++;
4220 
4221  // delete MainCanvas; fCdeleteRoot++;
4222 
4223  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
4224  }
4225  else
4226  {
4227  cout << "!TEcnaHistos::DeeSCNumbering(...)> Dee = " << DeeNumber
4228  << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )" << fTTBELL << endl;
4229  }
4230 }
4231 // end of DeeSCNumbering
4232 
4233 void TEcnaHistos::ViewDeeSCNumberingPad(const Int_t& DeeNumber)
4234 {
4235 //display the SC numbering of the Dee in a Pad
4236 
4237  gStyle->SetTitleW(0.4); // taille titre histos
4238  gStyle->SetTitleH(0.08);
4239 
4240  ViewDeeGrid(DeeNumber, " ");
4241 
4242  //..... SC numbers writing in the grid .... (ViewDeeSCNumberingPad)
4243 
4244  char* f_in = new char[fgMaxCar]; fCnew++;
4245  gStyle->SetTextSize(0.0325);
4246 
4247  //------------------ LOOP ON THE Dee_SC NUMBER (ViewDeeSCNumberingPad)
4248  Int_t x_channel = 0; // => defined here after according to DeeDir and SCQuadType
4249  TText *text_DSSC_num = new TText(); fCnewRoot++;
4250  TText *text_DeeSCCons_num = new TText(); fCnewRoot++;
4251 
4252  for (Int_t n1DeeSCEcna = 1; n1DeeSCEcna <= fEcal->MaxSCEcnaInDee(); n1DeeSCEcna++)
4253  {
4254  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
4255  TString SCQuadType = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna);
4256  if( SCQuadType == "top" && DeeDir == "right"){x_channel = 13;}
4257  if( SCQuadType == "top" && DeeDir == "left" ){x_channel = 7;}
4258  if( SCQuadType == "bottom" && DeeDir == "left" ){x_channel = 11;}
4259  if( SCQuadType == "bottom" && DeeDir == "right"){x_channel = 17;}
4260  Int_t i_SCEcha = (Int_t)x_channel;
4261 
4262  Double_t x_from_IX = (Double_t)GetXCrysInStex(DeeNumber, n1DeeSCEcna, i_SCEcha);
4263  Double_t y_from_IY = (Double_t)GetYCrysInStex(DeeNumber, n1DeeSCEcna, i_SCEcha);
4264  Double_t y_from_IYp = y_from_IY + (Double_t)1.;
4265  Double_t y_from_IYm = y_from_IY - (Double_t)1.;
4266 
4267  TString DeeEndcap = fEcalNumbering->GetEEDeeEndcap(DeeNumber);
4268  Color_t couleur_SC = GetSCColor(DeeEndcap, DeeDir, SCQuadType);
4269  text_DSSC_num->SetTextColor(couleur_SC);
4270  text_DeeSCCons_num->SetTextColor((Color_t)1);
4271 
4272  Int_t i_DSSC = fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
4273  Int_t i_DeeSCCons = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
4274  if( i_DSSC > 0 )
4275  {
4276  if(
4277  //.................................................... (D2,S9) , (D4,S1)
4278  !(i_DeeSCCons == 33 && n1DeeSCEcna == 60) &&
4279  !(i_DeeSCCons == 33 && n1DeeSCEcna == 119) &&
4280  //................................................... (D2,S8) , (D4,S2)
4281  !(i_DeeSCCons == 29 && n1DeeSCEcna == 32) && // !(29c and 58c)
4282  !(i_DeeSCCons == 29 && n1DeeSCEcna == 138) &&
4283  !(i_DeeSCCons == 29 && n1DeeSCEcna == 157) &&
4284  !(i_DeeSCCons == 58 && n1DeeSCEcna == 176) &&
4285  !(i_DeeSCCons == 58 && n1DeeSCEcna == 193) &&
4286  //.................................................... (D2,S7) , (D4,S3)
4287  !(i_DeeSCCons == 149 && n1DeeSCEcna == 188) &&
4288  //.................................................... (D2,S6) , (D4,S4)
4289  !(i_DeeSCCons == 112 && n1DeeSCEcna == 29) &&
4290  !(i_DeeSCCons == 112 && n1DeeSCEcna == 144) &&
4291  !(i_DeeSCCons == 112 && n1DeeSCEcna == 165) &&
4292  !(i_DeeSCCons == 119 && n1DeeSCEcna == 102) &&
4293  !(i_DeeSCCons == 119 && n1DeeSCEcna == 123) &&
4294  //.................................................... (D2,S5) , (D4,S5)
4295  !(i_DeeSCCons == 132 && n1DeeSCEcna == 41) &&
4296  //----------------------------------------------------------------------
4297  //.................................................... (D1,S1) , (D3,S9)
4298  !(i_DeeSCCons == 182 && n1DeeSCEcna == 60) &&
4299  !(i_DeeSCCons == 182 && n1DeeSCEcna == 119) &&
4300  //.................................................... (D1,S2) , (D3,S8)
4301  !(i_DeeSCCons == 178 && n1DeeSCEcna == 32) && // !(178c and 207c)
4302  !(i_DeeSCCons == 178 && n1DeeSCEcna == 138) &&
4303  !(i_DeeSCCons == 178 && n1DeeSCEcna == 157) &&
4304  !(i_DeeSCCons == 207 && n1DeeSCEcna == 176) &&
4305  !(i_DeeSCCons == 207 && n1DeeSCEcna == 193) &&
4306  //.................................................... (D1,S3) , (D3,S7)
4307  !(i_DeeSCCons == 298 && n1DeeSCEcna == 188) &&
4308  //.................................................... (D1,S4) , (D3,S6)
4309  !(i_DeeSCCons == 261 && n1DeeSCEcna == 29) && // !(261a and 268a)
4310  !(i_DeeSCCons == 261 && n1DeeSCEcna == 144) &&
4311  !(i_DeeSCCons == 261 && n1DeeSCEcna == 165) &&
4312  !(i_DeeSCCons == 268 && n1DeeSCEcna == 102) &&
4313  !(i_DeeSCCons == 268 && n1DeeSCEcna == 123) &&
4314  //.................................................... (D1,S5) , (D3,S5)
4315  !(i_DeeSCCons == 281 && n1DeeSCEcna == 41)
4316  )
4317  {
4318  sprintf(f_in, "%d", i_DSSC);
4319  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in); // <=== DrawText: prend du temps
4320  sprintf(f_in, "%d", i_DeeSCCons);
4321  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in); // <=== DrawText: prend du temps
4322  }
4323 
4324  //.................................................... (D2,S9) , (D4,S1)
4325 
4326  if( i_DeeSCCons == 33 && n1DeeSCEcna == 60 )
4327  {
4328  sprintf(f_in, "30a");
4329  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4330  sprintf(f_in, "33a");
4331  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4332  }
4333  if( i_DeeSCCons == 33 && n1DeeSCEcna == 119 )
4334  {
4335  sprintf(f_in, "30b");
4336  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4337  sprintf(f_in, "33b");
4338  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4339  }
4340  //.................................................... (D2,S8) , (D4,S2)
4341  if( i_DeeSCCons == 29 && n1DeeSCEcna == 32 )
4342  {
4343  sprintf(f_in, " 3c-25c");
4344  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4345  sprintf(f_in, "29c-58c");
4346  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4347  }
4348  if( i_DeeSCCons == 29 && n1DeeSCEcna == 138 )
4349  {
4350  sprintf(f_in, "3a");
4351  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4352  sprintf(f_in, "29a");
4353  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4354  }
4355  if( i_DeeSCCons == 29 && n1DeeSCEcna == 157 )
4356  {
4357  sprintf(f_in, "3b");
4358  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4359  sprintf(f_in, "29b");
4360  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4361  }
4362 
4363  if( i_DeeSCCons == 58 && n1DeeSCEcna == 176 )
4364  {
4365  sprintf(f_in, "25a");
4366  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4367  sprintf(f_in, "58a");
4368  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4369  }
4370  if( i_DeeSCCons == 58 && n1DeeSCEcna == 193 )
4371  {
4372  sprintf(f_in, "25b");
4373  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4374  sprintf(f_in, "58b");
4375  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4376  }
4377  //.................................................... (D2,S7) , (D4,S3)
4378  if( i_DeeSCCons == 149 && n1DeeSCEcna == 188 )
4379  {
4380  sprintf(f_in, "34a");
4381  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4382  sprintf(f_in, "149a");
4383  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4384  }
4385  //.................................................... (D2,S6) , (D4,S4)
4386  if( i_DeeSCCons == 112 && n1DeeSCEcna == 29 )
4387  {
4388  sprintf(f_in, " 14a-21a");
4389  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4390  sprintf(f_in, "112a-119a");
4391  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4392  }
4393  if( i_DeeSCCons == 112 && n1DeeSCEcna == 144 )
4394  {
4395  sprintf(f_in, "14c");
4396  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4397  sprintf(f_in, "112c");
4398  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4399  }
4400  if( i_DeeSCCons == 112 && n1DeeSCEcna == 165 )
4401  {
4402  sprintf(f_in, "14b");
4403  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4404  sprintf(f_in, "112b");
4405  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4406  }
4407 
4408  if( i_DeeSCCons == 119 && n1DeeSCEcna == 102 )
4409  {
4410  sprintf(f_in, "21c");
4411  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4412  sprintf(f_in, "119c");
4413  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4414  }
4415  if( i_DeeSCCons == 119 && n1DeeSCEcna == 123 )
4416  {
4417  sprintf(f_in, "21b");
4418  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4419  sprintf(f_in, "119b");
4420  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4421  }
4422  //.................................................... (D2,S5) , (D4,S5)
4423  if( i_DeeSCCons == 132 && n1DeeSCEcna == 41 )
4424  {
4425  sprintf(f_in, "3a");
4426  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4427  sprintf(f_in, "132a");
4428  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4429  }
4430 
4431  //.................................................... (D1,S1) , (D3,S9)
4432  if( i_DeeSCCons == 182 && n1DeeSCEcna == 60 )
4433  {
4434  sprintf(f_in, "30a");
4435  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4436  sprintf(f_in, "182a");
4437  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4438  }
4439  if( i_DeeSCCons == 182 && n1DeeSCEcna == 119 )
4440  {
4441  sprintf(f_in, "30b");
4442  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4443  sprintf(f_in, "182b");
4444  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4445  }
4446  //.................................................... (D1,S2) , (D3,S8)
4447  if( i_DeeSCCons == 178 && n1DeeSCEcna == 32 )
4448  {
4449  sprintf(f_in, " 3c-25c");
4450  text_DSSC_num->DrawText(x_from_IX-6, y_from_IYp, f_in);
4451  sprintf(f_in, "178c-207c");
4452  text_DeeSCCons_num->DrawText(x_from_IX-6, y_from_IYm, f_in);
4453  }
4454  if( i_DeeSCCons == 178 && n1DeeSCEcna == 138 )
4455  {
4456  sprintf(f_in, "3a");
4457  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4458  sprintf(f_in, "178a");
4459  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4460  }
4461  if( i_DeeSCCons == 178 && n1DeeSCEcna == 157 )
4462  {
4463  sprintf(f_in, "3b");
4464  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4465  sprintf(f_in, "178b");
4466  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4467  }
4468 
4469  if( i_DeeSCCons == 207 && n1DeeSCEcna == 176 )
4470  {
4471  sprintf(f_in, "25a");
4472  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4473  sprintf(f_in, "207a");
4474  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4475  }
4476  if( i_DeeSCCons == 207 && n1DeeSCEcna == 193 )
4477  {
4478  sprintf(f_in, "25b");
4479  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4480  sprintf(f_in, "207b");
4481  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4482  }
4483  //.................................................... (D1,S3) , (D3,S7)
4484  if( i_DeeSCCons == 298 && n1DeeSCEcna == 188 )
4485  {
4486  sprintf(f_in, "34a");
4487  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4488  sprintf(f_in, "298a");
4489  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4490  }
4491  //.................................................... (D1,S4) , (D3,S6)
4492  if( i_DeeSCCons == 261 && n1DeeSCEcna == 29 )
4493  {
4494  sprintf(f_in, " 14a-21a");
4495  text_DSSC_num->DrawText(x_from_IX-6, y_from_IYp, f_in);
4496  sprintf(f_in, "261a-268a");
4497  text_DeeSCCons_num->DrawText(x_from_IX-6, y_from_IYm, f_in);
4498  }
4499  if( i_DeeSCCons == 261 && n1DeeSCEcna == 144 )
4500  {
4501  sprintf(f_in, "14c");
4502  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4503  sprintf(f_in, "261c");
4504  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4505  }
4506  if( i_DeeSCCons == 261 && n1DeeSCEcna == 165 )
4507  {
4508  sprintf(f_in, "14b");
4509  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4510  sprintf(f_in, "261b");
4511  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4512  }
4513 
4514  if( i_DeeSCCons == 268 && n1DeeSCEcna == 102 )
4515  {
4516  sprintf(f_in, "21c");
4517  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4518  sprintf(f_in, "268c");
4519  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4520  }
4521  if( i_DeeSCCons == 268 && n1DeeSCEcna == 123 )
4522  {
4523  sprintf(f_in, "21b");
4524  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4525  sprintf(f_in, "268b");
4526  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4527  }
4528  //.................................................... (D1,S5) , (D3,S5)
4529  if( i_DeeSCCons == 281 && n1DeeSCEcna == 41 )
4530  {
4531  sprintf(f_in, "20a");
4532  text_DSSC_num->DrawText(x_from_IX, y_from_IYp, f_in);
4533  sprintf(f_in, "281a");
4534  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IYm, f_in);
4535  }
4536  }
4537  }
4538 
4539  // delete text_DSSC_num; fCdeleteRoot++;
4540 
4541  //......................... mention "color, black"
4542  Color_t coul_textcolors = fCnaParHistos->ColorDefinition("noir");
4543  sprintf( f_in, "color: nb in Data Sector, black: nb for construction");
4544  Int_t x_colors = 3;
4545  Int_t y_colors = -14;
4546 
4547  TText *text_colors = new TText(x_colors, y_colors, f_in); fCnewRoot++;
4548  text_colors->SetTextSize(0.03);
4549  text_colors->SetTextColor(coul_textcolors);
4550  text_colors->Draw();
4551 
4552  delete [] f_in; f_in = 0; fCdelete++;
4553 
4554  Color_t couleur_noir = fCnaParHistos->ColorDefinition("noir");
4555  gStyle->SetTextColor(couleur_noir);
4556 }
4557 //----------------> end of ViewDeeSCNumberingPad()
4558 
4559 void TEcnaHistos::ViewDeeGrid(const Int_t& DeeNumber, const TString& c_option)
4560 {
4561  //Grid of one Dee with axis IX and IY
4562 
4563  Int_t GeoBidSizeIX = fEcal->MaxSCIXInDee()*fEcal->MaxCrysIXInSC();
4564  Int_t GeoBidSizeIY = fEcal->MaxSCIYInDee()*fEcal->MaxCrysIYInSC();
4565 
4566  if ( c_option == "corcc")
4567  {
4568  GeoBidSizeIX = fEcal->MaxSCIXInDee()*fEcal->MaxCrysInSC();
4569  GeoBidSizeIY = fEcal->MaxSCIYInDee()*fEcal->MaxCrysInSC();
4570  }
4571 
4572  Int_t nb_binx = GeoBidSizeIX;
4573  Int_t nb_biny = GeoBidSizeIY;
4574  Axis_t xinf_bid = (Axis_t)0.;
4575  Axis_t xsup_bid = (Axis_t)GeoBidSizeIX;
4576 
4577  Axis_t yinf_bid = (Axis_t)0.;
4578  Axis_t ysup_bid = (Axis_t)GeoBidSizeIY;
4579  Double_t ymid_bid = (Double_t)(ysup_bid-yinf_bid)/2.;
4580 
4581  //---------------- trace de la grille: un rectangle = un super-cristal
4582 
4583  Int_t size_IX = fEcal->MaxCrysIXInSC();
4584  Int_t size_IY = fEcal->MaxCrysIYInSC();
4585 
4586  if ( c_option == "corcc"){size_IX = fEcal->MaxCrysInSC(); size_IY = fEcal->MaxCrysInSC();}
4587 
4588  Int_t max_x = nb_binx/size_IX;
4589  Int_t max_y = nb_biny/size_IY;
4590  Int_t max_yd = max_y/2;
4591 
4592  //= SURLIGNAGES (unite de coordonnees: le cristal ou 5 fois le cristal si option corcc)
4593  //........................... multplicative coefficient for corcc option
4594  Int_t coefcc_x = 1;
4595  Int_t coefcc_y = 1;
4596  if ( c_option == "corcc"){coefcc_x = fEcal->MaxCrysIXInSC(); coefcc_y = fEcal->MaxCrysIYInSC();}
4597 
4598  //............................. lignes horizontales
4599  Double_t yline = (Double_t)yinf_bid - (Double_t)size_IY;
4600 
4601  Double_t xline_beg = (Double_t)xinf_bid;
4602  Double_t xline_end = (Double_t)xsup_bid;
4603 
4604  // k = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10
4605  Int_t x_min[11] = {11,11, 7, 0, 0, 0, 0, 0, 0, 0, 0};
4606  Int_t x_max[11] = {50,50,47,45,45,42,37,35,30,15,50};
4607  for(Int_t i=0;i<11;i++){x_min[i] = coefcc_x*x_min[i]; x_max[i] = coefcc_x*x_max[i];}
4608 
4609  for( Int_t j = 0 ; j < max_y ; j++)
4610  {
4611  if( j < max_yd ) // j = 0,1,2,3,4,5,6,7,8,9
4612  {
4613  if( DeeNumber == 1 || DeeNumber == 3 )
4614  {
4615  xline_beg = xinf_bid + (Double_t)x_min[10-j];
4616  xline_end = xinf_bid + (Double_t)x_max[10-j];
4617  }
4618  if( DeeNumber == 2 || DeeNumber == 4 )
4619  {
4620  xline_beg = xsup_bid - (Double_t)x_max[10-j];
4621  xline_end = xsup_bid - (Double_t)x_min[10-j];
4622  }
4623  }
4624 
4625  if( j == max_yd ) // j = 10
4626  {
4627  if( DeeNumber == 1 || DeeNumber == 3 )
4628  {
4629  xline_beg = xinf_bid + (Double_t)x_min[0];
4630  xline_end = xinf_bid + (Double_t)x_max[0];
4631  }
4632  if( DeeNumber == 2 || DeeNumber == 4 )
4633  {
4634  xline_beg = xsup_bid - (Double_t)x_max[0];
4635  xline_end = xsup_bid - (Double_t)x_min[0];
4636  }
4637  }
4638 
4639  if( j > max_yd ) // j = 11,12,13,14,15,16,17,18,19,20
4640  {
4641  if( DeeNumber == 1 || DeeNumber == 3 )
4642  {
4643  xline_beg = xinf_bid + (Double_t)x_min[j-10];
4644  xline_end = xinf_bid + (Double_t)x_max[j-10];
4645  }
4646  if( DeeNumber == 2 || DeeNumber == 4 )
4647  {
4648  xline_beg = xsup_bid - (Double_t)x_max[j-10];
4649  xline_end = xsup_bid - (Double_t)x_min[j-10];
4650  }
4651  }
4652 
4653  yline = yline + (Double_t)size_IY;
4654  TLine *lin;
4655  lin = new TLine(xline_beg, yline, xline_end, yline); fCnewRoot++;
4656  lin->Draw();
4657  //lin->Delete(); // => si on delete, pas de trace de la ligne
4658  // delete lin; fCdeleteRoot++;
4659  }
4660 
4661  //.......................... lignes verticales
4662  Double_t xline = (Double_t)xinf_bid - (Double_t)size_IX;
4663 
4664  Double_t yline_haut_bot = (Double_t)ymid_bid;
4665  Double_t yline_haut_top = (Double_t)ysup_bid;
4666 
4667  Double_t yline_bas_bot = (Double_t)yinf_bid;
4668  Double_t yline_bas_top = (Double_t)ymid_bid;
4669 
4670  // coordonnees demi-lignes
4671  // l = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10
4672  Int_t y_min[11] = { 0,11, 7, 0, 0, 0, 0, 0, 0, 0, 0};
4673  Int_t y_max[11] = {50,50,47,45,45,42,38,35,30,15,10};
4674  for(Int_t i=0;i<11;i++){y_min[i] = coefcc_y*y_min[i]; y_max[i] = coefcc_y*y_max[i];}
4675 
4676  gStyle->SetTextSize(0.075); // ===> pourquoi pas avant?
4677 
4678  for( Int_t i = 0 ; i <= max_x ; i++)
4679  {
4680  if( DeeNumber == 1 || DeeNumber == 3 )
4681  {
4682  yline_haut_bot = ymid_bid + (Double_t)y_min[i];
4683  yline_haut_top = ymid_bid + (Double_t)y_max[i];
4684  }
4685  if( DeeNumber == 2 || DeeNumber == 4 )
4686  {
4687  yline_haut_bot = ymid_bid + (Double_t)y_min[10-i];
4688  yline_haut_top = ymid_bid + (Double_t)y_max[10-i];
4689  }
4690  yline_bas_bot = ysup_bid - yline_haut_top;
4691  yline_bas_top = ysup_bid - yline_haut_bot;
4692 
4693  xline = xline + (Double_t)size_IX;
4694  TLine *lin_haut;
4695  lin_haut = new TLine(xline, yline_haut_bot, xline, yline_haut_top); fCnewRoot++;
4696  lin_haut->Draw();
4697  // delete lin_haut; fCdeleteRoot++;
4698  TLine *lin_bas;
4699  lin_bas = new TLine(xline, yline_bas_bot, xline, yline_bas_top); fCnewRoot++;
4700  lin_bas->Draw();
4701  // delete lin_bas; fCdeleteRoot++;
4702  }
4703 
4704  EEDataSectors(coefcc_x, coefcc_y, DeeNumber, "Dee");
4705  EEGridAxis(coefcc_x, coefcc_y, DeeNumber, "Dee", c_option);
4706 
4707 } // end of ViewDeeGrid
4708 
4709 //=================================================================================
4710 //
4711 // SqrtContourLevels(const Int_t& nb_niv, Double_t* cont_niv)
4712 //
4713 //=================================================================================
4714 void TEcnaHistos::SqrtContourLevels(const Int_t& nb_niv, Double_t* cont_niv)
4715 {
4716 //Calculation of levels in z coordinate for 3D plots. Square root scale
4717 
4718  Int_t nb_niv2 = (nb_niv+1)/2;
4719 
4720  for (Int_t num_niv = 0; num_niv < nb_niv2; num_niv++)
4721  {
4722  Int_t ind_niv = num_niv + nb_niv2 - 1;
4723  if ( ind_niv < 0 || ind_niv > nb_niv )
4724  {
4725  cout << "!TEcnaHistos::ContourLevels(...)> *** ERROR *** "
4726  << "wrong contour levels for correlation matrix"
4727  << fTTBELL << endl;
4728  }
4729  else
4730  {
4731  cont_niv[ind_niv] =
4732  (Double_t)(num_niv*num_niv)/
4733  ((Double_t)((nb_niv2-1)*(nb_niv2-1)));
4734  }
4735  }
4736  for (Int_t num_niv = -1; num_niv > -nb_niv2; num_niv--)
4737  {
4738  Int_t ind_niv = num_niv + nb_niv2 - 1;
4739  if ( ind_niv < 0 || ind_niv > nb_niv )
4740  {
4741  cout << "!TEcnaHistos::ContourLevels(...)> *** ERROR *** "
4742  << "wrong contour levels for correlation matrix"
4743  << fTTBELL << endl;
4744  }
4745  else
4746  {
4747  cont_niv[ind_niv] =
4748  -(Double_t)(num_niv*num_niv)/
4749  ((Double_t)((nb_niv2-1)*(nb_niv2-1)));
4750  }
4751  }
4752 }
4753 
4754 //==========================================================================
4755 //
4756 // GetHocoVecoAxisTitle
4757 //
4758 //==========================================================================
4759 TString TEcnaHistos::GetHocoVecoAxisTitle(const TString& chcode)
4760 {
4761  TString xname = " ";
4762 
4763  if ( fFlagSubDet == "EB" ){xname = GetEtaPhiAxisTitle(chcode);}
4764  if ( fFlagSubDet == "EE" ){xname = GetIXIYAxisTitle(chcode);}
4765 
4766  return xname;
4767 }
4768 
4769 TString TEcnaHistos::GetEtaPhiAxisTitle(const TString& chcode)
4770 {
4771  TString xname = " ";
4772 
4773  if ( chcode == "ietaEB" ){xname = "i#eta Xtal ";}
4774  if ( chcode == "ietaSM" ){xname = "i#eta Xtal ";}
4775  if ( chcode == "ietaTow"){xname = "i#eta Xtal ";}
4776 
4777  if ( chcode == "iphiEB" ){xname = " i#varphi Xtal";}
4778  if ( chcode == "jphiEB+" ){xname = " i#varphi Xtal";}
4779  if ( chcode == "jphiEB-" ){xname = " i#varphi Xtal";}
4780  if ( chcode == "jphiSMB+" ){xname = " i#varphi Xtal";}
4781  if ( chcode == "jphiSMB-" ){xname = "i#varphi Xtal ";}
4782  if ( chcode == "jphiTow" ){xname = "i#varphi Xtal in SM ";}
4783  if ( chcode == "phi" ){xname = "i#varphi Xtal in EB ";}
4784 
4785  return xname;
4786 }
4787 
4788 TString TEcnaHistos::GetIXIYAxisTitle(const TString& chcode)
4789 {
4790  TString xname = " ";
4791 
4792  if ( chcode == "iIXDee" ){xname = "IX(SC)";}
4793 
4794  if ( chcode == "iIXDee1" ){xname = " -IX Xtal";}
4795  if ( chcode == "iIXDee2" ){xname = " IX Xtal ";}
4796  if ( chcode == "iIXDee3" ){xname = " IX Xtal";}
4797  if ( chcode == "iIXDee4" ){xname = "-IX Xtal ";}
4798 
4799  if ( chcode == "iIXEE" ){xname = " IX Xtal";}
4800 
4801  if ( chcode == "iIXSC" ){xname = "IX Xtal";}
4802 
4803  if ( chcode == "jIYDee" ){xname = "IY Xtal";}
4804  if ( chcode == "jIYSC" ){xname = "IY Xtal";}
4805  if ( chcode == "IY" ){xname = "IY";}
4806 
4807  return xname;
4808 }
4809 
4810 //=======================================================================================
4811 //
4812 // ViewStas(***)
4813 //
4814 // (Hoco,Veco) matrices for all the Stex's of a Stas
4815 // Stas = EB or EE
4816 //
4817 //=======================================================================================
4818 void TEcnaHistos::ViewStas(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
4819  const TString& HistoCode)
4820 {
4821 // (Hoco, Veco) matrices for all the Stex's of a Stas
4822 
4823  //......................... matrix title
4824  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
4825 
4826  if (HistoCode == "D_NOE_ChNb"){sprintf(f_in_mat_tit, "Number of Events");}
4827  if (HistoCode == "D_Ped_ChNb"){sprintf(f_in_mat_tit, "Pedestals");}
4828  if (HistoCode == "D_TNo_ChNb"){sprintf(f_in_mat_tit, "Total noise");}
4829  if (HistoCode == "D_MCs_ChNb"){sprintf(f_in_mat_tit, "Mean cor(s,s')");}
4830  if (HistoCode == "D_LFN_ChNb"){sprintf(f_in_mat_tit, "Low frequency noise");}
4831  if (HistoCode == "D_HFN_ChNb"){sprintf(f_in_mat_tit, "High frequency noise");}
4832  if (HistoCode == "D_SCs_ChNb"){sprintf(f_in_mat_tit, "Sigma of cor(s,s')");}
4833 
4834  //.... Axis parameters: *** WARNING *** EB ===> x (Bid Hoco) = phi (StinVeco), y (Bid Veco) = eta (StinHoco)
4835  Int_t GeoBidSizeHoco = fEcal->MaxStinVecoInStas();
4836  Int_t GeoBidSizeVeco = fEcal->MaxStinHocoInStas();
4837 
4838  Int_t vertic_empty_strips = 3;
4839  Int_t vertic_empty_strip_1 = 1;
4840 
4841  if ( fFlagSubDet == "EE" )
4842  {
4843  // for empty vertical strips: before EE-, between EE- and EE+, after EE+ on plot
4844  GeoBidSizeHoco = fEcal->MaxStinHocoInStas() + vertic_empty_strips;
4845  GeoBidSizeVeco = fEcal->MaxStinVecoInStas();
4846  }
4847 
4848  Int_t nb_binx = GeoBidSizeHoco;
4849  Int_t nb_biny = GeoBidSizeVeco;
4850  Axis_t xinf_bid = (Axis_t)0.;
4851  Axis_t xsup_bid = (Axis_t)GeoBidSizeHoco;
4852  Axis_t yinf_bid = (Axis_t)0.;
4853  Axis_t ysup_bid = (Axis_t)GeoBidSizeVeco;
4854 
4855  TString axis_x_var_name = " #Hoco ";
4856  TString axis_y_var_name = " #varVeco ";
4857 
4858  //............. matrices reading and histogram filling (ViewStas)
4859 
4860  TH2D* h_geo_bid = new TH2D("geobidim_ViewStas", f_in_mat_tit,
4861  nb_binx, xinf_bid, xsup_bid,
4862  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
4863  h_geo_bid->Reset();
4864 
4865  Int_t CounterExistingFile = 0;
4866  Int_t CounterDataExist = 0;
4867 
4868  Int_t* xFapNbOfEvts = new Int_t[fEcal->MaxStexInStas()]; fCnew++;
4869  for(Int_t i=0; i<fEcal->MaxStexInStas(); i++){xFapNbOfEvts[i]=0;}
4870 
4871  //Int_t* NOFE_int = new Int_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
4872 
4873  //......................................................................... (ViewStas)
4874  for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
4875  {
4876  TVectorD partial_histp(fEcal->MaxStinEcnaInStex());
4877  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){partial_histp(i)=(Double_t)0.;}
4878 
4879  Bool_t OKFileExists = kFALSE;
4880  Bool_t OKDataExist = kFALSE;
4881 
4882  if( arg_AlreadyRead == fTobeRead )
4883  {
4884  fMyRootFile->PrintNoComment();
4885  Int_t n1StasStex = iStasStex+1;
4886  fMyRootFile->FileParameters(fFapAnaType, fFapNbOfSamples,
4887  fFapRunNumber, fFapFirstReqEvtNumber,
4888  fFapLastReqEvtNumber, fFapReqNbOfEvts,
4889  n1StasStex, fCfgResultsRootFilePath.Data());
4890 
4891  if ( fMyRootFile->LookAtRootFile() == kTRUE ){OKFileExists = kTRUE;} // (ViewStas)
4892 
4893  if( OKFileExists == kTRUE )
4894  {
4895  xFapNbOfEvts[iStasStex] = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, n1StasStex);
4896  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
4897  // cout << "*TEcnaHistos::ViewStas(...)> Data are analyzed from file ----> "
4898  // << fp_name_short << endl;
4899 
4900  //....................... search for first and last dates
4901  if( iStasStex == 0 )
4902  {
4903  fStartTime = fMyRootFile->GetStartTime();
4904  fStopTime = fMyRootFile->GetStopTime();
4905  fStartDate = fMyRootFile->GetStartDate();
4906  fStopDate = fMyRootFile->GetStopDate();
4907  }
4908 
4909  time_t xStartTime = fMyRootFile->GetStartTime();
4910  time_t xStopTime = fMyRootFile->GetStopTime();
4911  TString xStartDate = fMyRootFile->GetStartDate();
4912  TString xStopDate = fMyRootFile->GetStopDate();
4913 
4914  if( xStartTime < fStartTime ){fStartTime = xStartTime; fStartDate = xStartDate;}
4915  if( xStopTime > fStopTime ){fStopTime = xStopTime; fStopDate = xStopDate;}
4916 
4917  fRunType = fMyRootFile->GetRunType();
4918 
4919  //----------------------------------------------------------------------------- file reading (ViewStas)
4920  if( HistoCode == "D_NOE_ChNb" ){
4921  partial_histp = fMyRootFile->ReadAverageNumberOfEvents(fEcal->MaxStinEcnaInStex());}
4922  if( HistoCode == "D_Ped_ChNb" ){
4923  partial_histp = fMyRootFile->ReadAveragePedestals(fEcal->MaxStinEcnaInStex());}
4924  if (HistoCode == "D_TNo_ChNb" ){
4925  partial_histp = fMyRootFile->ReadAverageTotalNoise(fEcal->MaxStinEcnaInStex());}
4926  if( HistoCode == "D_MCs_ChNb" ){
4927  partial_histp = fMyRootFile->ReadAverageMeanCorrelationsBetweenSamples(fEcal->MaxStinEcnaInStex());}
4928  if( HistoCode == "D_LFN_ChNb" ){
4929  partial_histp = fMyRootFile->ReadAverageLowFrequencyNoise(fEcal->MaxStinEcnaInStex());}
4930  if( HistoCode == "D_HFN_ChNb" ){
4931  partial_histp = fMyRootFile->ReadAverageHighFrequencyNoise(fEcal->MaxStinEcnaInStex());}
4932  if( HistoCode == "D_SCs_ChNb" ){
4933  partial_histp = fMyRootFile->ReadAverageSigmaOfCorrelationsBetweenSamples(fEcal->MaxStinEcnaInStex());}
4934 
4935  if ( fMyRootFile->DataExist() == kTRUE ){OKDataExist = kTRUE;}
4936  }
4937  else
4938  {
4939  fStatusFileFound = kFALSE;
4940  cout << "!TEcnaHistos::ViewStas(...)> *ERROR* =====> "
4941  << " ROOT file not found" << fTTBELL << endl;
4942  }
4943  }
4944 
4945  if( arg_AlreadyRead == 1 )
4946  {
4947  OKDataExist = kTRUE;
4948  for(Int_t i0Stin=0; i0Stin<fEcal->MaxStinEcnaInStex(); i0Stin++)
4949  {
4950  partial_histp(i0Stin) = arg_read_histo(fEcal->MaxStinEcnaInStex()*iStasStex+i0Stin);
4951  }
4952  }
4953 
4954  if( OKDataExist == kTRUE)
4955  {
4956  fStatusFileFound = kTRUE;
4957  CounterExistingFile++;
4958 
4959  //................................................................. (ViewStas)
4960  TMatrixD read_matrix(nb_binx, nb_biny);
4961  for(Int_t i=0; i<nb_binx; i++)
4962  {for(Int_t j=0; j<nb_biny; j++){read_matrix(i,j)=(Double_t)0.;}}
4963 
4964  if ( OKDataExist == kTRUE )
4965  {
4966  fStatusDataExist = kTRUE;
4967  CounterDataExist++;
4968 
4969  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
4970  {
4971  //-------------------------------------- Geographical bidim filling (ViewStas)
4972  Int_t i_xgeo = GetXStinInStas(iStasStex, i0StexStinEcna, vertic_empty_strip_1);
4973  Int_t i_ygeo = GetYStinInStas(iStasStex, i0StexStinEcna);
4974 
4975  if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
4976  {
4977  Int_t n1StexStinEcna = i0StexStinEcna+1;
4978 
4979  if( fFlagSubDet == "EB" )
4980  {
4981  read_matrix(i_xgeo, i_ygeo) = partial_histp(i0StexStinEcna);
4982  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
4983  (Double_t)read_matrix(i_xgeo, i_ygeo));
4984  }
4985 
4986  if( fFlagSubDet == "EE" )
4987  {
4988  //---------------------> do not draw bin for SCEcna = 10 or 11 (ViewStas)
4989  if( !( (n1StexStinEcna == 10 || n1StexStinEcna == 11 ||
4990  n1StexStinEcna == 29 || n1StexStinEcna == 32) ) )
4991  {
4992  read_matrix(i_xgeo, i_ygeo) = partial_histp(i0StexStinEcna);
4993  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
4994  (Double_t)read_matrix(i_xgeo, i_ygeo));
4995  }
4996  if( n1StexStinEcna == 29 )
4997  {
4998  //----------------------------------------------------------------- (ViewStas)
4999  // Average on SCEcna 29 (x1+x2+x3+x6+x7) and SCEcna 10: (x11)
5000  // (x = Xtal# in SC; see CMS NOTE 2006/027, p.10)
5001  //
5002  // (x1+x2+x3+x6+x7)/5 = partial_histp(29-1) ; x11 = partial_histp(10-1)
5003  //
5004  // => (x1+x2+x3+x6+x7+x11)/6 = partial_histp(29-1)*5/6 + partial_histp(10-1)/6
5005  //
5006  // // except for "D_NOE_ChNb" because average done in ReadAverageNumberOfEvents
5007  // // (no averaged NbOfEvts in root file)
5008  //---------------------------------------------------------------------------------
5009  read_matrix(i_xgeo, i_ygeo) =
5010  partial_histp(i0StexStinEcna)*(Double_t)(5./6.) + partial_histp(9)/(Double_t)6.;
5011  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
5012  (Double_t)read_matrix(i_xgeo, i_ygeo));
5013  }
5014  //if( n1StexStinEcna == 32 && HistoCode != "D_NOE_ChNb" ) (ViewStas)
5015  if( n1StexStinEcna == 32 )
5016  {
5017  //---- same as previous case: replace SCEcna 29 by 32 AND SCEcna 10 by 11
5018  //----> (x1+x2+x3+x6+x7+x11)/6 = partial_histp(32-1)*5/6 + partial_histp(11-1)/6
5019  read_matrix(i_xgeo, i_ygeo) =
5020  partial_histp(i0StexStinEcna)*(Double_t)(5./6.) + partial_histp(10)/(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  } // end of if( fFlagSubDet == "EE" )
5025  } // end of if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
5026  } // end of for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
5027  } // end of if ( fMyRootFile->DataExist() == kTRUE )
5028  else
5029  {
5030  fStatusDataExist = kFALSE;
5031 
5032  cout << "!TEcnaHistos::ViewStas(...)> "
5033  << " Data not available for " << fFapStexName << " " << iStasStex+1
5034  << " (Quantity not present in the ROOT file)" << fTTBELL << endl;
5035  }
5036  } // end of if( fMyRootFile->LookAtRootFile() == kTRUE ) (ViewStas)
5037  else
5038  {
5039  fStatusFileFound = kFALSE;
5040 
5041  cout << "!TEcnaHistos::ViewStas(...)> "
5042  << " Data not available for " << fFapStexName << " " << iStasStex+1
5043  << " (ROOT file not found)" << fTTBELL << endl;
5044  }
5045 
5046  if( fFapNbOfEvts <= xFapNbOfEvts[iStasStex] ){fFapNbOfEvts = xFapNbOfEvts[iStasStex];}
5047 
5048  } // end of for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
5049 
5050  //delete [] NOFE_int; NOFE_int = 0; fCdelete++;
5051  delete [] xFapNbOfEvts; xFapNbOfEvts = 0; fCdelete++;
5052 
5053  if( CounterExistingFile > 0 && CounterDataExist > 0 )
5054  {
5055  //=============== H I S T O M I N / M A X M A N A G E M E N T ============ (ViewStas)
5056  //................................ Put histo min max values
5057  //.......... default if flag not set to "ON"
5058  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
5059  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
5060 
5061  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
5062  //.......... user's value if flag set to "ON"
5063  if( fFlagUserHistoMin == "ON" )
5064  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
5065  if( fFlagUserHistoMax == "ON" )
5066  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
5067  //................................. automatic min and/or max
5068  if( fFlagUserHistoMin == "AUTO" )
5069  {SetYminMemoFromValue(HistoCode.Data(), h_geo_bid->GetMinimum()); fFlagUserHistoMin = "OFF";}
5070  if( fFlagUserHistoMax == "AUTO" )
5071  {SetYmaxMemoFromValue(HistoCode.Data(), h_geo_bid->GetMaximum()); fFlagUserHistoMax = "OFF";}
5072  //...................................... histo set ymin and ymax
5073  SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, HistoCode);
5074 
5075  // ************************** A GARDER EN RESERVE *******************************
5076  //............. special contour level for correlations (square root wise scale)
5077  //if ( HistoCode == "D_MCs_ChNb" )
5078  //{
5079  // Int_t nb_niv = 9;
5080  // Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
5081  // SqrtContourLevels(nb_niv, &cont_niv[0]);
5082  // h_geo_bid->SetContour(nb_niv, &cont_niv[0]);
5083  // delete [] cont_niv; fCdelete++;
5084  //}
5085  // ******************************** (FIN RESERVE) *******************************
5086 
5087  // =================================== P L O T S ======================== (ViewStas)
5088 
5089  char* f_in = new char[fgMaxCar]; fCnew++;
5090 
5091  //...................... Taille/format canvas
5092  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
5093  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
5094 
5095  if( fFlagSubDet == "EB")
5096  {canv_w = fCnaParHistos->CanvasFormatW("phietaEB");
5097  canv_h = fCnaParHistos->CanvasFormatH("phietaEB");}
5098  if( fFlagSubDet == "EE")
5099  {canv_w = fCnaParHistos->CanvasFormatW("IYIXEE");
5100  canv_h = fCnaParHistos->CanvasFormatH("IYIXEE");}
5101 
5102  //............................................... paves commentaires (ViewStas)
5103  SetAllPavesViewStas();
5104 
5105  //------------------------------------ Canvas name ----------------- (ViewStas)
5106  TString name_cov_cor;
5107  Int_t MaxCar = fgMaxCar;
5108  name_cov_cor.Resize(MaxCar);
5109  name_cov_cor = "?";
5110 
5111  if( HistoCode == "D_NOE_ChNb"){name_cov_cor = "Number_of_Events";}
5112  if( HistoCode == "D_Ped_ChNb"){name_cov_cor = "Pedestals";}
5113  if( HistoCode == "D_TNo_ChNb"){name_cov_cor = "Total_noise";}
5114  if( HistoCode == "D_MCs_ChNb"){name_cov_cor = "Mean_Corss";}
5115  if( HistoCode == "D_LFN_ChNb"){name_cov_cor = "Low_Fq_Noise";}
5116  if( HistoCode == "D_HFN_ChNb"){name_cov_cor = "High_Fq_Noise";}
5117  if( HistoCode == "D_SCs_ChNb"){name_cov_cor = "Sigma_Corss";}
5118 
5119  TString name_visu;
5120  MaxCar = fgMaxCar;
5121  name_visu.Resize(MaxCar);
5122  name_visu = "colz";
5123 
5124  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%s_%s_HocoVeco_R%d",
5125  name_cov_cor.Data(), fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
5126  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFlagSubDet.Data(),
5127  name_visu.Data(), arg_AlreadyRead);
5128 
5129  if( fFlagSubDet == "EB" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stas2DEB");}
5130  if( fFlagSubDet == "EE" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stas2DEE");}
5131 
5132  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
5133  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
5134 
5135  // cout << "*TEcnaHistos::ViewStas(...)> Plot is displayed on canvas ----> " << f_in << endl;
5136 
5137  delete [] f_in; f_in = 0; fCdelete++;
5138 
5139  //------------------------ Canvas draw and update ------------ (ViewStas)
5140  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
5141 
5142  fPavComStas->Draw();
5143  fPavComAnaRun->Draw();
5144  fPavComNbOfEvts->Draw();
5145 
5146  //----------------------------------------------------------- pad margins
5147  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
5148  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
5149  Double_t x_margin = x_low;
5150  Double_t y_margin = y_low;
5151  MainCanvas->Divide( 1, 1, x_margin, y_margin);
5152  // Divide(nx, ny, x_margin, y_margin, color);
5153  gPad->cd(1);
5154  //........................... specific EE
5155  if( fFlagSubDet == "EE" ){
5156  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
5157  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_EE") - 0.005;
5158  TVirtualPad* main_subpad = gPad;
5159  main_subpad->SetPad(x_low, y_low, x_up, y_up);}
5160 
5161  //------------------------------------------------------------
5162  h_geo_bid->GetXaxis()->SetTitle(axis_x_var_name);
5163  h_geo_bid->GetYaxis()->SetTitle(axis_y_var_name);
5164 
5165  h_geo_bid->DrawCopy("COLZ");
5166 
5167  // trace de la grille ---------------- (ViewStas)
5168  ViewStasGrid(vertic_empty_strips);
5169  gPad->Draw();
5170  gPad->Update();
5171 
5172  // delete MainCanvas; fCdeleteRoot++;
5173  }
5174  //..................... retour aux options standard
5175 
5176  Bool_t b_true = 1;
5177  h_geo_bid->SetStats(b_true);
5178  h_geo_bid->Delete(); h_geo_bid = 0; fCdeleteRoot++;
5179 
5180  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
5181 
5182 } // end of ViewStas(...)
5183 
5184 //==================================================================================
5185 //
5186 // GetXStinInStas , GetYStinInStas
5187 //
5188 //==================================================================================
5189 Int_t TEcnaHistos::GetXStinInStas(const Int_t& iStasStex, const Int_t& StexStinEcna,
5190  const Int_t& vertic_empty_strip_1)
5191 {
5192 //Gives the X Stin coordinate in the geographic view of the Stas
5193 // (X = 0 to MaxStexHocoInStas*MaxStinHocoInStex - 1 + vertic_empty_strips(EE only))
5194 
5195  Int_t ix_geo = 0;
5196  Int_t n1StasStex = iStasStex+1;
5197  TString ctype = fEcalNumbering->GetStexHalfStas(n1StasStex);
5198 
5199  if( fFlagSubDet == "EB")
5200  {
5201  if( ctype == "EB-")
5202  {
5203  ix_geo = (iStasStex - fEcal->MaxStexInStasMinus())*fEcal->MaxStinVecoInStex()
5204  + StexStinEcna%fEcal->MaxStinVecoInStex();
5205  }
5206  if( ctype == "EB+")
5207  {
5208  ix_geo = iStasStex*fEcal->MaxStinVecoInStex()
5209  + fEcal->MaxStinVecoInStex()- 1 - StexStinEcna%fEcal->MaxStinVecoInStex();
5210  }
5211  }
5212 
5213  if( fFlagSubDet == "EE")
5214  {
5215  TString LeftRightFromIP = fEcalNumbering->GetDeeDirViewedFromIP(n1StasStex);
5216 
5217  if( ctype == "EE-" && LeftRightFromIP == "left" )
5218  {
5219  ix_geo = fEcal->MaxStinHocoInStex() - StexStinEcna/fEcal->MaxStinVecoInStex() - 1 + vertic_empty_strip_1;
5220  }
5221  if( ctype == "EE-" && LeftRightFromIP == "right" )
5222  {
5223  ix_geo = fEcal->MaxStinHocoInStex() + StexStinEcna/fEcal->MaxStinVecoInStex() + vertic_empty_strip_1;
5224  }
5225  if( ctype == "EE+" && LeftRightFromIP == "left" )
5226  {
5227  ix_geo = (Int_t)fCnaParHistos->DeeOffsetX(fFlagSubDet, n1StasStex)
5228  + fEcal->MaxStinHocoInStex() - StexStinEcna/fEcal->MaxStinVecoInStex() - 1;
5229  }
5230  if( ctype == "EE+" && LeftRightFromIP == "right" )
5231  {
5232  ix_geo = (Int_t)fCnaParHistos->DeeOffsetX(fFlagSubDet, n1StasStex)
5233  + StexStinEcna/fEcal->MaxStinVecoInStex();
5234  }
5235  }
5236  return ix_geo;
5237 }
5238 
5239 Int_t TEcnaHistos::GetYStinInStas(const Int_t& iStasStex, const Int_t& StexStinEcna)
5240 {
5241 //Gives the Y crystal coordinate in the geographic view of one Stex
5242 // (Y = 0 to MaxStexVecoInStas*MaxStinVecoInStex - 1)
5243 
5244  Int_t iy_geo = 0;
5245 
5246  if( fFlagSubDet == "EB")
5247  {
5248  Int_t n1StasStex = iStasStex+1;
5249  TString ctype = fEcalNumbering->GetStexHalfStas(n1StasStex);
5250  if( ctype == "EB+")
5251  {iy_geo = StexStinEcna/fEcal->MaxStinVecoInStex() + fEcal->MaxStinHocoInStex(); }
5252  if( ctype == "EB-")
5253  {iy_geo = fEcal->MaxStinHocoInStex() - 1 - StexStinEcna/fEcal->MaxStinVecoInStex();}
5254  }
5255 
5256  if( fFlagSubDet == "EE")
5257  {iy_geo = StexStinEcna%fEcal->MaxStinVecoInStex();}
5258  return iy_geo;
5259 }
5260 
5261 //==========================================================================
5262 //
5263 // ViewStasGrid
5264 // independent of the ROOT file
5265 //
5266 //==========================================================================
5267 void TEcnaHistos::ViewStasGrid(const Int_t & vertic_empty_strips)
5268 {
5269  //Grid of Stas with axis Hoco and Veco
5270 
5271  if( fFlagSubDet == "EB"){ViewEBGrid();}
5272  if( fFlagSubDet == "EE"){ViewEEGrid(vertic_empty_strips);}
5273 
5274 } // end of ViewStasGrid
5275 
5277 {
5278  //Grid of EB with axis Hoco and Veco
5279 
5280  Int_t GeoBidSizeEta = fEcal->MaxSMEtaInEB()*fEcal->MaxTowEtaInSM();
5281  Int_t GeoBidSizePhi = fEcal->MaxSMPhiInEB()*fEcal->MaxTowPhiInSM();
5282 
5283  Int_t size_y = fEcal->MaxTowEtaInSM();
5284  Int_t size_x = fEcal->MaxTowPhiInSM();
5285 
5286  Int_t nb_binx = GeoBidSizePhi;
5287  Int_t nb_biny = GeoBidSizeEta;
5288  Axis_t xinf_bid = (Axis_t)0.;
5289  Axis_t xsup_bid = (Axis_t)nb_binx;
5290  Axis_t yinf_bid = (Axis_t)0.;
5291  Axis_t ysup_bid = (Axis_t)nb_biny;
5292 
5293  //---------------- trace de la grille: un rectangle = un SM
5294 
5295  Int_t max_x = nb_binx/size_x; // = fEcal->MaxSMPhiInEB()
5296  Int_t max_y = nb_biny/size_y; // = fEcal->MaxSMEtaInEB()
5297 
5298  //............................. lignes horizontales (ViewEBGrid)
5299  Double_t yline = (Double_t)yinf_bid;
5300 
5301  Double_t xline_left = (Double_t)xinf_bid;
5302  Double_t xline_right = (Double_t)xsup_bid;
5303 
5304  for( Int_t j = 0 ; j < max_y ; j++)
5305  {
5306  yline = yline + (Double_t)size_y;
5307  TLine *lin;
5308  lin = new TLine(xline_left, yline, xline_right, yline); fCnewRoot++;
5309  lin->Draw();
5310  // delete lin; fCdeleteRoot++;
5311  }
5312 
5313  //-------------------------------- lignes verticales
5314  Double_t xline = (Double_t)xinf_bid - (Double_t)size_x;
5315 
5316  Double_t yline_bot = (Double_t)yinf_bid;
5317  Double_t yline_top = (Double_t)ysup_bid;
5318 
5319  for( Int_t i = 0 ; i < max_x ; i++)
5320  {
5321  xline = xline + (Double_t)size_x;
5322  TLine *lin;
5323  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
5324  lin->Draw();
5325  }
5326 
5327  //-------------------------------- Numeros des SM
5328  Double_t yTextBot = yline_bot - (yline_top - yline_bot)/25.;
5329  Double_t yTextTop = yline_top + (yline_top - yline_bot)/120.;
5330  xline = (Double_t)xinf_bid - (Double_t)size_x;
5331 
5332  char* f_in = new char[fgMaxCar]; fCnew++;
5333  TText *text_SM = new TText(); fCnewRoot++;
5334  for( Int_t i = 0 ; i < max_x ; i++)
5335  {
5336  xline = xline + (Double_t)size_x;
5337  text_SM->SetTextColor(fCnaParHistos->ColorDefinition("bleu_fonce"));
5338  text_SM->SetTextSize((Double_t)0.03);
5339  sprintf( f_in, " +%d", i+1 );
5340  text_SM->DrawText(xline, yTextTop, f_in);
5341  sprintf( f_in, " %d", -i-1 );
5342  text_SM->DrawText(xline, yTextBot, f_in);
5343  }
5344  delete [] f_in; fCdelete++;
5345 
5346  //------------------ trace axes en eta et phi --------------- ViewEBGrid
5347 
5348  Int_t SMNumber = 1;
5349 
5350  //...................................................... Axe i(phi) (bottom x) ViewEBGrid
5351  Int_t MatSize = fEcal->MaxTowPhiInSM();
5352  Int_t size_x_eb = fEcal->MaxSMPhiInEB();
5353  Double_t phi_min = 0;
5354  Double_t phi_max = 360;
5355 
5356  TString x_var_name = GetHocoVecoAxisTitle("iphiEB");;
5357  TString x_direction = fEcalNumbering->GetXDirectionEB(SMNumber);
5358 
5359  new TF1("f1", x_direction.Data(), phi_min, phi_max); fCnewRoot++;
5360  TGaxis* sup_axis_x = 0;
5361 
5362  if( x_direction == "-x" ) // NEVER IN THIS CASE: xmin->xmax <=> right->left ("-x") direction
5363  {sup_axis_x = new TGaxis( (Float_t)0., (Float_t)0., (Float_t)(size_x_eb*MatSize), (Float_t)0.,
5364  "f1", size_x_eb, "SC" , 0.); fCnewRoot++;}
5365 
5366  if( x_direction == "x" ) // ALWAYS IN THIS CASE: xmin->xmax <=> left->right ("x") direction
5367  {sup_axis_x = new TGaxis( (Float_t)0., (Float_t)0., (Float_t)(size_x_eb*MatSize), (Float_t)0.,
5368  "f1", size_x_eb, "SC" , 0.); fCnewRoot++;}
5369 
5370  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
5371  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize("EBx");
5372  Float_t tic_siz_x = fCnaParHistos->AxisTickSize("SMx");
5373  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("EBx");
5374  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("EBx");
5375 
5376  sup_axis_x->SetTitle(x_var_name);
5377  sup_axis_x->SetTitleSize(tit_siz_x);
5378  sup_axis_x->SetTitleOffset(tit_off_x);
5379  sup_axis_x->SetLabelSize(lab_siz_x);
5380  sup_axis_x->SetLabelOffset(lab_off_x);
5381  sup_axis_x->SetTickSize(tic_siz_x);
5382  sup_axis_x->Draw("SAME");
5383 
5384  //...................................................... Axe eta (y) ViewEBGrid
5385  MatSize = fEcal->MaxTowEtaInSM();
5386  Int_t size_y_eb = fEcal->MaxSMEtaInEB();
5387 
5388  Double_t eta_min = (Double_t)(-85.);
5389  Double_t eta_max = (Double_t)85.;
5390 
5391  TString y_var_name = GetHocoVecoAxisTitle("ietaEB");
5392 
5393  TGaxis* sup_axis_y = 0;
5394  sup_axis_y = new TGaxis((Float_t)0., (Float_t)0.,
5395  (Float_t)0., (Float_t)(size_y_eb*MatSize),
5396  eta_min, eta_max, MatSize/2, "SC", 0.); fCnewRoot++;
5397 
5398  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
5399  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize("EBy");
5400  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("SMy");
5401  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("EBy");
5402  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("EBy");
5403 
5404  sup_axis_y->SetTitle(y_var_name);
5405  sup_axis_y->SetTitleSize(tit_siz_y);
5406  sup_axis_y->SetTitleOffset(tit_off_y);
5407  sup_axis_y->SetLabelColor(1);
5408  sup_axis_y->SetLabelSize(lab_siz_y);
5409  sup_axis_y->SetLabelOffset(lab_off_y);
5410  sup_axis_y->SetTickSize(tic_siz_y);
5411  sup_axis_y->Draw("SAME");
5412 
5413  //f2 = 0;
5414 
5415  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
5416 
5417 } // end of ViewEBGrid
5418 //---------------------------------------------------------------------
5419 void TEcnaHistos::ViewEEGrid(const Int_t& vertic_empty_strips)
5420 {
5421  //Grid of EE with axis Hoco and Veco
5422 
5423  Float_t coefcc_x = (Float_t)1./(Float_t)5.;
5424  Float_t coefcc_y = (Float_t)1./(Float_t)5.;
5425 
5426  for( Int_t DeeNumber = 1; DeeNumber <= 4; DeeNumber++)
5427  {
5428  EEDataSectors(coefcc_x, coefcc_y, DeeNumber, "EE");
5429  EEGridAxis(coefcc_x, coefcc_y, DeeNumber, "EE", " ");
5430  }
5431 
5432  // vertical line between the two endcaps
5433  Double_t xline = coefcc_x*( 2*fEcal->MaxCrysIXInDee()
5434  + ((Double_t)vertic_empty_strips)/2.*fEcal->MaxCrysIXInSC() );
5435 
5436  Double_t yline_bot = coefcc_y*(Double_t)0.;
5437  Double_t yline_top = coefcc_y*(Double_t)fEcal->MaxCrysIYInDee();
5438 
5439  TLine *lin;
5440  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
5441  lin->Draw();
5442 
5443  // vertical line in the midles of the two endcaps
5444  // xline = xline + coefcc_x*( fEcal->MaxCrysIXInDee()+ 0.5*fEcal->MaxCrysIXInSC() );
5445  xline = coefcc_x*(3*fEcal->MaxCrysIXInDee()
5446  + ((Double_t)vertic_empty_strips-1.)*fEcal->MaxCrysIXInSC() );
5447  TLine *lin12;
5448  lin12 = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
5449  lin12->SetLineStyle(2);
5450  lin12->Draw();
5451 
5452  xline = coefcc_x*(fEcal->MaxCrysIXInDee()
5453  + ((Double_t)vertic_empty_strips)/3.*fEcal->MaxCrysIXInSC() );
5454  TLine *lin34;
5455  lin34 = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
5456  lin34->SetLineStyle(2);
5457  lin34->Draw();
5458 
5459  // horizontal line at IY = 50
5460  Double_t xline_end = coefcc_x*( 4*fEcal->MaxCrysIXInDee() + vertic_empty_strips*fEcal->MaxCrysIXInSC());
5461  Double_t yline_mid = coefcc_x*fEcal->MaxCrysIYInDee()/2;
5462 
5463  TLine *linh;
5464  linh = new TLine( 0., yline_mid, xline_end, yline_mid); fCnewRoot++;
5465  linh->SetLineStyle(2);
5466  linh->Draw();
5467 
5468 } // end of ViewEEGrid
5469 
5470 //==================================================================================================
5471 void TEcnaHistos::EEDataSectors(const Float_t& coefcc_x, const Float_t& coefcc_y,
5472  const Int_t& DeeNumber, const TString& opt_plot)
5473 {
5474  //Surlignage des bords du Dee et des Data Sectors. Numeros des secteurs.
5475 
5476  // Epaisseur du trait selon option
5477  Int_t LineWidth = 2; // DEFAULT => option "EE"
5478  if( opt_plot == "Dee" ){LineWidth = 3;}
5479 
5480  Int_t ngmax = 0;
5481  // surlignage du bord interne du Dee (unite de coordonnees: le cristal)
5482  ngmax = 13;
5483  Float_t xg_dee_int_bot[13] = { 0, 5, 5, 7, 7, 8, 8, 9, 9,10,10,11,11};
5484  Float_t yg_dee_int_bot[13] = {39,39,40,40,41,41,42,42,43,43,45,45,50};
5485  for(Int_t i=0;i<ngmax;i++){
5486  xg_dee_int_bot[i] = coefcc_x*xg_dee_int_bot[i];
5487  yg_dee_int_bot[i] = coefcc_y*yg_dee_int_bot[i];}
5488 
5489  Float_t XgDeeIntBotRight[13]; Float_t YgDeeIntBotRight[13];
5490  Float_t XgDeeIntTopRight[13]; Float_t YgDeeIntTopRight[13];
5491 
5492  for( Int_t i=0; i<ngmax; i++)
5493  {
5494  XgDeeIntBotRight[i] = xg_dee_int_bot[i];
5495  YgDeeIntBotRight[i] = yg_dee_int_bot[i];
5496  XgDeeIntTopRight[i] = XgDeeIntBotRight[i];
5497  YgDeeIntTopRight[i] = coefcc_y*fEcal->MaxCrysIYInDee() - YgDeeIntBotRight[i];
5498  if ( DeeNumber == 2 || DeeNumber == 4 )
5499  {
5500  XgDeeIntBotRight[i] = -XgDeeIntBotRight[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5501  XgDeeIntTopRight[i] = -XgDeeIntTopRight[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5502  }
5503  XgDeeIntBotRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5504  XgDeeIntTopRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5505  }
5506 
5507  TGraph *BDeeIntBotRight = new TGraph(ngmax, XgDeeIntBotRight, YgDeeIntBotRight);
5508  BDeeIntBotRight->SetLineWidth(LineWidth);
5509  BDeeIntBotRight->Draw();
5510 
5511  TGraph *BDeeIntTopRight = new TGraph(ngmax, XgDeeIntTopRight, YgDeeIntTopRight);
5512  BDeeIntTopRight->SetLineWidth(LineWidth);
5513  BDeeIntTopRight->Draw();
5514 
5515  // surlignage du bord externe du Dee (unite de coordonnees: le cristal)
5516  ngmax = 21;
5517  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};
5518  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};
5519  for(Int_t i=0;i<ngmax;i++){
5520  xg_dee_ext_bot[i] = coefcc_x*xg_dee_ext_bot[i];
5521  yg_dee_ext_bot[i] = coefcc_y*yg_dee_ext_bot[i];}
5522 
5523  Float_t XgDeeExtBotRight[21]; Float_t YgDeeExtBotRight[21];
5524  Float_t XgDeeExtTopRight[21]; Float_t YgDeeExtTopRight[21];
5525 
5526  for( Int_t i=0; i<ngmax; i++)
5527  {
5528  XgDeeExtBotRight[i] = xg_dee_ext_bot[i];
5529  YgDeeExtBotRight[i] = yg_dee_ext_bot[i];
5530  XgDeeExtTopRight[i] = XgDeeExtBotRight[i];
5531  YgDeeExtTopRight[i] = coefcc_y*fEcal->MaxCrysIYInDee() - YgDeeExtBotRight[i];
5532  if ( DeeNumber == 2 || DeeNumber == 4 )
5533  {
5534  XgDeeExtBotRight[i] = -XgDeeExtBotRight[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5535  XgDeeExtTopRight[i] = -XgDeeExtTopRight[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5536  }
5537  XgDeeExtBotRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5538  XgDeeExtTopRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5539  }
5540 
5541  TGraph *BDeeExtBotRight = new TGraph(ngmax, XgDeeExtBotRight, YgDeeExtBotRight);
5542  BDeeExtBotRight->SetLineWidth(LineWidth);
5543  BDeeExtBotRight->Draw();
5544 
5545  TGraph *BDeeExtTopRight = new TGraph(ngmax, XgDeeExtTopRight, YgDeeExtTopRight);
5546  BDeeExtTopRight->SetLineWidth(LineWidth);
5547  BDeeExtTopRight->Draw();
5548 
5549  char* f_in = new char[fgMaxCar]; fCnew++;
5550 
5551  //............. Surlignage separateurs des secteurs en phi (Data sectors)
5552 
5553  //================== S9 -> S1 (EE-) option "EE" seulement
5554  if( opt_plot == "EE" )
5555  {
5556  ngmax = 2;
5557  Float_t xg_dee_data_sec9[2] = { 0, 0};
5558  Float_t yg_dee_data_sec9[2] = {61,100};
5559  for(Int_t i=0;i<ngmax;i++){
5560  xg_dee_data_sec9[i] = coefcc_x*xg_dee_data_sec9[i];
5561  yg_dee_data_sec9[i] = coefcc_y*yg_dee_data_sec9[i];}
5562 
5563  Float_t XgDeeDataSec9[11]; Float_t YgDeeDataSec9[11];
5564  for( Int_t i=0; i<ngmax; i++)
5565  {
5566  XgDeeDataSec9[i] = xg_dee_data_sec9[i]; YgDeeDataSec9[i] = yg_dee_data_sec9[i];
5567  if ( DeeNumber == 2 || DeeNumber == 4 )
5568  {
5569  XgDeeDataSec9[i] = -XgDeeDataSec9[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5570  }
5571  XgDeeDataSec9[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5572  }
5573  TGraph *BDeeDataSec9 = new TGraph(ngmax, XgDeeDataSec9, YgDeeDataSec9);
5574  BDeeDataSec9->SetLineWidth(LineWidth);
5575  BDeeDataSec9->Draw();
5576  }
5577 
5578  //================= S1->S2(EE-)
5579  ngmax = 11;
5580  Float_t xg_dee_data_sec1[11] = { 7,10,10,15,15,20,20,25,25,30,30};
5581  Float_t yg_dee_data_sec1[11] = {60,60,65,65,70,70,75,75,85,85,87};
5582  for(Int_t i=0;i<ngmax;i++){
5583  xg_dee_data_sec1[i] = coefcc_x*xg_dee_data_sec1[i];
5584  yg_dee_data_sec1[i] = coefcc_y*yg_dee_data_sec1[i];}
5585 
5586  Float_t XgDeeDataSec1[11]; Float_t YgDeeDataSec1[11];
5587  for( Int_t i=0; i<ngmax; i++)
5588  {
5589  XgDeeDataSec1[i] = xg_dee_data_sec1[i]; YgDeeDataSec1[i] = yg_dee_data_sec1[i];
5590  if ( DeeNumber == 2 || DeeNumber == 4 )
5591  {
5592  XgDeeDataSec1[i] = -XgDeeDataSec1[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5593  }
5594  XgDeeDataSec1[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5595  }
5596 
5597  TGraph *BDeeDataSec1 = new TGraph(ngmax, XgDeeDataSec1, YgDeeDataSec1);
5598  BDeeDataSec1->SetLineWidth(LineWidth);
5599  BDeeDataSec1->Draw();
5600 
5601  //================= S2->S3(EE-)
5602  ngmax = 6;
5603  Float_t xg_dee_data_sec2[6] = {11,15,15,40,40,47};
5604  Float_t yg_dee_data_sec2[6] = {50,50,55,55,60,60};
5605  for(Int_t i=0;i<ngmax;i++){
5606  xg_dee_data_sec2[i] = coefcc_x*xg_dee_data_sec2[i];
5607  yg_dee_data_sec2[i] = coefcc_y*yg_dee_data_sec2[i];}
5608 
5609  Float_t XgDeeDataSec2[6]; Float_t YgDeeDataSec2[6];
5610  for( Int_t i=0; i<ngmax; i++)
5611  {
5612  XgDeeDataSec2[i] = xg_dee_data_sec2[i]; YgDeeDataSec2[i] = yg_dee_data_sec2[i];
5613  if ( DeeNumber == 2 || DeeNumber == 4 )
5614  {
5615  XgDeeDataSec2[i] = -XgDeeDataSec2[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5616  }
5617  XgDeeDataSec2[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5618  }
5619  TGraph *BDeeDataSec2 = new TGraph(ngmax, XgDeeDataSec2, YgDeeDataSec2);
5620  BDeeDataSec2->SetLineWidth(LineWidth);
5621  BDeeDataSec2->Draw();
5622 
5623  //================= S3->S4(EE-)
5624  ngmax = 10;
5625  Float_t xg_dee_data_sec3[10] = {10,15,15,20,20,30,30,40,40,42};
5626  Float_t yg_dee_data_sec3[10] = {45,45,40,40,35,35,30,30,25,25};
5627  for(Int_t i=0;i<ngmax;i++){
5628  xg_dee_data_sec3[i] = coefcc_x*xg_dee_data_sec3[i];
5629  yg_dee_data_sec3[i] = coefcc_y*yg_dee_data_sec3[i];}
5630 
5631  Float_t XgDeeDataSec3[10]; Float_t YgDeeDataSec3[10];
5632  for( Int_t i=0; i<ngmax; i++)
5633  {
5634  XgDeeDataSec3[i] = xg_dee_data_sec3[i]; YgDeeDataSec3[i] = yg_dee_data_sec3[i];
5635  if ( DeeNumber == 2 || DeeNumber == 4 )
5636  {
5637  XgDeeDataSec3[i] = -XgDeeDataSec3[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5638  }
5639  XgDeeDataSec3[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5640  }
5641  TGraph *BDeeDataSec3 = new TGraph(ngmax, XgDeeDataSec3, YgDeeDataSec3);
5642  BDeeDataSec3->SetLineWidth(LineWidth);
5643  BDeeDataSec3->Draw();
5644 
5645  //================= S4->S5(EE-)
5646  ngmax = 6;
5647  Float_t xg_dee_data_sec4[6] = { 5, 5,10,10,15,15};
5648  Float_t yg_dee_data_sec4[6] = {40,30,30,15,15, 5};
5649  for(Int_t i=0;i<ngmax;i++){
5650  xg_dee_data_sec4[i] = coefcc_x*xg_dee_data_sec4[i];
5651  yg_dee_data_sec4[i] = coefcc_y*yg_dee_data_sec4[i];}
5652 
5653  Float_t XgDeeDataSec4[6]; Float_t YgDeeDataSec4[6];
5654  for( Int_t i=0; i<ngmax; i++)
5655  {
5656  XgDeeDataSec4[i] = xg_dee_data_sec4[i]; YgDeeDataSec4[i] = yg_dee_data_sec4[i];
5657  if ( DeeNumber == 2 || DeeNumber == 4 )
5658  {
5659  XgDeeDataSec4[i] = -XgDeeDataSec4[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5660  }
5661  XgDeeDataSec4[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5662  }
5663  TGraph *BDeeDataSec4 = new TGraph(ngmax, XgDeeDataSec4, YgDeeDataSec4);
5664  BDeeDataSec4->SetLineWidth(LineWidth);
5665  BDeeDataSec4->Draw();
5666 
5667 
5668  //..................................... Numeros des secteurs S_i (option "Dee" seulement)
5669  if( opt_plot == "Dee" || opt_plot == "EE" )
5670  {
5671  //............. Coordonnees des numeros de secteurs
5672  ngmax = 5;
5673  Float_t xg_coord_sector[5] = { 16, 41, 45, 33, -2};
5674  Float_t yg_coord_sector[5] = { 96, 83, 30, 5, -8};
5675 
5676  //....... Reprise secteurs 3 et 7
5677  if(opt_plot == "Dee" && (DeeNumber == 1) ){xg_coord_sector[2] += 0.5;}
5678  if(opt_plot == "Dee" && (DeeNumber == 2) ){xg_coord_sector[2] -= 1. ;}
5679  if(opt_plot == "Dee" && (DeeNumber == 3) ){xg_coord_sector[2] += 0.7;}
5680  if(opt_plot == "Dee" && (DeeNumber == 4) ){xg_coord_sector[2] -= 1.2;}
5681 
5682  if(opt_plot == "EE" && (DeeNumber == 2 || DeeNumber == 3) ){xg_coord_sector[2] += 0.55;}
5683  if(opt_plot == "EE" && (DeeNumber == 4 ) ){xg_coord_sector[2] -= 0.2;}
5684 
5685  for(Int_t i=0;i<ngmax;i++){
5686  xg_coord_sector[i] = coefcc_x*xg_coord_sector[i];
5687  yg_coord_sector[i] = coefcc_y*yg_coord_sector[i];}
5688 
5689  Float_t xg_sector[9];
5690  Float_t yg_sector[9];
5691  Int_t ns1 = 1;
5692  Int_t ns2 = 5;
5693  Float_t xinv_d2d4 = coefcc_x*44;
5694 
5695  if( DeeNumber == 1 )
5696  {
5697  ns1 = 1; ns2 = 5;
5698  xg_sector[1-ns1] = xg_coord_sector[1-ns1]; yg_sector[1-ns1] = yg_coord_sector[1-ns1];
5699  xg_sector[2-ns1] = xg_coord_sector[2-ns1]; yg_sector[2-ns1] = yg_coord_sector[2-ns1];
5700  xg_sector[3-ns1] = xg_coord_sector[3-ns1]; yg_sector[3-ns1] = yg_coord_sector[3-ns1];
5701  xg_sector[4-ns1] = xg_coord_sector[4-ns1]; yg_sector[4-ns1] = yg_coord_sector[4-ns1];
5702  xg_sector[5-ns1] = xg_coord_sector[5-ns1]; yg_sector[5-ns1] = yg_coord_sector[5-ns1];
5703  }
5704 
5705  if( DeeNumber == 2 )
5706  {
5707  ns1 = 5; ns2 = 9;
5708  xg_sector[ns2-1] = xinv_d2d4-xg_coord_sector[1-1]; yg_sector[ns2-1] = yg_coord_sector[1-1];
5709  xg_sector[ns2-2] = xinv_d2d4-xg_coord_sector[2-1]; yg_sector[ns2-2] = yg_coord_sector[2-1];
5710  xg_sector[ns2-3] = xinv_d2d4-xg_coord_sector[3-1]; yg_sector[ns2-3] = yg_coord_sector[3-1];
5711  xg_sector[ns2-4] = xinv_d2d4-xg_coord_sector[4-1]; yg_sector[ns2-4] = yg_coord_sector[4-1];
5712  xg_sector[ns2-5] = xinv_d2d4-xg_coord_sector[5-1]; yg_sector[ns2-5] = yg_coord_sector[5-1];
5713  }
5714  if( DeeNumber == 3 )
5715  {
5716  ns1 = 5; ns2 = 9;
5717  xg_sector[ns2-1]= xg_coord_sector[1-1]; yg_sector[ns2-1] = yg_coord_sector[1-1];
5718  xg_sector[ns2-2]= xg_coord_sector[2-1]; yg_sector[ns2-2] = yg_coord_sector[2-1];
5719  xg_sector[ns2-3]= xg_coord_sector[3-1]; yg_sector[ns2-3] = yg_coord_sector[3-1];
5720  xg_sector[ns2-4]= xg_coord_sector[4-1]; yg_sector[ns2-4] = yg_coord_sector[4-1];
5721  xg_sector[ns2-5]= xg_coord_sector[5-1]; yg_sector[ns2-5] = yg_coord_sector[5-1];
5722  }
5723  if( DeeNumber == 4 )
5724  {
5725  ns1 = 1; ns2 = 5;
5726  xg_sector[1-ns1]= xinv_d2d4-xg_coord_sector[1-ns1]; yg_sector[1-ns1] = yg_coord_sector[1-ns1];
5727  xg_sector[2-ns1]= xinv_d2d4-xg_coord_sector[2-ns1]; yg_sector[2-ns1] = yg_coord_sector[2-ns1];
5728  xg_sector[3-ns1]= xinv_d2d4-xg_coord_sector[3-ns1]; yg_sector[3-ns1] = yg_coord_sector[3-ns1];
5729  xg_sector[4-ns1]= xinv_d2d4-xg_coord_sector[4-ns1]; yg_sector[4-ns1] = yg_coord_sector[4-ns1];
5730  xg_sector[5-ns1]= xinv_d2d4-xg_coord_sector[5-ns1]; yg_sector[5-ns1] = yg_coord_sector[5-ns1];
5731  }
5732 
5733  Color_t coul_textsector = fCnaParHistos->ColorDefinition("vert37");
5734  for(Int_t ns=ns1; ns<= ns2; ns++)
5735  {
5736  xg_sector[ns-1] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5737  if( DeeNumber == 1 || DeeNumber == 2 ){sprintf( f_in, "+%d", ns);}
5738  if( DeeNumber == 3 || DeeNumber == 4 ){sprintf( f_in, "-%d", ns);}
5739  TText *text_num_module = new TText(xg_sector[ns-1], yg_sector[ns-1], f_in); fCnewRoot++;
5740  if(opt_plot == "Dee"){text_num_module->SetTextSize(0.065);}
5741  if(opt_plot == "EE" ){text_num_module->SetTextSize(0.045);}
5742  text_num_module->SetTextColor(coul_textsector);
5743  if( opt_plot == "Dee" ||
5744  ( opt_plot == "EE" && !( (DeeNumber == 3 && ns == 5) || (DeeNumber == 1 && ns == 5) ) ) )
5745  {text_num_module->Draw();}
5746 
5747  // text_num_module->Delete(); text_num_module = 0; fCdeleteRoot++;
5748  }
5749 
5750  //............................ numeros des dee's
5751  ngmax = 4;
5752  Float_t xg_coord_dee[4] = { 0, 0, 0, 0};
5753  Float_t yg_coord_dee[4] = {48, 48, 48, 48};
5754 
5755  xg_coord_dee[DeeNumber-1] = coefcc_x*xg_coord_dee[DeeNumber-1];
5756  yg_coord_dee[DeeNumber-1] = coefcc_y*yg_coord_dee[DeeNumber-1];
5757 
5758  Float_t xg_dee = xg_coord_dee[DeeNumber-1];
5759  Float_t yg_dee = yg_coord_dee[DeeNumber-1];
5760 
5761  Color_t coul_textdee = fCnaParHistos->ColorDefinition("noir");
5762 
5763  xg_dee += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber)
5764  + fCnaParHistos->DeeNumberOffsetX(opt_plot, DeeNumber);
5765 
5766  if( DeeNumber == 1 ){sprintf( f_in, "D1");}
5767  if( DeeNumber == 2 ){sprintf( f_in, "D2");}
5768  if( DeeNumber == 3 ){sprintf( f_in, "D3");}
5769  if( DeeNumber == 4 ){sprintf( f_in, "D4");}
5770 
5771  TText *text_num_module = new TText(xg_dee, yg_dee, f_in); fCnewRoot++;
5772  if( opt_plot == "EE" ){text_num_module->SetTextSize(0.045);}
5773  if( opt_plot == "Dee"){text_num_module->SetTextSize(0.085);}
5774  text_num_module->SetTextColor(coul_textdee);
5775  text_num_module->Draw();
5776  }
5777 
5778  //..................................... Numeros des Dee et indication EE+- (option "EE" seulement)
5779  if( opt_plot == "EE" )
5780  {
5781  //............................ indication EE+-
5782  ngmax = 4;
5783  Float_t xg_coord_eepm[4] = { 0, 0, 0, 0};
5784  Float_t yg_coord_eepm[4] = {95, 95, 95, 95};
5785 
5786  xg_coord_eepm[DeeNumber-1] = coefcc_x*xg_coord_eepm[DeeNumber-1];
5787  yg_coord_eepm[DeeNumber-1] = coefcc_y*yg_coord_eepm[DeeNumber-1];
5788 
5789  Float_t xg_eepm = xg_coord_eepm[DeeNumber-1];
5790  Float_t yg_eepm = yg_coord_eepm[DeeNumber-1];
5791 
5792  Color_t coul_texteepm = fCnaParHistos->ColorDefinition("noir");
5793 
5794  xg_eepm += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber)
5795  + fCnaParHistos->DeeNameOffsetX(DeeNumber);
5796 
5797  if( DeeNumber == 1 ){sprintf( f_in, "EE+F");}
5798  if( DeeNumber == 2 ){sprintf( f_in, "EE+N");}
5799  if( DeeNumber == 3 ){sprintf( f_in, "EE-N");}
5800  if( DeeNumber == 4 ){sprintf( f_in, "EE-F");}
5801 
5802  TText *text_num_eepm = new TText(xg_eepm, yg_eepm, f_in); fCnewRoot++;
5803  text_num_eepm->SetTextSize(0.04);
5804  text_num_eepm->SetTextColor(coul_texteepm);
5805  text_num_eepm->Draw();
5806  }
5807 
5808  //......................... mention "viewed from IP"
5809  Color_t coul_textfromIP = fCnaParHistos->ColorDefinition("rouge49");
5810  sprintf( f_in, "viewed from IP");
5811  Float_t x_from_ip = 15.;
5812  Float_t y_from_ip = -10.;
5813  if( opt_plot == "EE" ){y_from_ip = -16.;}
5814  x_from_ip = coefcc_x*x_from_ip;
5815  y_from_ip = coefcc_x*y_from_ip;
5816  if( opt_plot == "EE" && DeeNumber == 3 ){x_from_ip += 1.4*fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);}
5817  TText *text_from_ip = new TText(x_from_ip, y_from_ip, f_in); fCnewRoot++;
5818  text_from_ip->SetTextSize(0.045);
5819  if( opt_plot == "EE" ){text_from_ip->SetTextSize(0.035);}
5820  text_from_ip->SetTextColor(coul_textfromIP);
5821  if( opt_plot == "Dee" || (opt_plot == "EE" && DeeNumber == 3) ){text_from_ip->Draw();}
5822 
5823  delete [] f_in; f_in = 0; fCdelete++;
5824 
5825 } // ------ end of EEDataSectors() ------
5826 
5827 //==========================================================================================
5828 
5829 void TEcnaHistos::EEGridAxis(const Float_t& coefcc_x, const Float_t& coefcc_y,
5830  const Int_t& DeeNumber, const TString& opt_plot, const TString& c_option)
5831 {
5832  //------------------ trace axes en IX et IY --------------- EEGridAxis
5833  //=============================================================================== Axe IX
5834  Int_t size_IX_dee = fEcal->MaxSCIXInDee();
5835 
5836  Double_t IX_min = fEcalNumbering->GetIIXMin(1) - 0.5; // IX_min = 0.5 pour les 4 dee's
5837  Double_t IX_max = fEcalNumbering->GetIIXMax()*fEcal->MaxCrysIXInSC() + 0.5; // IX_max = 50.5 pour les 4 dee's
5838 
5839  Int_t MatSize = 1;
5840  if( opt_plot == "Dee" && c_option == "corcc" )
5841  {
5842  MatSize = fEcal->MaxCrysInSC();
5843  IX_min = fEcalNumbering->GetIIXMin() - 0.5;
5844  IX_max = fEcalNumbering->GetIIXMax() + 0.5;
5845  }
5846  if( opt_plot == "EE" && c_option == "corcc" ){return;} // => a voir...
5847 
5848  if( opt_plot == "Dee" && c_option != "corcc" ){MatSize = fEcal->MaxCrysIXInSC();}
5849  if( opt_plot == "EE" && c_option != "corcc" ){MatSize = 1;}
5850 
5851  TString x_var_name = " ";
5852 
5853  Float_t axis_x_inf = 0;
5854  Float_t axis_x_sup = 0;
5855  Float_t axis_y_inf = 0;
5856  Float_t axis_y_sup = 0;
5857  Int_t axis_nb_div = 205; // DEFAULT: option "EE"
5858  Double_t IX_values_min = 0;
5859  Double_t IX_values_max = 0;
5860  Option_t* chopt = "C";
5861 
5862  //........................................................................EEGridAxis
5863  if( DeeNumber == 1 ) // xmin -> xmax <=> right->left
5864  {
5865  //.....axis min->max/left->right: first draw axis with -ticksize and no label
5866  axis_x_inf = size_IX_dee*MatSize;
5867  axis_x_sup = 0;
5868  axis_y_inf = 0;
5869  axis_y_sup = 0;
5870  IX_values_min = -IX_max; // -50.5 right
5871  IX_values_max = -IX_min; // - 0.5 left
5872  if( opt_plot == "Dee" ){x_var_name = GetIXIYAxisTitle("iIXDee1");}
5873  if( opt_plot == "EE" ){x_var_name = GetIXIYAxisTitle("iIXEE");}
5874  if( opt_plot == "Dee" ){axis_nb_div = size_IX_dee;}
5875  chopt = "-CSU";
5876  }
5877  if( DeeNumber == 2 ) // xmin -> xmax <=> right->left
5878  {
5879  //.....axis min->max/left->right: first draw axis with -ticksize and no label
5880  axis_x_inf = size_IX_dee*MatSize;
5881  axis_x_sup = 0;
5882  axis_y_inf = 0;
5883  axis_y_sup = 0;
5884  IX_values_min = IX_min; // + 0.5 right
5885  IX_values_max = IX_max; // +50.5 left
5886  if( opt_plot == "Dee" ){x_var_name = GetIXIYAxisTitle("iIXDee2");}
5887  if( opt_plot == "EE" ){x_var_name = " ";}
5888  if( opt_plot == "Dee" ){axis_nb_div = size_IX_dee;}
5889  chopt = "-CSU";
5890  }
5891  if( DeeNumber == 3 ) // xmin -> xmax <=> left->right
5892  {
5893  axis_x_inf = 0;
5894  axis_x_sup = size_IX_dee*MatSize;
5895  axis_y_inf = 0;
5896  axis_y_sup = 0;
5897  IX_values_min = IX_min; // + 0.5 left
5898  IX_values_max = IX_max; // +50.5 right
5899  if( opt_plot == "Dee" ){x_var_name = GetIXIYAxisTitle("iIXDee3");}
5900  if( opt_plot == "EE" ){x_var_name = " ";}
5901  if( opt_plot == "Dee" ){axis_nb_div = size_IX_dee;}
5902  chopt = "CS";
5903  }
5904  if( DeeNumber == 4 ) // xmin -> xmax <=> left->right
5905  {
5906  axis_x_inf = 0;
5907  axis_x_sup = size_IX_dee*MatSize;
5908  axis_y_inf = 0;
5909  axis_y_sup = 0;
5910  IX_values_min = -IX_max; // -50.5 left
5911  IX_values_max = -IX_min; // - 0.5 right
5912  if( opt_plot == "Dee" ){x_var_name = GetIXIYAxisTitle("iIXDee4");}
5913  if( opt_plot == "EE" ){x_var_name = " ";}
5914  if( opt_plot == "Dee" ){axis_nb_div = size_IX_dee;}
5915  chopt = "CS";
5916  }
5917 
5918  //.................................................................... EEGridAxis
5919  axis_x_inf += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5920  axis_x_sup += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5921 
5922  TGaxis* sup_axis_x = 0;
5923  sup_axis_x = new TGaxis(axis_x_inf, axis_y_inf, axis_x_sup, axis_y_sup,
5924  IX_values_min, IX_values_max, axis_nb_div, chopt, 0.); fCnewRoot++;
5925 
5926  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
5927  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize();
5928 
5929  Float_t tic_siz_x = fCnaParHistos->AxisTickSize("Deex");
5930  if(opt_plot == "EE"){tic_siz_x = fCnaParHistos->AxisTickSize("EEx");}
5931 
5932  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("Deex");
5933  if(opt_plot == "EE"){tit_off_x = fCnaParHistos->AxisTitleOffset("EEx");}
5934 
5935  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("Deex");
5936  if(opt_plot == "EE"){lab_off_x = fCnaParHistos->AxisLabelOffset("EEx");}
5937 
5938  sup_axis_x->SetTitle(x_var_name);
5939  sup_axis_x->SetTitleSize(tit_siz_x);
5940  sup_axis_x->SetTitleOffset(tit_off_x);
5941  sup_axis_x->SetLabelSize(lab_siz_x);
5942  sup_axis_x->SetLabelOffset(lab_off_x);
5943  sup_axis_x->SetTickSize(tic_siz_x);
5944  sup_axis_x->Draw("SAME");
5945 
5946  //.....axis min->max/right->left: redraw axis with ticksize = 0 and with -labelOffset
5947  if( DeeNumber == 1 || DeeNumber == 2 )
5948  {
5949  chopt = "CS";
5950  TGaxis* sup_axis_x_bis = 0;
5951  sup_axis_x_bis = new TGaxis(axis_x_inf, axis_y_inf, axis_x_sup, axis_y_sup,
5952  IX_values_min, IX_values_max, axis_nb_div, chopt, 0.); fCnewRoot++;
5953  sup_axis_x_bis->SetTickSize(0.);
5954  lab_siz_x = sup_axis_x->GetLabelSize();
5955  sup_axis_x_bis->SetLabelSize(lab_siz_x);
5956  lab_off_x = sup_axis_x->GetLabelOffset();
5957  sup_axis_x_bis->SetLabelOffset(-lab_off_x);
5958  sup_axis_x_bis->Draw("SAME");
5959  }
5960 
5961  //================================================================== Axe IY EEGridAxis
5962 
5963  if( opt_plot == "Dee" || (opt_plot == "EE" && DeeNumber == 4) )
5964  {
5965  Int_t size_IY_dee = fEcal->MaxSCIYInDee();
5966  Int_t size_IY_axis = size_IY_dee;
5967 
5968  if( opt_plot == "Dee" ){axis_nb_div = size_IY_axis;}
5969  if( opt_plot == "EE" ){axis_nb_div = 210;}
5970 
5971  Double_t jIY_min = fEcalNumbering->GetJIYMin(DeeNumber, 1) - 0.5;
5972  Double_t jIY_max = fEcalNumbering->GetJIYMax(DeeNumber)*fEcal->MaxCrysIYInSC() + 0.5;
5973 
5974  TString jy_var_name = " ";
5975  TString jy_direction = "x";
5976 
5977  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
5978  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
5979 
5980  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("Deey");
5981  if(opt_plot == "EE"){tic_siz_y = fCnaParHistos->AxisTickSize("EEy");}
5982 
5983  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("Deey");
5984  if(opt_plot == "EE"){tit_off_y = fCnaParHistos->AxisTitleOffset("EEy");}
5985 
5986  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("Deey");
5987  if(opt_plot == "EE"){lab_off_y = fCnaParHistos->AxisLabelOffset("EEy");}
5988 
5989  TGaxis* axis_jy_plus = 0;
5990  axis_jy_plus = new TGaxis((Float_t)0., (Float_t)0.,
5991  (Float_t)0., (Float_t)(size_IY_axis*MatSize),
5992  jIY_min, jIY_max, axis_nb_div, "SC", 0.); fCnewRoot++;
5993 
5994  jy_var_name = GetIXIYAxisTitle("jIYDee");
5995  axis_jy_plus->SetTitle(jy_var_name);
5996  axis_jy_plus->SetTitleSize(tit_siz_y);
5997  axis_jy_plus->SetTitleOffset(tit_off_y);
5998  axis_jy_plus->SetLabelSize(lab_siz_y);
5999  axis_jy_plus->SetLabelOffset(lab_off_y);
6000  axis_jy_plus->SetTickSize(tic_siz_y);
6001  axis_jy_plus->Draw("SAME");
6002  }
6003 
6004 //---------------------------------- 2 axes (0,50) et (0,-50)
6005 #define IYAX
6006 #ifndef IYAX
6007  if( opt_plot == "Dee" || (opt_plot == "EE" && DeeNumber == 4) )
6008  {
6009  Int_t size_IY_dee = fEcal->MaxSCIYInDee();
6010  Int_t size_IY_axis = size_IY_dee/2;
6011 
6012  if( opt_plot == "Dee" ){axis_nb_div = (Int_t)size_IY_axis;}
6013  if( opt_plot == "EE" ){axis_nb_div = 5;}
6014 
6015  Double_t jIY_min = fEcalNumbering->GetJIYMin(DeeNumber, 1) - 0.5;
6016  Double_t jIY_max = (fEcalNumbering->GetJIYMax(DeeNumber)/2)*fEcal->MaxCrysIYInSC() + 0.5;
6017 
6018  TString jy_var_name = " ";
6019  TString jy_direction = "x";
6020 
6021  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
6022  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
6023 
6024  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("Deey");
6025  if(opt_plot == "EE"){tic_siz_y = fCnaParHistos->AxisTickSize("EEy");}
6026 
6027  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("Deey");
6028  if(opt_plot == "EE"){tit_off_y = fCnaParHistos->AxisTitleOffset("EEy");}
6029 
6030  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("Deey");
6031  if(opt_plot == "EE"){lab_off_y = fCnaParHistos->AxisLabelOffset("EEy");}
6032 
6033  TGaxis* axis_jy_plus = 0;
6034  axis_jy_plus = new TGaxis((Float_t)0., (Float_t)(size_IY_dee*MatSize/2),
6035  (Float_t)0., (Float_t)(2*size_IY_dee*MatSize/2),
6036  jIY_min, jIY_max, axis_nb_div, "SC", 0.); fCnewRoot++;
6037 
6038  jy_var_name = GetIXIYAxisTitle("jIYDee");
6039  axis_jy_plus->SetTitle(jy_var_name);
6040  axis_jy_plus->SetTitleSize(tit_siz_y);
6041  axis_jy_plus->SetTitleOffset(tit_off_y);
6042  axis_jy_plus->SetLabelSize(lab_siz_y);
6043  axis_jy_plus->SetLabelOffset(lab_off_y);
6044  axis_jy_plus->SetTickSize(tic_siz_y);
6045  axis_jy_plus->Draw("SAME");
6046 
6047  TGaxis* axis_jy_minus = 0;
6048  axis_jy_minus = new TGaxis((Float_t)0., (Float_t)(size_IY_dee*MatSize/2),
6049  (Float_t)0., (Float_t)0.,
6050  -jIY_min, -jIY_max, axis_nb_div, "-SC", 0.); fCnewRoot++;
6051 
6052  jy_var_name = GetIXIYAxisTitle("jIYDee");
6053  axis_jy_minus->SetTitle(jy_var_name);
6054  axis_jy_minus->SetTitleSize(tit_siz_y);
6055  axis_jy_minus->SetTitleOffset(tit_off_y);
6056  axis_jy_minus->SetLabelSize(lab_siz_y);
6057  axis_jy_minus->SetLabelOffset(lab_off_y);
6058  axis_jy_minus->SetTickSize(tic_siz_y);
6059  axis_jy_minus->Draw("SAME");
6060  }
6061 #endif // IYAX
6062 
6063 } // ------------- end of EEGridAxis(...) --------------
6064 
6065 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6066 //
6067 // ViewHisto(***)
6068 //
6069 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6070 //======================== D_MSp_SpNb
6071 void TEcnaHistos::XtalSamplesEv(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6072  const Int_t& n1StexStin, const Int_t& i0StinEcha)
6073 {XtalSamplesEv(arg_read_histo, arg_AlreadyRead, n1StexStin, i0StinEcha, "ONLYONE");}
6074 void TEcnaHistos::XtalSamplesEv(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6075  const Int_t& n1StexStin, const Int_t& i0StinEcha,
6076  const TString& PlotOption)
6077 {
6078  if( fFapStexNumber > 0 )
6079  {
6080  if( PlotOption == fAllXtalsInStinPlot )
6081  {
6082  Int_t StexStin_A = n1StexStin;
6083  if( fFlagSubDet == "EE" )
6084  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6085 
6086  Bool_t aOKData = kFALSE;
6087  TVectorD read_histo(fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6088 
6089  if( arg_AlreadyRead == fTobeRead )
6090  {
6091  fMyRootFile->PrintNoComment();
6092  fMyRootFile->FileParameters(fFapAnaType, fFapNbOfSamples,
6093  fFapRunNumber, fFapFirstReqEvtNumber,
6094  fFapLastReqEvtNumber, fFapReqNbOfEvts,
6095  fFapStexNumber, fCfgResultsRootFilePath.Data());
6096 
6097  if ( fMyRootFile->LookAtRootFile() == kTRUE )
6098  {
6099  fStatusFileFound = kTRUE;
6100  read_histo = fMyRootFile->ReadSampleMeans(StexStin_A, fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6101  if( fMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE;}
6102  }
6103  else
6104  {
6105  fStatusFileFound = kFALSE;
6106  cout << "!TEcnaHistos::XtalSamplesEv(...)> Data not available (ROOT file not found)." << endl;
6107  }
6108  if( fStatusFileFound == kTRUE && fStatusDataExist == kTRUE ){aOKData = kTRUE;}
6109  }
6110  if( arg_AlreadyRead >= 1 )
6111  {
6112  for(Int_t i=0; i<fEcal->MaxCrysInStin()*fEcal->MaxSampADC(); i++){read_histo[i] = arg_read_histo[i];}
6113  fStatusDataExist = kTRUE;
6114  aOKData = kTRUE;
6115  }
6116 
6117  if( aOKData == kTRUE )
6118  {
6119  TVectorD read_histo_samps(fFapNbOfSamples);
6120 
6121  Int_t xAlreadyRead = 1;
6122  for( Int_t i0_stin_echa=0; i0_stin_echa<fEcal->MaxCrysInStin(); i0_stin_echa++)
6123  {
6124  if( fFapStexName == "SM" )
6125  {cout << "*TEcnaHistos::XtalSamplesEv(...)> channel " << setw(2) << i0_stin_echa << ": ";}
6126  if( fFapStexName == "Dee" )
6127  {cout << "*TEcnaHistos::XtalSamplesEv(...)> Xtal " << setw(2) << i0_stin_echa+1 << ": ";}
6128 
6129  for( Int_t i0_samp=0; i0_samp<fFapNbOfSamples; i0_samp++ )
6130  {
6131  read_histo_samps(i0_samp) = read_histo(i0_stin_echa*fFapNbOfSamples+i0_samp);
6132  cout << setprecision(4) << setw(8) << read_histo_samps(i0_samp) << ", " ;
6133  }
6134  cout << endl;
6135  ViewHisto(read_histo_samps, xAlreadyRead,
6136  StexStin_A, i0_stin_echa, fZerv, "D_MSp_SpNb", fAllXtalsInStinPlot);
6137  xAlreadyRead++;
6138  }
6139  xAlreadyRead = 0;
6140  }
6141  else
6142  {
6143  cout << "!TEcnaHistos::XtalSamplesEv(...)> Data not available." << endl;
6144  }
6145  }
6146 
6147  if( !(PlotOption == fAllXtalsInStinPlot) )
6148  {
6149  Int_t StexStin_A = n1StexStin;
6150  if( fFlagSubDet == "EE" )
6151  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6152  ViewHisto(fReadHistoDummy, fTobeRead, StexStin_A, i0StinEcha, fZerv, "D_MSp_SpNb", PlotOption);
6153  }
6154  }
6155  else
6156  {
6157  cout << "!TEcnaHistos::XtalSamplesEv(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6158  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << endl;
6159  }
6160 }
6161 
6162 //======================== D_MSp_SpDs
6163 void TEcnaHistos::EvSamplesXtals(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6164  const Int_t& n1StexStin, const Int_t& i0StinEcha)
6165 {EvSamplesXtals(arg_read_histo, arg_AlreadyRead, n1StexStin, i0StinEcha, "ONLYONE");}
6166 void TEcnaHistos::EvSamplesXtals(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6167  const Int_t& n1StexStin, const Int_t& i0StinEcha,
6168  const TString& PlotOption)
6169 {
6170  if( fFapStexNumber > 0 )
6171  {
6172  if( PlotOption == fAllXtalsInStinPlot )
6173  {
6174  Int_t StexStin_A = n1StexStin;
6175  if( fFlagSubDet == "EE" )
6176  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6177 
6178  Bool_t aOKData = kFALSE;
6179  TVectorD read_histo(fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6180 
6181  if( arg_AlreadyRead == fTobeRead )
6182  {
6183  fMyRootFile->PrintNoComment();
6184  fMyRootFile->FileParameters(fFapAnaType, fFapNbOfSamples,
6185  fFapRunNumber, fFapFirstReqEvtNumber,
6186  fFapLastReqEvtNumber, fFapReqNbOfEvts,
6187  fFapStexNumber, fCfgResultsRootFilePath.Data());
6188 
6189  if ( fMyRootFile->LookAtRootFile() == kTRUE )
6190  {
6191  fStatusFileFound = kTRUE;
6192  read_histo = fMyRootFile->ReadSampleMeans(StexStin_A, fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6193  if( fMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE;}
6194  }
6195  else
6196  {
6197  fStatusFileFound = kFALSE;
6198  cout << "!TEcnaHistos::EvSamplesXtals(...)> Data not available (ROOT file not found)." << endl;
6199  }
6200  if( fStatusFileFound == kTRUE && fStatusDataExist == kTRUE ){aOKData = kTRUE;}
6201  }
6202  if( arg_AlreadyRead >= 1 )
6203  {
6204  for(Int_t i=0; i<fEcal->MaxCrysInStin()*fEcal->MaxSampADC(); i++){read_histo[i] = arg_read_histo[i];}
6205  fStatusDataExist = kTRUE;
6206  aOKData = kTRUE;
6207  }
6208  if( aOKData == kTRUE )
6209  {
6210  TVectorD read_histo_samps(fFapNbOfSamples);
6211 
6212  Int_t xAlreadyRead = 1;
6213  for( Int_t i0_stin_echa=0; i0_stin_echa<fEcal->MaxCrysInStin(); i0_stin_echa++)
6214  {
6215  if( fFapStexName == "SM" )
6216  {cout << "*TEcnaHistos::EvSamplesXtals(...)> channel " << setw(2) << i0_stin_echa << ": ";}
6217  if( fFapStexName == "Dee" )
6218  {cout << "*TEcnaHistos::EvSamplesXtals(...)> Xtal " << setw(2) << i0_stin_echa+1 << ": ";}
6219 
6220  for( Int_t i0_samp=0; i0_samp<fFapNbOfSamples; i0_samp++ )
6221  {
6222  read_histo_samps(i0_samp) = read_histo(i0_stin_echa*fFapNbOfSamples+i0_samp);
6223  cout << setprecision(4) << setw(8) << read_histo_samps(i0_samp) << ", " ;
6224  }
6225  cout << endl;
6226  ViewHisto(read_histo_samps, xAlreadyRead,
6227  StexStin_A, i0_stin_echa, fZerv, "D_MSp_SpDs", fAllXtalsInStinPlot);
6228  xAlreadyRead++;
6229  }
6230  xAlreadyRead = 0;
6231  }
6232  else
6233  {
6234  cout << "!TEcnaHistos::EvSamplesXtals(...)> Data not available." << endl;
6235  }
6236  }
6237 
6238  if( !(PlotOption == fAllXtalsInStinPlot) )
6239  {
6240  Int_t StexStin_A = n1StexStin;
6241  if( fFlagSubDet == "EE" )
6242  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6243  ViewHisto(fReadHistoDummy, fTobeRead, StexStin_A, i0StinEcha, fZerv, "D_MSp_SpDs", PlotOption);
6244  }
6245  }
6246  else
6247  {
6248  cout << "!TEcnaHistos::EvSamplesXtals(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6249  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << endl;
6250  }
6251 } // end of EvSamplesXtals(...)
6252 
6253 //======================== D_SSp_SpNb
6254 void TEcnaHistos::XtalSamplesSigma(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6255  const Int_t& n1StexStin, const Int_t& i0StinEcha)
6256 {XtalSamplesSigma(arg_read_histo, arg_AlreadyRead, n1StexStin, i0StinEcha, "ONLYONE");}
6257 void TEcnaHistos::XtalSamplesSigma(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6258  const Int_t& n1StexStin, const Int_t& i0StinEcha,
6259  const TString& PlotOption)
6260 {
6261  if( fFapStexNumber > 0 )
6262  {
6263  if( PlotOption == fAllXtalsInStinPlot )
6264  {
6265  Int_t StexStin_A = n1StexStin;
6266  if( fFlagSubDet == "EE" )
6267  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6268 
6269  Bool_t aOKData = kFALSE;
6270  TVectorD read_histo(fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6271 
6272  if( arg_AlreadyRead == fTobeRead )
6273  {
6274  fMyRootFile->PrintNoComment();
6275  fMyRootFile->FileParameters(fFapAnaType, fFapNbOfSamples,
6276  fFapRunNumber, fFapFirstReqEvtNumber,
6277  fFapLastReqEvtNumber, fFapReqNbOfEvts,
6278  fFapStexNumber, fCfgResultsRootFilePath.Data());
6279 
6280  if ( fMyRootFile->LookAtRootFile() == kTRUE )
6281  {
6282  fStatusFileFound = kTRUE;
6283  read_histo = fMyRootFile->ReadSampleSigmas(StexStin_A, fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6284  if( fMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE;}
6285  }
6286  else
6287  {
6288  fStatusFileFound = kFALSE;
6289  cout << "!TEcnaHistos::XtalSamplesSigma(...)> Data not available (ROOT file not found)." << endl;
6290  }
6291  if( fStatusFileFound == kTRUE && fStatusDataExist == kTRUE ){aOKData = kTRUE;}
6292  }
6293  if( arg_AlreadyRead >= 1 )
6294  {
6295  for(Int_t i=0; i<fEcal->MaxCrysInStin()*fEcal->MaxSampADC(); i++){read_histo[i] = arg_read_histo[i];}
6296  fStatusDataExist = kTRUE;
6297  aOKData = kTRUE;
6298  }
6299  if( aOKData == kTRUE )
6300  {
6301  TVectorD read_histo_samps(fFapNbOfSamples);
6302 
6303  Int_t xAlreadyRead = 1;
6304  for( Int_t i0_stin_echa=0; i0_stin_echa<fEcal->MaxCrysInStin(); i0_stin_echa++)
6305  {
6306  if( fFapStexName == "SM" )
6307  {cout << "*TEcnaHistos::XtalSamplesSigma(...)> channel " << setw(2) << i0_stin_echa << ": ";}
6308  if( fFapStexName == "Dee" )
6309  {cout << "*TEcnaHistos::XtalSamplesSigma(...)> Xtal " << setw(2) << i0_stin_echa+1 << ": ";}
6310 
6311  for( Int_t i0_samp=0; i0_samp<fFapNbOfSamples; i0_samp++ )
6312  {
6313  read_histo_samps(i0_samp) = read_histo(i0_stin_echa*fFapNbOfSamples+i0_samp);
6314  cout << setprecision(3) << setw(6) << read_histo_samps(i0_samp) << ", " ;
6315  }
6316  cout << endl;
6317  ViewHisto(read_histo_samps, xAlreadyRead,
6318  StexStin_A, i0StinEcha, fZerv, "D_SSp_SpNb", fAllXtalsInStinPlot);
6319  xAlreadyRead++;
6320  }
6321  xAlreadyRead = 0;
6322  }
6323  else
6324  {
6325  cout << "!TEcnaHistos::XtalSamplesSigma(...)> Data not available." << endl;
6326  }
6327  }
6328 
6329  if( !(PlotOption == fAllXtalsInStinPlot) )
6330  {
6331  Int_t StexStin_A = n1StexStin;
6332  if( fFlagSubDet == "EE" )
6333  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6334  ViewHisto(fReadHistoDummy, fTobeRead, StexStin_A, i0StinEcha, fZerv, "D_SSp_SpNb", PlotOption);
6335  }
6336  }
6337  else
6338  {
6339  cout << "!TEcnaHistos::XtalSamplesSigma(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6340  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << endl;
6341  }
6342 }
6343 
6344 
6345 //======================== D_SSp_SpDs
6346 void TEcnaHistos::SigmaSamplesXtals(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6347  const Int_t& n1StexStin, const Int_t& i0StinEcha)
6348 {SigmaSamplesXtals(arg_read_histo, arg_AlreadyRead, n1StexStin, i0StinEcha, "ONLYONE");}
6349 void TEcnaHistos::SigmaSamplesXtals(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6350  const Int_t& n1StexStin, const Int_t& i0StinEcha,
6351  const TString& PlotOption)
6352 {
6353  if( fFapStexNumber > 0 )
6354  {
6355  if( PlotOption == fAllXtalsInStinPlot )
6356  {
6357  Int_t StexStin_A = n1StexStin;
6358  if( fFlagSubDet == "EE" )
6359  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6360 
6361  Bool_t aOKData = kFALSE;
6362  TVectorD read_histo(fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6363 
6364  if( arg_AlreadyRead == fTobeRead )
6365  {
6366  fMyRootFile->PrintNoComment();
6367  fMyRootFile->FileParameters(fFapAnaType, fFapNbOfSamples,
6368  fFapRunNumber, fFapFirstReqEvtNumber,
6369  fFapLastReqEvtNumber, fFapReqNbOfEvts,
6370  fFapStexNumber, fCfgResultsRootFilePath.Data());
6371  if ( fMyRootFile->LookAtRootFile() == kTRUE )
6372  {
6373  fStatusFileFound = kTRUE;
6374  read_histo = fMyRootFile->ReadSampleSigmas(StexStin_A, fEcal->MaxCrysInStin()*fEcal->MaxSampADC());
6375  if( fMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE;}
6376  }
6377  else
6378  {
6379  fStatusFileFound = kFALSE;
6380  cout << "!TEcnaHistos::SigmaSamplesXtals(...)> Data not available (ROOT file not found)." << endl;
6381  }
6382  if( fStatusFileFound == kTRUE && fStatusDataExist == kTRUE ){aOKData = kTRUE;}
6383  }
6384 
6385  if( arg_AlreadyRead >= 1 )
6386  {
6387  for(Int_t i=0; i<fEcal->MaxCrysInStin()*fEcal->MaxSampADC(); i++){read_histo[i] = arg_read_histo[i];}
6388  fStatusDataExist = kTRUE;
6389  aOKData = kTRUE;
6390  }
6391  if( aOKData == kTRUE )
6392  {
6393  TVectorD read_histo_samps(fFapNbOfSamples);
6394 
6395  Int_t xAlreadyRead = 1;
6396  for( Int_t i0_stin_echa=0; i0_stin_echa<fEcal->MaxCrysInStin(); i0_stin_echa++)
6397  {
6398  if( fFapStexName == "SM" )
6399  {cout << "*TEcnaHistos::SigmaSamplesXtals(...)> channel " << setw(2) << i0_stin_echa << ": ";}
6400  if( fFapStexName == "Dee" )
6401  {cout << "*TEcnaHistos::SigmaSamplesXtals(...)> Xtal " << setw(2) << i0_stin_echa+1 << ": ";}
6402 
6403  for( Int_t i0_samp=0; i0_samp<fFapNbOfSamples; i0_samp++ )
6404  {
6405  read_histo_samps(i0_samp) = read_histo(i0_stin_echa*fFapNbOfSamples+i0_samp);
6406  cout << setprecision(3) << setw(6) << read_histo_samps(i0_samp) << ", " ;
6407  }
6408  cout << endl;
6409  ViewHisto(read_histo_samps, xAlreadyRead,
6410  StexStin_A, i0StinEcha, fZerv, "D_SSp_SpDs", fAllXtalsInStinPlot);
6411  xAlreadyRead++;
6412  }
6413  xAlreadyRead = 0;
6414  }
6415  else
6416  {
6417  cout << "!TEcnaHistos::SigmaSamplesXtals(...)> Data not available." << endl;
6418  }
6419  }
6420 
6421  if( !(PlotOption == fAllXtalsInStinPlot) )
6422  {
6423  Int_t StexStin_A = n1StexStin;
6424  if( fFlagSubDet == "EE" )
6425  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, n1StexStin);}
6426  ViewHisto(fReadHistoDummy, fTobeRead, StexStin_A, i0StinEcha, fZerv, "D_SSp_SpDs", PlotOption);
6427  }
6428  }
6429  else
6430  {
6431  cout << "!TEcnaHistos::SigmaSamplesXtals(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6432  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << endl;
6433  }
6434 } // end of SigmaSamplesXtals(...)
6435 
6436 //==========================================================================================
6437 //
6438 // ViewHisto
6439 //
6440 // arg_read_histo = array containing the values
6441 // arg_AlreadyRead = histo flag: =1 => arg_read_histo exists,
6442 // =0 => values will be read by internal
6443 // call to TEcnaRead inside ViewHisto
6444 // StexStin_A = [1,68] or [1,150] ==> tower# if EB, SC# if EE
6445 // i0StinEcha = [0,24] = Electronic channel# in tower (if EB) or SC (if EE)
6446 // i0Sample = [0,9] = sample#
6447 // HistoCode = String for histo type (pedestal, total noise, mean cor(s,s), ...)
6448 // opt_plot_arg = String for plot option (SAME or not SAME)
6449 //
6450 //===========================================================================================
6451 void TEcnaHistos::ViewHisto(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
6452  const Int_t& StexStin_A, const Int_t& i0StinEcha,
6453  const Int_t& i0Sample, const TString& HistoCode,
6454  const TString& opt_plot_arg)
6455 {
6456  //Histogram of the quantities (one run)
6457 
6458  TString opt_plot = opt_plot_arg;
6459  fPlotAllXtalsInStin = 0;
6460 
6461  if( opt_plot_arg == fAllXtalsInStinPlot ){opt_plot = fOnlyOnePlot; fPlotAllXtalsInStin = 1;}
6462 
6463  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
6464 
6465  Int_t OKHisto = 0;
6466 
6467  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Canvas already closed in option SAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6468  Int_t xCanvasExists = 1; // a priori ==> Canvas exists // (ViewHisto)
6469  if( opt_plot != fOnlyOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
6470  {
6471  TVirtualPad* main_subpad = 0;
6472  //---------------- Call to ActivePad
6473  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
6474  if( main_subpad == 0 )
6475  {
6476  cout << "*TEcnaHistos::ViewHisto(...)> WARNING ===> Canvas has been closed in option SAME or SAME n."
6477  << endl
6478  << " Please, restart with a new canvas."
6479  << fTTBELL << endl;
6480 
6481  ReInitCanvas(HistoCode, opt_plot);
6482  xCanvasExists = 0;
6483  }
6484  }
6485  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6486 
6487  //%%%%%%%%%%%%%%%%%%%%%%%% Change of X variable in option SAME n with no proj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6488  Int_t SameXVarMemo = 1; // a priori ==> SAME n option: X variable OK (ViewHisto)
6489  if( !(HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj") &&
6490  !(arg_AlreadyRead >= 1) )
6491  {
6492  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
6493  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
6494  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
6495  {
6496  SetXVarMemo(HistoCode, opt_plot, XVarHisto); SetYVarMemo(HistoCode, opt_plot, YVarHisto); SameXVarMemo = 1;
6497  }
6498  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
6499  {
6500  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
6501  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
6502 
6503  if( XVarHisto != XVariableMemo )
6504  {
6505  cout << "!TEcnaHistos::ViewHisto(...)> *** ERROR *** ===> X coordinate changed in option SAME n." << endl
6506  << " Present X = " << XVarHisto << endl
6507  << " Present Y = " << YVarHisto << endl
6508  << " Previous X = " << XVariableMemo << endl
6509  << " Previous Y = " << YVariableMemo
6510  << fTTBELL << endl;
6511  SameXVarMemo = 0;
6512  }
6513  else
6514  {SetYVarMemo(HistoCode, opt_plot, YVarHisto);}
6515  }
6516  }
6517  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6518 
6519  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Change of Y variable in option SAME n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6520  Int_t SameYVarMemo = 1; // a priori ==> SAME n option: Y variable OK (ViewHisto)
6521  if( (HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj") &&
6522  !(arg_AlreadyRead >= 1) )
6523  {
6524  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
6525  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
6526  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
6527  {
6528  SetYVarMemo(HistoCode, opt_plot, YVarHisto); SetYVarMemo(HistoCode, opt_plot, YVarHisto); SameYVarMemo = 1;
6529  }
6530  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
6531  {
6532  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
6533  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
6534 
6535  if( YVarHisto != YVariableMemo )
6536  {
6537  cout << "!TEcnaHistos::ViewHisto(...)> *** ERROR *** ===> Y coordinate changed in option SAME n." << endl
6538  << " Present X = " << XVarHisto << endl
6539  << " Present Y = " << YVarHisto << endl
6540  << " Previous X = " << XVariableMemo << endl
6541  << " Previous Y = " << YVariableMemo
6542  << fTTBELL << endl;
6543  SameYVarMemo = 0;
6544  }
6545  else
6546  {SetYVarMemo(HistoCode, opt_plot, YVarHisto);}
6547  }
6548  }
6549  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6550 
6551  //%%%%%%%%%%%%%%%%%%%%%%%%%%% Number of bins change in option SAME or SAME n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6552  Int_t OkBinsMemoSameOne = 1; // a priori ==> SAME n option: Nb bins OK (ViewHisto)
6553 
6554  Int_t SizeForPlot = GetHistoSize(HistoCode.Data(), "plot");
6555  Int_t xNbBins = GetHistoNumberOfBins(HistoCode.Data(), SizeForPlot);
6556 
6557  if( (opt_plot == fSameOnePlot || opt_plot == fSeveralPlot) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
6558  {
6559  SetNbBinsMemo(HistoCode, opt_plot, xNbBins); OkBinsMemoSameOne = 1;
6560  }
6561 
6562  if( (opt_plot == fSameOnePlot || opt_plot == fSeveralPlot) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
6563  {
6564  Int_t NbBinsMemo = GetNbBinsFromMemo(HistoCode, opt_plot);
6565  if( xNbBins != NbBinsMemo )
6566  {
6567  cout << "!TEcnaHistos::ViewHisto(...)> *** ERROR *** ===> Number of bins changed in option SAME or SAME n."
6568  << " Present number = " << xNbBins << ", requested number = " << NbBinsMemo << fTTBELL << endl;
6569  OkBinsMemoSameOne = 0;
6570  }
6571  }
6572 
6573  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6574 
6575  if( xCanvasExists == 1 && SameXVarMemo == 1 && SameYVarMemo == 1 && OkBinsMemoSameOne == 1 ){OKHisto = 1;}
6576 
6577  //======================== Histo accepted (ViewHisto)
6578  if( OKHisto == 1 )
6579  {
6580  Int_t opt_scale_x = fOptScaleLinx;
6581  if (fFlagScaleX == "LIN" ){opt_scale_x = fOptScaleLinx;}
6582  if (fFlagScaleX == "LOG" ){opt_scale_x = fOptScaleLogx;}
6583 
6584  Int_t opt_scale_y = fOptScaleLiny;
6585  if (fFlagScaleY == "LIN" ){opt_scale_y = fOptScaleLiny;}
6586  if (fFlagScaleY == "LOG" ){opt_scale_y = fOptScaleLogy;}
6587 
6588  fCnaParHistos->SetColorPalette(fFlagColPal);
6589  TString fp_name_short = " ";
6590 
6591  //-------------------- read_histo size
6592  Int_t SizeForRead = GetHistoSize(HistoCode.Data(), "read");
6593 
6594  //............................................... allocation/init_histo
6595  TVectorD histo_for_plot(SizeForPlot);
6596  for(Int_t i=0; i<SizeForPlot; i++){histo_for_plot[i]=(Double_t)0;}
6597 
6598  TVectorD histo_for_plot_memo(SizeForPlot);
6599  for(Int_t i=0; i<SizeForPlot; i++){histo_for_plot_memo[i]=(Double_t)0;}
6600 
6601  Int_t i_data_exist = 0;
6602  Int_t OKPlot = 0;
6603 
6604  //------------------------------------- histos Global, (Global)Proj, SampGlobal and SampProj
6605  if( HistoType == "Global" || HistoType == "Proj" || HistoType == "SampGlobal" ||
6606  HistoType == "SampProj" )
6607  {
6608  if( fFapStexNumber == 0 )
6609  {
6610  Bool_t ok_view_histo = kFALSE;
6611 
6612  //--------------------------------------------------------------------- Stas Histo (ViewHisto)
6613  Int_t CounterExistingFile = 0;
6614  Int_t CounterDataExist = 0;
6615 
6616  Int_t* xFapNbOfEvts = new Int_t[fEcal->MaxStexInStas()]; fCnew++;
6617  for(Int_t i=0; i<fEcal->MaxStexInStas(); i++){xFapNbOfEvts[i]=0;}
6618 
6619  //Int_t* NOFE_int = new Int_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
6620 
6621  for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
6622  {
6623  Bool_t OKFileExists = kFALSE;
6624  Bool_t ok_data_exists = kFALSE;
6625 
6626  TVectorD read_histo(fEcal->MaxStinEcnaInStex());
6627  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){read_histo(i)=(Double_t)0.;}
6628 
6629  if( arg_AlreadyRead == 0 )
6630  {
6631  //----------------------------------------------------------------------------- file reading
6632  fMyRootFile->PrintNoComment();
6633  Int_t n1StasStex = iStasStex+1;
6634  fMyRootFile->FileParameters(fFapAnaType, fFapNbOfSamples,
6635  fFapRunNumber, fFapFirstReqEvtNumber,
6636  fFapLastReqEvtNumber, fFapReqNbOfEvts,
6637  n1StasStex, fCfgResultsRootFilePath.Data());
6638 
6639  if( fMyRootFile->LookAtRootFile() == kTRUE ){OKFileExists = kTRUE;} // (ViewHisto, Stas)
6640  if( OKFileExists == kTRUE )
6641  {
6642  xFapNbOfEvts[iStasStex] = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, n1StasStex);
6643  fp_name_short = fMyRootFile->GetRootFileNameShort();
6644  // cout << "*TEcnaHistos::ViewHisto(...)> Data are analyzed from file ----> "
6645  // << fp_name_short << endl;
6646  //....................... search for first and last dates
6647  if( iStasStex == 0 )
6648  {
6649  fStartTime = fMyRootFile->GetStartTime();
6650  fStopTime = fMyRootFile->GetStopTime();
6651  fStartDate = fMyRootFile->GetStartDate();
6652  fStopDate = fMyRootFile->GetStopDate();
6653  }
6654 
6655  time_t xStartTime = fMyRootFile->GetStartTime();
6656  time_t xStopTime = fMyRootFile->GetStopTime();
6657  TString xStartDate = fMyRootFile->GetStartDate();
6658  TString xStopDate = fMyRootFile->GetStopDate();
6659 
6660  if( xStartTime < fStartTime ){fStartTime = xStartTime; fStartDate = xStartDate;}
6661  if( xStopTime > fStopTime ){fStopTime = xStopTime; fStopDate = xStopDate;}
6662 
6663  fRunType = fMyRootFile->GetRunType();
6664  ok_view_histo =
6665  GetOkViewHisto(fMyRootFile, StexStin_A, i0StinEcha, i0Sample, HistoCode.Data());
6666 
6667  if( ok_view_histo == kTRUE )
6668  {
6669  //............................................... histo reading (ViewHisto, Stas)
6670  if( HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" ){
6671  read_histo = fMyRootFile->ReadAverageNumberOfEvents(fEcal->MaxStinEcnaInStex());}
6672  if( HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs" ){
6673  read_histo = fMyRootFile->ReadAveragePedestals(fEcal->MaxStinEcnaInStex());}
6674  if( HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs" ){
6675  read_histo = fMyRootFile->ReadAverageTotalNoise(fEcal->MaxStinEcnaInStex());}
6676  if( HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" ){
6677  read_histo = fMyRootFile->ReadAverageMeanCorrelationsBetweenSamples(fEcal->MaxStinEcnaInStex());}
6678  if( HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" ){
6679  read_histo = fMyRootFile->ReadAverageLowFrequencyNoise(fEcal->MaxStinEcnaInStex());}
6680  if( HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" ){
6681  read_histo = fMyRootFile->ReadAverageHighFrequencyNoise(fEcal->MaxStinEcnaInStex());}
6682  if( HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs" ){
6683  read_histo = fMyRootFile->ReadAverageSigmaOfCorrelationsBetweenSamples(fEcal->MaxStinEcnaInStex());}
6684  if( fMyRootFile->DataExist() == kTRUE ){ok_data_exists = kTRUE;}
6685  }
6686  }
6687  }
6688 
6689  if( arg_AlreadyRead >= 1 )
6690  {
6691  ok_data_exists = kTRUE;
6692  for(Int_t i0Stin=0; i0Stin<fEcal->MaxStinEcnaInStex(); i0Stin++ )
6693  {read_histo(i0Stin) = arg_read_histo(fEcal->MaxStinEcnaInStex()*iStasStex+i0Stin);}
6694  }
6695 
6696  if( ok_data_exists == kTRUE )
6697  {
6698  fStatusFileFound = kTRUE;
6699  CounterExistingFile++;
6700 
6701 
6702  //...........................................................
6703  if( ok_data_exists == kTRUE )
6704  {
6705  fStatusDataExist = kTRUE;
6706  CounterDataExist++;
6707 
6708  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
6709  {
6710  //Int_t n1StexStinEcna = i0StexStinEcna+1;
6711  //-------------------------------------- Stas histo filling (ViewHisto, Stas)
6712  Int_t i_xgeo = -1;
6713  //...................................... EB
6714  if( fFlagSubDet == "EB" )
6715  {
6716  i_xgeo = iStasStex*fEcal->MaxStinEcnaInStex() + i0StexStinEcna;
6717  if( i_xgeo >= 0 && i_xgeo < SizeForPlot )
6718  {
6719  histo_for_plot[i_xgeo] = read_histo[i0StexStinEcna];
6720  }
6721  else
6722  {
6723  cout << "!TEcnaHistos::ViewHisto(...)> <EB> i_xgeo = " << i_xgeo
6724  << ". OUT OF RANGE ( range = [0,"<< SizeForPlot << "] " << endl;
6725  }
6726  }
6727  //...................................... EE (ViewHisto)
6728  //-------> Dee order: D4, D3, D2, D1
6729  if( fFlagSubDet == "EE" )
6730  {
6731  Int_t DeeOffset = 0;
6732  Int_t DSOffset = 0;
6733 
6734  Int_t DeeNumber = iStasStex+1;
6735  Int_t n1DeeSCEcna = i0StexStinEcna+1;
6736 
6737  //................................................ Dee offset
6738  if( DeeNumber == 3 ){DeeOffset += fEcal->MaxSCForConsInDee();} // 149
6739  if( DeeNumber == 2 ){DeeOffset += 3*fEcal->MaxSCForConsInDee()-1;} // 446
6740  if( DeeNumber == 1 ){DeeOffset += 4*fEcal->MaxSCForConsInDee()-1;} // 595
6741 
6742  //................................................ Data Sector offset (ViewHisto, Stas)
6743  Int_t StexDataSector = fEcalNumbering->GetDSFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
6744  //.... returns 0 if n1DeeSCEcna corresponds to an empty "ECNA-SC"
6745 
6746  //................................................ SC final coordinate (ViewHisto, Stas)
6747  Int_t StexDSStin = fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
6748  //--> return StexDSStin = 25 (not 3) for n1DeeSCEcna = 32
6749  //--> return StexDSStin = 14 (not 21) for n1DeeSCEcna = 29
6750  //--> return StexDSStin = -1 for n1DeeSCEcna = 10 and n1DeeSCEcna = 11
6751 
6752  if( StexDataSector >= 1 && StexDataSector <= 9 )
6753  {
6754  if( DeeNumber == 4 ) // Sectors 1,2,3,4,5a
6755  {
6756  for(Int_t is=2; is<=5; is++)
6757  { if( StexDataSector >= is )
6758  {Int_t ism = is-1; DSOffset += fEcalNumbering->GetMaxSCInDS(ism);}}
6759  }
6760 
6761  if( DeeNumber == 3 ) // Sectors 5b,6,7,8,9
6762  {
6763  if( StexDataSector >= 6 )
6764  {DSOffset += fEcalNumbering->GetMaxSCInDS(5)/2;}
6765  for(Int_t is=7; is<=9; is++)
6766  { if( StexDataSector >= is )
6767  {Int_t ism = is-1; DSOffset += fEcalNumbering->GetMaxSCInDS(ism);}}
6768  }
6769 
6770  if( DeeNumber == 2 ) // Sectors 9,8,7,6,5a
6771  {
6772  if( StexDataSector >= 6 )
6773  {DSOffset -= fEcalNumbering->GetMaxSCInDS(5)/2;}
6774  for(Int_t is=7; is<=9; is++)
6775  {if( StexDataSector >= is )
6776  {Int_t ism = is-1; DSOffset -= fEcalNumbering->GetMaxSCInDS(ism);}}
6777  }
6778 
6779  if( DeeNumber == 1 ) // Sectors 5b,4,3,2,1
6780  {
6781  for(Int_t is=2; is<=5; is++)
6782  { if( StexDataSector >= is )
6783  {Int_t ism = is-1; DSOffset -= fEcalNumbering->GetMaxSCInDS(ism);}}
6784  }
6785 
6786  if( StexDSStin >=1 && StexDSStin <= fEcalNumbering->GetMaxSCInDS(StexDataSector) )
6787  {
6788  if( DeeNumber == 4 ) // Sectors 1,2,3,4,5a
6789  {
6790  if(StexDataSector != 5)
6791  {i_xgeo = DeeOffset + DSOffset + (StexDSStin - 1);}
6792  if( StexDataSector == 5)
6793  {i_xgeo = DeeOffset + DSOffset + (StexDSStin - 1);}
6794  }
6795  if( DeeNumber == 3 ) // Sectors 5b,6,7,8,9
6796  {
6797  if(StexDataSector != 5)
6798  {i_xgeo = DeeOffset + DSOffset + (StexDSStin - 1);}
6799  if( StexDataSector == 5)
6800  {i_xgeo = DeeOffset + DSOffset + (StexDSStin-17) - 1;}
6801  }
6802  if( DeeNumber == 2 ) // Sectors 5a,6,7,8,9
6803  {
6804  if(StexDataSector != 5)
6805  {i_xgeo = DeeOffset + DSOffset
6806  - fEcalNumbering->GetMaxSCInDS(StexDataSector) + StexDSStin;}
6807  if( StexDataSector == 5)
6808  {i_xgeo = DeeOffset + DSOffset
6809  - fEcalNumbering->GetMaxSCInDS(StexDataSector)/2 + StexDSStin;}
6810  }
6811  if( DeeNumber == 1 ) // Sectors 1,2,3,4,5b
6812  {
6813  if(StexDataSector != 5)
6814  {i_xgeo = DeeOffset + DSOffset
6815  - fEcalNumbering->GetMaxSCInDS(StexDataSector) + StexDSStin;}
6816  if( StexDataSector == 5)
6817  {i_xgeo = DeeOffset + DSOffset
6818  - fEcalNumbering->GetMaxSCInDS(StexDataSector)/2 +(StexDSStin-17);}
6819  }
6820 
6821  }// end of if(StexDSStin >=1 && StexDSStin <= fEcalNumbering->GetMaxSCInDS(StexDataSector))
6822  else
6823  {
6824  cout << "!TEcnaHistos::ViewHisto(...)> <EE> StexDSStin = " << StexDSStin
6825  << ". OUT OF RANGE ( range = [1,"
6826  << fEcalNumbering->GetMaxSCInDS(StexDataSector)
6827  << "]. DeeNumber = " << DeeNumber
6828  << ", n1DeeSCEcna = " << n1DeeSCEcna
6829  << ", StexDataSector = " << StexDataSector
6830  << ", i_xgeo = " << i_xgeo << endl;
6831  }
6832  }// end of if( StexDataSector >= 1 && StexDataSector <= 9 )
6833  else
6834  {
6835  //cout << "!TEcnaHistos::ViewHisto(...)> <EE> StexDataSector = " << StexDataSector
6836  // << ". OUT OF RANGE ( range = [1,9]. DeeNumber = " << DeeNumber
6837  // << ", n1DeeSCEcna = " << n1DeeSCEcna
6838  // << ", i_xgeo = " << i_xgeo << endl;
6839  }
6840  //......................................... transfert read_histo -> histo_for_plot
6841  if( i_xgeo >= -1 && i_xgeo < SizeForPlot )
6842  {
6843  // special treatement for not connected & mixed SC's
6844  if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 || // 261a, 207c, 268a, 178c
6845  // [ 14a, 25c, 21a, 3c]
6846  n1DeeSCEcna == 144 || n1DeeSCEcna == 165 || // 261c, 261b [14c, 14b]
6847  n1DeeSCEcna == 176 || n1DeeSCEcna == 193 || // 207a, 207b [25a, 25b]
6848  n1DeeSCEcna == 60 || n1DeeSCEcna == 119 || // 182a, 182b [30a, 30b]
6849  n1DeeSCEcna == 102 || n1DeeSCEcna == 123 || // 268c, 268b [21c, 21b]
6850  n1DeeSCEcna == 138 || n1DeeSCEcna == 157 ) // 178a, 178b [ 3a, 3b]
6851  {
6852  //--------------- DSSC 14
6853  if( n1DeeSCEcna == 29 && i_xgeo >= 0 )
6854  {histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna]/(Double_t)5.;}
6855  if( (n1DeeSCEcna == 144 || n1DeeSCEcna == 165) && i_xgeo >= 0 )
6856  {histo_for_plot[i_xgeo] +=
6857  read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)25.;}
6858 
6859  //--------------- DSSC 25
6860  if( n1DeeSCEcna == 32 && i_xgeo >= 0 )
6861  {histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna]/(Double_t)5.;}
6862  if( (n1DeeSCEcna == 176 || n1DeeSCEcna == 193) && i_xgeo >= 0 )
6863  {histo_for_plot[i_xgeo] +=
6864  read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)25.;}
6865 
6866  //--------------- DSSC 30
6867  if( (n1DeeSCEcna == 60 || n1DeeSCEcna == 119) && i_xgeo >= 0 )
6868  {histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna]/(Double_t)2.;}
6869 
6870  //--------------- DSSC 21 (Add SC translated at 10-1 only once, i_xgeo = -1 accepted)
6871  if( n1DeeSCEcna == 102 )
6872  {histo_for_plot[i_xgeo] += read_histo[9]/(Double_t)21.
6873  + read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)21.;}
6874  if( n1DeeSCEcna == 123 && i_xgeo >= 0 )
6875  {histo_for_plot[i_xgeo] +=
6876  read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)21.;}
6877 
6878  //--------------- DSSC 3 (Add SC translated at 11-1 only once, i_xgeo = -1 accepted)
6879  if( n1DeeSCEcna == 138 )
6880  {histo_for_plot[i_xgeo] += read_histo[10]/(Double_t)21.
6881  + read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)21.;}
6882  if( n1DeeSCEcna == 157 && i_xgeo >= 0 )
6883  {histo_for_plot[i_xgeo] +=
6884  read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)21.;}
6885  }
6886  else
6887  {
6888  if( i_xgeo >= 0 )
6889  {histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna];} // standard treatment
6890  }
6891  } // end of if( i_xgeo >= -1 && i_xgeo < SizeForPlot )
6892  else
6893  {
6894  //cout << "!TEcnaHistos::ViewHisto(...)> <EE> i_xgeo = " << i_xgeo
6895  // << ". OUT OF RANGE ( range = [0,"<< SizeForPlot << "] " << endl;
6896  }
6897  }// end of if( fFlagSubDet == "EE" )
6898  }// end of for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
6899  }
6900  else
6901  {
6902  cout << "!TEcnaHistos::ViewHisto(...)> "
6903  << " Data not available for " << fFapStexName << " " << iStasStex+1
6904  << " (Quantity not present in the ROOT file)" << endl;
6905  }
6906  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE ) (ViewHisto/Stas)
6907  else
6908  {
6909  fStatusFileFound = kFALSE;
6910 
6911  cout << "!TEcnaHistos::ViewHisto(...)> "
6912  << " Data not available for " << fFapStexName << " " << iStasStex+1
6913  << " (ROOT file not found)" << endl;
6914  }
6915 
6916  if( fFapNbOfEvts <= xFapNbOfEvts[iStasStex] ){fFapNbOfEvts = xFapNbOfEvts[iStasStex];}
6917 
6918  } // end of for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
6919 
6920  //delete [] NOFE_int; NOFE_int = 0; fCdelete++;
6921  delete [] xFapNbOfEvts; xFapNbOfEvts = 0; fCdelete++;
6922 
6923  if( CounterExistingFile > 0 && CounterDataExist > 0 ){OKPlot = 1;}
6924 
6925  } // end of if( fFapStexNumber == 0 )
6926 
6927  //---------------------------------------------------------------------------- (ViewHisto [Stex])
6928 
6929  if( fFapStexNumber > 0 )
6930  {
6931  Bool_t OKFileExists = kFALSE ;
6932  Bool_t ok_view_histo = kFALSE;
6933 
6934  if( arg_AlreadyRead == 0 )
6935  {
6936  fMyRootFile->PrintNoComment();
6937  fMyRootFile->FileParameters(fFapAnaType, fFapNbOfSamples,
6938  fFapRunNumber, fFapFirstReqEvtNumber,
6939  fFapLastReqEvtNumber, fFapReqNbOfEvts,
6940  fFapStexNumber, fCfgResultsRootFilePath.Data());
6941 
6942  if ( fMyRootFile->LookAtRootFile() == kTRUE ){OKFileExists = kTRUE;} // (ViewHisto, Stex)
6943 
6944  if( OKFileExists == kTRUE )
6945  {
6946  fFapNbOfEvts = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, fFapStexNumber);
6947  fp_name_short = fMyRootFile->GetRootFileNameShort();
6948  // cout << "*TEcnaHistos::ViewHisto(...)> Data are analyzed from file ----> "
6949  // << fp_name_short << endl;
6950 
6951  fStartDate = fMyRootFile->GetStartDate();
6952  fStopDate = fMyRootFile->GetStopDate();
6953  fRunType = fMyRootFile->GetRunType();
6954 
6955  ok_view_histo =
6956  GetOkViewHisto(fMyRootFile, StexStin_A, i0StinEcha, i0Sample, HistoCode.Data());
6957  }
6958  }
6959 
6960  if( arg_AlreadyRead >= 1 )
6961  {
6962  OKFileExists = kTRUE; ok_view_histo = kTRUE;
6963  }
6964 
6965  if( OKFileExists == kTRUE )
6966  {
6967  fStatusFileFound = kTRUE;
6968  //---------------------------------------------------------------------------- (ViewHisto [Stex])
6969 
6970  if( ok_view_histo == kTRUE )
6971  {
6972  //------------ EB or EE with SampGlobal or SampProj (histo_for_plot = read_histo)
6973  if( fFlagSubDet == "EB" ||
6974  ( fFlagSubDet == "EE" && ( HistoType == "SampGlobal" || HistoType == "SampProj" ) ) )
6975  {
6976  histo_for_plot = GetHistoValues(arg_read_histo, arg_AlreadyRead, fMyRootFile, HistoCode.Data(),
6977  SizeForPlot, SizeForRead,
6978  StexStin_A, i0StinEcha, i0Sample, i_data_exist);
6979  if( i_data_exist > 0 ){OKPlot = 1;}
6980  if( OKPlot == 1 && opt_plot == "ASCII" && ( HistoType == "Global" || HistoType == "Proj" ) )
6981  {WriteHistoAscii(HistoCode.Data(), SizeForPlot, histo_for_plot);}
6982  }
6983 
6984  //------------ EE except for SampGlobal and SampProj) (histo_for_plot # read_histo)
6985  if( fFlagSubDet == "EE" && !( HistoType == "SampGlobal" || HistoType == "SampProj" ) )
6986  {
6987  TVectorD read_histo(SizeForRead);
6988  for(Int_t i=0; i<SizeForRead; i++){read_histo(i)=(Double_t)0.;}
6989 
6990  read_histo = GetHistoValues(arg_read_histo, arg_AlreadyRead, fMyRootFile, HistoCode.Data(),
6991  SizeForRead, SizeForRead,
6992  StexStin_A, i0StinEcha, i0Sample, i_data_exist);
6993  if( i_data_exist > 0 ){OKPlot = 1;}
6994  if( OKPlot == 1 && opt_plot == "ASCII" )
6995  {
6996  WriteHistoAscii(HistoCode.Data(), fEcal->MaxCrysEcnaInDee(), read_histo);
6997  }
6998  if( OKPlot == 1 && opt_plot != "ASCII" )
6999  {
7000  //..................... Build histo_for_plot from read_histo (ViewHisto [Stex])
7001  Int_t DeeNumber = fFapStexNumber;
7002  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
7003 
7004  //%%%%%%%%%%%%%%%%%%%%%%%%%%%% LOOP ON Echa (Ecna) %%%%%%%%%%%%%%%%%%%%%%%%%% (ViewHisto [Stex])
7005  for(Int_t i0DeeEcha=0; i0DeeEcha<fEcal->MaxCrysEcnaInDee(); i0DeeEcha++)
7006  {
7007  Int_t n1SCEcha = fEcalNumbering->Get1SCEchaFrom0DeeEcha(i0DeeEcha);
7008  Int_t n1DeeSCEcna = i0DeeEcha/fEcal->MaxCrysInSC()+1;
7009 
7010  Int_t DataSector = fEcalNumbering->GetDSFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
7011  Int_t SC_in_DS = fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna, n1SCEcha);
7012 
7013  Int_t i_xgeo = -1;
7014 
7015  if( n1SCEcha >= 1 && n1SCEcha <= fEcal->MaxCrysInSC() )
7016  {
7017  if( n1DeeSCEcna >= 1 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
7018  {
7019  if( DataSector >= 1 && DataSector <= 9 )
7020  {
7021  if( SC_in_DS >= 1 && SC_in_DS <= fEcalNumbering->GetMaxSCInDS(DataSector) )
7022  {
7023  if( read_histo[i0DeeEcha] != 0 )
7024  {
7025  //................................... Data Sector offset
7026  Int_t DSOffset = GetDSOffset(DeeNumber, DataSector);
7027 
7028  //........................ Super-Crystal (SC) offset (ViewHisto [Stex])
7029  Int_t SCOffset = GetSCOffset(DeeNumber, DataSector, SC_in_DS);
7030 
7031  //........................ Xtal final bin
7032  Int_t nSCCons = fEcalNumbering->
7033  GetDeeSCConsFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna, n1SCEcha);
7034 
7035  Int_t n1FinalSCEcha = n1SCEcha;
7036 
7037  if( fEcalNumbering->GetSCType(nSCCons) == "NotConnected" ||
7038  fEcalNumbering->GetSCType(nSCCons) == "NotComplete" )
7039  { //----- not complete and not connected SC's
7040  // no i_xgeo value if SC = 14 or 25 and channel 11
7041  if( !( (SC_in_DS == 14 || SC_in_DS == 25 ) && n1SCEcha == 11 ) )
7042  {
7043  n1FinalSCEcha =
7044  ModifiedSCEchaForNotConnectedSCs(DeeNumber, nSCCons, SC_in_DS,
7045  n1DeeSCEcna, n1SCEcha);
7046  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha-1);
7047  }
7048  // change SC 14 -> 21 and channel 11 -> 21
7049  if( SC_in_DS == 14 && n1SCEcha == 11 )
7050  {
7051  SCOffset = GetSCOffset(DeeNumber, DataSector, 21);
7052  n1FinalSCEcha = 21;
7053  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha-1);
7054  }
7055  // change SC 25 -> 3 for channel 11 -> 21
7056  if( SC_in_DS == 25 && n1SCEcha == 11 )
7057  {
7058  SCOffset = GetSCOffset(DeeNumber, DataSector, 3);
7059  n1FinalSCEcha = 21;
7060  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha-1);
7061  }
7062  }
7063  else
7064  { //----------- Complete SCs
7065  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha-1);
7066  }
7067 
7068  histo_for_plot_memo[i_xgeo]++;
7069  if( histo_for_plot_memo[i_xgeo] >= 2 )
7070  {
7071  cout << "! histo_memo[" << i_xgeo
7072  << "] = " << histo_for_plot_memo[i_xgeo]
7073  << ", nSCCons = " << nSCCons
7074  << ", SC_in_DS = " << SC_in_DS
7075  << ", DSOffset = " << DSOffset
7076  << ", SCOffset = " << SCOffset
7077  << ", n1DeeSCEcna = " << n1DeeSCEcna
7078  << ", n1SCEcha = " << n1SCEcha
7079  << ", n1FinalSCEcha = " << n1FinalSCEcha << endl;
7080  }
7081  //.............................. transfert read_histo -> histo_for_plot
7082  if( i_xgeo >= 0 && i_xgeo < SizeForPlot )
7083  {
7084  if( n1FinalSCEcha > 0 )
7085  {histo_for_plot[i_xgeo] += read_histo[i0DeeEcha];}
7086  }
7087  else
7088  {
7089  cout << "!TEcnaHistos::ViewHisto(...)> <EE> i_xgeo = " << i_xgeo
7090  << ". OUT OF RANGE ( range = [0,"<< SizeForPlot << "] " << endl;
7091  }
7092  } // end of if( read_histo[i0DeeEcha] > 0 )
7093  } // end of if( SC_in_DS >= 1 && SC_in_DS <= fEcalNumbering->GetMaxSCInDS(DataSector) )
7094  else
7095  {
7096  cout << "!TEcnaHistos::ViewHisto(...)> <EE> SC_in_DS = " << SC_in_DS
7097  << ". OUT OF RANGE ( range = [1,"
7098  << fEcalNumbering->GetMaxSCInDS(DataSector) << "] "
7099  << ", DataSector = " << DataSector
7100  << ", n1DeeSCEcna = " << n1DeeSCEcna
7101  << ", n1SCEcha = " << n1SCEcha
7102  << ", i0DeeEcha = " << i0DeeEcha
7103  << endl;
7104  }
7105  } // end of if( DataSector >= 1 && DataSector <= 9 )
7106  else
7107  {
7108  if( DataSector != 0 )
7109  {
7110  cout << "!TEcnaHistos::ViewHisto(...)> <EE> DataSector = " << DataSector
7111  << ". OUT OF RANGE ( range = [1,9] "
7112  << ", n1DeeSCEcna = " << n1DeeSCEcna
7113  << ", n1SCEcha = " << n1SCEcha
7114  << ", i0DeeEcha = " << i0DeeEcha
7115  << endl;
7116  }
7117  }
7118  } // end of if( n1DeeSCEcna >= 1 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
7119  else
7120  {
7121  cout << "!TEcnaHistos::ViewHisto(...)> <EE> n1DeeSCEcna = " << n1DeeSCEcna
7122  << ". OUT OF RANGE ( range = [1,"<< fEcal->MaxSCEcnaInDee() << "] "
7123  << ", n1SCEcha = " << n1SCEcha
7124  << ", i0DeeEcha = " << i0DeeEcha
7125  << endl;
7126  }
7127  } // end of if(n1SCEcha >= 1 && n1SCEcha <= fEcal->MaxCrysInSC() )
7128  else
7129  {
7130  cout << "!TEcnaHistos::ViewHisto(...)> <EE> n1SCEcha = " << n1SCEcha
7131  << ". OUT OF RANGE ( range = [1,"<< fEcal->MaxCrysInSC() << "] "
7132  << ", i0DeeEcha = " << i0DeeEcha
7133  << endl;
7134  }
7135  }
7136  } // end of if( OKPlot == 1 && opt_plot != "ASCII" )
7137  } // end of if(fFlagSubDet == "EE")
7138  } // end of if(ok_view_histo == kTRUE)
7139  else
7140  {
7141  cout << "!TEcnaHistos::ViewHisto(...)> *ERROR* =====> "
7142  << " ok_view_histo != kTRUE " << fTTBELL << endl;
7143  }
7144  } // end of if(fMyRootFile->LookAtRootFile() == kTRUE)
7145  else
7146  {
7147  fStatusFileFound = kFALSE;
7148 
7149  cout << "!TEcnaHistos::ViewHisto(...)> *ERROR* =====> "
7150  << " ROOT file not found" << fTTBELL << endl;
7151  }
7152  } // end of if(fFapStexNumber > 0)
7153  } // end of if( HistoType == "Global" || HistoType == "Proj" || HistoType == "SampGlobal" || HistoType == "SampProj" )
7154  else
7155  {
7156  //--------------------------------------------------------------------- not Global-Proj Histo
7157  if( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) )
7158  {
7159  Bool_t OKFileExists = kFALSE;
7160 
7161  if( !(arg_AlreadyRead > 1) )
7162  {
7163  fMyRootFile->PrintNoComment();
7164  fMyRootFile->FileParameters(fFapAnaType, fFapNbOfSamples,
7165  fFapRunNumber, fFapFirstReqEvtNumber,
7166  fFapLastReqEvtNumber, fFapReqNbOfEvts,
7167  fFapStexNumber, fCfgResultsRootFilePath.Data());
7168  OKFileExists = fMyRootFile->LookAtRootFile();
7169  if( OKFileExists == kTRUE ){fFapNbOfEvts = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, fFapStexNumber);}
7170  }
7171  else
7172  {
7173  OKFileExists = kTRUE;
7174  }
7175 
7176  if( OKFileExists == kTRUE ) // (ViewHisto, not Global-Proj)
7177  {
7178  fStatusFileFound = kTRUE;
7179 
7180  for(Int_t i=0; i<SizeForPlot; i++){histo_for_plot[i]=(Double_t)0;}
7181 
7182  histo_for_plot = GetHistoValues(arg_read_histo, arg_AlreadyRead, fMyRootFile, HistoCode.Data(),
7183  SizeForPlot, SizeForRead,
7184  StexStin_A, i0StinEcha, i0Sample, i_data_exist);
7185 
7186  fFapNbOfEvts = fMyRootFile->GetNumberOfEvents(fFapReqNbOfEvts, fFapStexNumber);
7187  fStartDate = fMyRootFile->GetStartDate();
7188  fStopDate = fMyRootFile->GetStopDate();
7189  fRunType = fMyRootFile->GetRunType();
7190 
7191  if( i_data_exist > 0 ){OKPlot = 1;}
7192  }
7193  else
7194  {
7195  cout << "!TEcnaHistos::ViewHisto(...)> *ERROR* =====> "
7196  << " ROOT file not found" << fTTBELL << endl;
7197  }
7198  }
7199  else
7200  {
7201  cout << "!TEcnaHistos::ViewHisto(...)> " << fFapStexName.Data()
7202  << " = " << fFapStexNumber << ". Out of range (range = [1,"
7203  << fEcal->MaxStexInStas() << "]) " << fTTBELL << endl;
7204  }
7205  }
7206 
7207  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PLOT accepted
7208 
7209  if( ( HistoType == "Global" || HistoType == "Proj" ||
7210  HistoType == "SampGlobal" || HistoType == "SampProj" ||
7211  HistoType == "H1Basic" || HistoType == "H1BasicProj" ) ||
7212  ( !( HistoType == "Global" || HistoType == "Proj" ||
7213  HistoType == "SampGlobal" || HistoType == "SampProj" ||
7214  HistoType == "H1Basic" || HistoType == "H1BasicProj" ) &&
7215  ( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) ) ) )
7216  {
7217  if( opt_plot != "ASCII" )
7218  {
7219  if( OKPlot > 0 )
7220  {
7221  //... Ymin and ymax default values will be taken if fFlagUserHistoMin/Max = "OFF"
7222  // and if "Free" for "SAME" and "SAME n" options
7223  if( (opt_plot == fOnlyOnePlot && ( arg_AlreadyRead == 0 || arg_AlreadyRead == 1 ) ) ||
7224  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
7225  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
7226  {
7227  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
7228  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
7229  }
7230 
7231  //==== 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)
7232  //
7233  // must be done before booking because of the x <-> y permutation in case of "Proj"
7234  //
7235  //-----------------------------------------------------------------------------------------
7236  //
7237  // CASE: HistoType == "Proj" OR HistoType == "SampProj"
7238  //
7239  // Xinf and Xsup must be calculated from ymin and ymax
7240  // of the direct ("Global") histo
7241  //
7242  //-----------------------------------------------------------------------------------------
7243  if( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj" )
7244  {
7245  TString HistoCodi = HistoCode; // HistoCodi = direct histo
7246 
7247  if( HistoCode == "D_NOE_ChDs" ){HistoCodi = "D_NOE_ChNb";}
7248  if( HistoCode == "D_Ped_ChDs" ){HistoCodi = "D_Ped_ChNb";}
7249  if( HistoCode == "D_TNo_ChDs" ){HistoCodi = "D_TNo_ChNb";}
7250  if( HistoCode == "D_MCs_ChDs" ){HistoCodi = "D_MCs_ChNb";}
7251  if( HistoCode == "D_LFN_ChDs" ){HistoCodi = "D_LFN_ChNb";}
7252  if( HistoCode == "D_HFN_ChDs" ){HistoCodi = "D_HFN_ChNb";}
7253  if( HistoCode == "D_SCs_ChDs" ){HistoCodi = "D_SCs_ChNb";}
7254  if( HistoCode == "D_MSp_SpDs" ){HistoCodi = "D_MSp_SpNb";}
7255  if( HistoCode == "D_SSp_SpDs" ){HistoCodi = "D_SSp_SpNb";}
7256  if( HistoCode == "D_Adc_EvDs" ){HistoCodi = "D_Adc_EvNb";}
7257 
7258  TString TitleHisto = ";";
7259  if( opt_plot != fSameOnePlot )
7260  {TitleHisto = fCnaParHistos->GetQuantityName(HistoCodi);}
7261 
7262  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
7263 
7264  //--------------------------------------------------------------------------- (ViewHisto)
7265  //
7266  // fOnlyOnePlot => compute Xinf and Xsup at each time
7267  // fSeveralPlot => compute Xinf and Xsup once when flag = "Free" for each HistoCode
7268  // fSameOnePlot => compute Xinf and Xsup once
7269  //
7270  //--------------------------------------------------------------------------------------
7271  if( (opt_plot == fOnlyOnePlot && ( arg_AlreadyRead == 0 || arg_AlreadyRead == 1 ) ) ||
7272  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, fSeveralPlot) == "Free" ) ||
7273  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, fSameOnePlot) == "Free" ) )
7274  {
7275  Double_t XinfProj =(Double_t)0;
7276  Double_t XsupProj =(Double_t)0;
7277 
7278  //...................................................................... (ViewHisto)
7279  if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
7280  {
7281  Int_t HisSiza = GetHistoSize(HistoCodi.Data(), "plot");
7282  Int_t ReadHisSiza = HisSiza;
7283  //.............................. prepa direct histogram booking (ViewHisto)
7284  Axis_t xinf_hisa = GetHistoXinf(HistoCodi.Data(), HisSiza, opt_plot);
7285  Axis_t xsup_hisa = GetHistoXsup(HistoCodi.Data(), HisSiza, opt_plot);
7286  Int_t nb_binxa = GetHistoNumberOfBins(HistoCodi.Data(), HisSiza);
7287  //.............................. direct ("Global") histogram booking (ViewHisto)
7288  TH1D* h_hisa =
7289  new TH1D("histoa", TitleHisto.Data(), nb_binxa, xinf_hisa, xsup_hisa); fCnewRoot++;
7290  h_hisa->Reset();
7291  //.... direct histogram filling to get its ymin (=> xminProj) and ymax (=> xmaxProj)
7292  FillHisto(h_hisa, histo_for_plot, HistoCodi.Data(), ReadHisSiza);
7293  //... Get direct histo ymin and/or ymax and keep them as xinf and xsup
7294  // in memo for the plotted histo
7295  XinfProj = fUserHistoMin;
7296  XsupProj = fUserHistoMax;
7297  if( fFlagUserHistoMin == "AUTO" ){XinfProj = h_hisa->GetMinimum();}
7298  if( fFlagUserHistoMax == "AUTO" ){XsupProj = h_hisa->GetMaximum();}
7299  XsupProj += (XsupProj-XinfProj)*fCnaParHistos->GetMarginAutoMinMax(); // to see the last bin
7300  h_hisa->Delete(); h_hisa = 0; fCdeleteRoot++;
7301  } // end of if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
7302  else
7303  {
7304  if( fFlagUserHistoMin == "OFF" )
7305  {
7306  SetYminMemoFromValue(HistoCode.Data(),
7307  fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
7308  XinfProj = GetYminValueFromMemo(HistoCode.Data());
7309  }
7310 
7311  if( fFlagUserHistoMax == "OFF" )
7312  {
7313  SetYmaxMemoFromValue(HistoCode.Data(),
7314  fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
7315  XsupProj = GetYmaxValueFromMemo(HistoCode.Data());
7316  }
7317  if( fFlagUserHistoMin == "ON" ){XinfProj = fUserHistoMin;}
7318  if( fFlagUserHistoMax == "ON" ){XsupProj = fUserHistoMax;}
7319  }
7320 
7321  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
7322  {
7323  SetXinfMemoFromValue(HistoCode.Data(), XinfProj);
7324  SetXsupMemoFromValue(HistoCode.Data(), XsupProj);
7325  }
7326  else
7327  {
7328  SetXinfMemoFromValue(XinfProj);
7329  SetXsupMemoFromValue(XsupProj);
7330  }
7331  } // end of if( (opt_plot == fOnlyOnePlot) ||
7332  // (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
7333  // (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
7334  } // end of if( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj" )
7335 
7336  //=============== H I S T O B O O K I N G A N D F I L L I N G ======== (ViewHisto)
7337  //.............................. prepa histogram booking (ViewHisto)
7338 
7339  //.......... Set number of bins: forcing to fNbBinsProj if "HistoType" == "Proj"
7340  Int_t xNbBins = GetHistoNumberOfBins(HistoCode.Data(), SizeForPlot);
7341 
7342  Double_t cXinf = (Double_t)0.;
7343  Double_t cXsup = (Double_t)0.;
7344 
7345  //.......... Set Xinf and Xsup at each time because of simultaneous SAME options
7346  if( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj")
7347  {
7348  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
7349  {
7350  cXinf = GetXinfValueFromMemo(HistoCode.Data());
7351  cXsup = GetXsupValueFromMemo(HistoCode.Data());
7352  }
7353  else
7354  {
7355  cXinf = GetXinfValueFromMemo();
7356  cXsup = GetXsupValueFromMemo();
7357  }
7358  }
7359  else
7360  {
7361  cXinf = GetHistoXinf(HistoCode.Data(), SizeForPlot, opt_plot);
7362  cXsup = GetHistoXsup(HistoCode.Data(), SizeForPlot, opt_plot);
7363  }
7364 
7365  //.............................. histogram booking (ViewHisto)
7366  Axis_t xinf_his = cXinf; // ancillary variables since no const in arguments of TH1D
7367  Axis_t xsup_his = cXsup;
7368  Int_t nb_binx = xNbBins;
7369 
7370  TString TitleHisto = ";";
7371  if( opt_plot != fSameOnePlot )
7372  {TitleHisto = fCnaParHistos->GetQuantityName(HistoCode.Data());}
7373  TH1D* h_his0 = new TH1D("histo", TitleHisto.Data(), nb_binx, xinf_his, xsup_his); fCnewRoot++;
7374  h_his0->Reset();
7375  //............................... histogram filling
7376  FillHisto(h_his0, histo_for_plot, HistoCode.Data(), SizeForPlot);
7377 
7378  //=============== H I S T O Y M I N / Y M A X M A N A G E M E N T =========== (ViewHisto)
7379  if( opt_plot == fOnlyOnePlot ||
7380  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
7381  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
7382  {
7383  if( opt_plot == fSameOnePlot ){fHistoCodeFirst = HistoCode;} // registration of first HistoCode
7384  //................................. Automatic min and/or max for other options than "Proj"
7385  if( HistoType != "Proj" && HistoType != "SampProj" && HistoType != "H1BasicProj" )
7386  {
7387  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
7388  //................................. user's min and/or max
7389  if( fFlagUserHistoMin == "ON" )
7390  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
7391  if( fFlagUserHistoMax == "ON" )
7392  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
7393  //................................. automatic min and/or max
7394  if( fFlagUserHistoMin == "AUTO" )
7395  {
7396  //.............. no bottom margin if ymin = 0
7397  Double_t ymin = GetYminFromHistoFrameAndMarginValue(h_his0, (Double_t)0.);
7398  if( ymin != (Double_t)0. )
7399  {ymin =
7400  GetYminFromHistoFrameAndMarginValue(h_his0, fCnaParHistos->GetMarginAutoMinMax());}
7401  SetYminMemoFromValue(HistoCode.Data(),ymin);
7402  fFlagUserHistoMin = "OFF";
7403  }
7404  if( fFlagUserHistoMax == "AUTO" )
7405  {
7406  Double_t ymax =
7407  GetYmaxFromHistoFrameAndMarginValue(h_his0,fCnaParHistos->GetMarginAutoMinMax());
7408  SetYmaxMemoFromValue(HistoCode.Data(),ymax);
7409  fFlagUserHistoMax = "OFF";
7410  }
7411  //................................. Set YMin and YMax of histo (ViewHisto)
7412  SetYminMemoFromPreviousMemo(HistoCode);
7413  SetYmaxMemoFromPreviousMemo(HistoCode);
7414  } // end of if( HistoType != "Proj" && HistoType != "SampProj" && HistoType != "H1BasicProj" )
7415 
7416  //.......... Find maximum in case of Proj (LIN scale only) // PS: EvolProj => in ViewHistime
7417  if( ( HistoType == "Proj" || HistoType == "SampProj" ||
7418  HistoType == "H1BasicProj" ) && fFlagScaleY == "LIN" )
7419  {
7420  SetYmaxMemoFromValue
7421  (HistoCode.Data(),
7422  GetYmaxFromHistoFrameAndMarginValue(h_his0, fCnaParHistos->GetMarginAutoMinMax()));
7423  }
7424  } // end of if( opt_plot == fOnlyOnePlot ||
7425  // (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
7426  // (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
7427 
7428  //--- Set ymin and ymax to the first HistoCode values for option SAME n
7429  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
7430  {
7431  Double_t ymin = GetYminValueFromMemo(fHistoCodeFirst.Data());
7432  SetYminMemoFromValue(HistoCode.Data(), ymin);
7433 
7434  Double_t ymax = GetYmaxValueFromMemo(fHistoCodeFirst.Data());
7435  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
7436  }
7437 
7438  //... histogram set ymin and ymax and consequently margin at top of the plot
7439  Int_t xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo(h_his0, HistoCode);
7440 
7441  //==================================== P L O T ============================== (ViewHisto)
7442  HistoPlot(h_his0, SizeForPlot, xinf_his, xsup_his,
7443  HistoCode.Data(), HistoType.Data(),
7444  StexStin_A, i0StinEcha, i0Sample,
7445  opt_scale_x, opt_scale_y, opt_plot, arg_AlreadyRead,
7446  xFlagAutoYsupMargin);
7447  h_his0->Delete(); h_his0 = 0; fCdeleteRoot++;
7448  //===========================================================================
7449 
7450  //--- Recover ymin and ymax from user's values in option SAME n
7451  if( (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy") )
7452  {
7453  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
7454  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
7455  }
7456  } // end of if( OKPlot > 0 )
7457  else
7458  {
7459  cout << "!TEcnaHistos::ViewHisto(...)> Histo not available."
7460  << fTTBELL << endl;
7461  }
7462  }
7463  }
7464  } // end of if( OKHisto == 1 )
7465 
7466 } // end of ViewHisto(...)
7467 
7468 //------------------------------------------------------------------------------------
7469 Int_t TEcnaHistos::GetDSOffset(const Int_t& DeeNumber, const Int_t& DataSector)
7470 {
7471  // gives the DataSector Offset on 1D histos for option "Global"
7472 
7473  Int_t DSOffset = 0;
7474 
7475  if( DeeNumber == 4 )
7476  {
7477  if( DataSector >= 1 ){}
7478  if( DataSector >= 2 ){DSOffset += fEcalNumbering->GetMaxSCInDS(1)*fEcal->MaxCrysInSC();}
7479  if( DataSector >= 3 ){DSOffset += fEcalNumbering->GetMaxSCInDS(2)*fEcal->MaxCrysInSC();}
7480  if( DataSector >= 4 ){DSOffset += fEcalNumbering->GetMaxSCInDS(3)*fEcal->MaxCrysInSC();}
7481  if( DataSector >= 5 ){DSOffset += fEcalNumbering->GetMaxSCInDS(4)*fEcal->MaxCrysInSC();}
7482  }
7483  if( DeeNumber == 3 )
7484  {
7485  if( DataSector >= 5 ){}
7486  if( DataSector >= 6 ){DSOffset += (fEcalNumbering->GetMaxSCInDS(5)/2)*fEcal->MaxCrysInSC();}
7487  if( DataSector >= 7 ){DSOffset += fEcalNumbering->GetMaxSCInDS(6)*fEcal->MaxCrysInSC();}
7488  if( DataSector >= 8 ){DSOffset += fEcalNumbering->GetMaxSCInDS(7)*fEcal->MaxCrysInSC();}
7489  if( DataSector >= 9 ){DSOffset += fEcalNumbering->GetMaxSCInDS(8)*fEcal->MaxCrysInSC();}
7490  }
7491  if( DeeNumber == 2 )
7492  {
7493  if( DataSector <= 9 ){}
7494  if( DataSector <= 8 ){DSOffset += fEcalNumbering->GetMaxSCInDS(9)*fEcal->MaxCrysInSC();}
7495  if( DataSector <= 7 ){DSOffset += fEcalNumbering->GetMaxSCInDS(8)*fEcal->MaxCrysInSC();}
7496  if( DataSector <= 6 ){DSOffset += fEcalNumbering->GetMaxSCInDS(7)*fEcal->MaxCrysInSC();}
7497  if( DataSector <= 5 ){DSOffset += fEcalNumbering->GetMaxSCInDS(6)*fEcal->MaxCrysInSC();}
7498  }
7499  if( DeeNumber == 1 )
7500  {
7501  if( DataSector <= 5 ){}
7502  if( DataSector <= 4 ){DSOffset += (fEcalNumbering->GetMaxSCInDS(5)/2)*fEcal->MaxCrysInSC();}
7503  if( DataSector <= 3 ){DSOffset += fEcalNumbering->GetMaxSCInDS(4)*fEcal->MaxCrysInSC();}
7504  if( DataSector <= 2 ){DSOffset += fEcalNumbering->GetMaxSCInDS(3)*fEcal->MaxCrysInSC();}
7505  if( DataSector <= 1 ){DSOffset += fEcalNumbering->GetMaxSCInDS(2)*fEcal->MaxCrysInSC();}
7506  }
7507  return DSOffset;
7508 }
7509 //------------------------------------------------------------------------------------
7510 Int_t TEcnaHistos::GetSCOffset(const Int_t& DeeNumber, const Int_t& DataSector, const Int_t& SC_in_DS)
7511 {
7512  // gives the SC (Super-Crystal) Offset on 1D histos for option "Global"
7513 
7514  Int_t SCOffset = 0;
7515 
7516  if( DeeNumber == 1 || DeeNumber == 3 )
7517  {
7518  if( DataSector == 5 ){SCOffset += ((SC_in_DS-17)-1)*fEcal->MaxCrysInSC();}
7519  if( DataSector != 5 ){SCOffset += (SC_in_DS-1)*fEcal->MaxCrysInSC();}
7520  }
7521 
7522  if( DeeNumber == 2 || DeeNumber == 4 ){SCOffset += (SC_in_DS-1)*fEcal->MaxCrysInSC();}
7523 
7524  return SCOffset;
7525 }
7526 //------------------------------------------------------------------------------------
7527 Int_t TEcnaHistos::ModifiedSCEchaForNotConnectedSCs(const Int_t& n1DeeNumber,
7528  const Int_t& nSCCons, const Int_t& SC_in_DS,
7529  const Int_t& n1DeeSCEcna, const Int_t& n1SCEcha)
7530 {
7531  //------------------------ Modification of n1SCEcha number for not connected SC's
7532 
7533  Int_t ModifiedSCEcha = -1;
7534  TString SCQuad = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna); // SCQuad = top OR bottom
7535  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(n1DeeNumber); // DeeDir = left OR right
7536 
7537  TString TypQuad = "?";
7538  if( SCQuad == "top" && DeeDir == "right" ){TypQuad = "TR";}
7539  if( SCQuad == "top" && DeeDir == "left" ){TypQuad = "TL";}
7540  if( SCQuad == "bottom" && DeeDir == "left" ){TypQuad = "BL";}
7541  if( SCQuad == "bottom" && DeeDir == "right" ){TypQuad = "BR";}
7542 
7543  //------------------------------------------------------------------------------------------- top
7544 
7545  //..... (D1,S1), (D3,S9) SC_in_DS = 30, n1DeeSCEcna = 60 -> 182a for construction top/right
7546  //..... (D1,S2), (D3,S8) SC_in_DS = 3, n1DeeSCEcna = 138 -> 178a for construction top/right
7547  if( (SC_in_DS == 30 && n1DeeSCEcna == 60 && TypQuad == "TR") ||
7548  (SC_in_DS == 3 && n1DeeSCEcna == 138 && TypQuad == "TR") ){if(n1SCEcha > 15){ModifiedSCEcha = n1SCEcha - 15;}}
7549 
7550  //..... (D4,S1), (D2,S9) SC_in_DS = 30, n1DeeSCEcna = 60 -> 33a for construction top/left
7551  //..... (D4,S2), (D2,S8) SC_in_DS = 3, n1DeeSCEcna = 138 -> 29a for construction top/left
7552  if( (SC_in_DS == 30 && n1DeeSCEcna == 60 && TypQuad == "TL") ||
7553  (SC_in_DS == 3 && n1DeeSCEcna == 138 && TypQuad == "TL") )
7554  {
7555  if(n1SCEcha == 4){ModifiedSCEcha = 1;}
7556  if(n1SCEcha == 5){ModifiedSCEcha = 2;}
7557  if(n1SCEcha == 9){ModifiedSCEcha = 3;}
7558  if(n1SCEcha == 10){ModifiedSCEcha = 4;}
7559  if(n1SCEcha == 14){ModifiedSCEcha = 5;}
7560  if(n1SCEcha == 15){ModifiedSCEcha = 6;}
7561  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7562  if(n1SCEcha == 20){ModifiedSCEcha = 8;}
7563  if(n1SCEcha == 24){ModifiedSCEcha = 9;}
7564  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7565  }
7566 
7567  //..... (D1,S1), (D3,S9) SC_in_DS = 30, n1DeeSCEcna = 119 -> 182b for construction top/right
7568  if( SC_in_DS == 30 && n1DeeSCEcna == 119 && TypQuad == "TR" ){if(n1SCEcha > 5){ModifiedSCEcha = n1SCEcha - 5;}}
7569 
7570  //..... (D4,S1), (D2,S9) SC_in_DS = 30, n1DeeSCEcna = 119 -> 33b for construction top/left
7571  if( SC_in_DS == 30 && n1DeeSCEcna == 119 && TypQuad == "TL" )
7572  {
7573  if(n1SCEcha == 4){ModifiedSCEcha = 11;}
7574  if(n1SCEcha == 5){ModifiedSCEcha = 12;}
7575  if(n1SCEcha == 9){ModifiedSCEcha = 13;}
7576  if(n1SCEcha == 10){ModifiedSCEcha = 14;}
7577  if(n1SCEcha == 14){ModifiedSCEcha = 15;}
7578  if(n1SCEcha == 15){ModifiedSCEcha = 16;}
7579  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7580  if(n1SCEcha == 20){ModifiedSCEcha = 18;}
7581  if(n1SCEcha == 24){ModifiedSCEcha = 19;}
7582  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7583  }
7584 
7585  //..... (D1,S1), (D3,S9) SC_in_DS = 12, n1DeeSCEcna = 13 -> 161 for construction top/right
7586  //..... (D4,S1), (D2,S9) SC_in_DS = 12, n1DeeSCEcna = 13 -> 12 for construction top/left
7587  if( SC_in_DS == 12 && n1DeeSCEcna == 13 && TypQuad == "TR" )
7588  {
7589  ModifiedSCEcha = n1SCEcha;
7590  }
7591  if( SC_in_DS == 12 && n1DeeSCEcna == 13 && TypQuad == "TL" )
7592  {
7593  if( n1SCEcha >= 1 && n1SCEcha <= 4 ){ModifiedSCEcha = n1SCEcha;}
7594  if( n1SCEcha >= 6 && n1SCEcha <= 9 ){ModifiedSCEcha = n1SCEcha-1;}
7595  if( n1SCEcha >= 11 && n1SCEcha <= 14 ){ModifiedSCEcha = n1SCEcha-2;}
7596  if( n1SCEcha >= 16 && n1SCEcha <= 19 ){ModifiedSCEcha = n1SCEcha-3;}
7597  if( n1SCEcha >= 21 && n1SCEcha <= 24 ){ModifiedSCEcha = n1SCEcha-4;}
7598  }
7599 
7600  //..... (D1,S2), (D3,S8) SC_in_DS = 25, n1DeeSCEcna = 176 -> 207a for construction top/right
7601  if( SC_in_DS == 25 && n1DeeSCEcna == 176 && TypQuad == "TR" )
7602  {
7603  if(n1SCEcha == 4){ModifiedSCEcha = 1;}
7604  if(n1SCEcha == 5){ModifiedSCEcha = 2;}
7605  if(n1SCEcha == 9){ModifiedSCEcha = 3;}
7606  if(n1SCEcha == 10){ModifiedSCEcha = 4;}
7607  if(n1SCEcha == 14){ModifiedSCEcha = 5;}
7608  if(n1SCEcha == 15){ModifiedSCEcha = 6;}
7609  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7610  if(n1SCEcha == 20){ModifiedSCEcha = 8;}
7611  if(n1SCEcha == 24){ModifiedSCEcha = 9;}
7612  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7613  }
7614 
7615  //..... (D4,S2), (D2,S8) SC_in_DS = 25, n1DeeSCEcna = 176 -> 58a for construction top/left
7616  if( SC_in_DS == 25 && n1DeeSCEcna == 176 && TypQuad == "TL" )
7617  {
7618  if(n1SCEcha == 16){ModifiedSCEcha = 1;}
7619  if(n1SCEcha == 21){ModifiedSCEcha = 2;}
7620  if(n1SCEcha == 17){ModifiedSCEcha = 3;}
7621  if(n1SCEcha == 22){ModifiedSCEcha = 4;}
7622  if(n1SCEcha == 18){ModifiedSCEcha = 5;}
7623  if(n1SCEcha == 23){ModifiedSCEcha = 6;}
7624  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7625  if(n1SCEcha == 24){ModifiedSCEcha = 8;}
7626  if(n1SCEcha == 20){ModifiedSCEcha = 9;}
7627  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7628  }
7629 
7630  //..... (D1,S2), (D3,S8) SC_in_DS = 3, n1DeeSCEcna = 157 -> 178b for construction top/right
7631  //..... (D1,S2), (D3,S8) SC_in_DS = 25, n1DeeSCEcna = 193 -> 207b for construction top/right
7632  if( (SC_in_DS == 3 && n1DeeSCEcna == 157 && TypQuad == "TR") ||
7633  (SC_in_DS == 25 && n1DeeSCEcna == 193 && TypQuad == "TR") )
7634  {
7635  if(n1SCEcha == 4){ModifiedSCEcha = 11;}
7636  if(n1SCEcha == 5){ModifiedSCEcha = 12;}
7637  if(n1SCEcha == 9){ModifiedSCEcha = 13;}
7638  if(n1SCEcha == 10){ModifiedSCEcha = 14;}
7639  if(n1SCEcha == 14){ModifiedSCEcha = 15;}
7640  if(n1SCEcha == 15){ModifiedSCEcha = 16;}
7641  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7642  if(n1SCEcha == 20){ModifiedSCEcha = 18;}
7643  if(n1SCEcha == 24){ModifiedSCEcha = 19;}
7644  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7645  }
7646 
7647  //..... (D4,S2), (D2,S8) SC_in_DS = 3, n1DeeSCEcna = 157 -> 29b for construction top/left
7648  //..... (D4,S2), (D2,S8) SC_in_DS = 25, n1DeeSCEcna = 193 -> 58b for construction top/left
7649  if( (SC_in_DS == 3 && n1DeeSCEcna == 157 && TypQuad == "TL") ||
7650  (SC_in_DS == 25 && n1DeeSCEcna == 193 && TypQuad == "TL") )
7651  {
7652  if(n1SCEcha == 16){ModifiedSCEcha = 11;}
7653  if(n1SCEcha == 21){ModifiedSCEcha = 12;}
7654  if(n1SCEcha == 17){ModifiedSCEcha = 13;}
7655  if(n1SCEcha == 22){ModifiedSCEcha = 14;}
7656  if(n1SCEcha == 18){ModifiedSCEcha = 15;}
7657  if(n1SCEcha == 23){ModifiedSCEcha = 16;}
7658  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7659  if(n1SCEcha == 24){ModifiedSCEcha = 18;}
7660  if(n1SCEcha == 20){ModifiedSCEcha = 19;}
7661  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7662  }
7663 
7664  //..... (D1,S2), (D3,S8) SC_in_DS = 32, n1DeeSCEcna = 51 -> 216 for construction top/right
7665  if( SC_in_DS == 32 && n1DeeSCEcna == 51 && TypQuad == "TR" )
7666  {
7667  if( n1SCEcha >= 1 && n1SCEcha <= 4 ){ModifiedSCEcha = n1SCEcha;}
7668  if( n1SCEcha >= 6 && n1SCEcha <= 9 ){ModifiedSCEcha = n1SCEcha-1;}
7669  if( n1SCEcha >= 11 && n1SCEcha <= 14 ){ModifiedSCEcha = n1SCEcha-2;}
7670  if( n1SCEcha >= 16 && n1SCEcha <= 19 ){ModifiedSCEcha = n1SCEcha-3;}
7671  if( n1SCEcha >= 21 && n1SCEcha <= 24 ){ModifiedSCEcha = n1SCEcha-4;}
7672  }
7673 
7674  //..... (D4,S2), (D2,S8) SC_in_DS = 32, n1DeeSCEcna = 51 -> 67 for construction top/left
7675  if( SC_in_DS == 32 && n1DeeSCEcna == 51 && TypQuad == "TL" )
7676  {
7677  ModifiedSCEcha = n1SCEcha;
7678  }
7679 
7680  // **************************** Special case: TWO SC's IN THE SAME SC-Ecna place *************************
7681  //========================================================================================== D1,D3 ======
7682  // (D1,S2), (D3,S8) SC_in_DS = 3, n1DeeSCEcna = 32 -> 178c for construction top/right
7683  // (D1,S2), (D3,S8) SC_in_DS = 25, n1DeeSCEcna = 32 -> 207c for construction top/right
7684  // For n1DeeSCEcna = 32: ONLY "25" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
7685  // fT2d_DSSC[dee-1][32-1] = 25; // also 3; // ( (207c, 58c) also (178c, 29c) for construction)
7686  // is recovered from number for construction
7687  //=======================================================================================================
7688  if( n1DeeSCEcna == 32 && TypQuad == "TR" )
7689  {
7690  if( nSCCons == 207 )
7691  {
7692  if(n1SCEcha == 1){ModifiedSCEcha = 21;}
7693  if(n1SCEcha == 2){ModifiedSCEcha = 22;}
7694  if(n1SCEcha == 3){ModifiedSCEcha = 23;}
7695  if(n1SCEcha == 6){ModifiedSCEcha = 24;}
7696  if(n1SCEcha == 7){ModifiedSCEcha = 25;}
7697  }
7698  if( nSCCons == 178 )
7699  {
7700  if(n1SCEcha == 11){ModifiedSCEcha = 21;}
7701  }
7702  }
7703 
7704  //========================================================================================== D2,D4 ======
7705  // (D4,S2), (D2,S8) SC_in_DS = 3, n1DeeSCEcna = 32 -> 29c for construction top/left
7706  // (D4,S2), (D2,S8) SC_in_DS = 25, n1DeeSCEcna = 32 -> 58c for construction top/left
7707  // For n1DeeSCEcna = 32: ONLY "25" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
7708  // fT2d_DSSC[dee-1][32-1] = 25; // also 3; // ( (207c, 58c) also (178c, 29c) for construction)
7709  // is recovered from number for construction
7710  //=======================================================================================================
7711  if( n1DeeSCEcna == 32 && TypQuad == "TL" )
7712  {
7713  if( nSCCons == 58 )
7714  {
7715  if(n1SCEcha == 1){ModifiedSCEcha = 21;}
7716  if(n1SCEcha == 2){ModifiedSCEcha = 22;}
7717  if(n1SCEcha == 3){ModifiedSCEcha = 23;}
7718  if(n1SCEcha == 6){ModifiedSCEcha = 24;}
7719  if(n1SCEcha == 7){ModifiedSCEcha = 25;}
7720  }
7721  if( nSCCons == 29 )
7722  {
7723  if(n1SCEcha == 11){ModifiedSCEcha = 21;}
7724  }
7725  }
7726  //****************************************************************************************************
7727 
7728  //------------------------------------------------------------------------------------------- bottom
7729 
7730  // **************************** Special case: TWO SC's IN THE SAME SC-Ecna place *************************
7731  //========================================================================================== D1,D3 ======
7732  // (D1,S4), (D3,S6) SC_in_DS = 14, n1DeeSCEcna = 29 -> 261a for construction bottom/right
7733  // (D1,S4), (D3,S6) SC_in_DS = 21, n1DeeSCEcna = 29 -> 268a for construction bottom/right
7734  // For n1DeeSCEcna = 29: ONLY "14" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
7735  // fT2d_DSSC[dee-1][29-1] = 14; // also 21; // ( (261a, 112a) also (268a, 119a) for construction)
7736  // is recovered from number for construction
7737  //=======================================================================================================
7738  if( n1DeeSCEcna == 29 && TypQuad == "BR" )
7739  {
7740  if( nSCCons == 261 )
7741  {
7742  if(n1SCEcha == 1){ModifiedSCEcha = 21;}
7743  if(n1SCEcha == 2){ModifiedSCEcha = 22;}
7744  if(n1SCEcha == 3){ModifiedSCEcha = 23;}
7745  if(n1SCEcha == 6){ModifiedSCEcha = 24;}
7746  if(n1SCEcha == 7){ModifiedSCEcha = 25;}
7747  }
7748  if( nSCCons == 268 )
7749  {
7750  if(n1SCEcha == 11){ModifiedSCEcha = 21;}
7751  }
7752  }
7753 
7754  //========================================================================================== D2,D4 ======
7755  // (D4,S4), (D2,S6) SC_in_DS = 14, n1DeeSCEcna = 29 -> 112a for construction bottom/left
7756  // (D4,S4), (D2,S6) SC_in_DS = 21, n1DeeSCEcna = 29 -> 119a for construction bottom/left
7757  // For n1DeeSCEcna = 29: ONLY "14" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
7758  // fT2d_DSSC[dee-1][29-1] = 14; // also 21; // ( (261a, 112a) also (268a, 119a) for construction)
7759  // is recovered from number for construction
7760  //=======================================================================================================
7761  if( n1DeeSCEcna == 29 && TypQuad == "BL" )
7762  {
7763  if( nSCCons == 119 )
7764  {
7765  if(n1SCEcha == 11){ModifiedSCEcha = 21;}
7766  }
7767  if( nSCCons == 112 )
7768  {
7769  if(n1SCEcha == 1){ModifiedSCEcha = 21;}
7770  if(n1SCEcha == 2){ModifiedSCEcha = 22;}
7771  if(n1SCEcha == 3){ModifiedSCEcha = 23;}
7772  if(n1SCEcha == 6){ModifiedSCEcha = 24;}
7773  if(n1SCEcha == 7){ModifiedSCEcha = 25;}
7774  }
7775  }
7776 
7777  // ****************************************************************************************************
7778 
7779  //..... (D1,S3), (D3,S7) SC_in_DS = 34, n1DeeSCEcna = 188 -> 298a for construction bottom/right
7780  //..... (D1,S4), (D3,S6) SC_in_DS = 14, n1DeeSCEcna = 165 -> 261b for construction bottom/right
7781  if( (SC_in_DS == 34 && n1DeeSCEcna == 188 && TypQuad == "BR") ||
7782  (SC_in_DS == 14 && n1DeeSCEcna == 165 && TypQuad == "BR") ){if(n1SCEcha > 15){ModifiedSCEcha = n1SCEcha - 15;}}
7783 
7784  //..... (D4,S3), (D2,S7) SC_in_DS = 34, n1DeeSCEcna = 188 -> 149a for construction bottom/left
7785  //..... (D4,S4), (D2,S6) SC_in_DS = 14, n1DeeSCEcna = 165 -> 112b for construction bottom/left
7786  if( (SC_in_DS == 34 && n1DeeSCEcna == 188 && TypQuad == "BL") ||
7787  (SC_in_DS == 14 && n1DeeSCEcna == 165 && TypQuad == "BL") )
7788  {
7789  if(n1SCEcha == 4){ModifiedSCEcha = 1;}
7790  if(n1SCEcha == 5){ModifiedSCEcha = 2;}
7791  if(n1SCEcha == 9){ModifiedSCEcha = 3;}
7792  if(n1SCEcha == 10){ModifiedSCEcha = 4;}
7793  if(n1SCEcha == 14){ModifiedSCEcha = 5;}
7794  if(n1SCEcha == 15){ModifiedSCEcha = 6;}
7795  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7796  if(n1SCEcha == 20){ModifiedSCEcha = 8;}
7797  if(n1SCEcha == 24){ModifiedSCEcha = 9;}
7798  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7799  }
7800 
7801  //..... (D1,S3), (D3,S7) SC_in_DS = 10, n1DeeSCEcna = 50 -> 224 for construction bottom/right
7802  if( SC_in_DS == 10 && n1DeeSCEcna == 50 && TypQuad == "BR" )
7803  {
7804  ModifiedSCEcha = n1SCEcha;
7805  }
7806 
7807  //..... (D4,S3), (D2,S7) SC_in_DS = 10, n1DeeSCEcna = 50 -> 75 for construction bottom/left
7808  if( SC_in_DS == 10 && n1DeeSCEcna == 50 && TypQuad == "BL")
7809  {
7810  if( n1SCEcha >= 1 && n1SCEcha <= 4 ){ModifiedSCEcha = n1SCEcha;}
7811  if( n1SCEcha >= 6 && n1SCEcha <= 9 ){ModifiedSCEcha = n1SCEcha-1;}
7812  if( n1SCEcha >= 11 && n1SCEcha <= 14 ){ModifiedSCEcha = n1SCEcha-2;}
7813  if( n1SCEcha >= 16 && n1SCEcha <= 19 ){ModifiedSCEcha = n1SCEcha-3;}
7814  if( n1SCEcha >= 21 && n1SCEcha <= 24 ){ModifiedSCEcha = n1SCEcha-4;}
7815  }
7816 
7817  //..... (D1,S4), (D3,S6) SC_in_DS = 14, n1DeeSCEcna = 144 -> 261c for construction bottom/right
7818  if( SC_in_DS == 14 && n1DeeSCEcna == 144 && TypQuad == "BR" ){if(n1SCEcha > 5){ModifiedSCEcha = n1SCEcha - 5;}}
7819 
7820  //..... (D4,S4), (D2,S6) SC_in_DS = 14, n1DeeSCEcna = 144 -> 112c for construction bottom/left
7821  if( SC_in_DS == 14 && n1DeeSCEcna == 144 && TypQuad == "BL" )
7822  {
7823  if(n1SCEcha == 4){ModifiedSCEcha = 11;}
7824  if(n1SCEcha == 5){ModifiedSCEcha = 12;}
7825  if(n1SCEcha == 9){ModifiedSCEcha = 13;}
7826  if(n1SCEcha == 10){ModifiedSCEcha = 14;}
7827  if(n1SCEcha == 14){ModifiedSCEcha = 15;}
7828  if(n1SCEcha == 15){ModifiedSCEcha = 16;}
7829  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7830  if(n1SCEcha == 20){ModifiedSCEcha = 18;}
7831  if(n1SCEcha == 24){ModifiedSCEcha = 19;}
7832  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7833  }
7834 
7835  //..... (D1,S4), (D3,S6) SC_in_DS = 21, n1DeeSCEcna = 123 -> 268b for construction bottom/right
7836  //..... (D1,S5), (D3,S5) SC_in_DS = 20, n1DeeSCEcna = 21 -> 281a for construction bottom/right
7837  if( (SC_in_DS == 21 && n1DeeSCEcna == 123 && TypQuad == "BR") ||
7838  (SC_in_DS == 20 && n1DeeSCEcna == 41 && TypQuad == "BR") )
7839  {
7840  if(n1SCEcha == 4){ModifiedSCEcha = 1;}
7841  if(n1SCEcha == 5){ModifiedSCEcha = 2;}
7842  if(n1SCEcha == 9){ModifiedSCEcha = 3;}
7843  if(n1SCEcha == 10){ModifiedSCEcha = 4;}
7844  if(n1SCEcha == 14){ModifiedSCEcha = 5;}
7845  if(n1SCEcha == 15){ModifiedSCEcha = 6;}
7846  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7847  if(n1SCEcha == 20){ModifiedSCEcha = 8;}
7848  if(n1SCEcha == 24){ModifiedSCEcha = 9;}
7849  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7850  }
7851 
7852  //..... (D4,S4), (D2,S6) SC_in_DS = 21, n1DeeSCEcna = 123 -> 119b for construction bottom/left
7853  //..... (D4,S5), (D2,S5) SC_in_DS = 3, n1DeeSCEcna = 41 -> 132a for construction bottom/left
7854  if( (SC_in_DS == 21 && n1DeeSCEcna == 123 && TypQuad == "BL") ||
7855  (SC_in_DS == 3 && n1DeeSCEcna == 41 && TypQuad == "BL") ){if(n1SCEcha > 15){ModifiedSCEcha = n1SCEcha - 15;}}
7856 
7857 
7858  //..... (D1,S4), (D3,S6) SC_in_DS = 21, n1DeeSCEcna = 102 -> 268c for construction bottom/right
7859  if( SC_in_DS == 21 && n1DeeSCEcna == 102 && TypQuad == "BR" )
7860  {
7861  if(n1SCEcha == 4){ModifiedSCEcha = 11;}
7862  if(n1SCEcha == 5){ModifiedSCEcha = 12;}
7863  if(n1SCEcha == 9){ModifiedSCEcha = 13;}
7864  if(n1SCEcha == 10){ModifiedSCEcha = 14;}
7865  if(n1SCEcha == 14){ModifiedSCEcha = 15;}
7866  if(n1SCEcha == 15){ModifiedSCEcha = 16;}
7867  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7868  if(n1SCEcha == 20){ModifiedSCEcha = 18;}
7869  if(n1SCEcha == 24){ModifiedSCEcha = 19;}
7870  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7871  }
7872 
7873  //..... (D4,S4), (D2,S6) SC_in_DS = 21, n1DeeSCEcna = 102 -> 119c for construction bottom/left
7874  if( SC_in_DS == 21 && n1DeeSCEcna == 102 && TypQuad == "BL" )
7875  {
7876  if(n1SCEcha == 16){ModifiedSCEcha = 11;}
7877  if(n1SCEcha == 21){ModifiedSCEcha = 12;}
7878  if(n1SCEcha == 17){ModifiedSCEcha = 13;}
7879  if(n1SCEcha == 22){ModifiedSCEcha = 14;}
7880  if(n1SCEcha == 18){ModifiedSCEcha = 15;}
7881  if(n1SCEcha == 23){ModifiedSCEcha = 16;}
7882  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7883  if(n1SCEcha == 24){ModifiedSCEcha = 18;}
7884  if(n1SCEcha == 20){ModifiedSCEcha = 19;}
7885  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7886  }
7887 
7888  //..... (D1,S5), (D3,S5) SC_in_DS = 23, n1DeeSCEcna = 8 -> 286 for construction bottom/right
7889  if( SC_in_DS == 23 && n1DeeSCEcna == 8 && TypQuad == "BR" )
7890  {
7891  if( n1SCEcha >= 1 && n1SCEcha <= 4 ){ModifiedSCEcha = n1SCEcha;}
7892  if( n1SCEcha >= 6 && n1SCEcha <= 9 ){ModifiedSCEcha = n1SCEcha-1;}
7893  if( n1SCEcha >= 11 && n1SCEcha <= 14 ){ModifiedSCEcha = n1SCEcha-2;}
7894  if( n1SCEcha >= 16 && n1SCEcha <= 19 ){ModifiedSCEcha = n1SCEcha-3;}
7895  if( n1SCEcha >= 21 && n1SCEcha <= 24 ){ModifiedSCEcha = n1SCEcha-4;}
7896  }
7897 
7898  //..... (D4,S5), (D2,S5) SC_in_DS = 6, n1DeeSCEcna = 8 -> 137 for construction bottom/left
7899  if( SC_in_DS == 6 && n1DeeSCEcna == 8 && TypQuad == "BL" )
7900  {
7901  ModifiedSCEcha = n1SCEcha;
7902  }
7903 
7904  //======================= ERROR message if ModifiedSCEcha is not correct
7905  if( ModifiedSCEcha < 1 || ModifiedSCEcha > fEcal->MaxCrysInSC() )
7906  {
7907  cout << "! *** ERROR *** > ModifiedSCEcha = " << ModifiedSCEcha
7908  << ", SC_in_DS = " << SC_in_DS
7909  << ", nSCCons = " << nSCCons
7910  << ", n1DeeSCEcna = " << n1DeeSCEcna
7911  << ", n1SCEcha = " << n1SCEcha
7912  << ", ModifiedSCEcha = " << ModifiedSCEcha
7913  << ", TypQuad = " << TypQuad
7914  << fTTBELL << endl;
7915  }
7916 
7917 
7918  return ModifiedSCEcha;
7919 }
7920 // end of ModifiedSCEchaForNotConnectedSCs(...)
7921 
7922 //======================================================================================
7923 //
7924 // ViewHistime: evolution in time
7925 //
7926 //======================================================================================
7927 
7928 //======================================================================================
7929 //
7930 // ViewHistime: time evolution
7931 //
7932 //======================================================================================
7933 void TEcnaHistos::ViewHistime(const TString& list_of_run_file_name,
7934  const Int_t& StexStin_A, const Int_t& i0StinEcha,
7935  const TString& HistoCode, const TString& opt_plot_arg)
7936 {
7937  //Histogram of the quantities as a function of time (several runs)
7938 
7939  TString opt_plot = opt_plot_arg;
7940  TString HistoType = fCnaParHistos->GetHistoType(HistoCode);
7941 
7942  if( opt_plot_arg == "ONLYONE" ){opt_plot = fOnlyOnePlot;}
7943  if( opt_plot_arg == "SEVERAL" ){opt_plot = fSeveralPlot;}
7944  if( opt_plot_arg == "SAMEONE" ){opt_plot = fSameOnePlot;}
7945 
7946  Int_t OKHisto = 0;
7947 
7948  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Canvas already closed in option SAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7949  Int_t xCanvasExists = 1; // a priori ==> SAME plot // (ViewHistime)
7950  if( opt_plot != fOnlyOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
7951  {
7952  TVirtualPad* main_subpad = 0;
7953  //---------------- Call to ActivePad
7954  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
7955  if( main_subpad == 0 )
7956  {
7957  cout << "*TEcnaHistos::ViewHistime(...)> WARNING ===> Canvas has been closed in option SAME or SAME n."
7958  << endl
7959  << " Please, restart with a new canvas."
7960  << fTTBELL << endl;
7961 
7962  ReInitCanvas(HistoCode, opt_plot);
7963  xCanvasExists = 0;
7964  }
7965  }
7966  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7967 
7968  //%%%%%%%%%%%%%%%%%%%%% Change of X variable in option SAME n with no proj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7969  Int_t SameXVarMemo = 1; // a priori ==> SAME n option: X variable OK (ViewHistime)
7970  if( !( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj" || HistoType == "EvolProj" ) )
7971  {
7972  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
7973  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
7974 
7975  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
7976  {
7977  SetXVarMemo(HistoCode, opt_plot, XVarHisto); SetYVarMemo(HistoCode, opt_plot, YVarHisto); SameXVarMemo = 1;
7978  }
7979  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
7980  {
7981  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
7982  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
7983 
7984  if( XVarHisto != XVariableMemo )
7985  {
7986  cout << "!TEcnaHistos::ViewHistime(...)> *** ERROR *** ===> X coordinate changed in option SAME n." << endl
7987  << " Present X = " << XVarHisto << endl
7988  << " Present Y = " << YVarHisto << endl
7989  << " Previous X = " << XVariableMemo << endl
7990  << " Previous Y = " << YVariableMemo
7991  << fTTBELL << endl;
7992  SameXVarMemo = 0;
7993  }
7994  else
7995  {SetYVarMemo(HistoCode, opt_plot, YVarHisto);}
7996  }
7997  }
7998  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7999 
8000  //%%%%%%%%%%%%%%%%%%%%%%% Change of Y variable in option SAME n with proj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8001  Int_t SameYVarMemo = 1; // a priori ==> SAME n option: Y variable OK (ViewHistime)
8002  if( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "H1BasicProj" || HistoType == "EvolProj" )
8003  {
8004  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
8005  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
8006 
8007  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
8008  {
8009  SetYVarMemo(HistoCode, opt_plot, YVarHisto); SetYVarMemo(HistoCode, opt_plot, YVarHisto); SameYVarMemo = 1;
8010  }
8011  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
8012  {
8013  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
8014  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
8015 
8016  if( YVarHisto != YVariableMemo )
8017  {
8018  cout << "!TEcnaHistos::ViewHistime(...)> *** ERROR *** ===> Y coordinate changed in option SAME n." << endl
8019  << " Present X = " << XVarHisto << endl
8020  << " Present Y = " << YVarHisto << endl
8021  << " Previous X = " << XVariableMemo << endl
8022  << " Previous Y = " << YVariableMemo
8023  << fTTBELL << endl;
8024  SameYVarMemo = 0;
8025  }
8026  else
8027  {SetYVarMemo(HistoCode, opt_plot, YVarHisto);}
8028  }
8029  }
8030  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8031  if( xCanvasExists == 1 && SameXVarMemo == 1 && SameYVarMemo == 1 ){OKHisto = 1;}
8032 
8033  //======================== Histime accepted
8034  if( OKHisto == 1 )
8035  {
8036  // fMyRootFile->PrintNoComment();
8037 
8038  fCnaParHistos->SetColorPalette(fFlagColPal);
8039 
8040  //................................. Init YMin and YMax of histo // (ViewHistime)
8041  if((opt_plot == fOnlyOnePlot) ||
8042  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8043  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free"))
8044  {SetYminMemoFromPreviousMemo(HistoCode); SetYmaxMemoFromPreviousMemo(HistoCode);}
8045 
8046  //........ GetHistoryRunListParameters(...) : performs the allocation of the array fT1DRunNumber[]
8047  // at first call of the present method ViewHistime
8048  // increments the number of read file (fNbOfListFileEvolXXX) for option SAME
8049  // and read the values fT1DRunNumber[0 to max] from the file list_of_run_file_name
8050  // return the number of runs in the list of the file
8051  //............... Get the run parameters
8052 
8053  Int_t nb_of_runs_in_list = GetHistoryRunListParameters(list_of_run_file_name.Data(), HistoCode);
8054 
8055  if( nb_of_runs_in_list > 0 )
8056  {
8057  //.............................. prepa x axis: time in hours
8058  //Double_t sec_in_day = (Double_t)86400.; //===> (number of seconds in a day)
8059  Double_t margin_frame_xaxis = (Double_t)25.; //===> margin in x coordinates
8060 
8061  Double_t thstart_evol = (Double_t)0.;
8062  Double_t thstop_evol = (Double_t)0.;
8063 
8064  Int_t* exist_indic = new Int_t[nb_of_runs_in_list]; fCnew++;
8065 
8066  //===================================== FIRST LOOP BEGINNING ===================================
8067  //-------------------------------------------------------------------------------- (ViewHistime)
8068  //
8069  // FIRST LOOP: read the "HistoryRunList" file. Check the existence of the runs
8070  // and determine the number of existing runs.
8071  //
8072  //--------------------------------------------------------------------------------
8073 
8074  fNbOfExistingRuns = (Int_t)0;
8075 
8076  if( fFapStexNumber > 0 )
8077  {
8078  for(Int_t i_run = 0; i_run < nb_of_runs_in_list; i_run++)
8079  {
8080  exist_indic[i_run] = 0;
8081  // ==> set the attribute value relative to the run (fFapRunNumber)
8082  SetRunNumberFromList(i_run, nb_of_runs_in_list);
8083 
8084  fMyRootFile->PrintNoComment();
8085  fMyRootFile->FileParameters(fFapAnaType.Data(), fFapNbOfSamples,
8086  fT1DRunNumber[i_run], fFapFirstReqEvtNumber,
8087  fFapLastReqEvtNumber, fFapReqNbOfEvts,
8088  fFapStexNumber, fCfgResultsRootFilePath.Data());
8089 
8090  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewHistime, 1rst loop)
8091  {
8092  fStatusFileFound = kTRUE;
8093 
8094  //------ At first HistoryRunList file: set fStartEvol... and fStopEvol... quantities
8095  if( GetListFileNumber(HistoCode) == 1 )
8096  {
8097  if( fNbOfExistingRuns == 0 )
8098  {
8099  // start time of the first existing run of the list
8100  fStartEvolTime = fMyRootFile->GetStartTime();
8101  fStartEvolDate = fMyRootFile->GetStartDate();
8102  fStartEvolRun = fT1DRunNumber[i_run];
8103  // start time of the last existing run of the list
8104  // (in case of only one existing run in the list)
8105  fStopEvolTime = fMyRootFile->GetStartTime();
8106  fStopEvolDate = fMyRootFile->GetStartDate();
8107  fStopEvolRun = fT1DRunNumber[i_run];
8108  }
8109  else
8110  {
8111  // start time of the last existing run of the list
8112  fStopEvolTime = fMyRootFile->GetStartTime();
8113  fStopEvolDate = fMyRootFile->GetStartDate();
8114  fStopEvolRun = fT1DRunNumber[i_run];
8115  }
8116  }
8117  //---- set flag of run existence and increase number of existing runs
8118  // (for the first HistoryRunList file)
8119  exist_indic[i_run] = 1;
8120  fNbOfExistingRuns++;
8121  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
8122  else
8123  {
8124  fStatusFileFound = kFALSE;
8125 
8126  cout << "!TEcnaHistos::ViewHistime(...)> *ERROR* =====> "
8127  << " ROOT file not found for run " << fT1DRunNumber[i_run]
8128  << fTTBELL << endl << endl;
8129  }
8130  } // end of for(Int_t i_run = 0; i_run < nb_of_runs_in_list; i_run++)
8131 
8132  //===================================== FIRST LOOP END =========================== (ViewHistime)
8133  if( fNbOfExistingRuns > 0 )
8134  {
8135  //-------------------- recover the array after removing non existing ROOT files
8136  Int_t i_existing_run = (Int_t)0;
8137 
8138  for( Int_t i_run = 0; i_run < nb_of_runs_in_list; i_run++)
8139  {
8140  if( exist_indic[i_run] == 1 )
8141  {
8142  fT1DRunNumber[i_existing_run] = fT1DRunNumber[i_run];
8143  i_existing_run++;
8144  }
8145  }
8146 
8147  //---------------------- Get start and stop time values to set the axis limits (ViewHistime)
8148 
8149  thstart_evol = (Double_t)fStartEvolTime;
8150  thstop_evol = (Double_t)fStopEvolTime;
8151 
8152  Double_t xinf_lim = thstart_evol-(thstop_evol-thstart_evol)/margin_frame_xaxis;
8153  Double_t xsup_lim = thstop_evol +(thstop_evol-thstart_evol)/margin_frame_xaxis;
8154 
8155  Axis_t xinf_his = (Axis_t)(xinf_lim);
8156  Axis_t xsup_his = (Axis_t)(xsup_lim);
8157 
8158  //............................. i0StexEcha, i0Sample
8159  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha);
8160  Int_t i0Sample = 0;
8161 
8162  Double_t* time_coordx = new Double_t[fNbOfExistingRuns]; fCnew++;
8163  Double_t* hval_coordy = new Double_t[fNbOfExistingRuns]; fCnew++;
8164 
8165  //........... Set values to -1
8166 
8167  for( Int_t i_run = 0; i_run < fNbOfExistingRuns; i_run++)
8168  {
8169  time_coordx[i_run] = (Double_t)(-1);
8170  hval_coordy[i_run] = (Double_t)(-1);
8171  }
8172 
8173  //========================== SECOND LOOP BEGINNING =====================================
8174  //----------------------------------------------------------------------- (ViewHistime)
8175  //
8176  // SECOND LOOP OVER THE EXISTING RUNS : FILL THE GRAPH COORDINATES
8177  //
8178  //-----------------------------------------------------------------------
8179  for (Int_t i_run = 0; i_run < fNbOfExistingRuns; i_run++)
8180  {
8181  // => set the attribute value relative to the run (fFapRunNumber)
8182  SetRunNumberFromList(i_run, fNbOfExistingRuns);
8183 
8184  fMyRootFile->PrintNoComment();
8185  fMyRootFile->FileParameters(fFapAnaType.Data(), fFapNbOfSamples,
8186  fT1DRunNumber[i_run], fFapFirstReqEvtNumber,
8187  fFapLastReqEvtNumber, fFapReqNbOfEvts,
8188  fFapStexNumber, fCfgResultsRootFilePath.Data());
8189 
8190  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewHistime, 2nd loop)
8191  {
8192  fStatusFileFound = kTRUE;
8193 
8194  Bool_t ok_view_histo = GetOkViewHisto(fMyRootFile, StexStin_A, i0StinEcha, i0Sample, HistoCode);
8195 
8196  //............... F I L L G R A P H C O O R D I N A T E S (ViewHistime)
8197  if( ok_view_histo == kTRUE )
8198  {
8199  //................................................. x coordinate
8200  time_t xStartTime = fMyRootFile->GetStartTime();
8201  Double_t thstart = (Double_t)xStartTime;
8202  time_coordx[i_run] = (Double_t)(thstart - xinf_lim);
8203  //................................................. y coordinate
8204  TVectorD read_histo(fEcal->MaxCrysEcnaInStex());
8205  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++){read_histo(i)=(Double_t)0.;}
8206 
8207  if(HistoCode == "H_Ped_Date" || HistoCode == "H_Ped_RuDs")
8208  {read_histo = fMyRootFile->ReadPedestals(fEcal->MaxCrysEcnaInStex());}
8209  if(HistoCode == "H_TNo_Date" || HistoCode == "H_TNo_RuDs")
8210  {read_histo = fMyRootFile->ReadTotalNoise(fEcal->MaxCrysEcnaInStex());}
8211  if(HistoCode == "H_MCs_Date" || HistoCode == "H_MCs_RuDs")
8212  {read_histo = fMyRootFile->ReadMeanCorrelationsBetweenSamples(fEcal->MaxCrysEcnaInStex());}
8213 
8214  if(HistoCode == "H_LFN_Date" || HistoCode == "H_LFN_RuDs")
8215  {read_histo = fMyRootFile->ReadLowFrequencyNoise(fEcal->MaxCrysEcnaInStex());}
8216  if(HistoCode == "H_HFN_Date" || HistoCode == "H_HFN_RuDs")
8217  {read_histo = fMyRootFile->ReadHighFrequencyNoise(fEcal->MaxCrysEcnaInStex());}
8218  if(HistoCode == "H_SCs_Date" || HistoCode == "H_SCs_RuDs")
8219  {read_histo = fMyRootFile->ReadSigmaOfCorrelationsBetweenSamples(fEcal->MaxCrysEcnaInStex());}
8220  hval_coordy[i_run] = (Double_t)read_histo(i0StexEcha);
8221  }
8222  else
8223  {
8224  cout << "!TEcnaHistos::ViewHistime(...)> Histo not available. "
8225  << fTTBELL << endl;
8226  }
8227  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
8228  else
8229  {
8230  fStatusFileFound = kFALSE;
8231  }
8232  }
8233  //========================== END OF SECOND LOOP ===========================================
8234 
8235  //.................................................................... SCALE x and y
8236  Int_t opt_scale_x = fOptScaleLinx;
8237  if (fFlagScaleX == "LIN" ){opt_scale_x = fOptScaleLinx;}
8238  if (fFlagScaleX == "LOG" ){opt_scale_x = fOptScaleLogx;}
8239 
8240  Int_t opt_scale_y = fOptScaleLiny;
8241  if (fFlagScaleY == "LIN" ){opt_scale_y = fOptScaleLiny;}
8242  if (fFlagScaleY == "LOG" ){opt_scale_y = fOptScaleLogy;}
8243 
8244  //------------------------------------------------- G R A P H (ViewHistime)
8245  TGraph* g_graph0 = new TGraph(fNbOfExistingRuns, time_coordx, hval_coordy); fCnewRoot++;
8246  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
8247  {g_graph0->SetTitle(fCnaParHistos->GetQuantityName(HistoCode));}
8248  if( opt_plot == fSameOnePlot )
8249  {g_graph0->SetTitle(";");}
8250 
8251  //... Ymin and ymax default values will be taken if fFlagUserHistoMin/Max = "OFF"
8252  // (and if "Free" for "SAME" and "SAME n" options)
8253  if((opt_plot == fOnlyOnePlot) ||
8254  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8255  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
8256  {
8257  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
8258  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
8259  }
8260 
8261  //................................ Put min max values (ViewHistime)
8262  //.......... default if flag not set to "ON"
8263  //SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
8264  //SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
8265 
8266  g_graph0->Set(fNbOfExistingRuns);
8267  Double_t graph_ymin =
8268  GetYminFromGraphFrameAndMarginValue(g_graph0, fCnaParHistos->GetMarginAutoMinMax());
8269  Double_t graph_ymax =
8270  GetYmaxFromGraphFrameAndMarginValue(g_graph0, fCnaParHistos->GetMarginAutoMinMax());
8271 
8272  //---------------------------------- G R A P H P L O T ---------------------------- (ViewHistime)
8273  if( HistoType == "Evol" )
8274  {
8275  //----------------- G R A P H Y M I N / Y M A X M A N A G E M E N T
8276  if((opt_plot == fOnlyOnePlot) ||
8277  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8278  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
8279  {
8280  if( opt_plot == fSameOnePlot ){fHistoCodeFirst = HistoCode;} // registration of first HistoCode
8281 
8282  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
8283  //.......... user's value if flag set to "ON"
8284  if( fFlagUserHistoMin == "ON" )
8285  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
8286  if( fFlagUserHistoMax == "ON" )
8287  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
8288  //................................. automatic min and/or max
8289  if( fFlagUserHistoMin == "AUTO" )
8290  {SetYminMemoFromValue(HistoCode.Data(), graph_ymin); fFlagUserHistoMin = "OFF";}
8291  if( fFlagUserHistoMax == "AUTO" )
8292  {SetYmaxMemoFromValue(HistoCode.Data(), graph_ymax); fFlagUserHistoMax = "OFF";}
8293 
8294  //................................. Init Ymin and Ymax for graph
8295  SetYminMemoFromPreviousMemo(HistoCode);
8296  SetYmaxMemoFromPreviousMemo(HistoCode);
8297  }
8298  //--- Set ymin and ymax to the first HistoCode values for option SAME n
8299  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
8300  {
8301  Double_t ymin = GetYminValueFromMemo(fHistoCodeFirst.Data());
8302  SetYminMemoFromValue(HistoCode.Data(), ymin);
8303 
8304  Double_t ymax = GetYmaxValueFromMemo(fHistoCodeFirst.Data());
8305  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
8306  }
8307 
8308  //..... graph set ymin and ymax and consequently margin at top of the plot
8309  Int_t xFlagAutoYsupMargin = SetGraphFrameYminYmaxFromMemo(g_graph0, HistoCode);
8310 
8311  HistimePlot(g_graph0, xinf_his, xsup_his,
8312  HistoCode.Data(), HistoType.Data(),
8313  StexStin_A, i0StinEcha, i0Sample,
8314  opt_scale_x, opt_scale_y, opt_plot, xFlagAutoYsupMargin);
8315  // g_graph0->Delete(); fCdeleteRoot++; // *===> NE PAS DELETER LE GRAPH SINON CA EFFACE TOUT!
8316 
8317  //--- Recover ymin and ymax from user's values in option SAME n
8318  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
8319  {
8320  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
8321  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
8322  }
8323  }
8324 
8325  //---------- H I S T O Y P R O J E C T I O N P L O T ---------------------- (ViewHistime)
8326 
8327  //====== 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)
8328  //
8329  // must be done before booking because of the x <-> y permutation in case of "Proj"
8330  //
8331  //-----------------------------------------------------------------------------------------
8332  //
8333  // CASE: HistoType == "Proj" OR HistoType == "SampProj"
8334  //
8335  // Xinf and Xsup must be calculated from ymin and ymax
8336  // of the direct graph
8337  //
8338  //-----------------------------------------------------------------------------------------
8339 
8340  if( HistoType == "EvolProj" )
8341  {
8342  Int_t HisSizeEvolProj = fNbBinsProj;
8343  TVectorD histo_for_plot(HisSizeEvolProj);
8344  for(Int_t i=0; i<HisSizeEvolProj; i++){histo_for_plot[i]=(Double_t)0.;}
8345 
8346  //graph_ymin = GetYminValueFromMemo(HistoCode.Data());
8347  //graph_ymax = GetYmaxValueFromMemo(HistoCode.Data());
8348 
8349  TString HistoCodi = HistoCode; // HistoCodi = direct histo
8350 
8351  if( HistoCode == "H_Ped_RuDs" ){HistoCodi = "H_Ped_Date";}
8352  if( HistoCode == "H_TNo_RuDs" ){HistoCodi = "H_TNo_Date";}
8353  if( HistoCode == "H_LFN_RuDs" ){HistoCodi = "H_LFN_Date";}
8354  if( HistoCode == "H_HFN_RuDs" ){HistoCodi = "H_HFN_Date";}
8355  if( HistoCode == "H_MCs_RuDs" ){HistoCodi = "H_MCs_Date";}
8356  if( HistoCode == "H_SCs_RuDs" ){HistoCodi = "H_SCs_Date";}
8357 
8358  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
8359 
8360  //--------------------------------------------------------------------------- (ViewHistime)
8361  //
8362  // fOnlyOnePlot => compute Xinf and Xsup at each time
8363  // fSeveralPlot => compute Xinf and Xsup once when flag = "Free" for each HistoCode
8364  // fSameOnePlot => compute Xinf and Xsup once
8365  //
8366  //--------------------------------------------------------------------------------------
8367  if( (opt_plot == fOnlyOnePlot) ||
8368  ( (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, fSeveralPlot) == "Free" ) ||
8369  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, fSameOnePlot) == "Free" ) ) )
8370  {
8371  Double_t XinfProj =(Double_t)0;
8372  Double_t XsupProj =(Double_t)0;
8373 
8374  //...................................................................... (ViewHistime)
8375  if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
8376  {
8377  //... Get direct graph ymin and/or ymax and keep them as xinf and xsup
8378  // in memo for the plotted histo
8379  XinfProj = fUserHistoMin;
8380  XsupProj = fUserHistoMax;
8381  if( fFlagUserHistoMin == "AUTO" ){XinfProj = GetYminValueFromMemo(HistoCodi.Data());}
8382  if( fFlagUserHistoMax == "AUTO" ){XsupProj = GetYmaxValueFromMemo(HistoCodi.Data());}
8383  } // end of if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
8384  else
8385  {
8386  if( fFlagUserHistoMin == "OFF" )
8387  {
8388  SetYminMemoFromValue(HistoCode.Data(),
8389  fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
8390  XinfProj = GetYminValueFromMemo(HistoCode.Data());
8391  }
8392 
8393  if( fFlagUserHistoMax == "OFF" )
8394  {
8395  SetYmaxMemoFromValue(HistoCode.Data(),
8396  fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
8397  XsupProj = GetYmaxValueFromMemo(HistoCode.Data());
8398  }
8399  if( fFlagUserHistoMin == "ON" ){XinfProj = fUserHistoMin;}
8400  if( fFlagUserHistoMax == "ON" ){XsupProj = fUserHistoMax;}
8401  }
8402 
8403  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
8404  {
8405  SetXinfMemoFromValue(HistoCode.Data(), XinfProj);
8406  SetXsupMemoFromValue(HistoCode.Data(), XsupProj);
8407  }
8408  else
8409  {
8410  SetXinfMemoFromValue(XinfProj);
8411  SetXsupMemoFromValue(XsupProj);
8412  }
8413  } // end of if( (opt_plot == fOnlyOnePlot) ||
8414  // (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8415  // (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
8416 
8417  Double_t cXinf = (Double_t)0.;
8418  Double_t cXsup = (Double_t)0.;
8419 
8420  //.......... Set Xinf and Xsup at each time because of simultaneous SAME options (ViewHistime)
8421  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
8422  {
8423  cXinf = GetXinfValueFromMemo(HistoCode.Data());
8424  cXsup = GetXsupValueFromMemo(HistoCode.Data());
8425  }
8426  else
8427  {
8428  cXinf = GetXinfValueFromMemo();
8429  cXsup = GetXsupValueFromMemo();
8430  }
8431  //....... In case of only one run: in order to have cXinf < cXsup for "EvolProj" plot
8432  if( cXinf >= cXsup ){cXinf -= 1.; cXsup +=1.;}
8433 
8434  //.............................. histogram booking (ViewHisto)
8435  Axis_t xinf_his = cXinf; // ancillary variables since no const in arguments of TH1D
8436  Axis_t xsup_his = cXsup;
8437 
8438  TString TitleHisto = ";";
8439  if( opt_plot != fSameOnePlot )
8440  {TitleHisto = fCnaParHistos->GetQuantityName(HistoCode.Data());}
8441 
8442  //........ fill array histo_for_plot from hval_coordy (ViewHistime)
8443  for(Int_t i_run=0; i_run<fNbOfExistingRuns; i_run++)
8444  {
8445  Double_t XFromYGraph = hval_coordy[i_run];
8446  Double_t binXProjY = (Double_t)HisSizeEvolProj*(XFromYGraph - cXinf)/(cXsup - cXinf);
8447  Int_t ibinXProjY = (Int_t)binXProjY;
8448  if( ibinXProjY >= 0 && ibinXProjY<HisSizeEvolProj ){histo_for_plot[ibinXProjY]++;}
8449  }
8450 
8451  TH1D* h_his_evol_proj = new TH1D("histevolproj", TitleHisto.Data(),
8452  HisSizeEvolProj, xinf_his, xsup_his); fCnewRoot++;
8453 
8454  h_his_evol_proj->Reset();
8455 
8456  //.... direct histogram filling (ViewHistime)
8457  for(Int_t i=0; i<HisSizeEvolProj; i++)
8458  {
8459  Double_t yi = (Double_t)i/(Double_t)HisSizeEvolProj*(cXsup-cXinf) + cXinf;
8460  Double_t his_val = (Double_t)histo_for_plot[i];
8461  h_his_evol_proj->Fill(yi, his_val);
8462  }
8463 
8464  //------- 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
8465  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
8466  //.......... user's value if flag set to "ON"
8467  if( fFlagUserHistoMin == "ON" )
8468  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
8469  if( fFlagUserHistoMax == "ON" )
8470  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
8471  //................................. automatic min and/or max
8472  if( fFlagUserHistoMin == "AUTO" )
8473  {SetYminMemoFromValue(HistoCode.Data(), graph_ymin); fFlagUserHistoMin = "OFF";}
8474  if( fFlagUserHistoMax == "AUTO" )
8475  {SetYmaxMemoFromValue(HistoCode.Data(), graph_ymax); fFlagUserHistoMax = "OFF";}
8476 
8477  //................................. Init Ymin and Ymax for graph
8478  SetYminMemoFromPreviousMemo(HistoCode);
8479  SetYmaxMemoFromPreviousMemo(HistoCode);
8480 
8481  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8482  //.......... Find maximum in case of Proj (LIN scale only) // PS: EvolProj => in ViewHistime
8483  if( fFlagScaleY == "LIN" )
8484  {
8485  SetYmaxMemoFromValue
8486  (HistoCode.Data(),
8487  GetYmaxFromHistoFrameAndMarginValue(h_his_evol_proj, fCnaParHistos->GetMarginAutoMinMax()));
8488  }
8489 
8490  //--- Set ymin and ymax to the first HistoCode values for option SAME n
8491  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
8492  {
8493  Double_t ymin = GetYminValueFromMemo(fHistoCodeFirst.Data());
8494  SetYminMemoFromValue(HistoCode.Data(), ymin);
8495 
8496  Double_t ymax = GetYmaxValueFromMemo(fHistoCodeFirst.Data());
8497  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
8498  }
8499  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8500 
8501  //..... graph set ymin and ymax and consequently margin at top of the plot
8502  Int_t xFlagAutoYsupMargin = SetGraphFrameYminYmaxFromMemo(g_graph0, HistoCode);
8503  Int_t arg_AlreadyRead = 0;
8504 
8505  HistoPlot(h_his_evol_proj, HisSizeEvolProj,
8506  xinf_his, xsup_his,
8507  HistoCode.Data(), HistoType.Data(),
8508  StexStin_A, i0StinEcha, i0Sample,
8509  opt_scale_x, opt_scale_y, opt_plot, arg_AlreadyRead,
8510  xFlagAutoYsupMargin);
8511 
8512  h_his_evol_proj->Delete(); h_his_evol_proj = 0; fCdeleteRoot++;
8513  //*===> deleter l'histo sinon "Replacing existing histo (potential memory leak)" a l'execution
8514 
8515  } // end of if( HistoType == "EvolProj" )
8516  //---------------------------------------------------------------------------------- (ViewHistime)
8517 
8518  delete [] time_coordx; time_coordx = 0; fCdelete++;
8519  delete [] hval_coordy; hval_coordy = 0; fCdelete++;
8520  }
8521  else
8522  {
8523  cout << "!TEcnaHistos::ViewHistime(...)> The list of runs in file: " << list_of_run_file_name
8524  << " has " << nb_of_runs_in_list << " run numbers" << endl
8525  << " but none of them correspond to an existing ROOT file."
8526  << fTTBELL << endl;
8527  }
8528  } // end of if( fFapStexNumber > 0 )
8529  else
8530  {
8531  cout << "!TEcnaHistos::ViewHistime(...)> *ERROR* =====> "
8532  << fFapStexName << " number = " << fFapStexNumber << ". "
8533  << fFapStexName << " number must be in range [1," << fEcal->MaxStexInStas() << "] ";
8534  if( fFlagSubDet == "EB" ){cout << " (or [-18,+18])";}
8535  cout << fTTBELL << endl;
8536  }
8537  delete [] exist_indic; exist_indic = 0; fCdelete++;
8538  } // end of if( nb_of_runs_in_list > 0 )
8539  else
8540  {
8541  if( nb_of_runs_in_list == 0 )
8542  {
8543  cout << "!TEcnaHistos::ViewHistime(...)> The list of runs in file: " << list_of_run_file_name
8544  << " is empty !" << fTTBELL << endl;
8545  }
8546  if( nb_of_runs_in_list < 0 )
8547  {
8548  cout << "!TEcnaHistos::ViewHistime(...)> " << list_of_run_file_name
8549  << ": file not found in directory: " << fCfgHistoryRunListFilePath.Data() << fTTBELL << endl;
8550  }
8551  }
8552  } // end of if( OKHisto == 1 )
8553 } // end of ViewHistime
8554 
8555 //------------------------------------------------------------------------------------
8556 //
8557 // GetHistoryRunListParameters(...), AllocArraysForEvol(), GetListFileNumber(...)
8558 //
8559 //------------------------------------------------------------------------------------
8560 
8561 Int_t TEcnaHistos::GetHistoryRunListParameters(const TString& list_of_run_file_name, const TString& HistoCode)
8562 {
8563  // Build the array of run numbers from the list-of-runs .ascii file.
8564  // Return the list size
8565  // *=====> list_of_run_file_name is the name of the ASCII file containing the list of the runs
8566  //
8567  // SYNTAX OF THE FILE:
8568  //
8569  // HistoryRunList_EB_SM6_Analysis_1.ascii <- 1rst line: comment (file name for example)
8570  // 73677 <- 2nd line and others: run numbers (empty lines accepted)
8571  // 73688
8572  // 73689
8573  //
8574  // 73690
8575  // 73692
8576  //
8577  // In option SAME (of TEcnaHistos), several lists of runs can be called and these lists can have
8578  // DIFFERENT sizes (here the "size" is the number of runs of the list). In addition,
8579  // some runs in some lists may not exist in reality. So, we must adopt a convention which is
8580  // the following: the number of runs corresponds to the number of EXISTING runs
8581  // of the FIRST read list. Let be N1 this number.
8582  // If another list has more runs than N1 runs, we read only the first N1 runs.
8583  // If another list has less runs than N1 runs, we read all the runs of this list.
8584  //
8585  //--------------------------------------------------------------------------------------------------
8586 
8587  Int_t nb_of_runs_in_list = 0;
8588 
8589  //========= immediate return if file name is an empty string
8590  if( list_of_run_file_name.Data() == '\0' )
8591  {
8592  cout << "!TEcnaHistos::GetHistoryRunListParameters(...)> *** ERROR *** =====> "
8593  << " EMPTY STRING for list of run file name." << fTTBELL << endl;
8594  }
8595  else
8596  {
8597  // ===> increase the HistoryRunList file number
8598  if ( HistoCode == "H_Ped_Date" ){fNbOfListFileH_Ped_Date++;}
8599  if ( HistoCode == "H_TNo_Date" ){fNbOfListFileH_TNo_Date++;}
8600  if ( HistoCode == "H_MCs_Date" ){fNbOfListFileH_MCs_Date++;}
8601  if ( HistoCode == "H_LFN_Date" ){fNbOfListFileH_LFN_Date++;}
8602  if ( HistoCode == "H_HFN_Date" ){fNbOfListFileH_HFN_Date++;}
8603  if ( HistoCode == "H_SCs_Date" ){fNbOfListFileH_SCs_Date++;}
8604 
8605  if ( HistoCode == "H_Ped_RuDs" ){fNbOfListFileH_Ped_RuDs++;}
8606  if ( HistoCode == "H_TNo_RuDs" ){fNbOfListFileH_TNo_RuDs++;}
8607  if ( HistoCode == "H_MCs_RuDs" ){fNbOfListFileH_MCs_RuDs++;}
8608  if ( HistoCode == "H_LFN_RuDs" ){fNbOfListFileH_LFN_RuDs++;}
8609  if ( HistoCode == "H_HFN_RuDs" ){fNbOfListFileH_HFN_RuDs++;}
8610  if ( HistoCode == "H_SCs_RuDs" ){fNbOfListFileH_SCs_RuDs++;}
8611 
8612  fFapFileRuns = list_of_run_file_name.Data(); // (short name)
8613 
8614  //........... Add the path to the file name ( GetHistoryRunListParameters )
8615  TString xFileNameRunList = list_of_run_file_name.Data();
8616  const Text_t *t_file_name = (const Text_t *)xFileNameRunList.Data();
8617 
8618  //.............. replace the string "$HOME" by the true $HOME path
8619  if(fCfgHistoryRunListFilePath.BeginsWith("$HOME"))
8620  {
8621  fCfgHistoryRunListFilePath.Remove(0,5);
8622  const Text_t *t_file_nohome = (const Text_t *)fCfgHistoryRunListFilePath.Data(); // /scratch0/cna/...
8623 
8624  TString home_path = gSystem->Getenv("HOME");
8625  fCfgHistoryRunListFilePath = home_path; // /afs/cern.ch/u/USER
8626  fCfgHistoryRunListFilePath.Append(t_file_nohome); // /afs/cern.ch/u/USER/scratch0/cna/...
8627  }
8628 
8629  xFileNameRunList = fCfgHistoryRunListFilePath.Data();
8630 
8631  xFileNameRunList.Append('/');
8632  xFileNameRunList.Append(t_file_name);
8633 
8634  fFcin_f.open(xFileNameRunList.Data());
8635 
8636  //....................................... ( GetHistoryRunListParameters )
8637  if( fFcin_f.fail() == kFALSE )
8638  {
8639  //...................................... first reading to get the number of runs in the list
8640  fFcin_f.clear();
8641  string xHeadComment;
8642  fFcin_f >> xHeadComment;
8643  Int_t cRunNumber;
8644  Int_t list_size_read = 0;
8645 
8646  while( !fFcin_f.eof() ){fFcin_f >> cRunNumber; list_size_read++;}
8647  fFapNbOfRuns = list_size_read - 1;
8648 
8649  //...................................... second reading to get the run numbers
8650 
8651  //====== Return to the beginning of the file =====
8652  fFcin_f.clear();
8653  fFcin_f.seekg(0, ios::beg);
8654  //================================================
8655 
8656  string yHeadComment;
8657  fFcin_f >> yHeadComment;
8658 
8659  //....................... Set fFapMaxNbOfRuns to -1 at first call (first read file)
8660  //
8661  // fNbOfListFileEvolXXX is initialized to 0 in Init()
8662  // It is incremented once here above
8663  // So, at first call fNbOfListFileEvolXXX = 1
8664  // then fFapMaxNbOfRuns = -1
8665  //.......................................................................... (GetHistoryRunListParameters)
8666  if( (HistoCode == "H_Ped_Date" && fNbOfListFileH_Ped_Date == 1) ||
8667  (HistoCode == "H_TNo_Date" && fNbOfListFileH_TNo_Date == 1) ||
8668  (HistoCode == "H_MCs_Date" && fNbOfListFileH_MCs_Date == 1) ||
8669  (HistoCode == "H_LFN_Date" && fNbOfListFileH_LFN_Date == 1) ||
8670  (HistoCode == "H_HFN_Date" && fNbOfListFileH_HFN_Date == 1) ||
8671  (HistoCode == "H_SCs_Date" && fNbOfListFileH_SCs_Date == 1) ||
8672  (HistoCode == "H_Ped_RuDs" && fNbOfListFileH_Ped_RuDs == 1) ||
8673  (HistoCode == "H_TNo_RuDs" && fNbOfListFileH_TNo_RuDs == 1) ||
8674  (HistoCode == "H_MCs_RuDs" && fNbOfListFileH_MCs_RuDs == 1) ||
8675  (HistoCode == "H_LFN_RuDs" && fNbOfListFileH_LFN_RuDs == 1) ||
8676  (HistoCode == "H_HFN_RuDs" && fNbOfListFileH_HFN_RuDs == 1) ||
8677  (HistoCode == "H_SCs_RuDs" && fNbOfListFileH_SCs_RuDs == 1)){fFapMaxNbOfRuns = -1;}
8678 
8679  // first call: fFapMaxNbOfRuns = fFapNbOfRuns = nb of run from the first reading
8680  if( fFapMaxNbOfRuns == -1 ){fFapMaxNbOfRuns = fFapNbOfRuns;}
8681  // next calls: fFapNbOfRuns must not be greater than fFapMaxNbOfRuns found at first time
8682  else{if( fFapNbOfRuns > fFapMaxNbOfRuns ){fFapNbOfRuns = fFapMaxNbOfRuns;}}
8683 
8684  // Allocation and initialization of the array fT1DRunNumber[].
8685  //................. check maximum value for allocation
8686  if( fFapMaxNbOfRuns > fCnaParHistos->MaxNbOfRunsInLists() )
8687  {
8688  cout << "TEcnaHistos::GetHistoryRunListParameters(...)> Max number of runs in HistoryRunList = "
8689  << fFapMaxNbOfRuns
8690  << " too large, forced to parameter TEcnaParHistos->fMaxNbOfRunsInLists value (= "
8691  << fCnaParHistos->MaxNbOfRunsInLists()
8692  << "). Please, set this parameter to a larger value than " << fFapMaxNbOfRuns
8693  << fTTBELL << endl;
8694  fFapMaxNbOfRuns = fCnaParHistos->MaxNbOfRunsInLists();
8695  }
8696  //................................. Alloc of the array and init
8697  if( fT1DRunNumber == 0 )
8698  {
8699  if( fFapMaxNbOfRuns > 0 )
8700  {
8701  fT1DRunNumber = new Int_t[fFapMaxNbOfRuns]; fCnew++;
8702  }
8703  else
8704  {
8705  cout << "!TEcnaHistos::GetHistoryRunListParameters(...)> *** ERROR *** =====> fFapMaxNbOfRuns = "
8706  << fFapMaxNbOfRuns << ". Forced to 1." << fTTBELL << endl;
8707  fFapMaxNbOfRuns = 1;
8708  fT1DRunNumber = new Int_t[fFapMaxNbOfRuns]; fCnew++;
8709  }
8710  }
8711 
8712 
8713  //.................................... Init the list of runs
8714  for ( Int_t i_run = 0; i_run < fFapMaxNbOfRuns; i_run++ ){fT1DRunNumber[i_run] = -1;}
8715  //.................................... read the list of runs
8716  for (Int_t i_list = 0; i_list < fFapNbOfRuns; i_list++)
8717  {
8718  fFcin_f >> cRunNumber;
8719  fT1DRunNumber[i_list] = cRunNumber;
8720  }
8721  //........................................ ( GetHistoryRunListParameters )
8722  nb_of_runs_in_list = fFapNbOfRuns;
8723  fFcin_f.close();
8724  }
8725  else
8726  {
8727  fFcin_f.clear();
8728  cout << "!TEcnaHistos::GetHistoryRunListParameters(...)> *** ERROR *** =====> "
8729  << xFileNameRunList.Data() << " : file not found." << fTTBELL << endl;
8730  nb_of_runs_in_list = -1;
8731  }
8732  }
8733  return nb_of_runs_in_list;
8734 }
8735 // end of GetHistoryRunListParameters(...)
8736 
8737 //------------------------------------------------------------------------------------------------
8738 
8739 Int_t TEcnaHistos::GetListFileNumber(const TString& HistoCode)
8740 {
8741 // Get the number of the read list file
8742 
8743  Int_t number = 0;
8744 
8745  if ( HistoCode == "H_Ped_Date"){number = fNbOfListFileH_Ped_Date;}
8746  if ( HistoCode == "H_TNo_Date"){number = fNbOfListFileH_TNo_Date;}
8747  if ( HistoCode == "H_MCs_Date"){number = fNbOfListFileH_MCs_Date;}
8748  if ( HistoCode == "H_LFN_Date"){number = fNbOfListFileH_LFN_Date;}
8749  if ( HistoCode == "H_HFN_Date"){number = fNbOfListFileH_HFN_Date;}
8750  if ( HistoCode == "H_SCs_Date"){number = fNbOfListFileH_SCs_Date;}
8751  if ( HistoCode == "H_Ped_RuDs"){number = fNbOfListFileH_Ped_RuDs;}
8752  if ( HistoCode == "H_TNo_RuDs"){number = fNbOfListFileH_TNo_RuDs;}
8753  if ( HistoCode == "H_MCs_RuDs"){number = fNbOfListFileH_MCs_RuDs;}
8754  if ( HistoCode == "H_LFN_RuDs"){number = fNbOfListFileH_LFN_RuDs;}
8755  if ( HistoCode == "H_HFN_RuDs"){number = fNbOfListFileH_HFN_RuDs;}
8756  if ( HistoCode == "H_SCs_RuDs"){number = fNbOfListFileH_SCs_RuDs;}
8757  return number;
8758 }
8759 
8760 //--------------------------------------------------------------------------------------------------
8761 void TEcnaHistos::SetRunNumberFromList(const Int_t& xArgIndexRun, const Int_t& MaxNbOfRuns)
8762 {
8763  // Set run number for the xArgIndexRun_th run in the list of runs (evolution plots)
8764  // The array fT1DRunNumber[] have been obtained from a previous call
8765  // to GetHistoryRunListParameters(xFileNameRunList, HistoCode)
8766 
8767  if( xArgIndexRun >= 0 && xArgIndexRun < MaxNbOfRuns)
8768  {
8769  fFapRunNumber = fT1DRunNumber[xArgIndexRun];
8770  if( xArgIndexRun == 0 ){InitSpecParBeforeFileReading();} // SpecPar = Special Parameters (dates, times, run types)
8771  }
8772  else
8773  {
8774  cout << "!TEcnaHistos::SetRunNumberFromList(...)> **** ERROR **** Run index out of range in list of runs. xArgIndexRun = "
8775  << xArgIndexRun << " (MaxNbOfRuns = "<< MaxNbOfRuns << ")" << endl;
8776  }
8777 }
8778 
8779 //--------------------------------------------------------------------------------------------------
8781 {
8782  // Init parameters that will be set by reading the info which are in the results ROOT file
8783  // SpecPar = Special Parameters (dates, times, run types)
8784 
8785  Int_t MaxCar = fgMaxCar;
8786  fStartDate.Resize(MaxCar);
8787  fStartDate = "(date not found)";
8788 
8789  MaxCar = fgMaxCar;
8790  fStopDate.Resize(MaxCar);
8791  fStopDate = "(date not found)";
8792 
8793  fStartTime = (time_t)0;
8794  fStopTime = (time_t)0;
8795 
8796  fRunType = "(run type not found)";
8797 
8798 } // ------------- ( end of InitSpecParBeforeFileReading() ) -------------
8799 
8800 //======================================================================================
8801 //
8802 // 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
8803 //
8804 //======================================================================================
8805 
8807  const Int_t& StexStin_A, const Int_t& i0StinEcha, const Int_t& i0Sample,
8808  const TString& HistoCode)
8809 {
8810 // Check possibility to plot the histo
8811 
8812  Bool_t ok_view_histo = kFALSE;
8813 
8814  TString HistoType = fCnaParHistos->GetHistoType(HistoCode);
8815 
8816  TString root_file_name = aMyRootFile->GetRootFileNameShort();
8817 
8818  TVectorD vStin(fEcal->MaxStinEcnaInStex());
8819  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex() ; i++){vStin(i)=(Double_t)0.;}
8820  vStin = aMyRootFile->ReadStinNumbers(fEcal->MaxStinEcnaInStex());
8821 
8822  if( aMyRootFile->DataExist() == kTRUE )
8823  {
8824  fStatusDataExist = kTRUE;
8825 
8826  Int_t Stin_ok = 0;
8827  for (Int_t index_Stin = 0; index_Stin < fEcal->MaxStinEcnaInStex(); index_Stin++)
8828  {
8829  if ( vStin(index_Stin) == StexStin_A ){Stin_ok++;};
8830  }
8831 
8832  //.............................................. ok_view
8833  Int_t ok_view = 1;
8834 
8835  if( !( HistoType == "Global" || HistoType == "Proj" ) )
8836  {
8837  if( Stin_ok != 1)
8838  {
8839  Int_t StinNumber = StexStin_A;
8840  if( fFlagSubDet == "EE" )
8841  {StinNumber = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A);}
8842  cout << "!TEcnaHistos::GetOkViewHisto(...)> *ERROR* =====> " << "File: " << root_file_name
8843  << ", " << fFapStinName.Data() << " "
8844  << StinNumber
8845  << " not found. Available numbers = ";
8846  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
8847  {
8848  if( vStin(i) > 0 )
8849  {
8850  if( fFlagSubDet == "EB" ){cout << vStin(i) << ", ";}
8851  if( fFlagSubDet == "EE" )
8852  {cout << fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i)) << ", ";}
8853  }
8854  }
8855  cout << fTTBELL << endl;
8856  ok_view = -1;
8857  }
8858  else
8859  {
8860  ok_view = 1;
8861  }
8862  }
8863 
8864  //.............................................. ok_max_elt ( GetOkViewHisto(...) )
8865  Int_t ok_max_elt = 1;
8866 
8867  if( ( ( (HistoType == "H1Basic") || (HistoType == "Evol") || (HistoType == "EvolProj") )
8868  && (i0StinEcha >= 0) && (i0StinEcha<fEcal->MaxCrysInStin())
8869  && (i0Sample >= 0) && (i0Sample <fFapNbOfSamples ) ) ||
8870  !( (HistoType == "H1Basic") || (HistoType == "Evol") || (HistoType == "EvolProj") ))
8871  {ok_max_elt = 1;}
8872  else
8873  {
8874  Int_t Choffset = 0;
8875  if( fFlagSubDet == "EE" ){Choffset = 1;}
8876  if( ( (HistoType == "H1Basic") || (HistoType == "Evol") || (HistoType == "EvolProj") )
8877  && !( (i0StinEcha >= 0) && (i0StinEcha<fEcal->MaxCrysInStin()) ) )
8878  {cout << "!TEcnaHistos::GetOkViewHisto(...)> *ERROR* =====> " << "File: " << root_file_name
8879  << ". Wrong channel number. Value = " << i0StinEcha << " (required range: [" << Choffset << ", "
8880  << fEcal->MaxCrysInStin()-1+Choffset << "] )"
8881  << fTTBELL << endl;}
8882  if( (HistoCode == "D_Adc_EvDs" || HistoCode == "D_Adc_EvNb") &&
8883  !((i0Sample >= 0) && (i0Sample <fFapNbOfSamples)) )
8884  {cout << "!TEcnaHistos::GetOkViewHisto(...)> *ERROR* =====> " << "File: " << root_file_name
8885  << ". Wrong sample index. Value = " << i0Sample << " (required range: [0, "
8886  << fFapNbOfSamples-1 << "] )"
8887  << fTTBELL << endl;}
8888  ok_max_elt = -1;
8889  }
8890 
8891  if( (ok_view == 1) && (ok_max_elt == 1) )
8892  {
8893  ok_view_histo = kTRUE;
8894  }
8895  else
8896  {
8897  cout << "!TEcnaHistos::GetOkViewHisto(...)> At least one ERROR has been detected. ok_view = " << ok_view
8898  << ", ok_max_elt = " << ok_max_elt << fTTBELL << endl;
8899  }
8900  }
8901  else
8902  {
8903  fStatusDataExist = kFALSE;
8904 
8905  cout << "!TEcnaHistos::GetOkViewHisto(...)> No data in ROOT file "
8906  << ", aMyRootFile->DataExist() = " << aMyRootFile->DataExist() << fTTBELL << endl;
8907  }
8908  return ok_view_histo;
8909 }
8910 //..............................................................................................
8911 
8912 Int_t TEcnaHistos::SetHistoFrameYminYmaxFromMemo(TH1D* h_his0, const TString& HistoCode)
8913 {
8914 // Set min and max according to HistoCode
8915 
8916  // if Ymin = Ymax (or Ymin > Ymax): nothing done here
8917  // return xFlagAutoYsupMargin = 1
8918  //
8919  // if Ymin < Ymax: min and max calculated by h_his0->SetMinimum() and h_his0->SetMaximum()
8920  // return xFlagAutoYsupMargin = 0
8921 
8922  Int_t xFlagAutoYsupMargin = 1; // (SetHistoFrameYminYmaxFromMemo)
8923 
8924  if(HistoCode == "D_NOE_ChNb"){
8925  if(fD_NOE_ChNbYmin < fD_NOE_ChNbYmax){xFlagAutoYsupMargin = 0;
8926  h_his0->SetMinimum(fD_NOE_ChNbYmin); h_his0->SetMaximum(fD_NOE_ChNbYmax);}}
8927 
8928  if(HistoCode == "D_NOE_ChDs"){
8929  if(fD_NOE_ChDsYmin < fD_NOE_ChDsYmax){xFlagAutoYsupMargin = 0;
8930  h_his0->SetMinimum(fD_NOE_ChDsYmin); h_his0->SetMaximum(fD_NOE_ChDsYmax);}}
8931 
8932  if(HistoCode == "D_Ped_ChNb"){
8933  if(fD_Ped_ChNbYmin < fD_Ped_ChNbYmax){xFlagAutoYsupMargin = 0;
8934  h_his0->SetMinimum(fD_Ped_ChNbYmin); h_his0->SetMaximum(fD_Ped_ChNbYmax);}}
8935 
8936  if(HistoCode == "D_Ped_ChDs"){
8937  if(fD_Ped_ChDsYmin < fD_Ped_ChDsYmax){xFlagAutoYsupMargin = 0;
8938  h_his0->SetMinimum(fD_Ped_ChDsYmin); h_his0->SetMaximum(fD_Ped_ChDsYmax);}}
8939 
8940  if(HistoCode == "D_TNo_ChNb"){
8941  if(fD_TNo_ChNbYmin < fD_TNo_ChNbYmax){xFlagAutoYsupMargin = 0;
8942  h_his0->SetMinimum(fD_TNo_ChNbYmin); h_his0->SetMaximum(fD_TNo_ChNbYmax);}}
8943 
8944  if(HistoCode == "D_TNo_ChDs"){
8945  if(fD_TNo_ChDsYmin < fD_TNo_ChDsYmax){xFlagAutoYsupMargin = 0;
8946  h_his0->SetMinimum(fD_TNo_ChDsYmin); h_his0->SetMaximum(fD_TNo_ChDsYmax);}}
8947 
8948  if(HistoCode == "D_MCs_ChNb"){
8949  if(fD_MCs_ChNbYmin < fD_MCs_ChNbYmax){xFlagAutoYsupMargin = 0;
8950  h_his0->SetMinimum(fD_MCs_ChNbYmin); h_his0->SetMaximum(fD_MCs_ChNbYmax);}}
8951 
8952  if(HistoCode == "D_MCs_ChDs"){
8953  if(fD_MCs_ChDsYmin < fD_MCs_ChDsYmax){xFlagAutoYsupMargin = 0;
8954  h_his0->SetMinimum(fD_MCs_ChDsYmin); h_his0->SetMaximum(fD_MCs_ChDsYmax);}}
8955 
8956  if(HistoCode == "D_LFN_ChNb"){
8957  if(fD_LFN_ChNbYmin < fD_LFN_ChNbYmax){xFlagAutoYsupMargin = 0;
8958  h_his0->SetMinimum(fD_LFN_ChNbYmin); h_his0->SetMaximum(fD_LFN_ChNbYmax);}}
8959 
8960  if(HistoCode == "D_LFN_ChDs"){
8961  if(fD_LFN_ChDsYmin < fD_LFN_ChDsYmax){xFlagAutoYsupMargin = 0;
8962  h_his0->SetMinimum(fD_LFN_ChDsYmin); h_his0->SetMaximum(fD_LFN_ChDsYmax);}}
8963 
8964  if(HistoCode == "D_HFN_ChNb"){
8965  if(fD_HFN_ChNbYmin < fD_HFN_ChNbYmax){xFlagAutoYsupMargin = 0;
8966  h_his0->SetMinimum(fD_HFN_ChNbYmin); h_his0->SetMaximum(fD_HFN_ChNbYmax);}}
8967 
8968  if(HistoCode == "D_HFN_ChDs"){
8969  if(fD_HFN_ChDsYmin < fD_HFN_ChDsYmax){xFlagAutoYsupMargin = 0;
8970  h_his0->SetMinimum(fD_HFN_ChDsYmin); h_his0->SetMaximum(fD_HFN_ChDsYmax);}}
8971 
8972  if(HistoCode == "D_SCs_ChNb"){
8973  if(fD_SCs_ChNbYmin < fD_SCs_ChNbYmax){xFlagAutoYsupMargin = 0;
8974  h_his0->SetMinimum(fD_SCs_ChNbYmin); h_his0->SetMaximum(fD_SCs_ChNbYmax);}}
8975 
8976  if(HistoCode == "D_SCs_ChDs"){
8977  if(fD_SCs_ChDsYmin < fD_SCs_ChDsYmax){xFlagAutoYsupMargin = 0;
8978  h_his0->SetMinimum(fD_SCs_ChDsYmin); h_his0->SetMaximum(fD_SCs_ChDsYmax);}}
8979 
8980  if(HistoCode == "D_MSp_SpNb"){
8981  if(fD_MSp_SpNbYmin < fD_MSp_SpNbYmax){xFlagAutoYsupMargin = 0;
8982  h_his0->SetMinimum(fD_MSp_SpNbYmin); h_his0->SetMaximum(fD_MSp_SpNbYmax);}}
8983 
8984  if(HistoCode == "D_MSp_SpDs"){
8985  if(fD_MSp_SpDsYmin < fD_MSp_SpDsYmax){xFlagAutoYsupMargin = 0;
8986  h_his0->SetMinimum(fD_MSp_SpDsYmin); h_his0->SetMaximum(fD_MSp_SpDsYmax);}}
8987 
8988  if(HistoCode == "D_SSp_SpNb"){
8989  if(fD_SSp_SpNbYmin < fD_SSp_SpNbYmax){xFlagAutoYsupMargin = 0;
8990  h_his0->SetMinimum(fD_SSp_SpNbYmin); h_his0->SetMaximum(fD_SSp_SpNbYmax);}}
8991 
8992  if(HistoCode == "D_SSp_SpDs"){
8993  if(fD_SSp_SpDsYmin < fD_SSp_SpDsYmax){xFlagAutoYsupMargin = 0;
8994  h_his0->SetMinimum(fD_SSp_SpDsYmin); h_his0->SetMaximum(fD_SSp_SpDsYmax);}}
8995 
8996  if(HistoCode == "D_Adc_EvNb"){
8997  if(fD_Adc_EvNbYmin < fD_Adc_EvNbYmax){xFlagAutoYsupMargin = 0;
8998  h_his0->SetMinimum(fD_Adc_EvNbYmin); h_his0->SetMaximum(fD_Adc_EvNbYmax);}}
8999 
9000  if(HistoCode == "D_Adc_EvDs"){
9001  if(fD_Adc_EvDsYmin < fD_Adc_EvDsYmax){xFlagAutoYsupMargin = 0;
9002  h_his0->SetMinimum(fD_Adc_EvDsYmin); h_his0->SetMaximum(fD_Adc_EvDsYmax);}}
9003 
9004  if(HistoCode == "H2CorccInStins"){
9005  if(fH2CorccInStinsYmin < fH2CorccInStinsYmax){xFlagAutoYsupMargin = 0;
9006  h_his0->SetMinimum(fH2CorccInStinsYmin); h_his0->SetMaximum(fH2CorccInStinsYmax);}}
9007 
9008  if(HistoCode == "H2LFccMosMatrix"){
9009  if(fH2LFccMosMatrixYmin < fH2LFccMosMatrixYmax){xFlagAutoYsupMargin = 0;
9010  h_his0->SetMinimum(fH2LFccMosMatrixYmin); h_his0->SetMaximum(fH2LFccMosMatrixYmax);}}
9011 
9012  if(HistoCode == "H2HFccMosMatrix"){
9013  if(fH2HFccMosMatrixYmin < fH2HFccMosMatrixYmax){xFlagAutoYsupMargin = 0;
9014  h_his0->SetMinimum(fH2HFccMosMatrixYmin); h_his0->SetMaximum(fH2HFccMosMatrixYmax);}}
9015 
9016  if(HistoCode == "H_Ped_RuDs"){
9017  if(fH_Ped_RuDsYmin < fH_Ped_RuDsYmax){xFlagAutoYsupMargin = 0;
9018  h_his0->SetMinimum(fH_Ped_RuDsYmin); h_his0->SetMaximum(fH_Ped_RuDsYmax);}}
9019 
9020  if(HistoCode == "H_TNo_RuDs"){
9021  if(fH_TNo_RuDsYmin < fH_TNo_RuDsYmax){xFlagAutoYsupMargin = 0;
9022  h_his0->SetMinimum(fH_TNo_RuDsYmin); h_his0->SetMaximum(fH_TNo_RuDsYmax);}}
9023 
9024  if(HistoCode == "H_MCs_RuDs"){
9025  if(fH_MCs_RuDsYmin < fH_MCs_RuDsYmax){xFlagAutoYsupMargin = 0;
9026  h_his0->SetMinimum(fH_MCs_RuDsYmin); h_his0->SetMaximum(fH_MCs_RuDsYmax);}}
9027 
9028  if(HistoCode == "H_LFN_RuDs"){
9029  if(fH_LFN_RuDsYmin < fH_LFN_RuDsYmax){xFlagAutoYsupMargin = 0;
9030  h_his0->SetMinimum(fH_LFN_RuDsYmin); h_his0->SetMaximum(fH_LFN_RuDsYmax);}}
9031 
9032  if(HistoCode == "H_HFN_RuDs"){
9033  if(fH_HFN_RuDsYmin < fH_HFN_RuDsYmax){xFlagAutoYsupMargin = 0;
9034  h_his0->SetMinimum(fH_HFN_RuDsYmin); h_his0->SetMaximum(fH_HFN_RuDsYmax);}}
9035 
9036  if(HistoCode == "H_SCs_RuDs"){
9037  if(fH_SCs_RuDsYmin < fH_SCs_RuDsYmax){xFlagAutoYsupMargin = 0;
9038  h_his0->SetMinimum(fH_SCs_RuDsYmin); h_his0->SetMaximum(fH_SCs_RuDsYmax);}}
9039 
9040  return xFlagAutoYsupMargin;
9041 } // end of SetHistoFrameYminYmaxFromMemo
9042 
9043 Int_t TEcnaHistos::SetGraphFrameYminYmaxFromMemo(TGraph* g_graph0, const TString& HistoCode)
9044 {
9045 // Set min and max according to HistoCode
9046 
9047  Int_t xFlagAutoYsupMargin = 1; // DEFAULT: 1 = min and max calulated by ROOT, 0 = by this code
9048 
9049  if(HistoCode == "H_Ped_Date"){
9050  if(fH_Ped_DateYmin < fH_Ped_DateYmax){xFlagAutoYsupMargin = 0;
9051  g_graph0->SetMinimum(fH_Ped_DateYmin); g_graph0->SetMaximum(fH_Ped_DateYmax);}}
9052 
9053  if(HistoCode == "H_TNo_Date"){
9054  if(fH_TNo_DateYmin < fH_TNo_DateYmax){xFlagAutoYsupMargin = 0;
9055  g_graph0->SetMinimum(fH_TNo_DateYmin); g_graph0->SetMaximum(fH_TNo_DateYmax);}}
9056 
9057  if(HistoCode == "H_MCs_Date"){
9058  if(fH_MCs_DateYmin < fH_MCs_DateYmax){xFlagAutoYsupMargin = 0;
9059  g_graph0->SetMinimum(fH_MCs_DateYmin); g_graph0->SetMaximum(fH_MCs_DateYmax);}}
9060 
9061  if(HistoCode == "H_LFN_Date"){
9062  if(fH_LFN_DateYmin < fH_LFN_DateYmax){xFlagAutoYsupMargin = 0;
9063  g_graph0->SetMinimum(fH_LFN_DateYmin); g_graph0->SetMaximum(fH_LFN_DateYmax);}}
9064 
9065  if(HistoCode == "H_HFN_Date"){
9066  if(fH_HFN_DateYmin < fH_HFN_DateYmax){xFlagAutoYsupMargin = 0;
9067  g_graph0->SetMinimum(fH_HFN_DateYmin); g_graph0->SetMaximum(fH_HFN_DateYmax);}}
9068 
9069  if(HistoCode == "H_SCs_Date"){
9070  if(fH_SCs_DateYmin < fH_SCs_DateYmax){xFlagAutoYsupMargin = 0;
9071  g_graph0->SetMinimum(fH_SCs_DateYmin); g_graph0->SetMaximum(fH_SCs_DateYmax);}}
9072 
9073  return xFlagAutoYsupMargin;
9074 } // end of SetGraphFrameYminYmaxFromMemo
9075 
9076 //..............................................................................................
9077 Double_t TEcnaHistos::GetYminFromHistoFrameAndMarginValue(TH1D* h_his0, const Double_t margin_factor)
9078 {
9079 //Calculation for automatic minimum with margin
9080  Double_t minproj = h_his0->GetMinimum();
9081  Double_t maxproj = h_his0->GetMaximum();
9082  minproj = minproj - (maxproj-minproj)*margin_factor;
9083  return minproj;
9084 }
9085 
9086 Double_t TEcnaHistos::GetYmaxFromHistoFrameAndMarginValue(TH1D* h_his0, const Double_t margin_factor)
9087 {
9088 //Calculation for automatic maximum with margin
9089  Double_t minproj = h_his0->GetMinimum();
9090  Double_t maxproj = h_his0->GetMaximum();
9091  maxproj = maxproj + (maxproj-minproj)*margin_factor;
9092  return maxproj;
9093 }
9094 
9095 Double_t TEcnaHistos::GetYminFromGraphFrameAndMarginValue(TGraph* g_graph0, const Double_t margin_factor)
9096 {
9097 //Calculation for automatic minimum with margin
9098  Double_t graph_ymin = g_graph0->GetY()[0];
9099  for(Int_t i=1; i<g_graph0->GetN(); i++)
9100  {if( g_graph0->GetY()[i] < graph_ymin ){graph_ymin = g_graph0->GetY()[i];}}
9101 
9102  Double_t graph_ymax = g_graph0->GetY()[0];
9103  for(Int_t i=1; i<g_graph0->GetN(); i++)
9104  {if( g_graph0->GetY()[i] > graph_ymax ){graph_ymax = g_graph0->GetY()[i];}}
9105 
9106  graph_ymin = graph_ymin - (graph_ymax-graph_ymin)*margin_factor;
9107  return graph_ymin;
9108 }
9109 Double_t TEcnaHistos::GetYmaxFromGraphFrameAndMarginValue(TGraph* g_graph0, const Double_t margin_factor)
9110 {
9111 //Calculation for automatic maximum with margin
9112  Double_t graph_ymin = g_graph0->GetY()[0];
9113  for(Int_t i=1; i<g_graph0->GetN(); i++)
9114  {if( g_graph0->GetY()[i] < graph_ymin ){graph_ymin = g_graph0->GetY()[i];}}
9115 
9116  Double_t graph_ymax = g_graph0->GetY()[0];
9117  for(Int_t i=1; i<g_graph0->GetN(); i++)
9118  {if( g_graph0->GetY()[i] > graph_ymax ){graph_ymax = g_graph0->GetY()[i];}}
9119 
9120  graph_ymax = graph_ymax + (graph_ymax-graph_ymin)*margin_factor;
9121  return graph_ymax;
9122 }
9123 //----------------------------------------------- HistoPlot
9124 
9125 void TEcnaHistos::HistoPlot(TH1D* h_his0, const Int_t& HisSize,
9126  const Axis_t& xinf_his, const Axis_t& xsup_his,
9127  const TString& HistoCode, const TString& HistoType,
9128  const Int_t& StexStin_A, const Int_t& i0StinEcha, const Int_t& i0Sample,
9129  const Int_t& opt_scale_x, const Int_t& opt_scale_y,
9130  const TString& opt_plot, const Int_t& arg_AlreadyRead,
9131  const Int_t& xFlagAutoYsupMargin)
9132 {
9133  // Plot 1D histogram
9134 
9135  UInt_t canv_w = fCnaParHistos->SetCanvasWidth(HistoCode.Data(), opt_plot);
9136  UInt_t canv_h = fCnaParHistos->SetCanvasHeight(HistoCode.Data(), opt_plot);
9137 
9138  TString QuantityName = " ";
9139  Int_t MaxCar = fgMaxCar;
9140  QuantityName.Resize(MaxCar);
9141  QuantityName = fCnaParHistos->GetQuantityName(HistoCode.Data());
9142 
9143 
9144  if( arg_AlreadyRead == 0 || arg_AlreadyRead == 1 )
9145  {
9146  SetHistoPresentation(h_his0, HistoType.Data(), opt_plot); // (gStyle parameters)
9147  //.................................................. prepa paves commentaires (HistoPlot)
9148  SetAllPavesViewHisto(HistoCode.Data(), StexStin_A, i0StinEcha, i0Sample, opt_plot.Data(), arg_AlreadyRead);
9149  }
9150 
9151  //..................................................... Canvas name (HistoPlot)
9152  TString canvas_name = SetCanvasName(HistoCode.Data(), opt_scale_x, opt_scale_y,
9153  opt_plot.Data(), arg_AlreadyRead,
9154  StexStin_A, i0StinEcha, i0Sample);
9155  //..................................................... Canvas allocations (HistoPlot)
9156  TCanvas* MainCanvas = 0;
9157 
9158  if(opt_plot == fOnlyOnePlot && (arg_AlreadyRead == 0 || arg_AlreadyRead == 1 ) )
9159  {
9160  MainCanvas = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w , canv_h); fCnewRoot++;
9161  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();
9162  }
9163 
9164  if( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
9165  {if(GetMemoFlag(HistoCode, opt_plot) == "Free")
9166  {MainCanvas = CreateCanvas(HistoCode, opt_plot, canvas_name, canv_w, canv_h);
9167  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();}}
9168 
9169  // cout << "*TEcnaHistos::HistoPlot(...)> Plot is displayed on canvas ----> " << canvas_name.Data() << endl;
9170 
9171  //--------------- EE => SC for construction, EB => Xtal in SM (default: Stin ECNA number, i0StinEcha)
9172  Int_t Stex_StinCons = StexStin_A; // Stex_StinCons = Tower for EB, SC for construction for EE
9173  Int_t n1StexCrys = i0StinEcha+1; // n1StexCrys = Crys in SM for EB, ECNA
9174 
9175  if( StexStin_A >= 1 && StexStin_A <= fEcal->MaxStinEcnaInStex() )
9176  {
9177  if( fFlagSubDet == "EB" )
9178  {n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);}
9179  if( fFlagSubDet == "EE" )
9180  {Stex_StinCons = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A);}
9181  }
9182 
9183  //------ String for StexNumber ( to display "EB" or "EE" if Stex = 0 )
9184  TString sFapStexNumber = StexNumberToString(fFapStexNumber);
9185 
9186  //============================================================================= (HistoPlot)
9187  //
9188  // 1st OPERATIONS: Pave texts preparation and first Draw.
9189  // SetParametersCanvas
9190  // Set Memo Flags.
9191  // Set main_subpad and main_pavtxt
9192  //
9193  //=============================================================================
9194  TVirtualPad* main_subpad = 0; // main_subpad: Pad for the histo
9195  TPaveText* main_pavtxt = 0; // Pave for the "Several Changing" parameters (options SAME and SAME n)
9196 
9197  Int_t xMemoPlotSame = 1; // a priori ==> SAME plot
9198 
9199  //========================================= Option ONLYONE (HistoPlot)
9200  if( opt_plot == fOnlyOnePlot )
9201  {
9202  if( arg_AlreadyRead == 0 || arg_AlreadyRead == 1 )
9203  {
9204  //.................................... Draw titles and paves (pad = main canvas)
9205  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
9206  fPavComStex->Draw();
9207  if( !( HistoType == "Global" || HistoType == "Proj" ) ){fPavComStin->Draw(); fPavComXtal->Draw();}
9208 
9209  if( HistoType == "EvolProj" )
9210  {
9211  fPavComEvolRuns->Draw();
9212  fPavComEvolNbOfEvtsAna->Draw();
9213  }
9214  else
9215  {
9216  fPavComAnaRun->Draw();
9217  fPavComNbOfEvts->Draw();
9218  }
9219 
9220  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
9221  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
9222  Double_t y_low = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
9223  Double_t y_up = fCnaParHistos->BoxBottomY("top_right_box_EB") - 0.005;
9224  Color_t fond_pad = fCnaParHistos->ColorDefinition("blanc");
9225 
9226  Double_t x_margin = x_low;
9227  Double_t y_margin = y_low;
9228  MainCanvas->Divide( 1, 1, x_margin, y_margin, fond_pad);
9229  // Divide(nx, ny, x_margin, y_margin, color);
9230 
9231  gPad->cd(1);
9232  main_subpad = gPad;
9233  main_subpad->SetPad(x_low, y_low, x_up, y_up);
9234 
9235  xMemoPlotSame = 0;
9236  }
9237  if (arg_AlreadyRead > 1 )
9238  {main_subpad = fCurrentPad;}
9239 
9240  } // end of if(opt_plot == fOnlyOnePlot && (arg_AlreadyRead == 0 || arg_AlreadyRead == 1 ) )
9241 
9242  //========================================= Options SAME and SAME n (HistoPlot)
9243  if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
9244  {
9245  //..................... First call in options SAME and SAME n
9246  if( GetMemoFlag(HistoCode, opt_plot) == "Free" )
9247  {
9248  //Call to SetParametersPavTxt
9249  //fPavTxt<HISTOCODE> = fPavComSeveralChanging; => come from SetAllPavesViewHisto
9250  SetParametersPavTxt(HistoCode, opt_plot);
9251 
9252  //---------------- Call to ActivePavTxt
9253  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
9254  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
9255 
9256  //---------------------------- Set texts for pave "several changing", options SAME and SAME n
9257  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
9258 
9259  main_pavtxt->SetTextAlign(fTextPaveAlign);
9260  main_pavtxt->SetTextFont(fTextPaveFont);
9261  main_pavtxt->SetBorderSize(fTextBorderSize);
9262  Float_t cTextPaveSize = 0.025;
9263  if( HistoType == "H1Basic" || HistoType == "SampProj" || HistoType == "H1BasicProj" ||
9264  HistoType == "Proj" || HistoType == "EvolProj" )
9265  {cTextPaveSize = 0.025;}
9266  main_pavtxt->SetTextSize(cTextPaveSize);
9267 
9268  char* f_in = new char[fgMaxCar]; fCnew++;
9269 
9270  //------------------------------------------------------------ titles pave "several" (HistoPlot)
9271  TString DecalStexName = "";
9272  if( fFlagSubDet == "EB" ){DecalStexName = " ";}
9273  TString DecalStinName = "";
9274  if( fFlagSubDet == "EE" ){DecalStinName = " ";}
9275 
9276  TString sStexOrStasName = "";
9277  if( fFapStexNumber == 0 ){sStexOrStasName = " ";}
9278  if( fFapStexNumber != 0 ){sStexOrStasName = fFapStexName;}
9279 
9280  if( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot )
9281  {
9282  if( HistoType == "SampGlobal" )
9283  {sprintf(f_in, "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s %s%s %s %s Sample",
9284  DecalStexName.Data(), sStexOrStasName.Data(),
9285  DecalStinName.Data(), fFapStinName.Data(), fFapXtalName.Data(), fFapEchaName.Data());}
9286  if( HistoType == "SampProj" )
9287  {sprintf(f_in, "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s %s%s %s %s Sample",
9288  DecalStexName.Data(), sStexOrStasName.Data(),
9289  DecalStinName.Data(), fFapStinName.Data(), fFapXtalName.Data(), fFapEchaName.Data());}
9290  if( HistoType == "H1Basic" || HistoType == "H1BasicProj" )
9291  {sprintf(f_in, "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s %s%s %s %s",
9292  DecalStexName.Data(), sStexOrStasName.Data(),
9293  DecalStinName.Data(), fFapStinName.Data(), fFapXtalName.Data(), fFapEchaName.Data());}
9294  if((HistoType == "Global") || (HistoType == "Proj") )
9295  {sprintf(f_in, "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s",
9296  DecalStexName.Data(), sStexOrStasName.Data());}
9297 
9298  if( HistoType == "EvolProj" )
9299  {sprintf(f_in, "Analysis Samp Evts range Nb Evts %s%s %s%s %s %s",
9300  DecalStexName.Data(), sStexOrStasName.Data(),
9301  DecalStinName.Data(), fFapStinName.Data(), fFapXtalName.Data(), fFapEchaName.Data());}
9302  }
9303 
9304  TText* ttit = main_pavtxt->AddText(f_in);
9305  ttit->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
9306 
9307  //------------------------------------------------------------ values pave "several" (HistoPlot)
9308 
9309  //.................................... option SAME n only (HistoPlot)
9310  if( opt_plot == fSameOnePlot)
9311  {
9312  if( (HistoType == "Global") || (HistoType == "Proj") || (HistoType == "H1BasicProj") )
9313  {
9314  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s %-25s",
9315  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber, fRunType.Data(),
9316  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts,
9317  sFapStexNumber.Data(), QuantityName.Data());
9318  }
9319 
9320  if( HistoType == "EvolProj" )
9321  {
9322  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%7d %-25s",
9323  fFapAnaType.Data(), fFapNbOfSamples, fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts,
9324  sFapStexNumber.Data(), Stex_StinCons, n1StexCrys, i0StinEcha, QuantityName.Data());
9325  }
9326 
9327  } // end of if for option SAME n only
9328 
9329  //..................................... option SAME (HistoPlot)
9330  if( opt_plot == fSeveralPlot )
9331  {
9332  Int_t kSample = i0Sample+1; // Sample number range = [1,n<=10]
9333 
9334  if( HistoType == "SampGlobal" )
9335  {
9336  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d%6d",
9337  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber, fRunType.Data(),
9338  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts,sFapStexNumber.Data(),
9339  Stex_StinCons, n1StexCrys, i0StinEcha, kSample);
9340  }
9341  if( HistoType == "SampProj" )
9342  {
9343  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d%6d",
9344  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber, fRunType.Data(),
9345  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts, sFapStexNumber.Data(),
9346  Stex_StinCons, n1StexCrys, i0StinEcha, kSample);
9347  }
9348  if( HistoType == "H1Basic" || HistoType == "H1BasicProj" )
9349  {
9350  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d",
9351  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber, fRunType.Data(),
9352  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts, sFapStexNumber.Data(),
9353  Stex_StinCons, n1StexCrys, i0StinEcha);
9354  }
9355  if( (HistoType == "Global") || (HistoType == "Proj") )
9356  {
9357  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s",
9358  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber, fRunType.Data(),
9359  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts, sFapStexNumber.Data());
9360  }
9361 
9362  if( HistoType == "EvolProj" )
9363  {
9364  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %4s%7d%5d%5d",
9365  fFapAnaType.Data(), fFapNbOfSamples,
9366  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts, sFapStexNumber.Data(),
9367  Stex_StinCons, n1StexCrys, i0StinEcha);
9368  }
9369  }
9370 
9371  TText* tt = main_pavtxt->AddText(f_in);
9372  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
9373 
9374  delete [] f_in; f_in = 0; fCdelete++;
9375 
9376  //---------------- Draw the "several changing" pave with its text in the Canvas (AT FIRST TIME)
9377  main_pavtxt->Draw();
9378  //---------------- Draw evol run pave if "EvolProj" (AT FIRST TIME)
9379  if( HistoType == "EvolProj" ){fPavComEvolRuns->Draw();}
9380 
9381  //---------------- Call to SetParametersCanvas
9382  //fImp<HISTOCODE> = (TCanvasImp*)fCanv<HISTOCODE>->GetCanvasImp();
9383  //fCanv<HISTOCODE>->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
9384  //fPad<HISTOCODE> = gPad;
9385  //fMemoPlot<HISTOCODE> = 1; =======> set MemoFlag to "Buzy"
9386  //fMemoColor<HISTOCODE> = 0;
9387  SetParametersCanvas(HistoCode, opt_plot);
9388 
9389  //---------------- Set xMemoPlotSame to 0
9390  xMemoPlotSame = 0;
9391  } // end of if( GetMemoFlag(HistoCode, opt_plot) == "Free" ) (HistoPlot)
9392 
9393  //.......... First and further calls in options SAME and SAME n (fMemoPlot<HISTOCODE> = 1)
9394  if(GetMemoFlag(HistoCode, opt_plot) == "Busy")
9395  {
9396  //---------------- Call to ActivePavTxt
9397  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
9398  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
9399 
9400  //---------------- Call to ActivePad
9401  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
9402 
9403  //---------------- Recover pointer to the current canvas
9404  MainCanvas = GetCurrentCanvas(HistoCode.Data(), opt_plot.Data());
9405  }
9406  } // end of if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
9407 
9408 
9409  //============================================================================= (HistoPlot)
9410  //
9411  // 2nd OPERATIONS: Write and Draw the parameter values in the
9412  // "several changing" pave (options SAME and SAME n)
9413  // and Draw Histo
9414  //=============================================================================
9415  if(main_subpad != 0)
9416  {
9417  if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
9418  {
9419  //------------------------------------------------------------ values
9420  if(xMemoPlotSame != 0)
9421  {
9422  // main_pavtxt = fPavComSeveralChanging = fPavTxt<HISTOCODE>
9423  main_pavtxt->SetTextAlign(fTextPaveAlign);
9424  main_pavtxt->SetTextFont(fTextPaveFont);
9425  main_pavtxt->SetBorderSize(fTextBorderSize);
9426  Float_t cTextPaveSize = 0.025;
9427  if( HistoType == "H1Basic" || HistoType == "SampProj"
9428  || HistoType == "Proj" || HistoType == "EvolProj" || HistoType == "H1BasicProj" )
9429  {cTextPaveSize = 0.025;}
9430  main_pavtxt->SetTextSize(cTextPaveSize);
9431 
9432  char* f_in = new char[fgMaxCar]; fCnew++;
9433 
9434  if( opt_plot == fSameOnePlot )
9435  {
9436  if( (HistoType == "Global") || (HistoType == "Proj") )
9437  {
9438  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s %-25s",
9439  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber, fRunType.Data(),
9440  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts,
9441  sFapStexNumber.Data(), QuantityName.Data());
9442  }
9443 
9444  if( HistoType == "EvolProj" )
9445  {
9446  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%7d %-25s",
9447  fFapAnaType.Data(), fFapNbOfSamples,
9448  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts, sFapStexNumber.Data(),
9449  Stex_StinCons, n1StexCrys, i0StinEcha, QuantityName.Data());
9450  }
9451  }
9452 
9453  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
9454  {
9455  Int_t kSample = i0Sample+1; // Sample number range = [1,n<=10] (HistoPlot)
9456 
9457  if(HistoType == "SampGlobal" )
9458  {
9459  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d%6d",
9460  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber, fRunType.Data(),
9461  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts, sFapStexNumber.Data(),
9462  Stex_StinCons, n1StexCrys, i0StinEcha, kSample);
9463  }
9464  if( HistoType == "SampProj" )
9465  {
9466  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d%6d",
9467  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber, fRunType.Data(),
9468  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts, sFapStexNumber.Data(),
9469  Stex_StinCons, n1StexCrys, i0StinEcha, kSample);
9470  }
9471  if( HistoType == "H1Basic" || HistoType == "H1BasicProj")
9472  {
9473  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%5d",
9474  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber, fRunType.Data(),
9475  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts, sFapStexNumber.Data(),
9476  Stex_StinCons, n1StexCrys, i0StinEcha);
9477  }
9478  if( (HistoType == "Global") || (HistoType == "Proj") )
9479  {
9480  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s",
9481  fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber, fRunType.Data(),
9482  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts, sFapStexNumber.Data());
9483  }
9484 
9485  if( HistoType == "EvolProj" )
9486  {
9487  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %4s%7d%5d%5d",
9488  fFapAnaType.Data(), fFapNbOfSamples,
9489  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts,
9490  sFapStexNumber.Data(), Stex_StinCons, n1StexCrys, i0StinEcha);
9491  }
9492  }
9493 
9494  TText *tt = main_pavtxt->AddText(f_in);
9495  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
9496  MainCanvas->cd(); gStyle->SetOptDate(0);
9497  main_pavtxt->Draw();
9498 
9499  delete [] f_in; f_in = 0; fCdelete++;
9500  }
9501 
9502  main_subpad->cd();
9503  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
9504  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
9505  Double_t y_low = fCnaParHistos->BoxTopY("several_plots_box") + 0.005;
9506  Double_t y_up = fCnaParHistos->BoxBottomY("general_comment") - 0.005;
9507  if( opt_plot == fSameOnePlot && HistoType == "EvolProj" )
9508  {y_up = fCnaParHistos->BoxBottomY("top_left_box_EB") - 0.005;}
9509  main_subpad->SetPad(x_low, y_low, x_up, y_up);
9510  } // end of if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
9511 
9512  //............................................ Style (HistoPlot)
9513  SetViewHistoColors(h_his0, HistoCode.Data(), opt_plot, arg_AlreadyRead);
9514 
9515  //................................. Set axis titles
9516  TString axis_x_var_name = SetHistoXAxisTitle(HistoCode);
9517  TString axis_y_var_name = SetHistoYAxisTitle(HistoCode);
9518  h_his0->GetXaxis()->SetTitle(axis_x_var_name);
9519  h_his0->GetYaxis()->SetTitle(axis_y_var_name);
9520 
9521  Int_t lin_scale = 0;
9522  Int_t log_scale = 1;
9523 
9524  if(opt_scale_x == fOptScaleLinx){gPad->SetLogx(lin_scale);}
9525  if(opt_scale_x == fOptScaleLogx){gPad->SetLogx(log_scale);}
9526  if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(lin_scale);}
9527  if(opt_scale_y == fOptScaleLogy){gPad->SetLogy(log_scale);}
9528 
9529  //---------------------------------------------------------------- Draw histo (HistoPlot)
9530  if(opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0 ){h_his0->DrawCopy();}
9531  if(opt_plot == fOnlyOnePlot && arg_AlreadyRead == 1 ){h_his0->DrawCopy();}
9532  if(opt_plot == fOnlyOnePlot && arg_AlreadyRead > 1 ){h_his0->DrawCopy("AHSAME");}
9533 
9534  if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
9535  {
9536  if(xMemoPlotSame == 0){h_his0->DrawCopy();}
9537  if(xMemoPlotSame != 0){h_his0->DrawCopy("SAME");}
9538  }
9539  //----------------------------------------------------------------
9540 
9541  //.................... Horizontal line at y=0 (HistoPlot)
9542  if( !( HistoCode == "D_Adc_EvDs" || HistoCode == "D_Adc_EvNb" ||
9543  HistoType == "Proj" || HistoType == "SampProj" ||
9544  HistoType == "EvolProj" || HistoType == "H1BasicProj" ) &&
9545  !( HistoType == "H1Basic" && arg_AlreadyRead == 0 ) )
9546  {
9547  Double_t yinf = h_his0->GetMinimum();
9548  Double_t ysup = h_his0->GetMaximum();
9549  if( yinf <= (Double_t)0. && ysup >= (Double_t)0. )
9550  {TLine* lin = new TLine(0.,0.,(Double_t)HisSize, 0.); fCnewRoot++;
9551  lin->Draw();}
9552  }
9553 
9554  if( ( opt_plot == fOnlyOnePlot )
9555  || ( (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) && xMemoPlotSame == 0 ) )
9556  {
9557  Double_t yinf = (Double_t)h_his0->GetMinimum();
9558  Double_t ysup = (Double_t)h_his0->GetMaximum();
9559 
9560  if(xFlagAutoYsupMargin == 1)
9561  {
9562  if( yinf >= ysup ){yinf = (Double_t)0.; ysup += ysup;} // ROOT default if ymin >= ymax
9563  Double_t MaxMarginFactor = (Double_t)0.05; // frame top line = 5% above the maximum
9564  ysup += (ysup-yinf)*MaxMarginFactor; // ROOT default if ymin < ymax
9565  }
9566 
9567  char* f_in = new char[fgMaxCar]; fCnew++;
9568 
9569  //.................... Vertical lines for Data sectors (EE Global plot only)
9570  if( fFlagSubDet == "EE" && fFapStexNumber == 0 )
9571  {
9572  //............................................................. Data Sectors (HistoPlot)
9573  Color_t coul_DS = fCnaParHistos->ColorDefinition("noir");
9574  Int_t DeeOffset = 0;
9575  for(Int_t n1Dee=1; n1Dee<=4; n1Dee++)
9576  {
9577  if( n1Dee == 4 ){DeeOffset = 0;}
9578  if( n1Dee == 3 ){DeeOffset = fEcal->MaxSCForConsInDee();} // 149
9579  if( n1Dee == 2 ){DeeOffset = 2*fEcal->MaxSCForConsInDee();} // 446
9580  if( n1Dee == 1 ){DeeOffset = 3*fEcal->MaxSCForConsInDee();} // 595
9581 
9582  Double_t ydee = ysup + (ysup-yinf)/(Double_t)15.;
9583  Double_t xBinDee = DeeOffset + fEcal->MaxSCForConsInDee()/(Double_t)2.;
9584  sprintf( f_in, "D%d", n1Dee );
9585  TText *text_Dee = new TText(xBinDee, ydee, f_in); fCnewRoot++;
9586  text_Dee->SetTextColor(coul_DS);
9587  text_Dee->SetTextSize((Double_t)0.04);
9588  text_Dee->Draw("SAME");
9589 
9590  Double_t DSLabelOffset = (Double_t)12;
9591 
9592  for(Int_t i=1; i<5; i++)
9593  {
9594  Int_t iDS = 0;
9595  if( n1Dee == 1 ){iDS = i;}
9596  if( n1Dee == 2 ){iDS = i+4;}
9597  if( n1Dee == 3 ){iDS = i+5;}
9598  if( n1Dee == 4 ){iDS = i+1;}
9599 
9600  Double_t xBinDS = DeeOffset + (Double_t)GetDSOffset(n1Dee, iDS)/fEcal->MaxCrysInSC();
9601  TLine* lin_DS = new TLine(xBinDS, yinf, xBinDS, ysup); fCnewRoot++;
9602  lin_DS->SetLineColor(coul_DS);
9603  lin_DS->SetLineWidth(1);
9604  lin_DS->SetLineStyle(2);
9605  lin_DS->Draw();
9606 
9607  if( n1Dee == 2 && i == 4 )
9608  {
9609  TLine* lin_DSp = new TLine(DeeOffset, yinf, DeeOffset, ysup); fCnewRoot++;
9610  lin_DSp->SetLineColor(coul_DS);
9611  lin_DSp->SetLineWidth(1);
9612  lin_DSp->SetLineStyle(2);
9613  lin_DSp->Draw();
9614  }
9615 
9616  Double_t yds = ysup + (ysup-yinf)/(Double_t)50.;
9617  Double_t xBinDSp = xBinDS + DSLabelOffset;
9618  Int_t nDS = iDS;
9619 
9620  sprintf( f_in, "S%d", nDS );
9621  TText *text_DS = new TText(xBinDSp, yds, f_in); fCnewRoot++;
9622  text_DS->SetTextColor(coul_DS);
9623  text_DS->SetTextSize((Double_t)0.03);
9624  text_DS->Draw("SAME");
9625  if( (n1Dee == 4 && i == 1) || (n1Dee == 2 && i == 4) )
9626  {
9627  if(n1Dee == 4){nDS = iDS-1;}
9628  if(n1Dee == 2){nDS = iDS+1;}
9629  sprintf( f_in, "S%d", nDS );
9630  TText *text_DS = new TText(xBinDS-1.75*DSLabelOffset, yds, f_in); fCnewRoot++;
9631  text_DS->SetTextColor(coul_DS);
9632  text_DS->SetTextSize((Double_t)0.03);
9633  text_DS->Draw("SAME");
9634  }
9635  }
9636  }
9637  }
9638 
9639  //........... Vertical lines for Data sectors and special SC's (EE only, Dee's Global plots) (HistoPlot)
9640  if( fFlagSubDet == "EE" && fFapStexNumber > 0 )
9641  {
9642  if( HistoType == "Global" )
9643  {
9644  Double_t ytext = yinf - (ysup-yinf)/8.5;
9645  //............................................................. Data Sectors
9646  Color_t coul_DS = fCnaParHistos->ColorDefinition("noir");
9647  for(Int_t i=1; i<5; i++)
9648  {
9649  Int_t iDS = 0;
9650  if( fFapStexNumber == 1 ){iDS = i;}
9651  if( fFapStexNumber == 2 ){iDS = i+4;}
9652  if( fFapStexNumber == 3 ){iDS = i+5;}
9653  if( fFapStexNumber == 4 ){iDS = i+1;}
9654 
9655  Double_t xBinDS = (Double_t)GetDSOffset(fFapStexNumber, iDS);
9656  TLine* lin_DS = new TLine(xBinDS, yinf, xBinDS, ysup); fCnewRoot++;
9657  lin_DS->SetLineColor(coul_DS);
9658  lin_DS->SetLineWidth(2);
9659  lin_DS->SetLineStyle(2);
9660  lin_DS->Draw();
9661  Double_t ytextds = ysup + (ysup-yinf)/30.;
9662  Double_t xBinDSNumber =
9663  xBinDS + fEcalNumbering->GetMaxSCInDS(iDS)*fEcal->MaxCrysInSC()/(Double_t)2.25;
9664  sprintf( f_in, "S%d", iDS );
9665  TText *text_DS = new TText(xBinDSNumber, ytextds, f_in); fCnewRoot++;
9666  text_DS->SetTextColor(coul_DS);
9667  text_DS->SetTextSize((Double_t)0.04);
9668  text_DS->Draw("SAME");
9669  if( ( (fFapStexNumber == 1 || fFapStexNumber == 2 ) && i == 4 ) ||
9670  ( (fFapStexNumber == 3 || fFapStexNumber == 4 ) && i == 1 ) )
9671  {
9672  Int_t iDSp = iDS;
9673  if( i == 4 ){iDSp = iDS+1;}
9674  if( i == 1 ){iDSp = iDS-1;}
9675  sprintf( f_in, "S%d", iDSp);
9676  Double_t xBinpDSNumber =
9677  xBinDSNumber - fEcalNumbering->GetMaxSCInDS(iDS)*fEcal->MaxCrysInSC();
9678  TText *text_DSp = new TText(xBinpDSNumber, ytextds, f_in); fCnewRoot++;
9679  text_DSp->SetTextColor(coul_DS);
9680  text_DSp->SetTextSize((Double_t)0.04);
9681  text_DSp->Draw("SAME");
9682  }
9683  }
9684  //.............................................................. Vertical lines for SC's
9685  // Trop serre. A garder en reserve.
9686  //for(Int_t i=0; i<fEcal->MaxSCForConsInDee(); i++)
9687  // {
9688  // Double_t xBinSC =(Double_t)(fEcal->MaxCrysInSC()*i);
9689  // TLine* lin_SC = new TLine(xBinSC, yinf, xBinSC, ysup); fCnewRoot++;
9690  // lin_SC->SetLineColor(coul_DS);
9691  // lin_SC->SetLineStyle(3);
9692  // lin_SC->Draw();
9693  // }
9694  //............................................................... Not connected SC's
9695  Color_t coul_notconnected = fCnaParHistos->ColorDefinition("bleu_fonce");
9696  for(Int_t i=1; i<=fEcal->NumberOfNotConnectedSCs(); i++)
9697  {
9698  Int_t index = 0;
9699  if( fFapStexNumber == 1 || fFapStexNumber == 3 ){index = 2*i - 1;}
9700  if( fFapStexNumber == 2 || fFapStexNumber == 4 ){index = 2*i;}
9701  //................. display of the not connected SC's numbers (+ vertical line)
9702  Double_t xBinNotConnectedSC = NotConnectedSCH1DBin(index);
9703  TLine* lin_notconnected =
9704  new TLine(xBinNotConnectedSC, yinf, xBinNotConnectedSC, ysup); fCnewRoot++;
9705  lin_notconnected->SetLineColor(coul_notconnected);
9706  lin_notconnected->SetLineStyle(3);
9707  lin_notconnected->Draw();
9708 
9709  Double_t xBinNotConnectedSCEnd = NotConnectedSCH1DBin(index)+fEcal->MaxCrysInSC();
9710  TLine* lin_notconnected_end =
9711  new TLine(xBinNotConnectedSCEnd, yinf, xBinNotConnectedSCEnd, ysup); fCnewRoot++;
9712  lin_notconnected_end->SetLineColor(coul_notconnected);
9713  lin_notconnected_end->SetLineStyle(3);
9714  lin_notconnected_end->Draw();
9715 
9716  //sprintf( f_in, "%d", GetNotConnectedSCForConsFromIndex(index) );
9717  sprintf( f_in, "%d", GetNotConnectedDSSCFromIndex(index) );
9718  TText *text_SC_NotConnected = new TText(xBinNotConnectedSC, ytext, f_in); fCnewRoot++;
9719  text_SC_NotConnected->SetTextAngle((Double_t)45.);
9720  text_SC_NotConnected->SetTextColor(coul_notconnected);
9721  text_SC_NotConnected->SetTextFont(42);
9722  text_SC_NotConnected->SetTextSize((Double_t)0.03);
9723  text_SC_NotConnected->Draw("SAME");
9724  }
9725  //Double_t xtext = xinf_his - (xsup_his-xinf_his)/8.;
9726  //Double_t ytextp = yinf - (ysup-yinf)/6.;
9727  //sprintf( f_in, "Special SC => ");
9728  //TText *text_legend_NotConnected = new TText(xtext, ytext, f_in); fCnewRoot++;
9729  //text_legend_NotConnected->SetTextColor(coul_notconnected);
9730  //text_legend_NotConnected->SetTextSize((Double_t)0.03);
9731  //text_legend_NotConnected->Draw("SAME");
9732 
9733  //............................................................... Not complete SC's
9734  Color_t coul_notcomplete = fCnaParHistos->ColorDefinition("rouge40");
9735  for(Int_t i=1; i<=fEcal->NumberOfNotCompleteSCs(); i++)
9736  {
9737  Int_t index = 0;
9738  if( fFapStexNumber == 1 || fFapStexNumber == 3 ){index = 2*i - 1;}
9739  if( fFapStexNumber == 2 || fFapStexNumber == 4 ){index = 2*i;}
9740  //................. display of the not complete SC's numbers (+ vertical line)
9741  Double_t xBinNotCompleteSC = NotCompleteSCH1DBin(index);
9742  TLine* lin_notcomplete =
9743  new TLine(xBinNotCompleteSC, yinf, xBinNotCompleteSC, ysup); fCnewRoot++;
9744  lin_notcomplete->SetLineColor(coul_notcomplete);
9745  lin_notcomplete->SetLineStyle(3);
9746  lin_notcomplete->Draw();
9747 
9748  Double_t xBinNotCompleteSCEnd = NotCompleteSCH1DBin(index)+fEcal->MaxCrysInSC();;
9749  TLine* lin_notcomplete_end =
9750  new TLine(xBinNotCompleteSCEnd, yinf, xBinNotCompleteSCEnd, ysup); fCnewRoot++;
9751  lin_notcomplete_end->SetLineColor(coul_notcomplete);
9752  lin_notcomplete_end->SetLineStyle(3);
9753  lin_notcomplete_end->Draw();
9754 
9755  sprintf( f_in, "%d", GetNotCompleteDSSCFromIndex(index) );
9756  // sprintf( f_in, "%d", GetNotCompleteSCForConsFromIndex(index) );
9757  TText *text_SC_NotComplete = new TText(xBinNotCompleteSC, ytext, f_in); fCnewRoot++;
9758  text_SC_NotComplete->SetTextAngle((Double_t)45.);
9759  text_SC_NotComplete->SetTextColor(coul_notcomplete);
9760  text_SC_NotComplete->SetTextFont(42);
9761  text_SC_NotComplete->SetTextSize((Double_t)0.03);
9762  text_SC_NotComplete->Draw("SAME");
9763  }
9764  //Double_t xtextp = xinf_his + (xsup_his-xinf_his)/15.;
9765  //sprintf( f_in, "Not complete SC");
9766  //TText *text_legend_NotComplete = new TText(xtextp, ytextp, f_in); fCnewRoot++;
9767  //text_legend_NotComplete->SetTextColor(coul_notcomplete);
9768  //text_legend_NotComplete->SetTextSize((Double_t)0.03);
9769  //text_legend_NotComplete->Draw("SAME");
9770  }
9771  }
9772  delete [] f_in; f_in = 0; fCdelete++;
9773  } // end of if( ( opt_plot == fOnlyOnePlot )
9774  // || ( (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) && xMemoPlotSame == 0 ) )
9775 
9776  //..............................................Top Axis (HistoPlot)
9777  Int_t min_value = 0;
9778  Int_t max_value = 0;
9779  if(HistoType == "Global")
9780  {
9781  if( fFapStexNumber > 0 )
9782  {
9783  //.......................... Axis for the Stin numbers and Data sectors (EE) numbers
9784  if( fFlagSubDet == "EB" )
9785  {
9786  min_value = 0;
9787  max_value = fEcal->MaxStinEcnaInStex() - 1;
9788  }
9789  if( fFlagSubDet == "EE" )
9790  {
9791  if( fFapStexNumber == 1 ){min_value = 1; max_value = 5;}
9792  if( fFapStexNumber == 2 ){min_value = 5; max_value = 9;}
9793  if( fFapStexNumber == 3 ){min_value = 5; max_value = 9;}
9794  if( fFapStexNumber == 4 ){min_value = 1; max_value = 5;}
9795  }
9796  }
9797  if( fFapStexNumber == 0 )
9798  {
9799  //.......................... Axis for the SM (EB) and Dee numbers (EE)
9800  if( fFlagSubDet == "EB" )
9801  {
9802  min_value = 0;
9803  max_value = fEcal->MaxStexInStas() - 1;
9804  }
9805  if( fFlagSubDet == "EE" )
9806  {
9807  min_value = 1;
9808  max_value = fEcal->MaxStexInStas();
9809  }
9810  }
9811  TopAxisForHistos(h_his0, opt_plot, xMemoPlotSame, min_value, max_value,
9812  xFlagAutoYsupMargin, HisSize);
9813  } // end of if (HistoType == "Global")
9814 
9815  if( !( (HistoType == "H1Basic" || HistoType == "H1BasicProj")
9816  && ( arg_AlreadyRead > 1 && arg_AlreadyRead < fEcal->MaxCrysInStin() ) ) )
9817  {
9818  gPad->Update();
9819  }
9820  }
9821  else // else du if(main_subpad !=0)
9822  {
9823  cout << "*TEcnaHistos::HistoPlot(...)> Canvas not found. Previously closed in option SAME."
9824  << fTTBELL << endl;
9825 
9826  ReInitCanvas(HistoCode, opt_plot);
9827  xMemoPlotSame = 0;
9828  }
9829 
9830  // delete MainCanvas; fCdeleteRoot++;
9831 
9832 } // end of HistoPlot
9833 
9834 
9835 TString TEcnaHistos::StexNumberToString(const Int_t& StexNumber)
9836 {
9837  // Convert Int_t StexNumber into TString: "StexNumber" if StexNumber in [-18,36]
9838  // or into TString: "EB" or "EE" if StexNumber = 0.
9839 
9840  TString sFapStexNumber = "?";
9841  if( StexNumber == -1 ){sFapStexNumber = " -1";}
9842  if( StexNumber == -2 ){sFapStexNumber = " -2";}
9843  if( StexNumber == -3 ){sFapStexNumber = " -3";}
9844  if( StexNumber == -4 ){sFapStexNumber = " -4";}
9845  if( StexNumber == -5 ){sFapStexNumber = " -5";}
9846  if( StexNumber == -6 ){sFapStexNumber = " -6";}
9847  if( StexNumber == -7 ){sFapStexNumber = " -7";}
9848  if( StexNumber == -8 ){sFapStexNumber = " -8";}
9849  if( StexNumber == -9 ){sFapStexNumber = " -9";}
9850  if( StexNumber == -10 ){sFapStexNumber = "-10";}
9851  if( StexNumber == -11 ){sFapStexNumber = "-11";}
9852  if( StexNumber == -12 ){sFapStexNumber = "-12";}
9853  if( StexNumber == -13 ){sFapStexNumber = "-13";}
9854  if( StexNumber == -14 ){sFapStexNumber = "-14";}
9855  if( StexNumber == -15 ){sFapStexNumber = "-15";}
9856  if( StexNumber == -16 ){sFapStexNumber = "-16";}
9857  if( StexNumber == -17 ){sFapStexNumber = "-17";}
9858  if( StexNumber == -18 ){sFapStexNumber = "-18";}
9859  if( StexNumber == 0 ){sFapStexNumber = fFlagSubDet;}
9860  if( StexNumber == 1 ){sFapStexNumber = " 1";}
9861  if( StexNumber == 2 ){sFapStexNumber = " 2";}
9862  if( StexNumber == 3 ){sFapStexNumber = " 3";}
9863  if( StexNumber == 4 ){sFapStexNumber = " 4";}
9864  if( StexNumber == 5 ){sFapStexNumber = " 5";}
9865  if( StexNumber == 6 ){sFapStexNumber = " 6";}
9866  if( StexNumber == 7 ){sFapStexNumber = " 7";}
9867  if( StexNumber == 8 ){sFapStexNumber = " 8";}
9868  if( StexNumber == 9 ){sFapStexNumber = " 9";}
9869  if( StexNumber == 10 ){sFapStexNumber = " 10";}
9870  if( StexNumber == 11 ){sFapStexNumber = " 11";}
9871  if( StexNumber == 12 ){sFapStexNumber = " 12";}
9872  if( StexNumber == 13 ){sFapStexNumber = " 13";}
9873  if( StexNumber == 14 ){sFapStexNumber = " 14";}
9874  if( StexNumber == 15 ){sFapStexNumber = " 15";}
9875  if( StexNumber == 16 ){sFapStexNumber = " 16";}
9876  if( StexNumber == 17 ){sFapStexNumber = " 17";}
9877  if( StexNumber == 18 ){sFapStexNumber = " 18";}
9878  if( StexNumber == 19 ){sFapStexNumber = " -1";}
9879  if( StexNumber == 20 ){sFapStexNumber = " -2";}
9880  if( StexNumber == 21 ){sFapStexNumber = " -3";}
9881  if( StexNumber == 22 ){sFapStexNumber = " -4";}
9882  if( StexNumber == 23 ){sFapStexNumber = " -5";}
9883  if( StexNumber == 24 ){sFapStexNumber = " -6";}
9884  if( StexNumber == 25 ){sFapStexNumber = " -7";}
9885  if( StexNumber == 26 ){sFapStexNumber = " -8";}
9886  if( StexNumber == 27 ){sFapStexNumber = " -9";}
9887  if( StexNumber == 28 ){sFapStexNumber = "-10";}
9888  if( StexNumber == 29 ){sFapStexNumber = "-11";}
9889  if( StexNumber == 30 ){sFapStexNumber = "-12";}
9890  if( StexNumber == 31 ){sFapStexNumber = "-13";}
9891  if( StexNumber == 32 ){sFapStexNumber = "-14";}
9892  if( StexNumber == 33 ){sFapStexNumber = "-15";}
9893  if( StexNumber == 34 ){sFapStexNumber = "-16";}
9894  if( StexNumber == 35 ){sFapStexNumber = "-17";}
9895  if( StexNumber == 36 ){sFapStexNumber = "-18";}
9896  return sFapStexNumber;
9897 }
9898 
9900 {
9901  // gives the x coordinate for the i_th NotConnected SC
9902  // GetDSOffset(DeeNumber, DataSector) , GetSCOffset(DeeNumber, DataSector, SC_in_DS)
9903 
9904  Double_t xbin = (Double_t)(-1);
9905 
9906  if( index == 1 ){xbin = GetDSOffset(1,1)+GetSCOffset(1,1, 30);} // nb_for_cons == 182 (D1,S1) (D3,S9)
9907  if( index == 2 ){xbin = GetDSOffset(2,9)+GetSCOffset(2,9, 30);} // nb_for_cons == 33 (D2,S9) (D4,S1)
9908 
9909  if( index == 3 ){xbin = GetDSOffset(1,2)+GetSCOffset(1,2, 3);} // nb_for_cons == 178 (D1,S2) (D3,S8)
9910  if( index == 4 ){xbin = GetDSOffset(2,8)+GetSCOffset(2,8, 3);} // nb_for_cons == 29 (D2,S8) (D4,S2)
9911 
9912  if( index == 5 ){xbin = GetDSOffset(1,2)+GetSCOffset(1,2, 25);} // nb_for_cons == 207 (D1,S2) (D3,S8)
9913  if( index == 6 ){xbin = GetDSOffset(2,8)+GetSCOffset(2,8, 25);} // nb_for_cons == 58 (D2,S8) (D4,S2)
9914 
9915  if( index == 7 ){xbin = GetDSOffset(1,3)+GetSCOffset(1,3, 34);} // nb_for_cons == 298 (D1,S3) (D3,S7)
9916  if( index == 8 ){xbin = GetDSOffset(2,7)+GetSCOffset(2,7, 34);} // nb_for_cons == 149 (D2,S7) (D4,S3)
9917 
9918  if( index == 9 ){xbin = GetDSOffset(1,4)+GetSCOffset(1,4, 14);} // nb_for_cons == 261 (D1,S4) (D3,S6)
9919  if( index == 10 ){xbin = GetDSOffset(2,6)+GetSCOffset(2,6, 14);} // nb_for_cons == 112 (D2,S6) (D4,S4)
9920  if( index == 11 ){xbin = GetDSOffset(1,4)+GetSCOffset(1,4, 21);} // nb_for_cons == 268 (D1,S4) (D3,S6)
9921  if( index == 12 ){xbin = GetDSOffset(2,6)+GetSCOffset(2,6, 21);} // nb_for_cons == 119 (D2,S6) (D4,S4)
9922 
9923  if( index == 13 ){xbin = GetDSOffset(1,5)+GetSCOffset(1,5, 20);} // nb_for_cons == 281 (D1,S5) (D3,S5)
9924  if( index == 14 ){xbin = GetDSOffset(2,5)+GetSCOffset(2,5, 3);} // nb_for_cons == 132 (D2,S5) (D4,S5)
9925 
9926  return xbin;
9927 }
9928 
9930 {
9931  // gives the x coordinate for the i_th NotConnected SC
9932 
9933  Double_t xbin = (Double_t)(-1);
9934 
9935  if( index == 1 ){xbin = GetDSOffset(1,1)+GetSCOffset(1,1, 12);} // nb_for_cons == 161 (D1,S1) (D3,S9)
9936  if( index == 2 ){xbin = GetDSOffset(2,9)+GetSCOffset(2,9, 12);} // nb_for_cons == 12 (D2,S9) (D4,S1)
9937 
9938  if( index == 3 ){xbin = GetDSOffset(1,2)+GetSCOffset(1,2, 32);} // nb_for_cons == 216 (D1,S2) (D3,S8)
9939  if( index == 4 ){xbin = GetDSOffset(2,8)+GetSCOffset(2,8, 32);} // nb_for_cons == 67 (D2,S8) (D4,S2)
9940 
9941  if( index == 5 ){xbin = GetDSOffset(1,3)+GetSCOffset(1,3, 10);} // nb_for_cons == 224 (D1,S3) (D3,S7)
9942  if( index == 6 ){xbin = GetDSOffset(2,7)+GetSCOffset(2,7, 10);} // nb_for_cons == 75 (D2,S7) (D4,S3)
9943 
9944  if( index == 7 ){xbin = GetDSOffset(1,5)+GetSCOffset(1,5, 23);} // nb_for_cons == 286 (D1,S5) (D3,S5)
9945  if( index == 8 ){xbin = GetDSOffset(2,5)+GetSCOffset(2,5, 6);} // nb_for_cons == 137 (D2,S5) (D4,S5)
9946 
9947  return xbin;
9948 }
9949 
9951 {
9952 
9953  Int_t SCForCons = 0;
9954  if( index == 1 ){SCForCons = 182;} // (D1,S1) (D3,S9)
9955  if( index == 2 ){SCForCons = 33;} // (D2,S9) (D4,S1)
9956 
9957  if( index == 3 ){SCForCons = 178;} // (D1,S2) (D3,S8)
9958  if( index == 4 ){SCForCons = 29;} // (D2,S8) (D4,S2)
9959  if( index == 5 ){SCForCons = 207;} // (D1,S2) (D3,S8)
9960  if( index == 6 ){SCForCons = 58;} // (D2,S8) (D4,S2)
9961 
9962  if( index == 7 ){SCForCons = 298;} // (D1,S3) (D3,S7)
9963  if( index == 8 ){SCForCons = 149;} // (D2,S7) (D4,S3)
9964 
9965  if( index == 9 ){SCForCons = 261;} // (D1,S4) (D3,S6)
9966  if( index == 10 ){SCForCons = 112;} // (D2,S6) (D4,S4)
9967  if( index == 11 ){SCForCons = 268;} // (D1,S4) (D3,S6)
9968  if( index == 12 ){SCForCons = 119;} // (D2,S6) (D4,S4)
9969 
9970  if( index == 13 ){SCForCons = 281;} // (D1,S5) (D3,S5)
9971  if( index == 14 ){SCForCons = 132;} // (D2,S5) (D4,S5)
9972  return SCForCons;
9973 }
9974 
9976 {
9977 
9978  Int_t DSSC = 0;
9979  if( index == 1 ){DSSC = 30;} // (D1,S1) (D3,S9)
9980  if( index == 2 ){DSSC = 30;} // (D2,S9) (D4,S1)
9981 
9982  if( index == 3 ){DSSC = 3;} // (D1,S2) (D3,S8)
9983  if( index == 4 ){DSSC = 3;} // (D2,S8) (D4,S2)
9984  if( index == 5 ){DSSC = 25;} // (D1,S2) (D3,S8)
9985  if( index == 6 ){DSSC = 25;} // (D2,S8) (D4,S2)
9986 
9987  if( index == 7 ){DSSC = 34;} // (D1,S3) (D3,S7)
9988  if( index == 8 ){DSSC = 34;} // (D2,S7) (D4,S3)
9989 
9990  if( index == 9 ){DSSC = 14;} // (D1,S4) (D3,S6)
9991  if( index == 10 ){DSSC = 14;} // (D2,S6) (D4,S4)
9992  if( index == 11 ){DSSC = 21;} // (D1,S4) (D3,S6)
9993  if( index == 12 ){DSSC = 21;} // (D2,S6) (D4,S4)
9994 
9995  if( index == 13 ){DSSC = 20;} // (D1,S5) (D3,S5)
9996  if( index == 14 ){DSSC = 3;} // (D2,S5) (D4,S5)
9997  return DSSC;
9998 }
9999 
10000 
10002 {
10003 
10004  Int_t DSSC = 0;
10005  if( index == 1 ){DSSC = 161;} // (D1,S1) (D3,S9)
10006  if( index == 2 ){DSSC = 12;} // (D2,S9) (D4,S1)
10007 
10008  if( index == 3 ){DSSC = 216;} // (D1,S2) (D3,S8)
10009  if( index == 4 ){DSSC = 67;} // (D2,S8) (D4,S2)
10010 
10011  if( index == 5 ){DSSC = 224;} // (D1,S3) (D3,S7)
10012  if( index == 6 ){DSSC = 75;} // (D2,S7) (D4,S3)
10013 
10014  if( index == 7 ){DSSC = 286;} // (D1,S5) (D3,S5)
10015  if( index == 8 ){DSSC = 137;} // (D2,S5) (D4,S5)
10016  return DSSC;
10017 }
10018 
10020 {
10021 
10022  Int_t DSSC = 0;
10023  if( index == 1 ){DSSC = 12;} // (D1,S1) (D3,S9)
10024  if( index == 2 ){DSSC = 12;} // (D2,S9) (D4,S1)
10025 
10026  if( index == 3 ){DSSC = 32;} // (D1,S2) (D3,S8)
10027  if( index == 4 ){DSSC = 32;} // (D2,S8) (D4,S2)
10028 
10029  if( index == 5 ){DSSC = 10;} // (D1,S3) (D3,S7)
10030  if( index == 6 ){DSSC = 10;} // (D2,S7) (D4,S3)
10031 
10032  if( index == 7 ){DSSC = 23;} // (D1,S5) (D3,S5)
10033  if( index == 8 ){DSSC = 6;} // (D2,S5) (D4,S5)
10034  return DSSC;
10035 }
10036 //----------------------------------------------- HistimePlot
10037 void TEcnaHistos::HistimePlot(TGraph* g_graph0,
10038  Axis_t xinf, Axis_t xsup,
10039  const TString& HistoCode, const TString& HistoType,
10040  const Int_t& StexStin_A, const Int_t& i0StinEcha, const Int_t& i0Sample,
10041  const Int_t& opt_scale_x, const Int_t& opt_scale_y,
10042  const TString& opt_plot, const Int_t& xFlagAutoYsupMargin)
10043 {
10044  // Plot 1D histogram for evolution in time
10045 
10046  UInt_t canv_w = fCnaParHistos->SetCanvasWidth(HistoCode, opt_plot);
10047  UInt_t canv_h = fCnaParHistos->SetCanvasHeight(HistoCode, opt_plot);
10048 
10049  SetGraphPresentation(g_graph0, HistoType.Data(), opt_plot.Data()); // (gStyle parameters)}
10050 
10051  //...................................................... paves commentaires (HistimePlot)
10052  SetAllPavesViewHisto(HistoCode, StexStin_A, i0StinEcha, i0Sample, opt_plot);
10053 
10054  //..................................................... Canvas name (HistimePlot)
10055  Int_t arg_AlreadyRead = 0;
10056  TString canvas_name = SetCanvasName(HistoCode.Data(), opt_scale_x, opt_scale_y, opt_plot, arg_AlreadyRead,
10057  StexStin_A, i0StinEcha, i0Sample);
10058 
10059  //------------------------------------------------ Canvas allocation (HistimePlot)
10060  //......................................... declarations canvas et pad
10061  TCanvas* MainCanvas = 0;
10062 
10063  if( opt_plot == fOnlyOnePlot )
10064  {MainCanvas = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w , canv_h); fCnewRoot++;
10065  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();}
10066 
10067  if( opt_plot == fSeveralPlot )
10068  {
10069  if(GetMemoFlag(HistoCode, opt_plot) == "Free")
10070  {
10071  MainCanvas = CreateCanvas(HistoCode, opt_plot, canvas_name, canv_w, canv_h);
10072  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();
10073  }
10074  }
10075 
10076  if( opt_plot == fSameOnePlot )
10077  {
10078  if(GetMemoFlag(HistoCode, opt_plot) == "Free")
10079  {
10080  MainCanvas = CreateCanvas(HistoCode, opt_plot, canvas_name, canv_w, canv_h);
10081  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();
10082  }
10083  }
10084 
10085  // cout << "*TEcnaHistos::HistimePlot(...)> Plot is displayed on canvas ----> " << canvas_name.Data() << endl;
10086 
10087  //--------------- EE => SC for construction, EB => Xtal in SM (default: Stin ECNA number, i0StinEcha)
10088  Int_t Stex_StinCons = StexStin_A; // Stex_StinCons = Tower for EB, SC for construction for EE
10089  Int_t n1StexCrys = i0StinEcha+1; // n1StexCrys = Crys in SM for EB
10090 
10091  if( StexStin_A >= 1 && StexStin_A <= fEcal->MaxStinEcnaInStex() )
10092  {
10093  if( fFlagSubDet == "EB" )
10094  {n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);}
10095  if( fFlagSubDet == "EE" )
10096  {Stex_StinCons = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A);}
10097  }
10098 
10099  //------ String for StexNumber ( to display "EB" or "EE" if Stex = 0 )
10100  TString sFapStexNumber = StexNumberToString(fFapStexNumber);
10101 
10102  //============================================================================= (HistimePlot)
10103  //
10104  // 1st OPERATIONS: Pave texts preparation and first Draw.
10105  // SetParametersCanvas
10106  // Set Memo Flags.
10107  // Set main_subpad and main_pavtxt
10108  //
10109  //=============================================================================
10110  TVirtualPad* main_subpad = 0; // main_subpad: Pad for the histo
10111  TPaveText* main_pavtxt = 0; // main_pavtxt: pave for changing parameters
10112 
10113  Int_t xMemoPlotSame = 1; // a priori ==> SAME plot
10114 
10115  TString QuantityName = fCnaParHistos->GetQuantityName(HistoCode.Data());
10116 
10117  //========================================= Option ONLYONE (HistimePlot)
10118  if( opt_plot == fOnlyOnePlot )
10119  {
10120  //................................. Draw titles and paves (pad = main canvas)
10121  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
10122  fPavComStex->Draw();
10123 
10124  if( !( HistoType == "Global" || HistoType == "Proj" ) )
10125  {
10126  fPavComStin->Draw();
10127  fPavComXtal->Draw();
10128  }
10129  fPavComEvolNbOfEvtsAna->Draw();
10130  fPavComEvolRuns->Draw();
10131 
10132  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
10133  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
10134  Double_t y_low = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
10135  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_EB") - 0.005;
10136 
10137  Double_t x_margin = x_low;
10138  Double_t y_margin = y_low;
10139 
10140  Color_t fond_pad = fCnaParHistos->ColorDefinition("gris18");
10141 
10142  MainCanvas->Divide( 1, 1, x_margin, y_margin, fond_pad);
10143  // Divide(nx, ny, x_margin, y_margin, color);
10144 
10145  gPad->cd(1);
10146  main_subpad = gPad;
10147  main_subpad->SetPad(x_low, y_low, x_up, y_up);
10148 
10149  xMemoPlotSame = 0;
10150  }
10151  //========================================= Options SAME and SAME n (HistimePlot)
10152  if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
10153  {
10154  if(GetMemoFlag(HistoCode, opt_plot) == "Free")
10155  {
10156  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
10157  fPavComSeveralChanging->Draw();
10158 
10159  fPavComEvolRuns->Draw();
10160 
10161  if( !( HistoType == "Global" || HistoType == "Proj" ||
10162  HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10163  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date") )
10164  {
10165  fPavComStin->Draw();
10166  fPavComXtal->Draw();
10167  }
10168 
10169  if( !( HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10170  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ) )
10171  {
10172  fPavComXtal->Draw();
10173  }
10174  //Call to SetParametersPavTxt
10175  //fPavTxt<HISTOCODE> = fPavComSeveralChanging; => come from SetAllPavesViewHisto
10176  SetParametersPavTxt(HistoCode, opt_plot);
10177 
10178  //---------------- Call to ActivePavTxt
10179  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
10180  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
10181 
10182  //-------------------- Set texts for pave "several changing", options SAME and SAME n (HistimePlot)
10183  main_pavtxt->SetTextAlign(fTextPaveAlign);
10184  main_pavtxt->SetTextFont(fTextPaveFont);
10185  main_pavtxt->SetTextSize(fTextPaveSize);
10186  main_pavtxt->SetBorderSize(fTextBorderSize);
10187 
10188  char* f_in = new char[fgMaxCar]; fCnew++;
10189 
10190  TString DecalStexName = "";
10191  if( fFlagSubDet == "EB" ){DecalStexName = " ";}
10192  TString DecalStinName = "";
10193  if( fFlagSubDet == "EE" ){DecalStinName = " ";}
10194 
10195  TString sStexOrStasName = "";
10196  if( fFapStexNumber == 0 ){sStexOrStasName = " ";}
10197  if( fFapStexNumber != 0 ){sStexOrStasName = fFapStexName;}
10198 
10199 
10200  //-----------------------------> HistoType = "EvolProj" => treated in HistoPlot, not here.
10201  if(opt_plot == fSeveralPlot)
10202  {
10203  sprintf(f_in, "Analysis Samp Evts range Nb Evts %s%s %s%s %s %s",
10204  DecalStexName.Data(), sStexOrStasName.Data(),
10205  DecalStinName.Data(), fFapStinName.Data(), fFapXtalName.Data(), fFapEchaName.Data());
10206  }
10207  if(opt_plot == fSameOnePlot)
10208  {
10209  sprintf(f_in, "Analysis Samp Evts range Nb Evts %s%s %s%s %s %s",
10210  DecalStexName.Data(), sStexOrStasName.Data(),
10211  DecalStinName.Data(), fFapStinName.Data(), fFapXtalName.Data(), fFapEchaName.Data());
10212  }
10213 
10214  //................................................................... (HistimePlot)
10215  TText* ttit = main_pavtxt->AddText(f_in);
10216  ttit->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10217 
10218  if(opt_plot == fSeveralPlot)
10219  {
10220  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%6d",
10221  fFapAnaType.Data(), fFapNbOfSamples,
10222  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts, sFapStexNumber.Data(),
10223  Stex_StinCons, n1StexCrys, i0StinEcha);
10224  }
10225  if(opt_plot == fSameOnePlot)
10226  {
10227  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%6d %-25s",
10228  fFapAnaType.Data(), fFapNbOfSamples,
10229  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts, sFapStexNumber.Data(),
10230  Stex_StinCons, n1StexCrys, i0StinEcha, QuantityName.Data());
10231  }
10232 
10233  TText* tt = main_pavtxt->AddText(f_in);
10234  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
10235 
10236  delete [] f_in; f_in = 0; fCdelete++;
10237 
10238  //---------- Draw the "several changing" pave with its text in the Canvas (FIRST TIME) (HistimePlot)
10239  main_pavtxt->Draw();
10240 
10241  //---------------- Call to SetParametersCanvas
10242  //fImp<HISTOCODE> = (TCanvasImp*)fCanv<HISTOCODE>->GetCanvasImp();
10243  //fCanv<HISTOCODE>->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
10244  //fPad<HISTOCODE> = gPad;
10245  //fMemoPlot<HISTOCODE> = 1; =======> set MemoFlag to "Buzy"
10246  //fMemoColor<HISTOCODE> = 0;
10247  SetParametersCanvas(HistoCode, opt_plot);
10248 
10249  //---------------- Set xMemoPlotSame to 0
10250  xMemoPlotSame = 0;
10251  }
10252 
10253  //............................ cases fMemoPlotxxx = 1 (HistimePlot)
10254  if(GetMemoFlag(HistoCode, opt_plot) == "Busy")
10255  {
10256  //---------------- Call to ActivePavTxt
10257  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
10258  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
10259 
10260  //---------------- Call to ActivePad
10261  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
10262 
10263  //---------------- Recover pointer to the current canvas
10264  MainCanvas = GetCurrentCanvas(HistoCode.Data(), opt_plot.Data());
10265  }
10266  }
10267 
10268  //============================================================================= (HistimePlot)
10269  //
10270  // 2nd OPERATIONS: Write and Draw the parameter values in the
10271  // "several changing" pave (options SAME and SAME n)
10272  // Draw Histo
10273  //=============================================================================
10274  if(main_subpad != 0)
10275  {
10276  if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
10277  {
10278  if(xMemoPlotSame != 0)
10279  {
10280  main_pavtxt->SetTextAlign(fTextPaveAlign);
10281  main_pavtxt->SetTextFont(fTextPaveFont);
10282  main_pavtxt->SetTextSize(fTextPaveSize);
10283  main_pavtxt->SetBorderSize(fTextBorderSize);
10284 
10285  char* f_in = new char[fgMaxCar]; fCnew++;
10286 
10287  if(opt_plot == fSeveralPlot )
10288  {sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%6d",
10289  fFapAnaType.Data(), fFapNbOfSamples, fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts,
10290  sFapStexNumber.Data(), Stex_StinCons, n1StexCrys, i0StinEcha);}
10291  if(opt_plot == fSameOnePlot )
10292  {sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d%6d %-25s",
10293  fFapAnaType.Data(), fFapNbOfSamples, fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts,
10294  sFapStexNumber.Data(), Stex_StinCons, n1StexCrys, i0StinEcha, QuantityName.Data());}
10295 
10296  TText *tt = main_pavtxt->AddText(f_in);
10297  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
10298  MainCanvas->cd(); gStyle->SetOptDate(0);
10299  main_pavtxt->Draw();
10300 
10301  delete [] f_in; f_in = 0; fCdelete++;
10302  }
10303  main_subpad->cd();
10304  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
10305  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
10306  Double_t y_low = fCnaParHistos->BoxTopY("several_evol_box") + 0.005;
10307  Double_t y_up = fCnaParHistos->BoxBottomY("general_comment") - 0.005;
10308  if( opt_plot == fSameOnePlot ){y_up = fCnaParHistos->BoxBottomY("top_left_box_EB") - 0.005;}
10309  main_subpad->SetPad(x_low, y_low, x_up, y_up);
10310  }
10311 
10312  //............................................ Style (HistimePlot)
10313  SetViewGraphColors(g_graph0, HistoCode, opt_plot);
10314 
10315  //................................. Set axis titles
10316  TString axis_x_var_name = SetHistoXAxisTitle(HistoCode);
10317  TString axis_y_var_name = SetHistoYAxisTitle(HistoCode);
10318  g_graph0->GetXaxis()->SetTitle(axis_x_var_name);
10319  g_graph0->GetYaxis()->SetTitle(axis_y_var_name);
10320 
10321  //................................. Xaxis is a time axis
10322  g_graph0->GetXaxis()->SetTimeDisplay(1);
10323  g_graph0->GetXaxis()->SetTimeFormat("%d %b-%Hh");
10324 
10325  g_graph0->GetXaxis()->SetTimeOffset(xinf);
10326 
10327  Int_t nb_displayed = fCnaParHistos->GetNbOfRunsDisplayed(); // max nb of run numbers displayed
10328 
10329  //........................................................................... (HistimePlot)
10330  Int_t liny = 0;
10331  Int_t logy = 1;
10332 
10333  if(opt_plot == fOnlyOnePlot)
10334  {
10335  fXinf = (Double_t)xinf;
10336  fXsup = (Double_t)xsup;
10337  fYinf = (Double_t)GetYminValueFromMemo(HistoCode);
10338  fYsup = (Double_t)GetYmaxValueFromMemo(HistoCode);
10339 
10340  gPad->RangeAxis(fXinf, fYinf, fXsup, fYsup);
10341 
10342  //if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(liny);}
10343  if(opt_scale_y == fOptScaleLogy){gPad->SetLogy(logy); g_graph0->Draw("ALP");}
10344 
10345  if(opt_scale_y == fOptScaleLiny)
10346  {
10347  gPad->SetLogy(liny);
10348  g_graph0->Draw("ALP");
10349  Int_t nb_pts = g_graph0->GetN();
10350  Double_t* coord_x = g_graph0->GetX();
10351  Double_t* coord_y = g_graph0->GetY();
10352 
10353  char* f_in = new char[fgMaxCar]; fCnew++;
10354 
10355  //................. display of the run numbers (HistimePlot)
10356  Double_t interv_displayed = (coord_x[nb_pts-1] - coord_x[0])/(Double_t)nb_displayed;
10357  Double_t last_drawn_coordx = coord_x[0] - 1.5*interv_displayed;
10358 
10359  for(Int_t i_run=0; i_run<nb_pts; i_run++)
10360  {
10361  if ( (coord_x[i_run] - last_drawn_coordx) > interv_displayed )
10362  {
10363  Double_t joinYinf = fYinf;
10364  Double_t joinYsup = fYsup;
10365  if( joinYsup <= joinYinf )
10366  {
10367  joinYinf =
10368  GetYminFromGraphFrameAndMarginValue(g_graph0, fCnaParHistos->GetMarginAutoMinMax());
10369  joinYsup =
10370  GetYmaxFromGraphFrameAndMarginValue(g_graph0, fCnaParHistos->GetMarginAutoMinMax());
10371  joinYsup = joinYsup + (joinYsup-joinYinf)/20.;
10372  }
10373 
10374  sprintf( f_in, "R%d", fT1DRunNumber[i_run]);
10375  TText *text_run_num = new TText(coord_x[i_run], joinYsup, f_in); fCnewRoot++;
10376  text_run_num->SetTextAngle((Double_t)45.);
10377  text_run_num->SetTextSize((Double_t)0.035);
10378  text_run_num->Draw("SAME");
10379  // delete text_StexStin_num; fCdeleteRoot++;
10380 
10381  TLine *jointlign;
10382  jointlign = new TLine(coord_x[i_run], joinYsup, coord_x[i_run], coord_y[i_run]); fCnewRoot++;
10383  jointlign->SetLineWidth(1);
10384  jointlign->SetLineStyle(2);
10385  jointlign->Draw("SAME");
10386  // delete jointlign; fCdeleteRoot++;
10387 
10388  last_drawn_coordx = coord_x[i_run]; // (HistimePlot)
10389  }
10390  }
10391 
10392  delete [] f_in; f_in = 0; fCdelete++;
10393 
10394  }
10395  if(opt_scale_y == fOptScaleLogy)
10396  {
10397  gPad->SetLogy(logy);
10398  g_graph0->Draw("ALP");
10399  }
10400  }
10401 
10402  //...................................................................... (HistimePlot)
10403  if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
10404  {
10405  if(xMemoPlotSame == 0)
10406  {
10407  if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(liny);}
10408  if(opt_scale_y == fOptScaleLogy){gPad->SetLogy(logy);
10409 }
10410  g_graph0->Draw("ALP");
10411 
10412  fXinf = (Double_t)xinf;
10413  fXsup = (Double_t)xsup;
10414  fYinf = (Double_t)GetYminValueFromMemo(HistoCode);
10415  fYsup = (Double_t)GetYmaxValueFromMemo(HistoCode);
10416 
10417  gPad->RangeAxis(fXinf, fYinf, fXsup, fYsup);
10418  }
10419 
10420  if(xMemoPlotSame != 0) // (HistimePlot)
10421  {
10422  if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(liny);}
10423  if(opt_scale_y == fOptScaleLogy){gPad->SetLogy(logy);}
10424 
10425  g_graph0->Draw("LP");
10426  }
10427  }
10428  gPad->Update();
10429  }
10430  else // else du if(main_subpad !=0)
10431  {
10432  cout << "*TEcnaHistos::HistimePlot(...)> Canvas not found. Previously closed in option SAME."
10433  << fTTBELL << endl;
10434 
10435  ReInitCanvas(HistoCode, opt_plot);
10436  xMemoPlotSame = 0;
10437  }
10438 
10439  // delete MainCanvas; fCdeleteRoot++;
10440 
10441 } // end of HistimePlot
10442 
10443 //------------------------------------------------------------------------------------------------------
10444 void TEcnaHistos::TopAxisForHistos(TH1D* h_his0, const TString& opt_plot,
10445  const Int_t& xMemoPlotSame, const Int_t& min_value, const Int_t& max_value,
10446  const Int_t& xFlagAutoYsupMargin, const Int_t& HisSize)
10447 {
10448 // Axis on top of the plot to indicate the Stin numbers
10449 
10450  if( opt_plot == fOnlyOnePlot ||
10451  ( (opt_plot == fSeveralPlot) && (xMemoPlotSame == 0) ) ||
10452  ( (opt_plot == fSameOnePlot) && (xMemoPlotSame == 0) ) )
10453  {
10454  Double_t Maxih = (Double_t)h_his0->GetMaximum();
10455  Double_t Minih = (Double_t)h_his0->GetMinimum();
10456 
10457  if(xFlagAutoYsupMargin == 1)
10458  {
10459  if( Minih >= Maxih ){Minih = (Double_t)0.; Maxih += Maxih;} // ROOT default if ymin >= ymax
10460  Double_t MaxMarginFactor = (Double_t)0.05; // frame top line = 5% above the maximum
10461  Maxih += (Maxih-Minih)*MaxMarginFactor; // ROOT default if ymin < ymax
10462  }
10463 
10464  Double_t v_min = min_value;
10465  Double_t v_max = max_value+(Double_t)1.;
10466  Double_t v_min_p = v_min+(Double_t)1.;
10467  Double_t v_max_p = v_max+(Double_t)1.;
10468 
10469  Int_t ndiv = 50207;
10470  TString opt = "B-";
10471  Double_t Xbegin = 0.;
10472  Double_t Xend = (Double_t)HisSize;
10473  Double_t ticks = 0.05;
10474 
10475  if( fFapStexNumber == 0 && fFlagSubDet == "EE" )
10476  {
10477  v_min = 0;
10478  v_max = max_value;
10479  ndiv = 4;
10480  opt = "CSU"; // first draw axis with ticksize and no label
10481  Xbegin = (Double_t)HisSize;
10482  Xend = 0.;
10483  }
10484 
10485  if( fFapStexNumber > 0 && fFlagSubDet == "EE" )
10486  {
10487  ticks = 0;
10488  if( fFapStexNumber == 1 )
10489  {
10490  v_min = min_value;
10491  v_max = max_value+0.5;
10492  Xbegin = (Double_t)HisSize;
10493  Xend = 0.;
10494  opt = "CSU"; // first draw axis with no ticksize and no label
10495  }
10496  if( fFapStexNumber == 2 )
10497  {
10498  v_min = min_value+0.5;
10499  v_max = max_value+1.;
10500  Xbegin = (Double_t)HisSize;
10501  Xend = 0.;
10502  opt = "CSU"; // first draw axis with no ticksize and no label
10503  }
10504  if( fFapStexNumber == 3 )
10505  {
10506  v_min = min_value+0.5;
10507  v_max = max_value+1.;
10508  Xbegin = 0.;
10509  Xend = (Double_t)HisSize;
10510  opt = "-CSU"; // first draw axis with no ticksize and no label
10511  }
10512  if( fFapStexNumber == 4 )
10513  {
10514  v_min = min_value;
10515  v_max = max_value+0.5;
10516  Xbegin = 0.;
10517  Xend = (Double_t)HisSize;
10518  opt = "-CSU"; // first draw axis with no ticksize and no label
10519  }
10520  v_min -= 1;
10521  v_max -= 1;
10522  ndiv = 5;
10523  }
10524 
10525  TGaxis* top_axis_x = 0;
10526 
10527  top_axis_x = new TGaxis(Xbegin, Maxih, Xend, Maxih,
10528  v_min, v_max, ndiv, opt, 0.); fCnewRoot++;
10529 
10530  top_axis_x->SetTickSize(ticks);
10531  top_axis_x->SetTitleOffset((Float_t)(1.2));
10532  top_axis_x->SetLabelOffset((Float_t)(0.005));
10533 
10534  TString x_var_name = "?";
10535  Int_t MaxCar = fgMaxCar;
10536  x_var_name.Resize(MaxCar);
10537  if( fFapStexNumber > 0 )
10538  {
10539  if( fFlagSubDet == "EB"){x_var_name = "Tower number";}
10540  if( fFlagSubDet == "EE")
10541  {
10542  x_var_name = " ";
10543  // x_var_name = " Data sector"; // don't remove the space characters !
10544  }
10545  }
10546  if( fFapStexNumber == 0 )
10547  {
10548  if( fFlagSubDet == "EB"){x_var_name = "SM number";}
10549  if( fFlagSubDet == "EE"){x_var_name = " ";}
10550  }
10551  top_axis_x->SetTitle(x_var_name);
10552  top_axis_x->Draw("SAME");
10553 
10554  if( fFlagSubDet == "EE" )
10555  {
10556  // redraw axis with ticksize = 0, with labelOffset<0 or >0 and div centered in middle division
10557  opt = "-MS";
10558  if(fFapStexNumber == 1 || fFapStexNumber == 2 ){opt = "-MS";}
10559  if(fFapStexNumber == 3 || fFapStexNumber == 4 ){opt = "MS";}
10560  ndiv = 4;
10561  if( fFapStexNumber > 0 ){ndiv = 5;}
10562  TGaxis* top_axis_x_bis = 0;
10563  top_axis_x_bis = new TGaxis(Xbegin, Maxih, Xend, Maxih,
10564  v_min_p, v_max_p, ndiv, opt, 0.); fCnewRoot++;
10565  top_axis_x_bis->SetTickSize(0.);
10566  Float_t lab_siz_x = top_axis_x->GetLabelSize();
10567  top_axis_x_bis->SetLabelSize(lab_siz_x);
10568  top_axis_x_bis->SetLabelOffset(-0.1);
10569 
10570  top_axis_x_bis->SetLabelOffset((Float_t)(9999.));
10571  // if(fFapStexNumber == 1 || fFapStexNumber == 2 ){top_axis_x_bis->SetLabelOffset(-0.07);}
10572  // if(fFapStexNumber == 3 || fFapStexNumber == 4 ){top_axis_x_bis->SetLabelOffset(-0.05);}
10573  // if(fFapStexNumber == 0 )
10574  // {top_axis_x_bis->SetLabelOffset((Float_t)(9999.));} // keep the tick and remove the value
10575  top_axis_x_bis->Draw("SAME");
10576  }
10577  }
10578 } // end of TopAxisForHistos
10579 
10580 //............................................................................................
10581 void TEcnaHistos::SetAllPavesViewMatrix(const TString& BetweenWhat,
10582  const Int_t& StexStin_A, const Int_t& StexStin_B,
10583  const Int_t& i0StinEcha)
10584 {
10585 // Put all the paves of a matrix view
10586 
10587  fPavComGeneralTitle = fCnaParHistos->SetPaveGeneralComment(fFlagGeneralTitle);
10588 
10589  fPavComStex = fCnaParHistos->SetPaveStex("standard", fFapStexNumber);
10590 
10591  if(BetweenWhat == fLFBetweenChannels || BetweenWhat == fHFBetweenChannels)
10592  {fPavComStin = fCnaParHistos->SetPaveStinsXY(StexStin_A, StexStin_B);}
10593  if(BetweenWhat == fBetweenSamples)
10594  {
10595  fPavComStin = fCnaParHistos->SetPaveStin(StexStin_A, fFapStexNumber);
10596 
10597  if( fFlagSubDet == "EB" )
10598  {Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
10599  fPavComXtal = fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha);}
10600  if( fFlagSubDet == "EE" )
10601  {TString Dir = fEcalNumbering->GetDeeDirViewedFromIP(fFapStexNumber);
10602  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
10603  fPavComXtal = fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha);}
10604  }
10605 
10606  fPavComAnaRun = fCnaParHistos->SetPaveAnalysisRun(fFapAnaType, fFapNbOfSamples, fFapRunNumber, fRunType,
10607  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, "OneCol");
10608  fPavComNbOfEvts = fCnaParHistos->SetPaveNbOfEvts(fFapNbOfEvts, fStartDate, fStopDate, "OneCol");
10609 }
10610 
10611 void TEcnaHistos::SetAllPavesViewStin(const Int_t& StexStin_A)
10612 {
10613 // Put all the paves of a Stin view
10614 
10615  fPavComGeneralTitle = fCnaParHistos->SetPaveGeneralComment(fFlagGeneralTitle);
10616  fPavComStex = fCnaParHistos->SetPaveStex("standard", fFapStexNumber);
10617 
10618  fPavComStin = fCnaParHistos->SetPaveStin(StexStin_A, fFapStexNumber);
10619 
10620  fPavComAnaRun = fCnaParHistos->SetPaveAnalysisRun(fFapAnaType, fFapNbOfSamples, fFapRunNumber, fRunType,
10621  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, "OneCol");
10622  fPavComNbOfEvts = fCnaParHistos->SetPaveNbOfEvts(fFapNbOfEvts, fStartDate, fStopDate, "OneCol");
10623 }
10624 
10625 void TEcnaHistos::SetAllPavesViewStinCrysNb(const Int_t& StexNumber, const Int_t& StexStin_A)
10626 {
10627 // Put all the paves of a crystal numbering Stin view
10628 
10629  fPavComStex = fCnaParHistos->SetPaveStex("standard", StexNumber);
10630  fPavComStin = fCnaParHistos->SetPaveStin(StexStin_A, StexNumber);
10631 
10632  if( fFlagSubDet == "EB")
10633  {fPavComLVRB = fCnaParHistos->SetPaveLVRB(StexNumber, StexStin_A);}
10634  if( fFlagSubDet == "EE")
10635  {fPavComCxyz = fCnaParHistos->SetPaveCxyz(StexNumber);}
10636 }
10637 
10638 void TEcnaHistos::SetAllPavesViewStex(const TString& chopt, const Int_t& StexNumber)
10639 {
10640  if( chopt == "Numbering" )
10641  {
10642  fCnaParHistos->SetViewHistoStyle("Stex2DEENb");
10643  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10644  fPavComStex = fCnaParHistos->SetPaveStex("standStex", StexNumber);
10645  if( fFlagSubDet == "EE" ){fPavComCxyz = fCnaParHistos->SetPaveCxyz(StexNumber);}
10646  }
10647  else
10648  {
10649  SetAllPavesViewStex(StexNumber);
10650  }
10651 }
10652 // end of SetAllPavesViewStex(...,...)
10653 
10654 void TEcnaHistos::SetAllPavesViewStex(const Int_t& StexNumber)
10655 {
10656  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10657  fPavComGeneralTitle = fCnaParHistos->SetPaveGeneralComment(fFlagGeneralTitle);
10658  fPavComStex = fCnaParHistos->SetPaveStex("standStex", StexNumber);
10659 
10660  TString opt_pave_nbcol = "OneCol";
10661  if( fFapStexName == "SM"){opt_pave_nbcol = "TwoCol";}
10662 
10663  fPavComAnaRun = fCnaParHistos->SetPaveAnalysisRun(fFapAnaType, fFapNbOfSamples, fFapRunNumber, fRunType,
10664  fFapFirstReqEvtNumber, fFapLastReqEvtNumber,opt_pave_nbcol);
10665  fPavComNbOfEvts = fCnaParHistos->SetPaveNbOfEvts(fFapNbOfEvts, fStartDate, fStopDate, opt_pave_nbcol);
10666 }
10667 // end of SetAllPavesViewStex(...)
10668 
10670 {
10671  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10672  fPavComGeneralTitle = fCnaParHistos->SetPaveGeneralComment(fFlagGeneralTitle);
10673  fPavComStas = fCnaParHistos->SetPaveStas();
10674 
10675  fPavComAnaRun = fCnaParHistos->SetPaveAnalysisRun(fFapAnaType, fFapNbOfSamples, fFapRunNumber, fRunType,
10676  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, "OneCol");
10677  fPavComNbOfEvts = fCnaParHistos->SetPaveNbOfEvts(fFapNbOfEvts, fStartDate, fStopDate, "OneCol");
10678 }
10679 // end of SetAllPavesViewStas
10680 
10681 void TEcnaHistos::SetAllPavesViewHisto(const TString& HistoCode, const Int_t& StexStin_A,
10682  const Int_t& i0StinEcha, const Int_t& i0Sample,
10683  const TString& opt_plot)
10684 {
10685  Int_t arg_AlreadyRead = 0;
10686  SetAllPavesViewHisto(HistoCode, StexStin_A, i0StinEcha, i0Sample, opt_plot, arg_AlreadyRead);
10687 }
10688 
10689 void TEcnaHistos::SetAllPavesViewHisto(const TString& HistoCode, const Int_t& StexStin_A,
10690  const Int_t& i0StinEcha, const Int_t& i0Sample,
10691  const TString& opt_plot, const Int_t& arg_AlreadyRead)
10692 {
10693 // Put all the paves of a histo view according to HistoCode
10694 
10695  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10696 
10697  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
10698 
10699  fPavComGeneralTitle = fCnaParHistos->SetPaveGeneralComment(fFlagGeneralTitle);
10700 
10701  if(opt_plot == fOnlyOnePlot)
10702  {
10703  if( !( HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" ||
10704  HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs" ||
10705  HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" ||
10706  HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs" ||
10707  HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" ||
10708  HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" ||
10709  HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs" ) )
10710  {
10711  fPavComStex = fCnaParHistos->SetPaveStex("standard", fFapStexNumber);
10712  fPavComStin = fCnaParHistos->SetPaveStin(StexStin_A, fFapStexNumber);
10713  }
10714  else
10715  {
10716  if( HistoCode == "D_NOE_ChNb" ||
10717  HistoCode == "D_Ped_ChNb" || HistoCode == "D_TNo_ChNb" ||
10718  HistoCode == "D_MCs_ChNb" || HistoCode == "D_LFN_ChNb" ||
10719  HistoCode == "D_HFN_ChNb" || HistoCode == "D_SCs_ChNb" )
10720  {fPavComStex = fCnaParHistos->SetPaveStex("standGH", fFapStexNumber);}
10721  else
10722  {fPavComStex = fCnaParHistos->SetPaveStex("standard", fFapStexNumber);}
10723  }
10724  //.................................................... (SetAllPavesViewHisto)
10725 
10726  if( HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10727  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
10728  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
10729  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
10730  {
10731  Int_t n1StexCrys =
10732  fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
10733  fPavComXtal = fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha);
10734  }
10735 
10736  if( HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" ||
10737  HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpDs" )
10738  {
10739  Int_t n1StexCrys =
10740  fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
10741  fPavComXtal =
10742  fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha, arg_AlreadyRead, fPlotAllXtalsInStin);
10743  }
10744 
10745  if( HistoCode == "D_Adc_EvDs" || HistoCode == "D_Adc_EvNb")
10746  {
10747  Int_t n1StexCrys =
10748  fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
10749  fPavComXtal = fCnaParHistos->SetPaveCrystalSample(n1StexCrys, StexStin_A, i0StinEcha, i0Sample);
10750  }
10751 
10752  if( HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10753  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
10754  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
10755  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
10756  {
10757  fPavComEvolNbOfEvtsAna =
10758  fCnaParHistos->SetPaveEvolNbOfEvtsAna(fFapAnaType, fFapNbOfSamples,
10759  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, HistoType);
10760  fPavComEvolRuns = fCnaParHistos->SetPaveEvolRuns(fStartEvolRun, fStartEvolDate,
10761  fStopEvolRun, fStopEvolDate, opt_plot, HistoType);
10762  }
10763  else
10764  {
10765  fPavComAnaRun = fCnaParHistos->SetPaveAnalysisRun(fFapAnaType, fFapNbOfSamples, fFapRunNumber, fRunType,
10766  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, "OneCol");
10767  fPavComNbOfEvts = fCnaParHistos->SetPaveNbOfEvts(fFapNbOfEvts, fStartDate, fStopDate, "OneCol");
10768  }
10769  }
10770 
10771  //.................................................... (SetAllPavesViewHisto)
10772 
10773  if( opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free" )
10774  {
10775  if( HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10776  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
10777  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
10778  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
10779  {
10780  fPavComSeveralChanging = fCnaParHistos->SetOptionSamePaveBorder("sevevol", HistoType);
10781  fPavComEvolRuns = fCnaParHistos->SetPaveEvolRuns(fStartEvolRun, fStartEvolDate,
10782  fStopEvolRun, fStopEvolDate, opt_plot, HistoType);
10783  }
10784  else
10785  {
10786  fPavComSeveralChanging = fCnaParHistos->SetOptionSamePaveBorder("several", HistoType);
10787  }
10788  }
10789 
10790  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free" )
10791  {
10792  fPavComSeveralChanging = fCnaParHistos->SetOptionSamePaveBorder("several", HistoType);
10793  fPavComEvolRuns = fCnaParHistos->SetPaveEvolRuns(fStartEvolRun, fStartEvolDate,
10794  fStopEvolRun, fStopEvolDate, opt_plot, HistoType);
10795  }
10796 
10797 }
10798 // end of SetAllPavesViewHisto
10799 
10800 TString TEcnaHistos::SetCanvasName(const TString& HistoCode,
10801  const Int_t& opt_scale_x, const Int_t& opt_scale_y,
10802  const TString& opt_plot, const Int_t& arg_AlreadyRead,
10803  const Int_t& StexStin_A, const Int_t& i0StinEcha, const Int_t& i0Sample)
10804 {
10805  //......... Set Canvas name *===> FOR 1D HISTO ONLY
10806  // (for 2D histos, see inside ViewMatrix, ViewStex,...)
10807 
10808  TString canvas_name;
10809  Int_t MaxCar = fgMaxCar;
10810  canvas_name.Resize(MaxCar);
10811  canvas_name = "?";
10812 
10813  char* f_in = new char[fgMaxCar]; fCnew++;
10814 
10815  //......................... name_ opt_plot (Set Canvas name)
10816  TString name_opt_plot;
10817  MaxCar = fgMaxCar;
10818  name_opt_plot.Resize(MaxCar);
10819  name_opt_plot = "?";
10820 
10821  //if(opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0){name_opt_plot = "P0";} // Only one plot
10822  //if(opt_plot == fOnlyOnePlot && arg_AlreadyRead == 1){name_opt_plot = "P1";} // SAME in Stin plot
10823  //if(opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1){name_opt_plot = "Pn";} // SAME in Stin plot
10824 
10825  if( opt_plot == fOnlyOnePlot ){sprintf(f_in,"P%d", arg_AlreadyRead); name_opt_plot = f_in;}
10826 
10827  if(opt_plot == fSeveralPlot)
10828  {
10829  name_opt_plot = "SAME_N";
10830  //...................................... name_same (opt_plot = fSeveralPlot)
10831  Int_t name_same = -1;
10832 
10833  if(HistoCode == "D_NOE_ChNb"){name_same = fCanvSameD_NOE_ChNb;}
10834  if(HistoCode == "D_NOE_ChDs"){name_same = fCanvSameD_NOE_ChDs;}
10835  if(HistoCode == "D_Ped_ChNb"){name_same = fCanvSameD_Ped_ChNb;}
10836  if(HistoCode == "D_Ped_ChDs"){name_same = fCanvSameD_Ped_ChDs;}
10837  if(HistoCode == "D_TNo_ChNb"){name_same = fCanvSameD_TNo_ChNb;}
10838  if(HistoCode == "D_TNo_ChDs"){name_same = fCanvSameD_TNo_ChDs;}
10839  if(HistoCode == "D_MCs_ChNb"){name_same = fCanvSameD_MCs_ChNb;}
10840  if(HistoCode == "D_MCs_ChDs"){name_same = fCanvSameD_MCs_ChDs;}
10841  if(HistoCode == "D_LFN_ChNb"){name_same = fCanvSameD_LFN_ChNb;}
10842  if(HistoCode == "D_LFN_ChDs"){name_same = fCanvSameD_LFN_ChDs;}
10843  if(HistoCode == "D_HFN_ChNb"){name_same = fCanvSameD_HFN_ChNb;}
10844  if(HistoCode == "D_HFN_ChDs"){name_same = fCanvSameD_HFN_ChDs;}
10845  if(HistoCode == "D_SCs_ChNb"){name_same = fCanvSameD_SCs_ChNb;}
10846  if(HistoCode == "D_SCs_ChDs"){name_same = fCanvSameD_SCs_ChDs;}
10847  if(HistoCode == "D_MSp_SpNb"){name_same = fCanvSameD_MSp_SpNb;}
10848  if(HistoCode == "D_MSp_SpDs"){name_same = fCanvSameD_MSp_SpDs;}
10849  if(HistoCode == "D_SSp_SpNb"){name_same = fCanvSameD_SSp_SpNb;}
10850  if(HistoCode == "D_SSp_SpDs"){name_same = fCanvSameD_SSp_SpDs;}
10851  if(HistoCode == "D_Adc_EvDs"){name_same = fCanvSameD_Adc_EvDs;}
10852  if(HistoCode == "D_Adc_EvNb"){name_same = fCanvSameD_Adc_EvNb;}
10853  if(HistoCode == "H_Ped_Date"){name_same = fCanvSameH_Ped_Date;}
10854  if(HistoCode == "H_TNo_Date"){name_same = fCanvSameH_TNo_Date;}
10855  if(HistoCode == "H_MCs_Date"){name_same = fCanvSameH_MCs_Date;}
10856  if(HistoCode == "H_LFN_Date"){name_same = fCanvSameH_LFN_Date;}
10857  if(HistoCode == "H_HFN_Date"){name_same = fCanvSameH_HFN_Date;}
10858  if(HistoCode == "H_SCs_Date"){name_same = fCanvSameH_SCs_Date;}
10859  if(HistoCode == "H_Ped_RuDs"){name_same = fCanvSameH_Ped_RuDs;}
10860  if(HistoCode == "H_TNo_RuDs"){name_same = fCanvSameH_TNo_RuDs;}
10861  if(HistoCode == "H_MCs_RuDs"){name_same = fCanvSameH_MCs_RuDs;}
10862  if(HistoCode == "H_LFN_RuDs"){name_same = fCanvSameH_LFN_RuDs;}
10863  if(HistoCode == "H_HFN_RuDs"){name_same = fCanvSameH_HFN_RuDs;}
10864  if(HistoCode == "H_SCs_RuDs"){name_same = fCanvSameH_SCs_RuDs;}
10865 
10866  sprintf(f_in,"%d", name_same);
10867  TString s_name_same = f_in;
10868  const Text_t *t_name_same = (const Text_t *)s_name_same.Data();
10869  name_opt_plot.Append(t_name_same);
10870  }
10871  if(opt_plot == fSameOnePlot)
10872  {
10873  name_opt_plot = "SAME_Plus_N";
10874  //...................................... name_same (opt_plot = fSeveralPlot)
10875  Int_t name_same = fCanvSameH1SamePlus;
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 
10882  //......................... name_visu (Set Canvas name)
10883  TString name_visu;
10884  MaxCar = fgMaxCar;
10885  name_visu.Resize(MaxCar);
10886  name_visu = "";
10887 
10888  TString name_line;
10889  MaxCar = fgMaxCar;
10890  name_line.Resize(MaxCar);
10891  name_line = "Line_";
10892  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
10893  if( HistoType == "Global" && (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) ){name_line = "Polm_";}
10894 
10895  // if(opt_visu == fOptVisLine){name_line = "Line_";}
10896  // if(opt_visu == fOptVisPolm){name_line = "Poly_";}
10897 
10898  const Text_t *t_line = (const Text_t *)name_line.Data();
10899  name_visu.Append(t_line);
10900 
10901  TString name_scale_x;
10902  MaxCar = fgMaxCar;
10903  name_scale_x.Resize(MaxCar);
10904  name_scale_x = "?";
10905  if(opt_scale_x == fOptScaleLinx){name_scale_x = "LinX_";}
10906  if(opt_scale_x == fOptScaleLogx){name_scale_x = "LogX_";}
10907  const Text_t *t_scale_x = (const Text_t *)name_scale_x.Data();
10908  name_visu.Append(t_scale_x);
10909 
10910  TString name_scale_y;
10911  MaxCar = fgMaxCar;
10912  name_scale_y.Resize(MaxCar);
10913  name_scale_y = "?";
10914  if(opt_scale_y == fOptScaleLiny){name_scale_y = "LinY";}
10915  if(opt_scale_y == fOptScaleLogy){name_scale_y = "LogY";}
10916  const Text_t *t_scale_y = (const Text_t *)name_scale_y.Data();
10917  name_visu.Append(t_scale_y);
10918 
10919  //...................................... name quantity (Set Canvas name)
10920  TString name_quantity;
10921  MaxCar = fgMaxCar;
10922  name_quantity.Resize(MaxCar);
10923  name_quantity = "?";
10924 
10925  if(HistoCode == "D_NOE_ChNb"){name_quantity = "Nb_of_evts_as_func_of_Xtal";}
10926  if(HistoCode == "D_NOE_ChDs"){name_quantity = "Nb_of_evts_Xtal_distrib";}
10927  if(HistoCode == "D_Ped_ChNb"){name_quantity = "Pedestals_as_func_of_Xtal";}
10928  if(HistoCode == "D_Ped_ChDs"){name_quantity = "Pedestals_Xtal_distrib";}
10929  if(HistoCode == "D_TNo_ChNb"){name_quantity = "Total_Noise_as_func_of_Xtal";}
10930  if(HistoCode == "D_TNo_ChDs"){name_quantity = "Total_Noise_Xtal_distrib";}
10931  if(HistoCode == "D_MCs_ChNb"){name_quantity = "Mean_Corss_as_func_of_Xtal";}
10932  if(HistoCode == "D_MCs_ChDs"){name_quantity = "Mean_Corss_Xtal_distrib";}
10933  if(HistoCode == "D_LFN_ChNb"){name_quantity = "Low_Fq_Noise_as_func_of_Xtal";}
10934  if(HistoCode == "D_LFN_ChDs"){name_quantity = "Low_Fq_Noise_Xtal_distrib";}
10935  if(HistoCode == "D_HFN_ChNb"){name_quantity = "High_Fq_Noise_as_func_of_Xtal";}
10936  if(HistoCode == "D_HFN_ChDs"){name_quantity = "High_Fq_Noise_Xtal_distrib";}
10937  if(HistoCode == "D_SCs_ChNb"){name_quantity = "Sigma_Corss_as_func_of_Xtal";}
10938  if(HistoCode == "D_SCs_ChDs"){name_quantity = "Sigma_Corss_Xtal_distrib";}
10939  if(HistoCode == "D_MSp_SpNb"){name_quantity = "ExpValue_of_samples";}
10940  if(HistoCode == "D_MSp_SpDs"){name_quantity = "ExpValue_of_samples_distrib";}
10941  if(HistoCode == "D_SSp_SpNb"){name_quantity = "Sigma_of_samples";}
10942  if(HistoCode == "D_SSp_SpDs"){name_quantity = "Sigma_of_samples_distrib";}
10943  if(HistoCode == "D_Adc_EvDs"){name_quantity = "hevt";}
10944  if(HistoCode == "D_Adc_EvNb"){name_quantity = "ADC_as_func_of_Event";}
10945  if(HistoCode == "H_Ped_Date"){name_quantity = "Pedestal_history";}
10946  if(HistoCode == "H_TNo_Date"){name_quantity = "Total_Noise_history";}
10947  if(HistoCode == "H_MCs_Date"){name_quantity = "Mean_Corss_history";}
10948  if(HistoCode == "H_LFN_Date"){name_quantity = "Low_Fq_Noise_history";}
10949  if(HistoCode == "H_HFN_Date"){name_quantity = "High_Fq_Noise_history";}
10950  if(HistoCode == "H_SCs_Date"){name_quantity = "Sigma_Corss_history";}
10951  if(HistoCode == "H_Ped_RuDs"){name_quantity = "Pedestal_run_distribution";}
10952  if(HistoCode == "H_TNo_RuDs"){name_quantity = "Total_Noise_run_distribution";}
10953  if(HistoCode == "H_MCs_RuDs"){name_quantity = "Mean_Corss_run_distribution";}
10954  if(HistoCode == "H_LFN_RuDs"){name_quantity = "Low_Fq_Noise_run_distribution";}
10955  if(HistoCode == "H_HFN_RuDs"){name_quantity = "High_Fq_Noise_run_distribution";}
10956  if(HistoCode == "H_SCs_RuDs"){name_quantity = "Sigma_Corss_run_distribution";}
10957 
10958  Int_t num_crys = -1;
10959  if(HistoCode == "D_MSp_SpNb"){num_crys = i0StinEcha;}
10960  if(HistoCode == "D_MSp_SpDs"){num_crys = i0StinEcha;}
10961  if(HistoCode == "D_SSp_SpNb"){num_crys = i0StinEcha;}
10962  if(HistoCode == "D_SSp_SpDs"){num_crys = i0StinEcha;}
10963  if(HistoCode == "D_Adc_EvDs"){num_crys = i0StinEcha;}
10964  if(HistoCode == "D_Adc_EvNb"){num_crys = i0StinEcha;}
10965  if(HistoCode == "H_Ped_Date"){num_crys = i0StinEcha;}
10966  if(HistoCode == "H_TNo_Date"){num_crys = i0StinEcha;}
10967  if(HistoCode == "H_MCs_Date"){num_crys = i0StinEcha;}
10968  if(HistoCode == "H_LFN_Date"){num_crys = i0StinEcha;}
10969  if(HistoCode == "H_HFN_Date"){num_crys = i0StinEcha;}
10970  if(HistoCode == "H_SCs_Date"){num_crys = i0StinEcha;}
10971  if(HistoCode == "H_Ped_RuDs"){num_crys = i0StinEcha;}
10972  if(HistoCode == "H_TNo_RuDs"){num_crys = i0StinEcha;}
10973  if(HistoCode == "H_MCs_RuDs"){num_crys = i0StinEcha;}
10974  if(HistoCode == "H_LFN_RuDs"){num_crys = i0StinEcha;}
10975  if(HistoCode == "H_HFN_RuDs"){num_crys = i0StinEcha;}
10976  if(HistoCode == "H_SCs_RuDs"){num_crys = i0StinEcha;}
10977 
10978  Int_t num_samp = -1;
10979  if(HistoCode == "D_Adc_EvDs"){num_samp = i0Sample;}
10980  if(HistoCode == "D_Adc_EvNb"){num_samp = i0Sample;}
10981 
10982  //........................................................... (Set Canvas name)
10983 
10984  if (HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" ||
10985  HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs" ||
10986  HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs" ||
10987  HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" ||
10988  HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" ||
10989  HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" ||
10990  HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs" )
10991  {
10992  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%d_%s%d_%s_%s",
10993  name_quantity.Data(), fFapAnaType.Data(),
10994  fFapNbOfSamples, fFapRunNumber, fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts,
10995  fFapStexName.Data(), fFapStexNumber,
10996  name_opt_plot.Data(), name_visu.Data());
10997  }
10998 
10999  if (HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" ||
11000  HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
11001  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
11002  HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpDs" ||
11003  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
11004  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs")
11005  {
11006  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%d_%s%d_%s%d_Xtal%d_%s_%s",
11007  name_quantity.Data(), fFapAnaType.Data(),
11008  fFapNbOfSamples, fFapRunNumber, fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts,
11009  fFapStexName.Data(), fFapStexNumber, fFapStinName.Data(), StexStin_A, num_crys,
11010  name_opt_plot.Data(), name_visu.Data());
11011  }
11012 
11013  if (HistoCode == "D_Adc_EvNb" || HistoCode == "D_Adc_EvDs")
11014  {
11015  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%d_%s%d_%s%d_Xtal%d_Samp%d_%s_%s",
11016  name_quantity.Data(), fFapAnaType.Data(),
11017  fFapNbOfSamples, fFapRunNumber, fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts,
11018  fFapStexName.Data(), fFapStexNumber, fFapStinName.Data(), StexStin_A, num_crys, num_samp,
11019  name_opt_plot.Data(), name_visu.Data());
11020  }
11021 
11022  canvas_name = f_in;
11023  delete [] f_in; f_in = 0; fCdelete++;
11024  return canvas_name.Data();
11025 
11026 } // end of CanvasName()
11027 
11028 //-----------------------------------------------------------------------------
11029 //
11030 // M I S C E L L A N E O U S P A R A M E T E R S
11031 //
11032 // C O N C E R N I N G T H E D I S P L A Y
11033 //
11034 //-----------------------------------------------------------------------------
11035 
11036 //===========================================================================
11037 //
11038 // GetHistoSize, GetHistoValues, SetHistoXAxisTitle, SetHistoYAxisTitle,
11039 // GetHistoXinf, GetHistoXsup, GetHistoNumberOfBins, FillHisto
11040 //
11041 //===========================================================================
11042 Int_t TEcnaHistos::GetHistoSize(const TString& chqcode, const TString& opt_plot_read)
11043 {
11044 // Histo size as a function of the quantity code
11045 
11046 // VERY IMPORTANT: in some cases the number of bins must be strictly related to the parameters values
11047 // (number of crystals, number of samples, etc...). See below comments "===> ONE BIN BY..."
11048 
11049  Int_t HisSize = fNbBinsProj; // default value
11050 
11051  //............ histo with sample number as x coordinate => HisSize depends on option "plot" or "read"
11052  // because of nb of samples in file: size for plot = 10 even if nb of samples in file < 10
11053  if( chqcode == "D_MSp_SpNb" || chqcode == "D_SSp_SpNb" ||
11054  chqcode == "D_MSp_SpDs" || chqcode == "D_SSp_SpDs" )
11055  {
11056  if( opt_plot_read == "read" ){HisSize = fFapNbOfSamples;}
11057  if( opt_plot_read == "plot" ){HisSize = fEcal->MaxSampADC();}
11058  } // ===> ONE BIN BY SAMPLE
11059 
11060  //............ histo with event number as x coordinate. (==> "D_Adc_EvDs" option: obsolete, to be confirmed)
11061  if(chqcode == "D_Adc_EvNb" || chqcode == "D_Adc_EvDs"){HisSize = fFapReqNbOfEvts;} // ===> ONE BIN BY EVENT
11062 
11063  //............
11064  if(chqcode == "D_NOE_ChNb" ||
11065  chqcode == "D_Ped_ChNb" || chqcode == "D_TNo_ChNb" || chqcode == "D_MCs_ChNb" ||
11066  chqcode == "D_LFN_ChNb" || chqcode == "D_HFN_ChNb" || chqcode == "D_SCs_ChNb" ||
11067  chqcode == "D_NOE_ChDs" ||
11068  chqcode == "D_Ped_ChDs" || chqcode == "D_TNo_ChDs" || chqcode == "D_MCs_ChDs" ||
11069  chqcode == "D_LFN_ChDs" || chqcode == "D_HFN_ChDs" || chqcode == "D_SCs_ChDs" )
11070  {
11071  if( fFlagSubDet == "EB" )
11072  {
11073  if( fFapStexNumber > 0 ){HisSize = fEcal->MaxCrysEcnaInStex();} // ===> ONE BIN BY Xtal
11074  if( fFapStexNumber == 0 ){HisSize = fEcal->MaxSMInEB()*fEcal->MaxTowInSM();} // ===> ONE BIN BY Tower
11075  }
11076  if( fFlagSubDet == "EE" )
11077  {
11078  if( fFapStexNumber > 0 )
11079  {
11080  if( opt_plot_read == "read" ){HisSize = fEcal->MaxCrysEcnaInDee();}
11081  if( opt_plot_read == "plot" ){HisSize = fEcal->MaxCrysForConsInDee();}
11082  } // ===> ONE BIN BY Xtal
11083  if( fFapStexNumber == 0 )
11084  {HisSize = fEcal->MaxDeeInEE()*fEcal->MaxSCForConsInDee();} // ===> ONE BIN BY SC
11085  }
11086  }
11087 
11088  if( chqcode == "H_Ped_RuDs" || chqcode == "H_TNo_RuDs" || chqcode == "H_MCs_RuDs" ||
11089  chqcode == "H_LFN_RuDs" || chqcode == "H_HFN_RuDs" || chqcode == "H_SCs_RuDs" )
11090  {
11091  HisSize = fNbBinsProj;
11092  }
11093 
11094  return HisSize;
11095 }
11096 
11097 TVectorD TEcnaHistos::GetHistoValues(const TVectorD& arg_read_histo, const Int_t& arg_AlreadyRead,
11098  TEcnaRead* aMyRootFile, const TString& HistoCode,
11099  const Int_t& HisSizePlot, const Int_t& HisSizeRead,
11100  const Int_t& StexStin_A, const Int_t& i0StinEcha,
11101  const Int_t& i0Sample, Int_t& i_data_exist)
11102 {
11103  // Histo values in a TVectorD. i_data_exist entry value = 0. Incremented in this method.
11104 
11105  TVectorD plot_histo(HisSizePlot); for(Int_t i=0; i<HisSizePlot; i++){plot_histo(i)=(Double_t)0.;}
11106 
11107  fStatusDataExist = kFALSE;
11108 
11109  if( arg_AlreadyRead >= 1 )
11110  {
11111  //cout << "*TEcnaHistos::GetHistoValues(...)> arg_AlreadyRead = " << arg_AlreadyRead << endl;
11112  for(Int_t i=0; i<HisSizeRead; i++){plot_histo(i)=arg_read_histo(i);}
11113  fStatusDataExist = kTRUE; i_data_exist++;
11114  }
11115 
11116  if( arg_AlreadyRead == 0 )
11117  {
11118  //cout << "*TEcnaHistos::GetHistoValues(...)> arg_AlreadyRead = " << arg_AlreadyRead << endl;
11119  TVectorD read_histo(HisSizeRead); for(Int_t i=0; i<HisSizeRead; i++){read_histo(i)=(Double_t)0.;}
11120 
11121  if( HistoCode == "D_MSp_SpNb" || HistoCode == "D_MSp_SpDs" ||
11122  HistoCode == "D_SSp_SpNb" || HistoCode == "D_SSp_SpDs" )
11123  {
11124  //====> For plots as a function of Sample# (read10->plot10, read3->plot10)
11125  if( HisSizeRead <= HisSizePlot )
11126  {
11127  if (HistoCode == "D_MSp_SpNb" || HistoCode == "D_MSp_SpDs" )
11128  {
11129  read_histo = aMyRootFile->ReadSampleMeans(StexStin_A, i0StinEcha, HisSizeRead);
11130  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11131  for(Int_t i=0; i<HisSizeRead; i++){plot_histo(i)=read_histo(i);}
11132  }
11133 
11134  if (HistoCode == "D_SSp_SpNb" || HistoCode == "D_SSp_SpDs" )
11135  {
11136  read_histo = aMyRootFile->ReadSampleSigmas(StexStin_A, i0StinEcha, HisSizeRead);
11137  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11138  for(Int_t i=0; i<HisSizeRead; i++){plot_histo(i)=read_histo(i);}
11139  }
11140  }
11141  else
11142  {
11143  cout << "!TEcnaHistos::GetHistoValues(...)> *** ERROR *** > HisSizeRead greater than HisSizePlot"
11144  << " for plot as a function of sample#. HisSizeRead = " << HisSizeRead
11145  << ", HisSizePlot = " << HisSizePlot << fTTBELL << endl;
11146  }
11147  } // end of if( HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" " ||
11148  // HistoCode == "D_SSp_SpNb" || HistoCode == "D_SSp_SpDs" )
11149 
11150  if( !(HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" ||
11151  HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpDs" ) ) // = else of previous if
11152  {
11153  //====> For other plots
11154  if( HisSizeRead == HisSizePlot )
11155  {
11156  //========> for EE, HisSizeRead > HisSizePlot but readEcna#->plotForCons# will be build in the calling method
11157  // HisSizeRead = fEcal->MaxCrysEcnaInStex() (GetHistoValues)
11158 
11159  if( HistoCode == "D_Adc_EvNb" || HistoCode == "D_Adc_EvDs" )
11160  {
11161  read_histo = aMyRootFile->ReadSampleAdcValues(StexStin_A, i0StinEcha, i0Sample, HisSizeRead);
11162  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11163  }
11164 
11165  if( HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" )
11166  {
11167  read_histo = aMyRootFile->ReadNumberOfEvents(HisSizeRead);
11168  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11169  }
11170 
11171  if( HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs" )
11172  {
11173  read_histo = aMyRootFile->ReadPedestals(HisSizeRead);
11174  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11175  }
11176 
11177  //...................................................... (GetHistoValues)
11178  if( HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs")
11179  {
11180  read_histo = aMyRootFile->ReadTotalNoise(HisSizeRead);
11181  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11182  }
11183 
11184  if( HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" )
11185  {
11186  read_histo = aMyRootFile->ReadLowFrequencyNoise(HisSizeRead);
11187  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11188 
11189  }
11190 
11191  if( HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" )
11192  {
11193  read_histo = aMyRootFile->ReadHighFrequencyNoise(HisSizeRead);
11194  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11195 
11196  }
11197 
11198  if( HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" )
11199  {
11200  read_histo = aMyRootFile->ReadMeanCorrelationsBetweenSamples(HisSizeRead);
11201  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11202  }
11203 
11204  if( HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs" )
11205  {
11206  read_histo = aMyRootFile->ReadSigmaOfCorrelationsBetweenSamples(HisSizeRead);
11207  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}
11208  }
11209 
11210  for(Int_t i=0; i<HisSizeRead; i++){plot_histo(i)=read_histo(i);}
11211 
11212  }
11213  else
11214  {
11215  cout << "!TEcnaHistos::GetHistoValues(...)> *** ERROR *** > HisSizeRead not equal to HisSizePlot."
11216  << " HisSizeRead = " << HisSizeRead
11217  << ", HisSizePlot = " << HisSizePlot << fTTBELL << endl;
11218  }
11219  } // end of if( !(HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb") )
11220  } // end of if( arg_AlreadyRead == 0 )
11221 
11222  if( i_data_exist == 0 )
11223  {
11224  cout << "!TEcnaHistos::GetHistoValues(...)> Histo not found." << fTTBELL << endl;
11225  }
11226 
11227  return plot_histo;
11228 }
11229 //------- (end of GetHistoValues) -------------
11230 
11231 TString TEcnaHistos::SetHistoXAxisTitle(const TString& HistoCode)
11232 {
11233  // Set histo X axis title
11234 
11235  TString axis_x_var_name;
11236 
11237  if(HistoCode == "D_NOE_ChNb" || HistoCode == "D_Ped_ChNb" ||
11238  HistoCode == "D_TNo_ChNb" || HistoCode == "D_MCs_ChNb" ||
11239  HistoCode == "D_LFN_ChNb" || HistoCode == "D_HFN_ChNb" ||
11240  HistoCode == "D_SCs_ChNb" )
11241  {
11242  if( fFapStexNumber > 0 )
11243  {
11244  if( fFlagSubDet == "EB" ){axis_x_var_name = "Xtal (electronic channel number)";}
11245  if( fFlagSubDet == "EE" ){axis_x_var_name = "Xtal";}
11246  }
11247  if( fFapStexNumber == 0 )
11248  {
11249  if( fFlagSubDet == "EB" ){axis_x_var_name = "Tower number";}
11250  if( fFlagSubDet == "EE" ){axis_x_var_name = "SC number";}
11251  }
11252  }
11253 
11254  if(HistoCode == "D_NOE_ChDs"){axis_x_var_name = "Number of events";}
11255  if(HistoCode == "D_Ped_ChDs"){axis_x_var_name = "Pedestal";}
11256  if(HistoCode == "D_TNo_ChDs"){axis_x_var_name = "Total noise";}
11257  if(HistoCode == "D_MCs_ChDs"){axis_x_var_name = "Mean cor(s,s')";}
11258  if(HistoCode == "D_LFN_ChDs"){axis_x_var_name = "Low frequency noise";}
11259  if(HistoCode == "D_HFN_ChDs"){axis_x_var_name = "High frequency noise";}
11260  if(HistoCode == "D_SCs_ChDs"){axis_x_var_name = "Sigmas cor(s,s')";}
11261  if(HistoCode == "D_MSp_SpNb"){axis_x_var_name = "Sample";}
11262  if(HistoCode == "D_MSp_SpDs"){axis_x_var_name = "Pedestal";}
11263  if(HistoCode == "D_SSp_SpNb"){axis_x_var_name = "Sample";}
11264  if(HistoCode == "D_SSp_SpDs"){axis_x_var_name = "Total noise";}
11265  if(HistoCode == "D_Adc_EvDs"){axis_x_var_name = "ADC";}
11266  if(HistoCode == "D_Adc_EvNb"){axis_x_var_name = "Event number";}
11267  if(HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
11268  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date")
11269  {axis_x_var_name = "Time";}
11270  if(HistoCode == "H_Ped_RuDs"){axis_x_var_name = "Pedestal";}
11271  if(HistoCode == "H_TNo_RuDs"){axis_x_var_name = "Total noise";}
11272  if(HistoCode == "H_MCs_RuDs"){axis_x_var_name = "Mean cor(s,s')";}
11273  if(HistoCode == "H_LFN_RuDs"){axis_x_var_name = "Low frequency noise";}
11274  if(HistoCode == "H_HFN_RuDs"){axis_x_var_name = "High frequency noise";}
11275  if(HistoCode == "H_SCs_RuDs"){axis_x_var_name = "Sigmas cor(s,s')";}
11276 
11277  return axis_x_var_name;
11278 }
11279 
11280 TString TEcnaHistos::SetHistoYAxisTitle(const TString& HistoCode)
11281 {
11282 // Set histo Y axis title
11283 
11284  TString axis_y_var_name;
11285 
11286  if(HistoCode == "D_NOE_ChNb"){axis_y_var_name = "Number of events";}
11287  if(HistoCode == "D_Ped_ChNb"){axis_y_var_name = "Pedestal";}
11288  if(HistoCode == "D_TNo_ChNb"){axis_y_var_name = "Total noise";}
11289  if(HistoCode == "D_MCs_ChNb"){axis_y_var_name = "Mean cor(s,s')";}
11290  if(HistoCode == "D_LFN_ChNb"){axis_y_var_name = "Low frequency noise";}
11291  if(HistoCode == "D_HFN_ChNb"){axis_y_var_name = "High frequency noise";}
11292  if(HistoCode == "D_SCs_ChNb"){axis_y_var_name = "Sigma of cor(s,s')";}
11293 
11294  if(HistoCode == "D_NOE_ChDs" ||
11295  HistoCode == "D_Ped_ChDs" || HistoCode == "D_TNo_ChDs" || HistoCode == "D_MCs_ChDs" ||
11296  HistoCode == "D_LFN_ChDs" || HistoCode == "D_HFN_ChDs" || HistoCode == "D_SCs_ChDs" )
11297  {
11298  if( fFapStexNumber > 0 ){axis_y_var_name = "number of crystals";}
11299  if( fFapStexNumber == 0 )
11300  {
11301  if( fFlagSubDet == "EB" ){axis_y_var_name = "number of towers";}
11302  if( fFlagSubDet == "EE" ){axis_y_var_name = "number of SC's";}
11303  }
11304  }
11305 
11306  if(HistoCode == "D_MSp_SpNb"){axis_y_var_name = "Sample mean";}
11307  if(HistoCode == "D_MSp_SpDs"){axis_y_var_name = "Number of samples";}
11308  if(HistoCode == "D_SSp_SpNb"){axis_y_var_name = "Sample sigma";}
11309  if(HistoCode == "D_SSp_SpDs"){axis_y_var_name = "Number of samples";}
11310  if(HistoCode == "D_Adc_EvNb"){axis_y_var_name = "Sample ADC value";}
11311  if(HistoCode == "D_Adc_EvDs"){axis_y_var_name = "Number of events";}
11312  if(HistoCode == "H_Ped_Date"){axis_y_var_name = "Pedestal";}
11313  if(HistoCode == "H_TNo_Date"){axis_y_var_name = "Total noise";}
11314  if(HistoCode == "H_MCs_Date"){axis_y_var_name = "Mean cor(s,s')";}
11315  if(HistoCode == "H_LFN_Date"){axis_y_var_name = "Low frequency noise";}
11316  if(HistoCode == "H_HFN_Date"){axis_y_var_name = "High frequency noise";}
11317  if(HistoCode == "H_SCs_Date"){axis_y_var_name = "Sigma cor(s,s')";}
11318 
11319  if(HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
11320  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
11321  {axis_y_var_name = "number of runs";}
11322 
11323  return axis_y_var_name;
11324 }
11325 //-------------------------------------------------------------------------------
11326 Axis_t TEcnaHistos::GetHistoXinf(const TString& HistoCode, const Int_t& HisSize, const TString& opt_plot)
11327 {
11328 // Set histo Xinf
11329 
11330  Axis_t xinf_his = (Axis_t)0;
11331 
11332  if(HistoCode == "D_NOE_ChNb"){xinf_his = (Axis_t)0.;}
11333  if(HistoCode == "D_Ped_ChNb"){xinf_his = (Axis_t)0.;}
11334  if(HistoCode == "D_TNo_ChNb"){xinf_his = (Axis_t)0.;}
11335  if(HistoCode == "D_MCs_ChNb"){xinf_his = (Axis_t)0.;}
11336  if(HistoCode == "D_LFN_ChNb"){xinf_his = (Axis_t)0.;}
11337  if(HistoCode == "D_HFN_ChNb"){xinf_his = (Axis_t)0.;}
11338  if(HistoCode == "D_SCs_ChNb"){xinf_his = (Axis_t)0.;}
11339  if(HistoCode == "D_MSp_SpNb"){xinf_his = (Axis_t)0.;}
11340  if(HistoCode == "D_SSp_SpNb"){xinf_his = (Axis_t)0.;}
11341  if(HistoCode == "D_Adc_EvNb"){xinf_his = (Axis_t)0.;}
11342 
11343  if(HistoCode == "D_NOE_ChDs"){xinf_his = (Axis_t)fD_NOE_ChNbYmin;} // D_XXX_YYDs = projection of D_XXX_YYNb
11344  if(HistoCode == "D_Ped_ChDs"){xinf_his = (Axis_t)fD_Ped_ChNbYmin;}
11345  if(HistoCode == "D_TNo_ChDs"){xinf_his = (Axis_t)fD_TNo_ChNbYmin;}
11346  if(HistoCode == "D_MCs_ChDs"){xinf_his = (Axis_t)fD_MCs_ChNbYmin;}
11347  if(HistoCode == "D_LFN_ChDs"){xinf_his = (Axis_t)fD_LFN_ChNbYmin;}
11348  if(HistoCode == "D_HFN_ChDs"){xinf_his = (Axis_t)fD_HFN_ChNbYmin;}
11349  if(HistoCode == "D_SCs_ChDs"){xinf_his = (Axis_t)fD_SCs_ChNbYmin;}
11350  if(HistoCode == "D_MSp_SpDs"){xinf_his = (Axis_t)fD_MSp_SpNbYmin;}
11351  if(HistoCode == "D_SSp_SpDs"){xinf_his = (Axis_t)fD_SSp_SpNbYmin;}
11352  if(HistoCode == "D_Adc_EvDs"){xinf_his = (Axis_t)fD_Adc_EvNbYmin;}
11353 
11354  if(HistoCode == "H_Ped_Date"){xinf_his = (Axis_t)0.;}
11355  if(HistoCode == "H_TNo_Date"){xinf_his = (Axis_t)0.;}
11356  if(HistoCode == "H_MCs_Date"){xinf_his = (Axis_t)0.;}
11357  if(HistoCode == "H_LFN_Date"){xinf_his = (Axis_t)0.;}
11358  if(HistoCode == "H_HFN_Date"){xinf_his = (Axis_t)0.;}
11359  if(HistoCode == "H_SCs_Date"){xinf_his = (Axis_t)0.;}
11360 
11361  if(HistoCode == "H_Ped_RuDs"){xinf_his = (Axis_t)fH_Ped_RuDsYmin;}
11362  if(HistoCode == "H_TNo_RuDs"){xinf_his = (Axis_t)fH_TNo_RuDsYmin;}
11363  if(HistoCode == "H_MCs_RuDs"){xinf_his = (Axis_t)fH_MCs_RuDsYmin;}
11364  if(HistoCode == "H_LFN_RuDs"){xinf_his = (Axis_t)fH_LFN_RuDsYmin;}
11365  if(HistoCode == "H_HFN_RuDs"){xinf_his = (Axis_t)fH_HFN_RuDsYmin;}
11366  if(HistoCode == "H_SCs_RuDs"){xinf_his = (Axis_t)fH_SCs_RuDsYmin;}
11367 
11368  return xinf_his;
11369 }
11370 
11371 Axis_t TEcnaHistos::GetHistoXsup(const TString& HistoCode, const Int_t& HisSize, const TString& opt_plot)
11372 {
11373 // Set histo Xsup
11374 
11375  Axis_t xsup_his = (Axis_t)0;
11376 
11377  if(HistoCode == "D_NOE_ChNb"){xsup_his = (Axis_t)HisSize;}
11378  if(HistoCode == "D_Ped_ChNb"){xsup_his = (Axis_t)HisSize;}
11379  if(HistoCode == "D_TNo_ChNb"){xsup_his = (Axis_t)HisSize;}
11380  if(HistoCode == "D_MCs_ChNb"){xsup_his = (Axis_t)HisSize;}
11381  if(HistoCode == "D_LFN_ChNb"){xsup_his = (Axis_t)HisSize;}
11382  if(HistoCode == "D_HFN_ChNb"){xsup_his = (Axis_t)HisSize;}
11383  if(HistoCode == "D_SCs_ChNb"){xsup_his = (Axis_t)HisSize;}
11384  if(HistoCode == "D_MSp_SpNb"){xsup_his = (Axis_t)HisSize;}
11385  if(HistoCode == "D_SSp_SpNb"){xsup_his = (Axis_t)HisSize;}
11386  if(HistoCode == "D_Adc_EvNb"){xsup_his = (Axis_t)(fFapReqNbOfEvts);}
11387 
11388  if(HistoCode == "D_NOE_ChDs"){xsup_his = (Axis_t)fD_NOE_ChNbYmax;}
11389  if(HistoCode == "D_Ped_ChDs"){xsup_his = (Axis_t)fD_Ped_ChNbYmax;}
11390  if(HistoCode == "D_TNo_ChDs"){xsup_his = (Axis_t)fD_TNo_ChNbYmax;}
11391  if(HistoCode == "D_MCs_ChDs"){xsup_his = (Axis_t)fD_MCs_ChNbYmax;}
11392  if(HistoCode == "D_LFN_ChDs"){xsup_his = (Axis_t)fD_LFN_ChNbYmax;}
11393  if(HistoCode == "D_HFN_ChDs"){xsup_his = (Axis_t)fD_HFN_ChNbYmax;}
11394  if(HistoCode == "D_SCs_ChDs"){xsup_his = (Axis_t)fD_SCs_ChNbYmax;}
11395  if(HistoCode == "D_MSp_SpDs"){xsup_his = (Axis_t)fD_MSp_SpNbYmax;}
11396  if(HistoCode == "D_SSp_SpDs"){xsup_his = (Axis_t)fD_SSp_SpNbYmax;}
11397  if(HistoCode == "D_Adc_EvDs"){xsup_his = (Axis_t)fD_Adc_EvNbYmax;}
11398 
11399  if(HistoCode == "H_Ped_Date"){xsup_his = (Axis_t)0.;}
11400  if(HistoCode == "H_TNo_Date"){xsup_his = (Axis_t)0.;}
11401  if(HistoCode == "H_MCs_Date"){xsup_his = (Axis_t)0.;}
11402  if(HistoCode == "H_LFN_Date"){xsup_his = (Axis_t)0.;}
11403  if(HistoCode == "H_HFN_Date"){xsup_his = (Axis_t)0.;}
11404  if(HistoCode == "H_SCs_Date"){xsup_his = (Axis_t)0.;}
11405 
11406  if(HistoCode == "H_Ped_RuDs"){xsup_his = (Axis_t)fH_Ped_RuDsYmax;}
11407  if(HistoCode == "H_TNo_RuDs"){xsup_his = (Axis_t)fH_TNo_RuDsYmax;}
11408  if(HistoCode == "H_MCs_RuDs"){xsup_his = (Axis_t)fH_MCs_RuDsYmax;}
11409  if(HistoCode == "H_LFN_RuDs"){xsup_his = (Axis_t)fH_LFN_RuDsYmax;}
11410  if(HistoCode == "H_HFN_RuDs"){xsup_his = (Axis_t)fH_HFN_RuDsYmax;}
11411  if(HistoCode == "H_SCs_RuDs"){xsup_his = (Axis_t)fH_SCs_RuDsYmax;}
11412 
11413  return xsup_his;
11414 }
11415 //-----------------------------------------------------------------------------------
11416 Int_t TEcnaHistos::GetHistoNumberOfBins(const TString& HistoCode, const Int_t& HisSize)
11417 {
11418 // Set histo number of bins
11419 
11420  Int_t nb_binx = HisSize;
11421  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
11422  if ( HistoType == "Proj" || HistoType == "SampProj" ||
11423  HistoType == "EvolProj" || HistoType == "H1BasicProj" )
11424  {nb_binx = fNbBinsProj;}
11425 
11426  return nb_binx;
11427 }
11428 //-----------------------------------------------------------------------------------
11429 void TEcnaHistos::FillHisto(TH1D* h_his0, const TVectorD& read_histo, const TString& HistoCode,
11430  const Int_t& HisSize)
11431 {
11432 // Fill histo
11433 
11434  h_his0->Reset();
11435 
11436  for(Int_t i=0; i<HisSize; i++)
11437  {
11438  Double_t his_val = (Double_t)0;
11439  Double_t xi = (Double_t)0;
11440  //................................................... Basic + Global
11441  if (HistoCode == "D_NOE_ChNb" || HistoCode == "D_Ped_ChNb" ||
11442  HistoCode == "D_LFN_ChNb" || HistoCode == "D_TNo_ChNb" ||
11443  HistoCode == "D_HFN_ChNb" || HistoCode == "D_MCs_ChNb" ||
11444  HistoCode == "D_SCs_ChNb" || HistoCode == "D_MSp_SpNb" || HistoCode == "D_SSp_SpNb" )
11445  {
11446  xi = (Double_t)i;
11447  his_val = (Double_t)read_histo[i];
11448  h_his0->Fill(xi, his_val);
11449  }
11450 
11451  //................................................... D_Adc_EvNb option
11452  if (HistoCode == "D_Adc_EvNb" )
11453  {
11454  xi = (Double_t)i;
11455  his_val = (Double_t)read_histo[i];
11456  h_his0->Fill(xi, his_val);
11457  }
11458  //................................................... Proj
11459  if (HistoCode == "D_NOE_ChDs" ||
11460  HistoCode == "D_Ped_ChDs" || HistoCode == "D_LFN_ChDs" ||
11461  HistoCode == "D_TNo_ChDs" || HistoCode == "D_HFN_ChDs" ||
11462  HistoCode == "D_MCs_ChDs" || HistoCode == "D_SCs_ChDs" ||
11463  HistoCode == "D_MSp_SpDs" || HistoCode == "D_SSp_SpDs" ||
11464  HistoCode == "D_Adc_EvDs" )
11465  {
11466  his_val = (Double_t)read_histo[i];
11467  Double_t increment = (Double_t)1;
11468  h_his0->Fill(his_val, increment);
11469  }
11470 
11471  //................................................... EvolProj
11472  //
11473  // *=======> direct Fill in ViewHistime(...)
11474  //
11475  }
11476 }
11477 
11478 //===========================================================================
11479 //
11480 // SetXinfMemoFromValue(...), SetXsupMemoFromValue(...)
11481 // GetXsupValueFromMemo(...), GetXsupValueFromMemo(...)
11482 //
11483 //===========================================================================
11484 void TEcnaHistos::SetXinfMemoFromValue(const TString& HistoCode, const Double_t& value)
11485 {
11486  if( HistoCode == "D_NOE_ChNb"){fD_NOE_ChNbXinf = value;}
11487  if( HistoCode == "D_NOE_ChDs"){fD_NOE_ChDsXinf = value;}
11488  if( HistoCode == "D_Ped_ChNb"){fD_Ped_ChNbXinf = value;}
11489  if( HistoCode == "D_Ped_ChDs"){fD_Ped_ChDsXinf = value;}
11490  if( HistoCode == "D_TNo_ChNb"){fD_TNo_ChNbXinf = value;}
11491  if( HistoCode == "D_TNo_ChDs"){fD_TNo_ChDsXinf = value;}
11492  if( HistoCode == "D_MCs_ChNb"){fD_MCs_ChNbXinf = value;}
11493  if( HistoCode == "D_MCs_ChDs"){fD_MCs_ChDsXinf = value;}
11494  if( HistoCode == "D_LFN_ChNb"){fD_LFN_ChNbXinf = value;}
11495  if( HistoCode == "D_LFN_ChDs"){fD_LFN_ChDsXinf = value;}
11496  if( HistoCode == "D_HFN_ChNb"){fD_HFN_ChNbXinf = value;}
11497  if( HistoCode == "D_HFN_ChDs"){fD_HFN_ChDsXinf = value;}
11498  if( HistoCode == "D_SCs_ChNb"){fD_SCs_ChNbXinf = value;}
11499  if( HistoCode == "D_SCs_ChDs"){fD_SCs_ChDsXinf = value;}
11500  if( HistoCode == "D_MSp_SpNb"){fD_Ped_ChNbXinf = value;}
11501  if( HistoCode == "D_MSp_SpDs"){fD_Ped_ChDsXinf = value;}
11502  if( HistoCode == "D_SSp_SpNb"){fD_TNo_ChNbXinf = value;}
11503  if( HistoCode == "D_SSp_SpDs"){fD_TNo_ChDsXinf = value;}
11504  if( HistoCode == "D_Adc_EvNb"){fD_Ped_ChNbXinf = value;}
11505  if( HistoCode == "D_Adc_EvDs"){fD_Adc_EvDsXinf = value;}
11506  if( HistoCode == "H_Ped_Date"){fH_Ped_DateXinf = value;}
11507  if( HistoCode == "H_TNo_Date"){fH_TNo_DateXinf = value;}
11508  if( HistoCode == "H_MCs_Date"){fH_MCs_DateXinf = value;}
11509  if( HistoCode == "H_LFN_Date"){fH_LFN_DateXinf = value;}
11510  if( HistoCode == "H_HFN_Date"){fH_HFN_DateXinf = value;}
11511  if( HistoCode == "H_SCs_Date"){fH_SCs_DateXinf = value;}
11512  if( HistoCode == "H_Ped_RuDs"){fH_Ped_RuDsXinf = value;}
11513  if( HistoCode == "H_TNo_RuDs"){fH_TNo_RuDsXinf = value;}
11514  if( HistoCode == "H_MCs_RuDs"){fH_MCs_RuDsXinf = value;}
11515  if( HistoCode == "H_LFN_RuDs"){fH_LFN_RuDsXinf = value;}
11516  if( HistoCode == "H_HFN_RuDs"){fH_HFN_RuDsXinf = value;}
11517  if( HistoCode == "H_SCs_RuDs"){fH_SCs_RuDsXinf = value;}
11518 }// end of SetXinfMemoFromValue(...)
11519 
11521 {fH1SameOnePlotXinf = value;}
11522 
11523 void TEcnaHistos::SetXsupMemoFromValue(const TString& HistoCode, const Double_t& value)
11524 {
11525  if( HistoCode == "D_NOE_ChNb"){fD_NOE_ChNbXsup = value;}
11526  if( HistoCode == "D_NOE_ChDs"){fD_NOE_ChDsXsup = value;}
11527  if( HistoCode == "D_Ped_ChNb"){fD_Ped_ChNbXsup = value;}
11528  if( HistoCode == "D_Ped_ChDs"){fD_Ped_ChDsXsup = value;}
11529  if( HistoCode == "D_TNo_ChNb"){fD_TNo_ChNbXsup = value;}
11530  if( HistoCode == "D_TNo_ChDs"){fD_TNo_ChDsXsup = value;}
11531  if( HistoCode == "D_MCs_ChNb"){fD_MCs_ChNbXsup = value;}
11532  if( HistoCode == "D_MCs_ChDs"){fD_MCs_ChDsXsup = value;}
11533  if( HistoCode == "D_LFN_ChNb"){fD_LFN_ChNbXsup = value;}
11534  if( HistoCode == "D_LFN_ChDs"){fD_LFN_ChDsXsup = value;}
11535  if( HistoCode == "D_HFN_ChNb"){fD_HFN_ChNbXsup = value;}
11536  if( HistoCode == "D_HFN_ChDs"){fD_HFN_ChDsXsup = value;}
11537  if( HistoCode == "D_SCs_ChNb"){fD_SCs_ChNbXsup = value;}
11538  if( HistoCode == "D_SCs_ChDs"){fD_SCs_ChDsXsup = value;}
11539  if( HistoCode == "D_MSp_SpNb"){fD_Ped_ChNbXsup = value;}
11540  if( HistoCode == "D_MSp_SpDs"){fD_Ped_ChDsXsup = value;}
11541  if( HistoCode == "D_SSp_SpNb"){fD_TNo_ChNbXsup = value;}
11542  if( HistoCode == "D_SSp_SpDs"){fD_TNo_ChDsXsup = value;}
11543  if( HistoCode == "D_Adc_EvNb"){fD_Ped_ChNbXsup = value;}
11544  if( HistoCode == "D_Adc_EvDs"){fD_Adc_EvDsXsup = value;}
11545  if( HistoCode == "H_Ped_Date"){fH_Ped_DateXsup = value;}
11546  if( HistoCode == "H_TNo_Date"){fH_TNo_DateXsup = value;}
11547  if( HistoCode == "H_MCs_Date"){fH_MCs_DateXsup = value;}
11548  if( HistoCode == "H_LFN_Date"){fH_LFN_DateXsup = value;}
11549  if( HistoCode == "H_HFN_Date"){fH_HFN_DateXsup = value;}
11550  if( HistoCode == "H_SCs_Date"){fH_SCs_DateXsup = value;}
11551  if( HistoCode == "H_Ped_RuDs"){fH_Ped_RuDsXsup = value;}
11552  if( HistoCode == "H_TNo_RuDs"){fH_TNo_RuDsXsup = value;}
11553  if( HistoCode == "H_MCs_RuDs"){fH_MCs_RuDsXsup = value;}
11554  if( HistoCode == "H_LFN_RuDs"){fH_LFN_RuDsXsup = value;}
11555  if( HistoCode == "H_HFN_RuDs"){fH_HFN_RuDsXsup = value;}
11556  if( HistoCode == "H_SCs_RuDs"){fH_SCs_RuDsXsup = value;}
11557 }// end of SetXsupMemoFromValue(...)
11558 
11560 {fH1SameOnePlotXsup = value;}
11561 
11562 Double_t TEcnaHistos::GetXinfValueFromMemo(const TString& HistoCode)
11563 {
11564  Double_t val_inf = (Double_t)0.;
11565 
11566  if( HistoCode == "D_NOE_ChNb"){val_inf = fD_NOE_ChNbXinf;}
11567  if( HistoCode == "D_NOE_ChDs"){val_inf = fD_NOE_ChDsXinf;}
11568  if( HistoCode == "D_Ped_ChNb"){val_inf = fD_Ped_ChNbXinf;}
11569  if( HistoCode == "D_Ped_ChDs"){val_inf = fD_Ped_ChDsXinf;}
11570  if( HistoCode == "D_TNo_ChNb"){val_inf = fD_TNo_ChNbXinf;}
11571  if( HistoCode == "D_TNo_ChDs"){val_inf = fD_TNo_ChDsXinf;}
11572  if( HistoCode == "D_MCs_ChNb"){val_inf = fD_MCs_ChNbXinf;}
11573  if( HistoCode == "D_MCs_ChDs"){val_inf = fD_MCs_ChDsXinf;}
11574  if( HistoCode == "D_LFN_ChNb"){val_inf = fD_LFN_ChNbXinf;}
11575  if( HistoCode == "D_LFN_ChDs"){val_inf = fD_LFN_ChDsXinf;}
11576  if( HistoCode == "D_HFN_ChNb"){val_inf = fD_HFN_ChNbXinf;}
11577  if( HistoCode == "D_HFN_ChDs"){val_inf = fD_HFN_ChDsXinf;}
11578  if( HistoCode == "D_SCs_ChNb"){val_inf = fD_SCs_ChNbXinf;}
11579  if( HistoCode == "D_SCs_ChDs"){val_inf = fD_SCs_ChDsXinf;}
11580  if( HistoCode == "D_MSp_SpNb"){val_inf = fD_Ped_ChNbXinf;}
11581  if( HistoCode == "D_MSp_SpDs"){val_inf = fD_Ped_ChDsXinf;}
11582  if( HistoCode == "D_SSp_SpNb"){val_inf = fD_TNo_ChNbXinf;}
11583  if( HistoCode == "D_SSp_SpDs"){val_inf = fD_TNo_ChDsXinf;}
11584  if( HistoCode == "D_Adc_EvNb"){val_inf = fD_Adc_EvNbXinf;}
11585  if( HistoCode == "D_Adc_EvDs"){val_inf = fD_Adc_EvDsXinf;}
11586  if( HistoCode == "H_Ped_Date"){val_inf = fH_Ped_DateXinf;}
11587  if( HistoCode == "H_TNo_Date"){val_inf = fH_TNo_DateXinf;}
11588  if( HistoCode == "H_MCs_Date"){val_inf = fH_MCs_DateXinf;}
11589  if( HistoCode == "H_LFN_Date"){val_inf = fH_LFN_DateXinf;}
11590  if( HistoCode == "H_HFN_Date"){val_inf = fH_HFN_DateXinf;}
11591  if( HistoCode == "H_SCs_Date"){val_inf = fH_SCs_DateXinf;}
11592  if( HistoCode == "H_Ped_RuDs"){val_inf = fH_Ped_RuDsXinf;}
11593  if( HistoCode == "H_TNo_RuDs"){val_inf = fH_TNo_RuDsXinf;}
11594  if( HistoCode == "H_MCs_RuDs"){val_inf = fH_MCs_RuDsXinf;}
11595  if( HistoCode == "H_LFN_RuDs"){val_inf = fH_LFN_RuDsXinf;}
11596  if( HistoCode == "H_HFN_RuDs"){val_inf = fH_HFN_RuDsXinf;}
11597  if( HistoCode == "H_SCs_RuDs"){val_inf = fH_SCs_RuDsXinf;}
11598  return val_inf;
11599 }// end of GetXinfValueFromMemo(...)
11600 
11602 {return fH1SameOnePlotXinf;}
11603 
11604 Double_t TEcnaHistos::GetXsupValueFromMemo(const TString& HistoCode)
11605 {
11606  Double_t val_sup = (Double_t)0.;
11607 
11608  if( HistoCode == "D_NOE_ChNb"){val_sup = fD_NOE_ChNbXsup;}
11609  if( HistoCode == "D_NOE_ChDs"){val_sup = fD_NOE_ChDsXsup;}
11610  if( HistoCode == "D_Ped_ChNb"){val_sup = fD_Ped_ChNbXsup;}
11611  if( HistoCode == "D_Ped_ChDs"){val_sup = fD_Ped_ChDsXsup;}
11612  if( HistoCode == "D_TNo_ChNb"){val_sup = fD_TNo_ChNbXsup;}
11613  if( HistoCode == "D_TNo_ChDs"){val_sup = fD_TNo_ChDsXsup;}
11614  if( HistoCode == "D_MCs_ChNb"){val_sup = fD_MCs_ChNbXsup;}
11615  if( HistoCode == "D_MCs_ChDs"){val_sup = fD_MCs_ChDsXsup;}
11616  if( HistoCode == "D_LFN_ChNb"){val_sup = fD_LFN_ChNbXsup;}
11617  if( HistoCode == "D_LFN_ChDs"){val_sup = fD_LFN_ChDsXsup;}
11618  if( HistoCode == "D_HFN_ChNb"){val_sup = fD_HFN_ChNbXsup;}
11619  if( HistoCode == "D_HFN_ChDs"){val_sup = fD_HFN_ChDsXsup;}
11620  if( HistoCode == "D_SCs_ChNb"){val_sup = fD_SCs_ChNbXsup;}
11621  if( HistoCode == "D_SCs_ChDs"){val_sup = fD_SCs_ChDsXsup;}
11622  if( HistoCode == "D_MSp_SpNb"){val_sup = fD_Ped_ChNbXsup;}
11623  if( HistoCode == "D_MSp_SpDs"){val_sup = fD_Ped_ChDsXsup;}
11624  if( HistoCode == "D_SSp_SpNb"){val_sup = fD_TNo_ChNbXsup;}
11625  if( HistoCode == "D_SSp_SpDs"){val_sup = fD_TNo_ChDsXsup;}
11626  if( HistoCode == "D_Adc_EvNb"){val_sup = fD_Adc_EvNbXsup;}
11627  if( HistoCode == "D_Adc_EvDs"){val_sup = fD_Adc_EvDsXsup;}
11628  if( HistoCode == "H_Ped_Date"){val_sup = fH_Ped_DateXsup;}
11629  if( HistoCode == "H_TNo_Date"){val_sup = fH_TNo_DateXsup;}
11630  if( HistoCode == "H_MCs_Date"){val_sup = fH_MCs_DateXsup;}
11631  if( HistoCode == "H_LFN_Date"){val_sup = fH_LFN_DateXsup;}
11632  if( HistoCode == "H_HFN_Date"){val_sup = fH_HFN_DateXsup;}
11633  if( HistoCode == "H_SCs_Date"){val_sup = fH_SCs_DateXsup;}
11634  if( HistoCode == "H_Ped_RuDs"){val_sup = fH_Ped_RuDsXsup;}
11635  if( HistoCode == "H_TNo_RuDs"){val_sup = fH_TNo_RuDsXsup;}
11636  if( HistoCode == "H_MCs_RuDs"){val_sup = fH_MCs_RuDsXsup;}
11637  if( HistoCode == "H_LFN_RuDs"){val_sup = fH_LFN_RuDsXsup;}
11638  if( HistoCode == "H_HFN_RuDs"){val_sup = fH_HFN_RuDsXsup;}
11639  if( HistoCode == "H_SCs_RuDs"){val_sup = fH_SCs_RuDsXsup;}
11640  return val_sup;
11641 }// end of GetXsupValueFromMemo(...)
11642 
11644 {return fH1SameOnePlotXsup;}
11645 
11646 //-------------------------------------------------------------------------------------------
11647 //
11648 // SetHistoMin, SetHistoMax, SetAllYminYmaxMemoFromDefaultValues
11649 //
11650 //-------------------------------------------------------------------------------------------
11651 void TEcnaHistos::SetHistoMin(const Double_t& value){fUserHistoMin = value; fFlagUserHistoMin = "ON";}
11652 void TEcnaHistos::SetHistoMax(const Double_t& value){fUserHistoMax = value; fFlagUserHistoMax = "ON";}
11653 
11654 void TEcnaHistos::SetHistoMin(){fFlagUserHistoMin = "AUTO";}
11655 void TEcnaHistos::SetHistoMax(){fFlagUserHistoMax = "AUTO";}
11656 
11658 {
11659 //.......... Default values for histo min and max
11660 
11661  SetYminMemoFromValue("D_NOE_ChNb", fCnaParHistos->GetYminDefaultValue("D_NOE_ChNb"));
11662  SetYmaxMemoFromValue("D_NOE_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_NOE_ChNb"));
11663 
11664  SetYminMemoFromValue("D_NOE_ChDs", fCnaParHistos->GetYminDefaultValue("D_NOE_ChDs"));
11665  SetYmaxMemoFromValue("D_NOE_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_NOE_ChDs"));
11666 
11667  SetYminMemoFromValue("D_Ped_ChNb", fCnaParHistos->GetYminDefaultValue("D_Ped_ChNb"));
11668  SetYmaxMemoFromValue("D_Ped_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_Ped_ChNb"));
11669 
11670  SetYminMemoFromValue("D_Ped_ChDs", fCnaParHistos->GetYminDefaultValue("D_Ped_ChDs"));
11671  SetYmaxMemoFromValue("D_Ped_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_Ped_ChDs"));
11672 
11673  SetYminMemoFromValue("D_TNo_ChNb", fCnaParHistos->GetYminDefaultValue("D_TNo_ChNb"));
11674  SetYmaxMemoFromValue("D_TNo_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_TNo_ChNb"));
11675 
11676  SetYminMemoFromValue("D_TNo_ChDs", fCnaParHistos->GetYminDefaultValue("D_TNo_ChDs"));
11677  SetYmaxMemoFromValue("D_TNo_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_TNo_ChDs"));
11678 
11679  SetYminMemoFromValue("D_MCs_ChNb", fCnaParHistos->GetYminDefaultValue("D_MCs_ChNb"));
11680  SetYmaxMemoFromValue("D_MCs_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_MCs_ChNb"));
11681 
11682  SetYminMemoFromValue("D_MCs_ChDs", fCnaParHistos->GetYminDefaultValue("D_MCs_ChDs"));
11683  SetYmaxMemoFromValue("D_MCs_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_MCs_ChDs"));
11684 
11685  SetYminMemoFromValue("D_LFN_ChNb", fCnaParHistos->GetYminDefaultValue("D_LFN_ChNb"));
11686  SetYmaxMemoFromValue("D_LFN_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_LFN_ChNb"));
11687 
11688  SetYminMemoFromValue("D_LFN_ChDs", fCnaParHistos->GetYminDefaultValue("D_LFN_ChDs"));
11689  SetYmaxMemoFromValue("D_LFN_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_LFN_ChDs"));
11690 
11691  SetYminMemoFromValue("D_HFN_ChNb", fCnaParHistos->GetYminDefaultValue("D_HFN_ChNb"));
11692  SetYmaxMemoFromValue("D_HFN_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_HFN_ChNb"));
11693 
11694  SetYminMemoFromValue("D_HFN_ChDs", fCnaParHistos->GetYminDefaultValue("D_HFN_ChDs"));
11695  SetYmaxMemoFromValue("D_HFN_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_HFN_ChDs"));
11696 
11697  SetYminMemoFromValue("D_SCs_ChNb", fCnaParHistos->GetYminDefaultValue("D_SCs_ChNb"));
11698  SetYmaxMemoFromValue("D_SCs_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_SCs_ChNb"));
11699 
11700  SetYminMemoFromValue("D_SCs_ChDs", fCnaParHistos->GetYminDefaultValue("D_SCs_ChDs"));
11701  SetYmaxMemoFromValue("D_SCs_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_SCs_ChDs"));
11702 
11703  SetYminMemoFromValue("D_MSp_SpNb", fCnaParHistos->GetYminDefaultValue("D_MSp_SpNb"));
11704  SetYmaxMemoFromValue("D_MSp_SpNb", fCnaParHistos->GetYmaxDefaultValue("D_MSp_SpNb"));
11705 
11706  SetYminMemoFromValue("D_MSp_SpDs", fCnaParHistos->GetYminDefaultValue("D_MSp_SpDs"));
11707  SetYmaxMemoFromValue("D_MSp_SpDs", fCnaParHistos->GetYmaxDefaultValue("D_MSp_SpDs"));
11708 
11709  SetYminMemoFromValue("D_SSp_SpNb", fCnaParHistos->GetYminDefaultValue("D_SSp_SpNb"));
11710  SetYmaxMemoFromValue("D_SSp_SpNb", fCnaParHistos->GetYmaxDefaultValue("D_SSp_SpNb"));
11711 
11712  SetYminMemoFromValue("D_SSp_SpDs", fCnaParHistos->GetYminDefaultValue("D_SSp_SpDs"));
11713  SetYmaxMemoFromValue("D_SSp_SpDs", fCnaParHistos->GetYmaxDefaultValue("D_SSp_SpDs"));
11714 
11715  SetYminMemoFromValue("D_Adc_EvDs", fCnaParHistos->GetYminDefaultValue("D_Adc_EvDs"));
11716  SetYmaxMemoFromValue("D_Adc_EvDs", fCnaParHistos->GetYmaxDefaultValue("D_Adc_EvDs"));
11717 
11718  SetYminMemoFromValue("D_Adc_EvNb", fCnaParHistos->GetYminDefaultValue("D_Adc_EvNb"));
11719  SetYmaxMemoFromValue("D_Adc_EvNb", fCnaParHistos->GetYmaxDefaultValue("D_Adc_EvNb"));
11720 
11721  SetYminMemoFromValue("H_Ped_Date", fCnaParHistos->GetYminDefaultValue("H_Ped_Date"));
11722  SetYmaxMemoFromValue("H_Ped_Date", fCnaParHistos->GetYmaxDefaultValue("H_Ped_Date"));
11723 
11724  SetYminMemoFromValue("H_TNo_Date", fCnaParHistos->GetYminDefaultValue("H_TNo_Date"));
11725  SetYmaxMemoFromValue("H_TNo_Date", fCnaParHistos->GetYmaxDefaultValue("H_TNo_Date"));
11726 
11727  SetYminMemoFromValue("H_LFN_Date", fCnaParHistos->GetYminDefaultValue("H_LFN_Date"));
11728  SetYmaxMemoFromValue("H_LFN_Date", fCnaParHistos->GetYmaxDefaultValue("H_LFN_Date"));
11729 
11730  SetYminMemoFromValue("H_HFN_Date", fCnaParHistos->GetYminDefaultValue("H_HFN_Date"));
11731  SetYmaxMemoFromValue("H_HFN_Date", fCnaParHistos->GetYmaxDefaultValue("H_HFN_Date"));
11732 
11733  SetYminMemoFromValue("H_MCs_Date", fCnaParHistos->GetYminDefaultValue("H_MCs_Date"));
11734  SetYmaxMemoFromValue("H_MCs_Date", fCnaParHistos->GetYmaxDefaultValue("H_MCs_Date"));
11735 
11736  SetYminMemoFromValue("H_SCs_Date", fCnaParHistos->GetYminDefaultValue("H_SCs_Date"));
11737  SetYmaxMemoFromValue("H_SCs_Date", fCnaParHistos->GetYmaxDefaultValue("H_SCs_Date"));
11738 
11739  SetYminMemoFromValue("H_Ped_RuDs", fCnaParHistos->GetYminDefaultValue("H_Ped_RuDs"));
11740  SetYmaxMemoFromValue("H_Ped_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_Ped_RuDs"));
11741 
11742  SetYminMemoFromValue("H_TNo_RuDs", fCnaParHistos->GetYminDefaultValue("H_TNo_RuDs"));
11743  SetYmaxMemoFromValue("H_TNo_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_TNo_RuDs"));
11744 
11745  SetYminMemoFromValue("H_LFN_RuDs", fCnaParHistos->GetYminDefaultValue("H_LFN_RuDs"));
11746  SetYmaxMemoFromValue("H_LFN_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_LFN_RuDs"));
11747 
11748  SetYminMemoFromValue("H_HFN_RuDs", fCnaParHistos->GetYminDefaultValue("H_HFN_RuDs"));
11749  SetYmaxMemoFromValue("H_HFN_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_HFN_RuDs"));
11750 
11751  SetYminMemoFromValue("H_MCs_RuDs", fCnaParHistos->GetYminDefaultValue("H_MCs_RuDs"));
11752  SetYmaxMemoFromValue("H_MCs_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_MCs_RuDs"));
11753 
11754  SetYminMemoFromValue("H_SCs_RuDs", fCnaParHistos->GetYminDefaultValue("H_SCs_RuDs"));
11755  SetYmaxMemoFromValue("H_SCs_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_SCs_RuDs"));
11756 
11757  SetYminMemoFromValue("H2LFccMosMatrix", fCnaParHistos->GetYminDefaultValue("H2LFccMosMatrix"));
11758  SetYmaxMemoFromValue("H2LFccMosMatrix", fCnaParHistos->GetYmaxDefaultValue("H2LFccMosMatrix"));
11759 
11760  SetYminMemoFromValue("H2HFccMosMatrix", fCnaParHistos->GetYminDefaultValue("H2HFccMosMatrix"));
11761  SetYmaxMemoFromValue("H2HFccMosMatrix", fCnaParHistos->GetYmaxDefaultValue("H2HFccMosMatrix"));
11762 
11763  SetYminMemoFromValue("H2CorccInStins", fCnaParHistos->GetYminDefaultValue("H2CorccInStins"));
11764  SetYmaxMemoFromValue("H2CorccInStins", fCnaParHistos->GetYmaxDefaultValue("H2CorccInStins"));
11765 
11766  //........... set user's min and max flags to "OFF" and values to -1 and +1 (just to have fUserHistoMin < fUserHistoMax)
11767  fUserHistoMin = -1.; fFlagUserHistoMin = "OFF";
11768  fUserHistoMax = 1.; fFlagUserHistoMax = "OFF";
11769 } // end of SetAllYminYmaxMemoFromDefaultValues()
11770 
11771 //===========================================================================
11772 //
11773 // SetYminMemoFromValue(...), SetYmaxMemoFromValue(...)
11774 // GetYminValueFromMemo(...), GetYmaxValueFromMemo(...)
11775 //
11776 //===========================================================================
11777 void TEcnaHistos::SetYminMemoFromValue(const TString& HistoCode, const Double_t& value)
11778 {
11779  if( HistoCode == "D_NOE_ChNb" ){fD_NOE_ChNbYmin = value;}
11780  if( HistoCode == "D_NOE_ChDs" ){fD_NOE_ChDsYmin = value;}
11781  if( HistoCode == "D_Ped_ChNb" ){fD_Ped_ChNbYmin = value;}
11782  if( HistoCode == "D_Ped_ChDs" ){fD_Ped_ChDsYmin = value;}
11783  if( HistoCode == "D_TNo_ChNb" ){fD_TNo_ChNbYmin = value;}
11784  if( HistoCode == "D_TNo_ChDs" ){fD_TNo_ChDsYmin = value;}
11785  if( HistoCode == "D_MCs_ChNb" ){fD_MCs_ChNbYmin = value;}
11786  if( HistoCode == "D_MCs_ChDs" ){fD_MCs_ChDsYmin = value;}
11787  if( HistoCode == "D_LFN_ChNb" ){fD_LFN_ChNbYmin = value;}
11788  if( HistoCode == "D_LFN_ChDs" ){fD_LFN_ChDsYmin = value;}
11789  if( HistoCode == "D_HFN_ChNb" ){fD_HFN_ChNbYmin = value;}
11790  if( HistoCode == "D_HFN_ChDs" ){fD_HFN_ChDsYmin = value;}
11791  if( HistoCode == "D_SCs_ChNb" ){fD_SCs_ChNbYmin = value;}
11792  if( HistoCode == "D_SCs_ChDs" ){fD_SCs_ChDsYmin = value;}
11793  if( HistoCode == "D_MSp_SpNb" ){fD_Ped_ChNbYmin = value;}
11794  if( HistoCode == "D_MSp_SpDs" ){fD_Ped_ChDsYmin = value;}
11795  if( HistoCode == "D_SSp_SpNb" ){fD_TNo_ChNbYmin = value;}
11796  if( HistoCode == "D_SSp_SpDs" ){fD_TNo_ChDsYmin = value;}
11797  if( HistoCode == "D_Adc_EvNb" ){fD_Ped_ChNbYmin = value;}
11798  if( HistoCode == "D_Adc_EvDs" ){fD_Adc_EvDsYmin = value;}
11799  if( HistoCode == "H_Ped_Date" ){fH_Ped_DateYmin = value;}
11800  if( HistoCode == "H_TNo_Date" ){fH_TNo_DateYmin = value;}
11801  if( HistoCode == "H_MCs_Date" ){fH_MCs_DateYmin = value;}
11802  if( HistoCode == "H_LFN_Date" ){fH_LFN_DateYmin = value;}
11803  if( HistoCode == "H_HFN_Date" ){fH_HFN_DateYmin = value;}
11804  if( HistoCode == "H_SCs_Date" ){fH_SCs_DateYmin = value;}
11805  if( HistoCode == "H_Ped_RuDs" ){fH_Ped_RuDsYmin = value;}
11806  if( HistoCode == "H_TNo_RuDs" ){fH_TNo_RuDsYmin = value;}
11807  if( HistoCode == "H_MCs_RuDs" ){fH_MCs_RuDsYmin = value;}
11808  if( HistoCode == "H_LFN_RuDs" ){fH_LFN_RuDsYmin = value;}
11809  if( HistoCode == "H_HFN_RuDs" ){fH_HFN_RuDsYmin = value;}
11810  if( HistoCode == "H_SCs_RuDs" ){fH_SCs_RuDsYmin = value;}
11811  if( HistoCode == "H2LFccMosMatrix" ){fH2LFccMosMatrixYmin = value;}
11812  if( HistoCode == "H2HFccMosMatrix" ){fH2HFccMosMatrixYmin = value;}
11813  if( HistoCode == "H2CorccInStins" ){fH2CorccInStinsYmin = value;}
11814 }// end of SetYminMemoFromValue(...)
11815 
11816 void TEcnaHistos::SetYmaxMemoFromValue(const TString& HistoCode, const Double_t& value)
11817 {
11818  if( HistoCode == "D_NOE_ChNb" ){fD_NOE_ChNbYmax = value;}
11819  if( HistoCode == "D_NOE_ChDs" ){fD_NOE_ChDsYmax = value;}
11820  if( HistoCode == "D_Ped_ChNb" ){fD_Ped_ChNbYmax = value;}
11821  if( HistoCode == "D_Ped_ChDs" ){fD_Ped_ChDsYmax = value;}
11822  if( HistoCode == "D_TNo_ChNb" ){fD_TNo_ChNbYmax = value;}
11823  if( HistoCode == "D_TNo_ChDs" ){fD_TNo_ChDsYmax = value;}
11824  if( HistoCode == "D_MCs_ChNb" ){fD_MCs_ChNbYmax = value;}
11825  if( HistoCode == "D_MCs_ChDs" ){fD_MCs_ChDsYmax = value;}
11826  if( HistoCode == "D_LFN_ChNb" ){fD_LFN_ChNbYmax = value;}
11827  if( HistoCode == "D_LFN_ChDs" ){fD_LFN_ChDsYmax = value;}
11828  if( HistoCode == "D_HFN_ChNb" ){fD_HFN_ChNbYmax = value;}
11829  if( HistoCode == "D_HFN_ChDs" ){fD_HFN_ChDsYmax = value;}
11830  if( HistoCode == "D_SCs_ChNb" ){fD_SCs_ChNbYmax = value;}
11831  if( HistoCode == "D_SCs_ChDs" ){fD_SCs_ChDsYmax = value;}
11832  if( HistoCode == "D_MSp_SpNb" ){fD_Ped_ChNbYmax = value;}
11833  if( HistoCode == "D_MSp_SpDs" ){fD_Ped_ChDsYmax = value;}
11834  if( HistoCode == "D_SSp_SpNb" ){fD_TNo_ChNbYmax = value;}
11835  if( HistoCode == "D_SSp_SpDs" ){fD_TNo_ChDsYmax = value;}
11836  if( HistoCode == "D_Adc_EvNb" ){fD_Ped_ChNbYmax = value;}
11837  if( HistoCode == "D_Adc_EvDs" ){fD_Ped_ChDsYmax = value;}
11838  if( HistoCode == "H_Ped_Date" ){fH_Ped_DateYmax = value;}
11839  if( HistoCode == "H_TNo_Date" ){fH_TNo_DateYmax = value;}
11840  if( HistoCode == "H_MCs_Date" ){fH_MCs_DateYmax = value;}
11841  if( HistoCode == "H_LFN_Date" ){fH_LFN_DateYmax = value;}
11842  if( HistoCode == "H_HFN_Date" ){fH_HFN_DateYmax = value;}
11843  if( HistoCode == "H_SCs_Date" ){fH_SCs_DateYmax = value;}
11844  if( HistoCode == "H_Ped_RuDs" ){fH_Ped_RuDsYmax = value;}
11845  if( HistoCode == "H_TNo_RuDs" ){fH_TNo_RuDsYmax = value;}
11846  if( HistoCode == "H_MCs_RuDs" ){fH_MCs_RuDsYmax = value;}
11847  if( HistoCode == "H_LFN_RuDs" ){fH_LFN_RuDsYmax = value;}
11848  if( HistoCode == "H_HFN_RuDs" ){fH_HFN_RuDsYmax = value;}
11849  if( HistoCode == "H_SCs_RuDs" ){fH_SCs_RuDsYmax = value;}
11850  if( HistoCode == "H2LFccMosMatrix" ){fH2LFccMosMatrixYmax = value;}
11851  if( HistoCode == "H2HFccMosMatrix" ){fH2HFccMosMatrixYmax = value;}
11852  if( HistoCode == "H2CorccInStins" ){fH2CorccInStinsYmax = value;}
11853 }// end of SetYmaxMemoFromValue(...)
11854 
11855 Double_t TEcnaHistos::GetYminValueFromMemo(const TString& HistoCode)
11856 {
11857  Double_t val_min = (Double_t)0.;
11858  Double_t val_min_proj = (Double_t)0.1;
11859 
11860  if( HistoCode == "D_NOE_ChNb" ){val_min = fD_NOE_ChNbYmin;}
11861  if( HistoCode == "D_NOE_ChDs" ){val_min = val_min_proj;}
11862  if( HistoCode == "D_Ped_ChNb" ){val_min = fD_Ped_ChNbYmin;}
11863  if( HistoCode == "D_Ped_ChDs" ){val_min = val_min_proj;}
11864  if( HistoCode == "D_TNo_ChNb" ){val_min = fD_TNo_ChNbYmin;}
11865  if( HistoCode == "D_TNo_ChDs" ){val_min = val_min_proj;}
11866  if( HistoCode == "D_MCs_ChNb" ){val_min = fD_MCs_ChNbYmin;}
11867  if( HistoCode == "D_MCs_ChDs" ){val_min = val_min_proj;}
11868  if( HistoCode == "D_LFN_ChNb" ){val_min = fD_LFN_ChNbYmin;}
11869  if( HistoCode == "D_LFN_ChDs" ){val_min = val_min_proj;}
11870  if( HistoCode == "D_HFN_ChNb" ){val_min = fD_HFN_ChNbYmin;}
11871  if( HistoCode == "D_HFN_ChDs" ){val_min = val_min_proj;}
11872  if( HistoCode == "D_SCs_ChNb" ){val_min = fD_SCs_ChNbYmin;}
11873  if( HistoCode == "D_SCs_ChDs" ){val_min = val_min_proj;}
11874  if( HistoCode == "D_MSp_SpNb" ){val_min = fD_Ped_ChNbYmin;}
11875  if( HistoCode == "D_MSp_SpDs" ){val_min = val_min_proj;}
11876  if( HistoCode == "D_SSp_SpNb" ){val_min = fD_TNo_ChNbYmin;}
11877  if( HistoCode == "D_SSp_SpDs" ){val_min = val_min_proj;}
11878  if( HistoCode == "D_Adc_EvNb" ){val_min = fD_Ped_ChNbYmin;}
11879  if( HistoCode == "D_Adc_EvDs" ){val_min = val_min_proj;}
11880  if( HistoCode == "H_Ped_Date" ){val_min = fH_Ped_DateYmin;}
11881  if( HistoCode == "H_TNo_Date" ){val_min = fH_TNo_DateYmin;}
11882  if( HistoCode == "H_MCs_Date" ){val_min = fH_MCs_DateYmin;}
11883  if( HistoCode == "H_LFN_Date" ){val_min = fH_LFN_DateYmin;}
11884  if( HistoCode == "H_HFN_Date" ){val_min = fH_HFN_DateYmin;}
11885  if( HistoCode == "H_SCs_Date" ){val_min = fH_SCs_DateYmin;}
11886  if( HistoCode == "H_Ped_RuDs" ){val_min = fH_Ped_RuDsYmin;}
11887  if( HistoCode == "H_TNo_RuDs" ){val_min = fH_TNo_RuDsYmin;}
11888  if( HistoCode == "H_MCs_RuDs" ){val_min = fH_MCs_RuDsYmin;}
11889  if( HistoCode == "H_LFN_RuDs" ){val_min = fH_LFN_RuDsYmin;}
11890  if( HistoCode == "H_HFN_RuDs" ){val_min = fH_HFN_RuDsYmin;}
11891  if( HistoCode == "H_SCs_RuDs" ){val_min = fH_SCs_RuDsYmin;}
11892  if( HistoCode == "H2LFccMosMatrix" ){val_min = fH2LFccMosMatrixYmin;}
11893  if( HistoCode == "H2HFccMosMatrix" ){val_min = fH2HFccMosMatrixYmin;}
11894  if( HistoCode == "H2CorccInStins" ){val_min = fH2CorccInStinsYmin;}
11895  return val_min;
11896 }// end of GetYminValueFromMemo(...)
11897 
11898 Double_t TEcnaHistos::GetYmaxValueFromMemo(const TString& HistoCode)
11899 {
11900  Double_t val_max = (Double_t)0.;
11901  Double_t val_max_proj = (Double_t)2000.;
11902 
11903  if( HistoCode == "D_NOE_ChNb" ){val_max = fD_NOE_ChNbYmax;}
11904  if( HistoCode == "D_NOE_ChDs" ){val_max = val_max_proj;}
11905  if( HistoCode == "D_Ped_ChNb" ){val_max = fD_Ped_ChNbYmax;}
11906  if( HistoCode == "D_Ped_ChDs" ){val_max = val_max_proj;}
11907  if( HistoCode == "D_TNo_ChNb" ){val_max = fD_TNo_ChNbYmax;}
11908  if( HistoCode == "D_TNo_ChDs" ){val_max = val_max_proj;}
11909  if( HistoCode == "D_MCs_ChNb" ){val_max = fD_MCs_ChNbYmax;}
11910  if( HistoCode == "D_MCs_ChDs" ){val_max = val_max_proj;}
11911  if( HistoCode == "D_LFN_ChNb" ){val_max = fD_LFN_ChNbYmax;}
11912  if( HistoCode == "D_LFN_ChDs" ){val_max = val_max_proj;}
11913  if( HistoCode == "D_HFN_ChNb" ){val_max = fD_HFN_ChNbYmax;}
11914  if( HistoCode == "D_HFN_ChDs" ){val_max = val_max_proj;}
11915  if( HistoCode == "D_SCs_ChNb" ){val_max = fD_SCs_ChNbYmax;}
11916  if( HistoCode == "D_SCs_ChDs" ){val_max = val_max_proj;}
11917  if( HistoCode == "D_MSp_SpNb" ){val_max = fD_Ped_ChNbYmax;}
11918  if( HistoCode == "D_MSp_SpDs" ){val_max = val_max_proj;}
11919  if( HistoCode == "D_SSp_SpNb" ){val_max = fD_TNo_ChNbYmax;}
11920  if( HistoCode == "D_SSp_SpDs" ){val_max = val_max_proj;}
11921  if( HistoCode == "D_Adc_EvNb" ){val_max = fD_Ped_ChNbYmax;}
11922  if( HistoCode == "D_Adc_EvDs" ){val_max = val_max_proj;}
11923  if( HistoCode == "H_Ped_Date" ){val_max = fH_Ped_DateYmax;}
11924  if( HistoCode == "H_TNo_Date" ){val_max = fH_TNo_DateYmax;}
11925  if( HistoCode == "H_MCs_Date" ){val_max = fH_MCs_DateYmax;}
11926  if( HistoCode == "H_LFN_Date" ){val_max = fH_LFN_DateYmax;}
11927  if( HistoCode == "H_HFN_Date" ){val_max = fH_HFN_DateYmax;}
11928  if( HistoCode == "H_SCs_Date" ){val_max = fH_SCs_DateYmax;}
11929  if( HistoCode == "H_Ped_RuDs" ){val_max = fH_Ped_RuDsYmax;}
11930  if( HistoCode == "H_TNo_RuDs" ){val_max = fH_TNo_RuDsYmax;}
11931  if( HistoCode == "H_MCs_RuDs" ){val_max = fH_MCs_RuDsYmax;}
11932  if( HistoCode == "H_LFN_RuDs" ){val_max = fH_LFN_RuDsYmax;}
11933  if( HistoCode == "H_HFN_RuDs" ){val_max = fH_HFN_RuDsYmax;}
11934  if( HistoCode == "H_SCs_RuDs" ){val_max = fH_SCs_RuDsYmax;}
11935  if( HistoCode == "H2LFccMosMatrix" ){val_max = fH2LFccMosMatrixYmax;}
11936  if( HistoCode == "H2HFccMosMatrix" ){val_max = fH2HFccMosMatrixYmax;}
11937  if( HistoCode == "H2CorccInStins" ){val_max = fH2CorccInStinsYmax;}
11938  return val_max;
11939 }// end of GetYmaxValueFromMemo(...)
11940 
11941 void TEcnaHistos::SetYminMemoFromPreviousMemo(const TString& HistoCode)
11942 {
11943 // InitQuantity Ymin
11944 
11945  if( HistoCode == "D_NOE_ChNb" ){fD_NOE_ChNbYmin = GetYminValueFromMemo("D_NOE_ChNb");}
11946  if( HistoCode == "D_NOE_ChDs" ){fD_NOE_ChDsYmin = GetYminValueFromMemo("D_NOE_ChDs");}
11947  if( HistoCode == "D_Ped_ChNb" ){fD_Ped_ChNbYmin = GetYminValueFromMemo("D_Ped_ChNb");}
11948  if( HistoCode == "D_Ped_ChDs" ){fD_Ped_ChDsYmin = GetYminValueFromMemo("D_Ped_ChDs");}
11949  if( HistoCode == "D_TNo_ChNb" ){fD_TNo_ChNbYmin = GetYminValueFromMemo("D_TNo_ChNb");}
11950  if( HistoCode == "D_TNo_ChDs" ){fD_TNo_ChDsYmin = GetYminValueFromMemo("D_TNo_ChDs");}
11951  if( HistoCode == "D_MCs_ChNb" ){fD_MCs_ChNbYmin = GetYminValueFromMemo("D_MCs_ChNb");}
11952  if( HistoCode == "D_MCs_ChDs" ){fD_MCs_ChDsYmin = GetYminValueFromMemo("D_MCs_ChDs");}
11953  if( HistoCode == "D_LFN_ChNb" ){fD_LFN_ChNbYmin = GetYminValueFromMemo("D_LFN_ChNb");}
11954  if( HistoCode == "D_LFN_ChDs" ){fD_LFN_ChDsYmin = GetYminValueFromMemo("D_LFN_ChDs");}
11955  if( HistoCode == "D_HFN_ChNb" ){fD_HFN_ChNbYmin = GetYminValueFromMemo("D_HFN_ChNb");}
11956  if( HistoCode == "D_HFN_ChDs" ){fD_HFN_ChDsYmin = GetYminValueFromMemo("D_HFN_ChDs");}
11957  if( HistoCode == "D_SCs_ChNb" ){fD_SCs_ChNbYmin = GetYminValueFromMemo("D_SCs_ChNb");}
11958  if( HistoCode == "D_SCs_ChDs" ){fD_SCs_ChDsYmin = GetYminValueFromMemo("D_SCs_ChDs");}
11959  if( HistoCode == "D_MSp_SpNb" ){fD_MSp_SpNbYmin = GetYminValueFromMemo("D_MSp_SpNb");}
11960  if( HistoCode == "D_MSp_SpDs" ){fD_MSp_SpDsYmin = GetYminValueFromMemo("D_MSp_SpDs");}
11961  if( HistoCode == "D_SSp_SpNb" ){fD_SSp_SpNbYmin = GetYminValueFromMemo("D_SSp_SpNb");}
11962  if( HistoCode == "D_SSp_SpDs" ){fD_SSp_SpDsYmin = GetYminValueFromMemo("D_SSp_SpDs");}
11963  if( HistoCode == "D_Adc_EvNb" ){fD_Adc_EvNbYmin = GetYminValueFromMemo("D_Adc_EvNb");}
11964  if( HistoCode == "D_Adc_EvDs" ){fD_Adc_EvDsYmin = GetYminValueFromMemo("D_Adc_EvDs");}
11965  if( HistoCode == "H_Ped_Date" ){fH_Ped_DateYmin = GetYminValueFromMemo("H_Ped_Date");}
11966  if( HistoCode == "H_TNo_Date" ){fH_TNo_DateYmin = GetYminValueFromMemo("H_TNo_Date");}
11967  if( HistoCode == "H_MCs_Date" ){fH_MCs_DateYmin = GetYminValueFromMemo("H_MCs_Date");}
11968  if( HistoCode == "H_LFN_Date" ){fH_LFN_DateYmin = GetYminValueFromMemo("H_LFN_Date");}
11969  if( HistoCode == "H_HFN_Date" ){fH_HFN_DateYmin = GetYminValueFromMemo("H_HFN_Date");}
11970  if( HistoCode == "H_SCs_Date" ){fH_SCs_DateYmin = GetYminValueFromMemo("H_SCs_Date");}
11971  if( HistoCode == "H_Ped_RuDs" ){fH_Ped_RuDsYmin = GetYminValueFromMemo("H_Ped_RuDs");}
11972  if( HistoCode == "H_TNo_RuDs" ){fH_TNo_RuDsYmin = GetYminValueFromMemo("H_TNo_RuDs");}
11973  if( HistoCode == "H_MCs_RuDs" ){fH_MCs_RuDsYmin = GetYminValueFromMemo("H_MCs_RuDs");}
11974  if( HistoCode == "H_LFN_RuDs" ){fH_LFN_RuDsYmin = GetYminValueFromMemo("H_LFN_RuDs");}
11975  if( HistoCode == "H_HFN_RuDs" ){fH_HFN_RuDsYmin = GetYminValueFromMemo("H_HFN_RuDs");}
11976  if( HistoCode == "H_SCs_RuDs" ){fH_SCs_RuDsYmin = GetYminValueFromMemo("H_SCs_RuDs");}
11977  if( HistoCode == "H2LFccMosMatrix" ){fH2LFccMosMatrixYmin = GetYminValueFromMemo("H2LFccMosMatrix");}
11978  if( HistoCode == "H2HFccMosMatrix" ){fH2HFccMosMatrixYmin = GetYminValueFromMemo("H2HFccMosMatrix");}
11979  if( HistoCode == "H2CorccInStins" ){fH2CorccInStinsYmin = GetYminValueFromMemo("H2CorccInStins");}
11980 }// end of SetYminMemoFromPreviousMemo(...)
11981 
11982 void TEcnaHistos::SetYmaxMemoFromPreviousMemo(const TString& HistoCode)
11983 {
11984 // InitQuantity Ymax
11985 
11986  if( HistoCode == "D_NOE_ChNb" ){fD_NOE_ChNbYmax = GetYmaxValueFromMemo("D_NOE_ChNb");}
11987  if( HistoCode == "D_NOE_ChDs" ){fD_NOE_ChDsYmax = GetYmaxValueFromMemo("D_NOE_ChDs");}
11988  if( HistoCode == "D_Ped_ChNb" ){fD_Ped_ChNbYmax = GetYmaxValueFromMemo("D_Ped_ChNb");}
11989  if( HistoCode == "D_Ped_ChDs" ){fD_Ped_ChDsYmax = GetYmaxValueFromMemo("D_Ped_ChDs");}
11990  if( HistoCode == "D_TNo_ChNb" ){fD_TNo_ChNbYmax = GetYmaxValueFromMemo("D_TNo_ChNb");}
11991  if( HistoCode == "D_TNo_ChDs" ){fD_TNo_ChDsYmax = GetYmaxValueFromMemo("D_TNo_ChDs");}
11992  if( HistoCode == "D_MCs_ChNb" ){fD_MCs_ChNbYmax = GetYmaxValueFromMemo("D_MCs_ChNb");}
11993  if( HistoCode == "D_MCs_ChDs" ){fD_MCs_ChDsYmax = GetYmaxValueFromMemo("D_MCs_ChDs");}
11994  if( HistoCode == "D_LFN_ChNb" ){fD_LFN_ChNbYmax = GetYmaxValueFromMemo("D_LFN_ChNb");}
11995  if( HistoCode == "D_LFN_ChDs" ){fD_LFN_ChDsYmax = GetYmaxValueFromMemo("D_LFN_ChDs");}
11996  if( HistoCode == "D_HFN_ChNb" ){fD_HFN_ChNbYmax = GetYmaxValueFromMemo("D_HFN_ChNb");}
11997  if( HistoCode == "D_HFN_ChDs" ){fD_HFN_ChDsYmax = GetYmaxValueFromMemo("D_HFN_ChDs");}
11998  if( HistoCode == "D_SCs_ChNb" ){fD_SCs_ChNbYmax = GetYmaxValueFromMemo("D_SCs_ChNb");}
11999  if( HistoCode == "D_SCs_ChDs" ){fD_SCs_ChDsYmax = GetYmaxValueFromMemo("D_SCs_ChDs");}
12000  if( HistoCode == "D_MSp_SpNb" ){fD_MSp_SpNbYmax = GetYmaxValueFromMemo("D_MSp_SpNb");}
12001  if( HistoCode == "D_MSp_SpDs" ){fD_MSp_SpDsYmax = GetYmaxValueFromMemo("D_MSp_SpDs");}
12002  if( HistoCode == "D_SSp_SpNb" ){fD_SSp_SpNbYmax = GetYmaxValueFromMemo("D_SSp_SpNb");}
12003  if( HistoCode == "D_SSp_SpDs" ){fD_SSp_SpDsYmax = GetYmaxValueFromMemo("D_SSp_SpDs");}
12004  if( HistoCode == "D_Adc_EvNb" ){fD_Adc_EvNbYmax = GetYmaxValueFromMemo("D_Adc_EvNb");}
12005  if( HistoCode == "D_Adc_EvDs" ){fD_Adc_EvDsYmax = GetYmaxValueFromMemo("D_Adc_EvDs");}
12006  if( HistoCode == "H_Ped_Date" ){fH_Ped_DateYmax = GetYmaxValueFromMemo("H_Ped_Date");}
12007  if( HistoCode == "H_TNo_Date" ){fH_TNo_DateYmax = GetYmaxValueFromMemo("H_TNo_Date");}
12008  if( HistoCode == "H_MCs_Date" ){fH_MCs_DateYmax = GetYmaxValueFromMemo("H_MCs_Date");}
12009  if( HistoCode == "H_LFN_Date" ){fH_LFN_DateYmax = GetYmaxValueFromMemo("H_LFN_Date");}
12010  if( HistoCode == "H_HFN_Date" ){fH_HFN_DateYmax = GetYmaxValueFromMemo("H_HFN_Date");}
12011  if( HistoCode == "H_SCs_Date" ){fH_SCs_DateYmax = GetYmaxValueFromMemo("H_SCs_Date");}
12012  if( HistoCode == "H_Ped_RuDs" ){fH_Ped_RuDsYmax = GetYmaxValueFromMemo("H_Ped_RuDs");}
12013  if( HistoCode == "H_TNo_RuDs" ){fH_TNo_RuDsYmax = GetYmaxValueFromMemo("H_TNo_RuDs");}
12014  if( HistoCode == "H_MCs_RuDs" ){fH_MCs_RuDsYmax = GetYmaxValueFromMemo("H_MCs_RuDs");}
12015  if( HistoCode == "H_LFN_RuDs" ){fH_LFN_RuDsYmax = GetYmaxValueFromMemo("H_LFN_RuDs");}
12016  if( HistoCode == "H_HFN_RuDs" ){fH_HFN_RuDsYmax = GetYmaxValueFromMemo("H_HFN_RuDs");}
12017  if( HistoCode == "H_SCs_RuDs" ){fH_SCs_RuDsYmax = GetYmaxValueFromMemo("H_SCs_RuDs");}
12018  if( HistoCode == "H2LFccMosMatrix" ){fH2LFccMosMatrixYmax = GetYmaxValueFromMemo("H2LFccMosMatrix");}
12019  if( HistoCode == "H2HFccMosMatrix" ){fH2HFccMosMatrixYmax = GetYmaxValueFromMemo("H2HFccMosMatrix");}
12020  if( HistoCode == "H2CorccInStins" ){fH2CorccInStinsYmax = GetYmaxValueFromMemo("H2CorccInStins");}
12021 }// end of SetYmaxMemoFromPreviousMemo(...)
12022 
12023 //------------------------------------------------------------------------------------------------------
12024 void TEcnaHistos::SetXVarMemo(const TString& HistoCode, const TString& opt_plot, const TString& xvar)
12025 {
12026 
12027  if( opt_plot == fSameOnePlot ){fXMemoH1SamePlus = xvar;}
12028 
12029  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12030  {
12031  if( HistoCode == "D_NOE_ChNb"){fXMemoD_NOE_ChNb = xvar;}
12032  if( HistoCode == "D_NOE_ChDs"){fXMemoD_NOE_ChDs = xvar;}
12033  if( HistoCode == "D_Ped_ChNb"){fXMemoD_Ped_ChNb = xvar;}
12034  if( HistoCode == "D_Ped_ChDs"){fXMemoD_Ped_ChDs = xvar;}
12035  if( HistoCode == "D_TNo_ChNb"){fXMemoD_TNo_ChNb = xvar;}
12036  if( HistoCode == "D_TNo_ChDs"){fXMemoD_TNo_ChDs = xvar;}
12037  if( HistoCode == "D_MCs_ChNb"){fXMemoD_MCs_ChNb = xvar;}
12038  if( HistoCode == "D_MCs_ChDs"){fXMemoD_MCs_ChDs = xvar;}
12039  if( HistoCode == "D_LFN_ChNb"){fXMemoD_LFN_ChNb = xvar;}
12040  if( HistoCode == "D_LFN_ChDs"){fXMemoD_LFN_ChDs = xvar;}
12041  if( HistoCode == "D_HFN_ChNb"){fXMemoD_HFN_ChNb = xvar;}
12042  if( HistoCode == "D_HFN_ChDs"){fXMemoD_HFN_ChDs = xvar;}
12043  if( HistoCode == "D_SCs_ChNb"){fXMemoD_SCs_ChNb = xvar;}
12044  if( HistoCode == "D_SCs_ChDs"){fXMemoD_SCs_ChDs = xvar;}
12045  if( HistoCode == "D_MSp_SpNb"){fXMemoD_MSp_SpNb = xvar;}
12046  if( HistoCode == "D_MSp_SpDs"){fXMemoD_MSp_SpDs = xvar;}
12047  if( HistoCode == "D_SSp_SpNb"){fXMemoD_SSp_SpNb = xvar;}
12048  if( HistoCode == "D_SSp_SpDs"){fXMemoD_SSp_SpDs = xvar;}
12049  if( HistoCode == "D_Adc_EvNb"){fXMemoD_Adc_EvNb = xvar;}
12050  if( HistoCode == "D_Adc_EvDs"){fXMemoD_Adc_EvDs = xvar;}
12051  if( HistoCode == "H_Ped_Date"){fXMemoH_Ped_Date = xvar;}
12052  if( HistoCode == "H_TNo_Date"){fXMemoH_TNo_Date = xvar;}
12053  if( HistoCode == "H_MCs_Date"){fXMemoH_MCs_Date = xvar;}
12054  if( HistoCode == "H_LFN_Date"){fXMemoH_LFN_Date = xvar;}
12055  if( HistoCode == "H_HFN_Date"){fXMemoH_HFN_Date = xvar;}
12056  if( HistoCode == "H_SCs_Date"){fXMemoH_SCs_Date = xvar;}
12057  if( HistoCode == "H_Ped_RuDs"){fXMemoH_Ped_RuDs = xvar;}
12058  if( HistoCode == "H_TNo_RuDs"){fXMemoH_TNo_RuDs = xvar;}
12059  if( HistoCode == "H_MCs_RuDs"){fXMemoH_MCs_RuDs = xvar;}
12060  if( HistoCode == "H_LFN_RuDs"){fXMemoH_LFN_RuDs = xvar;}
12061  if( HistoCode == "H_HFN_RuDs"){fXMemoH_HFN_RuDs = xvar;}
12062  if( HistoCode == "H_SCs_RuDs"){fXMemoH_SCs_RuDs = xvar;}
12063  }
12064 }// end of SetXVarMemo(...)
12065 
12066 TString TEcnaHistos::GetXVarFromMemo(const TString& HistoCode, const TString& opt_plot)
12067 {
12068  TString xvar = "(xvar not found)";
12069 
12070  if( opt_plot == fSameOnePlot ){xvar = fXMemoH1SamePlus;}
12071 
12072  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12073  {
12074  if( HistoCode == "D_NOE_ChNb"){xvar = fXMemoD_NOE_ChNb;}
12075  if( HistoCode == "D_NOE_ChDs"){xvar = fXMemoD_NOE_ChDs;}
12076  if( HistoCode == "D_Ped_ChNb"){xvar = fXMemoD_Ped_ChNb;}
12077  if( HistoCode == "D_Ped_ChDs"){xvar = fXMemoD_Ped_ChDs;}
12078  if( HistoCode == "D_TNo_ChNb"){xvar = fXMemoD_TNo_ChNb;}
12079  if( HistoCode == "D_TNo_ChDs"){xvar = fXMemoD_TNo_ChDs;}
12080  if( HistoCode == "D_MCs_ChNb"){xvar = fXMemoD_MCs_ChNb;}
12081  if( HistoCode == "D_MCs_ChDs"){xvar = fXMemoD_MCs_ChDs;}
12082  if( HistoCode == "D_LFN_ChNb"){xvar = fXMemoD_LFN_ChNb;}
12083  if( HistoCode == "D_LFN_ChDs"){xvar = fXMemoD_LFN_ChDs;}
12084  if( HistoCode == "D_HFN_ChNb"){xvar = fXMemoD_HFN_ChNb;}
12085  if( HistoCode == "D_HFN_ChDs"){xvar = fXMemoD_HFN_ChDs;}
12086  if( HistoCode == "D_SCs_ChNb"){xvar = fXMemoD_SCs_ChNb;}
12087  if( HistoCode == "D_SCs_ChDs"){xvar = fXMemoD_SCs_ChDs;}
12088  if( HistoCode == "D_MSp_SpNb"){xvar = fXMemoD_MSp_SpNb;}
12089  if( HistoCode == "D_MSp_SpDs"){xvar = fXMemoD_MSp_SpDs;}
12090  if( HistoCode == "D_SSp_SpNb"){xvar = fXMemoD_SSp_SpNb;}
12091  if( HistoCode == "D_SSp_SpDs"){xvar = fXMemoD_SSp_SpDs;}
12092  if( HistoCode == "D_Adc_EvNb"){xvar = fXMemoD_Adc_EvNb;}
12093  if( HistoCode == "D_Adc_EvDs"){xvar = fXMemoD_Adc_EvDs;}
12094  if( HistoCode == "H_Ped_Date"){xvar = fXMemoH_Ped_Date;}
12095  if( HistoCode == "H_TNo_Date"){xvar = fXMemoH_TNo_Date;}
12096  if( HistoCode == "H_MCs_Date"){xvar = fXMemoH_MCs_Date;}
12097  if( HistoCode == "H_LFN_Date"){xvar = fXMemoH_LFN_Date;}
12098  if( HistoCode == "H_HFN_Date"){xvar = fXMemoH_HFN_Date;}
12099  if( HistoCode == "H_SCs_Date"){xvar = fXMemoH_SCs_Date;}
12100  if( HistoCode == "H_Ped_RuDs"){xvar = fXMemoH_Ped_RuDs;}
12101  if( HistoCode == "H_TNo_RuDs"){xvar = fXMemoH_TNo_RuDs;}
12102  if( HistoCode == "H_MCs_RuDs"){xvar = fXMemoH_MCs_RuDs;}
12103  if( HistoCode == "H_LFN_RuDs"){xvar = fXMemoH_LFN_RuDs;}
12104  if( HistoCode == "H_HFN_RuDs"){xvar = fXMemoH_HFN_RuDs;}
12105  if( HistoCode == "H_SCs_RuDs"){xvar = fXMemoH_SCs_RuDs;}
12106  }
12107  return xvar;
12108 }// end of GetXVarFromMemo(...)
12109 
12110 
12111 void TEcnaHistos::SetYVarMemo(const TString& HistoCode, const TString& opt_plot, const TString& yvar)
12112 {
12113  if( opt_plot == fSameOnePlot ){fYMemoH1SamePlus = yvar;}
12114 
12115  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12116  {
12117  if( HistoCode == "D_NOE_ChNb"){fYMemoD_NOE_ChNb = yvar;}
12118  if( HistoCode == "D_NOE_ChDs"){fYMemoD_NOE_ChDs = yvar;}
12119  if( HistoCode == "D_Ped_ChNb"){fYMemoD_Ped_ChNb = yvar;}
12120  if( HistoCode == "D_Ped_ChDs"){fYMemoD_Ped_ChDs = yvar;}
12121  if( HistoCode == "D_TNo_ChNb"){fYMemoD_TNo_ChNb = yvar;}
12122  if( HistoCode == "D_TNo_ChDs"){fYMemoD_TNo_ChDs = yvar;}
12123  if( HistoCode == "D_MCs_ChNb"){fYMemoD_MCs_ChNb = yvar;}
12124  if( HistoCode == "D_MCs_ChDs"){fYMemoD_MCs_ChDs = yvar;}
12125  if( HistoCode == "D_LFN_ChNb"){fYMemoD_LFN_ChNb = yvar;}
12126  if( HistoCode == "D_LFN_ChDs"){fYMemoD_LFN_ChDs = yvar;}
12127  if( HistoCode == "D_HFN_ChNb"){fYMemoD_HFN_ChNb = yvar;}
12128  if( HistoCode == "D_HFN_ChDs"){fYMemoD_HFN_ChDs = yvar;}
12129  if( HistoCode == "D_SCs_ChNb"){fYMemoD_SCs_ChNb = yvar;}
12130  if( HistoCode == "D_SCs_ChDs"){fYMemoD_SCs_ChDs = yvar;}
12131  if( HistoCode == "D_MSp_SpNb"){fYMemoD_MSp_SpNb = yvar;}
12132  if( HistoCode == "D_MSp_SpDs"){fYMemoD_MSp_SpDs = yvar;}
12133  if( HistoCode == "D_SSp_SpNb"){fYMemoD_SSp_SpNb = yvar;}
12134  if( HistoCode == "D_Adc_EvDs"){fYMemoD_Adc_EvDs = yvar;}
12135  if( HistoCode == "D_SSp_SpDs"){fYMemoD_SSp_SpDs = yvar;}
12136  if( HistoCode == "D_Adc_EvNb"){fYMemoD_Adc_EvNb = yvar;}
12137  if( HistoCode == "H_Ped_Date"){fYMemoH_Ped_Date = yvar;}
12138  if( HistoCode == "H_TNo_Date"){fYMemoH_TNo_Date = yvar;}
12139  if( HistoCode == "H_MCs_Date"){fYMemoH_MCs_Date = yvar;}
12140  if( HistoCode == "H_LFN_Date"){fYMemoH_LFN_Date = yvar;}
12141  if( HistoCode == "H_HFN_Date"){fYMemoH_HFN_Date = yvar;}
12142  if( HistoCode == "H_SCs_Date"){fYMemoH_SCs_Date = yvar;}
12143  if( HistoCode == "H_Ped_RuDs"){fYMemoH_Ped_RuDs = yvar;}
12144  if( HistoCode == "H_TNo_RuDs"){fYMemoH_TNo_RuDs = yvar;}
12145  if( HistoCode == "H_MCs_RuDs"){fYMemoH_MCs_RuDs = yvar;}
12146  if( HistoCode == "H_LFN_RuDs"){fYMemoH_LFN_RuDs = yvar;}
12147  if( HistoCode == "H_HFN_RuDs"){fYMemoH_HFN_RuDs = yvar;}
12148  if( HistoCode == "H_SCs_RuDs"){fYMemoH_SCs_RuDs = yvar;}
12149  }
12150 }// end of SetYVarMemo(...)
12151 
12152 TString TEcnaHistos::GetYVarFromMemo(const TString& HistoCode, const TString& opt_plot)
12153 {
12154  TString yvar = "(yvar not found)";
12155 
12156  if( opt_plot == fSameOnePlot ){yvar = fYMemoH1SamePlus;}
12157 
12158  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12159  {
12160  if( HistoCode == "D_NOE_ChNb"){yvar = fYMemoD_NOE_ChNb;}
12161  if( HistoCode == "D_NOE_ChDs"){yvar = fYMemoD_NOE_ChDs;}
12162  if( HistoCode == "D_Ped_ChNb"){yvar = fYMemoD_Ped_ChNb;}
12163  if( HistoCode == "D_Ped_ChDs"){yvar = fYMemoD_Ped_ChDs;}
12164  if( HistoCode == "D_TNo_ChNb"){yvar = fYMemoD_TNo_ChNb;}
12165  if( HistoCode == "D_TNo_ChDs"){yvar = fYMemoD_TNo_ChDs;}
12166  if( HistoCode == "D_MCs_ChNb"){yvar = fYMemoD_MCs_ChNb;}
12167  if( HistoCode == "D_MCs_ChDs"){yvar = fYMemoD_MCs_ChDs;}
12168  if( HistoCode == "D_LFN_ChNb"){yvar = fYMemoD_LFN_ChNb;}
12169  if( HistoCode == "D_LFN_ChDs"){yvar = fYMemoD_LFN_ChDs;}
12170  if( HistoCode == "D_HFN_ChNb"){yvar = fYMemoD_HFN_ChNb;}
12171  if( HistoCode == "D_HFN_ChDs"){yvar = fYMemoD_HFN_ChDs;}
12172  if( HistoCode == "D_SCs_ChNb"){yvar = fYMemoD_SCs_ChNb;}
12173  if( HistoCode == "D_SCs_ChDs"){yvar = fYMemoD_SCs_ChDs;}
12174  if( HistoCode == "D_MSp_SpNb"){yvar = fYMemoD_MSp_SpNb;}
12175  if( HistoCode == "D_MSp_SpDs"){yvar = fYMemoD_MSp_SpDs;}
12176  if( HistoCode == "D_SSp_SpNb"){yvar = fYMemoD_SSp_SpNb;}
12177  if( HistoCode == "D_SSp_SpDs"){yvar = fYMemoD_SSp_SpDs;}
12178  if( HistoCode == "D_Adc_EvNb"){yvar = fYMemoD_Adc_EvNb;}
12179  if( HistoCode == "D_Adc_EvDs"){yvar = fYMemoD_Adc_EvDs;}
12180  if( HistoCode == "H_Ped_Date"){yvar = fYMemoH_Ped_Date;}
12181  if( HistoCode == "H_TNo_Date"){yvar = fYMemoH_TNo_Date;}
12182  if( HistoCode == "H_MCs_Date"){yvar = fYMemoH_MCs_Date;}
12183  if( HistoCode == "H_LFN_Date"){yvar = fYMemoH_LFN_Date;}
12184  if( HistoCode == "H_HFN_Date"){yvar = fYMemoH_HFN_Date;}
12185  if( HistoCode == "H_SCs_Date"){yvar = fYMemoH_SCs_Date;}
12186  if( HistoCode == "H_Ped_RuDs"){yvar = fYMemoH_Ped_RuDs;}
12187  if( HistoCode == "H_TNo_RuDs"){yvar = fYMemoH_TNo_RuDs;}
12188  if( HistoCode == "H_MCs_RuDs"){yvar = fYMemoH_MCs_RuDs;}
12189  if( HistoCode == "H_LFN_RuDs"){yvar = fYMemoH_LFN_RuDs;}
12190  if( HistoCode == "H_HFN_RuDs"){yvar = fYMemoH_HFN_RuDs;}
12191  if( HistoCode == "H_SCs_RuDs"){yvar = fYMemoH_SCs_RuDs;}
12192  }
12193  return yvar;
12194 }// end of GetYVarFromMemo(...)
12195 
12196 void TEcnaHistos::SetNbBinsMemo(const TString& HistoCode, const TString& opt_plot, const Int_t& nb_bins)
12197 {
12198 
12199  if( opt_plot == fSameOnePlot ){fNbBinsMemoH1SamePlus = nb_bins;}
12200 
12201  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12202  {
12203  if( HistoCode == "D_NOE_ChNb"){fNbBinsMemoD_NOE_ChNb = nb_bins;}
12204  if( HistoCode == "D_NOE_ChDs"){fNbBinsMemoD_NOE_ChDs = nb_bins;}
12205  if( HistoCode == "D_Ped_ChNb"){fNbBinsMemoD_Ped_ChNb = nb_bins;}
12206  if( HistoCode == "D_Ped_ChDs"){fNbBinsMemoD_Ped_ChDs = nb_bins;}
12207  if( HistoCode == "D_TNo_ChNb"){fNbBinsMemoD_TNo_ChNb = nb_bins;}
12208  if( HistoCode == "D_TNo_ChDs"){fNbBinsMemoD_TNo_ChDs = nb_bins;}
12209  if( HistoCode == "D_MCs_ChNb"){fNbBinsMemoD_MCs_ChNb = nb_bins;}
12210  if( HistoCode == "D_MCs_ChDs"){fNbBinsMemoD_MCs_ChDs = nb_bins;}
12211  if( HistoCode == "D_LFN_ChNb"){fNbBinsMemoD_LFN_ChNb = nb_bins;}
12212  if( HistoCode == "D_LFN_ChDs"){fNbBinsMemoD_LFN_ChDs = nb_bins;}
12213  if( HistoCode == "D_HFN_ChNb"){fNbBinsMemoD_HFN_ChNb = nb_bins;}
12214  if( HistoCode == "D_HFN_ChDs"){fNbBinsMemoD_HFN_ChDs = nb_bins;}
12215  if( HistoCode == "D_SCs_ChNb"){fNbBinsMemoD_SCs_ChNb = nb_bins;}
12216  if( HistoCode == "D_SCs_ChDs"){fNbBinsMemoD_SCs_ChDs = nb_bins;}
12217  if( HistoCode == "D_MSp_SpNb"){fNbBinsMemoD_MSp_SpNb = nb_bins;}
12218  if( HistoCode == "D_MSp_SpDs"){fNbBinsMemoD_MSp_SpDs = nb_bins;}
12219  if( HistoCode == "D_SSp_SpNb"){fNbBinsMemoD_SSp_SpNb = nb_bins;}
12220  if( HistoCode == "D_SSp_SpDs"){fNbBinsMemoD_SSp_SpDs = nb_bins;}
12221  if( HistoCode == "D_Adc_EvNb"){fNbBinsMemoD_Adc_EvNb = nb_bins;}
12222  if( HistoCode == "D_Adc_EvDs"){fNbBinsMemoD_Adc_EvDs = nb_bins;}
12223  if( HistoCode == "H_Ped_Date"){fNbBinsMemoH_Ped_Date = nb_bins;}
12224  if( HistoCode == "H_TNo_Date"){fNbBinsMemoH_TNo_Date = nb_bins;}
12225  if( HistoCode == "H_MCs_Date"){fNbBinsMemoH_MCs_Date = nb_bins;}
12226  if( HistoCode == "H_LFN_Date"){fNbBinsMemoH_LFN_Date = nb_bins;}
12227  if( HistoCode == "H_HFN_Date"){fNbBinsMemoH_HFN_Date = nb_bins;}
12228  if( HistoCode == "H_SCs_Date"){fNbBinsMemoH_SCs_Date = nb_bins;}
12229  if( HistoCode == "H_Ped_RuDs"){fNbBinsMemoH_Ped_RuDs = nb_bins;}
12230  if( HistoCode == "H_TNo_RuDs"){fNbBinsMemoH_TNo_RuDs = nb_bins;}
12231  if( HistoCode == "H_MCs_RuDs"){fNbBinsMemoH_MCs_RuDs = nb_bins;}
12232  if( HistoCode == "H_LFN_RuDs"){fNbBinsMemoH_LFN_RuDs = nb_bins;}
12233  if( HistoCode == "H_HFN_RuDs"){fNbBinsMemoH_HFN_RuDs = nb_bins;}
12234  if( HistoCode == "H_SCs_RuDs"){fNbBinsMemoH_SCs_RuDs = nb_bins;}
12235  }
12236 }// end of SetNbBinsMemo(...)
12237 
12238 Int_t TEcnaHistos::GetNbBinsFromMemo(const TString& HistoCode, const TString& opt_plot)
12239 {
12240  Int_t nb_bins = 0;
12241 
12242  if( opt_plot == fSameOnePlot ){nb_bins = fNbBinsMemoH1SamePlus;}
12243 
12244  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12245  {
12246  if( HistoCode == "D_NOE_ChNb"){nb_bins = fNbBinsMemoD_NOE_ChNb;}
12247  if( HistoCode == "D_NOE_ChDs"){nb_bins = fNbBinsMemoD_NOE_ChDs;}
12248  if( HistoCode == "D_Ped_ChNb"){nb_bins = fNbBinsMemoD_Ped_ChNb;}
12249  if( HistoCode == "D_Ped_ChDs"){nb_bins = fNbBinsMemoD_Ped_ChDs;}
12250  if( HistoCode == "D_TNo_ChNb"){nb_bins = fNbBinsMemoD_TNo_ChNb;}
12251  if( HistoCode == "D_TNo_ChDs"){nb_bins = fNbBinsMemoD_TNo_ChDs;}
12252  if( HistoCode == "D_MCs_ChNb"){nb_bins = fNbBinsMemoD_MCs_ChNb;}
12253  if( HistoCode == "D_MCs_ChDs"){nb_bins = fNbBinsMemoD_MCs_ChDs;}
12254  if( HistoCode == "D_LFN_ChNb"){nb_bins = fNbBinsMemoD_LFN_ChNb;}
12255  if( HistoCode == "D_LFN_ChDs"){nb_bins = fNbBinsMemoD_LFN_ChDs;}
12256  if( HistoCode == "D_HFN_ChNb"){nb_bins = fNbBinsMemoD_HFN_ChNb;}
12257  if( HistoCode == "D_HFN_ChDs"){nb_bins = fNbBinsMemoD_HFN_ChDs;}
12258  if( HistoCode == "D_SCs_ChNb"){nb_bins = fNbBinsMemoD_SCs_ChNb;}
12259  if( HistoCode == "D_SCs_ChDs"){nb_bins = fNbBinsMemoD_SCs_ChDs;}
12260  if( HistoCode == "D_MSp_SpNb"){nb_bins = fNbBinsMemoD_MSp_SpNb;}
12261  if( HistoCode == "D_MSp_SpDs"){nb_bins = fNbBinsMemoD_MSp_SpDs;}
12262  if( HistoCode == "D_SSp_SpNb"){nb_bins = fNbBinsMemoD_SSp_SpNb;}
12263  if( HistoCode == "D_SSp_SpDs"){nb_bins = fNbBinsMemoD_SSp_SpDs;}
12264  if( HistoCode == "D_Adc_EvNb"){nb_bins = fNbBinsMemoD_Adc_EvNb;}
12265  if( HistoCode == "D_Adc_EvDs"){nb_bins = fNbBinsMemoD_Adc_EvDs;}
12266  if( HistoCode == "H_Ped_Date"){nb_bins = fNbBinsMemoH_Ped_Date;}
12267  if( HistoCode == "H_TNo_Date"){nb_bins = fNbBinsMemoH_TNo_Date;}
12268  if( HistoCode == "H_MCs_Date"){nb_bins = fNbBinsMemoH_MCs_Date;}
12269  if( HistoCode == "H_LFN_Date"){nb_bins = fNbBinsMemoH_LFN_Date;}
12270  if( HistoCode == "H_HFN_Date"){nb_bins = fNbBinsMemoH_HFN_Date;}
12271  if( HistoCode == "H_SCs_Date"){nb_bins = fNbBinsMemoH_SCs_Date;}
12272  if( HistoCode == "H_Ped_RuDs"){nb_bins = fNbBinsMemoH_Ped_RuDs;}
12273  if( HistoCode == "H_TNo_RuDs"){nb_bins = fNbBinsMemoH_TNo_RuDs;}
12274  if( HistoCode == "H_MCs_RuDs"){nb_bins = fNbBinsMemoH_MCs_RuDs;}
12275  if( HistoCode == "H_LFN_RuDs"){nb_bins = fNbBinsMemoH_LFN_RuDs;}
12276  if( HistoCode == "H_HFN_RuDs"){nb_bins = fNbBinsMemoH_HFN_RuDs;}
12277  if( HistoCode == "H_SCs_RuDs"){nb_bins = fNbBinsMemoH_SCs_RuDs;}
12278  }
12279  return nb_bins;
12280 }// end of GetNbBinsFromMemo(...)
12281 
12282 TString TEcnaHistos::GetMemoFlag(const TString& opt_plot)
12283 {
12284  TString memo_flag;
12285  Int_t MaxCar = fgMaxCar;
12286  memo_flag.Resize(MaxCar);
12287  memo_flag = "(no memo_flag info)";
12288 
12289  Int_t memo_flag_number = -1;
12290 
12291  if( opt_plot == fSameOnePlot ){memo_flag_number = fMemoPlotH1SamePlus;}
12292 
12293  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12294  {
12295  memo_flag_number = fMemoPlotD_TNo_ChDs+fMemoPlotD_MCs_ChDs
12296  +fMemoPlotD_LFN_ChDs+fMemoPlotD_HFN_ChDs+fMemoPlotD_SCs_ChDs;
12297  }
12298 
12299  if(memo_flag_number == 0){memo_flag = "Free";}
12300  if(memo_flag_number >= 1){memo_flag = "Busy";}
12301 
12302  return memo_flag;
12303 }
12304 
12305 TString TEcnaHistos::GetMemoFlag(const TString& HistoCode, const TString& opt_plot)
12306 {
12307 // Get Memo Flag
12308 
12309  TString memo_flag;
12310  Int_t MaxCar = fgMaxCar;
12311  memo_flag.Resize(MaxCar);
12312  memo_flag = "(no memo_flag info)";
12313 
12314  Int_t memo_flag_number = -1;
12315 
12316  if( opt_plot == fSameOnePlot ){memo_flag_number = fMemoPlotH1SamePlus;}
12317 
12318  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12319  {
12320  if(HistoCode == "D_NOE_ChNb"){memo_flag_number = fMemoPlotD_NOE_ChNb;}
12321  if(HistoCode == "D_NOE_ChDs"){memo_flag_number = fMemoPlotD_NOE_ChDs;}
12322  if(HistoCode == "D_Ped_ChNb"){memo_flag_number = fMemoPlotD_Ped_ChNb;}
12323  if(HistoCode == "D_Ped_ChDs"){memo_flag_number = fMemoPlotD_Ped_ChDs;}
12324  if(HistoCode == "D_TNo_ChNb"){memo_flag_number = fMemoPlotD_TNo_ChNb;}
12325  if(HistoCode == "D_TNo_ChDs"){memo_flag_number = fMemoPlotD_TNo_ChDs;}
12326  if(HistoCode == "D_MCs_ChNb"){memo_flag_number = fMemoPlotD_MCs_ChNb;}
12327  if(HistoCode == "D_MCs_ChDs"){memo_flag_number = fMemoPlotD_MCs_ChDs;}
12328  if(HistoCode == "D_LFN_ChNb"){memo_flag_number = fMemoPlotD_LFN_ChNb;}
12329  if(HistoCode == "D_LFN_ChDs"){memo_flag_number = fMemoPlotD_LFN_ChDs;}
12330  if(HistoCode == "D_HFN_ChNb"){memo_flag_number = fMemoPlotD_HFN_ChNb;}
12331  if(HistoCode == "D_HFN_ChDs"){memo_flag_number = fMemoPlotD_HFN_ChDs;}
12332  if(HistoCode == "D_SCs_ChNb"){memo_flag_number = fMemoPlotD_SCs_ChNb;}
12333  if(HistoCode == "D_SCs_ChDs"){memo_flag_number = fMemoPlotD_SCs_ChDs;}
12334  if(HistoCode == "D_MSp_SpNb"){memo_flag_number = fMemoPlotD_MSp_SpNb;}
12335  if(HistoCode == "D_MSp_SpDs"){memo_flag_number = fMemoPlotD_MSp_SpDs;}
12336  if(HistoCode == "D_SSp_SpNb"){memo_flag_number = fMemoPlotD_SSp_SpNb;}
12337  if(HistoCode == "D_SSp_SpDs"){memo_flag_number = fMemoPlotD_SSp_SpDs;}
12338  if(HistoCode == "D_Adc_EvNb"){memo_flag_number = fMemoPlotD_Adc_EvNb;}
12339  if(HistoCode == "D_Adc_EvDs"){memo_flag_number = fMemoPlotD_Adc_EvDs;}
12340  if(HistoCode == "H_Ped_Date"){memo_flag_number = fMemoPlotH_Ped_Date;}
12341  if(HistoCode == "H_TNo_Date"){memo_flag_number = fMemoPlotH_TNo_Date;}
12342  if(HistoCode == "H_MCs_Date"){memo_flag_number = fMemoPlotH_MCs_Date;}
12343  if(HistoCode == "H_LFN_Date"){memo_flag_number = fMemoPlotH_LFN_Date;}
12344  if(HistoCode == "H_HFN_Date"){memo_flag_number = fMemoPlotH_HFN_Date;}
12345  if(HistoCode == "H_SCs_Date"){memo_flag_number = fMemoPlotH_SCs_Date;}
12346  if(HistoCode == "H_Ped_RuDs"){memo_flag_number = fMemoPlotH_Ped_RuDs;}
12347  if(HistoCode == "H_TNo_RuDs"){memo_flag_number = fMemoPlotH_TNo_RuDs;}
12348  if(HistoCode == "H_MCs_RuDs"){memo_flag_number = fMemoPlotH_MCs_RuDs;}
12349  if(HistoCode == "H_LFN_RuDs"){memo_flag_number = fMemoPlotH_LFN_RuDs;}
12350  if(HistoCode == "H_HFN_RuDs"){memo_flag_number = fMemoPlotH_HFN_RuDs;}
12351  if(HistoCode == "H_SCs_RuDs"){memo_flag_number = fMemoPlotH_SCs_RuDs;}
12352  }
12353 
12354  if(memo_flag_number == 0){memo_flag = "Free";}
12355  if(memo_flag_number == 1){memo_flag = "Busy";}
12356 
12357  return memo_flag;
12358 }
12359 
12360 TCanvas* TEcnaHistos::CreateCanvas(const TString& HistoCode, const TString& opt_plot, const TString& canvas_name,
12361  UInt_t canv_w, UInt_t canv_h)
12362 {
12363 // Create canvas according to HistoCode
12364 
12365  TCanvas* main_canvas = 0;
12366 
12367  if( opt_plot == fSameOnePlot )
12368  {
12369  fCanvH1SamePlus = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12370  main_canvas = fCanvH1SamePlus;
12371  }
12372  if( opt_plot == fSeveralPlot || opt_plot == fOnlyOnePlot )
12373  {
12374  if(HistoCode == "D_NOE_ChNb"){
12375  fCanvD_NOE_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12376  main_canvas = fCanvD_NOE_ChNb;}
12377  if(HistoCode == "D_NOE_ChDs"){
12378  fCanvD_NOE_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12379  main_canvas = fCanvD_NOE_ChDs;}
12380  if(HistoCode == "D_Ped_ChNb"){
12381  fCanvD_Ped_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12382  main_canvas = fCanvD_Ped_ChNb;}
12383  if(HistoCode == "D_Ped_ChDs"){
12384  fCanvD_Ped_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12385  main_canvas = fCanvD_Ped_ChDs;}
12386  if(HistoCode == "D_TNo_ChNb"){
12387  fCanvD_TNo_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12388  main_canvas = fCanvD_TNo_ChNb;}
12389  if(HistoCode == "D_TNo_ChDs"){
12390  fCanvD_TNo_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12391  main_canvas = fCanvD_TNo_ChDs;}
12392  if(HistoCode == "D_MCs_ChNb"){
12393  fCanvD_MCs_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12394  main_canvas = fCanvD_MCs_ChNb;}
12395  if(HistoCode == "D_MCs_ChDs"){
12396  fCanvD_MCs_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12397  main_canvas = fCanvD_MCs_ChDs;}
12398  if(HistoCode == "D_LFN_ChNb"){
12399  fCanvD_LFN_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12400  main_canvas = fCanvD_LFN_ChNb;}
12401  if(HistoCode == "D_LFN_ChDs"){
12402  fCanvD_LFN_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12403  main_canvas = fCanvD_LFN_ChDs;}
12404  if(HistoCode == "D_HFN_ChNb"){
12405  fCanvD_HFN_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12406  main_canvas = fCanvD_HFN_ChNb;}
12407  if(HistoCode == "D_HFN_ChDs"){
12408  fCanvD_HFN_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12409  main_canvas = fCanvD_HFN_ChDs;}
12410  if(HistoCode == "D_SCs_ChNb"){
12411  fCanvD_SCs_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12412  main_canvas = fCanvD_SCs_ChNb;}
12413  if(HistoCode == "D_SCs_ChDs"){
12414  fCanvD_SCs_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12415  main_canvas = fCanvD_SCs_ChDs;}
12416 
12417  if(HistoCode == "D_MSp_SpNb" ){
12418  fCanvD_MSp_SpNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12419  main_canvas = fCanvD_MSp_SpNb;}
12420  if(HistoCode == "D_MSp_SpDs" ){
12421  fCanvD_MSp_SpDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12422  main_canvas = fCanvD_MSp_SpDs;}
12423  if(HistoCode =="D_SSp_SpNb" ){
12424  fCanvD_SSp_SpNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12425  main_canvas = fCanvD_SSp_SpNb;}
12426  if(HistoCode =="D_SSp_SpDs" ){
12427  fCanvD_SSp_SpDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12428  main_canvas = fCanvD_SSp_SpDs;}
12429 
12430  if(HistoCode == "D_Adc_EvNb"){
12431  fCanvD_Adc_EvNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12432  main_canvas = fCanvD_Adc_EvNb;}
12433  if(HistoCode == "D_Adc_EvDs"){
12434  fCanvD_Adc_EvDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12435  main_canvas = fCanvD_Adc_EvDs;}
12436 
12437  if(HistoCode == "H_Ped_Date"){
12438  fCanvH_Ped_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12439  main_canvas = fCanvH_Ped_Date;}
12440  if(HistoCode == "H_TNo_Date"){
12441  fCanvH_TNo_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12442  main_canvas = fCanvH_TNo_Date;}
12443  if(HistoCode == "H_MCs_Date"){
12444  fCanvH_MCs_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12445  main_canvas = fCanvH_MCs_Date;}
12446  if(HistoCode == "H_LFN_Date"){
12447  fCanvH_LFN_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12448  main_canvas = fCanvH_LFN_Date;}
12449  if(HistoCode == "H_HFN_Date"){
12450  fCanvH_HFN_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12451  main_canvas = fCanvH_HFN_Date;}
12452  if(HistoCode == "H_SCs_Date"){
12453  fCanvH_SCs_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12454  main_canvas = fCanvH_SCs_Date;}
12455 
12456  if(HistoCode == "H_Ped_RuDs"){
12457  fCanvH_Ped_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12458  main_canvas = fCanvH_Ped_RuDs;}
12459  if(HistoCode == "H_TNo_RuDs"){
12460  fCanvH_TNo_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12461  main_canvas = fCanvH_TNo_RuDs;}
12462  if(HistoCode == "H_MCs_RuDs"){
12463  fCanvH_MCs_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12464  main_canvas = fCanvH_MCs_RuDs;}
12465  if(HistoCode == "H_LFN_RuDs"){
12466  fCanvH_LFN_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12467  main_canvas = fCanvH_LFN_RuDs;}
12468  if(HistoCode == "H_HFN_RuDs"){
12469  fCanvH_HFN_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12470  main_canvas = fCanvH_HFN_RuDs;}
12471  if(HistoCode == "H_SCs_RuDs"){
12472  fCanvH_SCs_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12473  main_canvas = fCanvH_SCs_RuDs;}
12474 
12475  }
12476  return main_canvas;
12477 }
12478 // end of CreateCanvas
12479 
12480 void TEcnaHistos::SetParametersCanvas(const TString& HistoCode, const TString& opt_plot)
12481 {
12482 // Set parameters canvas according to HistoCode
12483 
12484  Double_t x_margin_factor = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
12485  Double_t y_margin_factor = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
12486 
12487  if( opt_plot == fSameOnePlot )
12488  {
12489  fImpH1SamePlus = (TCanvasImp*)fCanvH1SamePlus->GetCanvasImp();
12490  fCanvH1SamePlus->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12491  fPadH1SamePlus = gPad; fClosedH1SamePlus = kFALSE;
12492  fMemoPlotH1SamePlus = 1; fMemoColorH1SamePlus = 0;
12493  }
12494 
12495  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
12496  {
12497  if(HistoCode == "D_NOE_ChNb")
12498  {
12499  fImpD_NOE_ChNb = (TCanvasImp*)fCanvD_NOE_ChNb->GetCanvasImp();
12500  fCanvD_NOE_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12501  fPadD_NOE_ChNb = gPad; fClosedD_NOE_ChNb = kFALSE;
12502  fMemoPlotD_NOE_ChNb = 1; fMemoColorD_NOE_ChNb = 0;
12503  }
12504 
12505  if(HistoCode == "D_NOE_ChDs") // (SetParametersCanvas)
12506  {
12507  fImpD_NOE_ChDs = (TCanvasImp*)fCanvD_NOE_ChDs->GetCanvasImp();
12508  fCanvD_NOE_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12509  fPadD_NOE_ChDs = gPad; fClosedD_NOE_ChDs = kFALSE;
12510  fMemoPlotD_NOE_ChDs = 1; fMemoColorD_NOE_ChDs = 0;
12511  }
12512 
12513  if(HistoCode == "D_Ped_ChNb")
12514  {
12515  fImpD_Ped_ChNb = (TCanvasImp*)fCanvD_Ped_ChNb->GetCanvasImp();
12516  fCanvD_Ped_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12517  fPadD_Ped_ChNb = gPad; fClosedD_Ped_ChNb = kFALSE;
12518  fMemoPlotD_Ped_ChNb = 1; fMemoColorD_Ped_ChNb = 0;
12519  }
12520 
12521  if(HistoCode == "D_Ped_ChDs")
12522  {
12523  fImpD_Ped_ChDs = (TCanvasImp*)fCanvD_Ped_ChDs->GetCanvasImp();
12524  fCanvD_Ped_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12525  fPadD_Ped_ChDs = gPad; fClosedD_Ped_ChDs = kFALSE;
12526  fMemoPlotD_Ped_ChDs = 1; fMemoColorD_Ped_ChDs = 0;
12527  }
12528 
12529  if(HistoCode == "D_TNo_ChNb")
12530  {
12531  fImpD_TNo_ChNb = (TCanvasImp*)fCanvD_TNo_ChNb->GetCanvasImp();
12532  fCanvD_TNo_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12533  fPadD_TNo_ChNb = gPad; fClosedD_TNo_ChNb = kFALSE;
12534  fMemoPlotD_TNo_ChNb = 1; fMemoColorD_TNo_ChNb = 0;
12535  }
12536 
12537  if(HistoCode == "D_TNo_ChDs") // (SetParametersCanvas)
12538  {
12539  fImpD_TNo_ChDs = (TCanvasImp*)fCanvD_TNo_ChDs->GetCanvasImp();
12540  fCanvD_TNo_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12541  fPadD_TNo_ChDs = gPad; fClosedD_TNo_ChDs = kFALSE;
12542  fMemoPlotD_TNo_ChDs = 1; fMemoColorD_TNo_ChDs = 0;
12543  }
12544 
12545  if(HistoCode == "D_MCs_ChNb")
12546  {
12547  fImpD_MCs_ChNb = (TCanvasImp*)fCanvD_MCs_ChNb->GetCanvasImp();
12548  fCanvD_MCs_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12549  fPadD_MCs_ChNb = gPad; fClosedD_MCs_ChNb = kFALSE;
12550  fMemoPlotD_MCs_ChNb = 1; fMemoColorD_MCs_ChNb = 0;
12551  }
12552 
12553  if(HistoCode == "D_MCs_ChDs")
12554  {
12555  fImpD_MCs_ChDs = (TCanvasImp*)fCanvD_MCs_ChDs->GetCanvasImp();
12556  fCanvD_MCs_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12557  fPadD_MCs_ChDs = gPad; fClosedD_MCs_ChDs = kFALSE;
12558  fMemoPlotD_MCs_ChDs = 1; fMemoColorD_MCs_ChDs = 0;
12559  }
12560 
12561  if(HistoCode == "D_LFN_ChNb") // (SetParametersCanvas)
12562  {
12563  fImpD_LFN_ChNb = (TCanvasImp*)fCanvD_LFN_ChNb->GetCanvasImp();
12564  fCanvD_LFN_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12565  fPadD_LFN_ChNb = gPad; fClosedD_LFN_ChNb = kFALSE;
12566  fMemoPlotD_LFN_ChNb = 1; fMemoColorD_LFN_ChNb = 0;
12567  }
12568 
12569  if(HistoCode == "D_LFN_ChDs")
12570  {
12571  fImpD_LFN_ChDs = (TCanvasImp*)fCanvD_LFN_ChDs->GetCanvasImp();
12572  fCanvD_LFN_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12573  fPadD_LFN_ChDs = gPad; fClosedD_LFN_ChDs = kFALSE;
12574  fMemoPlotD_LFN_ChDs = 1; fMemoColorD_LFN_ChDs = 0;
12575  }
12576 
12577  if(HistoCode == "D_HFN_ChNb")
12578  {
12579  fImpD_HFN_ChNb = (TCanvasImp*)fCanvD_HFN_ChNb->GetCanvasImp();
12580  fCanvD_HFN_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12581  fPadD_HFN_ChNb = gPad; fClosedD_HFN_ChNb = kFALSE;
12582  fMemoPlotD_HFN_ChNb = 1; fMemoColorD_HFN_ChNb = 0;
12583  }
12584 
12585  if(HistoCode == "D_HFN_ChDs")
12586  {
12587  fImpD_HFN_ChDs = (TCanvasImp*)fCanvD_HFN_ChDs->GetCanvasImp();
12588  fCanvD_HFN_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12589  fPadD_HFN_ChDs = gPad; fClosedD_HFN_ChDs = kFALSE;
12590  fMemoPlotD_HFN_ChDs = 1; fMemoColorD_HFN_ChDs = 0;
12591  }
12592 
12593  if(HistoCode == "D_SCs_ChNb") // (SetParametersCanvas)
12594  {
12595  fImpD_SCs_ChNb = (TCanvasImp*)fCanvD_SCs_ChNb->GetCanvasImp();
12596  fCanvD_SCs_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12597  fPadD_SCs_ChNb = gPad; fClosedD_SCs_ChNb = kFALSE;
12598  fMemoPlotD_SCs_ChNb = 1; fMemoColorD_SCs_ChNb = 0;
12599  }
12600 
12601  if(HistoCode == "D_SCs_ChDs")
12602  {
12603  fImpD_SCs_ChDs = (TCanvasImp*)fCanvD_SCs_ChDs->GetCanvasImp();
12604  fCanvD_SCs_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12605  fPadD_SCs_ChDs = gPad; fClosedD_SCs_ChDs = kFALSE;
12606  fMemoPlotD_SCs_ChDs = 1; fMemoColorD_SCs_ChDs = 0;
12607  }
12608 
12609  if(HistoCode == "D_MSp_SpNb")
12610  {
12611  fImpD_MSp_SpNb = (TCanvasImp*)fCanvD_MSp_SpNb->GetCanvasImp();
12612  fCanvD_MSp_SpNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12613  fPadD_MSp_SpNb = gPad; fClosedD_MSp_SpNb = kFALSE;
12614  fMemoPlotD_MSp_SpNb = 1; fMemoColorD_MSp_SpNb = 0;
12615  }
12616 
12617  if(HistoCode == "D_MSp_SpDs")
12618  {
12619  fImpD_MSp_SpDs = (TCanvasImp*)fCanvD_MSp_SpDs->GetCanvasImp();
12620  fCanvD_MSp_SpDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12621  fPadD_MSp_SpDs = gPad; fClosedD_MSp_SpDs = kFALSE;
12622  fMemoPlotD_MSp_SpDs = 1; fMemoColorD_MSp_SpDs = 0;
12623  }
12624 
12625  if(HistoCode == "D_SSp_SpNb") // (SetParametersCanvas)
12626  {
12627  fImpD_SSp_SpNb = (TCanvasImp*)fCanvD_SSp_SpNb->GetCanvasImp();
12628  fCanvD_SSp_SpNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12629  fPadD_SSp_SpNb = gPad; fClosedD_SSp_SpNb = kFALSE;
12630  fMemoPlotD_SSp_SpNb = 1; fMemoColorD_SSp_SpNb = 0;
12631  }
12632 
12633  if(HistoCode == "D_SSp_SpDs") // (SetParametersCanvas)
12634  {
12635  fImpD_SSp_SpDs = (TCanvasImp*)fCanvD_SSp_SpDs->GetCanvasImp();
12636  fCanvD_SSp_SpDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12637  fPadD_SSp_SpDs = gPad; fClosedD_SSp_SpDs = kFALSE;
12638  fMemoPlotD_SSp_SpDs = 1; fMemoColorD_SSp_SpDs = 0;
12639  }
12640 
12641  if(HistoCode == "D_Adc_EvDs")
12642  {
12643  fImpD_Adc_EvDs = (TCanvasImp*)fCanvD_Adc_EvDs->GetCanvasImp();
12644  fCanvD_Adc_EvDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12645  fPadD_Adc_EvDs = gPad; fClosedD_Adc_EvDs = kFALSE;
12646  fMemoPlotD_Adc_EvDs = 1; fMemoColorD_Adc_EvDs = 0;
12647  }
12648 
12649  if(HistoCode == "D_Adc_EvNb")
12650  {
12651  fImpD_Adc_EvNb = (TCanvasImp*)fCanvD_Adc_EvNb->GetCanvasImp();
12652  fCanvD_Adc_EvNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12653  fPadD_Adc_EvNb = gPad; fClosedD_Adc_EvNb = kFALSE;
12654  fMemoPlotD_Adc_EvNb = 1; fMemoColorD_Adc_EvNb = 0;
12655  }
12656 
12657  if(HistoCode == "H_Ped_Date") // (SetParametersCanvas)
12658  {
12659  fImpH_Ped_Date = (TCanvasImp*)fCanvH_Ped_Date->GetCanvasImp();
12660  fCanvH_Ped_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12661  fPadH_Ped_Date = gPad; fClosedH_Ped_Date = kFALSE;
12662  fMemoPlotH_Ped_Date = 1; fMemoColorH_Ped_Date = 0;
12663  }
12664  if(HistoCode == "H_TNo_Date")
12665  {
12666  fImpH_TNo_Date = (TCanvasImp*)fCanvH_TNo_Date->GetCanvasImp();
12667  fCanvH_TNo_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12668  fPadH_TNo_Date = gPad; fClosedH_TNo_Date = kFALSE;
12669  fMemoPlotH_TNo_Date = 1; fMemoColorH_TNo_Date = 0;
12670  }
12671  if(HistoCode == "H_MCs_Date")
12672  {
12673  fImpH_MCs_Date = (TCanvasImp*)fCanvH_MCs_Date->GetCanvasImp();
12674  fCanvH_MCs_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12675  fPadH_MCs_Date = gPad; fClosedH_MCs_Date = kFALSE;
12676  fMemoPlotH_MCs_Date = 1; fMemoColorH_MCs_Date = 0;
12677  }
12678 
12679  if(HistoCode == "H_LFN_Date") // (SetParametersCanvas)
12680  {
12681  fImpH_LFN_Date = (TCanvasImp*)fCanvH_LFN_Date->GetCanvasImp();
12682  fCanvH_LFN_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12683  fPadH_LFN_Date = gPad; fClosedH_LFN_Date = kFALSE;
12684  fMemoPlotH_LFN_Date = 1; fMemoColorH_LFN_Date = 0;
12685  }
12686  if(HistoCode == "H_HFN_Date")
12687  {
12688  fImpH_HFN_Date = (TCanvasImp*)fCanvH_HFN_Date->GetCanvasImp();
12689  fCanvH_HFN_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12690  fPadH_HFN_Date = gPad; fClosedH_HFN_Date = kFALSE;
12691  fMemoPlotH_HFN_Date = 1; fMemoColorH_HFN_Date = 0;
12692  }
12693  if(HistoCode == "H_SCs_Date")
12694  {
12695  fImpH_SCs_Date = (TCanvasImp*)fCanvH_SCs_Date->GetCanvasImp();
12696  fCanvH_SCs_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12697  fPadH_SCs_Date = gPad; fClosedH_SCs_Date = kFALSE;
12698  fMemoPlotH_SCs_Date = 1; fMemoColorH_SCs_Date = 0;
12699  }
12700 
12701  if(HistoCode == "H_Ped_RuDs") // (SetParametersCanvas)
12702  {
12703  fImpH_Ped_RuDs = (TCanvasImp*)fCanvH_Ped_RuDs->GetCanvasImp();
12704  fCanvH_Ped_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12705  fPadH_Ped_RuDs = gPad; fClosedH_Ped_RuDs = kFALSE;
12706  fMemoPlotH_Ped_RuDs = 1; fMemoColorH_Ped_RuDs = 0;
12707  }
12708  if(HistoCode == "H_TNo_RuDs")
12709  {
12710  fImpH_TNo_RuDs = (TCanvasImp*)fCanvH_TNo_RuDs->GetCanvasImp();
12711  fCanvH_TNo_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12712  fPadH_TNo_RuDs = gPad; fClosedH_TNo_RuDs = kFALSE;
12713  fMemoPlotH_TNo_RuDs = 1; fMemoColorH_TNo_RuDs = 0;
12714  }
12715  if(HistoCode == "H_MCs_RuDs")
12716  {
12717  fImpH_MCs_RuDs = (TCanvasImp*)fCanvH_MCs_RuDs->GetCanvasImp();
12718  fCanvH_MCs_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12719  fPadH_MCs_RuDs = gPad; fClosedH_MCs_RuDs = kFALSE;
12720  fMemoPlotH_MCs_RuDs = 1; fMemoColorH_MCs_RuDs = 0;
12721  }
12722 
12723  if(HistoCode == "H_LFN_RuDs") // (SetParametersCanvas)
12724  {
12725  fImpH_LFN_RuDs = (TCanvasImp*)fCanvH_LFN_RuDs->GetCanvasImp();
12726  fCanvH_LFN_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12727  fPadH_LFN_RuDs = gPad; fClosedH_LFN_RuDs = kFALSE;
12728  fMemoPlotH_LFN_RuDs = 1; fMemoColorH_LFN_RuDs = 0;
12729  }
12730  if(HistoCode == "H_HFN_RuDs")
12731  {
12732  fImpH_HFN_RuDs = (TCanvasImp*)fCanvH_HFN_RuDs->GetCanvasImp();
12733  fCanvH_HFN_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12734  fPadH_HFN_RuDs = gPad; fClosedH_HFN_RuDs = kFALSE;
12735  fMemoPlotH_HFN_RuDs = 1; fMemoColorH_HFN_RuDs = 0;
12736  }
12737  if(HistoCode == "H_SCs_RuDs")
12738  {
12739  fImpH_SCs_RuDs = (TCanvasImp*)fCanvH_SCs_RuDs->GetCanvasImp();
12740  fCanvH_SCs_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12741  fPadH_SCs_RuDs = gPad; fClosedH_SCs_RuDs = kFALSE;
12742  fMemoPlotH_SCs_RuDs = 1; fMemoColorH_SCs_RuDs = 0;
12743  }
12744  }
12745 }
12746 // end of SetParametersCanvas
12747 
12748 TCanvas* TEcnaHistos::GetCurrentCanvas(const TString& HistoCode, const TString& opt_plot)
12749 {
12750  TCanvas* main_canvas = 0;
12751 
12752  if( opt_plot == fSameOnePlot ){main_canvas = fCanvH1SamePlus;}
12753 
12754  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
12755  {
12756  if(HistoCode == "D_NOE_ChNb"){main_canvas = fCanvD_NOE_ChNb;}
12757  if(HistoCode == "D_NOE_ChDs"){main_canvas = fCanvD_NOE_ChDs;}
12758  if(HistoCode == "D_Ped_ChNb"){main_canvas = fCanvD_Ped_ChNb;}
12759  if(HistoCode == "D_Ped_ChDs"){main_canvas = fCanvD_Ped_ChDs;}
12760  if(HistoCode == "D_TNo_ChNb"){main_canvas = fCanvD_TNo_ChNb;}
12761  if(HistoCode == "D_TNo_ChDs"){main_canvas = fCanvD_TNo_ChDs;}
12762  if(HistoCode == "D_MCs_ChNb"){main_canvas = fCanvD_MCs_ChNb;}
12763  if(HistoCode == "D_MCs_ChDs"){main_canvas = fCanvD_MCs_ChDs;}
12764  if(HistoCode == "D_LFN_ChNb"){main_canvas = fCanvD_LFN_ChNb;}
12765  if(HistoCode == "D_LFN_ChDs"){main_canvas = fCanvD_LFN_ChDs;}
12766  if(HistoCode == "D_HFN_ChNb"){main_canvas = fCanvD_HFN_ChNb;}
12767  if(HistoCode == "D_HFN_ChDs"){main_canvas = fCanvD_HFN_ChDs;}
12768  if(HistoCode == "D_SCs_ChNb"){main_canvas = fCanvD_SCs_ChNb;}
12769  if(HistoCode == "D_SCs_ChDs"){main_canvas = fCanvD_SCs_ChDs;}
12770  if(HistoCode == "D_MSp_SpNb"){main_canvas = fCanvD_MSp_SpNb;}
12771  if(HistoCode == "D_MSp_SpDs"){main_canvas = fCanvD_MSp_SpDs;}
12772  if(HistoCode == "D_SSp_SpNb"){main_canvas = fCanvD_SSp_SpNb;}
12773  if(HistoCode == "D_SSp_SpDs"){main_canvas = fCanvD_SSp_SpDs;}
12774  if(HistoCode == "D_Adc_EvNb"){main_canvas = fCanvD_Adc_EvNb;}
12775  if(HistoCode == "D_Adc_EvDs"){main_canvas = fCanvD_Adc_EvDs;}
12776  if(HistoCode == "H_Ped_Date"){main_canvas = fCanvH_Ped_Date;}
12777  if(HistoCode == "H_TNo_Date"){main_canvas = fCanvH_TNo_Date;}
12778  if(HistoCode == "H_MCs_Date"){main_canvas = fCanvH_MCs_Date;}
12779  if(HistoCode == "H_LFN_Date"){main_canvas = fCanvH_LFN_Date;}
12780  if(HistoCode == "H_HFN_Date"){main_canvas = fCanvH_HFN_Date;}
12781  if(HistoCode == "H_SCs_Date"){main_canvas = fCanvH_SCs_Date;}
12782  if(HistoCode == "H_Ped_RuDs"){main_canvas = fCanvH_Ped_RuDs;}
12783  if(HistoCode == "H_TNo_RuDs"){main_canvas = fCanvH_TNo_RuDs;}
12784  if(HistoCode == "H_MCs_RuDs"){main_canvas = fCanvH_MCs_RuDs;}
12785  if(HistoCode == "H_LFN_RuDs"){main_canvas = fCanvH_LFN_RuDs;}
12786  if(HistoCode == "H_HFN_RuDs"){main_canvas = fCanvH_HFN_RuDs;}
12787  if(HistoCode == "H_SCs_RuDs"){main_canvas = fCanvH_SCs_RuDs;}
12788  }
12789  return main_canvas;
12790 }
12791 // end of GetCurrentCanvas(...)
12792 
12793 TCanvas* TEcnaHistos::GetCurrentCanvas(){return fCurrentCanvas;}
12794 TString TEcnaHistos::GetCurrentCanvasName(){return fCurrentCanvasName;}
12795 
12797 {
12798  if( fCurrentCanvas != 0)
12799  {
12800  if( (TCanvasImp*)fCurrentCanvas->GetCanvasImp() != 0 )
12801  {
12802  (TCanvas*)fCurrentCanvas->DrawClone();
12803  }
12804  else
12805  {
12806  cout << "TEcnaHistos::PlotCloneOfCurrentCanvas()> Last canvas has been removed. No clone can be done."
12807  << endl << " Please, display the canvas again."
12808  << fTTBELL << endl;
12809  }
12810  }
12811  else
12812  {
12813  cout << "TEcnaHistos::PlotCloneOfCurrentCanvas()> No canvas has been created. No clone can be done."
12814  << fTTBELL << endl;
12815  }
12816 }
12817 
12818 //--------------------------------------------------------------------------------------------
12819 TVirtualPad* TEcnaHistos::ActivePad(const TString& HistoCode, const TString& opt_plot)
12820 {
12821 // Active Pad for Same plot option
12822 
12823  TVirtualPad* main_subpad = 0;
12824 
12825  fCurrentHistoCode = HistoCode;
12826  fCurrentOptPlot = opt_plot;
12827 
12828  if( opt_plot == fSameOnePlot )
12829  {
12830  fCanvH1SamePlus->
12831  Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12832  if( fClosedH1SamePlus == kFALSE ){main_subpad = fPadH1SamePlus;}
12833  }
12834 
12835  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12836  {
12837  if(HistoCode == "D_NOE_ChNb"){
12838  fCanvD_NOE_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12839  if( fClosedD_NOE_ChNb == kFALSE ){main_subpad = fPadD_NOE_ChNb;}}
12840 
12841  if(HistoCode == "D_NOE_ChDs"){
12842  fCanvD_NOE_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12843  if( fClosedD_NOE_ChDs == kFALSE ){main_subpad = fPadD_NOE_ChDs;}}
12844 
12845  if(HistoCode == "D_Ped_ChNb"){
12846  fCanvD_Ped_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12847  if( fClosedD_Ped_ChNb == kFALSE ){main_subpad = fPadD_Ped_ChNb;}}
12848 
12849  if(HistoCode == "D_Ped_ChDs"){
12850  fCanvD_Ped_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12851  if( fClosedD_Ped_ChDs == kFALSE ){main_subpad = fPadD_Ped_ChDs;}}
12852 
12853  if(HistoCode == "D_TNo_ChNb"){
12854  fCanvD_TNo_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12855  if( fClosedD_TNo_ChNb == kFALSE ){main_subpad = fPadD_TNo_ChNb;}}
12856 
12857  if(HistoCode == "D_TNo_ChDs"){
12858  fCanvD_TNo_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12859  if( fClosedD_TNo_ChDs == kFALSE ){main_subpad = fPadD_TNo_ChDs;}}
12860 
12861  if(HistoCode == "D_MCs_ChNb"){
12862  fCanvD_MCs_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12863  if( fClosedD_MCs_ChNb == kFALSE ){main_subpad = fPadD_MCs_ChNb;}}
12864 
12865  if(HistoCode == "D_MCs_ChDs"){
12866  fCanvD_MCs_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12867  if( fClosedD_MCs_ChDs == kFALSE ){main_subpad = fPadD_MCs_ChDs;}}
12868 
12869  if(HistoCode == "D_LFN_ChNb"){
12870  fCanvD_LFN_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12871  if( fClosedD_LFN_ChNb == kFALSE ){main_subpad = fPadD_LFN_ChNb;}}
12872 
12873  if(HistoCode == "D_LFN_ChDs"){
12874  fCanvD_LFN_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12875  if( fClosedD_LFN_ChDs == kFALSE ){main_subpad = fPadD_LFN_ChDs;}}
12876 
12877  if(HistoCode == "D_HFN_ChNb"){
12878  fCanvD_HFN_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12879  if( fClosedD_HFN_ChNb == kFALSE ){main_subpad = fPadD_HFN_ChNb;}}
12880 
12881  if(HistoCode == "D_HFN_ChDs"){
12882  fCanvD_HFN_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12883  if( fClosedD_HFN_ChDs == kFALSE ){main_subpad = fPadD_HFN_ChDs;}}
12884 
12885  if(HistoCode == "D_SCs_ChNb"){
12886  fCanvD_SCs_ChNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12887  if( fClosedD_SCs_ChNb == kFALSE ){main_subpad = fPadD_SCs_ChNb;}}
12888 
12889  if(HistoCode == "D_SCs_ChDs"){
12890  fCanvD_SCs_ChDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12891  if( fClosedD_SCs_ChDs == kFALSE ){main_subpad = fPadD_SCs_ChDs;}}
12892 
12893  if(HistoCode == "D_MSp_SpNb"){
12894  fCanvD_MSp_SpNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12895  if( fClosedD_MSp_SpNb == kFALSE ){main_subpad = fPadD_MSp_SpNb;}}
12896 
12897  if(HistoCode == "D_MSp_SpDs"){
12898  fCanvD_MSp_SpDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12899  if( fClosedD_MSp_SpDs == kFALSE ){main_subpad = fPadD_MSp_SpDs;}}
12900 
12901  if(HistoCode == "D_SSp_SpNb"){
12902  fCanvD_SSp_SpNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12903  if( fClosedD_SSp_SpNb == kFALSE ){main_subpad = fPadD_SSp_SpNb;}}
12904 
12905  if(HistoCode == "D_SSp_SpDs"){
12906  fCanvD_SSp_SpDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12907  if( fClosedD_SSp_SpDs == kFALSE ){main_subpad = fPadD_SSp_SpDs;}}
12908 
12909  if(HistoCode == "D_Adc_EvNb"){
12910  fCanvD_Adc_EvNb->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12911  if( fClosedD_Adc_EvNb == kFALSE ){main_subpad = fPadD_Adc_EvNb;}}
12912 
12913  if(HistoCode == "D_Adc_EvDs"){
12914  fCanvD_Adc_EvDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12915  if( fClosedD_Adc_EvDs == kFALSE ){main_subpad = fPadD_Adc_EvDs;}}
12916 
12917  if(HistoCode == "H_Ped_Date"){
12918  fCanvH_Ped_Date->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12919  if( fClosedH_Ped_Date == kFALSE ){main_subpad = fPadH_Ped_Date;}}
12920 
12921  if(HistoCode == "H_TNo_Date"){
12922  fCanvH_TNo_Date->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12923  if( fClosedH_TNo_Date == kFALSE ){main_subpad = fPadH_TNo_Date;}}
12924 
12925  if(HistoCode == "H_MCs_Date"){
12926  fCanvH_MCs_Date->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12927  if( fClosedH_MCs_Date == kFALSE ){main_subpad = fPadH_MCs_Date;}}
12928 
12929  if(HistoCode == "H_LFN_Date"){
12930  fCanvH_LFN_Date->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12931  if( fClosedH_LFN_Date == kFALSE ){main_subpad = fPadH_LFN_Date;}}
12932 
12933  if(HistoCode == "H_HFN_Date"){
12934  fCanvH_HFN_Date->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12935  if( fClosedH_HFN_Date == kFALSE ){main_subpad = fPadH_HFN_Date;}}
12936 
12937  if(HistoCode == "H_SCs_Date"){
12938  fCanvH_SCs_Date->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12939  if( fClosedH_SCs_Date == kFALSE ){main_subpad = fPadH_SCs_Date;}}
12940 
12941  if(HistoCode == "H_Ped_RuDs"){
12942  fCanvH_Ped_RuDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12943  if( fClosedH_Ped_RuDs == kFALSE ){main_subpad = fPadH_Ped_RuDs;}}
12944 
12945  if(HistoCode == "H_TNo_RuDs"){
12946  fCanvH_TNo_RuDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12947  if( fClosedH_TNo_RuDs == kFALSE ){main_subpad = fPadH_TNo_RuDs;}}
12948 
12949  if(HistoCode == "H_MCs_RuDs"){
12950  fCanvH_MCs_RuDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12951  if( fClosedH_MCs_RuDs == kFALSE ){main_subpad = fPadH_MCs_RuDs;}}
12952 
12953  if(HistoCode == "H_LFN_RuDs"){
12954  fCanvH_LFN_RuDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12955  if( fClosedH_LFN_RuDs == kFALSE ){main_subpad = fPadH_LFN_RuDs;}}
12956 
12957  if(HistoCode == "H_HFN_RuDs"){
12958  fCanvH_HFN_RuDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12959  if( fClosedH_HFN_RuDs == kFALSE ){main_subpad = fPadH_HFN_RuDs;}}
12960 
12961  if(HistoCode == "H_SCs_RuDs"){
12962  fCanvH_SCs_RuDs->Connect("Closed()","TEcnaHistos",this,"DoCanvasClosed()");
12963  if( fClosedH_SCs_RuDs == kFALSE ){main_subpad = fPadH_SCs_RuDs;}}
12964  }
12965 
12966  if( main_subpad == 0 )
12967  {cout << "*TEcnaHistos::ActivePad(...)> main_subpad = "
12968  << main_subpad << ". This canvas has been closed." << endl;}
12969 
12970  return main_subpad;
12971 }
12972 // end of ActivePad
12973 
12975 {
12976  if( fCurrentOptPlot == fSameOnePlot ){fClosedH1SamePlus = kTRUE;}
12977  if( fCurrentOptPlot == fOnlyOnePlot || fCurrentOptPlot == fSeveralPlot )
12978  {
12979  if(fCurrentHistoCode == "D_NOE_ChNb"){fClosedD_NOE_ChNb = kTRUE;}
12980  if(fCurrentHistoCode == "D_NOE_ChDs"){fClosedD_NOE_ChDs = kTRUE;}
12981  if(fCurrentHistoCode == "D_Ped_ChNb"){fClosedD_Ped_ChNb = kTRUE;}
12982  if(fCurrentHistoCode == "D_Ped_ChDs"){fClosedD_Ped_ChDs = kTRUE;}
12983  if(fCurrentHistoCode == "D_TNo_ChNb"){fClosedD_TNo_ChNb = kTRUE;}
12984  if(fCurrentHistoCode == "D_TNo_ChDs"){fClosedD_TNo_ChDs = kTRUE;}
12985  if(fCurrentHistoCode == "D_MCs_ChNb"){fClosedD_MCs_ChNb = kTRUE;}
12986  if(fCurrentHistoCode == "D_MCs_ChDs"){fClosedD_MCs_ChDs = kTRUE;}
12987  if(fCurrentHistoCode == "D_LFN_ChNb"){fClosedD_LFN_ChNb = kTRUE;}
12988  if(fCurrentHistoCode == "D_LFN_ChDs"){fClosedD_LFN_ChDs = kTRUE;}
12989  if(fCurrentHistoCode == "D_HFN_ChNb"){fClosedD_HFN_ChNb = kTRUE;}
12990  if(fCurrentHistoCode == "D_HFN_ChDs"){fClosedD_HFN_ChDs = kTRUE;}
12991  if(fCurrentHistoCode == "D_SCs_ChNb"){fClosedD_SCs_ChNb = kTRUE;}
12992  if(fCurrentHistoCode == "D_SCs_ChDs"){fClosedD_SCs_ChDs = kTRUE;}
12993  if(fCurrentHistoCode == "D_MSp_SpNb"){fClosedD_MSp_SpNb = kTRUE;}
12994  if(fCurrentHistoCode == "D_MSp_SpDs"){fClosedD_MSp_SpDs = kTRUE;}
12995  if(fCurrentHistoCode == "D_SSp_SpNb"){fClosedD_SSp_SpNb = kTRUE;}
12996  if(fCurrentHistoCode == "D_SSp_SpDs"){fClosedD_SSp_SpDs = kTRUE;}
12997  if(fCurrentHistoCode == "D_Adc_EvNb"){fClosedD_Adc_EvNb = kTRUE;}
12998  if(fCurrentHistoCode == "D_Adc_EvDs"){fClosedD_Adc_EvDs = kTRUE;}
12999  if(fCurrentHistoCode == "H_Ped_Date"){fClosedH_Ped_Date = kTRUE;}
13000  if(fCurrentHistoCode == "H_TNo_Date"){fClosedH_TNo_Date = kTRUE;}
13001  if(fCurrentHistoCode == "H_MCs_Date"){fClosedH_MCs_Date = kTRUE;}
13002  if(fCurrentHistoCode == "H_LFN_Date"){fClosedH_LFN_Date = kTRUE;}
13003  if(fCurrentHistoCode == "H_HFN_Date"){fClosedH_HFN_Date = kTRUE;}
13004  if(fCurrentHistoCode == "H_SCs_Date"){fClosedH_SCs_Date = kTRUE;}
13005  if(fCurrentHistoCode == "H_Ped_RuDs"){fClosedH_Ped_RuDs = kTRUE;}
13006  if(fCurrentHistoCode == "H_TNo_RuDs"){fClosedH_TNo_RuDs = kTRUE;}
13007  if(fCurrentHistoCode == "H_MCs_RuDs"){fClosedH_MCs_RuDs = kTRUE;}
13008  if(fCurrentHistoCode == "H_LFN_RuDs"){fClosedH_LFN_RuDs = kTRUE;}
13009  if(fCurrentHistoCode == "H_HFN_RuDs"){fClosedH_HFN_RuDs = kTRUE;}
13010  if(fCurrentHistoCode == "H_SCs_RuDs"){fClosedH_SCs_RuDs = kTRUE;}
13011  }
13012 
13013  fCurrentOptPlot = "NADA"; // to avoid fClosed... = kTRUE if other canvas than those above Closed (i.e. 2D plots)
13014  fCurrentHistoCode = "NADA";
13015 
13016  cout << "!TEcnaHistos::DoCanvasClosed(...)> WARNING: canvas has been closed." << endl;
13017 }
13018 
13019 void TEcnaHistos::SetParametersPavTxt(const TString& HistoCode, const TString& opt_plot)
13020 {
13021 // Set parameters pave "sevearl changing" according to HistoCode
13022 
13023  if( opt_plot == fSameOnePlot ){fPavTxtH1SamePlus = fPavComSeveralChanging;}
13024 
13025  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
13026  {
13027  if(HistoCode == "D_NOE_ChNb"){fPavTxtD_NOE_ChNb = fPavComSeveralChanging;}
13028  if(HistoCode == "D_NOE_ChDs"){fPavTxtD_NOE_ChDs = fPavComSeveralChanging;}
13029  if(HistoCode == "D_Ped_ChNb"){fPavTxtD_Ped_ChNb = fPavComSeveralChanging;}
13030  if(HistoCode == "D_Ped_ChDs"){fPavTxtD_Ped_ChDs = fPavComSeveralChanging;}
13031  if(HistoCode == "D_TNo_ChNb"){fPavTxtD_TNo_ChNb = fPavComSeveralChanging;}
13032  if(HistoCode == "D_TNo_ChDs"){fPavTxtD_TNo_ChDs = fPavComSeveralChanging;}
13033  if(HistoCode == "D_MCs_ChNb"){fPavTxtD_MCs_ChNb = fPavComSeveralChanging;}
13034  if(HistoCode == "D_MCs_ChDs"){fPavTxtD_MCs_ChDs = fPavComSeveralChanging;}
13035  if(HistoCode == "D_LFN_ChNb"){fPavTxtD_LFN_ChNb = fPavComSeveralChanging;}
13036  if(HistoCode == "D_LFN_ChDs"){fPavTxtD_LFN_ChDs = fPavComSeveralChanging;}
13037  if(HistoCode == "D_HFN_ChNb"){fPavTxtD_HFN_ChNb = fPavComSeveralChanging;}
13038  if(HistoCode == "D_HFN_ChDs"){fPavTxtD_HFN_ChDs = fPavComSeveralChanging;}
13039  if(HistoCode == "D_SCs_ChNb"){fPavTxtD_SCs_ChNb = fPavComSeveralChanging;}
13040  if(HistoCode == "D_SCs_ChDs"){fPavTxtD_SCs_ChDs = fPavComSeveralChanging;}
13041  if(HistoCode == "D_MSp_SpNb"){fPavTxtD_MSp_SpNb = fPavComSeveralChanging;}
13042  if(HistoCode == "D_MSp_SpDs"){fPavTxtD_MSp_SpDs = fPavComSeveralChanging;}
13043  if(HistoCode == "D_SSp_SpNb"){fPavTxtD_SSp_SpNb = fPavComSeveralChanging;}
13044  if(HistoCode == "D_SSp_SpDs"){fPavTxtD_SSp_SpDs = fPavComSeveralChanging;}
13045  if(HistoCode == "D_Adc_EvNb"){fPavTxtD_Adc_EvNb = fPavComSeveralChanging;}
13046  if(HistoCode == "D_Adc_EvDs"){fPavTxtD_Adc_EvDs = fPavComSeveralChanging;}
13047  if(HistoCode == "H_Ped_Date"){fPavTxtH_Ped_Date = fPavComSeveralChanging;}
13048  if(HistoCode == "H_TNo_Date"){fPavTxtH_TNo_Date = fPavComSeveralChanging;}
13049  if(HistoCode == "H_MCs_Date"){fPavTxtH_MCs_Date = fPavComSeveralChanging;}
13050  if(HistoCode == "H_LFN_Date"){fPavTxtH_LFN_Date = fPavComSeveralChanging;}
13051  if(HistoCode == "H_HFN_Date"){fPavTxtH_HFN_Date = fPavComSeveralChanging;}
13052  if(HistoCode == "H_SCs_Date"){fPavTxtH_SCs_Date = fPavComSeveralChanging;}
13053  if(HistoCode == "H_Ped_RuDs"){fPavTxtH_Ped_RuDs = fPavComSeveralChanging;}
13054  if(HistoCode == "H_TNo_RuDs"){fPavTxtH_TNo_RuDs = fPavComSeveralChanging;}
13055  if(HistoCode == "H_MCs_RuDs"){fPavTxtH_MCs_RuDs = fPavComSeveralChanging;}
13056  if(HistoCode == "H_LFN_RuDs"){fPavTxtH_LFN_RuDs = fPavComSeveralChanging;}
13057  if(HistoCode == "H_HFN_RuDs"){fPavTxtH_HFN_RuDs = fPavComSeveralChanging;}
13058  if(HistoCode == "H_SCs_RuDs"){fPavTxtH_SCs_RuDs = fPavComSeveralChanging;}
13059  }
13060 }
13061 // end of SetParametersPavTxt
13062 
13063 
13064 TPaveText* TEcnaHistos::ActivePavTxt(const TString& HistoCode, const TString& opt_plot)
13065 {
13066  // Active Pad for Same plot option
13067 
13068  TPaveText* main_pavtxt = 0;
13069 
13070  if( opt_plot == fSameOnePlot ){main_pavtxt = fPavTxtH1SamePlus;}
13071 
13072  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
13073  {
13074  if(HistoCode == "D_NOE_ChNb"){main_pavtxt = fPavTxtD_NOE_ChNb;}
13075  if(HistoCode == "D_NOE_ChDs"){main_pavtxt = fPavTxtD_NOE_ChDs;}
13076  if(HistoCode == "D_Ped_ChNb"){main_pavtxt = fPavTxtD_Ped_ChNb;}
13077  if(HistoCode == "D_Ped_ChDs"){main_pavtxt = fPavTxtD_Ped_ChDs;}
13078  if(HistoCode == "D_TNo_ChNb"){main_pavtxt = fPavTxtD_TNo_ChNb;}
13079  if(HistoCode == "D_TNo_ChDs"){main_pavtxt = fPavTxtD_TNo_ChDs;}
13080  if(HistoCode == "D_MCs_ChNb"){main_pavtxt = fPavTxtD_MCs_ChNb;}
13081  if(HistoCode == "D_MCs_ChDs"){main_pavtxt = fPavTxtD_MCs_ChDs;}
13082  if(HistoCode == "D_LFN_ChNb"){main_pavtxt = fPavTxtD_LFN_ChNb;}
13083  if(HistoCode == "D_LFN_ChDs"){main_pavtxt = fPavTxtD_LFN_ChDs;}
13084  if(HistoCode == "D_HFN_ChNb"){main_pavtxt = fPavTxtD_HFN_ChNb;}
13085  if(HistoCode == "D_HFN_ChDs"){main_pavtxt = fPavTxtD_HFN_ChDs;}
13086  if(HistoCode == "D_SCs_ChNb"){main_pavtxt = fPavTxtD_SCs_ChNb;}
13087  if(HistoCode == "D_SCs_ChDs"){main_pavtxt = fPavTxtD_SCs_ChDs;}
13088  if(HistoCode == "D_MSp_SpNb"){main_pavtxt = fPavTxtD_MSp_SpNb;}
13089  if(HistoCode == "D_MSp_SpDs"){main_pavtxt = fPavTxtD_MSp_SpDs;}
13090  if(HistoCode == "D_SSp_SpNb"){main_pavtxt = fPavTxtD_SSp_SpNb;}
13091  if(HistoCode == "D_SSp_SpDs"){main_pavtxt = fPavTxtD_SSp_SpDs;}
13092  if(HistoCode == "D_Adc_EvNb"){main_pavtxt = fPavTxtD_Adc_EvNb;}
13093  if(HistoCode == "D_Adc_EvDs"){main_pavtxt = fPavTxtD_Adc_EvDs;}
13094  if(HistoCode == "H_Ped_Date"){main_pavtxt = fPavTxtH_Ped_Date;}
13095  if(HistoCode == "H_TNo_Date"){main_pavtxt = fPavTxtH_TNo_Date;}
13096  if(HistoCode == "H_MCs_Date"){main_pavtxt = fPavTxtH_MCs_Date;}
13097  if(HistoCode == "H_LFN_Date"){main_pavtxt = fPavTxtH_LFN_Date;}
13098  if(HistoCode == "H_HFN_Date"){main_pavtxt = fPavTxtH_HFN_Date;}
13099  if(HistoCode == "H_SCs_Date"){main_pavtxt = fPavTxtH_SCs_Date;}
13100  if(HistoCode == "H_Ped_RuDs"){main_pavtxt = fPavTxtH_Ped_RuDs;}
13101  if(HistoCode == "H_TNo_RuDs"){main_pavtxt = fPavTxtH_TNo_RuDs;}
13102  if(HistoCode == "H_MCs_RuDs"){main_pavtxt = fPavTxtH_MCs_RuDs;}
13103  if(HistoCode == "H_LFN_RuDs"){main_pavtxt = fPavTxtH_LFN_RuDs;}
13104  if(HistoCode == "H_HFN_RuDs"){main_pavtxt = fPavTxtH_HFN_RuDs;}
13105  if(HistoCode == "H_SCs_RuDs"){main_pavtxt = fPavTxtH_SCs_RuDs;}
13106  }
13107 
13108  if( main_pavtxt == 0 )
13109  {cout << "*TEcnaHistos::ActivePavTxt(...)> ERROR: main_pavtxt = " << main_pavtxt << endl;}
13110 
13111  return main_pavtxt;
13112 }
13113 // end of ActivePavTxt
13114 
13115 //void TEcnaHistos::SetViewHistoMarkerAndLine(TH1D* h_his0, const TString& HistoCode, const TString& opt_plot)
13116 //{
13118 //
13119 // TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
13120 //
13121 // //............................... Marker
13122 // h_his0->SetMarkerStyle(1); // default
13123 //
13124 // if( HistoType == "Global" && ( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot ) )
13125 // {h_his0->SetMarkerStyle(7); }
13126 //
13127 // //............................... Line
13128 // h_his0->SetLineWidth(1); // default
13129 //
13130 // if( HistoType == "Global" && ( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot ) )
13131 // {h_his0->SetLineWidth(0);}
13132 //
13133 //}
13134 
13135 void TEcnaHistos::SetViewHistoColors(TH1D* h_his0, const TString& HistoCode,
13136  const TString& opt_plot, const Int_t& arg_AlreadyRead)
13137 {
13138 // Set colors, fill, marker, line style for histo view
13139 
13140  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
13141  if( HistoType == "Global" ){h_his0->SetMarkerStyle(1);}
13142 
13143  Int_t MaxNbOfColors = fCnaParHistos->GetMaxNbOfColors();
13144 
13145  if( opt_plot == fSameOnePlot )
13146  {
13147  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
13148  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
13149  fMemoColorH1SamePlus++;
13150  if(fMemoColorH1SamePlus>MaxNbOfColors){fMemoColorH1SamePlus = 0;}
13151  }
13152 
13153  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
13154  {
13155  if(HistoCode == "D_NOE_ChNb")
13156  {
13157  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rose"));}
13158  if(opt_plot == fSeveralPlot )
13159  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChNb));
13160  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChNb));
13161  fMemoColorD_NOE_ChNb++;
13162  if(fMemoColorD_NOE_ChNb>MaxNbOfColors){fMemoColorD_NOE_ChNb = 0;}}
13163  }
13164  if(HistoCode == "D_NOE_ChDs")
13165  {
13166  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rose"));}
13167  if(opt_plot == fSeveralPlot )
13168  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChDs));
13169  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChDs));
13170  fMemoColorD_NOE_ChDs++;
13171  if(fMemoColorD_NOE_ChDs>MaxNbOfColors){fMemoColorD_NOE_ChDs = 0;}}
13172  }
13173  if(HistoCode == "D_Ped_ChNb")
13174  {
13175  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
13176  if(opt_plot == fSeveralPlot )
13177  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChNb));
13178  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChNb));
13179  fMemoColorD_Ped_ChNb++;
13180  if(fMemoColorD_Ped_ChNb>MaxNbOfColors){fMemoColorD_Ped_ChNb = 0;}}
13181  }
13182  if(HistoCode == "D_Ped_ChDs")
13183  {
13184  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
13185  if(opt_plot == fSeveralPlot )
13186  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChDs));
13187  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChDs));
13188  fMemoColorD_Ped_ChDs++;
13189  if(fMemoColorD_Ped_ChDs>MaxNbOfColors){fMemoColorD_Ped_ChDs = 0;}}
13190  }
13191  if(HistoCode == "D_TNo_ChNb")
13192  {
13193  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge48"));}
13194  if(opt_plot == fSeveralPlot )
13195  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChNb));
13196  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChNb));
13197  fMemoColorD_TNo_ChNb++;
13198  if(fMemoColorD_TNo_ChNb>MaxNbOfColors){fMemoColorD_TNo_ChNb = 0;}}
13199  }
13200  if(HistoCode == "D_TNo_ChDs")
13201  {
13202  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge48"));}
13203  if(opt_plot == fSeveralPlot )
13204  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChDs));
13205  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChDs));
13206  fMemoColorD_TNo_ChDs++;
13207  if(fMemoColorD_TNo_ChDs>MaxNbOfColors){fMemoColorD_TNo_ChDs = 0;}}
13208  }
13209 
13210  if(HistoCode == "D_MCs_ChNb")
13211  {
13212  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("vert31"));}
13213  if(opt_plot == fSeveralPlot )
13214  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChNb));
13215  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChNb));
13216  fMemoColorD_MCs_ChNb++;
13217  if(fMemoColorD_MCs_ChNb>MaxNbOfColors){fMemoColorD_MCs_ChNb = 0;}}
13218  }
13219  if(HistoCode == "D_MCs_ChDs")
13220  {
13221  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("vert31"));}
13222  if(opt_plot == fSeveralPlot )
13223  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChDs));
13224  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChDs));
13225  fMemoColorD_MCs_ChDs++;
13226  if(fMemoColorD_MCs_ChDs>MaxNbOfColors){fMemoColorD_MCs_ChDs = 0;}}
13227  }
13228  if(HistoCode == "D_LFN_ChNb")
13229  {
13230  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge44"));}
13231  if(opt_plot == fSeveralPlot )
13232  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChNb));
13233  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChNb));
13234  fMemoColorD_LFN_ChNb++;
13235  if(fMemoColorD_LFN_ChNb>MaxNbOfColors){fMemoColorD_LFN_ChNb = 0;}}
13236  }
13237  if(HistoCode == "D_LFN_ChDs")
13238  {
13239  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge44"));}
13240  if(opt_plot == fSeveralPlot )
13241  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChDs));
13242  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChDs));
13243  fMemoColorD_LFN_ChDs++;
13244  if(fMemoColorD_LFN_ChDs>MaxNbOfColors){fMemoColorD_LFN_ChDs = 0;}}
13245  }
13246  if(HistoCode == "D_HFN_ChNb")
13247  {
13248  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
13249  if(opt_plot == fSeveralPlot )
13250  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChNb));
13251  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChNb));
13252  fMemoColorD_HFN_ChNb++;
13253  if(fMemoColorD_HFN_ChNb>MaxNbOfColors){fMemoColorD_HFN_ChNb = 0;}}
13254  }
13255  if(HistoCode == "D_HFN_ChDs")
13256  {
13257  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
13258  if(opt_plot == fSeveralPlot )
13259  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChDs));
13260  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChDs));
13261  fMemoColorD_HFN_ChDs++;
13262  if(fMemoColorD_HFN_ChDs>MaxNbOfColors){fMemoColorD_HFN_ChDs = 0;}}
13263  }
13264 
13265  if(HistoCode == "D_SCs_ChNb")
13266  {
13267  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("marron23"));}
13268  if(opt_plot == fSeveralPlot )
13269  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChNb));
13270  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChNb));
13271  fMemoColorD_SCs_ChNb++;
13272  if(fMemoColorD_SCs_ChNb>MaxNbOfColors){fMemoColorD_SCs_ChNb = 0;}}
13273  }
13274  if(HistoCode == "D_SCs_ChDs")
13275  {
13276  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("marron23"));}
13277  if(opt_plot == fSeveralPlot )
13278  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChDs));
13279  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChDs));
13280  fMemoColorD_SCs_ChDs++;
13281  if(fMemoColorD_SCs_ChDs>MaxNbOfColors){fMemoColorD_SCs_ChDs = 0;}}
13282  }
13283 
13284  if(HistoCode == "D_MSp_SpNb")
13285  {
13286  if( (opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) ||
13287  (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1 && fPlotAllXtalsInStin == 0 ) )
13288  {h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
13289 
13290  if( opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 0 && fPlotAllXtalsInStin == 1 )
13291  {h_his0->SetFillColor((Color_t)0);}
13292 
13293  if(opt_plot == fSeveralPlot )
13294  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_SpNb));
13295  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_SpNb));
13296  fMemoColorD_MSp_SpNb++;
13297  if(fMemoColorD_MSp_SpNb>MaxNbOfColors){fMemoColorD_MSp_SpNb = 0;}}
13298  }
13299 
13300  if(HistoCode == "D_MSp_SpDs")
13301  {
13302  if( (opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) ||
13303  (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1 && fPlotAllXtalsInStin == 0 ) )
13304  {h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
13305 
13306  if( opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 0 && fPlotAllXtalsInStin == 1 )
13307  {h_his0->SetFillColor((Color_t)0);}
13308 
13309  if(opt_plot == fSeveralPlot )
13310  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_SpDs));
13311  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_SpDs));
13312  fMemoColorD_MSp_SpDs++;
13313  if(fMemoColorD_MSp_SpDs>MaxNbOfColors){fMemoColorD_MSp_SpDs = 0;}}
13314  }
13315 
13316  if(HistoCode == "D_SSp_SpNb")
13317  {
13318  if( (opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) ||
13319  (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1 && fPlotAllXtalsInStin == 0 ) )
13320  {h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
13321 
13322  if(opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 0 && fPlotAllXtalsInStin == 1 )
13323  {h_his0->SetFillColor((Color_t)0);}
13324 
13325  if(opt_plot == fSeveralPlot )
13326  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_SpNb));
13327  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_SpNb));
13328  fMemoColorD_SSp_SpNb++;
13329  if(fMemoColorD_SSp_SpNb>MaxNbOfColors){fMemoColorD_SSp_SpNb = 0;}}
13330  }
13331 
13332  if(HistoCode == "D_SSp_SpDs")
13333  {
13334  if( (opt_plot == fOnlyOnePlot && arg_AlreadyRead == 0) ||
13335  (opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 1 && fPlotAllXtalsInStin == 0 ) )
13336  {h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
13337 
13338  if(opt_plot == fOnlyOnePlot && arg_AlreadyRead >= 0 && fPlotAllXtalsInStin == 1 )
13339  {h_his0->SetFillColor((Color_t)0);}
13340 
13341  if(opt_plot == fSeveralPlot )
13342  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_SpDs));
13343  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_SpDs));
13344  fMemoColorD_SSp_SpDs++;
13345  if(fMemoColorD_SSp_SpDs>MaxNbOfColors){fMemoColorD_SSp_SpDs = 0;}}
13346  }
13347 
13348  if(HistoCode == "D_Adc_EvNb")
13349  {
13350  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("orange42"));}
13351  if(opt_plot == fSeveralPlot )
13352  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvNb));
13353  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvNb));
13354  fMemoColorD_Adc_EvNb++;
13355  if(fMemoColorD_Adc_EvNb>MaxNbOfColors){fMemoColorD_Adc_EvNb = 0;}}
13356  gPad->SetGrid(1,0);
13357  }
13358 
13359  if(HistoCode == "D_Adc_EvDs")
13360  {
13361  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("orange42"));}
13362  if(opt_plot == fSeveralPlot )
13363  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvDs));
13364  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvDs));
13365  fMemoColorD_Adc_EvDs++;
13366  if(fMemoColorD_Adc_EvDs>MaxNbOfColors){fMemoColorD_Adc_EvDs = 0;}}
13367  }
13368 
13369  if(HistoCode == "H_Ped_RuDs")
13370  {
13371  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
13372  if(opt_plot == fSeveralPlot )
13373  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_RuDs));
13374  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_RuDs));
13375  fMemoColorH_Ped_RuDs++;
13376  if(fMemoColorH_Ped_RuDs>MaxNbOfColors){fMemoColorH_Ped_RuDs = 0;}}
13377  gPad->SetGrid(1,1);
13378  }
13379 
13380  if(HistoCode == "H_TNo_RuDs")
13381  {
13382  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge48"));}
13383  if(opt_plot == fSeveralPlot )
13384  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_RuDs));
13385  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_RuDs));
13386  fMemoColorH_TNo_RuDs++;
13387  if(fMemoColorH_TNo_RuDs>MaxNbOfColors){fMemoColorH_TNo_RuDs = 0;}}
13388  gPad->SetGrid(1,1);
13389  }
13390 
13391  if(HistoCode == "H_MCs_RuDs")
13392  {
13393  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("vert31"));}
13394  if(opt_plot == fSeveralPlot )
13395  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_RuDs));
13396  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_RuDs));
13397  fMemoColorH_MCs_RuDs++;
13398  if(fMemoColorH_MCs_RuDs>MaxNbOfColors){fMemoColorH_MCs_RuDs = 0;}}
13399  gPad->SetGrid(1,1);
13400  }
13401 
13402  if(HistoCode == "H_LFN_RuDs")
13403  {
13404  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge44"));}
13405  if(opt_plot == fSeveralPlot )
13406  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_RuDs));
13407  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_RuDs));
13408  fMemoColorH_LFN_RuDs++;
13409  if(fMemoColorH_LFN_RuDs>MaxNbOfColors){fMemoColorH_LFN_RuDs = 0;}}
13410  gPad->SetGrid(1,1);
13411  }
13412 
13413  if(HistoCode == "H_HFN_RuDs")
13414  {
13415  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
13416  if(opt_plot == fSeveralPlot )
13417  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_RuDs));
13418  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_RuDs));
13419  fMemoColorH_HFN_RuDs++;
13420  if(fMemoColorH_HFN_RuDs>MaxNbOfColors){fMemoColorH_HFN_RuDs = 0;}}
13421  gPad->SetGrid(1,1);
13422  }
13423 
13424  if(HistoCode == "H_SCs_RuDs")
13425  {
13426  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("marron23"));}
13427  if(opt_plot == fSeveralPlot )
13428  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_RuDs));
13429  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_RuDs));
13430  fMemoColorH_SCs_RuDs++;
13431  if(fMemoColorH_SCs_RuDs>MaxNbOfColors){fMemoColorH_SCs_RuDs = 0;}}
13432  gPad->SetGrid(1,1);
13433  }
13434  }
13435 
13436  // if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot){h_his0->SetLineWidth(2);}
13437 }
13438 // end of SetViewHistoColors
13439 
13440 void TEcnaHistos::SetViewGraphColors(TGraph* g_graph0, const TString& HistoCode, const TString& opt_plot)
13441 {
13442 // Set colors for histo view
13443 
13444  Int_t MaxNbOfColors = fCnaParHistos->GetMaxNbOfColors();
13445 
13446  if( opt_plot == fSameOnePlot )
13447  {
13448  g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
13449  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
13450  fMemoColorH1SamePlus++;
13451  if(fMemoColorH1SamePlus>MaxNbOfColors){fMemoColorH1SamePlus = 0;}
13452  gPad->SetGrid(1,1);
13453  }
13454 
13455  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
13456  {
13457  if(HistoCode == "H_Ped_Date")
13458  {
13459  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("bleu38"));}
13460  if(opt_plot == fSeveralPlot )
13461  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_Date));
13462  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_Date));
13463  fMemoColorH_Ped_Date++;
13464  if(fMemoColorH_Ped_Date>MaxNbOfColors){fMemoColorH_Ped_Date = 0;}}
13465  gPad->SetGrid(1,1);
13466  }
13467 
13468  if(HistoCode == "H_TNo_Date")
13469  {
13470  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("rouge48"));}
13471  if(opt_plot == fSeveralPlot)
13472  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_Date));
13473  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_Date));
13474  fMemoColorH_TNo_Date++;
13475  if(fMemoColorH_TNo_Date>MaxNbOfColors){fMemoColorH_TNo_Date = 0;}}
13476  gPad->SetGrid(1,1);
13477  }
13478 
13479  if(HistoCode == "H_MCs_Date")
13480  {
13481  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("vert31"));}
13482  if(opt_plot == fSeveralPlot)
13483  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_Date));
13484  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_Date));
13485  fMemoColorH_MCs_Date++;
13486  if(fMemoColorH_MCs_Date>MaxNbOfColors){fMemoColorH_MCs_Date = 0;}}
13487  gPad->SetGrid(1,1);
13488  }
13489 
13490  if(HistoCode == "H_LFN_Date")
13491  {
13492  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("bleu38"));}
13493  if(opt_plot == fSeveralPlot )
13494  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_Date));
13495  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_Date));
13496  fMemoColorH_LFN_Date++;
13497  if(fMemoColorH_LFN_Date>MaxNbOfColors){fMemoColorH_LFN_Date = 0;}}
13498  gPad->SetGrid(1,1);
13499  }
13500 
13501  if(HistoCode == "H_HFN_Date")
13502  {
13503  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("rouge48"));}
13504  if(opt_plot == fSeveralPlot)
13505  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_Date));
13506  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_Date));
13507  fMemoColorH_HFN_Date++;
13508  if(fMemoColorH_HFN_Date>MaxNbOfColors){fMemoColorH_HFN_Date = 0;}}
13509  gPad->SetGrid(1,1);
13510  }
13511 
13512  if(HistoCode == "H_SCs_Date")
13513  {
13514  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("vert31"));}
13515  if(opt_plot == fSeveralPlot)
13516  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_Date));
13517  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_Date));
13518  fMemoColorH_SCs_Date++;
13519  if(fMemoColorH_SCs_Date>MaxNbOfColors){fMemoColorH_SCs_Date = 0;}}
13520  gPad->SetGrid(1,1);
13521  }
13522  }
13523  //if(opt_plot == fSeveralPlot){g_graph0->SetLineWidth(2);}
13524 }
13525 // end of SetViewGraphColors
13526 
13527 Color_t TEcnaHistos::GetViewHistoColor(const TString& HistoCode, const TString& opt_plot)
13528 {
13529  Color_t couleur = fCnaParHistos->ColorDefinition("noir"); // a priori = "noir"
13530 
13531  if( opt_plot == fSameOnePlot ){couleur = fCnaParHistos->ColorTab(fMemoColorH1SamePlus);}
13532 
13533  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
13534  {
13535  if(HistoCode == "D_NOE_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_NOE_ChNb);}
13536  if(HistoCode == "D_NOE_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_NOE_ChDs);}
13537  if(HistoCode == "D_Ped_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_Ped_ChNb);}
13538  if(HistoCode == "D_Ped_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_Ped_ChDs);}
13539  if(HistoCode == "D_TNo_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_TNo_ChNb);}
13540  if(HistoCode == "D_TNo_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_TNo_ChDs);}
13541  if(HistoCode == "D_MCs_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_MCs_ChNb);}
13542  if(HistoCode == "D_MCs_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_MCs_ChDs);}
13543  if(HistoCode == "D_LFN_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_LFN_ChNb);}
13544  if(HistoCode == "D_LFN_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_LFN_ChDs);}
13545  if(HistoCode == "D_HFN_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_HFN_ChNb);}
13546  if(HistoCode == "D_HFN_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_HFN_ChDs);}
13547  if(HistoCode == "D_SCs_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_SCs_ChNb);}
13548  if(HistoCode == "D_SCs_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_SCs_ChDs);}
13549  if(HistoCode == "D_MSp_SpNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_MSp_SpNb);}
13550  if(HistoCode == "D_MSp_SpDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_MSp_SpDs);}
13551  if(HistoCode == "D_SSp_SpNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_SSp_SpNb);}
13552  if(HistoCode == "D_SSp_SpDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_SSp_SpDs);}
13553  if(HistoCode == "D_Adc_EvNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_Adc_EvNb);}
13554  if(HistoCode == "D_Adc_EvDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_Adc_EvDs);}
13555  if(HistoCode == "H_Ped_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_Ped_Date);}
13556  if(HistoCode == "H_TNo_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_TNo_Date);}
13557  if(HistoCode == "H_MCs_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_MCs_Date);}
13558  if(HistoCode == "H_LFN_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_LFN_Date);}
13559  if(HistoCode == "H_HFN_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_HFN_Date);}
13560  if(HistoCode == "H_SCs_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_SCs_Date);}
13561  if(HistoCode == "H_Ped_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_Ped_RuDs);}
13562  if(HistoCode == "H_TNo_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_TNo_RuDs);}
13563  if(HistoCode == "H_MCs_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_MCs_RuDs);}
13564  if(HistoCode == "H_LFN_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_LFN_RuDs);}
13565  if(HistoCode == "H_HFN_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_HFN_RuDs);}
13566  if(HistoCode == "H_SCs_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_SCs_RuDs);}
13567  }
13568  return couleur;
13569 }
13570 // end of GetViewHistoColor
13571 
13572 Color_t TEcnaHistos::GetSCColor(const TString& DeeEndcap, const TString& DeeDir, const TString& QuadType)
13573 {
13574  //gives the SC color for the numbering plots
13575  TColor* my_color = new TColor();
13576  Color_t couleur = fCnaParHistos->ColorDefinition("noir"); // default = "noir"
13577 
13578  if( DeeEndcap == "EE+" )
13579  {
13580  if ( DeeDir == "right" && QuadType == "top" ){couleur=fCnaParHistos->ColorDefinition("rouge");}
13581  if ( DeeDir == "right" && QuadType == "bottom" ){couleur=fCnaParHistos->ColorDefinition("bleu_fonce");}
13582  if ( DeeDir == "left" && QuadType == "top" ){couleur=(Color_t)my_color->GetColor("#006600");}
13583  if ( DeeDir == "left" && QuadType == "bottom" ){couleur=(Color_t)my_color->GetColor("#CC3300");}
13584  }
13585  if( DeeEndcap == "EE-" )
13586  {
13587  if ( DeeDir == "right" && QuadType == "top" ){couleur=(Color_t)my_color->GetColor("#008800");}
13588  if ( DeeDir == "right" && QuadType == "bottom" ){couleur=(Color_t)my_color->GetColor("#EE5500");}
13589  if ( DeeDir == "left" && QuadType == "top" ){couleur=fCnaParHistos->ColorDefinition("rouge");}
13590  if ( DeeDir == "left" && QuadType == "bottom" ){couleur=fCnaParHistos->ColorDefinition("bleu_fonce");}
13591  }
13592 
13593  return couleur;
13594 }
13596 {
13597  // Set presentation (axis title offsets, title size, label size, etc...
13598 
13599  fCnaParHistos->SetViewHistoStyle(HistoType.Data());
13600  fCnaParHistos->SetViewHistoPadMargins(HistoType.Data(), " ");
13601  fCnaParHistos->SetViewHistoOffsets(histo, HistoType.Data(), " ");
13602  fCnaParHistos->SetViewHistoStats(histo, HistoType.Data());
13603 }
13604 void TEcnaHistos::SetHistoPresentation(TH1D* histo, const TString& HistoType, const TString& opt_plot)
13605 {
13606 // Set presentation (axis title offsets, title size, label size, etc...
13607 
13608  fCnaParHistos->SetViewHistoStyle(HistoType.Data());
13609  fCnaParHistos->SetViewHistoPadMargins(HistoType.Data(), opt_plot.Data());
13610  fCnaParHistos->SetViewHistoOffsets(histo, HistoType.Data(), opt_plot.Data());
13611  fCnaParHistos->SetViewHistoStats(histo, HistoType.Data());
13612 }
13613 
13614 void TEcnaHistos::SetGraphPresentation(TGraph* graph, 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);
13620  fCnaParHistos->SetViewGraphOffsets(graph, HistoType.Data());
13621 
13622  //............................... Graph marker
13623  graph->SetMarkerStyle(1);
13624  if( HistoType == "Evol" ){graph->SetMarkerStyle(20);}
13625 }
13626 
13627 //=====================================================================
13628 //
13629 // NewCanvas, ReInitCanvas
13630 //
13631 //=====================================================================
13632 void TEcnaHistos::NewCanvas(const TString& opt_plot)
13633 {
13634 // ReInit canvas in option SAME n in order to restart a new SAME n plot
13635 // (called by user only for option Same n)
13636 
13637  if( opt_plot == fSameOnePlot )
13638  {
13639  fImpH1SamePlus = 0; fCanvH1SamePlus = 0;
13640  fPadH1SamePlus = 0; fMemoPlotH1SamePlus = 0;
13641  fMemoColorH1SamePlus = 0; fCanvSameH1SamePlus++;
13642  fPavTxtH1SamePlus = 0; fClosedH1SamePlus = kFALSE;
13643  }
13644  else
13645  {
13646  cout << "TEcnaHistos::NewCanvas(...)> *** ERROR *** " << opt_plot.Data() << ": "
13647  << "unknown option for NewCanvas. Only " << fSameOnePlot << " option is accepted."
13648  << fTTBELL << endl;
13649  }
13650 }
13651 
13652 void TEcnaHistos::ReInitCanvas(const TString& HistoCode, const TString& opt_plot)
13653 {
13654 // ReInit canvas in option SAME and SAME n
13655 
13656  if( opt_plot == fSameOnePlot )
13657  {
13658  fImpH1SamePlus = 0; fCanvH1SamePlus = 0;
13659  fPadH1SamePlus = 0; fMemoPlotH1SamePlus = 0;
13660  fMemoColorH1SamePlus = 0; fCanvSameH1SamePlus++;
13661  fPavTxtH1SamePlus = 0; fClosedH1SamePlus = kFALSE;
13662  }
13663 
13664  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
13665  {
13666  if(HistoCode == "D_NOE_ChNb")
13667  {
13668  fImpD_NOE_ChNb = 0; fCanvD_NOE_ChNb = 0;
13669  fPadD_NOE_ChNb = 0; fMemoPlotD_NOE_ChNb = 0;
13670  fMemoColorD_NOE_ChNb = 0; fCanvSameD_NOE_ChNb++;
13671  fPavTxtD_NOE_ChNb = 0; fClosedD_NOE_ChNb = kFALSE;
13672  }
13673 
13674  if(HistoCode == "D_NOE_ChDs")
13675  {
13676  fImpD_NOE_ChDs = 0; fCanvD_NOE_ChDs = 0;
13677  fPadD_NOE_ChDs = 0; fMemoPlotD_NOE_ChDs = 0;
13678  fMemoColorD_NOE_ChDs = 0; fCanvSameD_NOE_ChDs++;
13679  fPavTxtD_NOE_ChDs = 0; fClosedD_NOE_ChDs = kFALSE;
13680  }
13681 
13682  if(HistoCode == "D_Ped_ChNb") // (ReInitCanvas)
13683  {
13684  fImpD_Ped_ChNb = 0; fCanvD_Ped_ChNb = 0;
13685  fPadD_Ped_ChNb = 0; fMemoPlotD_Ped_ChNb = 0;
13686  fMemoColorD_Ped_ChNb = 0; fCanvSameD_Ped_ChNb++;
13687  fPavTxtD_Ped_ChNb = 0; fClosedD_Ped_ChNb = kFALSE;
13688  }
13689 
13690  if(HistoCode == "D_Ped_ChDs")
13691  {
13692  fImpD_Ped_ChDs = 0; fCanvD_Ped_ChDs = 0;
13693  fPadD_Ped_ChDs = 0; fMemoPlotD_Ped_ChDs = 0;
13694  fMemoColorD_Ped_ChDs = 0; fCanvSameD_Ped_ChDs++;
13695  fPavTxtD_Ped_ChDs = 0; fClosedD_Ped_ChDs = kFALSE;
13696  }
13697 
13698  if(HistoCode == "D_TNo_ChNb")
13699  {
13700  fImpD_TNo_ChNb = 0; fCanvD_TNo_ChNb = 0;
13701  fPadD_TNo_ChNb = 0; fMemoPlotD_TNo_ChNb = 0;
13702  fMemoColorD_TNo_ChNb = 0; fCanvSameD_TNo_ChNb++;
13703  fPavTxtD_TNo_ChNb = 0; fClosedD_TNo_ChNb = kFALSE;
13704  }
13705 
13706  if(HistoCode == "D_TNo_ChDs")
13707  {
13708  fImpD_TNo_ChDs = 0; fCanvD_TNo_ChDs = 0;
13709  fPadD_TNo_ChDs = 0; fMemoPlotD_TNo_ChDs = 0;
13710  fMemoColorD_TNo_ChDs = 0; fCanvSameD_TNo_ChDs++;
13711  fPavTxtD_TNo_ChDs = 0; fClosedD_TNo_ChDs = kFALSE;
13712  }
13713 
13714  if(HistoCode == "D_MCs_ChNb") // (ReInitCanvas)
13715  {
13716  fImpD_MCs_ChNb = 0; fCanvD_MCs_ChNb = 0;
13717  fPadD_MCs_ChNb = 0; fMemoPlotD_MCs_ChNb = 0;
13718  fMemoColorD_MCs_ChNb = 0; fCanvSameD_MCs_ChNb++;
13719  fPavTxtD_MCs_ChNb = 0; fClosedD_MCs_ChNb = kFALSE;
13720  }
13721 
13722  if(HistoCode == "D_MCs_ChDs")
13723  {
13724  fImpD_MCs_ChDs = 0; fCanvD_MCs_ChDs = 0;
13725  fPadD_MCs_ChDs = 0; fMemoPlotD_MCs_ChDs = 0;
13726  fMemoColorD_MCs_ChDs = 0; fCanvSameD_MCs_ChDs++;
13727  fPavTxtD_MCs_ChDs = 0; fClosedD_MCs_ChDs = kFALSE;
13728  }
13729 
13730  if(HistoCode == "D_LFN_ChNb")
13731  {
13732  fImpD_LFN_ChNb = 0; fCanvD_LFN_ChNb = 0;
13733  fPadD_LFN_ChNb = 0; fMemoPlotD_LFN_ChNb = 0;
13734  fMemoColorD_LFN_ChNb = 0; fCanvSameD_LFN_ChNb++;
13735  fPavTxtD_LFN_ChNb = 0; fClosedD_LFN_ChNb = kFALSE;
13736  }
13737 
13738  if(HistoCode == "D_LFN_ChDs") // (ReInitCanvas)
13739  {
13740  fImpD_LFN_ChDs = 0; fCanvD_LFN_ChDs = 0;
13741  fPadD_LFN_ChDs= 0; fMemoPlotD_LFN_ChDs = 0;
13742  fMemoColorD_LFN_ChDs = 0; fCanvSameD_LFN_ChDs++;
13743  fPavTxtD_LFN_ChDs= 0; fClosedD_LFN_ChDs = kFALSE;
13744  }
13745 
13746  if(HistoCode == "D_HFN_ChNb")
13747  {
13748  fImpD_HFN_ChNb = 0; fCanvD_HFN_ChNb = 0;
13749  fPadD_HFN_ChNb = 0; fMemoPlotD_HFN_ChNb = 0;
13750  fMemoColorD_HFN_ChNb = 0; fCanvSameD_HFN_ChNb++;
13751  fPavTxtD_HFN_ChNb = 0; fClosedD_HFN_ChNb = kFALSE;
13752  }
13753 
13754  if(HistoCode == "D_HFN_ChDs")
13755  {
13756  fImpD_HFN_ChDs = 0; fCanvD_HFN_ChDs = 0;
13757  fPadD_HFN_ChDs = 0; fMemoPlotD_HFN_ChDs = 0;
13758  fMemoColorD_HFN_ChDs = 0; fCanvSameD_HFN_ChDs++;
13759  fPavTxtD_HFN_ChDs = 0; fClosedD_HFN_ChDs = kFALSE;
13760  }
13761 
13762  if(HistoCode == "D_SCs_ChNb")
13763  {
13764  fImpD_SCs_ChNb = 0; fCanvD_SCs_ChNb = 0;
13765  fPadD_SCs_ChNb = 0; fMemoPlotD_SCs_ChNb = 0;
13766  fMemoColorD_SCs_ChNb = 0; fCanvSameD_SCs_ChNb++;
13767  fPavTxtD_SCs_ChNb = 0; fClosedD_SCs_ChNb = kFALSE;
13768  }
13769 
13770  if(HistoCode == "D_SCs_ChDs") // (ReInitCanvas)
13771  {
13772  fImpD_SCs_ChDs = 0; fCanvD_SCs_ChDs = 0;
13773  fPadD_SCs_ChDs = 0; fMemoPlotD_SCs_ChDs = 0;
13774  fMemoColorD_SCs_ChDs = 0; fCanvSameD_SCs_ChDs++;
13775  fPavTxtD_SCs_ChDs = 0; fClosedD_SCs_ChDs = kFALSE;
13776  }
13777 
13778  if(HistoCode == "D_MSp_SpNb")
13779  {
13780  fImpD_MSp_SpNb = 0; fCanvD_MSp_SpNb = 0;
13781  fPadD_MSp_SpNb = 0; fMemoPlotD_MSp_SpNb = 0;
13782  fMemoColorD_MSp_SpNb = 0; fCanvSameD_MSp_SpNb++;
13783  fPavTxtD_MSp_SpNb = 0; fClosedD_MSp_SpNb = kFALSE;
13784  }
13785 
13786  if(HistoCode == "D_MSp_SpDs")
13787  {
13788  fImpD_MSp_SpDs = 0; fCanvD_MSp_SpDs = 0;
13789  fPadD_MSp_SpDs = 0; fMemoPlotD_MSp_SpDs = 0;
13790  fMemoColorD_MSp_SpDs = 0; fCanvSameD_MSp_SpDs++;
13791  fPavTxtD_MSp_SpDs = 0; fClosedD_MSp_SpDs = kFALSE;
13792  }
13793 
13794  if(HistoCode == "D_SSp_SpNb")
13795  {
13796  fImpD_SSp_SpNb = 0; fCanvD_SSp_SpNb = 0;
13797  fPadD_SSp_SpNb = 0; fMemoPlotD_SSp_SpNb= 0;
13798  fMemoColorD_SSp_SpNb = 0; fCanvSameD_SSp_SpNb++;
13799  fPavTxtD_SSp_SpNb = 0; fClosedD_SSp_SpNb = kFALSE;
13800  }
13801 
13802  if(HistoCode == "D_SSp_SpDs")
13803  {
13804  fImpD_SSp_SpDs = 0; fCanvD_SSp_SpDs = 0;
13805  fPadD_SSp_SpDs = 0; fMemoPlotD_SSp_SpDs= 0;
13806  fMemoColorD_SSp_SpDs = 0; fCanvSameD_SSp_SpDs++;
13807  fPavTxtD_SSp_SpDs = 0; fClosedD_SSp_SpDs = kFALSE;
13808  }
13809 
13810  if(HistoCode == "D_Adc_EvNb") // (ReInitCanvas)
13811  {
13812  fImpD_Adc_EvNb = 0; fCanvD_Adc_EvNb = 0;
13813  fPadD_Adc_EvNb = 0; fMemoPlotD_Adc_EvNb = 0;
13814  fMemoColorD_Adc_EvNb = 0; fCanvSameD_Adc_EvNb++;
13815  fPavTxtD_Adc_EvNb = 0; fClosedD_Adc_EvNb = kFALSE;
13816  }
13817 
13818  if(HistoCode == "D_Adc_EvDs")
13819  {
13820  fImpD_Adc_EvDs = 0; fCanvD_Adc_EvDs = 0;
13821  fPadD_Adc_EvDs = 0; fMemoPlotD_Adc_EvDs = 0;
13822  fMemoColorD_Adc_EvDs = 0; fCanvSameD_Adc_EvDs++;
13823  fPavTxtD_Adc_EvDs = 0; fClosedD_Adc_EvDs = kFALSE;
13824  }
13825 
13826 
13827  if(HistoCode == "H_Ped_Date")
13828  {
13829  fImpH_Ped_Date = 0; fCanvH_Ped_Date = 0;
13830  fPadH_Ped_Date = 0; fMemoPlotH_Ped_Date = 0;
13831  fMemoColorH_Ped_Date = 0; fCanvSameH_Ped_Date++;
13832  fNbOfListFileH_Ped_Date = 0;fClosedH_Ped_Date = kFALSE;
13833  }
13834 
13835  if(HistoCode == "H_TNo_Date")
13836  {
13837  fImpH_TNo_Date = 0; fCanvH_TNo_Date = 0;
13838  fPadH_TNo_Date = 0; fMemoPlotH_TNo_Date = 0;
13839  fMemoColorH_TNo_Date = 0; fCanvSameH_TNo_Date++;
13840  fNbOfListFileH_TNo_Date = 0; fClosedH_TNo_Date = kFALSE;
13841  }
13842 
13843  if(HistoCode == "H_MCs_Date") // (ReInitCanvas)
13844  {
13845  fImpH_MCs_Date = 0; fCanvH_MCs_Date = 0;
13846  fPadH_MCs_Date = 0; fMemoPlotH_MCs_Date = 0;
13847  fMemoColorH_MCs_Date = 0; fCanvSameH_MCs_Date++;
13848  fNbOfListFileH_MCs_Date = 0; fClosedH_MCs_Date = kFALSE;
13849  }
13850 
13851 
13852  if(HistoCode == "H_LFN_Date")
13853  {
13854  fImpH_LFN_Date = 0; fCanvH_LFN_Date = 0;
13855  fPadH_LFN_Date = 0; fMemoPlotH_LFN_Date = 0;
13856  fMemoColorH_LFN_Date = 0; fCanvSameH_LFN_Date++;
13857  fNbOfListFileH_LFN_Date = 0; fClosedH_LFN_Date = kFALSE;
13858  }
13859 
13860  if(HistoCode == "H_HFN_Date")
13861  {
13862  fImpH_HFN_Date = 0; fCanvH_HFN_Date = 0;
13863  fPadH_HFN_Date = 0; fMemoPlotH_HFN_Date = 0;
13864  fMemoColorH_HFN_Date = 0; fCanvSameH_HFN_Date++;
13865  fNbOfListFileH_HFN_Date = 0; fClosedH_HFN_Date = kFALSE;
13866  }
13867 
13868  if(HistoCode == "H_SCs_Date")
13869  {
13870  fImpH_SCs_Date = 0; fCanvH_SCs_Date = 0;
13871  fPadH_SCs_Date = 0; fMemoPlotH_SCs_Date = 0;
13872  fMemoColorH_SCs_Date = 0; fCanvSameH_SCs_Date++;
13873  fNbOfListFileH_SCs_Date = 0; fClosedH_SCs_Date = kFALSE;
13874  }
13875 
13876  if(HistoCode == "H_Ped_RuDs")
13877  {
13878  fImpH_Ped_RuDs = 0; fCanvH_Ped_RuDs = 0;
13879  fPadH_Ped_RuDs = 0; fMemoPlotH_Ped_RuDs = 0;
13880  fMemoColorH_Ped_RuDs = 0; fCanvSameH_Ped_RuDs++;
13881  fNbOfListFileH_Ped_RuDs = 0; fClosedH_Ped_RuDs = kFALSE;
13882  }
13883 
13884  if(HistoCode == "H_TNo_RuDs")
13885  {
13886  fImpH_TNo_RuDs = 0; fCanvH_TNo_RuDs = 0;
13887  fPadH_TNo_RuDs = 0; fMemoPlotH_TNo_RuDs = 0;
13888  fMemoColorH_TNo_RuDs = 0; fCanvSameH_TNo_RuDs++;
13889  fNbOfListFileH_TNo_RuDs = 0; fClosedH_TNo_RuDs = kFALSE;
13890  }
13891 
13892  if(HistoCode == "H_MCs_RuDs") // (ReInitCanvas)
13893  {
13894  fImpH_MCs_RuDs = 0; fCanvH_MCs_RuDs = 0;
13895  fPadH_MCs_RuDs = 0; fMemoPlotH_MCs_RuDs = 0;
13896  fMemoColorH_MCs_RuDs = 0; fCanvSameH_MCs_RuDs++;
13897  fNbOfListFileH_MCs_RuDs = 0; fClosedH_MCs_RuDs = kFALSE;
13898  }
13899 
13900 
13901  if(HistoCode == "H_LFN_RuDs")
13902  {
13903  fImpH_LFN_RuDs = 0; fCanvH_LFN_RuDs = 0;
13904  fPadH_LFN_RuDs = 0; fMemoPlotH_LFN_RuDs = 0;
13905  fMemoColorH_LFN_RuDs = 0; fCanvSameH_LFN_RuDs++;
13906  fNbOfListFileH_LFN_RuDs = 0; fClosedH_LFN_RuDs = kFALSE;
13907  }
13908 
13909  if(HistoCode == "H_HFN_RuDs")
13910  {
13911  fImpH_HFN_RuDs = 0; fCanvH_HFN_RuDs = 0;
13912  fPadH_HFN_RuDs = 0; fMemoPlotH_HFN_RuDs = 0;
13913  fMemoColorH_HFN_RuDs = 0; fCanvSameH_HFN_RuDs++;
13914  fNbOfListFileH_HFN_RuDs = 0; fClosedH_HFN_RuDs = kFALSE;
13915  }
13916 
13917  if(HistoCode == "H_SCs_RuDs")
13918  {
13919  fImpH_SCs_RuDs = 0; fCanvH_SCs_RuDs = 0;
13920  fPadH_SCs_RuDs = 0; fMemoPlotH_SCs_RuDs = 0;
13921  fMemoColorH_SCs_RuDs = 0; fCanvSameH_SCs_RuDs++;
13922  fNbOfListFileH_SCs_RuDs = 0; fClosedH_SCs_RuDs = kFALSE;
13923  }
13924  }
13925 }
13926 // ------- end of ReInitCanvas(...) ------------
13927 
13928 //==========================================================================================
13929 void TEcnaHistos::WriteMatrixAscii(const TString& BetweenWhat, const TString& CorOrCov,
13930  const Int_t& StexStinEcna, const Int_t& MatrixBinIndex,
13931  const Int_t& MatSize, const TMatrixD& read_matrix)
13932 {
13933 // write matrix in ascii file
13934 
13935  Int_t ChanNumber = MatrixBinIndex;
13936 
13937  fCnaWrite->RegisterFileParameters(fFapAnaType, fFapNbOfSamples,
13938  fFapRunNumber, fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts,
13939  fFapStexNumber, fStartDate, fStopDate, fStartTime, fStopTime);
13940 
13941  if( BetweenWhat == fBetweenSamples && CorOrCov == fCorrelationMatrix )
13942  {
13943  fCnaWrite->WriteAsciiCorrelationsBetweenSamples(StexStinEcna, ChanNumber, MatSize, read_matrix);
13944  fAsciiFileName = fCnaWrite->GetAsciiFileName();
13945  }
13946 
13947  if( BetweenWhat == fBetweenSamples && CorOrCov == fCovarianceMatrix )
13948  {
13949  fCnaWrite->WriteAsciiCovariancesBetweenSamples(StexStinEcna, ChanNumber, MatSize, read_matrix);
13950  fAsciiFileName = fCnaWrite->GetAsciiFileName();
13951  }
13952 }
13953 //...............................................................................................
13954 void TEcnaHistos::WriteHistoAscii(const TString& HistoCode, const Int_t& HisSize,
13955  const TVectorD& read_histo)
13956 {
13957 // write matrix in ascii file
13958 
13959  fCnaWrite->RegisterFileParameters(fFapAnaType, fFapNbOfSamples,
13960  fFapRunNumber, fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFapReqNbOfEvts,
13961  fFapStexNumber, fStartDate, fStopDate,
13962  fStartTime, fStopTime);
13963 
13964  fCnaWrite->WriteAsciiHisto(HistoCode, HisSize, read_histo);
13965  fAsciiFileName = fCnaWrite->GetAsciiFileName();
13966 }
13967 
13968 TString TEcnaHistos::AsciiFileName(){return fAsciiFileName.Data();}
13969 
13970 //---------------> messages de rappel pour l'auteur:
13971 //
13972 //======= 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 ==============!!!!
13973 // A EVITER ABSOLUMENT quand on est sous TEcnaGui CAR LE cin >> BLOQUE X11
13974 // puisqu'on n'a pas la main dans la fenetre de compte-rendu de la CNA
13975 // {Int_t cintoto; cout << "taper 0 pour continuer" << endl; cin >> cintoto;}
13976 // *=================================================*
13977 // | |
13978 //++++++++++++++++++++++++| A T T E N T I O N: PAS DE TEST "cintoto" ici! |+++++++++++++++++++++!!!!
13979 // | |
13980 // *=================================================*
13981 //
13982 // INFO: When "new" fails to allocate the memory for an object, or "new[]" fails to allocate the memory
13983 // for an object array, a std::bad_alloc object is thrown.
13984 // "In GCC, the RTTI mangled name of std::bad_alloc is, I'm guessing, St9bad_alloc."
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 &)
TCanvas * CreateCanvas(const TString &, const TString &, const TString &, UInt_t, UInt_t)
int i
Definition: DBlmapReader.cc:9
TString SetHistoXAxisTitle(const TString &)
void PlotDetector(const TVectorD &, const TString &, const TString &)
void SCCrystalNumbering(const Int_t &, const Int_t &)
void XtalSamplesSigma(const TVectorD &, const Int_t &, const Int_t &, const Int_t &, const TString &)
TVectorD ReadLowFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2050
Int_t GetRunNumber()
Definition: TEcnaRead.cc:745
Int_t GetNotConnectedDSSCFromIndex(const Int_t &)
Int_t GetLastReqEvtNumber()
Definition: TEcnaRead.cc:747
Int_t GetHistoNumberOfBins(const TString &, const Int_t &)
void InitSpecParBeforeFileReading()
void ViewStex(const TVectorD &, const Int_t &, const TString &)
Int_t GetHistoryRunListParameters(const TString &, const TString &)
TString GetMemoFlag(const TString &)
void SetNbBinsMemo(const TString &, const TString &, const Int_t &)
TString GetXVarFromMemo(const TString &, const TString &)
void SetXsupMemoFromValue(const TString &, const Double_t &)
void ViewStinGrid(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &)
Double_t GetXinfValueFromMemo()
Int_t GetNotCompleteDSSCFromIndex(const Int_t &)
TString GetYVarFromMemo(const TString &, const TString &)
Int_t GetYStinInStas(const Int_t &, const Int_t &)
void CorrelationsBetweenSamples(const Int_t &)
void PlotMatrix(const TMatrixD &, const TString &, const TString &)
Definition: TEcnaHistos.cc:892
Bool_t GetOkViewHisto(TEcnaRead *, const Int_t &, const Int_t &, const Int_t &, const TString &)
TVirtualPad * ActivePad(const TString &, const TString &)
void ViewSMGrid(const Int_t &, const TString &)
void ViewStin(const Int_t &, const TString &)
Double_t GetYmaxFromHistoFrameAndMarginValue(TH1D *, const Double_t)
TVectorD ReadSampleAdcValues(const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1249
void PlotHistory(const TString &, const TString &, const TString &, const Int_t &, const Int_t &)
Double_t GetYmaxFromGraphFrameAndMarginValue(TGraph *, const Double_t)
Int_t GetNumberOfEvents(const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:4276
Double_t GetXsupValueFromMemo()
TString GetStartDate()
Definition: TEcnaRead.cc:757
void SetAllPavesViewStex(const TString &, const Int_t &)
void ReInitCanvas(const TString &, const TString &)
TVectorD ReadSigmaOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2212
void SetViewHistoColors(TH1D *, const TString &, const TString &, const Int_t &)
void XtalSamplesEv(const TVectorD &, const Int_t &, const Int_t &, const Int_t &, const TString &)
TString GetRootFileNameShort()
Definition: TEcnaRead.cc:4358
void SetRunNumberFromList(const Int_t &, const Int_t &)
void SetYmaxMemoFromPreviousMemo(const TString &)
void SetParametersPavTxt(const TString &, const TString &)
Int_t SetGraphFrameYminYmaxFromMemo(TGraph *, const TString &)
TString StexNumberToString(const Int_t &)
void CovariancesBetweenSamples(const Int_t &)
void SetHistoScaleY(const TString &)
Definition: TEcnaHistos.cc:807
void DeeSCNumbering(const Int_t &)
void SetHistoMin()
void SetAllPavesViewStinCrysNb(const Int_t &, const Int_t &)
void ViewStexStinNumberingPad(const Int_t &)
void FillHisto(TH1D *, const TVectorD &, const TString &, const Int_t &)
void TowerCrystalNumbering(const Int_t &, const Int_t &)
void StexHocoVecoLHFCorcc(const TString &)
void WriteHistoAscii(const TString &, const Int_t &, const TVectorD &)
Bool_t RegisterPointer(const TString &, const Long_t &)
Definition: TEcnaObject.cc:103
void ViewStas(const TVectorD &, const Int_t &, const TString &)
void ViewEBGrid()
TString GetEtaPhiAxisTitle(const TString &)
Int_t SetHistoFrameYminYmaxFromMemo(TH1D *, const TString &)
Double_t GetYmaxValueFromMemo(const TString &)
Int_t GetFirstReqEvtNumber()
Definition: TEcnaRead.cc:746
Double_t GetYminValueFromMemo(const TString &)
Color_t GetViewHistoColor(const TString &, const TString &)
void ViewStexGrid(const Int_t &, const TString &)
void StexStinNumbering(const Int_t &)
TPaveText * ActivePavTxt(const TString &, const TString &)
void RunType(const TString &)
Definition: TEcnaHistos.cc:823
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 &)
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 &)
void EEGridAxis(const Float_t &, const Float_t &, const Int_t &, const TString &, const TString &)
Int_t GetXSampInStin(const Int_t &, const Int_t &, const Int_t &, const Int_t &)
void SetHistoMax()
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:1130
TVectorD ReadSampleSigmas(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1508
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 &)
TString GetHocoVecoAxisTitle(const TString &)
void SetYminMemoFromPreviousMemo(const TString &)
void SetAllYminYmaxMemoFromDefaultValues()
Double_t GetYminFromHistoFrameAndMarginValue(TH1D *, const Double_t)
void ViewHistime(const TString &, const Int_t &, const Int_t &, const TString &, const TString &)
int j
Definition: DBlmapReader.cc:9
TVectorD ReadTotalNoise(const Int_t &)
Definition: TEcnaRead.cc:1890
void SetXinfMemoFromValue(const TString &, const Double_t &)
void SetHistoColorPalette(const TString &)
Definition: TEcnaHistos.cc:812
Bool_t StatusFileFound()
Definition: TEcnaHistos.cc:832
void ViewSMTowerNumberingPad(const Int_t &)
TString GetStopDate()
Definition: TEcnaRead.cc:758
Int_t GetNotCompleteSCForConsFromIndex(const Int_t &)
void SetAllPavesViewStas()
void SetAllPavesViewHisto(const TString &, const Int_t &, const Int_t &, const Int_t &, const TString &)
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 &)
void DoCanvasClosed()
void ViewDeeSCNumberingPad(const Int_t &)
void PrintNoComment()
Definition: TEcnaRead.cc:4463
TVectorD ReadPedestals(const Int_t &)
Definition: TEcnaRead.cc:1808
TString GetCurrentCanvasName()
void SetParametersCanvas(const TString &, const TString &)
Bool_t DataExist()
Definition: TEcnaRead.cc:977
Axis_t GetHistoXsup(const TString &, const Int_t &, const TString &)
Int_t GetNbOfSamples()
Definition: TEcnaRead.cc:744
void ViewEEGrid(const Int_t &)
void Plot1DHisto(const TVectorD &, const TString &, const TString &, const TString &)
void SetEcalSubDetector(const TString &)
Definition: TEcnaHistos.cc:679
TString GetAnalysisName()
Definition: TEcnaRead.cc:743
Int_t GetXCrysInStex(const Int_t &, const Int_t &, const Int_t &)
void SetAllPavesViewMatrix(const TString &, const Int_t &, const Int_t &, const Int_t &)
Definition: adjgraph.h:12
void SetViewGraphColors(TGraph *, const TString &, const TString &)
TVectorD ReadHighFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2131
void StinCrystalNumbering(const Int_t &, const Int_t &)
Int_t GetYCrysInStex(const Int_t &, const Int_t &, const Int_t &)
void SetAllPavesViewStin(const Int_t &)
Color_t GetSCColor(const TString &, const TString &, const TString &)
void SetXVarMemo(const TString &, const TString &, const TString &)
Int_t GetSCOffset(const Int_t &, const Int_t &, const Int_t &)
void SMTowerNumbering(const Int_t &)
void EvSamplesXtals(const TVectorD &, const Int_t &, const Int_t &, const Int_t &, const TString &)
Int_t ModifiedSCEchaForNotConnectedSCs(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
void SetHistoScaleX(const TString &)
Definition: TEcnaHistos.cc:802
void NumberOfEvents(const Int_t &)
Definition: TEcnaHistos.cc:827
void TopAxisForHistos(TH1D *, const TString &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
void SqrtContourLevels(const Int_t &, Double_t *)
Int_t GetReqNbOfEvts()
Definition: TEcnaRead.cc:748
Int_t GetYSampInStin(const Int_t &, const Int_t &, const Int_t &, const Int_t &)
void SetGraphPresentation(TGraph *, const TString &, const TString &)
Int_t GetDSOffset(const Int_t &, const Int_t &)
TString GetRunType()
Definition: TEcnaRead.cc:759
TCanvas * GetCurrentCanvas()
Int_t GetNbBinsFromMemo(const TString &, const TString &)
TString AsciiFileName()
Int_t GetNotConnectedSCForConsFromIndex(const Int_t &)
void SetHistoPresentation(TH1D *, const TString &)
void ViewDeeGrid(const Int_t &, const TString &)
TVectorD ReadMeanCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:1969
Int_t GetXStinInStas(const Int_t &, const Int_t &, const Int_t &)
Double_t NotConnectedSCH1DBin(const Int_t &)
tuple cout
Definition: gather_cfg.py:121
void NewCanvas(const TString &)
TString SetHistoYAxisTitle(const TString &)
Double_t GetYminFromGraphFrameAndMarginValue(TGraph *, const Double_t)
Int_t GetStexNumber()
Definition: TEcnaRead.cc:749
TString GetIXIYAxisTitle(const TString &)
void SetYVarMemo(const TString &, const TString &, const TString &)
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
Axis_t GetHistoXinf(const TString &, const Int_t &, const TString &)
void ViewStasGrid(const Int_t &)
Long_t GetPointerValue(const TString &)
Definition: TEcnaObject.cc:230
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:1336
void SetYmaxMemoFromValue(const TString &, const Double_t &)
Int_t GetHistoSize(const TString &, const TString &)
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:749
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:818
void SigmaSamplesXtals(const TVectorD &, const Int_t &, const Int_t &, const Int_t &, const TString &)
void ViewSCGrid(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString &)
Bool_t StatusDataExist()
Definition: TEcnaHistos.cc:833
TVectorD ReadNumberOfEvents(const Int_t &)
Definition: TEcnaRead.cc:1663
void GeneralTitle(const TString &)
Definition: TEcnaHistos.cc:798
void PlotCloneOfCurrentCanvas()
void WriteMatrixAscii(const TString &, const TString &, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)