CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 <cmath>
10 #include <ctime>
11 
12 #include "TVectorD.h"
13 #include "TMatrixD.h"
14 
21 
33 
34 class TEcnaWrite : public TObject {
35 private:
36  //..... Attributes
37 
38  Int_t fCnew, fCdelete;
40 
41  Int_t fgMaxCar; // Max nb of caracters for char*
42 
43  TString fTTBELL;
44 
46 
47  //...............................................................
48 
49  Int_t fFlagPrint;
51 
53  TString fFlagSubDet;
54 
58 
59  std::ofstream fFcout_f;
60 
61  //...................................... Codes for file names
63  Int_t fCodeRoot;
64 
66  Int_t fCodePed;
67  Int_t fCodeTno;
68  Int_t fCodeLfn;
69  Int_t fCodeHfn;
72 
73  Int_t fCodeCovCss;
74  Int_t fCodeCorCss;
75 
76  Int_t fCodeAdcEvt;
77  Int_t fCodeMSp;
78  Int_t fCodeSSp;
79 
80  Int_t fCodeAvPed;
81  Int_t fCodeAvTno;
84 
85  Int_t fCodeLfCov;
86  Int_t fCodeLfCor;
87  Int_t fCodeHfCov;
88  Int_t fCodeHfCor;
89 
92 
93  //..........................................................................
96 
97  Int_t fNbChanByLine; // Nb channels by line (for ASCII results file)
98  Int_t fNbSampByLine; // Nb samples by line (for ASCII results file)
99  Int_t fUserSamp; // Current sample number (for ASCII results file)
100  Int_t fStexStinUser; // Current Stin number in Stex
101  Int_t fStinEchaUser; // Current electronic channel number in Stin
102  // for ASCII results file ([0,24] for EB, [1,25] for EE)
103 
104  Double_t** fjustap_2d_ev;
105  Double_t* fjustap_1d_ev;
106 
107  Double_t** fjustap_2d_var;
108  Double_t* fjustap_1d_var;
109 
110  Double_t** fjustap_2d_cc;
111  Double_t* fjustap_1d_cc;
112 
113  Double_t** fjustap_2d_ss;
114  Double_t* fjustap_1d_ss;
115 
116  //.................... Private methods
117 
118  void fAsciiFileWriteHeader(const Int_t&);
119  void fT2dWriteAscii(const Int_t&, const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
120 
121 public:
122  //..... Public attributes
123 
124  TString fAnaType;
126  Int_t fRunNumber;
130  Int_t fStexNumber;
131  TString fStexName;
132  TString fStinName;
133 
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(TEcnaObject*, const TString&);
148  TEcnaWrite(const TString&, const TEcnaParPaths*, const TEcnaParCout*, const TEcnaParEcal*, const TEcnaNumbering*);
149 
150  ~TEcnaWrite() override;
151 
152  void Init();
153  void SetEcalSubDetector(const TString&);
154  void SetEcalSubDetector(const TString&, const TEcnaParEcal*, const TEcnaNumbering*);
155 
156  //...................................................... making file name method
157  void fMakeResultsFileName(); // => default: arg = fCodeRoot
158  void fMakeResultsFileName(const Int_t&);
159 
160  //.................................... ASCII writing file methods
161  // void WriteAsciiSampleMeans(); // methode a remettre ?
162  // void WriteAsciiSampleSigmas(); // methode a remettre ?
163 
164  void WriteAsciiCovariancesBetweenSamples(const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
165  void WriteAsciiCorrelationsBetweenSamples(const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
166 
167  void WriteAsciiHisto(const TString&, const Int_t&, const TVectorD&);
168 
169  //...........................................................................
170  TString GetAsciiFileName();
171  TString GetRootFileName();
172  TString GetRootFileNameShort();
173  TString GetAnalysisName();
174 
175  Int_t GetNbOfSamples();
176  Int_t GetRunNumber();
177  Int_t GetFirstReqEvtNumber();
178  Int_t GetReqNbOfEvts();
179  Int_t GetStexNumber();
180 
181  Int_t NumberOfEventsAnalysis(Int_t**, const Int_t&, const Int_t&, const Int_t&); // Called by TEcnaRun
182  Int_t NumberOfEventsAnalysis(Int_t*, const Int_t&, const Int_t&, const Int_t&); // Called by TEcnaRead
183 
184  void RegisterFileParameters(const TString&,
185  const Int_t&,
186  const Int_t&,
187  const Int_t&,
188  const Int_t&,
189  const Int_t&,
190  const Int_t&,
191  const TString&,
192  const TString&,
193  const time_t,
194  const time_t);
195 
197  const TString&, const Int_t&, const Int_t&, const Int_t&, const Int_t&, const Int_t&, const Int_t&);
198 
199  ClassDefOverride(TEcnaWrite, 1) // Writing in file (.ascii, .root) methods for CNA (Correlated Noises Analysis)
200 };
201 
202 #endif // ZTR_TEcnaParameter
void fAsciiFileWriteHeader(const Int_t &)
Definition: TEcnaWrite.cc:1347
Int_t fCodeHfn
Definition: TEcnaWrite.h:69
Double_t ** fjustap_2d_cc
Definition: TEcnaWrite.h:110
Int_t NumberOfEventsAnalysis(Int_t **, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaWrite.cc:514
Int_t fSectSampSizeY
Definition: TEcnaWrite.h:95
Int_t fCodeAvPed
Definition: TEcnaWrite.h:80
Int_t fStinEchaUser
Definition: TEcnaWrite.h:101
void Init()
Definition: TEcnaWrite.cc:143
Int_t GetStexNumber()
Definition: TEcnaWrite.cc:395
Int_t fgMaxCar
Definition: TEcnaWrite.h:41
void WriteAsciiCovariancesBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1723
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:597
Int_t fNbSampByLine
Definition: TEcnaWrite.h:98
Double_t * fjustap_1d_ev
Definition: TEcnaWrite.h:105
Int_t fCodePrintNoComment
Definition: TEcnaWrite.h:50
TString fFlagSubDet
Definition: TEcnaWrite.h:53
Int_t fCodeHfCov
Definition: TEcnaWrite.h:87
TString fStexName
Definition: TEcnaWrite.h:131
Double_t ** fjustap_2d_ev
Definition: TEcnaWrite.h:104
Double_t ** fjustap_2d_var
Definition: TEcnaWrite.h:107
Double_t ** fjustap_2d_ss
Definition: TEcnaWrite.h:113
Int_t fNbChanByLine
Definition: TEcnaWrite.h:97
TEcnaParPaths * fCnaParPaths
Definition: TEcnaWrite.h:56
TString fAnaType
Definition: TEcnaWrite.h:124
Int_t fStexNumber
Definition: TEcnaWrite.h:130
TString fAsciiFileNameShort
Definition: TEcnaWrite.h:142
Int_t fStexStinUser
Definition: TEcnaWrite.h:100
TEcnaParEcal * fEcal
Definition: TEcnaWrite.h:52
Int_t fRunNumber
Definition: TEcnaWrite.h:126
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
TString GetAsciiFileName()
Definition: TEcnaWrite.cc:387
Int_t GetFirstReqEvtNumber()
Definition: TEcnaWrite.cc:393
Int_t fCdelete
Definition: TEcnaWrite.h:38
Int_t fCnew
Definition: TEcnaWrite.h:38
Int_t fUserSamp
Definition: TEcnaWrite.h:99
Int_t fCdeleteRoot
Definition: TEcnaWrite.h:39
Int_t fCodePed
Definition: TEcnaWrite.h:66
Int_t fCodeAvTno
Definition: TEcnaWrite.h:81
TString fRootFileName
Definition: TEcnaWrite.h:139
Int_t fCodeAvMeanCorss
Definition: TEcnaWrite.h:82
TString fTTBELL
Definition: TEcnaWrite.h:43
Int_t fCodePrintAllComments
Definition: TEcnaWrite.h:50
Int_t fCodeSigCorss
Definition: TEcnaWrite.h:71
void fT2dWriteAscii(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1798
Int_t fFlagPrint
Definition: TEcnaWrite.h:49
Double_t * fjustap_1d_cc
Definition: TEcnaWrite.h:111
Int_t GetRunNumber()
Definition: TEcnaWrite.cc:392
Int_t fCnaCommand
Definition: TEcnaWrite.h:45
Int_t fCodeRoot
Definition: TEcnaWrite.h:63
Int_t fCodeMSp
Definition: TEcnaWrite.h:77
Int_t fNbOfSamples
Definition: TEcnaWrite.h:125
TString fStopDate
Definition: TEcnaWrite.h:135
Double_t * fjustap_1d_ss
Definition: TEcnaWrite.h:114
Int_t fCodeHeaderAscii
Definition: TEcnaWrite.h:62
void WriteAsciiHisto(const TString &, const Int_t &, const TVectorD &)
Definition: TEcnaWrite.cc:1485
Int_t fFirstReqEvtNumber
Definition: TEcnaWrite.h:127
Int_t fSectChanSizeX
Definition: TEcnaWrite.h:94
Int_t GetReqNbOfEvts()
Definition: TEcnaWrite.cc:394
std::ofstream fFcout_f
Definition: TEcnaWrite.h:59
Int_t fCodeMeanCorss
Definition: TEcnaWrite.h:70
void SetEcalSubDetector(const TString &)
Definition: TEcnaWrite.cc:208
TString fStinName
Definition: TEcnaWrite.h:132
Int_t fCodeLFccMoStins
Definition: TEcnaWrite.h:90
Int_t fCodeLfCov
Definition: TEcnaWrite.h:85
Int_t fCodeAdcEvt
Definition: TEcnaWrite.h:76
Int_t fCodeTno
Definition: TEcnaWrite.h:67
Double_t * fjustap_1d_var
Definition: TEcnaWrite.h:108
Int_t fCodePrintComments
Definition: TEcnaWrite.h:50
Int_t fCodeHFccMoStins
Definition: TEcnaWrite.h:91
Int_t fCodeLfn
Definition: TEcnaWrite.h:68
Int_t fCodeAvSigCorss
Definition: TEcnaWrite.h:83
Int_t GetNbOfSamples()
Definition: TEcnaWrite.cc:391
TEcnaParCout * fCnaParCout
Definition: TEcnaWrite.h:57
TString fAsciiFileName
Definition: TEcnaWrite.h:141
Int_t fSectChanSizeY
Definition: TEcnaWrite.h:94
void WriteAsciiCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1759
Int_t fCodeCovCss
Definition: TEcnaWrite.h:73
Int_t fCodeNbOfEvts
Definition: TEcnaWrite.h:65
time_t fStopTime
Definition: TEcnaWrite.h:136
Int_t fCodeCorCss
Definition: TEcnaWrite.h:74
TString GetRootFileNameShort()
Definition: TEcnaWrite.cc:389
Int_t fLastReqEvtNumber
Definition: TEcnaWrite.h:128
TString fPathForAsciiFiles
Definition: TEcnaWrite.h:134
Int_t fSectSampSizeX
Definition: TEcnaWrite.h:95
Int_t fCodeLfCor
Definition: TEcnaWrite.h:86
TString fStartDate
Definition: TEcnaWrite.h:135
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:631
Int_t fCodePrintWarnings
Definition: TEcnaWrite.h:50
Int_t fCnewRoot
Definition: TEcnaWrite.h:39
TString GetRootFileName()
Definition: TEcnaWrite.cc:388
Int_t fCodeHfCor
Definition: TEcnaWrite.h:88
TString GetAnalysisName()
Definition: TEcnaWrite.cc:390
Int_t fReqNbOfEvts
Definition: TEcnaWrite.h:129
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:55
~TEcnaWrite() override
Definition: TEcnaWrite.cc:17
Int_t fCnaError
Definition: TEcnaWrite.h:45
Int_t fCodeSSp
Definition: TEcnaWrite.h:78
time_t fStartTime
Definition: TEcnaWrite.h:136