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: 08/04/2010
4 
6 
7 ClassImp(TEcnaHistos)
8 //______________________________________________________________________________
9 //
10 // TEcnaHistos.
11 //
12 //==============> INTRODUCTION
13 //
14 // This class provides methods for displaying plots of various types:
15 // 1D, 2D and 3D histograms for different quantities (pedestals, noises,
16 // correlations, .etc..). The data are read from files which has been
17 // previously written by using the class TEcnaRun (.root result files).
18 // The reading is performed by appropriate methods of the class TEcnaRead.
19 //
20 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21 //
22 // Class TEcnaHistos *** I N S T R U C T I O N S F O R U S E ***
23 //
24 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25 //
26 // // (A) --> Object declarations:
27 //
28 // TEcnaHistos* MyHistosEB = new TEcnaHistos("EB");
29 // TEcnaHistos* MyHistosEE = new TEcnaHistos("EE");
30 //
31 // // (B) --> Specification of the file which has to be read.
32 // // This file is a .root result file which has previously been written by means of
33 // // the class TEcnaRun (see documentation of this class)
34 //
35 // // 1) specify the parameter values of the file name:
36 //
37 // TString AnalysisName = "StdPed12"; (AnalysisName -> explanation in TEcnaRun documentation)
38 // Int_t NbOfSamples = 10;
39 // Int_t RunNumber = 112206;
40 // Int_t FirstReqEvtNumber = 1;
41 // Int_t LastReqEvtNumber = 150;
42 // Int_t ReqNbOfEvts = 150;
43 // Int_t SM or Dee Number = 2;
44 //
45 // // 2) call method "FileParameters" to say that the file to be read is the file
46 // // which name parameters are those specified above:
47 //
48 // MyHistosEB->FileParameters(AnalysisName, NbOfSamples, RunNumber,
49 // FirstReqEvtNumber, LastReqEvtNumber, ReqNbOfEvts, SMNumber);
50 //
51 // // Now, the class TEcnaHistos knowns that it has to work
52 // // with the file StdPed12_S1_10_R16467_0_150_SM6.root
53 //
54 // // (C) --> E X A M P L E S O F U S E
55 //
56 // //--> Plot correlation matrices between samples
57 // // for channel 21 (electronic channel number in Tower)
58 // // and for the two towers 10 and 33
59 //
60 // Int_t TowEcha = 21; // (Electronic channel number in tower)
61 // MyHistosEB->CorrelationsBetweenSamples(SMTower_X, TowEcha, "SURF1Z");
62 // MyHistosEB->CorrelationsBetweenSamples(SMTower_Y, TowEcha, "SURF1Z");
63 //
64 // //--> Plot Pedestals as a function of SC number for Dee 4
65 //
66 // TString AnalysisName = "StdPed12";
67 // Int_t NbOfSamples = 10;
68 // Int_t RunNumber = 112592;
69 // Int_t FirstReqEvtNumber = 1;
70 // Int_t LastReqEvtNumber = 150;
71 // Int_t ReqNbOfEvts = 150;
72 //
73 // Int_t DeeNumber = 4;
74 // MyHistosEE->FileParameters(AnalysisName, NbOfSamples, RunNumber,
75 // FirstReqEvtNumber, LastReqEvtNumber, ReqNbOfEvts, DeeNumber);
76 // MyHistosEE->DeeXtalsPedestals();
77 //
78 // //--> Plot total noise history for channel 12 of tower 38
79 // // (electronic channel number in tower)
80 //
81 // MyHistosEB->FileParameters(AnalysisName, NbOfSamples, RunNumber,
82 // FirstReqEvtNumber, LastReqEvtNumber, ReqNbOfEvts, SMNumber);
83 // Int_t SMTower = 38;
84 // Int_t TowEcha = 12;
85 // TString list_of_run_file_name = "HistoryRunList_SM6.ascii";
86 // MyHistoEB->XtalTimeTotalNoise(list_of_run_file_name, SMTower, TowEcha, "SAME");
87 //
88 // // the .ascii file "HistoryRunList_SM6.ascii" must contain a list of
89 // // the run numbers according to the following syntax:
90 //
91 // //.......... SYNTAX OF THE FILE "HistoryRunList_SM6.ascii" ("runlist history plot" file):
92 //
93 // HistoryRunList_SM6.ascii <- 1rst line: comment (name of the file, for example)
94 //
95 // 73677 <- other lines: run numbers
96 // 73688
97 // <- (empty lines can be used)
98 // 73689
99 // 73690
100 // 73692
101 //
102 //
103 // etc...
104 //
105 //
106 //------------------------------------------- LIST OF METHODS ------------------------------------------
107 //
108 //######################################################################################################
109 //
110 // Examples for use are in file TEcnaHistosTest.cc (in directory test)
111 // =================
112 //
113 //######################################################################################################
114 
115 // //==================================================================================================
116 // // method to set the result file name parameters (from values in argument)
117 // // FileParameters(AnaType, NbOfSamples, Run#,
118 // // FirstRequestedEvt#, LastRequestedEvt#, ReqNbOfEvts#, SM# or Dee#)
119 // // RunNumber = 0 => history plots, SM or Dee number = 0 => Plots for EB or EE
120 // //==================================================================================================
121 //
122 // void FileParameters(const TString Analysis,
123 // const Int_t& NbOfSamples,
124 // const Int_t& Run#, // RunNumber = 0 => history plots
125 // const Int_t& FirstRequestedEvt#,
126 // const Int_t& LastRequestedEvt#,
127 // const Int_t& ReqNbOfEvts#,
128 // const Int_t& SMOrDee#); // SM or Dee number = 0 => Plots for EB or EE
129 //
130 // -----------------------------------------------------------------------------------
131 // In the following:
132 //
133 // TowOrSC# = Tower number in case of EB or SC number FOR CONSTRUCTION in case of EE
134 //
135 // -----------------------------------------------------------------------------------
136 //
137 // //==================================================================================================
138 // // methods for displaying the correlations and covariances matrices
139 // // DrawOption = ROOT DrawOption ("SAME", "LEGO", "COLZ", etc...)
140 // // + option "ASCII": write histo in ASCII file
141 // //==================================================================================================
142 // void LowFrequencyMeanCorrelationsBetweenTowers (const TString DrawOption); // SubDet: specific EB
143 // void LowFrequencyMeanCorrelationsBetweenSCs (const TString DrawOption); // SubDet: specific EE
144 // void HighFrequencyMeanCorrelationsBetweenTowers(const TString DrawOption); // SubDet: specific EB
145 // void HighFrequencyMeanCorrelationsBetweenSCs (const TString DrawOption); // SubDet: specific EE
146 //
147 // void LowFrequencyCorrelationsBetweenChannels
148 // (const Int_t& TowOrSC#, const Int_t& Tow'OrSC'#, const TString DrawOption); // SubDet: EB or EE
149 // void LowFrequencyCovariancesBetweenChannels
150 // (const Int_t& TowOrSC#, const Int_t& Tow'OrSC'#, const TString DrawOption); // SubDet: EB or EE
151 // void HighFrequencyCorrelationsBetweenChannels
152 // (const Int_t& TowOrSC#, const Int_t& Tow'OrSC'#, const TString DrawOption); // SubDet: EB or EE
153 // void HighFrequencyCovariancesBetweenChannels
154 // (const Int_t& TowOrSC#, const Int_t& Tow'OrSC'#, const TString DrawOption); // SubDet: EB or EE
155 //
156 // void CorrelationsBetweenSamples
157 // (const Int_t& TowOrSC#, const Int_t& Channel#inTowOrSC, const TString DrawOption); // SubDet: EB or EE
158 // void CovariancesBetweenSamples
159 // (const Int_t& TowOrSC#, const Int_t& Channel#inTowOrSC, const TString DrawOption); // SubDet: EB or EE
160 //
161 // //==================================================================================================
162 // // methods for displaying 2D view of the whole subdetector; (eta,Phi) for EB, (IX,IY) for EE
163 // //==================================================================================================
164 // void EBEtaPhiAveragedNumberOfEvents(); // SubDet: specific EB
165 // void EBEtaPhiAveragedPedestals(); // SubDet: specific EB
166 // void EBEtaPhiAveragedTotalNoise(); // SubDet: specific EB
167 // void EBEtaPhiAveragedMeanOfCorss(); // SubDet: specific EB
168 // void EBEtaPhiAveragedLowFrequencyNoise(); // SubDet: specific EB
169 // void EBEtaPhiAveragedHighFrequencyNoise(); // SubDet: specific EB
170 // void EBEtaPhiAveragedSigmaOfCorss(); // SubDet: specific EB
171 //
172 // void EEIXIYAveragedNumberOfEvents(); // SubDet: specific EE
173 // void EEIXIYAveragedPedestals(); // SubDet: specific EE
174 // void EEIXIYAveragedTotalNoise(); // SubDet: specific EE
175 // void EEIXIYAveragedMeanOfCorss(); // SubDet: specific EE
176 // void EEIXIYAveragedLowFrequencyNoise(); // SubDet: specific EE
177 // void EEIXIYAveragedHighFrequencyNoise(); // SubDet: specific EE
178 // void EEIXIYAveragedSigmaOfCorss(); // SubDet: specific EE
179 //
180 // //==================================================================================================
181 // // methods for displaying SM 2D(eta,phi) and Dee 2D(IX,IY) view
182 // //==================================================================================================
183 // void SMEtaPhiNumberOfEvents(); // SubDet: specific EB
184 // void SMEtaPhiPedestals(); // SubDet: specific EB
185 // void SMEtaPhiTotalNoise(); // SubDet: specific EB
186 // void SMEtaPhiMeanOfCorss(); // SubDet: specific EB
187 // void SMEtaPhiLowFrequencyNoise(); // SubDet: specific EB
188 // void SMEtaPhiHighFrequencyNoise(); // SubDet: specific EB
189 // void SMEtaPhiSigmaOfCorss(); // SubDet: specific EB
190 //
191 // void SMEtaPhiLowFrequencyCorcc(); // SubDet: specific EB
192 // void SMEtaPhiHighFrequencyCorcc(); // SubDet: specific EB
193 //
194 // void DeeIXIYNumberOfEvents(); // SubDet: specific EE
195 // void DeeIXIYPedestals(); // SubDet: specific EE
196 // void DeeIXIYTotalNoise(); // SubDet: specific EE
197 // void DeeIXIYMeanOfCorss(); // SubDet: specific EE
198 // void DeeIXIYLowFrequencyNoise(); // SubDet: specific EE
199 // void DeeIXIYHighFrequencyNoise(); // SubDet: specific EE
200 // void DeeIXIYSigmaOfCorss(); // SubDet: specific EE
201 //
202 // void DeeIXIYLowFrequencyCorcc(); // SubDet: specific EE
203 // void DeeIXIYHighFrequencyCorcc(); // SubDet: specific EE
204 //
205 // //==================================================================================================
206 // // methods for displaying 1D histos
207 // //
208 // // PlotOption: optional argument ("ONLYONE", "SAME","SAME n" or "ASCII")
209 // //
210 // // "ONLYONE" : display only one histo (default; same as without argument)
211 // // "SAME" : Same as Draw Option "SAME" in ROOT: superimpose on previous picture in the same pad
212 // // 1D histos of only one quantity
213 // // "SAME n" : Same as Draw Option "SAME" in ROOT: superimpose on previous picture in the same pad
214 // // 1D histos of possibly several quantities
215 // // "ASCII" : write histo contents in ASCII file
216 // //
217 // // Codification for the method names: [part of detector][X axis][Y axis](...)
218 // //
219 // // Examples: SMXtalsTotalNoise(...) : Total noise as a function of Xtal number for one SM
220 // // XtalSamplesSigma(...) : Sigma as a function of sample number for one Xtal
221 // // DeeLowFrequencyNoiseXtals(...) : Low Fq noise distribution over the Xtals for one Dee
222 // // XtalTimePedestals(...) : Pedestal evolution in time for one Xtal (history plot)
223 // // XtalTimePedestalsRuns(...) : Pedestal distribution over runs for one Xtal
224 // // (projection of the history plot on Y axis)
225 // // etc...
226 // //
227 // //==================================================================================================
228 // void SMXtalsNumberOfEvents ([const TString PlotOption]); // SubDet: specific EB
229 // void SMXtalsPedestals ([const TString PlotOption]); // SubDet: specific EB
230 // void SMXtalsTotalNoise ([const TString PlotOption]); // SubDet: specific EB
231 // void SMXtalsMeanOfCorss ([const TString PlotOption]); // SubDet: specific EB
232 // void SMXtalsLowFrequencyNoise ([const TString PlotOption]); // SubDet: specific EB
233 // void SMXtalsHighFrequencyNoise([const TString PlotOption]); // SubDet: specific EB
234 // void SMXtalsSigmaOfCorss ([const TString PlotOption]); // SubDet: specific EB
235 //
236 // void SMNumberOfEventsXtals ([const TString PlotOption]); // SubDet: specific EB
237 // void SMPedestalsXtals ([const TString PlotOption]); // SubDet: specific EB
238 // void SMTotalNoiseXtals ([const TString PlotOption]); // SubDet: specific EB
239 // void SMMeanOfCorssXtals ([const TString PlotOption]); // SubDet: specific EB
240 // void SMLowFrequencyNoiseXtals ([const TString PlotOption]); // SubDet: specific EB
241 // void SMHighFrequencyNoiseXtals([const TString PlotOption]); // SubDet: specific EB
242 // void SMSigmaOfCorssXtals ([const TString PlotOption]); // SubDet: specific EB
243 //
244 // void DeeXtalsNumberOfEvents ([const TString PlotOption]); // SubDet: specific EE
245 // void DeeXtalsPedestals ([const TString PlotOption]); // SubDet: specific EE
246 // void DeeXtalsTotalNoise ([const TString PlotOption]); // SubDet: specific EE
247 // void DeeXtalsMeanOfCorss ([const TString PlotOption]); // SubDet: specific EE
248 // void DeeXtalsLowFrequencyNoise ([const TString PlotOption]); // SubDet: specific EE
249 // void DeeXtalsHighFrequencyNoise([const TString PlotOption]); // SubDet: specific EE
250 // void DeeXtalsSigmaOfCorss ([const TString PlotOption]); // SubDet: specific EE
251 //
252 // void DeeNumberOfEventsXtals ([const TString PlotOption]); // SubDet: specific EE
253 // void DeePedestalsXtals ([const TString PlotOption]); // SubDet: specific EE
254 // void DeeTotalNoiseXtals ([const TString PlotOption]); // SubDet: specific EE
255 // void DeeMeanOfCorssXtals ([const TString PlotOption]); // SubDet: specific EE
256 // void DeeLowFrequencyNoiseXtals ([const TString PlotOption]); // SubDet: specific EE
257 // void DeeHighFrequencyNoiseXtals([const TString PlotOption]); // SubDet: specific EE
258 // void DeeSigmaOfCorssXtals ([const TString PlotOption]); // SubDet: specific EE
259 //
260 // void XtalSamplesEv(const Int_t& TowOrSC#, const Int_t& Channel#inTowOrSC,
261 // [const TString PlotOption]); // SubDet: EB or EE
262 // void XtalSamplesSigma(const Int_t& TowOrSC#, const Int_t& Channel#inTowOrSC,
263 // [const TString PlotOption]); // SubDet: EB or EE
264 // void XtalSampleValues(const Int_t& TowOrSC#, const Int_t& Channel#inTowOrSC,
265 // const Int_t& Sample#, [const TString PlotOption]); // SubDet: EB or EE
266 // void SampleADCEvents(const Int_t& TowOrSC#, const Int_t& Channel#inTowOrSC,
267 // const Int_t& Sample#, [const TString PlotOption]); // SubDet: EB or EE
268 //
269 // //==================================================================================================
270 // // methods for displaying 1D history plots
271 // //==================================================================================================
272 // void XtalTimePedestals(const TString ListOfRunFileName, const Int_t& TowOrSC#,
273 // const Int_t& Channel#inTowOrSC, [const TString PlotOption]); // SubDet: EB or EE
274 //
275 // void XtalTimeTotalNoise(const TString ListOfRunFileName, const Int_t& TowOrSC#,
276 // const Int_t& Channel#inTowOrSC, [const TString PlotOption]); // SubDet: EB or EE
277 //
278 // void XtalTimeMeanOfCorss(const TString ListOfRunFileName, const Int_t& TowOrSC#,
279 // const Int_t& Channel#inTowOrSC, [const TString PlotOption]); // SubDet: EB or EE
280 //
281 // void XtalTimeLowFrequencyNoise(const TString ListOfRunFileName, const Int_t& TowOrSC#,
282 // const Int_t& Channel#inTowOrSC, [const TString PlotOption]); // SubDet: EB or EE
283 //
284 // void XtalTimeHighFrequencyNoise(const TString ListOfRunFileName, const Int_t& TowOrSC#,
285 // const Int_t& Channel#inTowOrSC, [const TString PlotOption]); // SubDet: EB or EE
286 //
287 // void XtalTimeSigmaOfCorss(const TString ListOfRunFileName, const Int_t& TowOrSC#,
288 // const Int_t& Channel#inTowOrSC, [const TString PlotOption]); // SubDet: EB or EE
289 //
290 // //==================================================================================================
291 // // methods for displaying Nb of run distribution plots (1D history plot Y projection)
292 // //==================================================================================================
293 // void XtalPedestalsRuns(const TString ListOfRunFileName, const Int_t& TowOrSC#,
294 // const Int_t& Channel#inTowOrSC, [const TString PlotOption]); // SubDet: EB or EE
295 //
296 // void XtalTotalNoiseRuns(const TString ListOfRunFileName, const Int_t& TowOrSC#,
297 // const Int_t& Channel#inTowOrSC, [const TString PlotOption]); // SubDet: EB or EE
298 //
299 // void XtalMeanOfCorssRuns(const TString ListOfRunFileName, const Int_t& TowOrSC#,
300 // const Int_t& Channel#inTowOrSC, [const TString PlotOption]); // SubDet: EB or EE
301 //
302 // void XtalLowFrequencyNoiseRuns(const TString ListOfRunFileName, const Int_t& TowOrSC#,
303 // const Int_t& Channel#inTowOrSC, [const TString PlotOption]); // SubDet: EB or EE
304 //
305 // void XtalHighFrequencyNoiseRuns(const TString ListOfRunFileName, const Int_t& TowOrSC#,
306 // const Int_t& Channel#inTowOrSC, [const TString PlotOption]); // SubDet: EB or EE
307 //
308 // void XtalSigmaOfCorssRuns(const TString ListOfRunFileName, const Int_t& TowOrSC#,
309 // const Int_t& Channel#inTowOrSC, [const TString PlotOption]); // SubDet: EB or EE
310 //
311 // //==================================================================================================
312 // // methods for displaying Tower, SC, crystal numbering
313 // //==================================================================================================
314 //
315 // void SMTowerNumbering(const Int_t& SM#); // SubDet: specific EB
316 // void DeeSCNumbering (const Int_t& Dee#); // SubDet: specific EE
317 //
318 // void TowerCrystalNumbering(const Int_t& SM#, const Int_t& Tow#); // SubDet: specific EB
319 // void SCCrystalNumbering (const Int_t& Dee#, const Int_t& SC#); // SubDet: specific EE
320 // // (SC# for construction)
321 //
322 // //==================================================================================================
323 // // General title
324 // //==================================================================================================
325 // void GeneralTitle(const TString Title); // SubDet: EB or EE
326 //
327 // //==================================================================================================
328 // // Lin:Log scale (SCALE = "LIN" or "LOG")
329 // //==================================================================================================
330 // void SetHistoScaleX(const TString SCALE); // SubDet: EB or EE
331 // void SetHistoScaleY(const TString SCALE); // SubDet: EB or EE
332 //
333 // //==================================================================================================
334 // // ColorPalette (OPTION = "ECNAColor" or "Rainbow")
335 // //==================================================================================================
336 // void SetHistoColorPalette(const TString OPTION); // SubDet: EB or EE
337 //
338 // //==================================================================================================
339 // // histo ymin, ymax management
340 // //==================================================================================================
341 //
342 // // These methods must be called before calls to the display methods
343 //
344 // //.................................. 1D and 2D histo ymin,ymax forced to user's values
345 // void SetHistoMin(const Double_t& YminValue); // SubDet: EB or EE
346 // void SetHistoMax(const Double_t& YmaxValue); // SubDet: EB or EE
347 //
348 // //.................................. 1D and 2D histo ymin,ymax calculated from histo values
349 // void SetHistoMin(); // SubDet: EB or EE
350 // void SetHistoMax(); // SubDet: EB or EE
351 //
352 // if SetHistoMin and SetHistoMax are not called, default values are applied. These default values
353 // are in methods GetYminDefaultValue(...) and GetYmaxDefaultValue(...) of class TEcnaParHistos
354 //
355 //------------------------------------------------------------------------------------------------------
356 
357 //-----------------------------------------------------------------------------------------------------
358 //
359 // Location of the ECNA web page:
360 //
361 // http://cms-fabbro.web.cern.ch/cms-fabbro/cna_new/Correlated_Noise_Analysis/ECNA_main_page.htm
362 //
363 //------------------------------ TEcnaHistos.cc ---------------------------
364 //
365 // Creation (first version): 18 April 2005
366 //
367 // For questions or comments, please send e-mail to Bernard Fabbro:
368 //
369 // fabbro@hep.saclay.cea.fr
370 //
371 //------------------------------------------------------------------------
372 
373 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
374 //
375 // (attributes) ===> TEcnaParPaths --->|
376 // TEcnaParEcal --->|
377 // TEcnaWrite ---> TEcnaParPaths --->|
378 // TEcnaParCout --->|
379 // TEcnaParEcal --->|
380 // TEcnaNumbering ---> TEcnaParEcal --->|
381 // TEcnaParHistos ---> TEcnaParEcal --->|
382 // TEcnaNumbering ---> TEcnaParEcal --->|
383 // TEcnaNumbering ---> TEcnaParEcal --->|
384 //
385 // TEcnaRead ---> TEcnaParCout --->|
386 // TEcnaParPaths --->|
387 // TEcnaHeader --->|
388 // TEcnaParEcal --->|
389 // TEcnaWrite ---> TEcnaParPaths --->|
390 // TEcnaParCout --->|
391 // TEcnaParEcal --->|
392 // TEcnaNumbering ---> TEcnaParEcal --->|
393 // TEcnaNumbering ---> TEcnaParEcal --->|
394 //
395 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
397 {
398  //destructor
399 
400  if (fT1DRunNumber != 0){delete [] fT1DRunNumber; fCdelete++;}
401 
402  //if (fCnaParHistos != 0){delete fCnaParHistos; fCdelete++;}
403  //if (fCnaParPaths != 0){delete fCnaParPaths; fCdelete++;}
404  //if (fCnaParCout != 0){delete fCnaParCout; fCdelete++;}
405  //if (fCnaWrite != 0){delete fCnaWrite; fCdelete++;}
406  //if (fEcal != 0){delete fEcal; fCdelete++;}
407  //if (fEcalNumbering != 0){delete fEcalNumbering; fCdelete++;}
408 
409  if (fMyRootFile != 0){delete fMyRootFile; fCdelete++;}
410 
411 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
412 
413  if ( fCnew != fCdelete )
414  {
415  cout << "*TEcnaHistos> WRONG MANAGEMENT OF ALLOCATIONS: fCnew = "
416  << fCnew << ", fCdelete = " << fCdelete << fTTBELL << endl;
417  }
418  else
419  {
420  // cout << "*TEcnaHistos> BRAVO! GOOD MANAGEMENT OF ALLOCATIONS: fCnew = "
421  // << fCnew << ", fCdelete = " << fCdelete << endl;
422  }
423 
424 #define MGRA
425 #ifndef MGRA
426  if ( fCnewRoot != fCdeleteRoot )
427  {
428  cout << "*TEcnaHistos> WRONG MANAGEMENT OF ROOT ALLOCATIONS: fCnewRoot = "
429  << fCnewRoot << ", fCdeleteRoot = " << fCdeleteRoot << endl;
430  }
431  else
432  {
433  cout << "*TEcnaHistos> BRAVO! GOOD MANAGEMENT OF ROOT ALLOCATIONS:"
434  << " fCnewRoot = " << fCnewRoot <<", fCdeleteRoot = "
435  << fCdeleteRoot << endl;
436  }
437 #endif // MGRA
438 
439  // cout << "TEcnaHistos> Leaving destructor" << endl;
440  // cout << " fCnew = " << fCnew << ", fCdelete = " << fCdelete << endl;
441 
442  // cout << "[Info Management] CLASS: TEcnaHistos. DESTROY OBJECT: this = " << this << endl;
443 
444 }
445 
446 //===================================================================
447 //
448 // Constructors
449 //
450 //===================================================================
452 // Constructor without argument. Call to Init()
453 
454  // cout << "[Info Management] CLASS: TEcnaHistos. CREATE OBJECT: this = " << this << endl;
455 
456  Init();
457 }
458 TEcnaHistos::TEcnaHistos(const TString SubDet)
459 {
460 
461  // cout << "[Info Management] CLASS: TEcnaHistos. CREATE OBJECT: this = " << this << endl;
462 
463  Init();
464 
465  //----------------------- Object management
466  fCnaParCout = 0; fCnaParCout = new TEcnaParCout(); /*fCnew++*/
467 
468  fCnaParPaths = 0; fCnaParPaths = new TEcnaParPaths(); /*fCnew++*/
471 
472  //......... Set SubDetector ("EB" or "EE")
473  TEcnaParEcal* pEcal = 0;
474  TEcnaParHistos* pCnaParHistos = 0;
475  TEcnaNumbering* pEcalNumbering = 0;
476  TEcnaWrite* pCnaWrite = 0;
477 
478  SetEcalSubDetector(SubDet.Data(), pEcal, pCnaParHistos, pEcalNumbering, pCnaWrite);
479  //......... init ymin,ymax histos -> Default values for Ymin and Ymax
481 }
482 
483 TEcnaHistos::TEcnaHistos(const TString SubDet,
484  const TEcnaParPaths* pCnaParPaths,
485  const TEcnaParCout* pCnaParCout,
486  const TEcnaParEcal* pEcal,
487  const TEcnaParHistos* pCnaParHistos,
488  const TEcnaNumbering* pEcalNumbering,
489  const TEcnaWrite* pCnaWrite)
490 {
491 // Constructor with argument. Call to Init() and set the subdetector flag
492 
493  // cout << "[Info Management] CLASS: TEcnaHistos. CREATE OBJECT: this = " << this << endl;
494 
495  Init();
496 
497  //----------------------- Object management
498  fCnaParCout = 0;
499  if( pCnaParCout == 0 )
500  {fCnaParCout = new TEcnaParCout(); /*fCnew++*/ ;}
501  else
502  {fCnaParCout = (TEcnaParCout*)pCnaParCout;}
503 
504  fCnaParPaths = 0;
505  if( pCnaParPaths == 0 )
506  {fCnaParPaths = new TEcnaParPaths(); /*fCnew++*/ ;}
507  else
508  {fCnaParPaths = (TEcnaParPaths*)pCnaParPaths;}
509 
512 
513  //......... Set SubDetector ("EB" or "EE")
514  SetEcalSubDetector(SubDet.Data(), pEcal, pCnaParHistos, pEcalNumbering, pCnaWrite);
515  //......... init ymin,ymax histos -> Default values for Ymin and Ymax
517 }
518 
520 {
521 //========================= GENERAL INITIALISATION
522  fCnew = 0;
523  fCdelete = 0;
524  fCnewRoot = 0;
525  fCdeleteRoot = 0;
526 
527  fCnaCommand = 0;
528  fCnaError = 0;
529 
530  fgMaxCar = 512;
531  fZerv = 0;
532 
533  //------------------------------ initialisations ----------------------
534  fTTBELL = '\007';
535 
536  fT1DRunNumber = 0;
537 
538  //........................ init code plot type (Init)
539  Int_t MaxCar = fgMaxCar;
540  fOnlyOnePlot.Resize(MaxCar);
541  fOnlyOnePlot = "ONLYONE";
542 
543  MaxCar = fgMaxCar;
544  fSeveralPlot.Resize(MaxCar);
545  fSeveralPlot = "SAME";
546 
547  MaxCar = fgMaxCar;
548  fSameOnePlot.Resize(MaxCar);
549  fSameOnePlot = "SAME n";
550 
551  //.......... init flags Same plot
568  //.......... init flags colors (Init)
585  //.......... init counter Same canvas
602  //................. Flag Scale X anf Y set to "LIN" and flag color palete set to "Black/Red/Blue"
603 
604  MaxCar = fgMaxCar;
605  fFlagScaleX.Resize(MaxCar);
606  fFlagScaleX = "LIN";
607 
608  MaxCar = fgMaxCar; // (Init)
609  fFlagScaleY.Resize(MaxCar);
610  fFlagScaleY = "LIN";
611 
612  MaxCar = fgMaxCar;
613  fFlagColPal.Resize(MaxCar);
614  fFlagColPal = "Black/Red/Blue";
615 
616  //................. Flag General Title set to empty string
617  MaxCar = fgMaxCar;
618  fFlagGeneralTitle.Resize(MaxCar);
619  fFlagGeneralTitle = "";
620 
621  //................. Init codes Options
622  fOptScaleLinx = 31400;
623  fOptScaleLogx = 31401;
624  fOptScaleLiny = 31402;
625  fOptScaleLogy = 31403;
626 
627  fOptVisLine = 1101;
628  fOptVisPolm = 1102;
629 
630  //............................ (Init)
631  MaxCar = fgMaxCar;
632  fCovarianceMatrix.Resize(MaxCar);
633  fCovarianceMatrix = "Cov";
634  MaxCar = fgMaxCar;
635  fCorrelationMatrix.Resize(MaxCar);
636  fCorrelationMatrix = "Cor";
637 
638  MaxCar = fgMaxCar;
639  fLFBetweenChannels.Resize(MaxCar);
640  fLFBetweenChannels = "MccLow";
641  MaxCar = fgMaxCar;
642  fHFBetweenChannels.Resize(MaxCar);
643  fHFBetweenChannels = "MccHigh";
644 
645  MaxCar = fgMaxCar;
646  fBetweenSamples.Resize(MaxCar);
647  fBetweenSamples = "Mss";
648 
649  MaxCar = fgMaxCar;
650  fLFBetweenStins.Resize(MaxCar);
651  fLFBetweenStins = "MttLow";
652  MaxCar = fgMaxCar;
653  fHFBetweenStins.Resize(MaxCar);
654  fHFBetweenStins = "MttHigh";
655 
656  //.................................. text pave alignement for pave "SeveralChanging" (HistimePlot)
657  fTextPaveAlign = 12; // 1 = left adjusted, 2 = vertically centered
658  fTextPaveFont = 100; // 10*10 = 10*(ID10 = Courier New)
659  fTextPaveSize = (Float_t)0.025; // 0.0xxx = xxx% of the pave size
660  fTextBorderSize = 1; // Pave Border (=>Shadow)
661 
662  //................................. Init Xvar, Yvar, NbBins management for options SAME and SAME n
663  fXMemoH1SamePlus = "";
664  fXMemoD_NOE_ChNb = "";
665  fXMemoD_NOE_ChDs = "";
666  fXMemoD_Ped_ChNb = "";
667  fXMemoD_Ped_ChDs = "";
668  fXMemoD_TNo_ChNb = "";
669  fXMemoD_TNo_ChDs = "";
670  fXMemoD_MCs_ChNb = "";
671  fXMemoD_MCs_ChDs = "";
672  fXMemoD_LFN_ChNb = "";
673  fXMemoD_LFN_ChDs = "";
674  fXMemoD_HFN_ChNb = "";
675  fXMemoD_HFN_ChDs = "";
676  fXMemoD_SCs_ChNb = "";
677  fXMemoD_SCs_ChDs = "";
678  fXMemoD_MSp_Samp = "";
679  fXMemoD_SSp_Samp = "";
680  fXMemoD_Adc_EvDs = "";
681  fXMemoD_Adc_EvNb = "";
682  fXMemoH_Ped_Date = "";
683  fXMemoH_TNo_Date = "";
684  fXMemoH_MCs_Date = "";
685  fXMemoH_LFN_Date = "";
686  fXMemoH_HFN_Date = "";
687  fXMemoH_SCs_Date = "";
688  fXMemoH_Ped_RuDs = "";
689  fXMemoH_TNo_RuDs = "";
690  fXMemoH_MCs_RuDs = "";
691  fXMemoH_LFN_RuDs = "";
692  fXMemoH_HFN_RuDs = "";
693  fXMemoH_SCs_RuDs = "";
694 
695  fYMemoH1SamePlus = "";
696  fYMemoD_NOE_ChNb = "";
697  fYMemoD_NOE_ChDs = "";
698  fYMemoD_Ped_ChNb = "";
699  fYMemoD_Ped_ChDs = "";
700  fYMemoD_TNo_ChNb = "";
701  fYMemoD_TNo_ChDs = "";
702  fYMemoD_MCs_ChNb = "";
703  fYMemoD_MCs_ChDs = "";
704  fYMemoD_LFN_ChNb = "";
705  fYMemoD_LFN_ChDs = "";
706  fYMemoD_HFN_ChNb = "";
707  fYMemoD_HFN_ChDs = "";
708  fYMemoD_SCs_ChNb = "";
709  fYMemoD_SCs_ChDs = "";
710  fYMemoD_MSp_Samp = "";
711  fYMemoD_SSp_Samp = "";
712  fYMemoD_Adc_EvDs = "";
713  fYMemoD_Adc_EvNb = "";
714  fYMemoH_Ped_Date = "";
715  fYMemoH_TNo_Date = "";
716  fYMemoH_MCs_Date = "";
717  fYMemoH_LFN_Date = "";
718  fYMemoH_HFN_Date = "";
719  fYMemoH_SCs_Date = "";
720  fYMemoH_Ped_RuDs = "";
721  fYMemoH_TNo_RuDs = "";
722  fYMemoH_MCs_RuDs = "";
723  fYMemoH_LFN_RuDs = "";
724  fYMemoH_HFN_RuDs = "";
725  fYMemoH_SCs_RuDs = "";
726 
758 
759  //.................................. Init canvas/pad pointers (Init)
760  fCurrentCanvas = 0;
761 
762  fCurrentCanvasName = "?";
763 
764  fCanvH1SamePlus = 0;
765  fCanvD_NOE_ChNb = 0;
766  fCanvD_NOE_ChDs = 0;
767  fCanvD_Ped_ChNb = 0;
768  fCanvD_Ped_ChDs = 0;
769  fCanvD_TNo_ChNb = 0;
770  fCanvD_TNo_ChDs = 0;
771  fCanvD_MCs_ChNb = 0;
772  fCanvD_MCs_ChDs = 0;
773  fCanvD_LFN_ChNb = 0;
774  fCanvD_LFN_ChDs = 0;
775  fCanvD_HFN_ChNb = 0;
776  fCanvD_HFN_ChDs = 0;
777  fCanvD_SCs_ChNb = 0;
778  fCanvD_SCs_ChDs = 0;
779  fCanvD_MSp_Samp = 0;
780  fCanvD_SSp_Samp = 0;
781  fCanvD_Adc_EvDs = 0;
782  fCanvD_Adc_EvNb = 0;
783  fCanvH_Ped_Date = 0;
784  fCanvH_TNo_Date = 0;
785  fCanvH_MCs_Date = 0;
786  fCanvH_LFN_Date = 0;
787  fCanvH_HFN_Date = 0;
788  fCanvH_SCs_Date = 0;
789  fCanvH_Ped_RuDs = 0;
790  fCanvH_TNo_RuDs = 0;
791  fCanvH_MCs_RuDs = 0;
792  fCanvH_LFN_RuDs = 0;
793  fCanvH_HFN_RuDs = 0;
794  fCanvH_SCs_RuDs = 0;
795 
796  fCurrentPad = 0; // (Init)
797 
798  fPadH1SamePlus = 0;
799  fPadD_NOE_ChNb = 0;
800  fPadD_NOE_ChDs = 0;
801  fPadD_Ped_ChNb = 0;
802  fPadD_Ped_ChDs = 0;
803  fPadD_TNo_ChNb = 0;
804  fPadD_TNo_ChDs = 0;
805  fPadD_MCs_ChNb = 0;
806  fPadD_MCs_ChDs = 0;
807  fPadD_LFN_ChNb = 0;
808  fPadD_LFN_ChDs = 0;
809  fPadD_HFN_ChNb = 0;
810  fPadD_HFN_ChDs = 0;
811  fPadD_SCs_ChNb = 0;
812  fPadD_SCs_ChDs = 0;
813  fPadD_MSp_Samp = 0;
814  fPadD_SSp_Samp = 0;
815  fPadD_Adc_EvDs = 0;
816  fPadD_Adc_EvNb = 0;
817  fPadH_Ped_Date = 0;
818  fPadH_TNo_Date = 0;
819  fPadH_MCs_Date = 0;
820  fPadH_LFN_Date = 0;
821  fPadH_HFN_Date = 0;
822  fPadH_SCs_Date = 0;
823  fPadH_Ped_RuDs = 0;
824  fPadH_TNo_RuDs = 0;
825  fPadH_MCs_RuDs = 0;
826  fPadH_LFN_RuDs = 0;
827  fPadH_HFN_RuDs = 0;
828  fPadH_SCs_RuDs = 0;
829 
830  fPavTxtH1SamePlus = 0; // (Init)
831  fPavTxtD_NOE_ChNb = 0;
832  fPavTxtD_NOE_ChDs = 0;
833  fPavTxtD_Ped_ChNb = 0;
834  fPavTxtD_Ped_ChDs = 0;
835  fPavTxtD_TNo_ChNb = 0;
836  fPavTxtD_TNo_ChDs = 0;
837  fPavTxtD_MCs_ChNb = 0;
838  fPavTxtD_MCs_ChDs = 0;
839  fPavTxtD_LFN_ChNb = 0;
840  fPavTxtD_LFN_ChDs = 0;
841  fPavTxtD_HFN_ChNb = 0;
842  fPavTxtD_HFN_ChDs = 0;
843  fPavTxtD_SCs_ChNb = 0;
844  fPavTxtD_SCs_ChDs = 0;
845  fPavTxtD_MSp_Samp = 0;
846  fPavTxtD_SSp_Samp = 0;
847  fPavTxtD_Adc_EvDs = 0;
848  fPavTxtD_Adc_EvNb = 0;
849  fPavTxtH_Ped_Date = 0;
850  fPavTxtH_TNo_Date = 0;
851  fPavTxtH_MCs_Date = 0;
852  fPavTxtH_LFN_Date = 0;
853  fPavTxtH_HFN_Date = 0;
854  fPavTxtH_SCs_Date = 0;
855  fPavTxtH_Ped_RuDs = 0;
856  fPavTxtH_TNo_RuDs = 0;
857  fPavTxtH_MCs_RuDs = 0;
858  fPavTxtH_LFN_RuDs = 0;
859  fPavTxtH_HFN_RuDs = 0;
860  fPavTxtH_SCs_RuDs = 0;
861 
862  fImpH1SamePlus = 0; // (Init)
863  fImpD_NOE_ChNb = 0;
864  fImpD_NOE_ChDs = 0;
865  fImpD_Ped_ChNb = 0;
866  fImpD_Ped_ChDs = 0;
867  fImpD_TNo_ChNb = 0;
868  fImpD_TNo_ChDs = 0;
869  fImpD_MCs_ChNb = 0;
870  fImpD_MCs_ChDs = 0;
871  fImpD_LFN_ChNb = 0;
872  fImpD_LFN_ChDs = 0;
873  fImpD_HFN_ChNb = 0;
874  fImpD_HFN_ChDs = 0;
875  fImpD_SCs_ChNb = 0;
876  fImpD_SCs_ChDs = 0;
877  fImpD_MSp_Samp = 0;
878  fImpD_SSp_Samp = 0;
879  fImpD_Adc_EvDs = 0;
880  fImpD_Adc_EvNb = 0;
881  fImpH_Ped_Date = 0;
882  fImpH_TNo_Date = 0;
883  fImpH_MCs_Date = 0;
884  fImpH_LFN_Date = 0;
885  fImpH_HFN_Date = 0;
886  fImpH_SCs_Date = 0;
887  fImpH_Ped_RuDs = 0;
888  fImpH_TNo_RuDs = 0;
889  fImpH_MCs_RuDs = 0;
890  fImpH_LFN_RuDs = 0;
891  fImpH_HFN_RuDs = 0;
892  fImpH_SCs_RuDs = 0;
893 
894  fNbBinsProj = 100; // number of bins for histos in option Projection
895 
896  //.................................... Miscellaneous parameters (Init)
897 
904 
911 
912  fNbOfExistingRuns = 0;
913 
914  fFapNbOfRuns = -1; // INIT NUMBER OF RUNS: set to -1
915  fFapMaxNbOfRuns = -1; // INIT MAXIMUM NUMBER OF RUNS: set to -1
916 
917  MaxCar = fgMaxCar;
918  fFapFileRuns.Resize(MaxCar);
919  fFapFileRuns = "(file with list of runs parameters: no info)";
920 
921  fStartEvolTime = 0;
922  fStopEvolTime = 0;
923  fStartEvolDate = "Start date: not known";
924  fStopEvolDate = "Stop date: not known";
925 
926  fStartEvolRun = 0;
927  fStopEvolRun = 0;
928 
929  fRunType = "Run type: not known";
930 
931  fFapNbOfEvts = 0;
932 
933  MaxCar = fgMaxCar;
934  fMyRootFileName.Resize(MaxCar);
935  fMyRootFileName = "No ROOT file name available (fMyRootFileName).";
936 
937  fFapAnaType = "Analysis name: not known"; // Init Type of analysis
938  fFapNbOfSamples = 0; // Init Nb of required samples
939  fFapRunNumber = 0; // Init Run number
940  fFapFirstReqEvtNumber = 0; // Init First requested event number
941  fFapLastReqEvtNumber = 0; // Init Last requested event number
942  fFapReqNbOfEvts = 0; // Init Requested number of events
943  fFapStexNumber = 0; // Init Stex number
944 
945  //------------------ Init pointer fMyRootFile
946  fMyRootFile = 0;
947  //------------------ Init fAsciiFileName
948  fAsciiFileName = "?";
949 
950 } // end of Init()
951 
952 //----------------------------------------------------------------------------------------
953 void TEcnaHistos::SetEcalSubDetector(const TString SubDet,
954  const TEcnaParEcal* pEcal,
955  const TEcnaParHistos* pCnaParHistos,
956  const TEcnaNumbering* pEcalNumbering,
957  const TEcnaWrite* pCnaWrite)
958 {
959  // Set Subdetector (EB or EE)
960 
961  fEcal = 0;
962  if( pEcal == 0 )
963  {fEcal = new TEcnaParEcal(SubDet.Data()); /*fCnew++*/ ;}
964  else
965  {fEcal = (TEcnaParEcal*)pEcal;}
966 
967  Int_t MaxCar = fgMaxCar;
968  fFlagSubDet.Resize(MaxCar);
969  fFlagSubDet = fEcal->GetEcalSubDetector(); // fFlagSubDet = "EB" or "EE"
970 
971  fEcalNumbering = 0;
972  if( pEcalNumbering == 0 )
973  {fEcalNumbering = new TEcnaNumbering(fFlagSubDet.Data(), fEcal); /*fCnew++*/ ;}
974  else
975  {fEcalNumbering = (TEcnaNumbering*)pEcalNumbering;}
976 
977  fCnaParHistos = 0;
978  if( pCnaParHistos == 0 )
979  {fCnaParHistos = new TEcnaParHistos(fFlagSubDet.Data(), fEcal, fEcalNumbering); /* fCnew++*/ ;}
980  else
981  {fCnaParHistos = (TEcnaParHistos*)pCnaParHistos;}
982 
983  fCnaWrite = 0;
984  if( pCnaWrite == 0 )
985  {fCnaWrite =
986  new TEcnaWrite(fFlagSubDet.Data(), fCnaParPaths, fCnaParCout, fEcal, fEcalNumbering); /*fCnew++*/ ;}
987  else
988  {fCnaWrite = (TEcnaWrite*)pCnaWrite;}
989 
990  //------------------- creation objet TEcnaRead fMyRootFile (a reprendre plus clairement)
991  fFileHeader = 0;
995 
996  //.................................. Init specific EB/EE parameters ( SetEcalSubDetector(...) )
997  MaxCar = fgMaxCar;
998  fFapStexName.Resize(MaxCar);
999  fFapStexName = "no info for Stex";
1000  MaxCar = fgMaxCar;
1001  fFapStinName.Resize(MaxCar);
1002  fFapStinName = "no info for Stin";
1003  MaxCar = fgMaxCar;
1004  fFapEchaName.Resize(MaxCar);
1005  fFapEchaName = "no info for Echa";
1006 
1007  if( fFlagSubDet == "EB" )
1008  {
1009  fFapStexName = "SM";
1010  fFapStinName = "Tower";
1011  fFapEchaName = "Xtal";
1012  fFapStexBarrel = fEcalNumbering->GetSMHalfBarrel(fFapStexNumber);
1013  }
1014 
1015  if( fFlagSubDet == "EE" )
1016  {
1017  fFapStexName = "Dee";
1018  fFapStinName = "SC";
1019  fFapEchaName = "Xtal";
1020  fFapStexType = fEcalNumbering->GetEEDeeType(fFapStexNumber);
1021  fFapStexDir = "right";
1022  fFapStinQuadType = "top";
1023  }
1024 
1025 } // ---------------- end of SetEcalSubDetector(...) ----------------
1026 
1027 //=============================================================================================
1028 //
1029 // Set lin or log scale on X or Y axis
1030 // Set Color Palette
1031 //
1032 //=============================================================================================
1033 void TEcnaHistos::SetHistoScaleX(const TString option_scale)
1034 {
1035  fFlagScaleX = "LIN";
1036  if ( option_scale == "LOG" ){fFlagScaleX = "LOG";}
1037 }
1038 void TEcnaHistos::SetHistoScaleY(const TString option_scale)
1039 {
1040  fFlagScaleY = "LIN";
1041  if ( option_scale == "LOG" ){fFlagScaleY = "LOG";}
1042 }
1043 void TEcnaHistos::SetHistoColorPalette (const TString option_palette)
1044 {
1045  fFlagColPal = "Black/Red/Blue";
1046  if ( !(option_palette == "Rainbow" || option_palette == "rainbow") ){fFlagColPal = "Black/Red/Blue";}
1047  if ( option_palette == "Rainbow" || option_palette == "rainbow" ){fFlagColPal = "Rainbow";}
1048 }
1049 
1051 {
1052  fFlagGeneralTitle = title.Data();
1053 }
1054 
1055 //====================== return status for root file and data existence
1058 
1059 //=============================================================================================
1060 //
1061 // View matrices
1062 //
1063 //=============================================================================================
1064 
1065 //------------------------------------------------------------------------------ Stin x Stin
1071 {
1072 //Plot low frequency mean correlation matrix between Stins
1073 
1074  Int_t StexStin_A = 0;
1075  Int_t StexStin_B = 0;
1076  Int_t MatrixBinIndex = 0;
1077 
1078  TString MatrixProbaNature = fCorrelationMatrix;
1079  TString MatrixElement = fLFBetweenStins;
1080 
1081  ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, MatrixProbaNature, MatrixElement, PlotOption);
1082 }
1083 
1089 {
1090 //Plot low frequency mean correlation matrix between Stins
1091 
1092  Int_t StexStin_A = 0;
1093  Int_t StexStin_B = 0;
1094  Int_t MatrixBinIndex = 0;
1095 
1096  TString MatrixProbaNature = fCorrelationMatrix;
1097  TString MatrixElement = fHFBetweenStins;
1098 
1099  ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, MatrixProbaNature, MatrixElement, PlotOption);
1100 }
1101 
1102 //------------------------------------------------------------------------------ Crystal x Crystal
1103 void TEcnaHistos::LowFrequencyCorrelationsBetweenChannels(const Int_t& aStexStin_A, const Int_t& aStexStin_B,
1104  const TString PlotOption)
1105 {
1106  //Plot correlation matrix between crystals of two Stins (mean over samples)
1107 
1108  Int_t StexStin_A = aStexStin_A;
1109  Int_t StexStin_B = aStexStin_B;
1110  if( fFlagSubDet == "EE" )
1111  {
1112  StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);
1113  StexStin_B = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_B);
1114  }
1115 
1116  Int_t MatrixBinIndex = 0;
1117  TString MatrixProbaNature = fCorrelationMatrix;
1118  TString MatrixElement = fLFBetweenChannels;
1119  ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, MatrixProbaNature, MatrixElement, PlotOption);
1120 }
1121 
1122 void TEcnaHistos::LowFrequencyCovariancesBetweenChannels(const Int_t& aStexStin_A, const Int_t& aStexStin_B,
1123  const TString PlotOption)
1124 {
1125  //Plot covariance matrix between crystals of two Stins (mean over samples)
1126 
1127  Int_t StexStin_A = aStexStin_A;
1128  Int_t StexStin_B = aStexStin_B;
1129  if( fFlagSubDet == "EE" )
1130  {
1131  StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);
1132  StexStin_B = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_B);
1133  }
1134 
1135  Int_t MatrixBinIndex = 0;
1136  TString MatrixProbaNature = fCovarianceMatrix;
1137  TString MatrixElement = fLFBetweenChannels;
1138  ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, MatrixProbaNature, MatrixElement, PlotOption);
1139 }
1140 
1141 void TEcnaHistos::HighFrequencyCorrelationsBetweenChannels(const Int_t& aStexStin_A, const Int_t& aStexStin_B,
1142  const TString PlotOption)
1143 {
1144  //Plot correlation matrix between crystals of two Stins (mean over samples)
1145 
1146  Int_t StexStin_A = aStexStin_A;
1147  Int_t StexStin_B = aStexStin_B;
1148  if( fFlagSubDet == "EE" )
1149  {
1150  StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);
1151  StexStin_B = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_B);
1152  }
1153 
1154  Int_t MatrixBinIndex = 0;
1155  TString MatrixProbaNature = fCorrelationMatrix;
1156  TString MatrixElement = fHFBetweenChannels;
1157  ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, MatrixProbaNature, MatrixElement, PlotOption);
1158 }
1159 
1160 void TEcnaHistos::HighFrequencyCovariancesBetweenChannels(const Int_t& aStexStin_A, const Int_t& aStexStin_B,
1161  const TString PlotOption)
1162 {
1163  //Plot covariance matrix between crystals of two Stins (mean over samples)
1164 
1165  Int_t StexStin_A = aStexStin_A;
1166  Int_t StexStin_B = aStexStin_B;
1167  if( fFlagSubDet == "EE" )
1168  {
1169  StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);
1170  StexStin_B = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_B);
1171  }
1172 
1173  Int_t MatrixBinIndex = 0;
1174  TString MatrixProbaNature = fCovarianceMatrix;
1175  TString MatrixElement = fHFBetweenChannels;
1176  ViewMatrix(StexStin_A, StexStin_B, MatrixBinIndex, MatrixProbaNature, MatrixElement, PlotOption);
1177 }
1178 
1179 //------------------------------------------------------------------------------ Sample x Sample
1180 
1181 void TEcnaHistos::CorrelationsBetweenSamples(const Int_t& aStexStin_A, const Int_t& i0StinEcha,
1182  const TString PlotOption)
1183 {
1184 //Plot correlation matrix between samples for a given i0StinEcha in a given StexStin
1185 
1186  Int_t StexStin_A = aStexStin_A;
1187  if( fFlagSubDet == "EE" )
1188  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
1189 
1190  Int_t StexStin_B = 0;
1191  TString MatrixProbaNature = fCorrelationMatrix;
1192  TString MatrixElement = fBetweenSamples;
1193 
1194  ViewMatrix(StexStin_A, StexStin_B, i0StinEcha, MatrixProbaNature, MatrixElement, PlotOption);
1195 }
1196 
1197 //.............................................................................. Covariances
1198 void TEcnaHistos::CovariancesBetweenSamples(const Int_t& aStexStin_A, const Int_t& i0StinEcha,
1199  const TString PlotOption)
1200 {
1201 //Plot covariance matrix between samples for a given i0StinEcha
1202 
1203  Int_t StexStin_A = aStexStin_A;
1204  if( fFlagSubDet == "EE" )
1205  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
1206 
1207  Int_t StexStin_B = 0;
1208  TString MatrixProbaNature = fCovarianceMatrix;
1209  TString MatrixElement = fBetweenSamples;
1210 
1211  ViewMatrix(StexStin_A, StexStin_B, i0StinEcha, MatrixProbaNature, MatrixElement, PlotOption);
1212 }
1213 //=============================================================================================================
1214 //
1215 // ViewMatrix
1216 //
1217 // MatrixBinIndex: = i0StinEcha if cov(s,s'), cor(s,s')
1218 // = 0 if cov(c,c'), cor(c,c'), cov(Stin,Stin'), cor(Stin,Stin')
1219 //
1220 // ViewMatrix(StexStin_A , StexStin_B, MatrixBinIndex, MatrixProbaNature, MatrixElement, PlotOption)
1221 // ViewMatrix(StexStin_A , 0, i0StinEcha , MatrixProbaNature, MatrixElement, PlotOption)
1222 // Output:
1223 // Plot of cov(s,s') or cor(s,s') matrix for i0StinEcha of StexStin_A
1224 //
1225 // ViewMatrix(StexStin_A , StexStin_B, MatrixBinIndex, MatrixProbaNature, MatrixElement, PlotOption)
1226 // ViewMatrix(StexStin_A , StexStin_B, 0 , MatrixProbaNature, MatrixElement, PlotOption)
1227 // Output:
1228 // Plot of (i0StinEcha of StexStin_A, i0StinEcha of StexStin_B) matrix
1229 //
1230 //=============================================================================================================
1231 void TEcnaHistos::ViewMatrix(const Int_t& StexStin_A, const Int_t& StexStin_B,
1232  const Int_t& MatrixBinIndex, const TString MatrixProbaNature,
1233  const TString MatrixElement, const TString PlotOption)
1234 {
1235  //Plot correlation or covariance matrix between samples or channels or Stins
1236 
1237  if( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) )
1238  {
1244 
1245  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewMatrix)
1246  {
1247  fStatusFileFound = kTRUE;
1248 
1250  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
1251 
1252  // cout << "*TEcnaHistos::ViewMatrix(...)> Data are analyzed from file ----> "
1253  // << fp_name_short << endl;
1254  //...................................................................... (ViewMatrix)
1255  TVectorD vStin(fEcal->MaxStinEcnaInStex());
1256  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vStin(i)=(Double_t)0.;}
1258 
1259  if( fMyRootFile->DataExist() == kTRUE )
1260  {
1261  fStatusDataExist = kTRUE;
1262 
1263  Int_t Stin_X_ok = 0;
1264  Int_t Stin_Y_ok = 0;
1265 
1266  if( (MatrixElement == fLFBetweenStins) || (MatrixElement == fHFBetweenStins) )
1267  {Stin_X_ok = 1; Stin_Y_ok = 1;}
1268  if( MatrixElement == fBetweenSamples )
1269  {Stin_Y_ok = 1;}
1270 
1271  for (Int_t index_Stin = 0; index_Stin < fEcal->MaxStinEcnaInStex(); index_Stin++)
1272  {
1273  if ( vStin(index_Stin) == StexStin_A ){Stin_X_ok = 1;}
1274  if ( vStin(index_Stin) == StexStin_B ){Stin_Y_ok = 1;}
1275  }
1276  //................................................................. (ViewMatrix)
1277  if( Stin_X_ok == 1 && Stin_Y_ok == 1 )
1278  {
1282 
1283  Int_t MatSize = -1;
1284  Int_t ReadMatSize = -1;
1285  Int_t i0StinEcha = -1;
1286 
1287  //-------------------------- Set values of ReadMatSize, MatSize, i0StinEcha
1288  if( MatrixElement == fBetweenSamples )
1289  {ReadMatSize = fFapNbOfSamples; MatSize = fEcal->MaxSampADC(); i0StinEcha=(Int_t)MatrixBinIndex;}
1290 
1291  if( MatrixElement == fLFBetweenChannels || MatrixElement == fHFBetweenChannels )
1292  {ReadMatSize = fEcal->MaxCrysInStin(); MatSize = fEcal->MaxCrysInStin(); /*i0Sample=MatrixBinIndex;*/}
1293 
1294  if( (MatrixElement == fLFBetweenStins) || (MatrixElement == fHFBetweenStins) )
1295  {ReadMatSize = fEcal->MaxStinEcnaInStex(); MatSize = fEcal->MaxStinInStex();}
1296 
1297  //------------------------------------------------------------------------------------- (ViewMatrix)
1298  if( ( MatrixElement == fLFBetweenStins || MatrixElement == fHFBetweenStins ) ||
1299  ( MatrixElement == fLFBetweenChannels || MatrixElement == fHFBetweenChannels
1300  /* && (i0Sample >= 0) && (i0Sample < fFapNbOfSamples ) */ ) ||
1301  ( (MatrixElement == fBetweenSamples) && (i0StinEcha >= 0) && (i0StinEcha < fEcal->MaxCrysInStin()) ) )
1302  {
1303  TMatrixD read_matrix(ReadMatSize, ReadMatSize);
1304  for(Int_t i=0; i<ReadMatSize; i++)
1305  {for(Int_t j=0; j<ReadMatSize; j++){read_matrix(i,j)=(Double_t)0.;}}
1306 
1307  if ( MatrixElement == fBetweenSamples && MatrixProbaNature == fCovarianceMatrix )
1308  {read_matrix =
1309  fMyRootFile->ReadCovariancesBetweenSamples(StexStin_A, i0StinEcha, ReadMatSize);}
1310  if ( MatrixElement == fBetweenSamples && MatrixProbaNature == fCorrelationMatrix )
1311  {read_matrix =
1312  fMyRootFile->ReadCorrelationsBetweenSamples(StexStin_A, i0StinEcha, ReadMatSize);}
1313 
1314  if ( MatrixElement == fLFBetweenChannels && MatrixProbaNature == fCovarianceMatrix )
1315  {read_matrix =
1316  fMyRootFile->ReadLowFrequencyCovariancesBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);}
1317  if ( MatrixElement == fLFBetweenChannels && MatrixProbaNature == fCorrelationMatrix )
1318  {read_matrix =
1319  fMyRootFile->ReadLowFrequencyCorrelationsBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);}
1320 
1321  if ( MatrixElement == fHFBetweenChannels && MatrixProbaNature == fCovarianceMatrix )
1322  {read_matrix =
1323  fMyRootFile->ReadHighFrequencyCovariancesBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);}
1324  if ( MatrixElement == fHFBetweenChannels && MatrixProbaNature == fCorrelationMatrix )
1325  {read_matrix =
1326  fMyRootFile->ReadHighFrequencyCorrelationsBetweenChannels(StexStin_A, StexStin_B, ReadMatSize);}
1327 
1328  if ( MatrixElement == fLFBetweenStins && MatrixProbaNature == fCorrelationMatrix )
1329  {read_matrix =
1331  if ( MatrixElement == fHFBetweenStins && MatrixProbaNature == fCorrelationMatrix )
1332  {read_matrix =
1334 
1335  //.......................................................... (ViewMatrix)
1336  if( fMyRootFile->DataExist() == kTRUE )
1337  {
1338  fStatusDataExist = kTRUE;
1339 
1340  if( PlotOption == "ASCII" )
1341  {
1342  WriteMatrixAscii(MatrixElement, MatrixProbaNature,
1343  StexStin_A, MatrixBinIndex, ReadMatSize, read_matrix);
1344  }
1345  else
1346  {
1347  //......................... matrix title (ViewMatrix)
1348  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
1349 
1350  if( MatrixElement == fBetweenSamples && MatrixProbaNature == fCovarianceMatrix )
1351  {sprintf(f_in_mat_tit, "Covariance(Sample, Sample')");}
1352  if( MatrixElement == fBetweenSamples && MatrixProbaNature == fCorrelationMatrix )
1353  {sprintf(f_in_mat_tit, "Correlation(Sample, Sample')");}
1354 
1355  if(fFlagSubDet == "EB" )
1356  {
1357  if( MatrixElement == fLFBetweenStins && MatrixProbaNature == fCorrelationMatrix )
1358  {sprintf(f_in_mat_tit,
1359  "Mean LF |Cor(Xtal,Xtal')| for each (Tower,Tower')");}
1360  if( MatrixElement == fHFBetweenStins && MatrixProbaNature == fCorrelationMatrix )
1361  {sprintf(f_in_mat_tit,
1362  "Mean HF |Cor(Xtal,Xtal')| for each (Tower,Tower')");}
1363  }
1364  if(fFlagSubDet == "EE" )
1365  {
1366  if( MatrixElement == fLFBetweenStins && MatrixProbaNature == fCorrelationMatrix )
1367  {sprintf(f_in_mat_tit,
1368  "Mean LF |Cor(Xtal,Xtal')| for each (SC,SC')");}
1369  if( MatrixElement == fHFBetweenStins && MatrixProbaNature == fCorrelationMatrix )
1370  {sprintf(f_in_mat_tit,
1371  "Mean HF |Cor(Xtal,Xtal')| for each (SC,SC')");}
1372  }
1373 
1374  if( MatrixElement == fLFBetweenChannels && MatrixProbaNature == fCorrelationMatrix )
1375  {
1376  if( fFlagSubDet == "EB" )
1377  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') matrix elts for (Tow,Tow')");}
1378  if( fFlagSubDet == "EE" )
1379  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') matrix elts for (SC,SC')");}
1380  }
1381  if( MatrixElement == fHFBetweenChannels && MatrixProbaNature == fCorrelationMatrix )
1382  {
1383  if( fFlagSubDet == "EB" )
1384  {sprintf(f_in_mat_tit, "HF Cor(Xtal,Xtal') matrix elts for (Tow,Tow')");}
1385  if( fFlagSubDet == "EE" )
1386  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') matrix elts for (SC,SC')");}
1387  }
1388 
1389  //................................. Axis parameters (ViewMatrix)
1390  TString axis_x_var_name;
1391  TString axis_y_var_name;
1392 
1393  char* f_in_axis_x = new char[fgMaxCar]; fCnew++;
1394  char* f_in_axis_y = new char[fgMaxCar]; fCnew++;
1395 
1396  if( MatrixElement == fLFBetweenStins || MatrixElement == fHFBetweenStins )
1397  {
1398  if( fFlagSubDet == "EB" )
1399  {sprintf(f_in_axis_x, " %s number ", fFapStinName.Data());}
1400  if( fFlagSubDet == "EE" )
1401  {sprintf(f_in_axis_x, " %s number for construction ", fFapStinName.Data());}
1402 
1403  axis_x_var_name = f_in_axis_x; axis_y_var_name = f_in_axis_x;
1404  }
1405  if( MatrixElement == fBetweenSamples)
1406  {
1407  axis_x_var_name = " Sample "; axis_y_var_name = " Sample ";
1408  }
1409  if( MatrixElement == fLFBetweenChannels || MatrixElement == fHFBetweenChannels ){
1410  sprintf(f_in_axis_x, " Crystal %s %d ", fFapStinName.Data(), StexStin_A);
1411  sprintf(f_in_axis_y, " Crystal %s %d ", fFapStinName.Data(),StexStin_B);
1412  axis_x_var_name = f_in_axis_x; axis_y_var_name = f_in_axis_y;}
1413 
1414  Int_t nb_binx = MatSize;
1415  Int_t nb_biny = MatSize;
1416  Axis_t xinf_bid = (Axis_t)0.;
1417  Axis_t xsup_bid = (Axis_t)MatSize;
1418  Axis_t yinf_bid = (Axis_t)0.;
1419  Axis_t ysup_bid = (Axis_t)MatSize;
1420 
1421  if( (fFlagSubDet == "EE") &&
1422  (MatrixElement == fLFBetweenStins || MatrixElement == fHFBetweenStins) )
1423  {
1424  if( fFapStexNumber == 1 || fFapStexNumber == 3 )
1425  {
1426  xinf_bid += fEcal->MaxStinInStex();
1427  xsup_bid += fEcal->MaxStinInStex();
1428  yinf_bid += fEcal->MaxStinInStex();
1429  ysup_bid += fEcal->MaxStinInStex();
1430  }
1431  }
1432  //................................................... histogram booking (ViewMatrix)
1433  TH2D* h_fbid0 = new TH2D("bidim", f_in_mat_tit,
1434  nb_binx, xinf_bid, xsup_bid,
1435  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
1436  h_fbid0->Reset();
1437 
1438  h_fbid0->GetXaxis()->SetTitle(axis_x_var_name);
1439  h_fbid0->GetYaxis()->SetTitle(axis_y_var_name);
1440 
1441  //------------------------------------------------ F I L L H I S T O
1442  if( (fFlagSubDet == "EE") &&
1443  (MatrixElement == fLFBetweenStins || MatrixElement == fHFBetweenStins) )
1444  {
1445  for(Int_t i = 0 ; i < ReadMatSize ; i++)
1446  {
1447  for(Int_t j = 0 ; j < ReadMatSize ; j++)
1448  {
1449  Double_t xi_bid =
1451  Double_t xj_bid =
1453  if( xi_bid > 0 && xj_bid > 0 )
1454  {h_fbid0->Fill(xi_bid-1, xj_bid-1, read_matrix(i,j));}
1455  }
1456  }
1457  }
1458  else
1459  {
1460  for(Int_t i = 0 ; i < ReadMatSize ; i++)
1461  {
1462  Double_t xi = (Double_t)i;
1463  for(Int_t j = 0 ; j < ReadMatSize ; j++)
1464  {
1465  Double_t xj = (Double_t)j;
1466  Double_t mat_val = (Double_t)read_matrix(i,j);
1467  h_fbid0->Fill(xi, xj, (Double_t)mat_val);
1468  }
1469  }
1470  }
1471  //--------------- H I S T O M I N / M A X M A N A G E M E N T (ViewMatrix)
1472 
1473  //................................ Put histo min max values
1474  TString quantity_code = "D_MCs_ChNb";
1475  if ( MatrixProbaNature == fCorrelationMatrix )
1476  {
1477  if( MatrixElement == fBetweenSamples ){quantity_code = "D_MCs_ChNb";}
1478 
1479  if( MatrixElement == fLFBetweenChannels ){quantity_code = "H2LFccMosMatrix";}
1480  if( MatrixElement == fHFBetweenChannels ){quantity_code = "H2HFccMosMatrix";}
1481 
1482  if( MatrixElement == fLFBetweenStins ){quantity_code = "H2LFccMosMatrix";}
1483  if( MatrixElement == fHFBetweenStins ){quantity_code = "H2HFccMosMatrix";}
1484  }
1485  if( MatrixProbaNature == fCovarianceMatrix ){quantity_code = "H2HFccMosMatrix";}
1486  //.......... default if flag not set to "ON"
1487  SetYminMemoFromValue(quantity_code, fCnaParHistos->GetYminDefaultValue(quantity_code));
1488  SetYmaxMemoFromValue(quantity_code, fCnaParHistos->GetYmaxDefaultValue(quantity_code));
1489 
1490  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
1491  //................................. User's min and/or max
1492  if( fFlagUserHistoMin == "ON" )
1493  {SetYminMemoFromValue(quantity_code, fUserHistoMin); fFlagUserHistoMin = "OFF";}
1494  if( fFlagUserHistoMax == "ON" )
1495  {SetYmaxMemoFromValue(quantity_code, fUserHistoMax); fFlagUserHistoMax = "OFF";}
1496  //................................. automatic min and/or max
1497  if( fFlagUserHistoMin == "AUTO" )
1498  {SetYminMemoFromValue(quantity_code, h_fbid0->GetMinimum()); fFlagUserHistoMin = "OFF";}
1499  if( fFlagUserHistoMax == "AUTO" )
1500  {SetYmaxMemoFromValue(quantity_code, h_fbid0->GetMaximum()); fFlagUserHistoMax = "OFF";}
1501  //...................................... histo set ymin and ymax (ViewMatrix)
1502  Int_t xFlagAutoYsupMargin = 0;
1503 
1504  if( MatrixProbaNature == fCorrelationMatrix )
1505  {
1506  if(MatrixElement == fBetweenSamples)
1507  {xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "D_MCs_ChNb");}
1508  if( MatrixElement == fLFBetweenStins || MatrixElement == fLFBetweenChannels )
1509  {xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "H2LFccMosMatrix");}
1510  if( MatrixElement == fHFBetweenStins || MatrixElement == fHFBetweenChannels )
1511  {xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "H2HFccMosMatrix");}
1512  //************************** A GARDER EN RESERVE ******************************
1513  //............. special contour level for correlations (square root wise scale)
1514  // Int_t nb_niv = 9;
1515  // Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
1516  // SqrtContourLevels(nb_niv, &cont_niv[0]);
1517  // h_fbid0->SetContour(nb_niv, &cont_niv[0]);
1518  // delete [] cont_niv; fCdelete++;
1519  //******************************** (FIN RESERVE) ******************************
1520  }
1521  if( MatrixProbaNature == fCovarianceMatrix )
1522  {
1523  if (MatrixElement == fBetweenSamples)
1524  {SetYminMemoFromPreviousMemo("D_TNo_ChNb"); // covariance => same level as sigmas
1525  SetYmaxMemoFromPreviousMemo("D_TNo_ChNb");
1526  xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "D_TNo_ChNb");}
1527  if ( MatrixElement == fLFBetweenStins || MatrixElement == fHFBetweenStins ||
1528  MatrixElement == fLFBetweenChannels || MatrixElement == fHFBetweenChannels )
1529  {xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo((TH1D*)h_fbid0, "H2HFccMosMatrix");}
1530  }
1531 
1532  // ----------------------------------------------- P L O T S (ViewMatrix)
1533  char* f_in = new char[fgMaxCar]; fCnew++;
1534 
1535  //...................... Taille/format canvas
1536 
1537  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
1538  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
1539 
1540  //............................. options generales
1541  TString HistoType;
1542  Int_t MaxCar = fgMaxCar;
1543  HistoType.Resize(MaxCar);
1544  HistoType = "(no quantity type info)";
1545 
1546  if (PlotOption == "COLZ" ){HistoType = "colz";}
1547  if (PlotOption == "BOX" ){HistoType = "colz";}
1548  if (PlotOption == "TEXT" ){HistoType = "colz";}
1549  if (PlotOption == "CONTZ" ){HistoType = "colz";}
1550  if (PlotOption == "LEGO2Z"){HistoType = "lego";}
1551  if (PlotOption == "SURF1Z"){HistoType = "surf";}
1552  if (PlotOption == "SURF2Z"){HistoType = "surf";}
1553  if (PlotOption == "SURF3Z"){HistoType = "surf";}
1554  if (PlotOption == "SURF4" ){HistoType = "surf";}
1555 
1556  if( fFlagSubDet == "EB" )
1557  {
1559  SetAllPavesViewMatrix(MatrixElement.Data(), StexStin_A, StexStin_B, i0StinEcha);
1560  }
1561  if( fFlagSubDet == "EE" )
1562  {
1565  SetAllPavesViewMatrix(MatrixElement.Data(), StexStin_A, StexStin_B, i0StinEcha);
1566  }
1567 
1568  //---------------------------------------- Canvas name (ViewMatrix)
1569  TString name_cov_cor;
1570  MaxCar = fgMaxCar;
1571  name_cov_cor.Resize(MaxCar);
1572  name_cov_cor = "?";
1573  if( MatrixProbaNature == fCovarianceMatrix){name_cov_cor = "Covariance";}
1574  if( MatrixProbaNature == fCorrelationMatrix){name_cov_cor = "Correlation";}
1575 
1576  TString name_chan_samp;
1577  MaxCar = fgMaxCar;
1578  name_chan_samp.Resize(MaxCar);
1579  name_chan_samp = "?";
1580 
1581  if( MatrixElement == fLFBetweenStins ){name_chan_samp = "LFccMos";}
1582  if( MatrixElement == fHFBetweenStins ){name_chan_samp = "HFccMos"; }
1583 
1584  if( MatrixElement == fLFBetweenChannels ){name_chan_samp = "LF_cc";}
1585  if( MatrixElement == fHFBetweenChannels ){name_chan_samp = "HF_cc";}
1586 
1587  if(MatrixElement == fBetweenSamples)
1588  {
1589  name_chan_samp = "Between_Samples"; // MatrixBinIndex = i0StinEcha
1590  }
1591 
1592  TString name_visu;
1593  MaxCar = fgMaxCar;
1594  name_visu.Resize(MaxCar);
1595  name_visu = "?";
1596 
1597  name_visu = PlotOption;
1598 
1599  if( (MatrixElement == fLFBetweenStins) || (MatrixElement == fHFBetweenStins) ){
1600  sprintf(f_in, "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%s",
1601  name_cov_cor.Data(), name_chan_samp.Data(),
1604  fFapStexName.Data(), fFapStexNumber,
1605  name_visu.Data());}
1606 
1607  if( MatrixElement == fLFBetweenChannels || MatrixElement == fHFBetweenChannels ){
1608  sprintf(f_in, "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%sX%d_%sY%d_%s",
1609  name_cov_cor.Data(), name_chan_samp.Data(),
1612  fFapStexName.Data(), fFapStexNumber,
1613  fFapStexName.Data(), StexStin_A, fFapStexName.Data(), StexStin_B,
1614  name_visu.Data());}
1615 
1616  if( MatrixElement == fBetweenSamples ){
1617  sprintf(f_in, "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%sX%d_%sY%d_ElecChannel_%d_%s",
1618  name_cov_cor.Data(), name_chan_samp.Data(),
1621  fFapStexName.Data(), fFapStexNumber,
1622  fFapStexName.Data(), StexStin_A, fFapStexName.Data(), StexStin_B,
1623  MatrixBinIndex,
1624  name_visu.Data());}
1625 
1626  //---------------------------------------------------------- (ViewMatrix)
1627 
1628  SetHistoPresentation((TH1D*)h_fbid0, HistoType);
1629  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w , canv_h); fCnewRoot++;
1630  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
1631 
1632  // cout << "*TEcnaHistos::ViewMatrix(...)> Plot is displayed on canvas ----> "
1633  // << fCurrentCanvasName << endl;
1634  // cout << "*TEcnaHistos::ViewMatrix(...)> fCurrentCanvas = " << fCurrentCanvas << endl;
1635 
1636  delete [] f_in; f_in = 0; fCdelete++;
1637 
1638  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
1639  fPavComStex->Draw();
1640 
1641  if(MatrixElement == fLFBetweenChannels || MatrixElement == fHFBetweenChannels)
1642  {fPavComStin->Draw();}
1643  if(MatrixElement == fBetweenSamples)
1644  {fPavComStin->Draw(); fPavComXtal->Draw();}
1645 
1646  fPavComAnaRun->Draw();
1647  fPavComNbOfEvts->Draw();
1648 
1649  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
1650  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
1651  MainCanvas->Divide(1, 1, x_margin, y_margin);
1652  gPad->cd(1);
1653 
1654  //---------------------------------------------------------- (ViewMatrix)
1655  Int_t logy = 0;
1656  gPad->SetLogy(logy);
1657  if( (MatrixElement == fLFBetweenStins) ||
1658  (MatrixElement == fHFBetweenStins) ){gPad->SetGrid(1,1);}
1659  h_fbid0->DrawCopy(PlotOption);
1660  h_fbid0->SetStats((Bool_t)1);
1661  gPad->Update();
1662  h_fbid0->Delete(); h_fbid0 = 0; fCdeleteRoot++;
1663 
1664  //MainCanvas->Delete(); fCdeleteRoot++;
1665  delete [] f_in_axis_x; f_in_axis_x = 0; fCdelete++;
1666  delete [] f_in_axis_y; f_in_axis_y = 0; fCdelete++;
1667  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
1668  }
1669  } // end of if ( fMyRootFile->DataExist() == kTRUE )
1670  else
1671  {
1672  fStatusDataExist = kFALSE;
1673  }
1674  } // end of if ((MatrixElement == fLFBetweenStins) || (MatrixElement == fHFBetweenStins) ) ||
1675  //( (MatrixElement == fBetweenSamples) && (i0StinEcha>= 0) && (i0StinEcha<fEcal->MaxCrysInStin())) ||
1676  //( (MatrixElement == fLFBetweenChannels || MatrixElement == fHFBetweenChannels)
1677  // /* && (i0Sample >= 0) && (i0Sample < fFapNbOfSamples ) */ ) )
1678  else
1679  {
1680  if(MatrixElement == fBetweenSamples)
1681  {
1682  cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* ==> Wrong channel number in "
1683  << fFapStinName.Data() << ". Value = "
1684  << i0StinEcha << " (required range: [0, "
1685  << fEcal->MaxCrysInStin()-1 << "] )"
1686  << fTTBELL << endl;
1687  }
1688 
1689  // if( MatrixElement == fLFBetweenChannels || MatrixElement == fHFBetweenChannels )
1690  // {
1691  // cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* ==> Wrong sample index. Value = "
1692  // << i0Sample << " (required range: [0, "
1693  // << fFapNbOfSamples-1 << "] )"
1694  // << fTTBELL << endl;
1695  //}
1696  }
1697  }
1698  else // else of the if ( Stin_X_ok ==1 && Stin_Y_ok ==1 )
1699  {
1700  //---------------------------------------------------------- (ViewMatrix)
1701  if ( Stin_X_ok != 1 )
1702  {
1703  cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
1704  << fFapStinName.Data() << " "
1706  << fFapStinName.Data() << " not found. Available numbers = ";
1707  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
1708  {
1709  if( vStin(i) > 0 )
1710  {
1711  cout << fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i)) << ", ";
1712  }
1713  }
1714  cout << fTTBELL << endl;
1715  }
1716  if ( Stin_Y_ok != 1 )
1717  {
1718  cout << "*TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
1719  << fFapStinName.Data() << " "
1721  << fFapStinName.Data() << " not found. Available numbers = ";
1722  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
1723  {
1724  if( vStin(i) > 0 )
1725  {
1726  cout << fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i)) << ", ";
1727  }
1728  }
1729  cout << fTTBELL << endl;
1730  }
1731  }
1732  } // end of if ( fMyRootFile->DataExist() == kTRUE )
1733  else
1734  {
1735  fStatusDataExist = kFALSE;
1736  }
1737  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
1738  else
1739  {
1740  fStatusFileFound = kFALSE;
1741  cout << "!TEcnaHistos::ViewMatrix(...)> *ERROR* =====> "
1742  << " ROOT file not found" << fTTBELL << endl;
1743  }
1744  } // ---- end of if( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) ) -----
1745  else
1746  {
1747  cout << "!TEcnaHistos::ViewMatrix(...)> " << fFapStexName.Data()
1748  << " = " << fFapStexNumber << ". Out of range (range = [1,"
1749  << fEcal->MaxStexInStas() << "]) " << fTTBELL << endl;
1750  }
1751 } // end of ViewMatrix(...)
1752 
1753 //==========================================================================
1754 //
1755 // ViewStin ( => option COLZ )
1756 //
1757 //==========================================================================
1758 
1759 void TEcnaHistos::CorrelationsBetweenSamples(const Int_t& StinNumber)
1760 {
1761  TString MatrixProbaNature = fCorrelationMatrix;
1762  ViewStin(StinNumber, MatrixProbaNature);
1763 }
1764 
1765 void TEcnaHistos::CovariancesBetweenSamples(const Int_t& StinNumber)
1766 {
1767  TString MatrixProbaNature = fCovarianceMatrix;
1768  ViewStin(StinNumber, MatrixProbaNature);
1769 }
1770 
1771 //==========================================================================
1772 //
1773 // ViewStin ( => option COLZ )
1774 //
1775 // StexStin ==>
1776 // (sample,sample) cor or cov matrices for all the crystal of StexStin
1777 //
1778 //
1779 //==========================================================================
1780 void TEcnaHistos::ViewStin(const Int_t& cStexStin, const TString MatrixProbaNature)
1781 {
1782  //cor(s,s') or cov(s,s') matrices for all the crystals of one given Stin. Option COLZ mandatory.
1783 
1784  // cStexStin = number for cons (in case of EE)
1785  // StexStin = ECNA number
1786 
1787  if( (fFapStexNumber > 0) && fFapStexNumber <= fEcal->MaxStexInStas() )
1788  {
1789  Int_t StexStin = cStexStin;
1790  if(fFlagSubDet == "EE" )
1791  {StexStin = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, cStexStin);}
1792 
1798 
1799  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewStin)
1800  {
1801  fStatusFileFound = kTRUE;
1802 
1804  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
1805  // cout << "*TEcnaHistos::ViewStin(...)> Data are analyzed from file ----> "
1806  // << fp_name_short << endl;
1807 
1808  TVectorD vStin(fEcal->MaxStinEcnaInStex());
1809  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vStin(i)=(Double_t)0.;}
1811 
1812  if ( fMyRootFile->DataExist() == kTRUE )
1813  {
1814  fStatusDataExist = kTRUE;
1815 
1816  Int_t Stin_ok = 0;
1817  for (Int_t index_Stin = 0; index_Stin < fEcal->MaxStinEcnaInStex(); index_Stin++)
1818  {
1819  if ( vStin(index_Stin) == StexStin ){Stin_ok++;}
1820  }
1821 
1822  if( Stin_ok == 1)
1823  {
1827 
1828  //......................... matrix title (ViewStin)
1829  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
1830 
1831  if ( MatrixProbaNature == fCovarianceMatrix )
1832  {sprintf(f_in_mat_tit, "Xtal's Cov(s,s') matrices in %s.",
1833  fFapStinName.Data());}
1834  if ( MatrixProbaNature == fCorrelationMatrix )
1835  {sprintf(f_in_mat_tit, "Xtal's Cor(s,s') matrices in %s.",
1836  fFapStinName.Data());}
1837 
1838  //................................. Bidim parameters
1839  Int_t GeoBidSize = fEcal->MaxSampADC()*fEcal->MaxCrysHocoInStin();
1840  Int_t nb_binx = GeoBidSize;
1841  Int_t nb_biny = GeoBidSize;
1842  Axis_t xinf_bid = (Axis_t)0.;
1843  Axis_t xsup_bid = (Axis_t)GeoBidSize;
1844  Axis_t yinf_bid = (Axis_t)0.;
1845  Axis_t ysup_bid = (Axis_t)GeoBidSize;
1846 
1847  //--------------------------------------------------------- (ViewStin)
1848  //............. matrices reading and histogram filling
1849 
1850  TH2D* h_geo_bid = new TH2D("geobidim", f_in_mat_tit,
1851  nb_binx, xinf_bid, xsup_bid,
1852  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
1853 
1854  h_geo_bid->Reset();
1855 
1856  //======================================================== (ViewStin)
1857 
1858  //----------------------------------------------- Geographical bidim filling
1859  Int_t ReadMatSize = fFapNbOfSamples;
1860  Int_t MatSize = fEcal->MaxSampADC();
1861  TMatrixD read_matrix(ReadMatSize, ReadMatSize);
1862  for(Int_t i=0; i<ReadMatSize; i++){for(Int_t j=0; j<ReadMatSize; j++)
1863  {read_matrix(i,j)=(Double_t)0.;}}
1864 
1865  Int_t i_data_exist = 0;
1866 
1867  for(Int_t n_crys = 0; n_crys < fEcal->MaxCrysInStin(); n_crys++)
1868  {
1869  if( MatrixProbaNature == fCovarianceMatrix )
1870  {read_matrix = fMyRootFile->ReadCovariancesBetweenSamples(StexStin, n_crys, ReadMatSize);}
1871  if ( MatrixProbaNature == fCorrelationMatrix )
1872  {read_matrix = fMyRootFile->ReadCorrelationsBetweenSamples(StexStin, n_crys, ReadMatSize);}
1873 
1874  if( fMyRootFile->DataExist() == kFALSE )
1875  {
1876  fStatusDataExist = kFALSE;
1877 
1878  cout << "*TEcnaHistos::ViewStin> Exiting loop over the channels." << endl;
1879  break;
1880  }
1881  else
1882  {
1883  fStatusDataExist = kTRUE;
1884 
1885  i_data_exist++;
1886 
1887  for(Int_t i_samp = 0 ; i_samp < ReadMatSize ; i_samp++)
1888  {
1889  Int_t i_xgeo = GetXSampInStin(fFapStexNumber,
1890  StexStin, n_crys, i_samp);
1891  for(Int_t j_samp = 0; j_samp < ReadMatSize ; j_samp++)
1892  {
1893  Int_t j_ygeo = GetYSampInStin(fFapStexNumber,
1894  StexStin, n_crys, j_samp);
1895  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)j_ygeo,
1896  (Double_t)read_matrix(i_samp, j_samp));
1897  }
1898  }
1899  }
1900  }
1901 
1902  //=========== H I S T O M I N / M A X M A N A G E M E N T ======== (ViewStin)
1903  //................................ Put histo min max values
1904  TString quantity_code = "D_MCs_ChNb";
1905  if( MatrixProbaNature == fCorrelationMatrix ){quantity_code = "D_MCs_ChNb";}
1906  if( MatrixProbaNature == fCovarianceMatrix ){quantity_code = "H2HFccMosMatrix";}
1907 
1908  //.......... default if flag not set to "ON"
1909  SetYminMemoFromValue(quantity_code, fCnaParHistos->GetYminDefaultValue(quantity_code));
1910  SetYmaxMemoFromValue(quantity_code, fCnaParHistos->GetYmaxDefaultValue(quantity_code));
1911 
1912  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
1913  //.......... user's min and/or max values
1914  if( fFlagUserHistoMin == "ON" )
1915  {SetYminMemoFromValue(quantity_code, fUserHistoMin); fFlagUserHistoMin = "OFF";}
1916  if( fFlagUserHistoMax == "ON" )
1917  {SetYmaxMemoFromValue(quantity_code, fUserHistoMax); fFlagUserHistoMax = "OFF";}
1918  //................................. automatic min and/or max
1919  if( fFlagUserHistoMin == "AUTO" )
1920  {SetYminMemoFromValue(quantity_code, h_geo_bid->GetMinimum()); fFlagUserHistoMin = "OFF";}
1921  if( fFlagUserHistoMax == "AUTO" )
1922  {SetYmaxMemoFromValue(quantity_code, h_geo_bid->GetMaximum()); fFlagUserHistoMax = "OFF";}
1923  //...................................... histo set ymin and ymax (ViewStin)
1924  Int_t xFlagAutoYsupMargin = 0;
1925  if ( MatrixProbaNature == fCorrelationMatrix )
1926  {xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, "D_MCs_ChNb");
1927 
1928  // ************************** A GARDER EN RESERVE *******************************
1929  //............. special contour level for correlations (square root wise scale)
1930  //Int_t nb_niv = 9;
1931  //Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
1932  //SqrtContourLevels(nb_niv, &cont_niv[0]);
1933  //h_geo_bid->SetContour(nb_niv, &cont_niv[0]);
1934  //delete [] cont_niv; fCdelete++;
1935  // ******************************** (FIN RESERVE) *******************************
1936  }
1937  if ( MatrixProbaNature == fCovarianceMatrix )
1938  {xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, "D_TNo_ChNb");}
1939 
1940  // =================================== P L O T S ======================== (ViewStin)
1941  if( i_data_exist > 0 )
1942  {
1943  char* f_in = new char[fgMaxCar]; fCnew++;
1944 
1945  //...................... Taille/format canvas
1946  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
1947  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
1948 
1949  //.................................................. paves commentaires (ViewStin)
1950  SetAllPavesViewStin(StexStin);
1951 
1952  //------------------------------------ Canvas name ----------------- (ViewStin)
1953  TString name_cov_cor;
1954  Int_t MaxCar = fgMaxCar;
1955  name_cov_cor.Resize(MaxCar);
1956  name_cov_cor = "?";
1957  if( MatrixProbaNature == fCovarianceMatrix ){name_cov_cor = "CovSS_Matrices_in_";}
1958  if( MatrixProbaNature == fCorrelationMatrix){name_cov_cor = "CorSS_Matrices_in_";}
1959 
1960  TString name_visu;
1961  MaxCar = fgMaxCar;
1962  name_visu.Resize(MaxCar);
1963  name_visu = "colz";
1964 
1965  sprintf(f_in, "%s_%s_%s_S1_%d_R%d_%d_%d_%s%d_%s%d_%s",
1966  name_cov_cor.Data(), fFapStinName.Data(),
1969  fFapStexName.Data(), fFapStexNumber,
1970  fFapStinName.Data(), StexStin, name_visu.Data());
1971 
1972  SetHistoPresentation((TH1D*)h_geo_bid, "Stin");
1973 
1974  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
1975  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
1976 
1977  // cout << "*TEcnaHistos::ViewStin(...)> Plot is displayed on canvas ----> " << f_in << endl;
1978 
1979  delete [] f_in; f_in = 0; fCdelete++;
1980 
1981  //------------------------ Canvas draw and update ------------ (ViewStin)
1982  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
1983  fPavComStex->Draw();
1984  fPavComStin->Draw();
1985  fPavComAnaRun->Draw();
1986  fPavComNbOfEvts->Draw();
1987 
1988  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
1989  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
1990  MainCanvas->Divide(1, 1, x_margin, y_margin);
1991  gPad->cd(1);
1992 
1993  Int_t logy = 0;
1994  gPad->SetLogy(logy);
1995 
1996  h_geo_bid->DrawCopy("COLZ");
1997 
1998  //--------------------------------------------------------------------------- (ViewStin)
1999  Int_t size_Hoco = fEcal->MaxCrysHocoInStin();
2000  Int_t size_Veco = fEcal->MaxCrysVecoInStin();
2001 
2002  ViewStinGrid(fFapStexNumber, StexStin, MatSize, size_Hoco, size_Veco, " ");
2003 
2004  gPad->Update();
2005 
2006  h_geo_bid->SetStats((Bool_t)1);
2007 
2008  // delete MainCanvas; fCdeleteRoot++;
2009  }
2010  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
2011 
2012  h_geo_bid->Delete(); h_geo_bid = 0; fCdeleteRoot++;
2013  }
2014  else
2015  {
2016  cout << "!TEcnaHistos::ViewStin(...)> *ERROR* =====> "
2017  << fFapStinName.Data() << " "
2018  << cStexStin << " not found."
2019  << " Available numbers = ";
2020  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
2021  {
2022  if( vStin(i) > 0 )
2023  {
2024  if( fFlagSubDet == "EB" ){cout << (Int_t)vStin(i) << ", ";}
2025  if( fFlagSubDet == "EE" )
2026  {cout << fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i)) << ", ";}
2027  }
2028  }
2029  cout << fTTBELL << endl;
2030  }
2031  } // end of if ( myRootFile->DataExist() == kTRUE )
2032  else
2033  {
2034  fStatusDataExist = kFALSE;
2035  }
2036  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
2037  else
2038  {
2039  fStatusFileFound = kFALSE;
2040 
2041  cout << "!TEcnaHistos::ViewStin(...)> *ERROR* =====> "
2042  << " ROOT file not found" << fTTBELL << endl;
2043  }
2044  }
2045  else
2046  {
2047  cout << "!TEcnaHistos::ViewStin(...)> " << fFapStexName.Data()
2048  << " = " << fFapStexNumber << ". Out of range (range = [1,"
2049  << fEcal->MaxStexInStas() << "]) " << fTTBELL << endl;
2050  }
2051 } // end of ViewStin(...)
2052 
2053 //====================================================================================
2054 //
2055 // StinCrystalNumbering
2056 // independent of the ROOT file => StexNumber as argument
2057 //
2058 //====================================================================================
2059 void TEcnaHistos::StinCrystalNumbering(const Int_t& StexNumber, const Int_t& cStexStin)
2060 {
2061 //display the crystal numbering of one Stin
2062 // cStexStin = Tower number in case of EB or SC number for construction in case of EE
2063 
2064  if( fFlagSubDet == "EB" ){TowerCrystalNumbering(StexNumber, cStexStin);}
2065  if( fFlagSubDet == "EE" ){SCCrystalNumbering(StexNumber, cStexStin);}
2066 }
2067 //----------------> end of StinCrystalNumbering()
2068 
2069 //====================================================================================
2070 //
2071 // TowerCrystalNumbering
2072 // independent of the ROOT file => SMNumber as argument
2073 //
2074 //====================================================================================
2075 void TEcnaHistos::TowerCrystalNumbering(const Int_t& SMNumber, const Int_t& n1SMTow)
2076 {
2077  //display the crystal numbering of one tower
2078 
2079  if( (SMNumber > 0) && (SMNumber <= fEcal->MaxSMInEB()) )
2080  {
2082 
2083  Int_t MatSize = fEcal->MaxSampADC();
2084  Int_t size_eta = fEcal->MaxCrysEtaInTow();
2085  Int_t size_phi = fEcal->MaxCrysPhiInTow();
2086 
2087  //---------------------------------- bidim
2088 
2089  Int_t nb_bins = fEcal->MaxSampADC();
2090  Int_t nx_gbins = nb_bins*size_eta;
2091  Int_t ny_gbins = nb_bins*size_phi;
2092 
2093  Axis_t xinf_gbid = (Axis_t)0.;
2094  Axis_t xsup_gbid = (Axis_t)fEcal->MaxSampADC()*size_eta;
2095  Axis_t yinf_gbid = (Axis_t)0.;
2096  Axis_t ysup_gbid = (Axis_t)fEcal->MaxSampADC()*size_phi;
2097 
2098  TString fg_name = "M0' crystals";
2099  TString fg_tit = "Xtal numbering (chan. in tow, chan. in SM, Xtal in SM, hashed)";
2100 
2101  //----------------------- empty 2D histo for pave coordinates registration
2102  TH2D *h_gbid;
2103  h_gbid = new TH2D(fg_name.Data(), fg_tit.Data(),
2104  nx_gbins, xinf_gbid, xsup_gbid,
2105  ny_gbins, yinf_gbid, ysup_gbid); fCnewRoot++;
2106  h_gbid->Reset();
2107 
2108  //----------------- T R A C E D E S P L O T S ------ (TowerCrystalNumbering)
2109 
2110  char* f_in = new char[fgMaxCar]; fCnew++;
2111 
2112  //...................... Taille/format canvas
2113 
2114  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
2115  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
2116 
2117  //........................................ couleurs
2118  Color_t couleur_noir = fCnaParHistos->SetColorsForNumbers("crystal");
2119  Color_t couleur_rouge = fCnaParHistos->SetColorsForNumbers("lvrb_top");
2120  Color_t couleur_bleu_fonce = fCnaParHistos->SetColorsForNumbers("lvrb_bottom");
2121 
2122  gStyle->SetPalette(1,0); // Rainbow spectrum
2123 
2124  //.................................... options generales
2126 
2127  //.................................... paves commentaires (TowerCrystalNumbering)
2128 
2129  SetAllPavesViewStinCrysNb(SMNumber, n1SMTow);
2130 
2131  //---------------------------------------------- (TowerCrystalNumbering)
2132 
2133  //..................... Canvas name
2134  sprintf(f_in, "Crystal_Numbering_for_%s_X_%d_%s%d",
2135  fFapStinName.Data(), n1SMTow, fFapStexName.Data(), SMNumber);
2136 
2137  SetHistoPresentation((TH1D*)h_gbid, "Stin");
2138 
2139  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w , canv_h); fCnewRoot++;
2140  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
2141 
2142  // cout << "*TEcnaHistosEB::TowerCrystalNumbering(...)> Plot is displayed on canvas ----> "
2143  // << f_in << endl;
2144 
2145  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
2146  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
2147  MainCanvas->Divide(1, 1, x_margin, y_margin);
2148 
2149  fPavComStex->Draw();
2150  fPavComStin->Draw();
2151  fPavComLVRB->Draw();
2152 
2153  Bool_t b_true = 1;
2154  Bool_t b_false = 0;
2155  gPad->cd(1);
2156 
2157  gStyle->SetMarkerColor(couleur_rouge);
2158 
2159  Int_t logy = 0;
2160  gPad->SetLogy(logy);
2161 
2162  //............................... bidim .......... (TowerCrystalNumbering)
2163 
2164  h_gbid->SetStats(b_false);
2165  h_gbid->DrawCopy("COLZ");
2166 
2167  //..... Ecriture des numeros de channels dans la grille..... (TowerCrystalNumbering)
2168  // et des numeros SM des cristaux
2169 
2170  //............... prepa arguments fixes appels [TText]->DrawText()
2171  char* f_in_elec = new char[fgMaxCar]; fCnew++;
2172  TString TowerLvrbType = fEcalNumbering->GetTowerLvrbType(n1SMTow) ;
2173  TText *text_elec_num = new TText(); fCnewRoot++;
2174  if ( TowerLvrbType == "top" ){text_elec_num->SetTextColor(couleur_rouge);}
2175  if ( TowerLvrbType == "bottom" ){text_elec_num->SetTextColor(couleur_bleu_fonce);}
2176  text_elec_num->SetTextSize(0.04);
2177 
2178  char* f_in_sme = new char[fgMaxCar]; fCnew++;
2179  TText *text_sme_num = new TText(); fCnewRoot++;
2180  if ( TowerLvrbType == "top" ){text_sme_num->SetTextColor(couleur_rouge);}
2181  if ( TowerLvrbType == "bottom" ){text_sme_num->SetTextColor(couleur_bleu_fonce);}
2182  text_sme_num->SetTextSize(0.03);
2183 
2184  char* f_in_sm = new char[fgMaxCar]; fCnew++;
2185  TText *text_sm_num = new TText(); fCnewRoot++;
2186  text_sm_num->SetTextColor(couleur_noir);
2187  text_sm_num->SetTextSize(0.03);
2188 
2189  char* f_in_hsd = new char[fgMaxCar]; fCnew++;
2190  TText *text_hsd_num = new TText(); fCnewRoot++;
2191  text_hsd_num->SetTextColor(couleur_noir);
2192  text_hsd_num->SetTextSize(0.03);
2193 
2194  //............... prepa arguments fixes appels GetXGeo(...) et GetYGeo(...)
2195  Int_t i_samp = 0;
2196  //Double_t off_set = (Double_t)(fEcal->MaxSampADC()/4);
2197  Double_t off_set = (Double_t)1.;
2198 
2199  //------------------ LOOP ON THE CRYSTAL ELECTRONIC CHANNEL NUMBER (TowerCrystalNumbering)
2200 
2201  for (Int_t i_chan = 0; i_chan < fEcal->MaxCrysInTow(); i_chan++)
2202  {
2203  Int_t i_xgeo = GetXSampInStin(SMNumber, n1SMTow, i_chan, i_samp);
2204  Int_t i_ygeo = GetYSampInStin(SMNumber, n1SMTow, i_chan, i_samp);
2205 
2206  Double_t xgi = i_xgeo + 3.*off_set;
2207  Double_t ygj = i_ygeo + 7.*off_set;
2208 
2209  Double_t xgi_sme = i_xgeo + 3.*off_set;
2210  Double_t ygj_sme = i_ygeo + 5.*off_set;
2211 
2212  Double_t xgi_sm = i_xgeo + 3.*off_set;
2213  Double_t ygj_sm = i_ygeo + 3.*off_set;
2214 
2215  Double_t xgi_hsd = i_xgeo + 3.*off_set;
2216  Double_t ygj_hsd = i_ygeo + 1.*off_set;
2217 
2218  Int_t i_crys_sme = fEcalNumbering->Get0SMEchaFrom1SMTowAnd0TowEcha(n1SMTow, i_chan);
2219 
2220  Int_t i_crys_sm = fEcalNumbering->Get1SMCrysFrom1SMTowAnd0TowEcha(n1SMTow, i_chan);
2221 
2222  Double_t Eta = fEcalNumbering->GetEta(SMNumber, n1SMTow, i_chan);
2223  Double_t Phi = fEcalNumbering->GetPhi(SMNumber, n1SMTow, i_chan);
2224 
2225  Int_t i_crys_hsd = fEcalNumbering->GetHashedNumberFromIEtaAndIPhi((Int_t)Eta, (Int_t)Phi);
2226 
2227  //------------------------------------------------------- TowerCrystalNumbering
2228 
2229  sprintf(f_in_elec, "%d", i_chan);
2230  text_elec_num->DrawText(xgi, ygj, f_in_elec);
2231 
2232  sprintf(f_in_sme, "%d", i_crys_sme);
2233  text_sme_num->DrawText(xgi_sme, ygj_sme, f_in_sme);
2234 
2235  sprintf(f_in_sm, "%d", i_crys_sm);
2236  text_sm_num->DrawText(xgi_sm, ygj_sm, f_in_sm);
2237 
2238  sprintf(f_in_hsd, "%d", i_crys_hsd);
2239  text_sm_num->DrawText(xgi_hsd, ygj_hsd, f_in_hsd);
2240  }
2241  text_sm_num->Delete(); text_sm_num = 0; fCdeleteRoot++;
2242  text_sme_num->Delete(); text_sme_num = 0; fCdeleteRoot++;
2243  text_elec_num->Delete(); text_elec_num = 0; fCdeleteRoot++;
2244  text_hsd_num->Delete(); text_hsd_num = 0; fCdeleteRoot++;
2245 
2246  ViewStinGrid(SMNumber, n1SMTow, MatSize, size_eta, size_phi, "CrystalNumbering");
2247 
2248  gPad->Update();
2249  h_gbid->SetStats(b_true);
2250 
2251  h_gbid->Delete(); h_gbid = 0; fCdeleteRoot++;
2252 
2253  delete [] f_in; f_in = 0; fCdelete++;
2254  delete [] f_in_sm; f_in_sm = 0; fCdelete++;
2255  delete [] f_in_sme; f_in_sme = 0; fCdelete++;
2256  delete [] f_in_elec; f_in_elec = 0; fCdelete++;
2257  }
2258  else
2259  {
2260  cout << "!TEcnaHistos::TowerCrystalNumbering(...)> SM = " << SMNumber
2261  << ". Out of range ( range = [1," << fEcal->MaxSMInEB() << "] )" << fTTBELL << endl;
2262  }
2263 }
2264 //----------------> end of TowerCrystalNumbering()
2265 
2266 //====================================================================================
2267 //
2268 // SCCrystalNumbering
2269 // independent of the ROOT file => DeeNumber and n1DeeSCEcna as argument
2270 //
2271 //====================================================================================
2272 void TEcnaHistos::SCCrystalNumbering(const Int_t& DeeNumber, const Int_t& n1DeeSCCons)
2273 {
2274  //display the crystal numbering of one SC
2275 
2276  if( (DeeNumber > 0) && (DeeNumber <= fEcal->MaxDeeInEE()) )
2277  {
2278  Int_t n1DeeSCEcna = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(DeeNumber, n1DeeSCCons);
2281 
2282  Int_t MatSize = fEcal->MaxSampADC();
2283  Int_t size_IX = fEcal->MaxCrysIXInSC();
2284  Int_t size_IY = fEcal->MaxCrysIYInSC();
2285 
2286  //---------------------------------- bidim
2287 
2288  Int_t nb_bins = fEcal->MaxSampADC();
2289  Int_t nx_gbins = nb_bins*size_IX;
2290  Int_t ny_gbins = nb_bins*size_IY;
2291 
2292  Axis_t xinf_gbid = (Axis_t)0.;
2293  Axis_t xsup_gbid = (Axis_t)fEcal->MaxSampADC()*size_IX;
2294  Axis_t yinf_gbid = (Axis_t)0.;
2295  Axis_t ysup_gbid = (Axis_t)fEcal->MaxSampADC()*size_IY;
2296 
2297  TString fg_name = "crystalnbring";
2298  TString fg_tit = "Xtal numbering for construction";
2299 
2300  TH2D *h_gbid;
2301  h_gbid = new TH2D(fg_name.Data(), fg_tit.Data(),
2302  nx_gbins, xinf_gbid, xsup_gbid,
2303  ny_gbins, yinf_gbid, ysup_gbid); fCnewRoot++;
2304  h_gbid->Reset();
2305 
2306  //----------------- T R A C E D E S P L O T S ------ (SCCrystalNumbering)
2307 
2308  char* f_in = new char[fgMaxCar]; fCnew++;
2309 
2310  //...................... Taille/format canvas
2311 
2312  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
2313  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
2314  //........................................ couleurs
2315  // Color_t couleur_noir = fCnaParHistos->ColorDefinition("noir");
2316  Color_t couleur_rouge = fCnaParHistos->ColorDefinition("rouge");
2317  // Color_t couleur_bleu_fonce = fCnaParHistos->ColorDefinition("bleu_fonce");
2318 
2319  gStyle->SetPalette(1,0); // Rainbow spectrum
2320  //.................................... options generales
2322 
2323  //.................................... paves commentaires (SCCrystalNumbering)
2324 
2325  SetAllPavesViewStinCrysNb(DeeNumber, n1DeeSCEcna);
2326 
2327  //---------------------------------------------- (SCCrystalNumbering)
2328 
2329  //..................... Canvas name
2330  sprintf(f_in, "Crystal_Numbering_for_%s_X_%d_%s%d",
2331  fFapStinName.Data(), n1DeeSCEcna, fFapStexName.Data(), DeeNumber);
2332 
2333  SetHistoPresentation((TH1D*)h_gbid, "Stin");
2334 
2335  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w , canv_h); fCnewRoot++;
2336  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
2337 
2338  // cout << "*TEcnaHistosEE::SCCrystalNumbering(...)> Plot is displayed on canvas ----> "
2339  // << f_in << endl;
2340 
2341  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
2342  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
2343 
2344  MainCanvas->Divide(1, 1, x_margin, y_margin);
2345 
2346  fPavComStex->Draw();
2347  fPavComStin->Draw();
2348  fPavComCxyz->Draw();
2349 
2350  Bool_t b_true = 1;
2351  Bool_t b_false = 0;
2352  gPad->cd(1);
2353 
2354  gStyle->SetMarkerColor(couleur_rouge);
2355 
2356  Int_t logy = 0;
2357  gPad->SetLogy(logy);
2358 
2359  //............................... bidim .......... (SCCrystalNumbering)
2360 
2361  h_gbid->SetStats(b_false);
2362 
2363  fCnaParHistos->SetViewHistoOffsets((TH1D*)h_gbid, "Stin", " ");
2364 
2365  h_gbid->DrawCopy("COLZ");
2366 
2367  //..... Ecriture des numeros de channels dans la grille..... (SCCrystalNumbering)
2368  // et des numeros Dee des cristaux
2369  TString SCQuadType = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna);
2370  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
2371  TString DeeEndcap = fEcalNumbering->GetEEDeeEndcap(DeeNumber);
2372  Color_t couleur_SC = GetSCColor(DeeEndcap, DeeDir, SCQuadType);
2373  //............... prepa arguments fixes appels [TText]->DrawText()
2374  char* f_in_elec = new char[fgMaxCar]; fCnew++;
2375  TText *text_elec_num = new TText(); fCnewRoot++;
2376  text_elec_num->SetTextColor(couleur_SC);
2377  text_elec_num->SetTextSize(0.06);
2378 
2379  //............... prepa arguments fixes appels GetXGeo(...) et GetYGeo(...)
2380  Int_t i_samp = 0;
2381  Double_t off_set = (Double_t)(fEcal->MaxSampADC()/3);
2382 
2383  //------------------ LOOP ON THE CRYSTAL ELECTRONIC CHANNEL NUMBER (SCCrystalNumbering)
2384 
2385  for (Int_t i_chan = 0; i_chan < fEcal->MaxCrysInSC(); i_chan++)
2386  {
2387  Int_t i_xgeo = GetXSampInStin(DeeNumber, n1DeeSCEcna, i_chan, i_samp);
2388  Int_t i_ygeo = GetYSampInStin(DeeNumber, n1DeeSCEcna, i_chan, i_samp);
2389 
2390  Double_t xgi = i_xgeo + off_set;
2391  Double_t ygj = i_ygeo + 2*off_set;
2392 
2393  TString Dir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
2394 
2395  //------------------------------------------------------- SCCrystalNumbering
2396 
2397  sprintf(f_in_elec, "%d", i_chan+1); // offset = +1 (Xtal for construction numbering, CMS NOTE 2006/027)
2398  text_elec_num->DrawText(xgi, ygj, f_in_elec);
2399  }
2400  text_elec_num->Delete(); text_elec_num = 0; fCdeleteRoot++;
2401 
2402  ViewStinGrid(DeeNumber, n1DeeSCEcna, MatSize, size_IX, size_IY, "CrystalNumbering");
2403 
2404  gPad->Update();
2405  h_gbid->SetStats(b_true);
2406 
2407  h_gbid->Delete(); h_gbid = 0; fCdeleteRoot++;
2408 
2409  delete [] f_in; f_in = 0; fCdelete++;
2410  delete [] f_in_elec; f_in_elec = 0; fCdelete++;
2411  }
2412  else
2413  {
2414  cout << "!TEcnaHistos::SCCrystalNumbering(...)> Dee = " << DeeNumber
2415  << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )" << fTTBELL << endl;
2416  }
2417 }
2418 //----------------> end of SCCrystalNumbering()
2419 
2420 //==================================================================================
2421 //
2422 // GetXSampInStin, GetYSampInStin
2423 //
2424 //==================================================================================
2425 Int_t TEcnaHistos::GetXSampInStin(const Int_t& StexNumber, const Int_t& StexStin,
2426  const Int_t& i0StinEcha, const Int_t& i_samp)
2427 {
2428 //Gives the X coordinate in the geographic view of one Stin
2429 
2430  Int_t ix_geo = -1;
2431 
2432  if( fFlagSubDet == "EB" )
2433  {TString ctype = fEcalNumbering->GetStinLvrbType(StexStin);
2434  TString btype = fEcalNumbering->GetStexHalfStas(StexNumber);
2435  if( (btype == "EB+" && ctype == "bottom") || (btype == "EB-" && ctype == "top") )
2436  {ix_geo = ( (fEcal->MaxCrysHocoInStin()-1)-(i0StinEcha/fEcal->MaxCrysHocoInStin()) )
2437  *fEcal->MaxSampADC() + i_samp;}
2438  if( (btype == "EB+" && ctype == "top") || (btype == "EB-" && ctype == "bottom") )
2439  {ix_geo = ( i0StinEcha/fEcal->MaxCrysHocoInStin() )*fEcal->MaxSampADC() + i_samp;}}
2440 
2441  if( fFlagSubDet == "EE" )
2442  { TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(StexNumber);
2443  if( DeeDir == "right" )
2444  {ix_geo = (fEcalNumbering->GetIXCrysInSC(StexNumber, StexStin, i0StinEcha)-1)*fEcal->MaxSampADC() + i_samp;}
2445  if( DeeDir == "left" )
2446  {ix_geo = (fEcal->MaxCrysHocoInStin() - fEcalNumbering->GetIXCrysInSC(StexNumber, StexStin, i0StinEcha))*
2447  fEcal->MaxSampADC() + i_samp;}}
2448 
2449  return ix_geo;
2450 }
2451 //--------------------------------------------------------------------------------------------
2452 Int_t TEcnaHistos::GetYSampInStin(const Int_t& StexNumber, const Int_t& StexStin,
2453  const Int_t& i0StinEcha, const Int_t& j_samp)
2454 {
2455 //Gives the Y coordinate in the geographic view of one Stin
2456 
2457  Int_t jy_geo = -1;
2458 
2459  if( fFlagSubDet == "EB" )
2460  {
2461  TString ctype = fEcalNumbering->GetStinLvrbType(StexStin);
2462  TString btype = fEcalNumbering->GetStexHalfStas(StexNumber);
2463 
2464  //.......................... jy_geo for the EB+ (and beginning for the EB-)
2465 
2466  if( (btype == "EB+" && ctype == "top") || (btype == "EB-" && ctype == "bottom") )
2467  {
2468  if( i0StinEcha >= 0 && i0StinEcha <= 4 ) {jy_geo = (i0StinEcha - 0)*fEcal->MaxSampADC() + j_samp;}
2469  if( i0StinEcha >= 5 && i0StinEcha <= 9 ) {jy_geo = -(i0StinEcha - 9)*fEcal->MaxSampADC() + j_samp;}
2470  if( i0StinEcha >= 10 && i0StinEcha <= 14 ) {jy_geo = (i0StinEcha - 10)*fEcal->MaxSampADC() + j_samp;}
2471  if( i0StinEcha >= 15 && i0StinEcha <= 19 ) {jy_geo = -(i0StinEcha - 19)*fEcal->MaxSampADC() + j_samp;}
2472  if( i0StinEcha >= 20 && i0StinEcha <= 24 ) {jy_geo = (i0StinEcha - 20)*fEcal->MaxSampADC() + j_samp;}
2473  }
2474 
2475  if( (btype == "EB+" && ctype == "bottom") || (btype == "EB-" && ctype == "top") )
2476  {
2477  if( i0StinEcha >= 0 && i0StinEcha <= 4 )
2478  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) - (i0StinEcha- 0))*fEcal->MaxSampADC() + j_samp;}
2479  if( i0StinEcha >= 5 && i0StinEcha <= 9 )
2480  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) + (i0StinEcha- 9))*fEcal->MaxSampADC() + j_samp;}
2481  if( i0StinEcha >= 10 && i0StinEcha <= 14 )
2482  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) - (i0StinEcha-10))*fEcal->MaxSampADC() + j_samp;}
2483  if( i0StinEcha >= 15 && i0StinEcha <= 19 )
2484  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) + (i0StinEcha-19))*fEcal->MaxSampADC() + j_samp;}
2485  if( i0StinEcha >= 20 && i0StinEcha <= 24 )
2486  {jy_geo = ( (fEcal->MaxCrysVecoInStin()-1) - (i0StinEcha-20))*fEcal->MaxSampADC() + j_samp;}
2487  }
2488  }
2489 
2490  if( fFlagSubDet == "EE" )
2491  {jy_geo =
2492  (fEcalNumbering->GetJYCrysInSC(StexNumber, StexStin, i0StinEcha) - 1)*fEcal->MaxSampADC() + j_samp;}
2493 
2494  return jy_geo;
2495 }
2496 
2497 //===============================================================================
2498 //
2499 // ViewStinGrid
2500 // independent of the ROOT file => StexNumber as argument
2501 //
2502 //===============================================================================
2503 void TEcnaHistos::ViewStinGrid(const Int_t& StexNumber,
2504  const Int_t& StexStin, const Int_t& MatSize,
2505  const Int_t& size_Hoco, const Int_t& size_Veco,
2506  const TString chopt)
2507 {
2508  //Grid of one Stin with axis Hoco and Veco
2509 
2510  if( fFlagSubDet == "EB"){ViewTowerGrid(StexNumber, StexStin, MatSize,
2511  size_Hoco, size_Veco, chopt);}
2512  if( fFlagSubDet == "EE"){ViewSCGrid(StexNumber, StexStin, MatSize,
2513  size_Hoco, size_Veco, chopt);}
2514 
2515 } // end of ViewStinGrid
2516 
2517 //===============================================================================
2518 //
2519 // ViewTowerGrid
2520 // independent of the ROOT file => SMNumber as argument
2521 //
2522 //===============================================================================
2523 void TEcnaHistos::ViewTowerGrid(const Int_t& SMNumber,
2524  const Int_t& n1SMTow, const Int_t& MatSize,
2525  const Int_t& size_eta, const Int_t& size_phi,
2526  const TString chopt)
2527 {
2528  //Grid of one tower with axis eta and phi
2529  //.......................... lignes verticales
2530  Double_t xline = 0.;
2531 
2532  Double_t yline_bot = 0.;
2533  Double_t yline_top = (Double_t)(MatSize*size_eta);
2534 
2535  for( Int_t i = 0 ; i < size_eta ; i++)
2536  {
2537  xline = xline + (Double_t)MatSize;
2538  TLine *lin;
2539  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
2540  lin->Draw();
2541  // delete lin; fCdeleteRoot++;
2542  }
2543  //............................. lignes horizontales
2544  Double_t xline_left = 0;
2545  Double_t xline_right = (Double_t)(MatSize*size_eta);
2546 
2547  Double_t yline = -(Double_t)MatSize;
2548 
2549  for( Int_t j = 0 ; j < size_eta+1 ; j++)
2550  {
2551  yline = yline + (Double_t)MatSize;
2552  TLine *lin;
2553  lin = new TLine(xline_left, yline, xline_right, yline); fCnewRoot++;
2554  lin->Draw();
2555  // delete lin; fCdeleteRoot++;
2556  }
2557 
2558  //------------------ trace axes en eta et phi --------------- ViewTowerGrid
2559 
2560  //...................................................... Axe i(eta) (x bottom) (ViewTowerGrid)
2561 
2562  Double_t eta_min = fEcalNumbering->GetIEtaMin(SMNumber, n1SMTow);
2563  Double_t eta_max = fEcalNumbering->GetIEtaMax(SMNumber, n1SMTow);
2564 
2565  TString x_var_name = GetEtaPhiAxisTitle("ietaTow");
2566  TString x_direction = fEcalNumbering->GetXDirectionEB(SMNumber);
2567 
2568  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
2569  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize();
2570  Float_t tic_siz_x = fCnaParHistos->AxisTickSize();
2571  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("Towx");
2572  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("Towx");
2573 
2574  TF1 *f1 = new TF1("f1", x_direction.Data(), eta_min, eta_max); fCnewRoot++;
2575 
2576  TGaxis* sup_axis_x = 0;
2577 
2578  if ( x_direction == "-x" ) // NEVER IN THIS CASE: xmin->xmax <=> right->left ("-x") direction
2579  {sup_axis_x = new TGaxis( -(Float_t)MatSize, (Float_t)0, (Float_t)(size_eta*MatSize), (Float_t)0.,
2580  "f1", size_eta, "BCS" , 0.); fCnewRoot++;
2581  cout << "TEcnaHistosEB::ViewTowerGrid()> non foreseen case. eta with -x direction." << fTTBELL << endl;}
2582 
2583  if ( x_direction == "x" ) // ALWAYS IN THIS CASE: xmin->xmax <=> left->right ("x") direction
2584  {sup_axis_x = new TGaxis( (Float_t)0. , (Float_t)0., (Float_t)(size_eta*MatSize), (Float_t)0.,
2585  "f1", size_eta, "CS" , 0.); fCnewRoot++;}
2586 
2587  sup_axis_x->SetTitle(x_var_name);
2588  sup_axis_x->SetTitleSize(tit_siz_x);
2589  sup_axis_x->SetTitleOffset(tit_off_x);
2590  sup_axis_x->SetLabelSize(lab_siz_x);
2591  sup_axis_x->SetLabelOffset(lab_off_x);
2592  sup_axis_x->SetTickSize(tic_siz_x);
2593  sup_axis_x->Draw("SAME");
2594  f1 = 0;
2595 
2596  //...................................................... Axe phi (y right) (ViewTowerGrid)
2597  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
2598  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
2599  Float_t tic_siz_y = fCnaParHistos->AxisTickSize();
2600  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("Towy");
2601  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("Towy");
2602 
2603  if( chopt == "CrystalNumbering" )
2604  {
2605  Double_t phi_min = fEcalNumbering->GetPhiMin(SMNumber, n1SMTow);
2606  Double_t phi_max = fEcalNumbering->GetPhiMax(SMNumber, n1SMTow);
2607 
2608  TString y_var_name = GetEtaPhiAxisTitle("phi");
2609  TString y_direction = fEcalNumbering->GetYDirectionEB(SMNumber);
2610 
2611  TF1 *f2 = new TF1("f2", y_direction.Data(), phi_min, phi_max); fCnewRoot++;
2612  TGaxis* sup_axis_y = 0;
2613 
2614  if ( y_direction == "-x" ) // ALWAYS IN THIS CASE: ymin->ymax <=> top->bottom ("-x") direction
2615  {sup_axis_y = new TGaxis( (Float_t)(size_eta*MatSize), (Float_t)0.,
2616  (Float_t)(size_eta*MatSize), (Float_t)(size_phi*MatSize),
2617  "f2", size_phi, "+CS", 0.); fCnewRoot++;}
2618 
2619  if ( y_direction == "x" ) // NEVER IN THIS CASE: ymin->ymax <=> bottom->top ("x") direction
2620  {sup_axis_y = new TGaxis( (Float_t)0., (Float_t)0., (Float_t) 0., (Float_t)(size_phi*MatSize),
2621  "f2", size_phi, "BCS", 0.); fCnewRoot++;}
2622 
2623  sup_axis_y->SetTitle(y_var_name);
2624  sup_axis_y->SetTitleSize(tit_siz_y);
2625  sup_axis_y->SetTitleOffset(tit_off_y);
2626  sup_axis_y->SetLabelSize(lab_siz_y);
2627  sup_axis_y->SetLabelOffset(lab_off_y);
2628  sup_axis_y->SetTickSize(tic_siz_y);
2629  sup_axis_y->Draw("SAME");
2630  f2 = 0;
2631  }
2632  //...................................................... Axe j(phi) (y left) (ViewTowerGrid)
2633 
2634  Double_t j_phi_min = fEcalNumbering->GetJPhiMin(SMNumber, n1SMTow);
2635  Double_t j_phi_max = fEcalNumbering->GetJPhiMax(SMNumber, n1SMTow);
2636 
2637  TString jy_var_name = GetEtaPhiAxisTitle("jphiTow");
2638  TString jy_direction = fEcalNumbering->GetJYDirectionEB(SMNumber);
2639 
2640  TF1 *f3 = new TF1("f3", jy_direction.Data(), j_phi_min, j_phi_max); fCnewRoot++;
2641  TGaxis* sup_axis_jy = 0;
2642 
2643  sup_axis_jy = new TGaxis( (Float_t)0., (Float_t)0.,
2644  (Float_t)0., (Float_t)(size_phi*MatSize),
2645  "f3", size_phi, "SC", 0.); fCnewRoot++;
2646 
2647  sup_axis_jy->SetTitle(jy_var_name);
2648  sup_axis_jy->SetTitleSize(tit_siz_y);
2649  sup_axis_jy->SetTitleOffset(tit_off_y);
2650  sup_axis_jy->SetLabelSize(lab_siz_y);
2651  sup_axis_jy->SetLabelOffset(lab_off_y);
2652  sup_axis_jy->SetTickSize(tic_siz_y);
2653  sup_axis_jy->Draw("SAME");
2654  f3 = 0;
2655 
2656 } // end of ViewTowerGrid
2657 
2658 //===============================================================================
2659 //
2660 // ViewSCGrid
2661 // independent of the ROOT file => DeeNumber as argument
2662 //
2663 //===============================================================================
2664 void TEcnaHistos::ViewSCGrid(const Int_t& DeeNumber, const Int_t& n1DeeSCEcna,
2665  const Int_t& MatSize, const Int_t& size_IX,
2666  const Int_t& size_IY, const TString chopt)
2667 {
2668  //Grid of one SC with axis IX and IY
2669  //.......................... lignes verticales
2670  Double_t xline = 0.;
2671 
2672  Double_t yline_bot = 0.;
2673  Double_t yline_top = (Double_t)(MatSize*size_IX);
2674 
2675  for( Int_t i = 0 ; i < size_IX ; i++)
2676  {
2677  xline = xline + (Double_t)MatSize;
2678  TLine *lin;
2679  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
2680  lin->Draw();
2681  // delete lin; fCdeleteRoot++;
2682  }
2683  //............................. lignes horizontales
2684  Double_t xline_left = 0;
2685  Double_t xline_right = (Double_t)(MatSize*size_IX);
2686 
2687  Double_t yline = -(Double_t)MatSize;
2688 
2689  for( Int_t j = 0 ; j < size_IX+1 ; j++)
2690  {
2691  yline = yline + (Double_t)MatSize;
2692  TLine *lin;
2693  lin = new TLine(xline_left, yline, xline_right, yline); fCnewRoot++;
2694  lin->Draw();
2695  // delete lin; fCdeleteRoot++;
2696  }
2697 
2698  //------------------ trace axes en IX et IY --------------- ViewSCGrid
2699 
2700  //...................................................... Axe i(IX) (x bottom) (ViewSCGrid)
2701 
2702  Double_t IX_min = fEcalNumbering->GetIIXMin(n1DeeSCEcna) - 0.5;
2703  Double_t IX_max = fEcalNumbering->GetIIXMax(n1DeeSCEcna) + 0.5;
2704 
2705  Float_t axis_x_inf = 0;
2706  Float_t axis_x_sup = 0;
2707  Float_t axis_y_inf = 0;
2708  Float_t axis_y_sup = 0;
2709  Int_t axis_nb_div = 1;
2710  Double_t IX_values_min = 0;
2711  Double_t IX_values_max = 0;
2712  Option_t* axis_chopt = "CS";
2713 
2714  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
2715  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize();
2716  Float_t tic_siz_x = fCnaParHistos->AxisTickSize();
2717  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("SCx");
2718  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("SCx");
2719 
2720  TString StrDee = "iIXSC";
2721  if( DeeNumber == 1 ){StrDee = "iIXDee1";}
2722  if( DeeNumber == 2 ){StrDee = "iIXDee2";}
2723  if( DeeNumber == 3 ){StrDee = "iIXDee3";}
2724  if( DeeNumber == 4 ){StrDee = "iIXDee4";}
2725 
2726  TString x_var_name = GetIXIYAxisTitle(StrDee.Data());
2727  TString x_direction = fEcalNumbering->GetXDirectionEE(DeeNumber);
2728 
2729  TGaxis* sup_axis_x = 0;
2730 
2731  if( DeeNumber == 1 ) // -xmin -> -xmax <=> left->right
2732  {
2733  axis_x_inf = 0; axis_y_inf = 0; axis_x_sup = size_IX*MatSize; axis_y_sup = 0;
2734  axis_nb_div = size_IX;
2735  IX_values_min = -IX_min ; IX_values_max = -IX_max; axis_chopt = "CS";
2736  }
2737  if( DeeNumber == 2 ) // xmin -> xmax <=> right->left
2738  {
2739  axis_x_inf = 0; axis_y_inf = 0; axis_x_sup = size_IX*MatSize; axis_y_sup = 0;
2740  axis_nb_div = size_IX;
2741  IX_values_min = IX_min ; IX_values_max = IX_max; axis_chopt = "CS";
2742  }
2743  if( DeeNumber == 3 ) // xmin -> xmax <=> left->right
2744  {
2745  axis_x_inf = 0; axis_y_inf = 0; axis_x_sup = size_IX*MatSize; axis_y_sup = 0;
2746  axis_nb_div = size_IX;
2747  IX_values_min = IX_min ; IX_values_max = IX_max; axis_chopt = "CS";
2748  }
2749  if( DeeNumber == 4 ) // -xmin -> -xmax <=> right->left
2750  {
2751  axis_x_inf = 0; axis_y_inf = 0; axis_x_sup = size_IX*MatSize; axis_y_sup = 0;
2752  axis_nb_div = size_IX;
2753  IX_values_min = -IX_min ; IX_values_max = -IX_max; axis_chopt = "CS";
2754  }
2755 
2756  TF1 *f1 = new TF1("f1", x_direction.Data(), IX_values_min, IX_values_max); fCnewRoot++;
2757  sup_axis_x = new TGaxis( axis_x_inf, axis_y_inf, axis_x_sup, axis_y_sup,
2758  "f1", axis_nb_div, axis_chopt , 0.); fCnewRoot++;
2759 
2760  sup_axis_x->SetTitle(x_var_name);
2761  sup_axis_x->SetTitleSize(tit_siz_x);
2762  sup_axis_x->SetTitleOffset(tit_off_x);
2763  sup_axis_x->SetLabelSize(lab_siz_x);
2764  sup_axis_x->SetLabelOffset(lab_off_x);
2765  sup_axis_x->SetTickSize(tic_siz_x); // <===== NE MARCHE QU'AVEC L'OPTION "S"
2766  sup_axis_x->Draw("SAME");
2767  f1 = 0;
2768 
2769  //...................................................... Axe j(IY) (ViewSCGrid)
2770 
2771  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
2772  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
2773  Float_t tic_siz_y = fCnaParHistos->AxisTickSize();
2774  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("SCy");
2775  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("SCy");
2776 
2777  Double_t j_IY_min = fEcalNumbering->GetJIYMin(DeeNumber, n1DeeSCEcna) - 0.5;
2778  Double_t j_IY_max = fEcalNumbering->GetJIYMax(DeeNumber, n1DeeSCEcna) + 0.5;
2779 
2780  TString jy_var_name = GetIXIYAxisTitle("jIYSC");
2781  TString jy_direction = fEcalNumbering->GetJYDirectionEE(DeeNumber);
2782 
2783  TF1 *f2 = new TF1("f2", jy_direction.Data(), j_IY_min, j_IY_max); fCnewRoot++;
2784 
2785  TGaxis* sup_axis_jy = new TGaxis( (Float_t)0., (Float_t)0.,
2786  (Float_t)0., (Float_t)(size_IY*MatSize),
2787  "f2", size_IY, "CS", 0.); fCnewRoot++;
2788 
2789  sup_axis_jy->SetTitle(jy_var_name);
2790  sup_axis_jy->SetTitleSize(tit_siz_y);
2791  sup_axis_jy->SetTitleOffset(tit_off_y);
2792  sup_axis_jy->SetLabelSize(lab_siz_y);
2793  sup_axis_jy->SetLabelOffset(lab_off_y);
2794  sup_axis_jy->SetTickSize(tic_siz_y); // <===== NE MARCHE QU'AVEC L'OPTION "S"
2795  sup_axis_jy->Draw();
2796  f2 = 0;
2797 
2798 } // end of ViewSCGrid
2799 
2800 //=======================================================================================
2801 //
2802 // Stex view (StexHocoVeco)
2803 //
2804 //=======================================================================================
2812 
2820 
2828 //=======================================================================================
2829 //
2830 // ViewStex
2831 //
2832 // (Hoco,Veco) matrices for all the Stins of a Stex
2833 //
2834 //
2835 //=======================================================================================
2836 void TEcnaHistos::ViewStex(const TString HistoCode)
2837 {
2838 // (Hoco, Veco) matrices for all the Stins of a Stex
2839 
2845 
2846  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewStex)
2847  {
2848  fStatusFileFound = kTRUE;
2849 
2851  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
2852  // cout << "*TEcnaHistos::ViewStex(...)> Data are analyzed from file ----> "
2853  // << fp_name_short << endl;
2854 
2858 
2859  //......................... matrix title
2860  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
2861 
2862  if (HistoCode == "D_NOE_ChNb") {sprintf(f_in_mat_tit, "Number of events");}
2863  if (HistoCode == "D_Ped_ChNb") {sprintf(f_in_mat_tit, "Pedestals");}
2864  if (HistoCode == "D_TNo_ChNb") {sprintf(f_in_mat_tit, "Total Noise");}
2865  if (HistoCode == "D_MCs_ChNb") {sprintf(f_in_mat_tit, "Mean Cor(s,s')");}
2866  if (HistoCode == "D_LFN_ChNb") {sprintf(f_in_mat_tit, "Low Frequency Noise");}
2867  if (HistoCode == "D_HFN_ChNb") {sprintf(f_in_mat_tit, "High Frequency Noise");}
2868  if (HistoCode == "D_SCs_ChNb") {sprintf(f_in_mat_tit, "Sigma Cor(s,s')");}
2869 
2870  //................................. Axis parameters
2871  Int_t GeoBidSizeHoco = fEcal->MaxStinHocoInStex()*fEcal->MaxCrysHocoInStin();
2872  Int_t GeoBidSizeVeco = fEcal->MaxStinVecoInStex()*fEcal->MaxCrysVecoInStin();
2873 
2874  Int_t nb_binx = GeoBidSizeHoco;
2875  Int_t nb_biny = GeoBidSizeVeco;
2876  Axis_t xinf_bid = (Axis_t)0.;
2877  Axis_t xsup_bid = (Axis_t)GeoBidSizeHoco;
2878  Axis_t yinf_bid = (Axis_t)0.;
2879  Axis_t ysup_bid = (Axis_t)GeoBidSizeVeco;
2880 
2881  TString axis_x_var_name = " #Hoco ";
2882  TString axis_y_var_name = " #varVeco ";
2883 
2884  //............. matrices reading and histogram filling (ViewStex)
2885 
2886  TH2D* h_geo_bid = new TH2D("geobidim_Hoco_Veco", f_in_mat_tit,
2887  nb_binx, xinf_bid, xsup_bid,
2888  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
2889 
2890  h_geo_bid->Reset();
2891 
2892  //............................................... matrices reading
2893  TVectorD partial_histp(fEcal->MaxCrysEcnaInStex());
2894  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++){partial_histp(i)=(Double_t)0.;}
2895 
2896  TMatrixD read_matrix(nb_binx, nb_biny);
2897  for(Int_t i=0; i<nb_binx; i++)
2898  {for(Int_t j=0; j<nb_biny; j++){read_matrix(i,j)=(Double_t)0.;}}
2899 
2900  if (HistoCode == "D_NOE_ChNb" ){
2901  partial_histp = fMyRootFile->ReadNumberOfEvents(fEcal->MaxCrysEcnaInStex());}
2902  if (HistoCode == "D_Ped_ChNb" ){
2903  partial_histp = fMyRootFile->ReadPedestals(fEcal->MaxCrysEcnaInStex());}
2904  if (HistoCode == "D_TNo_ChNb" ){
2905  partial_histp = fMyRootFile->ReadTotalNoise(fEcal->MaxCrysEcnaInStex());}
2906  if (HistoCode == "D_MCs_ChNb" ){
2908  if (HistoCode == "D_LFN_ChNb" ){
2910  if (HistoCode == "D_HFN_ChNb" ){
2912  if (HistoCode == "D_SCs_ChNb" ){
2914 
2915  if ( fMyRootFile->DataExist() == kTRUE )
2916  {
2917  fStatusDataExist = kTRUE;
2918 
2919  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
2920  {
2921  Int_t StexStin = fMyRootFile->GetStexStinFromIndex(i0StexStinEcna);
2922 
2923  if (StexStin != -1)
2924  {
2925  //------------------ Geographical bidim filling (ViewStex)
2926  for(Int_t i0StinEcha=0; i0StinEcha<fEcal->MaxCrysInStin(); i0StinEcha++)
2927  {
2928  Int_t iStexEcha = (StexStin-1)*fEcal->MaxCrysInStin() + i0StinEcha;
2929  Int_t i_xgeo = GetXCrysInStex(fFapStexNumber, StexStin, i0StinEcha);
2930  Int_t i_ygeo = GetYCrysInStex(fFapStexNumber, StexStin, i0StinEcha);
2931 
2932  if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
2933  {
2934  read_matrix(i_xgeo, i_ygeo) = partial_histp(iStexEcha);
2935  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
2936  (Double_t)read_matrix(i_xgeo, i_ygeo));
2937  }
2938  }
2939  }
2940  }
2941 
2942  //=============== H I S T O M I N / M A X M A N A G E M E N T ============ (ViewStex)
2943 
2944  //................................ Put histo min max values
2945  //.......... default if flag not set to "ON"
2946  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
2947  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
2948 
2949  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
2950  //.......... user's value if flag set to "ON"
2951  if( fFlagUserHistoMin == "ON" )
2952  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
2953  if( fFlagUserHistoMax == "ON" )
2954  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
2955  //................................. automatic min and/or max
2956  if( fFlagUserHistoMin == "AUTO" )
2957  {SetYminMemoFromValue(HistoCode.Data(), h_geo_bid->GetMinimum()); fFlagUserHistoMin = "OFF";}
2958  if( fFlagUserHistoMax == "AUTO" )
2959  {SetYmaxMemoFromValue(HistoCode.Data(), h_geo_bid->GetMaximum()); fFlagUserHistoMax = "OFF";}
2960  //...................................... histo set ymin and ymax
2961  Int_t xFlagAutoYsupMargin = 0;
2962  xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, HistoCode);
2963 
2964  // ************************** A GARDER EN RESERVE *******************************
2965  //............. special contour level for correlations (square root wise scale)
2966  //if ( HistoCode == "D_MCs_ChNb" )
2967  //{
2968  // Int_t nb_niv = 9;
2969  // Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
2970  // SqrtContourLevels(nb_niv, &cont_niv[0]);
2971  // h_geo_bid->SetContour(nb_niv, &cont_niv[0]);
2972  // delete [] cont_niv; fCdelete++;
2973  //}
2974  // ******************************** (FIN RESERVE) *******************************
2975 
2976  // =================================== P L O T S ======================== (ViewStex)
2977 
2978  char* f_in = new char[fgMaxCar]; fCnew++;
2979 
2980  //...................... Taille/format canvas
2981  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
2982  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
2983 
2984  if( fFlagSubDet == "EB")
2985  {canv_h = fCnaParHistos->CanvasFormatH("etaphiSM");
2986  canv_w = fCnaParHistos->CanvasFormatW("etaphiSM");}
2987  if( fFlagSubDet == "EE")
2988  {canv_h = fCnaParHistos->CanvasFormatH("IXIYDee");
2989  canv_w = fCnaParHistos->CanvasFormatW("IXIYDee");}
2990 
2991  //............................................... paves commentaires (ViewStex)
2993 
2994  //------------------------------------ Canvas name ----------------- (ViewStex)
2995  TString name_cov_cor;
2996  Int_t MaxCar = fgMaxCar;
2997  name_cov_cor.Resize(MaxCar);
2998  name_cov_cor = "?";
2999 
3000  if( HistoCode == "D_NOE_ChNb"){name_cov_cor = "Nb_Of_D_Adc_EvDs";}
3001  if( HistoCode == "D_Ped_ChNb"){name_cov_cor = "Pedestals";}
3002  if( HistoCode == "D_TNo_ChNb"){name_cov_cor = "Total_noise";}
3003  if( HistoCode == "D_MCs_ChNb"){name_cov_cor = "Mean_Corss";}
3004  if( HistoCode == "D_LFN_ChNb"){name_cov_cor = "Low_Fq_Noise";}
3005  if( HistoCode == "D_HFN_ChNb"){name_cov_cor = "High_Fq_Noise";}
3006  if( HistoCode == "D_SCs_ChNb"){name_cov_cor = "Sigma_Corss";}
3007 
3008  TString name_visu;
3009  MaxCar = fgMaxCar;
3010  name_visu.Resize(MaxCar);
3011  name_visu = "colz";
3012 
3013  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%s%d_%s_HocoVeco",
3014  name_cov_cor.Data(), fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
3016  name_visu.Data());
3017 
3018  if( fFlagSubDet == "EB" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEB");}
3019  if( fFlagSubDet == "EE" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEE");}
3020 
3021  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
3022  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
3023 
3024  // cout << "*TEcnaHistos::ViewStex(...)> Plot is displayed on canvas ----> " << f_in << endl;
3025 
3026  delete [] f_in; f_in = 0; fCdelete++;
3027 
3028  //------------------------ Canvas draw and update ------------ (ViewStex)
3029  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
3030  fPavComStex->Draw();
3031  fPavComAnaRun->Draw();
3032  fPavComNbOfEvts->Draw();
3033 
3034  //----------------------------------------------------------- pad margins
3035  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3036  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
3037  Double_t x_margin = x_low;
3038  Double_t y_margin = y_low;
3039  MainCanvas->Divide( 1, 1, x_margin, y_margin);
3040  // Divide(nx, ny, x_margin, y_margin, color);
3041  gPad->cd(1);
3042  //........................... specific EE
3043  if( fFlagSubDet == "EE" )
3044  {Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
3045  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_Dee") - 0.005;
3046  TVirtualPad* main_subpad = gPad;
3047  main_subpad->SetPad(x_low, y_low, x_up, y_up);}
3048 
3049  //------------------------------------------------------------
3050  h_geo_bid->GetXaxis()->SetTitle(axis_x_var_name);
3051  h_geo_bid->GetYaxis()->SetTitle(axis_y_var_name);
3052 
3053  h_geo_bid->DrawCopy("COLZ");
3054 
3055  // trace de la grille: un rectangle = une tour ou un SC ---------------- (ViewStex)
3057  gPad->Draw();
3058  gPad->Update();
3059 
3060  //..................... retour aux options standard
3061  Bool_t b_true = 1;
3062  h_geo_bid->SetStats(b_true);
3063  h_geo_bid->Delete(); h_geo_bid = 0; fCdeleteRoot++;
3064 
3065  // delete MainCanvas; fCdeleteRoot++;
3066  }
3067  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
3068  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
3069  else
3070  {
3071  fStatusFileFound = kFALSE;
3072 
3073  cout << "!TEcnaHistos::ViewStex(...)> *ERROR* =====> "
3074  << " ROOT file not found" << fTTBELL << endl;
3075  }
3076 } // end of ViewStex(...)
3077 
3078 //===========================================================================
3079 //
3080 // StexHocoVecoLHFCorcc():
3081 // Geographical view of the cor(c,c) (mean over samples) for a
3082 // given Stex (BIG MATRIX)
3083 //
3084 //===========================================================================
3087 
3090 
3091 void TEcnaHistos::StexHocoVecoLHFCorcc(const TString Freq)
3092 {
3093 // (Hoco, Veco) matrices for all the Stins of a Stex
3094 
3100 
3101  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (StexHocoVecoLHFCorcc)
3102  {
3103  fStatusFileFound = kTRUE;
3104 
3106  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
3107  //cout << "*TEcnaHistos::StexHocoVecoLHFCorcc(...)> Data are analyzed from file ----> "
3108  // << fp_name_short << endl;
3109 
3113 
3114  //......................... matrix title
3115  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
3116 
3117  if( fFlagSubDet == "EB" && Freq == "LF" )
3118  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') for each tower in SM");}
3119  if( fFlagSubDet == "EB" && Freq == "HF" )
3120  {sprintf(f_in_mat_tit, "HF Cor(Xtal,Xtal') for each tower in SM");}
3121  if( fFlagSubDet == "EE" && Freq == "LF" )
3122  {sprintf(f_in_mat_tit, "LF Cor(Xtal,Xtal') for each SC in Dee");}
3123  if( fFlagSubDet == "EE" && Freq == "HF" )
3124  {sprintf(f_in_mat_tit, "HF Cor(Xtal,Xtal') for each SC in Dee");}
3125 
3126  //................................. Axis parameters
3127  Int_t GeoBidSizeHoco = fEcal->MaxStinHocoInStex()*fEcal->MaxCrysInStin();
3128  Int_t GeoBidSizeVeco = fEcal->MaxStinVecoInStex()*fEcal->MaxCrysInStin();
3129 
3130  Int_t nb_binx = GeoBidSizeHoco;
3131  Int_t nb_biny = GeoBidSizeVeco;
3132  Axis_t xinf_bid = (Axis_t)0.;
3133  Axis_t xsup_bid = (Axis_t)GeoBidSizeHoco;
3134  Axis_t yinf_bid = (Axis_t)0.;
3135  Axis_t ysup_bid = (Axis_t)GeoBidSizeVeco;
3136 
3137  TString axis_x_var_name = " #Hoco ";
3138  TString axis_y_var_name = " #varVeco ";
3139 
3140  //--------------------------------------------------------- (StexHocoVecoLHFCorcc)
3141 
3142  //............. matrices reading and histogram filling
3143 
3144  TH2D* h_geo_bid = new TH2D("geobidim_Hoco_Veco", f_in_mat_tit,
3145  nb_binx, xinf_bid, xsup_bid,
3146  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
3147  h_geo_bid->Reset();
3148 
3149  //======================================================== (StexHocoVecoLHFCorcc)
3150  TVectorD Stin_numbers(fEcal->MaxStinEcnaInStex());
3151  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){Stin_numbers(i)=(Double_t)0.;}
3152  Stin_numbers = fMyRootFile->ReadStinNumbers(fEcal->MaxStinEcnaInStex());
3153 
3154  if ( fMyRootFile->DataExist() == kTRUE )
3155  {
3156  fStatusDataExist = kTRUE;
3157 
3158  TMatrixD partial_matrix(fEcal->MaxCrysEcnaInStex(), fEcal->MaxCrysEcnaInStex());
3159  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++)
3160  {for(Int_t j=0; j<fEcal->MaxCrysEcnaInStex(); j++){partial_matrix(i,j)=(Double_t)0.;}}
3161 
3162  if( Freq == "LF")
3164  if( Freq == "HF")
3166 
3167  if ( fMyRootFile->DataExist() == kTRUE )
3168  {
3169  fStatusDataExist = kTRUE;
3170 
3172 
3173  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
3174  {
3175  Int_t StexStin = (Int_t)Stin_numbers(i0StexStinEcna);
3176  Int_t offset_x = ((StexStin-1)/fEcal->MaxStinVecoInStex())*fEcal->MaxCrysInStin();
3177  Int_t offset_y = ((StexStin-1)%fEcal->MaxStinVecoInStex())*fEcal->MaxCrysInStin();
3178 
3179  if (StexStin != -1)
3180  {
3181  //================================================= (StexHocoVecoLHFCorcc)
3182  //------------------ Geographical bidim filling
3183  for(Int_t i0StinEcha=0; i0StinEcha<fEcal->MaxCrysInStin(); i0StinEcha++)
3184  {
3185  for(Int_t j0StinEcha=0; j0StinEcha<fEcal->MaxCrysInStin(); j0StinEcha++)
3186  {
3187  Int_t i_xgeo = offset_x + i0StinEcha;
3188  Int_t i_ygeo = offset_y + j0StinEcha;
3189 
3190  if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
3191  {
3192  Int_t iEcha = (StexStin-1)*fEcal->MaxCrysInStin() + i0StinEcha;
3193  Int_t jEcha = (StexStin-1)*fEcal->MaxCrysInStin() + j0StinEcha;
3194 
3195  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
3196  (Double_t)partial_matrix(iEcha, jEcha));
3197  }
3198  }
3199  }
3200  }
3201  }
3202 
3203  //=============== H I S T O M I N / M A X M A N A G E M E N T ============ (StexHocoVecoLHFCorcc)
3204 
3205  TString HistoCode = "H2CorccInStins";
3206 
3207  //................................ Put histo min max values
3208  //.......... default if flag not set to "ON"
3209  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
3210  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
3211 
3212  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
3213  //.......... user's value if flag set to "ON"
3214  if( fFlagUserHistoMin == "ON" )
3215  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
3216  if( fFlagUserHistoMax == "ON" )
3217  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
3218  //................................. automatic min and/or max
3219  if( fFlagUserHistoMin == "AUTO" )
3220  {SetYminMemoFromValue(HistoCode.Data(), h_geo_bid->GetMinimum()); fFlagUserHistoMin = "OFF";}
3221  if( fFlagUserHistoMax == "AUTO" )
3222  {SetYmaxMemoFromValue(HistoCode.Data(), h_geo_bid->GetMaximum()); fFlagUserHistoMax = "OFF";}
3223  //...................................... histo set ymin and ymax
3224  Int_t xFlagAutoYsupMargin = 0;
3225  xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, HistoCode);
3226 
3227  // ----------------------------------- P L O T S (StexHocoVecoLHFCorcc)
3228 
3229  char* f_in = new char[fgMaxCar]; fCnew++;
3230 
3231  //...................... Taille/format canvas
3232 
3233  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
3234  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
3235 
3236  if( fFlagSubDet == "EB")
3237  {canv_h = fCnaParHistos->CanvasFormatH("etaphiSM");
3238  canv_w = fCnaParHistos->CanvasFormatW("etaphiSM");}
3239  if( fFlagSubDet == "EE")
3240  {canv_h = fCnaParHistos->CanvasFormatH("IXIYDee");
3241  canv_w = fCnaParHistos->CanvasFormatW("IXIYDee");}
3242 
3243  //..................................... paves commentaires (StexHocoVecoLHFCorcc)
3245 
3246  //----------------- Canvas name ------- (StexHocoVecoLHFCorcc)
3247  TString name_cov_cor;
3248  Int_t MaxCar = fgMaxCar;
3249  name_cov_cor.Resize(MaxCar);
3250  if( Freq == "LF" ){name_cov_cor = "StexLFCorcc";}
3251  if( Freq == "HF" ){name_cov_cor = "StexHFCorcc";}
3252 
3253  TString name_visu;
3254  MaxCar = fgMaxCar;
3255  name_visu.Resize(MaxCar);
3256  name_visu = "colz";
3257 
3258  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_Stex%s%d_%s_HocoVeco",
3259  name_cov_cor.Data(), fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
3261  name_visu.Data());
3262 
3263  if( fFlagSubDet == "EB" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEB");}
3264  if( fFlagSubDet == "EE" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stex2DEE");}
3265 
3266  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
3267  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
3268 
3269  // cout << "*TEcnaHistos::StexHocoVecoLHFCorcc(...)> Plot is displayed on canvas ----> "
3270  // << f_in << endl;
3271 
3272  delete [] f_in; f_in = 0; fCdelete++;
3273 
3274  //------------ Canvas draw and update ------ (StexHocoVecoLHFCorcc)
3275  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
3276  fPavComStex->Draw();
3277  fPavComAnaRun->Draw();
3278  fPavComNbOfEvts->Draw();
3279 
3280  //----------------------------------------------------------- pad margins
3281  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3282  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
3283  Double_t x_margin = x_low;
3284  Double_t y_margin = y_low;
3285  MainCanvas->Divide( 1, 1, x_margin, y_margin);
3286  // Divide(nx, ny, x_margin, y_margin, color);
3287  gPad->cd(1);
3288  //........................... specific EE
3289  if( fFlagSubDet == "EE" )
3290  {Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
3291  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_Dee") - 0.005;
3292  TVirtualPad* main_subpad = gPad;
3293  main_subpad->SetPad(x_low, y_low, x_up, y_up);}
3294 
3295  // Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3296  // Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
3297  // MainCanvas->Divide(1, 1, x_margin, y_margin);
3298  // gPad->cd(1);
3299 
3300  h_geo_bid->GetXaxis()->SetTitle(axis_x_var_name);
3301  h_geo_bid->GetYaxis()->SetTitle(axis_y_var_name);
3302 
3303  h_geo_bid->DrawCopy("COLZ");
3304 
3305  // trace de la grille: un rectangle = une tour (StexHocoVecoLHFCorcc)
3306  ViewStexGrid(fFapStexNumber, "corcc");
3307  gPad->Draw();
3308  gPad->Update();
3309 
3310  //..................... retour aux options standard
3311  Bool_t b_true = 1;
3312  h_geo_bid->SetStats(b_true);
3313  h_geo_bid->Delete(); h_geo_bid = 0; fCdeleteRoot++;
3314 
3315  // delete MainCanvas; fCdeleteRoot++;
3316  }
3317  }
3318  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
3319  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
3320  else
3321  {
3322  fStatusFileFound = kFALSE;
3323 
3324  cout << "!TEcnaHistos::StexHocoVecoLHFCorcc(...)> *ERROR* =====> "
3325  << " ROOT file not found" << fTTBELL << endl;
3326  }
3327 } // end of StexHocoVecoLHFCorcc
3328 
3329 //==================================================================================
3330 //
3331 // GetXCrysInStex, GetYCrysInStex
3332 //
3333 //==================================================================================
3334 
3335 Int_t TEcnaHistos::GetXCrysInStex(const Int_t& StexNumber, const Int_t& StexStin,
3336  const Int_t& i0StinEcha)
3337 {
3338 //Gives the X crystal coordinate in the geographic view of one Stex
3339 // (X = 0 to MaxStinHocoInStex*NbCrysHocoInStin - 1)
3340 
3341  Int_t ix_geo = 0;
3342 
3343  if( fFlagSubDet == "EB")
3344  {TString ctype = fEcalNumbering->GetStexHalfStas(StexNumber);
3345  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin, i0StinEcha, StexNumber);
3346  ix_geo = (n1StexCrys-1)/fEcal->MaxCrysVecoInStex(); // ix_geo for EB+
3347  if( ctype == "EB-"){ix_geo = fEcal->MaxCrysHocoInStex() - ix_geo - 1;}}
3348 
3349  if( fFlagSubDet == "EE")
3350  {TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(StexNumber);
3351  ix_geo = 0;
3352  if( DeeDir == "right" )
3353  {ix_geo = fEcalNumbering->GetIXCrysInDee(StexNumber, StexStin, i0StinEcha) - 1;}
3354  if( DeeDir == "left" )
3355  {ix_geo = fEcal->MaxCrysIXInDee() - fEcalNumbering->GetIXCrysInDee(StexNumber, StexStin, i0StinEcha);}}
3356 
3357  return ix_geo;
3358 }
3359 
3360 Int_t TEcnaHistos::GetYCrysInStex(const Int_t& StexNumber, const Int_t& StexStin,
3361  const Int_t& j0StinEcha)
3362 {
3363 //Gives the Y crystal coordinate in the geographic view of one Stex
3364 // (Y = 0 to MaxStinVecoInStex*NbCrysVecoInStin - 1)
3365 
3366  Int_t iy_geo = 0;
3367 
3368  if( fFlagSubDet == "EB")
3369  {TString ctype = fEcalNumbering->GetStexHalfStas(StexNumber);
3370  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin, j0StinEcha, StexNumber);
3371  Int_t ix_geo = (n1StexCrys-1)/fEcal->MaxCrysVecoInStex(); // ix_geo for EB+
3372  iy_geo = n1StexCrys - 1 - ix_geo*fEcal->MaxCrysVecoInStex(); // iy_geo for EB+
3373  if( ctype == "EB-"){iy_geo = fEcal->MaxCrysVecoInStex() - iy_geo - 1;}}
3374 
3375  if( fFlagSubDet == "EE")
3376  {iy_geo = fEcalNumbering->GetJYCrysInDee(StexNumber, StexStin, j0StinEcha) - 1;}
3377 
3378  return iy_geo;
3379 }
3380 
3381 //===========================================================================
3382 //
3383 // StexStinNumbering, ViewStexStinNumberingPad
3384 //
3385 // independent of the ROOT file => StexNumber as argument
3386 //
3387 //===========================================================================
3388 void TEcnaHistos::StexStinNumbering(const Int_t& StexNumber)
3389 {
3390 //display the Stin numbering of the Stex
3391 
3392  if( fFlagSubDet == "EB" ){SMTowerNumbering(StexNumber);}
3393  if( fFlagSubDet == "EE" ){DeeSCNumbering(StexNumber);}
3394 }
3395 // end of StexStinNumbering
3396 
3397 //=============================================================================
3398 //
3399 // ViewStexStinNumberingPad
3400 // independent of the ROOT file => StexNumber as argument
3401 //
3402 //=============================================================================
3403 void TEcnaHistos::ViewStexStinNumberingPad(const Int_t& StexNumber)
3404 {
3405 //display the Stin numbering of the Stex in a Pad
3406 
3407  if( fFlagSubDet == "EB"){ViewSMTowerNumberingPad(StexNumber);}
3408  if( fFlagSubDet == "EE"){ViewDeeSCNumberingPad(StexNumber);}
3409 }
3410 //----------------> end of ViewStexStinNumberingPad()
3411 
3412 //==========================================================================
3413 //
3414 // ViewStexGrid
3415 // independent of the ROOT file => StexNumber as argument
3416 //
3417 //==========================================================================
3418 void TEcnaHistos::ViewStexGrid(const Int_t& StexNumber, const TString c_option)
3419 {
3420  //Grid of one Stex with axis Hoco and Veco
3421 
3422  if( fFlagSubDet == "EB"){ViewSMGrid(StexNumber, c_option);}
3423  if( fFlagSubDet == "EE"){ViewDeeGrid(StexNumber, c_option);}
3424 
3425 } // end of ViewStexGrid
3426 
3427 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& S P E C I F I C &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
3428 
3429 //======================================= BARREL ===============================
3430 void TEcnaHistos::SMTowerNumbering(const Int_t& SMNumber)
3431 {
3432  //display the tower numbering of the super-module
3433 
3434  if( (SMNumber > 0) && (SMNumber <= fEcal->MaxSMInEB()) )
3435  {
3436  Int_t GeoBidSizeEta = fEcal->MaxTowEtaInSM()*fEcal->MaxCrysEtaInTow();
3437  Int_t GeoBidSizePhi = fEcal->MaxTowPhiInSM()*fEcal->MaxCrysPhiInTow();
3438 
3439  Int_t nb_binx = GeoBidSizeEta;
3440  Int_t nb_biny = GeoBidSizePhi;
3441  Axis_t xinf_bid = (Axis_t)0.;
3442  Axis_t xsup_bid = (Axis_t)GeoBidSizeEta;
3443  Axis_t yinf_bid = (Axis_t)0.;
3444  Axis_t ysup_bid = (Axis_t)GeoBidSizePhi;
3445 
3446  TString axis_x_var_name = " #eta ";
3447  TString axis_y_var_name = " #varphi ";
3448 
3449  //------------------------------------------------------------------- SMTowerNumbering
3450 
3451  //............. matrices reading and histogram filling
3452  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
3453 
3454  sprintf(f_in_mat_tit, "SM tower numbering");
3455 
3456  // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
3457 
3458  TH2D* h_empty_bid = new TH2D("grid_bidim_eta_phi", f_in_mat_tit,
3459  nb_binx, xinf_bid, xsup_bid,
3460  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
3461  h_empty_bid->Reset();
3462 
3463  h_empty_bid->GetXaxis()->SetTitle(axis_x_var_name);
3464  h_empty_bid->GetYaxis()->SetTitle(axis_y_var_name);
3465 
3466  // ------------------------------------------------ P L O T S (SMTowerNumbering)
3467 
3468  char* f_in = new char[fgMaxCar]; fCnew++;
3469 
3470  //...................... Taille/format canvas
3471 
3472  UInt_t canv_h = fCnaParHistos->CanvasFormatH("etaphiSM");
3473  UInt_t canv_w = fCnaParHistos->CanvasFormatW("etaphiSM");
3474 
3475  //............................................... options generales
3476 
3478 
3479  //............................................... paves commentaires (SMTowerNumbering)
3480  SetAllPavesViewStex("Numbering", SMNumber);
3481 
3482  //------------------------------------ Canvas name ----------------- (SMTowerNumbering)
3483 
3484  sprintf(f_in, "tower_numbering_for_SuperModule_SM%d", SMNumber);
3485 
3486  SetHistoPresentation((TH1D*)h_empty_bid,"Stex2DEB");
3487 
3488  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
3489  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
3490 
3491  // cout << "*TEcnaHistosEB::ViewSM(...)> Plot is displayed on canvas ----> " << f_in << endl;
3492 
3493  delete [] f_in; f_in = 0; fCdelete++;
3494 
3495  //------------------------ Canvas draw and update ------------ (SMTowerNumbering)
3496  fPavComStex->Draw();
3497 
3498  Double_t x_margin = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3499  Double_t y_margin = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
3500  MainCanvas->Divide(1, 1, x_margin, y_margin);
3501  gPad->cd(1);
3502 
3503  h_empty_bid->DrawCopy("COL"); // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
3504 
3505  ViewSMTowerNumberingPad(SMNumber);
3506  gPad->Update();
3507 
3508  //..................... retour aux options standard
3509  Bool_t b_true = 1;
3510  h_empty_bid->SetStats(b_true);
3511 
3512  h_empty_bid->Delete(); h_empty_bid = 0; fCdeleteRoot++;
3513 
3514  // delete MainCanvas; fCdeleteRoot++;
3515 
3516  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
3517  }
3518  else
3519  {
3520  cout << "!TEcnaHistos::SMTowerNumbering(...)> SM = " << SMNumber
3521  << ". Out of range ( range = [1," << fEcal->MaxSMInEB() << "] )" << fTTBELL << endl;
3522  }
3523 }
3524 // end of SMTowerNumbering
3525 
3526 void TEcnaHistos::ViewSMTowerNumberingPad(const Int_t& SMNumber)
3527 {
3528  //display the tower numbering of the super-module in a Pad
3529 
3530  gStyle->SetTitleW(0.2); // taille titre histos
3531  gStyle->SetTitleH(0.07);
3532 
3533  ViewSMGrid(SMNumber, " ");
3534 
3535  Color_t couleur_rouge = fCnaParHistos->SetColorsForNumbers("lvrb_top");
3536  Color_t couleur_bleu_fonce = fCnaParHistos->SetColorsForNumbers("lvrb_bottom");
3537 
3538  //..... Ecriture des numeros de tours dans la grille..... (ViewSMTowerNumberingPad)
3539 
3540  char* f_in = new char[fgMaxCar]; fCnew++;
3541  gStyle->SetTextSize(0.075);
3542 
3543  // x_channel, y_channel: coordinates of the text "Txx"
3544  Int_t y_channel = 12;
3545  Int_t x_channel = 12;
3546 
3547  Int_t max_tow_phi = fEcal->MaxTowPhiInSM()*fEcal->MaxCrysPhiInTow();
3548 
3549  //------------------ LOOP ON THE SM_TOWER NUMBER (ViewSMTowerNumberingPad)
3550 
3551  TText *text_SMtow_num = new TText(); fCnewRoot++;
3552 
3553  for (Int_t i_SMtow = 1; i_SMtow <= fEcal->MaxTowInSM(); i_SMtow++)
3554  {
3555  if(fEcalNumbering->GetTowerLvrbType(i_SMtow) == "top")
3556  {text_SMtow_num->SetTextColor(couleur_rouge);}
3557  if(fEcalNumbering->GetTowerLvrbType(i_SMtow) == "bottom")
3558  {text_SMtow_num->SetTextColor(couleur_bleu_fonce);}
3559 
3560  //................................ x from eta
3561  Double_t x_from_eta = fEcalNumbering->GetEta(SMNumber, i_SMtow, x_channel) - (Double_t)1;
3562  if(fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-")
3563  {x_from_eta = fEcal->MaxTowEtaInSM()*fEcal->MaxCrysEtaInTow() + x_from_eta + (Double_t)1;}
3564 
3565  //................................ y from phi
3566  Double_t y_from_phi = max_tow_phi - 1
3567  - (fEcalNumbering->GetPhi(SMNumber, i_SMtow, y_channel) - fEcalNumbering->GetPhiMin(SMNumber));
3568  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-")
3569  {y_from_phi = - y_from_phi + fEcal->MaxTowPhiInSM()*fEcal->MaxCrysPhiInTow() - (Double_t)1;}
3570 
3571  sprintf(f_in, "%d", i_SMtow);
3572  text_SMtow_num->DrawText(x_from_eta, y_from_phi, f_in); // <=== prend du temps si on mets "T%d" dans le sprintf
3573  }
3574 
3575  text_SMtow_num->Delete(); text_SMtow_num = 0; fCdeleteRoot++;
3576 
3577  //.................................................... legende (ViewSMTowerNumberingPad)
3578  Double_t offset_tow_tex_eta = (Double_t)8.;
3579  Double_t offset_tow_tex_phi = (Double_t)15.;
3580 
3581  Color_t couleur_noir = fCnaParHistos->ColorDefinition("noir");
3582  Double_t x_legend = (Double_t)0.;
3583  Double_t y_legend = (Double_t)0.;
3584 
3585  Int_t ref_tower = fEcal->MaxTowInSM();
3586 
3587  //................................................. LVRB TOP (ViewSMTowerNumberingPad)
3588  gStyle->SetTextSize(0.075);
3589  gStyle->SetTextColor(couleur_rouge);
3590  x_legend = fEcalNumbering->GetEta(SMNumber, ref_tower, x_channel);
3591  y_legend = fEcalNumbering->GetPhi(SMNumber, ref_tower, y_channel) - fEcalNumbering->GetPhiMin(SMNumber);
3592 
3593  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+" )
3594  {
3595  x_legend = x_legend + offset_tow_tex_eta;
3596  y_legend = y_legend + offset_tow_tex_phi;
3597  }
3598  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-" )
3599  {
3600  x_legend = -x_legend + offset_tow_tex_eta;
3601  y_legend = y_legend + offset_tow_tex_phi;
3602  }
3603 
3604  sprintf( f_in, "xx");
3605  TText *text_legend_rouge = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3606  text_legend_rouge->Draw();
3607  gStyle->SetTextSize(0.05);
3608  x_legend = x_legend - (Double_t)3.5;
3609  y_legend = y_legend - (Double_t)2.;
3610  sprintf(f_in, " LVRB ");
3611  TText *text_legend_rouge_expl = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3612  text_legend_rouge_expl->Draw();
3613  y_legend = y_legend - (Double_t)1.75;
3614  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+" ){sprintf(f_in, " <--- ");}
3615  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-" ){sprintf(f_in, " ---> ");}
3616  TText *text_legend_rouge_expm = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3617  text_legend_rouge_expm->Draw();
3618  //text_legend_rouge_expl->Delete(); text_legend_rouge_expl = 0; fCdeleteRoot++;
3619 
3620  //................................................. LVRB BOTTOM (ViewSMTowerNumberingPad)
3621  gStyle->SetTextSize(0.075);
3622  gStyle->SetTextColor(couleur_bleu_fonce);
3623  x_legend = fEcalNumbering->GetEta(SMNumber, ref_tower, x_channel);
3624  y_legend = fEcalNumbering->GetPhi(SMNumber, ref_tower, y_channel) - fEcalNumbering->GetPhiMin(SMNumber);
3625 
3626  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+" )
3627  {
3628  x_legend = x_legend + offset_tow_tex_eta;
3629  y_legend = y_legend + offset_tow_tex_phi/3;
3630  }
3631  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-" )
3632  {
3633  x_legend = -x_legend + offset_tow_tex_eta;
3634  y_legend = y_legend + offset_tow_tex_phi/3;
3635  }
3636 
3637  sprintf(f_in, "xx");
3638  TText *text_legend_bleu = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3639  text_legend_bleu->Draw();
3640  //text_legend_bleu->Delete(); text_legend_bleu = 0; fCdeleteRoot++;
3641  gStyle->SetTextSize(0.05);
3642  x_legend = x_legend - (Double_t)3.5;
3643  y_legend = y_legend - (Double_t)2.;
3644  sprintf( f_in, " LVRB ");
3645  TText *text_legend_bleu_expl = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3646  text_legend_bleu_expl->Draw();
3647  y_legend = y_legend - (Double_t)1.75;
3648  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+" ){sprintf( f_in, " ---> ");}
3649  if( fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-" ){sprintf( f_in, " <--- ");}
3650  TText *text_legend_bleu_expm = new TText(x_legend, y_legend, f_in); fCnewRoot++;
3651  text_legend_bleu_expm->Draw();
3652  //text_legend_bleu_expl->Delete(); text_legend_bleu_expl = 0; fCdeleteRoot++;
3653 
3654  delete [] f_in; f_in = 0; fCdelete++;
3655 
3656  gStyle->SetTextColor(couleur_noir);
3657 }
3658 //----------------> end of ViewSMTowerNumberingPad()
3659 
3660 void TEcnaHistos::ViewSMGrid(const Int_t& SMNumber, const TString c_option)
3661 {
3662  //Grid of one supermodule with axis eta and phi
3663 
3664  Int_t GeoBidSizeEta = fEcal->MaxTowEtaInSM()*fEcal->MaxCrysEtaInTow();
3665  Int_t GeoBidSizePhi = fEcal->MaxTowPhiInSM()*fEcal->MaxCrysPhiInTow();
3666 
3667  if ( c_option == "corcc")
3668  {
3669  GeoBidSizeEta = fEcal->MaxTowEtaInSM()*fEcal->MaxCrysInTow();
3670  GeoBidSizePhi = fEcal->MaxTowPhiInSM()*fEcal->MaxCrysInTow();
3671  }
3672 
3673  Int_t nb_binx = GeoBidSizeEta;
3674  Int_t nb_biny = GeoBidSizePhi;
3675  Axis_t xinf_bid = (Axis_t)0.;
3676  Axis_t xsup_bid = (Axis_t)GeoBidSizeEta;
3677  Axis_t yinf_bid = (Axis_t)0.;
3678  Axis_t ysup_bid = (Axis_t)GeoBidSizePhi;
3679 
3680  //---------------- trace de la grille: un rectangle = une tour
3681 
3682  Int_t size_eta = fEcal->MaxCrysEtaInTow();
3683  Int_t size_phi = fEcal->MaxCrysPhiInTow();
3684  if ( c_option == "corcc")
3685  {
3686  size_eta = fEcal->MaxCrysInTow();
3687  size_phi = fEcal->MaxCrysInTow();
3688  }
3689  Int_t max_x = nb_binx/size_eta;
3690  Int_t max_y = nb_biny/size_phi;
3691 
3692  //............................. lignes horizontales
3693  Double_t yline = (Double_t)yinf_bid;
3694 
3695  Double_t xline_left = (Double_t)xinf_bid;
3696  Double_t xline_right = (Double_t)xsup_bid;
3697 
3698  for( Int_t j = 0 ; j < max_y ; j++)
3699  {
3700  yline = yline + (Double_t)size_phi;
3701  TLine *lin;
3702  lin = new TLine(xline_left, yline, xline_right, yline); fCnewRoot++;
3703  lin->Draw();
3704  // delete lin; fCdeleteRoot++;
3705  }
3706 
3707  //.......................... lignes verticales
3708  Double_t xline = (Double_t)xinf_bid - (Double_t)size_eta;
3709 
3710  Double_t yline_bot = (Double_t)yinf_bid;
3711  Double_t yline_top = (Double_t)ysup_bid;
3712 
3713  Color_t coul_surligne = fCnaParHistos->ColorDefinition("noir");
3714  Color_t coul_textmodu = fCnaParHistos->ColorDefinition("vert36");
3715 
3716  //............................ Mj text
3717  gStyle->SetTextColor(coul_textmodu);
3718  gStyle->SetTextSize(0.075);
3719 
3720  char* f_in = new char[fgMaxCar]; fCnew++;
3721 
3722  for( Int_t i = 0 ; i < max_x ; i++)
3723  {
3724  xline = xline + (Double_t)size_eta;
3725  TLine *lin;
3726  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
3727 
3728  //............. Surlignage separateur des modules
3729  if( (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") && (i == 4 || i == 8 || i == 12) )
3730  {lin->SetLineWidth(2); lin->SetLineColor(coul_surligne);}
3731  if( (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+") && (i == 5 || i == 9 || i == 13) )
3732  {lin->SetLineWidth(2); lin->SetLineColor(coul_surligne);}
3733 
3734  lin->Draw();
3735  // delete lin; fCdeleteRoot++;
3736 
3737  //............. Numeros des modules
3738  if( (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB-") && (i == 2 || i == 6 || i == 10 || i == 14) )
3739  {
3740  if( i == 2 ){sprintf( f_in, "M4");}
3741  if( i == 6 ){sprintf( f_in, "M3");}
3742  if( i == 10 ){sprintf( f_in, "M2");}
3743  if( i == 14 ){sprintf( f_in, "M1");}
3744 
3745  TText *text_num_module = new TText(xline + 1, yline_top + 1, f_in); fCnewRoot++;
3746  text_num_module->Draw();
3747  //text_num_module->Delete(); text_num_module = 0; fCdeleteRoot++;
3748  }
3749  if( (fEcalNumbering->GetSMHalfBarrel(SMNumber) == "EB+") && (i == 3 || i == 7 || i == 11 || i == 15) )
3750  {
3751  if( i == 3 ){sprintf( f_in, "M1");}
3752  if( i == 7 ){sprintf( f_in, "M2");}
3753  if( i == 11 ){sprintf( f_in, "M3");}
3754  if( i == 15 ){sprintf( f_in, "M4");}
3755 
3756  TText *text_num_module = new TText(xline, yline_top + 1, f_in); fCnewRoot++;
3757  text_num_module->Draw();
3758  //text_num_module->Delete(); text_num_module = 0; fCdeleteRoot++;
3759  }
3760  }
3761  delete [] f_in; f_in = 0; fCdelete++;
3762 
3763  //------------------ trace axes en eta et phi --------------- ViewSMGrid
3764 
3765  Int_t MatSize = fEcal->MaxCrysEtaInTow();
3766  if ( c_option == "corcc"){MatSize = fEcal->MaxCrysInTow();}
3767 
3768  Int_t size_eta_sm = fEcal->MaxTowEtaInSM();
3769  Int_t size_phi_sm = fEcal->MaxTowPhiInSM();
3770 
3771  //...................................................... Axe i(eta) (bottom x) ViewSMGrid
3772  Double_t eta_min = fEcalNumbering->GetIEtaMin(SMNumber);
3773  Double_t eta_max = fEcalNumbering->GetIEtaMax(SMNumber);
3774 
3775  TString x_var_name = GetHocoVecoAxisTitle("ietaSM");;
3776  TString x_direction = fEcalNumbering->GetXDirectionEB(SMNumber);
3777 
3778  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
3779  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize("SMx");
3780  Float_t tic_siz_x = fCnaParHistos->AxisTickSize("SMx");
3781  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("SMx");
3782  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("SMx");
3783 
3784  TF1 *f1 = new TF1("f1", x_direction.Data(), eta_min, eta_max); fCnewRoot++;
3785  TGaxis* sup_axis_x = 0;
3786 
3787  if( x_direction == "-x" ) // NEVER IN THIS CASE: xmin->xmax <=> right->left ("-x") direction
3788  {sup_axis_x = new TGaxis( (Float_t)0., (Float_t)0., (Float_t)(size_eta_sm*MatSize), (Float_t)0.,
3789  "f1", size_eta_sm, "SC" , 0.); fCnewRoot++;}
3790 
3791  if( x_direction == "x" ) // ALWAYS IN THIS CASE: xmin->xmax <=> left->right ("x") direction
3792  {sup_axis_x = new TGaxis( (Float_t)0., (Float_t)0., (Float_t)(size_eta_sm*MatSize), (Float_t)0.,
3793  "f1", size_eta_sm, "SC" , 0.); fCnewRoot++;}
3794 
3795  sup_axis_x->SetTitle(x_var_name);
3796  sup_axis_x->SetTitleSize(tit_siz_x);
3797  sup_axis_x->SetTitleOffset(tit_off_x);
3798  sup_axis_x->SetLabelSize(lab_siz_x);
3799  sup_axis_x->SetLabelOffset(lab_off_x);
3800  sup_axis_x->SetTickSize(tic_siz_x);
3801  sup_axis_x->Draw("SAME");
3802 
3803  //...................................................... Axe phi (y) ViewSMGrid
3804  Double_t phi_min = fEcalNumbering->GetPhiMin(SMNumber);
3805  Double_t phi_max = fEcalNumbering->GetPhiMax(SMNumber);
3806 
3807  TString y_var_name = GetHocoVecoAxisTitle("phi");
3808  TString y_direction = fEcalNumbering->GetYDirectionEB(SMNumber);
3809 
3810  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
3811  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize("SMy");
3812  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("SMy");
3813  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("SMy");
3814  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("SMy");
3815 
3816  TF1 *f2 = new TF1("f2", y_direction.Data(), phi_min, phi_max); fCnewRoot++;
3817  TGaxis* sup_axis_y = 0;
3818 
3819  if ( y_direction == "-x" ) // ALWAYS IN THIS CASE: ymin->ymax <=> top->bottom ("-x") direction
3820  {sup_axis_y = new TGaxis(-(Float_t)1.5*(Float_t)size_eta, (Float_t)0.,
3821  -(Float_t)1.5*(Float_t)size_eta, (Float_t)(size_phi_sm*MatSize),
3822  "f2", (Int_t)size_phi_sm, "SC", 0.); fCnewRoot++;}
3823 
3824  if ( y_direction == "x" ) // NEVER IN THIS CASE: ymin->ymax <=> bottom->top ("x") direction
3825  {sup_axis_y = new TGaxis(-(Float_t)1.5*(Float_t)size_eta, (Float_t)0.,
3826  -(Float_t)1.5*(Float_t)size_eta, (Float_t)(size_phi_sm*MatSize),
3827  "f2", (Int_t)size_phi_sm, "SC", 0.); fCnewRoot++;}
3828 
3829  sup_axis_y->SetTitle(y_var_name);
3830  sup_axis_y->SetTitleSize(tit_siz_y);
3831  sup_axis_y->SetTitleOffset(tit_off_y);
3832  sup_axis_y->SetLabelSize(lab_siz_y);
3833  sup_axis_y->SetLabelOffset(lab_off_y);
3834  sup_axis_y->SetTickSize(tic_siz_y);
3835  sup_axis_y->Draw("SAME");
3836 
3837  //...................................................... Axe jphi (jy) ViewSMGrid
3838  Double_t jphi_min = fEcalNumbering->GetJPhiMin(SMNumber);
3839  Double_t jphi_max = fEcalNumbering->GetJPhiMax(SMNumber);
3840 
3841  TString jy_var_name = " ";
3842  TString jy_direction = fEcalNumbering->GetJYDirectionEB(SMNumber);
3843 
3844  TF1 *f3 = new TF1("f3", jy_direction.Data(), jphi_min, jphi_max); fCnewRoot++;
3845  TGaxis* sup_axis_jy = 0;
3846 
3847  //............; essai
3848  sup_axis_jy = new TGaxis((Float_t)0., (Float_t)0.,
3849  (Float_t)0., (Float_t)(size_phi_sm*MatSize),
3850  "f3", (Int_t)size_phi_sm, "SC", 0.); fCnewRoot++;
3851 
3852  if ( jy_direction == "-x" ) // IN THIS CASE FOR EB+: ymin->ymax <=> top->bottom ("-x") direction
3853  {jy_var_name = GetEtaPhiAxisTitle("jphiSMB+");}
3854 
3855  if ( jy_direction == "x" ) // IN THIS CASE FOR EB-: ymin->ymax <=> bottom->top ("x") direction
3856  {jy_var_name = GetEtaPhiAxisTitle("jphiSMB-");}
3857 
3858  lab_off_y = fCnaParHistos->AxisLabelOffset("SMyInEB");
3859 
3860  sup_axis_jy->SetTitle(jy_var_name);
3861  sup_axis_jy->SetTitleSize(tit_siz_y);
3862  sup_axis_jy->SetTitleOffset(tit_off_y);
3863  sup_axis_jy->SetLabelSize(lab_siz_y);
3864  sup_axis_jy->SetLabelOffset(lab_off_y);
3865  sup_axis_jy->SetTickSize(tic_siz_y);
3866  sup_axis_jy->Draw("SAME");
3867 
3868  //--------------------------- ViewSMGrid
3869 
3870  f1 = 0;
3871  f2 = 0;
3872  f3 = 0;
3873 
3874  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
3875 
3876 } // end of ViewSMGrid
3877 
3878 //======================================= ENDCAP ===============================
3879 void TEcnaHistos::DeeSCNumbering(const Int_t& DeeNumber)
3880 {
3881  //display the SC numbering of the Dee
3882 
3883  if( (DeeNumber > 0) && (DeeNumber <= fEcal->MaxDeeInEE()) )
3884  {
3885  Int_t GeoBidSizeIX = fEcal->MaxSCIXInDee()*fEcal->MaxCrysIXInSC();
3886  Int_t GeoBidSizeIY = fEcal->MaxSCIYInDee()*fEcal->MaxCrysIYInSC();
3887 
3888  Int_t nb_binx = GeoBidSizeIX;
3889  Int_t nb_biny = GeoBidSizeIY;
3890  Axis_t xinf_bid = (Axis_t)0.;
3891  Axis_t xsup_bid = (Axis_t)GeoBidSizeIX;
3892  Axis_t yinf_bid = (Axis_t)0.;
3893  Axis_t ysup_bid = (Axis_t)GeoBidSizeIY;
3894 
3895  TString axis_x_var_name = " IX ";
3896  TString axis_y_var_name = " IY ";
3897 
3898  //------------------------------------------------------------------- DeeSCNumbering
3899  //........................................... empty histogram filling
3900  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
3901 
3902  sprintf(f_in_mat_tit, " Dee SC numbering ");
3903 
3904  // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
3905 
3906  TH2D* h_empty_bid = new TH2D("grid_bidim_IX_IY", f_in_mat_tit,
3907  nb_binx, xinf_bid, xsup_bid,
3908  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
3909  h_empty_bid->Reset();
3910 
3911  h_empty_bid->GetXaxis()->SetTitle(axis_x_var_name);
3912  h_empty_bid->GetYaxis()->SetTitle(axis_y_var_name);
3913 
3914  // ------------------------------------------------ P L O T S (DeeSCNumbering)
3915 
3916  char* f_in = new char[fgMaxCar]; fCnew++;
3917 
3918  //...................... Taille/format canvas
3919 
3920  UInt_t canv_h = fCnaParHistos->CanvasFormatH("IXIYDee");
3921  UInt_t canv_w = fCnaParHistos->CanvasFormatW("IXIYDee");
3922 
3923  //............................................... options generales
3925 
3926  //............................................... paves commentaires (DeeSCNumbering)
3927  SetAllPavesViewStex("Numbering", DeeNumber);
3928 
3929  //------------------------------------ Canvas name ----------------- (DeeSCNumbering)
3930 
3931  sprintf(f_in, "SC_numbering_for_Dee_Dee%d", DeeNumber);
3932  SetHistoPresentation((TH1D*)h_empty_bid,"Stex2DEENb");
3933  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
3934  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
3935 
3936  // cout << "*TEcnaHistosEE::ViewDee(...)> Plot is displayed on canvas ----> " << f_in << endl;
3937 
3938  delete [] f_in; f_in = 0; fCdelete++;
3939 
3940  //------------------------ Canvas draw and update ------------ (DeeSCNumbering)
3941  fPavComStex->Draw();
3942  fPavComCxyz->Draw();
3943 
3944  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
3945  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
3946  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
3947  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_Dee") - 0.005;
3948 
3949  Double_t x_margin = x_low;
3950  Double_t y_margin = y_low;
3951 
3952  MainCanvas->Divide( 1, 1, x_margin, y_margin);
3953  // Divide(nx, ny, x_margin, y_margin, color);
3954 
3955  gPad->cd(1);
3956  TVirtualPad* main_subpad = gPad;
3957  main_subpad->SetPad(x_low, y_low, x_up, y_up);
3958 
3959  h_empty_bid->DrawCopy("COL"); // il faut tracer un bidim vide pour pouvoir tracer la grille et les axes
3960  ViewDeeSCNumberingPad(DeeNumber);
3961  gPad->Update();
3962 
3963  //..................... retour aux options standard
3964  Bool_t b_true = 1;
3965  h_empty_bid->SetStats(b_true);
3966 
3967  h_empty_bid->Delete(); h_empty_bid = 0; fCdeleteRoot++;
3968 
3969  // delete MainCanvas; fCdeleteRoot++;
3970 
3971  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
3972  }
3973  else
3974  {
3975  cout << "!TEcnaHistos::DeeSCNumbering(...)> Dee = " << DeeNumber
3976  << ". Out of range ( range = [1," << fEcal->MaxDeeInEE() << "] )" << fTTBELL << endl;
3977  }
3978 }
3979 // end of DeeSCNumbering
3980 
3981 void TEcnaHistos::ViewDeeSCNumberingPad(const Int_t& DeeNumber)
3982 {
3983 //display the SC numbering of the Dee in a Pad
3984 
3985  gStyle->SetTitleW(0.4); // taille titre histos
3986  gStyle->SetTitleH(0.08);
3987 
3988  ViewDeeGrid(DeeNumber, " ");
3989 
3990  //..... SC numbers writing in the grid .... (ViewDeeSCNumberingPad)
3991 
3992  char* f_in = new char[fgMaxCar]; fCnew++;
3993  gStyle->SetTextSize(0.0325);
3994 
3995  //------------------ LOOP ON THE Dee_SC NUMBER (ViewDeeSCNumberingPad)
3996  Int_t x_channel = 0; // => defined here after according to DeeDir and SCQuadType
3997  TText *text_DSSC_num = new TText(); fCnewRoot++;
3998  TText *text_DeeSCCons_num = new TText(); fCnewRoot++;
3999 
4000  for (Int_t n1DeeSCEcna = 1; n1DeeSCEcna <= fEcal->MaxSCEcnaInDee(); n1DeeSCEcna++)
4001  {
4002  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
4003  TString SCQuadType = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna);
4004  if( SCQuadType == "top" && DeeDir == "right"){x_channel = 13;}
4005  if( SCQuadType == "top" && DeeDir == "left" ){x_channel = 7;}
4006  if( SCQuadType == "bottom" && DeeDir == "left" ){x_channel = 11;}
4007  if( SCQuadType == "bottom" && DeeDir == "right"){x_channel = 17;}
4008  Int_t i_SCEcha = (Int_t)x_channel;
4009  Double_t x_from_IX = (Double_t)GetXCrysInStex(DeeNumber, n1DeeSCEcna, i_SCEcha);
4010  Double_t y_from_IY = (Double_t)GetYCrysInStex(DeeNumber, n1DeeSCEcna, i_SCEcha);
4011  TString DeeEndcap = fEcalNumbering->GetEEDeeEndcap(DeeNumber);
4012  Color_t couleur_SC = GetSCColor(DeeEndcap, DeeDir, SCQuadType);
4013  text_DSSC_num->SetTextColor(couleur_SC);
4014  text_DeeSCCons_num->SetTextColor((Color_t)1);
4015 
4016  Int_t i_DSSC = fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
4017  Int_t i_DeeSCCons = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
4018  if( i_DSSC > 0 )
4019  {
4020  if(
4021  //.................................................... (D2,S9) , (D4,S1)
4022  !(i_DeeSCCons == 33 && n1DeeSCEcna == 60) &&
4023  !(i_DeeSCCons == 33 && n1DeeSCEcna == 119) &&
4024  //................................................... (D2,S8) , (D4,S2)
4025  !(i_DeeSCCons == 29 && n1DeeSCEcna == 32) && // !(29c and 58c)
4026  !(i_DeeSCCons == 29 && n1DeeSCEcna == 138) &&
4027  !(i_DeeSCCons == 29 && n1DeeSCEcna == 157) &&
4028  !(i_DeeSCCons == 58 && n1DeeSCEcna == 176) &&
4029  !(i_DeeSCCons == 58 && n1DeeSCEcna == 193) &&
4030  //.................................................... (D2,S7) , (D4,S3)
4031  !(i_DeeSCCons == 149 && n1DeeSCEcna == 188) &&
4032  //.................................................... (D2,S6) , (D4,S4)
4033  !(i_DeeSCCons == 112 && n1DeeSCEcna == 29) &&
4034  !(i_DeeSCCons == 112 && n1DeeSCEcna == 144) &&
4035  !(i_DeeSCCons == 112 && n1DeeSCEcna == 165) &&
4036  !(i_DeeSCCons == 119 && n1DeeSCEcna == 102) &&
4037  !(i_DeeSCCons == 119 && n1DeeSCEcna == 123) &&
4038  //.................................................... (D2,S5) , (D4,S5)
4039  !(i_DeeSCCons == 132 && n1DeeSCEcna == 41) &&
4040  //----------------------------------------------------------------------
4041  //.................................................... (D1,S1) , (D3,S9)
4042  !(i_DeeSCCons == 182 && n1DeeSCEcna == 60) &&
4043  !(i_DeeSCCons == 182 && n1DeeSCEcna == 119) &&
4044  //.................................................... (D1,S2) , (D3,S8)
4045  !(i_DeeSCCons == 178 && n1DeeSCEcna == 32) && // !(178c and 207c)
4046  !(i_DeeSCCons == 178 && n1DeeSCEcna == 138) &&
4047  !(i_DeeSCCons == 178 && n1DeeSCEcna == 157) &&
4048  !(i_DeeSCCons == 207 && n1DeeSCEcna == 176) &&
4049  !(i_DeeSCCons == 207 && n1DeeSCEcna == 193) &&
4050  //.................................................... (D1,S3) , (D3,S7)
4051  !(i_DeeSCCons == 298 && n1DeeSCEcna == 188) &&
4052  //.................................................... (D1,S4) , (D3,S6)
4053  !(i_DeeSCCons == 261 && n1DeeSCEcna == 29) && // !(261a and 268a)
4054  !(i_DeeSCCons == 261 && n1DeeSCEcna == 144) &&
4055  !(i_DeeSCCons == 261 && n1DeeSCEcna == 165) &&
4056  !(i_DeeSCCons == 268 && n1DeeSCEcna == 102) &&
4057  !(i_DeeSCCons == 268 && n1DeeSCEcna == 123) &&
4058  //.................................................... (D1,S5) , (D3,S5)
4059  !(i_DeeSCCons == 281 && n1DeeSCEcna == 41)
4060  )
4061  {
4062  sprintf(f_in, "%d", i_DSSC);
4063  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in); // <=== DrawText: prend du temps
4064  sprintf(f_in, "%d", i_DeeSCCons);
4065  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in); // <=== DrawText: prend du temps
4066  }
4067 
4068  //.................................................... (D2,S9) , (D4,S1)
4069  if( i_DeeSCCons == 33 && n1DeeSCEcna == 60 )
4070  {
4071  sprintf(f_in, "30a");
4072  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4073  sprintf(f_in, "33a");
4074  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4075  }
4076  if( i_DeeSCCons == 33 && n1DeeSCEcna == 119 )
4077  {
4078  sprintf(f_in, "30b");
4079  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4080  sprintf(f_in, "33b");
4081  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4082  }
4083  //.................................................... (D2,S8) , (D4,S2)
4084  if( i_DeeSCCons == 29 && n1DeeSCEcna == 32 )
4085  {
4086  sprintf(f_in, " 3c-25c");
4087  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4088  sprintf(f_in, "29c-58c");
4089  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4090  }
4091  if( i_DeeSCCons == 29 && n1DeeSCEcna == 138 )
4092  {
4093  sprintf(f_in, "3a");
4094  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4095  sprintf(f_in, "29a");
4096  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4097  }
4098  if( i_DeeSCCons == 29 && n1DeeSCEcna == 157 )
4099  {
4100  sprintf(f_in, "3b");
4101  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4102  sprintf(f_in, "29b");
4103  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4104  }
4105 
4106  if( i_DeeSCCons == 58 && n1DeeSCEcna == 176 )
4107  {
4108  sprintf(f_in, "25a");
4109  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4110  sprintf(f_in, "58a");
4111  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4112  }
4113  if( i_DeeSCCons == 58 && n1DeeSCEcna == 193 )
4114  {
4115  sprintf(f_in, "25b");
4116  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4117  sprintf(f_in, "58b");
4118  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4119  }
4120  //.................................................... (D2,S7) , (D4,S3)
4121  if( i_DeeSCCons == 149 && n1DeeSCEcna == 188 )
4122  {
4123  sprintf(f_in, "34a");
4124  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4125  sprintf(f_in, "149a");
4126  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4127  }
4128  //.................................................... (D2,S6) , (D4,S4)
4129  if( i_DeeSCCons == 112 && n1DeeSCEcna == 29 )
4130  {
4131  sprintf(f_in, " 14a-21a");
4132  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4133  sprintf(f_in, "112a-119a");
4134  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4135  }
4136  if( i_DeeSCCons == 112 && n1DeeSCEcna == 144 )
4137  {
4138  sprintf(f_in, "14c");
4139  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4140  sprintf(f_in, "112c");
4141  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4142  }
4143  if( i_DeeSCCons == 112 && n1DeeSCEcna == 165 )
4144  {
4145  sprintf(f_in, "14a");
4146  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4147  sprintf(f_in, "112b");
4148  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4149  }
4150 
4151  if( i_DeeSCCons == 119 && n1DeeSCEcna == 102 )
4152  {
4153  sprintf(f_in, "21c");
4154  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4155  sprintf(f_in, "119c");
4156  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4157  }
4158  if( i_DeeSCCons == 119 && n1DeeSCEcna == 123 )
4159  {
4160  sprintf(f_in, "21b");
4161  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4162  sprintf(f_in, "119b");
4163  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4164  }
4165  //.................................................... (D2,S5) , (D4,S5)
4166  if( i_DeeSCCons == 132 && n1DeeSCEcna == 41 )
4167  {
4168  sprintf(f_in, "3a");
4169  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4170  sprintf(f_in, "132a");
4171  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4172  }
4173 
4174  //.................................................... (D1,S1) , (D3,S9)
4175  if( i_DeeSCCons == 182 && n1DeeSCEcna == 60 )
4176  {
4177  sprintf(f_in, "30a");
4178  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4179  sprintf(f_in, "182a");
4180  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4181  }
4182  if( i_DeeSCCons == 182 && n1DeeSCEcna == 119 )
4183  {
4184  sprintf(f_in, "30b");
4185  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4186  sprintf(f_in, "182b");
4187  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4188  }
4189  //.................................................... (D1,S2) , (D3,S8)
4190  if( i_DeeSCCons == 178 && n1DeeSCEcna == 32 )
4191  {
4192  sprintf(f_in, " 3c-25c");
4193  text_DSSC_num->DrawText(x_from_IX-6, y_from_IY+1, f_in);
4194  sprintf(f_in, "178c-207c");
4195  text_DeeSCCons_num->DrawText(x_from_IX-6, y_from_IY-1, f_in);
4196  }
4197  if( i_DeeSCCons == 178 && n1DeeSCEcna == 138 )
4198  {
4199  sprintf(f_in, "3a");
4200  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4201  sprintf(f_in, "178a");
4202  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4203  }
4204  if( i_DeeSCCons == 178 && n1DeeSCEcna == 157 )
4205  {
4206  sprintf(f_in, "3b");
4207  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4208  sprintf(f_in, "178b");
4209  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4210  }
4211 
4212  if( i_DeeSCCons == 207 && n1DeeSCEcna == 176 )
4213  {
4214  sprintf(f_in, "25a");
4215  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4216  sprintf(f_in, "207a");
4217  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4218  }
4219  if( i_DeeSCCons == 207 && n1DeeSCEcna == 193 )
4220  {
4221  sprintf(f_in, "25b");
4222  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4223  sprintf(f_in, "207b");
4224  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4225  }
4226  //.................................................... (D1,S3) , (D3,S7)
4227  if( i_DeeSCCons == 298 && n1DeeSCEcna == 188 )
4228  {
4229  sprintf(f_in, "34a");
4230  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4231  sprintf(f_in, "298a");
4232  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4233  }
4234  //.................................................... (D1,S4) , (D3,S6)
4235  if( i_DeeSCCons == 261 && n1DeeSCEcna == 29 )
4236  {
4237  sprintf(f_in, " 14a-21a");
4238  text_DSSC_num->DrawText(x_from_IX-6, y_from_IY+1, f_in);
4239  sprintf(f_in, "261a-268a");
4240  text_DeeSCCons_num->DrawText(x_from_IX-6, y_from_IY-1, f_in);
4241  }
4242  if( i_DeeSCCons == 261 && n1DeeSCEcna == 144 )
4243  {
4244  sprintf(f_in, "14a");
4245  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4246  sprintf(f_in, "261c");
4247  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4248  }
4249  if( i_DeeSCCons == 261 && n1DeeSCEcna == 165 )
4250  {
4251  sprintf(f_in, "14b");
4252  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4253  sprintf(f_in, "261b");
4254  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4255  }
4256 
4257  if( i_DeeSCCons == 268 && n1DeeSCEcna == 102 )
4258  {
4259  sprintf(f_in, "21c");
4260  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4261  sprintf(f_in, "268c");
4262  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4263  }
4264  if( i_DeeSCCons == 268 && n1DeeSCEcna == 123 )
4265  {
4266  sprintf(f_in, "21b");
4267  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4268  sprintf(f_in, "268b");
4269  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4270  }
4271  //.................................................... (D1,S5) , (D3,S5)
4272  if( i_DeeSCCons == 281 && n1DeeSCEcna == 41 )
4273  {
4274  sprintf(f_in, "20a");
4275  text_DSSC_num->DrawText(x_from_IX, y_from_IY+1, f_in);
4276  sprintf(f_in, "281a");
4277  text_DeeSCCons_num->DrawText(x_from_IX, y_from_IY-1, f_in);
4278  }
4279  }
4280  }
4281 
4282  // delete text_DSSC_num; fCdeleteRoot++;
4283 
4284  //......................... mention "color, black"
4285  Color_t coul_textcolors = fCnaParHistos->ColorDefinition("noir");
4286  sprintf( f_in, "color: nb in Data Sector, black: nb for construction");
4287  Int_t x_colors = 3;
4288  Int_t y_colors = -14;
4289 
4290  TText *text_colors = new TText(x_colors, y_colors, f_in); fCnewRoot++;
4291  text_colors->SetTextSize(0.03);
4292  text_colors->SetTextColor(coul_textcolors);
4293  text_colors->Draw();
4294 
4295  delete [] f_in; f_in = 0; fCdelete++;
4296 
4297  Color_t couleur_noir = fCnaParHistos->ColorDefinition("noir");
4298  gStyle->SetTextColor(couleur_noir);
4299 }
4300 //----------------> end of ViewDeeSCNumberingPad()
4301 
4302 void TEcnaHistos::ViewDeeGrid(const Int_t& DeeNumber, const TString c_option)
4303 {
4304  //Grid of one Dee with axis IX and IY
4305 
4306  Int_t GeoBidSizeIX = fEcal->MaxSCIXInDee()*fEcal->MaxCrysIXInSC();
4307  Int_t GeoBidSizeIY = fEcal->MaxSCIYInDee()*fEcal->MaxCrysIYInSC();
4308 
4309  if ( c_option == "corcc")
4310  {
4311  GeoBidSizeIX = fEcal->MaxSCIXInDee()*fEcal->MaxCrysInSC();
4312  GeoBidSizeIY = fEcal->MaxSCIYInDee()*fEcal->MaxCrysInSC();
4313  }
4314 
4315  Int_t nb_binx = GeoBidSizeIX;
4316  Int_t nb_biny = GeoBidSizeIY;
4317  Axis_t xinf_bid = (Axis_t)0.;
4318  Axis_t xsup_bid = (Axis_t)GeoBidSizeIX;
4319 
4320  Axis_t yinf_bid = (Axis_t)0.;
4321  Axis_t ysup_bid = (Axis_t)GeoBidSizeIY;
4322  Double_t ymid_bid = (Double_t)(ysup_bid-yinf_bid)/2.;
4323 
4324  //---------------- trace de la grille: un rectangle = un super-cristal
4325 
4326  Int_t size_IX = fEcal->MaxCrysIXInSC();
4327  Int_t size_IY = fEcal->MaxCrysIYInSC();
4328 
4329  if ( c_option == "corcc"){size_IX = fEcal->MaxCrysInSC(); size_IY = fEcal->MaxCrysInSC();}
4330 
4331  Int_t max_x = nb_binx/size_IX;
4332  Int_t max_y = nb_biny/size_IY;
4333  Int_t max_yd = max_y/2;
4334 
4335  //= SURLIGNAGES (unite de coordonnees: le cristal ou 5 fois le cristal si option corcc)
4336  //........................... multplicative coefficient for corcc option
4337  Int_t coefcc_x = 1;
4338  Int_t coefcc_y = 1;
4339  if ( c_option == "corcc"){coefcc_x = fEcal->MaxCrysIXInSC(); coefcc_y = fEcal->MaxCrysIYInSC();}
4340 
4341  //............................. lignes horizontales
4342  Double_t yline = (Double_t)yinf_bid - (Double_t)size_IY;
4343 
4344  Double_t xline_beg = (Double_t)xinf_bid;
4345  Double_t xline_end = (Double_t)xsup_bid;
4346 
4347  // k = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10
4348  Int_t x_min[11] = {11,11, 7, 0, 0, 0, 0, 0, 0, 0, 0};
4349  Int_t x_max[11] = {50,50,47,45,45,42,37,35,30,15,50};
4350  for(Int_t i=0;i<11;i++){x_min[i] = coefcc_x*x_min[i]; x_max[i] = coefcc_x*x_max[i];}
4351 
4352  for( Int_t j = 0 ; j < max_y ; j++)
4353  {
4354  if( j < max_yd ) // j = 0,1,2,3,4,5,6,7,8,9
4355  {
4356  if( DeeNumber == 1 || DeeNumber == 3 )
4357  {
4358  xline_beg = xinf_bid + (Double_t)x_min[10-j];
4359  xline_end = xinf_bid + (Double_t)x_max[10-j];
4360  }
4361  if( DeeNumber == 2 || DeeNumber == 4 )
4362  {
4363  xline_beg = xsup_bid - (Double_t)x_max[10-j];
4364  xline_end = xsup_bid - (Double_t)x_min[10-j];
4365  }
4366  }
4367 
4368  if( j == max_yd ) // j = 10
4369  {
4370  if( DeeNumber == 1 || DeeNumber == 3 )
4371  {
4372  xline_beg = xinf_bid + (Double_t)x_min[0];
4373  xline_end = xinf_bid + (Double_t)x_max[0];
4374  }
4375  if( DeeNumber == 2 || DeeNumber == 4 )
4376  {
4377  xline_beg = xsup_bid - (Double_t)x_max[0];
4378  xline_end = xsup_bid - (Double_t)x_min[0];
4379  }
4380  }
4381 
4382  if( j > max_yd ) // j = 11,12,13,14,15,16,17,18,19,20
4383  {
4384  if( DeeNumber == 1 || DeeNumber == 3 )
4385  {
4386  xline_beg = xinf_bid + (Double_t)x_min[j-10];
4387  xline_end = xinf_bid + (Double_t)x_max[j-10];
4388  }
4389  if( DeeNumber == 2 || DeeNumber == 4 )
4390  {
4391  xline_beg = xsup_bid - (Double_t)x_max[j-10];
4392  xline_end = xsup_bid - (Double_t)x_min[j-10];
4393  }
4394  }
4395 
4396  yline = yline + (Double_t)size_IY;
4397  TLine *lin;
4398  lin = new TLine(xline_beg, yline, xline_end, yline); fCnewRoot++;
4399  lin->Draw();
4400  //lin->Delete(); // => si on delete, pas de trace de la ligne
4401  // delete lin; fCdeleteRoot++;
4402  }
4403 
4404  //.......................... lignes verticales
4405  Double_t xline = (Double_t)xinf_bid - (Double_t)size_IX;
4406 
4407  Double_t yline_haut_bot = (Double_t)ymid_bid;
4408  Double_t yline_haut_top = (Double_t)ysup_bid;
4409 
4410  Double_t yline_bas_bot = (Double_t)yinf_bid;
4411  Double_t yline_bas_top = (Double_t)ymid_bid;
4412 
4413  // coordonnees demi-lignes
4414  // l = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10
4415  Int_t y_min[11] = { 0,11, 7, 0, 0, 0, 0, 0, 0, 0, 0};
4416  Int_t y_max[11] = {50,50,47,45,45,42,38,35,30,15,10};
4417  for(Int_t i=0;i<11;i++){y_min[i] = coefcc_y*y_min[i]; y_max[i] = coefcc_y*y_max[i];}
4418 
4419  gStyle->SetTextSize(0.075); // ===> pourquoi pas avant?
4420 
4421  for( Int_t i = 0 ; i <= max_x ; i++)
4422  {
4423  if( DeeNumber == 1 || DeeNumber == 3 )
4424  {
4425  yline_haut_bot = ymid_bid + (Double_t)y_min[i];
4426  yline_haut_top = ymid_bid + (Double_t)y_max[i];
4427  }
4428  if( DeeNumber == 2 || DeeNumber == 4 )
4429  {
4430  yline_haut_bot = ymid_bid + (Double_t)y_min[10-i];
4431  yline_haut_top = ymid_bid + (Double_t)y_max[10-i];
4432  }
4433  yline_bas_bot = ysup_bid - yline_haut_top;
4434  yline_bas_top = ysup_bid - yline_haut_bot;
4435 
4436  xline = xline + (Double_t)size_IX;
4437  TLine *lin_haut;
4438  lin_haut = new TLine(xline, yline_haut_bot, xline, yline_haut_top); fCnewRoot++;
4439  lin_haut->Draw();
4440  // delete lin_haut; fCdeleteRoot++;
4441  TLine *lin_bas;
4442  lin_bas = new TLine(xline, yline_bas_bot, xline, yline_bas_top); fCnewRoot++;
4443  lin_bas->Draw();
4444  // delete lin_bas; fCdeleteRoot++;
4445  }
4446 
4447  EEDataSectors(coefcc_x, coefcc_y, DeeNumber, "Dee");
4448  EEGridAxis(coefcc_x, coefcc_y, DeeNumber, "Dee", c_option);
4449 
4450 } // end of ViewDeeGrid
4451 
4452 //=================================================================================
4453 //
4454 // SqrtContourLevels(const Int_t& nb_niv, Double_t* cont_niv)
4455 //
4456 //=================================================================================
4457 void TEcnaHistos::SqrtContourLevels(const Int_t& nb_niv, Double_t* cont_niv)
4458 {
4459 //Calculation of levels in z coordinate for 3D plots. Square root scale
4460 
4461  Int_t nb_niv2 = (nb_niv+1)/2;
4462 
4463  for (Int_t num_niv = 0; num_niv < nb_niv2; num_niv++)
4464  {
4465  Int_t ind_niv = num_niv + nb_niv2 - 1;
4466  if ( ind_niv < 0 || ind_niv > nb_niv )
4467  {
4468  cout << "!TEcnaHistos::ContourLevels(...)> *** ERROR *** "
4469  << "wrong contour levels for correlation matrix"
4470  << fTTBELL << endl;
4471  }
4472  else
4473  {
4474  cont_niv[ind_niv] =
4475  (Double_t)(num_niv*num_niv)/
4476  ((Double_t)((nb_niv2-1)*(nb_niv2-1)));
4477  }
4478  }
4479  for (Int_t num_niv = -1; num_niv > -nb_niv2; num_niv--)
4480  {
4481  Int_t ind_niv = num_niv + nb_niv2 - 1;
4482  if ( ind_niv < 0 || ind_niv > nb_niv )
4483  {
4484  cout << "!TEcnaHistos::ContourLevels(...)> *** ERROR *** "
4485  << "wrong contour levels for correlation matrix"
4486  << fTTBELL << endl;
4487  }
4488  else
4489  {
4490  cont_niv[ind_niv] =
4491  -(Double_t)(num_niv*num_niv)/
4492  ((Double_t)((nb_niv2-1)*(nb_niv2-1)));
4493  }
4494  }
4495 }
4496 
4497 //==========================================================================
4498 //
4499 // GetHocoVecoAxisTitle
4500 //
4501 //==========================================================================
4502 TString TEcnaHistos::GetHocoVecoAxisTitle(const TString chcode)
4503 {
4504  TString xname = " ";
4505 
4506  if ( fFlagSubDet == "EB" ){xname = GetEtaPhiAxisTitle(chcode);}
4507  if ( fFlagSubDet == "EE" ){xname = GetIXIYAxisTitle(chcode);}
4508 
4509  return xname;
4510 }
4511 
4512 TString TEcnaHistos::GetEtaPhiAxisTitle(const TString chcode)
4513 {
4514  TString xname = " ";
4515 
4516  if ( chcode == "ietaEB" ){xname = "i#eta Xtal ";}
4517  if ( chcode == "ietaSM" ){xname = "i#eta Xtal ";}
4518  if ( chcode == "ietaTow"){xname = "i#eta Xtal ";}
4519 
4520  if ( chcode == "iphiEB" ){xname = " i#varphi Xtal";}
4521  if ( chcode == "jphiEB+" ){xname = " i#varphi Xtal";}
4522  if ( chcode == "jphiEB-" ){xname = " i#varphi Xtal";}
4523  if ( chcode == "jphiSMB+" ){xname = " i#varphi Xtal";}
4524  if ( chcode == "jphiSMB-" ){xname = "i#varphi Xtal ";}
4525  if ( chcode == "jphiTow" ){xname = "i#varphi Xtal in SM ";}
4526  if ( chcode == "phi" ){xname = "i#varphi Xtal in EB ";}
4527 
4528  return xname;
4529 }
4530 
4531 TString TEcnaHistos::GetIXIYAxisTitle(const TString chcode)
4532 {
4533  TString xname = " ";
4534 
4535  if ( chcode == "iIXDee" ){xname = "IX(SC)";}
4536 
4537  if ( chcode == "iIXDee1" ){xname = " -IX Xtal";}
4538  if ( chcode == "iIXDee2" ){xname = " IX Xtal ";}
4539  if ( chcode == "iIXDee3" ){xname = " IX Xtal";}
4540  if ( chcode == "iIXDee4" ){xname = "-IX Xtal ";}
4541 
4542  if ( chcode == "iIXEE" ){xname = " IX Xtal";}
4543 
4544  if ( chcode == "iIXSC" ){xname = "IX Xtal";}
4545 
4546  if ( chcode == "jIYDee" ){xname = "IY Xtal";}
4547  if ( chcode == "jIYSC" ){xname = "IY Xtal";}
4548  if ( chcode == "IY" ){xname = "IY";}
4549 
4550  return xname;
4551 }
4552 //=======================================================================================
4553 //
4554 // Stas view (StasHocoVeco)
4555 //
4556 //=======================================================================================
4560 
4564 
4568 
4572 
4576 
4580 
4584 
4585 //=======================================================================================
4586 //
4587 // ViewStas
4588 //
4589 // (Hoco,Veco) matrices for all the Stex's of a Stas
4590 // Stas = EB or EE
4591 //
4592 //=======================================================================================
4593 void TEcnaHistos::ViewStas(const TString HistoCode)
4594 {
4595 // (Hoco, Veco) matrices for all the Stex's of a Stas
4596 
4597  //......................... matrix title
4598  char* f_in_mat_tit = new char[fgMaxCar]; fCnew++;
4599 
4600  if (HistoCode == "D_NOE_ChNb"){sprintf(f_in_mat_tit, "Number of Events");}
4601  if (HistoCode == "D_Ped_ChNb"){sprintf(f_in_mat_tit, "Pedestals");}
4602  if (HistoCode == "D_TNo_ChNb"){sprintf(f_in_mat_tit, "Total Noise");}
4603  if (HistoCode == "D_MCs_ChNb"){sprintf(f_in_mat_tit, "Mean Cor(s,s')");}
4604  if (HistoCode == "D_LFN_ChNb"){sprintf(f_in_mat_tit, "Low Frequency Noise");}
4605  if (HistoCode == "D_HFN_ChNb"){sprintf(f_in_mat_tit, "High Frequency Noise");}
4606  if (HistoCode == "D_SCs_ChNb"){sprintf(f_in_mat_tit, "Sigma Cor(s,s')");}
4607 
4608  //.... Axis parameters: *** WARNING *** EB ===> x (Bid Hoco) = phi (StinVeco), y (Bid Veco) = eta (StinHoco)
4609  Int_t GeoBidSizeHoco = fEcal->MaxStinVecoInStas();
4610  Int_t GeoBidSizeVeco = fEcal->MaxStinHocoInStas();
4611 
4612  Int_t vertic_empty_strips = 3;
4613  Int_t vertic_empty_strip_1 = 1;
4614 
4615  if ( fFlagSubDet == "EE" )
4616  {
4617  // for empty vertical strips: before EE-, between EE- and EE+, after EE+ on plot
4618  GeoBidSizeHoco = fEcal->MaxStinHocoInStas() + vertic_empty_strips;
4619  GeoBidSizeVeco = fEcal->MaxStinVecoInStas();
4620  }
4621 
4622  Int_t nb_binx = GeoBidSizeHoco;
4623  Int_t nb_biny = GeoBidSizeVeco;
4624  Axis_t xinf_bid = (Axis_t)0.;
4625  Axis_t xsup_bid = (Axis_t)GeoBidSizeHoco;
4626  Axis_t yinf_bid = (Axis_t)0.;
4627  Axis_t ysup_bid = (Axis_t)GeoBidSizeVeco;
4628 
4629  TString axis_x_var_name = " #Hoco ";
4630  TString axis_y_var_name = " #varVeco ";
4631 
4632  //............. matrices reading and histogram filling (ViewStas)
4633 
4634  TH2D* h_geo_bid = new TH2D("geobidim_Hoco_Veco", f_in_mat_tit,
4635  nb_binx, xinf_bid, xsup_bid,
4636  nb_biny, yinf_bid, ysup_bid); fCnewRoot++;
4637  h_geo_bid->Reset();
4638 
4639  Int_t CounterExistingFile = 0;
4640  Int_t CounterDataExist = 0;
4641 
4642  Int_t* xFapNbOfEvts = new Int_t[fEcal->MaxStexInStas()]; fCnew++;
4643  for(Int_t i=0; i<fEcal->MaxStexInStas(); i++){xFapNbOfEvts[i]=0;}
4644  Int_t* NOFE_int = new Int_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
4645 
4646  //......................................................................... (ViewStas)
4647  for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
4648  {
4653  iStasStex+1, fCfgResultsRootFilePath.Data());
4654 
4655  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewStas)
4656  {
4657  fStatusFileFound = kTRUE;
4658 
4659  CounterExistingFile++;
4660  xFapNbOfEvts[iStasStex] = GetNumberOfEvents(fMyRootFile, fFapReqNbOfEvts);
4661  //----------------------------------------------------------------------------- file reading
4662  TString fp_name_short = fMyRootFile->GetRootFileNameShort();
4663  // cout << "*TEcnaHistos::ViewStas(...)> Data are analyzed from file ----> "
4664  // << fp_name_short << endl;
4665 
4666  //....................... search for first and last dates
4667  if( iStasStex == 0 )
4668  {
4673  }
4674  else
4675  {
4676  time_t xStartTime = fMyRootFile->GetStartTime();
4677  time_t xStopTime = fMyRootFile->GetStopTime();
4678  TString xStartDate = fMyRootFile->GetStartDate();
4679  TString xStopDate = fMyRootFile->GetStopDate();
4680  if( xStartTime < fStartTime ){fStartTime = xStartTime; fStartDate = xStartDate;}
4681  if( xStopTime > fStopTime ){fStopTime = xStopTime; fStopDate = xStopDate;}
4682  }
4683 
4685 
4686  //............................................... matrices reading (ViewStas)
4687  TVectorD partial_histp(fEcal->MaxStinEcnaInStex());
4688  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){partial_histp(i)=(Double_t)0.;}
4689 
4690  TMatrixD read_matrix(nb_binx, nb_biny);
4691  for(Int_t i=0; i<nb_binx; i++)
4692  {for(Int_t j=0; j<nb_biny; j++){read_matrix(i,j)=(Double_t)0.;}}
4693 
4694  if( HistoCode == "D_NOE_ChNb" ){
4696  if( HistoCode == "D_Ped_ChNb" ){
4698  if (HistoCode == "D_TNo_ChNb" ){
4700  if( HistoCode == "D_MCs_ChNb" ){
4702  if( HistoCode == "D_LFN_ChNb" ){
4704  if( HistoCode == "D_HFN_ChNb" ){
4706  if( HistoCode == "D_SCs_ChNb" ){
4708 
4709  if ( fMyRootFile->DataExist() == kTRUE )
4710  {
4711  fStatusDataExist = kTRUE;
4712 
4713  CounterDataExist++;
4714  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
4715  {
4716  //-------------------------------------- Geographical bidim filling (ViewStas)
4717  Int_t i_xgeo = GetXStinInStas(iStasStex, i0StexStinEcna, vertic_empty_strip_1);
4718  Int_t i_ygeo = GetYStinInStas(iStasStex, i0StexStinEcna);
4719 
4720  if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
4721  {
4722  Int_t n1StexStinEcna = i0StexStinEcna+1;
4723 
4724  if( fFlagSubDet == "EB" )
4725  {
4726  read_matrix(i_xgeo, i_ygeo) = partial_histp(i0StexStinEcna);
4727  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
4728  (Double_t)read_matrix(i_xgeo, i_ygeo));
4729  }
4730 
4731  if( fFlagSubDet == "EE" )
4732  {
4733  //---------------------> do not draw bin for SCEcna = 10 or 11
4734  if( !( (n1StexStinEcna == 10 || n1StexStinEcna == 11 ||
4735  n1StexStinEcna == 29 || n1StexStinEcna == 32) ) )
4736  {
4737  read_matrix(i_xgeo, i_ygeo) = partial_histp(i0StexStinEcna);
4738  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
4739  (Double_t)read_matrix(i_xgeo, i_ygeo));
4740  }
4741  if( n1StexStinEcna == 29 )
4742  {
4743  //---------------------------------------------------------------------------------
4744  // Average on SCEcna 29 (x1+x2+x3+x6+x7) and SCEcna 10: (x11)
4745  // (x = Xtal# in SC; see CMS NOTE 2006/027, p.10)
4746  //
4747  // (x1+x2+x3+x6+x7)/5 = partial_histp(29-1) ; x11 = partial_histp(10-1)
4748  //
4749  // => (x1+x2+x3+x6+x7+x11)/6 = partial_histp(29-1)*5/6 + partial_histp(10-1)/6
4750  //
4751  // // except for "D_NOE_ChNb" because average done in ReadAveragedNumberOfEvents
4752  // // (no averaged NbOfEvts in root file)
4753  //---------------------------------------------------------------------------------
4754  read_matrix(i_xgeo, i_ygeo) =
4755  partial_histp(i0StexStinEcna)*(Double_t)(5./6.) + partial_histp(9)/(Double_t)6.;
4756  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
4757  (Double_t)read_matrix(i_xgeo, i_ygeo));
4758  }
4759  //if( n1StexStinEcna == 32 && HistoCode != "D_NOE_ChNb" )
4760  if( n1StexStinEcna == 32 )
4761  {
4762  //---- same as previous case: replace SCEcna 29 by 32 AND SCEcna 10 by 11
4763  //----> (x1+x2+x3+x6+x7+x11)/6 = partial_histp(32-1)*5/6 + partial_histp(11-1)/6
4764  read_matrix(i_xgeo, i_ygeo) =
4765  partial_histp(i0StexStinEcna)*(Double_t)(5./6.) + partial_histp(10)/(Double_t)6.;
4766  h_geo_bid->Fill((Double_t)i_xgeo, (Double_t)i_ygeo,
4767  (Double_t)read_matrix(i_xgeo, i_ygeo));
4768  }
4769  } // end of if( fFlagSubDet == "EE" )
4770  } // end of if(i_xgeo >=0 && i_xgeo < nb_binx && i_ygeo >=0 && i_ygeo < nb_biny)
4771  } // end of for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
4772  } // end of if ( fMyRootFile->DataExist() == kTRUE )
4773  else
4774  {
4775  fStatusDataExist = kFALSE;
4776 
4777  cout << "!TEcnaHistos::ViewStas(...)> "
4778  << " Data not available for " << fFapStexName << " " << iStasStex+1
4779  << " (Quantity not present in the ROOT file)" << fTTBELL << endl;
4780  }
4781  } // end of if( fMyRootFile->LookAtRootFile() == kTRUE )
4782  else
4783  {
4784  fStatusFileFound = kFALSE;
4785 
4786  cout << "!TEcnaHistos::ViewStas(...)> "
4787  << " Data not available for " << fFapStexName << " " << iStasStex+1
4788  << " (ROOT file not found)" << fTTBELL << endl;
4789  }
4790 
4791  if( fFapNbOfEvts <= xFapNbOfEvts[iStasStex] ){fFapNbOfEvts = xFapNbOfEvts[iStasStex];}
4792 
4793  } // end of for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
4794 
4795  delete [] NOFE_int; NOFE_int = 0; fCdelete++;
4796  delete [] xFapNbOfEvts; xFapNbOfEvts = 0; fCdelete++;
4797 
4798  if( CounterExistingFile > 0 && CounterDataExist > 0 )
4799  {
4800  //=============== H I S T O M I N / M A X M A N A G E M E N T ============ (ViewStas)
4801  //................................ Put histo min max values
4802  //.......... default if flag not set to "ON"
4803  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
4804  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
4805 
4806  if( fUserHistoMin == fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
4807  //.......... user's value if flag set to "ON"
4808  if( fFlagUserHistoMin == "ON" )
4809  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
4810  if( fFlagUserHistoMax == "ON" )
4811  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
4812  //................................. automatic min and/or max
4813  if( fFlagUserHistoMin == "AUTO" )
4814  {SetYminMemoFromValue(HistoCode.Data(), h_geo_bid->GetMinimum()); fFlagUserHistoMin = "OFF";}
4815  if( fFlagUserHistoMax == "AUTO" )
4816  {SetYmaxMemoFromValue(HistoCode.Data(), h_geo_bid->GetMaximum()); fFlagUserHistoMax = "OFF";}
4817  //...................................... histo set ymin and ymax
4818  Int_t xFlagAutoYsupMargin = 0;
4819  xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo((TH1D*)h_geo_bid, HistoCode);
4820 
4821  // ************************** A GARDER EN RESERVE *******************************
4822  //............. special contour level for correlations (square root wise scale)
4823  //if ( HistoCode == "D_MCs_ChNb" )
4824  //{
4825  // Int_t nb_niv = 9;
4826  // Double_t* cont_niv = new Double_t[nb_niv]; fCnew++;
4827  // SqrtContourLevels(nb_niv, &cont_niv[0]);
4828  // h_geo_bid->SetContour(nb_niv, &cont_niv[0]);
4829  // delete [] cont_niv; fCdelete++;
4830  //}
4831  // ******************************** (FIN RESERVE) *******************************
4832 
4833  // =================================== P L O T S ======================== (ViewStas)
4834 
4835  char* f_in = new char[fgMaxCar]; fCnew++;
4836 
4837  //...................... Taille/format canvas
4838  UInt_t canv_h = fCnaParHistos->CanvasFormatH("petit");
4839  UInt_t canv_w = fCnaParHistos->CanvasFormatW("petit");
4840 
4841  if( fFlagSubDet == "EB")
4842  {canv_w = fCnaParHistos->CanvasFormatW("phietaEB");
4843  canv_h = fCnaParHistos->CanvasFormatH("phietaEB");}
4844  if( fFlagSubDet == "EE")
4845  {canv_w = fCnaParHistos->CanvasFormatW("IYIXEE");
4846  canv_h = fCnaParHistos->CanvasFormatH("IYIXEE");}
4847 
4848  //............................................... paves commentaires (ViewStas)
4850 
4851  //------------------------------------ Canvas name ----------------- (ViewStas)
4852  TString name_cov_cor;
4853  Int_t MaxCar = fgMaxCar;
4854  name_cov_cor.Resize(MaxCar);
4855  name_cov_cor = "?";
4856 
4857  if( HistoCode == "D_NOE_ChNb"){name_cov_cor = "Number_of_Events";}
4858  if( HistoCode == "D_Ped_ChNb"){name_cov_cor = "Pedestals";}
4859  if( HistoCode == "D_TNo_ChNb"){name_cov_cor = "Total_noise";}
4860  if( HistoCode == "D_MCs_ChNb"){name_cov_cor = "Mean_Corss";}
4861  if( HistoCode == "D_LFN_ChNb"){name_cov_cor = "Low_Fq_Noise";}
4862  if( HistoCode == "D_HFN_ChNb"){name_cov_cor = "High_Fq_Noise";}
4863  if( HistoCode == "D_SCs_ChNb"){name_cov_cor = "Sigma_Corss";}
4864 
4865  TString name_visu;
4866  MaxCar = fgMaxCar;
4867  name_visu.Resize(MaxCar);
4868  name_visu = "colz";
4869 
4870  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%s_%s_HocoVeco",
4871  name_cov_cor.Data(), fFapAnaType.Data(), fFapNbOfSamples, fFapRunNumber,
4872  fFapFirstReqEvtNumber, fFapLastReqEvtNumber, fFlagSubDet.Data(), name_visu.Data());
4873 
4874  if( fFlagSubDet == "EB" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stas2DEB");}
4875  if( fFlagSubDet == "EE" ){SetHistoPresentation((TH1D*)h_geo_bid, "Stas2DEE");}
4876 
4877  TCanvas *MainCanvas = new TCanvas(f_in, f_in, canv_w, canv_h); fCnewRoot++;
4878  fCurrentCanvas = MainCanvas; fCurrentCanvasName = f_in;
4879 
4880  // cout << "*TEcnaHistos::ViewStas(...)> Plot is displayed on canvas ----> " << f_in << endl;
4881 
4882  delete [] f_in; f_in = 0; fCdelete++;
4883 
4884  //------------------------ Canvas draw and update ------------ (ViewStas)
4885  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
4886 
4887  fPavComStas->Draw();
4888  fPavComAnaRun->Draw();
4889  fPavComNbOfEvts->Draw();
4890 
4891  //----------------------------------------------------------- pad margins
4892  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
4893  Double_t y_low = fCnaParHistos->BoxTopY("bottom_left_box") + 0.005;
4894  Double_t x_margin = x_low;
4895  Double_t y_margin = y_low;
4896  MainCanvas->Divide( 1, 1, x_margin, y_margin);
4897  // Divide(nx, ny, x_margin, y_margin, color);
4898  gPad->cd(1);
4899  //........................... specific EE
4900  if( fFlagSubDet == "EE" ){
4901  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
4902  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_EE") - 0.005;
4903  TVirtualPad* main_subpad = gPad;
4904  main_subpad->SetPad(x_low, y_low, x_up, y_up);}
4905 
4906  //------------------------------------------------------------
4907  h_geo_bid->GetXaxis()->SetTitle(axis_x_var_name);
4908  h_geo_bid->GetYaxis()->SetTitle(axis_y_var_name);
4909 
4910  h_geo_bid->DrawCopy("COLZ");
4911 
4912  // trace de la grille ---------------- (ViewStas)
4913  ViewStasGrid(vertic_empty_strips);
4914  gPad->Draw();
4915  gPad->Update();
4916 
4917  // delete MainCanvas; fCdeleteRoot++;
4918  }
4919  //..................... retour aux options standard
4920  Bool_t b_true = 1;
4921  h_geo_bid->SetStats(b_true);
4922  h_geo_bid->Delete(); h_geo_bid = 0; fCdeleteRoot++;
4923 
4924  delete [] f_in_mat_tit; f_in_mat_tit = 0; fCdelete++;
4925 
4926 } // end of ViewStas(...)
4927 
4928 //==================================================================================
4929 //
4930 // GetXStinInStas , GetYStinInStas
4931 //
4932 //==================================================================================
4933 Int_t TEcnaHistos::GetXStinInStas(const Int_t& iStasStex, const Int_t& StexStinEcna,
4934  const Int_t& vertic_empty_strip_1)
4935 {
4936 //Gives the X Stin coordinate in the geographic view of the Stas
4937 // (X = 0 to MaxStexHocoInStas*MaxStinHocoInStex - 1 + vertic_empty_strips(EE only))
4938 
4939  Int_t ix_geo = 0;
4940  TString ctype = fEcalNumbering->GetStexHalfStas(iStasStex+1);
4941 
4942  if( fFlagSubDet == "EB")
4943  {
4944  if( ctype == "EB-")
4945  {
4946  ix_geo = (iStasStex - fEcal->MaxStexInStasMinus())*fEcal->MaxStinVecoInStex()
4947  + StexStinEcna%fEcal->MaxStinVecoInStex();
4948  }
4949  if( ctype == "EB+")
4950  {
4951  ix_geo = iStasStex*fEcal->MaxStinVecoInStex()
4952  + fEcal->MaxStinVecoInStex()- 1 - StexStinEcna%fEcal->MaxStinVecoInStex();
4953  }
4954  }
4955 
4956  if( fFlagSubDet == "EE")
4957  {
4958  TString LeftRightFromIP = fEcalNumbering->GetDeeDirViewedFromIP(iStasStex+1);
4959 
4960  if( ctype == "EE-" && LeftRightFromIP == "left" )
4961  {
4962  ix_geo = fEcal->MaxStinHocoInStex() - StexStinEcna/fEcal->MaxStinVecoInStex() - 1 + vertic_empty_strip_1;
4963  }
4964  if( ctype == "EE-" && LeftRightFromIP == "right" )
4965  {
4966  ix_geo = fEcal->MaxStinHocoInStex() + StexStinEcna/fEcal->MaxStinVecoInStex() + vertic_empty_strip_1;
4967  }
4968  if( ctype == "EE+" && LeftRightFromIP == "left" )
4969  {
4970  ix_geo = (Int_t)fCnaParHistos->DeeOffsetX(fFlagSubDet, iStasStex+1)
4971  + fEcal->MaxStinHocoInStex() - StexStinEcna/fEcal->MaxStinVecoInStex() - 1;
4972  }
4973  if( ctype == "EE+" && LeftRightFromIP == "right" )
4974  {
4975  ix_geo = (Int_t)fCnaParHistos->DeeOffsetX(fFlagSubDet, iStasStex+1)
4976  + StexStinEcna/fEcal->MaxStinVecoInStex();
4977  }
4978  }
4979  return ix_geo;
4980 }
4981 
4982 Int_t TEcnaHistos::GetYStinInStas(const Int_t& iStasStex, const Int_t& StexStinEcna)
4983 {
4984 //Gives the Y crystal coordinate in the geographic view of one Stex
4985 // (Y = 0 to MaxStexVecoInStas*MaxStinVecoInStex - 1)
4986 
4987  Int_t iy_geo = 0;
4988 
4989  if( fFlagSubDet == "EB")
4990  {
4991  TString ctype = fEcalNumbering->GetStexHalfStas(iStasStex+1);
4992  if( ctype == "EB+")
4993  {iy_geo = StexStinEcna/fEcal->MaxStinVecoInStex() + fEcal->MaxStinHocoInStex(); }
4994  if( ctype == "EB-")
4995  {iy_geo = fEcal->MaxStinHocoInStex() - 1 - StexStinEcna/fEcal->MaxStinVecoInStex();}
4996  }
4997 
4998  if( fFlagSubDet == "EE")
4999  {iy_geo = StexStinEcna%fEcal->MaxStinVecoInStex();}
5000  return iy_geo;
5001 }
5002 
5003 //==========================================================================
5004 //
5005 // ViewStasGrid
5006 // independent of the ROOT file
5007 //
5008 //==========================================================================
5009 void TEcnaHistos::ViewStasGrid(const Int_t & vertic_empty_strips)
5010 {
5011  //Grid of Stas with axis Hoco and Veco
5012 
5013  if( fFlagSubDet == "EB"){ViewEBGrid();}
5014  if( fFlagSubDet == "EE"){ViewEEGrid(vertic_empty_strips);}
5015 
5016 } // end of ViewStasGrid
5017 
5019 {
5020  //Grid of EB with axis Hoco and Veco
5021 
5022  Int_t GeoBidSizeEta = fEcal->MaxSMEtaInEB()*fEcal->MaxTowEtaInSM();
5023  Int_t GeoBidSizePhi = fEcal->MaxSMPhiInEB()*fEcal->MaxTowPhiInSM();
5024 
5025  Int_t size_y = fEcal->MaxTowEtaInSM();
5026  Int_t size_x = fEcal->MaxTowPhiInSM();
5027 
5028  Int_t nb_binx = GeoBidSizePhi;
5029  Int_t nb_biny = GeoBidSizeEta;
5030  Axis_t xinf_bid = (Axis_t)0.;
5031  Axis_t xsup_bid = (Axis_t)nb_binx;
5032  Axis_t yinf_bid = (Axis_t)0.;
5033  Axis_t ysup_bid = (Axis_t)nb_biny;
5034 
5035  //---------------- trace de la grille: un rectangle = un SM
5036 
5037  Int_t max_x = nb_binx/size_x; // = fEcal->MaxSMPhiInEB()
5038  Int_t max_y = nb_biny/size_y; // = fEcal->MaxSMEtaInEB()
5039 
5040  //............................. lignes horizontales (ViewEBGrid)
5041  Double_t yline = (Double_t)yinf_bid;
5042 
5043  Double_t xline_left = (Double_t)xinf_bid;
5044  Double_t xline_right = (Double_t)xsup_bid;
5045 
5046  for( Int_t j = 0 ; j < max_y ; j++)
5047  {
5048  yline = yline + (Double_t)size_y;
5049  TLine *lin;
5050  lin = new TLine(xline_left, yline, xline_right, yline); fCnewRoot++;
5051  lin->Draw();
5052  // delete lin; fCdeleteRoot++;
5053  }
5054 
5055  //-------------------------------- lignes verticales
5056  Double_t xline = (Double_t)xinf_bid - (Double_t)size_x;
5057 
5058  Double_t yline_bot = (Double_t)yinf_bid;
5059  Double_t yline_top = (Double_t)ysup_bid;
5060 
5061  for( Int_t i = 0 ; i < max_x ; i++)
5062  {
5063  xline = xline + (Double_t)size_x;
5064  TLine *lin;
5065  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
5066  lin->Draw();
5067  }
5068 
5069  //-------------------------------- Numeros des SM
5070  Double_t yTextBot = yline_bot - (yline_top - yline_bot)/25.;
5071  Double_t yTextTop = yline_top + (yline_top - yline_bot)/120.;
5072  xline = (Double_t)xinf_bid - (Double_t)size_x;
5073 
5074  char* f_in = new char[fgMaxCar]; fCnew++;
5075  TText *text_SM = new TText(); fCnewRoot++;
5076  for( Int_t i = 0 ; i < max_x ; i++)
5077  {
5078  xline = xline + (Double_t)size_x;
5079  text_SM->SetTextColor(fCnaParHistos->ColorDefinition("bleu_fonce"));
5080  text_SM->SetTextSize((Double_t)0.03);
5081  sprintf( f_in, " +%d", i+1 );
5082  text_SM->DrawText(xline, yTextTop, f_in);
5083  sprintf( f_in, " %d", -i-1 );
5084  text_SM->DrawText(xline, yTextBot, f_in);
5085  }
5086  delete [] f_in; fCdelete++;
5087 
5088  //------------------ trace axes en eta et phi --------------- ViewEBGrid
5089 
5090  Int_t SMNumber = 1;
5091 
5092  //...................................................... Axe i(phi) (bottom x) ViewEBGrid
5093  Int_t MatSize = fEcal->MaxTowPhiInSM();
5094  Int_t size_x_eb = fEcal->MaxSMPhiInEB();
5095  Double_t phi_min = 0;
5096  Double_t phi_max = 360;
5097 
5098  TString x_var_name = GetHocoVecoAxisTitle("iphiEB");;
5099  TString x_direction = fEcalNumbering->GetXDirectionEB(SMNumber);
5100 
5101  TF1 *f1 = new TF1("f1", x_direction.Data(), phi_min, phi_max); fCnewRoot++;
5102  TGaxis* sup_axis_x = 0;
5103 
5104  if( x_direction == "-x" ) // NEVER IN THIS CASE: xmin->xmax <=> right->left ("-x") direction
5105  {sup_axis_x = new TGaxis( (Float_t)0., (Float_t)0., (Float_t)(size_x_eb*MatSize), (Float_t)0.,
5106  "f1", size_x_eb, "SC" , 0.); fCnewRoot++;}
5107 
5108  if( x_direction == "x" ) // ALWAYS IN THIS CASE: xmin->xmax <=> left->right ("x") direction
5109  {sup_axis_x = new TGaxis( (Float_t)0., (Float_t)0., (Float_t)(size_x_eb*MatSize), (Float_t)0.,
5110  "f1", size_x_eb, "SC" , 0.); fCnewRoot++;}
5111 
5112  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
5113  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize("EBx");
5114  Float_t tic_siz_x = fCnaParHistos->AxisTickSize("SMx");
5115  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("EBx");
5116  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("EBx");
5117 
5118  sup_axis_x->SetTitle(x_var_name);
5119  sup_axis_x->SetTitleSize(tit_siz_x);
5120  sup_axis_x->SetTitleOffset(tit_off_x);
5121  sup_axis_x->SetLabelSize(lab_siz_x);
5122  sup_axis_x->SetLabelOffset(lab_off_x);
5123  sup_axis_x->SetTickSize(tic_siz_x);
5124  sup_axis_x->Draw("SAME");
5125 
5126  f1 = 0;
5127 
5128  //...................................................... Axe eta (y) ViewEBGrid
5129  MatSize = fEcal->MaxTowEtaInSM();
5130  Int_t size_y_eb = fEcal->MaxSMEtaInEB();
5131 
5132  Double_t eta_min = (Double_t)(-85.);
5133  Double_t eta_max = (Double_t)85.;
5134 
5135  TString y_var_name = GetHocoVecoAxisTitle("ietaEB");
5136 
5137  TGaxis* sup_axis_y = 0;
5138  sup_axis_y = new TGaxis((Float_t)0., (Float_t)0.,
5139  (Float_t)0., (Float_t)(size_y_eb*MatSize),
5140  eta_min, eta_max, MatSize/2, "SC", 0.); fCnewRoot++;
5141 
5142  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
5143  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize("EBy");
5144  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("SMy");
5145  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("EBy");
5146  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("EBy");
5147 
5148  sup_axis_y->SetTitle(y_var_name);
5149  sup_axis_y->SetTitleSize(tit_siz_y);
5150  sup_axis_y->SetTitleOffset(tit_off_y);
5151  sup_axis_y->SetLabelColor(1);
5152  sup_axis_y->SetLabelSize(lab_siz_y);
5153  sup_axis_y->SetLabelOffset(lab_off_y);
5154  sup_axis_y->SetTickSize(tic_siz_y);
5155  sup_axis_y->Draw("SAME");
5156 
5157  //f2 = 0;
5158 
5159  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
5160 
5161 } // end of ViewEBGrid
5162 //---------------------------------------------------------------------
5163 void TEcnaHistos::ViewEEGrid(const Int_t& vertic_empty_strips)
5164 {
5165  //Grid of EE with axis Hoco and Veco
5166 
5167  Float_t coefcc_x = (Float_t)1./(Float_t)5.;
5168  Float_t coefcc_y = (Float_t)1./(Float_t)5.;
5169 
5170  for( Int_t DeeNumber = 1; DeeNumber <= 4; DeeNumber++)
5171  {
5172  EEDataSectors(coefcc_x, coefcc_y, DeeNumber, "EE");
5173  EEGridAxis(coefcc_x, coefcc_y, DeeNumber, "EE", " ");
5174  }
5175 
5176  // vertical line between the two endcaps
5177  Double_t xline = coefcc_x*( 2*fEcal->MaxCrysIXInDee()
5178  + ((Double_t)vertic_empty_strips)/2.*fEcal->MaxCrysIXInSC() );
5179 
5180  Double_t yline_bot = coefcc_y*(Double_t)0.;
5181  Double_t yline_top = coefcc_y*(Double_t)fEcal->MaxCrysIYInDee();
5182 
5183  TLine *lin;
5184  lin = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
5185  lin->Draw();
5186 
5187  // vertical line in the midles of the two endcaps
5188  // xline = xline + coefcc_x*( fEcal->MaxCrysIXInDee()+ 0.5*fEcal->MaxCrysIXInSC() );
5189  xline = coefcc_x*(3*fEcal->MaxCrysIXInDee()
5190  + ((Double_t)vertic_empty_strips-1.)*fEcal->MaxCrysIXInSC() );
5191  TLine *lin12;
5192  lin12 = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
5193  lin12->SetLineStyle(2);
5194  lin12->Draw();
5195 
5196  xline = coefcc_x*(fEcal->MaxCrysIXInDee()
5197  + ((Double_t)vertic_empty_strips)/3.*fEcal->MaxCrysIXInSC() );
5198  TLine *lin34;
5199  lin34 = new TLine(xline, yline_bot, xline, yline_top); fCnewRoot++;
5200  lin34->SetLineStyle(2);
5201  lin34->Draw();
5202 
5203  // horizontal line at IY = 50
5204  Double_t xline_end = coefcc_x*( 4*fEcal->MaxCrysIXInDee() + vertic_empty_strips*fEcal->MaxCrysIXInSC());
5205  Double_t yline_mid = coefcc_x*fEcal->MaxCrysIYInDee()/2;
5206 
5207  TLine *linh;
5208  linh = new TLine( 0., yline_mid, xline_end, yline_mid); fCnewRoot++;
5209  linh->SetLineStyle(2);
5210  linh->Draw();
5211 
5212 } // end of ViewEEGrid
5213 
5214 //==================================================================================================
5215 void TEcnaHistos::EEDataSectors(const Float_t& coefcc_x, const Float_t& coefcc_y,
5216  const Int_t& DeeNumber, const TString opt_plot)
5217 {
5218  //Surlignage des bords du Dee et des Data Sectors. Numeros des secteurs.
5219 
5220  // Epaisseur du trait selon option
5221  Int_t LineWidth = 2; // DEFAULT => option "EE"
5222  if( opt_plot == "Dee" ){LineWidth = 3;}
5223 
5224  Int_t ngmax = 0;
5225  // surlignage du bord interne du Dee (unite de coordonnees: le cristal)
5226  ngmax = 13;
5227  Float_t xg_dee_int_bot[13] = { 0, 5, 5, 7, 7, 8, 8, 9, 9,10,10,11,11};
5228  Float_t yg_dee_int_bot[13] = {39,39,40,40,41,41,42,42,43,43,45,45,50};
5229  for(Int_t i=0;i<ngmax;i++){
5230  xg_dee_int_bot[i] = coefcc_x*xg_dee_int_bot[i];
5231  yg_dee_int_bot[i] = coefcc_y*yg_dee_int_bot[i];}
5232 
5233  Float_t XgDeeIntBotRight[13]; Float_t YgDeeIntBotRight[13];
5234  Float_t XgDeeIntTopRight[13]; Float_t YgDeeIntTopRight[13];
5235 
5236  for( Int_t i=0; i<ngmax; i++)
5237  {
5238  XgDeeIntBotRight[i] = xg_dee_int_bot[i];
5239  YgDeeIntBotRight[i] = yg_dee_int_bot[i];
5240  XgDeeIntTopRight[i] = XgDeeIntBotRight[i];
5241  YgDeeIntTopRight[i] = coefcc_y*fEcal->MaxCrysIYInDee() - YgDeeIntBotRight[i];
5242  if ( DeeNumber == 2 || DeeNumber == 4 )
5243  {
5244  XgDeeIntBotRight[i] = -XgDeeIntBotRight[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5245  XgDeeIntTopRight[i] = -XgDeeIntTopRight[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5246  }
5247  XgDeeIntBotRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5248  XgDeeIntTopRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5249  }
5250 
5251  TGraph *BDeeIntBotRight = new TGraph(ngmax, XgDeeIntBotRight, YgDeeIntBotRight);
5252  BDeeIntBotRight->SetLineWidth(LineWidth);
5253  BDeeIntBotRight->Draw();
5254 
5255  TGraph *BDeeIntTopRight = new TGraph(ngmax, XgDeeIntTopRight, YgDeeIntTopRight);
5256  BDeeIntTopRight->SetLineWidth(LineWidth);
5257  BDeeIntTopRight->Draw();
5258 
5259  // surlignage du bord externe du Dee (unite de coordonnees: le cristal)
5260  ngmax = 21;
5261  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};
5262  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};
5263  for(Int_t i=0;i<ngmax;i++){
5264  xg_dee_ext_bot[i] = coefcc_x*xg_dee_ext_bot[i];
5265  yg_dee_ext_bot[i] = coefcc_y*yg_dee_ext_bot[i];}
5266 
5267  Float_t XgDeeExtBotRight[21]; Float_t YgDeeExtBotRight[21];
5268  Float_t XgDeeExtTopRight[21]; Float_t YgDeeExtTopRight[21];
5269 
5270  for( Int_t i=0; i<ngmax; i++)
5271  {
5272  XgDeeExtBotRight[i] = xg_dee_ext_bot[i];
5273  YgDeeExtBotRight[i] = yg_dee_ext_bot[i];
5274  XgDeeExtTopRight[i] = XgDeeExtBotRight[i];
5275  YgDeeExtTopRight[i] = coefcc_y*fEcal->MaxCrysIYInDee() - YgDeeExtBotRight[i];
5276  if ( DeeNumber == 2 || DeeNumber == 4 )
5277  {
5278  XgDeeExtBotRight[i] = -XgDeeExtBotRight[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5279  XgDeeExtTopRight[i] = -XgDeeExtTopRight[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5280  }
5281  XgDeeExtBotRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5282  XgDeeExtTopRight[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5283  }
5284 
5285  TGraph *BDeeExtBotRight = new TGraph(ngmax, XgDeeExtBotRight, YgDeeExtBotRight);
5286  BDeeExtBotRight->SetLineWidth(LineWidth);
5287  BDeeExtBotRight->Draw();
5288 
5289  TGraph *BDeeExtTopRight = new TGraph(ngmax, XgDeeExtTopRight, YgDeeExtTopRight);
5290  BDeeExtTopRight->SetLineWidth(LineWidth);
5291  BDeeExtTopRight->Draw();
5292 
5293  char* f_in = new char[fgMaxCar]; fCnew++;
5294 
5295  //............. Surlignage separateurs des secteurs en phi (Data sectors)
5296 
5297  //================== S9 -> S1 (EE-) option "EE" seulement
5298  if( opt_plot == "EE" )
5299  {
5300  ngmax = 2;
5301  Float_t xg_dee_data_sec9[2] = { 0, 0};
5302  Float_t yg_dee_data_sec9[2] = {61,100};
5303  for(Int_t i=0;i<ngmax;i++){
5304  xg_dee_data_sec9[i] = coefcc_x*xg_dee_data_sec9[i];
5305  yg_dee_data_sec9[i] = coefcc_y*yg_dee_data_sec9[i];}
5306 
5307  Float_t XgDeeDataSec9[11]; Float_t YgDeeDataSec9[11];
5308  for( Int_t i=0; i<ngmax; i++)
5309  {
5310  XgDeeDataSec9[i] = xg_dee_data_sec9[i]; YgDeeDataSec9[i] = yg_dee_data_sec9[i];
5311  if ( DeeNumber == 2 || DeeNumber == 4 )
5312  {
5313  XgDeeDataSec9[i] = -XgDeeDataSec9[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5314  }
5315  XgDeeDataSec9[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5316  }
5317  TGraph *BDeeDataSec9 = new TGraph(ngmax, XgDeeDataSec9, YgDeeDataSec9);
5318  BDeeDataSec9->SetLineWidth(LineWidth);
5319  BDeeDataSec9->Draw();
5320  }
5321 
5322  //================= S1->S2(EE-)
5323  ngmax = 11;
5324  Float_t xg_dee_data_sec1[11] = { 7,10,10,15,15,20,20,25,25,30,30};
5325  Float_t yg_dee_data_sec1[11] = {60,60,65,65,70,70,75,75,85,85,87};
5326  for(Int_t i=0;i<ngmax;i++){
5327  xg_dee_data_sec1[i] = coefcc_x*xg_dee_data_sec1[i];
5328  yg_dee_data_sec1[i] = coefcc_y*yg_dee_data_sec1[i];}
5329 
5330  Float_t XgDeeDataSec1[11]; Float_t YgDeeDataSec1[11];
5331  for( Int_t i=0; i<ngmax; i++)
5332  {
5333  XgDeeDataSec1[i] = xg_dee_data_sec1[i]; YgDeeDataSec1[i] = yg_dee_data_sec1[i];
5334  if ( DeeNumber == 2 || DeeNumber == 4 )
5335  {
5336  XgDeeDataSec1[i] = -XgDeeDataSec1[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5337  }
5338  XgDeeDataSec1[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5339  }
5340 
5341  TGraph *BDeeDataSec1 = new TGraph(ngmax, XgDeeDataSec1, YgDeeDataSec1);
5342  BDeeDataSec1->SetLineWidth(LineWidth);
5343  BDeeDataSec1->Draw();
5344 
5345  //================= S2->S3(EE-)
5346  ngmax = 6;
5347  Float_t xg_dee_data_sec2[6] = {11,15,15,40,40,47};
5348  Float_t yg_dee_data_sec2[6] = {50,50,55,55,60,60};
5349  for(Int_t i=0;i<ngmax;i++){
5350  xg_dee_data_sec2[i] = coefcc_x*xg_dee_data_sec2[i];
5351  yg_dee_data_sec2[i] = coefcc_y*yg_dee_data_sec2[i];}
5352 
5353  Float_t XgDeeDataSec2[6]; Float_t YgDeeDataSec2[6];
5354  for( Int_t i=0; i<ngmax; i++)
5355  {
5356  XgDeeDataSec2[i] = xg_dee_data_sec2[i]; YgDeeDataSec2[i] = yg_dee_data_sec2[i];
5357  if ( DeeNumber == 2 || DeeNumber == 4 )
5358  {
5359  XgDeeDataSec2[i] = -XgDeeDataSec2[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5360  }
5361  XgDeeDataSec2[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5362  }
5363  TGraph *BDeeDataSec2 = new TGraph(ngmax, XgDeeDataSec2, YgDeeDataSec2);
5364  BDeeDataSec2->SetLineWidth(LineWidth);
5365  BDeeDataSec2->Draw();
5366 
5367  //================= S3->S4(EE-)
5368  ngmax = 10;
5369  Float_t xg_dee_data_sec3[10] = {10,15,15,20,20,30,30,40,40,42};
5370  Float_t yg_dee_data_sec3[10] = {45,45,40,40,35,35,30,30,25,25};
5371  for(Int_t i=0;i<ngmax;i++){
5372  xg_dee_data_sec3[i] = coefcc_x*xg_dee_data_sec3[i];
5373  yg_dee_data_sec3[i] = coefcc_y*yg_dee_data_sec3[i];}
5374 
5375  Float_t XgDeeDataSec3[10]; Float_t YgDeeDataSec3[10];
5376  for( Int_t i=0; i<ngmax; i++)
5377  {
5378  XgDeeDataSec3[i] = xg_dee_data_sec3[i]; YgDeeDataSec3[i] = yg_dee_data_sec3[i];
5379  if ( DeeNumber == 2 || DeeNumber == 4 )
5380  {
5381  XgDeeDataSec3[i] = -XgDeeDataSec3[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5382  }
5383  XgDeeDataSec3[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5384  }
5385  TGraph *BDeeDataSec3 = new TGraph(ngmax, XgDeeDataSec3, YgDeeDataSec3);
5386  BDeeDataSec3->SetLineWidth(LineWidth);
5387  BDeeDataSec3->Draw();
5388 
5389  //================= S4->S5(EE-)
5390  ngmax = 6;
5391  Float_t xg_dee_data_sec4[6] = { 5, 5,10,10,15,15};
5392  Float_t yg_dee_data_sec4[6] = {40,30,30,15,15, 5};
5393  for(Int_t i=0;i<ngmax;i++){
5394  xg_dee_data_sec4[i] = coefcc_x*xg_dee_data_sec4[i];
5395  yg_dee_data_sec4[i] = coefcc_y*yg_dee_data_sec4[i];}
5396 
5397  Float_t XgDeeDataSec4[6]; Float_t YgDeeDataSec4[6];
5398  for( Int_t i=0; i<ngmax; i++)
5399  {
5400  XgDeeDataSec4[i] = xg_dee_data_sec4[i]; YgDeeDataSec4[i] = yg_dee_data_sec4[i];
5401  if ( DeeNumber == 2 || DeeNumber == 4 )
5402  {
5403  XgDeeDataSec4[i] = -XgDeeDataSec4[i] + coefcc_x*fEcal->MaxCrysIXInDee();
5404  }
5405  XgDeeDataSec4[i] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5406  }
5407  TGraph *BDeeDataSec4 = new TGraph(ngmax, XgDeeDataSec4, YgDeeDataSec4);
5408  BDeeDataSec4->SetLineWidth(LineWidth);
5409  BDeeDataSec4->Draw();
5410 
5411 
5412  //..................................... Numeros des secteurs S_i (option "Dee" seulement)
5413  if( opt_plot == "Dee" || opt_plot == "EE" )
5414  {
5415  //............. Coordonnees des numeros de secteurs
5416  ngmax = 5;
5417  Float_t xg_coord_sector[5] = { 16, 41, 45, 33, -2};
5418  Float_t yg_coord_sector[5] = { 96, 83, 30, 5, -8};
5419 
5420  //....... Reprise secteurs 3 et 7
5421  if(opt_plot == "Dee" && (DeeNumber == 1) ){xg_coord_sector[2] += 0.5;}
5422  if(opt_plot == "Dee" && (DeeNumber == 2) ){xg_coord_sector[2] -= 1. ;}
5423  if(opt_plot == "Dee" && (DeeNumber == 3) ){xg_coord_sector[2] += 0.7;}
5424  if(opt_plot == "Dee" && (DeeNumber == 4) ){xg_coord_sector[2] -= 1.2;}
5425 
5426  if(opt_plot == "EE" && (DeeNumber == 2 || DeeNumber == 3) ){xg_coord_sector[2] += 0.55;}
5427  if(opt_plot == "EE" && (DeeNumber == 4 ) ){xg_coord_sector[2] -= 0.2;}
5428 
5429  for(Int_t i=0;i<ngmax;i++){
5430  xg_coord_sector[i] = coefcc_x*xg_coord_sector[i];
5431  yg_coord_sector[i] = coefcc_y*yg_coord_sector[i];}
5432 
5433  Float_t xg_sector[9];
5434  Float_t yg_sector[9];
5435  Int_t ns1 = 1;
5436  Int_t ns2 = 5;
5437  Float_t xinv_d2d4 = coefcc_x*44;
5438 
5439  if( DeeNumber == 1 )
5440  {
5441  ns1 = 1; ns2 = 5;
5442  xg_sector[1-ns1] = xg_coord_sector[1-ns1]; yg_sector[1-ns1] = yg_coord_sector[1-ns1];
5443  xg_sector[2-ns1] = xg_coord_sector[2-ns1]; yg_sector[2-ns1] = yg_coord_sector[2-ns1];
5444  xg_sector[3-ns1] = xg_coord_sector[3-ns1]; yg_sector[3-ns1] = yg_coord_sector[3-ns1];
5445  xg_sector[4-ns1] = xg_coord_sector[4-ns1]; yg_sector[4-ns1] = yg_coord_sector[4-ns1];
5446  xg_sector[5-ns1] = xg_coord_sector[5-ns1]; yg_sector[5-ns1] = yg_coord_sector[5-ns1];
5447  }
5448 
5449  if( DeeNumber == 2 )
5450  {
5451  ns1 = 5; ns2 = 9;
5452  xg_sector[ns2-1] = xinv_d2d4-xg_coord_sector[1-1]; yg_sector[ns2-1] = yg_coord_sector[1-1];
5453  xg_sector[ns2-2] = xinv_d2d4-xg_coord_sector[2-1]; yg_sector[ns2-2] = yg_coord_sector[2-1];
5454  xg_sector[ns2-3] = xinv_d2d4-xg_coord_sector[3-1]; yg_sector[ns2-3] = yg_coord_sector[3-1];
5455  xg_sector[ns2-4] = xinv_d2d4-xg_coord_sector[4-1]; yg_sector[ns2-4] = yg_coord_sector[4-1];
5456  xg_sector[ns2-5] = xinv_d2d4-xg_coord_sector[5-1]; yg_sector[ns2-5] = yg_coord_sector[5-1];
5457  }
5458  if( DeeNumber == 3 )
5459  {
5460  ns1 = 5; ns2 = 9;
5461  xg_sector[ns2-1]= xg_coord_sector[1-1]; yg_sector[ns2-1] = yg_coord_sector[1-1];
5462  xg_sector[ns2-2]= xg_coord_sector[2-1]; yg_sector[ns2-2] = yg_coord_sector[2-1];
5463  xg_sector[ns2-3]= xg_coord_sector[3-1]; yg_sector[ns2-3] = yg_coord_sector[3-1];
5464  xg_sector[ns2-4]= xg_coord_sector[4-1]; yg_sector[ns2-4] = yg_coord_sector[4-1];
5465  xg_sector[ns2-5]= xg_coord_sector[5-1]; yg_sector[ns2-5] = yg_coord_sector[5-1];
5466  }
5467  if( DeeNumber == 4 )
5468  {
5469  ns1 = 1; ns2 = 5;
5470  xg_sector[1-ns1]= xinv_d2d4-xg_coord_sector[1-ns1]; yg_sector[1-ns1] = yg_coord_sector[1-ns1];
5471  xg_sector[2-ns1]= xinv_d2d4-xg_coord_sector[2-ns1]; yg_sector[2-ns1] = yg_coord_sector[2-ns1];
5472  xg_sector[3-ns1]= xinv_d2d4-xg_coord_sector[3-ns1]; yg_sector[3-ns1] = yg_coord_sector[3-ns1];
5473  xg_sector[4-ns1]= xinv_d2d4-xg_coord_sector[4-ns1]; yg_sector[4-ns1] = yg_coord_sector[4-ns1];
5474  xg_sector[5-ns1]= xinv_d2d4-xg_coord_sector[5-ns1]; yg_sector[5-ns1] = yg_coord_sector[5-ns1];
5475  }
5476 
5477  Color_t coul_textsector = fCnaParHistos->ColorDefinition("vert37");
5478  for(Int_t ns=ns1; ns<= ns2; ns++)
5479  {
5480  xg_sector[ns-1] += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5481  if( DeeNumber == 1 || DeeNumber == 2 ){sprintf( f_in, "+%d", ns);}
5482  if( DeeNumber == 3 || DeeNumber == 4 ){sprintf( f_in, "-%d", ns);}
5483  TText *text_num_module = new TText(xg_sector[ns-1], yg_sector[ns-1], f_in); fCnewRoot++;
5484  if(opt_plot == "Dee"){text_num_module->SetTextSize(0.065);}
5485  if(opt_plot == "EE" ){text_num_module->SetTextSize(0.045);}
5486  text_num_module->SetTextColor(coul_textsector);
5487  if( opt_plot == "Dee" ||
5488  ( opt_plot == "EE" && !( (DeeNumber == 3 && ns == 5) || (DeeNumber == 1 && ns == 5) ) ) )
5489  {text_num_module->Draw();}
5490 
5491  // text_num_module->Delete(); text_num_module = 0; fCdeleteRoot++;
5492  }
5493 
5494  //............................ numeros des dee's
5495  ngmax = 4;
5496  Float_t xg_coord_dee[4] = { 0, 0, 0, 0};
5497  Float_t yg_coord_dee[4] = {48, 48, 48, 48};
5498 
5499  xg_coord_dee[DeeNumber-1] = coefcc_x*xg_coord_dee[DeeNumber-1];
5500  yg_coord_dee[DeeNumber-1] = coefcc_y*yg_coord_dee[DeeNumber-1];
5501 
5502  Float_t xg_dee = xg_coord_dee[DeeNumber-1];
5503  Float_t yg_dee = yg_coord_dee[DeeNumber-1];
5504 
5505  Color_t coul_textdee = fCnaParHistos->ColorDefinition("noir");
5506 
5507  xg_dee += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber)
5508  + fCnaParHistos->DeeNumberOffsetX(opt_plot, DeeNumber);
5509 
5510  if( DeeNumber == 1 ){sprintf( f_in, "D1");}
5511  if( DeeNumber == 2 ){sprintf( f_in, "D2");}
5512  if( DeeNumber == 3 ){sprintf( f_in, "D3");}
5513  if( DeeNumber == 4 ){sprintf( f_in, "D4");}
5514 
5515  TText *text_num_module = new TText(xg_dee, yg_dee, f_in); fCnewRoot++;
5516  if( opt_plot == "EE" ){text_num_module->SetTextSize(0.045);}
5517  if( opt_plot == "Dee"){text_num_module->SetTextSize(0.085);}
5518  text_num_module->SetTextColor(coul_textdee);
5519  text_num_module->Draw();
5520  }
5521 
5522  //..................................... Numeros des Dee et indication EE+- (option "EE" seulement)
5523  if( opt_plot == "EE" )
5524  {
5525  //............................ indication EE+-
5526  ngmax = 4;
5527  Float_t xg_coord_eepm[4] = { 0, 0, 0, 0};
5528  Float_t yg_coord_eepm[4] = {95, 95, 95, 95};
5529 
5530  xg_coord_eepm[DeeNumber-1] = coefcc_x*xg_coord_eepm[DeeNumber-1];
5531  yg_coord_eepm[DeeNumber-1] = coefcc_y*yg_coord_eepm[DeeNumber-1];
5532 
5533  Float_t xg_eepm = xg_coord_eepm[DeeNumber-1];
5534  Float_t yg_eepm = yg_coord_eepm[DeeNumber-1];
5535 
5536  Color_t coul_texteepm = fCnaParHistos->ColorDefinition("noir");
5537 
5538  xg_eepm += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber)
5539  + fCnaParHistos->DeeNameOffsetX(DeeNumber);
5540 
5541  if( DeeNumber == 1 ){sprintf( f_in, "EE+F");}
5542  if( DeeNumber == 2 ){sprintf( f_in, "EE+N");}
5543  if( DeeNumber == 3 ){sprintf( f_in, "EE-N");}
5544  if( DeeNumber == 4 ){sprintf( f_in, "EE-F");}
5545 
5546  TText *text_num_eepm = new TText(xg_eepm, yg_eepm, f_in); fCnewRoot++;
5547  text_num_eepm->SetTextSize(0.04);
5548  text_num_eepm->SetTextColor(coul_texteepm);
5549  text_num_eepm->Draw();
5550  }
5551 
5552  //......................... mention "viewed from IP"
5553  Color_t coul_textfromIP = fCnaParHistos->ColorDefinition("rouge49");
5554  sprintf( f_in, "viewed from IP");
5555  Float_t x_from_ip = 15.;
5556  Float_t y_from_ip = -10.;
5557  if( opt_plot == "EE" ){y_from_ip = -16.;}
5558  x_from_ip = coefcc_x*x_from_ip;
5559  y_from_ip = coefcc_x*y_from_ip;
5560  if( opt_plot == "EE" && DeeNumber == 3 ){x_from_ip += 1.4*fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);}
5561  TText *text_from_ip = new TText(x_from_ip, y_from_ip, f_in); fCnewRoot++;
5562  text_from_ip->SetTextSize(0.045);
5563  if( opt_plot == "EE" ){text_from_ip->SetTextSize(0.035);}
5564  text_from_ip->SetTextColor(coul_textfromIP);
5565  if( opt_plot == "Dee" || (opt_plot == "EE" && DeeNumber == 3) ){text_from_ip->Draw();}
5566 
5567  delete [] f_in; f_in = 0; fCdelete++;
5568 
5569 } // ------ end of EEDataSectors() ------
5570 
5571 //==========================================================================================
5572 
5573 void TEcnaHistos::EEGridAxis(const Float_t& coefcc_x, const Float_t& coefcc_y,
5574  const Int_t& DeeNumber, const TString opt_plot, const TString c_option)
5575 {
5576  //------------------ trace axes en IX et IY --------------- EEGridAxis
5577  //=============================================================================== Axe IX
5578  Int_t size_IX_dee = fEcal->MaxSCIXInDee();
5579 
5580  Double_t IX_min = fEcalNumbering->GetIIXMin(1) - 0.5; // IX_min = 0.5 pour les 4 dee's
5581  Double_t IX_max = fEcalNumbering->GetIIXMax()*fEcal->MaxCrysIXInSC() + 0.5; // IX_max = 50.5 pour les 4 dee's
5582 
5583  Int_t MatSize = 1;
5584  if( opt_plot == "Dee" && c_option == "corcc" )
5585  {
5586  MatSize = fEcal->MaxCrysInSC();
5587  IX_min = fEcalNumbering->GetIIXMin() - 0.5;
5588  IX_max = fEcalNumbering->GetIIXMax() + 0.5;
5589  }
5590  if( opt_plot == "EE" && c_option == "corcc" ){return;} // => a voir...
5591 
5592  if( opt_plot == "Dee" && c_option != "corcc" ){MatSize = fEcal->MaxCrysIXInSC();}
5593  if( opt_plot == "EE" && c_option != "corcc" ){MatSize = 1;}
5594 
5595  TString x_var_name = " ";
5596 
5597  Float_t axis_x_inf = 0;
5598  Float_t axis_x_sup = 0;
5599  Float_t axis_y_inf = 0;
5600  Float_t axis_y_sup = 0;
5601  Int_t axis_nb_div = 205; // DEFAULT: option "EE"
5602  Double_t IX_values_min = 0;
5603  Double_t IX_values_max = 0;
5604  Option_t* chopt = "C";
5605 
5606  //........................................................................EEGridAxis
5607  if( DeeNumber == 1 ) // xmin -> xmax <=> right->left
5608  {
5609  //.....axis min->max/left->right: first draw axis with -ticksize and no label
5610  axis_x_inf = size_IX_dee*MatSize;
5611  axis_x_sup = 0;
5612  axis_y_inf = 0;
5613  axis_y_sup = 0;
5614  IX_values_min = -IX_max; // -50.5 right
5615  IX_values_max = -IX_min; // - 0.5 left
5616  if( opt_plot == "Dee" ){x_var_name = GetIXIYAxisTitle("iIXDee1");}
5617  if( opt_plot == "EE" ){x_var_name = GetIXIYAxisTitle("iIXEE");}
5618  if( opt_plot == "Dee" ){axis_nb_div = size_IX_dee;}
5619  chopt = "-CSU";
5620  }
5621  if( DeeNumber == 2 ) // xmin -> xmax <=> right->left
5622  {
5623  //.....axis min->max/left->right: first draw axis with -ticksize and no label
5624  axis_x_inf = size_IX_dee*MatSize;
5625  axis_x_sup = 0;
5626  axis_y_inf = 0;
5627  axis_y_sup = 0;
5628  IX_values_min = IX_min; // + 0.5 right
5629  IX_values_max = IX_max; // +50.5 left
5630  if( opt_plot == "Dee" ){x_var_name = GetIXIYAxisTitle("iIXDee2");}
5631  if( opt_plot == "EE" ){x_var_name = " ";}
5632  if( opt_plot == "Dee" ){axis_nb_div = size_IX_dee;}
5633  chopt = "-CSU";
5634  }
5635  if( DeeNumber == 3 ) // xmin -> xmax <=> left->right
5636  {
5637  axis_x_inf = 0;
5638  axis_x_sup = size_IX_dee*MatSize;
5639  axis_y_inf = 0;
5640  axis_y_sup = 0;
5641  IX_values_min = IX_min; // + 0.5 left
5642  IX_values_max = IX_max; // +50.5 right
5643  if( opt_plot == "Dee" ){x_var_name = GetIXIYAxisTitle("iIXDee3");}
5644  if( opt_plot == "EE" ){x_var_name = " ";}
5645  if( opt_plot == "Dee" ){axis_nb_div = size_IX_dee;}
5646  chopt = "CS";
5647  }
5648  if( DeeNumber == 4 ) // xmin -> xmax <=> left->right
5649  {
5650  axis_x_inf = 0;
5651  axis_x_sup = size_IX_dee*MatSize;
5652  axis_y_inf = 0;
5653  axis_y_sup = 0;
5654  IX_values_min = -IX_max; // -50.5 left
5655  IX_values_max = -IX_min; // - 0.5 right
5656  if( opt_plot == "Dee" ){x_var_name = GetIXIYAxisTitle("iIXDee4");}
5657  if( opt_plot == "EE" ){x_var_name = " ";}
5658  if( opt_plot == "Dee" ){axis_nb_div = size_IX_dee;}
5659  chopt = "CS";
5660  }
5661 
5662  //.................................................................... EEGridAxis
5663  axis_x_inf += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5664  axis_x_sup += fCnaParHistos->DeeOffsetX(opt_plot, DeeNumber);
5665 
5666  TGaxis* sup_axis_x = 0;
5667  sup_axis_x = new TGaxis(axis_x_inf, axis_y_inf, axis_x_sup, axis_y_sup,
5668  IX_values_min, IX_values_max, axis_nb_div, chopt, 0.); fCnewRoot++;
5669 
5670  Float_t tit_siz_x = fCnaParHistos->AxisTitleSize();
5671  Float_t lab_siz_x = fCnaParHistos->AxisLabelSize();
5672 
5673  Float_t tic_siz_x = fCnaParHistos->AxisTickSize("Deex");
5674  if(opt_plot == "EE"){tic_siz_x = fCnaParHistos->AxisTickSize("EEx");}
5675 
5676  Float_t tit_off_x = fCnaParHistos->AxisTitleOffset("Deex");
5677  if(opt_plot == "EE"){tit_off_x = fCnaParHistos->AxisTitleOffset("EEx");}
5678 
5679  Float_t lab_off_x = fCnaParHistos->AxisLabelOffset("Deex");
5680  if(opt_plot == "EE"){lab_off_x = fCnaParHistos->AxisLabelOffset("EEx");}
5681 
5682  sup_axis_x->SetTitle(x_var_name);
5683  sup_axis_x->SetTitleSize(tit_siz_x);
5684  sup_axis_x->SetTitleOffset(tit_off_x);
5685  sup_axis_x->SetLabelSize(lab_siz_x);
5686  sup_axis_x->SetLabelOffset(lab_off_x);
5687  sup_axis_x->SetTickSize(tic_siz_x);
5688  sup_axis_x->Draw("SAME");
5689 
5690  //.....axis min->max/right->left: redraw axis with ticksize = 0 and with -labelOffset
5691  if( DeeNumber == 1 || DeeNumber == 2 )
5692  {
5693  chopt = "CS";
5694  TGaxis* sup_axis_x_bis = 0;
5695  sup_axis_x_bis = new TGaxis(axis_x_inf, axis_y_inf, axis_x_sup, axis_y_sup,
5696  IX_values_min, IX_values_max, axis_nb_div, chopt, 0.); fCnewRoot++;
5697  sup_axis_x_bis->SetTickSize(0.);
5698  lab_siz_x = sup_axis_x->GetLabelSize();
5699  sup_axis_x_bis->SetLabelSize(lab_siz_x);
5700  lab_off_x = sup_axis_x->GetLabelOffset();
5701  sup_axis_x_bis->SetLabelOffset(-lab_off_x);
5702  sup_axis_x_bis->Draw("SAME");
5703  }
5704 
5705  //================================================================== Axe IY EEGridAxis
5706 
5707  if( opt_plot == "Dee" || (opt_plot == "EE" && DeeNumber == 4) )
5708  {
5709  Int_t size_IY_dee = fEcal->MaxSCIYInDee();
5710  Int_t size_IY_axis = size_IY_dee;
5711 
5712  if( opt_plot == "Dee" ){axis_nb_div = size_IY_axis;}
5713  if( opt_plot == "EE" ){axis_nb_div = 210;}
5714 
5715  Double_t jIY_min = fEcalNumbering->GetJIYMin(DeeNumber, 1) - 0.5;
5716  Double_t jIY_max = fEcalNumbering->GetJIYMax(DeeNumber)*fEcal->MaxCrysIYInSC() + 0.5;
5717 
5718  TString jy_var_name = " ";
5719  TString jy_direction = "x";
5720 
5721  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
5722  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
5723 
5724  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("Deey");
5725  if(opt_plot == "EE"){tic_siz_y = fCnaParHistos->AxisTickSize("EEy");}
5726 
5727  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("Deey");
5728  if(opt_plot == "EE"){tit_off_y = fCnaParHistos->AxisTitleOffset("EEy");}
5729 
5730  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("Deey");
5731  if(opt_plot == "EE"){lab_off_y = fCnaParHistos->AxisLabelOffset("EEy");}
5732 
5733  TGaxis* axis_jy_plus = 0;
5734  axis_jy_plus = new TGaxis((Float_t)0., (Float_t)0.,
5735  (Float_t)0., (Float_t)(size_IY_axis*MatSize),
5736  jIY_min, jIY_max, axis_nb_div, "SC", 0.); fCnewRoot++;
5737 
5738  jy_var_name = GetIXIYAxisTitle("jIYDee");
5739  axis_jy_plus->SetTitle(jy_var_name);
5740  axis_jy_plus->SetTitleSize(tit_siz_y);
5741  axis_jy_plus->SetTitleOffset(tit_off_y);
5742  axis_jy_plus->SetLabelSize(lab_siz_y);
5743  axis_jy_plus->SetLabelOffset(lab_off_y);
5744  axis_jy_plus->SetTickSize(tic_siz_y);
5745  axis_jy_plus->Draw("SAME");
5746  }
5747 
5748 //---------------------------------- 2 axes (0,50) et (0,-50)
5749 #define IYAX
5750 #ifndef IYAX
5751  if( opt_plot == "Dee" || (opt_plot == "EE" && DeeNumber == 4) )
5752  {
5753  Int_t size_IY_dee = fEcal->MaxSCIYInDee();
5754  Int_t size_IY_axis = size_IY_dee/2;
5755 
5756  if( opt_plot == "Dee" ){axis_nb_div = (Int_t)size_IY_axis;}
5757  if( opt_plot == "EE" ){axis_nb_div = 5;}
5758 
5759  Double_t jIY_min = fEcalNumbering->GetJIYMin(DeeNumber, 1) - 0.5;
5760  Double_t jIY_max = (fEcalNumbering->GetJIYMax(DeeNumber)/2)*fEcal->MaxCrysIYInSC() + 0.5;
5761 
5762  TString jy_var_name = " ";
5763  TString jy_direction = "x";
5764 
5765  Float_t tit_siz_y = fCnaParHistos->AxisTitleSize();
5766  Float_t lab_siz_y = fCnaParHistos->AxisLabelSize();
5767 
5768  Float_t tic_siz_y = fCnaParHistos->AxisTickSize("Deey");
5769  if(opt_plot == "EE"){tic_siz_y = fCnaParHistos->AxisTickSize("EEy");}
5770 
5771  Float_t tit_off_y = fCnaParHistos->AxisTitleOffset("Deey");
5772  if(opt_plot == "EE"){tit_off_y = fCnaParHistos->AxisTitleOffset("EEy");}
5773 
5774  Float_t lab_off_y = fCnaParHistos->AxisLabelOffset("Deey");
5775  if(opt_plot == "EE"){lab_off_y = fCnaParHistos->AxisLabelOffset("EEy");}
5776 
5777  TGaxis* axis_jy_plus = 0;
5778  axis_jy_plus = new TGaxis((Float_t)0., (Float_t)(size_IY_dee*MatSize/2),
5779  (Float_t)0., (Float_t)(2*size_IY_dee*MatSize/2),
5780  jIY_min, jIY_max, axis_nb_div, "SC", 0.); fCnewRoot++;
5781 
5782  jy_var_name = GetIXIYAxisTitle("jIYDee");
5783  axis_jy_plus->SetTitle(jy_var_name);
5784  axis_jy_plus->SetTitleSize(tit_siz_y);
5785  axis_jy_plus->SetTitleOffset(tit_off_y);
5786  axis_jy_plus->SetLabelSize(lab_siz_y);
5787  axis_jy_plus->SetLabelOffset(lab_off_y);
5788  axis_jy_plus->SetTickSize(tic_siz_y);
5789  axis_jy_plus->Draw("SAME");
5790 
5791  TGaxis* axis_jy_minus = 0;
5792  axis_jy_minus = new TGaxis((Float_t)0., (Float_t)(size_IY_dee*MatSize/2),
5793  (Float_t)0., (Float_t)0.,
5794  -jIY_min, -jIY_max, axis_nb_div, "-SC", 0.); fCnewRoot++;
5795 
5796  jy_var_name = GetIXIYAxisTitle("jIYDee");
5797  axis_jy_minus->SetTitle(jy_var_name);
5798  axis_jy_minus->SetTitleSize(tit_siz_y);
5799  axis_jy_minus->SetTitleOffset(tit_off_y);
5800  axis_jy_minus->SetLabelSize(lab_siz_y);
5801  axis_jy_minus->SetLabelOffset(lab_off_y);
5802  axis_jy_minus->SetTickSize(tic_siz_y);
5803  axis_jy_minus->Draw("SAME");
5804  }
5805 #endif // IYAX
5806 
5807 } // ------------- end of EEGridAxis(...) --------------
5808 
5809 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5810 //
5811 // ViewHisto
5812 //
5813 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5814 //======================== D_NOE_ChNb
5817 void TEcnaHistos::EBXtalsAveragedNumberOfEvents(const TString PlotOption)
5818 {StexXtalsNumberOfEvents(PlotOption);}
5819 void TEcnaHistos::SMXtalsNumberOfEvents(const TString PlotOption)
5820 {StexXtalsNumberOfEvents(PlotOption);}
5821 
5824 void TEcnaHistos::EEXtalsAveragedNumberOfEvents(const TString PlotOption)
5825 {StexXtalsNumberOfEvents(PlotOption);}
5826 void TEcnaHistos::DeeXtalsNumberOfEvents(const TString PlotOption)
5827 {StexXtalsNumberOfEvents(PlotOption);}
5828 
5830 void TEcnaHistos::StexXtalsNumberOfEvents(const TString PlotOption)
5831 {ViewHisto(fZerv, fZerv, fZerv, "D_NOE_ChNb", PlotOption);}
5832 
5833 //....................
5836 void TEcnaHistos::EBAveragedNumberOfEventsXtals(const TString PlotOption)
5837 {StexNumberOfEventsXtals(PlotOption);}
5838 void TEcnaHistos::SMNumberOfEventsXtals(const TString PlotOption)
5839 {StexNumberOfEventsXtals(PlotOption);}
5840 
5843 void TEcnaHistos::EEAveragedNumberOfEventsXtals(const TString PlotOption)
5844 {StexNumberOfEventsXtals(PlotOption);}
5845 void TEcnaHistos::DeeNumberOfEventsXtals(const TString PlotOption)
5846 {StexNumberOfEventsXtals(PlotOption);}
5847 
5849 void TEcnaHistos::StexNumberOfEventsXtals(const TString PlotOption)
5850 {ViewHisto(fZerv, fZerv, fZerv, "D_NOE_ChDs", PlotOption);}
5851 
5852 //======================== D_Ped_ChDs
5855 void TEcnaHistos::EBXtalsAveragedPedestals(const TString PlotOption)
5856 {StexXtalsPedestals(PlotOption);}
5857 void TEcnaHistos::SMXtalsPedestals(const TString PlotOption)
5858 {StexXtalsPedestals(PlotOption);}
5859 
5862 void TEcnaHistos::EEXtalsAveragedPedestals(const TString PlotOption)
5863 {StexXtalsPedestals(PlotOption);}
5864 void TEcnaHistos::DeeXtalsPedestals(const TString PlotOption)
5865 {StexXtalsPedestals(PlotOption);}
5866 
5868 void TEcnaHistos::StexXtalsPedestals(const TString PlotOption)
5869 {ViewHisto(fZerv, fZerv, fZerv, "D_Ped_ChNb", PlotOption);}
5870 
5871 //............................
5874 void TEcnaHistos::EBAveragedPedestalsXtals(const TString PlotOption)
5875 {StexPedestalsXtals(PlotOption);}
5876 void TEcnaHistos::SMPedestalsXtals(const TString PlotOption)
5877 {StexPedestalsXtals(PlotOption);}
5878 
5881 void TEcnaHistos::EEAveragedPedestalsXtals(const TString PlotOption)
5882 {StexPedestalsXtals(PlotOption);}
5883 void TEcnaHistos::DeePedestalsXtals(const TString PlotOption)
5884 {StexPedestalsXtals(PlotOption);}
5885 
5887 void TEcnaHistos::StexPedestalsXtals(const TString PlotOption)
5888 {ViewHisto(fZerv, fZerv, fZerv, "D_Ped_ChDs", PlotOption);}
5889 
5890 //======================== D_TNo_ChNb
5893 void TEcnaHistos::EBXtalsAveragedTotalNoise(const TString PlotOption)
5894 {StexXtalsTotalNoise(PlotOption);}
5895 void TEcnaHistos::SMXtalsTotalNoise(const TString PlotOption)
5896 {StexXtalsTotalNoise(PlotOption);}
5897 
5900 void TEcnaHistos::EEXtalsAveragedTotalNoise(const TString PlotOption)
5901 {StexXtalsTotalNoise(PlotOption);}
5902 void TEcnaHistos::DeeXtalsTotalNoise(const TString PlotOption)
5903 {StexXtalsTotalNoise(PlotOption);}
5904 
5906 void TEcnaHistos::StexXtalsTotalNoise(const TString PlotOption)
5907 {ViewHisto(fZerv, fZerv, fZerv, "D_TNo_ChNb", PlotOption);}
5908 
5909 //...............................
5912 void TEcnaHistos::EBAveragedTotalNoiseXtals(const TString PlotOption)
5913 {StexTotalNoiseXtals(PlotOption);}
5914 void TEcnaHistos::SMTotalNoiseXtals(const TString PlotOption)
5915 {StexTotalNoiseXtals(PlotOption);}
5916 
5919 void TEcnaHistos::EEAveragedTotalNoiseXtals(const TString PlotOption)
5920 {StexTotalNoiseXtals(PlotOption);}
5921 void TEcnaHistos::DeeTotalNoiseXtals(const TString PlotOption)
5922 {StexTotalNoiseXtals(PlotOption);}
5923 
5925 void TEcnaHistos::StexTotalNoiseXtals(const TString PlotOption)
5926 {ViewHisto(fZerv, fZerv, fZerv, "D_TNo_ChDs", PlotOption);}
5927 
5928 //======================== D_MCs_ChNb
5931 void TEcnaHistos::EBXtalsAveragedMeanOfCorss(const TString PlotOption)
5932  {StexXtalsMeanOfCorss(PlotOption);}
5933 void TEcnaHistos::SMXtalsMeanOfCorss(const TString PlotOption)
5934  {StexXtalsMeanOfCorss(PlotOption);}
5935 
5938 void TEcnaHistos::EEXtalsAveragedMeanOfCorss(const TString PlotOption)
5939  {StexXtalsMeanOfCorss(PlotOption);}
5940 void TEcnaHistos::DeeXtalsMeanOfCorss(const TString PlotOption)
5941  {StexXtalsMeanOfCorss(PlotOption);}
5942 
5944 void TEcnaHistos::StexXtalsMeanOfCorss(const TString PlotOption)
5945 {ViewHisto(fZerv, fZerv, fZerv, "D_MCs_ChNb", PlotOption);}
5946 
5947 //..........................
5950 void TEcnaHistos::EBAveragedMeanOfCorssXtals(const TString PlotOption)
5951  {StexMeanOfCorssXtals(PlotOption);}
5952 void TEcnaHistos::SMMeanOfCorssXtals(const TString PlotOption)
5953  {StexMeanOfCorssXtals(PlotOption);}
5954 
5957 void TEcnaHistos::EEAveragedMeanOfCorssXtals(const TString PlotOption)
5958  {StexMeanOfCorssXtals(PlotOption);}
5959 void TEcnaHistos::DeeMeanOfCorssXtals(const TString PlotOption)
5960  {StexMeanOfCorssXtals(PlotOption);}
5961 
5963 void TEcnaHistos::StexMeanOfCorssXtals(const TString PlotOption)
5964 {ViewHisto(fZerv, fZerv, fZerv, "D_MCs_ChDs", PlotOption);}
5965 
5966 //======================== D_LFN_ChDs
5970  {StexXtalsLowFrequencyNoise(PlotOption);}
5971 void TEcnaHistos::SMXtalsLowFrequencyNoise(const TString PlotOption)
5972  {StexXtalsLowFrequencyNoise(PlotOption);}
5973 
5977  {StexXtalsLowFrequencyNoise(PlotOption);}
5978 void TEcnaHistos::DeeXtalsLowFrequencyNoise(const TString PlotOption)
5979  {StexXtalsLowFrequencyNoise(PlotOption);}
5980 
5982 void TEcnaHistos::StexXtalsLowFrequencyNoise(const TString PlotOption)
5983 {ViewHisto(fZerv, fZerv, fZerv, "D_LFN_ChNb", PlotOption);}
5984 
5985 //.....................................
5989  {StexLowFrequencyNoiseXtals(PlotOption);}
5990 void TEcnaHistos::SMLowFrequencyNoiseXtals(const TString PlotOption)
5991  {StexLowFrequencyNoiseXtals(PlotOption);}
5992 
5996  {StexLowFrequencyNoiseXtals(PlotOption);}
5997 void TEcnaHistos::DeeLowFrequencyNoiseXtals(const TString PlotOption)
5998  {StexLowFrequencyNoiseXtals(PlotOption);}
5999 
6001 void TEcnaHistos::StexLowFrequencyNoiseXtals(const TString PlotOption)
6002 {ViewHisto(fZerv, fZerv, fZerv, "D_LFN_ChDs", PlotOption);}
6003 
6004 //======================== D_HFN_ChNb
6008  {StexXtalsHighFrequencyNoise(PlotOption);}
6009 void TEcnaHistos::SMXtalsHighFrequencyNoise(const TString PlotOption)
6010  {StexXtalsHighFrequencyNoise(PlotOption);}
6011 
6015  {StexXtalsHighFrequencyNoise(PlotOption);}
6016 void TEcnaHistos::DeeXtalsHighFrequencyNoise(const TString PlotOption)
6017  {StexXtalsHighFrequencyNoise(PlotOption);}
6018 
6020 void TEcnaHistos::StexXtalsHighFrequencyNoise(const TString PlotOption)
6021 {ViewHisto(fZerv, fZerv, fZerv, "D_HFN_ChNb", PlotOption);}
6022 
6023 //....................................
6027  {StexHighFrequencyNoiseXtals(PlotOption);}
6028 void TEcnaHistos::SMHighFrequencyNoiseXtals(const TString PlotOption)
6029  {StexHighFrequencyNoiseXtals(PlotOption);}
6030 
6034  {StexHighFrequencyNoiseXtals(PlotOption);}
6035 void TEcnaHistos::DeeHighFrequencyNoiseXtals(const TString PlotOption)
6036  {StexHighFrequencyNoiseXtals(PlotOption);}
6037 
6039 void TEcnaHistos::StexHighFrequencyNoiseXtals(const TString PlotOption)
6040 {ViewHisto(fZerv, fZerv, fZerv, "D_HFN_ChDs", PlotOption);}
6041 
6042 //======================== D_SCs_ChNb
6045 void TEcnaHistos::EBXtalsAveragedSigmaOfCorss(const TString PlotOption)
6046  {StexXtalsSigmaOfCorss(PlotOption);}
6047 void TEcnaHistos::SMXtalsSigmaOfCorss(const TString PlotOption)
6048  {StexXtalsSigmaOfCorss(PlotOption);}
6049 
6052 void TEcnaHistos::EEXtalsAveragedSigmaOfCorss(const TString PlotOption)
6053  {StexXtalsSigmaOfCorss(PlotOption);}
6054 void TEcnaHistos::DeeXtalsSigmaOfCorss(const TString PlotOption)
6055  {StexXtalsSigmaOfCorss(PlotOption);}
6056 
6058 void TEcnaHistos::StexXtalsSigmaOfCorss(const TString PlotOption)
6059 {ViewHisto(fZerv, fZerv, fZerv, "D_SCs_ChNb", PlotOption);}
6060 
6061 //......................................
6064 void TEcnaHistos::EBAveragedSigmaOfCorssXtals(const TString PlotOption)
6065  {StexSigmaOfCorssXtals(PlotOption);}
6066 void TEcnaHistos::SMSigmaOfCorssXtals(const TString PlotOption)
6067  {StexSigmaOfCorssXtals(PlotOption);}
6068 
6071 void TEcnaHistos::EEAveragedSigmaOfCorssXtals(const TString PlotOption)
6072  {StexSigmaOfCorssXtals(PlotOption);}
6073 void TEcnaHistos::DeeSigmaOfCorssXtals(const TString PlotOption)
6074  {StexSigmaOfCorssXtals(PlotOption);}
6075 
6077 void TEcnaHistos::StexSigmaOfCorssXtals(const TString PlotOption)
6078 {ViewHisto(fZerv, fZerv, fZerv, "D_SCs_ChDs", PlotOption);}
6079 
6080 //======================== D_MSp_Samp
6081 void TEcnaHistos::XtalSamplesEv(const Int_t& aStexStin_A, const Int_t& i0StinEcha)
6082  {XtalSamplesEv(aStexStin_A, i0StinEcha, "ONLYONE");}
6083 void TEcnaHistos::XtalSamplesEv(const Int_t& aStexStin_A, const Int_t& i0StinEcha,
6084  const TString PlotOption)
6085 {
6086  if( fFapStexNumber != 0 )
6087  {
6088  Int_t StexStin_A = aStexStin_A;
6089  if( fFlagSubDet == "EE" )
6090  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
6091  ViewHisto(StexStin_A, i0StinEcha, fZerv, "D_MSp_Samp", PlotOption);
6092  }
6093  else
6094  {
6095  cout << "!TEcnaHistos::XtalSamplesEv(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6096  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << endl;
6097  }
6098 }
6099 
6100 //======================== D_SSp_Samp
6101 void TEcnaHistos::XtalSamplesSigma(const Int_t& aStexStin_A, const Int_t& i0StinEcha)
6102  {XtalSamplesSigma(aStexStin_A, i0StinEcha, "ONLYONE");}
6103 void TEcnaHistos::XtalSamplesSigma(const Int_t& aStexStin_A, const Int_t& i0StinEcha,
6104  const TString PlotOption)
6105 {
6106  if( fFapStexNumber != 0 )
6107  {
6108  Int_t StexStin_A = aStexStin_A;
6109  if( fFlagSubDet == "EE" )
6110  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
6111  ViewHisto(StexStin_A, i0StinEcha, fZerv, "D_SSp_Samp", PlotOption);
6112  }
6113  else
6114  {
6115  cout << "!TEcnaHistos::XtalSamplesSigma(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6116  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << endl;
6117  }
6118 }
6119 
6120 //======================== D_Adc_EvNb
6121 void TEcnaHistos::XtalSampleValues(const Int_t& aStexStin_A, const Int_t& i0StinEcha, const Int_t& iSample)
6122  {XtalSampleValues(aStexStin_A, i0StinEcha, iSample, "ONLYONE");}
6123 void TEcnaHistos::XtalSampleValues(const Int_t& aStexStin_A, const Int_t& i0StinEcha, const Int_t& iSample,
6124  const TString PlotOption)
6125 {
6126  if( fFapStexNumber != 0 )
6127  {
6128  Int_t StexStin_A = aStexStin_A;
6129  if( fFlagSubDet == "EE" )
6130  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
6131  ViewHisto(StexStin_A, i0StinEcha, iSample, "D_Adc_EvNb", PlotOption);
6132  }
6133  else
6134  {
6135  cout << "!TEcnaHistos::XtalSampleValues(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6136  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << endl;
6137  }
6138 }
6139 
6140 //======================== D_Adc_EvDs
6141 void TEcnaHistos::SampleADCEvents(const Int_t& aStexStin_A, const Int_t& i0StinEcha, const Int_t& iSample)
6142  {SampleADCEvents(aStexStin_A, i0StinEcha, iSample, "ONLYONE");}
6143 void TEcnaHistos::SampleADCEvents(const Int_t& aStexStin_A, const Int_t& i0StinEcha,
6144  const Int_t& iSample, const TString PlotOption)
6145 {
6146  if( fFapStexNumber != 0 )
6147  {
6148  Int_t StexStin_A = aStexStin_A;
6149  if( fFlagSubDet == "EE" )
6150  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
6151  ViewHisto(StexStin_A, i0StinEcha, iSample, "D_Adc_EvDs", PlotOption);
6152  }
6153  else
6154  {
6155  cout << "!TEcnaHistos::SampleADCEvents(...)> " << fFapStexName.Data() << " number = " << fFapStexNumber
6156  << " out of range (range = [1," << fEcal->MaxStexInStas() << "])" << fTTBELL << endl;
6157  }
6158 }
6159 
6160 //==========================================================================================
6161 //
6162 // ViewHisto
6163 //
6164 // ViewHisto( StexStin_A, i0StinEcha, iSample, opt_quantity, opt_plot)
6165 //
6166 // (StexStin_A, i0StinEcha, iSample (NOT USED), fOptHisEv, lin/log, opt_plot) ==>
6167 // exp values of the samples for i0StinEcha of StexStin_A
6168 //
6169 // (StexStin_A, i0StinEcha, iSample (NOT USED), fOptHisSigma, lin/log, opt_plot) ==>
6170 // sigmas of the samples for i0StinEcha of StexStin_A
6171 //
6172 // (StexStin_A, i0StinEcha, iSample, fOptHisD_Adc_EvDs, lin/log, opt_plot) ==>
6173 // ADC event distribution for i0StinEcha of StexStin_A and for sample
6174 //
6175 // (StexStin_A, i0StinEcha, iSample (NOT USED), fOptHisD_Adc_EvNb, lin/log, opt_plot) ==>
6176 // Pedestal as a function of event number for i0StinEcha of StexStin_A
6177 //
6178 //===========================================================================================
6179 void TEcnaHistos::ViewHisto(const Int_t& StexStin_A, const Int_t& i0StinEcha,
6180  const Int_t& iSample, const TString HistoCode,
6181  const TString opt_plot_arg)
6182 {
6183 //Histogram of the quantities (one run)
6184 
6185  //.......................................
6186  TString opt_plot = opt_plot_arg;
6187 
6188  Int_t OKHisto = 0;
6189 
6190  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Canvas already closed in option SAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6191  Int_t xCanvasExists = 1; // a priori ==> Canvas exists // (ViewHisto)
6192  if( opt_plot != fOnlyOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
6193  {
6194  TVirtualPad* main_subpad = 0;
6195  //---------------- Call to ActivePad
6196  //if( (TRootCanvas*)fCanv<HISTOCODE>->GetCanvasImp() == fImp<HISTOCODE> ){
6197  // main_subpad = fPad<HISTOCODE>;} (return main_subpad)
6198  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
6199  if( main_subpad == 0 )
6200  {
6201  cout << "*TEcnaHistos::ViewHisto(...)> WARNING ===> Canvas has been closed in option SAME or SAME n."
6202  << endl
6203  << " Please, restart with a new canvas."
6204  << fTTBELL << endl;
6205 
6206  ReInitCanvas(HistoCode, opt_plot);
6207  xCanvasExists = 0;
6208  }
6209  }
6210  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6211 
6212  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
6213  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
6214 
6215  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
6216 
6217  //%%%%%%%%%%%%%%%%%%%%%%%% Change of X variable in option SAME n with no proj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6218  Int_t SameXVarMemo = 1; // a priori ==> SAME n option: X variable OK (ViewHisto)
6219  if( !( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj") )
6220  {
6221  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
6222  {
6223  SetXVarMemo(HistoCode, opt_plot, XVarHisto); SetYVarMemo(HistoCode, opt_plot, YVarHisto); SameXVarMemo = 1;
6224  }
6225  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
6226  {
6227  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
6228  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
6229 
6230  if( XVarHisto != XVariableMemo )
6231  {
6232  cout << "!TEcnaHistos::ViewHisto(...)> *** ERROR *** ===> X coordinate changed in option SAME n." << endl
6233  << " Present X = " << XVarHisto << endl
6234  << " Present Y = " << YVarHisto << endl
6235  << " Previous X = " << XVariableMemo << endl
6236  << " Previous Y = " << YVariableMemo
6237  << fTTBELL << endl;
6238  SameXVarMemo = 0;
6239  }
6240  else
6241  {SetYVarMemo(HistoCode, opt_plot, YVarHisto);}
6242  }
6243  }
6244  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6245 
6246  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Change of Y variable in option SAME n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6247  Int_t SameYVarMemo = 1; // a priori ==> SAME n option: Y variable OK (ViewHisto)
6248  if( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj" )
6249  {
6250  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
6251  {
6252  SetYVarMemo(HistoCode, opt_plot, YVarHisto); SetYVarMemo(HistoCode, opt_plot, YVarHisto); SameYVarMemo = 1;
6253  }
6254  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
6255  {
6256  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
6257  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
6258 
6259  if( YVarHisto != YVariableMemo )
6260  {
6261  cout << "!TEcnaHistos::ViewHisto(...)> *** ERROR *** ===> Y coordinate changed in option SAME n." << endl
6262  << " Present X = " << XVarHisto << endl
6263  << " Present Y = " << YVarHisto << endl
6264  << " Previous X = " << XVariableMemo << endl
6265  << " Previous Y = " << YVariableMemo
6266  << fTTBELL << endl;
6267  SameYVarMemo = 0;
6268  }
6269  else
6270  {SetYVarMemo(HistoCode, opt_plot, YVarHisto);}
6271  }
6272  }
6273  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6274 
6275  //%%%%%%%%%%%%%%%%%%%%%%%%%%% Number of bins change in option SAME or SAME n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6276  Int_t OkBinsMemoSameOne = 1; // a priori ==> SAME n option: Nb bins OK (ViewHisto)
6277 
6278  Int_t SizeForPlot = GetHistoSize(HistoCode.Data(), "plot");
6279  Int_t xNbBins = GetHistoNumberOfBins(HistoCode.Data(), SizeForPlot);
6280 
6281  if( (opt_plot == fSameOnePlot || opt_plot == fSeveralPlot) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
6282  {
6283  SetNbBinsMemo(HistoCode, opt_plot, xNbBins); OkBinsMemoSameOne = 1;
6284  }
6285  if( (opt_plot == fSameOnePlot || opt_plot == fSeveralPlot) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
6286  {
6287  Int_t NbBinsMemo = GetNbBinsFromMemo(HistoCode, opt_plot);
6288  if( xNbBins != NbBinsMemo )
6289  {
6290  cout << "!TEcnaHistos::ViewHisto(...)> *** ERROR *** ===> Number of bins changed in option SAME or SAME n."
6291  << " Present number = " << xNbBins << ", requested number = " << NbBinsMemo << fTTBELL << endl;
6292  OkBinsMemoSameOne = 0;
6293  }
6294  }
6295 
6296  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6297 
6298  if( xCanvasExists == 1 && SameXVarMemo == 1 && SameYVarMemo == 1 && OkBinsMemoSameOne == 1 ){OKHisto = 1;}
6299 
6300  //======================== Histo accepted (ViewHisto)
6301  if( OKHisto == 1 )
6302  {
6303  Int_t opt_scale_x = fOptScaleLinx;
6304  if (fFlagScaleX == "LIN" ){opt_scale_x = fOptScaleLinx;}
6305  if (fFlagScaleX == "LOG" ){opt_scale_x = fOptScaleLogx;}
6306 
6307  Int_t opt_scale_y = fOptScaleLiny;
6308  if (fFlagScaleY == "LIN" ){opt_scale_y = fOptScaleLiny;}
6309  if (fFlagScaleY == "LOG" ){opt_scale_y = fOptScaleLogy;}
6310 
6312  TString fp_name_short = " ";
6313 
6314  //-------------------- read_histo size
6315  Int_t SizeForRead = GetHistoSize(HistoCode.Data(), "read");
6316 
6317  //............................................... allocation/init read_histo
6318  TVectorD histo_for_plot(SizeForPlot);
6319  for(Int_t i=0; i<SizeForPlot; i++){histo_for_plot[i]=(Double_t)0;}
6320 
6321  TVectorD histo_for_plot_memo(SizeForPlot);
6322  for(Int_t i=0; i<SizeForPlot; i++){histo_for_plot_memo[i]=(Double_t)0;}
6323 
6324  Int_t i_data_exist = 0;
6325  Int_t OKPlot = 0;
6326 
6327  //-------------------------------------------------------- histos Global and Proj
6328  if( HistoType == "Global" || HistoType == "Proj" || HistoType == "SampGlobal" || HistoType == "SampProj" )
6329  {
6330  if( (fFapStexNumber == 0) )
6331  {
6332  //--------------------------------------------------------------------- Stas Histo (ViewHisto)
6333  Int_t CounterExistingFile = 0;
6334  Int_t CounterDataExist = 0;
6335 
6336  Int_t* xFapNbOfEvts = new Int_t[fEcal->MaxStexInStas()]; fCnew++;
6337  for(Int_t i=0; i<fEcal->MaxStexInStas(); i++){xFapNbOfEvts[i]=0;}
6338 
6339  Int_t* NOFE_int = new Int_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
6340 
6341  for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
6342  {
6347  iStasStex+1, fCfgResultsRootFilePath.Data());
6348 
6349  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewHisto, Stas)
6350  {
6351  fStatusFileFound = kTRUE;
6352 
6353  CounterExistingFile++;
6354  xFapNbOfEvts[iStasStex] = GetNumberOfEvents(fMyRootFile, fFapReqNbOfEvts);
6355  //----------------------------------------------------------------------------- file reading
6356  fp_name_short = fMyRootFile->GetRootFileNameShort();
6357  // cout << "*TEcnaHistos::ViewHisto(...)> Data are analyzed from file ----> "
6358  // << fp_name_short << endl;
6359 
6360  //....................... search for first and last dates
6361  if( iStasStex == 0 )
6362  {
6367  }
6368  else
6369  {
6370  time_t xStartTime = fMyRootFile->GetStartTime();
6371  time_t xStopTime = fMyRootFile->GetStopTime();
6372  TString xStartDate = fMyRootFile->GetStartDate();
6373  TString xStopDate = fMyRootFile->GetStopDate();
6374  if( xStartTime < fStartTime ){fStartTime = xStartTime; fStartDate = xStartDate;}
6375  if( xStopTime > fStopTime ){fStopTime = xStopTime; fStopDate = xStopDate;}
6376  }
6377 
6379 
6380  //............................................... histo reading (ViewHisto, Stas)
6381  TVectorD read_histo(fEcal->MaxStinEcnaInStex());
6382  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){read_histo(i)=(Double_t)0.;}
6383 
6384  if( HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" ){
6386  if( HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs" ){
6388  if( HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs" ){
6390  if( HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" ){
6392  if( HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" ){
6394  if( HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" ){
6396  if( HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs" ){
6398 
6399  //...........................................................
6400  if( fMyRootFile->DataExist() == kTRUE )
6401  {
6402  fStatusDataExist = kTRUE;
6403 
6404  CounterDataExist++;
6405 
6406  for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
6407  {
6408  //Int_t n1StexStinEcna = i0StexStinEcna+1;
6409  //-------------------------------------- Stas histo filling (ViewHisto, Stas)
6410  Int_t i_xgeo = -1;
6411  //...................................... EB
6412  if( fFlagSubDet == "EB" )
6413  {
6414  i_xgeo = iStasStex*fEcal->MaxStinEcnaInStex() + i0StexStinEcna;
6415  if( i_xgeo >= 0 && i_xgeo < SizeForPlot )
6416  {
6417  histo_for_plot[i_xgeo] = read_histo[i0StexStinEcna];
6418  }
6419  else
6420  {
6421  cout << "!TEcnaHistos::ViewHisto(...)> <EB> i_xgeo = " << i_xgeo
6422  << ". OUT OF RANGE ( range = [0,"<< SizeForPlot << "] " << endl;
6423  }
6424  }
6425  //...................................... EE (ViewHisto)
6426  //-------> Dee order: D4, D3, D2, D1
6427  if( fFlagSubDet == "EE" )
6428  {
6429  Int_t DeeOffset = 0;
6430  Int_t DSOffset = 0;
6431 
6432  Int_t DeeNumber = iStasStex+1;
6433  Int_t n1DeeSCEcna = i0StexStinEcna+1;
6434 
6435  //................................................ Dee offset
6436  if( DeeNumber == 3 ){DeeOffset += fEcal->MaxSCForConsInDee();} // 149
6437  if( DeeNumber == 2 ){DeeOffset += 3*fEcal->MaxSCForConsInDee()-1;} // 446
6438  if( DeeNumber == 1 ){DeeOffset += 4*fEcal->MaxSCForConsInDee()-1;} // 595
6439 
6440  //................................................ Data Sector offset (ViewHisto)
6441  Int_t StexDataSector = fEcalNumbering->GetDSFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
6442  //.... returns 0 if n1DeeSCEcna corresponds to an empty "ECNA-SC"
6443 
6444  //................................................ SC final coordinate (ViewHisto)
6445  Int_t StexDSStin = fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
6446  //--> return StexDSStin = 25 (not 3) for n1DeeSCEcna = 32
6447  //--> return StexDSStin = 14 (not 21) for n1DeeSCEcna = 29
6448  //--> return StexDSStin = -1 for n1DeeSCEcna = 10 and n1DeeSCEcna = 11
6449 
6450  if( StexDataSector >= 1 && StexDataSector <= 9 )
6451  {
6452  if( DeeNumber == 4 ) // Sectors 1,2,3,4,5a
6453  {
6454  for(Int_t is=2; is<=5; is++)
6455  { if( StexDataSector >= is )
6456  {DSOffset += fEcalNumbering->GetMaxSCInDS(is-1);}}
6457  }
6458 
6459  if( DeeNumber == 3 ) // Sectors 5b,6,7,8,9
6460  {
6461  if( StexDataSector >= 6 )
6462  {DSOffset += fEcalNumbering->GetMaxSCInDS(5)/2;}
6463  for(Int_t is=7; is<=9; is++)
6464  { if( StexDataSector >= is )
6465  {DSOffset += fEcalNumbering->GetMaxSCInDS(is-1);}}
6466  }
6467 
6468  if( DeeNumber == 2 ) // Sectors 9,8,7,6,5a
6469  {
6470  if( StexDataSector >= 6 )
6471  {DSOffset -= fEcalNumbering->GetMaxSCInDS(5)/2;}
6472  for(Int_t is=7; is<=9; is++)
6473  {if( StexDataSector >= is )
6474  {DSOffset -= fEcalNumbering->GetMaxSCInDS(is-1);}}
6475  }
6476 
6477  if( DeeNumber == 1 ) // Sectors 5b,4,3,2,1
6478  {
6479  for(Int_t is=2; is<=5; is++)
6480  { if( StexDataSector >= is )
6481  {DSOffset -= fEcalNumbering->GetMaxSCInDS(is-1);}}
6482  }
6483 
6484  if( StexDSStin >=1 && StexDSStin <= fEcalNumbering->GetMaxSCInDS(StexDataSector) )
6485  {
6486  if( DeeNumber == 4 ) // Sectors 1,2,3,4,5a
6487  {
6488  if(StexDataSector != 5)
6489  {i_xgeo = DeeOffset + DSOffset + (StexDSStin - 1);}
6490  if( StexDataSector == 5)
6491  {i_xgeo = DeeOffset + DSOffset + (StexDSStin - 1);}
6492  }
6493  if( DeeNumber == 3 ) // Sectors 5b,6,7,8,9
6494  {
6495  if(StexDataSector != 5)
6496  {i_xgeo = DeeOffset + DSOffset + (StexDSStin - 1);}
6497  if( StexDataSector == 5)
6498  {i_xgeo = DeeOffset + DSOffset + (StexDSStin-17) - 1;}
6499  }
6500  if( DeeNumber == 2 ) // Sectors 5a,6,7,8,9
6501  {
6502  if(StexDataSector != 5)
6503  {i_xgeo = DeeOffset + DSOffset
6504  - fEcalNumbering->GetMaxSCInDS(StexDataSector) + StexDSStin;}
6505  if( StexDataSector == 5)
6506  {i_xgeo = DeeOffset + DSOffset
6507  - fEcalNumbering->GetMaxSCInDS(StexDataSector)/2 + StexDSStin;}
6508  }
6509  if( DeeNumber == 1 ) // Sectors 1,2,3,4,5b
6510  {
6511  if(StexDataSector != 5)
6512  {i_xgeo = DeeOffset + DSOffset
6513  - fEcalNumbering->GetMaxSCInDS(StexDataSector) + StexDSStin;}
6514  if( StexDataSector == 5)
6515  {i_xgeo = DeeOffset + DSOffset
6516  - fEcalNumbering->GetMaxSCInDS(StexDataSector)/2 +(StexDSStin-17);}
6517  }
6518 
6519  }// end of if(StexDSStin >=1 && StexDSStin <= fEcalNumbering->GetMaxSCInDS(StexDataSector))
6520  else
6521  {
6522  cout << "!TEcnaHistos::ViewHisto(...)> <EE> StexDSStin = " << StexDSStin
6523  << ". OUT OF RANGE ( range = [1,"
6524  << fEcalNumbering->GetMaxSCInDS(StexDataSector)
6525  << "]. DeeNumber = " << DeeNumber
6526  << ", n1DeeSCEcna = " << n1DeeSCEcna
6527  << ", StexDataSector = " << StexDataSector
6528  << ", i_xgeo = " << i_xgeo << endl;
6529  }
6530  }// end of if( StexDataSector >= 1 && StexDataSector <= 9 )
6531  else
6532  {
6533  //cout << "!TEcnaHistos::ViewHisto(...)> <EE> StexDataSector = " << StexDataSector
6534  // << ". OUT OF RANGE ( range = [1,9]. DeeNumber = " << DeeNumber
6535  // << ", n1DeeSCEcna = " << n1DeeSCEcna
6536  // << ", i_xgeo = " << i_xgeo << endl;
6537  }
6538  //......................................... transfert read_histo -> histo_for_plot
6539  if( i_xgeo >= -1 && i_xgeo < SizeForPlot )
6540  {
6541  // special treatement for not connected & mixed SC's
6542  if( n1DeeSCEcna == 29 || n1DeeSCEcna == 32 || // 261a, 207c, 268a, 178c
6543  // [ 14a, 25c, 21a, 3c]
6544  n1DeeSCEcna == 144 || n1DeeSCEcna == 165 || // 261c, 261b [14c, 14b]
6545  n1DeeSCEcna == 176 || n1DeeSCEcna == 193 || // 207a, 207b [25a, 25b]
6546  n1DeeSCEcna == 60 || n1DeeSCEcna == 119 || // 182a, 182b [30a, 30b]
6547  n1DeeSCEcna == 102 || n1DeeSCEcna == 123 || // 268c, 268b [21c, 21b]
6548  n1DeeSCEcna == 138 || n1DeeSCEcna == 157 ) // 178a, 178b [ 3a, 3b]
6549  {
6550  //--------------- DSSC 14
6551  if( n1DeeSCEcna == 29 && i_xgeo >= 0 )
6552  {histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna]/(Double_t)5.;}
6553  if( (n1DeeSCEcna == 144 || n1DeeSCEcna == 165) && i_xgeo >= 0 )
6554  {histo_for_plot[i_xgeo] +=
6555  read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)25.;}
6556 
6557  //--------------- DSSC 25
6558  if( n1DeeSCEcna == 32 && i_xgeo >= 0 )
6559  {histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna]/(Double_t)5.;}
6560  if( (n1DeeSCEcna == 176 || n1DeeSCEcna == 193) && i_xgeo >= 0 )
6561  {histo_for_plot[i_xgeo] +=
6562  read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)25.;}
6563 
6564  //--------------- DSSC 30
6565  if( (n1DeeSCEcna == 60 || n1DeeSCEcna == 119) && i_xgeo >= 0 )
6566  {histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna]/(Double_t)2.;}
6567 
6568  //--------------- DSSC 21 (Add SC translated at 10-1 only once, i_xgeo = -1 accepted)
6569  if( n1DeeSCEcna == 102 )
6570  {histo_for_plot[i_xgeo] += read_histo[9]/(Double_t)21.
6571  + read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)21.;}
6572  if( n1DeeSCEcna == 123 && i_xgeo >= 0 )
6573  {histo_for_plot[i_xgeo] +=
6574  read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)21.;}
6575 
6576  //--------------- DSSC 3 (Add SC translated at 11-1 only once, i_xgeo = -1 accepted)
6577  if( n1DeeSCEcna == 138 )
6578  {histo_for_plot[i_xgeo] += read_histo[10]/(Double_t)21.
6579  + read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)21.;}
6580  if( n1DeeSCEcna == 157 && i_xgeo >= 0 )
6581  {histo_for_plot[i_xgeo] +=
6582  read_histo[i0StexStinEcna]*(Double_t)10./(Double_t)21.;}
6583  }
6584  else
6585  {
6586  if( i_xgeo >= 0 )
6587  {histo_for_plot[i_xgeo] += read_histo[i0StexStinEcna];} // standard treatment
6588  }
6589  } // end of if( i_xgeo >= -1 && i_xgeo < SizeForPlot )
6590  else
6591  {
6592  //cout << "!TEcnaHistos::ViewHisto(...)> <EE> i_xgeo = " << i_xgeo
6593  // << ". OUT OF RANGE ( range = [0,"<< SizeForPlot << "] " << endl;
6594  }
6595  }// end of if( fFlagSubDet == "EE" )
6596  }// end of for(Int_t i0StexStinEcna=0; i0StexStinEcna<fEcal->MaxStinEcnaInStex(); i0StexStinEcna++)
6597  }
6598  else
6599  {
6600  cout << "!TEcnaHistos::ViewHisto(...)> "
6601  << " Data not available for " << fFapStexName << " " << iStasStex+1
6602  << " (Quantity not present in the ROOT file)" << endl;
6603  }
6604  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE ) (ViewHisto/Stas)
6605  else
6606  {
6607  fStatusFileFound = kFALSE;
6608 
6609  cout << "!TEcnaHistos::ViewHisto(...)> "
6610  << " Data not available for " << fFapStexName << " " << iStasStex+1
6611  << " (ROOT file not found)" << endl;
6612  }
6613 
6614  if( fFapNbOfEvts <= xFapNbOfEvts[iStasStex] ){fFapNbOfEvts = xFapNbOfEvts[iStasStex];}
6615 
6616  } // end of for(Int_t iStasStex=0; iStasStex<fEcal->MaxStexInStas(); iStasStex++)
6617 
6618  delete [] NOFE_int; NOFE_int = 0; fCdelete++;
6619  delete [] xFapNbOfEvts; xFapNbOfEvts = 0; fCdelete++;
6620 
6621  if( CounterExistingFile > 0 && CounterDataExist > 0 ){OKPlot = 1;}
6622 
6623  } // end of if( fFapStexNumber == 0 )
6624 
6625  //---------------------------------------------------------------------------- (ViewHisto [Stex])
6626  if( fFapStexNumber > 0 )
6627  {
6633 
6634  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewHisto, Stex)
6635  {
6636  fStatusFileFound = kTRUE;
6637  //---------------------------------------------------------------------------- (ViewHisto [Stex])
6639  fp_name_short = fMyRootFile->GetRootFileNameShort();
6640  // cout << "*TEcnaHistos::ViewHisto(...)> Data are analyzed from file ----> "
6641  // << fp_name_short << endl;
6642 
6643  Bool_t ok_view_histo =
6644  GetOkViewHisto(fMyRootFile, StexStin_A, i0StinEcha, iSample, HistoCode.Data());
6645 
6646  if( ok_view_histo == kTRUE )
6647  {
6648  //------------ EB or EE with SampGlobal or SampProj (histo_for_plot = read_histo)
6649  if( fFlagSubDet == "EB" ||
6650  ( fFlagSubDet == "EE" && ( HistoType == "SampGlobal" || HistoType == "SampProj" ) ) )
6651  {
6652  histo_for_plot = GetHistoValues(fMyRootFile, HistoCode.Data(), SizeForPlot, SizeForRead,
6653  StexStin_A, i0StinEcha, iSample, i_data_exist);
6654  if( i_data_exist > 0 ){OKPlot = 1;}
6655  if( OKPlot == 1 && opt_plot == "ASCII" && ( HistoType == "Global" || HistoType == "Proj" ) )
6656  {WriteHistoAscii(HistoCode.Data(), SizeForPlot, histo_for_plot);}
6657  }
6658 
6659  //------------ EE except for SampGlobal and SampProj) (histo_for_plot # read_histo)
6660  if( fFlagSubDet == "EE" && !( HistoType == "SampGlobal" || HistoType == "SampProj" ) )
6661  {
6662  TVectorD read_histo(SizeForRead);
6663  for(Int_t i=0; i<SizeForRead; i++){read_histo(i)=(Double_t)0.;}
6664 
6665  read_histo = GetHistoValues(fMyRootFile, HistoCode.Data(), SizeForRead, SizeForRead,
6666  StexStin_A, i0StinEcha, iSample, i_data_exist);
6667  if( i_data_exist > 0 ){OKPlot = 1;}
6668  if( OKPlot == 1 && opt_plot == "ASCII" )
6669  {
6670  WriteHistoAscii(HistoCode.Data(), fEcal->MaxCrysEcnaInDee(), read_histo);
6671  }
6672  if( OKPlot == 1 && opt_plot != "ASCII" )
6673  {
6674  //..................... Build histo_for_plot from read_histo (ViewHisto [Stex])
6675  Int_t DeeNumber = fFapStexNumber;
6676  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(DeeNumber);
6677 
6678  //%%%%%%%%%%%%%%%%%%%%%%%%%%%% LOOP ON Echa (Ecna) %%%%%%%%%%%%%%%%%%%%%%%%%% (ViewHisto [Stex])
6679  for(Int_t i0DeeEcha=0; i0DeeEcha<fEcal->MaxCrysEcnaInDee(); i0DeeEcha++)
6680  {
6681  Int_t n1SCEcha = fEcalNumbering->Get1SCEchaFrom0DeeEcha(i0DeeEcha);
6682  Int_t n1DeeSCEcna = i0DeeEcha/fEcal->MaxCrysInSC()+1;
6683 
6684  Int_t DataSector = fEcalNumbering->GetDSFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna);
6685  Int_t SC_in_DS = fEcalNumbering->GetDSSCFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna, n1SCEcha);
6686 
6687  Int_t i_xgeo = -1;
6688 
6689  if( n1SCEcha >= 1 && n1SCEcha <= fEcal->MaxCrysInSC() )
6690  {
6691  if( n1DeeSCEcna >= 1 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
6692  {
6693  if( DataSector >= 1 && DataSector <= 9 )
6694  {
6695  if( SC_in_DS >= 1 && SC_in_DS <= fEcalNumbering->GetMaxSCInDS(DataSector) )
6696  {
6697  if( read_histo[i0DeeEcha] != 0 )
6698  {
6699  //................................... Data Sector offset
6700  Int_t DSOffset = GetDSOffset(DeeNumber, DataSector);
6701 
6702  //........................ Super-Crystal (SC) offset (ViewHisto [Stex])
6703  Int_t SCOffset = GetSCOffset(DeeNumber, DataSector, SC_in_DS);
6704 
6705  //........................ Xtal final bin
6706  Int_t nSCCons = fEcalNumbering->
6707  GetDeeSCConsFrom1DeeSCEcna(DeeNumber, n1DeeSCEcna, n1SCEcha);
6708 
6709  Int_t n1FinalSCEcha = n1SCEcha;
6710 
6711  if( fEcalNumbering->GetSCType(nSCCons) == "NotConnected" ||
6712  fEcalNumbering->GetSCType(nSCCons) == "NotComplete" )
6713  { //----- not complete and not connected SC's
6714  // no i_xgeo value if SC = 14 or 25 and channel 11
6715  if( !( (SC_in_DS == 14 || SC_in_DS == 25 ) && n1SCEcha == 11 ) )
6716  {
6717  n1FinalSCEcha =
6718  ModifiedSCEchaForNotConnectedSCs(DeeNumber, nSCCons, SC_in_DS,
6719  n1DeeSCEcna, n1SCEcha);
6720  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha-1);
6721  }
6722  // change SC 14 -> 21 and channel 11 -> 21
6723  if( SC_in_DS == 14 && n1SCEcha == 11 )
6724  {
6725  SCOffset = GetSCOffset(DeeNumber, DataSector, 21);
6726  n1FinalSCEcha = 21;
6727  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha-1);
6728  }
6729  // change SC 25 -> 3 for channel 11 -> 21
6730  if( SC_in_DS == 25 && n1SCEcha == 11 )
6731  {
6732  SCOffset = GetSCOffset(DeeNumber, DataSector, 3);
6733  n1FinalSCEcha = 21;
6734  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha-1);
6735  }
6736  }
6737  else
6738  { //----------- Complete SCs
6739  i_xgeo = DSOffset + SCOffset + (n1FinalSCEcha-1);
6740  }
6741 
6742  histo_for_plot_memo[i_xgeo]++;
6743  if( histo_for_plot_memo[i_xgeo] >= 2 )
6744  {
6745  cout << "! histo_memo[" << i_xgeo
6746  << "] = " << histo_for_plot_memo[i_xgeo]
6747  << ", nSCCons = " << nSCCons
6748  << ", SC_in_DS = " << SC_in_DS
6749  << ", DSOffset = " << DSOffset
6750  << ", SCOffset = " << SCOffset
6751  << ", n1DeeSCEcna = " << n1DeeSCEcna
6752  << ", n1SCEcha = " << n1SCEcha
6753  << ", n1FinalSCEcha = " << n1FinalSCEcha << endl;
6754  }
6755  //.............................. transfert read_histo -> histo_for_plot
6756  if( i_xgeo >= 0 && i_xgeo < SizeForPlot )
6757  {
6758  if( n1FinalSCEcha > 0 )
6759  {histo_for_plot[i_xgeo] += read_histo[i0DeeEcha];}
6760  }
6761  else
6762  {
6763  cout << "!TEcnaHistos::ViewHisto(...)> <EE> i_xgeo = " << i_xgeo
6764  << ". OUT OF RANGE ( range = [0,"<< SizeForPlot << "] " << endl;
6765  }
6766  } // end of if( read_histo[i0DeeEcha] > 0 )
6767  } // end of if( SC_in_DS >= 1 && SC_in_DS <= fEcalNumbering->GetMaxSCInDS(DataSector) )
6768  else
6769  {
6770  cout << "!TEcnaHistos::ViewHisto(...)> <EE> SC_in_DS = " << SC_in_DS
6771  << ". OUT OF RANGE ( range = [1,"
6772  << fEcalNumbering->GetMaxSCInDS(DataSector) << "] "
6773  << ", DataSector = " << DataSector
6774  << ", n1DeeSCEcna = " << n1DeeSCEcna
6775  << ", n1SCEcha = " << n1SCEcha
6776  << ", i0DeeEcha = " << i0DeeEcha
6777  << endl;
6778  }
6779  } // end of if( DataSector >= 1 && DataSector <= 9 )
6780  else
6781  {
6782  if( DataSector != 0 )
6783  {
6784  cout << "!TEcnaHistos::ViewHisto(...)> <EE> DataSector = " << DataSector
6785  << ". OUT OF RANGE ( range = [1,9] "
6786  << ", n1DeeSCEcna = " << n1DeeSCEcna
6787  << ", n1SCEcha = " << n1SCEcha
6788  << ", i0DeeEcha = " << i0DeeEcha
6789  << endl;
6790  }
6791  }
6792  } // end of if( n1DeeSCEcna >= 1 && n1DeeSCEcna <= fEcal->MaxSCEcnaInDee() )
6793  else
6794  {
6795  cout << "!TEcnaHistos::ViewHisto(...)> <EE> n1DeeSCEcna = " << n1DeeSCEcna
6796  << ". OUT OF RANGE ( range = [1,"<< fEcal->MaxSCEcnaInDee() << "] "
6797  << ", n1SCEcha = " << n1SCEcha
6798  << ", i0DeeEcha = " << i0DeeEcha
6799  << endl;
6800  }
6801  } // end of if(n1SCEcha >= 1 && n1SCEcha <= fEcal->MaxCrysInSC() )
6802  else
6803  {
6804  cout << "!TEcnaHistos::ViewHisto(...)> <EE> n1SCEcha = " << n1SCEcha
6805  << ". OUT OF RANGE ( range = [1,"<< fEcal->MaxCrysInSC() << "] "
6806  << ", i0DeeEcha = " << i0DeeEcha
6807  << endl;
6808  }
6809  }
6810  } // end of if( OKPlot == 1 && opt_plot != "ASCII" )
6811  } // end of if(fFlagSubDet == "EE")
6812  } // end of if(ok_view_histo == kTRUE)
6813  else
6814  {
6815  cout << "!TEcnaHistos::ViewHisto(...)> *ERROR* =====> "
6816  << " ok_view_histo != kTRUE " << fTTBELL << endl;
6817  }
6818  } // end of if(fMyRootFile->LookAtRootFile() == kTRUE)
6819  else
6820  {
6821  fStatusFileFound = kFALSE;
6822 
6823  cout << "!TEcnaHistos::ViewHisto(...)> *ERROR* =====> "
6824  << " ROOT file not found" << fTTBELL << endl;
6825  }
6826  } // end of if(fFapStexNumber > 0)
6827  } // end of if( HistoType == "Global" || HistoType == "Proj" || HistoType == "SampGlobal" || HistoType == "SampProj" )
6828  else
6829  {
6830  //--------------------------------------------------------------------- not Global-Proj Histo
6831  if( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) )
6832  {
6838 
6839  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewHisto, not Global-Proj)
6840  {
6841  fStatusFileFound = kTRUE;
6842 
6844 
6845  for(Int_t i=0; i<SizeForPlot; i++){histo_for_plot[i]=(Double_t)0;}
6846  histo_for_plot = GetHistoValues(fMyRootFile, HistoCode.Data(), SizeForPlot, SizeForRead,
6847  StexStin_A, i0StinEcha, iSample, i_data_exist);
6848  if( i_data_exist > 0 ){OKPlot = 1;}
6849  }
6850  else
6851  {
6852  cout << "!TEcnaHistos::ViewHisto(...)> *ERROR* =====> "
6853  << " ROOT file not found" << fTTBELL << endl;
6854  }
6855  }
6856  else
6857  {
6858  cout << "!TEcnaHistos::ViewHisto(...)> " << fFapStexName.Data()
6859  << " = " << fFapStexNumber << ". Out of range (range = [1,"
6860  << fEcal->MaxStexInStas() << "]) " << fTTBELL << endl;
6861  }
6862  }
6863 
6864  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PLOT accepted
6865 
6866  if( ( HistoType == "Global" || HistoType == "Proj" || HistoType == "SampGlobal" || HistoType == "SampProj") ||
6867  ( !( HistoType == "Global" || HistoType == "Proj" || HistoType == "SampGlobal" || HistoType == "SampProj") &&
6868  ( (fFapStexNumber > 0) && (fFapStexNumber <= fEcal->MaxStexInStas()) ) ) )
6869  {
6870  if( opt_plot != "ASCII" )
6871  {
6872  if( OKPlot > 0 )
6873  {
6874  //... Ymin and ymax default values will be taken if fFlagUserHistoMin/Max = "OFF"
6875  // and if "Free" for "SAME" and "SAME n" options
6876  if((opt_plot == fOnlyOnePlot) ||
6877  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
6878  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
6879  {
6880  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
6881  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
6882  }
6883 
6884  //==== 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)
6885  //
6886  // must be done before booking because of the x <-> y permutation in case of "Proj"
6887  //
6888  //-----------------------------------------------------------------------------------------
6889  //
6890  // CASE: HistoType == "Proj" OR HistoType == "SampProj"
6891  //
6892  // Xinf and Xsup must be calculated from ymin and ymax
6893  // of the direct ("Global") histo
6894  //
6895  //-----------------------------------------------------------------------------------------
6896  if( HistoType == "Proj" || HistoType == "SampProj" )
6897  {
6898  TString HistoCodi = HistoCode; // HistoCodi = direct histo
6899 
6900  if( HistoCode == "D_NOE_ChDs" ){HistoCodi = "D_NOE_ChNb";}
6901  if( HistoCode == "D_Ped_ChDs" ){HistoCodi = "D_Ped_ChNb";}
6902  if( HistoCode == "D_TNo_ChDs" ){HistoCodi = "D_TNo_ChNb";}
6903  if( HistoCode == "D_MCs_ChDs" ){HistoCodi = "D_MCs_ChNb";}
6904  if( HistoCode == "D_LFN_ChDs" ){HistoCodi = "D_LFN_ChNb";}
6905  if( HistoCode == "D_HFN_ChDs" ){HistoCodi = "D_HFN_ChNb";}
6906  if( HistoCode == "D_SCs_ChDs" ){HistoCodi = "D_SCs_ChNb";}
6907  if( HistoCode == "D_Adc_EvDs" ){HistoCodi = "D_Adc_EvNb";}
6908 
6909  TString TitleHisto = ";";
6910  if( opt_plot != fSameOnePlot )
6911  {TitleHisto = fCnaParHistos->GetQuantityName(HistoCodi);}
6912 
6913  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
6914 
6915  //--------------------------------------------------------------------------- (ViewHisto)
6916  //
6917  // fOnlyOnePlot => compute Xinf and Xsup at each time
6918  // fSeveralPlot => compute Xinf and Xsup once when flag = "Free" for each HistoCode
6919  // fSameOnePlot => compute Xinf and Xsup once
6920  //
6921  //--------------------------------------------------------------------------------------
6922  if( (opt_plot == fOnlyOnePlot) ||
6923  ( (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, fSeveralPlot) == "Free" ) ||
6924  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, fSameOnePlot) == "Free" ) ) )
6925  {
6926  Double_t XinfProj =(Double_t)0;
6927  Double_t XsupProj =(Double_t)0;
6928 
6929  //...................................................................... (ViewHisto)
6930  if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
6931  {
6932  Int_t HisSiza = GetHistoSize(HistoCodi.Data(), "plot");
6933  Int_t ReadHisSiza = HisSiza;
6934  //.............................. prepa direct histogram booking (ViewHisto)
6935  Axis_t xinf_hisa = GetHistoXinf(HistoCodi.Data(), HisSiza, opt_plot);
6936  Axis_t xsup_hisa = GetHistoXsup(HistoCodi.Data(), HisSiza, opt_plot);
6937  Int_t nb_binxa = GetHistoNumberOfBins(HistoCodi.Data(), HisSiza);
6938  //.............................. direct ("Global") histogram booking (ViewHisto)
6939  TH1D* h_hisa =
6940  new TH1D("histoa", TitleHisto.Data(), nb_binxa, xinf_hisa, xsup_hisa); fCnewRoot++;
6941  h_hisa->Reset();
6942  //.... direct histogram filling to get its ymin (=> xminProj) and ymax (=> xmaxProj)
6943  FillHisto(h_hisa, histo_for_plot, HistoCodi.Data(), ReadHisSiza);
6944  //... Get direct histo ymin and/or ymax and keep them as xinf and xsup
6945  // in memo for the plotted histo
6946  XinfProj = fUserHistoMin;
6947  XsupProj = fUserHistoMax;
6948  if( fFlagUserHistoMin == "AUTO" ){XinfProj = h_hisa->GetMinimum();}
6949  if( fFlagUserHistoMax == "AUTO" ){XsupProj = h_hisa->GetMaximum();}
6950  h_hisa->Delete(); h_hisa = 0; fCdeleteRoot++;
6951  } // end of if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
6952  else
6953  {
6954  if( fFlagUserHistoMin == "OFF" )
6955  {
6956  SetYminMemoFromValue(HistoCode.Data(),
6957  fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
6958  XinfProj = GetYminValueFromMemo(HistoCode.Data());
6959  }
6960 
6961  if( fFlagUserHistoMax == "OFF" )
6962  {
6963  SetYmaxMemoFromValue(HistoCode.Data(),
6964  fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
6965  XsupProj = GetYmaxValueFromMemo(HistoCode.Data());
6966  }
6967  if( fFlagUserHistoMin == "ON" ){XinfProj = fUserHistoMin;}
6968  if( fFlagUserHistoMax == "ON" ){XsupProj = fUserHistoMax;}
6969  }
6970 
6971  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
6972  {
6973  SetXinfMemoFromValue(HistoCode.Data(), XinfProj);
6974  SetXsupMemoFromValue(HistoCode.Data(), XsupProj);
6975  }
6976  else
6977  {
6978  SetXinfMemoFromValue(XinfProj);
6979  SetXsupMemoFromValue(XsupProj);
6980  }
6981  } // end of if( (opt_plot == fOnlyOnePlot) ||
6982  // (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
6983  // (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
6984  } // end of if( HistoType == "Proj" || HistoType == "SampProj" )
6985 
6986 
6987  //=============== H I S T O B O O K I N G A N D F I L L I N G ======== (ViewHisto)
6988  //.............................. prepa histogram booking (ViewHisto)
6989 
6990  //.......... Set number of bins: forcing to fNbBinsProj if "HistoType" == "Proj"
6991  Int_t xNbBins = GetHistoNumberOfBins(HistoCode.Data(), SizeForPlot);
6992 
6993  Double_t cXinf = (Double_t)0.;
6994  Double_t cXsup = (Double_t)0.;
6995 
6996  //.......... Set Xinf and Xsup at each time because of simultaneous SAME options
6997  if( HistoType == "Proj" || HistoType == "SampProj" )
6998  {
6999  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
7000  {
7001  cXinf = GetXinfValueFromMemo(HistoCode.Data());
7002  cXsup = GetXsupValueFromMemo(HistoCode.Data());
7003  }
7004  else
7005  {
7006  cXinf = GetXinfValueFromMemo();
7007  cXsup = GetXsupValueFromMemo();
7008  }
7009  }
7010  else
7011  {
7012  cXinf = GetHistoXinf(HistoCode.Data(), SizeForPlot, opt_plot);
7013  cXsup = GetHistoXsup(HistoCode.Data(), SizeForPlot, opt_plot);
7014  }
7015 
7016  //.............................. histogram booking (ViewHisto)
7017  Axis_t xinf_his = cXinf; // ancillary variables since no const in arguments of TH1D
7018  Axis_t xsup_his = cXsup;
7019  Int_t nb_binx = xNbBins;
7020 
7021  TString TitleHisto = ";";
7022  if( opt_plot != fSameOnePlot )
7023  {TitleHisto = fCnaParHistos->GetQuantityName(HistoCode.Data());}
7024  TH1D* h_his0 = new TH1D("histo", TitleHisto.Data(), nb_binx, xinf_his, xsup_his); fCnewRoot++;
7025  h_his0->Reset();
7026  //............................... histogram filling
7027  FillHisto(h_his0, histo_for_plot, HistoCode.Data(), SizeForPlot);
7028 
7029  //=============== H I S T O Y M I N / Y M A X M A N A G E M E N T =========== (ViewHisto)
7030  if( opt_plot == fOnlyOnePlot ||
7031  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
7032  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
7033  {
7034  if( opt_plot == fSameOnePlot ){fHistoCodeFirst = HistoCode;} // registration of first HistoCode
7035  //................................. Automatic min and/or max for other options than "Proj"
7036  if( HistoType != "Proj" && HistoType != "SampProj" )
7037  {
7038  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
7039  //................................. user's min and/or max
7040  if( fFlagUserHistoMin == "ON" )
7041  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
7042  if( fFlagUserHistoMax == "ON" )
7043  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
7044  //................................. automatic min and/or max
7045  if( fFlagUserHistoMin == "AUTO" )
7046  {
7047  //.............. no bottom margin if ymin = 0
7048  Double_t ymin = GetYminFromHistoFrameAndMarginValue(h_his0, (Double_t)0.);
7049  if( ymin != (Double_t)0. )
7050  {ymin =
7052  SetYminMemoFromValue(HistoCode.Data(),ymin);
7053  fFlagUserHistoMin = "OFF";
7054  }
7055  if( fFlagUserHistoMax == "AUTO" )
7056  {
7057  Double_t ymax =
7059  SetYmaxMemoFromValue(HistoCode.Data(),ymax);
7060  fFlagUserHistoMax = "OFF";
7061  }
7062  //................................. Set YMin and YMax of histo (ViewHisto)
7063  SetYminMemoFromPreviousMemo(HistoCode);
7064  SetYmaxMemoFromPreviousMemo(HistoCode);
7065  } // end of if( HistoType != "Proj" && HistoType != "SampProj" )
7066 
7067  //.......... Find maximum in case of Proj (LIN scale only) // PS: EvolProj => in ViewHistime
7068  if( ( HistoType == "Proj" || HistoType == "SampProj" ) && fFlagScaleY == "LIN" )
7069  {
7071  (HistoCode.Data(),
7073  }
7074  } // end of if( opt_plot == fOnlyOnePlot ||
7075  // (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
7076  // (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
7077 
7078  //--- Set ymin and ymax to the first HistoCode values for option SAME n
7079  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
7080  {
7081  Double_t ymin = GetYminValueFromMemo(fHistoCodeFirst.Data());
7082  SetYminMemoFromValue(HistoCode.Data(), ymin);
7083 
7084  Double_t ymax = GetYmaxValueFromMemo(fHistoCodeFirst.Data());
7085  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
7086  }
7087 
7088  //... histogram set ymin and ymax and consequently margin at top of the plot
7089  Int_t xFlagAutoYsupMargin = SetHistoFrameYminYmaxFromMemo(h_his0, HistoCode);
7090 
7091  //==================================== P L O T ============================== (ViewHisto)
7092  HistoPlot(h_his0, SizeForPlot, xinf_his, xsup_his,
7093  HistoCode.Data(), HistoType.Data(),
7094  StexStin_A, i0StinEcha, iSample,
7095  opt_scale_x, opt_scale_y, opt_plot, xFlagAutoYsupMargin);
7096 
7097  h_his0->Delete(); h_his0 = 0; fCdeleteRoot++;
7098  //===========================================================================
7099 
7100  //--- Recover ymin and ymax from user's values in option SAME n
7101  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
7102  {
7103  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
7104  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
7105  }
7106  } // end of if( OKPlot > 0 )
7107  else
7108  {
7109  cout << "!TEcnaHistos::ViewHisto(...)> Histo not available."
7110  << fTTBELL << endl;
7111  }
7112  }
7113  }
7114  } // end of if( OKHisto == 1 )
7115 } // end of ViewHisto(...)
7116 
7117 //------------------------------------------------------------------------------------
7118 Int_t TEcnaHistos::GetDSOffset(const Int_t& DeeNumber, const Int_t& DataSector)
7119 {
7120  // gives the DataSector Offset on 1D histos for option "Global"
7121 
7122  Int_t DSOffset = 0;
7123 
7124  if( DeeNumber == 4 )
7125  {
7126  if( DataSector >= 1 ){}
7127  if( DataSector >= 2 ){DSOffset += fEcalNumbering->GetMaxSCInDS(1)*fEcal->MaxCrysInSC();}
7128  if( DataSector >= 3 ){DSOffset += fEcalNumbering->GetMaxSCInDS(2)*fEcal->MaxCrysInSC();}
7129  if( DataSector >= 4 ){DSOffset += fEcalNumbering->GetMaxSCInDS(3)*fEcal->MaxCrysInSC();}
7130  if( DataSector >= 5 ){DSOffset += fEcalNumbering->GetMaxSCInDS(4)*fEcal->MaxCrysInSC();}
7131  }
7132  if( DeeNumber == 3 )
7133  {
7134  if( DataSector >= 5 ){}
7135  if( DataSector >= 6 ){DSOffset += (fEcalNumbering->GetMaxSCInDS(5)/2)*fEcal->MaxCrysInSC();}
7136  if( DataSector >= 7 ){DSOffset += fEcalNumbering->GetMaxSCInDS(6)*fEcal->MaxCrysInSC();}
7137  if( DataSector >= 8 ){DSOffset += fEcalNumbering->GetMaxSCInDS(7)*fEcal->MaxCrysInSC();}
7138  if( DataSector >= 9 ){DSOffset += fEcalNumbering->GetMaxSCInDS(8)*fEcal->MaxCrysInSC();}
7139  }
7140  if( DeeNumber == 2 )
7141  {
7142  if( DataSector <= 9 ){}
7143  if( DataSector <= 8 ){DSOffset += fEcalNumbering->GetMaxSCInDS(9)*fEcal->MaxCrysInSC();}
7144  if( DataSector <= 7 ){DSOffset += fEcalNumbering->GetMaxSCInDS(8)*fEcal->MaxCrysInSC();}
7145  if( DataSector <= 6 ){DSOffset += fEcalNumbering->GetMaxSCInDS(7)*fEcal->MaxCrysInSC();}
7146  if( DataSector <= 5 ){DSOffset += fEcalNumbering->GetMaxSCInDS(6)*fEcal->MaxCrysInSC();}
7147  }
7148  if( DeeNumber == 1 )
7149  {
7150  if( DataSector <= 5 ){}
7151  if( DataSector <= 4 ){DSOffset += (fEcalNumbering->GetMaxSCInDS(5)/2)*fEcal->MaxCrysInSC();}
7152  if( DataSector <= 3 ){DSOffset += fEcalNumbering->GetMaxSCInDS(4)*fEcal->MaxCrysInSC();}
7153  if( DataSector <= 2 ){DSOffset += fEcalNumbering->GetMaxSCInDS(3)*fEcal->MaxCrysInSC();}
7154  if( DataSector <= 1 ){DSOffset += fEcalNumbering->GetMaxSCInDS(2)*fEcal->MaxCrysInSC();}
7155  }
7156  return DSOffset;
7157 }
7158 //------------------------------------------------------------------------------------
7159 Int_t TEcnaHistos::GetSCOffset(const Int_t& DeeNumber, const Int_t& DataSector, const Int_t& SC_in_DS)
7160 {
7161  // gives the SC (Super-Crystal) Offset on 1D histos for option "Global"
7162 
7163  Int_t SCOffset = 0;
7164 
7165  if( DeeNumber == 1 || DeeNumber == 3 )
7166  {
7167  if( DataSector == 5 ){SCOffset += ((SC_in_DS-17)-1)*fEcal->MaxCrysInSC();}
7168  if( DataSector != 5 ){SCOffset += (SC_in_DS-1)*fEcal->MaxCrysInSC();}
7169  }
7170 
7171  if( DeeNumber == 2 || DeeNumber == 4 ){SCOffset += (SC_in_DS-1)*fEcal->MaxCrysInSC();}
7172 
7173  return SCOffset;
7174 }
7175 //------------------------------------------------------------------------------------
7176 Int_t TEcnaHistos::ModifiedSCEchaForNotConnectedSCs(const Int_t& n1DeeNumber,
7177  const Int_t& nSCCons, const Int_t& SC_in_DS,
7178  const Int_t& n1DeeSCEcna, const Int_t& n1SCEcha)
7179 {
7180  //------------------------ Modification of n1SCEcha number for not connected SC's
7181 
7182  Int_t ModifiedSCEcha = -1;
7183  TString SCQuad = fEcalNumbering->GetSCQuadFrom1DeeSCEcna(n1DeeSCEcna); // SCQuad = top OR bottom
7184  TString DeeDir = fEcalNumbering->GetDeeDirViewedFromIP(n1DeeNumber); // DeeDir = left OR right
7185 
7186  TString TypQuad = "?";
7187  if( SCQuad == "top" && DeeDir == "right" ){TypQuad = "TR";}
7188  if( SCQuad == "top" && DeeDir == "left" ){TypQuad = "TL";}
7189  if( SCQuad == "bottom" && DeeDir == "left" ){TypQuad = "BL";}
7190  if( SCQuad == "bottom" && DeeDir == "right" ){TypQuad = "BR";}
7191 
7192  //------------------------------------------------------------------------------------------- top
7193 
7194  //..... (D1,S1), (D3,S9) SC_in_DS = 30, n1DeeSCEcna = 60 -> 182a for construction top/right
7195  //..... (D1,S2), (D3,S8) SC_in_DS = 3, n1DeeSCEcna = 138 -> 178a for construction top/right
7196  if( (SC_in_DS == 30 && n1DeeSCEcna == 60 && TypQuad == "TR") ||
7197  (SC_in_DS == 3 && n1DeeSCEcna == 138 && TypQuad == "TR") ){if(n1SCEcha > 15){ModifiedSCEcha = n1SCEcha - 15;}}
7198 
7199  //..... (D4,S1), (D2,S9) SC_in_DS = 30, n1DeeSCEcna = 60 -> 33a for construction top/left
7200  //..... (D4,S2), (D2,S8) SC_in_DS = 3, n1DeeSCEcna = 138 -> 29a for construction top/left
7201  if( (SC_in_DS == 30 && n1DeeSCEcna == 60 && TypQuad == "TL") ||
7202  (SC_in_DS == 3 && n1DeeSCEcna == 138 && TypQuad == "TL") )
7203  {
7204  if(n1SCEcha == 4){ModifiedSCEcha = 1;}
7205  if(n1SCEcha == 5){ModifiedSCEcha = 2;}
7206  if(n1SCEcha == 9){ModifiedSCEcha = 3;}
7207  if(n1SCEcha == 10){ModifiedSCEcha = 4;}
7208  if(n1SCEcha == 14){ModifiedSCEcha = 5;}
7209  if(n1SCEcha == 15){ModifiedSCEcha = 6;}
7210  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7211  if(n1SCEcha == 20){ModifiedSCEcha = 8;}
7212  if(n1SCEcha == 24){ModifiedSCEcha = 9;}
7213  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7214  }
7215 
7216  //..... (D1,S1), (D3,S9) SC_in_DS = 30, n1DeeSCEcna = 119 -> 182b for construction top/right
7217  if( SC_in_DS == 30 && n1DeeSCEcna == 119 && TypQuad == "TR" ){if(n1SCEcha > 5){ModifiedSCEcha = n1SCEcha - 5;}}
7218 
7219  //..... (D4,S1), (D2,S9) SC_in_DS = 30, n1DeeSCEcna = 119 -> 33b for construction top/left
7220  if( SC_in_DS == 30 && n1DeeSCEcna == 119 && TypQuad == "TL" )
7221  {
7222  if(n1SCEcha == 4){ModifiedSCEcha = 11;}
7223  if(n1SCEcha == 5){ModifiedSCEcha = 12;}
7224  if(n1SCEcha == 9){ModifiedSCEcha = 13;}
7225  if(n1SCEcha == 10){ModifiedSCEcha = 14;}
7226  if(n1SCEcha == 14){ModifiedSCEcha = 15;}
7227  if(n1SCEcha == 15){ModifiedSCEcha = 16;}
7228  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7229  if(n1SCEcha == 20){ModifiedSCEcha = 18;}
7230  if(n1SCEcha == 24){ModifiedSCEcha = 19;}
7231  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7232  }
7233 
7234  //..... (D1,S1), (D3,S9) SC_in_DS = 12, n1DeeSCEcna = 13 -> 161 for construction top/right
7235  //..... (D4,S1), (D2,S9) SC_in_DS = 12, n1DeeSCEcna = 13 -> 12 for construction top/left
7236  if( SC_in_DS == 12 && n1DeeSCEcna == 13 && TypQuad == "TR" )
7237  {
7238  ModifiedSCEcha = n1SCEcha;
7239  }
7240  if( SC_in_DS == 12 && n1DeeSCEcna == 13 && TypQuad == "TL" )
7241  {
7242  if( n1SCEcha >= 1 && n1SCEcha <= 4 ){ModifiedSCEcha = n1SCEcha;}
7243  if( n1SCEcha >= 6 && n1SCEcha <= 9 ){ModifiedSCEcha = n1SCEcha-1;}
7244  if( n1SCEcha >= 11 && n1SCEcha <= 14 ){ModifiedSCEcha = n1SCEcha-2;}
7245  if( n1SCEcha >= 16 && n1SCEcha <= 19 ){ModifiedSCEcha = n1SCEcha-3;}
7246  if( n1SCEcha >= 21 && n1SCEcha <= 24 ){ModifiedSCEcha = n1SCEcha-4;}
7247  }
7248 
7249  //..... (D1,S2), (D3,S8) SC_in_DS = 25, n1DeeSCEcna = 176 -> 207a for construction top/right
7250  if( SC_in_DS == 25 && n1DeeSCEcna == 176 && TypQuad == "TR" )
7251  {
7252  if(n1SCEcha == 4){ModifiedSCEcha = 1;}
7253  if(n1SCEcha == 5){ModifiedSCEcha = 2;}
7254  if(n1SCEcha == 9){ModifiedSCEcha = 3;}
7255  if(n1SCEcha == 10){ModifiedSCEcha = 4;}
7256  if(n1SCEcha == 14){ModifiedSCEcha = 5;}
7257  if(n1SCEcha == 15){ModifiedSCEcha = 6;}
7258  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7259  if(n1SCEcha == 20){ModifiedSCEcha = 8;}
7260  if(n1SCEcha == 24){ModifiedSCEcha = 9;}
7261  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7262  }
7263 
7264  //..... (D4,S2), (D2,S8) SC_in_DS = 25, n1DeeSCEcna = 176 -> 58a for construction top/left
7265  if( SC_in_DS == 25 && n1DeeSCEcna == 176 && TypQuad == "TL" )
7266  {
7267  if(n1SCEcha == 16){ModifiedSCEcha = 1;}
7268  if(n1SCEcha == 21){ModifiedSCEcha = 2;}
7269  if(n1SCEcha == 17){ModifiedSCEcha = 3;}
7270  if(n1SCEcha == 22){ModifiedSCEcha = 4;}
7271  if(n1SCEcha == 18){ModifiedSCEcha = 5;}
7272  if(n1SCEcha == 23){ModifiedSCEcha = 6;}
7273  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7274  if(n1SCEcha == 24){ModifiedSCEcha = 8;}
7275  if(n1SCEcha == 20){ModifiedSCEcha = 9;}
7276  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7277  }
7278 
7279  //..... (D1,S2), (D3,S8) SC_in_DS = 3, n1DeeSCEcna = 157 -> 178b for construction top/right
7280  //..... (D1,S2), (D3,S8) SC_in_DS = 25, n1DeeSCEcna = 193 -> 207b for construction top/right
7281  if( (SC_in_DS == 3 && n1DeeSCEcna == 157 && TypQuad == "TR") ||
7282  (SC_in_DS == 25 && n1DeeSCEcna == 193 && TypQuad == "TR") )
7283  {
7284  if(n1SCEcha == 4){ModifiedSCEcha = 11;}
7285  if(n1SCEcha == 5){ModifiedSCEcha = 12;}
7286  if(n1SCEcha == 9){ModifiedSCEcha = 13;}
7287  if(n1SCEcha == 10){ModifiedSCEcha = 14;}
7288  if(n1SCEcha == 14){ModifiedSCEcha = 15;}
7289  if(n1SCEcha == 15){ModifiedSCEcha = 16;}
7290  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7291  if(n1SCEcha == 20){ModifiedSCEcha = 18;}
7292  if(n1SCEcha == 24){ModifiedSCEcha = 19;}
7293  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7294  }
7295 
7296  //..... (D4,S2), (D2,S8) SC_in_DS = 3, n1DeeSCEcna = 157 -> 29b for construction top/left
7297  //..... (D4,S2), (D2,S8) SC_in_DS = 25, n1DeeSCEcna = 193 -> 58b for construction top/left
7298  if( (SC_in_DS == 3 && n1DeeSCEcna == 157 && TypQuad == "TL") ||
7299  (SC_in_DS == 25 && n1DeeSCEcna == 193 && TypQuad == "TL") )
7300  {
7301  if(n1SCEcha == 16){ModifiedSCEcha = 11;}
7302  if(n1SCEcha == 21){ModifiedSCEcha = 12;}
7303  if(n1SCEcha == 17){ModifiedSCEcha = 13;}
7304  if(n1SCEcha == 22){ModifiedSCEcha = 14;}
7305  if(n1SCEcha == 18){ModifiedSCEcha = 15;}
7306  if(n1SCEcha == 23){ModifiedSCEcha = 16;}
7307  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7308  if(n1SCEcha == 24){ModifiedSCEcha = 18;}
7309  if(n1SCEcha == 20){ModifiedSCEcha = 19;}
7310  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7311  }
7312 
7313  //..... (D1,S2), (D3,S8) SC_in_DS = 32, n1DeeSCEcna = 51 -> 216 for construction top/right
7314  if( SC_in_DS == 32 && n1DeeSCEcna == 51 && TypQuad == "TR" )
7315  {
7316  if( n1SCEcha >= 1 && n1SCEcha <= 4 ){ModifiedSCEcha = n1SCEcha;}
7317  if( n1SCEcha >= 6 && n1SCEcha <= 9 ){ModifiedSCEcha = n1SCEcha-1;}
7318  if( n1SCEcha >= 11 && n1SCEcha <= 14 ){ModifiedSCEcha = n1SCEcha-2;}
7319  if( n1SCEcha >= 16 && n1SCEcha <= 19 ){ModifiedSCEcha = n1SCEcha-3;}
7320  if( n1SCEcha >= 21 && n1SCEcha <= 24 ){ModifiedSCEcha = n1SCEcha-4;}
7321  }
7322 
7323  //..... (D4,S2), (D2,S8) SC_in_DS = 32, n1DeeSCEcna = 51 -> 67 for construction top/left
7324  if( SC_in_DS == 32 && n1DeeSCEcna == 51 && TypQuad == "TL" )
7325  {
7326  ModifiedSCEcha = n1SCEcha;
7327  }
7328 
7329  // **************************** Special case: TWO SC's IN THE SAME SC-Ecna place *************************
7330  //========================================================================================== D1,D3 ======
7331  // (D1,S2), (D3,S8) SC_in_DS = 3, n1DeeSCEcna = 32 -> 178c for construction top/right
7332  // (D1,S2), (D3,S8) SC_in_DS = 25, n1DeeSCEcna = 32 -> 207c for construction top/right
7333  // For n1DeeSCEcna = 32: ONLY "25" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
7334  // fT2d_DSSC[dee-1][32-1] = 25; // also 3; // ( (207c, 58c) also (178c, 29c) for construction)
7335  // is recovered from number for construction
7336  //=======================================================================================================
7337  if( n1DeeSCEcna == 32 && TypQuad == "TR" )
7338  {
7339  if( nSCCons == 207 )
7340  {
7341  if(n1SCEcha == 1){ModifiedSCEcha = 21;}
7342  if(n1SCEcha == 2){ModifiedSCEcha = 22;}
7343  if(n1SCEcha == 3){ModifiedSCEcha = 23;}
7344  if(n1SCEcha == 6){ModifiedSCEcha = 24;}
7345  if(n1SCEcha == 7){ModifiedSCEcha = 25;}
7346  }
7347  if( nSCCons == 178 )
7348  {
7349  if(n1SCEcha == 11){ModifiedSCEcha = 21;}
7350  }
7351  }
7352 
7353  //========================================================================================== D2,D4 ======
7354  // (D4,S2), (D2,S8) SC_in_DS = 3, n1DeeSCEcna = 32 -> 29c for construction top/left
7355  // (D4,S2), (D2,S8) SC_in_DS = 25, n1DeeSCEcna = 32 -> 58c for construction top/left
7356  // For n1DeeSCEcna = 32: ONLY "25" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
7357  // fT2d_DSSC[dee-1][32-1] = 25; // also 3; // ( (207c, 58c) also (178c, 29c) for construction)
7358  // is recovered from number for construction
7359  //=======================================================================================================
7360  if( n1DeeSCEcna == 32 && TypQuad == "TL" )
7361  {
7362  if( nSCCons == 58 )
7363  {
7364  if(n1SCEcha == 1){ModifiedSCEcha = 21;}
7365  if(n1SCEcha == 2){ModifiedSCEcha = 22;}
7366  if(n1SCEcha == 3){ModifiedSCEcha = 23;}
7367  if(n1SCEcha == 6){ModifiedSCEcha = 24;}
7368  if(n1SCEcha == 7){ModifiedSCEcha = 25;}
7369  }
7370  if( nSCCons == 29 )
7371  {
7372  if(n1SCEcha == 11){ModifiedSCEcha = 21;}
7373  }
7374  }
7375  //****************************************************************************************************
7376 
7377  //------------------------------------------------------------------------------------------- bottom
7378 
7379  // **************************** Special case: TWO SC's IN THE SAME SC-Ecna place *************************
7380  //========================================================================================== D1,D3 ======
7381  // (D1,S4), (D3,S6) SC_in_DS = 14, n1DeeSCEcna = 29 -> 261a for construction bottom/right
7382  // (D1,S4), (D3,S6) SC_in_DS = 21, n1DeeSCEcna = 29 -> 268a for construction bottom/right
7383  // For n1DeeSCEcna = 29: ONLY "14" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
7384  // fT2d_DSSC[dee-1][29-1] = 14; // also 21; // ( (261a, 112a) also (268a, 119a) for construction)
7385  // is recovered from number for construction
7386  //=======================================================================================================
7387  if( n1DeeSCEcna == 29 && TypQuad == "BR" )
7388  {
7389  if( nSCCons == 261 )
7390  {
7391  if(n1SCEcha == 1){ModifiedSCEcha = 21;}
7392  if(n1SCEcha == 2){ModifiedSCEcha = 22;}
7393  if(n1SCEcha == 3){ModifiedSCEcha = 23;}
7394  if(n1SCEcha == 6){ModifiedSCEcha = 24;}
7395  if(n1SCEcha == 7){ModifiedSCEcha = 25;}
7396  }
7397  if( nSCCons == 268 )
7398  {
7399  if(n1SCEcha == 11){ModifiedSCEcha = 21;}
7400  }
7401  }
7402 
7403  //========================================================================================== D2,D4 ======
7404  // (D4,S4), (D2,S6) SC_in_DS = 14, n1DeeSCEcna = 29 -> 112a for construction bottom/left
7405  // (D4,S4), (D2,S6) SC_in_DS = 21, n1DeeSCEcna = 29 -> 119a for construction bottom/left
7406  // For n1DeeSCEcna = 29: ONLY "14" IN ARRAY fT2d_DSSC[][] (see TEcnaNumbering.cc)
7407  // fT2d_DSSC[dee-1][29-1] = 14; // also 21; // ( (261a, 112a) also (268a, 119a) for construction)
7408  // is recovered from number for construction
7409  //=======================================================================================================
7410  if( n1DeeSCEcna == 29 && TypQuad == "BL" )
7411  {
7412  if( nSCCons == 119 )
7413  {
7414  if(n1SCEcha == 11){ModifiedSCEcha = 21;}
7415  }
7416  if( nSCCons == 112 )
7417  {
7418  if(n1SCEcha == 1){ModifiedSCEcha = 21;}
7419  if(n1SCEcha == 2){ModifiedSCEcha = 22;}
7420  if(n1SCEcha == 3){ModifiedSCEcha = 23;}
7421  if(n1SCEcha == 6){ModifiedSCEcha = 24;}
7422  if(n1SCEcha == 7){ModifiedSCEcha = 25;}
7423  }
7424  }
7425 
7426  // ****************************************************************************************************
7427 
7428  //..... (D1,S3), (D3,S7) SC_in_DS = 34, n1DeeSCEcna = 188 -> 298a for construction bottom/right
7429  //..... (D1,S4), (D3,S6) SC_in_DS = 14, n1DeeSCEcna = 165 -> 261b for construction bottom/right
7430  if( (SC_in_DS == 34 && n1DeeSCEcna == 188 && TypQuad == "BR") ||
7431  (SC_in_DS == 14 && n1DeeSCEcna == 165 && TypQuad == "BR") ){if(n1SCEcha > 15){ModifiedSCEcha = n1SCEcha - 15;}}
7432 
7433  //..... (D4,S3), (D2,S7) SC_in_DS = 34, n1DeeSCEcna = 188 -> 149a for construction bottom/left
7434  //..... (D4,S4), (D2,S6) SC_in_DS = 14, n1DeeSCEcna = 165 -> 112b for construction bottom/left
7435  if( (SC_in_DS == 34 && n1DeeSCEcna == 188 && TypQuad == "BL") ||
7436  (SC_in_DS == 14 && n1DeeSCEcna == 165 && TypQuad == "BL") )
7437  {
7438  if(n1SCEcha == 4){ModifiedSCEcha = 1;}
7439  if(n1SCEcha == 5){ModifiedSCEcha = 2;}
7440  if(n1SCEcha == 9){ModifiedSCEcha = 3;}
7441  if(n1SCEcha == 10){ModifiedSCEcha = 4;}
7442  if(n1SCEcha == 14){ModifiedSCEcha = 5;}
7443  if(n1SCEcha == 15){ModifiedSCEcha = 6;}
7444  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7445  if(n1SCEcha == 20){ModifiedSCEcha = 8;}
7446  if(n1SCEcha == 24){ModifiedSCEcha = 9;}
7447  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7448  }
7449 
7450  //..... (D1,S3), (D3,S7) SC_in_DS = 10, n1DeeSCEcna = 50 -> 224 for construction bottom/right
7451  if( SC_in_DS == 10 && n1DeeSCEcna == 50 && TypQuad == "BR" )
7452  {
7453  ModifiedSCEcha = n1SCEcha;
7454  }
7455 
7456  //..... (D4,S3), (D2,S7) SC_in_DS = 10, n1DeeSCEcna = 50 -> 75 for construction bottom/left
7457  if( SC_in_DS == 10 && n1DeeSCEcna == 50 && TypQuad == "BL")
7458  {
7459  if( n1SCEcha >= 1 && n1SCEcha <= 4 ){ModifiedSCEcha = n1SCEcha;}
7460  if( n1SCEcha >= 6 && n1SCEcha <= 9 ){ModifiedSCEcha = n1SCEcha-1;}
7461  if( n1SCEcha >= 11 && n1SCEcha <= 14 ){ModifiedSCEcha = n1SCEcha-2;}
7462  if( n1SCEcha >= 16 && n1SCEcha <= 19 ){ModifiedSCEcha = n1SCEcha-3;}
7463  if( n1SCEcha >= 21 && n1SCEcha <= 24 ){ModifiedSCEcha = n1SCEcha-4;}
7464  }
7465 
7466  //..... (D1,S4), (D3,S6) SC_in_DS = 14, n1DeeSCEcna = 144 -> 261c for construction bottom/right
7467  if( SC_in_DS == 14 && n1DeeSCEcna == 144 && TypQuad == "BR" ){if(n1SCEcha > 5){ModifiedSCEcha = n1SCEcha - 5;}}
7468 
7469  //..... (D4,S4), (D2,S6) SC_in_DS = 14, n1DeeSCEcna = 144 -> 112c for construction bottom/left
7470  if( SC_in_DS == 14 && n1DeeSCEcna == 144 && TypQuad == "BL" )
7471  {
7472  if(n1SCEcha == 4){ModifiedSCEcha = 11;}
7473  if(n1SCEcha == 5){ModifiedSCEcha = 12;}
7474  if(n1SCEcha == 9){ModifiedSCEcha = 13;}
7475  if(n1SCEcha == 10){ModifiedSCEcha = 14;}
7476  if(n1SCEcha == 14){ModifiedSCEcha = 15;}
7477  if(n1SCEcha == 15){ModifiedSCEcha = 16;}
7478  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7479  if(n1SCEcha == 20){ModifiedSCEcha = 18;}
7480  if(n1SCEcha == 24){ModifiedSCEcha = 19;}
7481  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7482  }
7483 
7484  //..... (D1,S4), (D3,S6) SC_in_DS = 21, n1DeeSCEcna = 123 -> 268b for construction bottom/right
7485  //..... (D1,S5), (D3,S5) SC_in_DS = 20, n1DeeSCEcna = 21 -> 281a for construction bottom/right
7486  if( (SC_in_DS == 21 && n1DeeSCEcna == 123 && TypQuad == "BR") ||
7487  (SC_in_DS == 20 && n1DeeSCEcna == 41 && TypQuad == "BR") )
7488  {
7489  if(n1SCEcha == 4){ModifiedSCEcha = 1;}
7490  if(n1SCEcha == 5){ModifiedSCEcha = 2;}
7491  if(n1SCEcha == 9){ModifiedSCEcha = 3;}
7492  if(n1SCEcha == 10){ModifiedSCEcha = 4;}
7493  if(n1SCEcha == 14){ModifiedSCEcha = 5;}
7494  if(n1SCEcha == 15){ModifiedSCEcha = 6;}
7495  if(n1SCEcha == 19){ModifiedSCEcha = 7;}
7496  if(n1SCEcha == 20){ModifiedSCEcha = 8;}
7497  if(n1SCEcha == 24){ModifiedSCEcha = 9;}
7498  if(n1SCEcha == 25){ModifiedSCEcha = 10;}
7499  }
7500 
7501  //..... (D4,S4), (D2,S6) SC_in_DS = 21, n1DeeSCEcna = 123 -> 119b for construction bottom/left
7502  //..... (D4,S5), (D2,S5) SC_in_DS = 3, n1DeeSCEcna = 41 -> 132a for construction bottom/left
7503  if( (SC_in_DS == 21 && n1DeeSCEcna == 123 && TypQuad == "BL") ||
7504  (SC_in_DS == 3 && n1DeeSCEcna == 41 && TypQuad == "BL") ){if(n1SCEcha > 15){ModifiedSCEcha = n1SCEcha - 15;}}
7505 
7506 
7507  //..... (D1,S4), (D3,S6) SC_in_DS = 21, n1DeeSCEcna = 102 -> 268c for construction bottom/right
7508  if( SC_in_DS == 21 && n1DeeSCEcna == 102 && TypQuad == "BR" )
7509  {
7510  if(n1SCEcha == 4){ModifiedSCEcha = 11;}
7511  if(n1SCEcha == 5){ModifiedSCEcha = 12;}
7512  if(n1SCEcha == 9){ModifiedSCEcha = 13;}
7513  if(n1SCEcha == 10){ModifiedSCEcha = 14;}
7514  if(n1SCEcha == 14){ModifiedSCEcha = 15;}
7515  if(n1SCEcha == 15){ModifiedSCEcha = 16;}
7516  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7517  if(n1SCEcha == 20){ModifiedSCEcha = 18;}
7518  if(n1SCEcha == 24){ModifiedSCEcha = 19;}
7519  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7520  }
7521 
7522  //..... (D4,S4), (D2,S6) SC_in_DS = 21, n1DeeSCEcna = 102 -> 119c for construction bottom/left
7523  if( SC_in_DS == 21 && n1DeeSCEcna == 102 && TypQuad == "BL" )
7524  {
7525  if(n1SCEcha == 16){ModifiedSCEcha = 11;}
7526  if(n1SCEcha == 21){ModifiedSCEcha = 12;}
7527  if(n1SCEcha == 17){ModifiedSCEcha = 13;}
7528  if(n1SCEcha == 22){ModifiedSCEcha = 14;}
7529  if(n1SCEcha == 18){ModifiedSCEcha = 15;}
7530  if(n1SCEcha == 23){ModifiedSCEcha = 16;}
7531  if(n1SCEcha == 19){ModifiedSCEcha = 17;}
7532  if(n1SCEcha == 24){ModifiedSCEcha = 18;}
7533  if(n1SCEcha == 20){ModifiedSCEcha = 19;}
7534  if(n1SCEcha == 25){ModifiedSCEcha = 20;}
7535  }
7536 
7537  //..... (D1,S5), (D3,S5) SC_in_DS = 23, n1DeeSCEcna = 8 -> 286 for construction bottom/right
7538  if( SC_in_DS == 23 && n1DeeSCEcna == 8 && TypQuad == "BR" )
7539  {
7540  if( n1SCEcha >= 1 && n1SCEcha <= 4 ){ModifiedSCEcha = n1SCEcha;}
7541  if( n1SCEcha >= 6 && n1SCEcha <= 9 ){ModifiedSCEcha = n1SCEcha-1;}
7542  if( n1SCEcha >= 11 && n1SCEcha <= 14 ){ModifiedSCEcha = n1SCEcha-2;}
7543  if( n1SCEcha >= 16 && n1SCEcha <= 19 ){ModifiedSCEcha = n1SCEcha-3;}
7544  if( n1SCEcha >= 21 && n1SCEcha <= 24 ){ModifiedSCEcha = n1SCEcha-4;}
7545  }
7546 
7547  //..... (D4,S5), (D2,S5) SC_in_DS = 6, n1DeeSCEcna = 8 -> 137 for construction bottom/left
7548  if( SC_in_DS == 6 && n1DeeSCEcna == 8 && TypQuad == "BL" )
7549  {
7550  ModifiedSCEcha = n1SCEcha;
7551  }
7552 
7553  //======================= ERROR message if ModifiedSCEcha is not correct
7554  if( ModifiedSCEcha < 1 || ModifiedSCEcha > fEcal->MaxCrysInSC() )
7555  {
7556  cout << "! *** ERROR *** > ModifiedSCEcha = " << ModifiedSCEcha
7557  << ", SC_in_DS = " << SC_in_DS
7558  << ", nSCCons = " << nSCCons
7559  << ", n1DeeSCEcna = " << n1DeeSCEcna
7560  << ", n1SCEcha = " << n1SCEcha
7561  << ", ModifiedSCEcha = " << ModifiedSCEcha
7562  << ", TypQuad = " << TypQuad
7563  << fTTBELL << endl;
7564  }
7565 
7566  return ModifiedSCEcha;
7567 }
7568 // end of ModifiedSCEchaForNotConnectedSCs(...)
7569 
7570 //======================================================================================
7571 //
7572 // ViewHistime: evolution in time
7573 //
7574 //======================================================================================
7575 void TEcnaHistos::XtalTimePedestals(const TString list_of_run_file_name,
7576  const Int_t& aStexStin_A, const Int_t& i0StinEcha)
7577 {XtalTimePedestals(list_of_run_file_name, aStexStin_A, i0StinEcha, "ONLYONE");}
7578 void TEcnaHistos::XtalTimePedestals(const TString list_of_run_file_name,
7579  const Int_t& aStexStin_A, const Int_t& i0StinEcha,
7580  const TString PlotOption)
7581 {
7582  Int_t StexStin_A = aStexStin_A;
7583  if( fFlagSubDet == "EE" )
7584  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
7585 
7586  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, "H_Ped_Date", PlotOption);
7587 }
7588 
7589 void TEcnaHistos::XtalPedestalsRuns(const TString list_of_run_file_name,
7590  const Int_t& aStexStin_A, const Int_t& i0StinEcha)
7591 {XtalPedestalsRuns(list_of_run_file_name, aStexStin_A, i0StinEcha, "ONLYONE");}
7592 void TEcnaHistos::XtalPedestalsRuns(const TString list_of_run_file_name,
7593  const Int_t& aStexStin_A, const Int_t& i0StinEcha,
7594  const TString PlotOption)
7595 {
7596  Int_t StexStin_A = aStexStin_A;
7597  if( fFlagSubDet == "EE" )
7598  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
7599 
7600  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, "H_Ped_RuDs", PlotOption);
7601 }
7602 
7603 
7604 //.....................................................................................
7605 void TEcnaHistos::XtalTimeTotalNoise(const TString list_of_run_file_name,
7606  const Int_t& aStexStin_A, const Int_t& i0StinEcha)
7607 {XtalTimeTotalNoise(list_of_run_file_name, aStexStin_A, i0StinEcha, "ONLYONE");}
7608 void TEcnaHistos::XtalTimeTotalNoise(const TString list_of_run_file_name,
7609  const Int_t& aStexStin_A, const Int_t& i0StinEcha,
7610  const TString PlotOption)
7611 {
7612  Int_t StexStin_A = aStexStin_A;
7613  if( fFlagSubDet == "EE" )
7614  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
7615 
7616  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, "H_TNo_Date", PlotOption);
7617 }
7618 
7619 void TEcnaHistos::XtalTotalNoiseRuns(const TString list_of_run_file_name,
7620  const Int_t& aStexStin_A, const Int_t& i0StinEcha)
7621 {XtalTotalNoiseRuns(list_of_run_file_name, aStexStin_A, i0StinEcha, "ONLYONE");}
7622 void TEcnaHistos::XtalTotalNoiseRuns(const TString list_of_run_file_name,
7623  const Int_t& aStexStin_A, const Int_t& i0StinEcha,
7624  const TString PlotOption)
7625 {
7626  Int_t StexStin_A = aStexStin_A;
7627  if( fFlagSubDet == "EE" )
7628  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
7629 
7630  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, "H_TNo_RuDs", PlotOption);
7631 }
7632 
7633 //.....................................................................................
7634 void TEcnaHistos::XtalTimeMeanOfCorss(const TString list_of_run_file_name,
7635  const Int_t& aStexStin_A, const Int_t& i0StinEcha)
7636 {XtalTimeMeanOfCorss(list_of_run_file_name, aStexStin_A, i0StinEcha, "ONLYONE");}
7637 void TEcnaHistos::XtalTimeMeanOfCorss(const TString list_of_run_file_name,
7638  const Int_t& aStexStin_A, const Int_t& i0StinEcha,
7639  const TString PlotOption)
7640 {
7641  Int_t StexStin_A = aStexStin_A;
7642  if( fFlagSubDet == "EE" )
7643  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
7644 
7645  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, "H_MCs_Date", PlotOption);
7646 }
7647 
7648 void TEcnaHistos::XtalMeanOfCorssRuns(const TString list_of_run_file_name,
7649  const Int_t& aStexStin_A, const Int_t& i0StinEcha)
7650 {XtalMeanOfCorssRuns(list_of_run_file_name, aStexStin_A, i0StinEcha, "ONLYONE");}
7651 void TEcnaHistos::XtalMeanOfCorssRuns(const TString list_of_run_file_name,
7652  const Int_t& aStexStin_A, const Int_t& i0StinEcha,
7653  const TString PlotOption)
7654 {
7655  Int_t StexStin_A = aStexStin_A;
7656  if( fFlagSubDet == "EE" )
7657  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
7658 
7659  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, "H_MCs_RuDs", PlotOption);
7660 }
7661 
7662 //.....................................................................................
7663 void TEcnaHistos::XtalTimeLowFrequencyNoise(const TString list_of_run_file_name,
7664  const Int_t& aStexStin_A, const Int_t& i0StinEcha)
7665 {XtalTimeLowFrequencyNoise(list_of_run_file_name, aStexStin_A, i0StinEcha, "ONLYONE");}
7666 void TEcnaHistos::XtalTimeLowFrequencyNoise(const TString list_of_run_file_name,
7667  const Int_t& aStexStin_A, const Int_t& i0StinEcha,
7668  const TString PlotOption)
7669 {
7670  Int_t StexStin_A = aStexStin_A;
7671  if( fFlagSubDet == "EE" )
7672  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
7673 
7674  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, "H_LFN_Date", PlotOption);
7675 }
7676 
7677 void TEcnaHistos::XtalLowFrequencyNoiseRuns(const TString list_of_run_file_name,
7678  const Int_t& aStexStin_A, const Int_t& i0StinEcha)
7679 {XtalLowFrequencyNoiseRuns(list_of_run_file_name, aStexStin_A, i0StinEcha, "ONLYONE");}
7680 void TEcnaHistos::XtalLowFrequencyNoiseRuns(const TString list_of_run_file_name,
7681  const Int_t& aStexStin_A, const Int_t& i0StinEcha,
7682  const TString PlotOption)
7683 {
7684  Int_t StexStin_A = aStexStin_A;
7685  if( fFlagSubDet == "EE" )
7686  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
7687 
7688  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, "H_LFN_RuDs", PlotOption);
7689 }
7690 
7691 
7692 //.....................................................................................
7693 void TEcnaHistos::XtalTimeHighFrequencyNoise(const TString list_of_run_file_name,
7694  const Int_t& aStexStin_A, const Int_t& i0StinEcha)
7695 {XtalTimeHighFrequencyNoise(list_of_run_file_name, aStexStin_A, i0StinEcha, "ONLYONE");}
7696 void TEcnaHistos::XtalTimeHighFrequencyNoise(const TString list_of_run_file_name,
7697  const Int_t& aStexStin_A, const Int_t& i0StinEcha,
7698  const TString PlotOption)
7699 {
7700  Int_t StexStin_A = aStexStin_A;
7701  if( fFlagSubDet == "EE" )
7702  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
7703 
7704  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, "H_HFN_Date", PlotOption);
7705 }
7706 
7707 void TEcnaHistos::XtalHighFrequencyNoiseRuns(const TString list_of_run_file_name,
7708  const Int_t& aStexStin_A, const Int_t& i0StinEcha)
7709 {XtalHighFrequencyNoiseRuns(list_of_run_file_name, aStexStin_A, i0StinEcha, "ONLYONE");}
7710 void TEcnaHistos::XtalHighFrequencyNoiseRuns(const TString list_of_run_file_name,
7711  const Int_t& aStexStin_A, const Int_t& i0StinEcha,
7712  const TString PlotOption)
7713 {
7714  Int_t StexStin_A = aStexStin_A;
7715  if( fFlagSubDet == "EE" )
7716  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
7717 
7718  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, "H_HFN_RuDs", PlotOption);
7719 }
7720 
7721 
7722 //.....................................................................................
7723 void TEcnaHistos::XtalTimeSigmaOfCorss(const TString list_of_run_file_name,
7724  const Int_t& aStexStin_A, const Int_t& i0StinEcha)
7725 {XtalTimeSigmaOfCorss(list_of_run_file_name, aStexStin_A, i0StinEcha, "ONLYONE");}
7726 void TEcnaHistos::XtalTimeSigmaOfCorss(const TString list_of_run_file_name,
7727  const Int_t& aStexStin_A, const Int_t& i0StinEcha,
7728  const TString PlotOption)
7729 {
7730  Int_t StexStin_A = aStexStin_A;
7731  if( fFlagSubDet == "EE" )
7732  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
7733 
7734  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, "H_SCs_Date", PlotOption);
7735 }
7736 
7737 void TEcnaHistos::XtalSigmaOfCorssRuns(const TString list_of_run_file_name,
7738  const Int_t& aStexStin_A, const Int_t& i0StinEcha)
7739 {XtalSigmaOfCorssRuns(list_of_run_file_name, aStexStin_A, i0StinEcha, "ONLYONE");}
7740 void TEcnaHistos::XtalSigmaOfCorssRuns(const TString list_of_run_file_name,
7741  const Int_t& aStexStin_A, const Int_t& i0StinEcha,
7742  const TString PlotOption)
7743 {
7744  Int_t StexStin_A = aStexStin_A;
7745  if( fFlagSubDet == "EE" )
7746  {StexStin_A = fEcalNumbering->Get1DeeSCEcnaFromDeeSCCons(fFapStexNumber, aStexStin_A);}
7747 
7748  ViewHistime(list_of_run_file_name, StexStin_A, i0StinEcha, "H_SCs_RuDs", PlotOption);
7749 }
7750 
7751 //======================================================================================
7752 //
7753 // ViewHistime: time evolution
7754 //
7755 //======================================================================================
7756 void TEcnaHistos::ViewHistime(const TString list_of_run_file_name,
7757  const Int_t& StexStin_A, const Int_t& i0StinEcha,
7758  const TString HistoCode, const TString opt_plot_arg)
7759 {
7760  //Histogram of the quantities as a function of time (several runs)
7761 
7762  TString opt_plot = opt_plot_arg;
7763 
7764  if( opt_plot_arg == "ONLYONE" ){opt_plot = fOnlyOnePlot;}
7765  if( opt_plot_arg == "SEVERAL" ){opt_plot = fSeveralPlot;}
7766  if( opt_plot_arg == "SAMEONE" ){opt_plot = fSameOnePlot;}
7767 
7768  Int_t OKHisto = 0;
7769 
7770  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Canvas already closed in option SAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7771  Int_t xCanvasExists = 1; // a priori ==> SAME plot // (ViewHistime)
7772  if( opt_plot != fOnlyOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
7773  {
7774  TVirtualPad* main_subpad = 0;
7775  //---------------- Call to ActivePad
7776  //if( (TRootCanvas*)fCanv<HISTOCODE>->GetCanvasImp() == fImp<HISTOCODE> ){
7777  // main_subpad = fPad<HISTOCODE>;} (return main_subpad)
7778  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
7779  if( main_subpad == 0 )
7780  {
7781  cout << "*TEcnaHistos::ViewHistime(...)> WARNING ===> Canvas has been closed in option SAME or SAME n."
7782  << endl
7783  << " Please, restart with a new canvas."
7784  << fTTBELL << endl;
7785 
7786  ReInitCanvas(HistoCode, opt_plot);
7787  xCanvasExists = 0;
7788  }
7789  }
7790  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7791 
7792  TString XVarHisto = fCnaParHistos->GetXVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
7793  TString YVarHisto = fCnaParHistos->GetYVarHisto(HistoCode.Data(), fFlagSubDet.Data(), fFapStexNumber);
7794 
7795  TString HistoType = fCnaParHistos->GetHistoType(HistoCode);
7796 
7797  //%%%%%%%%%%%%%%%%%%%%% Change of X variable in option SAME n with no proj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7798  Int_t SameXVarMemo = 1; // a priori ==> SAME n option: X variable OK (ViewHistime)
7799  if( !( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj") )
7800  {
7801 
7802 
7803  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
7804  {
7805  SetXVarMemo(HistoCode, opt_plot, XVarHisto); SetYVarMemo(HistoCode, opt_plot, YVarHisto); SameXVarMemo = 1;
7806  }
7807  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
7808  {
7809  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
7810  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
7811 
7812  if( XVarHisto != XVariableMemo )
7813  {
7814  cout << "!TEcnaHistos::ViewHistime(...)> *** ERROR *** ===> X coordinate changed in option SAME n." << endl
7815  << " Present X = " << XVarHisto << endl
7816  << " Present Y = " << YVarHisto << endl
7817  << " Previous X = " << XVariableMemo << endl
7818  << " Previous Y = " << YVariableMemo
7819  << fTTBELL << endl;
7820  SameXVarMemo = 0;
7821  }
7822  else
7823  {SetYVarMemo(HistoCode, opt_plot, YVarHisto);}
7824  }
7825  }
7826  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7827 
7828  //%%%%%%%%%%%%%%%%%%%%%%% Change of Y variable in option SAME n with proj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7829  Int_t SameYVarMemo = 1; // a priori ==> SAME n option: Y variable OK (ViewHistime)
7830  if( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj" )
7831  {
7832  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Free" )
7833  {
7834  SetYVarMemo(HistoCode, opt_plot, YVarHisto); SetYVarMemo(HistoCode, opt_plot, YVarHisto); SameYVarMemo = 1;
7835  }
7836  if( (opt_plot == fSameOnePlot ) && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
7837  {
7838  TString XVariableMemo = GetXVarFromMemo(HistoCode, opt_plot);
7839  TString YVariableMemo = GetYVarFromMemo(HistoCode, opt_plot);
7840 
7841  if( YVarHisto != YVariableMemo )
7842  {
7843  cout << "!TEcnaHistos::ViewHistime(...)> *** ERROR *** ===> Y coordinate changed in option SAME n." << endl
7844  << " Present X = " << XVarHisto << endl
7845  << " Present Y = " << YVarHisto << endl
7846  << " Previous X = " << XVariableMemo << endl
7847  << " Previous Y = " << YVariableMemo
7848  << fTTBELL << endl;
7849  SameYVarMemo = 0;
7850  }
7851  else
7852  {SetYVarMemo(HistoCode, opt_plot, YVarHisto);}
7853  }
7854  }
7855  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7856  if( xCanvasExists == 1 && SameXVarMemo == 1 && SameYVarMemo == 1 ){OKHisto = 1;}
7857 
7858  //======================== Histime accepted
7859  if( OKHisto == 1 )
7860  {
7861  // fMyRootFile->PrintNoComment();
7862 
7864 
7865  //................................. Init YMin and YMax of histo // (ViewHistime)
7866  if((opt_plot == fOnlyOnePlot) ||
7867  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
7868  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free"))
7870 
7871  //........ GetHistoryRunListParameters(...) : performs the allocation of the array fT1DRunNumber[]
7872  // at first call of the present method ViewHistime
7873  // increments the number of read file (fNbOfListFileEvolXXX) for option SAME
7874  // and read the values fT1DRunNumber[0 to max] from the file list_of_run_file_name
7875  // return the number of runs in the list of the file
7876  //............... Get the run parameters
7877 
7878  Int_t nb_of_runs_in_list = GetHistoryRunListParameters(list_of_run_file_name.Data(), HistoCode);
7879 
7880  if( nb_of_runs_in_list > 0 )
7881  {
7882  //.............................. prepa x axis: time in hours
7883  //Double_t sec_in_day = (Double_t)86400.; //===> (number of seconds in a day)
7884  Double_t margin_frame_xaxis = (Double_t)25.; //===> margin in x coordinates
7885 
7886  Double_t thstart_evol = (Double_t)0.;
7887  Double_t thstop_evol = (Double_t)0.;
7888 
7889  Int_t* exist_indic = new Int_t[nb_of_runs_in_list]; fCnew++;
7890 
7891  //===================================== FIRST LOOP BEGINNING ===================================
7892  //-------------------------------------------------------------------------------- (ViewHistime)
7893  //
7894  // FIRST LOOP: read the "HistoryRunList" file. Check the existence of the runs
7895  // and determine the number of existing runs.
7896  //
7897  //--------------------------------------------------------------------------------
7898 
7899  fNbOfExistingRuns = (Int_t)0;
7900 
7901  if( fFapStexNumber > 0 )
7902  {
7903  for(Int_t i_run = 0; i_run < nb_of_runs_in_list; i_run++)
7904  {
7905  exist_indic[i_run] = 0;
7906  // ==> set the attribute value relative to the run (fFapRunNumber)
7907  SetRunNumberFromList(i_run, nb_of_runs_in_list);
7908 
7914 
7915  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewHistime, 1rst loop)
7916  {
7917  fStatusFileFound = kTRUE;
7918 
7919  //------ At first HistoryRunList file: set fStartEvol... and fStopEvol... quantities
7920  if( GetListFileNumber(HistoCode) == 1 )
7921  {
7922  if( fNbOfExistingRuns == 0 )
7923  {
7924  // start time of the first existing run of the list
7927  fStartEvolRun = fT1DRunNumber[i_run];
7928  // start time of the last existing run of the list
7929  // (in case of only one existing run in the list)
7932  fStopEvolRun = fT1DRunNumber[i_run];
7933  }
7934  else
7935  {
7936  // start time of the last existing run of the list
7939  fStopEvolRun = fT1DRunNumber[i_run];
7940  }
7941  }
7942  //---- set flag of run existence and increase number of existing runs
7943  // (for the first HistoryRunList file)
7944  exist_indic[i_run] = 1;
7946  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
7947  else
7948  {
7949  fStatusFileFound = kFALSE;
7950 
7951  cout << "!TEcnaHistos::ViewHistime(...)> *ERROR* =====> "
7952  << " ROOT file not found for run " << fT1DRunNumber[i_run]
7953  << fTTBELL << endl << endl;
7954  }
7955  } // end of for(Int_t i_run = 0; i_run < nb_of_runs_in_list; i_run++)
7956 
7957  //===================================== FIRST LOOP END =========================== (ViewHistime)
7958  if( fNbOfExistingRuns > 0 )
7959  {
7960  //-------------------- recover the array after removing non existing ROOT files
7961  Int_t i_existing_run = (Int_t)0;
7962 
7963  for( Int_t i_run = 0; i_run < nb_of_runs_in_list; i_run++)
7964  {
7965  if( exist_indic[i_run] == 1 )
7966  {
7967  fT1DRunNumber[i_existing_run] = fT1DRunNumber[i_run];
7968  i_existing_run++;
7969  }
7970  }
7971 
7972  //---------------------- Get start and stop time values to set the axis limits (ViewHistime)
7973 
7974  thstart_evol = (Double_t)fStartEvolTime;
7975  thstop_evol = (Double_t)fStopEvolTime;
7976 
7977  Double_t xinf_lim = thstart_evol-(thstop_evol-thstart_evol)/margin_frame_xaxis;
7978  Double_t xsup_lim = thstop_evol +(thstop_evol-thstart_evol)/margin_frame_xaxis;
7979 
7980  Axis_t xinf_his = (Axis_t)(xinf_lim);
7981  Axis_t xsup_his = (Axis_t)(xsup_lim);
7982 
7983  //............................. i0StexEcha, iSample
7984  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha);
7985  Int_t iSample = 0;
7986 
7987  Double_t* time_coordx = new Double_t[fNbOfExistingRuns]; fCnew++;
7988  Double_t* hval_coordy = new Double_t[fNbOfExistingRuns]; fCnew++;
7989 
7990  //........... Set values to -1
7991 
7992  for( Int_t i_run = 0; i_run < fNbOfExistingRuns; i_run++)
7993  {
7994  time_coordx[i_run] = (Double_t)(-1);
7995  hval_coordy[i_run] = (Double_t)(-1);
7996  }
7997 
7998  //========================== SECOND LOOP BEGINNING =====================================
7999  //----------------------------------------------------------------------- (ViewHistime)
8000  //
8001  // SECOND LOOP OVER THE EXISTING RUNS : FILL THE GRAPH COORDINATES
8002  //
8003  //-----------------------------------------------------------------------
8004  for (Int_t i_run = 0; i_run < fNbOfExistingRuns; i_run++)
8005  {
8006  // => set the attribute value relative to the run (fFapRunNumber)
8007  SetRunNumberFromList(i_run, fNbOfExistingRuns);
8008 
8014 
8015  if ( fMyRootFile->LookAtRootFile() == kTRUE ) // (ViewHistime, 2nd loop)
8016  {
8017  fStatusFileFound = kTRUE;
8018 
8019  Bool_t ok_view_histo = GetOkViewHisto(fMyRootFile, StexStin_A, i0StinEcha, iSample, HistoCode);
8020 
8021  //............... F I L L G R A P H C O O R D I N A T E S (ViewHistime)
8022  if( ok_view_histo == kTRUE )
8023  {
8024  //................................................. x coordinate
8025  time_t xStartTime = fMyRootFile->GetStartTime();
8026  Double_t thstart = (Double_t)xStartTime;
8027  time_coordx[i_run] = (Double_t)(thstart - xinf_lim);
8028  //................................................. y coordinate
8029  TVectorD read_histo(fEcal->MaxCrysEcnaInStex());
8030  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++){read_histo(i)=(Double_t)0.;}
8031 
8032  if(HistoCode == "H_Ped_Date" || HistoCode == "H_Ped_RuDs")
8033  {read_histo = fMyRootFile->ReadPedestals(fEcal->MaxCrysEcnaInStex());}
8034  if(HistoCode == "H_TNo_Date" || HistoCode == "H_TNo_RuDs")
8035  {read_histo = fMyRootFile->ReadTotalNoise(fEcal->MaxCrysEcnaInStex());}
8036  if(HistoCode == "H_MCs_Date" || HistoCode == "H_MCs_RuDs")
8038 
8039  if(HistoCode == "H_LFN_Date" || HistoCode == "H_LFN_RuDs")
8041  if(HistoCode == "H_HFN_Date" || HistoCode == "H_HFN_RuDs")
8043  if(HistoCode == "H_SCs_Date" || HistoCode == "H_SCs_RuDs")
8045  hval_coordy[i_run] = (Double_t)read_histo(i0StexEcha);
8046  }
8047  else
8048  {
8049  cout << "!TEcnaHistos::ViewHistime(...)> Histo not available. "
8050  << fTTBELL << endl;
8051  }
8052  } // end of if ( fMyRootFile->LookAtRootFile() == kTRUE )
8053  else
8054  {
8055  fStatusFileFound = kFALSE;
8056  }
8057  }
8058  //========================== END OF SECOND LOOP ===========================================
8059 
8060  //.................................................................... SCALE x and y
8061  Int_t opt_scale_x = fOptScaleLinx;
8062  if (fFlagScaleX == "LIN" ){opt_scale_x = fOptScaleLinx;}
8063  if (fFlagScaleX == "LOG" ){opt_scale_x = fOptScaleLogx;}
8064 
8065  Int_t opt_scale_y = fOptScaleLiny;
8066  if (fFlagScaleY == "LIN" ){opt_scale_y = fOptScaleLiny;}
8067  if (fFlagScaleY == "LOG" ){opt_scale_y = fOptScaleLogy;}
8068 
8069  //------------------------------------------------- G R A P H (ViewHistime)
8070  TGraph* g_graph0 = new TGraph(fNbOfExistingRuns, time_coordx, hval_coordy); fCnewRoot++;
8071  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
8072  {g_graph0->SetTitle(fCnaParHistos->GetQuantityName(HistoCode));}
8073  if( opt_plot == fSameOnePlot )
8074  {g_graph0->SetTitle(";");}
8075 
8076  //... Ymin and ymax default values will be taken if fFlagUserHistoMin/Max = "OFF"
8077  // (and if "Free" for "SAME" and "SAME n" options)
8078  if((opt_plot == fOnlyOnePlot) ||
8079  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8080  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
8081  {
8082  SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
8083  SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
8084  }
8085 
8086  //................................ Put min max values (ViewHistime)
8087  //.......... default if flag not set to "ON"
8088  //SetYminMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
8089  //SetYmaxMemoFromValue(HistoCode.Data(), fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
8090 
8091  g_graph0->Set(fNbOfExistingRuns);
8092  Double_t graph_ymin =
8094  Double_t graph_ymax =
8096 
8097  //---------------------------------- G R A P H P L O T ---------------------------- (ViewHistime)
8098  if( HistoType == "Evol" )
8099  {
8100  //----------------- G R A P H Y M I N / Y M A X M A N A G E M E N T
8101  if((opt_plot == fOnlyOnePlot) ||
8102  (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8103  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
8104  {
8105  if( opt_plot == fSameOnePlot ){fHistoCodeFirst = HistoCode;} // registration of first HistoCode
8106 
8107  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
8108  //.......... user's value if flag set to "ON"
8109  if( fFlagUserHistoMin == "ON" )
8110  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
8111  if( fFlagUserHistoMax == "ON" )
8112  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
8113  //................................. automatic min and/or max
8114  if( fFlagUserHistoMin == "AUTO" )
8115  {SetYminMemoFromValue(HistoCode.Data(), graph_ymin); fFlagUserHistoMin = "OFF";}
8116  if( fFlagUserHistoMax == "AUTO" )
8117  {SetYmaxMemoFromValue(HistoCode.Data(), graph_ymax); fFlagUserHistoMax = "OFF";}
8118 
8119  //................................. Init Ymin and Ymax for graph
8120  SetYminMemoFromPreviousMemo(HistoCode);
8121  SetYmaxMemoFromPreviousMemo(HistoCode);
8122  }
8123  //--- Set ymin and ymax to the first HistoCode values for option SAME n
8124  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
8125  {
8126  Double_t ymin = GetYminValueFromMemo(fHistoCodeFirst.Data());
8127  SetYminMemoFromValue(HistoCode.Data(), ymin);
8128 
8129  Double_t ymax = GetYmaxValueFromMemo(fHistoCodeFirst.Data());
8130  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
8131  }
8132 
8133  //..... graph set ymin and ymax and consequently margin at top of the plot
8134  Int_t xFlagAutoYsupMargin = SetGraphFrameYminYmaxFromMemo(g_graph0, HistoCode);
8135 
8136  HistimePlot(g_graph0, xinf_his, xsup_his,
8137  HistoCode.Data(), HistoType.Data(),
8138  StexStin_A, i0StinEcha, iSample,
8139  opt_scale_x, opt_scale_y, opt_plot, xFlagAutoYsupMargin);
8140  // g_graph0->Delete(); fCdeleteRoot++; // *===> NE PAS DELETER LE GRAPH SINON CA EFFACE TOUT!
8141 
8142  //--- Recover ymin and ymax from user's values in option SAME n
8143  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
8144  {
8145  SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin);
8146  SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax);
8147  }
8148  }
8149 
8150  //---------- H I S T O Y P R O J E C T I O N P L O T ---------------------- (ViewHistime)
8151 
8152  //====== 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)
8153  //
8154  // must be done before booking because of the x <-> y permutation in case of "Proj"
8155  //
8156  //-----------------------------------------------------------------------------------------
8157  //
8158  // CASE: HistoType == "Proj" OR HistoType == "SampProj"
8159  //
8160  // Xinf and Xsup must be calculated from ymin and ymax
8161  // of the direct graph
8162  //
8163  //-----------------------------------------------------------------------------------------
8164 
8165  if( HistoType == "EvolProj" )
8166  {
8167  Int_t HisSizeEvolProj = fNbBinsProj;
8168  TVectorD histo_for_plot(HisSizeEvolProj);
8169  for(Int_t i=0; i<HisSizeEvolProj; i++){histo_for_plot[i]=(Double_t)0.;}
8170 
8171  //graph_ymin = GetYminValueFromMemo(HistoCode.Data());
8172  //graph_ymax = GetYmaxValueFromMemo(HistoCode.Data());
8173 
8174  TString HistoCodi = HistoCode; // HistoCodi = direct histo
8175 
8176  if( HistoCode == "H_Ped_RuDs" ){HistoCodi = "H_Ped_Date";}
8177  if( HistoCode == "H_TNo_RuDs" ){HistoCodi = "H_TNo_Date";}
8178  if( HistoCode == "H_LFN_RuDs" ){HistoCodi = "H_LFN_Date";}
8179  if( HistoCode == "H_HFN_RuDs" ){HistoCodi = "H_HFN_Date";}
8180  if( HistoCode == "H_MCs_RuDs" ){HistoCodi = "H_MCs_Date";}
8181  if( HistoCode == "H_SCs_RuDs" ){HistoCodi = "H_SCs_Date";}
8182 
8183  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
8184 
8185  //--------------------------------------------------------------------------- (ViewHistime)
8186  //
8187  // fOnlyOnePlot => compute Xinf and Xsup at each time
8188  // fSeveralPlot => compute Xinf and Xsup once when flag = "Free" for each HistoCode
8189  // fSameOnePlot => compute Xinf and Xsup once
8190  //
8191  //--------------------------------------------------------------------------------------
8192  if( (opt_plot == fOnlyOnePlot) ||
8193  ( (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, fSeveralPlot) == "Free" ) ||
8194  (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, fSameOnePlot) == "Free" ) ) )
8195  {
8196  Double_t XinfProj =(Double_t)0;
8197  Double_t XsupProj =(Double_t)0;
8198 
8199  //...................................................................... (ViewHistime)
8200  if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
8201  {
8202  //... Get direct graph ymin and/or ymax and keep them as xinf and xsup
8203  // in memo for the plotted histo
8204  XinfProj = fUserHistoMin;
8205  XsupProj = fUserHistoMax;
8206  if( fFlagUserHistoMin == "AUTO" ){XinfProj = GetYminValueFromMemo(HistoCodi.Data());}
8207  if( fFlagUserHistoMax == "AUTO" ){XsupProj = GetYmaxValueFromMemo(HistoCodi.Data());}
8208  } // end of if( fFlagUserHistoMin == "AUTO" || fFlagUserHistoMax == "AUTO" )
8209  else
8210  {
8211  if( fFlagUserHistoMin == "OFF" )
8212  {
8213  SetYminMemoFromValue(HistoCode.Data(),
8214  fCnaParHistos->GetYminDefaultValue(HistoCode.Data()));
8215  XinfProj = GetYminValueFromMemo(HistoCode.Data());
8216  }
8217 
8218  if( fFlagUserHistoMax == "OFF" )
8219  {
8220  SetYmaxMemoFromValue(HistoCode.Data(),
8221  fCnaParHistos->GetYmaxDefaultValue(HistoCode.Data()));
8222  XsupProj = GetYmaxValueFromMemo(HistoCode.Data());
8223  }
8224  if( fFlagUserHistoMin == "ON" ){XinfProj = fUserHistoMin;}
8225  if( fFlagUserHistoMax == "ON" ){XsupProj = fUserHistoMax;}
8226  }
8227 
8228  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
8229  {
8230  SetXinfMemoFromValue(HistoCode.Data(), XinfProj);
8231  SetXsupMemoFromValue(HistoCode.Data(), XsupProj);
8232  }
8233  else
8234  {
8235  SetXinfMemoFromValue(XinfProj);
8236  SetXsupMemoFromValue(XsupProj);
8237  }
8238  } // end of if( (opt_plot == fOnlyOnePlot) ||
8239  // (opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free") ||
8240  // (opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free") )
8241 
8242  Double_t cXinf = (Double_t)0.;
8243  Double_t cXsup = (Double_t)0.;
8244 
8245  //.......... Set Xinf and Xsup at each time because of simultaneous SAME options (ViewHistime)
8246  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
8247  {
8248  cXinf = GetXinfValueFromMemo(HistoCode.Data());
8249  cXsup = GetXsupValueFromMemo(HistoCode.Data());
8250  }
8251  else
8252  {
8253  cXinf = GetXinfValueFromMemo();
8254  cXsup = GetXsupValueFromMemo();
8255  }
8256  //....... In case of only one run: in order to have cXinf < cXsup for "EvolProj" plot
8257  if( cXinf >= cXsup ){cXinf -= 1.; cXsup +=1.;}
8258 
8259  //.............................. histogram booking (ViewHisto)
8260  Axis_t xinf_his = cXinf; // ancillary variables since no const in arguments of TH1D
8261  Axis_t xsup_his = cXsup;
8262 
8263  TString TitleHisto = ";";
8264  if( opt_plot != fSameOnePlot )
8265  {TitleHisto = fCnaParHistos->GetQuantityName(HistoCode.Data());}
8266 
8267  //........ fill array histo_for_plot from hval_coordy (ViewHistime)
8268  for(Int_t i_run=0; i_run<fNbOfExistingRuns; i_run++)
8269  {
8270  Double_t XFromYGraph = hval_coordy[i_run];
8271  Double_t binXProjY = (Double_t)HisSizeEvolProj*(XFromYGraph - cXinf)/(cXsup - cXinf);
8272  Int_t ibinXProjY = (Int_t)binXProjY;
8273  if( ibinXProjY >= 0 && ibinXProjY<HisSizeEvolProj ){histo_for_plot[ibinXProjY]++;}
8274  }
8275 
8276  TH1D* h_his_evol_proj = new TH1D("histevolproj", TitleHisto.Data(),
8277  HisSizeEvolProj, xinf_his, xsup_his); fCnewRoot++;
8278 
8279  h_his_evol_proj->Reset();
8280 
8281  //.... direct histogram filling (ViewHistime)
8282  for(Int_t i=0; i<HisSizeEvolProj; i++)
8283  {
8284  Double_t yi = (Double_t)i/(Double_t)HisSizeEvolProj*(cXsup-cXinf) + cXinf;
8285  Double_t his_val = (Double_t)histo_for_plot[i];
8286  h_his_evol_proj->Fill(yi, his_val);
8287  }
8288 
8289  //------- 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
8290  if( fUserHistoMin >= fUserHistoMax ){fFlagUserHistoMin = "AUTO"; fFlagUserHistoMax = "AUTO";}
8291  //.......... user's value if flag set to "ON"
8292  if( fFlagUserHistoMin == "ON" )
8293  {SetYminMemoFromValue(HistoCode.Data(), fUserHistoMin); fFlagUserHistoMin = "OFF";}
8294  if( fFlagUserHistoMax == "ON" )
8295  {SetYmaxMemoFromValue(HistoCode.Data(), fUserHistoMax); fFlagUserHistoMax = "OFF";}
8296  //................................. automatic min and/or max
8297  if( fFlagUserHistoMin == "AUTO" )
8298  {SetYminMemoFromValue(HistoCode.Data(), graph_ymin); fFlagUserHistoMin = "OFF";}
8299  if( fFlagUserHistoMax == "AUTO" )
8300  {SetYmaxMemoFromValue(HistoCode.Data(), graph_ymax); fFlagUserHistoMax = "OFF";}
8301 
8302  //................................. Init Ymin and Ymax for graph
8303  SetYminMemoFromPreviousMemo(HistoCode);
8304  SetYmaxMemoFromPreviousMemo(HistoCode);
8305 
8306  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8307  //.......... Find maximum in case of Proj (LIN scale only) // PS: EvolProj => in ViewHistime
8308  if( fFlagScaleY == "LIN" )
8309  {
8311  (HistoCode.Data(),
8313  }
8314 
8315  //--- Set ymin and ymax to the first HistoCode values for option SAME n
8316  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Busy" )
8317  {
8318  Double_t ymin = GetYminValueFromMemo(fHistoCodeFirst.Data());
8319  SetYminMemoFromValue(HistoCode.Data(), ymin);
8320 
8321  Double_t ymax = GetYmaxValueFromMemo(fHistoCodeFirst.Data());
8322  SetYmaxMemoFromValue(HistoCode.Data(), ymax);
8323  }
8324  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8325 
8326 
8327  //..... graph set ymin and ymax and consequently margin at top of the plot
8328  Int_t xFlagAutoYsupMargin = SetGraphFrameYminYmaxFromMemo(g_graph0, HistoCode);
8329 
8330  HistoPlot(h_his_evol_proj, HisSizeEvolProj,
8331  xinf_his, xsup_his,
8332  HistoCode.Data(), HistoType.Data(),
8333  StexStin_A, i0StinEcha, iSample,
8334  opt_scale_x, opt_scale_y, opt_plot, xFlagAutoYsupMargin);
8335 
8336  h_his_evol_proj->Delete(); h_his_evol_proj = 0; fCdeleteRoot++;
8337  //*===> deleter l'histo sinon "Replacing existing histo (potential memory leak)" a l'execution
8338 
8339  } // end of if( HistoType == "EvolProj" )
8340  //---------------------------------------------------------------------------------- (ViewHistime)
8341 
8342  delete [] time_coordx; time_coordx = 0; fCdelete++;
8343  delete [] hval_coordy; hval_coordy = 0; fCdelete++;
8344  }
8345  else
8346  {
8347  cout << "!TEcnaHistos::ViewHistime(...)> The list of runs in file: " << list_of_run_file_name
8348  << " has " << nb_of_runs_in_list << " run numbers" << endl
8349  << " but none of them correspond to an existing ROOT file."
8350  << fTTBELL << endl;
8351  }
8352  } // end of if( fFapStexNumber > 0 )
8353  else
8354  {
8355  cout << "!TEcnaHistos::ViewHistime(...)> *ERROR* =====> "
8356  << fFapStexName << " number = " << fFapStexNumber << ". "
8357  << fFapStexName << " number must be in range [1," << fEcal->MaxStexInStas() << "] ";
8358  if( fFlagSubDet == "EB" ){cout << " (or [-18,+18])";}
8359  cout << fTTBELL << endl;
8360  }
8361  delete [] exist_indic; exist_indic = 0; fCdelete++;
8362  } // end of if( nb_of_runs_in_list > 0 )
8363  else
8364  {
8365  if( nb_of_runs_in_list == 0 )
8366  {
8367  cout << "!TEcnaHistos::ViewHistime(...)> The list of runs in file: " << list_of_run_file_name
8368  << " is empty !" << fTTBELL << endl;
8369  }
8370  if( nb_of_runs_in_list < 0 )
8371  {
8372  cout << "!TEcnaHistos::ViewHistime(...)> " << list_of_run_file_name
8373  << ": file not found in directory: " << fCfgHistoryRunListFilePath.Data() << fTTBELL << endl;
8374  }
8375  }
8376  } // end of if( OKHisto == 1 )
8377 } // end of ViewHistime
8378 
8379 //------------------------------------------------------------------------------------
8380 //
8381 // GetHistoryRunListParameters(...), AllocArraysForEvol(), GetListFileNumber(...)
8382 //
8383 //------------------------------------------------------------------------------------
8384 
8385 Int_t TEcnaHistos::GetHistoryRunListParameters(const TString list_of_run_file_name, const TString HistoCode)
8386 {
8387  // Build the array of run numbers from the list-of-runs .ascii file.
8388  // Return the list size
8389  // *=====> list_of_run_file_name is the name of the ASCII file containing the list of the runs
8390  //
8391  // SYNTAX OF THE FILE:
8392  //
8393  // HistoryRunList_EB_SM6_Analysis_1.ascii <- 1rst line: comment (file name for example)
8394  // 73677 <- 2nd line and others: run numbers (empty lines accepted)
8395  // 73688
8396  // 73689
8397  //
8398  // 73690
8399  // 73692
8400  //
8401  // In option SAME (of TEcnaHistos), several lists of runs can be called and these lists can have
8402  // DIFFERENT sizes (here the "size" is the number of runs of the list). In addition,
8403  // some runs in some lists may not exist in reality. So, we must adopt a convention which is
8404  // the following: the number of runs corresponds to the number of EXISTING runs
8405  // of the FIRST read list. Let be N1 this number.
8406  // If another list has more runs than N1 runs, we read only the first N1 runs.
8407  // If another list has less runs than N1 runs, we read all the runs of this list.
8408  //
8409  //--------------------------------------------------------------------------------------------------
8410 
8411  Int_t nb_of_runs_in_list = 0;
8412 
8413  //========= immediate return if file name is an empty string
8414  if( list_of_run_file_name.Data() == '\0' )
8415  {
8416  cout << "!TEcnaHistos::GetHistoryRunListParameters(...)> *** ERROR *** =====> "
8417  << " EMPTY STRING for list of run file name." << fTTBELL << endl;
8418  }
8419  else
8420  {
8421  // ===> increase the HistoryRunList file number
8422  if ( HistoCode == "H_Ped_Date" ){fNbOfListFileH_Ped_Date++;}
8423  if ( HistoCode == "H_TNo_Date" ){fNbOfListFileH_TNo_Date++;}
8424  if ( HistoCode == "H_MCs_Date" ){fNbOfListFileH_MCs_Date++;}
8425  if ( HistoCode == "H_LFN_Date" ){fNbOfListFileH_LFN_Date++;}
8426  if ( HistoCode == "H_HFN_Date" ){fNbOfListFileH_HFN_Date++;}
8427  if ( HistoCode == "H_SCs_Date" ){fNbOfListFileH_SCs_Date++;}
8428 
8429  if ( HistoCode == "H_Ped_RuDs" ){fNbOfListFileH_Ped_RuDs++;}
8430  if ( HistoCode == "H_TNo_RuDs" ){fNbOfListFileH_TNo_RuDs++;}
8431  if ( HistoCode == "H_MCs_RuDs" ){fNbOfListFileH_MCs_RuDs++;}
8432  if ( HistoCode == "H_LFN_RuDs" ){fNbOfListFileH_LFN_RuDs++;}
8433  if ( HistoCode == "H_HFN_RuDs" ){fNbOfListFileH_HFN_RuDs++;}
8434  if ( HistoCode == "H_SCs_RuDs" ){fNbOfListFileH_SCs_RuDs++;}
8435 
8436  fFapFileRuns = list_of_run_file_name.Data(); // (short name)
8437 
8438  //........... Add the path to the file name ( GetHistoryRunListParameters )
8439  TString xFileNameRunList = list_of_run_file_name.Data();
8440  const Text_t *t_file_name = (const Text_t *)xFileNameRunList.Data();
8441 
8442  //.............. replace the string "$HOME" by the true $HOME path
8443  if(fCfgHistoryRunListFilePath.BeginsWith("$HOME"))
8444  {
8445  fCfgHistoryRunListFilePath.Remove(0,5);
8446  const Text_t *t_file_nohome = (const Text_t *)fCfgHistoryRunListFilePath.Data(); // /scratch0/cna/...
8447 
8448  TString home_path = gSystem->Getenv("HOME");
8449  fCfgHistoryRunListFilePath = home_path; // /afs/cern.ch/u/USER
8450  fCfgHistoryRunListFilePath.Append(t_file_nohome); // /afs/cern.ch/u/USER/scratch0/cna/...
8451  }
8452 
8453  xFileNameRunList = fCfgHistoryRunListFilePath.Data();
8454 
8455  xFileNameRunList.Append('/');
8456  xFileNameRunList.Append(t_file_name);
8457 
8458  fFcin_f.open(xFileNameRunList.Data());
8459 
8460  //....................................... ( GetHistoryRunListParameters )
8461  if( fFcin_f.fail() == kFALSE )
8462  {
8463  //...................................... first reading to get the number of runs in the list
8464  fFcin_f.clear();
8465  string xHeadComment;
8466  fFcin_f >> xHeadComment;
8467  Int_t cRunNumber;
8468  Int_t list_size_read = 0;
8469 
8470  while( !fFcin_f.eof() ){fFcin_f >> cRunNumber; list_size_read++;}
8471  fFapNbOfRuns = list_size_read - 1;
8472 
8473  //...................................... second reading to get the run numbers
8474 
8475  //====== Return to the beginning of the file =====
8476  fFcin_f.clear();
8477  fFcin_f.seekg(0, ios::beg);
8478  //================================================
8479 
8480  string yHeadComment;
8481  fFcin_f >> yHeadComment;
8482 
8483  //....................... Set fFapMaxNbOfRuns to -1 at first call (first read file)
8484  //
8485  // fNbOfListFileEvolXXX is initialized to 0 in Init()
8486  // It is incremented once here above
8487  // So, at first call fNbOfListFileEvolXXX = 1
8488  // then fFapMaxNbOfRuns = -1
8489  //.......................................................................... (GetHistoryRunListParameters)
8490  if( (HistoCode == "H_Ped_Date" && fNbOfListFileH_Ped_Date == 1) ||
8491  (HistoCode == "H_TNo_Date" && fNbOfListFileH_TNo_Date == 1) ||
8492  (HistoCode == "H_MCs_Date" && fNbOfListFileH_MCs_Date == 1) ||
8493  (HistoCode == "H_LFN_Date" && fNbOfListFileH_LFN_Date == 1) ||
8494  (HistoCode == "H_HFN_Date" && fNbOfListFileH_HFN_Date == 1) ||
8495  (HistoCode == "H_SCs_Date" && fNbOfListFileH_SCs_Date == 1) ||
8496  (HistoCode == "H_Ped_RuDs" && fNbOfListFileH_Ped_RuDs == 1) ||
8497  (HistoCode == "H_TNo_RuDs" && fNbOfListFileH_TNo_RuDs == 1) ||
8498  (HistoCode == "H_MCs_RuDs" && fNbOfListFileH_MCs_RuDs == 1) ||
8499  (HistoCode == "H_LFN_RuDs" && fNbOfListFileH_LFN_RuDs == 1) ||
8500  (HistoCode == "H_HFN_RuDs" && fNbOfListFileH_HFN_RuDs == 1) ||
8501  (HistoCode == "H_SCs_RuDs" && fNbOfListFileH_SCs_RuDs == 1)){fFapMaxNbOfRuns = -1;}
8502 
8503  // first call: fFapMaxNbOfRuns = fFapNbOfRuns = nb of run from the first reading
8505  // next calls: fFapNbOfRuns must not be greater than fFapMaxNbOfRuns found at first time
8507 
8508  // Allocation and initialization of the array fT1DRunNumber[].
8509  //................. check maximum value for allocation
8511  {
8512  cout << "TEcnaHistos::GetHistoryRunListParameters(...)> Max number of runs in HistoryRunList = "
8513  << fFapMaxNbOfRuns
8514  << " too large, forced to parameter TEcnaParHistos->fMaxNbOfRunsInLists value (= "
8516  << "). Please, set this parameter to a larger value than " << fFapMaxNbOfRuns
8517  << fTTBELL << endl;
8519  }
8520  //................................. Alloc of the array and init
8521  if( fT1DRunNumber == 0 )
8522  {
8523  if( fFapMaxNbOfRuns > 0 )
8524  {
8525  fT1DRunNumber = new Int_t[fFapMaxNbOfRuns]; fCnew++;
8526  }
8527  else
8528  {
8529  cout << "!TEcnaHistos::GetHistoryRunListParameters(...)> *** ERROR *** =====> fFapMaxNbOfRuns = "
8530  << fFapMaxNbOfRuns << ". Forced to 1." << fTTBELL << endl;
8531  fFapMaxNbOfRuns = 1;
8532  fT1DRunNumber = new Int_t[fFapMaxNbOfRuns]; fCnew++;
8533  }
8534  }
8535 
8536 
8537  //.................................... Init the list of runs
8538  for ( Int_t i_run = 0; i_run < fFapMaxNbOfRuns; i_run++ ){fT1DRunNumber[i_run] = -1;}
8539  //.................................... read the list of runs
8540  for (Int_t i_list = 0; i_list < fFapNbOfRuns; i_list++)
8541  {
8542  fFcin_f >> cRunNumber;
8543  fT1DRunNumber[i_list] = cRunNumber;
8544  }
8545  //........................................ ( GetHistoryRunListParameters )
8546  nb_of_runs_in_list = fFapNbOfRuns;
8547  fFcin_f.close();
8548  }
8549  else
8550  {
8551  fFcin_f.clear();
8552  cout << "!TEcnaHistos::GetHistoryRunListParameters(...)> *** ERROR *** =====> "
8553  << xFileNameRunList.Data() << " : file not found." << fTTBELL << endl;
8554  nb_of_runs_in_list = -1;
8555  }
8556  }
8557  return nb_of_runs_in_list;
8558 }
8559 // end of GetHistoryRunListParameters(...)
8560 
8561 //------------------------------------------------------------------------------------------------
8562 
8563 Int_t TEcnaHistos::GetListFileNumber(const TString HistoCode)
8564 {
8565 // Get the number of the read list file
8566 
8567  Int_t number = 0;
8568 
8569  if ( HistoCode == "H_Ped_Date"){number = fNbOfListFileH_Ped_Date;}
8570  if ( HistoCode == "H_TNo_Date"){number = fNbOfListFileH_TNo_Date;}
8571  if ( HistoCode == "H_MCs_Date"){number = fNbOfListFileH_MCs_Date;}
8572  if ( HistoCode == "H_LFN_Date"){number = fNbOfListFileH_LFN_Date;}
8573  if ( HistoCode == "H_HFN_Date"){number = fNbOfListFileH_HFN_Date;}
8574  if ( HistoCode == "H_SCs_Date"){number = fNbOfListFileH_SCs_Date;}
8575  if ( HistoCode == "H_Ped_RuDs"){number = fNbOfListFileH_Ped_RuDs;}
8576  if ( HistoCode == "H_TNo_RuDs"){number = fNbOfListFileH_TNo_RuDs;}
8577  if ( HistoCode == "H_MCs_RuDs"){number = fNbOfListFileH_MCs_RuDs;}
8578  if ( HistoCode == "H_LFN_RuDs"){number = fNbOfListFileH_LFN_RuDs;}
8579  if ( HistoCode == "H_HFN_RuDs"){number = fNbOfListFileH_HFN_RuDs;}
8580  if ( HistoCode == "H_SCs_RuDs"){number = fNbOfListFileH_SCs_RuDs;}
8581  return number;
8582 }
8583 
8584 //--------------------------------------------------------------------------------------------
8585 //
8586 // FileParameters(s)(...)
8587 //
8588 //--------------------------------------------------------------------------------------------
8589 
8590 //===> DON'T SUPPRESS: THIS METHOD IS CALLED BY TEcnaGui and can be called by any other program
8591 void TEcnaHistos::FileParameters(const TString xArgAnaType, const Int_t& xArgNbOfSamples,
8592  const Int_t& xArgRunNumber, const Int_t& xArgFirstReqEvtNumber,
8593  const Int_t& xArgLastReqEvtNumber, const Int_t& xArgReqNbOfEvts,
8594  const Int_t& xArgStexNumber)
8595 {
8596 // Set parameters for reading the right CNA results file
8597 
8598  fFapAnaType = xArgAnaType;
8599  fFapNbOfSamples = xArgNbOfSamples;
8600  fFapRunNumber = xArgRunNumber;
8601  fFapFirstReqEvtNumber = xArgFirstReqEvtNumber;
8602  fFapLastReqEvtNumber = xArgLastReqEvtNumber;
8603  fFapReqNbOfEvts = xArgReqNbOfEvts;
8604  fFapStexNumber = xArgStexNumber;
8605 
8607 }
8608 
8609 //--------------------------------------------------------------------------------------------------
8610 void TEcnaHistos::SetRunNumberFromList(const Int_t& xArgIndexRun, const Int_t& MaxNbOfRuns)
8611 {
8612  // Set run number for the xArgIndexRun_th run in the list of runs (evolution plots)
8613  // The array fT1DRunNumber[] have been obtained from a previous call
8614  // to GetHistoryRunListParameters(xFileNameRunList, HistoCode)
8615 
8616  if( xArgIndexRun >= 0 && xArgIndexRun < MaxNbOfRuns)
8617  {
8618  fFapRunNumber = fT1DRunNumber[xArgIndexRun];
8619  if( xArgIndexRun == 0 ){InitSpecParBeforeFileReading();}
8620  }
8621  else
8622  {
8623  cout << "!TEcnaHistos::SetRunNumberFromList(...)> **** ERROR **** Run index out of range in list of runs. xArgIndexRun = "
8624  << xArgIndexRun << " (MaxNbOfRuns = "<< MaxNbOfRuns << ")" << endl;
8625  }
8626 }
8627 
8628 //--------------------------------------------------------------------------------------------------
8630 {
8631  // Init parameters that will be set by reading the info which are in the results ROOT file
8632  Int_t MaxCar = fgMaxCar;
8633  fStartDate.Resize(MaxCar);
8634  fStartDate = "(date not found)";
8635 
8636  MaxCar = fgMaxCar;
8637  fStopDate.Resize(MaxCar);
8638  fStopDate = "(date not found)";
8639 
8640  fStartTime = (time_t)0;
8641  fStopTime = (time_t)0;
8642 
8643  fRunType = "run type not found";
8644 
8645 } // ------------- ( end of InitSpecParBeforeFileReading() ) -------------
8646 
8647 Int_t TEcnaHistos::GetNumberOfEvents(TEcnaRead* xMyRootFile, const Int_t& xFapNbOfReqEvts)
8648 {
8649  //...... Calculate the number of found events (file existence already tested in calling method)
8650  Int_t xFapNbOfEvts = 0;
8651 
8652  TVectorD NOFE_histp(fEcal->MaxCrysEcnaInStex());
8653  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++){NOFE_histp(i)=(Double_t)0.;}
8654  NOFE_histp = xMyRootFile->ReadNumberOfEvents(fEcal->MaxCrysEcnaInStex());
8655 
8656  //... Call to fCnaWrite->NumberOfEvents(...) 1rst argument must be Int_t, not TVectorD,
8657  // duplicate NOFE_histp to NOFE_int to obtain fFapNbOfEvts from fCnaWrite->NumberOfEvents(...)
8658  Int_t* NOFE_int = new Int_t[fEcal->MaxCrysEcnaInStex()]; fCnew++;
8659  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++){NOFE_int[i]=(Int_t)NOFE_histp(i);}
8660 
8661  xFapNbOfEvts = fCnaWrite->NumberOfEvents(NOFE_int, fEcal->MaxCrysEcnaInStex(), xFapNbOfReqEvts);
8662 
8663  delete [] NOFE_int; NOFE_int = 0; fCdelete++;
8664 
8665  return xFapNbOfEvts;
8666 }
8667 
8668 //======================================================================================
8669 //
8670 // 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
8671 //
8672 //======================================================================================
8673 
8675  const Int_t& StexStin_A, const Int_t& i0StinEcha, const Int_t& iSample,
8676  const TString HistoCode)
8677 {
8678 // Check possibility to plot the histo
8679 
8680  Bool_t ok_view_histo = kFALSE;
8681 
8682  TString HistoType = fCnaParHistos->GetHistoType(HistoCode);
8683 
8684  TString root_file_name = aMyRootFile->GetRootFileNameShort();
8685 
8686  TVectorD vStin(fEcal->MaxStinEcnaInStex());
8687  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex() ; i++){vStin(i)=(Double_t)0.;}
8688  vStin = aMyRootFile->ReadStinNumbers(fEcal->MaxStinEcnaInStex());
8689 
8690  if( aMyRootFile->DataExist() == kTRUE )
8691  {
8692  fStatusDataExist = kTRUE;
8693 
8694  Int_t Stin_ok = 0;
8695  for (Int_t index_Stin = 0; index_Stin < fEcal->MaxStinEcnaInStex(); index_Stin++)
8696  {
8697  if ( vStin(index_Stin) == StexStin_A ){Stin_ok++;};
8698  }
8699 
8700  //.............................................. ok_view
8701  Int_t ok_view = 1;
8702 
8703  if( !( HistoType == "Global" || HistoType == "Proj" ) )
8704  {
8705  if( Stin_ok != 1)
8706  {
8707  Int_t StinNumber = StexStin_A;
8708  if( fFlagSubDet == "EE" )
8709  {StinNumber = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A);}
8710  cout << "!TEcnaHistos::GetOkViewHisto(...)> *ERROR* =====> " << "File: " << root_file_name
8711  << ", " << fFapStinName.Data() << " "
8712  << StinNumber
8713  << " not found. Available numbers = ";
8714  for(Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++)
8715  {
8716  if( vStin(i) > 0 )
8717  {
8718  if( fFlagSubDet == "EB" ){cout << vStin(i) << ", ";}
8719  if( fFlagSubDet == "EE" )
8720  {cout << fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, (Int_t)vStin(i)) << ", ";}
8721  }
8722  }
8723  cout << fTTBELL << endl;
8724  ok_view = -1;
8725  }
8726  else
8727  {
8728  ok_view = 1;
8729  }
8730  }
8731 
8732  //.............................................. ok_max_elt ( GetOkViewHisto(...) )
8733  Int_t ok_max_elt = 1;
8734 
8735  if( ( ( (HistoType == "H1Basic") || (HistoType == "Evol") || (HistoType == "EvolProj") )
8736  && (i0StinEcha >= 0) && (i0StinEcha<fEcal->MaxCrysInStin())
8737  && (iSample >= 0) && (iSample <fFapNbOfSamples ) ) ||
8738  !( (HistoType == "H1Basic") || (HistoType == "Evol") || (HistoType == "EvolProj") ))
8739  {ok_max_elt = 1;}
8740  else
8741  {
8742  Int_t Choffset = 0;
8743  if( fFlagSubDet == "EE" ){Choffset = 1;}
8744  if( ( (HistoType == "H1Basic") || (HistoType == "Evol") || (HistoType == "EvolProj") )
8745  && !( (i0StinEcha >= 0) && (i0StinEcha<fEcal->MaxCrysInStin()) ) )
8746  {cout << "!TEcnaHistos::GetOkViewHisto(...)> *ERROR* =====> " << "File: " << root_file_name
8747  << ". Wrong channel number. Value = " << i0StinEcha << " (required range: [" << Choffset << ", "
8748  << fEcal->MaxCrysInStin()-1+Choffset << "] )"
8749  << fTTBELL << endl;}
8750  if( (HistoCode == "D_Adc_EvDs" || HistoCode == "D_Adc_EvNb") &&
8751  !((iSample >= 0) && (iSample <fFapNbOfSamples)) )
8752  {cout << "!TEcnaHistos::GetOkViewHisto(...)> *ERROR* =====> " << "File: " << root_file_name
8753  << ". Wrong sample index. Value = " << iSample << " (required range: [0, "
8754  << fFapNbOfSamples-1 << "] )"
8755  << fTTBELL << endl;}
8756  ok_max_elt = -1;
8757  }
8758 
8759  if( (ok_view == 1) && (ok_max_elt == 1) )
8760  {
8761  ok_view_histo = kTRUE;
8762  }
8763  else
8764  {
8765  cout << "!TEcnaHistos::GetOkViewHisto(...)> At least one ERROR has been detected. ok_view = " << ok_view
8766  << ", ok_max_elt = " << ok_max_elt << fTTBELL << endl;
8767  }
8768  }
8769  else
8770  {
8771  fStatusDataExist = kFALSE;
8772 
8773  cout << "!TEcnaHistos::GetOkViewHisto(...)> No data in ROOT file "
8774  << ", aMyRootFile->DataExist() = " << aMyRootFile->DataExist() << fTTBELL << endl;
8775  }
8776  return ok_view_histo;
8777 }
8778 //..............................................................................................
8779 
8780 Int_t TEcnaHistos::SetHistoFrameYminYmaxFromMemo(TH1D* h_his0, const TString HistoCode)
8781 {
8782 // Set min and max according to HistoCode
8783 
8784  // if Ymin = Ymax (or Ymin > Ymax): nothing done here
8785  // return xFlagAutoYsupMargin = 1
8786  //
8787  // if Ymin < Ymax: min and max calculated by h_his0->SetMinimum() and h_his0->SetMaximum()
8788  // return xFlagAutoYsupMargin = 0
8789 
8790  Int_t xFlagAutoYsupMargin = 1; // (SetHistoFrameYminYmaxFromMemo)
8791 
8792  if(HistoCode == "D_NOE_ChNb"){
8793  if(fD_NOE_ChNbYmin < fD_NOE_ChNbYmax){xFlagAutoYsupMargin = 0;
8794  h_his0->SetMinimum(fD_NOE_ChNbYmin); h_his0->SetMaximum(fD_NOE_ChNbYmax);}}
8795 
8796  if(HistoCode == "D_NOE_ChDs"){
8797  if(fD_NOE_ChDsYmin < fD_NOE_ChDsYmax){xFlagAutoYsupMargin = 0;
8798  h_his0->SetMinimum(fD_NOE_ChDsYmin); h_his0->SetMaximum(fD_NOE_ChDsYmax);}}
8799 
8800  if(HistoCode == "D_Ped_ChNb"){
8801  if(fD_Ped_ChNbYmin < fD_Ped_ChNbYmax){xFlagAutoYsupMargin = 0;
8802  h_his0->SetMinimum(fD_Ped_ChNbYmin); h_his0->SetMaximum(fD_Ped_ChNbYmax);}}
8803 
8804  if(HistoCode == "D_Ped_ChDs"){
8805  if(fD_Ped_ChDsYmin < fD_Ped_ChDsYmax){xFlagAutoYsupMargin = 0;
8806  h_his0->SetMinimum(fD_Ped_ChDsYmin); h_his0->SetMaximum(fD_Ped_ChDsYmax);}}
8807 
8808  if(HistoCode == "D_TNo_ChNb"){
8809  if(fD_TNo_ChNbYmin < fD_TNo_ChNbYmax){xFlagAutoYsupMargin = 0;
8810  h_his0->SetMinimum(fD_TNo_ChNbYmin); h_his0->SetMaximum(fD_TNo_ChNbYmax);}}
8811 
8812  if(HistoCode == "D_TNo_ChDs"){
8813  if(fD_TNo_ChDsYmin < fD_TNo_ChDsYmax){xFlagAutoYsupMargin = 0;
8814  h_his0->SetMinimum(fD_TNo_ChDsYmin); h_his0->SetMaximum(fD_TNo_ChDsYmax);}}
8815 
8816  if(HistoCode == "D_MCs_ChNb"){
8817  if(fD_MCs_ChNbYmin < fD_MCs_ChNbYmax){xFlagAutoYsupMargin = 0;
8818  h_his0->SetMinimum(fD_MCs_ChNbYmin); h_his0->SetMaximum(fD_MCs_ChNbYmax);}}
8819 
8820  if(HistoCode == "D_MCs_ChDs"){
8821  if(fD_MCs_ChDsYmin < fD_MCs_ChDsYmax){xFlagAutoYsupMargin = 0;
8822  h_his0->SetMinimum(fD_MCs_ChDsYmin); h_his0->SetMaximum(fD_MCs_ChDsYmax);}}
8823 
8824  if(HistoCode == "D_LFN_ChNb"){
8825  if(fD_LFN_ChNbYmin < fD_LFN_ChNbYmax){xFlagAutoYsupMargin = 0;
8826  h_his0->SetMinimum(fD_LFN_ChNbYmin); h_his0->SetMaximum(fD_LFN_ChNbYmax);}}
8827 
8828  if(HistoCode == "D_LFN_ChDs"){
8829  if(fD_LFN_ChDsYmin < fD_LFN_ChDsYmax){xFlagAutoYsupMargin = 0;
8830  h_his0->SetMinimum(fD_LFN_ChDsYmin); h_his0->SetMaximum(fD_LFN_ChDsYmax);}}
8831 
8832  if(HistoCode == "D_HFN_ChNb"){
8833  if(fD_HFN_ChNbYmin < fD_HFN_ChNbYmax){xFlagAutoYsupMargin = 0;
8834  h_his0->SetMinimum(fD_HFN_ChNbYmin); h_his0->SetMaximum(fD_HFN_ChNbYmax);}}
8835 
8836  if(HistoCode == "D_HFN_ChDs"){
8837  if(fD_HFN_ChDsYmin < fD_HFN_ChDsYmax){xFlagAutoYsupMargin = 0;
8838  h_his0->SetMinimum(fD_HFN_ChDsYmin); h_his0->SetMaximum(fD_HFN_ChDsYmax);}}
8839 
8840  if(HistoCode == "D_SCs_ChNb"){
8841  if(fD_SCs_ChNbYmin < fD_SCs_ChNbYmax){xFlagAutoYsupMargin = 0;
8842  h_his0->SetMinimum(fD_SCs_ChNbYmin); h_his0->SetMaximum(fD_SCs_ChNbYmax);}}
8843 
8844  if(HistoCode == "D_SCs_ChDs"){
8845  if(fD_SCs_ChDsYmin < fD_SCs_ChDsYmax){xFlagAutoYsupMargin = 0;
8846  h_his0->SetMinimum(fD_SCs_ChDsYmin); h_his0->SetMaximum(fD_SCs_ChDsYmax);}}
8847 
8848  if(HistoCode == "D_MSp_Samp"){
8849  if(fD_MSp_SampYmin < fD_MSp_SampYmax){xFlagAutoYsupMargin = 0;
8850  h_his0->SetMinimum(fD_MSp_SampYmin); h_his0->SetMaximum(fD_MSp_SampYmax);}}
8851 
8852  if(HistoCode == "D_SSp_Samp"){
8853  if(fD_SSp_SampYmin < fD_SSp_SampYmax){xFlagAutoYsupMargin = 0;
8854  h_his0->SetMinimum(fD_SSp_SampYmin); h_his0->SetMaximum(fD_SSp_SampYmax);}}
8855 
8856  if(HistoCode == "D_Adc_EvNb"){
8857  if(fD_Adc_EvNbYmin < fD_Adc_EvNbYmax){xFlagAutoYsupMargin = 0;
8858  h_his0->SetMinimum(fD_Adc_EvNbYmin); h_his0->SetMaximum(fD_Adc_EvNbYmax);}}
8859 
8860  if(HistoCode == "D_Adc_EvDs"){
8861  if(fD_Adc_EvDsYmin < fD_Adc_EvDsYmax){xFlagAutoYsupMargin = 0;
8862  h_his0->SetMinimum(fD_Adc_EvDsYmin); h_his0->SetMaximum(fD_Adc_EvDsYmax);}}
8863 
8864  if(HistoCode == "H2CorccInStins"){
8865  if(fH2CorccInStinsYmin < fH2CorccInStinsYmax){xFlagAutoYsupMargin = 0;
8866  h_his0->SetMinimum(fH2CorccInStinsYmin); h_his0->SetMaximum(fH2CorccInStinsYmax);}}
8867 
8868  if(HistoCode == "H2LFccMosMatrix"){
8869  if(fH2LFccMosMatrixYmin < fH2LFccMosMatrixYmax){xFlagAutoYsupMargin = 0;
8870  h_his0->SetMinimum(fH2LFccMosMatrixYmin); h_his0->SetMaximum(fH2LFccMosMatrixYmax);}}
8871 
8872  if(HistoCode == "H2HFccMosMatrix"){
8873  if(fH2HFccMosMatrixYmin < fH2HFccMosMatrixYmax){xFlagAutoYsupMargin = 0;
8874  h_his0->SetMinimum(fH2HFccMosMatrixYmin); h_his0->SetMaximum(fH2HFccMosMatrixYmax);}}
8875 
8876  if(HistoCode == "H_Ped_RuDs"){
8877  if(fH_Ped_RuDsYmin < fH_Ped_RuDsYmax){xFlagAutoYsupMargin = 0;
8878  h_his0->SetMinimum(fH_Ped_RuDsYmin); h_his0->SetMaximum(fH_Ped_RuDsYmax);}}
8879 
8880  if(HistoCode == "H_TNo_RuDs"){
8881  if(fH_TNo_RuDsYmin < fH_TNo_RuDsYmax){xFlagAutoYsupMargin = 0;
8882  h_his0->SetMinimum(fH_TNo_RuDsYmin); h_his0->SetMaximum(fH_TNo_RuDsYmax);}}
8883 
8884  if(HistoCode == "H_MCs_RuDs"){
8885  if(fH_MCs_RuDsYmin < fH_MCs_RuDsYmax){xFlagAutoYsupMargin = 0;
8886  h_his0->SetMinimum(fH_MCs_RuDsYmin); h_his0->SetMaximum(fH_MCs_RuDsYmax);}}
8887 
8888  if(HistoCode == "H_LFN_RuDs"){
8889  if(fH_LFN_RuDsYmin < fH_LFN_RuDsYmax){xFlagAutoYsupMargin = 0;
8890  h_his0->SetMinimum(fH_LFN_RuDsYmin); h_his0->SetMaximum(fH_LFN_RuDsYmax);}}
8891 
8892  if(HistoCode == "H_HFN_RuDs"){
8893  if(fH_HFN_RuDsYmin < fH_HFN_RuDsYmax){xFlagAutoYsupMargin = 0;
8894  h_his0->SetMinimum(fH_HFN_RuDsYmin); h_his0->SetMaximum(fH_HFN_RuDsYmax);}}
8895 
8896  if(HistoCode == "H_SCs_RuDs"){
8897  if(fH_SCs_RuDsYmin < fH_SCs_RuDsYmax){xFlagAutoYsupMargin = 0;
8898  h_his0->SetMinimum(fH_SCs_RuDsYmin); h_his0->SetMaximum(fH_SCs_RuDsYmax);}}
8899 
8900  return xFlagAutoYsupMargin;
8901 } // end of SetHistoFrameYminYmaxFromMemo
8902 
8903 Int_t TEcnaHistos::SetGraphFrameYminYmaxFromMemo(TGraph* g_graph0, const TString HistoCode)
8904 {
8905 // Set min and max according to HistoCode
8906 
8907  Int_t xFlagAutoYsupMargin = 1; // DEFAULT: 1 = min and max calulated by ROOT, 0 = by this code
8908 
8909  if(HistoCode == "H_Ped_Date"){
8910  if(fH_Ped_DateYmin < fH_Ped_DateYmax){xFlagAutoYsupMargin = 0;
8911  g_graph0->SetMinimum(fH_Ped_DateYmin); g_graph0->SetMaximum(fH_Ped_DateYmax);}}
8912 
8913  if(HistoCode == "H_TNo_Date"){
8914  if(fH_TNo_DateYmin < fH_TNo_DateYmax){xFlagAutoYsupMargin = 0;
8915  g_graph0->SetMinimum(fH_TNo_DateYmin); g_graph0->SetMaximum(fH_TNo_DateYmax);}}
8916 
8917  if(HistoCode == "H_MCs_Date"){
8918  if(fH_MCs_DateYmin < fH_MCs_DateYmax){xFlagAutoYsupMargin = 0;
8919  g_graph0->SetMinimum(fH_MCs_DateYmin); g_graph0->SetMaximum(fH_MCs_DateYmax);}}
8920 
8921  if(HistoCode == "H_LFN_Date"){
8922  if(fH_LFN_DateYmin < fH_LFN_DateYmax){xFlagAutoYsupMargin = 0;
8923  g_graph0->SetMinimum(fH_LFN_DateYmin); g_graph0->SetMaximum(fH_LFN_DateYmax);}}
8924 
8925  if(HistoCode == "H_HFN_Date"){
8926  if(fH_HFN_DateYmin < fH_HFN_DateYmax){xFlagAutoYsupMargin = 0;
8927  g_graph0->SetMinimum(fH_HFN_DateYmin); g_graph0->SetMaximum(fH_HFN_DateYmax);}}
8928 
8929  if(HistoCode == "H_SCs_Date"){
8930  if(fH_SCs_DateYmin < fH_SCs_DateYmax){xFlagAutoYsupMargin = 0;
8931  g_graph0->SetMinimum(fH_SCs_DateYmin); g_graph0->SetMaximum(fH_SCs_DateYmax);}}
8932 
8933  return xFlagAutoYsupMargin;
8934 } // end of SetGraphFrameYminYmaxFromMemo
8935 
8936 //..............................................................................................
8937 Double_t TEcnaHistos::GetYminFromHistoFrameAndMarginValue(TH1D* h_his0, const Double_t margin_factor)
8938 {
8939 //Calculation for automatic minimum with margin
8940  Double_t minproj = h_his0->GetMinimum();
8941  Double_t maxproj = h_his0->GetMaximum();
8942  minproj = minproj - (maxproj-minproj)*margin_factor;
8943  return minproj;
8944 }
8945 
8946 Double_t TEcnaHistos::GetYmaxFromHistoFrameAndMarginValue(TH1D* h_his0, const Double_t margin_factor)
8947 {
8948 //Calculation for automatic maximum with margin
8949  Double_t minproj = h_his0->GetMinimum();
8950  Double_t maxproj = h_his0->GetMaximum();
8951  maxproj = maxproj + (maxproj-minproj)*margin_factor;
8952  return maxproj;
8953 }
8954 
8955 Double_t TEcnaHistos::GetYminFromGraphFrameAndMarginValue(TGraph* g_graph0, const Double_t margin_factor)
8956 {
8957 //Calculation for automatic minimum with margin
8958  Double_t graph_ymin = g_graph0->GetY()[0];
8959  for(Int_t i=1; i<g_graph0->GetN(); i++)
8960  {if( g_graph0->GetY()[i] < graph_ymin ){graph_ymin = g_graph0->GetY()[i];}}
8961 
8962  Double_t graph_ymax = g_graph0->GetY()[0];
8963  for(Int_t i=1; i<g_graph0->GetN(); i++)
8964  {if( g_graph0->GetY()[i] > graph_ymax ){graph_ymax = g_graph0->GetY()[i];}}
8965 
8966  graph_ymin = graph_ymin - (graph_ymax-graph_ymin)*margin_factor;
8967  return graph_ymin;
8968 }
8969 Double_t TEcnaHistos::GetYmaxFromGraphFrameAndMarginValue(TGraph* g_graph0, const Double_t margin_factor)
8970 {
8971 //Calculation for automatic maximum with margin
8972  Double_t graph_ymin = g_graph0->GetY()[0];
8973  for(Int_t i=1; i<g_graph0->GetN(); i++)
8974  {if( g_graph0->GetY()[i] < graph_ymin ){graph_ymin = g_graph0->GetY()[i];}}
8975 
8976  Double_t graph_ymax = g_graph0->GetY()[0];
8977  for(Int_t i=1; i<g_graph0->GetN(); i++)
8978  {if( g_graph0->GetY()[i] > graph_ymax ){graph_ymax = g_graph0->GetY()[i];}}
8979 
8980  graph_ymax = graph_ymax + (graph_ymax-graph_ymin)*margin_factor;
8981  return graph_ymax;
8982 }
8983 //----------------------------------------------- HistoPlot
8984 
8985 void TEcnaHistos::HistoPlot(TH1D* h_his0, const Int_t& HisSize,
8986  const Axis_t& xinf_his, const Axis_t& xsup_his,
8987  const TString HistoCode, const TString HistoType,
8988  const Int_t& StexStin_A, const Int_t& i0StinEcha, const Int_t& iSample,
8989  const Int_t& opt_scale_x, const Int_t& opt_scale_y,
8990  const TString opt_plot, const Int_t& xFlagAutoYsupMargin)
8991 {
8992  // Plot 1D histogram
8993 
8994  UInt_t canv_w = fCnaParHistos->SetCanvasWidth(HistoCode.Data(), opt_plot);
8995  UInt_t canv_h = fCnaParHistos->SetCanvasHeight(HistoCode.Data(), opt_plot);
8996 
8997  TString QuantityName = " ";
8998  Int_t MaxCar = fgMaxCar;
8999  QuantityName.Resize(MaxCar);
9000  QuantityName = fCnaParHistos->GetQuantityName(HistoCode.Data());
9001  SetHistoPresentation(h_his0, HistoType.Data(), opt_plot); // (gStyle parameters)}
9002 
9003  //.................................................. prepa paves commentaires (HistoPlot)
9004  SetAllPavesViewHisto(HistoCode.Data(), StexStin_A, i0StinEcha, iSample, opt_plot.Data());
9005 
9006  //..................................................... Canvas name (HistoPlot)
9007  TString canvas_name = SetCanvasName(HistoCode.Data(), opt_scale_x, opt_scale_y,
9008  opt_plot.Data(), StexStin_A, i0StinEcha, iSample);
9009 
9010  //.................................... Canvas allocations (HistoPlot)
9011  TCanvas* MainCanvas = 0;
9012 
9013  if(opt_plot == fOnlyOnePlot)
9014  {MainCanvas = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w , canv_h); fCnewRoot++;
9015  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();}
9016 
9017  if( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
9018  {if(GetMemoFlag(HistoCode, opt_plot) == "Free")
9019  {MainCanvas = CreateCanvas(HistoCode, opt_plot, canvas_name, canv_w, canv_h);
9020  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();}}
9021 
9022  // cout << "*TEcnaHistos::HistoPlot(...)> Plot is displayed on canvas ----> " << canvas_name.Data() << endl;
9023 
9024  //--------------- EE => SC for construction, EB => Xtal in SM (default: Stin ECNA number, i0StinEcha)
9025  Int_t Stex_StinCons = StexStin_A; // Stex_StinCons = Tower for EB, SC for construction for EE
9026  Int_t n1StexCrys = i0StinEcha+1; // n1StexCrys = Crys in SM for EB, ECNA
9027 
9028  if( StexStin_A >= 1 && StexStin_A <= fEcal->MaxStinEcnaInStex() )
9029  {
9030  if( fFlagSubDet == "EB" )
9031  {n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);}
9032  if( fFlagSubDet == "EE" )
9033  {Stex_StinCons = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A);}
9034  }
9035 
9036  //------ String for StexNumber ( to display "EB" or "EE" if Stex = 0 )
9037  TString sFapStexNumber = StexNumberToString(fFapStexNumber);
9038 
9039  //============================================================================= (HistoPlot)
9040  //
9041  // 1st OPERATIONS: Pave texts preparation and first Draw.
9042  // SetParametersCanvas
9043  // Set Memo Flags.
9044  // Set main_subpad and main_pavtxt
9045  //
9046  //=============================================================================
9047  TVirtualPad* main_subpad = 0; // main_subpad: Pad for the histo
9048  TPaveText* main_pavtxt = 0; // Pave for the "Several Changing" parameters (options SAME and SAME n)
9049 
9050  Int_t xMemoPlotSame = 1; // a priori ==> SAME plot
9051 
9052  //========================================= Option ONLYONE (HistoPlot)
9053  if(opt_plot == fOnlyOnePlot)
9054  {
9055  //.................................... Draw titles and paves (pad = main canvas)
9056  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
9057  fPavComStex->Draw();
9058  if( !( HistoType == "Global" || HistoType == "Proj" ) ){fPavComStin->Draw(); fPavComXtal->Draw();}
9059 
9060  if( HistoType == "EvolProj" )
9061  {
9062  fPavComEvolRuns->Draw();
9063  fPavComEvolNbOfEvtsAna->Draw();
9064  }
9065  else
9066  {
9067  fPavComAnaRun->Draw();
9068  fPavComNbOfEvts->Draw();
9069  }
9070 
9071  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
9072  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
9073  Double_t y_low = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
9074  Double_t y_up = fCnaParHistos->BoxBottomY("top_right_box_EB") - 0.005;
9075  Color_t fond_pad = fCnaParHistos->ColorDefinition("blanc");
9076 
9077  Double_t x_margin = x_low;
9078  Double_t y_margin = y_low;
9079  MainCanvas->Divide( 1, 1, x_margin, y_margin, fond_pad);
9080  // Divide(nx, ny, x_margin, y_margin, color);
9081 
9082  gPad->cd(1);
9083  main_subpad = gPad;
9084  main_subpad->SetPad(x_low, y_low, x_up, y_up);
9085 
9086  xMemoPlotSame = 0;
9087  } // end of if(opt_plot == fOnlyOnePlot)
9088 
9089  //========================================= Options SAME and SAME n (HistoPlot)
9090  if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
9091  {
9092  //..................... First call in options SAME and SAME n
9093  if( GetMemoFlag(HistoCode, opt_plot) == "Free" )
9094  {
9095  //Call to SetParametersPavTxt
9096  //fPavTxt<HISTOCODE> = fPavComSeveralChanging; => come from SetAllPavesViewHisto
9097  SetParametersPavTxt(HistoCode, opt_plot);
9098 
9099  //---------------- Call to ActivePavTxt
9100  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
9101  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
9102 
9103  //---------------------------- Set texts for pave "several changing", options SAME and SAME n
9104  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
9105 
9106  main_pavtxt->SetTextAlign(fTextPaveAlign);
9107  main_pavtxt->SetTextFont(fTextPaveFont);
9108  main_pavtxt->SetBorderSize(fTextBorderSize);
9109  Float_t cTextPaveSize = 0.025;
9110  if( HistoType == "H1Basic" || HistoType == "SampProj" ||
9111  HistoType == "Proj" || HistoType == "EvolProj" )
9112  {cTextPaveSize = 0.025;}
9113  main_pavtxt->SetTextSize(cTextPaveSize);
9114 
9115  char* f_in = new char[fgMaxCar]; fCnew++;
9116 
9117  //------------------------------------------------------------ titles pave "several" (HistoPlot)
9118  TString DecalStexName = "";
9119  if( fFlagSubDet == "EB" ){DecalStexName = " ";}
9120  TString DecalStinName = "";
9121  if( fFlagSubDet == "EE" ){DecalStinName = " ";}
9122 
9123  TString sStexOrStasName = "";
9124  if( fFapStexNumber == 0 ){sStexOrStasName = " ";}
9125  if( fFapStexNumber != 0 ){sStexOrStasName = fFapStexName;}
9126 
9127  if( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot )
9128  {
9129  if( HistoType == "SampGlobal" )
9130  {sprintf(f_in, "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s %s%s %s Sample",
9131  DecalStexName.Data(), sStexOrStasName.Data(),
9132  DecalStinName.Data(), fFapStinName.Data(), fFapEchaName.Data());}
9133  if( HistoType == "SampProj" )
9134  {sprintf(f_in, "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s %s%s %s Sample",
9135  DecalStexName.Data(), sStexOrStasName.Data(),
9136  DecalStinName.Data(), fFapStinName.Data(), fFapEchaName.Data());}
9137  if( HistoType == "H1Basic" )
9138  {sprintf(f_in, "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s %s%s %s",
9139  DecalStexName.Data(), sStexOrStasName.Data(),
9140  DecalStinName.Data(), fFapStinName.Data(), fFapEchaName.Data());}
9141  if((HistoType == "Global") ||(HistoType == "Proj") )
9142  {sprintf(f_in, "Analysis Samp RUN# (run type ) Evts range Nb Evts %s%s",
9143  DecalStexName.Data(), sStexOrStasName.Data());}
9144 
9145  if( HistoType == "EvolProj" )
9146  {sprintf(f_in, "Analysis Samp Evts range Nb Evts %s%s %s%s %s",
9147  DecalStexName.Data(), sStexOrStasName.Data(),
9148  DecalStinName.Data(), fFapStinName.Data(), fFapEchaName.Data());}
9149  }
9150 
9151  TText* ttit = main_pavtxt->AddText(f_in);
9152  ttit->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
9153 
9154  //------------------------------------------------------------ values pave "several"
9155 
9156  //.................................... option SAME n only (HistoPlot)
9157  if( opt_plot == fSameOnePlot)
9158  {
9159  if( (HistoType == "Global") || (HistoType == "Proj") )
9160  {
9161  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s %-25s",
9164  sFapStexNumber.Data(), QuantityName.Data());
9165  }
9166 
9167  if( HistoType == "EvolProj" )
9168  {
9169  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d %-25s",
9171  sFapStexNumber.Data(), Stex_StinCons, n1StexCrys, QuantityName.Data());
9172  }
9173 
9174  } // end of if for option SAME n only
9175 
9176  //..................................... option SAME
9177  if( opt_plot == fSeveralPlot )
9178  {
9179  Int_t kSample = iSample+1; // Sample number range = [1,n<=10]
9180 
9181  if( HistoType == "SampGlobal" )
9182  {
9183  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%6d",
9186  Stex_StinCons, n1StexCrys, kSample);
9187  }
9188  if( HistoType == "SampProj" )
9189  {
9190  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%6d",
9193  Stex_StinCons, n1StexCrys, kSample);
9194  }
9195  if( HistoType == "H1Basic" )
9196  {
9197  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d",
9200  Stex_StinCons, n1StexCrys);
9201  }
9202  if( (HistoType == "Global") || (HistoType == "Proj") )
9203  {
9204  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s",
9207  }
9208 
9209  if( HistoType == "EvolProj" )
9210  {
9211  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %4s%7d%7d",
9212  fFapAnaType.Data(), fFapNbOfSamples,
9214  Stex_StinCons, n1StexCrys);
9215  }
9216  }
9217 
9218  TText* tt = main_pavtxt->AddText(f_in);
9219  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
9220 
9221  delete [] f_in; f_in = 0; fCdelete++;
9222 
9223  //---------------- Draw the "several changing" pave with its text in the Canvas (AT FIRST TIME)
9224  main_pavtxt->Draw();
9225  //---------------- Draw evol run pave if "EvolProj" (AT FIRST TIME)
9226  if( HistoType == "EvolProj" ){fPavComEvolRuns->Draw();}
9227 
9228  //---------------- Call to SetParametersCanvas
9229  //fImp<HISTOCODE> = (TRootCanvas*)fCanv<HISTOCODE>->GetCanvasImp();
9230  //fCanv<HISTOCODE>->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
9231  //fPad<HISTOCODE> = gPad;
9232  //fMemoPlot<HISTOCODE> = 1; =======> set MemoFlag to "Buzy"
9233  //fMemoColor<HISTOCODE> = 0;
9234  SetParametersCanvas(HistoCode, opt_plot);
9235 
9236  //---------------- Set xMemoPlotSame to 0
9237  xMemoPlotSame = 0;
9238  }
9239  //-------- end of if( GetMemoFlag(HistoCode, opt_plot) == "Free" ) ---------- (HistoPlot)
9240  //.......... First and further calls in options SAME and SAME n (fMemoPlot<HISTOCODE> = 1)
9241  if(GetMemoFlag(HistoCode, opt_plot) == "Busy")
9242  {
9243  //---------------- Call to ActivePavTxt
9244  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
9245  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
9246 
9247  //---------------- Call to ActivePad
9248  //if( (TRootCanvas*)fCanv<HISTOCODE>->GetCanvasImp() == fImp<HISTOCODE> ){
9249  // main_subpad = fPad<HISTOCODE>;} (return main_subpad)
9250  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
9251 
9252  //---------------- Recover pointer to the current canvas
9253  MainCanvas = GetCurrentCanvas(HistoCode.Data(), opt_plot.Data());
9254 
9255  }
9256  } // end of if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
9257 
9258  //============================================================================= (HistoPlot)
9259  //
9260  // 2nd OPERATIONS: Write and Draw the parameter values in the
9261  // "several changing" pave (options SAME and SAME n)
9262  // and Draw Histo
9263  //=============================================================================
9264  if(main_subpad != 0)
9265  {
9266  if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
9267  {
9268  //------------------------------------------------------------ values
9269  if(xMemoPlotSame != 0)
9270  {
9271  // main_pavtxt = fPavComSeveralChanging = fPavTxt<HISTOCODE>
9272  main_pavtxt->SetTextAlign(fTextPaveAlign);
9273  main_pavtxt->SetTextFont(fTextPaveFont);
9274  main_pavtxt->SetBorderSize(fTextBorderSize);
9275  Float_t cTextPaveSize = 0.025;
9276  if( HistoType == "H1Basic" || HistoType == "SampProj"
9277  || HistoType == "Proj" || HistoType == "EvolProj" )
9278  {cTextPaveSize = 0.025;}
9279  main_pavtxt->SetTextSize(cTextPaveSize);
9280 
9281  char* f_in = new char[fgMaxCar]; fCnew++;
9282 
9283  if( opt_plot == fSameOnePlot )
9284  {
9285  if( (HistoType == "Global") || (HistoType == "Proj") )
9286  {
9287  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s %-25s",
9290  sFapStexNumber.Data(), QuantityName.Data());
9291  }
9292 
9293  if( HistoType == "EvolProj" )
9294  {
9295  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d %-25s",
9296  fFapAnaType.Data(), fFapNbOfSamples,
9298  Stex_StinCons, n1StexCrys, QuantityName.Data());
9299  }
9300  }
9301 
9302  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
9303  {
9304  Int_t kSample = iSample+1; // Sample number range = [1,n<=10] (HistoPlot)
9305 
9306  if(HistoType == "SampGlobal" )
9307  {
9308  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%6d",
9311  Stex_StinCons, n1StexCrys, kSample);
9312  }
9313  if( HistoType == "SampProj" )
9314  {
9315  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d%6d",
9318  Stex_StinCons, n1StexCrys, kSample);
9319  }
9320  if(HistoType == "H1Basic" )
9321  {
9322  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s%6d%5d",
9325  Stex_StinCons, n1StexCrys);
9326  }
9327  if( (HistoType == "Global") || (HistoType == "Proj") )
9328  {
9329  sprintf(f_in, "%-10s 1-%2d%7d (%-20s) %5d-%5d %7d %4s",
9332  }
9333 
9334  if( HistoType == "EvolProj" )
9335  {
9336  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %4s%7d%7d",
9337  fFapAnaType.Data(), fFapNbOfSamples,
9339  sFapStexNumber.Data(), Stex_StinCons, n1StexCrys);
9340  }
9341  }
9342 
9343  TText *tt = main_pavtxt->AddText(f_in);
9344  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
9345  MainCanvas->cd(); gStyle->SetOptDate(0);
9346  main_pavtxt->Draw();
9347 
9348  delete [] f_in; f_in = 0; fCdelete++;
9349  }
9350 
9351  main_subpad->cd();
9352  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
9353  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
9354  Double_t y_low = fCnaParHistos->BoxTopY("several_plots_box") + 0.005;
9355  Double_t y_up = fCnaParHistos->BoxBottomY("general_comment") - 0.005;
9356  if( opt_plot == fSameOnePlot && HistoType == "EvolProj" )
9357  {y_up = fCnaParHistos->BoxBottomY("top_left_box_EB") - 0.005;}
9358  main_subpad->SetPad(x_low, y_low, x_up, y_up);
9359  } // end of if( (opt_plot == fSeveralPlot) || (opt_plot == fSameOnePlot) )
9360 
9361  //............................................ Style (HistoPlot)
9362  SetViewHistoColors(h_his0, HistoCode.Data(), opt_plot);
9363  //SetViewHistoMarkerAndLine(h_his0, HistoCode.Data(), opt_plot);
9364 
9365  //................................. Set axis titles
9366  TString axis_x_var_name = SetHistoXAxisTitle(HistoCode);
9367  TString axis_y_var_name = SetHistoYAxisTitle(HistoCode);
9368  h_his0->GetXaxis()->SetTitle(axis_x_var_name);
9369  h_his0->GetYaxis()->SetTitle(axis_y_var_name);
9370 
9371  Int_t lin_scale = 0;
9372  Int_t log_scale = 1;
9373 
9374  if(opt_scale_x == fOptScaleLinx){gPad->SetLogx(lin_scale);}
9375  if(opt_scale_x == fOptScaleLogx){gPad->SetLogx(log_scale);}
9376  if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(lin_scale);}
9377  if(opt_scale_y == fOptScaleLogy){gPad->SetLogy(log_scale);}
9378 
9379  //---------------------------------------------------------------- Draw histo (HistoPlot)
9380  if(opt_plot == fOnlyOnePlot){h_his0->DrawCopy();}
9381 
9382  if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
9383  {
9384  if(xMemoPlotSame == 0){h_his0->DrawCopy();}
9385  if(xMemoPlotSame != 0){h_his0->DrawCopy("SAME");}
9386  }
9387  //----------------------------------------------------------------
9388 
9389  //.................... Horizontal line at y=0 (HistoPlot)
9390  if( !( HistoCode == "D_Adc_EvDs" || HistoCode == "D_Adc_EvNb" ||
9391  HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj" ) )
9392  {
9393  Double_t yinf = h_his0->GetMinimum();
9394  Double_t ysup = h_his0->GetMaximum();
9395  if( yinf <= (Double_t)0. && ysup >= (Double_t)0. )
9396  {TLine* lin = new TLine(0.,0.,(Double_t)HisSize, 0.); fCnewRoot++;
9397  lin->Draw();}
9398  }
9399 
9400  if( (opt_plot == fOnlyOnePlot)
9401  || ( (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) && xMemoPlotSame == 0 ) )
9402  {
9403  Double_t yinf = (Double_t)h_his0->GetMinimum();
9404  Double_t ysup = (Double_t)h_his0->GetMaximum();
9405 
9406  if(xFlagAutoYsupMargin == 1)
9407  {
9408  if( yinf >= ysup ){yinf = (Double_t)0.; ysup += ysup;} // ROOT default if ymin >= ymax
9409  Double_t MaxMarginFactor = (Double_t)0.05; // frame top line = 5% above the maximum
9410  ysup += (ysup-yinf)*MaxMarginFactor; // ROOT default if ymin < ymax
9411  }
9412 
9413  char* f_in = new char[fgMaxCar]; fCnew++;
9414 
9415  //.................... Vertical lines for Data sectors (EE Global plot only)
9416  if( fFlagSubDet == "EE" && fFapStexNumber == 0 )
9417  {
9418  //............................................................. Data Sectors (HistoPlot)
9419  Color_t coul_DS = fCnaParHistos->ColorDefinition("noir");
9420  Int_t DeeOffset = 0;
9421  for(Int_t n1Dee=1; n1Dee<=4; n1Dee++)
9422  {
9423  if( n1Dee == 4 ){DeeOffset = 0;}
9424  if( n1Dee == 3 ){DeeOffset = fEcal->MaxSCForConsInDee();} // 149
9425  if( n1Dee == 2 ){DeeOffset = 2*fEcal->MaxSCForConsInDee();} // 446
9426  if( n1Dee == 1 ){DeeOffset = 3*fEcal->MaxSCForConsInDee();} // 595
9427 
9428  Double_t ydee = ysup + (ysup-yinf)/(Double_t)15.;
9429  Double_t xBinDee = DeeOffset + fEcal->MaxSCForConsInDee()/(Double_t)2.;
9430  sprintf( f_in, "D%d", n1Dee );
9431  TText *text_Dee = new TText(xBinDee, ydee, f_in); fCnewRoot++;
9432  text_Dee->SetTextColor(coul_DS);
9433  text_Dee->SetTextSize((Double_t)0.04);
9434  text_Dee->Draw("SAME");
9435 
9436  Double_t DSLabelOffset = (Double_t)12;
9437 
9438  for(Int_t i=1; i<5; i++)
9439  {
9440  Int_t iDS = 0;
9441  if( n1Dee == 1 ){iDS = i;}
9442  if( n1Dee == 2 ){iDS = i+4;}
9443  if( n1Dee == 3 ){iDS = i+5;}
9444  if( n1Dee == 4 ){iDS = i+1;}
9445 
9446  Double_t xBinDS = DeeOffset + (Double_t)GetDSOffset(n1Dee, iDS)/fEcal->MaxCrysInSC();
9447  TLine* lin_DS = new TLine(xBinDS, yinf, xBinDS, ysup); fCnewRoot++;
9448  lin_DS->SetLineColor(coul_DS);
9449  lin_DS->SetLineWidth(1);
9450  lin_DS->SetLineStyle(2);
9451  lin_DS->Draw();
9452 
9453  if( n1Dee == 2 && i == 4 )
9454  {
9455  TLine* lin_DSp = new TLine(DeeOffset, yinf, DeeOffset, ysup); fCnewRoot++;
9456  lin_DSp->SetLineColor(coul_DS);
9457  lin_DSp->SetLineWidth(1);
9458  lin_DSp->SetLineStyle(2);
9459  lin_DSp->Draw();
9460  }
9461 
9462  Double_t yds = ysup + (ysup-yinf)/(Double_t)50.;
9463  Double_t xBinDSp = xBinDS + DSLabelOffset;
9464  Int_t nDS = iDS;
9465 
9466  sprintf( f_in, "S%d", nDS );
9467  TText *text_DS = new TText(xBinDSp, yds, f_in); fCnewRoot++;
9468  text_DS->SetTextColor(coul_DS);
9469  text_DS->SetTextSize((Double_t)0.03);
9470  text_DS->Draw("SAME");
9471  if( (n1Dee == 4 && i == 1) || (n1Dee == 2 && i == 4) )
9472  {
9473  if(n1Dee == 4){nDS = iDS-1;}
9474  if(n1Dee == 2){nDS = iDS+1;}
9475  sprintf( f_in, "S%d", nDS );
9476  TText *text_DS = new TText(xBinDS-1.75*DSLabelOffset, yds, f_in); fCnewRoot++;
9477  text_DS->SetTextColor(coul_DS);
9478  text_DS->SetTextSize((Double_t)0.03);
9479  text_DS->Draw("SAME");
9480  }
9481  }
9482  }
9483  }
9484 
9485  //........... Vertical lines for Data sectors and special SC's (EE only, Dee's Global plots) (HistoPlot)
9486  if( fFlagSubDet == "EE" && fFapStexNumber > 0 )
9487  {
9488  if( HistoType == "Global" )
9489  {
9490  Double_t ytext = yinf - (ysup-yinf)/8.5;
9491  //............................................................. Data Sectors
9492  Color_t coul_DS = fCnaParHistos->ColorDefinition("noir");
9493  for(Int_t i=1; i<5; i++)
9494  {
9495  Int_t iDS = 0;
9496  if( fFapStexNumber == 1 ){iDS = i;}
9497  if( fFapStexNumber == 2 ){iDS = i+4;}
9498  if( fFapStexNumber == 3 ){iDS = i+5;}
9499  if( fFapStexNumber == 4 ){iDS = i+1;}
9500 
9501  Double_t xBinDS = (Double_t)GetDSOffset(fFapStexNumber, iDS);
9502  TLine* lin_DS = new TLine(xBinDS, yinf, xBinDS, ysup); fCnewRoot++;
9503  lin_DS->SetLineColor(coul_DS);
9504  lin_DS->SetLineWidth(2);
9505  lin_DS->SetLineStyle(2);
9506  lin_DS->Draw();
9507  Double_t ytextds = ysup + (ysup-yinf)/30.;
9508  Double_t xBinDSNumber =
9509  xBinDS + fEcalNumbering->GetMaxSCInDS(iDS)*fEcal->MaxCrysInSC()/(Double_t)2.25;
9510  sprintf( f_in, "S%d", iDS );
9511  TText *text_DS = new TText(xBinDSNumber, ytextds, f_in); fCnewRoot++;
9512  text_DS->SetTextColor(coul_DS);
9513  text_DS->SetTextSize((Double_t)0.04);
9514  text_DS->Draw("SAME");
9515  if( ( (fFapStexNumber == 1 || fFapStexNumber == 2 ) && i == 4 ) ||
9516  ( (fFapStexNumber == 3 || fFapStexNumber == 4 ) && i == 1 ) )
9517  {
9518  Int_t iDSp = iDS;
9519  if( i == 4 ){iDSp = iDS+1;}
9520  if( i == 1 ){iDSp = iDS-1;}
9521  sprintf( f_in, "S%d", iDSp);
9522  Double_t xBinpDSNumber =
9523  xBinDSNumber - fEcalNumbering->GetMaxSCInDS(iDS)*fEcal->MaxCrysInSC();
9524  TText *text_DSp = new TText(xBinpDSNumber, ytextds, f_in); fCnewRoot++;
9525  text_DSp->SetTextColor(coul_DS);
9526  text_DSp->SetTextSize((Double_t)0.04);
9527  text_DSp->Draw("SAME");
9528  }
9529  }
9530  //.............................................................. Vertical lines for SC's
9531  // Trop serre. A garder en reserve.
9532  //for(Int_t i=0; i<fEcal->MaxSCForConsInDee(); i++)
9533  // {
9534  // Double_t xBinSC =(Double_t)(fEcal->MaxCrysInSC()*i);
9535  // TLine* lin_SC = new TLine(xBinSC, yinf, xBinSC, ysup); fCnewRoot++;
9536  // lin_SC->SetLineColor(coul_DS);
9537  // lin_SC->SetLineStyle(3);
9538  // lin_SC->Draw();
9539  // }
9540  //............................................................... Not connected SC's
9541  Color_t coul_notconnected = fCnaParHistos->ColorDefinition("bleu_fonce");
9542  for(Int_t i=1; i<=fEcal->NumberOfNotConnectedSCs(); i++)
9543  {
9544  Int_t index = 0;
9545  if( fFapStexNumber == 1 || fFapStexNumber == 3 ){index = 2*i - 1;}
9546  if( fFapStexNumber == 2 || fFapStexNumber == 4 ){index = 2*i;}
9547  //................. display of the not connected SC's numbers (+ vertical line)
9548  Double_t xBinNotConnectedSC = NotConnectedSCH1DBin(index);
9549  TLine* lin_notconnected =
9550  new TLine(xBinNotConnectedSC, yinf, xBinNotConnectedSC, ysup); fCnewRoot++;
9551  lin_notconnected->SetLineColor(coul_notconnected);
9552  lin_notconnected->SetLineStyle(3);
9553  lin_notconnected->Draw();
9554 
9555  Double_t xBinNotConnectedSCEnd = NotConnectedSCH1DBin(index)+fEcal->MaxCrysInSC();
9556  TLine* lin_notconnected_end =
9557  new TLine(xBinNotConnectedSCEnd, yinf, xBinNotConnectedSCEnd, ysup); fCnewRoot++;
9558  lin_notconnected_end->SetLineColor(coul_notconnected);
9559  lin_notconnected_end->SetLineStyle(3);
9560  lin_notconnected_end->Draw();
9561 
9562  //sprintf( f_in, "%d", GetNotConnectedSCForConsFromIndex(index) );
9563  sprintf( f_in, "%d", GetNotConnectedDSSCFromIndex(index) );
9564  TText *text_SC_NotConnected = new TText(xBinNotConnectedSC, ytext, f_in); fCnewRoot++;
9565  text_SC_NotConnected->SetTextAngle((Double_t)45.);
9566  text_SC_NotConnected->SetTextColor(coul_notconnected);
9567  text_SC_NotConnected->SetTextFont(42);
9568  text_SC_NotConnected->SetTextSize((Double_t)0.03);
9569  text_SC_NotConnected->Draw("SAME");
9570  }
9571  //Double_t xtext = xinf_his - (xsup_his-xinf_his)/8.;
9572  //Double_t ytextp = yinf - (ysup-yinf)/6.;
9573  //sprintf( f_in, "Special SC => ");
9574  //TText *text_legend_NotConnected = new TText(xtext, ytext, f_in); fCnewRoot++;
9575  //text_legend_NotConnected->SetTextColor(coul_notconnected);
9576  //text_legend_NotConnected->SetTextSize((Double_t)0.03);
9577  //text_legend_NotConnected->Draw("SAME");
9578 
9579  //............................................................... Not complete SC's
9580  Color_t coul_notcomplete = fCnaParHistos->ColorDefinition("rouge40");
9581  for(Int_t i=1; i<=fEcal->NumberOfNotCompleteSCs(); i++)
9582  {
9583  Int_t index = 0;
9584  if( fFapStexNumber == 1 || fFapStexNumber == 3 ){index = 2*i - 1;}
9585  if( fFapStexNumber == 2 || fFapStexNumber == 4 ){index = 2*i;}
9586  //................. display of the not complete SC's numbers (+ vertical line)
9587  Double_t xBinNotCompleteSC = NotCompleteSCH1DBin(index);
9588  TLine* lin_notcomplete =
9589  new TLine(xBinNotCompleteSC, yinf, xBinNotCompleteSC, ysup); fCnewRoot++;
9590  lin_notcomplete->SetLineColor(coul_notcomplete);
9591  lin_notcomplete->SetLineStyle(3);
9592  lin_notcomplete->Draw();
9593 
9594  Double_t xBinNotCompleteSCEnd = NotCompleteSCH1DBin(index)+fEcal->MaxCrysInSC();;
9595  TLine* lin_notcomplete_end =
9596  new TLine(xBinNotCompleteSCEnd, yinf, xBinNotCompleteSCEnd, ysup); fCnewRoot++;
9597  lin_notcomplete_end->SetLineColor(coul_notcomplete);
9598  lin_notcomplete_end->SetLineStyle(3);
9599  lin_notcomplete_end->Draw();
9600 
9601  sprintf( f_in, "%d", GetNotCompleteDSSCFromIndex(index) );
9602  // sprintf( f_in, "%d", GetNotCompleteSCForConsFromIndex(index) );
9603  TText *text_SC_NotComplete = new TText(xBinNotCompleteSC, ytext, f_in); fCnewRoot++;
9604  text_SC_NotComplete->SetTextAngle((Double_t)45.);
9605  text_SC_NotComplete->SetTextColor(coul_notcomplete);
9606  text_SC_NotComplete->SetTextFont(42);
9607  text_SC_NotComplete->SetTextSize((Double_t)0.03);
9608  text_SC_NotComplete->Draw("SAME");
9609  }
9610  //Double_t xtextp = xinf_his + (xsup_his-xinf_his)/15.;
9611  //sprintf( f_in, "Not complete SC");
9612  //TText *text_legend_NotComplete = new TText(xtextp, ytextp, f_in); fCnewRoot++;
9613  //text_legend_NotComplete->SetTextColor(coul_notcomplete);
9614  //text_legend_NotComplete->SetTextSize((Double_t)0.03);
9615  //text_legend_NotComplete->Draw("SAME");
9616  }
9617  }
9618  delete [] f_in; f_in = 0; fCdelete++;
9619  }
9620 
9621  //..............................................Top Axis (HistoPlot)
9622  Int_t min_value = 0;
9623  Int_t max_value = 0;
9624  if(HistoType == "Global")
9625  {
9626  if( fFapStexNumber > 0 )
9627  {
9628  //.......................... Axis for the Stin numbers and Data sectors (EE) numbers
9629  if( fFlagSubDet == "EB" )
9630  {
9631  min_value = 0;
9632  max_value = fEcal->MaxStinEcnaInStex() - 1;
9633  }
9634  if( fFlagSubDet == "EE" )
9635  {
9636  if( fFapStexNumber == 1 ){min_value = 1; max_value = 5;}
9637  if( fFapStexNumber == 2 ){min_value = 5; max_value = 9;}
9638  if( fFapStexNumber == 3 ){min_value = 5; max_value = 9;}
9639  if( fFapStexNumber == 4 ){min_value = 1; max_value = 5;}
9640  }
9641  }
9642  if( fFapStexNumber == 0 )
9643  {
9644  //.......................... Axis for the SM (EB) and Dee numbers (EE)
9645  if( fFlagSubDet == "EB" )
9646  {
9647  min_value = 0;
9648  max_value = fEcal->MaxStexInStas() - 1;
9649  }
9650  if( fFlagSubDet == "EE" )
9651  {
9652  min_value = 1;
9653  max_value = fEcal->MaxStexInStas();
9654  }
9655  }
9656  TopAxisForHistos(h_his0, opt_plot, xMemoPlotSame, min_value, max_value,
9657  xFlagAutoYsupMargin, HisSize);
9658  }
9659  gPad->Update();
9660  }
9661  else // else du if(main_subpad !=0)
9662  {
9663  cout << "*TEcnaHistos::HistoPlot(...)> Canvas not found. Previously closed in option SAME."
9664  << fTTBELL << endl;
9665 
9666  ReInitCanvas(HistoCode, opt_plot);
9667  xMemoPlotSame = 0;
9668  }
9669 
9670  // delete MainCanvas; fCdeleteRoot++;
9671 
9672 } // end of HistoPlot
9673 
9674 
9675 TString TEcnaHistos::StexNumberToString(const Int_t& StexNumber)
9676 {
9677  // Convert Int_t StexNumber into TString: "StexNumber" if StexNumber in [-18,36]
9678  // or into TString: "EB" or "EE" if StexNumber = 0.
9679 
9680  TString sFapStexNumber = "?";
9681  if( StexNumber == -1 ){sFapStexNumber = " -1";}
9682  if( StexNumber == -2 ){sFapStexNumber = " -2";}
9683  if( StexNumber == -3 ){sFapStexNumber = " -3";}
9684  if( StexNumber == -4 ){sFapStexNumber = " -4";}
9685  if( StexNumber == -5 ){sFapStexNumber = " -5";}
9686  if( StexNumber == -6 ){sFapStexNumber = " -6";}
9687  if( StexNumber == -7 ){sFapStexNumber = " -7";}
9688  if( StexNumber == -8 ){sFapStexNumber = " -8";}
9689  if( StexNumber == -9 ){sFapStexNumber = " -9";}
9690  if( StexNumber == -10 ){sFapStexNumber = "-10";}
9691  if( StexNumber == -11 ){sFapStexNumber = "-11";}
9692  if( StexNumber == -12 ){sFapStexNumber = "-12";}
9693  if( StexNumber == -13 ){sFapStexNumber = "-13";}
9694  if( StexNumber == -14 ){sFapStexNumber = "-14";}
9695  if( StexNumber == -15 ){sFapStexNumber = "-15";}
9696  if( StexNumber == -16 ){sFapStexNumber = "-16";}
9697  if( StexNumber == -17 ){sFapStexNumber = "-17";}
9698  if( StexNumber == -18 ){sFapStexNumber = "-18";}
9699  if( StexNumber == 0 ){sFapStexNumber = fFlagSubDet;}
9700  if( StexNumber == 1 ){sFapStexNumber = " 1";}
9701  if( StexNumber == 2 ){sFapStexNumber = " 2";}
9702  if( StexNumber == 3 ){sFapStexNumber = " 3";}
9703  if( StexNumber == 4 ){sFapStexNumber = " 4";}
9704  if( StexNumber == 5 ){sFapStexNumber = " 5";}
9705  if( StexNumber == 6 ){sFapStexNumber = " 6";}
9706  if( StexNumber == 7 ){sFapStexNumber = " 7";}
9707  if( StexNumber == 8 ){sFapStexNumber = " 8";}
9708  if( StexNumber == 9 ){sFapStexNumber = " 9";}
9709  if( StexNumber == 10 ){sFapStexNumber = " 10";}
9710  if( StexNumber == 11 ){sFapStexNumber = " 11";}
9711  if( StexNumber == 12 ){sFapStexNumber = " 12";}
9712  if( StexNumber == 13 ){sFapStexNumber = " 13";}
9713  if( StexNumber == 14 ){sFapStexNumber = " 14";}
9714  if( StexNumber == 15 ){sFapStexNumber = " 15";}
9715  if( StexNumber == 16 ){sFapStexNumber = " 16";}
9716  if( StexNumber == 17 ){sFapStexNumber = " 17";}
9717  if( StexNumber == 18 ){sFapStexNumber = " 18";}
9718  if( StexNumber == 19 ){sFapStexNumber = " -1";}
9719  if( StexNumber == 20 ){sFapStexNumber = " -2";}
9720  if( StexNumber == 21 ){sFapStexNumber = " -3";}
9721  if( StexNumber == 22 ){sFapStexNumber = " -4";}
9722  if( StexNumber == 23 ){sFapStexNumber = " -5";}
9723  if( StexNumber == 24 ){sFapStexNumber = " -6";}
9724  if( StexNumber == 25 ){sFapStexNumber = " -7";}
9725  if( StexNumber == 26 ){sFapStexNumber = " -8";}
9726  if( StexNumber == 27 ){sFapStexNumber = " -9";}
9727  if( StexNumber == 28 ){sFapStexNumber = "-10";}
9728  if( StexNumber == 29 ){sFapStexNumber = "-11";}
9729  if( StexNumber == 30 ){sFapStexNumber = "-12";}
9730  if( StexNumber == 31 ){sFapStexNumber = "-13";}
9731  if( StexNumber == 32 ){sFapStexNumber = "-14";}
9732  if( StexNumber == 33 ){sFapStexNumber = "-15";}
9733  if( StexNumber == 34 ){sFapStexNumber = "-16";}
9734  if( StexNumber == 35 ){sFapStexNumber = "-17";}
9735  if( StexNumber == 36 ){sFapStexNumber = "-18";}
9736  return sFapStexNumber;
9737 }
9738 
9740 {
9741  // gives the x coordinate for the i_th NotConnected SC
9742  // GetDSOffset(DeeNumber, DataSector) , GetSCOffset(DeeNumber, DataSector, SC_in_DS)
9743 
9744  Double_t xbin = (Double_t)(-1);
9745 
9746  if( index == 1 ){xbin = GetDSOffset(1,1)+GetSCOffset(1,1, 30);} // nb_for_cons == 182 (D1,S1) (D3,S9)
9747  if( index == 2 ){xbin = GetDSOffset(2,9)+GetSCOffset(2,9, 30);} // nb_for_cons == 33 (D2,S9) (D4,S1)
9748 
9749  if( index == 3 ){xbin = GetDSOffset(1,2)+GetSCOffset(1,2, 3);} // nb_for_cons == 178 (D1,S2) (D3,S8)
9750  if( index == 4 ){xbin = GetDSOffset(2,8)+GetSCOffset(2,8, 3);} // nb_for_cons == 29 (D2,S8) (D4,S2)
9751 
9752  if( index == 5 ){xbin = GetDSOffset(1,2)+GetSCOffset(1,2, 25);} // nb_for_cons == 207 (D1,S2) (D3,S8)
9753  if( index == 6 ){xbin = GetDSOffset(2,8)+GetSCOffset(2,8, 25);} // nb_for_cons == 58 (D2,S8) (D4,S2)
9754 
9755  if( index == 7 ){xbin = GetDSOffset(1,3)+GetSCOffset(1,3, 34);} // nb_for_cons == 298 (D1,S3) (D3,S7)
9756  if( index == 8 ){xbin = GetDSOffset(2,7)+GetSCOffset(2,7, 34);} // nb_for_cons == 149 (D2,S7) (D4,S3)
9757 
9758  if( index == 9 ){xbin = GetDSOffset(1,4)+GetSCOffset(1,4, 14);} // nb_for_cons == 261 (D1,S4) (D3,S6)
9759  if( index == 10 ){xbin = GetDSOffset(2,6)+GetSCOffset(2,6, 14);} // nb_for_cons == 112 (D2,S6) (D4,S4)
9760  if( index == 11 ){xbin = GetDSOffset(1,4)+GetSCOffset(1,4, 21);} // nb_for_cons == 268 (D1,S4) (D3,S6)
9761  if( index == 12 ){xbin = GetDSOffset(2,6)+GetSCOffset(2,6, 21);} // nb_for_cons == 119 (D2,S6) (D4,S4)
9762 
9763  if( index == 13 ){xbin = GetDSOffset(1,5)+GetSCOffset(1,5, 20);} // nb_for_cons == 281 (D1,S5) (D3,S5)
9764  if( index == 14 ){xbin = GetDSOffset(2,5)+GetSCOffset(2,5, 3);} // nb_for_cons == 132 (D2,S5) (D4,S5)
9765 
9766  return xbin;
9767 }
9768 
9770 {
9771  // gives the x coordinate for the i_th NotConnected SC
9772 
9773  Double_t xbin = (Double_t)(-1);
9774 
9775  if( index == 1 ){xbin = GetDSOffset(1,1)+GetSCOffset(1,1, 12);} // nb_for_cons == 161 (D1,S1) (D3,S9)
9776  if( index == 2 ){xbin = GetDSOffset(2,9)+GetSCOffset(2,9, 12);} // nb_for_cons == 12 (D2,S9) (D4,S1)
9777 
9778  if( index == 3 ){xbin = GetDSOffset(1,2)+GetSCOffset(1,2, 32);} // nb_for_cons == 216 (D1,S2) (D3,S8)
9779  if( index == 4 ){xbin = GetDSOffset(2,8)+GetSCOffset(2,8, 32);} // nb_for_cons == 67 (D2,S8) (D4,S2)
9780 
9781  if( index == 5 ){xbin = GetDSOffset(1,3)+GetSCOffset(1,3, 10);} // nb_for_cons == 224 (D1,S3) (D3,S7)
9782  if( index == 6 ){xbin = GetDSOffset(2,7)+GetSCOffset(2,7, 10);} // nb_for_cons == 75 (D2,S7) (D4,S3)
9783 
9784  if( index == 7 ){xbin = GetDSOffset(1,5)+GetSCOffset(1,5, 23);} // nb_for_cons == 286 (D1,S5) (D3,S5)
9785  if( index == 8 ){xbin = GetDSOffset(2,5)+GetSCOffset(2,5, 6);} // nb_for_cons == 137 (D2,S5) (D4,S5)
9786 
9787  return xbin;
9788 }
9789 
9791 {
9792 
9793  Int_t SCForCons = 0;
9794  if( index == 1 ){SCForCons = 182;} // (D1,S1) (D3,S9)
9795  if( index == 2 ){SCForCons = 33;} // (D2,S9) (D4,S1)
9796 
9797  if( index == 3 ){SCForCons = 178;} // (D1,S2) (D3,S8)
9798  if( index == 4 ){SCForCons = 29;} // (D2,S8) (D4,S2)
9799  if( index == 5 ){SCForCons = 207;} // (D1,S2) (D3,S8)
9800  if( index == 6 ){SCForCons = 58;} // (D2,S8) (D4,S2)
9801 
9802  if( index == 7 ){SCForCons = 298;} // (D1,S3) (D3,S7)
9803  if( index == 8 ){SCForCons = 149;} // (D2,S7) (D4,S3)
9804 
9805  if( index == 9 ){SCForCons = 261;} // (D1,S4) (D3,S6)
9806  if( index == 10 ){SCForCons = 112;} // (D2,S6) (D4,S4)
9807  if( index == 11 ){SCForCons = 268;} // (D1,S4) (D3,S6)
9808  if( index == 12 ){SCForCons = 119;} // (D2,S6) (D4,S4)
9809 
9810  if( index == 13 ){SCForCons = 281;} // (D1,S5) (D3,S5)
9811  if( index == 14 ){SCForCons = 132;} // (D2,S5) (D4,S5)
9812  return SCForCons;
9813 }
9814 
9816 {
9817 
9818  Int_t DSSC = 0;
9819  if( index == 1 ){DSSC = 30;} // (D1,S1) (D3,S9)
9820  if( index == 2 ){DSSC = 30;} // (D2,S9) (D4,S1)
9821 
9822  if( index == 3 ){DSSC = 3;} // (D1,S2) (D3,S8)
9823  if( index == 4 ){DSSC = 3;} // (D2,S8) (D4,S2)
9824  if( index == 5 ){DSSC = 25;} // (D1,S2) (D3,S8)
9825  if( index == 6 ){DSSC = 25;} // (D2,S8) (D4,S2)
9826 
9827  if( index == 7 ){DSSC = 34;} // (D1,S3) (D3,S7)
9828  if( index == 8 ){DSSC = 34;} // (D2,S7) (D4,S3)
9829 
9830  if( index == 9 ){DSSC = 14;} // (D1,S4) (D3,S6)
9831  if( index == 10 ){DSSC = 14;} // (D2,S6) (D4,S4)
9832  if( index == 11 ){DSSC = 21;} // (D1,S4) (D3,S6)
9833  if( index == 12 ){DSSC = 21;} // (D2,S6) (D4,S4)
9834 
9835  if( index == 13 ){DSSC = 20;} // (D1,S5) (D3,S5)
9836  if( index == 14 ){DSSC = 3;} // (D2,S5) (D4,S5)
9837  return DSSC;
9838 }
9839 
9840 
9842 {
9843 
9844  Int_t DSSC = 0;
9845  if( index == 1 ){DSSC = 161;} // (D1,S1) (D3,S9)
9846  if( index == 2 ){DSSC = 12;} // (D2,S9) (D4,S1)
9847 
9848  if( index == 3 ){DSSC = 216;} // (D1,S2) (D3,S8)
9849  if( index == 4 ){DSSC = 67;} // (D2,S8) (D4,S2)
9850 
9851  if( index == 5 ){DSSC = 224;} // (D1,S3) (D3,S7)
9852  if( index == 6 ){DSSC = 75;} // (D2,S7) (D4,S3)
9853 
9854  if( index == 7 ){DSSC = 286;} // (D1,S5) (D3,S5)
9855  if( index == 8 ){DSSC = 137;} // (D2,S5) (D4,S5)
9856  return DSSC;
9857 }
9858 
9860 {
9861 
9862  Int_t DSSC = 0;
9863  if( index == 1 ){DSSC = 12;} // (D1,S1) (D3,S9)
9864  if( index == 2 ){DSSC = 12;} // (D2,S9) (D4,S1)
9865 
9866  if( index == 3 ){DSSC = 32;} // (D1,S2) (D3,S8)
9867  if( index == 4 ){DSSC = 32;} // (D2,S8) (D4,S2)
9868 
9869  if( index == 5 ){DSSC = 10;} // (D1,S3) (D3,S7)
9870  if( index == 6 ){DSSC = 10;} // (D2,S7) (D4,S3)
9871 
9872  if( index == 7 ){DSSC = 23;} // (D1,S5) (D3,S5)
9873  if( index == 8 ){DSSC = 6;} // (D2,S5) (D4,S5)
9874  return DSSC;
9875 }
9876 //----------------------------------------------- HistimePlot
9877 void TEcnaHistos::HistimePlot(TGraph* g_graph0,
9878  Axis_t xinf, Axis_t xsup,
9879  const TString HistoCode, const TString HistoType,
9880  const Int_t& StexStin_A, const Int_t& i0StinEcha, const Int_t& iSample,
9881  const Int_t& opt_scale_x, const Int_t& opt_scale_y,
9882  const TString opt_plot, const Int_t& xFlagAutoYsupMargin)
9883 {
9884  // Plot 1D histogram for evolution in time
9885 
9886  UInt_t canv_w = fCnaParHistos->SetCanvasWidth(HistoCode, opt_plot);
9887  UInt_t canv_h = fCnaParHistos->SetCanvasHeight(HistoCode, opt_plot);
9888 
9889  SetGraphPresentation(g_graph0, HistoType.Data(), opt_plot.Data()); // (gStyle parameters)}
9890 
9891  //...................................................... paves commentaires (HistimePlot)
9892  SetAllPavesViewHisto(HistoCode, StexStin_A, i0StinEcha, iSample, opt_plot);
9893 
9894  //..................................................... Canvas name (HistimePlot)
9895  TString canvas_name = SetCanvasName(HistoCode.Data(), opt_scale_x, opt_scale_y, opt_plot,
9896  StexStin_A, i0StinEcha, iSample);
9897 
9898  //------------------------------------------------ Canvas allocation (HistimePlot)
9899  //......................................... declarations canvas et pad
9900  TCanvas* MainCanvas = 0;
9901 
9902  if( opt_plot == fOnlyOnePlot )
9903  {MainCanvas = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w , canv_h); fCnewRoot++;
9904  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();}
9905 
9906  if( opt_plot == fSeveralPlot )
9907  {
9908  if(GetMemoFlag(HistoCode, opt_plot) == "Free")
9909  {
9910  MainCanvas = CreateCanvas(HistoCode, opt_plot, canvas_name, canv_w, canv_h);
9911  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();
9912  }
9913  }
9914 
9915  if( opt_plot == fSameOnePlot )
9916  {
9917  if(GetMemoFlag(HistoCode, opt_plot) == "Free")
9918  {
9919  MainCanvas = CreateCanvas(HistoCode, opt_plot, canvas_name, canv_w, canv_h);
9920  fCurrentPad = gPad; fCurrentCanvas = MainCanvas; fCurrentCanvasName = canvas_name.Data();
9921  }
9922  }
9923 
9924  // cout << "*TEcnaHistos::HistimePlot(...)> Plot is displayed on canvas ----> " << canvas_name.Data() << endl;
9925 
9926  //--------------- EE => SC for construction, EB => Xtal in SM (default: Stin ECNA number, i0StinEcha)
9927  Int_t Stex_StinCons = StexStin_A; // Stex_StinCons = Tower for EB, SC for construction for EE
9928  Int_t n1StexCrys = i0StinEcha+1; // n1StexCrys = Crys in SM for EB
9929 
9930  if( StexStin_A >= 1 && StexStin_A <= fEcal->MaxStinEcnaInStex() )
9931  {
9932  if( fFlagSubDet == "EB" )
9933  {n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);}
9934  if( fFlagSubDet == "EE" )
9935  {Stex_StinCons = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fFapStexNumber, StexStin_A);}
9936  }
9937 
9938  //------ String for StexNumber ( to display "EB" or "EE" if Stex = 0 )
9939  TString sFapStexNumber = StexNumberToString(fFapStexNumber);
9940 
9941  //============================================================================= (HistimePlot)
9942  //
9943  // 1st OPERATIONS: Pave texts preparation and first Draw.
9944  // SetParametersCanvas
9945  // Set Memo Flags.
9946  // Set main_subpad and main_pavtxt
9947  //
9948  //=============================================================================
9949  TVirtualPad* main_subpad = 0; // main_subpad: Pad for the histo
9950  TPaveText* main_pavtxt = 0; // main_pavtxt: pave for changing parameters
9951 
9952  Int_t xMemoPlotSame = 1; // a priori ==> SAME plot
9953 
9954  TString QuantityName = fCnaParHistos->GetQuantityName(HistoCode.Data());
9955 
9956  //========================================= Option ONLYONE (HistimePlot)
9957  if( opt_plot == fOnlyOnePlot )
9958  {
9959  //................................. Draw titles and paves (pad = main canvas)
9960  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
9961  fPavComStex->Draw();
9962 
9963  if( !( HistoType == "Global" || HistoType == "Proj" ) )
9964  {
9965  fPavComStin->Draw();
9966  fPavComXtal->Draw();
9967  }
9968  fPavComEvolNbOfEvtsAna->Draw();
9969  fPavComEvolRuns->Draw();
9970 
9971  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
9972  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
9973  Double_t y_low = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
9974  Double_t y_up = fCnaParHistos->BoxBottomY("top_left_box_EB") - 0.005;
9975 
9976  Double_t x_margin = x_low;
9977  Double_t y_margin = y_low;
9978 
9979  Color_t fond_pad = fCnaParHistos->ColorDefinition("gris18");
9980 
9981  MainCanvas->Divide( 1, 1, x_margin, y_margin, fond_pad);
9982  // Divide(nx, ny, x_margin, y_margin, color);
9983 
9984  gPad->cd(1);
9985  main_subpad = gPad;
9986  main_subpad->SetPad(x_low, y_low, x_up, y_up);
9987 
9988  xMemoPlotSame = 0;
9989  }
9990  //========================================= Options SAME and SAME n (HistimePlot)
9991  if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
9992  {
9993  if(GetMemoFlag(HistoCode, opt_plot) == "Free")
9994  {
9995  if( fPavComGeneralTitle != 0 ){fPavComGeneralTitle->Draw();}
9996  fPavComSeveralChanging->Draw();
9997 
9998  fPavComEvolRuns->Draw();
9999 
10000  if( !( HistoType == "Global" || HistoType == "Proj" ||
10001  HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10002  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date") )
10003  {
10004  fPavComStin->Draw();
10005  fPavComXtal->Draw();
10006  }
10007 
10008  if( !( HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10009  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ) )
10010  {
10011  fPavComXtal->Draw();
10012  }
10013  //Call to SetParametersPavTxt
10014  //fPavTxt<HISTOCODE> = fPavComSeveralChanging; => come from SetAllPavesViewHisto
10015  SetParametersPavTxt(HistoCode, opt_plot);
10016 
10017  //---------------- Call to ActivePavTxt
10018  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
10019  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
10020 
10021  //-------------------- Set texts for pave "several changing", options SAME and SAME n (HistimePlot)
10022  main_pavtxt->SetTextAlign(fTextPaveAlign);
10023  main_pavtxt->SetTextFont(fTextPaveFont);
10024  main_pavtxt->SetTextSize(fTextPaveSize);
10025  main_pavtxt->SetBorderSize(fTextBorderSize);
10026 
10027  char* f_in = new char[fgMaxCar]; fCnew++;
10028 
10029  TString DecalStexName = "";
10030  if( fFlagSubDet == "EB" ){DecalStexName = " ";}
10031  TString DecalStinName = "";
10032  if( fFlagSubDet == "EE" ){DecalStinName = " ";}
10033 
10034  TString sStexOrStasName = "";
10035  if( fFapStexNumber == 0 ){sStexOrStasName = " ";}
10036  if( fFapStexNumber != 0 ){sStexOrStasName = fFapStexName;}
10037 
10038 
10039  //-----------------------------> HistoType = "EvolProj" => treated in HistoPlot, not here.
10040  if(opt_plot == fSeveralPlot)
10041  {
10042  sprintf(f_in, "Analysis Samp Evts range Nb Evts %s%s %s%s %s",
10043  DecalStexName.Data(), sStexOrStasName.Data(),
10044  DecalStinName.Data(), fFapStinName.Data(), fFapEchaName.Data());
10045  }
10046  if(opt_plot == fSameOnePlot)
10047  {
10048  sprintf(f_in, "Analysis Samp Evts range Nb Evts %s%s %s%s %s",
10049  DecalStexName.Data(), sStexOrStasName.Data(),
10050  DecalStinName.Data(), fFapStinName.Data(), fFapEchaName.Data());
10051  }
10052 
10053  //................................................................... (HistimePlot)
10054  TText* ttit = main_pavtxt->AddText(f_in);
10055  ttit->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10056 
10057  if(opt_plot == fSeveralPlot)
10058  {
10059  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d",
10060  fFapAnaType.Data(), fFapNbOfSamples,
10062  Stex_StinCons, n1StexCrys);
10063  }
10064  if(opt_plot == fSameOnePlot)
10065  {
10066  sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d %-25s",
10067  fFapAnaType.Data(), fFapNbOfSamples,
10069  Stex_StinCons, n1StexCrys, QuantityName.Data());
10070  }
10071 
10072  TText* tt = main_pavtxt->AddText(f_in);
10073  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
10074 
10075  delete [] f_in; f_in = 0; fCdelete++;
10076 
10077  //---------- Draw the "several changing" pave with its text in the Canvas (FIRST TIME) (HistimePlot)
10078  main_pavtxt->Draw();
10079 
10080  //---------------- Call to SetParametersCanvas
10081  //fImp<HISTOCODE> = (TRootCanvas*)fCanv<HISTOCODE>->GetCanvasImp();
10082  //fCanv<HISTOCODE>->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
10083  //fPad<HISTOCODE> = gPad;
10084  //fMemoPlot<HISTOCODE> = 1; =======> set MemoFlag to "Buzy"
10085  //fMemoColor<HISTOCODE> = 0;
10086  SetParametersCanvas(HistoCode, opt_plot);
10087 
10088  //---------------- Set xMemoPlotSame to 0
10089  xMemoPlotSame = 0;
10090  }
10091 
10092  //............................ cases fMemoPlotxxx = 1 (HistimePlot)
10093  if(GetMemoFlag(HistoCode, opt_plot) == "Busy")
10094  {
10095  //---------------- Call to ActivePavTxt
10096  // main_pavtxt = fPavTxt<HISTOCODE>;} (return main_pavtxt)
10097  main_pavtxt = ActivePavTxt(HistoCode.Data(), opt_plot.Data());
10098 
10099  //---------------- Call to ActivePad
10100  //if( (TRootCanvas*)fCanv<HISTOCODE>->GetCanvasImp() == fImp<HISTOCODE> ){
10101  // main_subpad = fPad<HISTOCODE>;} (return main_subpad)
10102  main_subpad = ActivePad(HistoCode.Data(), opt_plot.Data()); // => return 0 if canvas has been closed
10103 
10104  //---------------- Recover pointer to the current canvas
10105  MainCanvas = GetCurrentCanvas(HistoCode.Data(), opt_plot.Data());
10106  }
10107  }
10108 
10109  //============================================================================= (HistimePlot)
10110  //
10111  // 2nd OPERATIONS: Write and Draw the parameter values in the
10112  // "several changing" pave (options SAME and SAME n)
10113  // Draw Histo
10114  //=============================================================================
10115  if(main_subpad != 0)
10116  {
10117  if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
10118  {
10119  if(xMemoPlotSame != 0)
10120  {
10121  main_pavtxt->SetTextAlign(fTextPaveAlign);
10122  main_pavtxt->SetTextFont(fTextPaveFont);
10123  main_pavtxt->SetTextSize(fTextPaveSize);
10124  main_pavtxt->SetBorderSize(fTextBorderSize);
10125 
10126  char* f_in = new char[fgMaxCar]; fCnew++;
10127 
10128  if(opt_plot == fSeveralPlot )
10129  {sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d",
10131  sFapStexNumber.Data(), Stex_StinCons, n1StexCrys);}
10132  if(opt_plot == fSameOnePlot )
10133  {sprintf(f_in, "%-10s 1-%2d %5d-%5d %7d %5s%6d%7d %-25s",
10135  sFapStexNumber.Data(), Stex_StinCons, n1StexCrys, QuantityName.Data());}
10136 
10137  TText *tt = main_pavtxt->AddText(f_in);
10138  tt->SetTextColor(GetViewHistoColor(HistoCode, opt_plot));
10139  MainCanvas->cd(); gStyle->SetOptDate(0);
10140  main_pavtxt->Draw();
10141 
10142  delete [] f_in; f_in = 0; fCdelete++;
10143  }
10144  main_subpad->cd();
10145  Double_t x_low = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
10146  Double_t x_up = fCnaParHistos->BoxRightX("bottom_right_box") + 0.005;
10147  Double_t y_low = fCnaParHistos->BoxTopY("several_evol_box") + 0.005;
10148  Double_t y_up = fCnaParHistos->BoxBottomY("general_comment") - 0.005;
10149  if( opt_plot == fSameOnePlot ){y_up = fCnaParHistos->BoxBottomY("top_left_box_EB") - 0.005;}
10150  main_subpad->SetPad(x_low, y_low, x_up, y_up);
10151  }
10152 
10153  //............................................ Style (HistimePlot)
10154  SetViewGraphColors(g_graph0, HistoCode, opt_plot);
10155 
10156  //................................. Set axis titles
10157  TString axis_x_var_name = SetHistoXAxisTitle(HistoCode);
10158  TString axis_y_var_name = SetHistoYAxisTitle(HistoCode);
10159  g_graph0->GetXaxis()->SetTitle(axis_x_var_name);
10160  g_graph0->GetYaxis()->SetTitle(axis_y_var_name);
10161 
10162  //................................. Xaxis is a time axis
10163  g_graph0->GetXaxis()->SetTimeDisplay(1);
10164  g_graph0->GetXaxis()->SetTimeFormat("%d %b-%Hh");
10165 
10166  g_graph0->GetXaxis()->SetTimeOffset(xinf);
10167 
10168  Int_t nb_displayed = fCnaParHistos->GetNbOfRunsDisplayed(); // max nb of run numbers displayed
10169 
10170  //........................................................................... (HistimePlot)
10171  Int_t liny = 0;
10172  Int_t logy = 1;
10173 
10174  if(opt_plot == fOnlyOnePlot)
10175  {
10176  fXinf = (Double_t)xinf;
10177  fXsup = (Double_t)xsup;
10178  fYinf = (Double_t)GetYminValueFromMemo(HistoCode);
10179  fYsup = (Double_t)GetYmaxValueFromMemo(HistoCode);
10180 
10181  gPad->RangeAxis(fXinf, fYinf, fXsup, fYsup);
10182 
10183  //if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(liny);}
10184  if(opt_scale_y == fOptScaleLogy){gPad->SetLogy(logy); g_graph0->Draw("ALP");}
10185 
10186  if(opt_scale_y == fOptScaleLiny)
10187  {
10188  gPad->SetLogy(liny);
10189  g_graph0->Draw("ALP");
10190  Int_t nb_pts = g_graph0->GetN();
10191  Double_t* coord_x = g_graph0->GetX();
10192  Double_t* coord_y = g_graph0->GetY();
10193 
10194  char* f_in = new char[fgMaxCar]; fCnew++;
10195 
10196  //................. display of the run numbers (HistimePlot)
10197  Double_t interv_displayed = (coord_x[nb_pts-1] - coord_x[0])/(Double_t)nb_displayed;
10198  Double_t last_drawn_coordx = coord_x[0] - 1.5*interv_displayed;
10199 
10200  for(Int_t i_run=0; i_run<nb_pts; i_run++)
10201  {
10202  if ( (coord_x[i_run] - last_drawn_coordx) > interv_displayed )
10203  {
10204  Double_t joinYinf = fYinf;
10205  Double_t joinYsup = fYsup;
10206  if( joinYsup <= joinYinf )
10207  {
10208  joinYinf =
10210  joinYsup =
10212  joinYsup = joinYsup + (joinYsup-joinYinf)/20.;
10213  }
10214 
10215  sprintf( f_in, "R%d", fT1DRunNumber[i_run]);
10216  TText *text_run_num = new TText(coord_x[i_run], joinYsup, f_in); fCnewRoot++;
10217  text_run_num->SetTextAngle((Double_t)45.);
10218  text_run_num->SetTextSize((Double_t)0.035);
10219  text_run_num->Draw("SAME");
10220  // delete text_StexStin_num; fCdeleteRoot++;
10221 
10222  TLine *jointlign;
10223  jointlign = new TLine(coord_x[i_run], joinYsup, coord_x[i_run], coord_y[i_run]); fCnewRoot++;
10224  jointlign->SetLineWidth(1);
10225  jointlign->SetLineStyle(2);
10226  jointlign->Draw("SAME");
10227  // delete jointlign; fCdeleteRoot++;
10228 
10229  last_drawn_coordx = coord_x[i_run]; // (HistimePlot)
10230  }
10231  }
10232 
10233  delete [] f_in; f_in = 0; fCdelete++;
10234 
10235  }
10236  if(opt_scale_y == fOptScaleLogy)
10237  {
10238  gPad->SetLogy(logy);
10239  g_graph0->Draw("ALP");
10240  }
10241  }
10242 
10243  //...................................................................... (HistimePlot)
10244  if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot)
10245  {
10246  if(xMemoPlotSame == 0)
10247  {
10248  if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(liny);}
10249  if(opt_scale_y == fOptScaleLogy){gPad->SetLogy(logy);
10250 }
10251  g_graph0->Draw("ALP");
10252 
10253  fXinf = (Double_t)xinf;
10254  fXsup = (Double_t)xsup;
10255  fYinf = (Double_t)GetYminValueFromMemo(HistoCode);
10256  fYsup = (Double_t)GetYmaxValueFromMemo(HistoCode);
10257 
10258  gPad->RangeAxis(fXinf, fYinf, fXsup, fYsup);
10259  }
10260 
10261  if(xMemoPlotSame != 0) // (HistimePlot)
10262  {
10263  if(opt_scale_y == fOptScaleLiny){gPad->SetLogy(liny);}
10264  if(opt_scale_y == fOptScaleLogy){gPad->SetLogy(logy);}
10265 
10266  g_graph0->Draw("LP");
10267  }
10268  }
10269  gPad->Update();
10270  }
10271  else // else du if(main_subpad !=0)
10272  {
10273  cout << "*TEcnaHistos::HistimePlot(...)> Canvas not found. Previously closed in option SAME."
10274  << fTTBELL << endl;
10275 
10276  ReInitCanvas(HistoCode, opt_plot);
10277  xMemoPlotSame = 0;
10278  }
10279 
10280  // delete MainCanvas; fCdeleteRoot++;
10281 
10282 } // end of HistimePlot
10283 
10284 //------------------------------------------------------------------------------------------------------
10285 void TEcnaHistos::TopAxisForHistos(TH1D* h_his0, const TString opt_plot,
10286  const Int_t& xMemoPlotSame, const Int_t& min_value, const Int_t& max_value,
10287  const Int_t& xFlagAutoYsupMargin, const Int_t& HisSize)
10288 {
10289 // Axis on top of the plot to indicate the Stin numbers
10290 
10291  if( opt_plot == fOnlyOnePlot ||
10292  ( (opt_plot == fSeveralPlot) && (xMemoPlotSame == 0) ) ||
10293  ( (opt_plot == fSameOnePlot) && (xMemoPlotSame == 0) ) )
10294  {
10295  Double_t Maxih = (Double_t)h_his0->GetMaximum();
10296  Double_t Minih = (Double_t)h_his0->GetMinimum();
10297 
10298  if(xFlagAutoYsupMargin == 1)
10299  {
10300  if( Minih >= Maxih ){Minih = (Double_t)0.; Maxih += Maxih;} // ROOT default if ymin >= ymax
10301  Double_t MaxMarginFactor = (Double_t)0.05; // frame top line = 5% above the maximum
10302  Maxih += (Maxih-Minih)*MaxMarginFactor; // ROOT default if ymin < ymax
10303  }
10304 
10305  Double_t v_min = min_value;
10306  Double_t v_max = max_value+1;
10307  Int_t ndiv = 50207;
10308  TString opt = "B-";
10309  Double_t Xbegin = 0.;
10310  Double_t Xend = (Double_t)HisSize;
10311  Double_t ticks = 0.05;
10312 
10313  if( fFapStexNumber == 0 && fFlagSubDet == "EE" )
10314  {
10315  v_min = 0;
10316  v_max = max_value;
10317  ndiv = 4;
10318  opt = "CSU"; // first draw axis with ticksize and no label
10319  Xbegin = (Double_t)HisSize;
10320  Xend = 0.;
10321  }
10322 
10323  if( fFapStexNumber > 0 && fFlagSubDet == "EE" )
10324  {
10325  ticks = 0;
10326  if( fFapStexNumber == 1 )
10327  {
10328  v_min = min_value;
10329  v_max = max_value+0.5;
10330  Xbegin = (Double_t)HisSize;
10331  Xend = 0.;
10332  opt = "CSU"; // first draw axis with no ticksize and no label
10333  }
10334  if( fFapStexNumber == 2 )
10335  {
10336  v_min = min_value+0.5;
10337  v_max = max_value+1.;
10338  Xbegin = (Double_t)HisSize;
10339  Xend = 0.;
10340  opt = "CSU"; // first draw axis with no ticksize and no label
10341  }
10342  if( fFapStexNumber == 3 )
10343  {
10344  v_min = min_value+0.5;
10345  v_max = max_value+1.;
10346  Xbegin = 0.;
10347  Xend = (Double_t)HisSize;
10348  opt = "-CSU"; // first draw axis with no ticksize and no label
10349  }
10350  if( fFapStexNumber == 4 )
10351  {
10352  v_min = min_value;
10353  v_max = max_value+0.5;
10354  Xbegin = 0.;
10355  Xend = (Double_t)HisSize;
10356  opt = "-CSU"; // first draw axis with no ticksize and no label
10357  }
10358  v_min -= 1;
10359  v_max -= 1;
10360  ndiv = 5;
10361  }
10362 
10363  TGaxis* top_axis_x = 0;
10364 
10365  top_axis_x = new TGaxis(Xbegin, Maxih, Xend, Maxih,
10366  v_min, v_max, ndiv, opt, 0.); fCnewRoot++;
10367 
10368  top_axis_x->SetTickSize(ticks);
10369  top_axis_x->SetTitleOffset((Float_t)(1.2));
10370  top_axis_x->SetLabelOffset((Float_t)(0.005));
10371 
10372  TString x_var_name = "?";
10373  Int_t MaxCar = fgMaxCar;
10374  x_var_name.Resize(MaxCar);
10375  if( fFapStexNumber > 0 )
10376  {
10377  if( fFlagSubDet == "EB"){x_var_name = "Tower number";}
10378  if( fFlagSubDet == "EE")
10379  {
10380  x_var_name = " ";
10381  // x_var_name = " Data sector"; // don't remove the space characters !
10382  }
10383  }
10384  if( fFapStexNumber == 0 )
10385  {
10386  if( fFlagSubDet == "EB"){x_var_name = "SM number";}
10387  if( fFlagSubDet == "EE"){x_var_name = " ";}
10388  }
10389  top_axis_x->SetTitle(x_var_name);
10390  top_axis_x->Draw("SAME");
10391 
10392  if( fFlagSubDet == "EE" )
10393  {
10394  // redraw axis with ticksize = 0, with labelOffset<0 or >0 and div centered in middle division
10395  opt = "-MS";
10396  if(fFapStexNumber == 1 || fFapStexNumber == 2 ){opt = "-MS";}
10397  if(fFapStexNumber == 3 || fFapStexNumber == 4 ){opt = "MS";}
10398  ndiv = 4;
10399  if( fFapStexNumber > 0 ){ndiv = 5;}
10400  TGaxis* top_axis_x_bis = 0;
10401  top_axis_x_bis = new TGaxis(Xbegin, Maxih, Xend, Maxih,
10402  v_min+1, v_max+1, ndiv, opt, 0.); fCnewRoot++;
10403  top_axis_x_bis->SetTickSize(0.);
10404  Float_t lab_siz_x = top_axis_x->GetLabelSize();
10405  top_axis_x_bis->SetLabelSize(lab_siz_x);
10406  top_axis_x_bis->SetLabelOffset(-0.1);
10407 
10408  top_axis_x_bis->SetLabelOffset((Float_t)(9999.));
10409  // if(fFapStexNumber == 1 || fFapStexNumber == 2 ){top_axis_x_bis->SetLabelOffset(-0.07);}
10410  // if(fFapStexNumber == 3 || fFapStexNumber == 4 ){top_axis_x_bis->SetLabelOffset(-0.05);}
10411  // if(fFapStexNumber == 0 )
10412  // {top_axis_x_bis->SetLabelOffset((Float_t)(9999.));} // keep the tick and remove the value
10413  top_axis_x_bis->Draw("SAME");
10414  }
10415  }
10416 } // end of TopAxisForHistos
10417 
10418 //............................................................................................
10420 {
10421 // Put the general comment pave
10422 
10423  SetGeneralTitle(title);
10424 }
10425 //............................................................................................
10426 void TEcnaHistos::SetAllPavesViewMatrix(const TString MatrixElement,
10427  const Int_t& StexStin_A, const Int_t& StexStin_B,
10428  const Int_t& i0StinEcha)
10429 {
10430 // Put all the paves of a matrix view
10431 
10433 
10435 
10436  if(MatrixElement == fLFBetweenChannels || MatrixElement == fHFBetweenChannels)
10437  {fPavComStin = fCnaParHistos->SetPaveStinsXY(StexStin_A, StexStin_B);}
10438  if(MatrixElement == fBetweenSamples)
10439  {
10441 
10442  if( fFlagSubDet == "EB" )
10443  {Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
10444  fPavComXtal = fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha);}
10445  if( fFlagSubDet == "EE" )
10447  Int_t n1StexCrys = fEcalNumbering->Get1StexCrysFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha, fFapStexNumber);
10448  fPavComXtal = fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha);}
10449  }
10450 
10454 }
10455 
10456 void TEcnaHistos::SetAllPavesViewStin(const Int_t& StexStin_A)
10457 {
10458 // Put all the paves of a Stin view
10459 
10462 
10464 
10468 }
10469 
10470 void TEcnaHistos::SetAllPavesViewStinCrysNb(const Int_t& StexNumber, const Int_t& StexStin_A)
10471 {
10472 // Put all the paves of a crystal numbering Stin view
10473 
10474  fPavComStex = fCnaParHistos->SetPaveStex("standard", StexNumber);
10475  fPavComStin = fCnaParHistos->SetPaveStin(StexStin_A, StexNumber);
10476 
10477  if( fFlagSubDet == "EB")
10478  {fPavComLVRB = fCnaParHistos->SetPaveLVRB(StexNumber, StexStin_A);}
10479  if( fFlagSubDet == "EE")
10480  {fPavComCxyz = fCnaParHistos->SetPaveCxyz(StexNumber);}
10481 }
10482 
10483 void TEcnaHistos::SetAllPavesViewStex(const TString chopt, const Int_t& StexNumber)
10484 {
10485  if( chopt == "Numbering" )
10486  {
10487  fCnaParHistos->SetViewHistoStyle("Stex2DEENb");
10488  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10489  fPavComStex = fCnaParHistos->SetPaveStex("standStex", StexNumber);
10490  if( fFlagSubDet == "EE" ){fPavComCxyz = fCnaParHistos->SetPaveCxyz(StexNumber);}
10491  }
10492  else
10493  {
10494  SetAllPavesViewStex(StexNumber);
10495  }
10496 }
10497 // end of SetAllPavesViewStex(...,...)
10498 
10499 void TEcnaHistos::SetAllPavesViewStex(const Int_t& StexNumber)
10500 {
10501  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10503  fPavComStex = fCnaParHistos->SetPaveStex("standStex", StexNumber);
10504 
10505  TString opt_pave_nbcol = "OneCol";
10506  if( fFapStexName == "SM"){opt_pave_nbcol = "TwoCol";}
10507 
10511 }
10512 // end of SetAllPavesViewStex(...)
10513 
10515 {
10516  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10519 
10523 }
10524 // end of SetAllPavesViewStas
10525 
10526 void TEcnaHistos::SetAllPavesViewHisto(const TString HistoCode,
10527  const Int_t& StexStin_A, const Int_t& i0StinEcha,
10528  const Int_t& iSample, const TString opt_plot)
10529 {
10530 // Put all the paves of a histo view according to HistoCode
10531 
10532  gStyle->SetTextColor(fCnaParHistos->ColorDefinition("noir"));
10533 
10534  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
10535 
10537 
10538  if(opt_plot == fOnlyOnePlot)
10539  {
10540  if( !( HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" ||
10541  HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs" ||
10542  HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" ||
10543  HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs" ||
10544  HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" ||
10545  HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" ||
10546  HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs" ) )
10547  {
10550  }
10551  else
10552  {
10553  if( HistoCode == "D_NOE_ChNb" ||
10554  HistoCode == "D_Ped_ChNb" || HistoCode == "D_TNo_ChNb" ||
10555  HistoCode == "D_MCs_ChNb" || HistoCode == "D_LFN_ChNb" ||
10556  HistoCode == "D_HFN_ChNb" || HistoCode == "D_SCs_ChNb" )
10558  else
10560  }
10561 
10562  //.................................................... (SetAllPavesViewHisto)
10563 
10564  if( HistoCode == "D_MSp_Samp" || HistoCode == "D_SSp_Samp" ||
10565  HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10566  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
10567  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
10568  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
10569  {
10570  Int_t n1StexCrys =
10572  fPavComXtal = fCnaParHistos->SetPaveCrystal(n1StexCrys, StexStin_A, i0StinEcha);
10573  }
10574  if( HistoCode == "D_Adc_EvDs" || HistoCode == "D_Adc_EvNb")
10575  {
10576  Int_t n1StexCrys =
10578  fPavComXtal = fCnaParHistos->SetPaveCrystalSample(n1StexCrys, StexStin_A, i0StinEcha, iSample);
10579  }
10580 
10581  if( HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10582  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
10583  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
10584  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
10585  {
10590  fStopEvolRun, fStopEvolDate, opt_plot, HistoType);
10591  }
10592  else
10593  {
10597  }
10598  }
10599 
10600  //.................................................... (SetAllPavesViewHisto)
10601 
10602  if( opt_plot == fSeveralPlot && GetMemoFlag(HistoCode, opt_plot) == "Free" )
10603  {
10604  if( HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10605  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
10606  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
10607  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
10608  {
10611  fStopEvolRun, fStopEvolDate, opt_plot, HistoType);
10612  }
10613  else
10614  {
10616  }
10617  }
10618 
10619  if( opt_plot == fSameOnePlot && GetMemoFlag(HistoCode, opt_plot) == "Free" )
10620  {
10623  fStopEvolRun, fStopEvolDate, opt_plot, HistoType);
10624  }
10625 
10626 }
10627 // end of SetAllPavesViewHisto
10628 
10629 TString TEcnaHistos::SetCanvasName(const TString HistoCode,
10630  const Int_t& opt_scale_x, const Int_t& opt_scale_y,
10631  const TString opt_plot, const Int_t& StexStin_A,
10632  const Int_t& i0StinEcha, const Int_t& iSample)
10633 {
10634  //......... Set Canvas name *===> FOR 1D HISTO ONLY
10635  // (for 2D histos, see inside ViewMatrix, ViewStex,...)
10636 
10637  TString canvas_name;
10638  Int_t MaxCar = fgMaxCar;
10639  canvas_name.Resize(MaxCar);
10640  canvas_name = "?";
10641 
10642  char* f_in = new char[fgMaxCar]; fCnew++;
10643 
10644  //......................... name_ opt_plot (Set Canvas name)
10645  TString name_opt_plot;
10646  MaxCar = fgMaxCar;
10647  name_opt_plot.Resize(MaxCar);
10648  name_opt_plot = "?";
10649  if(opt_plot == fOnlyOnePlot){name_opt_plot = "P1";} // Only one plot
10650  if(opt_plot == fSeveralPlot)
10651  {
10652  name_opt_plot = "SAME_N";
10653  //...................................... name_same (opt_plot = fSeveralPlot)
10654  Int_t name_same = -1;
10655 
10656  if(HistoCode == "D_NOE_ChNb"){name_same = fCanvSameD_NOE_ChNb;}
10657  if(HistoCode == "D_NOE_ChDs"){name_same = fCanvSameD_NOE_ChDs;}
10658  if(HistoCode == "D_Ped_ChNb"){name_same = fCanvSameD_Ped_ChNb;}
10659  if(HistoCode == "D_Ped_ChDs"){name_same = fCanvSameD_Ped_ChDs;}
10660  if(HistoCode == "D_TNo_ChNb"){name_same = fCanvSameD_TNo_ChNb;}
10661  if(HistoCode == "D_TNo_ChDs"){name_same = fCanvSameD_TNo_ChDs;}
10662  if(HistoCode == "D_MCs_ChNb"){name_same = fCanvSameD_MCs_ChNb;}
10663  if(HistoCode == "D_MCs_ChDs"){name_same = fCanvSameD_MCs_ChDs;}
10664  if(HistoCode == "D_LFN_ChNb"){name_same = fCanvSameD_LFN_ChNb;}
10665  if(HistoCode == "D_LFN_ChDs"){name_same = fCanvSameD_LFN_ChDs;}
10666  if(HistoCode == "D_HFN_ChNb"){name_same = fCanvSameD_HFN_ChNb;}
10667  if(HistoCode == "D_HFN_ChDs"){name_same = fCanvSameD_HFN_ChDs;}
10668  if(HistoCode == "D_SCs_ChNb"){name_same = fCanvSameD_SCs_ChNb;}
10669  if(HistoCode == "D_SCs_ChDs"){name_same = fCanvSameD_SCs_ChDs;}
10670  if(HistoCode == "D_MSp_Samp"){name_same = fCanvSameD_MSp_Samp;}
10671  if(HistoCode == "D_SSp_Samp"){name_same = fCanvSameD_SSp_Samp;}
10672  if(HistoCode == "D_Adc_EvDs"){name_same = fCanvSameD_Adc_EvDs;}
10673  if(HistoCode == "D_Adc_EvNb"){name_same = fCanvSameD_Adc_EvNb;}
10674  if(HistoCode == "H_Ped_Date"){name_same = fCanvSameH_Ped_Date;}
10675  if(HistoCode == "H_TNo_Date"){name_same = fCanvSameH_TNo_Date;}
10676  if(HistoCode == "H_MCs_Date"){name_same = fCanvSameH_MCs_Date;}
10677  if(HistoCode == "H_LFN_Date"){name_same = fCanvSameH_LFN_Date;}
10678  if(HistoCode == "H_HFN_Date"){name_same = fCanvSameH_HFN_Date;}
10679  if(HistoCode == "H_SCs_Date"){name_same = fCanvSameH_SCs_Date;}
10680  if(HistoCode == "H_Ped_RuDs"){name_same = fCanvSameH_Ped_RuDs;}
10681  if(HistoCode == "H_TNo_RuDs"){name_same = fCanvSameH_TNo_RuDs;}
10682  if(HistoCode == "H_MCs_RuDs"){name_same = fCanvSameH_MCs_RuDs;}
10683  if(HistoCode == "H_LFN_RuDs"){name_same = fCanvSameH_LFN_RuDs;}
10684  if(HistoCode == "H_HFN_RuDs"){name_same = fCanvSameH_HFN_RuDs;}
10685  if(HistoCode == "H_SCs_RuDs"){name_same = fCanvSameH_SCs_RuDs;}
10686 
10687  sprintf(f_in,"%d", name_same);
10688  TString s_name_same = f_in;
10689  const Text_t *t_name_same = (const Text_t *)s_name_same.Data();
10690  name_opt_plot.Append(t_name_same);
10691  }
10692  if(opt_plot == fSameOnePlot)
10693  {
10694  name_opt_plot = "SAME_Plus_N";
10695  //...................................... name_same (opt_plot = fSeveralPlot)
10696  Int_t name_same = fCanvSameH1SamePlus;
10697  sprintf(f_in,"%d", name_same);
10698  TString s_name_same = f_in;
10699  const Text_t *t_name_same = (const Text_t *)s_name_same.Data();
10700  name_opt_plot.Append(t_name_same);
10701  }
10702 
10703  //......................... name_visu (Set Canvas name)
10704  TString name_visu;
10705  MaxCar = fgMaxCar;
10706  name_visu.Resize(MaxCar);
10707  name_visu = "";
10708 
10709  TString name_line;
10710  MaxCar = fgMaxCar;
10711  name_line.Resize(MaxCar);
10712  name_line = "Line_";
10713  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
10714  if( HistoType == "Global" && (opt_plot == fSeveralPlot || opt_plot == fSameOnePlot) ){name_line = "Polm_";}
10715 
10716  // if(opt_visu == fOptVisLine){name_line = "Line_";}
10717  // if(opt_visu == fOptVisPolm){name_line = "Poly_";}
10718 
10719  const Text_t *t_line = (const Text_t *)name_line.Data();
10720  name_visu.Append(t_line);
10721 
10722  TString name_scale_x;
10723  MaxCar = fgMaxCar;
10724  name_scale_x.Resize(MaxCar);
10725  name_scale_x = "?";
10726  if(opt_scale_x == fOptScaleLinx){name_scale_x = "LinX_";}
10727  if(opt_scale_x == fOptScaleLogx){name_scale_x = "LogX_";}
10728  const Text_t *t_scale_x = (const Text_t *)name_scale_x.Data();
10729  name_visu.Append(t_scale_x);
10730 
10731  TString name_scale_y;
10732  MaxCar = fgMaxCar;
10733  name_scale_y.Resize(MaxCar);
10734  name_scale_y = "?";
10735  if(opt_scale_y == fOptScaleLiny){name_scale_y = "LinY";}
10736  if(opt_scale_y == fOptScaleLogy){name_scale_y = "LogY";}
10737  const Text_t *t_scale_y = (const Text_t *)name_scale_y.Data();
10738  name_visu.Append(t_scale_y);
10739 
10740  //...................................... name quantity (Set Canvas name)
10741  TString name_quantity;
10742  MaxCar = fgMaxCar;
10743  name_quantity.Resize(MaxCar);
10744  name_quantity = "?";
10745 
10746  if(HistoCode == "D_NOE_ChNb"){name_quantity = "Nb_of_evts_as_func_of_Xtal";}
10747  if(HistoCode == "D_NOE_ChDs"){name_quantity = "Nb_of_evts_Xtal_distrib";}
10748  if(HistoCode == "D_Ped_ChNb"){name_quantity = "Pedestals_as_func_of_Xtal";}
10749  if(HistoCode == "D_Ped_ChDs"){name_quantity = "Pedestals_Xtal_distrib";}
10750  if(HistoCode == "D_TNo_ChNb"){name_quantity = "Total_Noise_as_func_of_Xtal";}
10751  if(HistoCode == "D_TNo_ChDs"){name_quantity = "Total_Noise_Xtal_distrib";}
10752  if(HistoCode == "D_MCs_ChNb"){name_quantity = "Mean_Corss_as_func_of_Xtal";}
10753  if(HistoCode == "D_MCs_ChDs"){name_quantity = "Mean_Corss_Xtal_distrib";}
10754  if(HistoCode == "D_LFN_ChNb"){name_quantity = "Low_Fq_Noise_as_func_of_Xtal";}
10755  if(HistoCode == "D_LFN_ChDs"){name_quantity = "Low_Fq_Noise_Xtal_distrib";}
10756  if(HistoCode == "D_HFN_ChNb"){name_quantity = "High_Fq_Noise_as_func_of_Xtal";}
10757  if(HistoCode == "D_HFN_ChDs"){name_quantity = "High_Fq_Noise_Xtal_distrib";}
10758  if(HistoCode == "D_SCs_ChNb"){name_quantity = "Sigma_Corss_as_func_of_Xtal";}
10759  if(HistoCode == "D_SCs_ChDs"){name_quantity = "Sigma_Corss_Xtal_distrib";}
10760  if(HistoCode == "D_MSp_Samp"){name_quantity = "ExpValue_of_samples";}
10761  if(HistoCode == "D_SSp_Samp"){name_quantity = "Sigma_of_samples";}
10762  if(HistoCode == "D_Adc_EvDs"){name_quantity = "hevt";}
10763  if(HistoCode == "D_Adc_EvNb"){name_quantity = "ADC_as_func_of_Event";}
10764  if(HistoCode == "H_Ped_Date"){name_quantity = "Pedestal_history";}
10765  if(HistoCode == "H_TNo_Date"){name_quantity = "Total_Noise_history";}
10766  if(HistoCode == "H_MCs_Date"){name_quantity = "Mean_Corss_history";}
10767  if(HistoCode == "H_LFN_Date"){name_quantity = "Low_Fq_Noise_history";}
10768  if(HistoCode == "H_HFN_Date"){name_quantity = "High_Fq_Noise_history";}
10769  if(HistoCode == "H_SCs_Date"){name_quantity = "Sigma_Corss_history";}
10770  if(HistoCode == "H_Ped_RuDs"){name_quantity = "Pedestal_run_distribution";}
10771  if(HistoCode == "H_TNo_RuDs"){name_quantity = "Total_Noise_run_distribution";}
10772  if(HistoCode == "H_MCs_RuDs"){name_quantity = "Mean_Corss_run_distribution";}
10773  if(HistoCode == "H_LFN_RuDs"){name_quantity = "Low_Fq_Noise_run_distribution";}
10774  if(HistoCode == "H_HFN_RuDs"){name_quantity = "High_Fq_Noise_run_distribution";}
10775  if(HistoCode == "H_SCs_RuDs"){name_quantity = "Sigma_Corss_run_distribution";}
10776 
10777  Int_t num_crys = -1;
10778  if(HistoCode == "D_MSp_Samp"){num_crys = i0StinEcha;}
10779  if(HistoCode == "D_SSp_Samp"){num_crys = i0StinEcha;}
10780  if(HistoCode == "D_Adc_EvDs"){num_crys = i0StinEcha;}
10781  if(HistoCode == "D_Adc_EvNb"){num_crys = i0StinEcha;}
10782  if(HistoCode == "H_Ped_Date"){num_crys = i0StinEcha;}
10783  if(HistoCode == "H_TNo_Date"){num_crys = i0StinEcha;}
10784  if(HistoCode == "H_MCs_Date"){num_crys = i0StinEcha;}
10785  if(HistoCode == "H_LFN_Date"){num_crys = i0StinEcha;}
10786  if(HistoCode == "H_HFN_Date"){num_crys = i0StinEcha;}
10787  if(HistoCode == "H_SCs_Date"){num_crys = i0StinEcha;}
10788  if(HistoCode == "H_Ped_RuDs"){num_crys = i0StinEcha;}
10789  if(HistoCode == "H_TNo_RuDs"){num_crys = i0StinEcha;}
10790  if(HistoCode == "H_MCs_RuDs"){num_crys = i0StinEcha;}
10791  if(HistoCode == "H_LFN_RuDs"){num_crys = i0StinEcha;}
10792  if(HistoCode == "H_HFN_RuDs"){num_crys = i0StinEcha;}
10793  if(HistoCode == "H_SCs_RuDs"){num_crys = i0StinEcha;}
10794 
10795  Int_t num_samp = -1;
10796  if(HistoCode == "D_Adc_EvDs"){num_samp = iSample;}
10797  if(HistoCode == "D_Adc_EvNb"){num_samp = iSample;}
10798 
10799  //........................................................... (Set Canvas name)
10800 
10801  if (HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" ||
10802  HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs" ||
10803  HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs" ||
10804  HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" ||
10805  HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" ||
10806  HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" ||
10807  HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs" )
10808  {
10809  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%d_%s%d_%s_%s",
10810  name_quantity.Data(), fFapAnaType.Data(),
10812  fFapStexName.Data(), fFapStexNumber,
10813  name_opt_plot.Data(), name_visu.Data());
10814  }
10815 
10816  if (HistoCode == "D_MSp_Samp" || HistoCode == "D_SSp_Samp" ||
10817  HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
10818  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date" ||
10819  HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
10820  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs")
10821  {
10822  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%d_%s%d_%s%d_Xtal%d_%s_%s",
10823  name_quantity.Data(), fFapAnaType.Data(),
10825  fFapStexName.Data(), fFapStexNumber, fFapStinName.Data(), StexStin_A, num_crys,
10826  name_opt_plot.Data(), name_visu.Data());
10827  }
10828 
10829  if (HistoCode == "D_Adc_EvNb" || HistoCode == "D_Adc_EvDs")
10830  {
10831  sprintf(f_in, "%s_%s_S1_%d_R%d_%d_%d_%d_%s%d_%s%d_Xtal%d_Samp%d_%s_%s",
10832  name_quantity.Data(), fFapAnaType.Data(),
10834  fFapStexName.Data(), fFapStexNumber, fFapStinName.Data(), StexStin_A, num_crys, num_samp,
10835  name_opt_plot.Data(), name_visu.Data());
10836  }
10837 
10838  canvas_name = f_in;
10839  delete [] f_in; f_in = 0; fCdelete++;
10840  return canvas_name.Data();
10841 
10842 } // end of CanvasName()
10843 
10844 //-----------------------------------------------------------------------------
10845 //
10846 // M I S C E L L A N E O U S P A R A M E T E R S
10847 //
10848 // C O N C E R N I N G T H E D I S P L A Y
10849 //
10850 //-----------------------------------------------------------------------------
10851 
10852 //===========================================================================
10853 //
10854 // GetHistoSize, GetHistoValues, SetHistoXAxisTitle, SetHistoYAxisTitle,
10855 // GetHistoXinf, GetHistoXsup, GetHistoNumberOfBins, FillHisto
10856 //
10857 //===========================================================================
10858 Int_t TEcnaHistos::GetHistoSize(const TString chqcode, const TString opt_plot_read)
10859 {
10860 // Histo size as a function of the quantity code
10861 
10862 // VERY IMPORTANT: in some cases the number of bins must be strictly related to the parameters values
10863 // (number of crystals, number of samples, etc...). See below comments "===> ONE BIN BY..."
10864 
10865  Int_t HisSize = fNbBinsProj; // default value
10866 
10867  //............ histo with sample number as x coordinate => HisSize depends on option "plot" or "read"
10868  // because of nb of samples in file: size for plot = 10 even if nb of samples in file < 10
10869  if( chqcode == "D_MSp_Samp" || chqcode == "D_SSp_Samp" )
10870  {
10871  if( opt_plot_read == "read" ){HisSize = fFapNbOfSamples;}
10872  if( opt_plot_read == "plot" ){HisSize = fEcal->MaxSampADC();}
10873  } // ===> ONE BIN BY SAMPLE
10874 
10875  //............ histo with event number as x coordinate. (==> "D_Adc_EvDs" option: obsolete, to be confirmed)
10876  if(chqcode == "D_Adc_EvNb" || chqcode == "D_Adc_EvDs"){HisSize = fFapReqNbOfEvts;} // ===> ONE BIN BY EVENT
10877 
10878  //............
10879  if(chqcode == "D_NOE_ChNb" ||
10880  chqcode == "D_Ped_ChNb" || chqcode == "D_TNo_ChNb" || chqcode == "D_MCs_ChNb" ||
10881  chqcode == "D_LFN_ChNb" || chqcode == "D_HFN_ChNb" || chqcode == "D_SCs_ChNb" ||
10882  chqcode == "D_NOE_ChDs" ||
10883  chqcode == "D_Ped_ChDs" || chqcode == "D_TNo_ChDs" || chqcode == "D_MCs_ChDs" ||
10884  chqcode == "D_LFN_ChDs" || chqcode == "D_HFN_ChDs" || chqcode == "D_SCs_ChDs" )
10885  {
10886  if( fFlagSubDet == "EB" )
10887  {
10888  if( fFapStexNumber > 0 ){HisSize = fEcal->MaxCrysEcnaInStex();} // ===> ONE BIN BY Xtal
10889  if( fFapStexNumber == 0 ){HisSize = fEcal->MaxSMInEB()*fEcal->MaxTowInSM();} // ===> ONE BIN BY Tower
10890  }
10891  if( fFlagSubDet == "EE" )
10892  {
10893  if( fFapStexNumber > 0 )
10894  {
10895  if( opt_plot_read == "read" ){HisSize = fEcal->MaxCrysEcnaInDee();}
10896  if( opt_plot_read == "plot" ){HisSize = fEcal->MaxCrysForConsInDee();}
10897  } // ===> ONE BIN BY Xtal
10898  if( fFapStexNumber == 0 )
10899  {HisSize = fEcal->MaxDeeInEE()*fEcal->MaxSCForConsInDee();} // ===> ONE BIN BY SC
10900  }
10901  }
10902 
10903  if( chqcode == "H_Ped_RuDs" || chqcode == "H_TNo_RuDs" || chqcode == "H_MCs_RuDs" ||
10904  chqcode == "H_LFN_RuDs" || chqcode == "H_HFN_RuDs" || chqcode == "H_SCs_RuDs" )
10905  {
10906  HisSize = fNbBinsProj;
10907  }
10908 
10909  return HisSize;
10910 }
10911 
10912 TVectorD TEcnaHistos::GetHistoValues(TEcnaRead* aMyRootFile, const TString HistoCode,
10913  const Int_t& HisSizePlot, const Int_t& HisSizeRead,
10914  const Int_t& StexStin_A, const Int_t& i0StinEcha, const Int_t& iSample,
10915  Int_t& i_data_exist)
10916 {
10917 // Histo values in a TVectorD. i_data_exist entry value = 0. Incremented in this method.
10918 
10919  fStartDate = aMyRootFile->GetStartDate();
10920  fStopDate = aMyRootFile->GetStopDate();
10921  fRunType = aMyRootFile->GetRunType();
10922 
10923  TVectorD plot_histo(HisSizePlot); for(Int_t i=0; i<HisSizePlot; i++){plot_histo(i)=(Double_t)0.;}
10924  TVectorD read_histo(HisSizeRead); for(Int_t i=0; i<HisSizeRead; i++){read_histo(i)=(Double_t)0.;}
10925 
10926  fStatusDataExist = kFALSE;
10927 
10928  if( HistoCode == "D_MSp_Samp" || HistoCode == "D_SSp_Samp" )
10929  {
10930  //====> For plots as a function of Sample# (read10->plot10, read3->plot10)
10931  if( HisSizeRead <= HisSizePlot )
10932  {
10933  if (HistoCode == "D_MSp_Samp")
10934  {read_histo = aMyRootFile->ReadSampleMeans(StexStin_A, i0StinEcha, HisSizeRead);
10935  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}}
10936 
10937  if (HistoCode == "D_SSp_Samp")
10938  {read_histo = aMyRootFile->ReadSampleSigmas(StexStin_A, i0StinEcha, HisSizeRead);
10939  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}}
10940 
10941  for(Int_t i=0; i<HisSizeRead; i++){plot_histo(i)=read_histo(i);}
10942  }
10943  else
10944  {
10945  cout << "!TEcnaHistos::GetHistoValues(...)> *** ERROR *** > HisSizeRead greater than HisSizePlot"
10946  << " for plot as a function of sample#. HisSizeRead = " << HisSizeRead
10947  << ", HisSizePlot = " << HisSizePlot << fTTBELL << endl;
10948  }
10949  }
10950  else
10951  {
10952  //====> For other plots
10953  if( HisSizeRead == HisSizePlot )
10954  {
10955  //========> for EE, HisSizeRead > HisSizePlot but readEcna#->plotForCons# will be build in the calling method
10956  // HisSizeRead = fEcal->MaxCrysEcnaInStex() (GetHistoValues)
10957 
10958  if( HistoCode == "D_Adc_EvNb" || HistoCode == "D_Adc_EvDs" )
10959  {Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(StexStin_A, i0StinEcha);
10960  read_histo = aMyRootFile->ReadSampleValues(i0StexEcha, iSample, HisSizeRead);
10961  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}}
10962 
10963 
10964  if( HistoCode == "D_NOE_ChNb" || HistoCode == "D_NOE_ChDs" )
10965  {read_histo = aMyRootFile->ReadNumberOfEvents(HisSizeRead);
10966  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}}
10967 
10968  if( HistoCode == "D_Ped_ChNb" || HistoCode == "D_Ped_ChDs" )
10969  {read_histo = aMyRootFile->ReadPedestals(HisSizeRead);
10970  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}}
10971 
10972  //...................................................... (GetHistoValues)
10973  if( HistoCode == "D_TNo_ChNb" || HistoCode == "D_TNo_ChDs")
10974  {read_histo = aMyRootFile->ReadTotalNoise(HisSizeRead);
10975  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}}
10976 
10977  if( HistoCode == "D_MCs_ChNb" || HistoCode == "D_MCs_ChDs" )
10978  {read_histo = aMyRootFile->ReadMeanOfCorrelationsBetweenSamples(HisSizeRead);
10979  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}}
10980 
10981  if( HistoCode == "D_LFN_ChNb" || HistoCode == "D_LFN_ChDs" )
10982  {read_histo = aMyRootFile->ReadLowFrequencyNoise(HisSizeRead);
10983  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}}
10984 
10985  if( HistoCode == "D_HFN_ChNb" || HistoCode == "D_HFN_ChDs" )
10986  {read_histo = aMyRootFile->ReadHighFrequencyNoise(HisSizeRead);
10987  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}}
10988 
10989  if( HistoCode == "D_SCs_ChNb" || HistoCode == "D_SCs_ChDs" )
10990  {read_histo = aMyRootFile->ReadSigmaOfCorrelationsBetweenSamples(HisSizeRead);
10991  if( aMyRootFile->DataExist() == kTRUE ){fStatusDataExist = kTRUE; i_data_exist++;}}
10992 
10993  for(Int_t i=0; i<HisSizeRead; i++){plot_histo(i)=read_histo(i);}
10994  }
10995  else
10996  {
10997  cout << "!TEcnaHistos::GetHistoValues(...)> *** ERROR *** > HisSizeRead not equal to HisSizePlot."
10998  << " HisSizeRead = " << HisSizeRead
10999  << ", HisSizePlot = " << HisSizePlot << fTTBELL << endl;
11000  }
11001  }
11002  return plot_histo;
11003 }
11004 //------- (end of GetHistoValues) -------------
11005 
11006 TString TEcnaHistos::SetHistoXAxisTitle(const TString HistoCode)
11007 {
11008  // Set histo X axis title
11009 
11010  TString axis_x_var_name;
11011 
11012  if(HistoCode == "D_NOE_ChNb" || HistoCode == "D_Ped_ChNb" ||
11013  HistoCode == "D_TNo_ChNb" || HistoCode == "D_MCs_ChNb" ||
11014  HistoCode == "D_LFN_ChNb" || HistoCode == "D_HFN_ChNb" ||
11015  HistoCode == "D_SCs_ChNb" )
11016  {
11017  if( fFapStexNumber > 0 )
11018  {
11019  if( fFlagSubDet == "EB" ){axis_x_var_name = "Xtal (electronic channel number)";}
11020  if( fFlagSubDet == "EE" ){axis_x_var_name = "Xtal";}
11021  }
11022  if( fFapStexNumber == 0 )
11023  {
11024  if( fFlagSubDet == "EB" ){axis_x_var_name = "Tower number";}
11025  if( fFlagSubDet == "EE" ){axis_x_var_name = "SC number";}
11026  }
11027  }
11028 
11029  if(HistoCode == "D_NOE_ChDs"){axis_x_var_name = "Number of events";}
11030  if(HistoCode == "D_Ped_ChDs"){axis_x_var_name = "Pedestal";}
11031  if(HistoCode == "D_TNo_ChDs"){axis_x_var_name = "Total Noise";}
11032  if(HistoCode == "D_MCs_ChDs"){axis_x_var_name = "Mean Cor(s,s')";}
11033  if(HistoCode == "D_LFN_ChDs"){axis_x_var_name = "Low Frequency Noise";}
11034  if(HistoCode == "D_HFN_ChDs"){axis_x_var_name = "High Frequency Noise";}
11035  if(HistoCode == "D_SCs_ChDs"){axis_x_var_name = "Sigmas Cor(s,s')";}
11036  if(HistoCode == "D_MSp_Samp"){axis_x_var_name = "Sample";}
11037  if(HistoCode == "D_SSp_Samp"){axis_x_var_name = "Sample";}
11038  if(HistoCode == "D_Adc_EvDs"){axis_x_var_name = "ADC";}
11039  if(HistoCode == "D_Adc_EvNb"){axis_x_var_name = "Event number";}
11040  if(HistoCode == "H_Ped_Date" || HistoCode == "H_TNo_Date" || HistoCode == "H_MCs_Date" ||
11041  HistoCode == "H_LFN_Date" || HistoCode == "H_HFN_Date" || HistoCode == "H_SCs_Date")
11042  {axis_x_var_name = "Time";}
11043  if(HistoCode == "H_Ped_RuDs"){axis_x_var_name = "Pedestal";}
11044  if(HistoCode == "H_TNo_RuDs"){axis_x_var_name = "Total Noise";}
11045  if(HistoCode == "H_MCs_RuDs"){axis_x_var_name = "Mean Cor(s,s')";}
11046  if(HistoCode == "H_LFN_RuDs"){axis_x_var_name = "Low Frequency Noise";}
11047  if(HistoCode == "H_HFN_RuDs"){axis_x_var_name = "High Frequency Noise";}
11048  if(HistoCode == "H_SCs_RuDs"){axis_x_var_name = "Sigmas Cor(s,s')";}
11049 
11050  return axis_x_var_name;
11051 }
11052 
11053 TString TEcnaHistos::SetHistoYAxisTitle(const TString HistoCode)
11054 {
11055 // Set histo Y axis title
11056 
11057  TString axis_y_var_name;
11058 
11059  if(HistoCode == "D_NOE_ChNb"){axis_y_var_name = "number of found events";}
11060  if(HistoCode == "D_Ped_ChNb"){axis_y_var_name = "pedestal";}
11061  if(HistoCode == "D_TNo_ChNb"){axis_y_var_name = "total noise";}
11062  if(HistoCode == "D_MCs_ChNb"){axis_y_var_name = "mean of cor(s,s')";}
11063  if(HistoCode == "D_LFN_ChNb"){axis_y_var_name = "low frequency noise";}
11064  if(HistoCode == "D_HFN_ChNb"){axis_y_var_name = "high frequency noise";}
11065  if(HistoCode == "D_SCs_ChNb"){axis_y_var_name = "sigma of cor(s,s')";}
11066 
11067  if(HistoCode == "D_NOE_ChDs" ||
11068  HistoCode == "D_Ped_ChDs" || HistoCode == "D_TNo_ChDs" || HistoCode == "D_MCs_ChDs" ||
11069  HistoCode == "D_LFN_ChDs" || HistoCode == "D_HFN_ChDs" || HistoCode == "D_SCs_ChDs" )
11070  {
11071  if( fFapStexNumber > 0 ){axis_y_var_name = "number of crystals";}
11072  if( fFapStexNumber == 0 )
11073  {
11074  if( fFlagSubDet == "EB" ){axis_y_var_name = "number of towers";}
11075  if( fFlagSubDet == "EE" ){axis_y_var_name = "number of SC's";}
11076  }
11077  }
11078 
11079  if(HistoCode == "D_MSp_Samp"){axis_y_var_name = "Sample mean";}
11080  if(HistoCode == "D_SSp_Samp"){axis_y_var_name = "Sample sigma";}
11081  if(HistoCode == "D_Adc_EvDs"){axis_y_var_name = "number of events";}
11082  if(HistoCode == "D_Adc_EvNb"){axis_y_var_name = "Sample ADC value";}
11083  if(HistoCode == "H_Ped_Date"){axis_y_var_name = "Pedestal";}
11084  if(HistoCode == "H_TNo_Date"){axis_y_var_name = "Total noise";}
11085  if(HistoCode == "H_MCs_Date"){axis_y_var_name = "Mean cor(s,s')";}
11086  if(HistoCode == "H_LFN_Date"){axis_y_var_name = "Low frequency noise";}
11087  if(HistoCode == "H_HFN_Date"){axis_y_var_name = "High frequency noise";}
11088  if(HistoCode == "H_SCs_Date"){axis_y_var_name = "Sigma cor(s,s')";}
11089 
11090  if(HistoCode == "H_Ped_RuDs" || HistoCode == "H_TNo_RuDs" || HistoCode == "H_MCs_RuDs" ||
11091  HistoCode == "H_LFN_RuDs" || HistoCode == "H_HFN_RuDs" || HistoCode == "H_SCs_RuDs" )
11092  {axis_y_var_name = "number of runs";}
11093 
11094  return axis_y_var_name;
11095 }
11096 //-------------------------------------------------------------------------------
11097 Axis_t TEcnaHistos::GetHistoXinf(const TString HistoCode, const Int_t& HisSize, const TString opt_plot)
11098 {
11099 // Set histo Xinf
11100 
11101  Axis_t xinf_his = (Axis_t)0;
11102 
11103  if(HistoCode == "D_NOE_ChNb"){xinf_his = (Axis_t)0.;}
11104  if(HistoCode == "D_Ped_ChNb"){xinf_his = (Axis_t)0.;}
11105  if(HistoCode == "D_TNo_ChNb"){xinf_his = (Axis_t)0.;}
11106  if(HistoCode == "D_MCs_ChNb"){xinf_his = (Axis_t)0.;}
11107  if(HistoCode == "D_LFN_ChNb"){xinf_his = (Axis_t)0.;}
11108  if(HistoCode == "D_HFN_ChNb"){xinf_his = (Axis_t)0.;}
11109  if(HistoCode == "D_SCs_ChNb"){xinf_his = (Axis_t)0.;}
11110 
11111  if(HistoCode == "D_NOE_ChDs"){xinf_his = (Axis_t)fD_NOE_ChNbYmin;}
11112  if(HistoCode == "D_Ped_ChDs"){xinf_his = (Axis_t)fD_Ped_ChNbYmin;}
11113  if(HistoCode == "D_TNo_ChDs"){xinf_his = (Axis_t)fD_TNo_ChNbYmin;}
11114  if(HistoCode == "D_MCs_ChDs"){xinf_his = (Axis_t)fD_MCs_ChNbYmin;}
11115  if(HistoCode == "D_LFN_ChDs"){xinf_his = (Axis_t)fD_LFN_ChNbYmin;}
11116  if(HistoCode == "D_HFN_ChDs"){xinf_his = (Axis_t)fD_HFN_ChNbYmin;}
11117  if(HistoCode == "D_SCs_ChDs"){xinf_his = (Axis_t)fD_SCs_ChNbYmin;}
11118 
11119  if(HistoCode == "D_MSp_Samp"){xinf_his = (Axis_t)0.;}
11120  if(HistoCode == "D_SSp_Samp"){xinf_his = (Axis_t)0.;}
11121 
11122  if(HistoCode == "D_Adc_EvNb"){xinf_his = (Axis_t)0.;}
11123  if(HistoCode == "D_Adc_EvDs"){xinf_his = (Axis_t)fD_Adc_EvNbYmin;} // D_Adc_EvDs = projection of D_Adc_EvNb
11124 
11125  if(HistoCode == "H_Ped_Date"){xinf_his = (Axis_t)0.;}
11126  if(HistoCode == "H_TNo_Date"){xinf_his = (Axis_t)0.;}
11127  if(HistoCode == "H_MCs_Date"){xinf_his = (Axis_t)0.;}
11128  if(HistoCode == "H_LFN_Date"){xinf_his = (Axis_t)0.;}
11129  if(HistoCode == "H_HFN_Date"){xinf_his = (Axis_t)0.;}
11130  if(HistoCode == "H_SCs_Date"){xinf_his = (Axis_t)0.;}
11131 
11132  if(HistoCode == "H_Ped_RuDs"){xinf_his = (Axis_t)fH_Ped_RuDsYmin;}
11133  if(HistoCode == "H_TNo_RuDs"){xinf_his = (Axis_t)fH_TNo_RuDsYmin;}
11134  if(HistoCode == "H_MCs_RuDs"){xinf_his = (Axis_t)fH_MCs_RuDsYmin;}
11135  if(HistoCode == "H_LFN_RuDs"){xinf_his = (Axis_t)fH_LFN_RuDsYmin;}
11136  if(HistoCode == "H_HFN_RuDs"){xinf_his = (Axis_t)fH_HFN_RuDsYmin;}
11137  if(HistoCode == "H_SCs_RuDs"){xinf_his = (Axis_t)fH_SCs_RuDsYmin;}
11138 
11139  return xinf_his;
11140 }
11141 
11142 Axis_t TEcnaHistos::GetHistoXsup(const TString HistoCode, const Int_t& HisSize, const TString opt_plot)
11143 {
11144 // Set histo Xsup
11145 
11146  Axis_t xsup_his = (Axis_t)0;
11147 
11148  if(HistoCode == "D_NOE_ChNb"){xsup_his = (Axis_t)HisSize;}
11149  if(HistoCode == "D_Ped_ChNb"){xsup_his = (Axis_t)HisSize;}
11150  if(HistoCode == "D_TNo_ChNb"){xsup_his = (Axis_t)HisSize;}
11151  if(HistoCode == "D_MCs_ChNb"){xsup_his = (Axis_t)HisSize;}
11152  if(HistoCode == "D_LFN_ChNb"){xsup_his = (Axis_t)HisSize;}
11153  if(HistoCode == "D_HFN_ChNb"){xsup_his = (Axis_t)HisSize;}
11154  if(HistoCode == "D_SCs_ChNb"){xsup_his = (Axis_t)HisSize;}
11155 
11156  if(HistoCode == "D_NOE_ChDs"){xsup_his = (Axis_t)fD_NOE_ChNbYmax;}
11157  if(HistoCode == "D_Ped_ChDs"){xsup_his = (Axis_t)fD_Ped_ChNbYmax;}
11158  if(HistoCode == "D_TNo_ChDs"){xsup_his = (Axis_t)fD_TNo_ChNbYmax;}
11159  if(HistoCode == "D_MCs_ChDs"){xsup_his = (Axis_t)fD_MCs_ChNbYmax;}
11160  if(HistoCode == "D_LFN_ChDs"){xsup_his = (Axis_t)fD_LFN_ChNbYmax;}
11161  if(HistoCode == "D_HFN_ChDs"){xsup_his = (Axis_t)fD_HFN_ChNbYmax;}
11162  if(HistoCode == "D_SCs_ChDs"){xsup_his = (Axis_t)fD_SCs_ChNbYmax;}
11163 
11164  if(HistoCode == "D_MSp_Samp"){xsup_his = (Axis_t)HisSize;}
11165  if(HistoCode == "D_SSp_Samp"){xsup_his = (Axis_t)HisSize;}
11166 
11167  if(HistoCode == "D_Adc_EvNb"){xsup_his = (Axis_t)(fFapReqNbOfEvts);}
11168  if(HistoCode == "D_Adc_EvDs"){xsup_his = (Axis_t)fD_Adc_EvNbYmax;}
11169 
11170  if(HistoCode == "H_Ped_Date"){xsup_his = (Axis_t)0.;}
11171  if(HistoCode == "H_TNo_Date"){xsup_his = (Axis_t)0.;}
11172  if(HistoCode == "H_MCs_Date"){xsup_his = (Axis_t)0.;}
11173  if(HistoCode == "H_LFN_Date"){xsup_his = (Axis_t)0.;}
11174  if(HistoCode == "H_HFN_Date"){xsup_his = (Axis_t)0.;}
11175  if(HistoCode == "H_SCs_Date"){xsup_his = (Axis_t)0.;}
11176 
11177  if(HistoCode == "H_Ped_RuDs"){xsup_his = (Axis_t)fH_Ped_RuDsYmax;}
11178  if(HistoCode == "H_TNo_RuDs"){xsup_his = (Axis_t)fH_TNo_RuDsYmax;}
11179  if(HistoCode == "H_MCs_RuDs"){xsup_his = (Axis_t)fH_MCs_RuDsYmax;}
11180  if(HistoCode == "H_LFN_RuDs"){xsup_his = (Axis_t)fH_LFN_RuDsYmax;}
11181  if(HistoCode == "H_HFN_RuDs"){xsup_his = (Axis_t)fH_HFN_RuDsYmax;}
11182  if(HistoCode == "H_SCs_RuDs"){xsup_his = (Axis_t)fH_SCs_RuDsYmax;}
11183 
11184  return xsup_his;
11185 }
11186 //-----------------------------------------------------------------------------------
11187 Int_t TEcnaHistos::GetHistoNumberOfBins(const TString HistoCode, const Int_t& HisSize)
11188 {
11189 // Set histo number of bins
11190 
11191  Int_t nb_binx = HisSize;
11192  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
11193  if ( HistoType == "Proj" || HistoType == "SampProj" || HistoType == "EvolProj" )
11194  {nb_binx = fNbBinsProj;}
11195 
11196  return nb_binx;
11197 }
11198 //-----------------------------------------------------------------------------------
11199 void TEcnaHistos::FillHisto(TH1D* h_his0, const TVectorD& read_histo, const TString HistoCode,
11200  const Int_t& HisSize)
11201 {
11202 // Fill histo
11203 
11204  h_his0->Reset();
11205 
11206  for(Int_t i=0; i<HisSize; i++)
11207  {
11208  Double_t his_val = (Double_t)0;
11209  Double_t xi = (Double_t)0;
11210  //................................................... Basic + Global
11211  if (HistoCode == "D_MSp_Samp" || HistoCode == "D_SSp_Samp" ||
11212  HistoCode == "D_NOE_ChNb" || HistoCode == "D_Ped_ChNb" ||
11213  HistoCode == "D_LFN_ChNb" || HistoCode == "D_TNo_ChNb" ||
11214  HistoCode == "D_HFN_ChNb" || HistoCode == "D_MCs_ChNb" ||
11215  HistoCode == "D_SCs_ChNb" )
11216  {
11217  xi = (Double_t)i;
11218  his_val = (Double_t)read_histo[i];
11219  h_his0->Fill(xi, his_val);
11220  }
11221  //................................................... EvolProj
11222  //
11223  // *=======> direct Fill in ViewHistime(...)
11224  //
11225 
11226  //................................................... D_Adc_EvNb option
11227  if (HistoCode == "D_Adc_EvNb" )
11228  {
11229  xi = (Double_t)i;
11230  his_val = (Double_t)read_histo[i];
11231  h_his0->Fill(xi, his_val);
11232  }
11233  //................................................... Proj
11234  if (HistoCode == "D_NOE_ChDs" ||
11235  HistoCode == "D_Ped_ChDs" || HistoCode == "D_LFN_ChDs" ||
11236  HistoCode == "D_TNo_ChDs" || HistoCode == "D_HFN_ChDs" ||
11237  HistoCode == "D_MCs_ChDs" || HistoCode == "D_SCs_ChDs" ||
11238  HistoCode == "D_Adc_EvDs" )
11239  {
11240  his_val = (Double_t)read_histo[i];
11241  Double_t increment = (Double_t)1;
11242  h_his0->Fill(his_val, increment);
11243  }
11244  }
11245 }
11246 
11247 //===========================================================================
11248 //
11249 // SetXinfMemoFromValue(...), SetXsupMemoFromValue(...)
11250 // GetXsupValueFromMemo(...), GetXsupValueFromMemo(...)
11251 //
11252 //===========================================================================
11253 void TEcnaHistos::SetXinfMemoFromValue(const TString HistoCode, const Double_t& value)
11254 {
11255  if( HistoCode == "D_NOE_ChNb"){fD_NOE_ChNbXinf = value;}
11256  if( HistoCode == "D_NOE_ChDs"){fD_NOE_ChDsXinf = value;}
11257  if( HistoCode == "D_Ped_ChNb"){fD_Ped_ChNbXinf = value;}
11258  if( HistoCode == "D_Ped_ChDs"){fD_Ped_ChDsXinf = value;}
11259  if( HistoCode == "D_TNo_ChNb"){fD_TNo_ChNbXinf = value;}
11260  if( HistoCode == "D_TNo_ChDs"){fD_TNo_ChDsXinf = value;}
11261  if( HistoCode == "D_MCs_ChNb"){fD_MCs_ChNbXinf = value;}
11262  if( HistoCode == "D_MCs_ChDs"){fD_MCs_ChDsXinf = value;}
11263  if( HistoCode == "D_LFN_ChNb"){fD_LFN_ChNbXinf = value;}
11264  if( HistoCode == "D_LFN_ChDs"){fD_LFN_ChDsXinf = value;}
11265  if( HistoCode == "D_HFN_ChNb"){fD_HFN_ChNbXinf = value;}
11266  if( HistoCode == "D_HFN_ChDs"){fD_HFN_ChDsXinf = value;}
11267  if( HistoCode == "D_SCs_ChNb"){fD_SCs_ChNbXinf = value;}
11268  if( HistoCode == "D_SCs_ChDs"){fD_SCs_ChDsXinf = value;}
11269  if( HistoCode == "D_MSp_Samp"){fD_Ped_ChNbXinf = value;}
11270  if( HistoCode == "D_SSp_Samp"){fD_TNo_ChNbXinf = value;}
11271  if( HistoCode == "D_Adc_EvDs"){fD_Adc_EvDsXinf = value;}
11272  if( HistoCode == "D_Adc_EvNb"){fD_Ped_ChNbXinf = value;}
11273  if( HistoCode == "H_Ped_Date"){fH_Ped_DateXinf = value;}
11274  if( HistoCode == "H_TNo_Date"){fH_TNo_DateXinf = value;}
11275  if( HistoCode == "H_MCs_Date"){fH_MCs_DateXinf = value;}
11276  if( HistoCode == "H_LFN_Date"){fH_LFN_DateXinf = value;}
11277  if( HistoCode == "H_HFN_Date"){fH_HFN_DateXinf = value;}
11278  if( HistoCode == "H_SCs_Date"){fH_SCs_DateXinf = value;}
11279  if( HistoCode == "H_Ped_RuDs"){fH_Ped_RuDsXinf = value;}
11280  if( HistoCode == "H_TNo_RuDs"){fH_TNo_RuDsXinf = value;}
11281  if( HistoCode == "H_MCs_RuDs"){fH_MCs_RuDsXinf = value;}
11282  if( HistoCode == "H_LFN_RuDs"){fH_LFN_RuDsXinf = value;}
11283  if( HistoCode == "H_HFN_RuDs"){fH_HFN_RuDsXinf = value;}
11284  if( HistoCode == "H_SCs_RuDs"){fH_SCs_RuDsXinf = value;}
11285 }// end of SetXinfMemoFromValue(...)
11286 
11289 
11290 void TEcnaHistos::SetXsupMemoFromValue(const TString HistoCode, const Double_t& value)
11291 {
11292  if( HistoCode == "D_NOE_ChNb"){fD_NOE_ChNbXsup = value;}
11293  if( HistoCode == "D_NOE_ChDs"){fD_NOE_ChDsXsup = value;}
11294  if( HistoCode == "D_Ped_ChNb"){fD_Ped_ChNbXsup = value;}
11295  if( HistoCode == "D_Ped_ChDs"){fD_Ped_ChDsXsup = value;}
11296  if( HistoCode == "D_TNo_ChNb"){fD_TNo_ChNbXsup = value;}
11297  if( HistoCode == "D_TNo_ChDs"){fD_TNo_ChDsXsup = value;}
11298  if( HistoCode == "D_MCs_ChNb"){fD_MCs_ChNbXsup = value;}
11299  if( HistoCode == "D_MCs_ChDs"){fD_MCs_ChDsXsup = value;}
11300  if( HistoCode == "D_LFN_ChNb"){fD_LFN_ChNbXsup = value;}
11301  if( HistoCode == "D_LFN_ChDs"){fD_LFN_ChDsXsup = value;}
11302  if( HistoCode == "D_HFN_ChNb"){fD_HFN_ChNbXsup = value;}
11303  if( HistoCode == "D_HFN_ChDs"){fD_HFN_ChDsXsup = value;}
11304  if( HistoCode == "D_SCs_ChNb"){fD_SCs_ChNbXsup = value;}
11305  if( HistoCode == "D_SCs_ChDs"){fD_SCs_ChDsXsup = value;}
11306  if( HistoCode == "D_MSp_Samp"){fD_Ped_ChNbXsup = value;}
11307  if( HistoCode == "D_SSp_Samp"){fD_TNo_ChNbXsup = value;}
11308  if( HistoCode == "D_Adc_EvDs"){fD_Adc_EvDsXsup = value;}
11309  if( HistoCode == "D_Adc_EvNb"){fD_Ped_ChNbXsup = value;}
11310  if( HistoCode == "H_Ped_Date"){fH_Ped_DateXsup = value;}
11311  if( HistoCode == "H_TNo_Date"){fH_TNo_DateXsup = value;}
11312  if( HistoCode == "H_MCs_Date"){fH_MCs_DateXsup = value;}
11313  if( HistoCode == "H_LFN_Date"){fH_LFN_DateXsup = value;}
11314  if( HistoCode == "H_HFN_Date"){fH_HFN_DateXsup = value;}
11315  if( HistoCode == "H_SCs_Date"){fH_SCs_DateXsup = value;}
11316  if( HistoCode == "H_Ped_RuDs"){fH_Ped_RuDsXsup = value;}
11317  if( HistoCode == "H_TNo_RuDs"){fH_TNo_RuDsXsup = value;}
11318  if( HistoCode == "H_MCs_RuDs"){fH_MCs_RuDsXsup = value;}
11319  if( HistoCode == "H_LFN_RuDs"){fH_LFN_RuDsXsup = value;}
11320  if( HistoCode == "H_HFN_RuDs"){fH_HFN_RuDsXsup = value;}
11321  if( HistoCode == "H_SCs_RuDs"){fH_SCs_RuDsXsup = value;}
11322 }// end of SetXsupMemoFromValue(...)
11323 
11326 
11327 Double_t TEcnaHistos::GetXinfValueFromMemo(const TString HistoCode)
11328 {
11329  Double_t val_inf = (Double_t)0.;
11330 
11331  if( HistoCode == "D_NOE_ChNb"){val_inf = fD_NOE_ChNbXinf;}
11332  if( HistoCode == "D_NOE_ChDs"){val_inf = fD_NOE_ChDsXinf;}
11333  if( HistoCode == "D_Ped_ChNb"){val_inf = fD_Ped_ChNbXinf;}
11334  if( HistoCode == "D_Ped_ChDs"){val_inf = fD_Ped_ChDsXinf;}
11335  if( HistoCode == "D_TNo_ChNb"){val_inf = fD_TNo_ChNbXinf;}
11336  if( HistoCode == "D_TNo_ChDs"){val_inf = fD_TNo_ChDsXinf;}
11337  if( HistoCode == "D_MCs_ChNb"){val_inf = fD_MCs_ChNbXinf;}
11338  if( HistoCode == "D_MCs_ChDs"){val_inf = fD_MCs_ChDsXinf;}
11339  if( HistoCode == "D_LFN_ChNb"){val_inf = fD_LFN_ChNbXinf;}
11340  if( HistoCode == "D_LFN_ChDs"){val_inf = fD_LFN_ChDsXinf;}
11341  if( HistoCode == "D_HFN_ChNb"){val_inf = fD_HFN_ChNbXinf;}
11342  if( HistoCode == "D_HFN_ChDs"){val_inf = fD_HFN_ChDsXinf;}
11343  if( HistoCode == "D_SCs_ChNb"){val_inf = fD_SCs_ChNbXinf;}
11344  if( HistoCode == "D_SCs_ChDs"){val_inf = fD_SCs_ChDsXinf;}
11345  if( HistoCode == "D_MSp_Samp"){val_inf = fD_Ped_ChNbXinf;}
11346  if( HistoCode == "D_SSp_Samp"){val_inf = fD_TNo_ChNbXinf;}
11347  if( HistoCode == "D_Adc_EvDs"){val_inf = fD_Adc_EvDsXinf;}
11348  if( HistoCode == "D_Adc_EvNb"){val_inf = fD_Adc_EvNbXinf;}
11349  if( HistoCode == "H_Ped_Date"){val_inf = fH_Ped_DateXinf;}
11350  if( HistoCode == "H_TNo_Date"){val_inf = fH_TNo_DateXinf;}
11351  if( HistoCode == "H_MCs_Date"){val_inf = fH_MCs_DateXinf;}
11352  if( HistoCode == "H_LFN_Date"){val_inf = fH_LFN_DateXinf;}
11353  if( HistoCode == "H_HFN_Date"){val_inf = fH_HFN_DateXinf;}
11354  if( HistoCode == "H_SCs_Date"){val_inf = fH_SCs_DateXinf;}
11355  if( HistoCode == "H_Ped_RuDs"){val_inf = fH_Ped_RuDsXinf;}
11356  if( HistoCode == "H_TNo_RuDs"){val_inf = fH_TNo_RuDsXinf;}
11357  if( HistoCode == "H_MCs_RuDs"){val_inf = fH_MCs_RuDsXinf;}
11358  if( HistoCode == "H_LFN_RuDs"){val_inf = fH_LFN_RuDsXinf;}
11359  if( HistoCode == "H_HFN_RuDs"){val_inf = fH_HFN_RuDsXinf;}
11360  if( HistoCode == "H_SCs_RuDs"){val_inf = fH_SCs_RuDsXinf;}
11361  return val_inf;
11362 }// end of GetXinfValueFromMemo(...)
11363 
11365 {return fH1SameOnePlotXinf;}
11366 
11367 Double_t TEcnaHistos::GetXsupValueFromMemo(const TString HistoCode)
11368 {
11369  Double_t val_sup = (Double_t)0.;
11370 
11371  if( HistoCode == "D_NOE_ChNb"){val_sup = fD_NOE_ChNbXsup;}
11372  if( HistoCode == "D_NOE_ChDs"){val_sup = fD_NOE_ChDsXsup;}
11373  if( HistoCode == "D_Ped_ChNb"){val_sup = fD_Ped_ChNbXsup;}
11374  if( HistoCode == "D_Ped_ChDs"){val_sup = fD_Ped_ChDsXsup;}
11375  if( HistoCode == "D_TNo_ChNb"){val_sup = fD_TNo_ChNbXsup;}
11376  if( HistoCode == "D_TNo_ChDs"){val_sup = fD_TNo_ChDsXsup;}
11377  if( HistoCode == "D_MCs_ChNb"){val_sup = fD_MCs_ChNbXsup;}
11378  if( HistoCode == "D_MCs_ChDs"){val_sup = fD_MCs_ChDsXsup;}
11379  if( HistoCode == "D_LFN_ChNb"){val_sup = fD_LFN_ChNbXsup;}
11380  if( HistoCode == "D_LFN_ChDs"){val_sup = fD_LFN_ChDsXsup;}
11381  if( HistoCode == "D_HFN_ChNb"){val_sup = fD_HFN_ChNbXsup;}
11382  if( HistoCode == "D_HFN_ChDs"){val_sup = fD_HFN_ChDsXsup;}
11383  if( HistoCode == "D_SCs_ChNb"){val_sup = fD_SCs_ChNbXsup;}
11384  if( HistoCode == "D_SCs_ChDs"){val_sup = fD_SCs_ChDsXsup;}
11385  if( HistoCode == "D_MSp_Samp"){val_sup = fD_Ped_ChNbXsup;}
11386  if( HistoCode == "D_SSp_Samp"){val_sup = fD_TNo_ChNbXsup;}
11387  if( HistoCode == "D_Adc_EvDs"){val_sup = fD_Adc_EvDsXsup;}
11388  if( HistoCode == "D_Adc_EvNb"){val_sup = fD_Adc_EvNbXsup;}
11389  if( HistoCode == "H_Ped_Date"){val_sup = fH_Ped_DateXsup;}
11390  if( HistoCode == "H_TNo_Date"){val_sup = fH_TNo_DateXsup;}
11391  if( HistoCode == "H_MCs_Date"){val_sup = fH_MCs_DateXsup;}
11392  if( HistoCode == "H_LFN_Date"){val_sup = fH_LFN_DateXsup;}
11393  if( HistoCode == "H_HFN_Date"){val_sup = fH_HFN_DateXsup;}
11394  if( HistoCode == "H_SCs_Date"){val_sup = fH_SCs_DateXsup;}
11395  if( HistoCode == "H_Ped_RuDs"){val_sup = fH_Ped_RuDsXsup;}
11396  if( HistoCode == "H_TNo_RuDs"){val_sup = fH_TNo_RuDsXsup;}
11397  if( HistoCode == "H_MCs_RuDs"){val_sup = fH_MCs_RuDsXsup;}
11398  if( HistoCode == "H_LFN_RuDs"){val_sup = fH_LFN_RuDsXsup;}
11399  if( HistoCode == "H_HFN_RuDs"){val_sup = fH_HFN_RuDsXsup;}
11400  if( HistoCode == "H_SCs_RuDs"){val_sup = fH_SCs_RuDsXsup;}
11401  return val_sup;
11402 }// end of GetXsupValueFromMemo(...)
11403 
11405 {return fH1SameOnePlotXsup;}
11406 
11407 //-------------------------------------------------------------------------------------------
11408 //
11409 // SetHistoMin, SetHistoMax, SetAllYminYmaxMemoFromDefaultValues
11410 //
11411 // D O N ' T S U P P R E S S : THESE METHODS CAN BE CALLED BY EXTERNAL OBJECTS
11412 //
11413 //-------------------------------------------------------------------------------------------
11416 
11419 
11421 {
11422 //.......... Default values for histo min and max
11423 
11424  SetYminMemoFromValue("D_NOE_ChNb", fCnaParHistos->GetYminDefaultValue("D_NOE_ChNb"));
11425  SetYmaxMemoFromValue("D_NOE_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_NOE_ChNb"));
11426 
11427  SetYminMemoFromValue("D_NOE_ChDs", fCnaParHistos->GetYminDefaultValue("D_NOE_ChDs"));
11428  SetYmaxMemoFromValue("D_NOE_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_NOE_ChDs"));
11429 
11430  SetYminMemoFromValue("D_Ped_ChNb", fCnaParHistos->GetYminDefaultValue("D_Ped_ChNb"));
11431  SetYmaxMemoFromValue("D_Ped_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_Ped_ChNb"));
11432 
11433  SetYminMemoFromValue("D_Ped_ChDs", fCnaParHistos->GetYminDefaultValue("D_Ped_ChDs"));
11434  SetYmaxMemoFromValue("D_Ped_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_Ped_ChDs"));
11435 
11436  SetYminMemoFromValue("D_TNo_ChNb", fCnaParHistos->GetYminDefaultValue("D_TNo_ChNb"));
11437  SetYmaxMemoFromValue("D_TNo_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_TNo_ChNb"));
11438 
11439  SetYminMemoFromValue("D_TNo_ChDs", fCnaParHistos->GetYminDefaultValue("D_TNo_ChDs"));
11440  SetYmaxMemoFromValue("D_TNo_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_TNo_ChDs"));
11441 
11442  SetYminMemoFromValue("D_MCs_ChNb", fCnaParHistos->GetYminDefaultValue("D_MCs_ChNb"));
11443  SetYmaxMemoFromValue("D_MCs_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_MCs_ChNb"));
11444 
11445  SetYminMemoFromValue("D_MCs_ChDs", fCnaParHistos->GetYminDefaultValue("D_MCs_ChDs"));
11446  SetYmaxMemoFromValue("D_MCs_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_MCs_ChDs"));
11447 
11448  SetYminMemoFromValue("D_LFN_ChNb", fCnaParHistos->GetYminDefaultValue("D_LFN_ChNb"));
11449  SetYmaxMemoFromValue("D_LFN_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_LFN_ChNb"));
11450 
11451  SetYminMemoFromValue("D_LFN_ChDs", fCnaParHistos->GetYminDefaultValue("D_LFN_ChDs"));
11452  SetYmaxMemoFromValue("D_LFN_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_LFN_ChDs"));
11453 
11454  SetYminMemoFromValue("D_HFN_ChNb", fCnaParHistos->GetYminDefaultValue("D_HFN_ChNb"));
11455  SetYmaxMemoFromValue("D_HFN_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_HFN_ChNb"));
11456 
11457  SetYminMemoFromValue("D_HFN_ChDs", fCnaParHistos->GetYminDefaultValue("D_HFN_ChDs"));
11458  SetYmaxMemoFromValue("D_HFN_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_HFN_ChDs"));
11459 
11460  SetYminMemoFromValue("D_SCs_ChNb", fCnaParHistos->GetYminDefaultValue("D_SCs_ChNb"));
11461  SetYmaxMemoFromValue("D_SCs_ChNb", fCnaParHistos->GetYmaxDefaultValue("D_SCs_ChNb"));
11462 
11463  SetYminMemoFromValue("D_SCs_ChDs", fCnaParHistos->GetYminDefaultValue("D_SCs_ChDs"));
11464  SetYmaxMemoFromValue("D_SCs_ChDs", fCnaParHistos->GetYmaxDefaultValue("D_SCs_ChDs"));
11465 
11466  SetYminMemoFromValue("D_MSp_Samp", fCnaParHistos->GetYminDefaultValue("D_MSp_Samp"));
11467  SetYmaxMemoFromValue("D_MSp_Samp", fCnaParHistos->GetYmaxDefaultValue("D_MSp_Samp"));
11468 
11469  SetYminMemoFromValue("D_SSp_Samp", fCnaParHistos->GetYminDefaultValue("D_SSp_Samp"));
11470  SetYmaxMemoFromValue("D_SSp_Samp", fCnaParHistos->GetYmaxDefaultValue("D_SSp_Samp"));
11471 
11472  SetYminMemoFromValue("D_Adc_EvDs", fCnaParHistos->GetYminDefaultValue("D_Adc_EvDs"));
11473  SetYmaxMemoFromValue("D_Adc_EvDs", fCnaParHistos->GetYmaxDefaultValue("D_Adc_EvDs"));
11474 
11475  SetYminMemoFromValue("D_Adc_EvNb", fCnaParHistos->GetYminDefaultValue("D_Adc_EvNb"));
11476  SetYmaxMemoFromValue("D_Adc_EvNb", fCnaParHistos->GetYmaxDefaultValue("D_Adc_EvNb"));
11477 
11478  SetYminMemoFromValue("H_Ped_Date", fCnaParHistos->GetYminDefaultValue("H_Ped_Date"));
11479  SetYmaxMemoFromValue("H_Ped_Date", fCnaParHistos->GetYmaxDefaultValue("H_Ped_Date"));
11480 
11481  SetYminMemoFromValue("H_TNo_Date", fCnaParHistos->GetYminDefaultValue("H_TNo_Date"));
11482  SetYmaxMemoFromValue("H_TNo_Date", fCnaParHistos->GetYmaxDefaultValue("H_TNo_Date"));
11483 
11484  SetYminMemoFromValue("H_LFN_Date", fCnaParHistos->GetYminDefaultValue("H_LFN_Date"));
11485  SetYmaxMemoFromValue("H_LFN_Date", fCnaParHistos->GetYmaxDefaultValue("H_LFN_Date"));
11486 
11487  SetYminMemoFromValue("H_HFN_Date", fCnaParHistos->GetYminDefaultValue("H_HFN_Date"));
11488  SetYmaxMemoFromValue("H_HFN_Date", fCnaParHistos->GetYmaxDefaultValue("H_HFN_Date"));
11489 
11490  SetYminMemoFromValue("H_MCs_Date", fCnaParHistos->GetYminDefaultValue("H_MCs_Date"));
11491  SetYmaxMemoFromValue("H_MCs_Date", fCnaParHistos->GetYmaxDefaultValue("H_MCs_Date"));
11492 
11493  SetYminMemoFromValue("H_SCs_Date", fCnaParHistos->GetYminDefaultValue("H_SCs_Date"));
11494  SetYmaxMemoFromValue("H_SCs_Date", fCnaParHistos->GetYmaxDefaultValue("H_SCs_Date"));
11495 
11496  SetYminMemoFromValue("H_Ped_RuDs", fCnaParHistos->GetYminDefaultValue("H_Ped_RuDs"));
11497  SetYmaxMemoFromValue("H_Ped_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_Ped_RuDs"));
11498 
11499  SetYminMemoFromValue("H_TNo_RuDs", fCnaParHistos->GetYminDefaultValue("H_TNo_RuDs"));
11500  SetYmaxMemoFromValue("H_TNo_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_TNo_RuDs"));
11501 
11502  SetYminMemoFromValue("H_LFN_RuDs", fCnaParHistos->GetYminDefaultValue("H_LFN_RuDs"));
11503  SetYmaxMemoFromValue("H_LFN_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_LFN_RuDs"));
11504 
11505  SetYminMemoFromValue("H_HFN_RuDs", fCnaParHistos->GetYminDefaultValue("H_HFN_RuDs"));
11506  SetYmaxMemoFromValue("H_HFN_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_HFN_RuDs"));
11507 
11508  SetYminMemoFromValue("H_MCs_RuDs", fCnaParHistos->GetYminDefaultValue("H_MCs_RuDs"));
11509  SetYmaxMemoFromValue("H_MCs_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_MCs_RuDs"));
11510 
11511  SetYminMemoFromValue("H_SCs_RuDs", fCnaParHistos->GetYminDefaultValue("H_SCs_RuDs"));
11512  SetYmaxMemoFromValue("H_SCs_RuDs", fCnaParHistos->GetYmaxDefaultValue("H_SCs_RuDs"));
11513 
11514  SetYminMemoFromValue("H2LFccMosMatrix", fCnaParHistos->GetYminDefaultValue("H2LFccMosMatrix"));
11515  SetYmaxMemoFromValue("H2LFccMosMatrix", fCnaParHistos->GetYmaxDefaultValue("H2LFccMosMatrix"));
11516 
11517  SetYminMemoFromValue("H2HFccMosMatrix", fCnaParHistos->GetYminDefaultValue("H2HFccMosMatrix"));
11518  SetYmaxMemoFromValue("H2HFccMosMatrix", fCnaParHistos->GetYmaxDefaultValue("H2HFccMosMatrix"));
11519 
11520  SetYminMemoFromValue("H2CorccInStins", fCnaParHistos->GetYminDefaultValue("H2CorccInStins"));
11521  SetYmaxMemoFromValue("H2CorccInStins", fCnaParHistos->GetYmaxDefaultValue("H2CorccInStins"));
11522 
11523  //........... set user's min and max flags to "OFF" and values to -1 and +1
11524  fUserHistoMin = -1.; fFlagUserHistoMin = "OFF";
11525  fUserHistoMax = 1.; fFlagUserHistoMax = "OFF";
11526 }
11527 
11528 //===========================================================================
11529 //
11530 // SetYminMemoFromValue(...), SetYmaxMemoFromValue(...)
11531 // GetYminValueFromMemo(...), GetYmaxValueFromMemo(...)
11532 //
11533 //===========================================================================
11534 void TEcnaHistos::SetYminMemoFromValue(const TString HistoCode, const Double_t& value)
11535 {
11536  if( HistoCode == "D_NOE_ChNb" ){fD_NOE_ChNbYmin = value;}
11537  if( HistoCode == "D_NOE_ChDs" ){fD_NOE_ChDsYmin = value;}
11538  if( HistoCode == "D_Ped_ChNb" ){fD_Ped_ChNbYmin = value;}
11539  if( HistoCode == "D_Ped_ChDs" ){fD_Ped_ChDsYmin = value;}
11540  if( HistoCode == "D_TNo_ChNb" ){fD_TNo_ChNbYmin = value;}
11541  if( HistoCode == "D_TNo_ChDs" ){fD_TNo_ChDsYmin = value;}
11542  if( HistoCode == "D_MCs_ChNb" ){fD_MCs_ChNbYmin = value;}
11543  if( HistoCode == "D_MCs_ChDs" ){fD_MCs_ChDsYmin = value;}
11544  if( HistoCode == "D_LFN_ChNb" ){fD_LFN_ChNbYmin = value;}
11545  if( HistoCode == "D_LFN_ChDs" ){fD_LFN_ChDsYmin = value;}
11546  if( HistoCode == "D_HFN_ChNb" ){fD_HFN_ChNbYmin = value;}
11547  if( HistoCode == "D_HFN_ChDs" ){fD_HFN_ChDsYmin = value;}
11548  if( HistoCode == "D_SCs_ChNb" ){fD_SCs_ChNbYmin = value;}
11549  if( HistoCode == "D_SCs_ChDs" ){fD_SCs_ChDsYmin = value;}
11550  if( HistoCode == "D_MSp_Samp" ){fD_Ped_ChNbYmin = value;}
11551  if( HistoCode == "D_SSp_Samp" ){fD_TNo_ChNbYmin = value;}
11552  if( HistoCode == "D_Adc_EvDs" ){fD_Adc_EvDsYmin = value;}
11553  if( HistoCode == "D_Adc_EvNb" ){fD_Ped_ChNbYmin = value;}
11554  if( HistoCode == "H_Ped_Date" ){fH_Ped_DateYmin = value;}
11555  if( HistoCode == "H_TNo_Date" ){fH_TNo_DateYmin = value;}
11556  if( HistoCode == "H_MCs_Date" ){fH_MCs_DateYmin = value;}
11557  if( HistoCode == "H_LFN_Date" ){fH_LFN_DateYmin = value;}
11558  if( HistoCode == "H_HFN_Date" ){fH_HFN_DateYmin = value;}
11559  if( HistoCode == "H_SCs_Date" ){fH_SCs_DateYmin = value;}
11560  if( HistoCode == "H_Ped_RuDs" ){fH_Ped_RuDsYmin = value;}
11561  if( HistoCode == "H_TNo_RuDs" ){fH_TNo_RuDsYmin = value;}
11562  if( HistoCode == "H_MCs_RuDs" ){fH_MCs_RuDsYmin = value;}
11563  if( HistoCode == "H_LFN_RuDs" ){fH_LFN_RuDsYmin = value;}
11564  if( HistoCode == "H_HFN_RuDs" ){fH_HFN_RuDsYmin = value;}
11565  if( HistoCode == "H_SCs_RuDs" ){fH_SCs_RuDsYmin = value;}
11566  if( HistoCode == "H2LFccMosMatrix" ){fH2LFccMosMatrixYmin = value;}
11567  if( HistoCode == "H2HFccMosMatrix" ){fH2HFccMosMatrixYmin = value;}
11568  if( HistoCode == "H2CorccInStins" ){fH2CorccInStinsYmin = value;}
11569 }// end of SetYminMemoFromValue(...)
11570 
11571 void TEcnaHistos::SetYmaxMemoFromValue(const TString HistoCode, const Double_t& value)
11572 {
11573  if( HistoCode == "D_NOE_ChNb" ){fD_NOE_ChNbYmax = value;}
11574  if( HistoCode == "D_NOE_ChDs" ){fD_NOE_ChDsYmax = value;}
11575  if( HistoCode == "D_Ped_ChNb" ){fD_Ped_ChNbYmax = value;}
11576  if( HistoCode == "D_Ped_ChDs" ){fD_Ped_ChDsYmax = value;}
11577  if( HistoCode == "D_TNo_ChNb" ){fD_TNo_ChNbYmax = value;}
11578  if( HistoCode == "D_TNo_ChDs" ){fD_TNo_ChDsYmax = value;}
11579  if( HistoCode == "D_MCs_ChNb" ){fD_MCs_ChNbYmax = value;}
11580  if( HistoCode == "D_MCs_ChDs" ){fD_MCs_ChDsYmax = value;}
11581  if( HistoCode == "D_LFN_ChNb" ){fD_LFN_ChNbYmax = value;}
11582  if( HistoCode == "D_LFN_ChDs" ){fD_LFN_ChDsYmax = value;}
11583  if( HistoCode == "D_HFN_ChNb" ){fD_HFN_ChNbYmax = value;}
11584  if( HistoCode == "D_HFN_ChDs" ){fD_HFN_ChDsYmax = value;}
11585  if( HistoCode == "D_SCs_ChNb" ){fD_SCs_ChNbYmax = value;}
11586  if( HistoCode == "D_SCs_ChDs" ){fD_SCs_ChDsYmax = value;}
11587  if( HistoCode == "D_MSp_Samp" ){fD_Ped_ChNbYmax = value;}
11588  if( HistoCode == "D_SSp_Samp" ){fD_TNo_ChNbYmax = value;}
11589  if( HistoCode == "D_Adc_EvDs" ){fD_Adc_EvDsYmax = value;}
11590  if( HistoCode == "D_Adc_EvNb" ){fD_Ped_ChNbYmax = value;}
11591  if( HistoCode == "H_Ped_Date" ){fH_Ped_DateYmax = value;}
11592  if( HistoCode == "H_TNo_Date" ){fH_TNo_DateYmax = value;}
11593  if( HistoCode == "H_MCs_Date" ){fH_MCs_DateYmax = value;}
11594  if( HistoCode == "H_LFN_Date" ){fH_LFN_DateYmax = value;}
11595  if( HistoCode == "H_HFN_Date" ){fH_HFN_DateYmax = value;}
11596  if( HistoCode == "H_SCs_Date" ){fH_SCs_DateYmax = value;}
11597  if( HistoCode == "H_Ped_RuDs" ){fH_Ped_RuDsYmax = value;}
11598  if( HistoCode == "H_TNo_RuDs" ){fH_TNo_RuDsYmax = value;}
11599  if( HistoCode == "H_MCs_RuDs" ){fH_MCs_RuDsYmax = value;}
11600  if( HistoCode == "H_LFN_RuDs" ){fH_LFN_RuDsYmax = value;}
11601  if( HistoCode == "H_HFN_RuDs" ){fH_HFN_RuDsYmax = value;}
11602  if( HistoCode == "H_SCs_RuDs" ){fH_SCs_RuDsYmax = value;}
11603  if( HistoCode == "H2LFccMosMatrix" ){fH2LFccMosMatrixYmax = value;}
11604  if( HistoCode == "H2HFccMosMatrix" ){fH2HFccMosMatrixYmax = value;}
11605  if( HistoCode == "H2CorccInStins" ){fH2CorccInStinsYmax = value;}
11606 }// end of SetYmaxMemoFromValue(...)
11607 
11608 Double_t TEcnaHistos::GetYminValueFromMemo(const TString HistoCode)
11609 {
11610  Double_t val_min = (Double_t)0.;
11611  Double_t val_min_proj = (Double_t)0.1;
11612 
11613  if( HistoCode == "D_NOE_ChNb" ){val_min = fD_NOE_ChNbYmin;}
11614  if( HistoCode == "D_NOE_ChDs" ){val_min = val_min_proj;}
11615  if( HistoCode == "D_Ped_ChNb" ){val_min = fD_Ped_ChNbYmin;}
11616  if( HistoCode == "D_Ped_ChDs" ){val_min = val_min_proj;}
11617  if( HistoCode == "D_TNo_ChNb" ){val_min = fD_TNo_ChNbYmin;}
11618  if( HistoCode == "D_TNo_ChDs" ){val_min = val_min_proj;}
11619  if( HistoCode == "D_MCs_ChNb" ){val_min = fD_MCs_ChNbYmin;}
11620  if( HistoCode == "D_MCs_ChDs" ){val_min = val_min_proj;}
11621  if( HistoCode == "D_LFN_ChNb" ){val_min = fD_LFN_ChNbYmin;}
11622  if( HistoCode == "D_LFN_ChDs" ){val_min = val_min_proj;}
11623  if( HistoCode == "D_HFN_ChNb" ){val_min = fD_HFN_ChNbYmin;}
11624  if( HistoCode == "D_HFN_ChDs" ){val_min = val_min_proj;}
11625  if( HistoCode == "D_SCs_ChNb" ){val_min = fD_SCs_ChNbYmin;}
11626  if( HistoCode == "D_SCs_ChDs" ){val_min = val_min_proj;}
11627  if( HistoCode == "D_MSp_Samp" ){val_min = fD_Ped_ChNbYmin;}
11628  if( HistoCode == "D_SSp_Samp" ){val_min = fD_TNo_ChNbYmin;}
11629  if( HistoCode == "D_Adc_EvDs" ){val_min = val_min_proj;}
11630  if( HistoCode == "D_Adc_EvNb" ){val_min = fD_Ped_ChNbYmin;}
11631  if( HistoCode == "H_Ped_Date" ){val_min = fH_Ped_DateYmin;}
11632  if( HistoCode == "H_TNo_Date" ){val_min = fH_TNo_DateYmin;}
11633  if( HistoCode == "H_MCs_Date" ){val_min = fH_MCs_DateYmin;}
11634  if( HistoCode == "H_LFN_Date" ){val_min = fH_LFN_DateYmin;}
11635  if( HistoCode == "H_HFN_Date" ){val_min = fH_HFN_DateYmin;}
11636  if( HistoCode == "H_SCs_Date" ){val_min = fH_SCs_DateYmin;}
11637  if( HistoCode == "H_Ped_RuDs" ){val_min = fH_Ped_RuDsYmin;}
11638  if( HistoCode == "H_TNo_RuDs" ){val_min = fH_TNo_RuDsYmin;}
11639  if( HistoCode == "H_MCs_RuDs" ){val_min = fH_MCs_RuDsYmin;}
11640  if( HistoCode == "H_LFN_RuDs" ){val_min = fH_LFN_RuDsYmin;}
11641  if( HistoCode == "H_HFN_RuDs" ){val_min = fH_HFN_RuDsYmin;}
11642  if( HistoCode == "H_SCs_RuDs" ){val_min = fH_SCs_RuDsYmin;}
11643  if( HistoCode == "H2LFccMosMatrix" ){val_min = fH2LFccMosMatrixYmin;}
11644  if( HistoCode == "H2HFccMosMatrix" ){val_min = fH2HFccMosMatrixYmin;}
11645  if( HistoCode == "H2CorccInStins" ){val_min = fH2CorccInStinsYmin;}
11646  return val_min;
11647 }// end of GetYminValueFromMemo(...)
11648 
11649 Double_t TEcnaHistos::GetYmaxValueFromMemo(const TString HistoCode)
11650 {
11651  Double_t val_max = (Double_t)0.;
11652  Double_t val_max_proj = (Double_t)2000.;
11653 
11654  if( HistoCode == "D_NOE_ChNb" ){val_max = fD_NOE_ChNbYmax;}
11655  if( HistoCode == "D_NOE_ChDs" ){val_max = val_max_proj;}
11656  if( HistoCode == "D_Ped_ChNb" ){val_max = fD_Ped_ChNbYmax;}
11657  if( HistoCode == "D_Ped_ChDs" ){val_max = val_max_proj;}
11658  if( HistoCode == "D_TNo_ChNb" ){val_max = fD_TNo_ChNbYmax;}
11659  if( HistoCode == "D_TNo_ChDs" ){val_max = val_max_proj;}
11660  if( HistoCode == "D_MCs_ChNb" ){val_max = fD_MCs_ChNbYmax;}
11661  if( HistoCode == "D_MCs_ChDs" ){val_max = val_max_proj;}
11662  if( HistoCode == "D_LFN_ChNb" ){val_max = fD_LFN_ChNbYmax;}
11663  if( HistoCode == "D_LFN_ChDs" ){val_max = val_max_proj;}
11664  if( HistoCode == "D_HFN_ChNb" ){val_max = fD_HFN_ChNbYmax;}
11665  if( HistoCode == "D_HFN_ChDs" ){val_max = val_max_proj;}
11666  if( HistoCode == "D_SCs_ChNb" ){val_max = fD_SCs_ChNbYmax;}
11667  if( HistoCode == "D_SCs_ChDs" ){val_max = val_max_proj;}
11668  if( HistoCode == "D_MSp_Samp" ){val_max = fD_Ped_ChNbYmax;}
11669  if( HistoCode == "D_SSp_Samp" ){val_max = fD_TNo_ChNbYmax;}
11670  if( HistoCode == "D_Adc_EvDs" ){val_max = val_max_proj;}
11671  if( HistoCode == "D_Adc_EvNb" ){val_max = fD_Ped_ChNbYmax;}
11672  if( HistoCode == "H_Ped_Date" ){val_max = fH_Ped_DateYmax;}
11673  if( HistoCode == "H_TNo_Date" ){val_max = fH_TNo_DateYmax;}
11674  if( HistoCode == "H_MCs_Date" ){val_max = fH_MCs_DateYmax;}
11675  if( HistoCode == "H_LFN_Date" ){val_max = fH_LFN_DateYmax;}
11676  if( HistoCode == "H_HFN_Date" ){val_max = fH_HFN_DateYmax;}
11677  if( HistoCode == "H_SCs_Date" ){val_max = fH_SCs_DateYmax;}
11678  if( HistoCode == "H_Ped_RuDs" ){val_max = fH_Ped_RuDsYmax;}
11679  if( HistoCode == "H_TNo_RuDs" ){val_max = fH_TNo_RuDsYmax;}
11680  if( HistoCode == "H_MCs_RuDs" ){val_max = fH_MCs_RuDsYmax;}
11681  if( HistoCode == "H_LFN_RuDs" ){val_max = fH_LFN_RuDsYmax;}
11682  if( HistoCode == "H_HFN_RuDs" ){val_max = fH_HFN_RuDsYmax;}
11683  if( HistoCode == "H_SCs_RuDs" ){val_max = fH_SCs_RuDsYmax;}
11684  if( HistoCode == "H2LFccMosMatrix" ){val_max = fH2LFccMosMatrixYmax;}
11685  if( HistoCode == "H2HFccMosMatrix" ){val_max = fH2HFccMosMatrixYmax;}
11686  if( HistoCode == "H2CorccInStins" ){val_max = fH2CorccInStinsYmax;}
11687  return val_max;
11688 }// end of GetYmaxValueFromMemo(...)
11689 
11690 void TEcnaHistos::SetYminMemoFromPreviousMemo(const TString HistoCode)
11691 {
11692 // InitQuantity Ymin
11693 
11694  if( HistoCode == "D_NOE_ChNb" ){fD_NOE_ChNbYmin = GetYminValueFromMemo("D_NOE_ChNb");}
11695  if( HistoCode == "D_NOE_ChDs" ){fD_NOE_ChDsYmin = GetYminValueFromMemo("D_NOE_ChDs");}
11696  if( HistoCode == "D_Ped_ChNb" ){fD_Ped_ChNbYmin = GetYminValueFromMemo("D_Ped_ChNb");}
11697  if( HistoCode == "D_Ped_ChDs" ){fD_Ped_ChDsYmin = GetYminValueFromMemo("D_Ped_ChDs");}
11698  if( HistoCode == "D_TNo_ChNb" ){fD_TNo_ChNbYmin = GetYminValueFromMemo("D_TNo_ChNb");}
11699  if( HistoCode == "D_TNo_ChDs" ){fD_TNo_ChDsYmin = GetYminValueFromMemo("D_TNo_ChDs");}
11700  if( HistoCode == "D_MCs_ChNb" ){fD_MCs_ChNbYmin = GetYminValueFromMemo("D_MCs_ChNb");}
11701  if( HistoCode == "D_MCs_ChDs" ){fD_MCs_ChDsYmin = GetYminValueFromMemo("D_MCs_ChDs");}
11702  if( HistoCode == "D_LFN_ChNb" ){fD_LFN_ChNbYmin = GetYminValueFromMemo("D_LFN_ChNb");}
11703  if( HistoCode == "D_LFN_ChDs" ){fD_LFN_ChDsYmin = GetYminValueFromMemo("D_LFN_ChDs");}
11704  if( HistoCode == "D_HFN_ChNb" ){fD_HFN_ChNbYmin = GetYminValueFromMemo("D_HFN_ChNb");}
11705  if( HistoCode == "D_HFN_ChDs" ){fD_HFN_ChDsYmin = GetYminValueFromMemo("D_HFN_ChDs");}
11706  if( HistoCode == "D_SCs_ChNb" ){fD_SCs_ChNbYmin = GetYminValueFromMemo("D_SCs_ChNb");}
11707  if( HistoCode == "D_SCs_ChDs" ){fD_SCs_ChDsYmin = GetYminValueFromMemo("D_SCs_ChDs");}
11708  if( HistoCode == "D_MSp_Samp" ){fD_MSp_SampYmin = GetYminValueFromMemo("D_MSp_Samp");}
11709  if( HistoCode == "D_SSp_Samp" ){fD_SSp_SampYmin = GetYminValueFromMemo("D_SSp_Samp");}
11710  if( HistoCode == "D_Adc_EvDs" ){fD_Adc_EvDsYmin = GetYminValueFromMemo("D_Adc_EvDs");}
11711  if( HistoCode == "D_Adc_EvNb" ){fD_Adc_EvNbYmin = GetYminValueFromMemo("D_Adc_EvNb");}
11712  if( HistoCode == "H_Ped_Date" ){fH_Ped_DateYmin = GetYminValueFromMemo("H_Ped_Date");}
11713  if( HistoCode == "H_TNo_Date" ){fH_TNo_DateYmin = GetYminValueFromMemo("H_TNo_Date");}
11714  if( HistoCode == "H_MCs_Date" ){fH_MCs_DateYmin = GetYminValueFromMemo("H_MCs_Date");}
11715  if( HistoCode == "H_LFN_Date" ){fH_LFN_DateYmin = GetYminValueFromMemo("H_LFN_Date");}
11716  if( HistoCode == "H_HFN_Date" ){fH_HFN_DateYmin = GetYminValueFromMemo("H_HFN_Date");}
11717  if( HistoCode == "H_SCs_Date" ){fH_SCs_DateYmin = GetYminValueFromMemo("H_SCs_Date");}
11718  if( HistoCode == "H_Ped_RuDs" ){fH_Ped_RuDsYmin = GetYminValueFromMemo("H_Ped_RuDs");}
11719  if( HistoCode == "H_TNo_RuDs" ){fH_TNo_RuDsYmin = GetYminValueFromMemo("H_TNo_RuDs");}
11720  if( HistoCode == "H_MCs_RuDs" ){fH_MCs_RuDsYmin = GetYminValueFromMemo("H_MCs_RuDs");}
11721  if( HistoCode == "H_LFN_RuDs" ){fH_LFN_RuDsYmin = GetYminValueFromMemo("H_LFN_RuDs");}
11722  if( HistoCode == "H_HFN_RuDs" ){fH_HFN_RuDsYmin = GetYminValueFromMemo("H_HFN_RuDs");}
11723  if( HistoCode == "H_SCs_RuDs" ){fH_SCs_RuDsYmin = GetYminValueFromMemo("H_SCs_RuDs");}
11724  if( HistoCode == "H2LFccMosMatrix" ){fH2LFccMosMatrixYmin = GetYminValueFromMemo("H2LFccMosMatrix");}
11725  if( HistoCode == "H2HFccMosMatrix" ){fH2HFccMosMatrixYmin = GetYminValueFromMemo("H2HFccMosMatrix");}
11726  if( HistoCode == "H2CorccInStins" ){fH2CorccInStinsYmin = GetYminValueFromMemo("H2CorccInStins");}
11727 }// end of SetYminMemoFromPreviousMemo(...)
11728 
11729 void TEcnaHistos::SetYmaxMemoFromPreviousMemo(const TString HistoCode)
11730 {
11731 // InitQuantity Ymax
11732 
11733  if( HistoCode == "D_NOE_ChNb" ){fD_NOE_ChNbYmax = GetYmaxValueFromMemo("D_NOE_ChNb");}
11734  if( HistoCode == "D_NOE_ChDs" ){fD_NOE_ChDsYmax = GetYmaxValueFromMemo("D_NOE_ChDs");}
11735  if( HistoCode == "D_Ped_ChNb" ){fD_Ped_ChNbYmax = GetYmaxValueFromMemo("D_Ped_ChNb");}
11736  if( HistoCode == "D_Ped_ChDs" ){fD_Ped_ChDsYmax = GetYmaxValueFromMemo("D_Ped_ChDs");}
11737  if( HistoCode == "D_TNo_ChNb" ){fD_TNo_ChNbYmax = GetYmaxValueFromMemo("D_TNo_ChNb");}
11738  if( HistoCode == "D_TNo_ChDs" ){fD_TNo_ChDsYmax = GetYmaxValueFromMemo("D_TNo_ChDs");}
11739  if( HistoCode == "D_MCs_ChNb" ){fD_MCs_ChNbYmax = GetYmaxValueFromMemo("D_MCs_ChNb");}
11740  if( HistoCode == "D_MCs_ChDs" ){fD_MCs_ChDsYmax = GetYmaxValueFromMemo("D_MCs_ChDs");}
11741  if( HistoCode == "D_LFN_ChNb" ){fD_LFN_ChNbYmax = GetYmaxValueFromMemo("D_LFN_ChNb");}
11742  if( HistoCode == "D_LFN_ChDs" ){fD_LFN_ChDsYmax = GetYmaxValueFromMemo("D_LFN_ChDs");}
11743  if( HistoCode == "D_HFN_ChNb" ){fD_HFN_ChNbYmax = GetYmaxValueFromMemo("D_HFN_ChNb");}
11744  if( HistoCode == "D_HFN_ChDs" ){fD_HFN_ChDsYmax = GetYmaxValueFromMemo("D_HFN_ChDs");}
11745  if( HistoCode == "D_SCs_ChNb" ){fD_SCs_ChNbYmax = GetYmaxValueFromMemo("D_SCs_ChNb");}
11746  if( HistoCode == "D_SCs_ChDs" ){fD_SCs_ChDsYmax = GetYmaxValueFromMemo("D_SCs_ChDs");}
11747  if( HistoCode == "D_MSp_Samp" ){fD_MSp_SampYmax = GetYmaxValueFromMemo("D_MSp_Samp");}
11748  if( HistoCode == "D_SSp_Samp" ){fD_SSp_SampYmax = GetYmaxValueFromMemo("D_SSp_Samp");}
11749  if( HistoCode == "D_Adc_EvDs" ){fD_Adc_EvDsYmax = GetYmaxValueFromMemo("D_Adc_EvDs");}
11750  if( HistoCode == "D_Adc_EvNb" ){fD_Adc_EvNbYmax = GetYmaxValueFromMemo("D_Adc_EvNb");}
11751  if( HistoCode == "H_Ped_Date" ){fH_Ped_DateYmax = GetYmaxValueFromMemo("H_Ped_Date");}
11752  if( HistoCode == "H_TNo_Date" ){fH_TNo_DateYmax = GetYmaxValueFromMemo("H_TNo_Date");}
11753  if( HistoCode == "H_MCs_Date" ){fH_MCs_DateYmax = GetYmaxValueFromMemo("H_MCs_Date");}
11754  if( HistoCode == "H_LFN_Date" ){fH_LFN_DateYmax = GetYmaxValueFromMemo("H_LFN_Date");}
11755  if( HistoCode == "H_HFN_Date" ){fH_HFN_DateYmax = GetYmaxValueFromMemo("H_HFN_Date");}
11756  if( HistoCode == "H_SCs_Date" ){fH_SCs_DateYmax = GetYmaxValueFromMemo("H_SCs_Date");}
11757  if( HistoCode == "H_Ped_RuDs" ){fH_Ped_RuDsYmax = GetYmaxValueFromMemo("H_Ped_RuDs");}
11758  if( HistoCode == "H_TNo_RuDs" ){fH_TNo_RuDsYmax = GetYmaxValueFromMemo("H_TNo_RuDs");}
11759  if( HistoCode == "H_MCs_RuDs" ){fH_MCs_RuDsYmax = GetYmaxValueFromMemo("H_MCs_RuDs");}
11760  if( HistoCode == "H_LFN_RuDs" ){fH_LFN_RuDsYmax = GetYmaxValueFromMemo("H_LFN_RuDs");}
11761  if( HistoCode == "H_HFN_RuDs" ){fH_HFN_RuDsYmax = GetYmaxValueFromMemo("H_HFN_RuDs");}
11762  if( HistoCode == "H_SCs_RuDs" ){fH_SCs_RuDsYmax = GetYmaxValueFromMemo("H_SCs_RuDs");}
11763  if( HistoCode == "H2LFccMosMatrix" ){fH2LFccMosMatrixYmax = GetYmaxValueFromMemo("H2LFccMosMatrix");}
11764  if( HistoCode == "H2HFccMosMatrix" ){fH2HFccMosMatrixYmax = GetYmaxValueFromMemo("H2HFccMosMatrix");}
11765  if( HistoCode == "H2CorccInStins" ){fH2CorccInStinsYmax = GetYmaxValueFromMemo("H2CorccInStins");}
11766 }// end of SetYmaxMemoFromPreviousMemo(...)
11767 
11768 //------------------------------------------------------------------------------------------------------
11769 void TEcnaHistos::SetXVarMemo(const TString HistoCode, const TString opt_plot, const TString xvar)
11770 {
11771 
11772  if( opt_plot == fSameOnePlot ){fXMemoH1SamePlus = xvar;}
11773 
11774  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
11775  {
11776  if( HistoCode == "D_NOE_ChNb"){fXMemoD_NOE_ChNb = xvar;}
11777  if( HistoCode == "D_NOE_ChDs"){fXMemoD_NOE_ChDs = xvar;}
11778  if( HistoCode == "D_Ped_ChNb"){fXMemoD_Ped_ChNb = xvar;}
11779  if( HistoCode == "D_Ped_ChDs"){fXMemoD_Ped_ChDs = xvar;}
11780  if( HistoCode == "D_TNo_ChNb"){fXMemoD_TNo_ChNb = xvar;}
11781  if( HistoCode == "D_TNo_ChDs"){fXMemoD_TNo_ChDs = xvar;}
11782  if( HistoCode == "D_MCs_ChNb"){fXMemoD_MCs_ChNb = xvar;}
11783  if( HistoCode == "D_MCs_ChDs"){fXMemoD_MCs_ChDs = xvar;}
11784  if( HistoCode == "D_LFN_ChNb"){fXMemoD_LFN_ChNb = xvar;}
11785  if( HistoCode == "D_LFN_ChDs"){fXMemoD_LFN_ChDs = xvar;}
11786  if( HistoCode == "D_HFN_ChNb"){fXMemoD_HFN_ChNb = xvar;}
11787  if( HistoCode == "D_HFN_ChDs"){fXMemoD_HFN_ChDs = xvar;}
11788  if( HistoCode == "D_SCs_ChNb"){fXMemoD_SCs_ChNb = xvar;}
11789  if( HistoCode == "D_SCs_ChDs"){fXMemoD_SCs_ChDs = xvar;}
11790  if( HistoCode == "D_MSp_Samp"){fXMemoD_MSp_Samp = xvar;}
11791  if( HistoCode == "D_SSp_Samp"){fXMemoD_SSp_Samp = xvar;}
11792  if( HistoCode == "D_Adc_EvDs"){fXMemoD_Adc_EvDs = xvar;}
11793  if( HistoCode == "D_Adc_EvNb"){fXMemoD_Adc_EvNb = xvar;}
11794  if( HistoCode == "H_Ped_Date"){fXMemoH_Ped_Date = xvar;}
11795  if( HistoCode == "H_TNo_Date"){fXMemoH_TNo_Date = xvar;}
11796  if( HistoCode == "H_MCs_Date"){fXMemoH_MCs_Date = xvar;}
11797  if( HistoCode == "H_LFN_Date"){fXMemoH_LFN_Date = xvar;}
11798  if( HistoCode == "H_HFN_Date"){fXMemoH_HFN_Date = xvar;}
11799  if( HistoCode == "H_SCs_Date"){fXMemoH_SCs_Date = xvar;}
11800  if( HistoCode == "H_Ped_RuDs"){fXMemoH_Ped_RuDs = xvar;}
11801  if( HistoCode == "H_TNo_RuDs"){fXMemoH_TNo_RuDs = xvar;}
11802  if( HistoCode == "H_MCs_RuDs"){fXMemoH_MCs_RuDs = xvar;}
11803  if( HistoCode == "H_LFN_RuDs"){fXMemoH_LFN_RuDs = xvar;}
11804  if( HistoCode == "H_HFN_RuDs"){fXMemoH_HFN_RuDs = xvar;}
11805  if( HistoCode == "H_SCs_RuDs"){fXMemoH_SCs_RuDs = xvar;}
11806  }
11807 }// end of SetXVarMemo(...)
11808 
11809 TString TEcnaHistos::GetXVarFromMemo(const TString HistoCode, const TString opt_plot)
11810 {
11811  TString xvar = "(xvar not found)";
11812 
11813  if( opt_plot == fSameOnePlot ){xvar = fXMemoH1SamePlus;}
11814 
11815  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
11816  {
11817  if( HistoCode == "D_NOE_ChNb"){xvar = fXMemoD_NOE_ChNb;}
11818  if( HistoCode == "D_NOE_ChDs"){xvar = fXMemoD_NOE_ChDs;}
11819  if( HistoCode == "D_Ped_ChNb"){xvar = fXMemoD_Ped_ChNb;}
11820  if( HistoCode == "D_Ped_ChDs"){xvar = fXMemoD_Ped_ChDs;}
11821  if( HistoCode == "D_TNo_ChNb"){xvar = fXMemoD_TNo_ChNb;}
11822  if( HistoCode == "D_TNo_ChDs"){xvar = fXMemoD_TNo_ChDs;}
11823  if( HistoCode == "D_MCs_ChNb"){xvar = fXMemoD_MCs_ChNb;}
11824  if( HistoCode == "D_MCs_ChDs"){xvar = fXMemoD_MCs_ChDs;}
11825  if( HistoCode == "D_LFN_ChNb"){xvar = fXMemoD_LFN_ChNb;}
11826  if( HistoCode == "D_LFN_ChDs"){xvar = fXMemoD_LFN_ChDs;}
11827  if( HistoCode == "D_HFN_ChNb"){xvar = fXMemoD_HFN_ChNb;}
11828  if( HistoCode == "D_HFN_ChDs"){xvar = fXMemoD_HFN_ChDs;}
11829  if( HistoCode == "D_SCs_ChNb"){xvar = fXMemoD_SCs_ChNb;}
11830  if( HistoCode == "D_SCs_ChDs"){xvar = fXMemoD_SCs_ChDs;}
11831  if( HistoCode == "D_MSp_Samp"){xvar = fXMemoD_MSp_Samp;}
11832  if( HistoCode == "D_SSp_Samp"){xvar = fXMemoD_SSp_Samp;}
11833  if( HistoCode == "D_Adc_EvDs"){xvar = fXMemoD_Adc_EvDs;}
11834  if( HistoCode == "D_Adc_EvNb"){xvar = fXMemoD_Adc_EvNb;}
11835  if( HistoCode == "H_Ped_Date"){xvar = fXMemoH_Ped_Date;}
11836  if( HistoCode == "H_TNo_Date"){xvar = fXMemoH_TNo_Date;}
11837  if( HistoCode == "H_MCs_Date"){xvar = fXMemoH_MCs_Date;}
11838  if( HistoCode == "H_LFN_Date"){xvar = fXMemoH_LFN_Date;}
11839  if( HistoCode == "H_HFN_Date"){xvar = fXMemoH_HFN_Date;}
11840  if( HistoCode == "H_SCs_Date"){xvar = fXMemoH_SCs_Date;}
11841  if( HistoCode == "H_Ped_RuDs"){xvar = fXMemoH_Ped_RuDs;}
11842  if( HistoCode == "H_TNo_RuDs"){xvar = fXMemoH_TNo_RuDs;}
11843  if( HistoCode == "H_MCs_RuDs"){xvar = fXMemoH_MCs_RuDs;}
11844  if( HistoCode == "H_LFN_RuDs"){xvar = fXMemoH_LFN_RuDs;}
11845  if( HistoCode == "H_HFN_RuDs"){xvar = fXMemoH_HFN_RuDs;}
11846  if( HistoCode == "H_SCs_RuDs"){xvar = fXMemoH_SCs_RuDs;}
11847  }
11848  return xvar;
11849 }// end of GetXVarFromMemo(...)
11850 
11851 
11852 void TEcnaHistos::SetYVarMemo(const TString HistoCode, const TString opt_plot, const TString yvar)
11853 {
11854  if( opt_plot == fSameOnePlot ){fYMemoH1SamePlus = yvar;}
11855 
11856  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
11857  {
11858  if( HistoCode == "D_NOE_ChNb"){fYMemoD_NOE_ChNb = yvar;}
11859  if( HistoCode == "D_NOE_ChDs"){fYMemoD_NOE_ChDs = yvar;}
11860  if( HistoCode == "D_Ped_ChNb"){fYMemoD_Ped_ChNb = yvar;}
11861  if( HistoCode == "D_Ped_ChDs"){fYMemoD_Ped_ChDs = yvar;}
11862  if( HistoCode == "D_TNo_ChNb"){fYMemoD_TNo_ChNb = yvar;}
11863  if( HistoCode == "D_TNo_ChDs"){fYMemoD_TNo_ChDs = yvar;}
11864  if( HistoCode == "D_MCs_ChNb"){fYMemoD_MCs_ChNb = yvar;}
11865  if( HistoCode == "D_MCs_ChDs"){fYMemoD_MCs_ChDs = yvar;}
11866  if( HistoCode == "D_LFN_ChNb"){fYMemoD_LFN_ChNb = yvar;}
11867  if( HistoCode == "D_LFN_ChDs"){fYMemoD_LFN_ChDs = yvar;}
11868  if( HistoCode == "D_HFN_ChNb"){fYMemoD_HFN_ChNb = yvar;}
11869  if( HistoCode == "D_HFN_ChDs"){fYMemoD_HFN_ChDs = yvar;}
11870  if( HistoCode == "D_SCs_ChNb"){fYMemoD_SCs_ChNb = yvar;}
11871  if( HistoCode == "D_SCs_ChDs"){fYMemoD_SCs_ChDs = yvar;}
11872  if( HistoCode == "D_MSp_Samp"){fYMemoD_MSp_Samp = yvar;}
11873  if( HistoCode == "D_SSp_Samp"){fYMemoD_SSp_Samp = yvar;}
11874  if( HistoCode == "D_Adc_EvDs"){fYMemoD_Adc_EvDs = yvar;}
11875  if( HistoCode == "D_Adc_EvNb"){fYMemoD_Adc_EvNb = yvar;}
11876  if( HistoCode == "H_Ped_Date"){fYMemoH_Ped_Date = yvar;}
11877  if( HistoCode == "H_TNo_Date"){fYMemoH_TNo_Date = yvar;}
11878  if( HistoCode == "H_MCs_Date"){fYMemoH_MCs_Date = yvar;}
11879  if( HistoCode == "H_LFN_Date"){fYMemoH_LFN_Date = yvar;}
11880  if( HistoCode == "H_HFN_Date"){fYMemoH_HFN_Date = yvar;}
11881  if( HistoCode == "H_SCs_Date"){fYMemoH_SCs_Date = yvar;}
11882  if( HistoCode == "H_Ped_RuDs"){fYMemoH_Ped_RuDs = yvar;}
11883  if( HistoCode == "H_TNo_RuDs"){fYMemoH_TNo_RuDs = yvar;}
11884  if( HistoCode == "H_MCs_RuDs"){fYMemoH_MCs_RuDs = yvar;}
11885  if( HistoCode == "H_LFN_RuDs"){fYMemoH_LFN_RuDs = yvar;}
11886  if( HistoCode == "H_HFN_RuDs"){fYMemoH_HFN_RuDs = yvar;}
11887  if( HistoCode == "H_SCs_RuDs"){fYMemoH_SCs_RuDs = yvar;}
11888  }
11889 }// end of SetYVarMemo(...)
11890 
11891 TString TEcnaHistos::GetYVarFromMemo(const TString HistoCode, const TString opt_plot)
11892 {
11893  TString yvar = "(yvar not found)";
11894 
11895  if( opt_plot == fSameOnePlot ){yvar = fYMemoH1SamePlus;}
11896 
11897  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
11898  {
11899  if( HistoCode == "D_NOE_ChNb"){yvar = fYMemoD_NOE_ChNb;}
11900  if( HistoCode == "D_NOE_ChDs"){yvar = fYMemoD_NOE_ChDs;}
11901  if( HistoCode == "D_Ped_ChNb"){yvar = fYMemoD_Ped_ChNb;}
11902  if( HistoCode == "D_Ped_ChDs"){yvar = fYMemoD_Ped_ChDs;}
11903  if( HistoCode == "D_TNo_ChNb"){yvar = fYMemoD_TNo_ChNb;}
11904  if( HistoCode == "D_TNo_ChDs"){yvar = fYMemoD_TNo_ChDs;}
11905  if( HistoCode == "D_MCs_ChNb"){yvar = fYMemoD_MCs_ChNb;}
11906  if( HistoCode == "D_MCs_ChDs"){yvar = fYMemoD_MCs_ChDs;}
11907  if( HistoCode == "D_LFN_ChNb"){yvar = fYMemoD_LFN_ChNb;}
11908  if( HistoCode == "D_LFN_ChDs"){yvar = fYMemoD_LFN_ChDs;}
11909  if( HistoCode == "D_HFN_ChNb"){yvar = fYMemoD_HFN_ChNb;}
11910  if( HistoCode == "D_HFN_ChDs"){yvar = fYMemoD_HFN_ChDs;}
11911  if( HistoCode == "D_SCs_ChNb"){yvar = fYMemoD_SCs_ChNb;}
11912  if( HistoCode == "D_SCs_ChDs"){yvar = fYMemoD_SCs_ChDs;}
11913  if( HistoCode == "D_MSp_Samp"){yvar = fYMemoD_MSp_Samp;}
11914  if( HistoCode == "D_SSp_Samp"){yvar = fYMemoD_SSp_Samp;}
11915  if( HistoCode == "D_Adc_EvDs"){yvar = fYMemoD_Adc_EvDs;}
11916  if( HistoCode == "D_Adc_EvNb"){yvar = fYMemoD_Adc_EvNb;}
11917  if( HistoCode == "H_Ped_Date"){yvar = fYMemoH_Ped_Date;}
11918  if( HistoCode == "H_TNo_Date"){yvar = fYMemoH_TNo_Date;}
11919  if( HistoCode == "H_MCs_Date"){yvar = fYMemoH_MCs_Date;}
11920  if( HistoCode == "H_LFN_Date"){yvar = fYMemoH_LFN_Date;}
11921  if( HistoCode == "H_HFN_Date"){yvar = fYMemoH_HFN_Date;}
11922  if( HistoCode == "H_SCs_Date"){yvar = fYMemoH_SCs_Date;}
11923  if( HistoCode == "H_Ped_RuDs"){yvar = fYMemoH_Ped_RuDs;}
11924  if( HistoCode == "H_TNo_RuDs"){yvar = fYMemoH_TNo_RuDs;}
11925  if( HistoCode == "H_MCs_RuDs"){yvar = fYMemoH_MCs_RuDs;}
11926  if( HistoCode == "H_LFN_RuDs"){yvar = fYMemoH_LFN_RuDs;}
11927  if( HistoCode == "H_HFN_RuDs"){yvar = fYMemoH_HFN_RuDs;}
11928  if( HistoCode == "H_SCs_RuDs"){yvar = fYMemoH_SCs_RuDs;}
11929  }
11930  return yvar;
11931 }// end of GetYVarFromMemo(...)
11932 
11933 void TEcnaHistos::SetNbBinsMemo(const TString HistoCode, const TString opt_plot, const Int_t& nb_bins)
11934 {
11935 
11936  if( opt_plot == fSameOnePlot ){fNbBinsMemoH1SamePlus = nb_bins;}
11937 
11938  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
11939  {
11940  if( HistoCode == "D_NOE_ChNb"){fNbBinsMemoD_NOE_ChNb = nb_bins;}
11941  if( HistoCode == "D_NOE_ChDs"){fNbBinsMemoD_NOE_ChDs = nb_bins;}
11942  if( HistoCode == "D_Ped_ChNb"){fNbBinsMemoD_Ped_ChNb = nb_bins;}
11943  if( HistoCode == "D_Ped_ChDs"){fNbBinsMemoD_Ped_ChDs = nb_bins;}
11944  if( HistoCode == "D_TNo_ChNb"){fNbBinsMemoD_TNo_ChNb = nb_bins;}
11945  if( HistoCode == "D_TNo_ChDs"){fNbBinsMemoD_TNo_ChDs = nb_bins;}
11946  if( HistoCode == "D_MCs_ChNb"){fNbBinsMemoD_MCs_ChNb = nb_bins;}
11947  if( HistoCode == "D_MCs_ChDs"){fNbBinsMemoD_MCs_ChDs = nb_bins;}
11948  if( HistoCode == "D_LFN_ChNb"){fNbBinsMemoD_LFN_ChNb = nb_bins;}
11949  if( HistoCode == "D_LFN_ChDs"){fNbBinsMemoD_LFN_ChDs = nb_bins;}
11950  if( HistoCode == "D_HFN_ChNb"){fNbBinsMemoD_HFN_ChNb = nb_bins;}
11951  if( HistoCode == "D_HFN_ChDs"){fNbBinsMemoD_HFN_ChDs = nb_bins;}
11952  if( HistoCode == "D_SCs_ChNb"){fNbBinsMemoD_SCs_ChNb = nb_bins;}
11953  if( HistoCode == "D_SCs_ChDs"){fNbBinsMemoD_SCs_ChDs = nb_bins;}
11954  if( HistoCode == "D_MSp_Samp"){fNbBinsMemoD_MSp_Samp = nb_bins;}
11955  if( HistoCode == "D_SSp_Samp"){fNbBinsMemoD_SSp_Samp = nb_bins;}
11956  if( HistoCode == "D_Adc_EvDs"){fNbBinsMemoD_Adc_EvDs = nb_bins;}
11957  if( HistoCode == "D_Adc_EvNb"){fNbBinsMemoD_Adc_EvNb = nb_bins;}
11958  if( HistoCode == "H_Ped_Date"){fNbBinsMemoH_Ped_Date = nb_bins;}
11959  if( HistoCode == "H_TNo_Date"){fNbBinsMemoH_TNo_Date = nb_bins;}
11960  if( HistoCode == "H_MCs_Date"){fNbBinsMemoH_MCs_Date = nb_bins;}
11961  if( HistoCode == "H_LFN_Date"){fNbBinsMemoH_LFN_Date = nb_bins;}
11962  if( HistoCode == "H_HFN_Date"){fNbBinsMemoH_HFN_Date = nb_bins;}
11963  if( HistoCode == "H_SCs_Date"){fNbBinsMemoH_SCs_Date = nb_bins;}
11964  if( HistoCode == "H_Ped_RuDs"){fNbBinsMemoH_Ped_RuDs = nb_bins;}
11965  if( HistoCode == "H_TNo_RuDs"){fNbBinsMemoH_TNo_RuDs = nb_bins;}
11966  if( HistoCode == "H_MCs_RuDs"){fNbBinsMemoH_MCs_RuDs = nb_bins;}
11967  if( HistoCode == "H_LFN_RuDs"){fNbBinsMemoH_LFN_RuDs = nb_bins;}
11968  if( HistoCode == "H_HFN_RuDs"){fNbBinsMemoH_HFN_RuDs = nb_bins;}
11969  if( HistoCode == "H_SCs_RuDs"){fNbBinsMemoH_SCs_RuDs = nb_bins;}
11970  }
11971 }// end of SetNbBinsMemo(...)
11972 
11973 Int_t TEcnaHistos::GetNbBinsFromMemo(const TString HistoCode, const TString opt_plot)
11974 {
11975  Int_t nb_bins = 0;
11976 
11977  if( opt_plot == fSameOnePlot ){nb_bins = fNbBinsMemoH1SamePlus;}
11978 
11979  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
11980  {
11981  if( HistoCode == "D_NOE_ChNb"){nb_bins = fNbBinsMemoD_NOE_ChNb;}
11982  if( HistoCode == "D_NOE_ChDs"){nb_bins = fNbBinsMemoD_NOE_ChDs;}
11983  if( HistoCode == "D_Ped_ChNb"){nb_bins = fNbBinsMemoD_Ped_ChNb;}
11984  if( HistoCode == "D_Ped_ChDs"){nb_bins = fNbBinsMemoD_Ped_ChDs;}
11985  if( HistoCode == "D_TNo_ChNb"){nb_bins = fNbBinsMemoD_TNo_ChNb;}
11986  if( HistoCode == "D_TNo_ChDs"){nb_bins = fNbBinsMemoD_TNo_ChDs;}
11987  if( HistoCode == "D_MCs_ChNb"){nb_bins = fNbBinsMemoD_MCs_ChNb;}
11988  if( HistoCode == "D_MCs_ChDs"){nb_bins = fNbBinsMemoD_MCs_ChDs;}
11989  if( HistoCode == "D_LFN_ChNb"){nb_bins = fNbBinsMemoD_LFN_ChNb;}
11990  if( HistoCode == "D_LFN_ChDs"){nb_bins = fNbBinsMemoD_LFN_ChDs;}
11991  if( HistoCode == "D_HFN_ChNb"){nb_bins = fNbBinsMemoD_HFN_ChNb;}
11992  if( HistoCode == "D_HFN_ChDs"){nb_bins = fNbBinsMemoD_HFN_ChDs;}
11993  if( HistoCode == "D_SCs_ChNb"){nb_bins = fNbBinsMemoD_SCs_ChNb;}
11994  if( HistoCode == "D_SCs_ChDs"){nb_bins = fNbBinsMemoD_SCs_ChDs;}
11995  if( HistoCode == "D_MSp_Samp"){nb_bins = fNbBinsMemoD_MSp_Samp;}
11996  if( HistoCode == "D_SSp_Samp"){nb_bins = fNbBinsMemoD_SSp_Samp;}
11997  if( HistoCode == "D_Adc_EvDs"){nb_bins = fNbBinsMemoD_Adc_EvDs;}
11998  if( HistoCode == "D_Adc_EvNb"){nb_bins = fNbBinsMemoD_Adc_EvNb;}
11999  if( HistoCode == "H_Ped_Date"){nb_bins = fNbBinsMemoH_Ped_Date;}
12000  if( HistoCode == "H_TNo_Date"){nb_bins = fNbBinsMemoH_TNo_Date;}
12001  if( HistoCode == "H_MCs_Date"){nb_bins = fNbBinsMemoH_MCs_Date;}
12002  if( HistoCode == "H_LFN_Date"){nb_bins = fNbBinsMemoH_LFN_Date;}
12003  if( HistoCode == "H_HFN_Date"){nb_bins = fNbBinsMemoH_HFN_Date;}
12004  if( HistoCode == "H_SCs_Date"){nb_bins = fNbBinsMemoH_SCs_Date;}
12005  if( HistoCode == "H_Ped_RuDs"){nb_bins = fNbBinsMemoH_Ped_RuDs;}
12006  if( HistoCode == "H_TNo_RuDs"){nb_bins = fNbBinsMemoH_TNo_RuDs;}
12007  if( HistoCode == "H_MCs_RuDs"){nb_bins = fNbBinsMemoH_MCs_RuDs;}
12008  if( HistoCode == "H_LFN_RuDs"){nb_bins = fNbBinsMemoH_LFN_RuDs;}
12009  if( HistoCode == "H_HFN_RuDs"){nb_bins = fNbBinsMemoH_HFN_RuDs;}
12010  if( HistoCode == "H_SCs_RuDs"){nb_bins = fNbBinsMemoH_SCs_RuDs;}
12011  }
12012  return nb_bins;
12013 }// end of GetNbBinsFromMemo(...)
12014 
12015 TString TEcnaHistos::GetMemoFlag(const TString opt_plot)
12016 {
12017  TString memo_flag;
12018  Int_t MaxCar = fgMaxCar;
12019  memo_flag.Resize(MaxCar);
12020  memo_flag = "(no memo_flag info)";
12021 
12022  Int_t memo_flag_number = -1;
12023 
12024  if( opt_plot == fSameOnePlot ){memo_flag_number = fMemoPlotH1SamePlus;}
12025 
12026  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12027  {
12028  memo_flag_number = fMemoPlotD_TNo_ChDs+fMemoPlotD_MCs_ChDs
12030  }
12031 
12032  if(memo_flag_number == 0){memo_flag = "Free";}
12033  if(memo_flag_number >= 1){memo_flag = "Busy";}
12034 
12035  return memo_flag;
12036 }
12037 
12038 TString TEcnaHistos::GetMemoFlag(const TString HistoCode, const TString opt_plot)
12039 {
12040 // Get Memo Flag
12041 
12042  TString memo_flag;
12043  Int_t MaxCar = fgMaxCar;
12044  memo_flag.Resize(MaxCar);
12045  memo_flag = "(no memo_flag info)";
12046 
12047  Int_t memo_flag_number = -1;
12048 
12049  if( opt_plot == fSameOnePlot ){memo_flag_number = fMemoPlotH1SamePlus;}
12050 
12051  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
12052  {
12053  if(HistoCode == "D_NOE_ChNb"){memo_flag_number = fMemoPlotD_NOE_ChNb;}
12054  if(HistoCode == "D_NOE_ChDs"){memo_flag_number = fMemoPlotD_NOE_ChDs;}
12055  if(HistoCode == "D_Ped_ChNb"){memo_flag_number = fMemoPlotD_Ped_ChNb;}
12056  if(HistoCode == "D_Ped_ChDs"){memo_flag_number = fMemoPlotD_Ped_ChDs;}
12057  if(HistoCode == "D_TNo_ChNb"){memo_flag_number = fMemoPlotD_TNo_ChNb;}
12058  if(HistoCode == "D_TNo_ChDs"){memo_flag_number = fMemoPlotD_TNo_ChDs;}
12059  if(HistoCode == "D_MCs_ChNb"){memo_flag_number = fMemoPlotD_MCs_ChNb;}
12060  if(HistoCode == "D_MCs_ChDs"){memo_flag_number = fMemoPlotD_MCs_ChDs;}
12061  if(HistoCode == "D_LFN_ChNb"){memo_flag_number = fMemoPlotD_LFN_ChNb;}
12062  if(HistoCode == "D_LFN_ChDs"){memo_flag_number = fMemoPlotD_LFN_ChDs;}
12063  if(HistoCode == "D_HFN_ChNb"){memo_flag_number = fMemoPlotD_HFN_ChNb;}
12064  if(HistoCode == "D_HFN_ChDs"){memo_flag_number = fMemoPlotD_HFN_ChDs;}
12065  if(HistoCode == "D_SCs_ChNb"){memo_flag_number = fMemoPlotD_SCs_ChNb;}
12066  if(HistoCode == "D_SCs_ChDs"){memo_flag_number = fMemoPlotD_SCs_ChDs;}
12067  if(HistoCode == "D_MSp_Samp"){memo_flag_number = fMemoPlotD_MSp_Samp;}
12068  if(HistoCode == "D_SSp_Samp"){memo_flag_number = fMemoPlotD_SSp_Samp;}
12069  if(HistoCode == "D_Adc_EvDs"){memo_flag_number = fMemoPlotD_Adc_EvDs;}
12070  if(HistoCode == "D_Adc_EvNb"){memo_flag_number = fMemoPlotD_Adc_EvNb;}
12071  if(HistoCode == "H_Ped_Date"){memo_flag_number = fMemoPlotH_Ped_Date;}
12072  if(HistoCode == "H_TNo_Date"){memo_flag_number = fMemoPlotH_TNo_Date;}
12073  if(HistoCode == "H_MCs_Date"){memo_flag_number = fMemoPlotH_MCs_Date;}
12074  if(HistoCode == "H_LFN_Date"){memo_flag_number = fMemoPlotH_LFN_Date;}
12075  if(HistoCode == "H_HFN_Date"){memo_flag_number = fMemoPlotH_HFN_Date;}
12076  if(HistoCode == "H_SCs_Date"){memo_flag_number = fMemoPlotH_SCs_Date;}
12077  if(HistoCode == "H_Ped_RuDs"){memo_flag_number = fMemoPlotH_Ped_RuDs;}
12078  if(HistoCode == "H_TNo_RuDs"){memo_flag_number = fMemoPlotH_TNo_RuDs;}
12079  if(HistoCode == "H_MCs_RuDs"){memo_flag_number = fMemoPlotH_MCs_RuDs;}
12080  if(HistoCode == "H_LFN_RuDs"){memo_flag_number = fMemoPlotH_LFN_RuDs;}
12081  if(HistoCode == "H_HFN_RuDs"){memo_flag_number = fMemoPlotH_HFN_RuDs;}
12082  if(HistoCode == "H_SCs_RuDs"){memo_flag_number = fMemoPlotH_SCs_RuDs;}
12083  }
12084 
12085  if(memo_flag_number == 0){memo_flag = "Free";}
12086  if(memo_flag_number == 1){memo_flag = "Busy";}
12087 
12088  return memo_flag;
12089 }
12090 
12091 TCanvas* TEcnaHistos::CreateCanvas(const TString HistoCode, const TString opt_plot, const TString canvas_name,
12092  UInt_t canv_w, UInt_t canv_h)
12093 {
12094 // Create canvas according to HistoCode
12095 
12096  TCanvas* main_canvas = 0;
12097 
12098  if( opt_plot == fSameOnePlot )
12099  {
12100  fCanvH1SamePlus = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12101  main_canvas = fCanvH1SamePlus;
12102  }
12103  if( opt_plot == fSeveralPlot || opt_plot == fOnlyOnePlot )
12104  {
12105  if(HistoCode == "D_NOE_ChNb"){
12106  fCanvD_NOE_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12107  main_canvas = fCanvD_NOE_ChNb;}
12108  if(HistoCode == "D_NOE_ChDs"){
12109  fCanvD_NOE_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12110  main_canvas = fCanvD_NOE_ChDs;}
12111  if(HistoCode == "D_Ped_ChNb"){
12112  fCanvD_Ped_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12113  main_canvas = fCanvD_Ped_ChNb;}
12114  if(HistoCode == "D_Ped_ChDs"){
12115  fCanvD_Ped_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12116  main_canvas = fCanvD_Ped_ChDs;}
12117  if(HistoCode == "D_TNo_ChNb"){
12118  fCanvD_TNo_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12119  main_canvas = fCanvD_TNo_ChNb;}
12120  if(HistoCode == "D_TNo_ChDs"){
12121  fCanvD_TNo_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12122  main_canvas = fCanvD_TNo_ChDs;}
12123  if(HistoCode == "D_MCs_ChNb"){
12124  fCanvD_MCs_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12125  main_canvas = fCanvD_MCs_ChNb;}
12126  if(HistoCode == "D_MCs_ChDs"){
12127  fCanvD_MCs_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12128  main_canvas = fCanvD_MCs_ChDs;}
12129  if(HistoCode == "D_LFN_ChNb"){
12130  fCanvD_LFN_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12131  main_canvas = fCanvD_LFN_ChNb;}
12132  if(HistoCode == "D_LFN_ChDs"){
12133  fCanvD_LFN_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12134  main_canvas = fCanvD_LFN_ChDs;}
12135  if(HistoCode == "D_HFN_ChNb"){
12136  fCanvD_HFN_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12137  main_canvas = fCanvD_HFN_ChNb;}
12138  if(HistoCode == "D_HFN_ChDs"){
12139  fCanvD_HFN_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12140  main_canvas = fCanvD_HFN_ChDs;}
12141  if(HistoCode == "D_SCs_ChNb"){
12142  fCanvD_SCs_ChNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12143  main_canvas = fCanvD_SCs_ChNb;}
12144 
12145  if(HistoCode == "D_SCs_ChDs"){
12146  fCanvD_SCs_ChDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12147  main_canvas = fCanvD_SCs_ChDs;}
12148  if(HistoCode == "D_MSp_Samp" ){
12149  fCanvD_MSp_Samp = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12150  main_canvas = fCanvD_MSp_Samp;}
12151  if(HistoCode =="D_SSp_Samp" ){
12152  fCanvD_SSp_Samp = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12153  main_canvas = fCanvD_SSp_Samp;}
12154  if(HistoCode == "D_Adc_EvDs"){
12155  fCanvD_Adc_EvDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12156  main_canvas = fCanvD_Adc_EvDs;}
12157  if(HistoCode == "D_Adc_EvNb"){
12158  fCanvD_Adc_EvNb = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12159  main_canvas = fCanvD_Adc_EvNb;}
12160  if(HistoCode == "H_Ped_Date"){
12161  fCanvH_Ped_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12162  main_canvas = fCanvH_Ped_Date;}
12163  if(HistoCode == "H_TNo_Date"){
12164  fCanvH_TNo_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12165  main_canvas = fCanvH_TNo_Date;}
12166  if(HistoCode == "H_MCs_Date"){
12167  fCanvH_MCs_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12168  main_canvas = fCanvH_MCs_Date;}
12169  if(HistoCode == "H_LFN_Date"){
12170  fCanvH_LFN_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12171  main_canvas = fCanvH_LFN_Date;}
12172  if(HistoCode == "H_HFN_Date"){
12173  fCanvH_HFN_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12174  main_canvas = fCanvH_HFN_Date;}
12175  if(HistoCode == "H_SCs_Date"){
12176  fCanvH_SCs_Date = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12177  main_canvas = fCanvH_SCs_Date;}
12178 
12179  if(HistoCode == "H_Ped_RuDs"){
12180  fCanvH_Ped_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12181  main_canvas = fCanvH_Ped_RuDs;}
12182  if(HistoCode == "H_TNo_RuDs"){
12183  fCanvH_TNo_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12184  main_canvas = fCanvH_TNo_RuDs;}
12185  if(HistoCode == "H_MCs_RuDs"){
12186  fCanvH_MCs_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12187  main_canvas = fCanvH_MCs_RuDs;}
12188  if(HistoCode == "H_LFN_RuDs"){
12189  fCanvH_LFN_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12190  main_canvas = fCanvH_LFN_RuDs;}
12191  if(HistoCode == "H_HFN_RuDs"){
12192  fCanvH_HFN_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12193  main_canvas = fCanvH_HFN_RuDs;}
12194  if(HistoCode == "H_SCs_RuDs"){
12195  fCanvH_SCs_RuDs = new TCanvas(canvas_name.Data(), canvas_name.Data(), canv_w, canv_h); fCnewRoot++;
12196  main_canvas = fCanvH_SCs_RuDs;}
12197 
12198  }
12199  return main_canvas;
12200 }
12201 // end of CreateCanvas
12202 
12203 void TEcnaHistos::SetParametersCanvas(const TString HistoCode, const TString opt_plot)
12204 {
12205 // Set parameters canvas according to HistoCode
12206 
12207  Double_t x_margin_factor = fCnaParHistos->BoxLeftX("bottom_left_box") - 0.005;
12208  Double_t y_margin_factor = fCnaParHistos->BoxTopY("bottom_right_box") + 0.005;
12209 
12210  if( opt_plot == fSameOnePlot )
12211  {
12212  fImpH1SamePlus = (TRootCanvas*)fCanvH1SamePlus->GetCanvasImp();
12213  fCanvH1SamePlus->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12214  fPadH1SamePlus = gPad;
12216  }
12217 
12218  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
12219  {
12220  if(HistoCode == "D_NOE_ChNb")
12221  {
12222  fImpD_NOE_ChNb = (TRootCanvas*)fCanvD_NOE_ChNb->GetCanvasImp();
12223  fCanvD_NOE_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12224  fPadD_NOE_ChNb = gPad;
12226  }
12227 
12228  if(HistoCode == "D_NOE_ChDs") // (SetParametersCanvas)
12229  {
12230  fImpD_NOE_ChDs = (TRootCanvas*)fCanvD_NOE_ChDs->GetCanvasImp();
12231  fCanvD_NOE_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12232  fPadD_NOE_ChDs = gPad;
12234  }
12235 
12236  if(HistoCode == "D_Ped_ChNb")
12237  {
12238  fImpD_Ped_ChNb = (TRootCanvas*)fCanvD_Ped_ChNb->GetCanvasImp();
12239  fCanvD_Ped_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12240  fPadD_Ped_ChNb = gPad;
12242  }
12243 
12244  if(HistoCode == "D_Ped_ChDs")
12245  {
12246  fImpD_Ped_ChDs = (TRootCanvas*)fCanvD_Ped_ChDs->GetCanvasImp();
12247  fCanvD_Ped_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12248  fPadD_Ped_ChDs = gPad;
12250  }
12251 
12252  if(HistoCode == "D_TNo_ChNb")
12253  {
12254  fImpD_TNo_ChNb = (TRootCanvas*)fCanvD_TNo_ChNb->GetCanvasImp();
12255  fCanvD_TNo_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12256  fPadD_TNo_ChNb = gPad;
12258  }
12259 
12260  if(HistoCode == "D_TNo_ChDs") // (SetParametersCanvas)
12261  {
12262  fImpD_TNo_ChDs = (TRootCanvas*)fCanvD_TNo_ChDs->GetCanvasImp();
12263  fCanvD_TNo_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12264  fPadD_TNo_ChDs = gPad;
12266  }
12267 
12268  if(HistoCode == "D_MCs_ChNb")
12269  {
12270  fImpD_MCs_ChNb = (TRootCanvas*)fCanvD_MCs_ChNb->GetCanvasImp();
12271  fCanvD_MCs_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12272  fPadD_MCs_ChNb = gPad;
12274  }
12275 
12276  if(HistoCode == "D_MCs_ChDs")
12277  {
12278  fImpD_MCs_ChDs = (TRootCanvas*)fCanvD_MCs_ChDs->GetCanvasImp();
12279  fCanvD_MCs_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12280  fPadD_MCs_ChDs = gPad;
12282  }
12283 
12284  if(HistoCode == "D_LFN_ChNb") // (SetParametersCanvas)
12285  {
12286  fImpD_LFN_ChNb = (TRootCanvas*)fCanvD_LFN_ChNb->GetCanvasImp();
12287  fCanvD_LFN_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12288  fPadD_LFN_ChNb = gPad;
12290  }
12291 
12292  if(HistoCode == "D_LFN_ChDs")
12293  {
12294  fImpD_LFN_ChDs = (TRootCanvas*)fCanvD_LFN_ChDs->GetCanvasImp();
12295  fCanvD_LFN_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12296  fPadD_LFN_ChDs = gPad;
12298  }
12299 
12300  if(HistoCode == "D_HFN_ChNb")
12301  {
12302  fImpD_HFN_ChNb = (TRootCanvas*)fCanvD_HFN_ChNb->GetCanvasImp();
12303  fCanvD_HFN_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12304  fPadD_HFN_ChNb = gPad;
12306  }
12307 
12308  if(HistoCode == "D_HFN_ChDs")
12309  {
12310  fImpD_HFN_ChDs = (TRootCanvas*)fCanvD_HFN_ChDs->GetCanvasImp();
12311  fCanvD_HFN_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12312  fPadD_HFN_ChDs = gPad;
12314  }
12315 
12316  if(HistoCode == "D_SCs_ChNb") // (SetParametersCanvas)
12317  {
12318  fImpD_SCs_ChNb = (TRootCanvas*)fCanvD_SCs_ChNb->GetCanvasImp();
12319  fCanvD_SCs_ChNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12320  fPadD_SCs_ChNb = gPad;
12322  }
12323 
12324  if(HistoCode == "D_SCs_ChDs")
12325  {
12326  fImpD_SCs_ChDs = (TRootCanvas*)fCanvD_SCs_ChDs->GetCanvasImp();
12327  fCanvD_SCs_ChDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12328  fPadD_SCs_ChDs = gPad;
12330  }
12331 
12332  if(HistoCode == "D_MSp_Samp")
12333  {
12334  fImpD_MSp_Samp = (TRootCanvas*)fCanvD_MSp_Samp->GetCanvasImp();
12335  fCanvD_MSp_Samp->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12336  fPadD_MSp_Samp = gPad;
12338  }
12339 
12340  if(HistoCode == "D_SSp_Samp") // (SetParametersCanvas)
12341  {
12342  fImpD_SSp_Samp = (TRootCanvas*)fCanvD_SSp_Samp->GetCanvasImp();
12343  fCanvD_SSp_Samp->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12344  fPadD_SSp_Samp = gPad;
12346  }
12347 
12348  if(HistoCode == "D_Adc_EvDs")
12349  {
12350  fImpD_Adc_EvDs = (TRootCanvas*)fCanvD_Adc_EvDs->GetCanvasImp();
12351  fCanvD_Adc_EvDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12352  fPadD_Adc_EvDs = gPad;
12354  }
12355 
12356  if(HistoCode == "D_Adc_EvNb")
12357  {
12358  fImpD_Adc_EvNb = (TRootCanvas*)fCanvD_Adc_EvNb->GetCanvasImp();
12359  fCanvD_Adc_EvNb->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12360  fPadD_Adc_EvNb = gPad;
12362  }
12363 
12364  if(HistoCode == "H_Ped_Date") // (SetParametersCanvas)
12365  {
12366  fImpH_Ped_Date = (TRootCanvas*)fCanvH_Ped_Date->GetCanvasImp();
12367  fCanvH_Ped_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12368  fPadH_Ped_Date = gPad;
12370  }
12371  if(HistoCode == "H_TNo_Date")
12372  {
12373  fImpH_TNo_Date = (TRootCanvas*)fCanvH_TNo_Date->GetCanvasImp();
12374  fCanvH_TNo_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12375  fPadH_TNo_Date = gPad;
12377  }
12378  if(HistoCode == "H_MCs_Date")
12379  {
12380  fImpH_MCs_Date = (TRootCanvas*)fCanvH_MCs_Date->GetCanvasImp();
12381  fCanvH_MCs_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12382  fPadH_MCs_Date = gPad;
12384  }
12385 
12386  if(HistoCode == "H_LFN_Date") // (SetParametersCanvas)
12387  {
12388  fImpH_LFN_Date = (TRootCanvas*)fCanvH_LFN_Date->GetCanvasImp();
12389  fCanvH_LFN_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12390  fPadH_LFN_Date = gPad;
12392  }
12393  if(HistoCode == "H_HFN_Date")
12394  {
12395  fImpH_HFN_Date = (TRootCanvas*)fCanvH_HFN_Date->GetCanvasImp();
12396  fCanvH_HFN_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12397  fPadH_HFN_Date = gPad;
12399  }
12400  if(HistoCode == "H_SCs_Date")
12401  {
12402  fImpH_SCs_Date = (TRootCanvas*)fCanvH_SCs_Date->GetCanvasImp();
12403  fCanvH_SCs_Date->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12404  fPadH_SCs_Date = gPad;
12406  }
12407 
12408  if(HistoCode == "H_Ped_RuDs") // (SetParametersCanvas)
12409  {
12410  fImpH_Ped_RuDs = (TRootCanvas*)fCanvH_Ped_RuDs->GetCanvasImp();
12411  fCanvH_Ped_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12412  fPadH_Ped_RuDs = gPad;
12414  }
12415  if(HistoCode == "H_TNo_RuDs")
12416  {
12417  fImpH_TNo_RuDs = (TRootCanvas*)fCanvH_TNo_RuDs->GetCanvasImp();
12418  fCanvH_TNo_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12419  fPadH_TNo_RuDs = gPad;
12421  }
12422  if(HistoCode == "H_MCs_RuDs")
12423  {
12424  fImpH_MCs_RuDs = (TRootCanvas*)fCanvH_MCs_RuDs->GetCanvasImp();
12425  fCanvH_MCs_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12426  fPadH_MCs_RuDs = gPad;
12428  }
12429 
12430  if(HistoCode == "H_LFN_RuDs") // (SetParametersCanvas)
12431  {
12432  fImpH_LFN_RuDs = (TRootCanvas*)fCanvH_LFN_RuDs->GetCanvasImp();
12433  fCanvH_LFN_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12434  fPadH_LFN_RuDs = gPad;
12436  }
12437  if(HistoCode == "H_HFN_RuDs")
12438  {
12439  fImpH_HFN_RuDs = (TRootCanvas*)fCanvH_HFN_RuDs->GetCanvasImp();
12440  fCanvH_HFN_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12441  fPadH_HFN_RuDs = gPad;
12443  }
12444  if(HistoCode == "H_SCs_RuDs")
12445  {
12446  fImpH_SCs_RuDs = (TRootCanvas*)fCanvH_SCs_RuDs->GetCanvasImp();
12447  fCanvH_SCs_RuDs->Divide(1, 1, x_margin_factor , y_margin_factor); gPad->cd(1);
12448  fPadH_SCs_RuDs = gPad;
12450  }
12451  }
12452 }
12453 // end of SetParametersCanvas
12454 
12455 TCanvas* TEcnaHistos::GetCurrentCanvas(const TString HistoCode, const TString opt_plot)
12456 {
12457  TCanvas* main_canvas = 0;
12458 
12459  if( opt_plot == fSameOnePlot ){main_canvas = fCanvH1SamePlus;}
12460 
12461  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
12462  {
12463  if(HistoCode == "D_NOE_ChNb"){main_canvas = fCanvD_NOE_ChNb;}
12464  if(HistoCode == "D_NOE_ChDs"){main_canvas = fCanvD_NOE_ChDs;}
12465  if(HistoCode == "D_Ped_ChNb"){main_canvas = fCanvD_Ped_ChNb;}
12466  if(HistoCode == "D_Ped_ChDs"){main_canvas = fCanvD_Ped_ChDs;}
12467  if(HistoCode == "D_TNo_ChNb"){main_canvas = fCanvD_TNo_ChNb;}
12468  if(HistoCode == "D_TNo_ChDs"){main_canvas = fCanvD_TNo_ChDs;}
12469  if(HistoCode == "D_MCs_ChNb"){main_canvas = fCanvD_MCs_ChNb;}
12470  if(HistoCode == "D_MCs_ChDs"){main_canvas = fCanvD_MCs_ChDs;}
12471  if(HistoCode == "D_LFN_ChNb"){main_canvas = fCanvD_LFN_ChNb;}
12472  if(HistoCode == "D_LFN_ChDs"){main_canvas = fCanvD_LFN_ChDs;}
12473  if(HistoCode == "D_HFN_ChNb"){main_canvas = fCanvD_HFN_ChNb;}
12474  if(HistoCode == "D_HFN_ChDs"){main_canvas = fCanvD_HFN_ChDs;}
12475  if(HistoCode == "D_SCs_ChNb"){main_canvas = fCanvD_SCs_ChNb;}
12476  if(HistoCode == "D_SCs_ChDs"){main_canvas = fCanvD_SCs_ChDs;}
12477  if(HistoCode == "D_MSp_Samp"){main_canvas = fCanvD_MSp_Samp;}
12478  if(HistoCode == "D_SSp_Samp"){main_canvas = fCanvD_SSp_Samp;}
12479  if(HistoCode == "D_Adc_EvDs"){main_canvas = fCanvD_Adc_EvDs;}
12480  if(HistoCode == "D_Adc_EvNb"){main_canvas = fCanvD_Adc_EvNb;}
12481  if(HistoCode == "H_Ped_Date"){main_canvas = fCanvH_Ped_Date;}
12482  if(HistoCode == "H_TNo_Date"){main_canvas = fCanvH_TNo_Date;}
12483  if(HistoCode == "H_MCs_Date"){main_canvas = fCanvH_MCs_Date;}
12484  if(HistoCode == "H_LFN_Date"){main_canvas = fCanvH_LFN_Date;}
12485  if(HistoCode == "H_HFN_Date"){main_canvas = fCanvH_HFN_Date;}
12486  if(HistoCode == "H_SCs_Date"){main_canvas = fCanvH_SCs_Date;}
12487  if(HistoCode == "H_Ped_RuDs"){main_canvas = fCanvH_Ped_RuDs;}
12488  if(HistoCode == "H_TNo_RuDs"){main_canvas = fCanvH_TNo_RuDs;}
12489  if(HistoCode == "H_MCs_RuDs"){main_canvas = fCanvH_MCs_RuDs;}
12490  if(HistoCode == "H_LFN_RuDs"){main_canvas = fCanvH_LFN_RuDs;}
12491  if(HistoCode == "H_HFN_RuDs"){main_canvas = fCanvH_HFN_RuDs;}
12492  if(HistoCode == "H_SCs_RuDs"){main_canvas = fCanvH_SCs_RuDs;}
12493  }
12494  return main_canvas;
12495 }
12496 // end of GetCurrentCanvas(...)
12497 
12500 
12502 {
12503  if( fCurrentCanvas != 0)
12504  {
12505  if( (TRootCanvas*)fCurrentCanvas->GetCanvasImp() != 0 )
12506  {
12507  (TCanvas*)fCurrentCanvas->DrawClone();
12508  }
12509  else
12510  {
12511  cout << "TEcnaHistos::PlotCloneOfCurrentCanvas()> Last canvas has been removed. No clone can be done."
12512  << endl << " Please, display the canvas again."
12513  << fTTBELL << endl;
12514  }
12515  }
12516  else
12517  {
12518  cout << "TEcnaHistos::PlotCloneOfCurrentCanvas()> No canvas has been created. No clone can be done."
12519  << fTTBELL << endl;
12520  }
12521 }
12522 
12523 //--------------------------------------------------------------------------------------------
12524 TVirtualPad* TEcnaHistos::ActivePad(const TString HistoCode, const TString opt_plot)
12525 {
12526 // Active Pad for Same plot option
12527 
12528  TVirtualPad* main_subpad = 0;
12529 
12530  if( opt_plot == fSameOnePlot )
12531  {
12532  if( (TRootCanvas*)fCanvH1SamePlus->GetCanvasImp() == fImpH1SamePlus ){
12533  main_subpad = fPadH1SamePlus;}
12534  }
12535 
12536  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
12537  {
12538  if(HistoCode == "D_NOE_ChNb"){
12539  if( (TRootCanvas*)fCanvD_NOE_ChNb->GetCanvasImp() == fImpD_NOE_ChNb ){
12540  main_subpad = fPadD_NOE_ChNb;}}
12541 
12542  if(HistoCode == "D_NOE_ChDs"){
12543  if( (TRootCanvas*)fCanvD_NOE_ChDs->GetCanvasImp() == fImpD_NOE_ChDs ){
12544  main_subpad = fPadD_NOE_ChDs;}}
12545 
12546  if(HistoCode == "D_Ped_ChNb"){
12547  if( (TRootCanvas*)fCanvD_Ped_ChNb->GetCanvasImp() == fImpD_Ped_ChNb ){
12548  main_subpad = fPadD_Ped_ChNb;}}
12549 
12550  if(HistoCode == "D_Ped_ChDs"){
12551  if( (TRootCanvas*)fCanvD_Ped_ChDs->GetCanvasImp() == fImpD_Ped_ChDs ){
12552  main_subpad = fPadD_Ped_ChDs;}}
12553 
12554  if(HistoCode == "D_TNo_ChNb"){
12555  if((TRootCanvas*)fCanvD_TNo_ChNb->GetCanvasImp() == fImpD_TNo_ChNb){
12556  main_subpad = fPadD_TNo_ChNb;}}
12557 
12558  if(HistoCode == "D_TNo_ChDs"){
12559  if( (TRootCanvas*)fCanvD_TNo_ChDs->GetCanvasImp() == fImpD_TNo_ChDs ){
12560  main_subpad = fPadD_TNo_ChDs;}}
12561 
12562  if(HistoCode == "D_MCs_ChNb"){
12563  if( (TRootCanvas*)fCanvD_MCs_ChNb->GetCanvasImp() == fImpD_MCs_ChNb ){
12564  main_subpad = fPadD_MCs_ChNb;}}
12565 
12566  if(HistoCode == "D_MCs_ChDs"){
12567  if( (TRootCanvas*)fCanvD_MCs_ChDs->GetCanvasImp() == fImpD_MCs_ChDs ){
12568  main_subpad = fPadD_MCs_ChDs;}}
12569 
12570  if(HistoCode == "D_LFN_ChNb"){
12571  if( (TRootCanvas*)fCanvD_LFN_ChNb->GetCanvasImp() == fImpD_LFN_ChNb ){
12572  main_subpad = fPadD_LFN_ChNb;}}
12573 
12574  if(HistoCode == "D_LFN_ChDs"){
12575  if( (TRootCanvas*)fCanvD_LFN_ChDs->GetCanvasImp() == fImpD_LFN_ChDs ){
12576  main_subpad = fPadD_LFN_ChDs;}}
12577 
12578  if(HistoCode == "D_HFN_ChNb"){
12579  if( (TRootCanvas*)fCanvD_HFN_ChNb->GetCanvasImp() == fImpD_HFN_ChNb ){
12580  main_subpad = fPadD_HFN_ChNb;}}
12581 
12582  if(HistoCode == "D_HFN_ChDs"){
12583  if( (TRootCanvas*)fCanvD_HFN_ChDs->GetCanvasImp() == fImpD_HFN_ChDs ){
12584  main_subpad = fPadD_HFN_ChDs;}}
12585 
12586  if(HistoCode == "D_SCs_ChNb"){
12587  if( (TRootCanvas*)fCanvD_SCs_ChNb->GetCanvasImp() == fImpD_SCs_ChNb ){
12588  main_subpad = fPadD_SCs_ChNb;}}
12589 
12590  if(HistoCode == "D_SCs_ChDs"){
12591  if( (TRootCanvas*)fCanvD_SCs_ChDs->GetCanvasImp() == fImpD_SCs_ChDs ){
12592  main_subpad = fPadD_SCs_ChDs;}}
12593 
12594  if(HistoCode == "D_MSp_Samp" ){
12595  if( (TRootCanvas*)fCanvD_MSp_Samp->GetCanvasImp() == fImpD_MSp_Samp ){
12596  main_subpad = fPadD_MSp_Samp;}}
12597 
12598  if(HistoCode == "D_SSp_Samp" ){
12599  if( (TRootCanvas*)fCanvD_SSp_Samp->GetCanvasImp() == fImpD_SSp_Samp ){
12600  main_subpad = fPadD_SSp_Samp;}}
12601 
12602  if(HistoCode == "D_Adc_EvNb"){
12603  if( (TRootCanvas*)fCanvD_Adc_EvNb->GetCanvasImp() == fImpD_Adc_EvNb ){
12604  main_subpad = fPadD_Adc_EvNb;}}
12605 
12606  if(HistoCode == "D_Adc_EvDs"){
12607  if( (TRootCanvas*)fCanvD_Adc_EvDs->GetCanvasImp() == fImpD_Adc_EvDs ){
12608  main_subpad = fPadD_Adc_EvDs;}}
12609 
12610  if(HistoCode == "H_Ped_Date"){
12611  if( (TRootCanvas*)fCanvH_Ped_Date->GetCanvasImp() == fImpH_Ped_Date ){
12612  main_subpad = fPadH_Ped_Date;}}
12613 
12614  if(HistoCode == "H_TNo_Date"){
12615  if( (TRootCanvas*)fCanvH_TNo_Date->GetCanvasImp() == fImpH_TNo_Date ){
12616  main_subpad = fPadH_TNo_Date;}}
12617 
12618  if(HistoCode == "H_MCs_Date"){
12619  if( (TRootCanvas*)fCanvH_MCs_Date->GetCanvasImp() == fImpH_MCs_Date ){
12620  main_subpad = fPadH_MCs_Date;}}
12621 
12622  if(HistoCode == "H_LFN_Date"){
12623  if( (TRootCanvas*)fCanvH_LFN_Date->GetCanvasImp() == fImpH_LFN_Date ){
12624  main_subpad = fPadH_LFN_Date;}}
12625 
12626  if(HistoCode == "H_HFN_Date"){
12627  if( (TRootCanvas*)fCanvH_HFN_Date->GetCanvasImp() == fImpH_HFN_Date ){
12628  main_subpad = fPadH_HFN_Date;}}
12629 
12630  if(HistoCode == "H_SCs_Date"){
12631  if( (TRootCanvas*)fCanvH_SCs_Date->GetCanvasImp() == fImpH_SCs_Date ){
12632  main_subpad = fPadH_SCs_Date;}}
12633 
12634  if(HistoCode == "H_Ped_RuDs"){
12635  if( (TRootCanvas*)fCanvH_Ped_RuDs->GetCanvasImp() == fImpH_Ped_RuDs ){
12636  main_subpad = fPadH_Ped_RuDs;}}
12637 
12638  if(HistoCode == "H_TNo_RuDs"){
12639  if( (TRootCanvas*)fCanvH_TNo_RuDs->GetCanvasImp() == fImpH_TNo_RuDs ){
12640  main_subpad = fPadH_TNo_RuDs;}}
12641 
12642  if(HistoCode == "H_MCs_RuDs"){
12643  if( (TRootCanvas*)fCanvH_MCs_RuDs->GetCanvasImp() == fImpH_MCs_RuDs ){
12644  main_subpad = fPadH_MCs_RuDs;}}
12645 
12646  if(HistoCode == "H_LFN_RuDs"){
12647  if( (TRootCanvas*)fCanvH_LFN_RuDs->GetCanvasImp() == fImpH_LFN_RuDs ){
12648  main_subpad = fPadH_LFN_RuDs;}}
12649 
12650  if(HistoCode == "H_HFN_RuDs"){
12651  if( (TRootCanvas*)fCanvH_HFN_RuDs->GetCanvasImp() == fImpH_HFN_RuDs ){
12652  main_subpad = fPadH_HFN_RuDs;}}
12653 
12654  if(HistoCode == "H_SCs_RuDs"){
12655  if( (TRootCanvas*)fCanvH_SCs_RuDs->GetCanvasImp() == fImpH_SCs_RuDs ){
12656  main_subpad = fPadH_SCs_RuDs;}}
12657  }
12658 
12659  if( main_subpad == 0 )
12660  {cout << "*TEcnaHistos::ActivePad(...)> main_subpad = "
12661  << main_subpad << ". This canvas has been closed." << endl;}
12662 
12663  return main_subpad;
12664 }
12665 // end of ActivePad
12666 
12667 void TEcnaHistos::SetParametersPavTxt(const TString HistoCode, const TString opt_plot)
12668 {
12669 // Set parameters pave "sevearl changing" according to HistoCode
12670 
12672 
12673  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
12674  {
12675  if(HistoCode == "D_NOE_ChNb"){fPavTxtD_NOE_ChNb = fPavComSeveralChanging;}
12676  if(HistoCode == "D_NOE_ChDs"){fPavTxtD_NOE_ChDs = fPavComSeveralChanging;}
12677  if(HistoCode == "D_Ped_ChNb"){fPavTxtD_Ped_ChNb = fPavComSeveralChanging;}
12678  if(HistoCode == "D_Ped_ChDs"){fPavTxtD_Ped_ChDs = fPavComSeveralChanging;}
12679  if(HistoCode == "D_TNo_ChNb"){fPavTxtD_TNo_ChNb = fPavComSeveralChanging;}
12680  if(HistoCode == "D_TNo_ChDs"){fPavTxtD_TNo_ChDs = fPavComSeveralChanging;}
12681  if(HistoCode == "D_MCs_ChNb"){fPavTxtD_MCs_ChNb = fPavComSeveralChanging;}
12682  if(HistoCode == "D_MCs_ChDs"){fPavTxtD_MCs_ChDs = fPavComSeveralChanging;}
12683  if(HistoCode == "D_LFN_ChNb"){fPavTxtD_LFN_ChNb = fPavComSeveralChanging;}
12684  if(HistoCode == "D_LFN_ChDs"){fPavTxtD_LFN_ChDs = fPavComSeveralChanging;}
12685  if(HistoCode == "D_HFN_ChNb"){fPavTxtD_HFN_ChNb = fPavComSeveralChanging;}
12686  if(HistoCode == "D_HFN_ChDs"){fPavTxtD_HFN_ChDs = fPavComSeveralChanging;}
12687  if(HistoCode == "D_SCs_ChNb"){fPavTxtD_SCs_ChNb = fPavComSeveralChanging;}
12688  if(HistoCode == "D_SCs_ChDs"){fPavTxtD_SCs_ChDs = fPavComSeveralChanging;}
12689  if(HistoCode == "D_MSp_Samp"){fPavTxtD_MSp_Samp = fPavComSeveralChanging;}
12690  if(HistoCode == "D_SSp_Samp"){fPavTxtD_SSp_Samp = fPavComSeveralChanging;}
12691  if(HistoCode == "D_Adc_EvNb"){fPavTxtD_Adc_EvNb = fPavComSeveralChanging;}
12692  if(HistoCode == "D_Adc_EvDs"){fPavTxtD_Adc_EvDs = fPavComSeveralChanging;}
12693  if(HistoCode == "H_Ped_Date"){fPavTxtH_Ped_Date = fPavComSeveralChanging;}
12694  if(HistoCode == "H_TNo_Date"){fPavTxtH_TNo_Date = fPavComSeveralChanging;}
12695  if(HistoCode == "H_MCs_Date"){fPavTxtH_MCs_Date = fPavComSeveralChanging;}
12696  if(HistoCode == "H_LFN_Date"){fPavTxtH_LFN_Date = fPavComSeveralChanging;}
12697  if(HistoCode == "H_HFN_Date"){fPavTxtH_HFN_Date = fPavComSeveralChanging;}
12698  if(HistoCode == "H_SCs_Date"){fPavTxtH_SCs_Date = fPavComSeveralChanging;}
12699  if(HistoCode == "H_Ped_RuDs"){fPavTxtH_Ped_RuDs = fPavComSeveralChanging;}
12700  if(HistoCode == "H_TNo_RuDs"){fPavTxtH_TNo_RuDs = fPavComSeveralChanging;}
12701  if(HistoCode == "H_MCs_RuDs"){fPavTxtH_MCs_RuDs = fPavComSeveralChanging;}
12702  if(HistoCode == "H_LFN_RuDs"){fPavTxtH_LFN_RuDs = fPavComSeveralChanging;}
12703  if(HistoCode == "H_HFN_RuDs"){fPavTxtH_HFN_RuDs = fPavComSeveralChanging;}
12704  if(HistoCode == "H_SCs_RuDs"){fPavTxtH_SCs_RuDs = fPavComSeveralChanging;}
12705  }
12706 }
12707 // end of SetParametersPavTxt
12708 
12709 
12710 TPaveText* TEcnaHistos::ActivePavTxt(const TString HistoCode, const TString opt_plot)
12711 {
12712  // Active Pad for Same plot option
12713 
12714  TPaveText* main_pavtxt = 0;
12715 
12716  if( opt_plot == fSameOnePlot )
12717  {
12718  //if( (TRootCanvas*)fCanvH1SamePlus->GetCanvasImp() == fImpH1SamePlus )
12719  {main_pavtxt = fPavTxtH1SamePlus;}
12720  }
12721 
12722  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
12723  {
12724  if(HistoCode == "D_NOE_ChNb"){main_pavtxt = fPavTxtD_NOE_ChNb;}
12725  if(HistoCode == "D_NOE_ChDs"){main_pavtxt = fPavTxtD_NOE_ChDs;}
12726  if(HistoCode == "D_Ped_ChNb"){main_pavtxt = fPavTxtD_Ped_ChNb;}
12727  if(HistoCode == "D_Ped_ChDs"){main_pavtxt = fPavTxtD_Ped_ChDs;}
12728  if(HistoCode == "D_TNo_ChNb"){main_pavtxt = fPavTxtD_TNo_ChNb;}
12729  if(HistoCode == "D_TNo_ChDs"){main_pavtxt = fPavTxtD_TNo_ChDs;}
12730  if(HistoCode == "D_MCs_ChNb"){main_pavtxt = fPavTxtD_MCs_ChNb;}
12731  if(HistoCode == "D_MCs_ChDs"){main_pavtxt = fPavTxtD_MCs_ChDs;}
12732  if(HistoCode == "D_LFN_ChNb"){main_pavtxt = fPavTxtD_LFN_ChNb;}
12733  if(HistoCode == "D_LFN_ChDs"){main_pavtxt = fPavTxtD_LFN_ChDs;}
12734  if(HistoCode == "D_HFN_ChNb"){main_pavtxt = fPavTxtD_HFN_ChNb;}
12735  if(HistoCode == "D_HFN_ChDs"){main_pavtxt = fPavTxtD_HFN_ChDs;}
12736  if(HistoCode == "D_SCs_ChNb"){main_pavtxt = fPavTxtD_SCs_ChNb;}
12737  if(HistoCode == "D_SCs_ChDs"){main_pavtxt = fPavTxtD_SCs_ChDs;}
12738  if(HistoCode == "D_MSp_Samp"){main_pavtxt = fPavTxtD_MSp_Samp;}
12739  if(HistoCode == "D_SSp_Samp"){main_pavtxt = fPavTxtD_SSp_Samp;}
12740  if(HistoCode == "D_Adc_EvNb"){main_pavtxt = fPavTxtD_Adc_EvNb;}
12741  if(HistoCode == "D_Adc_EvDs"){main_pavtxt = fPavTxtD_Adc_EvDs;}
12742  if(HistoCode == "H_Ped_Date"){main_pavtxt = fPavTxtH_Ped_Date;}
12743  if(HistoCode == "H_TNo_Date"){main_pavtxt = fPavTxtH_TNo_Date;}
12744  if(HistoCode == "H_MCs_Date"){main_pavtxt = fPavTxtH_MCs_Date;}
12745  if(HistoCode == "H_LFN_Date"){main_pavtxt = fPavTxtH_LFN_Date;}
12746  if(HistoCode == "H_HFN_Date"){main_pavtxt = fPavTxtH_HFN_Date;}
12747  if(HistoCode == "H_SCs_Date"){main_pavtxt = fPavTxtH_SCs_Date;}
12748  if(HistoCode == "H_Ped_RuDs"){main_pavtxt = fPavTxtH_Ped_RuDs;}
12749  if(HistoCode == "H_TNo_RuDs"){main_pavtxt = fPavTxtH_TNo_RuDs;}
12750  if(HistoCode == "H_MCs_RuDs"){main_pavtxt = fPavTxtH_MCs_RuDs;}
12751  if(HistoCode == "H_LFN_RuDs"){main_pavtxt = fPavTxtH_LFN_RuDs;}
12752  if(HistoCode == "H_HFN_RuDs"){main_pavtxt = fPavTxtH_HFN_RuDs;}
12753  if(HistoCode == "H_SCs_RuDs"){main_pavtxt = fPavTxtH_SCs_RuDs;}
12754  }
12755 
12756  if( main_pavtxt == 0 )
12757  {cout << "*TEcnaHistos::ActivePavTxt(...)> ERROR: main_pavtxt = " << main_pavtxt << endl;}
12758 
12759  return main_pavtxt;
12760 }
12761 // end of ActivePavTxt
12762 
12763 //void TEcnaHistos::SetViewHistoMarkerAndLine(TH1D* h_his0, const TString HistoCode, const TString opt_plot)
12764 //{
12766 //
12767 // TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
12768 //
12769 // //............................... Marker
12770 // h_his0->SetMarkerStyle(1); // default
12771 //
12772 // if( HistoType == "Global" && ( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot ) )
12773 // {h_his0->SetMarkerStyle(7); }
12774 //
12775 // //............................... Line
12776 // h_his0->SetLineWidth(1); // default
12777 //
12778 // if( HistoType == "Global" && ( opt_plot == fSeveralPlot || opt_plot == fSameOnePlot ) )
12779 // {h_his0->SetLineWidth(0);}
12780 //
12781 //}
12782 
12783 void TEcnaHistos::SetViewHistoColors(TH1D* h_his0, const TString HistoCode, const TString opt_plot)
12784 {
12785 // Set colors, fill, marker, line style for histo view
12786 
12787  TString HistoType = fCnaParHistos->GetHistoType(HistoCode.Data());
12788  if( HistoType == "Global" ){h_his0->SetMarkerStyle(1);}
12789 
12790  Int_t MaxNbOfColors = fCnaParHistos->GetMaxNbOfColors();
12791 
12792  if( opt_plot == fSameOnePlot )
12793  {
12794  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
12795  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
12797  if(fMemoColorH1SamePlus>MaxNbOfColors){fMemoColorH1SamePlus = 0;}
12798  }
12799 
12800  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
12801  {
12802  if(HistoCode == "D_NOE_ChNb")
12803  {
12804  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rose"));}
12805  if(opt_plot == fSeveralPlot )
12806  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChNb));
12807  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChNb));
12809  if(fMemoColorD_NOE_ChNb>MaxNbOfColors){fMemoColorD_NOE_ChNb = 0;}}
12810  }
12811  if(HistoCode == "D_NOE_ChDs")
12812  {
12813  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rose"));}
12814  if(opt_plot == fSeveralPlot )
12815  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChDs));
12816  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_NOE_ChDs));
12818  if(fMemoColorD_NOE_ChDs>MaxNbOfColors){fMemoColorD_NOE_ChDs = 0;}}
12819  }
12820  if(HistoCode == "D_Ped_ChNb")
12821  {
12822  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
12823  if(opt_plot == fSeveralPlot )
12824  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChNb));
12825  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChNb));
12827  if(fMemoColorD_Ped_ChNb>MaxNbOfColors){fMemoColorD_Ped_ChNb = 0;}}
12828  }
12829  if(HistoCode == "D_Ped_ChDs")
12830  {
12831  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
12832  if(opt_plot == fSeveralPlot )
12833  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChDs));
12834  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Ped_ChDs));
12836  if(fMemoColorD_Ped_ChDs>MaxNbOfColors){fMemoColorD_Ped_ChDs = 0;}}
12837  }
12838  if(HistoCode == "D_TNo_ChNb")
12839  {
12840  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge48"));}
12841  if(opt_plot == fSeveralPlot )
12842  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChNb));
12843  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChNb));
12845  if(fMemoColorD_TNo_ChNb>MaxNbOfColors){fMemoColorD_TNo_ChNb = 0;}}
12846  }
12847  if(HistoCode == "D_TNo_ChDs")
12848  {
12849  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge48"));}
12850  if(opt_plot == fSeveralPlot )
12851  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChDs));
12852  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_TNo_ChDs));
12854  if(fMemoColorD_TNo_ChDs>MaxNbOfColors){fMemoColorD_TNo_ChDs = 0;}}
12855  }
12856 
12857  if(HistoCode == "D_MCs_ChNb")
12858  {
12859  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("vert31"));}
12860  if(opt_plot == fSeveralPlot )
12861  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChNb));
12862  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChNb));
12864  if(fMemoColorD_MCs_ChNb>MaxNbOfColors){fMemoColorD_MCs_ChNb = 0;}}
12865  }
12866  if(HistoCode == "D_MCs_ChDs")
12867  {
12868  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("vert31"));}
12869  if(opt_plot == fSeveralPlot )
12870  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChDs));
12871  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MCs_ChDs));
12873  if(fMemoColorD_MCs_ChDs>MaxNbOfColors){fMemoColorD_MCs_ChDs = 0;}}
12874  }
12875  if(HistoCode == "D_LFN_ChNb")
12876  {
12877  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge44"));}
12878  if(opt_plot == fSeveralPlot )
12879  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChNb));
12880  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChNb));
12882  if(fMemoColorD_LFN_ChNb>MaxNbOfColors){fMemoColorD_LFN_ChNb = 0;}}
12883  }
12884  if(HistoCode == "D_LFN_ChDs")
12885  {
12886  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge44"));}
12887  if(opt_plot == fSeveralPlot )
12888  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChDs));
12889  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_LFN_ChDs));
12891  if(fMemoColorD_LFN_ChDs>MaxNbOfColors){fMemoColorD_LFN_ChDs = 0;}}
12892  }
12893  if(HistoCode == "D_HFN_ChNb")
12894  {
12895  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
12896  if(opt_plot == fSeveralPlot )
12897  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChNb));
12898  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChNb));
12900  if(fMemoColorD_HFN_ChNb>MaxNbOfColors){fMemoColorD_HFN_ChNb = 0;}}
12901  }
12902  if(HistoCode == "D_HFN_ChDs")
12903  {
12904  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
12905  if(opt_plot == fSeveralPlot )
12906  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChDs));
12907  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_HFN_ChDs));
12909  if(fMemoColorD_HFN_ChDs>MaxNbOfColors){fMemoColorD_HFN_ChDs = 0;}}
12910  }
12911 
12912  if(HistoCode == "D_SCs_ChNb")
12913  {
12914  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("marron23"));}
12915  if(opt_plot == fSeveralPlot )
12916  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChNb));
12917  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChNb));
12919  if(fMemoColorD_SCs_ChNb>MaxNbOfColors){fMemoColorD_SCs_ChNb = 0;}}
12920  }
12921  if(HistoCode == "D_SCs_ChDs")
12922  {
12923  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("marron23"));}
12924  if(opt_plot == fSeveralPlot )
12925  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChDs));
12926  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SCs_ChDs));
12928  if(fMemoColorD_SCs_ChDs>MaxNbOfColors){fMemoColorD_SCs_ChDs = 0;}}
12929  }
12930 
12931  if(HistoCode == "D_MSp_Samp")
12932  {
12933  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
12934  if(opt_plot == fSeveralPlot )
12935  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_Samp));
12936  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_MSp_Samp));
12938  if(fMemoColorD_MSp_Samp>MaxNbOfColors){fMemoColorD_MSp_Samp = 0;}}
12939  }
12940 
12941  if(HistoCode == "D_SSp_Samp")
12942  {
12943  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
12944  if(opt_plot == fSeveralPlot )
12945  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_Samp));
12946  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_SSp_Samp));
12948  if(fMemoColorD_SSp_Samp>MaxNbOfColors){fMemoColorD_SSp_Samp = 0;}}
12949  }
12950 
12951  if(HistoCode == "D_Adc_EvDs")
12952  {
12953  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("orange42"));}
12954  if(opt_plot == fSeveralPlot )
12955  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvDs));
12956  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvDs));
12958  if(fMemoColorD_Adc_EvDs>MaxNbOfColors){fMemoColorD_Adc_EvDs = 0;}}
12959  }
12960 
12961  if(HistoCode == "D_Adc_EvNb")
12962  {
12963  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("orange42"));}
12964  if(opt_plot == fSeveralPlot )
12965  {h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvNb));
12966  h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorD_Adc_EvNb));
12968  if(fMemoColorD_Adc_EvNb>MaxNbOfColors){fMemoColorD_Adc_EvNb = 0;}}
12969  gPad->SetGrid(1,0);
12970  }
12971 
12972  if(HistoCode == "H_Ped_RuDs")
12973  {
12974  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("bleu38"));}
12975  if(opt_plot == fSeveralPlot )
12976  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_RuDs));
12977  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_RuDs));
12979  if(fMemoColorH_Ped_RuDs>MaxNbOfColors){fMemoColorH_Ped_RuDs = 0;}}
12980  gPad->SetGrid(1,1);
12981  }
12982 
12983  if(HistoCode == "H_TNo_RuDs")
12984  {
12985  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge48"));}
12986  if(opt_plot == fSeveralPlot )
12987  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_RuDs));
12988  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_RuDs));
12990  if(fMemoColorH_TNo_RuDs>MaxNbOfColors){fMemoColorH_TNo_RuDs = 0;}}
12991  gPad->SetGrid(1,1);
12992  }
12993 
12994  if(HistoCode == "H_MCs_RuDs")
12995  {
12996  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("vert31"));}
12997  if(opt_plot == fSeveralPlot )
12998  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_RuDs));
12999  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_RuDs));
13001  if(fMemoColorH_MCs_RuDs>MaxNbOfColors){fMemoColorH_MCs_RuDs = 0;}}
13002  gPad->SetGrid(1,1);
13003  }
13004 
13005  if(HistoCode == "H_LFN_RuDs")
13006  {
13007  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge44"));}
13008  if(opt_plot == fSeveralPlot )
13009  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_RuDs));
13010  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_RuDs));
13012  if(fMemoColorH_LFN_RuDs>MaxNbOfColors){fMemoColorH_LFN_RuDs = 0;}}
13013  gPad->SetGrid(1,1);
13014  }
13015 
13016  if(HistoCode == "H_HFN_RuDs")
13017  {
13018  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("rouge50"));}
13019  if(opt_plot == fSeveralPlot )
13020  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_RuDs));
13021  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_RuDs));
13023  if(fMemoColorH_HFN_RuDs>MaxNbOfColors){fMemoColorH_HFN_RuDs = 0;}}
13024  gPad->SetGrid(1,1);
13025  }
13026 
13027  if(HistoCode == "H_SCs_RuDs")
13028  {
13029  if(opt_plot == fOnlyOnePlot){h_his0->SetFillColor(fCnaParHistos->ColorDefinition("marron23"));}
13030  if(opt_plot == fSeveralPlot )
13031  {h_his0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_RuDs));
13032  h_his0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_RuDs));
13034  if(fMemoColorH_SCs_RuDs>MaxNbOfColors){fMemoColorH_SCs_RuDs = 0;}}
13035  gPad->SetGrid(1,1);
13036  }
13037  }
13038 
13039  // if(opt_plot == fSeveralPlot || opt_plot == fSameOnePlot){h_his0->SetLineWidth(2);}
13040 }
13041 // end of SetViewHistoColors
13042 
13043 void TEcnaHistos::SetViewGraphColors(TGraph* g_graph0, const TString HistoCode, const TString opt_plot)
13044 {
13045 // Set colors for histo view
13046 
13047  Int_t MaxNbOfColors = fCnaParHistos->GetMaxNbOfColors();
13048 
13049  if( opt_plot == fSameOnePlot )
13050  {
13051  g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
13052  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH1SamePlus));
13054  if(fMemoColorH1SamePlus>MaxNbOfColors){fMemoColorH1SamePlus = 0;}
13055  gPad->SetGrid(1,1);
13056  }
13057 
13058  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
13059  {
13060  if(HistoCode == "H_Ped_Date")
13061  {
13062  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("bleu38"));}
13063  if(opt_plot == fSeveralPlot )
13064  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_Date));
13065  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_Ped_Date));
13067  if(fMemoColorH_Ped_Date>MaxNbOfColors){fMemoColorH_Ped_Date = 0;}}
13068  gPad->SetGrid(1,1);
13069  }
13070 
13071  if(HistoCode == "H_TNo_Date")
13072  {
13073  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("rouge48"));}
13074  if(opt_plot == fSeveralPlot)
13075  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_Date));
13076  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_TNo_Date));
13078  if(fMemoColorH_TNo_Date>MaxNbOfColors){fMemoColorH_TNo_Date = 0;}}
13079  gPad->SetGrid(1,1);
13080  }
13081 
13082  if(HistoCode == "H_MCs_Date")
13083  {
13084  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("vert31"));}
13085  if(opt_plot == fSeveralPlot)
13086  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_Date));
13087  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_MCs_Date));
13089  if(fMemoColorH_MCs_Date>MaxNbOfColors){fMemoColorH_MCs_Date = 0;}}
13090  gPad->SetGrid(1,1);
13091  }
13092 
13093  if(HistoCode == "H_LFN_Date")
13094  {
13095  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("bleu38"));}
13096  if(opt_plot == fSeveralPlot )
13097  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_Date));
13098  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_LFN_Date));
13100  if(fMemoColorH_LFN_Date>MaxNbOfColors){fMemoColorH_LFN_Date = 0;}}
13101  gPad->SetGrid(1,1);
13102  }
13103 
13104  if(HistoCode == "H_HFN_Date")
13105  {
13106  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("rouge48"));}
13107  if(opt_plot == fSeveralPlot)
13108  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_Date));
13109  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_HFN_Date));
13111  if(fMemoColorH_HFN_Date>MaxNbOfColors){fMemoColorH_HFN_Date = 0;}}
13112  gPad->SetGrid(1,1);
13113  }
13114 
13115  if(HistoCode == "H_SCs_Date")
13116  {
13117  if(opt_plot == fOnlyOnePlot){g_graph0->SetMarkerColor(fCnaParHistos->ColorDefinition("vert31"));}
13118  if(opt_plot == fSeveralPlot)
13119  {g_graph0->SetMarkerColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_Date));
13120  g_graph0->SetLineColor(fCnaParHistos->ColorTab(fMemoColorH_SCs_Date));
13122  if(fMemoColorH_SCs_Date>MaxNbOfColors){fMemoColorH_SCs_Date = 0;}}
13123  gPad->SetGrid(1,1);
13124  }
13125  }
13126  //if(opt_plot == fSeveralPlot){g_graph0->SetLineWidth(2);}
13127 }
13128 // end of SetViewGraphColors
13129 
13130 Color_t TEcnaHistos::GetViewHistoColor(const TString HistoCode, const TString opt_plot)
13131 {
13132  Color_t couleur = fCnaParHistos->ColorDefinition("noir"); // a priori = "noir"
13133 
13134  if( opt_plot == fSameOnePlot ){couleur = fCnaParHistos->ColorTab(fMemoColorH1SamePlus);}
13135 
13136  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot )
13137  {
13138  if(HistoCode == "D_NOE_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_NOE_ChNb);}
13139  if(HistoCode == "D_NOE_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_NOE_ChDs);}
13140  if(HistoCode == "D_Ped_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_Ped_ChNb);}
13141  if(HistoCode == "D_Ped_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_Ped_ChDs);}
13142  if(HistoCode == "D_TNo_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_TNo_ChNb);}
13143  if(HistoCode == "D_TNo_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_TNo_ChDs);}
13144  if(HistoCode == "D_MCs_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_MCs_ChNb);}
13145  if(HistoCode == "D_MCs_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_MCs_ChDs);}
13146  if(HistoCode == "D_LFN_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_LFN_ChNb);}
13147  if(HistoCode == "D_LFN_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_LFN_ChDs);}
13148  if(HistoCode == "D_HFN_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_HFN_ChNb);}
13149  if(HistoCode == "D_HFN_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_HFN_ChDs);}
13150  if(HistoCode == "D_SCs_ChNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_SCs_ChNb);}
13151  if(HistoCode == "D_SCs_ChDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_SCs_ChDs);}
13152  if(HistoCode == "D_MSp_Samp"){couleur = fCnaParHistos->ColorTab(fMemoColorD_MSp_Samp);}
13153  if(HistoCode == "D_SSp_Samp"){couleur = fCnaParHistos->ColorTab(fMemoColorD_SSp_Samp);}
13154  if(HistoCode == "D_Adc_EvDs"){couleur = fCnaParHistos->ColorTab(fMemoColorD_Adc_EvDs);}
13155  if(HistoCode == "D_Adc_EvNb"){couleur = fCnaParHistos->ColorTab(fMemoColorD_Adc_EvNb);}
13156  if(HistoCode == "H_Ped_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_Ped_Date);}
13157  if(HistoCode == "H_TNo_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_TNo_Date);}
13158  if(HistoCode == "H_MCs_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_MCs_Date);}
13159  if(HistoCode == "H_LFN_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_LFN_Date);}
13160  if(HistoCode == "H_HFN_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_HFN_Date);}
13161  if(HistoCode == "H_SCs_Date"){couleur = fCnaParHistos->ColorTab(fMemoColorH_SCs_Date);}
13162  if(HistoCode == "H_Ped_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_Ped_RuDs);}
13163  if(HistoCode == "H_TNo_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_TNo_RuDs);}
13164  if(HistoCode == "H_MCs_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_MCs_RuDs);}
13165  if(HistoCode == "H_LFN_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_LFN_RuDs);}
13166  if(HistoCode == "H_HFN_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_HFN_RuDs);}
13167  if(HistoCode == "H_SCs_RuDs"){couleur = fCnaParHistos->ColorTab(fMemoColorH_SCs_RuDs);}
13168  }
13169  return couleur;
13170 }
13171 // end of GetViewHistoColor
13172 
13173 Color_t TEcnaHistos::GetSCColor(const TString DeeEndcap, const TString DeeDir, const TString QuadType)
13174 {
13175  //gives the SC color for the numbering plots
13176  TColor* my_color = new TColor();
13177  Color_t couleur = fCnaParHistos->ColorDefinition("noir"); // default = "noir"
13178 
13179  if( DeeEndcap == "EE+" )
13180  {
13181  if ( DeeDir == "right" && QuadType == "top" ){couleur=fCnaParHistos->ColorDefinition("rouge");}
13182  if ( DeeDir == "right" && QuadType == "bottom" ){couleur=fCnaParHistos->ColorDefinition("bleu_fonce");}
13183  if ( DeeDir == "left" && QuadType == "top" ){couleur=(Color_t)my_color->GetColor("#006600");}
13184  if ( DeeDir == "left" && QuadType == "bottom" ){couleur=(Color_t)my_color->GetColor("#CC3300");}
13185  }
13186  if( DeeEndcap == "EE-" )
13187  {
13188  if ( DeeDir == "right" && QuadType == "top" ){couleur=(Color_t)my_color->GetColor("#008800");}
13189  if ( DeeDir == "right" && QuadType == "bottom" ){couleur=(Color_t)my_color->GetColor("#EE5500");}
13190  if ( DeeDir == "left" && QuadType == "top" ){couleur=fCnaParHistos->ColorDefinition("rouge");}
13191  if ( DeeDir == "left" && QuadType == "bottom" ){couleur=fCnaParHistos->ColorDefinition("bleu_fonce");}
13192  }
13193 
13194  return couleur;
13195 }
13197 {
13198  // Set presentation (axis title offsets, title size, label size, etc...
13199 
13200  fCnaParHistos->SetViewHistoStyle(HistoType.Data());
13201  fCnaParHistos->SetViewHistoPadMargins(HistoType.Data(), " ");
13202  fCnaParHistos->SetViewHistoOffsets(histo, HistoType.Data(), " ");
13203  fCnaParHistos->SetViewHistoStats(histo, HistoType.Data());
13204 }
13205 void TEcnaHistos::SetHistoPresentation(TH1D* histo, const TString HistoType, const TString opt_plot)
13206 {
13207 // Set presentation (axis title offsets, title size, label size, etc...
13208 
13209  fCnaParHistos->SetViewHistoStyle(HistoType.Data());
13210  fCnaParHistos->SetViewHistoPadMargins(HistoType.Data(), opt_plot.Data());
13211  fCnaParHistos->SetViewHistoOffsets(histo, HistoType.Data(), opt_plot.Data());
13212  fCnaParHistos->SetViewHistoStats(histo, HistoType.Data());
13213 }
13214 
13215 void TEcnaHistos::SetGraphPresentation(TGraph* graph, const TString HistoType, const TString opt_plot)
13216 {
13217 // Set presentation (axis title offsets, title size, label size, etc...
13218 
13219  fCnaParHistos->SetViewHistoStyle(HistoType.Data());
13220  fCnaParHistos->SetViewHistoPadMargins(HistoType.Data(), opt_plot);
13221  fCnaParHistos->SetViewGraphOffsets(graph, HistoType.Data());
13222 
13223  //............................... Graph marker
13224  graph->SetMarkerStyle(1);
13225  if( HistoType == "Evol" ){graph->SetMarkerStyle(20);}
13226 }
13227 
13228 //=====================================================================
13229 //
13230 // NewCanvas, ReInitCanvas
13231 //
13232 //=====================================================================
13233 void TEcnaHistos::NewCanvas(const TString opt_plot)
13234 {
13235 // ReInit canvas in option SAME n in order to restart a new SAME n plot
13236 // (called by user only for option Same n)
13237 
13238  if( opt_plot == fSameOnePlot )
13239  {
13243  fPavTxtH1SamePlus = 0;
13244  }
13245  else
13246  {
13247  cout << "TEcnaHistos::NewCanvas(...)> *** ERROR *** " << opt_plot.Data() << ": "
13248  << "unknown option for NewCanvas. Only " << fSameOnePlot << " option is accepted."
13249  << fTTBELL << endl;
13250  }
13251 }
13252 
13253 void TEcnaHistos::ReInitCanvas(const TString HistoCode, const TString opt_plot)
13254 {
13255 // ReInit canvas in option SAME and SAME n
13256 
13257  if( opt_plot == fSameOnePlot )
13258  {
13262  fPavTxtH1SamePlus = 0;
13263  }
13264 
13265  if( opt_plot == fOnlyOnePlot || opt_plot == fSeveralPlot)
13266  {
13267  if(HistoCode == "D_NOE_ChNb")
13268  {
13272  fPavTxtD_NOE_ChNb = 0;
13273  }
13274 
13275  if(HistoCode == "D_NOE_ChDs")
13276  {
13280  fPavTxtD_NOE_ChDs = 0;
13281  }
13282 
13283  if(HistoCode == "D_Ped_ChNb") // (ReInitCanvas)
13284  {
13288  fPavTxtD_Ped_ChNb = 0;
13289  }
13290 
13291  if(HistoCode == "D_Ped_ChDs")
13292  {
13296  fPavTxtD_Ped_ChDs = 0;
13297  }
13298 
13299  if(HistoCode == "D_TNo_ChNb")
13300  {
13304  fPavTxtD_TNo_ChNb = 0;
13305  }
13306 
13307  if(HistoCode == "D_TNo_ChDs")
13308  {
13312  fPavTxtD_TNo_ChDs = 0;
13313  }
13314 
13315  if(HistoCode == "D_MCs_ChNb") // (ReInitCanvas)
13316  {
13320  fPavTxtD_MCs_ChNb = 0;
13321  }
13322 
13323  if(HistoCode == "D_MCs_ChDs")
13324  {
13328  fPavTxtD_MCs_ChDs = 0;
13329  }
13330 
13331  if(HistoCode == "D_LFN_ChNb")
13332  {
13336  fPavTxtD_LFN_ChNb = 0;
13337  }
13338 
13339  if(HistoCode == "D_LFN_ChDs") // (ReInitCanvas)
13340  {
13344  fPavTxtD_LFN_ChDs= 0;
13345  }
13346 
13347  if(HistoCode == "D_HFN_ChNb")
13348  {
13352  fPavTxtD_HFN_ChNb = 0;
13353  }
13354 
13355  if(HistoCode == "D_HFN_ChDs")
13356  {
13360  fPavTxtD_HFN_ChDs = 0;
13361  }
13362 
13363  if(HistoCode == "D_SCs_ChNb")
13364  {
13368  fPavTxtD_SCs_ChNb = 0;
13369  }
13370 
13371  if(HistoCode == "D_SCs_ChDs") // (ReInitCanvas)
13372  {
13376  fPavTxtD_SCs_ChDs = 0;
13377  }
13378 
13379  if(HistoCode == "D_MSp_Samp")
13380  {
13384  fPavTxtD_MSp_Samp = 0;
13385  }
13386 
13387  if(HistoCode == "D_SSp_Samp")
13388  {
13392  fPavTxtD_SSp_Samp = 0;
13393  }
13394 
13395  if(HistoCode == "D_Adc_EvDs")
13396  {
13400  fPavTxtD_Adc_EvDs = 0;
13401  }
13402 
13403  if(HistoCode == "D_Adc_EvNb") // (ReInitCanvas)
13404  {
13408  fPavTxtD_Adc_EvNb = 0;
13409  }
13410 
13411  if(HistoCode == "H_Ped_Date")
13412  {
13417  }
13418 
13419  if(HistoCode == "H_TNo_Date")
13420  {
13425  }
13426 
13427  if(HistoCode == "H_MCs_Date") // (ReInitCanvas)
13428  {
13433  }
13434 
13435 
13436  if(HistoCode == "H_LFN_Date")
13437  {
13442  }
13443 
13444  if(HistoCode == "H_HFN_Date")
13445  {
13450  }
13451 
13452  if(HistoCode == "H_SCs_Date")
13453  {
13458  }
13459 
13460  if(HistoCode == "H_Ped_RuDs")
13461  {
13466  }
13467 
13468  if(HistoCode == "H_TNo_RuDs")
13469  {
13474  }
13475 
13476  if(HistoCode == "H_MCs_RuDs") // (ReInitCanvas)
13477  {
13482  }
13483 
13484 
13485  if(HistoCode == "H_LFN_RuDs")
13486  {
13491  }
13492 
13493  if(HistoCode == "H_HFN_RuDs")
13494  {
13499  }
13500 
13501  if(HistoCode == "H_SCs_RuDs")
13502  {
13507  }
13508  }
13509 }
13510 // ------- end of ReInitCanvas(...) ------------
13511 
13512 //==========================================================================================
13513 void TEcnaHistos::WriteMatrixAscii(const TString MatrixElement, const TString MatrixProbaNature,
13514  const Int_t& StexStinEcna, const Int_t& MatrixBinIndex,
13515  const Int_t& MatSize, const TMatrixD& read_matrix)
13516 {
13517 // write matrix in ascii file
13518 
13519  Int_t ChanNumber = MatrixBinIndex;
13520 
13524 
13525  if( MatrixElement == fBetweenSamples && MatrixProbaNature == fCorrelationMatrix )
13526  {
13527  fCnaWrite->WriteAsciiCorrelationsBetweenSamples(StexStinEcna, ChanNumber, MatSize, read_matrix);
13529  }
13530 
13531  if( MatrixElement == fBetweenSamples && MatrixProbaNature == fCovarianceMatrix )
13532  {
13533  fCnaWrite->WriteAsciiCovariancesBetweenSamples(StexStinEcna, ChanNumber, MatSize, read_matrix);
13535  }
13536 }
13537 //...............................................................................................
13538 void TEcnaHistos::WriteHistoAscii(const TString HistoCode, const Int_t& HisSize,
13539  const TVectorD& read_histo)
13540 {
13541 // write matrix in ascii file
13542 
13547 
13548  fCnaWrite->WriteAsciiHisto(HistoCode, HisSize, read_histo);
13550 }
13551 
13553 
13554 //---------------------------------------------------------------------------------------------
13555 // HistoCode list modification (06/10/09)
13556 
13557 // D = Detector Plot ChNb = Channel Number
13558 // H = History Plot ChDs = Channel Distribution (Y projection)
13559 //
13560 // old code new code
13561 //
13562 // * 1 H1NbOfEvtsGlobal D_NOE_ChNb NOE = Number Of Events
13563 // * 2 H1NbOfEvtsProj D_NOE_ChDs
13564 // * 3 H1EvEvGlobal D_Ped_ChNb Ped = Pedestal
13565 // * 4 H1EvEvProj D_Ped_ChDs
13566 // * 5 H1EvSigGlobal D_TNo_ChNb TNo = Total Noise
13567 // * 6 H1EvSigProj D_TNo_ChDs
13568 // * 7 H1SigEvGlobal D_LFN_ChNb LFN = Low Frequency noise
13569 // * 8 H1SigEvProj D_LFN_ChDs
13570 // * 9 H1SigSigGlobal D_HFN_ChNb HFN = High Frequency noise
13571 // * 10 H1SigSigProj D_HFN_ChDs
13572 // * 11 H1EvCorssGlobal D_MCs_ChNb MCs = Mean of the correlations between samples
13573 // * 12 H1EvCorssProj D_MCs_ChDs
13574 // * 13 H1SigCorssGlobal D_SCs_ChNb Scs = Sigma of the correlations between samples
13575 // * 14 H1SigCorssProj D_SCs_ChDs
13576 // * 15 Ev D_MSp_Samp MSp = Mean of the samples
13577 // * 16 Sigma D_SSp_Samp SSp = Sigma of the samples
13578 // * 17 SampTime D_Adc_EvNb Adc = ADC count as a function of Event number
13579 // * 18 AdcProj D_Adc_EvDs EvDs = Event distribution
13580 // * 19 EvolEvEv H_Ped_Date Date = date in format YYMMJJ hhmmss
13581 // * 20 EvolEvEvProj H_Ped_RuDs RuDs = Run distribution
13582 // * 21 EvolEvSig H_TNo_Date
13583 // * 22 EvolEvSigProj H_TNo_RuDs
13584 // * 23 EvolSigEv H_LFN_Date
13585 // * 24 EvolSigEvProj H_LFN_RuDs
13586 // * 25 EvolSigSig H_HFN_Date
13587 // * 26 EvolSigSigProj H_HFN_RuDs
13588 // * 27 EvolEvCorss H_MCs_Date
13589 // * 28 EvolEvCorssProj H_MCs_RuDs
13590 // * 29 EvolSigCorss H_SCs_Date
13591 // * 30 EvolSigCorssProj H_SCs_RuDs
13592 
13593 //---------------> messages de rappel pour l'auteur:
13594 //
13595 //======= 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 ==============!!!!
13596 // A EVITER ABSOLUMENT quand on est sous TEcnaGui CAR LE cin >> BLOQUE X11
13597 // puisqu'on n'a pas la main dans la fenetre de compte-rendu de la CNA
13598 // {Int_t cintoto; cout << "taper 0 pour continuer" << endl; cin >> cintoto;}
13599 // *=================================================*
13600 // | |
13601 //++++++++++++++++++++++++| A T T E N T I O N: PAS DE TEST "cintoto" ici! |+++++++++++++++++++++!!!!
13602 // | |
13603 // *=================================================*
13604 // INFO: When "new" fails to allocate the memory for an object, or "new[]" fails to allocate the memory
13605 // for an object array, a std::bad_alloc object is thrown.
13606 // "In GCC, the RTTI mangled name of std::bad_alloc is, I'm guessing, St9bad_alloc."
TCanvasImp * fImpH_TNo_Date
Definition: TEcnaHistos.h:568
void EEXtalsAveragedTotalNoise()
void EBAveragedPedestalsXtals()
void GeneralTitle(const TString)
void SetGeneralTitle(const TString)
Double_t fD_TNo_ChDsYmin
Definition: TEcnaHistos.h:237
Int_t fMemoPlotD_HFN_ChDs
Definition: TEcnaHistos.h:321
void StexHocoVecoLowFrequencyNoise()
Axis_t fD_TNo_ChDsXinf
Definition: TEcnaHistos.h:171
TVirtualPad * fPadD_NOE_ChDs
Definition: TEcnaHistos.h:486
void DeeMeanOfCorssXtals()
TString fFapStexType
Definition: TEcnaHistos.h:96
Int_t MaxCrysPhiInTow()
Int_t fNbOfListFileH_MCs_Date
Definition: TEcnaHistos.h:597
Double_t fH_LFN_RuDsYmin
Definition: TEcnaHistos.h:283
void StexHocoVecoLHFCorcc(const TString)
TCanvasImp * fImpD_SSp_Samp
Definition: TEcnaHistos.h:564
Int_t GetHistoNumberOfBins(const TString, const Int_t &)
void StexHocoVecoTotalNoise()
UInt_t SetCanvasHeight(const TString, const TString)
Int_t MaxCrysHocoInStex()
Int_t fMemoPlotH_HFN_Date
Definition: TEcnaHistos.h:328
TString fXMemoH_TNo_RuDs
Definition: TEcnaHistos.h:377
Axis_t fH_Ped_RuDsXinf
Definition: TEcnaHistos.h:211
TPaveText * fPavTxtH_TNo_RuDs
Definition: TEcnaHistos.h:542
Double_t fD_SCs_ChNbYmin
Definition: TEcnaHistos.h:251
TEcnaNumbering * fEcalNumbering
Definition: TEcnaHistos.h:68
Int_t fMemoColorH_LFN_RuDs
Definition: TEcnaHistos.h:344
int i
Definition: DBlmapReader.cc:9
Axis_t fD_Adc_EvDsXsup
Definition: TEcnaHistos.h:195
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 &)
Int_t MaxCrysIYInDee()
Int_t MaxSCIYInDee()
TPaveText * fPavTxtD_Ped_ChNb
Definition: TEcnaHistos.h:519
TString fSameOnePlot
Definition: TEcnaHistos.h:313
TString fStartDate
Definition: TEcnaHistos.h:116
Int_t fCanvSameD_MCs_ChNb
Definition: TEcnaHistos.h:584
void ViewStex(const TString)
void SCCrystalNumbering(const Int_t &, const Int_t &)
TCanvas * fCanvH_SCs_RuDs
Definition: TEcnaHistos.h:480
Axis_t fH_TNo_RuDsXinf
Definition: TEcnaHistos.h:213
Double_t fH_TNo_DateYmax
Definition: TEcnaHistos.h:267
Int_t fCdeleteRoot
Definition: TEcnaHistos.h:53
TPaveText * fPavTxtH_HFN_RuDs
Definition: TEcnaHistos.h:545
TVectorD ReadLowFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2539
Int_t MaxCrysEtaInTow()
void StexNumberOfEventsXtals()
void SetViewHistoColors(TH1D *, const TString, const TString)
void XtalTimeTotalNoise(const TString, const Int_t &, const Int_t &, const TString)
Int_t fNbBinsMemoH_LFN_Date
Definition: TEcnaHistos.h:437
TCanvasImp * fImpD_Ped_ChDs
Definition: TEcnaHistos.h:552
Double_t fH_Ped_RuDsYmax
Definition: TEcnaHistos.h:278
Int_t fNbBinsMemoH_MCs_Date
Definition: TEcnaHistos.h:436
void XtalTimeMeanOfCorss(const TString, const Int_t &, const Int_t &, const TString)
Axis_t fD_Ped_ChDsXsup
Definition: TEcnaHistos.h:168
TString fFapStexDir
Definition: TEcnaHistos.h:97
void SetParametersPavTxt(const TString, const TString)
TVirtualPad * fPadD_LFN_ChNb
Definition: TEcnaHistos.h:493
TString fYMemoH_LFN_RuDs
Definition: TEcnaHistos.h:411
Double_t fH_LFN_DateYmin
Definition: TEcnaHistos.h:270
TString fXMemoD_MCs_ChNb
Definition: TEcnaHistos.h:358
Int_t fMemoColorD_TNo_ChNb
Definition: TEcnaHistos.h:335
Int_t fNbBinsMemoD_HFN_ChNb
Definition: TEcnaHistos.h:426
Int_t * fT1DRunNumber
Definition: TEcnaHistos.h:121
Int_t fMemoColorH_TNo_Date
Definition: TEcnaHistos.h:343
Int_t fMemoColorD_SCs_ChNb
Definition: TEcnaHistos.h:339
Double_t fD_LFN_ChNbYmax
Definition: TEcnaHistos.h:244
Int_t fMemoColorH_SCs_Date
Definition: TEcnaHistos.h:347
void SetHistoColorPalette(const TString)
TPaveText * SetPaveStinsXY(const Int_t &, const Int_t &)
TString GetSCQuadFrom1DeeSCEcna(const Int_t &)
TPaveText * fPavComAnaRun
Definition: TEcnaHistos.h:303
Int_t GetNotConnectedDSSCFromIndex(const Int_t &)
TPaveText * fPavComStex
Definition: TEcnaHistos.h:300
Int_t MaxCrysEcnaInDee()
void CovariancesBetweenSamples(const Int_t &, const Int_t &, const TString)
Int_t fOptVisPolm
Definition: TEcnaHistos.h:138
Axis_t fD_Adc_EvNbXsup
Definition: TEcnaHistos.h:197
TString fCorrelationMatrix
Definition: TEcnaHistos.h:142
Int_t fFapMaxNbOfRuns
Definition: TEcnaHistos.h:85
TString fFlagScaleX
Definition: TEcnaHistos.h:128
TString fStartEvolDate
Definition: TEcnaHistos.h:93
void InitSpecParBeforeFileReading()
TString fXMemoD_MCs_ChDs
Definition: TEcnaHistos.h:359
void XtalTimePedestals(const TString, const Int_t &, const Int_t &, const TString)
TCanvasImp * fImpH_MCs_Date
Definition: TEcnaHistos.h:569
void EEXtalsAveragedMeanOfCorss()
Int_t fMemoColorH_HFN_RuDs
Definition: TEcnaHistos.h:345
void SMEtaPhiHighFrequencyNoise()
TPaveText * fPavComStas
Definition: TEcnaHistos.h:299
TString fYMemoD_HFN_ChDs
Definition: TEcnaHistos.h:395
TPaveText * fPavTxtH_MCs_Date
Definition: TEcnaHistos.h:537
Int_t fCanvSameD_MSp_Samp
Definition: TEcnaHistos.h:588
void EEIXIYAveragedSigmaOfCorss()
Int_t Get0SMEchaFrom1SMTowAnd0TowEcha(const Int_t &, const Int_t &)
TString fRunType
Definition: TEcnaHistos.h:117
Int_t Get1DeeSCEcnaFromDeeSCCons(const Int_t &, const Int_t &)
void XtalSamplesEv(const Int_t &, const Int_t &, const TString)
Int_t fMemoColorH_MCs_RuDs
Definition: TEcnaHistos.h:346
TString fYMemoD_Ped_ChNb
Definition: TEcnaHistos.h:386
TString GetIXIYAxisTitle(const TString)
TString fYMemoH_MCs_Date
Definition: TEcnaHistos.h:404
TPaveText * fPavTxtH_SCs_RuDs
Definition: TEcnaHistos.h:546
Float_t AxisTitleOffset()
Int_t fMemoPlotD_Adc_EvNb
Definition: TEcnaHistos.h:324
Int_t fMemoPlotD_NOE_ChDs
Definition: TEcnaHistos.h:316
void ViewHistime(const TString, const Int_t &, const Int_t &, const TString, const TString)
void SetHistoScaleX(const TString)
Bool_t fStatusDataExist
Definition: TEcnaHistos.h:113
void SetViewHistoPadMargins(const TString, const TString)
void WriteAsciiCovariancesBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1241
Double_t GetPhiMin(const Int_t &, const Int_t &)
TCanvas * fCanvD_NOE_ChNb
Definition: TEcnaHistos.h:451
Int_t fNbBinsMemoD_TNo_ChNb
Definition: TEcnaHistos.h:420
TCanvas * fCanvH_HFN_Date
Definition: TEcnaHistos.h:473
Double_t GetXinfValueFromMemo()
TVirtualPad * fPadD_HFN_ChDs
Definition: TEcnaHistos.h:496
UInt_t CanvasFormatW(const TString)
TVirtualPad * fPadH_Ped_Date
Definition: TEcnaHistos.h:503
Int_t fTextPaveAlign
Definition: TEcnaHistos.h:148
TCanvas * fCanvD_SCs_ChDs
Definition: TEcnaHistos.h:464
Axis_t fH_TNo_DateXinf
Definition: TEcnaHistos.h:200
Int_t GetNotCompleteDSSCFromIndex(const Int_t &)
Int_t SetGraphFrameYminYmaxFromMemo(TGraph *, const TString)
Int_t fNbBinsMemoH_TNo_RuDs
Definition: TEcnaHistos.h:441
Int_t MaxCrysVecoInStin()
Axis_t fH_LFN_DateXinf
Definition: TEcnaHistos.h:204
Color_t ColorDefinition(const TString)
TString GetXVarFromMemo(const TString, const TString)
TPaveText * fPavTxtD_MSp_Samp
Definition: TEcnaHistos.h:531
Int_t GetYStinInStas(const Int_t &, const Int_t &)
TMatrixD ReadCovariancesBetweenSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1403
TCanvas * fCanvD_Adc_EvDs
Definition: TEcnaHistos.h:467
void StexXtalsNumberOfEvents()
Float_t DeeNameOffsetX(const Int_t &)
Double_t fH_MCs_DateYmax
Definition: TEcnaHistos.h:269
void ViewMatrix(const Int_t &, const Int_t &, const Int_t &, const TString, const TString, const TString)
TString fXMemoD_NOE_ChNb
Definition: TEcnaHistos.h:352
Int_t fCanvSameD_SCs_ChNb
Definition: TEcnaHistos.h:587
Int_t fNbBinsMemoH_Ped_RuDs
Definition: TEcnaHistos.h:440
void SetYminMemoFromValue(const TString, const Double_t &)
Double_t fD_MSp_SampYmin
Definition: TEcnaHistos.h:256
TString fStopEvolDate
Definition: TEcnaHistos.h:93
Axis_t GetHistoXsup(const TString, const Int_t &, const TString)
Int_t fOptVisLine
Definition: TEcnaHistos.h:138
void StexHocoVecoSigmaOfCorss()
void SetYmaxMemoFromPreviousMemo(const TString)
TString GetYDirectionEB(const Int_t &)
TString GetSMHalfBarrel(const Int_t &)
void StexXtalsMeanOfCorss()
Int_t MaxStinVecoInStex()
Int_t fCanvSameH_MCs_Date
Definition: TEcnaHistos.h:594
Axis_t fD_Ped_ChDsXinf
Definition: TEcnaHistos.h:167
TString fFapStinName
Definition: TEcnaHistos.h:101
Int_t fNbBinsMemoD_LFN_ChDs
Definition: TEcnaHistos.h:425
Int_t fMemoColorD_MCs_ChDs
Definition: TEcnaHistos.h:336
TVectorD ReadAveragedMeanOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2988
Double_t fD_TNo_ChDsYmax
Definition: TEcnaHistos.h:238
Double_t GetYmaxFromHistoFrameAndMarginValue(TH1D *, const Double_t)
TPaveText * fPavTxtH_TNo_Date
Definition: TEcnaHistos.h:536
TString fXMemoD_SCs_ChNb
Definition: TEcnaHistos.h:364
Double_t fYsup
Definition: TEcnaHistos.h:153
void SetViewGraphColors(TGraph *, const TString, const TString)
TString fYMemoH_TNo_Date
Definition: TEcnaHistos.h:403
TVirtualPad * fPadD_TNo_ChDs
Definition: TEcnaHistos.h:490
TVirtualPad * fPadD_HFN_ChNb
Definition: TEcnaHistos.h:495
TEcnaWrite * fCnaWrite
Definition: TEcnaHistos.h:66
void ViewTowerGrid(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString)
void NewCanvas(const TString)
Axis_t fH_SCs_RuDsXinf
Definition: TEcnaHistos.h:221
TPaveText * fPavTxtH_Ped_RuDs
Definition: TEcnaHistos.h:541
TCanvas * fCurrentCanvas
Definition: TEcnaHistos.h:448
TString fYMemoD_MCs_ChDs
Definition: TEcnaHistos.h:391
Double_t GetYmaxFromGraphFrameAndMarginValue(TGraph *, const Double_t)
TString fYMemoD_Adc_EvDs
Definition: TEcnaHistos.h:400
void StexHocoVecoMeanOfCorss()
void LowFrequencyCorrelationsBetweenChannels(const Int_t &, const Int_t &, const TString)
Int_t fCanvSameH_TNo_RuDs
Definition: TEcnaHistos.h:591
void ReInitCanvas(const TString, const TString)
TString fHistoCodeFirst
Definition: TEcnaHistos.h:226
Double_t fD_TNo_ChNbYmax
Definition: TEcnaHistos.h:236
Double_t GetXsupValueFromMemo()
TCanvasImp * fImpD_LFN_ChDs
Definition: TEcnaHistos.h:558
Int_t fNbBinsMemoH_SCs_RuDs
Definition: TEcnaHistos.h:445
TString GetStartDate()
Definition: TEcnaRead.cc:623
Int_t fNbBinsMemoH_HFN_RuDs
Definition: TEcnaHistos.h:444
void LowFrequencyMeanCorrelationsBetweenStins(const TString)
TVirtualPad * fPadD_NOE_ChNb
Definition: TEcnaHistos.h:485
void SetEcalSubDetector(const TString, const TEcnaParEcal *, const TEcnaParHistos *, const TEcnaNumbering *, const TEcnaWrite *)
Definition: TEcnaHistos.cc:953
TCanvas * CreateCanvas(const TString, const TString, const TString, UInt_t, UInt_t)
void StexHocoVecoNumberOfEvents()
TString GetDeeDirViewedFromIP(const Int_t &)
void LowFrequencyMeanCorrelationsBetweenSCs(const TString)
Int_t fFapNbOfRuns
Definition: TEcnaHistos.h:86
Double_t fH_TNo_DateYmin
Definition: TEcnaHistos.h:266
TString GetJYDirectionEB(const Int_t &)
void SetXsupMemoFromValue(const TString, const Double_t &)
Float_t DeeNumberOffsetX(const TString, const Int_t &)
Int_t fFapLastReqEvtNumber
Definition: TEcnaHistos.h:79
Int_t fCanvSameH_HFN_RuDs
Definition: TEcnaHistos.h:593
Int_t fMemoColorH_Ped_RuDs
Definition: TEcnaHistos.h:342
Double_t fH_Ped_DateYmax
Definition: TEcnaHistos.h:265
Double_t fXsup
Definition: TEcnaHistos.h:153
Double_t GetJPhiMax(const Int_t &, const Int_t &)
TCanvas * fCanvH_MCs_RuDs
Definition: TEcnaHistos.h:477
TString GetEEDeeType(const Int_t &)
TMatrixD ReadLowFrequencyCorrelationsBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1645
Double_t fD_Ped_ChNbYmin
Definition: TEcnaHistos.h:231
Int_t fStopEvolRun
Definition: TEcnaHistos.h:89
TString fYMemoH_HFN_RuDs
Definition: TEcnaHistos.h:412
Bool_t GetOkViewHisto(TEcnaRead *, const Int_t &, const Int_t &, const Int_t &, const TString)
void EBAveragedTotalNoiseXtals()
TString GetStinLvrbType(const Int_t &)
TCanvas * fCanvD_SSp_Samp
Definition: TEcnaHistos.h:466
Int_t fMemoColorD_MCs_ChNb
Definition: TEcnaHistos.h:336
TVectorD ReadAveragedSigmaOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:3043
void DeeXtalsMeanOfCorss()
Int_t fCnewRoot
Definition: TEcnaHistos.h:53
Double_t GetPhiMax(const Int_t &, const Int_t &)
Int_t MaxStinInStex()
TPaveText * fPavTxtH_LFN_Date
Definition: TEcnaHistos.h:538
Double_t fD_HFN_ChDsYmin
Definition: TEcnaHistos.h:249
TVectorD ReadSigmaOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2647
Int_t MaxStinHocoInStas()
Int_t fOptScaleLogx
Definition: TEcnaHistos.h:140
Axis_t fH_HFN_DateXinf
Definition: TEcnaHistos.h:206
TCanvasImp * fImpH1SamePlus
Definition: TEcnaHistos.h:548
Int_t fCanvSameD_LFN_ChNb
Definition: TEcnaHistos.h:585
Axis_t fH_HFN_RuDsXsup
Definition: TEcnaHistos.h:220
Int_t Get1SCEchaFrom0DeeEcha(const Int_t &)
void ViewStas(const TString)
TPaveText * fPavComGeneralTitle
Definition: TEcnaHistos.h:298
TCanvasImp * fImpD_LFN_ChNb
Definition: TEcnaHistos.h:557
void DeeIXIYLowFrequencyNoise()
Axis_t fD_SCs_ChNbXsup
Definition: TEcnaHistos.h:186
TString fYMemoD_SCs_ChDs
Definition: TEcnaHistos.h:397
TString HistoryRunListFilePath()
void EBEtaPhiAveragedLowFrequencyNoise()
Int_t fCanvSameD_NOE_ChDs
Definition: TEcnaHistos.h:581
TVirtualPad * fPadH_MCs_RuDs
Definition: TEcnaHistos.h:511
void EEAveragedTotalNoiseXtals()
TString GetRootFileNameShort()
Definition: TEcnaRead.cc:3168
Int_t fCanvSameH_LFN_Date
Definition: TEcnaHistos.h:592
Double_t fD_TNo_ChNbYmin
Definition: TEcnaHistos.h:235
time_t GetStopTime()
Definition: TEcnaRead.cc:622
TCanvasImp * fImpH_Ped_RuDs
Definition: TEcnaHistos.h:573
TEcnaParCout * fCnaParCout
Definition: TEcnaHistos.h:65
void DeeXtalsLowFrequencyNoise()
void SetRunNumberFromList(const Int_t &, const Int_t &)
void ViewDeeGrid(const Int_t &, const TString)
TString SetCanvasName(const TString, const Int_t &, const Int_t &, const TString, const Int_t &, const Int_t &, const Int_t &)
Int_t fCanvSameH_MCs_RuDs
Definition: TEcnaHistos.h:594
TString fXMemoH_SCs_Date
Definition: TEcnaHistos.h:375
TCanvas * fCanvH1SamePlus
Definition: TEcnaHistos.h:450
void StexXtalsSigmaOfCorss()
void SMEtaPhiPedestals()
Int_t fFapStexNumber
Definition: TEcnaHistos.h:81
Int_t fFapNbOfSamples
Definition: TEcnaHistos.h:76
Color_t GetViewHistoColor(const TString, const TString)
void GetReadyToReadRootFile(TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, TString)
Definition: TEcnaRead.cc:532
TString fCovarianceMatrix
Definition: TEcnaHistos.h:142
TString fXMemoD_NOE_ChDs
Definition: TEcnaHistos.h:353
Int_t fCanvSameD_LFN_ChDs
Definition: TEcnaHistos.h:585
Int_t fNbBinsMemoD_TNo_ChDs
Definition: TEcnaHistos.h:421
TPaveText * fPavTxtH1SamePlus
Definition: TEcnaHistos.h:516
Int_t fTextBorderSize
Definition: TEcnaHistos.h:151
TCanvasImp * fImpD_Adc_EvDs
Definition: TEcnaHistos.h:565
TCanvasImp * fImpH_SCs_RuDs
Definition: TEcnaHistos.h:578
void XtalHighFrequencyNoiseRuns(const TString, const Int_t &, const Int_t &, const TString)
Int_t MaxTowPhiInSM()
time_t fStopEvolTime
Definition: TEcnaHistos.h:92
TVirtualPad * fPadH_MCs_Date
Definition: TEcnaHistos.h:505
TCanvasImp * fImpD_NOE_ChDs
Definition: TEcnaHistos.h:550
TString fYMemoH_HFN_Date
Definition: TEcnaHistos.h:406
Double_t GetYmaxValueFromMemo(const TString)
void EEAveragedHighFrequencyNoiseXtals()
void XtalTimeHighFrequencyNoise(const TString, const Int_t &, const Int_t &, const TString)
Double_t fH2HFccMosMatrixYmax
Definition: TEcnaHistos.h:293
TString fXMemoD_MSp_Samp
Definition: TEcnaHistos.h:366
void XtalPedestalsRuns(const TString, const Int_t &, const Int_t &, const TString)
TPaveText * fPavTxtD_NOE_ChDs
Definition: TEcnaHistos.h:518
TString fBetweenSamples
Definition: TEcnaHistos.h:144
Double_t fD_SSp_SampYmin
Definition: TEcnaHistos.h:258
void SetGraphPresentation(TGraph *, const TString, const TString)
Int_t fMemoColorH_LFN_Date
Definition: TEcnaHistos.h:344
TCanvas * fCanvH_HFN_RuDs
Definition: TEcnaHistos.h:479
void StexXtalsTotalNoise()
TString fXMemoD_Ped_ChDs
Definition: TEcnaHistos.h:355
Double_t fD_HFN_ChDsYmax
Definition: TEcnaHistos.h:250
TPaveText * SetPaveLVRB(const Int_t &, const Int_t &)
tuple histo
Definition: trackerHits.py:12
TString StexNumberToString(const Int_t &)
Int_t fMemoPlotD_TNo_ChNb
Definition: TEcnaHistos.h:318
TString fXMemoH_SCs_RuDs
Definition: TEcnaHistos.h:381
Int_t fMemoColorD_MSp_Samp
Definition: TEcnaHistos.h:340
void SMEtaPhiLowFrequencyCorcc()
void EBAveragedSigmaOfCorssXtals()
TCanvas * fCanvD_MSp_Samp
Definition: TEcnaHistos.h:465
void SMEtaPhiTotalNoise()
TString fFapAnaType
Definition: TEcnaHistos.h:75
Double_t fD_LFN_ChDsYmin
Definition: TEcnaHistos.h:245
TMatrixD ReadHighFrequencyMeanCorrelationsBetweenStins(const Int_t &)
Definition: TEcnaRead.cc:2260
TVirtualPad * fPadH_Ped_RuDs
Definition: TEcnaHistos.h:509
Double_t fD_SCs_ChNbYmax
Definition: TEcnaHistos.h:252
Int_t fMemoColorD_SSp_Samp
Definition: TEcnaHistos.h:340
Int_t fMemoColorH_SCs_RuDs
Definition: TEcnaHistos.h:347
TString fYMemoH_Ped_Date
Definition: TEcnaHistos.h:402
Double_t fUserHistoMin
Definition: TEcnaHistos.h:133
Axis_t fD_LFN_ChNbXsup
Definition: TEcnaHistos.h:178
Double_t GetYmaxDefaultValue(const TString)
Int_t fMemoColorD_Adc_EvNb
Definition: TEcnaHistos.h:341
void WriteMatrixAscii(const TString, const TString, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
TPaveText * fPavTxtD_HFN_ChNb
Definition: TEcnaHistos.h:527
Int_t MaxSCIXInDee()
Int_t fNbBinsMemoD_Adc_EvDs
Definition: TEcnaHistos.h:432
void DeeSCNumbering(const Int_t &)
TCanvasImp * fImpD_Adc_EvNb
Definition: TEcnaHistos.h:566
void SetHistoMin()
void SetAllPavesViewStinCrysNb(const Int_t &, const Int_t &)
TPaveText * fPavTxtH_LFN_RuDs
Definition: TEcnaHistos.h:544
Int_t fMemoPlotH_MCs_Date
Definition: TEcnaHistos.h:329
void ViewStexStinNumberingPad(const Int_t &)
void DeeIXIYMeanOfCorss()
Axis_t fD_HFN_ChNbXsup
Definition: TEcnaHistos.h:182
Int_t GetHashedNumberFromIEtaAndIPhi(const Int_t &, const Int_t &)
TCanvas * fCanvH_Ped_Date
Definition: TEcnaHistos.h:469
Float_t AxisTitleSize()
Int_t fCnaCommand
Definition: TEcnaHistos.h:51
TVectorD ReadAveragedTotalNoise(const Int_t &)
Definition: TEcnaRead.cc:2823
Double_t GetIIXMin(const Int_t &)
Axis_t fD_TNo_ChNbXinf
Definition: TEcnaHistos.h:169
Int_t fMemoPlotH_TNo_Date
Definition: TEcnaHistos.h:326
Int_t fZerv
Definition: TEcnaHistos.h:48
void TowerCrystalNumbering(const Int_t &, const Int_t &)
Axis_t fH_TNo_RuDsXsup
Definition: TEcnaHistos.h:214
Int_t fCanvSameD_NOE_ChNb
Definition: TEcnaHistos.h:581
TString fXMemoH_TNo_Date
Definition: TEcnaHistos.h:371
Double_t fH2LFccMosMatrixYmax
Definition: TEcnaHistos.h:291
TMatrixD ReadLowFrequencyMeanCorrelationsBetweenStins(const Int_t &)
Definition: TEcnaRead.cc:2187
Int_t fMemoPlotH_TNo_RuDs
Definition: TEcnaHistos.h:326
Int_t SetHistoFrameYminYmaxFromMemo(TH1D *, const TString)
void SetParametersCanvas(const TString, const TString)
void ViewEBGrid()
Double_t fD_HFN_ChNbYmax
Definition: TEcnaHistos.h:248
void StexHighFrequencyNoiseXtals()
Int_t fNbOfListFileH_SCs_RuDs
Definition: TEcnaHistos.h:600
Int_t fMemoColorD_LFN_ChDs
Definition: TEcnaHistos.h:337
TString fFlagColPal
Definition: TEcnaHistos.h:130
TString GetXDirectionEE(const Int_t &)
Double_t fD_SSp_SampYmax
Definition: TEcnaHistos.h:259
Axis_t fH1SameOnePlotXsup
Definition: TEcnaHistos.h:159
Axis_t fH_MCs_DateXsup
Definition: TEcnaHistos.h:203
void StexLowFrequencyNoiseXtals()
TString GetEtaPhiAxisTitle(const TString)
Int_t fCanvSameD_HFN_ChNb
Definition: TEcnaHistos.h:586
void RegisterFileParameters(const TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString, const TString, const time_t, const time_t)
Definition: TEcnaWrite.cc:446
TString fXMemoH_Ped_Date
Definition: TEcnaHistos.h:370
void EBXtalsAveragedLowFrequencyNoise()
Int_t fOptScaleLinx
Definition: TEcnaHistos.h:140
Axis_t fH_SCs_RuDsXsup
Definition: TEcnaHistos.h:222
TPaveText * fPavTxtD_Ped_ChDs
Definition: TEcnaHistos.h:520
Int_t MaxCrysIXInDee()
Int_t fFapRunNumber
Definition: TEcnaHistos.h:77
TPaveText * SetPaveAnalysisRun(const TString, const Int_t &, const Int_t &, const TString, const Int_t &, const Int_t &, const TString)
Int_t MaxSMPhiInEB()
Double_t fD_HFN_ChNbYmin
Definition: TEcnaHistos.h:247
TString fYMemoD_TNo_ChDs
Definition: TEcnaHistos.h:389
TString GetTowerLvrbType(const Int_t &)
TString fYMemoD_MSp_Samp
Definition: TEcnaHistos.h:398
void StexStinNumbering(const Int_t &)
void EEAveragedNumberOfEventsXtals()
TString fXMemoD_Adc_EvNb
Definition: TEcnaHistos.h:369
void EBAveragedHighFrequencyNoiseXtals()
void SMXtalsHighFrequencyNoise()
void DeeXtalsTotalNoise()
Int_t fMemoPlotD_MCs_ChDs
Definition: TEcnaHistos.h:319
TPaveText * fPavTxtH_SCs_Date
Definition: TEcnaHistos.h:540
Int_t fFapFirstReqEvtNumber
Definition: TEcnaHistos.h:78
Int_t fNbBinsMemoD_Adc_EvNb
Definition: TEcnaHistos.h:433
void EBEtaPhiAveragedSigmaOfCorss()
void EBAveragedMeanOfCorssXtals()
void StasHocoVecoAveragedPedestals()
Int_t fCanvSameH_TNo_Date
Definition: TEcnaHistos.h:591
Int_t fNbOfListFileH_TNo_Date
Definition: TEcnaHistos.h:597
TString fXMemoH_MCs_Date
Definition: TEcnaHistos.h:372
Int_t NumberOfEvents(Int_t **, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaWrite.cc:361
Double_t fH2CorccInStinsYmax
Definition: TEcnaHistos.h:295
TString SetHistoXAxisTitle(const TString)
Double_t fD_Adc_EvNbYmin
Definition: TEcnaHistos.h:262
void StasHocoVecoAveragedTotalNoise()
Double_t fUserHistoMax
Definition: TEcnaHistos.h:133
TPaveText * fPavTxtD_Adc_EvNb
Definition: TEcnaHistos.h:534
TCanvas * fCanvD_Ped_ChDs
Definition: TEcnaHistos.h:454
TString GetHocoVecoAxisTitle(const TString)
Float_t AxisLabelOffset()
TVectorD GetHistoValues(TEcnaRead *, const TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, Int_t &)
Int_t fMemoColorH_Ped_Date
Definition: TEcnaHistos.h:342
TString fFapFileRuns
Definition: TEcnaHistos.h:87
TString GetAsciiFileName()
Definition: TEcnaWrite.cc:268
TVirtualPad * fPadD_Ped_ChNb
Definition: TEcnaHistos.h:487
Axis_t fH_MCs_RuDsXinf
Definition: TEcnaHistos.h:215
TCanvasImp * fImpH_HFN_RuDs
Definition: TEcnaHistos.h:577
void StasHocoVecoAveragedLowFrequencyNoise()
Int_t fMemoColorD_NOE_ChNb
Definition: TEcnaHistos.h:333
Axis_t fD_NOE_ChDsXsup
Definition: TEcnaHistos.h:164
Int_t fNbBinsMemoH1SamePlus
Definition: TEcnaHistos.h:415
Double_t fD_MSp_SampYmax
Definition: TEcnaHistos.h:257
Int_t MaxCrysIXInSC()
Int_t fCanvSameD_Adc_EvNb
Definition: TEcnaHistos.h:589
TVirtualPad * fPadH_HFN_RuDs
Definition: TEcnaHistos.h:513
Float_t fTextPaveSize
Definition: TEcnaHistos.h:150
void SMXtalsMeanOfCorss()
void SMXtalsPedestals()
void StexXtalsPedestals()
Int_t fMemoColorD_Ped_ChDs
Definition: TEcnaHistos.h:334
time_t fStopTime
Definition: TEcnaHistos.h:115
Int_t fMemoPlotH_LFN_Date
Definition: TEcnaHistos.h:327
void EBXtalsAveragedTotalNoise()
TString fTTBELL
Definition: TEcnaHistos.h:55
Axis_t fD_SCs_ChDsXinf
Definition: TEcnaHistos.h:187
TVirtualPad * fPadD_SSp_Samp
Definition: TEcnaHistos.h:500
Int_t fMemoPlotD_LFN_ChNb
Definition: TEcnaHistos.h:320
TString fSeveralPlot
Definition: TEcnaHistos.h:312
void StexSigmaOfCorssXtals()
Double_t fH_HFN_DateYmin
Definition: TEcnaHistos.h:272
TPaveText * fPavComLVRB
Definition: TEcnaHistos.h:306
Int_t fMemoColorD_TNo_ChDs
Definition: TEcnaHistos.h:335
Int_t fFapNbOfEvts
Definition: TEcnaHistos.h:83
Int_t fMemoColorH_HFN_Date
Definition: TEcnaHistos.h:345
Double_t GetJIYMax(const Int_t &, const Int_t &)
Int_t GetXSampInStin(const Int_t &, const Int_t &, const Int_t &, const Int_t &)
void SetYmaxMemoFromValue(const TString, const Double_t &)
Axis_t fD_Adc_EvDsXinf
Definition: TEcnaHistos.h:194
void DeeIXIYHighFrequencyNoise()
void DeePedestalsXtals()
Int_t GetJYCrysInDee(const Int_t &, const Int_t &, const Int_t &)
void SetHistoMax()
void EBXtalsAveragedPedestals()
TVirtualPad * fPadD_MCs_ChDs
Definition: TEcnaHistos.h:492
Double_t fH_HFN_RuDsYmax
Definition: TEcnaHistos.h:286
Double_t fH_TNo_RuDsYmin
Definition: TEcnaHistos.h:279
TString fYMemoH1SamePlus
Definition: TEcnaHistos.h:383
Int_t fCanvSameD_TNo_ChDs
Definition: TEcnaHistos.h:583
Int_t MaxNbOfRunsInLists()
void XtalSigmaOfCorssRuns(const TString, const Int_t &, const Int_t &, const TString)
Double_t GetIIXMax(const Int_t &)
TPaveText * fPavComXtal
Definition: TEcnaHistos.h:302
void DeeXtalsHighFrequencyNoise()
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:888
Color_t ColorTab(const Int_t &)
void EBXtalsAveragedSigmaOfCorss()
Int_t fMemoPlotH_LFN_RuDs
Definition: TEcnaHistos.h:327
TPaveText * SetPaveEvolRuns(const Int_t &, const TString, const Int_t &, const TString, const TString, const TString)
TString fXMemoH_HFN_RuDs
Definition: TEcnaHistos.h:380
Int_t fMemoPlotD_SCs_ChNb
Definition: TEcnaHistos.h:322
Double_t fD_Ped_ChNbYmax
Definition: TEcnaHistos.h:232
TVectorD ReadSampleValues(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1048
Int_t MaxStinVecoInStas()
Color_t GetSCColor(const TString, const TString, const TString)
Int_t fNbOfListFileH_SCs_Date
Definition: TEcnaHistos.h:598
TCanvas * fCanvD_HFN_ChNb
Definition: TEcnaHistos.h:461
void StexTotalNoiseXtals()
TPaveText * fPavTxtH_Ped_Date
Definition: TEcnaHistos.h:535
Double_t fH2CorccInStinsYmin
Definition: TEcnaHistos.h:294
TVectorD ReadSampleSigmas(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1274
TCanvas * fCanvD_Adc_EvNb
Definition: TEcnaHistos.h:468
TString fYMemoD_MCs_ChNb
Definition: TEcnaHistos.h:390
Int_t fNbBinsMemoD_SCs_ChNb
Definition: TEcnaHistos.h:428
Axis_t fH_MCs_RuDsXsup
Definition: TEcnaHistos.h:216
TPaveText * fPavComNbOfEvts
Definition: TEcnaHistos.h:304
Int_t fCanvSameH_HFN_Date
Definition: TEcnaHistos.h:593
TCanvas * fCanvD_HFN_ChDs
Definition: TEcnaHistos.h:462
void EEXtalsAveragedSigmaOfCorss()
void EEGridAxis(const Float_t &, const Float_t &, const Int_t &, const TString, const TString)
void EBEtaPhiAveragedPedestals()
TCanvas * fCanvH_Ped_RuDs
Definition: TEcnaHistos.h:475
TCanvasImp * fImpD_SCs_ChNb
Definition: TEcnaHistos.h:561
void DeeHighFrequencyNoiseXtals()
TString fXMemoH_Ped_RuDs
Definition: TEcnaHistos.h:376
Double_t fD_SCs_ChDsYmin
Definition: TEcnaHistos.h:253
void DeeIXIYPedestals()
Int_t fNbBinsMemoH_SCs_Date
Definition: TEcnaHistos.h:439
Double_t fH_SCs_DateYmax
Definition: TEcnaHistos.h:275
void EEXtalsAveragedLowFrequencyNoise()
TString GetYVarHisto(const TString, const TString, const Int_t &)
Double_t fD_MCs_ChDsYmax
Definition: TEcnaHistos.h:242
void SetColorPalette(const TString)
Int_t fNbBinsMemoD_MCs_ChDs
Definition: TEcnaHistos.h:423
TPaveText * SetPaveCxyz(const Int_t &)
TEcnaHeader * fFileHeader
Definition: TEcnaHistos.h:69
Double_t fD_NOE_ChDsYmin
Definition: TEcnaHistos.h:229
Int_t GetStexStinFromIndex(const Int_t &)
Definition: TEcnaRead.cc:3176
Double_t GetJPhiMin(const Int_t &, const Int_t &)
Double_t fXinf
Definition: TEcnaHistos.h:153
void StasHocoVecoAveragedHighFrequencyNoise()
void EEAveragedSigmaOfCorssXtals()
void ViewStin(const Int_t &, const TString)
TString fHFBetweenStins
Definition: TEcnaHistos.h:146
Axis_t fH_SCs_DateXinf
Definition: TEcnaHistos.h:208
TVirtualPad * fPadD_SCs_ChNb
Definition: TEcnaHistos.h:497
void SetAllYminYmaxMemoFromDefaultValues()
TString fYMemoD_LFN_ChDs
Definition: TEcnaHistos.h:393
Int_t fNbBinsMemoH_TNo_Date
Definition: TEcnaHistos.h:435
Int_t fMemoPlotD_NOE_ChNb
Definition: TEcnaHistos.h:316
void StasHocoVecoAveragedNumberOfEvents()
TString fYMemoD_Ped_ChDs
Definition: TEcnaHistos.h:387
Axis_t fD_NOE_ChNbXsup
Definition: TEcnaHistos.h:162
Int_t fCnaError
Definition: TEcnaHistos.h:51
TEcnaRead * fMyRootFile
Definition: TEcnaHistos.h:71
Int_t fMemoPlotH_SCs_Date
Definition: TEcnaHistos.h:330
Double_t GetYminFromHistoFrameAndMarginValue(TH1D *, const Double_t)
TString fYMemoD_SSp_Samp
Definition: TEcnaHistos.h:399
Int_t fNbBinsMemoH_LFN_RuDs
Definition: TEcnaHistos.h:443
Int_t fCanvSameD_SCs_ChDs
Definition: TEcnaHistos.h:587
Int_t fOptScaleLiny
Definition: TEcnaHistos.h:140
Double_t fD_Adc_EvDsYmin
Definition: TEcnaHistos.h:260
Int_t fMemoPlotD_MSp_Samp
Definition: TEcnaHistos.h:323
TCanvasImp * fImpD_NOE_ChNb
Definition: TEcnaHistos.h:549
TPaveText * fPavTxtD_TNo_ChDs
Definition: TEcnaHistos.h:522
TString fCfgResultsRootFilePath
Definition: TEcnaHistos.h:107
Double_t fD_MCs_ChDsYmin
Definition: TEcnaHistos.h:241
int j
Definition: DBlmapReader.cc:9
TVectorD ReadTotalNoise(const Int_t &)
Definition: TEcnaRead.cc:2433
TString fYMemoH_Ped_RuDs
Definition: TEcnaHistos.h:408
Int_t fNbBinsMemoD_HFN_ChDs
Definition: TEcnaHistos.h:427
TPaveText * fPavComStin
Definition: TEcnaHistos.h:301
void EEIXIYAveragedPedestals()
void FileParameters(const TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
void SMEtaPhiLowFrequencyNoise()
void StexHocoVecoHighFrequencyNoise()
TVectorD ReadAveragedPedestals(const Int_t &)
Definition: TEcnaRead.cc:2768
Double_t fD_Adc_EvDsYmax
Definition: TEcnaHistos.h:261
Bool_t StatusFileFound()
TString fYMemoH_LFN_Date
Definition: TEcnaHistos.h:405
TString fFlagSubDet
Definition: TEcnaHistos.h:58
void StasHocoVecoAveragedSigmaOfCorss()
void EBEtaPhiAveragedNumberOfEvents()
Double_t fH_HFN_DateYmax
Definition: TEcnaHistos.h:273
Int_t fNbBinsMemoH_HFN_Date
Definition: TEcnaHistos.h:438
TString fYMemoH_MCs_RuDs
Definition: TEcnaHistos.h:410
Axis_t fH_HFN_DateXsup
Definition: TEcnaHistos.h:207
void SMEtaPhiHighFrequencyCorcc()
TPaveText * SetOptionSamePaveBorder(const TString, const TString)
Int_t GetDSSCFrom1DeeSCEcna(const Int_t &, const Int_t &, const Int_t &)
TCanvas * fCanvD_LFN_ChDs
Definition: TEcnaHistos.h:460
void DeeTotalNoiseXtals()
void EBEtaPhiAveragedTotalNoise()
TString fFapStexName
Definition: TEcnaHistos.h:100
Int_t fMemoColorH1SamePlus
Definition: TEcnaHistos.h:332
Double_t fH_MCs_DateYmin
Definition: TEcnaHistos.h:268
TVirtualPad * fPadH_LFN_RuDs
Definition: TEcnaHistos.h:512
void EEAveragedMeanOfCorssXtals()
Int_t fNbOfExistingRuns
Definition: TEcnaHistos.h:90
TString fCfgHistoryRunListFilePath
Definition: TEcnaHistos.h:108
void ViewSMTowerNumberingPad(const Int_t &)
Axis_t fD_Ped_ChNbXinf
Definition: TEcnaHistos.h:165
void EEDataSectors(const Float_t &, const Float_t &, const Int_t &, const TString)
TString GetStopDate()
Definition: TEcnaRead.cc:624
TVirtualPad * ActivePad(const TString, const TString)
Float_t AxisTickSize()
Int_t GetNotCompleteSCForConsFromIndex(const Int_t &)
Int_t fNbOfListFileH_LFN_Date
Definition: TEcnaHistos.h:598
void SetAllPavesViewStas()
TPaveText * SetPaveNbOfEvts(const Int_t &, const TString, const TString, const TString)
TPaveText * fPavTxtD_HFN_ChDs
Definition: TEcnaHistos.h:528
Int_t fMemoColorD_HFN_ChDs
Definition: TEcnaHistos.h:338
void EEIXIYAveragedMeanOfCorss()
Axis_t fD_Ped_ChNbXsup
Definition: TEcnaHistos.h:166
TCanvasImp * fImpH_Ped_Date
Definition: TEcnaHistos.h:567
Bool_t fStatusFileFound
Definition: TEcnaHistos.h:112
void DeeXtalsNumberOfEvents()
void XtalLowFrequencyNoiseRuns(const TString, const Int_t &, const Int_t &, const TString)
TString fYMemoH_SCs_Date
Definition: TEcnaHistos.h:407
TCanvasImp * fImpD_Ped_ChNb
Definition: TEcnaHistos.h:551
void SMEtaPhiMeanOfCorss()
TString fXMemoD_TNo_ChDs
Definition: TEcnaHistos.h:357
Axis_t fD_SCs_ChNbXinf
Definition: TEcnaHistos.h:185
Axis_t fH_Ped_DateXsup
Definition: TEcnaHistos.h:199
TVirtualPad * fPadH_SCs_Date
Definition: TEcnaHistos.h:508
Int_t fMemoPlotD_SCs_ChDs
Definition: TEcnaHistos.h:322
Int_t fMemoPlotH_MCs_RuDs
Definition: TEcnaHistos.h:329
void DeeLowFrequencyNoiseXtals()
void ViewDeeSCNumberingPad(const Int_t &)
void SetAllPavesViewMatrix(const TString, const Int_t &, const Int_t &, const Int_t &)
Int_t fCanvSameH_Ped_Date
Definition: TEcnaHistos.h:590
TString fXMemoD_HFN_ChDs
Definition: TEcnaHistos.h:363
Double_t fD_LFN_ChDsYmax
Definition: TEcnaHistos.h:246
TPaveText * fPavComEvolNbOfEvtsAna
Definition: TEcnaHistos.h:309
Double_t BoxRightX(const TString)
Int_t fgMaxCar
Definition: TEcnaHistos.h:47
void PrintNoComment()
Definition: TEcnaRead.cc:3299
Axis_t fD_HFN_ChNbXinf
Definition: TEcnaHistos.h:181
Int_t fNbBinsMemoD_SSp_Samp
Definition: TEcnaHistos.h:431
void EBAveragedNumberOfEventsXtals()
TString fXMemoD_TNo_ChNb
Definition: TEcnaHistos.h:356
Int_t MaxCrysInStin()
TVectorD ReadPedestals(const Int_t &)
Definition: TEcnaRead.cc:2378
TMatrixD ReadLowFrequencyCovariancesBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1576
TString GetCurrentCanvasName()
Int_t fCnew
Definition: TEcnaHistos.h:52
Axis_t fD_Adc_EvNbXinf
Definition: TEcnaHistos.h:196
TString fStopDate
Definition: TEcnaHistos.h:116
Double_t fH_SCs_DateYmin
Definition: TEcnaHistos.h:274
Axis_t fH_Ped_RuDsXsup
Definition: TEcnaHistos.h:212
Int_t fNbBinsMemoH_Ped_Date
Definition: TEcnaHistos.h:434
TString fYMemoD_SCs_ChNb
Definition: TEcnaHistos.h:396
void SetHistoScaleY(const TString)
TPaveText * fPavTxtD_LFN_ChNb
Definition: TEcnaHistos.h:525
Int_t MaxTowEtaInSM()
void SMEtaPhiNumberOfEvents()
Int_t fNbBinsMemoD_MCs_ChNb
Definition: TEcnaHistos.h:422
TPaveText * fPavTxtD_MCs_ChNb
Definition: TEcnaHistos.h:523
Int_t fCanvSameD_MCs_ChDs
Definition: TEcnaHistos.h:584
void SetYVarMemo(const TString, const TString, const TString)
Double_t GetJIYMin(const Int_t &, const Int_t &)
TString fFlagGeneralTitle
Definition: TEcnaHistos.h:131
Int_t MaxSCEcnaInDee()
Bool_t DataExist()
Definition: TEcnaRead.cc:876
Int_t GetDSFrom1DeeSCEcna(const Int_t &, const Int_t &)
TCanvas * fCanvD_Ped_ChNb
Definition: TEcnaHistos.h:453
TString fFlagScaleY
Definition: TEcnaHistos.h:129
Int_t GetListFileNumber(const TString)
Int_t MaxSMEtaInEB()
TCanvasImp * fImpH_MCs_RuDs
Definition: TEcnaHistos.h:575
TPaveText * fPavComEvolRuns
Definition: TEcnaHistos.h:308
TCanvas * fCanvH_SCs_Date
Definition: TEcnaHistos.h:474
void ViewEEGrid(const Int_t &)
Int_t fNbOfListFileH_HFN_RuDs
Definition: TEcnaHistos.h:600
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)
Int_t fNbOfListFileH_Ped_Date
Definition: TEcnaHistos.h:597
Int_t fMemoPlotH_Ped_Date
Definition: TEcnaHistos.h:325
Int_t fNbOfListFileH_Ped_RuDs
Definition: TEcnaHistos.h:599
TString GetYVarFromMemo(const TString, const TString)
TString fXMemoH_HFN_Date
Definition: TEcnaHistos.h:374
TCanvasImp * fImpD_MSp_Samp
Definition: TEcnaHistos.h:563
Int_t fNbBinsMemoD_SCs_ChDs
Definition: TEcnaHistos.h:429
TCanvas * fCanvH_TNo_Date
Definition: TEcnaHistos.h:470
TPaveText * SetPaveCrystal(const Int_t &, const Int_t &, const Int_t &)
TCanvas * fCanvD_NOE_ChDs
Definition: TEcnaHistos.h:452
Int_t GetXCrysInStex(const Int_t &, const Int_t &, const Int_t &)
Int_t fMemoColorD_SCs_ChDs
Definition: TEcnaHistos.h:339
UInt_t SetCanvasWidth(const TString, const TString)
Int_t fMemoPlotD_MCs_ChNb
Definition: TEcnaHistos.h:319
TVirtualPad * fPadH_SCs_RuDs
Definition: TEcnaHistos.h:514
unsigned int UInt_t
Definition: FUTypes.h:12
Definition: adjgraph.h:15
TString fXMemoH_LFN_Date
Definition: TEcnaHistos.h:373
Axis_t fH_LFN_RuDsXinf
Definition: TEcnaHistos.h:217
Double_t fH2LFccMosMatrixYmin
Definition: TEcnaHistos.h:290
Int_t MaxCrysIYInSC()
void XtalMeanOfCorssRuns(const TString, const Int_t &, const Int_t &, const TString)
ifstream fFcin_f
Definition: TEcnaHistos.h:73
void ViewSMGrid(const Int_t &, const TString)
TCanvasImp * fImpD_HFN_ChNb
Definition: TEcnaHistos.h:559
Double_t fD_Ped_ChDsYmin
Definition: TEcnaHistos.h:233
void SMNumberOfEventsXtals()
Float_t DeeOffsetX(const TString, const Int_t &)
TVirtualPad * fPadD_SCs_ChDs
Definition: TEcnaHistos.h:498
TVirtualPad * fPadH_LFN_Date
Definition: TEcnaHistos.h:506
Axis_t fD_HFN_ChDsXsup
Definition: TEcnaHistos.h:184
Axis_t fH_LFN_RuDsXsup
Definition: TEcnaHistos.h:218
Double_t BoxBottomY(const TString)
void SampleADCEvents(const Int_t &, const Int_t &, const Int_t &, const TString)
void StasHocoVecoAveragedMeanOfCorss()
Double_t GetEta(const Int_t &, const Int_t &, const Int_t &)
Int_t Get1SMCrysFrom1SMTowAnd0TowEcha(const Int_t &, const Int_t &)
Axis_t fH_SCs_DateXsup
Definition: TEcnaHistos.h:209
Double_t fD_MCs_ChNbYmin
Definition: TEcnaHistos.h:239
TPaveText * fPavTxtD_SCs_ChNb
Definition: TEcnaHistos.h:529
TMatrixD ReadHighFrequencyCorrelationsBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1784
Int_t fMemoPlotD_Ped_ChDs
Definition: TEcnaHistos.h:317
TVectorD ReadMeanOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2485
Int_t fCanvSameH1SamePlus
Definition: TEcnaHistos.h:580
Int_t fMemoPlotD_TNo_ChDs
Definition: TEcnaHistos.h:318
Int_t fMemoColorH_MCs_Date
Definition: TEcnaHistos.h:346
Axis_t fD_MCs_ChDsXsup
Definition: TEcnaHistos.h:176
TPaveText * fPavTxtH_MCs_RuDs
Definition: TEcnaHistos.h:543
Double_t fH_LFN_DateYmax
Definition: TEcnaHistos.h:271
Int_t MaxCrysInTow()
TCanvasImp * fImpD_TNo_ChNb
Definition: TEcnaHistos.h:553
TPaveText * SetPaveStin(const Int_t &, const Int_t &)
TString GetQuantityName(const TString)
Int_t NumberOfNotConnectedSCs()
TVirtualPad * fPadH_TNo_RuDs
Definition: TEcnaHistos.h:510
void StexXtalsLowFrequencyNoise()
TVectorD ReadHighFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2593
void SetXinfMemoFromValue(const TString, const Double_t &)
void EEAveragedLowFrequencyNoiseXtals()
Double_t GetIEtaMin(const Int_t &, const Int_t &)
Int_t GetIXCrysInSC(const Int_t &, const Int_t &, const Int_t &)
void SetYminMemoFromPreviousMemo(const TString)
TString fXMemoD_LFN_ChNb
Definition: TEcnaHistos.h:360
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 &)
TString GetXVarHisto(const TString, const TString, const Int_t &)
Double_t fH_MCs_RuDsYmax
Definition: TEcnaHistos.h:282
void StinCrystalNumbering(const Int_t &, const Int_t &)
TCanvas * fCanvD_MCs_ChNb
Definition: TEcnaHistos.h:457
Int_t GetYCrysInStex(const Int_t &, const Int_t &, const Int_t &)
TCanvasImp * fImpD_TNo_ChDs
Definition: TEcnaHistos.h:554
Int_t GetMaxSCInDS(const Int_t &)
void CorrelationsBetweenSamples(const Int_t &, const Int_t &, const TString)
void SetAllPavesViewStin(const Int_t &)
void DeeIXIYLowFrequencyCorcc()
Double_t fD_NOE_ChNbYmax
Definition: TEcnaHistos.h:228
TString fYMemoD_NOE_ChNb
Definition: TEcnaHistos.h:384
Int_t MaxStexInStasMinus()
Axis_t fH1SameOnePlotXinf
Definition: TEcnaHistos.h:158
Axis_t fD_TNo_ChNbXsup
Definition: TEcnaHistos.h:170
TString fXMemoH1SamePlus
Definition: TEcnaHistos.h:351
TPaveText * SetPaveStex(const TString, const Int_t &)
Int_t MaxStexInStas()
TEcnaParPaths * fCnaParPaths
Definition: TEcnaHistos.h:64
void EEIXIYAveragedTotalNoise()
Int_t GetSCOffset(const Int_t &, const Int_t &, const Int_t &)
TVirtualPad * fPadH_HFN_Date
Definition: TEcnaHistos.h:507
TPaveText * fPavComSeveralChanging
Definition: TEcnaHistos.h:305
void EBEtaPhiAveragedMeanOfCorss()
TCanvasImp * fImpH_TNo_RuDs
Definition: TEcnaHistos.h:574
TVirtualPad * fPadD_LFN_ChDs
Definition: TEcnaHistos.h:494
void SMTowerNumbering(const Int_t &)
Axis_t fD_MCs_ChNbXinf
Definition: TEcnaHistos.h:173
Double_t fH_Ped_RuDsYmin
Definition: TEcnaHistos.h:277
Double_t fH_HFN_RuDsYmin
Definition: TEcnaHistos.h:285
TCanvas * fCanvD_TNo_ChNb
Definition: TEcnaHistos.h:455
TPaveText * fPavComCxyz
Definition: TEcnaHistos.h:307
Double_t fD_LFN_ChNbYmin
Definition: TEcnaHistos.h:243
TString fXMemoH_MCs_RuDs
Definition: TEcnaHistos.h:378
Int_t fMemoPlotD_SSp_Samp
Definition: TEcnaHistos.h:323
Int_t ModifiedSCEchaForNotConnectedSCs(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Int_t fNbOfListFileH_TNo_RuDs
Definition: TEcnaHistos.h:599
void EEIXIYAveragedHighFrequencyNoise()
TEcnaParEcal * fEcal
Definition: TEcnaHistos.h:67
TString fLFBetweenChannels
Definition: TEcnaHistos.h:145
time_t fStartEvolTime
Definition: TEcnaHistos.h:92
TVirtualPad * fPadD_MSp_Samp
Definition: TEcnaHistos.h:499
void SMHighFrequencyNoiseXtals()
Int_t fCanvSameD_TNo_ChNb
Definition: TEcnaHistos.h:583
Double_t fD_NOE_ChDsYmax
Definition: TEcnaHistos.h:230
void HighFrequencyMeanCorrelationsBetweenSCs(const TString)
Int_t MaxCrysVecoInStex()
TCanvasImp * fImpD_HFN_ChDs
Definition: TEcnaHistos.h:560
TPaveText * fPavTxtD_SSp_Samp
Definition: TEcnaHistos.h:532
Int_t fMemoColorD_HFN_ChNb
Definition: TEcnaHistos.h:338
TString fXMemoD_SSp_Samp
Definition: TEcnaHistos.h:367
Int_t fCanvSameH_SCs_Date
Definition: TEcnaHistos.h:595
Int_t fNbBinsMemoD_Ped_ChDs
Definition: TEcnaHistos.h:419
TString fYMemoD_Adc_EvNb
Definition: TEcnaHistos.h:401
void DeeXtalsSigmaOfCorss()
TString fFlagUserHistoMin
Definition: TEcnaHistos.h:134
Int_t fCanvSameD_HFN_ChDs
Definition: TEcnaHistos.h:586
void ViewStexGrid(const Int_t &, const TString)
void LowFrequencyMeanCorrelationsBetweenTowers(const TString)
void SMTotalNoiseXtals()
Int_t GetNbBinsFromMemo(const TString, const TString)
Double_t fH_TNo_RuDsYmax
Definition: TEcnaHistos.h:280
Int_t MaxSCForConsInDee()
void DeeXtalsPedestals()
Int_t fOptScaleLogy
Definition: TEcnaHistos.h:140
void SMSigmaOfCorssXtals()
TString GetMemoFlag(const TString)
void WriteHistoAscii(const TString, const Int_t &, const TVectorD &)
void DeeSigmaOfCorssXtals()
void ViewSCGrid(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString)
Int_t GetJYCrysInSC(const Int_t &, const Int_t &, const Int_t &)
void SqrtContourLevels(const Int_t &, Double_t *)
TCanvasImp * fImpH_SCs_Date
Definition: TEcnaHistos.h:572
Int_t fMemoPlotD_LFN_ChDs
Definition: TEcnaHistos.h:320
void SMXtalsNumberOfEvents()
TString ResultsRootFilePath()
TString SetHistoYAxisTitle(const TString)
Int_t fCanvSameH_Ped_RuDs
Definition: TEcnaHistos.h:590
Double_t GetYminValueFromMemo(const TString)
void SMXtalsTotalNoise()
void EBEtaPhiAveragedHighFrequencyNoise()
Int_t GetNbOfRunsDisplayed()
Int_t GetYSampInStin(const Int_t &, const Int_t &, const Int_t &, const Int_t &)
void StexXtalsHighFrequencyNoise()
TPaveText * fPavTxtD_NOE_ChNb
Definition: TEcnaHistos.h:517
Double_t GetPhi(const Int_t &, const Int_t &, const Int_t &)
Int_t fNbBinsMemoD_Ped_ChNb
Definition: TEcnaHistos.h:418
Int_t fCanvSameD_Adc_EvDs
Definition: TEcnaHistos.h:589
TString fCurrentCanvasName
Definition: TEcnaHistos.h:447
TCanvas * fCanvD_TNo_ChDs
Definition: TEcnaHistos.h:456
TString fYMemoD_LFN_ChNb
Definition: TEcnaHistos.h:392
void SetAllPavesViewHisto(const TString, const Int_t &, const Int_t &, const Int_t &, const TString)
void EEIXIYAveragedLowFrequencyNoise()
TCanvas * fCanvH_LFN_Date
Definition: TEcnaHistos.h:472
Int_t MaxCrysEcnaInStex()
Int_t fNbBinsMemoD_MSp_Samp
Definition: TEcnaHistos.h:430
void EBXtalsAveragedMeanOfCorss()
void HighFrequencyMeanCorrelationsBetweenTowers(const TString)
TString fFapEchaName
Definition: TEcnaHistos.h:102
Double_t fH_MCs_RuDsYmin
Definition: TEcnaHistos.h:281
Int_t GetHistoryRunListParameters(const TString, const TString)
Int_t fCdelete
Definition: TEcnaHistos.h:52
TCanvasImp * fImpD_MCs_ChDs
Definition: TEcnaHistos.h:556
TPaveText * fPavTxtD_MCs_ChDs
Definition: TEcnaHistos.h:524
void EEXtalsAveragedHighFrequencyNoise()
Int_t GetDSOffset(const Int_t &, const Int_t &)
TString GetSCType(const Int_t &)
void EEXtalsAveragedPedestals()
TVirtualPad * fPadH1SamePlus
Definition: TEcnaHistos.h:484
void EEXtalsAveragedNumberOfEvents()
TString GetRunType()
Definition: TEcnaRead.cc:625
Int_t fMemoPlotH_Ped_RuDs
Definition: TEcnaHistos.h:325
void StexPedestalsXtals()
TPaveText * SetPaveCrystalSample(const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Axis_t fD_LFN_ChDsXinf
Definition: TEcnaHistos.h:179
Int_t fMemoColorD_NOE_ChDs
Definition: TEcnaHistos.h:333
TCanvas * GetCurrentCanvas()
Int_t MaxCrysHocoInStin()
Int_t fMemoPlotH_SCs_RuDs
Definition: TEcnaHistos.h:330
TVirtualPad * fCurrentPad
Definition: TEcnaHistos.h:482
void SetViewHistoStyle(const TString)
TCanvas * fCanvD_MCs_ChDs
Definition: TEcnaHistos.h:458
Int_t fMemoColorD_Adc_EvDs
Definition: TEcnaHistos.h:341
Int_t fCanvSameD_Ped_ChNb
Definition: TEcnaHistos.h:582
TVirtualPad * fPadD_Adc_EvDs
Definition: TEcnaHistos.h:501
TString AsciiFileName()
void SetViewHistoOffsets(TH1D *, const TString, const TString)
Axis_t fD_LFN_ChNbXinf
Definition: TEcnaHistos.h:177
Double_t fH_LFN_RuDsYmax
Definition: TEcnaHistos.h:284
Int_t MaxCrysInSC()
void StexMeanOfCorssXtals()
Int_t MaxSampADC()
TString fHFBetweenChannels
Definition: TEcnaHistos.h:145
Int_t GetNotConnectedSCForConsFromIndex(const Int_t &)
Axis_t fD_MCs_ChDsXinf
Definition: TEcnaHistos.h:175
void SMXtalsSigmaOfCorss()
TCanvas * fCanvD_LFN_ChNb
Definition: TEcnaHistos.h:459
void SMLowFrequencyNoiseXtals()
Int_t fStartEvolRun
Definition: TEcnaHistos.h:89
void HighFrequencyMeanCorrelationsBetweenStins(const TString)
Int_t fTextPaveFont
Definition: TEcnaHistos.h:149
void ViewStinGrid(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TString)
Double_t BoxLeftX(const TString)
TString fXMemoH_LFN_RuDs
Definition: TEcnaHistos.h:379
TString fLFBetweenStins
Definition: TEcnaHistos.h:146
TPaveText * SetPaveEvolNbOfEvtsAna(const TString, const Int_t &, const Int_t &, const Int_t &, const TString)
TString fYMemoD_HFN_ChNb
Definition: TEcnaHistos.h:394
void SetViewHistoStats(TH1D *, const TString)
void SMMeanOfCorssXtals()
Int_t MaxDeeInEE()
Int_t fCanvSameH_LFN_RuDs
Definition: TEcnaHistos.h:592
Axis_t fH_TNo_DateXsup
Definition: TEcnaHistos.h:201
TMatrixD ReadCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1466
TPaveText * SetPaveGeneralComment(const TString)
TPaveText * fPavTxtD_SCs_ChDs
Definition: TEcnaHistos.h:530
void SetAllPavesViewStex(const TString, const Int_t &)
TVectorD ReadAveragedNumberOfEvents(const Int_t &)
Definition: TEcnaRead.cc:2708
TString fAsciiFileName
Definition: TEcnaHistos.h:110
Int_t GetNumberOfEvents(TEcnaRead *, const Int_t &)
Int_t fMemoPlotD_Ped_ChNb
Definition: TEcnaHistos.h:317
TVectorD ReadAveragedHighFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2933
Int_t GetIXCrysInDee(const Int_t &, const Int_t &, const Int_t &)
Int_t MaxSMInEB()
void EBXtalsAveragedNumberOfEvents()
Int_t fMemoPlotH1SamePlus
Definition: TEcnaHistos.h:315
TString fYMemoH_SCs_RuDs
Definition: TEcnaHistos.h:413
TPaveText * fPavTxtD_TNo_ChNb
Definition: TEcnaHistos.h:521
TCanvas * fCanvH_MCs_Date
Definition: TEcnaHistos.h:471
void SMXtalsLowFrequencyNoise()
Int_t fMemoColorH_TNo_RuDs
Definition: TEcnaHistos.h:343
void WriteAsciiCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1271
TPaveText * ActivePavTxt(const TString, const TString)
TPaveText * fPavTxtH_HFN_Date
Definition: TEcnaHistos.h:539
TString fXMemoD_HFN_ChNb
Definition: TEcnaHistos.h:362
TString fMyRootFileName
Definition: TEcnaHistos.h:105
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
Double_t GetMarginAutoMinMax()
Int_t fNbBinsMemoD_NOE_ChDs
Definition: TEcnaHistos.h:417
TPaveText * fPavTxtD_Adc_EvDs
Definition: TEcnaHistos.h:533
Int_t GetXStinInStas(const Int_t &, const Int_t &, const Int_t &)
void TopAxisForHistos(TH1D *, const TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Bool_t LookAtRootFile()
Definition: TEcnaRead.cc:675
Double_t GetIEtaMax(const Int_t &, const Int_t &)
void DeeIXIYHighFrequencyCorcc()
TString GetStexHalfStas(const Int_t &)
void SMEtaPhiSigmaOfCorss()
TString GetHistoType(const TString)
void EEAveragedPedestalsXtals()
void SetXVarMemo(const TString, const TString, const TString)
Double_t NotConnectedSCH1DBin(const Int_t &)
TVirtualPad * fPadD_TNo_ChNb
Definition: TEcnaHistos.h:489
TString fOnlyOnePlot
Definition: TEcnaHistos.h:311
Int_t fCanvSameH_SCs_RuDs
Definition: TEcnaHistos.h:595
void WriteAsciiHisto(const TString, const Int_t &, const TVectorD &)
Definition: TEcnaWrite.cc:1024
Double_t GetYminDefaultValue(const TString)
void SetViewGraphOffsets(TGraph *, const TString)
tuple cout
Definition: gather_cfg.py:41
Double_t fD_SCs_ChDsYmax
Definition: TEcnaHistos.h:254
TString GetEEDeeEndcap(const Int_t &)
Int_t MaxStinEcnaInStex()
TString fFapStexBarrel
Definition: TEcnaHistos.h:95
Int_t fNbBinsMemoD_LFN_ChNb
Definition: TEcnaHistos.h:424
Axis_t fD_NOE_ChNbXinf
Definition: TEcnaHistos.h:161
TCanvasImp * fImpH_HFN_Date
Definition: TEcnaHistos.h:571
void StexHocoVecoPedestals()
TMatrixD ReadHighFrequencyCovariancesBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1715
TString fFapStinQuadType
Definition: TEcnaHistos.h:98
Axis_t fD_HFN_ChDsXinf
Definition: TEcnaHistos.h:183
Double_t fYinf
Definition: TEcnaHistos.h:153
Double_t GetYminFromGraphFrameAndMarginValue(TGraph *, const Double_t)
TString GetEcalSubDetector()
void DeeIXIYTotalNoise()
void SetHistoPresentation(TH1D *, const TString)
Axis_t fH_HFN_RuDsXinf
Definition: TEcnaHistos.h:219
Int_t fNbBinsMemoH_MCs_RuDs
Definition: TEcnaHistos.h:442
void EEIXIYAveragedNumberOfEvents()
TVectorD ReadAveragedLowFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2878
TCanvas * fCanvD_SCs_ChNb
Definition: TEcnaHistos.h:463
TVirtualPad * fPadH_TNo_Date
Definition: TEcnaHistos.h:504
Axis_t fH_MCs_DateXinf
Definition: TEcnaHistos.h:202
void DeeIXIYNumberOfEvents()
Axis_t GetHistoXinf(const TString, const Int_t &, const TString)
Int_t GetMaxNbOfColors()
TString fYMemoD_TNo_ChNb
Definition: TEcnaHistos.h:388
Axis_t fD_TNo_ChDsXsup
Definition: TEcnaHistos.h:172
void ViewHisto(const Int_t &, const Int_t &, const Int_t &, const TString, const TString)
void HighFrequencyCorrelationsBetweenChannels(const Int_t &, const Int_t &, const TString)
void DeeNumberOfEventsXtals()
void HighFrequencyCovariancesBetweenChannels(const Int_t &, const Int_t &, const TString)
Int_t fNbOfListFileH_MCs_RuDs
Definition: TEcnaHistos.h:599
void XtalTotalNoiseRuns(const TString, const Int_t &, const Int_t &, const TString)
Double_t fD_Adc_EvNbYmax
Definition: TEcnaHistos.h:263
Double_t fH2HFccMosMatrixYmin
Definition: TEcnaHistos.h:292
Int_t MaxStinHocoInStex()
void XtalSamplesSigma(const Int_t &, const Int_t &, const TString)
TCanvasImp * fImpH_LFN_RuDs
Definition: TEcnaHistos.h:576
void EBAveragedLowFrequencyNoiseXtals()
TVirtualPad * fPadD_MCs_ChNb
Definition: TEcnaHistos.h:491
void DeeIXIYSigmaOfCorss()
TString GetJYDirectionEE(const Int_t &)
TCanvasImp * fImpD_SCs_ChDs
Definition: TEcnaHistos.h:562
TPaveText * fPavTxtD_LFN_ChDs
Definition: TEcnaHistos.h:526
Int_t NumberOfNotCompleteSCs()
Axis_t fD_LFN_ChDsXsup
Definition: TEcnaHistos.h:180
void ViewStasGrid(const Int_t &)
TCanvasImp * fImpH_LFN_Date
Definition: TEcnaHistos.h:570
Int_t fNbOfListFileH_LFN_RuDs
Definition: TEcnaHistos.h:600
Int_t Get1StexCrysFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &, const Int_t &)
Int_t fNbOfListFileH_HFN_Date
Definition: TEcnaHistos.h:598
TCanvasImp * fImpD_MCs_ChNb
Definition: TEcnaHistos.h:555
TString GetXDirectionEB(const Int_t &)
TString fXMemoD_Ped_ChNb
Definition: TEcnaHistos.h:354
Double_t fD_Ped_ChDsYmax
Definition: TEcnaHistos.h:234
Double_t NotCompleteSCH1DBin(const Int_t &)
TVectorD ReadSampleMeans(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1215
TEcnaParHistos * fCnaParHistos
Definition: TEcnaHistos.h:63
Int_t fNbBinsProj
Definition: TEcnaHistos.h:349
TString fXMemoD_LFN_ChDs
Definition: TEcnaHistos.h:361
Axis_t fH_Ped_DateXinf
Definition: TEcnaHistos.h:198
Float_t AxisLabelSize()
TString fFlagUserHistoMax
Definition: TEcnaHistos.h:134
Axis_t fH_LFN_DateXsup
Definition: TEcnaHistos.h:205
Axis_t fD_SCs_ChDsXsup
Definition: TEcnaHistos.h:188
TPaveText * SetPaveStas()
Int_t MaxCrysForConsInDee()
void FillHisto(TH1D *, const TVectorD &, const TString, const Int_t &)
TString fXMemoD_SCs_ChDs
Definition: TEcnaHistos.h:365
Int_t fCanvSameD_SSp_Samp
Definition: TEcnaHistos.h:588
void LowFrequencyCovariancesBetweenChannels(const Int_t &, const Int_t &, const TString)
Double_t BoxTopY(const TString)
Double_t fH_SCs_RuDsYmax
Definition: TEcnaHistos.h:288
Int_t fNbBinsMemoD_NOE_ChNb
Definition: TEcnaHistos.h:416
void SetNbBinsMemo(const TString, const TString, const Int_t &)
void XtalSampleValues(const Int_t &, const Int_t &, const Int_t &, const TString)
Double_t fH_Ped_DateYmin
Definition: TEcnaHistos.h:264
Int_t fMemoPlotD_Adc_EvDs
Definition: TEcnaHistos.h:324
Int_t MaxTowInSM()
Bool_t StatusDataExist()
void SMPedestalsXtals()
Color_t SetColorsForNumbers(const TString)
Int_t fMemoColorD_Ped_ChNb
Definition: TEcnaHistos.h:334
TString fXMemoD_Adc_EvDs
Definition: TEcnaHistos.h:368
time_t GetStartTime()
Definition: TEcnaRead.cc:621
TVectorD ReadNumberOfEvents(const Int_t &)
Definition: TEcnaRead.cc:2338
Double_t fD_NOE_ChNbYmin
Definition: TEcnaHistos.h:227
Axis_t fD_NOE_ChDsXinf
Definition: TEcnaHistos.h:163
void PlotCloneOfCurrentCanvas()
Int_t fMemoColorD_LFN_ChNb
Definition: TEcnaHistos.h:337
TVirtualPad * fPadD_Adc_EvNb
Definition: TEcnaHistos.h:502
void XtalTimeLowFrequencyNoise(const TString, const Int_t &, const Int_t &, const TString)
void XtalTimeSigmaOfCorss(const TString, const Int_t &, const Int_t &, const TString)
UInt_t CanvasFormatH(const TString)
Axis_t fD_MCs_ChNbXsup
Definition: TEcnaHistos.h:174
TCanvas * fCanvH_LFN_RuDs
Definition: TEcnaHistos.h:478
time_t fStartTime
Definition: TEcnaHistos.h:115
Int_t fMemoPlotD_HFN_ChNb
Definition: TEcnaHistos.h:321
Int_t fMemoPlotH_HFN_RuDs
Definition: TEcnaHistos.h:328
Double_t fH_SCs_RuDsYmin
Definition: TEcnaHistos.h:287
TString fYMemoD_NOE_ChDs
Definition: TEcnaHistos.h:385
TVirtualPad * fPadD_Ped_ChDs
Definition: TEcnaHistos.h:488
Int_t fFapReqNbOfEvts
Definition: TEcnaHistos.h:80
TCanvas * fCanvH_TNo_RuDs
Definition: TEcnaHistos.h:476
Double_t fD_MCs_ChNbYmax
Definition: TEcnaHistos.h:240
Int_t GetHistoSize(const TString, const TString)
TString fYMemoH_TNo_RuDs
Definition: TEcnaHistos.h:409
Int_t fCanvSameD_Ped_ChDs
Definition: TEcnaHistos.h:582
void EBXtalsAveragedHighFrequencyNoise()