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