CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TEcnaRead.cc
Go to the documentation of this file.
1 //----------Author's Name: B.Fabbro, FX Gentit DSM/IRFU/SPP CEA-Saclay
2 //----------Copyright: Those valid for CEA sofware
3 //----------Modified: 08/04/2010
4 
6 
8 
9 ClassImp(TEcnaRead)
10 //___________________________________________________________________________
11 //
12 // TEcnaRead.
13 //==============> INTRODUCTION
14 //
15 // This class allows the user to read the .root results files (containing
16 // expectation values, variances, covariances, correlations and other
17 // quantities of interest) previously computed by the class TEcnaRun.
18 // (see documentation of this class)
19 //
20 //==============> PRELIMINARY REMARK
21 //
22 // The user is not obliged to use directly this class. Another class
23 // named TEcnaHistos can be used to make plots of the results computed
24 // previously by means of the class TEcnaRun. The class TEcnaHistos
25 // calls TEcnaRead and manage the reading of the .root result files.
26 // (see the documentation of the class TEcnaHistos)
27 //
28 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
29 //
30 // Class TEcnaRead *** I N S T R U C T I O N S F O R U S E ***
31 //
32 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33 //
34 // //==============> TEcnaRead DECLARATION
35 //
36 // // The declaration is done by calling the constructor without argument:
37 //
38 // TEcnaRead* MyCnaRead = new TEcnaRead();
39 //
40 // //==============> PREPARATION METHOD GetReadyToReadRootFile(...)
41 //
42 // // There is a preparation method named: GetReadyToReadRootFile(...);
43 //
44 // // GetReadyToReadRootFile(...) is used to read the quantities written
45 // // in the ROOT files in order to use these quantities for analysis.
46 //
47 // //....... Example of program using GetReadyToReadRootFile(...)
48 //
49 // // This example describes the reading of one result file. This file is in a
50 // // directory which name is given by the contents of a TString named PathForRootFile
51 //
52 // //................ Set values for the arguments and call to the method
53 //
54 // TString AnalysisName = "AdcPed12"
55 // Int_t RunNumber = 22770;
56 // Int_t FirstReqEvtNumber = 0;
57 // Int_t LastReqEvtNumber = 150;
58 // Int_t NbOfEvts = 150;
59 // TString PathForRootFile = "/afs/cern.ch/etc..." // .root result files directory
60 //
61 // TEcnaRead* MyCnaRead = new TEcnaRead();
62 // MyCnaRead->GetReadyToReadRootFile(AnalysisName, RunNumber,
63 // FirstReqEvtNumber, LastReqEvtNumber, ReqNbOfEvts, Stex,
64 // PathForRootFile);
65 //
66 // //==============> CALL TO THE METHOD: Bool_t LookAtRootFile() (MANDATORY)
67 //
68 // // This methods returns a boolean. It tests the existence
69 // // of the ROOT file corresponding to the argument values given
70 // // in the call to the method GetReadyToReadRootFile(...).
71 // // It is recommended to test the return value of the method.
72 //
73 // //....... Example of use:
74 //
75 // if( MyCnaRead->LookAtRootFile() == kFALSE )
76 // {
77 // cout << "*** ERROR: ROOT file not found" << endl;
78 // }
79 // else
80 // {
81 // //........... The ROOT file exists and has been found
82 // //
83 // //---> CALLS TO THE METHODS WHICH RECOVER THE QUANTITIES. EXAMPLE:
84 // // (see the complete list of the methods hereafter)
85 //
86 // Int_t MaxSamples = 10;
87 // TMatrixD CorMat(MaxSamples,MaxSamples);
88 // Int_t smStin = 59;
89 // Int_t i0StinEcha = 4;
90 // CorMat = MyCnaRead->ReadCorrelationsBetweenSamples(smStin,i0StinEcha);
91 // :
92 // (Analysis of the correlations, etc...)
93 // :
94 // }
95 //
96 //******************************************************************************
97 //
98 // *=======================*
99 // | DETAILLED DESCRIPTION |
100 // *=======================*
101 //
102 
103 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
104 //
105 // Method GetReadyToReadRootFile(...) and associated methods
106 //
107 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
108 //
109 // TEcnaRead* MyCnaRead = new TEcnaRead(); // declaration of the object MyCnaRead
110 //
111 // MyCnaRead->GetReadyToReadRootFile(AnalysisName, RunNumber, NbOfSamples
112 // FirstReqEvtNumber, LastReqEvtNumber, ReqEvtNumber, Stexumber,
113 // PathForRootFile);
114 //
115 // Arguments:
116 //
117 // TString AnalysisName: code for the analysis. This code is
118 // necessary to distinguish between different
119 // analyses on the same events of a same run
120 // (example: pedestal run for the 3 gains:
121 // AnalysisName = "Ped1" or "Ped6" or "Ped12")
122 // The string AnalysisName is automatically
123 // included in the name of the results files
124 // (see below: results files paragraph)
125 //
126 // Int_t NbOfSamples number of samples (=10 maximum)
127 // Int_t RunNumber: run number
128 // Int_t FirstReqEvtNumber: first requested event number (numbering starting from 1)
129 // Int_t LastReqEvtNumber: last requested event number
130 // Int_t StexNumber: SM or Dee number (Stex = SM if EB, Dee if EE)
131 //
132 //
133 // TString PathForRootFile: Path of the directory containing the ROOT file.
134 // The path must be complete: /afs/cern.ch/user/... etc...
135 //
136 //==============> METHODS TO RECOVER THE QUANTITIES FROM THE ROOT FILE
137 //
138 // SM = SuperModule (EB) equivalent to a Dee (EE)
139 // SC = SuperCrystal (EE) equivalent to a Tower (EB)
140 //
141 // Stex = SM in case of EB , Dee in case of EE
142 // Stin = Tower in case of EB , SC in case of EE
143 //
144 // n1StexStin = Stin# in Stex = Tower number in SM (RANGE = [1,68]) .OR. SC number in Dee (RANGE = [1,149])
145 // i0StexEcha = Channel# in Stex = Electronic channel number in SM (RANGE = [0,1699]) .OR. in Dee (RANGE = [0,3724])
146 // i0StinEcha = Channel# in Stin = Electronic channel number in tower (RANGE = [0,24]) .OR. in SC (RANGE = [0,24])
147 //
148 // MaxCrysInStin = Maximum number of Xtals in a tower or a SC (25)
149 // MaxCrysEcnaInStex = Maximum number of Xtals in SM (1700) or in the matrix including Dee (5000)
150 // MaxStinEcnaInStex = Maximum number of towers in SM (68) or in the matrix including Dee (200)
151 // MaxSampADC = Maximum number of samples (10)
152 // NbOfSample = Number of samples used to perform the calculations
153 // (example: for the 3 first samples, NbOfSample = 3)
154 //
155 //
156 // TVectorD and TMatrixD sizes are indicated after the argument lists or at the beginning of method sub-lists
157 //
158 //
159 // TMatrixD ReadNumberOfEventsForSamples
160 // (const Int_t& n1StexStin, const Int_t& MaxCrysInStin, const Int_t& NbOfSamples); // TMatrixD(MaxCrysInStin,NbOfSamples)
161 //
162 // TVectorD ReadSampleValues
163 // (const Int_t& i0StexEcha, const Int_t& sample, const Int_t& NbOfReqEvts) // TVectorD(Nb of requested evts)
164 //
165 // TVectorD ReadSampleMeans
166 // (const Int_t& n1StexStin, const Int_t& i0StinEcha, const Int_t& NbOfSamples); // TVectorD(NbOfSamples)
167 // TVectorD ReadSampleSigmas
168 // (const Int_t& n1StexStin, const Int_t& i0StinEcha, const Int_t& NbOfSamples); // TVectorD(NbOfSamples)
169 // TVectorD ReadSigmasOfSamples
170 // (const Int_t& n1StexStin, const Int_t& i0StinEcha, const Int_t& NbOfSamples); // TVectorD(NbOfSamples)
171 //
172 // TMatrixD ReadCovariancesBetweenSamples
173 // (const Int_t& n1StexStin, const Int_t& i0StinEcha); // TMatrixD(NbOfSamples,NbOfSamples)
174 // TMatrixD ReadCorrelationsBetweenSamples
175 // (const Int_t& n1StexStin, const Int_t& i0StinEcha); // TMatrixD(NbOfSamples,NbOfSamples)
176 //
177 // ----------------------------------------------------------- TMatrixD(MaxCrysInStin, MaxCrysInStin)
178 // TMatrixD ReadLowFrequencyCovariancesBetweenChannels
179 // (const Int_t& n1StexStin_X, const Int_t& n1StexStin_Y, const Int_t& MaxCrysInStin);
180 //
181 // TMatrixD ReadLowFrequencyCorrelationsBetweenChannels
182 // (const Int_t& n1StexStin_X, const Int_t& n1StexStin_Y, const Int_t& MaxCrysInStin);
183 //
184 // TMatrixD ReadHighFrequencyCovariancesBetweenChannels
185 // (const Int_t& n1StexStin_X, const Int_t& n1StexStin_Y, const Int_t& MaxCrysInStin);
186 // TMatrixD ReadHighFrequencyCorrelationsBetweenChannels
187 // (const Int_t& n1StexStin_X, const Int_t& n1StexStin_Y, const Int_t& MaxCrysInStin);
188 //
189 // ----------------- TMatrixD(MaxCrysEcnaInStex, MaxCrysEcnaInStex) (BIG!: 1700x1700 for EB and 5000x5000 for EE)
190 // TMatrixD ReadLowFrequencyCovariancesBetweenChannels(const Int_t& MaxCrysEcnaInStex);
191 // TMatrixD ReadLowFrequencyCorrelationsBetweenChannels(const Int_t& MaxCrysEcnaInStex);
192 //
193 // TMatrixD ReadHighFrequencyCovariancesBetweenChannels(const Int_t& MaxCrysEcnaInStex);
194 // TMatrixD ReadHighFrequencyCorrelationsBetweenChannels(const Int_t& MaxCrysEcnaInStex);
195 //
196 // ---------------------------------------------------- TMatrixD(MaxStinEcnaInStex, MaxStinEcnaInStex)
197 // TMatrixD ReadLowFrequencyMeanCorrelationsBetweenStins(const Int_t& MaxStinEcnaInStex);
198 // TMatrixD ReadHighFrequencyMeanCorrelationsBetweenStins(const Int_t& MaxStinEcnaInStex);
199 //
200 // ---------------------------------------------------------------------------------------------------------------
201 // TVectorD ReadPedestals(const Int_t& MaxCrysEcnaInStex); // TVectorD(MaxCrysEcnaInStex)
202 // TVectorD ReadTotalNoise(const Int_t& MaxCrysEcnaInStex); // TVectorD(MaxCrysEcnaInStex)
203 // TVectorD ReadMeanOfCorrelationsBetweenSamples(const Int_t& MaxCrysEcnaInStex); // TVectorD(MaxCrysEcnaInStex)
204 //
205 // TVectorD ReadLowFrequencyNoise(const Int_t& MaxCrysEcnaInStex); // TVectorD(MaxCrysEcnaInStex)
206 // TVectorD ReadHighFrequencyNoise(const Int_t& MaxCrysEcnaInStex); // TVectorD(MaxCrysEcnaInStex)
207 // TVectorD ReadSigmaOfCorrelationsBetweenSamples(const Int_t& MaxCrysEcnaInStex); // TVectorD(MaxCrysEcnaInStex)
208 //
209 //----------------------------------------------------------------------------------------------------------------
210 // TString GetStartDate()
211 // TString GetStopDate()
212 // TString GetRunType()
213 // Int_t GetFirstReqEvtNumber();
214 // Int_t GetReqNbOfEvts();
215 //
216 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
217 //
218 // Print Methods
219 //
220 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
221 //
222 // Just after the declaration with the constructor without arguments,
223 // you can set a "Print Flag" by means of the following "Print Methods":
224 //
225 // TEcnaRead* MyCnaRead = new TEcnaRead(); // declaration of the object MyCnaRead
226 //
227 // // Print Methods:
228 //
229 // MyCnaRead->PrintNoComment(); // Set flag to forbid printing of all the comments
230 // // except ERRORS.
231 //
232 // MyCnaRead->PrintWarnings(); // (DEFAULT)
233 // // Set flag to authorize printing of some warnings.
234 // // WARNING/INFO: information on something unusual
235 // // in the data.
236 // // WARNING/CORRECTION: something wrong (but not too serious)
237 // // in the value of some argument.
238 // // Automatically modified to a correct value.
239 //
240 // MyCnaRead->PrintComments(); // Set flag to authorize printing of infos
241 // // and some comments concerning initialisations
242 //
243 // MyCnaRead->PrintAllComments(); // Set flag to authorize printing of all the comments
244 //
245 //-------------------------------------------------------------------------
246 //
247 // For more details on other classes of the CNA package:
248 //
249 // http://www.cern.ch/cms-fabbro/cna
250 //
251 //-------------------------------------------------------------------------
252 //
253 //------------------------------ TEcnaRead.cxx -----------------------------
254 //
255 // Creation (first version): 03 Dec 2002
256 //
257 // For questions or comments, please send e-mail to Bernard Fabbro:
258 //
259 // fabbro@hep.saclay.cea.fr
260 //
261 //------------------------------------------------------------------------
262 
264 {
265 //Constructor without argument
266 
267  // cout << "[Info Management] CLASS: TEcnaRead. CREATE OBJECT: this = " << this << endl;
268 
269  Init();
270 }
271 
272 TEcnaRead::TEcnaRead(const TString SubDet,
273  const TEcnaParPaths* pCnaParPaths,
274  const TEcnaParCout* pCnaParCout,
275  const TEcnaHeader* pFileHeader,
276  const TEcnaNumbering* pEcalNumbering,
277  const TEcnaWrite* pCnaWrite)
278 {
279 //Constructor with argument
280 
281  // cout << "[Info Management] CLASS: TEcnaRead. CREATE OBJECT: this = " << this << endl;
282 
283  fCnaParPaths = 0;
284  if( pCnaParPaths == 0 )
285  {fCnaParPaths = new TEcnaParPaths(); /* Anew("fCnaParPaths");*/ }
286  else
287  {fCnaParPaths = (TEcnaParPaths*)pCnaParPaths;}
288 
289  fCnaParCout = 0;
290  if( pCnaParCout == 0 )
291  {fCnaParCout = new TEcnaParCout(); /*Anew("fCnaParCout");*/ }
292  else
293  {fCnaParCout = (TEcnaParCout*)pCnaParCout;}
294 
295  fFileHeader = 0;
296  if( pFileHeader == 0 )
297  {
298  const Text_t *h_name = "CnaHeader"; //==> voir cette question avec FXG
299  const Text_t *h_title = "CnaHeader"; //==> voir cette question avec FXG
300  fFileHeader = new TEcnaHeader(h_name, h_title); // Anew("fFileHeader");
301  }
302  else
303  {fFileHeader = (TEcnaHeader*)pFileHeader;}
304 
305  Init();
306  SetEcalSubDetector(SubDet.Data(), pEcalNumbering, pCnaWrite);
307 }
308 
310 {
311 //Initialisation concerning the ROOT file
312 
313  fCnew = 0;
314  fCdelete = 0;
315 
316  fTTBELL = '\007';
317 
318  fgMaxCar = (Int_t)512;
319 
324 
325  //.................................. Set flag print to "Warnings" (Init)
327 
328  fUserSamp = -1;
329  fUserChan = -1;
330 
331  fSectChanSizeX = 0;
332  fSectChanSizeY = 0;
333  fSectSampSizeX = 0;
334  fSectSampSizeY = 0;
335 
336  //.................................. Flags for Root File (Init)
337  fOpenRootFile = kFALSE;
338 
340  fLookAtRootFile = 0;
341 
343 
344  //................................ tags Stin numbers
345  fTagStinNumbers = 0;
346  fMemoStinNumbers = 0;
347 
348  //.......................... flag data exist
349  fDataExist = kFALSE;
350 
351  //......................... transfert Sample ADC Values 3D array (Init)
352  fT3d_distribs = 0;
353  fT3d2_distribs = 0;
354  fT3d1_distribs = 0;
355 
356  //................................. others
357  Int_t MaxCar = fgMaxCar;
358 
359  MaxCar = fgMaxCar;
360  fPathRoot.Resize(MaxCar);
361  fPathRoot = "fPathRoot> not defined";
362 
363 }// end of Init()
364 
365 //============================================================================================================
366 void TEcnaRead::SetEcalSubDetector(const TString SubDet,
367  const TEcnaNumbering* pEcalNumbering,
368  const TEcnaWrite* pCnaWrite)
369 {
370  // Set Subdetector (EB or EE)
371 
372  fEcal = 0; fEcal = new TEcnaParEcal(SubDet.Data()); // Anew("fEcal");
373  Int_t MaxCar = fgMaxCar;
374  fFlagSubDet.Resize(MaxCar);
376 
377  if( fFlagSubDet == "EB" ){fStexName = "SM"; fStinName = "tower";}
378  if( fFlagSubDet == "EE" ){fStexName = "Dee"; fStinName = "SC";}
379 
380  fEcalNumbering = 0;
381  if( pEcalNumbering == 0 )
382  {fEcalNumbering = new TEcnaNumbering(fFlagSubDet.Data(), fEcal); /*Anew("fEcalNumbering")*/ ;}
383  else
384  {fEcalNumbering = (TEcnaNumbering*)pEcalNumbering;}
385 
386  fCnaWrite = 0;
387  if( pCnaWrite == 0 )
388  {fCnaWrite =
389  new TEcnaWrite(fFlagSubDet.Data(), fCnaParPaths, fCnaParCout, fEcal, fEcalNumbering); /*Anew("fCnaWrite")*/ ;}
390  else
391  {fCnaWrite = (TEcnaWrite*)pCnaWrite;}
392 }
393 //============================================================================================================
394 void TEcnaRead::Anew(const TString VarName)
395 {
396  // allocation survey for new
397 
398  fCnew++;
399  // cout << "TEcnaRead::Anew---> new " << setw(4) << fCnew << " --------------> " << setw(25)
400  // << VarName.Data() << " / object(this): " << this << endl;
401 }
402 
403 void TEcnaRead::Adelete(const TString VarName)
404 {
405  // allocation survey for delete
406 
407  fCdelete++;
408  // cout << "TEcnaRead::Adelete> ========== delete" << setw(4) << fCdelete << " -> " << setw(25)
409  // << VarName.Data() << " / object(this): " << this << endl;
410 }
411 
412 //=========================================== private copy ==========
413 
414 void TEcnaRead::fCopy(const TEcnaRead& rund)
415 {
416 //Private copy
417 
418  fFileHeader = rund.fFileHeader;
420 
421  fUserSamp = rund.fUserSamp;
422  fUserChan = rund.fUserChan;
423 
428 
429  //........................................ Codes
430 
435 
436  //.................................................. Tags
438 
439  fFlagPrint = rund.fFlagPrint;
440  fPathRoot = rund.fPathRoot;
441 
442  fCnew = rund.fCnew;
443  fCdelete = rund.fCdelete;
444 }
445 
446 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
447 //
448 // copy constructor
449 //
450 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
451 
453 {
454  cout << "*TEcnaRead::TEcnaRead(const TEcnaRead& dcop)> "
455  << " It is time to write a copy constructor" << endl
456  // << " type an integer value and then RETURN to continue"
457  << endl;
458 
459  // { Int_t cintoto; cin >> cintoto; }
460 
461 }
462 
463 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
464 //
465 // overloading of the operator=
466 //
467 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
468 
470 {
471 //Overloading of the operator=
472 
473  fCopy(dcop);
474  return *this;
475 }
476 
477 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
478 //
479 // destructor
480 //
481 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
482 
484 {
485 //Destructor
486 
487  // cout << "[Info Management] CLASS: TEcnaRead. DESTROY OBJECT: this = " << this << endl;
488 
490  cout << "*TEcnaRead::~TEcnaRead()> Entering destructor" << endl;}
491 
492  //if (fFileHeader != 0){delete fFileHeader; Adelete("fFileHeader");}
493  //if (fEcal != 0){delete fEcal; Adelete("fEcal");}
494  //if (fCnaParCout != 0){delete fCnaParCout; Adelete("fCnaParCout");}
495  //if (fCnaParPaths != 0){delete fCnaParPaths; Adelete("fCnaParPaths");}
496  //if (fCnaWrite != 0){delete fCnaWrite; Adelete("fCnaWrite");}
497  //if (fEcalNumbering != 0){delete fEcalNumbering; Adelete("fEcalNumbering");}
498 
499  if (fT1d_StexStinFromIndex != 0){delete [] fT1d_StexStinFromIndex; Adelete("fT1d_StexStinFromIndex");}
500  if (fTagStinNumbers != 0){delete [] fTagStinNumbers; Adelete("fTagStinNumbers");}
501 
502  if (fT3d_distribs != 0){delete [] fT3d_distribs; Adelete("fT3d_distribs");}
503  if (fT3d2_distribs != 0){delete [] fT3d2_distribs; Adelete("fT3d2_distribs");}
504  if (fT3d1_distribs != 0){delete [] fT3d1_distribs; Adelete("fT3d1_distribs");}
505 
506  if ( fCnew != fCdelete )
507  {
508  cout << "!TEcnaRead/destructor> WRONG MANAGEMENT OF ALLOCATIONS: fCnew = "
509  << fCnew << ", fCdelete = " << fCdelete << fTTBELL << endl;
510  }
511  else
512  {
513  // cout << "*TEcnaRead/destructor> BRAVO! GOOD MANAGEMENT OF ALLOCATIONS: fCnew = "
514  // << fCnew << ", fCdelete = " << fCdelete << endl;
515  }
516 
518  cout << "*TEcnaRead::~TEcnaRead()> End of destructor " << endl;}
519 }
520 
521 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
522 //
523 // M E T H O D S
524 //
525 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
526 
527 //============================================================================
528 //
529 // GetReadyToReadRootFile(...)
530 //
531 //============================================================================
532 void TEcnaRead::GetReadyToReadRootFile(TString typ_ana, const Int_t& nb_of_samples,
533  const Int_t& run_number, const Int_t& nfirst,
534  const Int_t& nlast, const Int_t& nreqevts, const Int_t& Stex,
535  TString path_root)
536 {
537  //Preparation for reading the ROOT file
538 
539  // Preliminary save of the arguments values because it can be of the form: fFileHeader->...
540  // and because fFileHeader can be deleted and re-created in this method
541 
542  TString sTypAna = typ_ana;
543  Int_t nNbOfSamples = nb_of_samples;
544  Int_t nRunNumber = run_number;
545  Int_t nFirstEvt = nfirst;
546  Int_t nLastEvt = nlast;
547  Int_t nReqNbOfEvts = nreqevts;
548  Int_t nStexNumber = Stex;
549 
550  //................................................................................................
551  const Text_t *h_name = "CnaHeader"; //==> voir cette question avec FXG
552  const Text_t *h_title = "CnaHeader"; //==> voir cette question avec FXG
553 
554  //----------- old version, with arguments h_name, h_title, (FXG) -----(----
555  //
556  // fFileHeader->HeaderParameters(h_name, h_title,
557  // sTypAna, nNbOfSamples, nRunNumber,
558  // nFirstEvt, nLastEvt, nReqNbOfEvts, nStexNumber);
559  //
560  //-------------------------------------------------------------------------
561 
562  //---------- new version
563  if( fFileHeader == 0 ){fFileHeader = new TEcnaHeader(h_name, h_title); /* Anew("fFileHeader") */ ;}
564  fFileHeader->HeaderParameters(sTypAna, nNbOfSamples, nRunNumber,
565  nFirstEvt, nLastEvt, nReqNbOfEvts, nStexNumber);
566 
567  // After this call to TEcnaHeader, we have:
568  // fFileHeader->fTypAna = sTypAna
569  // fFileHeader->fNbOfSamples = nNbOfSamples
570  // fFileHeader->fRunNumber = nRunNumber
571  // fFileHeader->fFirstReqEvtNumber = nFirstEvt
572  // fFileHeader->fLastReqEvtNumber = nLastEvt
573  // fFileHeader->fReqNbOfEvts = nReqNbOfEvts
574  // fFileHeader->fStex = nStexNumber ( GetReadyToReadRootFile(...) )
575  //.......................... path_root
576  fPathRoot = path_root;
577 
578  //-------- gets the arguments for the file names (long and short) and makes these names
579  fCnaWrite->RegisterFileParameters(typ_ana, nb_of_samples, run_number, nfirst, nlast, nreqevts, Stex);
581 
582  //------------------------- init Stin numbers memo flags
583  fMemoStinNumbers = 0;
584 
586  {
587  cout << endl;
588  cout << "*TEcnaRead::GetReadyToReadRootFile(...)>" << endl
589  << " The method has been called with the following argument values:" << endl
590  << " Analysis name = "
591  << fFileHeader->fTypAna << endl
592  << " Nb of required samples = "
593  << fFileHeader->fNbOfSamples << endl
594  << " Run number = "
595  << fFileHeader->fRunNumber << endl
596  << " First requested event number = "
597  << fFileHeader->fFirstReqEvtNumber << endl
598  << " Last requested event number = "
599  << fFileHeader->fLastReqEvtNumber << endl
600  << " Requested number of events = "
601  << fFileHeader->fReqNbOfEvts << endl
602  << " Stex number = "
603  << fFileHeader->fStex << endl
604  << " Path for the ROOT file = "
605  << fPathRoot << endl
606  << endl;
607  }
608 
609  fReadyToReadRootFile = 1; // set flag
610 
612  cout << "*TEcnaRead::GetReadyToReadRootFile(...)> Leaving the method."
613  << endl;}
614 } //----------------- end of GetReadyToReadRootFile(...)
615 
616 //=========================================================================
617 //
618 // Set start time and stop time, GetStartDate, GetStopDate
619 //
620 //=========================================================================
626 {
627  TString cType = "run type not defined";
628  Int_t numtype = fFileHeader->fRunType;
629  //----------------------------------------- run types
630 
631  if( numtype == 0 ){cType = "COSMICS";}
632  if( numtype == 1 ){cType = "BEAMH4";}
633  if( numtype == 2 ){cType = "BEAMH2";}
634  if( numtype == 3 ){cType = "MTCC";}
635  if( numtype == 4 ){cType = "LASER_STD";}
636  if( numtype == 5 ){cType = "LASER_POWER_SCAN";}
637  if( numtype == 6 ){cType = "LASER_DELAY_SCAN";}
638  if( numtype == 7 ){cType = "TESTPULSE_SCAN_MEM";}
639  if( numtype == 8 ){cType = "TESTPULSE_MGPA";}
640  if( numtype == 9 ){cType = "PEDESTAL_STD";}
641  if( numtype == 10 ){cType = "PEDESTAL_OFFSET_SCAN";}
642  if( numtype == 11 ){cType = "PEDESTAL_25NS_SCAN";}
643  if( numtype == 12 ){cType = "LED_STD";}
644 
645  if( numtype == 13 ){cType = "PHYSICS_GLOBAL";}
646  if( numtype == 14 ){cType = "COSMICS_GLOBAL";}
647  if( numtype == 15 ){cType = "HALO_GLOBAL";}
648 
649  if( numtype == 16 ){cType = "LASER_GAP";}
650  if( numtype == 17 ){cType = "TESTPULSE_GAP";}
651  if( numtype == 18 ){cType = "PEDESTAL_GAP";}
652  if( numtype == 19 ){cType = "LED_GAP";}
653 
654  if( numtype == 20 ){cType = "PHYSICS_LOCAL";}
655  if( numtype == 21 ){cType = "COSMICS_LOCAL";}
656  if( numtype == 22 ){cType = "HALO_LOCAL";}
657  if( numtype == 23 ){cType = "CALIB_LOCAL";}
658 
659  if( numtype == 24 ){cType = "PEDSIM";}
660 
661  return cType;
662 }
663 //==========================================================================
664 //
665 // R E A D M E T H O D S
666 // ( R O O T F I L E )
667 //
668 //==========================================================================
669 
670 //============================================================================
671 //
672 // LookAtRootFile()
673 //
674 //============================================================================
676 {
677 //---------- Reads the ROOT file header and makes allocations and some other things
678 
679  fLookAtRootFile = 0; // set flag to zero before looking for the file
680 
681  Bool_t ok_read = kFALSE;
682 
683  if(fReadyToReadRootFile == 1)
684  {
685  //------------ Call to ReadRootFileHeader
686  if( ReadRootFileHeader(0) == kTRUE ) // (1) = print, (0) = no print
687  {
688  //........................................ allocation tags
689  if( fTagStinNumbers == 0 ){fTagStinNumbers = new Int_t[1]; Anew("fTagStinNumbers");}
690 
691  //...................... allocation for fT1d_StexStinFromIndex[]
692  if(fT1d_StexStinFromIndex == 0)
693  {fT1d_StexStinFromIndex = new Int_t[fEcal->MaxStinEcnaInStex()]; Anew("fT1d_StexStinFromIndex");}
694 
695  //.. recover of the Stin numbers from the ROOT file (= init fT1d_StexStinFromIndex+init TagStin)
696  TVectorD vec(fEcal->MaxStinEcnaInStex());
697  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
699 
700  for (Int_t i = 0; i < fEcal->MaxStinEcnaInStex(); i++ ){
701  fT1d_StexStinFromIndex[i] = (Int_t)vec(i);}
702 
704  ok_read = kTRUE;
705 
706  fLookAtRootFile = 1; // set flag
707  }
708  else
709  {
710  cout << "!TEcnaRead::LookAtRootFile()> *** ERROR ***>"
711  << " ROOT file not found " << fTTBELL << endl;
712  ok_read = kFALSE;
713  }
714  }
715  else
716  {
717  cout << "!TEcnaRead::LookAtRootFile()> *** ERROR ***>"
718  << " GetReadyToReadRootFile not called " << fTTBELL << endl;
719  ok_read = kFALSE;
720  }
721  return ok_read;
722 } //----------------- end of LookAtRootFile()
723 
724 //-------------------------------------------------------------------------
725 //
726 // ReadRootFileHeader
727 //
728 //-------------------------------------------------------------------------
729 Bool_t TEcnaRead::ReadRootFileHeader(const Int_t& i_print)
730 {
731 //Read the header of the Root file
732 
733  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
734 
735  if( i_print == 1 ){cout << "*TEcnaRead::ReadRootFileHeader> file_name = "
736  << fCnaWrite->fRootFileNameShort.Data() << endl;}
737 
738  Bool_t ok_open = kFALSE;
739  Bool_t ok_read = kFALSE;
740 
741  if ( fOpenRootFile )
742  {
743  cout << "!TEcnaRead::ReadRootFileHeader(...)*** ERROR ***> "
744  << "Reading header on file already open." << endl;
745  }
746  else
747  {
748  ok_open = OpenRootFile(file_name, "READ");
749 
750  if(ok_open)
751  {
752  TEcnaHeader *h;
753  h =(TEcnaHeader*)gCnaRootFile->fRootFile->Get("CnaHeader");
754 
755  //..... get the attributes which are not already set by the call to TEcnaHeader
756  // in GetReadyToReadRootFile(...) and are only available in the ROOT file
757 
762 
764 
765  //........................................................................
773 
784 
788 
789  if(i_print == 1){fFileHeader->Print();}
790  CloseRootFile(file_name);
791  ok_read = kTRUE;
792  }
793  else
794  {
795  cout << "!TEcnaRead::ReadRootFileHeader(...) *** ERROR ***> Open ROOT file failed for file: "
796  << file_name << fTTBELL << endl;
797  ok_read = kFALSE;
798  }
799  }
800  return ok_read;
801 }
802 
803 //-------------------------------------------------------------
804 //
805 // OpenRootFile
806 //
807 //-------------------------------------------------------------
808 Bool_t TEcnaRead::OpenRootFile(const Text_t *name, TString status) {
809 //Open the Root file
810 
811  TString s_path;
812  s_path = fPathRoot;
813  s_path.Append('/');
814  s_path.Append(name);
815 
816  gCnaRootFile = 0; gCnaRootFile = new TEcnaRootFile(s_path.Data(), status); Anew("gCnaRootFile");
817 
818  Bool_t ok_open = kFALSE;
819 
820  if ( gCnaRootFile->fRootFileStatus == "RECREATE" ){ok_open = gCnaRootFile->OpenW();}
821  if ( gCnaRootFile->fRootFileStatus == "READ" ){ok_open = gCnaRootFile->OpenR();}
822 
823  if (!ok_open)
824  {
825  cout << "!TEcnaRead::OpenRootFile> " << s_path.Data() << ": file not found." << endl;
826  if( gCnaRootFile != 0 ){delete gCnaRootFile; gCnaRootFile = 0; Adelete("gCnaRootFile");}
827  }
828  else
829  {
831  TString e_path; e_path.Append(name);
832  cout << "*TEcnaRead::OpenRootFile> Open ROOT file " << e_path.Data() << " OK " << endl;}
833  fOpenRootFile = kTRUE;
834  }
835 
836  return ok_open;
837 } // end of OpenRootFile()
838 
839 //-------------------------------------------------------------
840 //
841 // CloseRootFile
842 //
843 //-------------------------------------------------------------
844 Bool_t TEcnaRead::CloseRootFile(const Text_t *name) {
845 //Close the Root file
846 
847  Bool_t ok_close = kFALSE;
848 
849  if (fOpenRootFile == kTRUE )
850  {
852 
854  TString e_path; e_path.Append(name);
855  cout << "*TEcnaRead::CloseRootFile> Close ROOT file " << e_path.Data() << " OK " << endl;}
856 
857  if( gCnaRootFile != 0 ){delete gCnaRootFile; gCnaRootFile = 0; Adelete("gCnaRootFile");}
858  fOpenRootFile = kFALSE;
859  ok_close = kTRUE;
860  }
861  else
862  {
863  cout << "*TEcnaRead::CloseRootFile(...)> no close since no file is open"
864  << fTTBELL << endl;
865  }
866 
867  return ok_close;
868 }
869 //-------------------------------------------------------------------------
870 //
871 // DataExist()
872 //
873 // DON'T SUPPRESS: CALLED BY ANOTHER CLASSES
874 //
875 //-------------------------------------------------------------------------
877 {
878  // return kTRUE if the data are present in the ROOT file, kFALSE if not.
879  // fDataExist is set in the read methods
880 
881  return fDataExist;
882 }
883 //-------------------------------------------------------------------------
884 //
885 // ReadStinNumbers(...)
886 //
887 //-------------------------------------------------------------------------
888 TVectorD TEcnaRead::ReadStinNumbers(const Int_t& VecDim)
889 {
890 //Get the Stin numbers and put them in a TVectorD
891 //Read the ROOT file at first call and load in a TVectorD attribute
892 //Get directly the TVectorD attribute at other times
893 //
894 // Possible values for VecDim:
895 // (1) VecDim = fEcal->MaxCrysEcnaInStex()
896 
897  TVectorD vec(VecDim);
898  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
899 
900  if (fMemoStinNumbers == 0)
901  {
903  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
904 
905  //.............. reading of the ROOT file data type TResultTyp = cTypStinsNumbers
906  // to get the conversion: Stin index -> Stin number (n1StexStin)
907 
908  Bool_t ok_open = kFALSE;
909  Bool_t ok_read = kFALSE;
910 
911  if ( fOpenRootFile )
912  {
913  cout << "!TEcnaRead::ReadStinNumbers(...) *** ERROR ***> Reading on file already open."
914  << fTTBELL << endl;
915  }
916  else
917  {
918  ok_open = OpenRootFile(file_name, "READ");
919 
920  Int_t i_zero = 0;
921  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
922 
923  if ( ok_read == kTRUE )
924  {
925  fDataExist = kTRUE;
926  //......... Get the Stin numbers and put them in TVectorD vec()
927  for ( Int_t i_Stin = 0; i_Stin < VecDim; i_Stin++)
928  {
929  vec(i_Stin) = gCnaRootFile->fCnaIndivResult->fMatHis(0,i_Stin);
930  fT1d_StexStinFromIndex[i_Stin] = (Int_t)vec(i_Stin);
931  }
933  }
934  else
935  {
936  fDataExist = kFALSE;
937  cout << "!TEcnaRead::ReadStinNumbers(...) *** ERROR ***> "
938  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
939  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
940  << fTTBELL << endl;
941  }
942  }
943  CloseRootFile(file_name);
944 
945  if( ok_read == kTRUE )
946  {
947  //........................... Print the Stin numbers
949  {
950  for(Int_t i=0; i < VecDim; i++)
951  {
952  cout << "*TEcnaRead::ReadStinNumbers(...)> StinNumber[" << i << "] = "
953  << vec[i] << endl;
954  }
955  }
956  }
957  }
958  else
959  {
960  fDataExist = kTRUE;
961  for ( Int_t i_Stin = 0; i_Stin < VecDim; i_Stin++)
962  {vec(i_Stin) = fT1d_StexStinFromIndex[i_Stin];}
963  }
964 
965  return vec;
966 } // ----------------- ( end of ReadStinNumbers(...) ) -----------------
967 
968 //-----------------------------------------------------------------------------
969 //
970 // ReadNumberOfEventsForSamples
971 //
972 //-----------------------------------------------------------------------------
973 TMatrixD TEcnaRead::ReadNumberOfEventsForSamples(const Int_t& n1StexStin,
974  const Int_t& MatDimX, const Int_t& MatDimY)
975 {
976 //Read the numbers of found events in the data
977 //for the crystals and for the samples, for a given Stin in the Stex
978 //in the ROOT file and return them in a TMatrixD(MaxCrysInStin,NbOfSamples)
979 //
980 //Possible values for MatDimX and MatDimY:
981 // (1) MatDimX = fEcal->MaxCrysInStin(), MatDimY = fFileHeader->fNbOfSamples
982 
983  TMatrixD mat(MatDimX, MatDimY);
984  for(Int_t i=0; i<MatDimX; i++)
985  {for(Int_t j=0; j<MatDimY; j++){mat(i,j)=(Double_t)0.;}}
986 
987  Int_t Stin_index = GetStinIndex(n1StexStin);
988  if( Stin_index >= 0 )
989  {
990  if(fLookAtRootFile == 1)
991  {
993  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
994 
995  Bool_t ok_open = kFALSE;
996  Bool_t ok_read = kFALSE;
997 
998  if ( fOpenRootFile )
999  {
1000  cout << "!TEcnaRead::ReadNumberOfEventsForSamples(...) *** ERROR ***> "
1001  << " Reading on file already open." << fTTBELL << endl;
1002  }
1003  else
1004  {
1005  ok_open = OpenRootFile(file_name, "READ");
1006 
1007  Int_t i_zero = 0;
1008  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1009 
1010  if ( ok_read == kTRUE )
1011  {
1012  fDataExist = kTRUE;
1013  for (Int_t i_crys=0; i_crys<MatDimX; i_crys++)
1014  {
1015  Int_t j_cna_chan = Stin_index*MatDimX + i_crys;
1016  for ( Int_t i_samp=0; i_samp<MatDimY; i_samp++)
1017  {
1018  mat(i_crys, i_samp) = gCnaRootFile->fCnaIndivResult->fMatHis(j_cna_chan, i_samp);
1019  }
1020  }
1021  }
1022  else
1023  {
1024  fDataExist = kFALSE;
1025  cout << "!TEcnaRead::ReadNumberOfEventsForSamples(...) *** ERROR ***> "
1026  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1027  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1028  << fTTBELL << endl;
1029  }
1030  }
1031  CloseRootFile(file_name);
1032  }
1033  else
1034  {
1035  cout << "!TEcnaRead::ReadNumberOfEventsForSamples(...) *** ERROR ***> "
1036  << "It is not possible to access the number of found events: the ROOT file has not been read."
1037  << fTTBELL << endl;
1038  }
1039  } // end of if (Stin_index >= 0)
1040  return mat;
1041 }
1042 
1043 //--------------------------------------------------------------------------------------
1044 //
1045 // ReadSampleValues(i0StexEcha,sample,fFileHeader->fReqNbOfEvts)
1046 //
1047 //--------------------------------------------------------------------------------------
1048 TVectorD TEcnaRead::ReadSampleValues(const Int_t& i0StexEcha, const Int_t& sample, const Int_t& VecDim)
1049 {
1050 //Read the event distribution for a given i0StexEcha and a given sample
1051 //in the results ROOT file and return it in a TVectorD(nb of evts in burst)
1052 //
1053 //Possible values for VecDim: (1) VecDim = fFileHeader->fReqNbOfEvts
1054 
1055  TVectorD vec(VecDim);
1056  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
1057 
1058  CnaResultTyp typ = cTypAdcEvt; // sample as a function of time type
1059 
1060  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1061 
1062  Bool_t ok_open = kFALSE;
1063  Bool_t ok_read = kFALSE;
1064 
1065  if ( fOpenRootFile )
1066  {
1067  cout << "!TEcnaRead::ReadSampleValues(...) *** ERROR ***> "
1068  << "Reading on file already open." << fTTBELL << endl;
1069  }
1070  else
1071  {
1072  ok_open = OpenRootFile(file_name, "READ");
1073  ok_read = gCnaRootFile->ReadElement(typ, i0StexEcha);
1074 
1075  if ( ok_read == kTRUE )
1076  {
1077  fDataExist = kTRUE;
1078  for ( Int_t i_bin=0; i_bin<VecDim; i_bin++)
1079  {
1080  vec(i_bin) = gCnaRootFile->fCnaIndivResult->fMatHis(sample, i_bin);
1081  }
1082  }
1083  else
1084  {
1085  fDataExist = kFALSE;
1086  cout << "!TEcnaRead::ReadSampleValues(...) *** ERROR ***> "
1087  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1088  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1089  << fTTBELL << endl;
1090  }
1091  }
1092  CloseRootFile(file_name);
1093 
1094  return vec;
1095 }
1096 //--- (end of ReadSampleValues) ----------
1097 
1098 //--------------------------------------------------------------------------------------
1099 //
1100 // ReadSampleValuesSameFile(fEcal->MaxCrysEcnaInStex(),
1101 // fFileHeader->fNbOfSamples, fFileHeader->fReqNbOfEvts)
1102 //
1103 //--------------------------------------------------------------------------------------
1104 Double_t*** TEcnaRead::ReadSampleValuesSameFile(const Int_t& DimX, const Int_t& DimY, const Int_t& DimZ)
1105 {
1106 
1107 //Possible values for DimX, DimY, DimZ : (1) DimX = fEcal->MaxCrysEcnaInStex()
1108 // DimY = fFileHeader->fNbOfSamples
1109 // DimZ = fFileHeader->fReqNbOfEvts
1110 
1111  if(fT3d_distribs == 0)
1112  {
1113  //............ Allocation for the 3d array
1114  fT3d_distribs = new Double_t**[DimX]; fCnew++;
1115  fT3d2_distribs = new Double_t*[DimX*DimY]; fCnew++;
1116  fT3d1_distribs = new Double_t[DimX*DimY*DimZ]; fCnew++;
1117 
1118  for(Int_t i0StexEcha = 0 ; i0StexEcha < DimX ; i0StexEcha++){
1119  fT3d_distribs[i0StexEcha] = &fT3d2_distribs[0] + i0StexEcha*DimY;
1120  for(Int_t j_samp = 0 ; j_samp < DimY ; j_samp++){
1121  fT3d2_distribs[DimY*i0StexEcha + j_samp] = &fT3d1_distribs[0]+
1122  DimZ*(DimY*i0StexEcha+j_samp);}}
1123  }
1124 
1125  //................................. Init to zero (ReadSampleValuesSameFile)
1126  for (Int_t iza=0; iza<DimX; iza++)
1127  {
1128  for (Int_t izb=0; izb<DimY; izb++)
1129  {
1130  for (Int_t izc=0; izc<DimZ; izc++)
1131  {
1132  if( fT3d_distribs[iza][izb][izc] != (Double_t)0 )
1133  {
1134  fT3d_distribs[iza][izb][izc] = (Double_t)0;
1135  }
1136  }
1137  }
1138  }
1139 
1140  //-------------------------------------------------------------------------- (ReadSampleValuesSameFile)
1141  CnaResultTyp typ = cTypAdcEvt; // sample as a function of time type
1142 
1143  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1144 
1145  Bool_t ok_open = kFALSE;
1146  Bool_t ok_read = kFALSE;
1147 
1148  Int_t i_entry = 0;
1149  Int_t i_entry_fail = 0;
1150 
1151  ok_open = OpenRootFile(file_name, "READ");
1152 
1153  if( ok_open == kTRUE )
1154  {
1155  for(Int_t i0StexEcha=0; i0StexEcha<DimX; i0StexEcha++)
1156  {
1157  if( i0StexEcha == 0 )
1158  {
1159  i_entry = gCnaRootFile->ReadElementNextEntryNumber(typ, i0StexEcha);
1160  if( i_entry >= 0 ){ok_read = kTRUE;}
1161  }
1162  if( i_entry >= 0 ) // (ReadSampleValuesSameFile)
1163  {
1164  if( i0StexEcha > 0 ){ok_read = gCnaRootFile->ReadElement(i_entry); i_entry++;}
1165 
1166  if ( ok_read == kTRUE )
1167  {
1168  fDataExist = kTRUE;
1169  for(Int_t sample=0; sample<DimY; sample++)
1170  {
1171  for ( Int_t i_bin=0; i_bin<DimZ; i_bin++)
1172  {
1173  fT3d_distribs[i0StexEcha][sample][i_bin]
1174  = gCnaRootFile->fCnaIndivResult->fMatHis(sample, i_bin);
1175  }
1176  }
1177  }
1178  else // (ReadSampleValuesSameFile)
1179  {
1180  fDataExist = kFALSE;
1181  cout << "!TEcnaRead::ReadSampleValuesSameFile(...) *** ERROR ***> "
1182  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1183  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1184  << fTTBELL << endl;
1185  }
1186  }
1187  else
1188  {
1189  i_entry_fail++;
1190  }
1191  }
1192  CloseRootFile(file_name);
1193  }
1194  else
1195  {
1196  cout << "*TEcnaRead::ReadSampleValuesSameFile(...)> *ERROR* =====> "
1197  << " ROOT file not found" << fTTBELL << endl;
1198  }
1199 
1200  if(i_entry_fail > 0 )
1201  {
1202  cout << "*TEcnaRead::ReadSampleValuesSameFile(...)> *ERROR* =====> "
1203  << " Entry reading failure(s). i_entry_fail = "
1204  << i_entry_fail << fTTBELL << endl;
1205  }
1206  return fT3d_distribs;
1207 }
1208 //--- (end of ReadSampleValuesSameFile) ----------
1209 
1210 //-------------------------------------------------------------------------
1211 //
1212 // ReadSampleMeans
1213 //
1214 //-------------------------------------------------------------------------
1215 TVectorD TEcnaRead::ReadSampleMeans(const Int_t & n1StexStin,
1216  const Int_t & i0StinEcha, const Int_t & VecDim)
1217 {
1218 //Read the expectation values of the samples
1219 //for a given Stin and a given channel
1220 //in the ROOT file and return them in a TVectorD
1221 //
1222 //Possible values for VecDim : (1) VecDim = fFileHeader->fNbOfSamples
1223 
1224  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha);
1225 
1226  TVectorD vec(VecDim);
1227  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
1228 
1229  CnaResultTyp typ = cTypMSp;
1230 
1231  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1232 
1233  Bool_t ok_open = kFALSE;
1234  Bool_t ok_read = kFALSE;
1235 
1236  if ( fOpenRootFile )
1237  {
1238  cout << "!TEcnaRead::ReadSampleMeans(...) *** ERROR ***> "
1239  << " Reading on file already open." << fTTBELL << endl;
1240  }
1241  else
1242  {
1243  ok_open = OpenRootFile(file_name, "READ");
1244 
1245  Int_t i_zero = 0;
1246  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1247 
1248  if ( ok_read == kTRUE )
1249  {
1250  fDataExist = kTRUE;
1251  for ( Int_t i_samp = 0; i_samp < VecDim; i_samp++)
1252  {
1253  vec(i_samp) = gCnaRootFile->fCnaIndivResult->fMatHis(i0StexEcha, i_samp);
1254  }
1255  }
1256  else
1257  {
1258  fDataExist = kFALSE;
1259  cout << "!TEcnaRead::ReadSampleMeans(...) *** ERROR ***> "
1260  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1261  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1262  << fTTBELL << endl;
1263  }
1264  }
1265  CloseRootFile(file_name);
1266  return vec;
1267 }
1268 
1269 //-------------------------------------------------------------------------
1270 //
1271 // ReadSampleSigmas
1272 //
1273 //-------------------------------------------------------------------------
1274 TVectorD TEcnaRead::ReadSampleSigmas(const Int_t & n1StexStin,
1275  const Int_t & i0StinEcha, const Int_t & VecDim)
1276 {
1277 //Read the expectation values of the samples
1278 //for a given Stin and a given channel
1279 //in the ROOT file and return them in a TVectorD
1280 //
1281 //Possible values for VecDim : (1) VecDim = fFileHeader->fNbOfSamples
1282 
1283  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha);
1284 
1285  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
1286 
1287  CnaResultTyp typ = cTypSSp;
1288 
1289  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1290 
1291  Bool_t ok_open = kFALSE;
1292  Bool_t ok_read = kFALSE;
1293 
1294  if ( fOpenRootFile )
1295  {
1296  cout << "!TEcnaRead::ReadSampleSigmas(...) *** ERROR ***> "
1297  << "Reading on file already open." << fTTBELL << endl;
1298  }
1299  else
1300  {
1301  ok_open = OpenRootFile(file_name, "READ");
1302 
1303  Int_t i_zero = 0;
1304  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1305 
1306  if ( ok_read == kTRUE )
1307  {
1308  fDataExist = kTRUE;
1309  for ( Int_t i_samp = 0; i_samp < VecDim; i_samp++)
1310  {
1311  vec(i_samp) = gCnaRootFile->fCnaIndivResult->fMatHis(i0StexEcha,i_samp);
1312  }
1313  }
1314  else
1315  {
1316  fDataExist = kFALSE;
1317  cout << "!TEcnaRead::ReadSampleSigmas(...) *** ERROR ***> "
1318  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1319  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1320  << fTTBELL << endl;
1321  }
1322  }
1323  CloseRootFile(file_name);
1324  return vec;
1325 }
1326 
1327 #define RSOS
1328 #ifndef RSOS
1329 //-------------------------------------------------------------------------
1330 //
1331 // ReadSigmasOfSamples(...)
1332 //
1333 //-------------------------------------------------------------------------
1334 TVectorD TEcnaRead::ReadSigmasOfSamples(const Int_t & n1StexStin,
1335  const Int_t & i0StinEcha, const Int_t & VecDim)
1336 {
1337 //Read the expectation values of the samples
1338 //for a given Stin and a given channel
1339 //in the ROOT file and return them in a TVectorD
1340 //
1341 //Possible values for VecDim : (1) VecDim = fFileHeader->fNbOfSamples
1342 
1343  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha);
1344 
1345  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
1346 
1347  CnaResultTyp typ = cTypSSp;
1348 
1349  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1350 
1351  Bool_t ok_open = kFALSE;
1352  Bool_t ok_read = kFALSE;
1353 
1354  if ( fOpenRootFile )
1355  {
1356  cout << "!TEcnaRead::ReadSigmasOfSamples(...) *** ERROR ***> "
1357  << "Reading on file already open." << fTTBELL << endl;
1358  }
1359  else
1360  {
1361  ok_open = OpenRootFile(file_name, "READ");
1362 
1363  Int_t i_zero = 0;
1364  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1365 
1366  if ( ok_read == kTRUE )
1367  {
1368  fDataExist = kTRUE;
1369  for ( Int_t i_samp = 0; i_samp < VecDim; i_samp++)
1370  {
1371  vec(i_samp) = gCnaRootFile->fCnaIndivResult->fMatHis(i0StexEcha,i_samp);
1372  if( vec(i_samp) >= (Double_t)0. )
1373  {
1374  vec(i_samp) = (Double_t)sqrt((Double_t)vec(i_samp));
1375  }
1376  else
1377  {
1378  vec(i_samp) = (Double_t)(-1.);
1379  cout << cout << "!TEcnaRead::ReadSigmasOfSamples(...) *** ERROR ***> "
1380  << "Negative variance! Sigma forced to -1" << fTTBELL << endl;
1381  }
1382  }
1383  }
1384  else
1385  {
1386  fDataExist = kFALSE;
1387  cout << "!TEcnaRead::ReadSigmasOfSamples(...) *** ERROR ***> "
1388  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1389  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1390  << fTTBELL << endl;
1391  }
1392  }
1393  CloseRootFile(file_name);
1394  return vec;
1395 }
1396 #endif // RSOS
1397 
1398 //-------------------------------------------------------------------------
1399 //
1400 // ReadCovariancesBetweenSamples(n1StexStin,StinEcha,fFileHeader->fNbOfSamples)
1401 //
1402 //-------------------------------------------------------------------------
1403 TMatrixD TEcnaRead::ReadCovariancesBetweenSamples(const Int_t & n1StexStin, const Int_t & i0StinEcha,
1404  const Int_t& MatDim)
1405 {
1406 //Read the (sample,sample) covariances for a given channel
1407 //in ROOT file and return them in a TMatrixD
1408 //
1409 //Possible values for MatDim: (1) MatDim = fFileHeader->fNbOfSamples
1410 
1411  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha);
1412 
1413  TMatrixD mat(MatDim, MatDim);
1414  for(Int_t i=0; i<MatDim; i++)
1415  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1416 
1417  CnaResultTyp typ = cTypCovCss;
1418 
1419  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1420 
1421  Bool_t ok_open = kFALSE;
1422  Bool_t ok_read = kFALSE;
1423 
1424  if ( fOpenRootFile )
1425  {
1426  cout << "!TEcnaRead::ReadCovariancesBetweenSamples(...) *** ERROR ***> "
1427  << "Reading on file already open." << fTTBELL << endl;
1428  }
1429  else
1430  {
1431  ok_open = OpenRootFile(file_name, "READ");
1432 
1433  ok_read = gCnaRootFile->ReadElement(typ, i0StexEcha);
1434 
1435  if ( ok_read == kTRUE )
1436  {
1437  fDataExist = kTRUE;
1438  for( Int_t i_samp = 0; i_samp < MatDim; i_samp++ )
1439  {
1440  for ( Int_t j_samp = 0; j_samp < MatDim; j_samp++)
1441  {
1442  mat(i_samp, j_samp) = gCnaRootFile->fCnaIndivResult->fMatMat(i_samp,j_samp);
1443  }
1444  }
1445  }
1446  else
1447  {
1448  fDataExist = kFALSE;
1449  cout << "!TEcnaRead::ReadCovariancesBetweenSamples() *** ERROR ***> "
1450  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1451  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1452  << fTTBELL << endl;
1453  }
1454  }
1455 
1456  CloseRootFile(file_name);
1457 
1458  return mat;
1459 }
1460 
1461 //-------------------------------------------------------------------------
1462 //
1463 // ReadCorrelationsBetweenSamples(n1StexStin,StinEcha,fFileHeader->fNbOfSamples)
1464 //
1465 //-------------------------------------------------------------------------
1466 TMatrixD TEcnaRead::ReadCorrelationsBetweenSamples(const Int_t & n1StexStin, const Int_t & i0StinEcha,
1467  const Int_t& MatDim)
1468 {
1469 //Read the (sample,sample) correlations for a given channel
1470 //in ROOT file and return them in a TMatrixD
1471 //
1472 //Possible values for MatDim: (1) MatDim = fFileHeader->fNbOfSamples
1473 
1474  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha);
1475  TMatrixD mat(MatDim, MatDim);
1476  for(Int_t i=0; i<MatDim; i++)
1477  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1478 
1479  CnaResultTyp typ = cTypCorCss;
1480  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1481 
1482  Bool_t ok_open = kFALSE;
1483  Bool_t ok_read = kFALSE;
1484 
1485  if ( fOpenRootFile )
1486  {
1487  cout << "!TEcnaRead::ReadCorrelationsBetweenSamples(...) *** ERROR ***> "
1488  << "Reading on file already open." << fTTBELL << endl;
1489  }
1490  else
1491  {
1492  ok_open = OpenRootFile(file_name, "READ");
1493  ok_read = gCnaRootFile->ReadElement(typ, i0StexEcha);
1494 
1495  if ( ok_read == kTRUE )
1496  {
1497  fDataExist = kTRUE;
1498  for ( Int_t i_samp = 0; i_samp < MatDim; i_samp++){
1499  for ( Int_t j_samp = 0; j_samp < MatDim; j_samp++){
1500  mat(i_samp, j_samp) = gCnaRootFile->fCnaIndivResult->fMatMat(i_samp,j_samp);}}
1501  }
1502  else
1503  {
1504  fDataExist = kFALSE;
1505  cout << "!TEcnaRead::ReadCorrelationsBetweenSamples() *** ERROR ***> "
1506  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1507  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1508  << fTTBELL << endl;
1509  }
1510  }
1511  CloseRootFile(file_name);
1512  return mat;
1513 }
1514 //-------------------------------------------------------------------------
1515 //
1516 // ReadRelevantCorrelationsBetweenSamples(n1StexStin,i0StinEcha)
1517 // (NOT USED)
1518 //-------------------------------------------------------------------------
1519 TVectorD TEcnaRead::ReadRelevantCorrelationsBetweenSamples(const Int_t & n1StexStin, const Int_t & i0StinEcha,
1520  const Int_t & InPutMatDim )
1521 {
1522 //Read the (sample,sample) correlations for a given channel
1523 //in ROOT file and return the relevant correlations in a TVectorD
1524 //
1525 //Possible values for InPutMatDim: (1) InPutMatDim = fFileHeader->fNbOfSamples
1526 //
1527 // *===> OutPut TVectorD dimension value = InPutMatDim*(InPutMatDim-1)/2
1528 
1529  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(n1StexStin, i0StinEcha);
1530  Int_t nb_of_relevant = InPutMatDim*(InPutMatDim-1)/2;
1531  TVectorD vec_rel(nb_of_relevant); for(Int_t i=0; i<nb_of_relevant; i++){vec_rel(i)=(Double_t)0.;}
1532  CnaResultTyp typ = cTypCorCss;
1533  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1534 
1535  Bool_t ok_open = kFALSE;
1536  Bool_t ok_read = kFALSE;
1537 
1538  if ( fOpenRootFile )
1539  {
1540  cout << "!TEcnaRead::ReadRelevantCorrelationsBetweenSamples(...) *** ERROR ***> "
1541  << "Reading on file already open." << fTTBELL << endl;
1542  }
1543  else
1544  {
1545  ok_open = OpenRootFile(file_name, "READ");
1546  ok_read = gCnaRootFile->ReadElement(typ, i0StexEcha);
1547 
1548  if ( ok_read == kTRUE )
1549  {
1550  fDataExist = kTRUE;
1551  Int_t k_cor = 0;
1552  for ( Int_t i_samp = 0; i_samp < InPutMatDim; i_samp++){
1553  for ( Int_t j_samp = 0; j_samp < i_samp; j_samp++){
1554  vec_rel(k_cor) = gCnaRootFile->fCnaIndivResult->fMatMat(i_samp,j_samp);
1555  k_cor++;}}
1556  }
1557  else
1558  {
1559  fDataExist = kFALSE;
1560  cout << "!TEcnaRead::ReadRelevantCorrelationsBetweenSamples() *** ERROR ***> "
1561  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1562  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1563  << fTTBELL << endl;
1564  }
1565  }
1566  CloseRootFile(file_name);
1567  return vec_rel;
1568 }
1569 //----- end of (ReadRelevantCorrelationsBetweenSamples ) -------
1570 
1571 //-----------------------------------------------------------------------------------------
1572 //
1573 // ReadLowFrequencyCovariancesBetweenChannels(Stin_a, Stin_b)
1574 //
1575 //-----------------------------------------------------------------------------------------
1577  const Int_t& n1StexStin_b,
1578  const Int_t& MatDim)
1579 {
1580 //Read the Low Frequency cov(i0StinEcha of Stin_a, i0StinEcha of Stin b)
1581 //in ROOT file and return them in a TMatrixD
1582 //
1583 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysInStin()
1584 
1585  Int_t index_Stin_a = GetStinIndex(n1StexStin_a);
1586  Int_t index_Stin_b = GetStinIndex(n1StexStin_b);
1587 
1588  TMatrixD mat(MatDim, MatDim);
1589  for(Int_t i=0; i<MatDim; i++)
1590  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1591 
1592  CnaResultTyp typ = cTypLfCov;
1593 
1594  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1595 
1596  Bool_t ok_open = kFALSE;
1597  Bool_t ok_read = kFALSE;
1598 
1599  if ( fOpenRootFile )
1600  {
1601  cout << "!TEcnaRead::ReadLowFrequencyCovariancesBetweenChannels(...) *** ERROR ***>"
1602  << " Reading on file already open." << fTTBELL << endl;
1603  }
1604  else
1605  {
1606  ok_open = OpenRootFile(file_name, "READ");
1607 
1608  Int_t i_zero = 0;
1609  ok_read = gCnaRootFile->ReadElement(typ,i_zero);
1610 
1611  if ( ok_read == kTRUE )
1612  {
1613  fDataExist = kTRUE;
1614  for ( Int_t i_crys = 0; i_crys < MatDim; i_crys++)
1615  {
1616  Int_t i_cna_chan = index_Stin_a*MatDim + i_crys;
1617  for ( Int_t j_crys = 0; j_crys < MatDim; j_crys++)
1618  {
1619  Int_t j_cna_chan = index_Stin_b*MatDim + j_crys;
1620  mat(i_crys, j_crys) = gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
1621  }
1622  }
1623  }
1624  else
1625  {
1626  fDataExist = kFALSE;
1627  cout << "!TEcnaRead::ReadLowFrequencyCovariancesBetweenChannels(...) *** ERROR ***> "
1628  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1629  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1630  << fTTBELL << endl;
1631  }
1632  }
1633 
1634  CloseRootFile(file_name);
1635 
1636  return mat;
1637 }
1638 //----- end of ( ReadLowFrequencyCovariancesBetweenChannels(...) ) -------
1639 
1640 //-------------------------------------------------------------------------------------------
1641 //
1642 // ReadLowFrequencyCorrelationsBetweenChannels(Stin_a, Stin_b)
1643 //
1644 //-------------------------------------------------------------------------------------------
1646  const Int_t & n1StexStin_b,
1647  const Int_t& MatDim)
1648 {
1649 //Read the Low Frequency cor(i0StinEcha of Stin_a, i0StinEcha of Stin b)
1650 //in ROOT file and return them in a TMatrixD
1651 //
1652 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysInStin()
1653 
1654  Int_t index_Stin_a = GetStinIndex(n1StexStin_a);
1655  Int_t index_Stin_b = GetStinIndex(n1StexStin_b);
1656 
1657  TMatrixD mat(MatDim, MatDim);
1658  for(Int_t i=0; i<MatDim; i++)
1659  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1660 
1661  CnaResultTyp typ = cTypLfCor;
1662 
1663  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1664 
1665  Bool_t ok_open = kFALSE;
1666  Bool_t ok_read = kFALSE;
1667 
1668  if ( fOpenRootFile )
1669  {
1670  cout << "!TEcnaRead::ReadLowFrequencyCorrelationsBetweenChannels(...) *** ERROR ***>"
1671  << " Reading on file already open." << fTTBELL << endl;
1672  }
1673  else
1674  {
1675  ok_open = OpenRootFile(file_name, "READ");
1676 
1677  Int_t i_zero = 0;
1678 
1679  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1680 
1681  if ( ok_read == kTRUE )
1682  {
1683  fDataExist = kTRUE;
1684  for ( Int_t i_crys = 0; i_crys < MatDim; i_crys++)
1685  {
1686  Int_t i_cna_chan = index_Stin_a*MatDim + i_crys;
1687  for ( Int_t j_crys = 0; j_crys < MatDim; j_crys++)
1688  {
1689  Int_t j_cna_chan = index_Stin_b*MatDim + j_crys;
1690  mat(i_crys, j_crys) = gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
1691  }
1692  }
1693  }
1694  else
1695  {
1696  fDataExist = kFALSE;
1697  cout << "!TEcnaRead::ReadLowFrequencyCorrelationsBetweenChannels(...) *** ERROR ***> "
1698  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1699  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1700  << fTTBELL << endl;
1701  }
1702  }
1703 
1704  CloseRootFile(file_name);
1705 
1706  return mat;
1707 }
1708 //----- end of ( ReadLowFrequencyCorrelationsBetweenChannels(...) ) -------
1709 
1710 //-----------------------------------------------------------------------------------------
1711 //
1712 // ReadHighFrequencyCovariancesBetweenChannels(Stin_a, Stin_b)
1713 //
1714 //-----------------------------------------------------------------------------------------
1716  const Int_t & n1StexStin_b,
1717  const Int_t& MatDim)
1718 {
1719 //Read the High Frequency cov(i0StinEcha of Stin_a, i0StinEcha of Stin b)
1720 //in ROOT file and return them in a TMatrixD
1721 //
1722 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysInStin()
1723 
1724  Int_t index_Stin_a = GetStinIndex(n1StexStin_a);
1725  Int_t index_Stin_b = GetStinIndex(n1StexStin_b);
1726 
1727  TMatrixD mat(MatDim, MatDim);
1728  for(Int_t i=0; i<MatDim; i++)
1729  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1730 
1731  CnaResultTyp typ = cTypHfCov;
1732 
1733  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1734 
1735  Bool_t ok_open = kFALSE;
1736  Bool_t ok_read = kFALSE;
1737 
1738  if ( fOpenRootFile )
1739  {
1740  cout << "!TEcnaRead::ReadHighFrequencyCovariancesBetweenChannels(...) *** ERROR ***>"
1741  << " Reading on file already open." << fTTBELL << endl;
1742  }
1743  else
1744  {
1745  ok_open = OpenRootFile(file_name, "READ");
1746 
1747  Int_t i_zero = 0;
1748  ok_read = gCnaRootFile->ReadElement(typ,i_zero);
1749 
1750  if ( ok_read == kTRUE )
1751  {
1752  fDataExist = kTRUE;
1753  for ( Int_t i_crys = 0; i_crys < MatDim; i_crys++)
1754  {
1755  Int_t i_cna_chan = index_Stin_a*MatDim + i_crys;
1756  for ( Int_t j_crys = 0; j_crys < MatDim; j_crys++)
1757  {
1758  Int_t j_cna_chan = index_Stin_b*MatDim + j_crys;
1759  mat(i_crys, j_crys) = gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
1760  }
1761  }
1762  }
1763  else
1764  {
1765  fDataExist = kFALSE;
1766  cout << "!TEcnaRead::ReadHighFrequencyCovariancesBetweenChannels(...) *** ERROR ***> "
1767  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1768  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1769  << fTTBELL << endl;
1770  }
1771  }
1772 
1773  CloseRootFile(file_name);
1774 
1775  return mat;
1776 }
1777 //----- end of ( ReadHighFrequencyCovariancesBetweenChannels(...) ) -------
1778 
1779 //-------------------------------------------------------------------------------------------
1780 //
1781 // ReadHighFrequencyCorrelationsBetweenChannels(Stin_a, Stin_b)
1782 //
1783 //-------------------------------------------------------------------------------------------
1785  const Int_t & n1StexStin_b,
1786  const Int_t& MatDim)
1787 {
1788 //Read the High Frequency Cor(i0StinEcha of Stin_a, i0StinEcha of Stin b)
1789 //in ROOT file and return them in a TMatrixD
1790 //
1791 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysInStin()
1792 
1793  Int_t index_Stin_a = GetStinIndex(n1StexStin_a);
1794  Int_t index_Stin_b = GetStinIndex(n1StexStin_b);
1795 
1796  TMatrixD mat(MatDim, MatDim);
1797  for(Int_t i=0; i<MatDim; i++)
1798  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1799 
1800  CnaResultTyp typ = cTypHfCor;
1801 
1802  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1803 
1804  Bool_t ok_open = kFALSE;
1805  Bool_t ok_read = kFALSE;
1806 
1807  if ( fOpenRootFile )
1808  {
1809  cout << "!TEcnaRead::ReadHighFrequencyCorrelationsBetweenChannels(...) *** ERROR ***>"
1810  << " Reading on file already open." << fTTBELL << endl;
1811  }
1812  else
1813  {
1814  ok_open = OpenRootFile(file_name, "READ");
1815 
1816  Int_t i_zero = 0;
1817 
1818  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1819 
1820  if ( ok_read == kTRUE )
1821  {
1822  fDataExist = kTRUE;
1823  for ( Int_t i_crys = 0; i_crys < MatDim; i_crys++)
1824  {
1825  Int_t i_cna_chan = index_Stin_a*MatDim + i_crys;
1826  for ( Int_t j_crys = 0; j_crys < MatDim; j_crys++)
1827  {
1828  Int_t j_cna_chan = index_Stin_b*MatDim + j_crys;
1829  mat(i_crys, j_crys) = gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
1830  }
1831  }
1832  }
1833  else
1834  {
1835  fDataExist = kFALSE;
1836  cout << "!TEcnaRead::ReadHighFrequencyCorrelationsBetweenChannels(...) *** ERROR ***> "
1837  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1838  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1839  << fTTBELL << endl;
1840  }
1841  }
1842 
1843  CloseRootFile(file_name);
1844 
1845  return mat;
1846 }
1847 //----- end of ( ReadHighFrequencyCorrelationsBetweenChannels(...) ) -------
1848 
1849 //-------------------------------------------------------------------------
1850 //
1851 // ReadLowFrequencyCovariancesBetweenChannels(...)
1852 // (NOT USED)
1853 //-------------------------------------------------------------------------
1855 {
1856 //Read all the Low Frequency covariances
1857 //in ROOT file and return them in a TMatrixD
1858 //
1859 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
1860 
1861  //=====> WARNING: BIG MATRIX (1700x1700)
1862  TMatrixD mat(MatDim, MatDim);
1863  for(Int_t i=0; i<MatDim; i++){for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1864 
1865  TVectorD vec(fEcal->MaxStinEcnaInStex());
1866  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
1868 
1869  CnaResultTyp typ = cTypLfCov;
1870 
1871  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1872 
1873  Bool_t ok_open = kFALSE;
1874  Bool_t ok_read = kFALSE;
1875 
1876  if ( fOpenRootFile )
1877  {
1878  cout << "!TEcnaRead::ReadLowFrequencyCovariancesBetweenChannels() *** ERROR ***>"
1879  << " Reading on file already open." << fTTBELL << endl;
1880  }
1881  else
1882  {
1883  ok_open = OpenRootFile(file_name, "READ");
1884 
1885  Int_t i_zero = 0;
1886  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1887 
1888  if ( ok_read == kTRUE )
1889  {
1890  fDataExist = kTRUE;
1891  for (Int_t index_Stin_a = 0; index_Stin_a < fEcal->MaxStinEcnaInStex(); index_Stin_a++)
1892  {
1893  if ( vec(index_Stin_a) > 0 && vec(index_Stin_a) <= fEcal->MaxStinEcnaInStex())
1894  {
1895  for (Int_t index_Stin_b = 0; index_Stin_b < fEcal->MaxStinEcnaInStex(); index_Stin_b++)
1896  {
1897  if ( vec(index_Stin_b) > 0 && vec(index_Stin_b) <= fEcal->MaxStinEcnaInStex())
1898  {
1899  for ( Int_t i_crys = 0; i_crys < fEcal->MaxCrysInStin(); i_crys++)
1900  {
1901  Int_t i_cna_chan = index_Stin_a*fEcal->MaxCrysInStin() + i_crys;
1902  Int_t i_chan_sm = (Int_t)(vec(index_Stin_a)-1)*fEcal->MaxCrysInStin() +i_crys;
1903  for ( Int_t j_crys = 0; j_crys < fEcal->MaxCrysInStin(); j_crys++)
1904  {
1905  Int_t j_cna_chan = index_Stin_b*fEcal->MaxCrysInStin() + j_crys;
1906  Int_t j_chan_sm = (Int_t)(vec(index_Stin_b)-1)*fEcal->MaxCrysInStin() +j_crys;
1907  mat(i_chan_sm, j_chan_sm) =
1908  gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
1909  }
1910  }
1911  }
1912  }
1913  }
1914  }
1915  }
1916  else
1917  {
1918  fDataExist = kFALSE;
1919  cout << "!TEcnaRead::ReadLowFrequencyCovariancesBetweenChannels() *** ERROR ***> "
1920  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
1921  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
1922  << fTTBELL << endl;
1923  }
1924  }
1925 
1926  CloseRootFile(file_name);
1927 
1928  return mat;
1929 }
1930 //----- end of ( ReadLowFrequencyCovariancesBetweenChannels(...) ) -------
1931 
1932 //-------------------------------------------------------------------------
1933 //
1934 // ReadLowFrequencyCorrelationsBetweenChannels(...)
1935 //
1936 //-------------------------------------------------------------------------
1938 {
1939 //Read all the Low Frequency correlations
1940 //in ROOT file and return them in a TMatrixD
1941 //
1942 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
1943 
1944  //=====> WARNING: BIG MATRIX (1700x1700)
1945  TMatrixD mat(MatDim, MatDim);
1946  for(Int_t i=0; i<MatDim; i++){for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
1947 
1948  TVectorD vec(fEcal->MaxStinEcnaInStex());
1949  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
1951 
1952  CnaResultTyp typ = cTypLfCor;
1953 
1954  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
1955 
1956  Bool_t ok_open = kFALSE;
1957  Bool_t ok_read = kFALSE;
1958 
1959  if ( fOpenRootFile )
1960  {
1961  cout << "!TEcnaRead::ReadLowFrequencyCorrelationsBetweenChannels() *** ERROR ***>"
1962  << " Reading on file already open." << fTTBELL << endl;
1963  }
1964  else
1965  {
1966  ok_open = OpenRootFile(file_name, "READ");
1967 
1968  Int_t i_zero = 0;
1969  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
1970 
1971  if ( ok_read == kTRUE )
1972  {
1973  fDataExist = kTRUE;
1974  for (Int_t index_Stin_a = 0; index_Stin_a < fEcal->MaxStinEcnaInStex(); index_Stin_a++)
1975  {
1976  if ( vec(index_Stin_a) > 0 && vec(index_Stin_a) <= fEcal->MaxStinEcnaInStex())
1977  {
1978  for (Int_t index_Stin_b = 0; index_Stin_b < fEcal->MaxStinEcnaInStex(); index_Stin_b++)
1979  {
1980  if ( vec(index_Stin_b) > 0 && vec(index_Stin_b) <= fEcal->MaxStinEcnaInStex())
1981  {
1982  for ( Int_t i_crys = 0; i_crys < fEcal->MaxCrysInStin(); i_crys++)
1983  {
1984  Int_t i_cna_chan = index_Stin_a*fEcal->MaxCrysInStin() + i_crys;
1985  Int_t i_chan_sm = (Int_t)(vec(index_Stin_a)-1)*fEcal->MaxCrysInStin() + i_crys;
1986  for ( Int_t j_crys = 0; j_crys < fEcal->MaxCrysInStin(); j_crys++)
1987  {
1988  Int_t j_cna_chan = index_Stin_b*fEcal->MaxCrysInStin() + j_crys;
1989  Int_t j_chan_sm = (Int_t)(vec(index_Stin_b)-1)*fEcal->MaxCrysInStin() + j_crys;
1990  mat(i_chan_sm, j_chan_sm) =
1991  gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
1992  }
1993  }
1994  }
1995  }
1996  }
1997  }
1998  }
1999  else
2000  {
2001  fDataExist = kFALSE;
2002  cout << "!TEcnaRead::ReadLowFrequencyCorrelationsBetweenChannels() *** ERROR ***> "
2003  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2004  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2005  << fTTBELL << endl;
2006  }
2007  }
2008 
2009  CloseRootFile(file_name);
2010 
2011  return mat;
2012 }
2013 //----- end of (ReadLowFrequencyCorrelationsBetweenChannels(...) ) -------
2014 
2015 //-------------------------------------------------------------------------
2016 //
2017 // ReadHighFrequencyCovariancesBetweenChannels(...)
2018 // (NOT USED)
2019 //-------------------------------------------------------------------------
2021 {
2022 //Read all the High Frequency covariances
2023 //in ROOT file and return them in a TMatrixD
2024 //
2025 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2026 
2027  //=====> WARNING: BIG MATRIX (1700x1700)
2028  TMatrixD mat(MatDim, MatDim);
2029  for(Int_t i=0; i<MatDim; i++){for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
2030 
2031  TVectorD vec(fEcal->MaxStinEcnaInStex());
2032  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
2034 
2035  CnaResultTyp typ = cTypHfCov;
2036 
2037  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2038 
2039  Bool_t ok_open = kFALSE;
2040  Bool_t ok_read = kFALSE;
2041 
2042  if ( fOpenRootFile )
2043  {
2044  cout << "!TEcnaRead::ReadHighFrequencyCovariancesBetweenChannels() *** ERROR ***>"
2045  << " Reading on file already open." << fTTBELL << endl;
2046  }
2047  else
2048  {
2049  ok_open = OpenRootFile(file_name, "READ");
2050 
2051  Int_t i_zero = 0;
2052  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2053 
2054  if ( ok_read == kTRUE )
2055  {
2056  fDataExist = kTRUE;
2057  for (Int_t index_Stin_a = 0; index_Stin_a < fEcal->MaxStinEcnaInStex(); index_Stin_a++)
2058  {
2059  if ( vec(index_Stin_a) > 0 && vec(index_Stin_a) <= fEcal->MaxStinEcnaInStex())
2060  {
2061  for (Int_t index_Stin_b = 0; index_Stin_b < fEcal->MaxStinEcnaInStex(); index_Stin_b++)
2062  {
2063  if ( vec(index_Stin_b) > 0 && vec(index_Stin_b) <= fEcal->MaxStinEcnaInStex())
2064  {
2065  for ( Int_t i_crys = 0; i_crys < fEcal->MaxCrysInStin(); i_crys++)
2066  {
2067  Int_t i_cna_chan = index_Stin_a*fEcal->MaxCrysInStin() + i_crys;
2068  Int_t i_chan_sm = (Int_t)(vec(index_Stin_a)-1)*fEcal->MaxCrysInStin() +i_crys;
2069  for ( Int_t j_crys = 0; j_crys < fEcal->MaxCrysInStin(); j_crys++)
2070  {
2071  Int_t j_cna_chan = index_Stin_b*fEcal->MaxCrysInStin() + j_crys;
2072  Int_t j_chan_sm = (Int_t)(vec(index_Stin_b)-1)*fEcal->MaxCrysInStin() +j_crys;
2073  mat(i_chan_sm, j_chan_sm) =
2074  gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
2075  }
2076  }
2077  }
2078  }
2079  }
2080  }
2081  }
2082  else
2083  {
2084  fDataExist = kFALSE;
2085  cout << "!TEcnaRead::ReadHighFrequencyCovariancesBetweenChannels() *** ERROR ***> "
2086  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2087  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2088  << fTTBELL << endl;
2089  }
2090  }
2091 
2092  CloseRootFile(file_name);
2093 
2094  return mat;
2095 }
2096 //----- end of ( ReadHighFrequencyCovariancesBetweenChannels(...) ) -------
2097 
2098 //-------------------------------------------------------------------------
2099 //
2100 // ReadHighFrequencyCorrelationsBetweenChannels(...)
2101 //
2102 //-------------------------------------------------------------------------
2104 {
2105 //Read all the High Frequency correlations
2106 //in ROOT file and return them in a TMatrixD
2107 //
2108 //Possible values for MatDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2109 
2110  //=====> WARNING: BIG MATRIX (1700x1700)
2111  TMatrixD mat(MatDim, MatDim);
2112  for(Int_t i=0; i<MatDim; i++){for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
2113 
2114  TVectorD vec(fEcal->MaxStinEcnaInStex());
2115  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
2117 
2118  CnaResultTyp typ = cTypHfCor;
2119 
2120  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2121 
2122  Bool_t ok_open = kFALSE;
2123  Bool_t ok_read = kFALSE;
2124 
2125  if ( fOpenRootFile )
2126  {
2127  cout << "!TEcnaRead::ReadHighFrequencyCorrelationsBetweenChannels() *** ERROR ***>"
2128  << " Reading on file already open." << fTTBELL << endl;
2129  }
2130  else
2131  {
2132  ok_open = OpenRootFile(file_name, "READ");
2133 
2134  Int_t i_zero = 0;
2135  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2136 
2137  if ( ok_read == kTRUE )
2138  {
2139  fDataExist = kTRUE;
2140  for (Int_t index_Stin_a = 0; index_Stin_a < fEcal->MaxStinEcnaInStex(); index_Stin_a++)
2141  {
2142  if ( vec(index_Stin_a) > 0 && vec(index_Stin_a) <= fEcal->MaxStinEcnaInStex())
2143  {
2144  for (Int_t index_Stin_b = 0; index_Stin_b < fEcal->MaxStinEcnaInStex(); index_Stin_b++)
2145  {
2146  if ( vec(index_Stin_b) > 0 && vec(index_Stin_b) <= fEcal->MaxStinEcnaInStex())
2147  {
2148  for ( Int_t i_crys = 0; i_crys < fEcal->MaxCrysInStin(); i_crys++)
2149  {
2150  Int_t i_cna_chan = index_Stin_a*fEcal->MaxCrysInStin() + i_crys;
2151  Int_t i_chan_sm = (Int_t)(vec(index_Stin_a)-1)*fEcal->MaxCrysInStin() + i_crys;
2152  for ( Int_t j_crys = 0; j_crys < fEcal->MaxCrysInStin(); j_crys++)
2153  {
2154  Int_t j_cna_chan = index_Stin_b*fEcal->MaxCrysInStin() + j_crys;
2155  Int_t j_chan_sm = (Int_t)(vec(index_Stin_b)-1)*fEcal->MaxCrysInStin() + j_crys;
2156  mat(i_chan_sm, j_chan_sm) =
2157  gCnaRootFile->fCnaIndivResult->fMatMat(i_cna_chan,j_cna_chan);
2158  }
2159  }
2160  }
2161  }
2162  }
2163  }
2164  }
2165  else
2166  {
2167  fDataExist = kFALSE;
2168  cout << "!TEcnaRead::ReadHighFrequencyCorrelationsBetweenChannels() *** ERROR ***> "
2169  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2170  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2171  << fTTBELL << endl;
2172  }
2173  }
2174 
2175  CloseRootFile(file_name);
2176 
2177  return mat;
2178 }
2179 //-------------- ( end of ReadHighFrequencyCorrelationsBetweenChannels(...) ) ---------
2180 
2181 
2182 //-------------------------------------------------------------------------
2183 //
2184 // ReadLowFrequencyMeanCorrelationsBetweenStins(...)
2185 //
2186 //-------------------------------------------------------------------------
2188 {
2189 //Read all the Low Frequency Mean Correlations Between Towers the for all (Stin_X, Stin_Y)
2190 //in ROOT file and return them in a TMatrixD
2191 //
2192 //Possible values for MatDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2193 
2194  TMatrixD mat(MatDim, MatDim);
2195  for(Int_t i=0; i<MatDim; i++)
2196  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
2197 
2198  TVectorD vec(fEcal->MaxStinEcnaInStex());
2199  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
2201 
2203 
2204  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2205 
2206  Bool_t ok_open = kFALSE;
2207  Bool_t ok_read = kFALSE;
2208 
2209  if ( fOpenRootFile )
2210  {
2211  cout << "!TEcnaRead::ReadLowFrequencyMeanCorrelationsBetweenStins() *** ERROR ***>"
2212  << " Reading on file already open." << fTTBELL << endl;
2213  }
2214  else
2215  {
2216  ok_open = OpenRootFile(file_name, "READ");
2217 
2218  Int_t i_zero = 0;
2219  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2220 
2221  if( ok_read == kTRUE )
2222  {
2223  fDataExist = kTRUE;
2224  for(Int_t index_Stin_a = 0; index_Stin_a < MatDim; index_Stin_a++)
2225  {
2226  for(Int_t index_Stin_b = 0; index_Stin_b < MatDim; index_Stin_b++)
2227  {
2228  if( vec(index_Stin_a) > 0 && vec(index_Stin_a) <= MatDim)
2229  {
2230  if( vec(index_Stin_b) > 0 && vec(index_Stin_b) <= MatDim)
2231  {
2232  mat((Int_t)vec(index_Stin_a)-1, (Int_t)vec(index_Stin_b)-1) =
2233  gCnaRootFile->fCnaIndivResult->fMatMat(index_Stin_a,index_Stin_b);
2234  }
2235  }
2236  }
2237  }
2238  }
2239  else
2240  {
2241  fDataExist = kFALSE;
2242  cout << "!TEcnaRead::ReadLowFrequencyMeanCorrelationsBetweenStins() *** ERROR ***> "
2243  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2244  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2245  << fTTBELL << endl;
2246  }
2247 
2248  CloseRootFile(file_name);
2249  }
2250 
2251  return mat;
2252 }
2253 //-------- ( end of ReadLowFrequencyMeanCorrelationsBetweenStins) --------
2254 
2255 //-------------------------------------------------------------------------
2256 //
2257 // ReadHighFrequencyMeanCorrelationsBetweenStins(...)
2258 //
2259 //-------------------------------------------------------------------------
2261 {
2262 //Read all the High Frequency Mean Correlations Between Towers the for all (Stin_X, Stin_Y)
2263 //in ROOT file and return them in a TMatrixD
2264 //
2265 //Possible values for MatDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2266 
2267  TMatrixD mat(MatDim, MatDim);
2268  for(Int_t i=0; i<MatDim; i++)
2269  {for(Int_t j=0; j<MatDim; j++){mat(i,j)=(Double_t)0.;}}
2270 
2271  TVectorD vec(fEcal->MaxStinEcnaInStex());
2272  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
2274 
2276 
2277  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2278 
2279  Bool_t ok_open = kFALSE;
2280  Bool_t ok_read = kFALSE;
2281 
2282  if ( fOpenRootFile )
2283  {
2284  cout << "!TEcnaRead::ReadHighFrequencyMeanCorrelationsBetweenStins() *** ERROR ***>"
2285  << " Reading on file already open." << fTTBELL << endl;
2286  }
2287  else
2288  {
2289  ok_open = OpenRootFile(file_name, "READ");
2290 
2291  Int_t i_zero = 0;
2292  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2293 
2294  if( ok_read == kTRUE )
2295  {
2296  fDataExist = kTRUE;
2297  for(Int_t index_Stin_a = 0; index_Stin_a < MatDim; index_Stin_a++)
2298  {
2299  for(Int_t index_Stin_b = 0; index_Stin_b < MatDim; index_Stin_b++)
2300  {
2301  if( vec(index_Stin_a) > 0 && vec(index_Stin_a) <= MatDim)
2302  {
2303  if( vec(index_Stin_b) > 0 && vec(index_Stin_b) <= MatDim)
2304  {
2305  mat((Int_t)vec(index_Stin_a)-1, (Int_t)vec(index_Stin_b)-1) =
2306  gCnaRootFile->fCnaIndivResult->fMatMat(index_Stin_a,index_Stin_b);
2307  }
2308  }
2309  }
2310  }
2311  }
2312  else
2313  {
2314  fDataExist = kFALSE;
2315  cout << "!TEcnaRead::ReadHighFrequencyMeanCorrelationsBetweenStins() *** ERROR ***> "
2316  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2317  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2318  << fTTBELL << endl;
2319  }
2320 
2321  CloseRootFile(file_name);
2322  }
2323 
2324  return mat;
2325 }
2326 //-------- ( end of ReadHighFrequencyMeanCorrelationsBetweenStins) --------
2327 
2328 //============================================================================
2329 //
2330 // 1 D H I S T O S : M E A N
2331 //
2332 //============================================================================
2333 //-----------------------------------------------------------------------------
2334 //
2335 // ReadNumberOfEvents(...)
2336 //
2337 //-----------------------------------------------------------------------------
2338 TVectorD TEcnaRead::ReadNumberOfEvents(const Int_t& VecDim)
2339 {
2340 //Read the numbers of found events in the data
2341 //for the crystals and for the samples for all the Stin's in the Stex
2342 //in the ROOT file, compute the average on the samples
2343 //and return them in a TVectorD(MaxCrysEcnaInStex)
2344 //
2345 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2346 
2347  TVectorD vec(VecDim);
2348  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2349 
2350  TMatrixD mat(fEcal->MaxCrysInStin(), fFileHeader->fNbOfSamples);
2351 
2352  for(Int_t iStexStin=0; iStexStin<fEcal->MaxStinEcnaInStex(); iStexStin++)
2353  {
2354  //............. set mat(,) to zero before reading it
2355  for(Int_t i=0; i<fEcal->MaxCrysInStin(); i++)
2356  {for(Int_t j=0; j<fFileHeader->fNbOfSamples; j++){mat(i,j)=(Double_t)0.;}}
2357  //............. read mat(,)
2359 
2360  for(Int_t i0StinEcha=0; i0StinEcha<fEcal->MaxCrysInStin(); i0StinEcha++)
2361  {
2362  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(iStexStin+1, i0StinEcha);
2363  vec(i0StexEcha) = 0;
2364  //.... average value over the samples
2365  for(Int_t i_samp=0; i_samp<fFileHeader->fNbOfSamples; i_samp++)
2366  {vec(i0StexEcha) += mat(i0StinEcha, i_samp);}
2367  vec(i0StexEcha) = vec(i0StexEcha)/fFileHeader->fNbOfSamples;
2368  }
2369  }
2370  return vec;
2371 }
2372 
2373 //-------------------------------------------------------------------------
2374 //
2375 // ReadPedestals(...)
2376 //
2377 //-------------------------------------------------------------------------
2378 TVectorD TEcnaRead::ReadPedestals(const Int_t& VecDim)
2379 {
2380 //Read the expectation values of the expectation values of the samples
2381 //for all the channels of a given Stin
2382 //in the ROOT file and return them in a TVectorD
2383 //
2384 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2385 
2386  TVectorD vec(VecDim);
2387  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2388 
2389  CnaResultTyp typ = cTypPed; // pedestals type
2390  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2391 
2392  Bool_t ok_open = kFALSE;
2393  Bool_t ok_read = kFALSE;
2394 
2395  if ( fOpenRootFile )
2396  {
2397  cout << "!TEcnaRead::ReadPedestals(...) *** ERROR ***> "
2398  << "Reading on file already open." << fTTBELL << endl;
2399  }
2400  else
2401  {
2402  ok_open = OpenRootFile(file_name, "READ");
2403 
2404  Int_t i_zero = 0;
2405  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2406 
2407  if ( ok_read == kTRUE )
2408  {
2409  fDataExist = kTRUE;
2410  for ( Int_t i_StexCrys = 0; i_StexCrys < VecDim; i_StexCrys++)
2411  {
2412  vec(i_StexCrys) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i_StexCrys);
2413  }
2414  }
2415  else
2416  {
2417  fDataExist = kFALSE;
2418  cout << "!TEcnaRead::ReadPedestals(...) *** ERROR ***> "
2419  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2420  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2421  << fTTBELL << endl;
2422  }
2423  }
2424  CloseRootFile(file_name);
2425  return vec;
2426 }
2427 
2428 //-------------------------------------------------------------------------
2429 //
2430 // ReadTotalNoise(...)
2431 //
2432 //-------------------------------------------------------------------------
2433 TVectorD TEcnaRead::ReadTotalNoise(const Int_t& VecDim)
2434 {
2435 //Read the expectation values of the sigmas of the samples
2436 //for all the channels of a given Stin
2437 //in the ROOT file and return them in a TVectorD
2438 //
2439 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2440 
2441  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2442  CnaResultTyp typ = cTypTno; // Total noise type
2443  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2444 
2445  Bool_t ok_open = kFALSE;
2446  Bool_t ok_read = kFALSE;
2447 
2448  if ( fOpenRootFile )
2449  {
2450  cout << "!TEcnaRead::ReadTotalNoise(...) *** ERROR ***> "
2451  << "Reading on file already open." << fTTBELL << endl;
2452  }
2453  else
2454  {
2455  ok_open = OpenRootFile(file_name, "READ");
2456 
2457  Int_t i_zero = 0;
2458  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2459 
2460  if ( ok_read == kTRUE )
2461  {
2462  fDataExist = kTRUE;
2463  for ( Int_t i_StexCrys = 0; i_StexCrys < VecDim; i_StexCrys++)
2464  {
2465  vec(i_StexCrys) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero,i_StexCrys);
2466  }
2467  }
2468  else
2469  {
2470  fDataExist = kFALSE;
2471  cout << "!TEcnaRead::ReadTotalNoise(...) *** ERROR ***> "
2472  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2473  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2474  << fTTBELL << endl;
2475  }
2476  }
2477  CloseRootFile(file_name);
2478  return vec;
2479 }
2480 //-------------------------------------------------------------------------
2481 //
2482 // ReadMeanOfCorrelationsBetweenSamples(...)
2483 //
2484 //-------------------------------------------------------------------------
2486 {
2487 //Read the Expectation values of the (sample,sample) correlations
2488 //for all the channels of a given Stin
2489 //in the ROOT file and return them in a TVectorD
2490 //
2491 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2492 
2493  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2494  CnaResultTyp typ = cTypMeanCorss; // mean of corss type
2495  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2496 
2497  Bool_t ok_open = kFALSE;
2498  Bool_t ok_read = kFALSE;
2499 
2500  if ( fOpenRootFile )
2501  {
2502  cout << "!TEcnaRead::ReadMeanOfCorrelationsBetweenSamples(...) *** ERROR ***> "
2503  << "Reading on file already open." << fTTBELL << endl;
2504  }
2505  else
2506  {
2507  ok_open = OpenRootFile(file_name, "READ");
2508 
2509  Int_t i_zero = 0;
2510  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2511 
2512  if ( ok_read == kTRUE )
2513  {
2514  fDataExist = kTRUE;
2515  for ( Int_t i_StexCrys = 0; i_StexCrys < VecDim; i_StexCrys++)
2516  {
2517  vec(i_StexCrys) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero,i_StexCrys);
2518  }
2519  }
2520  else
2521  {
2522  fDataExist = kFALSE;
2523  cout << "!TEcnaRead::ReadMeanOfCorrelationsBetweenSamples(...) *** ERROR ***> "
2524  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2525  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2526  << fTTBELL << endl;
2527  }
2528  }
2529 
2530  CloseRootFile(file_name);
2531  return vec;
2532 }
2533 
2534 //-------------------------------------------------------------------------
2535 //
2536 // ReadLowFrequencyNoise(...)
2537 //
2538 //-------------------------------------------------------------------------
2539 TVectorD TEcnaRead::ReadLowFrequencyNoise(const Int_t& VecDim)
2540 {
2541 //Read the sigmas of the expectation values of the samples
2542 //for all the channels of a given Stin
2543 //in the ROOT file and return them in a TVectorD
2544 //
2545 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2546 
2547  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2548  CnaResultTyp typ = cTypLfn; // low frequency noise type
2549  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2550 
2551  Bool_t ok_open = kFALSE;
2552  Bool_t ok_read = kFALSE;
2553 
2554  if ( fOpenRootFile )
2555  {
2556  cout << "!TEcnaRead::ReadLowFrequencyNoise(...) *** ERROR ***> "
2557  << "Reading on file already open." << fTTBELL << endl;
2558  }
2559  else
2560  {
2561  ok_open = OpenRootFile(file_name, "READ");
2562 
2563  Int_t i_zero = 0;
2564  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2565 
2566  if ( ok_read == kTRUE )
2567  {
2568  fDataExist = kTRUE;
2569  for ( Int_t i_StexCrys = 0; i_StexCrys < VecDim; i_StexCrys++)
2570  {
2571  vec(i_StexCrys) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero,i_StexCrys);
2572  }
2573  }
2574  else
2575  {
2576  fDataExist = kFALSE;
2577  cout << "!TEcnaRead::ReadLowFrequencyNoise(...) *** ERROR ***> "
2578  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2579  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2580  << fTTBELL << endl;
2581  }
2582  }
2583 
2584  CloseRootFile(file_name);
2585  return vec;
2586 }
2587 
2588 //-------------------------------------------------------------------------
2589 //
2590 // ReadHighFrequencyNoise(...)
2591 //
2592 //-------------------------------------------------------------------------
2593 TVectorD TEcnaRead::ReadHighFrequencyNoise(const Int_t& VecDim)
2594 {
2595 //Read the sigmas of the sigmas of the samples
2596 //for all the channels of a given Stin
2597 //in the ROOT file and return them in a TVectorD
2598 //
2599 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2600 
2601  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2602  CnaResultTyp typ = cTypHfn; // high frequency noise type
2603  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2604 
2605  Bool_t ok_open = kFALSE;
2606  Bool_t ok_read = kFALSE;
2607 
2608  if ( fOpenRootFile )
2609  {
2610  cout << "!TEcnaRead::ReadHighFrequencyNoise(...) *** ERROR ***> "
2611  << "Reading on file already open." << fTTBELL << endl;
2612  }
2613  else
2614  {
2615  ok_open = OpenRootFile(file_name, "READ");
2616 
2617  Int_t i_zero = 0;
2618  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2619 
2620  if ( ok_read == kTRUE )
2621  {
2622  fDataExist = kTRUE;
2623  for ( Int_t i_StexCrys = 0; i_StexCrys < VecDim; i_StexCrys++)
2624  {
2625  vec(i_StexCrys) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero,i_StexCrys);
2626  }
2627  }
2628  else
2629  {
2630  fDataExist = kFALSE;
2631  cout << "!TEcnaRead::ReadHighFrequencyNoise(...) *** ERROR ***> "
2632  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2633  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2634  << fTTBELL << endl;
2635  }
2636  }
2637 
2638  CloseRootFile(file_name);
2639  return vec;
2640 }
2641 
2642 //-------------------------------------------------------------------------
2643 //
2644 // ReadSigmaOfCorrelationsBetweenSamples(...)
2645 //
2646 //-------------------------------------------------------------------------
2648 {
2649 //Read the Expectation values of the (sample,sample) correlations
2650 //for all the channels of a given Stin
2651 //in the ROOT file and return them in a TVectorD
2652 //
2653 //Possible values for VecDim: (1) MatDim = fEcal->MaxCrysEcnaInStex()
2654 
2655  TVectorD vec(VecDim); for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2656  CnaResultTyp typ = cTypSigCorss; // sigma of corss type
2657  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2658 
2659  Bool_t ok_open = kFALSE;
2660  Bool_t ok_read = kFALSE;
2661 
2662  if ( fOpenRootFile )
2663  {
2664  cout << "!TEcnaRead::ReadSigmaOfCorrelationsBetweenSamples(...) *** ERROR ***> "
2665  << "Reading on file already open." << fTTBELL << endl;
2666  }
2667  else
2668  {
2669  ok_open = OpenRootFile(file_name, "READ");
2670 
2671  Int_t i_zero = 0;
2672  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2673 
2674  if ( ok_read == kTRUE )
2675  {
2676  fDataExist = kTRUE;
2677  for ( Int_t i_StexCrys = 0; i_StexCrys < VecDim; i_StexCrys++)
2678  {
2679  vec(i_StexCrys) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero,i_StexCrys);
2680  }
2681  }
2682  else
2683  {
2684  fDataExist = kFALSE;
2685  cout << "!TEcnaRead::ReadSigmaOfCorrelationsBetweenSamples(...) *** ERROR ***> "
2686  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2687  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2688  << fTTBELL << endl;
2689  }
2690  }
2691 
2692  CloseRootFile(file_name);
2693  return vec;
2694 }
2695 //============================================================================
2696 //
2697 // 1 D H I S T O S : A V E R A G E D M E A N
2698 //
2699 //============================================================================
2700 //-----------------------------------------------------------------------------
2701 //
2702 // ReadAveragedNumberOfEvents(...)
2703 //
2704 // NB: read "direct" numbers of evts and compute the average HERE
2705 // (different from ReadAveragedPedestals, Noises, etc...)
2706 //
2707 //-----------------------------------------------------------------------------
2708 TVectorD TEcnaRead::ReadAveragedNumberOfEvents(const Int_t& VecDim)
2709 {
2710 //Read the numbers of found events in the data
2711 //for the crystals and for the samples for all the Stin's in the Stex
2712 //in the ROOT file, compute the average on the samples and on the crystals
2713 //and return them in a TVectorD(MaxStinEcnaInStex)
2714 //
2715 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2716 
2717  TVectorD vecAveraged(VecDim);
2718  for(Int_t i=0; i<VecDim; i++){vecAveraged(i)=(Double_t)0.;}
2719 
2720  TVectorD vecMean(fEcal->MaxCrysEcnaInStex());
2721  for(Int_t i=0; i<fEcal->MaxCrysEcnaInStex(); i++){vecMean(i)=(Double_t)0.;}
2722 
2724 
2725  for(Int_t i0StexStin=0; i0StexStin<VecDim; i0StexStin++)
2726  {
2727  Int_t n1StexStin = i0StexStin+1;
2728  vecAveraged(i0StexStin) = 0;
2729  //.... average value over the crystals
2730  for(Int_t i0StinEcha=0; i0StinEcha<fEcal->MaxCrysInStin(); i0StinEcha++)
2731  {
2732  Int_t i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(i0StexStin+1, i0StinEcha);
2733 
2734  if( fStexName == "SM" )
2735  {vecAveraged(i0StexStin) += vecMean(i0StexEcha);}
2736 
2737  if( fStexName == "Dee" )
2738  {
2739  //--------- EE --> Special translation for mixed SCEcna (29 and 32)
2740  // Xtal 11 of SCEcna 29 -> Xtal 11 of SCEcna 10
2741  // Xtal 11 of SCEcna 32 -> Xtal 11 of SCEcna 11
2742  Int_t n1StinEcha = i0StinEcha+1;
2743  if( n1StexStin == 10 && n1StinEcha == 11 )
2744  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(29, i0StinEcha);}
2745  if( n1StexStin == 11 && n1StinEcha == 11 )
2746  {i0StexEcha = fEcalNumbering->Get0StexEchaFrom1StexStinAnd0StinEcha(32, i0StinEcha);}
2747  if( !( (n1StexStin == 29 || n1StexStin == 32) && n1StinEcha == 11 ) )
2748  {vecAveraged(i0StexStin) += vecMean(i0StexEcha);}
2749  }
2750  }
2751 
2752  Double_t xdivis = (Double_t)0.;
2753  if( fStexName == "SM" )
2754  {xdivis = (Double_t)fEcal->MaxCrysInStin();}
2755  if( fStexName == "Dee" )
2756  {xdivis = (Double_t)fEcalNumbering->MaxCrysInStinEcna(fFileHeader->fStex, i0StexStin+1, "TEcnaRead");}
2757 
2758  vecAveraged(i0StexStin) = vecAveraged(i0StexStin)/xdivis;
2759  }
2760  return vecAveraged;
2761 }
2762 
2763 //-------------------------------------------------------------------------
2764 //
2765 // ReadAveragedPedestals(...)
2766 //
2767 //-------------------------------------------------------------------------
2768 TVectorD TEcnaRead::ReadAveragedPedestals(const Int_t& VecDim)
2769 {
2770 //Read the expectation values of the Pedestals
2771 //for all the Stins of a given Stex
2772 //in the ROOT file and return them in a TVectorD
2773 //
2774 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2775 
2776  TVectorD vec(VecDim);
2777  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2778 
2779  CnaResultTyp typ = cTypAvPed; // averaged pedestals type
2780  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2781 
2782  Bool_t ok_open = kFALSE;
2783  Bool_t ok_read = kFALSE;
2784 
2785  if ( fOpenRootFile )
2786  {
2787  cout << "!TEcnaRead::ReadAveragedPedestals(...) *** ERROR ***> "
2788  << "Reading on file already open." << fTTBELL << endl;
2789  }
2790  else
2791  {
2792  ok_open = OpenRootFile(file_name, "READ");
2793 
2794  Int_t i_zero = 0;
2795  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2796 
2797  if ( ok_read == kTRUE )
2798  {
2799  fDataExist = kTRUE;
2800  for ( Int_t i0StexStin = 0; i0StexStin < VecDim; i0StexStin++)
2801  {
2802  vec(i0StexStin) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i0StexStin);
2803  }
2804  }
2805  else
2806  {
2807  fDataExist = kFALSE;
2808  cout << "!TEcnaRead::ReadAveragedPedestals(...) *** ERROR ***> "
2809  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2810  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2811  << fTTBELL << endl;
2812  }
2813  }
2814  CloseRootFile(file_name);
2815  return vec;
2816 } // end of ReadAveragedPedestals
2817 
2818 //-------------------------------------------------------------------------
2819 //
2820 // ReadAveragedTotalNoise(...)
2821 //
2822 //-------------------------------------------------------------------------
2823 TVectorD TEcnaRead::ReadAveragedTotalNoise(const Int_t& VecDim)
2824 {
2825 //Read the expectation values of the Total Noise
2826 //for all the Stins of a given Stex
2827 //in the ROOT file and return them in a TVectorD
2828 //
2829 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2830 
2831  TVectorD vec(VecDim);
2832  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2833 
2834  CnaResultTyp typ = cTypAvTno; // averaged Total Noise type
2835  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2836 
2837  Bool_t ok_open = kFALSE;
2838  Bool_t ok_read = kFALSE;
2839 
2840  if ( fOpenRootFile )
2841  {
2842  cout << "!TEcnaRead::ReadAveragedTotalNoise(...) *** ERROR ***> "
2843  << "Reading on file already open." << fTTBELL << endl;
2844  }
2845  else
2846  {
2847  ok_open = OpenRootFile(file_name, "READ");
2848 
2849  Int_t i_zero = 0;
2850  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2851 
2852  if ( ok_read == kTRUE )
2853  {
2854  fDataExist = kTRUE;
2855  for ( Int_t i0StexStin = 0; i0StexStin < VecDim; i0StexStin++)
2856  {
2857  vec(i0StexStin) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i0StexStin);
2858  }
2859  }
2860  else
2861  {
2862  fDataExist = kFALSE;
2863  cout << "!TEcnaRead::ReadAveragedTotalNoise(...) *** ERROR ***> "
2864  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2865  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2866  << fTTBELL << endl;
2867  }
2868  }
2869  CloseRootFile(file_name);
2870  return vec;
2871 }
2872 
2873 //-------------------------------------------------------------------------
2874 //
2875 // ReadAveragedLowFrequencyNoise(...)
2876 //
2877 //-------------------------------------------------------------------------
2878 TVectorD TEcnaRead::ReadAveragedLowFrequencyNoise(const Int_t& VecDim)
2879 {
2880 //Read the expectation values of the Pedestals
2881 //for all the Stins of a given Stex
2882 //in the ROOT file and return them in a TVectorD
2883 //
2884 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2885 
2886  TVectorD vec(VecDim);
2887  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2888 
2889  CnaResultTyp typ = cTypAvLfn; // averaged Low FrequencyNoise type
2890  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2891 
2892  Bool_t ok_open = kFALSE;
2893  Bool_t ok_read = kFALSE;
2894 
2895  if ( fOpenRootFile )
2896  {
2897  cout << "!TEcnaRead::ReadAveragedLowFrequencyNoise(...) *** ERROR ***> "
2898  << "Reading on file already open." << fTTBELL << endl;
2899  }
2900  else
2901  {
2902  ok_open = OpenRootFile(file_name, "READ");
2903 
2904  Int_t i_zero = 0;
2905  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2906 
2907  if ( ok_read == kTRUE )
2908  {
2909  fDataExist = kTRUE;
2910  for ( Int_t i0StexStin = 0; i0StexStin < VecDim; i0StexStin++)
2911  {
2912  vec(i0StexStin) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i0StexStin);
2913  }
2914  }
2915  else
2916  {
2917  fDataExist = kFALSE;
2918  cout << "!TEcnaRead::ReadAveragedLowFrequencyNoise(...) *** ERROR ***> "
2919  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2920  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2921  << fTTBELL << endl;
2922  }
2923  }
2924  CloseRootFile(file_name);
2925  return vec;
2926 } // end of ReadAveragedLowFrequencyNoise
2927 
2928 //-------------------------------------------------------------------------
2929 //
2930 // ReadAveragedHighFrequencyNoise(...)
2931 //
2932 //-------------------------------------------------------------------------
2933 TVectorD TEcnaRead::ReadAveragedHighFrequencyNoise(const Int_t& VecDim)
2934 {
2935 //Read the expectation values of the Pedestals
2936 //for all the Stins of a given Stex
2937 //in the ROOT file and return them in a TVectorD
2938 //
2939 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2940 
2941  TVectorD vec(VecDim);
2942  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2943 
2944  CnaResultTyp typ = cTypAvHfn; // averaged High FrequencyNoise type
2945  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
2946 
2947  Bool_t ok_open = kFALSE;
2948  Bool_t ok_read = kFALSE;
2949 
2950  if ( fOpenRootFile )
2951  {
2952  cout << "!TEcnaRead::ReadAveragedHighFrequencyNoise(...) *** ERROR ***> "
2953  << "Reading on file already open." << fTTBELL << endl;
2954  }
2955  else
2956  {
2957  ok_open = OpenRootFile(file_name, "READ");
2958 
2959  Int_t i_zero = 0;
2960  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
2961 
2962  if ( ok_read == kTRUE )
2963  {
2964  fDataExist = kTRUE;
2965  for ( Int_t i0StexStin = 0; i0StexStin < VecDim; i0StexStin++)
2966  {
2967  vec(i0StexStin) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i0StexStin);
2968  }
2969  }
2970  else
2971  {
2972  fDataExist = kFALSE;
2973  cout << "!TEcnaRead::ReadAveragedHighFrequencyNoise(...) *** ERROR ***> "
2974  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
2975  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
2976  << fTTBELL << endl;
2977  }
2978  }
2979  CloseRootFile(file_name);
2980  return vec;
2981 } // end of ReadAveragedHighFrequencyNoise
2982 
2983 //-------------------------------------------------------------------------
2984 //
2985 // ReadAveragedMeanOfCorrelationsBetweenSamples(...)
2986 //
2987 //-------------------------------------------------------------------------
2989 {
2990 //Read the expectation values of the Pedestals
2991 //for all the Stins of a given Stex
2992 //in the ROOT file and return them in a TVectorD
2993 //
2994 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
2995 
2996  TVectorD vec(VecDim);
2997  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
2998 
2999  CnaResultTyp typ = cTypAvMeanCorss; // averaged MeanOfCorrelationsBetweenSamples type
3000  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
3001 
3002  Bool_t ok_open = kFALSE;
3003  Bool_t ok_read = kFALSE;
3004 
3005  if ( fOpenRootFile )
3006  {
3007  cout << "!TEcnaRead::ReadAveragedMeanOfCorrelationsBetweenSamples(...) *** ERROR ***> "
3008  << "Reading on file already open." << fTTBELL << endl;
3009  }
3010  else
3011  {
3012  ok_open = OpenRootFile(file_name, "READ");
3013 
3014  Int_t i_zero = 0;
3015  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
3016 
3017  if ( ok_read == kTRUE )
3018  {
3019  fDataExist = kTRUE;
3020  for ( Int_t i0StexStin = 0; i0StexStin < VecDim; i0StexStin++)
3021  {
3022  vec(i0StexStin) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i0StexStin);
3023  }
3024  }
3025  else
3026  {
3027  fDataExist = kFALSE;
3028  cout << "!TEcnaRead::ReadAveragedMeanOfCorrelationsBetweenSamples(...) *** ERROR ***> "
3029  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
3030  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
3031  << fTTBELL << endl;
3032  }
3033  }
3034  CloseRootFile(file_name);
3035  return vec;
3036 } // end of ReadAveragedMeanOfCorrelationsBetweenSamples
3037 
3038 //-------------------------------------------------------------------------
3039 //
3040 // ReadAveragedSigmaOfCorrelationsBetweenSamples(...)
3041 //
3042 //-------------------------------------------------------------------------
3044 {
3045 //Read the expectation values of the Pedestals
3046 //for all the Stins of a given Stex
3047 //in the ROOT file and return them in a TVectorD
3048 //
3049 //Possible values for VecDim: (1) MatDim = fEcal->MaxStinEcnaInStex()
3050 
3051  TVectorD vec(VecDim);
3052  for(Int_t i=0; i<VecDim; i++){vec(i)=(Double_t)0.;}
3053 
3054  CnaResultTyp typ = cTypAvSigCorss; // averaged SigmaOfCorrelationsBetweenSamples type
3055  const Text_t *file_name = (const Text_t *)fCnaWrite->fRootFileNameShort.Data();
3056 
3057  Bool_t ok_open = kFALSE;
3058  Bool_t ok_read = kFALSE;
3059 
3060  if ( fOpenRootFile )
3061  {
3062  cout << "!TEcnaRead::ReadAveragedSigmaOfCorrelationsBetweenSamples(...) *** ERROR ***> "
3063  << "Reading on file already open." << fTTBELL << endl;
3064  }
3065  else
3066  {
3067  ok_open = OpenRootFile(file_name, "READ");
3068 
3069  Int_t i_zero = 0;
3070  ok_read = gCnaRootFile->ReadElement(typ, i_zero);
3071 
3072  if ( ok_read == kTRUE )
3073  {
3074  fDataExist = kTRUE;
3075  for ( Int_t i0StexStin = 0; i0StexStin < VecDim; i0StexStin++)
3076  {
3077  vec(i0StexStin) = gCnaRootFile->fCnaIndivResult->fMatHis(i_zero, i0StexStin);
3078  }
3079  }
3080  else
3081  {
3082  fDataExist = kFALSE;
3083  cout << "!TEcnaRead::ReadAveragedSigmaOfCorrelationsBetweenSamples(...) *** ERROR ***> "
3084  << fCnaWrite->fRootFileNameShort.Data() << ": ROOT file failed ->"
3085  << " quantity: <" << GetTypeOfQuantity(typ) << "> not available in file."
3086  << fTTBELL << endl;
3087  }
3088  }
3089  CloseRootFile(file_name);
3090  return vec;
3091 } // end of ReadAveragedSigmaOfCorrelationsBetweenSamples
3092 
3093 //=========================================================================
3094 //
3095 // M I S C E L L A N E O U S G E T M E T H O D S
3096 //
3097 //=========================================================================
3098 //-------------------------------------------------------------------------
3099 //
3100 // Get the name of the quantity from its "CnaResultTyp" type
3101 //
3102 
3103 //=========================================================================
3104 //
3105 // M I S C E L L A N E O U S G E T M E T H O D S
3106 //
3107 //=========================================================================
3108 //-------------------------------------------------------------------------
3109 //
3110 // Get the name of the quantity from its "CnaResultTyp" type
3111 //
3112 //-------------------------------------------------------------------------
3114 {
3115  TString quantity_name = "?";
3116 
3117  if( arg_typ == cTypNumbers)
3118  {
3119  if( fFlagSubDet == "EB" ){quantity_name = "SM numbers";}
3120  if( fFlagSubDet == "EE" ){quantity_name = "Dee numbers";}
3121  }
3122  if( arg_typ == cTypMSp ){quantity_name = "Mean of samples";}
3123  if( arg_typ == cTypSSp ){quantity_name = "Sigma of samples";}
3124 
3125  if( arg_typ == cTypNbOfEvts ){quantity_name = "Number of events";}
3126  if( arg_typ == cTypPed ){quantity_name = "Pedestals";}
3127  if( arg_typ == cTypTno ){quantity_name = "Total noise";}
3128  if( arg_typ == cTypLfn ){quantity_name = "LF noise";}
3129  if( arg_typ == cTypHfn ){quantity_name = "HF noise";}
3130  if( arg_typ == cTypMeanCorss){quantity_name = "Mean of cor(s,s')";}
3131  if( arg_typ == cTypSigCorss ){quantity_name = "Sigma of cor(s,s')";}
3132 
3133  if( arg_typ == cTypAvPed ){quantity_name = "Averaged pedestals";}
3134  if( arg_typ == cTypAvTno ){quantity_name = "Averaged total noise";}
3135  if( arg_typ == cTypAvLfn ){quantity_name = "Averaged LF noise";}
3136  if( arg_typ == cTypAvHfn ){quantity_name = "Averaged HF noise";}
3137  if( arg_typ == cTypAvMeanCorss){quantity_name = "Averaged mean of cor(s,s')";}
3138  if( arg_typ == cTypAvSigCorss ){quantity_name = "Averaged sigma of cor(s,s')";}
3139 
3140  if( arg_typ == cTypAdcEvt ){quantity_name = "Sample ADC a.f.o event number";}
3141 
3142  if( arg_typ == cTypCovCss ){quantity_name = "Cov(s,s')";}
3143  if( arg_typ == cTypCorCss ){quantity_name = "Cor(s,s')";}
3144  if( arg_typ == cTypLfCov ){quantity_name = "LF Cov(c,c')";}
3145  if( arg_typ == cTypLfCor ){quantity_name = "LF Cor(c,c')";}
3146  if( arg_typ == cTypHfCov ){quantity_name = "HF Cov(c,c')";}
3147  if( arg_typ == cTypHfCor ){quantity_name = "HF Cor(c,c')";}
3148 
3149  if( fFlagSubDet == "EB" )
3150  {
3151  if( arg_typ == cTypLFccMoStins){quantity_name = "Mean LF |Cor(c,c')| in (tow,tow')";}
3152  if( arg_typ == cTypHFccMoStins){quantity_name = "Mean HF |Cor(c,c')| in (tow,tow')";}
3153  }
3154  if( fFlagSubDet == "EE" )
3155  {
3156  if( arg_typ == cTypLFccMoStins){quantity_name = "Mean LF |Cor(c,c')| in (SC,SC')";}
3157  if( arg_typ == cTypHFccMoStins){quantity_name = "Mean HF |Cor(c,c')| in (SC,SC')";}
3158  }
3159  return quantity_name;
3160 }
3161 
3162 //-------------------------------------------------------------------------
3163 //
3164 // Get the ROOT file name (long and short)
3165 //
3166 //-------------------------------------------------------------------------
3169 //-------------------------------------------------------------------------
3170 //
3171 // GetStexStinFromIndex
3172 //
3173 // *====> DON'T SUPPRESS: this method is called by TEcnaRun and TEcnaHistos
3174 //
3175 //-------------------------------------------------------------------------
3176 Int_t TEcnaRead::GetStexStinFromIndex(const Int_t& i0StexStinEcna)
3177 {
3178 // Get the Stin number in Stex from the Stin index
3179 
3180  Int_t number = -1;
3181  TVectorD vec(fEcal->MaxStinEcnaInStex());
3182  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
3184  number = (Int_t)vec(i0StexStinEcna);
3185  return number;
3186 }
3187 
3189 {
3190  TString astring = "?";
3191  if (fFileHeader != 0){astring = fFileHeader->fTypAna;}
3192  else {cout << "!TEcnaRead::GetAnalysisName()> fFileHeader pointer = "
3193  << fFileHeader << endl;}
3194  return astring;
3195 }
3196 //------------------------------------------------------------------------
3198 {
3199  Int_t number = -1;
3200  if (fFileHeader != 0){number = fFileHeader->fFirstReqEvtNumber;}
3201  else {cout << "!TEcnaRead::GetFirstReqEvtNumber()> fFileHeader pointer = "
3202  << fFileHeader << endl;}
3203  return number;
3204 }
3205 //------------------------------------------------------------------------
3207 {
3208  Int_t number = -1;
3209  if (fFileHeader != 0){number = fFileHeader->fReqNbOfEvts;}
3210  else {cout << "!TEcnaRead::GetReqNbOfEvts()> fFileHeader pointer = "
3211  << fFileHeader << endl;}
3212  return number;
3213 }
3214 //------------------------------------------------------------------------
3215 
3217 //-------------------------------------------------------------------------
3218 //
3219 // GetStinIndex(n1StexStin)
3220 //
3221 //-------------------------------------------------------------------------
3222 Int_t TEcnaRead::GetStinIndex(const Int_t & n1StexStin)
3223 {
3224 //Get the index of the Stin from its number in Stex
3225 
3227  cout << "*TEcnaRead::GetStinIndex(...)> fEcal->MaxStinEcnaInStex() = "
3228  << fEcal->MaxStinEcnaInStex() << endl
3229  << " n1StexStin = " << n1StexStin
3230  << endl << endl;}
3231 
3232  Int_t Stin_index = n1StexStin-1; // suppose les 68 tours
3233 
3234 #define NOGT
3235 #ifndef NOGT
3236  Int_t Stin_index = -1;
3237  TVectorD vec(fEcal->MaxStinEcnaInStex());
3238  for(Int_t i=0; i<fEcal->MaxStinEcnaInStex(); i++){vec(i)=(Double_t)0.;}
3240 
3241  //........................... Get the Stin index
3242 
3243  for(Int_t i=0; i < fEcal->MaxStinEcnaInStex(); i++)
3244  {
3246  cout << "*TEcnaRead::GetStinIndex(...)> StinNumber[" << i << "] = "
3247  << vec[i] << endl;}
3248  if ( vec[i] == n1StexStin ){Stin_index = i;}
3249  }
3250 
3252  cout << "~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-" << endl;
3253  cout << "*TEcnaRead::GetStinIndex> Stin number: " << n1StexStin << endl
3254  << " Stin index : " << Stin_index << endl;
3255  cout << "~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-" << endl;}
3256 
3257  if ( Stin_index < 0 )
3258  {
3260  cout << "!TEcnaRead::GetStinIndex *** WARNING ***> n1StexStin" << n1StexStin << " : "
3261  << "index Stin not found"
3262  << fTTBELL << endl;}
3263  }
3264 #endif // NOGT
3265 
3266  return Stin_index;
3267 }
3268 
3269 //=========================================================================
3270 //
3271 // METHODS TO SET FLAGS TO PRINT (OR NOT) COMMENTS (DEBUG)
3272 //
3273 //=========================================================================
3274 
3276 {
3277 // Set flags to authorize printing of some comments concerning initialisations (default)
3278 
3280  cout << "*TEcnaRead::PrintComments()> Warnings and some comments on init will be printed" << endl;
3281 }
3282 
3284 {
3285 // Set flags to authorize printing of warnings
3286 
3288  cout << "*TEcnaRead::PrintWarnings()> Warnings will be printed" << endl;
3289 }
3290 
3292 {
3293 // Set flags to authorize printing of the comments of all the methods
3294 
3296  cout << "*TEcnaRead::PrintAllComments()> All the comments will be printed" << endl;
3297 }
3298 
3300 {
3301 // Set flags to forbid the printing of all the comments
3302 
3304 }
void Anew(const TString)
Definition: TEcnaRead.cc:394
Double_t *** fT3d_distribs
Definition: TEcnaRead.h:91
int i
Definition: DBlmapReader.cc:9
TVectorD ReadLowFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2539
TCnaResultType * fCnaIndivResult
Definition: TCnaRootFile.h:28
Int_t fCnew
Definition: TEcnaRead.h:48
Int_t fStex
Definition: TEcnaHeader.h:39
Int_t fHFccMoStinsCalc
Definition: TEcnaHeader.h:66
Int_t fAvLfnCalc
Definition: TEcnaHeader.h:56
Int_t fSSpCalc
Definition: TEcnaHeader.h:54
TString fRootFileStatus
Definition: TCnaRootFile.h:19
void Print()
Definition: TEcnaHeader.cc:131
Int_t fMemoStinNumbers
Definition: TEcnaRead.h:71
TEcnaRead & operator=(const TEcnaRead &)
Definition: TEcnaRead.cc:469
CnaResultTyp
TMatrixD ReadCovariancesBetweenSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1403
Int_t fUserChan
Definition: TEcnaRead.h:81
TString fPathRoot
Definition: TEcnaRead.h:73
TVectorD ReadAveragedMeanOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2988
Int_t fRunType
Definition: TEcnaHeader.h:46
Double_t ** fT3d2_distribs
Definition: TEcnaRead.h:92
Double_t * fT3d1_distribs
Definition: TEcnaRead.h:93
TString GetStartDate()
Definition: TEcnaRead.cc:623
TMatrixD ReadLowFrequencyCorrelationsBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1645
Int_t fAvMeanCorssCalc
Definition: TEcnaHeader.h:75
Int_t GetStinIndex(const Int_t &)
Definition: TEcnaRead.cc:3222
TVectorD ReadAveragedSigmaOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:3043
TVectorD ReadSigmaOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2647
TEcnaWrite * fCnaWrite
Definition: TEcnaRead.h:57
Int_t fgMaxCar
Definition: TEcnaRead.h:46
Int_t fHfCorCalc
Definition: TEcnaHeader.h:62
TString GetRootFileNameShort()
Definition: TEcnaRead.cc:3168
void PrintComments()
Definition: TEcnaRead.cc:3275
time_t GetStopTime()
Definition: TEcnaRead.cc:622
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
Int_t fReadyToReadRootFile
Definition: TEcnaRead.h:66
Int_t fReqNbOfEvts
Definition: TEcnaHeader.h:38
TFile * fRootFile
Definition: TCnaRootFile.h:20
Int_t fCodePrintAllComments
Definition: TEcnaRead.h:84
Int_t fUserSamp
Definition: TEcnaRead.h:80
Int_t fMSpCalc
Definition: TEcnaHeader.h:53
TMatrixD ReadHighFrequencyMeanCorrelationsBetweenStins(const Int_t &)
Definition: TEcnaRead.cc:2260
Int_t fNbOfSamples
Definition: TEcnaHeader.h:34
TVectorD ReadAveragedTotalNoise(const Int_t &)
Definition: TEcnaRead.cc:2823
Int_t GetNumberOfBinsSampleAsFunctionOfTime()
Definition: TEcnaRead.cc:3216
TVectorD ReadRelevantCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1519
TString fStopDate
Definition: TEcnaHeader.h:44
TMatrixD ReadLowFrequencyMeanCorrelationsBetweenStins(const Int_t &)
Definition: TEcnaRead.cc:2187
TString GetTypeOfQuantity(const CnaResultTyp)
Definition: TEcnaRead.cc:3113
Int_t fCodePrintWarnings
Definition: TEcnaRead.h:84
Int_t fMeanCorssCalc
Definition: TEcnaHeader.h:69
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
Int_t GetFirstReqEvtNumber()
Definition: TEcnaRead.cc:3197
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
Bool_t ReadRootFileHeader(const Int_t &)
Definition: TEcnaRead.cc:729
Int_t fHfCovCalc
Definition: TEcnaHeader.h:61
Bool_t ReadElement(Int_t)
Int_t fCodePrintNoComment
Definition: TEcnaRead.h:84
Int_t fSectChanSizeX
Definition: TEcnaRead.h:75
Int_t GetCodePrint(const TString)
Definition: TEcnaParCout.cc:77
Int_t * fT1d_StexStinFromIndex
Definition: TEcnaRead.h:69
Int_t fCorCssCalc
Definition: TEcnaHeader.h:60
TVectorD ReadStinNumbers(const Int_t &)
Definition: TEcnaRead.cc:888
TVectorD ReadSampleValues(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1048
TVectorD ReadSampleSigmas(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1274
T sqrt(T t)
Definition: SSEVec.h:28
Int_t fSectSampSizeY
Definition: TEcnaRead.h:75
Int_t GetStexStinFromIndex(const Int_t &)
Definition: TEcnaRead.cc:3176
TString fStexName
Definition: TEcnaRead.h:62
Int_t fAvTnoCalc
Definition: TEcnaHeader.h:55
TString fTTBELL
Definition: TEcnaRead.h:51
int j
Definition: DBlmapReader.cc:9
TVectorD ReadTotalNoise(const Int_t &)
Definition: TEcnaRead.cc:2433
void SetEcalSubDetector(const TString, const TEcnaNumbering *, const TEcnaWrite *)
Definition: TEcnaRead.cc:366
TVectorD ReadAveragedPedestals(const Int_t &)
Definition: TEcnaRead.cc:2768
TString GetStopDate()
Definition: TEcnaRead.cc:624
Int_t fAvHfnCalc
Definition: TEcnaHeader.h:57
TEcnaParCout * fCnaParCout
Definition: TEcnaRead.h:53
void PrintNoComment()
Definition: TEcnaRead.cc:3299
Int_t MaxCrysInStin()
TVectorD ReadPedestals(const Int_t &)
Definition: TEcnaRead.cc:2378
TString GetRootFileName()
Definition: TEcnaRead.cc:3167
TMatrixD ReadLowFrequencyCovariancesBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1576
TString fStartDate
Definition: TEcnaHeader.h:43
Bool_t DataExist()
Definition: TEcnaRead.cc:876
TEcnaParPaths * fCnaParPaths
Definition: TEcnaRead.h:54
Int_t fCdelete
Definition: TEcnaRead.h:49
void fCopy(const TEcnaRead &)
Definition: TEcnaRead.cc:414
TString GetAnalysisName()
Definition: TEcnaRead.cc:3188
Int_t MaxCrysInStinEcna(const Int_t &, const Int_t &, const TString)
void CloseFile()
TEcnaHeader * fFileHeader
Definition: TEcnaRead.h:56
TMatrixD ReadHighFrequencyCorrelationsBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1784
TVectorD ReadMeanOfCorrelationsBetweenSamples(const Int_t &)
Definition: TEcnaRead.cc:2485
void Init()
Definition: TEcnaRead.cc:309
TVectorD ReadHighFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2593
TString fTypAna
Definition: TEcnaHeader.h:33
TMatrixD ReadNumberOfEventsForSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:973
Bool_t OpenW(const Text_t *="")
Int_t fAvPedCalc
Definition: TEcnaHeader.h:74
Int_t fFirstReqEvtNumber
Definition: TEcnaHeader.h:36
Int_t GetReqNbOfEvts()
Definition: TEcnaRead.cc:3206
TEcnaParEcal * fEcal
Definition: TEcnaRead.h:58
Int_t fLfCorCalc
Definition: TEcnaHeader.h:64
Int_t fAdcEvtCalc
Definition: TEcnaHeader.h:52
Int_t MaxCrysEcnaInStex()
time_t fStartTime
Definition: TEcnaHeader.h:41
time_t fStopTime
Definition: TEcnaHeader.h:42
Int_t fLfCovCalc
Definition: TEcnaHeader.h:63
Double_t *** ReadSampleValuesSameFile(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1104
Int_t fFlagPrint
Definition: TEcnaRead.h:83
TEcnaNumbering * fEcalNumbering
Definition: TEcnaRead.h:59
TString GetRunType()
Definition: TEcnaRead.cc:625
Int_t fLFccMoStinsCalc
Definition: TEcnaHeader.h:65
Int_t fLastReqEvtNumber
Definition: TEcnaHeader.h:37
Bool_t fDataExist
Definition: TEcnaRead.h:88
int nlast
Definition: AMPTWrapper.h:47
TString fFlagSubDet
Definition: TEcnaRead.h:61
TMatrixD ReadCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1466
TVectorD ReadAveragedNumberOfEvents(const Int_t &)
Definition: TEcnaRead.cc:2708
TVectorD ReadAveragedHighFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2933
void HeaderParameters(TString, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaHeader.cc:114
Int_t Get0StexEchaFrom1StexStinAnd0StinEcha(const Int_t &, const Int_t &)
Bool_t LookAtRootFile()
Definition: TEcnaRead.cc:675
R__EXTERN TCnaRootFile * gCnaRootFile
Definition: TCnaRootFile.h:43
tuple cout
Definition: gather_cfg.py:41
Int_t MaxStinEcnaInStex()
Int_t fRunNumber
Definition: TEcnaHeader.h:35
TString GetRootFileNameShort()
Definition: TEcnaWrite.cc:270
Int_t fSigCorssCalc
Definition: TEcnaHeader.h:72
TMatrixD ReadHighFrequencyCovariancesBetweenChannels(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1715
Bool_t CloseRootFile(const Text_t *)
Definition: TEcnaRead.cc:844
TString GetEcalSubDetector()
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:476
TVectorD ReadAveragedLowFrequencyNoise(const Int_t &)
Definition: TEcnaRead.cc:2878
Bool_t OpenR(const Text_t *="")
virtual ~TEcnaRead()
Definition: TEcnaRead.cc:483
Bool_t fOpenRootFile
Definition: TEcnaRead.h:64
tuple status
Definition: ntuplemaker.py:245
Int_t * fTagStinNumbers
Definition: TEcnaRead.h:70
Int_t fStinNumbersCalc
Definition: TEcnaHeader.h:49
TString GetRootFileName()
Definition: TEcnaWrite.cc:269
void PrintAllComments()
Definition: TEcnaRead.cc:3291
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
Int_t fCodePrintComments
Definition: TEcnaRead.h:84
Int_t fSectSampSizeX
Definition: TEcnaRead.h:75
TVectorD ReadSampleMeans(const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaRead.cc:1215
TString fStinName
Definition: TEcnaRead.h:62
Int_t fAvSigCorssCalc
Definition: TEcnaHeader.h:76
Int_t fLookAtRootFile
Definition: TEcnaRead.h:67
Int_t fCovCssCalc
Definition: TEcnaHeader.h:59
Bool_t OpenRootFile(const Text_t *, TString)
Definition: TEcnaRead.cc:808
Int_t fSectChanSizeY
Definition: TEcnaRead.h:75
void PrintWarnings()
Definition: TEcnaRead.cc:3283
time_t GetStartTime()
Definition: TEcnaRead.cc:621
TVectorD ReadNumberOfEvents(const Int_t &)
Definition: TEcnaRead.cc:2338
void Adelete(const TString)
Definition: TEcnaRead.cc:403