CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TEcnaWrite.cc
Go to the documentation of this file.
1 //---------Author's Name: B.Fabbro DSM/IRFU/SPP CEA-Saclay
2 //----------Copyright: Those valid for CEA sofware
3 //----------Modified: 29/03/2010
5 
6 ClassImp(TEcnaWrite)
7 //______________________________________________________________________________
8 //
9 // TEcnaWrite.
10 //
11 //------------------------------------------------------------------------
12 //
13 // For more details on other classes of the CNA package:
14 //
15 // http://www.cern.ch/cms-fabbro/cna
16 //
17 //------------------------------------------------------------------------
18 //
19 
20 //--------------------------- TEcnaWrite.cc -------------------------------
21 //
22 // Creation (first version): 19 May 2005
23 //
24 // For questions or comments, please send e-mail to Bernard Fabbro:
25 //
26 // fabbro@hep.saclay.cea.fr
27 //
28 //------------------------------------------------------------------------
29 
31 {
32  //destructor
33 
34  //if (fEcal != 0){delete fEcal; fCdelete++;}
35  //if (fEcalNumbering != 0){delete fEcalNumbering; fCdelete++;}
36  //if (fCnaParPaths != 0){delete fCnaParPaths; fCdelete++;}
37  //if (fCnaParCout != 0){delete fCnaParCout; fCdelete++;}
38 
39  // cout << "[Info Management] CLASS: TEcnaWrite. DESTROY OBJECT: this = " << this << endl;
40 }
41 
42 //===================================================================
43 //
44 // Constructors
45 //
46 //===================================================================
48 {
49 
50  // cout << "[Info Management] CLASS: TEcnaWrite. CREATE OBJECT: this = " << this << endl;
51 
52  Init();
53 }
54 
55 TEcnaWrite::TEcnaWrite(const TString SubDet,
56  const TEcnaParPaths* pCnaParPaths,
57  const TEcnaParCout* pCnaParCout,
58  const TEcnaParEcal* pEcal,
59  const TEcnaNumbering* pEcalNumbering)
60 {
61 
62  // cout << "[Info Management] CLASS: TEcnaWrite. CREATE OBJECT: this = " << this << endl;
63 
64  Init();
65 
66  //----------------------------- Object management
67  fCnaParPaths = 0;
68  if( pCnaParPaths == 0 )
69  {fCnaParPaths = new TEcnaParPaths(); /*fCnew++*/ ;}
70  else
71  {fCnaParPaths = (TEcnaParPaths*)pCnaParPaths;}
72 
73  fCnaParCout = 0;
74  if( pCnaParCout == 0 )
75  {fCnaParCout = new TEcnaParCout(); /*fCnew++*/;}
76  else
77  {fCnaParCout = (TEcnaParCout*)pCnaParCout;}
78 
79  fEcal = 0;
80  if( pEcal == 0 )
81  {fEcal = new TEcnaParEcal(SubDet.Data()); /*fCnew++*/;}
82  else
83  {fEcal = (TEcnaParEcal*)pEcal;}
84 
85  fEcalNumbering = 0;
86  if( pEcalNumbering == 0 )
87  {fEcalNumbering = new TEcnaNumbering(SubDet.Data(), fEcal); /*fCnew++*/;}
88  else
89  {fEcalNumbering = (TEcnaNumbering*)pEcalNumbering;}
90 
91 
92  SetEcalSubDetector(SubDet.Data(), fEcal, fEcalNumbering);
93 }
94 
96 {
97  //----------------------------- Parameters values
98 
99  fgMaxCar = (Int_t)512; // max number of characters in TStrings
100  fCodeHeaderAscii = 0;
101  fCodeRoot = 1;
102 
103  //------------------------------------------- Codes
104  //................. presently used codes
105  fCodeNbOfEvts = 101;
106  fCodePed = 102;
107  fCodeTno = 103;
108  fCodeLfn = 104;
109  fCodeHfn = 105;
110  fCodeMeanCorss = 106;
111  fCodeSigCorss = 107;
112 
113  fCodeCovCss = 201;
114  fCodeCorCss = 202;
115 
116  //................. not yet used codes
117  //fCodeAdcEvt = 3;
118  //fCodeMSp = 4;
119  //fCodeSSp = 5;
120 
121  //fCodeAvPed = 17;
122  //fCodeAvTno = 6;
123  //fCodeAvMeanCorss = 18;
124  //fCodeAvSigCorss = 19;
125 
126  //fCodeLfCov = 11;
127  //fCodeLfCor = 12;
128  //fCodeHfCov = 9;
129  //fCodeHfCor = 10;
130 
131  //fCodeLFccMoStins = 13;
132  //fCodeHFccMoStins = 14;
133 
134  //----------------------------------------
135 
136  fUserSamp = 0;
137  fStexStinUser = 0;
138  fStinEchaUser = 0;
139 
140  fjustap_2d_ev = 0;
141  fjustap_1d_ev = 0;
142 
143  fjustap_2d_var = 0;
144  fjustap_1d_var = 0;
145 
146  fjustap_2d_cc = 0;
147  fjustap_1d_cc = 0;
148 
149  fjustap_2d_ss = 0;
150  fjustap_1d_ss = 0;
151 
153 
154 }
155 // end of Init()
156 
157 //===================================================================
158 //
159 // Methods
160 //
161 //===================================================================
162 
163 void TEcnaWrite::SetEcalSubDetector(const TString SubDet,
164  const TEcnaParEcal* pEcal,
165  const TEcnaNumbering* pEcalNumbering)
166 {
167  // Set Subdetector (EB or EE)
168 
169 
170  fEcal = 0;
171  if( pEcal == 0 )
172  {fEcal = new TEcnaParEcal(SubDet.Data()); fCnew++;}
173  else
174  {fEcal = (TEcnaParEcal*)pEcal;}
175 
176  Int_t MaxCar = fgMaxCar;
177  fFlagSubDet.Resize(MaxCar);
179 
180  fEcalNumbering = 0;
181  if( pEcalNumbering == 0 )
182  {fEcalNumbering = new TEcnaNumbering(SubDet.Data(), fEcal); fCnew++;}
183  else
184  {fEcalNumbering = (TEcnaNumbering*)pEcalNumbering;}
185 
186  //........................................................................
187  //
188  // (for ASCII files writing methods only) ...
189  //
190  // DEFINITION OF THE SECTOR SIZES
191  // FOR THE CORRELATION AND COVARIANCE MATRICES DISPLAY
192  //
193  // MUST BE A DIVISOR OF THE TOTAL NUMBER.
194  // ======================================
195  //
196  // Examples:
197  //
198  // (1) 25 channels => size = 25 or 5 (divisors of 25)
199  //
200  // 25 => matrix = 1 x 1 sector of size (25 x 25)
201  // = (1 x 1) x (25 x 25) = 1 x 625 = 625
202  // 5 => matrix = 5 x 5 sectors of size (5 x 5)
203  // = (5 x 5) x ( 5 x 5) = 25 x 25 = 625
204  //
205  // (2) 10 samples => size = 10, 5 or 2 (divisors of 10)
206  //
207  // 10 => matrix = 1 X 1 sectors of size (10 x 10)
208  // = (1 x 1) x (10 x 10) = 1 x 100 = 100
209  // 5 => matrix = 2 x 2 sectors of size (5 x 5)
210  // = (2 x 2) x ( 5 x 5) = 4 x 25 = 100
211  // 2 => matrix = 5 x 5 sectors of size (2 x 2)
212  // = (5 x 5) x ( 2 x 2) = 25 x 4 = 100
213  //
214  //........................................................................
219 
220  //........................................................................
221  //
222  // DEFINITION OF THE NUMBER OF VALUES BY LINE
223  // for the Expectation Values, Variances and.
224  // Event distributions by (channel,sample)
225  //
226  // MUST BE A DIVISOR OF THE TOTAL NUMBER.
227  // ======================================
228  //
229  // Examples:
230  // 1) For expectation values and variances:
231  //
232  // 25 channels => size = 5
233  // => sample sector = 5 lines of 5 values
234  // = 5 x 5 = 25 values
235  //
236  // 10 samples => size = 10
237  // => channel sector = 1 lines of 10 values
238  // = 1 x 10 = 10 values
239  //
240  // 2) For event distributions:
241  //
242  // 100 bins => size = 10
243  // => sample sector = 10 lines of 10 values
244  // = 10 x 10 = 100 values
245  //
246  //........................................................................
249 }//---------- (end of SetEcalSubDetector) ------------------
250 
251 //-------------------------------------------------------------------------
252 //
253 // Get methods for different run or file parameters
254 //
255 // W A R N I N G : some of these methods are called by external code
256 //
257 // D O N ' T S U P P R E S S !
258 //
259 //
260 // TString fRootFileNameShort
261 // TString fAnaType = typ_ana
262 // Int_t fRunNumber = run_number
263 // Int_t fFirstReqEvtNumber = nfirst
264 // Int_t fReqNbOfEvts = nevents
265 // Int_t fStexNumber = super_module
266 //
267 //-------------------------------------------------------------------------
277 
278 //.............................................................................................
279 Int_t TEcnaWrite::NumberOfEvents(Int_t* ArrayNbOfEvts,
280  const Int_t& MaxArray, const Int_t& NbOfReqEvts)
281 {
282  // CHECK THE NUMBER OF FOUND EVENTS, return rNumberOfEvents (NumberOfEvents())
283  // (number used to compute the average values over the events)
284 
285  Int_t rNumberOfEvents = 0;
286  Int_t PresentNumber = 0;
287  Int_t DifferentValue = 0;
288  Int_t EmptyChannel = 0;
289 
290  //........................................................ i_SSoSE = StexStin or StinEcha
291  for(Int_t i_SSoSE=0 ; i_SSoSE<MaxArray ; i_SSoSE++)
292  {
293  Int_t NbOfEvts = ArrayNbOfEvts[i_SSoSE];
294 
295  if( NbOfEvts > 0 )
296  {
297  if( PresentNumber == 0 )
298  {
299  PresentNumber = NbOfEvts;
300  }
301  else
302  {
303  if( NbOfEvts > PresentNumber )
304  {
305  PresentNumber = NbOfEvts;
306  DifferentValue++;
307  }
308  if( NbOfEvts < PresentNumber )
309  {
310  DifferentValue++;
311  }
312  }
313  }
314  else
315  {
316  EmptyChannel++;
317  }
318  }
319 
320  rNumberOfEvents = PresentNumber;
321 
322  if( EmptyChannel > 0 )
323  {
325  {
326  cout << "*TEcnaWrite::NumberOfEvents()> *** WARNING *** " << EmptyChannel
327  << " empty channels found." << endl;
328  }
329  }
330 
331  if( DifferentValue > 0 )
332  {
333  cout << "!TEcnaWrite::NumberOfEvents()> ******************************* W A R N I N G ***************************" << endl
334  << " NUMBER OF EVENTS NOT CONSTANT" << endl
335  << " The number of events is not the same for some channels and/or samples (empty channels not included)" << endl
336  << " Number of differences = " << DifferentValue << endl
337  << " Result ROOT file: " << fRootFileNameShort << endl
338  << " The maximum number (" << rNumberOfEvents << ") is considered as the number " << endl
339  << " of events for calculations of pedestals, noises and correlations." << endl
340  << " Some values of pedestals, noises and correlations may be wrong for channels" << endl
341  << " with number of events different from " << rNumberOfEvents << "." << endl
342  << " Please, check the histogram 'Numbers of events'." << endl
343  << "*******************************************************************************************************"
344  << fTTBELL << endl;
345  }
346  else
347  {
349  {
350  if( rNumberOfEvents < NbOfReqEvts )
351  {
352  cout << "*TEcnaWrite::NumberOfEvents()> *** INFO *** Number of events found in data = "
353  << rNumberOfEvents << ": less than number of requested events ( = " << NbOfReqEvts << ")" << endl;
354  }
355  }
356  }
357  return rNumberOfEvents;
358 }
359 
360 //.............................................................................................
361 Int_t TEcnaWrite::NumberOfEvents(Int_t** T2d_NbOfEvts, const Int_t& MaxCrysEcnaInStex,
362  const Int_t& MaxNbOfSamples, const Int_t& NbOfReqEvts)
363 {
364  // CHECK OF THE NUMBER OF FOUND EVENTS, return rNumberOfEvents (NumberOfEvents())
365  // (number used to compute the average values over the events)
366 
367  Int_t rNumberOfEvents = 0;
368  Int_t PresentNumber = 0;
369  Int_t DifferentValue = 0;
370 
371  for(Int_t i0StexEcha = 0 ; i0StexEcha < MaxCrysEcnaInStex ; i0StexEcha++)
372  {
373  for(Int_t i_samp = 0 ; i_samp < MaxNbOfSamples ; i_samp++)
374  {
375  Int_t NbOfEvts = T2d_NbOfEvts[i0StexEcha][i_samp];
376 
377  if( NbOfEvts > 0 )
378  {
379  if( PresentNumber == 0 )
380  {
381  PresentNumber = NbOfEvts;
382  }
383  else
384  {
385  if( NbOfEvts > PresentNumber )
386  {
387  PresentNumber = NbOfEvts;
388  DifferentValue++;
389  }
390  if( NbOfEvts < PresentNumber )
391  {
392  DifferentValue++;
393  }
394  }
395  }
396  }
397  }
398  //............................................................. (NumberOfEvents())
399  rNumberOfEvents = PresentNumber;
400 
401  if( DifferentValue > 0 )
402  {
403  cout << "!TEcnaWrite::NumberOfEvents()> ******************************* W A R N I N G ***************************" << endl
404  << " NUMBER OF EVENTS NOT CONSTANT" << endl
405  << " The number of events is not the same for some channels and/or samples (empty channels not included)" << endl
406  << " Number of differences = " << DifferentValue << endl
407  << " Result ROOT file: " << fRootFileNameShort << endl
408  << " The maximum number (" << rNumberOfEvents << ") is considered as the number " << endl
409  << " of events for calculations of pedestals, noises and correlations."
410  << " Some values of pedestals, noises and correlations may be wrong for channels" << endl
411  << " with number of events different from " << rNumberOfEvents << "." << endl
412  << " Please, check the histogram 'Numbers of events'." << endl
413  << "*******************************************************************************************************"
414  << fTTBELL << endl;
415  }
416  else
417  {
419  {
420  if( rNumberOfEvents < NbOfReqEvts )
421  {
422  cout << "*TEcnaWrite::NumberOfEvents()> *** INFO *** Number of events found in data = "
423  << rNumberOfEvents << ": less than number of requested events ( = " << NbOfReqEvts << ")" << endl;
424  }
425  }
426  }
427  return rNumberOfEvents;
428 
429 }//----- ( end of NumberOfEvents(...) ) ----------------
430 
431 void TEcnaWrite::RegisterFileParameters(const TString ArgAnaType,
432  const Int_t& ArgNbOfSamples, const Int_t& ArgRunNumber,
433  const Int_t& ArgFirstReqEvtNumber, const Int_t& ArgLastReqEvtNumber,
434  const Int_t& ArgReqNbOfEvts, const Int_t& ArgStexNumber)
435 {
436 
437  fAnaType = ArgAnaType;
438  fNbOfSamples = ArgNbOfSamples;
439  fRunNumber = ArgRunNumber;
440  fFirstReqEvtNumber = ArgFirstReqEvtNumber;
441  fLastReqEvtNumber = ArgLastReqEvtNumber;
442  fReqNbOfEvts = ArgReqNbOfEvts;
443  fStexNumber = ArgStexNumber;
444 }
445 
446 void TEcnaWrite::RegisterFileParameters(const TString ArgAnaType,
447  const Int_t& ArgNbOfSamples, const Int_t& ArgRunNumber,
448  const Int_t& ArgFirstReqEvtNumber, const Int_t& ArgLastReqEvtNumber,
449  const Int_t& ArgReqNbOfEvts, const Int_t& ArgStexNumber,
450  const TString ArgStartDate, const TString ArgStopDate,
451  const time_t ArgStartTime, const time_t ArgStopTime)
452 {
453  fAnaType = ArgAnaType;
454  fNbOfSamples = ArgNbOfSamples;
455  fRunNumber = ArgRunNumber;
456  fFirstReqEvtNumber = ArgFirstReqEvtNumber;
457  fLastReqEvtNumber = ArgLastReqEvtNumber;
458  fReqNbOfEvts = ArgReqNbOfEvts;
459  fStexNumber = ArgStexNumber;
460  fStartDate = ArgStartDate;
461 
462  fStopDate = ArgStopDate;
463  fStartTime = ArgStartTime;
464  fStopTime = ArgStopTime;
465 }
466 //=======================================================================
467 //
468 // FILE NAMES MANAGEMENT
469 //
470 //=======================================================================
471 //==============================================================================
472 //
473 // Results Filename Making (private)
474 //
475 //==============================================================================
477 void TEcnaWrite::fMakeResultsFileName(const Int_t& i_code)
478 {
479 //Results filename making (private)
480 
481  //----------------------------------------------------------------------
482  //
483  // Making of the name of the result file from the parameters set
484  // by call to RegisterFileParameters(...)
485  //
486  // Put the names in the following class attributes:
487  //
488  // fRootFileName, fRootFileNameShort,
489  // fAsciiFileName, fAsciiFileNameShort
490  //
491  // (Short means: without the directory path)
492  //
493  // set indications (run number, type of quantity, ...)
494  // and add the extension ".ascii" or ".root"
495  //
496  // ROOT: only one ROOT file: i_code = fCodeRoot.
497  // All the types of quantities
498  //
499  // ASCII: several ASCII files: i_code = code for one type of quantity
500  // each i_code which is not equal to fCodeRoot is also implicitly
501  // a code "fCodeAscii" (this last attribute is not in the class)
502  //
503  //----------------------------------------------------------------------
504 
505  char* f_in = new char[fgMaxCar]; fCnew++;
506  char* f_in_short = new char[fgMaxCar]; fCnew++;
507 
508  Int_t MaxCar = fgMaxCar;
509  fStexName.Resize(MaxCar);
510  fStexName = "SM or Dee?";
511 
512  MaxCar = fgMaxCar;
513  fStinName.Resize(MaxCar);
514  fStinName = "tower or SC?";
515 
516  if( fFlagSubDet == "EB" ){fStexName = "SM"; fStinName = "tower";}
517  if( fFlagSubDet == "EE" ){fStexName = "Dee"; fStinName = "SC";}
518 
519  // switch (i_code){
520 
521  //=================================== R O O T ========================= (fMakeResultsFileName)
522  TString sPointInterrog = "?";
523  TString sDollarHome = "$HOME";
524 
525  if (i_code == fCodeRoot)
526  {
527  if( fCnaParPaths->ResultsRootFilePath().Data() == sPointInterrog.Data() )
528  {
529  cout << "!TEcnaWrite::fMakeResultsFileName> * * * W A R N I N G * * * " << endl << endl
530  << " Path for results .root file not defined. Default option will be used here:" << endl
531  << " your results files will be written in your HOME directory." << endl << endl
532  << " In order to write the .root results file in a specific directory," << endl
533  << " you have to create a file named path_results_root in a subdirectory named ECNA" << endl
534  << " previously created in your home directory." << endl
535  << " This file must have only one line containing the path of the directory" << endl
536  << " where must be the .root result files." << endl
537  << endl;
538 
539  TString home_path = gSystem->Getenv("HOME");
540  fCnaParPaths->SetResultsRootFilePath(home_path.Data());
541  }
542 
543  if( fCnaParPaths->BeginningOfResultsRootFilePath().Data() == sDollarHome.Data() )
544  {
546  const Text_t *t_file_nohome = (const Text_t *)fCnaParPaths->ResultsRootFilePath().Data(); // /scratch0/cna/...
547 
548  TString home_path = gSystem->Getenv("HOME");
549  fCnaParPaths->SetResultsRootFilePath(home_path.Data()); // /afs/cern.ch/u/USER
550  fCnaParPaths->AppendResultsRootFilePath(t_file_nohome); // /afs/cern.ch/u/USER/scratch0/cna/...
551  }
552 
553  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d",
556  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d",
557  fAnaType.Data(), fNbOfSamples,
559  }
560 
561  //=================================== A S C I I ==================== (fMakeResultsFileName)
562 
563  if (i_code != fCodeRoot)
564  {
565  if (i_code == fCodeHeaderAscii)
566  {
567  if( fCnaParPaths->ResultsAsciiFilePath().Data() == sPointInterrog.Data() )
568  {
569  cout << "!TEcnaWrite::fMakeResultsFileName> * * * W A R N I N G * * * " << endl << endl
570  << " Path for results .ascii file not defined. Default option will be used here:" << endl
571  << " your results files will be written in your HOME directory." << endl << endl
572  << " In order to write the .ascii results file in a specific directory," << endl
573  << " you have to create a file named path_results_ascii in a subdirectory named ECNA" << endl
574  << " previously created in your home directory." << endl
575  << " This file must have only one line containing the path of the directory" << endl
576  << " where must be the .ascii result files." << endl
577  << endl;
578 
579  TString home_path = gSystem->Getenv("HOME");
580  fCnaParPaths->SetResultsAsciiFilePath(home_path.Data());
581  }
582 
583  if( fCnaParPaths->BeginningOfResultsAsciiFilePath().Data() == sDollarHome.Data() )
584  {
586  const Text_t *t_file_nohome = (const Text_t *)fCnaParPaths->ResultsAsciiFilePath().Data(); // /scratch0/cna/...
587 
588  TString home_path = gSystem->Getenv("HOME");
589  fCnaParPaths->SetResultsAsciiFilePath(home_path.Data()); // /afs/cern.ch/u/USER
590  fCnaParPaths->AppendResultsAsciiFilePath(t_file_nohome); // /afs/cern.ch/u/USER/scratch0/cna/...
591  }
592  }
593 
594  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_header",
597  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_header",
600  }
601 
602  //-------------------------------------------------------------- (fMakeResultsFileName)
603  if (i_code == fCodeNbOfEvts)
604  {
605  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_NbOfEvents",
608  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_NbOfEvents",
611  }
612 
613  if (i_code == fCodePed)
614  {
615  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_Pedestals",
618  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_Pedestals",
621  }
622 
623  if (i_code == fCodeTno)
624  {
625  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_TotalNoise",
628  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_TotalNoise",
631  }
632 
633  if (i_code == fCodeLfn)
634  {
635  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_LFNoise",
638  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_LFNoise",
641  }
642 
643  if (i_code == fCodeHfn)
644  {
645  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_HFNoise",
648  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_HFNoise",
651  }
652 
653  if (i_code == fCodeMeanCorss)
654  {
655  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_MeanCorss",
658  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_MeanCorss",
661  }
662 
663  if (i_code == fCodeSigCorss)
664  {
665  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_SigmaCorss",
668  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_SigmaCorss",
671  }
672 
673  if (i_code == fCodeCovCss)
674  {
675  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_Covss_%s%d_Channel_%d",
679  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_Covss_%s%d_Channel_%d",
683  }
684 
685  if (i_code == fCodeCorCss)
686  {
687  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_Corss_%s%d_Channel_%d",
691  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_Corss_%s%d_Channel_%d",
695  }
696 
697  //------- (not used yet)
698 #define OCOD
699 #ifndef OCOD
700  if (i_code == fCodeMSp)
701  {
702  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_SampleMeans",
705  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_SampleMeans",
708  }
709 
710  if (i_code == fCodeSSp)
711  {
712  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_SampleSigmas",
715  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_SampleSigmas",
718  }
719 
720  if( i_code == fCodeAvTno)
721  {
722  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_AveragedTotalNoise_c%d",
725  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_AveragedTotalNoise_c%d",
728  }
729 
730  if( i_code == fCodeLfCov)
731  {
732  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_LF_cov",
735  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_LF_cov",
738  }
739 
740  if ( i_code == fCodeLfCor)
741  {
742  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_LF_cor",
745  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_LF_cor",
748  }
749 
750  if (i_code == fCodeAvPed)
751  {
752  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_AveragedPedestals",
755  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_AveragedPedestals",
758  }
759 
760  if (i_code == fCodeAvMeanCorss)
761  {
762  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_AveragedMeanCorss%d",
765  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_AveragedMeanCorss%d",
768  }
769 
770  if (i_code == fCodeAvSigCorss)
771  {
772  sprintf(f_in, "%s/%s_S1_%d_R%d_%d_%d_%d_%s%d_AveragedSigmaCorss%d",
775  sprintf(f_in_short, "%s_S1_%d_R%d_%d_%d_%d_%s%d_AveragedSigmaCorss%d",
778  }
779 #endif // OCOD
780 
781  //----------------------------------------------------------- (fMakeResultsFileName)
782 
783  // default:
784  // cout << "*TEcnaWrite::fMakeResultsFileName(const Int_t& i_code)> "
785  // << "wrong header code , i_code = " << i_code << endl;
786  // }
787 
788  //======================================= f_name
789 
790  char* f_name = new char[fgMaxCar]; fCnew++;
791 
792  for (Int_t i = 0 ; i < fgMaxCar ; i++){f_name[i] = '\0';}
793 
794  Int_t ii = 0;
795  for (Int_t i = 0 ; i < fgMaxCar ; i++)
796  {
797  if ( f_in[i] != '\0' ){f_name[i] = f_in[i]; ii++;}
798  else {break;} // va directement a if ( ii+5 < fgMaxCar ) puis... f_name[ii] = '.';
799  }
800 
801  if ( ii+5 < fgMaxCar )
802  {
803  //.......... writing of the file extension (.root or .ascii) (fMakeResultsFileName)
804 
805  //------------------------------------------- extension .ascii
806  if ( i_code != fCodeRoot || i_code == fCodeNbOfEvts )
807  {
808  f_name[ii] = '.'; f_name[ii+1] = 'a';
809  f_name[ii+2] = 's'; f_name[ii+3] = 'c';
810  f_name[ii+4] = 'i'; f_name[ii+5] = 'i';
811 
812  fAsciiFileName = f_name;
813  }
814  //------------------------------------------- extension .root
815  if ( i_code == fCodeRoot )
816  {
817  f_name[ii] = '.'; f_name[ii+1] = 'r';
818  f_name[ii+2] = 'o'; f_name[ii+3] = 'o'; f_name[ii+4] = 't';
819 
820  fRootFileName = f_name;
821  }
822  }
823  else
824  {
825  cout << "*TEcnaWrite::fMakeResultsFileName(...)> Name too long (for f_name)."
826  << " No room enough for the extension. (ii = " << ii << ")"
827  << fTTBELL << endl;
828  }
829 
830 
831  //====================================== f_name_short (fMakeResultsFileName)
832 
833  char* f_name_short = new char[fgMaxCar]; fCnew++;
834 
835  for (Int_t i = 0 ; i < fgMaxCar ; i++){f_name_short[i] = '\0';}
836 
837  ii = 0;
838  for (Int_t i = 0 ; i < fgMaxCar ; i++)
839  {
840  if ( f_in_short[i] != '\0' ){f_name_short[i] = f_in_short[i]; ii++;}
841  else {break;} // va directement a f_name_short[ii] = '.';
842  }
843 
844  if ( ii+5 < fgMaxCar )
845  {
846  //.......... writing of the file extension (.root or .ascii)
847 
848  //-------------------------------------------extension .ascii
849  if ( i_code != fCodeRoot || i_code == fCodeNbOfEvts )
850  {
851  f_name_short[ii] = '.'; f_name_short[ii+1] = 'a';
852  f_name_short[ii+2] = 's'; f_name_short[ii+3] = 'c';
853  f_name_short[ii+4] = 'i'; f_name_short[ii+5] = 'i';
854 
855  fAsciiFileNameShort = f_name_short;
856  }
857 
858  //-------------------------------------------- extension .root
859  if ( i_code == fCodeRoot )
860  {
861  f_name_short[ii] = '.'; f_name_short[ii+1] = 'r';
862  f_name_short[ii+2] = 'o'; f_name_short[ii+3] = 'o'; f_name_short[ii+4] = 't';
863 
864  fRootFileNameShort = f_name_short;
865  }
866  }
867  else
868  {
869  cout << "*TEcnaWrite::fMakeResultsFileName(...)> Name too long (for f_name_short)."
870  << " No room enough for the extension. (ii = " << ii << ")"
871  << fTTBELL << endl;
872  }
873  delete [] f_name; f_name = 0; fCdelete++;
874  delete [] f_name_short; f_name_short = 0; fCdelete++;
875 
876  delete [] f_in; f_in = 0; fCdelete++;
877  delete [] f_in_short; f_in_short = 0; fCdelete++;
878 
879 } // end of fMakeResultsFileName
880 
881 //==========================================================================================
882 //
883 //
884 //
885 //==========================================================================================
886 
887 void TEcnaWrite::fAsciiFileWriteHeader(const Int_t& i_code)
888 {
889 //Ascii results file header writing (private). Called by the WriteAscii...() methods
890 
891  //-----------------------------------------------
892  //
893  // opening of the ASCII results file
894  // and writing of its header
895  //
896  //-----------------------------------------------
897 
898  if(fAsciiFileName.BeginsWith("$HOME"))
899  {
900  fAsciiFileName.Remove(0,5);
901  TString EndOfAsciiFileName = fAsciiFileName;
902  const Text_t *t_file_nohome = (const Text_t *)EndOfAsciiFileName.Data(); // const Text_t* -> EndOfAsciiFileName
903  // ( /scratch0/cna/... )
904  TString home_path = gSystem->Getenv("HOME");
905  fAsciiFileName = home_path; // fAsciiFileName = absolute HOME path ( /afs/cern.ch/u/USER )
906  fAsciiFileName.Append(t_file_nohome); // Append (const Text_t* -> EndOfAsciiFileName) to fAsciiFileName
907  // ( /afs/cern.ch/u/USER/scratch0/cna/... )
908  }
909 
910  fFcout_f.open(fAsciiFileName.Data());
911 
912  fFcout_f << "*** File: " << fAsciiFileName
913  << " *** " << endl << endl;
914  fFcout_f << "*Analysis name : " << fAnaType << endl;
915  fFcout_f << "*First-Last samples : 1 - " << fNbOfSamples << endl;
916  fFcout_f << "*Run number : " << fRunNumber << endl;
917  fFcout_f << "*First requested event number : " << fFirstReqEvtNumber << endl;
918  fFcout_f << "*Last requested event number : " << fLastReqEvtNumber << endl;
919  fFcout_f << "*Requested number of events : " << fReqNbOfEvts << endl;
920  if( fFlagSubDet == "EB" )
921  {fFcout_f << "*SuperModule number : " << fStexNumber << endl;}
922  if( fFlagSubDet == "EE" )
923  {fFcout_f << "*Dee number : " << fStexNumber << endl;}
924  fFcout_f << "*Date first requested event : " << fStartDate;
925  fFcout_f << "*Date last requested event : " << fStopDate << endl;
926  fFcout_f << endl;
927 
928  //=========================================================================
929  // closing of the results file if i_code = fCodeHeaderAscii only.
930  // closing is done in the fT1dWriteAscii() and fT2dWriteAscii() methods
931  // except for i_code = fCodeHeaderAscii
932  //=========================================================================
933  if(i_code == fCodeHeaderAscii){fFcout_f.close();}
934 }
935 
936 //=========================================================================
937 //
938 // W R I T I N G M E T H O D S : R O O T F I L E S
939 //
940 // The root files are written by TEcnaRun since the arrays are computed
941 // by this class (arrays fT2d_..., fT1d_..) and are private attributes.
942 // No writing method in ROOT file here.
943 // Just the making of the file name
944 //
945 //=========================================================================
946 
947 //=========================================================================
948 //
949 // W R I T I N G M E T H O D S : A S C I I F I L E S
950 //
951 // Ascii file are treated on the same footing as plots in the
952 // TEcnaHistos methods.
953 // The arrays are TVectorD or TMatrixD and are arguments of the
954 // writting methods (WriteAsciiHisto, fT2dWriteAscii)
955 //
956 //=========================================================================
957 //
958 // In the following, we describe:
959 //
960 // (1) The method which gets the path for the results ASCII files
961 // from a "cna-configuration" file
962 // (2) The codification for the names of the ASCII files
963 // (3) The methods which writes the results in the ASCII files
964 //
965 //
966 //
967 // (1)-----------> Method to set the path for the results ASCII files
968 //
969 // void MyCnaRun->GetPathForResultsAsciiFiles(pathname);
970 //
971 // TString pathname = name of a "cna-config" file located
972 // in the user's HOME directory and containing one line which
973 // specifies the path where must be written the .ascii result files.
974 // (no slash at the end of the string)
975 //
976 // DEFAULT:
977 // void MyCnaRun->GetPathForResultsAsciiFiles();
978 // If there is no argument, the "cna-config" file must be named
979 // "path_results_ascii.ecna" and must be located in the user's HOME
980 // directory
981 //
982 //
983 // (2)-----------> Codification for the names of the ASCII files (examples):
984 //
985 // aaa_nnnS_Rrrr_fff_ttt_SMnnn_pedestals.ascii OR aaa_nnnS_Rrrr_fff_ttt_Deennn_pedestals.ascii
986 // aaa_nnnS_Rrrr_fff_ttt_SMnnn_HF_noise.ascii OR aaa_nnnS_Rrrr_fff_ttt_Deennn_HF_noise.ascii
987 // aaa_nnnS_Rrrr_fff_ttt_SMnnn_corss_cCCC.ascii OR aaa_nnnS_Rrrr_fff_ttt_Deennn_corss_cCCC.ascii
988 // etc...
989 //
990 // with:
991 // aaa = Analysis name
992 // rrr = Run number
993 // fff = First requested event number
994 // ttt = Number of requested events
995 // CCC = Electronic Channel number in Stex
996 // nnn = SM number or Dee number
997 //
998 // Examples:
999 // StdPed12_10S_R66689_1_50_SM1_pedestals.ascii
1000 // StdPed6_10S_R66689_1_50_Dee3_cor_ss_c2234.ascii
1001 //
1002 //
1003 // (3)-----------> Methods which write the ASCII files:
1004 //
1005 // The methods which write the ASCII files are the following:
1006 //
1007 // void WriteAsciiCovariancesBetweenSamples(Channel, MatrixSize, TMatrixD matrix);
1008 // void WriteAsciiCorrelationsBetweenSamples(Channel, MatrixSize, TMatrixD matrix);
1009 // void fT2dWriteAscii(code, px, py, MatrixSize, TMatrixD matrix) [private]
1010 // void WriteAsciiHisto(CodeHisto, HistoSize, TVectorD histo)
1011 //
1012 // Each of these methods corresponds to a "calculation method" of TEcnaRun.
1013 // The calculation method of TEcnaRun must have been been called before
1014 // using the writing method of TEcnaWrite.
1015 //==========================================================================================
1016 
1017 //-------------------------------------------------------------------------------------------
1018 //
1019 // WriteAsciiHisto()
1020 //
1021 // Stex = SM or Dee , Stin = Tower or SC
1022 //
1023 //-------------------------------------------------------------------------------------------
1024 void TEcnaWrite::WriteAsciiHisto(const TString HistoCode, const Int_t& HisSize,
1025  const TVectorD& read_histo)
1026 {
1027 //Write histo with correspondance CNA-channel <-> xtal number in SM or Dee
1028 
1029  // BuildCrysTable() is called in the method Init() which is called by the constructor
1030 
1031  Int_t i_code = fCodeNbOfEvts;
1032 
1033  //--------------------------------------------------------------------------------
1034  if( HistoCode == "D_NOE_ChNb" ){i_code = fCodeNbOfEvts;}
1035  if( HistoCode == "D_Ped_ChNb" ){i_code = fCodePed;}
1036  if( HistoCode == "D_TNo_ChNb" ){i_code = fCodeTno;}
1037  if( HistoCode == "D_LFN_ChNb" ){i_code = fCodeLfn;}
1038  if( HistoCode == "D_HFN_ChNb" ){i_code = fCodeHfn;}
1039  if( HistoCode == "D_MCs_ChNb" ){i_code = fCodeMeanCorss;}
1040  if( HistoCode == "D_SCs_ChNb" ){i_code = fCodeSigCorss;}
1041 
1042  fMakeResultsFileName(i_code); // => Making of the results .ascii file name
1043  fAsciiFileWriteHeader(i_code); // => Open of the file associated with stream fFcout_f
1044 
1045  //..................................... format numerical values
1046  fFcout_f << setiosflags(ios::showpoint | ios::uppercase);
1047  fFcout_f << setprecision(3) << setw(6);
1048  fFcout_f.setf(ios::dec, ios::basefield);
1049  fFcout_f.setf(ios::fixed, ios::floatfield);
1050  fFcout_f.setf(ios::left, ios::adjustfield);
1051  fFcout_f.setf(ios::right, ios::adjustfield);
1052 
1053  cout << setiosflags(ios::showpoint | ios::uppercase);
1054  cout << setprecision(3) << setw(6);
1055  cout.setf(ios::dec, ios::basefield);
1056  cout.setf(ios::fixed, ios::floatfield);
1057  cout.setf(ios::left, ios::adjustfield);
1058  cout.setf(ios::right, ios::adjustfield);
1059 
1060  //........................................................ WriteAsciiHisto
1061  TString aStexName;
1062  Int_t MaxCar = fgMaxCar;
1063  aStexName.Resize(MaxCar);
1064  aStexName = "SM or Dee?";
1065 
1066  TString aStinName;
1067  MaxCar = fgMaxCar;
1068  aStinName.Resize(MaxCar);
1069  aStinName = "Tower or SC?";
1070 
1071  TString aHoco;
1072  MaxCar = fgMaxCar;
1073  aHoco.Resize(MaxCar);
1074  aHoco = "Eta or IX?";
1075 
1076  TString aVeco;
1077  MaxCar = fgMaxCar;
1078  aVeco.Resize(MaxCar);
1079  aVeco = "Phi or IY?";
1080 
1081  TString aSpecifa;
1082  MaxCar = fgMaxCar;
1083  aSpecifa.Resize(MaxCar);
1084  aSpecifa = " ";
1085 
1086  TString aSpecifc;
1087  MaxCar = fgMaxCar;
1088  aSpecifc.Resize(MaxCar);
1089  aSpecifc = " ";
1090 
1091  TString aSpecifd;
1092  MaxCar = fgMaxCar;
1093  aSpecifd.Resize(MaxCar);
1094  aSpecifd = " ";
1095 
1096  TString aSpecife;
1097  MaxCar = fgMaxCar;
1098  aSpecife.Resize(MaxCar);
1099  aSpecife = " ";
1100 
1101  TString aSpecif1;
1102  MaxCar = fgMaxCar;
1103  aSpecif1.Resize(MaxCar);
1104  aSpecif1 = " ";
1105 
1106  TString aSpecif2;
1107  MaxCar = fgMaxCar;
1108  aSpecif2.Resize(MaxCar);
1109  aSpecif2 = " ";
1110 
1111  if( fFlagSubDet == "EB" )
1112  {
1113  aStexName = "SM " ; aStinName = "tower" ; aSpecifa = " channel# ";
1114  aHoco = " Eta "; aVeco = " Phi "; aSpecifc = " channel# ";
1115  aSpecifd = " crystal# "; aSpecife = "SM ";
1116  }
1117  if( fFlagSubDet == "EE" )
1118  {
1119  aStexName = "Dee " ; aStinName = " SC " ; aSpecifa = " Sector# ";
1120  aHoco = " IX "; aVeco = " IY "; aSpecifc = " crystal# ";
1121  aSpecifd = " SC # "; aSpecife = "Sector";
1122  }
1123 
1124  //........................................................ WriteAsciiHisto
1125 
1126  for (Int_t i0StexEcha=0; i0StexEcha<HisSize; i0StexEcha++)
1127  {
1128  Int_t n1StexStin = 0;
1129  Int_t StexStinEcna = 0;
1130  Int_t i0StinEcha = 0;
1131  Int_t n1StinEcha = 0;
1132  Int_t n1StexCrys = 0;
1133  Int_t n1DataSector = 0;
1134  Int_t n1SCinDS = 0;
1135 
1136  if( fFlagSubDet == "EB")
1137  {
1138  n1StexStin = fEcalNumbering->Get1SMTowFrom0SMEcha(i0StexEcha);
1139  StexStinEcna = n1StexStin;
1140  i0StinEcha = fEcalNumbering->Get0TowEchaFrom0SMEcha(i0StexEcha);
1141  n1StexCrys = fEcalNumbering->Get1SMCrysFrom1SMTowAnd0TowEcha(n1StexStin, i0StinEcha);
1142  }
1143  if( fFlagSubDet == "EE")
1144  {
1145  StexStinEcna = fEcalNumbering->Get1DeeSCEcnaFrom0DeeEcha(i0StexEcha);
1146  n1DataSector = fEcalNumbering->GetDSFrom1DeeSCEcna(fStexNumber, StexStinEcna);
1147  n1SCinDS = fEcalNumbering->GetDSSCFrom1DeeSCEcna(fStexNumber, StexStinEcna);
1148  n1StexStin = fEcalNumbering->GetDeeSCConsFrom1DeeSCEcna(fStexNumber, StexStinEcna);
1149  n1StinEcha = fEcalNumbering->Get1SCEchaFrom0DeeEcha(i0StexEcha);
1150  }
1151 
1152  if( n1StexStin > 0 )
1153  {
1154  if( (fFlagSubDet == "EB" && i0StinEcha == 0) || (fFlagSubDet == "EE" && n1StinEcha == 1) )
1155  {
1156  if( HistoCode == "D_NOE_ChNb" ){aSpecif1 = "Number of"; aSpecif2 = " Events (requested)";}
1157  if( HistoCode == "D_Ped_ChNb" ){aSpecif1 = "Pedestals"; aSpecif2 = " ";}
1158  if( HistoCode == "D_TNo_ChNb" ){aSpecif1 = " Total "; aSpecif2 = " Noise ";}
1159  if( HistoCode == "D_MCs_ChNb" ){aSpecif1 = " Mean of "; aSpecif2 = " Cor(s,s) ";}
1160  if( HistoCode == "D_LFN_ChNb" ){aSpecif1 = " Low Fq"; aSpecif2 = " Noise ";}
1161  if( HistoCode == "D_HFN_ChNb" ){aSpecif1 = " High Fq"; aSpecif2 = " Noise ";}
1162  if( HistoCode == "D_SCs_ChNb" ){aSpecif1 = " Sigma of"; aSpecif2 = " Cor(s,s) ";}
1163 
1164  fFcout_f << endl;
1165 
1166  fFcout_f << aSpecifa.Data()
1167  << " " << aStinName.Data() << "# "
1168  << aSpecifc.Data()
1169  << aSpecifd.Data()
1170  << aHoco.Data()
1171  << aVeco.Data()
1172  << aSpecif1.Data() << endl;
1173 
1174  fFcout_f << " in " << aStexName.Data()
1175  << " in " << aStexName.Data()
1176  << " in " << aStinName.Data()
1177  << " in " << aSpecife.Data()
1178  << " in " << aStexName.Data()
1179  << " in " << aStexName.Data()
1180  << aSpecif2.Data() << endl << endl;
1181  }
1182 
1183  Double_t value = read_histo(i0StexEcha);
1184 
1185  if( fFlagSubDet == "EB" )
1186  {
1187  fFcout_f << setw(7) << i0StexEcha
1188  << setw(8) << n1StexStin
1189  << setw(11) << i0StinEcha // (Electronic channel number in tower)
1190  << setw(10) << n1StexCrys
1191  << setw(10) << (Int_t)fEcalNumbering->GetEta(fStexNumber, StexStinEcna, i0StinEcha)
1192  << setw(10) << (Int_t)fEcalNumbering->GetPhiInSM(fStexNumber, StexStinEcna, i0StinEcha);
1193  }
1194  if( fFlagSubDet == "EE" )
1195  {
1196  fFcout_f << setw(7) << n1DataSector
1197  << setw(8) << n1StexStin
1198  << setw(11) << n1StinEcha // (Xtal number for construction in SC)
1199  << setw(10) << n1SCinDS
1200  << setw(10) << fEcalNumbering->GetIXCrysInDee(fStexNumber, StexStinEcna, n1StinEcha-1)
1201  << setw(10) << fEcalNumbering->GetJYCrysInDee(fStexNumber, StexStinEcna, n1StinEcha-1);
1202  }
1203 
1204  if( HistoCode == "D_NOE_ChNb")
1205  {
1206  Int_t ivalue = (Int_t)value;
1207  fFcout_f << setw(13) << ivalue;
1208  fFcout_f << setw(4) << "(" << setw(6) << fReqNbOfEvts << ")";
1209  }
1210  else
1211  {
1212  fFcout_f << setw(13) << value;
1213  }
1214 
1215  fFcout_f << endl;
1216  }
1217  } // end of loop: for (Int_t i0StexEcha=0; i0StexEcha<HisSize; i0StexEcha++)
1218 
1219  fFcout_f.close();
1220 
1221  // if(fFlagPrint != fCodePrintNoComment)
1222  // {
1223  cout << "*TEcnaWrite::WriteAsciiHisto(...)> INFO: "
1224  << "histo has been written in file: " << endl
1225  << " " << fAsciiFileName.Data() << endl;
1226  // }
1227 } // end of TEcnaWrite::WriteAsciiHisto
1228 
1229 //================================================================================
1230 //
1231 // W R I T I N G O F T H E C O V A N D C O R M A T R I C E S
1232 //
1233 //================================================================================
1234 
1235 //--------------------------------------------------------------------------------
1236 //
1237 // Writing of the covariances between samples
1238 // for a given StexEcha in an ASCII file
1239 //
1240 //--------------------------------------------------------------------------------
1241 void TEcnaWrite::WriteAsciiCovariancesBetweenSamples(const Int_t& user_StexStin,
1242  const Int_t& user_StinEcha,
1243  const Int_t& MatSize,
1244  const TMatrixD& read_matrix)
1245 {
1246 //Writing of the covariances between samples for a given StexEcha in an ASCII file
1247 
1248  if( fFlagSubDet == "EB" ){fStexStinUser = user_StexStin;}
1249  if( fFlagSubDet == "EE" ){fStexStinUser =
1251 
1252  if( fFlagSubDet == "EB" ){fStinEchaUser = user_StinEcha;}
1253  if( fFlagSubDet == "EE" ){fStinEchaUser = user_StinEcha+1;}
1254 
1255  Int_t i_code = fCodeCovCss; // code for covariances between samples
1256  fMakeResultsFileName(i_code);
1257  fAsciiFileWriteHeader(i_code);
1258 
1259  Int_t i_pasx = fSectSampSizeX;
1260  Int_t i_pasy = fSectSampSizeY;
1261 
1262  fT2dWriteAscii(i_code, i_pasx, i_pasy, MatSize, read_matrix);
1263 }
1264 
1265 //---------------------------------------------------------------------------------
1266 //
1267 // Writing of the correlations between samples
1268 // for a given StexEcha in an ASCII file
1269 //
1270 //---------------------------------------------------------------------------------
1272  const Int_t& user_StinEcha,
1273  const Int_t& MatSize,
1274  const TMatrixD& read_matrix)
1275 {
1276 //Writing of the correlations between samples for a given StexEcha in an ASCII file
1277 
1278 
1279  if( fFlagSubDet == "EB" ){fStexStinUser = user_StexStin;}
1280  if( fFlagSubDet == "EE" ){fStexStinUser =
1282 
1283  if( fFlagSubDet == "EB" ){fStinEchaUser = user_StinEcha;}
1284  if( fFlagSubDet == "EE" ){fStinEchaUser = user_StinEcha+1;}
1285 
1286  Int_t i_code = fCodeCorCss; // code for correlations between samples
1287  fMakeResultsFileName(i_code);
1288  fAsciiFileWriteHeader(i_code);
1289 
1290  Int_t i_pasx = fSectSampSizeX;
1291  Int_t i_pasy = fSectSampSizeY;
1292 
1293  fT2dWriteAscii(i_code, i_pasx, i_pasy, MatSize, read_matrix);
1294 }
1295 
1296 //----------------------------------------------------------------------
1297 //
1298 // fT2dWriteAscii: Array 2D of (n_sctx , n_scty) sectors
1299 // of size: i_pasx_arg * i_pasy_arg
1300 //
1301 // (private)
1302 //
1303 //----------------------------------------------------------------------
1304 
1305 void TEcnaWrite::fT2dWriteAscii(const Int_t& i_code,
1306  const Int_t& i_pasx_arg,
1307  const Int_t& i_pasy_arg,
1308  const Int_t& MatSize,
1309  const TMatrixD& read_matrix)
1310 {
1311 //Writing of a matrix by sectors (private)
1312 
1313  Int_t i_pasx = i_pasx_arg; // taille secteur en x
1314  Int_t i_pasy = i_pasy_arg; // taille secteur en y
1315 
1316  //------------ formatage des nombres en faisant appel a la classe ios
1317 
1318  fFcout_f << setiosflags(ios::showpoint | ios::uppercase);
1319  fFcout_f.setf(ios::dec, ios::basefield);
1320  fFcout_f.setf(ios::fixed, ios::floatfield);
1321  fFcout_f.setf(ios::left, ios::adjustfield);
1322  fFcout_f.setf(ios::right, ios::adjustfield);
1323  fFcout_f << setprecision(3) << setw(6);
1324 
1325  cout << setiosflags(ios::showpoint | ios::uppercase);
1326  cout.setf(ios::dec, ios::basefield);
1327  cout.setf(ios::fixed, ios::floatfield);
1328  cout.setf(ios::left, ios::adjustfield);
1329  cout.setf(ios::right, ios::adjustfield);
1330  cout << setprecision(3) << setw(6);
1331 
1332  //--------------------- fin du formatage standard C++ -------------------
1333 
1334  //-----------------------------------------------------------------------
1335  // Reservation dynamique d'un array Double_t** de dimensions
1336  // les multiples de 5 juste au-dessus des dimensions de l'array 2D
1337  // a ecrire ( array de dimensions
1338  // (fEcal->MaxSampADC(),fEcal->MaxSampADC())
1339  // (fEcal->MaxCrysEcnaInStex(),fEcal->MaxCrysEcnaInStex()) )
1340  //-----------------------------------------------------------------------
1341  // Determination des tailles multiples de fSectChanSizeX ou fSectSampSizeX
1342 
1343 #define NOUC
1344 #ifndef NOUC
1345 
1346  //*************** channels *************
1347  Int_t justap_chan = 0;
1348 
1349  if( fEcal->MaxCrysEcnaInStex()%fSectChanSizeX == 0 )
1350  {justap_chan = fEcal->MaxCrysEcnaInStex();}
1351  else
1352  {justap_chan=((fEcal->MaxCrysEcnaInStex()/fSectChanSizeX)+1)*fSectChanSizeX;}
1353 
1354  //....................... Allocation fjustap_2d_cc
1355 
1356  if ( i_code == fCodeHfCov || i_code == fCodeHfCor||
1357  i_code == fCodeLfCov || i_code == fCodeLfCor ){
1358  if(fjustap_2d_cc == 0)
1359  {
1360  //................... Allocation
1361  fjustap_2d_cc = new Double_t*[justap_chan]; fCnew++;
1362  fjustap_1d_cc = new Double_t[justap_chan*justap_chan]; fCnew++;
1363  for(Int_t i = 0 ; i < justap_chan ; i++){
1364  fjustap_2d_cc[i] = &fjustap_1d_cc[0] + i*justap_chan;}
1365  }
1366 
1367  //............................... Transfert des valeurs dans fjustap_2d_cc (=init)
1368  for(Int_t i = 0; i < fEcal->MaxCrysEcnaInStex(); i++){
1369  for(Int_t j = 0; j < fEcal->MaxCrysEcnaInStex(); j++){
1370  if ( i_code == fCodeHfCov ){
1371  fjustap_2d_cc[i][j] = read_matrix(i,j);}
1372  if ( i_code == fCodeHfCor ){
1373  fjustap_2d_cc[i][j] = read_matrix(i,j);}
1374  if ( i_code == fCodeLfCov ){
1375  fjustap_2d_cc[i][j] = read_matrix(i,j);}
1376  if ( i_code == fCodeLfCor ){
1377  fjustap_2d_cc[i][j] = read_matrix(i,j);}
1378  }
1379  }
1380 
1381  //.......................... mise a zero du reste de la matrice (=init)
1382  for(Int_t i = fEcal->MaxCrysEcnaInStex(); i < justap_chan; i++){
1383  for(Int_t j = fEcal->MaxCrysEcnaInStex(); j < justap_chan; j++){
1384  fjustap_2d_cc[i][j] = (Double_t)0.;}}
1385  }
1386 
1387 #endif //NOUC
1388 
1389  //************************************ Samples ***************************
1390  Int_t justap_samp = 0;
1391 
1392  if ( fEcal->MaxSampADC()%fSectSampSizeX == 0 ){
1393  justap_samp = fEcal->MaxSampADC();}
1394  else{
1395  justap_samp=((fEcal->MaxSampADC()/fSectSampSizeX)+1)*fSectSampSizeX;}
1396 
1397  //....................... allocation fjustap_2d_ss
1398 
1399  if (i_code == fCodeCovCss || i_code == fCodeCorCss ||
1400  i_code == fCodeAvMeanCorss || i_code == fCodeAvSigCorss){
1401  if(fjustap_2d_ss == 0)
1402  {
1403  //................... Allocation
1404  fjustap_2d_ss = new Double_t*[justap_samp]; fCnew++;
1405  fjustap_1d_ss = new Double_t[justap_samp*justap_samp]; fCnew++;
1406  for(Int_t i = 0 ; i < justap_samp ; i++){
1407  fjustap_2d_ss[i] = &fjustap_1d_ss[0] + i*justap_samp;}
1408  }
1409 
1410  //.............................. Transfert des valeurs dans fjustap_2d_ss (=init)
1411  for(Int_t i = 0; i < fEcal->MaxSampADC(); i++){
1412  for(Int_t j = 0; j < fEcal->MaxSampADC(); j++){
1413  if( i_code == fCodeCovCss ){
1414  fjustap_2d_ss[i][j] = read_matrix(i,j);}
1415  if( i_code == fCodeCorCss ){
1416  fjustap_2d_ss[i][j] = read_matrix(i,j);}
1417  if( i_code == fCodeAvMeanCorss ){
1418  fjustap_2d_ss[i][j] = read_matrix(i,j);}
1419  if( i_code == fCodeAvSigCorss ){
1420  fjustap_2d_ss[i][j] = read_matrix(i,j);}
1421  }
1422  }
1423 
1424  //.......................... mise a zero du reste de la matrice (=init)
1425  for(Int_t i = fEcal->MaxSampADC(); i < justap_samp; i++){
1426  for(Int_t j = fEcal->MaxSampADC(); j < justap_samp; j++){
1427  fjustap_2d_ss[i][j] = (Double_t)0.;}}
1428  }
1429 
1430  //..................... impressions + initialisations selon i_code
1431 
1432  Int_t isx_max = 0;
1433  Int_t isy_max = 0;
1434 
1435 #define COCC
1436 #ifndef COCC
1437  if(i_code == fCodeHfCov)
1438  {
1439  fFcout_f << "Covariance matrix between channels "
1440  << "for sample number " << fUserSamp;
1441  isx_max = justap_chan;
1442  isy_max = justap_chan;
1443  }
1444  if(i_code == fCodeHfCor)
1445  {
1446  fFcout_f << "*Correlation matrix between channels "
1447  << "for sample number " << fUserSamp;
1448  isx_max = justap_chan;
1449  isy_max = justap_chan;
1450  }
1451 
1452  if(i_code == fCodeLfCov)
1453  {
1454  fFcout_f << "Covariance matrix between channels "
1455  << "averaged on the samples ";
1456  isx_max = justap_chan;
1457  isy_max = justap_chan;
1458  }
1459  if(i_code == fCodeLfCor)
1460  {
1461  fFcout_f << "Correlation matrix between channels "
1462  << "averaged on the samples ";
1463  isx_max = justap_chan;
1464  isy_max = justap_chan;
1465  }
1466 #endif // COCC
1467 
1468  Int_t n1StexStin = 0;
1469  Int_t i0StinEcha = 0;
1470  Int_t n1StinEcha = 0;
1471 
1472  if( fFlagSubDet == "EB")
1473  {
1474  n1StexStin = fStexStinUser;
1476  }
1477  if( fFlagSubDet == "EE")
1478  {
1479  n1StexStin = fStexStinUser;
1481 
1482  TString sDeeDir = fEcalNumbering->GetDeeDirViewedFromIP(fStexNumber);
1483  }
1484 
1485  if(i_code == fCodeCovCss)
1486  {
1487  if( fFlagSubDet == "EB")
1488  {
1489  fFcout_f << "Covariance matrix between samples "
1490  << "for channel number " << fStinEchaUser
1491  << " (" << fStinName << ": " << n1StexStin
1492  << " , channel in " << fStinName << ": " << i0StinEcha << ")";
1493  }
1494  if( fFlagSubDet == "EE")
1495  {
1496  fFcout_f << "Covariance matrix between samples "
1497  << "for channel number " << fStinEchaUser
1498  << " (" << fStinName << ": " << n1StexStin
1499  << " , channel in " << fStinName << ": " << n1StinEcha << ")";
1500  }
1501  isx_max = justap_samp;
1502  isy_max = justap_samp;
1503  }
1504  if(i_code == fCodeCorCss)
1505  {
1506  if( fFlagSubDet == "EB")
1507  {
1508  fFcout_f << "Correlation matrix between samples "
1509  << "for channel number " << fStinEchaUser
1510  << " (" << fStinName << ": " << n1StexStin
1511  << " , channel in " << fStinName << ": " << i0StinEcha << ")";
1512  }
1513  if( fFlagSubDet == "EE")
1514  {
1515  fFcout_f << "Correlation matrix between samples "
1516  << "for channel number " << fStinEchaUser
1517  << " (" << fStinName << ": " << n1StexStin
1518  << " , channel in " << fStinName << ": " << n1StinEcha << ")";
1519  }
1520  isx_max = justap_samp;
1521  isy_max = justap_samp;
1522  }
1523 
1524  if(i_code == fCodeAvMeanCorss)
1525  {
1526  if( fFlagSubDet == "EB")
1527  {
1528  fFcout_f << "Correction factors to the covariances "
1529  << "between samples for channel number " << fStinEchaUser
1530  << " (" << fStinName << ": " << n1StexStin
1531  << " , channel in " << fStinName << ": " << i0StinEcha << ")";
1532  }
1533  if( fFlagSubDet == "EE")
1534  {
1535  fFcout_f << "Correction factors to the covariances "
1536  << "between samples for channel number " << fStinEchaUser
1537  << " (" << fStinName << ": " << n1StexStin
1538  << " , channel in " << fStinName << ": " << n1StinEcha << ")";
1539  }
1540  isx_max = justap_samp;
1541  isy_max = justap_samp;
1542  }
1543 
1544  if(i_code == fCodeAvSigCorss)
1545  {
1546  if( fFlagSubDet == "EB")
1547  {
1548  fFcout_f << "Correction factors to the correlations "
1549  << "between samples for channel number " << fStinEchaUser
1550  << " ( " << fStinName << ": " << n1StexStin
1551  << " , channel in " << fStinName << ": " << i0StinEcha << ")";
1552  }
1553  if( fFlagSubDet == "EE")
1554  {
1555  fFcout_f << "Correction factors to the correlations "
1556  << "between samples for channel number " << fStinEchaUser
1557  << " ( " << fStinName << ": " << n1StexStin
1558  << " , channel in " << fStinName << ": " << n1StinEcha << ")";
1559  }
1560  isx_max = justap_samp;
1561  isy_max = justap_samp;
1562  }
1563 
1564  fFcout_f << endl;
1565 
1566  //............... Calcul des nombres de secteurs selon x
1567  // i_pasx = taille secteur en x
1568  // isx_max = taille de la matrice en x
1569  // n_sctx = nombre de secteurs en x
1570  //
1571  if(i_pasx > isx_max){i_pasx = isx_max;}
1572  Int_t n_sctx;
1573  Int_t max_verix;
1574  n_sctx = isx_max/i_pasx;
1575  max_verix = n_sctx*i_pasx;
1576  if(max_verix < isx_max){ n_sctx++;}
1577 
1578  //............... Calcul des nombres de secteurs selon y
1579  // i_pasy = taille secteur en y
1580  // isy_max = taille de la matrice en y
1581  // n_scty = nombre de secteurs en x
1582  //
1583  if(i_pasy > isy_max){i_pasy = isy_max;}
1584  Int_t n_scty;
1585  Int_t max_veriy;
1586  n_scty = isy_max/i_pasy;
1587  max_veriy = n_scty*i_pasy;
1588  if(max_veriy < isy_max){ n_scty++;}
1589 
1590 #define NBSC
1591 #ifndef NBSC
1592  //................ Ecriture de la taille et du nombre des secteurs
1593  if( i_code == fCodeCovCss || i_code == fCodeCorCss ||
1594  i_code == fCodeAvMeanCorss || i_code == fCodeAvSigCorss)
1595  {
1596  fFcout_f << "sector size = " << fSectSampSizeX
1597  << " , number of sectors = " << n_sctx << " x " << n_scty
1598  <<endl;
1599  }
1600  if( i_code == fCodeHfCov || i_code == fCodeHfCor ||
1601  i_code == fCodeLfCov || i_code == fCodeLfCor )
1602  {
1603  fFcout_f << "sector size = " << fSectChanSizeX
1604  << " , number of sectors = " << n_sctx << " x " << n_scty
1605  << endl;
1606  }
1607 #endif // NBSC
1608 
1609  fFcout_f << endl;
1610 
1611  //............... impression matrice par secteurs i_pas x i_pas
1612  //........................... boucles pour display des secteurs
1613  Int_t ix_inf = -i_pasx;
1614 
1615  for(Int_t nsx = 0 ; nsx < n_sctx ; nsx++)
1616  {
1617  //......................... calcul limites secteur
1618  ix_inf = ix_inf + i_pasx;
1619  Int_t ix_sup = ix_inf + i_pasx;
1620 
1621  Int_t iy_inf = -i_pasy;
1622 
1623  for(Int_t nsy = 0 ; nsy < n_scty ; nsy++)
1624  {
1625  iy_inf = iy_inf + i_pasy;
1626  Int_t iy_sup = iy_inf + i_pasy;
1627 
1628  //......................... display du secteur (nsx,nsy)
1629 
1630  if(i_code == fCodeHfCov || i_code == fCodeCovCss ||
1631  i_code == fCodeAvMeanCorss || i_code == fCodeAvSigCorss )
1632  {fFcout_f << " ";}
1633  if(i_code == fCodeHfCor || i_code == fCodeCorCss)
1634  {fFcout_f << " ";}
1635 
1636  for (Int_t iy_c = iy_inf ; iy_c < iy_sup ; iy_c++)
1637  {
1638  if(i_code == fCodeHfCov || i_code == fCodeLfCov || i_code == fCodeCovCss ||
1639  i_code == fCodeAvMeanCorss ||
1640  i_code == fCodeAvSigCorss)
1641  {fFcout_f.width(8);}
1642  if(i_code == fCodeHfCor || i_code == fCodeLfCor || i_code == fCodeCorCss)
1643  {fFcout_f.width(6);}
1644  fFcout_f << iy_c << " ";
1645  }
1646  fFcout_f << endl << endl;
1647 
1648  for (Int_t ix_c = ix_inf ; ix_c < ix_sup ; ix_c++)
1649  {
1650  if(i_code == fCodeHfCov|| i_code == fCodeLfCov || i_code == fCodeCovCss ||
1651  i_code == fCodeAvMeanCorss ||
1652  i_code == fCodeAvSigCorss)
1653  {fFcout_f.width(8);}
1654  if(i_code == fCodeHfCor || i_code == fCodeLfCor || i_code == fCodeCorCss)
1655  {fFcout_f.width(6);}
1656  fFcout_f << ix_c << " ";
1657 
1658  for (Int_t iy_c = iy_inf ; iy_c < iy_sup ; iy_c++)
1659  {
1660  if(i_code == fCodeHfCov ||
1661  i_code == fCodeLfCov ||
1662  i_code == fCodeCovCss ||
1663  i_code == fCodeAvMeanCorss ||
1664  i_code == fCodeAvSigCorss ){
1665  fFcout_f.width(8);}
1666 
1667  if(i_code == fCodeHfCor || i_code == fCodeLfCor || i_code == fCodeCorCss){
1668  fFcout_f.width(6);}
1669 
1670  if( i_code == fCodeHfCov || i_code == fCodeLfCov || i_code == fCodeHfCor){
1671  fFcout_f << fjustap_2d_cc[ix_c][iy_c] << " ";}
1672 
1673  if ( i_code == fCodeCovCss ||
1674  i_code == fCodeCorCss ||
1675  i_code == fCodeAvMeanCorss ||
1676  i_code == fCodeAvSigCorss )
1677  {
1678  fFcout_f << fjustap_2d_ss[ix_c][iy_c] << " ";
1679  }
1680  }
1681  fFcout_f << endl;
1682  }
1683  fFcout_f << endl;
1684  }
1685  }
1686 
1687  //........... closing of the results file
1688 
1689  fFcout_f.close();
1690 
1692  {
1693  cout << "*TEcnaWrite::fT2dWriteAscii(....)> INFO: "
1694  << "matrix has been written in file: " << endl
1695  << " " << fAsciiFileName.Data() << endl;
1696  }
1697 
1698 }// end of TEcnaWrite::fT2dWriteAscii
1699 
1700 
1701 //=========================================================================
1702 //
1703 // ci-dessous: ===> methodes a implementer plus tard?
1704 //
1705 //=========================================================================
1706 #define WASC
1707 #ifndef WASC
1708 //------------------------------------------------------------
1709 //
1710 // Writing of the expectation values in an ASCII file
1711 //
1712 //------------------------------------------------------------
1713 
1714 void TEcnaWrite::WriteAsciiSampleMeans()
1715 {
1716 //Writing of the expectation values in an ASCII file
1717 
1718  Int_t i_code = fCodeMSp;
1719  fMakeResultsFileName(i_code);
1720  fAsciiFileWriteHeader(i_code);
1721 
1722  Int_t i_lic1 = fNbChanByLine;
1723  Int_t i_lic2 = fNbSampByLine;
1724 
1725  fT1dWriteAscii(i_code, i_lic1, i_lic2);
1726 }
1727 
1728 //-------------------------------------------------------
1729 //
1730 // Writing of the sigmas in an ASCII file
1731 //
1732 //-------------------------------------------------------
1733 
1734 void TEcnaWrite::WriteAsciiSampleSigmas()
1735 {
1736 //Writing of the variances in an ASCII file
1737 
1738  Int_t i_code = fCodeVar; // code for variance
1739  fMakeResultsFileName(i_code);
1740  fAsciiFileWriteHeader(i_code);
1741 
1742  Int_t i_lic1 = fNbChanByLine;
1743  Int_t i_lic2 = fNbSampByLine;
1744 
1745  fT1dWriteAscii(i_code, i_lic1, i_lic2);
1746 }
1747 #endif // WASC
void fAsciiFileWriteHeader(const Int_t &)
Definition: TEcnaWrite.cc:887
Int_t fCodeHfn
Definition: TEcnaWrite.h:65
Double_t ** fjustap_2d_cc
Definition: TEcnaWrite.h:107
int i
Definition: DBlmapReader.cc:9
Int_t fSectSampSizeY
Definition: TEcnaWrite.h:91
Int_t fCodeAvPed
Definition: TEcnaWrite.h:76
Int_t fStinEchaUser
Definition: TEcnaWrite.h:97
void Init()
Definition: TEcnaWrite.cc:95
void SetEcalSubDetector(const TString, const TEcnaParEcal *, const TEcnaNumbering *)
Definition: TEcnaWrite.cc:163
Int_t GetStexNumber()
Definition: TEcnaWrite.cc:276
Int_t fgMaxCar
Definition: TEcnaWrite.h:35
void WriteAsciiCovariancesBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1241
Int_t MaxCrysVecoInStin()
Int_t fNbSampByLine
Definition: TEcnaWrite.h:94
Double_t * fjustap_1d_ev
Definition: TEcnaWrite.h:102
TString GetDeeDirViewedFromIP(const Int_t &)
Int_t fCodePrintNoComment
Definition: TEcnaWrite.h:46
Int_t Get1DeeSCEcnaFrom0DeeEcha(const Int_t &)
TString fFlagSubDet
Definition: TEcnaWrite.h:49
Int_t fCodeHfCov
Definition: TEcnaWrite.h:83
Int_t Get1SCEchaFrom0DeeEcha(const Int_t &)
TString fStexName
Definition: TEcnaWrite.h:129
Double_t ** fjustap_2d_ev
Definition: TEcnaWrite.h:101
TString BeginningOfResultsRootFilePath()
Double_t ** fjustap_2d_var
Definition: TEcnaWrite.h:104
Double_t ** fjustap_2d_ss
Definition: TEcnaWrite.h:110
Int_t fNbChanByLine
Definition: TEcnaWrite.h:93
TEcnaParPaths * fCnaParPaths
Definition: TEcnaWrite.h:52
TString fAnaType
Definition: TEcnaWrite.h:122
Int_t fStexNumber
Definition: TEcnaWrite.h:128
void AppendResultsAsciiFilePath(const Text_t *)
TString fAsciiFileNameShort
Definition: TEcnaWrite.h:142
Int_t fStexStinUser
Definition: TEcnaWrite.h:96
TEcnaParEcal * fEcal
Definition: TEcnaWrite.h:48
Int_t fRunNumber
Definition: TEcnaWrite.h:124
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
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
Int_t NumberOfEvents(Int_t **, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaWrite.cc:361
Int_t GetCodePrint(const TString)
Definition: TEcnaParCout.cc:77
TString GetAsciiFileName()
Definition: TEcnaWrite.cc:268
void SetResultsRootFilePath(const TString)
Int_t Get0TowEchaFrom0SMEcha(const Int_t &)
Int_t GetFirstReqEvtNumber()
Definition: TEcnaWrite.cc:274
Int_t fCdelete
Definition: TEcnaWrite.h:36
Int_t fCnew
Definition: TEcnaWrite.h:36
Int_t fUserSamp
Definition: TEcnaWrite.h:95
Int_t GetJYCrysInDee(const Int_t &, const Int_t &, const Int_t &)
Int_t fCodePed
Definition: TEcnaWrite.h:62
Int_t fCodeAvTno
Definition: TEcnaWrite.h:77
TString fRootFileName
Definition: TEcnaWrite.h:139
Int_t fCodeAvMeanCorss
Definition: TEcnaWrite.h:78
TString fTTBELL
Definition: TEcnaWrite.h:39
Int_t fCodePrintAllComments
Definition: TEcnaWrite.h:46
TString BeginningOfResultsAsciiFilePath()
int j
Definition: DBlmapReader.cc:9
Int_t fCodeSigCorss
Definition: TEcnaWrite.h:67
Int_t Get1SMTowFrom0SMEcha(const Int_t &)
Int_t GetDSSCFrom1DeeSCEcna(const Int_t &, const Int_t &, const Int_t &)
void fT2dWriteAscii(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1305
Int_t fFlagPrint
Definition: TEcnaWrite.h:45
Double_t * fjustap_1d_cc
Definition: TEcnaWrite.h:108
Int_t GetRunNumber()
Definition: TEcnaWrite.cc:273
Int_t fCodeRoot
Definition: TEcnaWrite.h:59
Int_t fCodeMSp
Definition: TEcnaWrite.h:73
Int_t fNbOfSamples
Definition: TEcnaWrite.h:123
Int_t GetDSFrom1DeeSCEcna(const Int_t &, const Int_t &)
void SetResultsAsciiFilePath(const TString)
TString fStopDate
Definition: TEcnaWrite.h:133
Int_t GetDeeSCConsFrom1DeeSCEcna(const Int_t &, const Int_t &)
Double_t * fjustap_1d_ss
Definition: TEcnaWrite.h:111
Int_t fCodeHeaderAscii
Definition: TEcnaWrite.h:58
Int_t fFirstReqEvtNumber
Definition: TEcnaWrite.h:125
Double_t GetEta(const Int_t &, const Int_t &, const Int_t &)
Int_t Get1SMCrysFrom1SMTowAnd0TowEcha(const Int_t &, const Int_t &)
Int_t fSectChanSizeX
Definition: TEcnaWrite.h:90
Int_t GetReqNbOfEvts()
Definition: TEcnaWrite.cc:275
Int_t fCodeMeanCorss
Definition: TEcnaWrite.h:66
TString fStinName
Definition: TEcnaWrite.h:130
Double_t GetPhiInSM(const Int_t &, const Int_t &, const Int_t &)
ofstream fFcout_f
Definition: TEcnaWrite.h:55
void TruncateResultsRootFilePath(const Int_t &, const Int_t &)
Int_t fCodeLfCov
Definition: TEcnaWrite.h:81
Int_t fCodeTno
Definition: TEcnaWrite.h:63
Double_t * fjustap_1d_var
Definition: TEcnaWrite.h:105
TString ResultsRootFilePath()
Int_t MaxCrysEcnaInStex()
Int_t fCodeLfn
Definition: TEcnaWrite.h:64
Int_t MaxCrysHocoInStin()
Int_t fCodeAvSigCorss
Definition: TEcnaWrite.h:79
Int_t GetNbOfSamples()
Definition: TEcnaWrite.cc:272
Int_t MaxSampADC()
Int_t GetIXCrysInDee(const Int_t &, const Int_t &, const Int_t &)
TEcnaParCout * fCnaParCout
Definition: TEcnaWrite.h:53
TString fAsciiFileName
Definition: TEcnaWrite.h:141
Int_t fSectChanSizeY
Definition: TEcnaWrite.h:90
void WriteAsciiCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1271
Int_t fCodeCovCss
Definition: TEcnaWrite.h:69
Int_t fCodeNbOfEvts
Definition: TEcnaWrite.h:61
time_t fStopTime
Definition: TEcnaWrite.h:134
Int_t fCodeCorCss
Definition: TEcnaWrite.h:70
void WriteAsciiHisto(const TString, const Int_t &, const TVectorD &)
Definition: TEcnaWrite.cc:1024
tuple cout
Definition: gather_cfg.py:41
TString GetRootFileNameShort()
Definition: TEcnaWrite.cc:270
Int_t fLastReqEvtNumber
Definition: TEcnaWrite.h:126
Int_t fSectSampSizeX
Definition: TEcnaWrite.h:91
Int_t fCodeLfCor
Definition: TEcnaWrite.h:82
TString GetEcalSubDetector()
TString fStartDate
Definition: TEcnaWrite.h:133
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:476
void TruncateResultsAsciiFilePath(const Int_t &, const Int_t &)
TString GetRootFileName()
Definition: TEcnaWrite.cc:269
void AppendResultsRootFilePath(const Text_t *)
Int_t fCodeHfCor
Definition: TEcnaWrite.h:84
TString GetAnalysisName()
Definition: TEcnaWrite.cc:271
Int_t fReqNbOfEvts
Definition: TEcnaWrite.h:127
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:51
Int_t fCodeSSp
Definition: TEcnaWrite.h:74
time_t fStartTime
Definition: TEcnaWrite.h:134
TString ResultsAsciiFilePath()