CMS 3D CMS Logo

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
TEcnaWrite::fCnewRoot
Int_t fCnewRoot
Definition: TEcnaWrite.h:39
TEcnaWrite::fNbChanByLine
Int_t fNbChanByLine
Definition: TEcnaWrite.h:97
TEcnaWrite::fjustap_2d_ev
Double_t ** fjustap_2d_ev
Definition: TEcnaWrite.h:104
TEcnaParPaths.h
TEcnaWrite::fjustap_2d_ss
Double_t ** fjustap_2d_ss
Definition: TEcnaWrite.h:113
TEcnaWrite::fCodePrintComments
Int_t fCodePrintComments
Definition: TEcnaWrite.h:50
TEcnaWrite::fNbSampByLine
Int_t fNbSampByLine
Definition: TEcnaWrite.h:98
TEcnaWrite::fStexNumber
Int_t fStexNumber
Definition: TEcnaWrite.h:130
TEcnaWrite::fCodeAvPed
Int_t fCodeAvPed
Definition: TEcnaWrite.h:80
TEcnaWrite::fReqNbOfEvts
Int_t fReqNbOfEvts
Definition: TEcnaWrite.h:129
TEcnaWrite::fCodeHfCor
Int_t fCodeHfCor
Definition: TEcnaWrite.h:88
TEcnaWrite::fUserSamp
Int_t fUserSamp
Definition: TEcnaWrite.h:99
TEcnaWrite::WriteAsciiCovariancesBetweenSamples
void WriteAsciiCovariancesBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1723
TEcnaWrite::fCodeCovCss
Int_t fCodeCovCss
Definition: TEcnaWrite.h:73
TEcnaWrite::fRootFileName
TString fRootFileName
Definition: TEcnaWrite.h:139
TEcnaWrite::fSectSampSizeX
Int_t fSectSampSizeX
Definition: TEcnaWrite.h:95
TEcnaWrite::GetNbOfSamples
Int_t GetNbOfSamples()
Definition: TEcnaWrite.cc:391
TEcnaParEcal
Definition: TEcnaParEcal.h:24
TEcnaWrite::fCodeAvSigCorss
Int_t fCodeAvSigCorss
Definition: TEcnaWrite.h:83
TEcnaWrite::fCnew
Int_t fCnew
Definition: TEcnaWrite.h:38
TEcnaWrite::fCdeleteRoot
Int_t fCdeleteRoot
Definition: TEcnaWrite.h:39
TEcnaWrite::fEcal
TEcnaParEcal * fEcal
Definition: TEcnaWrite.h:52
TEcnaWrite::fCodeRoot
Int_t fCodeRoot
Definition: TEcnaWrite.h:63
TEcnaWrite::fCodeSSp
Int_t fCodeSSp
Definition: TEcnaWrite.h:78
TEcnaWrite::fAnaType
TString fAnaType
Definition: TEcnaWrite.h:124
TEcnaWrite::GetRootFileName
TString GetRootFileName()
Definition: TEcnaWrite.cc:388
TEcnaWrite::fCnaParPaths
TEcnaParPaths * fCnaParPaths
Definition: TEcnaWrite.h:56
TEcnaParCout
Definition: TEcnaParCout.h:25
TEcnaWrite::fCnaError
Int_t fCnaError
Definition: TEcnaWrite.h:45
TEcnaWrite::fjustap_1d_cc
Double_t * fjustap_1d_cc
Definition: TEcnaWrite.h:111
TEcnaWrite::fT2dWriteAscii
void fT2dWriteAscii(const Int_t &, const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1798
TEcnaParEcal.h
TEcnaWrite::fCodeMSp
Int_t fCodeMSp
Definition: TEcnaWrite.h:77
TEcnaWrite::fTTBELL
TString fTTBELL
Definition: TEcnaWrite.h:43
TEcnaWrite::fgMaxCar
Int_t fgMaxCar
Definition: TEcnaWrite.h:41
TEcnaWrite::fCodePrintAllComments
Int_t fCodePrintAllComments
Definition: TEcnaWrite.h:50
TEcnaWrite::fRootFileNameShort
TString fRootFileNameShort
Definition: TEcnaWrite.h:138
TEcnaWrite::RegisterFileParameters
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
TEcnaWrite::fCdelete
Int_t fCdelete
Definition: TEcnaWrite.h:38
TEcnaWrite::fjustap_1d_var
Double_t * fjustap_1d_var
Definition: TEcnaWrite.h:108
TEcnaWrite::fFcout_f
std::ofstream fFcout_f
Definition: TEcnaWrite.h:59
TEcnaWrite::fSectSampSizeY
Int_t fSectSampSizeY
Definition: TEcnaWrite.h:95
TEcnaWrite::GetFirstReqEvtNumber
Int_t GetFirstReqEvtNumber()
Definition: TEcnaWrite.cc:393
TEcnaWrite::fStinName
TString fStinName
Definition: TEcnaWrite.h:132
TEcnaObject.h
TEcnaWrite::WriteAsciiCorrelationsBetweenSamples
void WriteAsciiCorrelationsBetweenSamples(const Int_t &, const Int_t &, const Int_t &, const TMatrixD &)
Definition: TEcnaWrite.cc:1759
TEcnaParPaths
Definition: TEcnaParPaths.h:24
TEcnaWrite::fStopDate
TString fStopDate
Definition: TEcnaWrite.h:135
TEcnaWrite::fCodeHeaderAscii
Int_t fCodeHeaderAscii
Definition: TEcnaWrite.h:62
TEcnaWrite::fCodeHFccMoStins
Int_t fCodeHFccMoStins
Definition: TEcnaWrite.h:91
TEcnaWrite::fjustap_1d_ss
Double_t * fjustap_1d_ss
Definition: TEcnaWrite.h:114
TEcnaWrite::fjustap_2d_var
Double_t ** fjustap_2d_var
Definition: TEcnaWrite.h:107
TEcnaWrite::fCodePrintNoComment
Int_t fCodePrintNoComment
Definition: TEcnaWrite.h:50
TEcnaWrite::fFlagPrint
Int_t fFlagPrint
Definition: TEcnaWrite.h:49
TEcnaWrite::fStexName
TString fStexName
Definition: TEcnaWrite.h:131
TEcnaWrite::GetReqNbOfEvts
Int_t GetReqNbOfEvts()
Definition: TEcnaWrite.cc:394
TEcnaObject
Definition: TEcnaObject.h:25
TEcnaWrite::fCodeSigCorss
Int_t fCodeSigCorss
Definition: TEcnaWrite.h:71
TEcnaWrite::fCnaParCout
TEcnaParCout * fCnaParCout
Definition: TEcnaWrite.h:57
TEcnaWrite::fCodeNbOfEvts
Int_t fCodeNbOfEvts
Definition: TEcnaWrite.h:65
TEcnaParCout.h
TEcnaWrite::~TEcnaWrite
~TEcnaWrite() override
Definition: TEcnaWrite.cc:17
TEcnaWrite::fCodeLfCov
Int_t fCodeLfCov
Definition: TEcnaWrite.h:85
TEcnaWrite::fPathForAsciiFiles
TString fPathForAsciiFiles
Definition: TEcnaWrite.h:134
TEcnaWrite::fCodeLfCor
Int_t fCodeLfCor
Definition: TEcnaWrite.h:86
TEcnaWrite::fCodeAdcEvt
Int_t fCodeAdcEvt
Definition: TEcnaWrite.h:76
TEcnaWrite::fAsciiFileNameShort
TString fAsciiFileNameShort
Definition: TEcnaWrite.h:142
TEcnaWrite::fCodeMeanCorss
Int_t fCodeMeanCorss
Definition: TEcnaWrite.h:70
TEcnaWrite::fStexStinUser
Int_t fStexStinUser
Definition: TEcnaWrite.h:100
TEcnaWrite::fAsciiFileWriteHeader
void fAsciiFileWriteHeader(const Int_t &)
Definition: TEcnaWrite.cc:1347
TEcnaWrite::WriteAsciiHisto
void WriteAsciiHisto(const TString &, const Int_t &, const TVectorD &)
Definition: TEcnaWrite.cc:1485
TEcnaWrite::fjustap_2d_cc
Double_t ** fjustap_2d_cc
Definition: TEcnaWrite.h:110
TEcnaWrite::GetAsciiFileName
TString GetAsciiFileName()
Definition: TEcnaWrite.cc:387
TEcnaWrite::SetEcalSubDetector
void SetEcalSubDetector(const TString &)
Definition: TEcnaWrite.cc:208
TEcnaNumbering
Definition: TEcnaNumbering.h:23
TEcnaWrite::fStinEchaUser
Int_t fStinEchaUser
Definition: TEcnaWrite.h:101
TEcnaWrite::fSectChanSizeY
Int_t fSectChanSizeY
Definition: TEcnaWrite.h:94
TEcnaWrite::fStartTime
time_t fStartTime
Definition: TEcnaWrite.h:136
TEcnaHeader.h
TEcnaWrite::GetStexNumber
Int_t GetStexNumber()
Definition: TEcnaWrite.cc:395
TEcnaWrite::fCodePrintWarnings
Int_t fCodePrintWarnings
Definition: TEcnaWrite.h:50
TEcnaWrite::fCodeHfn
Int_t fCodeHfn
Definition: TEcnaWrite.h:69
TEcnaWrite::NumberOfEventsAnalysis
Int_t NumberOfEventsAnalysis(Int_t **, const Int_t &, const Int_t &, const Int_t &)
Definition: TEcnaWrite.cc:514
TEcnaWrite::fAsciiFileName
TString fAsciiFileName
Definition: TEcnaWrite.h:141
TEcnaWrite::fFirstReqEvtNumber
Int_t fFirstReqEvtNumber
Definition: TEcnaWrite.h:127
TEcnaWrite::fCodeLfn
Int_t fCodeLfn
Definition: TEcnaWrite.h:68
TEcnaWrite::fCodePed
Int_t fCodePed
Definition: TEcnaWrite.h:66
TEcnaNumbering.h
TEcnaWrite::Init
void Init()
Definition: TEcnaWrite.cc:141
TEcnaWrite::fCodeAvMeanCorss
Int_t fCodeAvMeanCorss
Definition: TEcnaWrite.h:82
TEcnaWrite::fCodeAvTno
Int_t fCodeAvTno
Definition: TEcnaWrite.h:81
TEcnaWrite::TEcnaWrite
TEcnaWrite()
Definition: TEcnaWrite.cc:33
TEcnaWrite::fMakeResultsFileName
void fMakeResultsFileName()
Definition: TEcnaWrite.cc:631
TEcnaWrite::fCnaCommand
Int_t fCnaCommand
Definition: TEcnaWrite.h:45
TEcnaWrite::fCodeLFccMoStins
Int_t fCodeLFccMoStins
Definition: TEcnaWrite.h:90
TEcnaWrite::fStartDate
TString fStartDate
Definition: TEcnaWrite.h:135
TEcnaWrite::fNbOfSamples
Int_t fNbOfSamples
Definition: TEcnaWrite.h:125
TEcnaWrite::fCodeCorCss
Int_t fCodeCorCss
Definition: TEcnaWrite.h:74
TEcnaWrite::fCodeTno
Int_t fCodeTno
Definition: TEcnaWrite.h:67
TEcnaWrite::fLastReqEvtNumber
Int_t fLastReqEvtNumber
Definition: TEcnaWrite.h:128
TEcnaWrite::GetAnalysisName
TString GetAnalysisName()
Definition: TEcnaWrite.cc:390
TEcnaWrite::GetRootFileNameShort
TString GetRootFileNameShort()
Definition: TEcnaWrite.cc:389
TEcnaWrite::fjustap_1d_ev
Double_t * fjustap_1d_ev
Definition: TEcnaWrite.h:105
TEcnaWrite::GetRunNumber
Int_t GetRunNumber()
Definition: TEcnaWrite.cc:392
TEcnaWrite::fSectChanSizeX
Int_t fSectChanSizeX
Definition: TEcnaWrite.h:94
TEcnaWrite
Definition: TEcnaWrite.h:34
TEcnaWrite::fFlagSubDet
TString fFlagSubDet
Definition: TEcnaWrite.h:53
TEcnaWrite::fCodeHfCov
Int_t fCodeHfCov
Definition: TEcnaWrite.h:87
TEcnaWrite::fStopTime
time_t fStopTime
Definition: TEcnaWrite.h:136
TEcnaWrite::fEcalNumbering
TEcnaNumbering * fEcalNumbering
Definition: TEcnaWrite.h:55
TEcnaWrite::fRunNumber
Int_t fRunNumber
Definition: TEcnaWrite.h:126