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 
21 
33 
34 class TEcnaWrite : public TObject {
35 
36  private:
37 
38  //..... Attributes
39 
40  Int_t fgMaxCar; // Max nb of caracters for char*
41  Int_t fCnew, fCdelete;
43 
44  TString fTTBELL;
45 
47 
48  //...............................................................
49 
50  Int_t fFlagPrint;
52 
54  TString fFlagSubDet;
55 
59 
60  ofstream fFcout_f;
61 
62  //...................................... Codes for file names
64  Int_t fCodeRoot;
65 
67  Int_t fCodePed;
68  Int_t fCodeTno;
69  Int_t fCodeLfn;
70  Int_t fCodeHfn;
73 
74  Int_t fCodeCovCss;
75  Int_t fCodeCorCss;
76 
77  Int_t fCodeAdcEvt;
78  Int_t fCodeMSp;
79  Int_t fCodeSSp;
80 
81  Int_t fCodeAvPed;
82  Int_t fCodeAvTno;
85 
86  Int_t fCodeLfCov;
87  Int_t fCodeLfCor;
88  Int_t fCodeHfCov;
89  Int_t fCodeHfCor;
90 
93 
94  //..........................................................................
97 
98  Int_t fNbChanByLine; // Nb channels by line (for ASCII results file)
99  Int_t fNbSampByLine; // Nb samples by line (for ASCII results file)
100  Int_t fUserSamp; // Current sample number (for ASCII results file)
101  Int_t fStexStinUser; // Current Stin number in Stex
102  Int_t fStinEchaUser; // Current electronic channel number in Stin
103  // for ASCII results file ([0,24] for EB, [1,25] for EE)
104 
105 
106  Double_t** fjustap_2d_ev;
107  Double_t* fjustap_1d_ev;
108 
109  Double_t** fjustap_2d_var;
110  Double_t* fjustap_1d_var;
111 
112  Double_t** fjustap_2d_cc;
113  Double_t* fjustap_1d_cc;
114 
115  Double_t** fjustap_2d_ss;
116  Double_t* fjustap_1d_ss;
117 
118  //.................... Private methods
119 
120  void fAsciiFileWriteHeader(const Int_t&);
121  void fT2dWriteAscii(const Int_t&, const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
122 
123  public:
124 
125  //..... Public attributes
126 
127  TString fAnaType;
129  Int_t fRunNumber;
133  Int_t fStexNumber;
134  TString fStexName;
135  TString fStinName;
136 
140 
141  TString fRootFileNameShort; // name of the results ROOT file
142  TString fRootFileName; // name of the results ROOT file with its path = fPathRoot/fRootFileNameShort
143 
144  TString fAsciiFileName; // name of the results ASCII file
145  TString fAsciiFileNameShort; // name of the results ASCII file = fPathAscii/fAsciiFileNameShort
146 
147  //..... Methods
148 
149  TEcnaWrite();
150  TEcnaWrite(TEcnaObject*, const TString);
151  TEcnaWrite(const TString, const TEcnaParPaths*, const TEcnaParCout*,
152  const TEcnaParEcal*, const TEcnaNumbering*);
153 
154  virtual ~TEcnaWrite();
155 
156  void Init();
157  void SetEcalSubDetector(const TString);
158  void SetEcalSubDetector(const TString, const TEcnaParEcal*, const TEcnaNumbering*);
159 
160  //...................................................... making file name method
161  void fMakeResultsFileName(); // => default: arg = fCodeRoot
162  void fMakeResultsFileName(const Int_t&);
163 
164  //.................................... ASCII writing file methods
165  // void WriteAsciiSampleMeans(); // methode a remettre ?
166  // void WriteAsciiSampleSigmas(); // methode a remettre ?
167 
168  void WriteAsciiCovariancesBetweenSamples(const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
169  void WriteAsciiCorrelationsBetweenSamples(const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
170 
171  void WriteAsciiHisto(const TString, const Int_t&, const TVectorD&);
172 
173  //...........................................................................
174  TString GetAsciiFileName();
175  TString GetRootFileName();
176  TString GetRootFileNameShort();
177  TString GetAnalysisName();
178 
179  Int_t GetNbOfSamples();
180  Int_t GetRunNumber();
181  Int_t GetFirstReqEvtNumber();
182  Int_t GetReqNbOfEvts();
183  Int_t GetStexNumber();
184 
185  Int_t NumberOfEventsAnalysis(Int_t**, const Int_t&, const Int_t&, const Int_t&); // Called by TEcnaRun
186  Int_t NumberOfEventsAnalysis(Int_t*, const Int_t&, const Int_t&, const Int_t&); // Called by TEcnaRead
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:1050
Int_t fCodeHfn
Definition: TEcnaWrite.h:70
Double_t ** fjustap_2d_cc
Definition: TEcnaWrite.h:112
Int_t NumberOfEventsAnalysis(Int_t **, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaWrite.cc:519
void SetEcalSubDetector(const TString)
Definition: TEcnaWrite.cc:203
Int_t fSectSampSizeY
Definition: TEcnaWrite.h:96
Int_t fCodeAvPed
Definition: TEcnaWrite.h:81
Int_t fStinEchaUser
Definition: TEcnaWrite.h:102
void Init()
Definition: TEcnaWrite.cc:134
Int_t GetStexNumber()
Definition: TEcnaWrite.cc:391
Int_t fgMaxCar
Definition: TEcnaWrite.h:40
void WriteAsciiCovariancesBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1404
Int_t fNbSampByLine
Definition: TEcnaWrite.h:99
Double_t * fjustap_1d_ev
Definition: TEcnaWrite.h:107
Int_t fCodePrintNoComment
Definition: TEcnaWrite.h:51
TString fFlagSubDet
Definition: TEcnaWrite.h:54
Int_t fCodeHfCov
Definition: TEcnaWrite.h:88
TString fStexName
Definition: TEcnaWrite.h:134
Double_t ** fjustap_2d_ev
Definition: TEcnaWrite.h:106
Double_t ** fjustap_2d_var
Definition: TEcnaWrite.h:109
Double_t ** fjustap_2d_ss
Definition: TEcnaWrite.h:115
Int_t fNbChanByLine
Definition: TEcnaWrite.h:98
TEcnaParPaths * fCnaParPaths
Definition: TEcnaWrite.h:57
TString fAnaType
Definition: TEcnaWrite.h:127
Int_t fStexNumber
Definition: TEcnaWrite.h:133
TString fAsciiFileNameShort
Definition: TEcnaWrite.h:145
Int_t fStexStinUser
Definition: TEcnaWrite.h:101
TEcnaParEcal * fEcal
Definition: TEcnaWrite.h:53
Int_t fRunNumber
Definition: TEcnaWrite.h:129
TString fRootFileNameShort
Definition: TEcnaWrite.h:141
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:609
TString GetAsciiFileName()
Definition: TEcnaWrite.cc:383
Int_t GetFirstReqEvtNumber()
Definition: TEcnaWrite.cc:389
Int_t fCdelete
Definition: TEcnaWrite.h:41
Int_t fCnew
Definition: TEcnaWrite.h:41
Int_t fUserSamp
Definition: TEcnaWrite.h:100
Int_t fCdeleteRoot
Definition: TEcnaWrite.h:42
Int_t fCodePed
Definition: TEcnaWrite.h:67
Int_t fCodeAvTno
Definition: TEcnaWrite.h:82
TString fRootFileName
Definition: TEcnaWrite.h:142
Int_t fCodeAvMeanCorss
Definition: TEcnaWrite.h:83
TString fTTBELL
Definition: TEcnaWrite.h:44
Int_t fCodePrintAllComments
Definition: TEcnaWrite.h:51
Int_t fCodeSigCorss
Definition: TEcnaWrite.h:72
void fT2dWriteAscii(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1468
Int_t fFlagPrint
Definition: TEcnaWrite.h:50
Double_t * fjustap_1d_cc
Definition: TEcnaWrite.h:113
Int_t GetRunNumber()
Definition: TEcnaWrite.cc:388
Int_t fCnaCommand
Definition: TEcnaWrite.h:46
Int_t fCodeRoot
Definition: TEcnaWrite.h:64
Int_t fCodeMSp
Definition: TEcnaWrite.h:78
Int_t fNbOfSamples
Definition: TEcnaWrite.h:128
TString fStopDate
Definition: TEcnaWrite.h:138
Double_t * fjustap_1d_ss
Definition: TEcnaWrite.h:116
Int_t fCodeHeaderAscii
Definition: TEcnaWrite.h:63
Int_t fFirstReqEvtNumber
Definition: TEcnaWrite.h:130
Int_t fSectChanSizeX
Definition: TEcnaWrite.h:95
Int_t GetReqNbOfEvts()
Definition: TEcnaWrite.cc:390
Int_t fCodeMeanCorss
Definition: TEcnaWrite.h:71
TString fStinName
Definition: TEcnaWrite.h:135
ofstream fFcout_f
Definition: TEcnaWrite.h:60
Int_t fCodeLFccMoStins
Definition: TEcnaWrite.h:91
Int_t fCodeLfCov
Definition: TEcnaWrite.h:86
Int_t fCodeAdcEvt
Definition: TEcnaWrite.h:77
virtual ~TEcnaWrite()
Definition: TEcnaWrite.cc:17
Int_t fCodeTno
Definition: TEcnaWrite.h:68
Double_t * fjustap_1d_var
Definition: TEcnaWrite.h:110
Int_t fCodePrintComments
Definition: TEcnaWrite.h:51
Int_t fCodeHFccMoStins
Definition: TEcnaWrite.h:92
Int_t fCodeLfn
Definition: TEcnaWrite.h:69
Int_t fCodeAvSigCorss
Definition: TEcnaWrite.h:84
Int_t GetNbOfSamples()
Definition: TEcnaWrite.cc:387
TEcnaParCout * fCnaParCout
Definition: TEcnaWrite.h:58
TString fAsciiFileName
Definition: TEcnaWrite.h:144
Int_t fSectChanSizeY
Definition: TEcnaWrite.h:95
void WriteAsciiCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1434
Int_t fCodeCovCss
Definition: TEcnaWrite.h:74
Int_t fCodeNbOfEvts
Definition: TEcnaWrite.h:66
time_t fStopTime
Definition: TEcnaWrite.h:139
Int_t fCodeCorCss
Definition: TEcnaWrite.h:75
void WriteAsciiHisto(const TString, const Int_t &, const TVectorD &)
Definition: TEcnaWrite.cc:1187
TString GetRootFileNameShort()
Definition: TEcnaWrite.cc:385
Int_t fLastReqEvtNumber
Definition: TEcnaWrite.h:131
TString fPathForAsciiFiles
Definition: TEcnaWrite.h:137
Int_t fSectSampSizeX
Definition: TEcnaWrite.h:96
Int_t fCodeLfCor
Definition: TEcnaWrite.h:87
TString fStartDate
Definition: TEcnaWrite.h:138
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:639
Int_t fCodePrintWarnings
Definition: TEcnaWrite.h:51
Int_t fCnewRoot
Definition: TEcnaWrite.h:42
TString GetRootFileName()
Definition: TEcnaWrite.cc:384
Int_t fCodeHfCor
Definition: TEcnaWrite.h:89
TString GetAnalysisName()
Definition: TEcnaWrite.cc:386
Int_t fReqNbOfEvts
Definition: TEcnaWrite.h:132
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:56
Int_t fCnaError
Definition: TEcnaWrite.h:46
Int_t fCodeSSp
Definition: TEcnaWrite.h:79
time_t fStartTime
Definition: TEcnaWrite.h:139