00001 #ifndef CL_TCnaReadEB_H
00002 #define CL_TCnaReadEB_H
00003
00004 #include "TObject.h"
00005 #include "TString.h"
00006 #include "Riostream.h"
00007 #include "TVectorD.h"
00008 #include "TMatrixD.h"
00009 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TCnaHeaderEB.h"
00010 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TCnaResultType.h"
00011 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TCnaRootFile.h"
00012 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TCnaParameters.h"
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 class TCnaReadEB: public TObject {
00026
00027 private:
00028
00029
00030
00031
00032
00033 Int_t fgMaxCar;
00034
00035 Int_t fCnew;
00036 Int_t fCdelete;
00037
00038 TString fTTBELL;
00039
00040 TCnaHeaderEB *fFileHeader;
00041 Int_t fCodeHeader;
00042
00043 Bool_t fOpenRootFile;
00044 Int_t fCodeRoot;
00045 Int_t fCodeCorresp;
00046
00047 Int_t fReadyToReadRootFile;
00048 Int_t fLookAtRootFile;
00049
00050 Int_t fSpecialSMTowerNotIndexed;
00051
00052 Int_t* fT1d_SMtowFromIndex;
00053 Int_t* fTagTowerNumbers;
00054 Int_t fMemoTowerNumbers;
00055
00056 Double_t** fjustap_2d_ev;
00057 Double_t* fjustap_1d_ev;
00058
00059 Double_t** fjustap_2d_var;
00060 Double_t* fjustap_1d_var;
00061
00062 Double_t** fjustap_2d_cc;
00063 Double_t* fjustap_1d_cc;
00064
00065 Double_t** fjustap_2d_ss;
00066 Double_t* fjustap_1d_ss;
00067
00068 ofstream fFcout_f;
00069 ifstream fFcin_f;
00070
00071 Int_t fDim_name;
00072
00073 TString fRootFileName;
00074 TString fRootFileNameShort;
00075
00076 TString fAsciiFileName;
00077 TString fAsciiFileNameShort;
00078
00079 TString fPathAscii;
00080 TString fPathRoot;
00081
00082 TString fKeyFileNameForCnaPaths;
00083
00084 TString fKeyWorkingDirPath;
00085 TString fKeyRootFilePath;
00086
00087 Int_t fSectChanSizeX, fSectChanSizeY,
00088 fSectSampSizeX, fSectSampSizeY;
00089
00090 Int_t fNbChanByLine;
00091 Int_t fNbSampByLine;
00092 Int_t fUserSamp;
00093 Int_t fUserChan;
00094
00095 Int_t fFlagPrint;
00096 Int_t fCodePrintComments, fCodePrintWarnings, fCodePrintAllComments, fCodePrintNoComment;
00097
00098
00099
00100 Bool_t fDataExist;
00101
00102
00103
00104 void fCopy(const TCnaReadEB&);
00105 void fMakeResultsFileName(const Int_t&);
00106
00107 public:
00108
00109
00110
00111 TCnaReadEB();
00112 TCnaReadEB(const TCnaReadEB&);
00113
00114
00115
00116 TCnaReadEB& operator=(const TCnaReadEB&);
00117
00118
00119
00120 virtual ~TCnaReadEB();
00121
00122
00123
00124 void Init();
00125
00126 Bool_t OpenRootFile(Text_t *, TString);
00127 Bool_t CloseRootFile(Text_t *);
00128 Bool_t ReadRootFileHeader(const Int_t&);
00129 Bool_t DataExist();
00130
00131
00132
00133 void GetReadyToReadRootFile( TString, const Int_t&, const Int_t&,
00134 const Int_t&, const Int_t&, TString);
00135
00136 time_t GetStartTime();
00137 time_t GetStopTime();
00138 TString GetStartDate();
00139 TString GetStopDate();
00140 void DefineResultsRootFilePath(TString);
00141 TString GetRootFileNameShort();
00142
00143
00144
00145 Bool_t LookAtRootFile();
00146
00147 TVectorD ReadTowerNumbers();
00148 Int_t GetSMTowFromIndex(const Int_t&);
00149 Int_t GetTowerIndex(const Int_t&);
00150 Int_t GetSMEcha(const Int_t&, const Int_t&);
00151
00152 TMatrixD ReadNumbersOfFoundEventsForSamples(const Int_t&);
00153 TVectorD ReadSampleAsFunctionOfTime(const Int_t&, const Int_t&, const Int_t&);
00154 TVectorD ReadExpectationValuesOfSamples(const Int_t&, const Int_t&);
00155 TVectorD ReadVariancesOfSamples(const Int_t&, const Int_t&);
00156 TVectorD ReadSigmasOfSamples(const Int_t&, const Int_t&);
00157 TVectorD ReadEventDistribution(const Int_t&, const Int_t&, const Int_t&);
00158 Double_t ReadEventDistributionXmin(const Int_t&, const Int_t&, const Int_t&);
00159 Double_t ReadEventDistributionXmax(const Int_t&, const Int_t&, const Int_t&);
00160
00161 TMatrixD ReadCovariancesBetweenCrystalsMeanOverSamples(const Int_t&, const Int_t&);
00162
00163 TMatrixD ReadCorrelationsBetweenCrystalsMeanOverSamples(const Int_t&, const Int_t&);
00164
00165
00166 TMatrixD ReadCovariancesBetweenCrystalsMeanOverSamples();
00167 TMatrixD ReadCorrelationsBetweenCrystalsMeanOverSamples();
00168
00169 TMatrixD ReadCovariancesBetweenTowersMeanOverSamplesAndChannels();
00170 TMatrixD ReadCorrelationsBetweenTowersMeanOverSamplesAndChannels();
00171
00172 TMatrixD ReadCovariancesBetweenSamples(const Int_t&, const Int_t&);
00173 TMatrixD ReadCorrelationsBetweenSamples(const Int_t&, const Int_t&);
00174 TVectorD ReadRelevantCorrelationsBetweenSamples(const Int_t&, const Int_t&);
00175
00176 TVectorD ReadExpectationValuesOfExpectationValuesOfSamples();
00177 TVectorD ReadExpectationValuesOfSigmasOfSamples();
00178 TVectorD ReadExpectationValuesOfCorrelationsBetweenSamples();
00179
00180 TVectorD ReadSigmasOfExpectationValuesOfSamples();
00181 TVectorD ReadSigmasOfSigmasOfSamples();
00182 TVectorD ReadSigmasOfCorrelationsBetweenSamples();
00183
00184 TMatrixD ReadCorrectionsToSamplesFromCovss(const Int_t&);
00185 TVectorD ReadCorrectionsToSamplesFromCovss(const Int_t&, const Int_t&);
00186 TMatrixD ReadCorrectionFactorsToCovss(const Int_t&, const Int_t&);
00187 TMatrixD ReadCorrectionFactorsToCorss(const Int_t&, const Int_t&);
00188
00189 Int_t MaxTowEtaInSM();
00190 Int_t MaxTowPhiInSM();
00191 Int_t MaxTowInSM();
00192
00193 Int_t MaxCrysEtaInTow();
00194 Int_t MaxCrysPhiInTow();
00195 Int_t MaxCrysInTow();
00196 Int_t MaxCrysInSM();
00197
00198 Int_t MaxSampADC();
00199
00200 TString GetAnalysisName();
00201 Int_t GetFirstTakenEventNumber();
00202 Int_t GetNumberOfTakenEvents();
00203
00204 Int_t GetNumberOfBinsEventDistributions();
00205 Int_t GetNumberOfBinsSampleAsFunctionOfTime();
00206
00207 TString GetTypeOfQuantity(const CnaResultTyp);
00208
00209
00210
00211 void PrintNoComment();
00212
00213 void PrintWarnings();
00214 void PrintComments();
00215
00216 void PrintAllComments();
00217
00218 ClassDef(TCnaReadEB,1)
00219 };
00220
00221 #endif // CL_TCnaReadEB_H
00222
00223