#include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TCnaReadEB.h"
#include <math.h>
Go to the source code of this file.
Defines | |
#define | FCEV |
#define | NOGT |
Functions | |
ClassImp (TCnaReadEB) TCnaReadEB | |
Variables | |
R__EXTERN TCnaRootFile * | gCnaRootFile |
#define FCEV |
#define NOGT |
ClassImp | ( | TCnaReadEB | ) |
Definition at line 11 of file TCnaReadEB.cc.
References TCnaParameters::GetCodePrint().
00032 : 00033 // 00034 // TCnaReadEB* MyCnaRead = new TCnaReadEB(); 00035 // 00036 //==============> PREPARATION METHOD 00037 // 00038 // There is a preparation method named: GetReadyToReadRootFile(...); 00039 // 00040 // GetReadyToReadRootFile(...) is used to read the quantities written 00041 // in the ROOT files in order to use these quantities for analysis. 00042 // 00043 // *------------------------------------------------------* 00044 // %%%%%%%%%%%%%%%%%%| Example of program using GetReadyToReadRootFile(...) |%%%%%%%%%%%%%%%%%%%%%%% 00045 // *------------------------------------------------------* 00046 // 00047 // This example describes the reading of one result file. This file is in a 00048 // directory which name is given by the contents of a TSTring named PathForRootFile 00049 // 00050 // //................ Set values for the arguments 00051 // TString AnalysisName = "cosmics" 00052 // Int_t RunNumber = 22770; 00053 // Int_t FirstEvt = 300; 00054 // Int_t NbOfEvents = 150; 00055 // TString PathForRootFile = "/afs/cern.ch/etc..." // .root result files directory 00056 // 00057 // TCnaReadEB* MyCnaRead = new TCnaReadEB(); 00058 // MyCnaRead->GetReadyToReadRootFile(AnalysisName, RunNumber, 00059 // FirstTakenEvent, NbOfTakenEvents, Supermodule, 00060 // PathForRootFile); 00061 // 00062 // //##########> CALL TO THE METHOD: Bool_t LookAtRootFile() (MANDATORY) 00063 // // 00064 // // This methods returns a boolean. It tests the existence 00065 // // of the ROOT file corresponding to the argument values given 00066 // // in the call to the mwthod GetReadyToReadRootFile(...). 00067 // // It is recommended to test the return value of the method. 00068 // 00069 // // Example of use: 00070 // 00071 // if( MyCnaRead->LookAtRootFile() == kFALSE ) 00072 // { 00073 // cout << "*** ERROR: ROOT file not found" << endl; 00074 // } 00075 // else 00076 // { 00077 // //........... The ROOT file exists and has been found 00078 // // 00079 // //#########> CALLS TO THE METHODS WHICH RECOVER THE QUANTITIES. EXAMPLE: 00080 // // (see the complete list of the methods hereafter) 00081 // 00082 // Int_t MaxSamples = 10; 00083 // TMatrixD CorMat(MaxSamples,MaxSamples); 00084 // Int_t smtower = 59; 00085 // Int_t TowEcha = 4; 00086 // CorMat = MyCnaRead->ReadCorrelationsBetweenSamples(smtower,TowEcha); 00087 // : 00088 // (Analysis of the correlations, etc...) 00089 // : 00090 // } 00091 // 00092 //****************************************************************************** 00093 // 00094 // *=======================* 00095 // | DETAILLED DESCRIPTION | 00096 // *=======================* 00097 // 00098 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 00099 // 00100 // Declaration and Print Methods 00101 // 00102 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 00103 // 00104 // Just after the declaration with the constructor without arguments, 00105 // you can set a "Print Flag" by means of the following "Print Methods": 00106 // 00107 // TCnaReadEB* MyCnaRead = new TCnaReadEB(); // declaration of the object MyCnaRead 00108 // 00109 // // Print Methods: 00110 // 00111 // MyCnaRead->PrintNoComment(); // Set flag to forbid printing of all the comments 00112 // // except ERRORS. 00113 // 00114 // MyCnaRead->PrintWarnings(); // (DEFAULT) 00115 // // Set flag to authorize printing of some warnings. 00116 // // WARNING/INFO: information on something unusual 00117 // // in the data is pointed out. 00118 // // WARNING/CORRECTION: something wrong (but not too serious) 00119 // // in the value of some argument is pointed out and 00120 // // automatically modified to a correct value. 00121 // 00122 // MyCnaRead->PrintComments(); // Set flag to authorize printing of infos 00123 // // and some comments concerning initialisations 00124 // 00125 // MyCnaRead->PrintAllComments(); // Set flag to authorize printing of all the comments 00126 // 00127 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 00128 // 00129 // Method GetReadyToReadRootFile(...) and associated methods 00130 // 00131 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 00132 // 00133 // TCnaReadEB* MyCnaRead = new TCnaReadEB(); 00134 // MyCnaRead->GetReadyToReadRootFile(AnalysisName, RunNumber, 00135 // FirstEvent, NbOfEvents, SuperModule, 00136 // PathForRootFile); 00137 // 00138 // Explanations for the arguments: 00139 // 00140 // * TString AnalysisName --> see the method "GetReadyToReadData" of the class TCnaRunEB 00141 // * Int_t RunNumber --> see the method "GetReadyToReadData" of the class TCnaRunEB 00142 // * Int_t FirstEvent --> see the method "GetReadyToReadData" of the class TCnaRunEB 00143 // * Int_t NbOfEvents --> see the method "GetReadyToReadData" of the class TCnaRunEB 00144 // * Int_t SuperModule --> see the method "GetReadyToReadData" of the class TCnaRunEB 00145 // 00146 // * TString PathForRootFile: Path of the directory containing the ROOT file. 00147 // The path must be complete: /afs/cern.ch/user/... etc... 00148 // 00149 // 00150 //==============> METHODS TO RECOVER THE QUANTITIES FROM THE ROOT FILE 00151 // 00152 // Bool_t LookAtRootFile(); 00153 // 00154 // TVectorD ReadTowerNumbers(); 00155 // 00156 // TMatrixD ReadNumbersOfFoundEventsForSamples(const Int_t& SMTow); // TMatrixD(MaxCrysInTow,MaxSampADC) 00157 // TVectorD ReadSampleAsFunctionOfTime 00158 // (const Int_t& SMTow, const Int_t& TowEcha, const Int_t& sample); // TVectorD(MaxBins) 00159 // TVectorD ReadExpectationValuesOfSamples(const Int_t& SMTow, const Int_t& TowEcha)); // TVectorD(MaxSampADC) 00160 // TVectorD ReadVariancesOfSamples(const Int_t& SMTow, const Int_t& TowEcha); // TVectorD(MaxSampADC) 00161 // TVectorD ReadSigmasOfSamples(const Int_t& SMTow, const Int_t& TowEcha); // TVectorD(MaxSampADC) 00162 // TVectorD ReadEventDistribution 00163 // (const Int_t& SMTow, const Int_t& TowEcha, const Int_t& sample); // TVectorD(Maxbins) 00164 // Double_t ReadEventDistributionXmin(const Int_t& SMTow, const Int_t& TowEcha, const Int_t& sample); 00165 // Double_t ReadEventDistributionXmax(const Int_t& SMTow, const Int_t& TowEcha, const Int_t& sample); 00166 // 00167 // TMatrixD ReadCovariancesBetweenCrystalsMeanOverSamples 00168 // (const Int_t& SMTow_X, const Int_t& SMTow_Y); // TMatrixD(Tow_XEcha, Tow_YEcha) 00169 // TMatrixD ReadCorrelationsBetweenCrystalsMeanOverSamples 00170 // (const Int_t& SMTow_X, const Int_t& SMTow_Y); // TMatrixD(Tow_XEcha, Tow_YEcha) 00171 // 00172 // TMatrixD ReadCovariancesBetweenCrystalsMeanOverSamples(); // TMatrixD(SMEcha, SMEcha) (BIG!: 1700x1700) 00173 // TMatrixD ReadCorrelationsBetweenCrystalsMeanOverSamples(); // TMatrixD(SMEcha, SMEcha) (BIG!: 1700x1700) 00174 // 00175 // TMatrixD ReadCovariancesBetweenTowersMeanOverSamplesAndChannels(); // TMatrixD(SMTow,SMTow) (68x68) 00176 // TMatrixD ReadCorrelationsBetweenTowersMeanOverSamplesAndChannels(); // TMatrixD(SMTow,SMTow) (68x68) 00177 // 00178 // TMatrixD ReadCovariancesBetweenSamples 00179 // (const Int_t& SMTow, const Int_t& TowEcha); // TMatrixD(MaxSampADC,MaxSampADC) 00180 // TMatrixD ReadCorrelationsBetweenSamples 00181 // (const Int_t& SMTow, const Int_t& TowEcha); // TMatrixD(MaxSampADC,MaxSampADC) 00182 // TVectorD ReadRelevantCorrelationsBetweenSamples 00183 // (const Int_t& SMTow, const Int_t& TowEcha); // TVectorD( MaxSampADC(MaxSampADC-1)/2 ) 00184 // 00185 // TVectorD ReadExpectationValuesOfExpectationValuesOfSamples(); // TVectorD(MaxCrysInSM) 00186 // TVectorD ReadExpectationValuesOfSigmasOfSamples(); // TVectorD(MaxCrysInSM) 00187 // TVectorD ReadExpectationValuesOfCorrelationsBetweenSamples(); // TVectorD(MaxCrysInSM) 00188 // 00189 // TVectorD ReadSigmasOfExpectationValuesOfSamples(); // TVectorD(MaxSampADC) 00190 // TVectorD ReadSigmasOfSigmasOfSamples(); // TVectorD(MaxSampADC) 00191 // TVectorD ReadSigmasOfCorrelationsBetweenSamples(); // TVectorD(MaxSampADC) 00192 // 00193 // Int_t MaxTowEtaInSM(); 00194 // Int_t MaxTowPhiInSM(); 00195 // Int_t MaxTowInSM(); 00196 // 00197 // Int_t MaxCrysEtaInTow(); // Tower size X in terms of crystals 00198 // Int_t MaxCrysPhiInTow(); // Tower size Y in terms of crystals 00199 // Int_t MaxCrysInTow(); 00200 // 00201 // Int_t MaxSampADC(); 00202 // 00203 // Int_t GetNumberOfTakenEvents(); 00204 // 00205 // Int_t GetNumberOfBinsEventDistributions(); 00206 // Int_t GetNumberOfBinsSampleAsFunctionOfTime(); 00207 // Int_t GetNumberOfBinsEvolution(); 00208 // 00209 // Int_t GetTowerIndex(const Int_t& SMTow); 00210 // Int_t GetSMTowFromIndex(const Int_t& tower_index); 00211 // Int_t GetSMEcha(const Int_t& SMTow, const Int_t& TowEcha); 00212 // 00213 // // Int_t GetTowerNumber(const Int_t&); // SM-Tower number from CNA-channel number 00214 // // Int_t GetCrystalNumber(const Int_t&); // Crystal number in tower from CNA-channel number 00215 //------------------------------------------------------------------------- 00216 // 00217 // For more details on other classes of the CNA package: 00218 // 00219 // https://www.cern.ch/cms-fabbro/cna 00220 // 00221 //------------------------------------------------------------------------- 00222 // 00223 00224 //------------------------------ TCnaReadEB.cxx ----------------------------- 00225 // 00226 // Creation (first version): 03 Dec 2002 00227 // 00228 // For questions or comments, please send e-mail to Bernard Fabbro: 00229 // 00230 // fabbro@hep.saclay.cea.fr 00231 // 00232 //------------------------------------------------------------------------ 00233 00234 TCnaReadEB::TCnaReadEB() 00235 { 00236 //Constructor without argument: initialisation concerning the class 00237 // and call to Init() (initialisations concerning the ROOT file) 00238 00239 fTTBELL = '\007'; 00240 00241 fgMaxCar = (Int_t)512; 00242 fDim_name = fgMaxCar; 00243 00244 //............................... codes (all the values must be different) 00245 00246 fCodeHeader = 0; 00247 fCodeRoot = 1; 00248 fCodeCorresp = 2; 00249 00250 TCnaParameters* MyParameters = new TCnaParameters(); fCnew++; 00251 00252 fCodePrintNoComment = MyParameters->GetCodePrint("NoComment"); 00253 fCodePrintWarnings = MyParameters->GetCodePrint("Warnings "); 00254 fCodePrintComments = MyParameters->GetCodePrint("Comments"); 00255 fCodePrintAllComments = MyParameters->GetCodePrint("AllComments"); 00256 00257 delete MyParameters; fCdelete++; 00258 00259 //.................................. Set flag print to "Warnings" 00260 fFlagPrint = fCodePrintWarnings; 00261 //.................................. call to Init() 00262 Init(); 00263 }
R__EXTERN TCnaRootFile* gCnaRootFile |
Definition at line 9 of file TCnaReadEB.cc.