CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TEcnaWrite.h
Go to the documentation of this file.
1 #ifndef ZTR_TEcnaWrite
2 #define ZTR_TEcnaWrite
3 
4 #include <Riostream.h>
5 
6 #include "TObject.h"
7 #include "TSystem.h"
8 #include "Riostream.h"
9 #include <math.h>
10 #include <time.h>
11 
12 #include "TVectorD.h"
13 #include "TMatrixD.h"
14 
20 
21 //------------------------ TEcnaWrite.h -----------------
22 //
23 // For questions or comments, please send e-mail to:
24 //
25 // Bernard Fabbro
26 // fabbro@hep.saclay.cea.fr
27 //--------------------------------------------------------
28 
29 class TEcnaWrite : public TObject {
30 
31  private:
32 
33  //..... Attributes
34 
35  Int_t fgMaxCar; // Max nb of caracters for char*
36  Int_t fCnew, fCdelete;
38 
39  TString fTTBELL;
40 
42 
43  //...............................................................
44 
45  Int_t fFlagPrint;
47 
49  TString fFlagSubDet;
50 
54 
55  ofstream fFcout_f;
56 
57  //...................................... Codes for file names
59  Int_t fCodeRoot;
60 
62  Int_t fCodePed;
63  Int_t fCodeTno;
64  Int_t fCodeLfn;
65  Int_t fCodeHfn;
68 
69  Int_t fCodeCovCss;
70  Int_t fCodeCorCss;
71 
72  Int_t fCodeAdcEvt;
73  Int_t fCodeMSp;
74  Int_t fCodeSSp;
75 
76  Int_t fCodeAvPed;
77  Int_t fCodeAvTno;
80 
81  Int_t fCodeLfCov;
82  Int_t fCodeLfCor;
83  Int_t fCodeHfCov;
84  Int_t fCodeHfCor;
85 
88 
89  //..........................................................................
92 
93  Int_t fNbChanByLine; // Nb channels by line (for ASCII results file)
94  Int_t fNbSampByLine; // Nb samples by line (for ASCII results file)
95  Int_t fUserSamp; // Current sample number (for ASCII results file)
96  Int_t fStexStinUser; // Current Stin number in Stex
97  Int_t fStinEchaUser; // Current electronic channel number in Stin
98  // for ASCII results file ([0,24] for EB, [1,25] for EE)
99 
100 
101  Double_t** fjustap_2d_ev;
102  Double_t* fjustap_1d_ev;
103 
104  Double_t** fjustap_2d_var;
105  Double_t* fjustap_1d_var;
106 
107  Double_t** fjustap_2d_cc;
108  Double_t* fjustap_1d_cc;
109 
110  Double_t** fjustap_2d_ss;
111  Double_t* fjustap_1d_ss;
112 
113  //.................... Private methods
114 
115  void fAsciiFileWriteHeader(const Int_t&);
116  void fT2dWriteAscii(const Int_t&, const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
117 
118  public:
119 
120  //..... Public attributes
121 
122  TString fAnaType;
124  Int_t fRunNumber;
128  Int_t fStexNumber;
129  TString fStexName;
130  TString fStinName;
131 
135 
136  // Int_t fMaxSampADC;
137 
138  TString fRootFileNameShort; // name of the results ROOT file
139  TString fRootFileName; // name of the results ROOT file with its path = fPathRoot/fRootFileNameShort
140 
141  TString fAsciiFileName; // name of the results ASCII file
142  TString fAsciiFileNameShort; // name of the results ASCII file = fPathAscii/fAsciiFileNameShort
143 
144  //..... Methods
145 
146  TEcnaWrite();
147  TEcnaWrite(const TString, const TEcnaParPaths*, const TEcnaParCout*,
148  const TEcnaParEcal*, const TEcnaNumbering*);
149  virtual ~TEcnaWrite();
150 
151  void Init();
152  void SetEcalSubDetector(const TString, const TEcnaParEcal*, const TEcnaNumbering*);
153 
154  //...................................................... making file name method
155  void fMakeResultsFileName(); // => default: arg = fCodeRoot
156  void fMakeResultsFileName(const Int_t&);
157 
158  //=============================================================================================
159  //
160  // ci-dessous: ==> WriteAsciiSampleMeans()
161  // WriteAsciiSampleSigmas()
162  // methodes a remettre ?
163  //
164  //=============================================================================================
165  //.................................... ASCII writing file methods
166  // void WriteAsciiSampleMeans();
167  // void WriteAsciiSampleSigmas();
168 
169  void WriteAsciiCovariancesBetweenSamples(const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
170  void WriteAsciiCorrelationsBetweenSamples(const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
171 
172 
173  void WriteAsciiHisto(const TString, const Int_t&, const TVectorD&);
174 
175  TString GetAsciiFileName();
176  TString GetRootFileName();
177  TString GetRootFileNameShort();
178  TString GetAnalysisName();
179  Int_t GetNbOfSamples();
180  Int_t GetRunNumber();
181  Int_t GetFirstReqEvtNumber();
182  Int_t GetReqNbOfEvts();
183  Int_t GetStexNumber();
184 
185  Int_t NumberOfEvents(Int_t**, const Int_t&, const Int_t&, const Int_t&);
186  Int_t NumberOfEvents(Int_t*, const Int_t&, const Int_t&);
187 
188  void RegisterFileParameters(const TString, const Int_t&, const Int_t&, const Int_t&,
189  const Int_t&, const Int_t&, const Int_t&, const TString, const TString,
190  const time_t, const time_t);
191 
192  void RegisterFileParameters(const TString, const Int_t&, const Int_t&, const Int_t&,
193  const Int_t&, const Int_t&, const Int_t&);
194 
195  ClassDef(TEcnaWrite,1)// Writing in file (.ascii, .root) methods for CNA (Correlated Noises Analysis)
196  };
197 
198 #endif // ZTR_TEcnaParameter
199 
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_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 fNbSampByLine
Definition: TEcnaWrite.h:94
Double_t * fjustap_1d_ev
Definition: TEcnaWrite.h:102
Int_t fCodePrintNoComment
Definition: TEcnaWrite.h:46
TString fFlagSubDet
Definition: TEcnaWrite.h:49
Int_t fCodeHfCov
Definition: TEcnaWrite.h:83
TString fStexName
Definition: TEcnaWrite.h:129
Double_t ** fjustap_2d_ev
Definition: TEcnaWrite.h:101
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
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
TString GetAsciiFileName()
Definition: TEcnaWrite.cc:268
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 fCdeleteRoot
Definition: TEcnaWrite.h:37
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
Int_t fCodeSigCorss
Definition: TEcnaWrite.h:67
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 fCnaCommand
Definition: TEcnaWrite.h:41
Int_t fCodeRoot
Definition: TEcnaWrite.h:59
Int_t fCodeMSp
Definition: TEcnaWrite.h:73
Int_t fNbOfSamples
Definition: TEcnaWrite.h:123
TString fStopDate
Definition: TEcnaWrite.h:133
Double_t * fjustap_1d_ss
Definition: TEcnaWrite.h:111
Int_t fCodeHeaderAscii
Definition: TEcnaWrite.h:58
Int_t fFirstReqEvtNumber
Definition: TEcnaWrite.h:125
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
ofstream fFcout_f
Definition: TEcnaWrite.h:55
Int_t fCodeLFccMoStins
Definition: TEcnaWrite.h:86
Int_t fCodeLfCov
Definition: TEcnaWrite.h:81
Int_t fCodeAdcEvt
Definition: TEcnaWrite.h:72
virtual ~TEcnaWrite()
Definition: TEcnaWrite.cc:30
Int_t fCodeTno
Definition: TEcnaWrite.h:63
Double_t * fjustap_1d_var
Definition: TEcnaWrite.h:105
Int_t fCodePrintComments
Definition: TEcnaWrite.h:46
Int_t fCodeHFccMoStins
Definition: TEcnaWrite.h:87
Int_t fCodeLfn
Definition: TEcnaWrite.h:64
Int_t fCodeAvSigCorss
Definition: TEcnaWrite.h:79
Int_t GetNbOfSamples()
Definition: TEcnaWrite.cc:272
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
TString GetRootFileNameShort()
Definition: TEcnaWrite.cc:270
Int_t fLastReqEvtNumber
Definition: TEcnaWrite.h:126
TString fPathForAsciiFiles
Definition: TEcnaWrite.h:132
Int_t fSectSampSizeX
Definition: TEcnaWrite.h:91
Int_t fCodeLfCor
Definition: TEcnaWrite.h:82
TString fStartDate
Definition: TEcnaWrite.h:133
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:476
Int_t fCodePrintWarnings
Definition: TEcnaWrite.h:46
Int_t fCnewRoot
Definition: TEcnaWrite.h:37
TString GetRootFileName()
Definition: TEcnaWrite.cc:269
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 fCnaError
Definition: TEcnaWrite.h:41
Int_t fCodeSSp
Definition: TEcnaWrite.h:74
time_t fStartTime
Definition: TEcnaWrite.h:134