00001 #ifndef CL_TEcnaRead_H
00002 #define CL_TEcnaRead_H
00003
00004 #include <time.h>
00005 #include <math.h>
00006
00007 #include "TSystem.h"
00008 #include "TObject.h"
00009 #include "TString.h"
00010 #include "Riostream.h"
00011 #include "TVectorD.h"
00012 #include "TMatrixD.h"
00013
00014 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParEcal.h"
00015 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaHeader.h"
00016
00017 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParCout.h"
00018 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParPaths.h"
00019 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaWrite.h"
00020 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaNumbering.h"
00021
00022 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaResultType.h"
00023 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaRootFile.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class TEcnaRead: public TObject {
00039
00040 private:
00041
00042
00043
00044
00045
00046 Int_t fgMaxCar;
00047
00048 Int_t fCnew;
00049 Int_t fCdelete;
00050
00051 TString fTTBELL;
00052
00053 TEcnaParCout *fCnaParCout;
00054 TEcnaParPaths *fCnaParPaths;
00055
00056 TEcnaHeader *fFileHeader;
00057 TEcnaWrite *fCnaWrite;
00058 TEcnaParEcal *fEcal;
00059 TEcnaNumbering *fEcalNumbering;
00060
00061 TString fFlagSubDet;
00062 TString fStexName, fStinName;
00063
00064 Bool_t fOpenRootFile;
00065
00066 Int_t fReadyToReadRootFile;
00067 Int_t fLookAtRootFile;
00068
00069 Int_t* fT1d_StexStinFromIndex;
00070 Int_t* fTagStinNumbers;
00071 Int_t fMemoStinNumbers;
00072
00073 TString fPathRoot;
00074
00075 Int_t fSectChanSizeX, fSectChanSizeY,
00076 fSectSampSizeX, fSectSampSizeY;
00077
00078 Int_t fNbChanByLine;
00079 Int_t fNbSampByLine;
00080 Int_t fUserSamp;
00081 Int_t fUserChan;
00082
00083 Int_t fFlagPrint;
00084 Int_t fCodePrintComments, fCodePrintWarnings, fCodePrintAllComments, fCodePrintNoComment;
00085
00086
00087
00088 Bool_t fDataExist;
00089
00090
00091 Double_t*** fT3d_distribs;
00092 Double_t** fT3d2_distribs;
00093 Double_t* fT3d1_distribs;
00094
00095
00096
00097 void fCopy(const TEcnaRead&);
00098
00099 public:
00100
00101
00102
00103 TEcnaRead();
00104
00105 TEcnaRead(const TString, const TEcnaParPaths*, const TEcnaParCout*,
00106 const TEcnaHeader*, const TEcnaNumbering*, const TEcnaWrite*);
00107
00108 TEcnaRead(const TEcnaRead&);
00109
00110
00111
00112 TEcnaRead& operator=(const TEcnaRead&);
00113
00114
00115
00116 virtual ~TEcnaRead();
00117
00118
00119
00120 void Init();
00121 void SetEcalSubDetector(const TString, const TEcnaNumbering*, const TEcnaWrite*);
00122
00123 void Anew(const TString);
00124 void Adelete(const TString);
00125
00126 Bool_t OpenRootFile(const Text_t *, TString);
00127 Bool_t CloseRootFile(const Text_t *);
00128 Bool_t ReadRootFileHeader(const Int_t&);
00129 Bool_t DataExist();
00130
00131
00132
00133 void GetReadyToReadRootFile(TString,
00134 const Int_t&, const Int_t&, const Int_t&,
00135 const Int_t&, const Int_t&, const Int_t&, TString);
00136 time_t GetStartTime();
00137 time_t GetStopTime();
00138 TString GetStartDate();
00139 TString GetStopDate();
00140 TString GetRootFileName();
00141 TString GetRootFileNameShort();
00142
00143 TString GetRunType();
00144
00145
00146
00147 Bool_t LookAtRootFile();
00148
00149 Int_t GetStexStinFromIndex(const Int_t&);
00150 Int_t GetStinIndex(const Int_t&);
00151
00152 TVectorD ReadStinNumbers(const Int_t&);
00153 TMatrixD ReadNumberOfEventsForSamples(const Int_t&, const Int_t&, const Int_t&);
00154
00155 TVectorD ReadSampleValues(const Int_t&, const Int_t&, const Int_t&);
00156 Double_t*** ReadSampleValuesSameFile(const Int_t&, const Int_t&, const Int_t&);
00157
00158 TVectorD ReadSampleMeans(const Int_t&, const Int_t&, const Int_t&);
00159 TVectorD ReadSampleSigmas(const Int_t&, const Int_t&, const Int_t&);
00160
00161
00162
00163 TMatrixD ReadCovariancesBetweenSamples(const Int_t&, const Int_t&, const Int_t&);
00164 TMatrixD ReadCorrelationsBetweenSamples(const Int_t&, const Int_t&, const Int_t&);
00165 TVectorD ReadRelevantCorrelationsBetweenSamples(const Int_t&, const Int_t&, const Int_t&);
00166
00167
00168
00169 TMatrixD ReadLowFrequencyCovariancesBetweenChannels(const Int_t&, const Int_t&, const Int_t&);
00170 TMatrixD ReadHighFrequencyCovariancesBetweenChannels(const Int_t&, const Int_t&, const Int_t&);
00171
00172
00173 TMatrixD ReadLowFrequencyCorrelationsBetweenChannels(const Int_t&, const Int_t&, const Int_t&);
00174 TMatrixD ReadHighFrequencyCorrelationsBetweenChannels(const Int_t&, const Int_t&, const Int_t&);
00175
00176
00177
00178 TMatrixD ReadLowFrequencyCovariancesBetweenChannels(const Int_t&);
00179 TMatrixD ReadHighFrequencyCovariancesBetweenChannels(const Int_t&);
00180 TMatrixD ReadLowFrequencyCorrelationsBetweenChannels(const Int_t&);
00181 TMatrixD ReadHighFrequencyCorrelationsBetweenChannels(const Int_t&);
00182
00183
00184 TMatrixD ReadLowFrequencyMeanCorrelationsBetweenStins(const Int_t&);
00185 TMatrixD ReadHighFrequencyMeanCorrelationsBetweenStins(const Int_t&);
00186
00187
00188 TVectorD ReadNumberOfEvents(const Int_t&);
00189 TVectorD ReadPedestals(const Int_t&);
00190 TVectorD ReadTotalNoise(const Int_t&);
00191 TVectorD ReadLowFrequencyNoise(const Int_t&);
00192 TVectorD ReadHighFrequencyNoise(const Int_t&);
00193 TVectorD ReadMeanOfCorrelationsBetweenSamples(const Int_t&);
00194 TVectorD ReadSigmaOfCorrelationsBetweenSamples(const Int_t&);
00195
00196
00197 TVectorD ReadAveragedNumberOfEvents(const Int_t&);
00198 TVectorD ReadAveragedPedestals(const Int_t&);
00199 TVectorD ReadAveragedTotalNoise(const Int_t&);
00200 TVectorD ReadAveragedLowFrequencyNoise(const Int_t&);
00201 TVectorD ReadAveragedHighFrequencyNoise(const Int_t&);
00202 TVectorD ReadAveragedMeanOfCorrelationsBetweenSamples(const Int_t&);
00203 TVectorD ReadAveragedSigmaOfCorrelationsBetweenSamples(const Int_t&);
00204
00205
00206 TString GetAnalysisName();
00207 Int_t GetFirstReqEvtNumber();
00208 Int_t GetReqNbOfEvts();
00209
00210 Int_t GetNumberOfBinsSampleAsFunctionOfTime();
00211
00212 TString GetTypeOfQuantity(const CnaResultTyp);
00213
00214
00215
00216 void PrintNoComment();
00217
00218 void PrintWarnings();
00219 void PrintComments();
00220
00221 void PrintAllComments();
00222
00223 ClassDef(TEcnaRead,1)
00224 };
00225
00226 #endif // CL_TEcnaRead_H
00227
00228