00001 #ifndef ZTR_TEcnaWrite
00002 #define ZTR_TEcnaWrite
00003
00004 #include <Riostream.h>
00005
00006 #include "TObject.h"
00007 #include "TSystem.h"
00008 #include "Riostream.h"
00009 #include <math.h>
00010 #include <time.h>
00011
00012 #include "TVectorD.h"
00013 #include "TMatrixD.h"
00014
00015 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaObject.h"
00016 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaNumbering.h"
00017 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParEcal.h"
00018 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParPaths.h"
00019 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParCout.h"
00020 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaHeader.h"
00021
00033
00034 class TEcnaWrite : public TObject {
00035
00036 private:
00037
00038
00039
00040 Int_t fgMaxCar;
00041 Int_t fCnew, fCdelete;
00042 Int_t fCnewRoot, fCdeleteRoot;
00043
00044 TString fTTBELL;
00045
00046 Int_t fCnaCommand, fCnaError;
00047
00048
00049
00050 Int_t fFlagPrint;
00051 Int_t fCodePrintComments, fCodePrintWarnings, fCodePrintAllComments, fCodePrintNoComment;
00052
00053 TEcnaParEcal *fEcal;
00054 TString fFlagSubDet;
00055
00056 TEcnaNumbering *fEcalNumbering;
00057 TEcnaParPaths *fCnaParPaths;
00058 TEcnaParCout *fCnaParCout;
00059
00060 ofstream fFcout_f;
00061
00062
00063 Int_t fCodeHeaderAscii;
00064 Int_t fCodeRoot;
00065
00066 Int_t fCodeNbOfEvts;
00067 Int_t fCodePed;
00068 Int_t fCodeTno;
00069 Int_t fCodeLfn;
00070 Int_t fCodeHfn;
00071 Int_t fCodeMeanCorss;
00072 Int_t fCodeSigCorss;
00073
00074 Int_t fCodeCovCss;
00075 Int_t fCodeCorCss;
00076
00077 Int_t fCodeAdcEvt;
00078 Int_t fCodeMSp;
00079 Int_t fCodeSSp;
00080
00081 Int_t fCodeAvPed;
00082 Int_t fCodeAvTno;
00083 Int_t fCodeAvMeanCorss;
00084 Int_t fCodeAvSigCorss;
00085
00086 Int_t fCodeLfCov;
00087 Int_t fCodeLfCor;
00088 Int_t fCodeHfCov;
00089 Int_t fCodeHfCor;
00090
00091 Int_t fCodeLFccMoStins;
00092 Int_t fCodeHFccMoStins;
00093
00094
00095 Int_t fSectChanSizeX, fSectChanSizeY;
00096 Int_t fSectSampSizeX, fSectSampSizeY;
00097
00098 Int_t fNbChanByLine;
00099 Int_t fNbSampByLine;
00100 Int_t fUserSamp;
00101 Int_t fStexStinUser;
00102 Int_t fStinEchaUser;
00103
00104
00105
00106 Double_t** fjustap_2d_ev;
00107 Double_t* fjustap_1d_ev;
00108
00109 Double_t** fjustap_2d_var;
00110 Double_t* fjustap_1d_var;
00111
00112 Double_t** fjustap_2d_cc;
00113 Double_t* fjustap_1d_cc;
00114
00115 Double_t** fjustap_2d_ss;
00116 Double_t* fjustap_1d_ss;
00117
00118
00119
00120 void fAsciiFileWriteHeader(const Int_t&);
00121 void fT2dWriteAscii(const Int_t&, const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
00122
00123 public:
00124
00125
00126
00127 TString fAnaType;
00128 Int_t fNbOfSamples;
00129 Int_t fRunNumber;
00130 Int_t fFirstReqEvtNumber;
00131 Int_t fLastReqEvtNumber;
00132 Int_t fReqNbOfEvts;
00133 Int_t fStexNumber;
00134 TString fStexName;
00135 TString fStinName;
00136
00137 TString fPathForAsciiFiles;
00138 TString fStartDate, fStopDate;
00139 time_t fStartTime, fStopTime;
00140
00141 TString fRootFileNameShort;
00142 TString fRootFileName;
00143
00144 TString fAsciiFileName;
00145 TString fAsciiFileNameShort;
00146
00147
00148
00149 TEcnaWrite();
00150 TEcnaWrite(TEcnaObject*, const TString);
00151 TEcnaWrite(const TString, const TEcnaParPaths*, const TEcnaParCout*,
00152 const TEcnaParEcal*, const TEcnaNumbering*);
00153
00154 virtual ~TEcnaWrite();
00155
00156 void Init();
00157 void SetEcalSubDetector(const TString);
00158 void SetEcalSubDetector(const TString, const TEcnaParEcal*, const TEcnaNumbering*);
00159
00160
00161 void fMakeResultsFileName();
00162 void fMakeResultsFileName(const Int_t&);
00163
00164
00165
00166
00167
00168 void WriteAsciiCovariancesBetweenSamples(const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
00169 void WriteAsciiCorrelationsBetweenSamples(const Int_t&, const Int_t&, const Int_t&, const TMatrixD&);
00170
00171 void WriteAsciiHisto(const TString, const Int_t&, const TVectorD&);
00172
00173
00174 TString GetAsciiFileName();
00175 TString GetRootFileName();
00176 TString GetRootFileNameShort();
00177 TString GetAnalysisName();
00178
00179 Int_t GetNbOfSamples();
00180 Int_t GetRunNumber();
00181 Int_t GetFirstReqEvtNumber();
00182 Int_t GetReqNbOfEvts();
00183 Int_t GetStexNumber();
00184
00185 Int_t NumberOfEventsAnalysis(Int_t**, const Int_t&, const Int_t&, const Int_t&);
00186 Int_t NumberOfEventsAnalysis(Int_t*, const Int_t&, const Int_t&, const Int_t&);
00187
00188 void RegisterFileParameters(const TString, const Int_t&, const Int_t&, const Int_t&,
00189 const Int_t&, const Int_t&, const Int_t&, const TString, const TString,
00190 const time_t, const time_t);
00191
00192 void RegisterFileParameters(const TString, const Int_t&, const Int_t&, const Int_t&,
00193 const Int_t&, const Int_t&, const Int_t&);
00194
00195 ClassDef(TEcnaWrite,1)
00196 };
00197
00198 #endif // ZTR_TEcnaParameter
00199