File indexing completed on 2023-03-17 10:41:17
0001
0002
0003
0004
0005
0006 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaRun.h"
0007
0008 #include "Riostream.h"
0009 #include "TROOT.h"
0010 #include "TRint.h"
0011
0012 #include <stdlib.h>
0013 #include <string>
0014 #include "TString.h"
0015
0016 using namespace std;
0017
0018 int main(int argc, char** argv) {
0019
0020
0021
0022 Int_t xCnew = 0;
0023 Int_t xCdelete = 0;
0024
0025 TString fTTBELL = "\007";
0026
0027
0028
0029
0030 Int_t fKeyNbOfSamples = 10;
0031
0032 TEcnaObject* myTEcnaManager = new TEcnaObject();
0033
0034 std::cout << "!EcnaCalculationsExample> CONTROLE 1" << std::endl;
0035
0036 TEcnaRun* MyRunEB = new TEcnaRun(myTEcnaManager, "EB", fKeyNbOfSamples);
0037 xCnew++;
0038
0039 std::cout << "!EcnaCalculationsExample> CONTROLE 2" << std::endl;
0040
0041
0042
0043 TString fKeyAnaType = "AdcPeg12";
0044 TString fKeyStdType = "StdPeg12";
0045 Int_t fKeyRunNumber = 136098;
0046 Int_t fKeyFirstEvt = 1;
0047 Int_t fKeyLastEvt = 0;
0048 Int_t fKeyNbOfEvts = 150;
0049 Int_t fKeySuMoNumber = 18;
0050
0051 MyRunEB->GetReadyToReadData(
0052 fKeyAnaType.Data(), fKeyRunNumber, fKeyFirstEvt, fKeyLastEvt, fKeyNbOfEvts, fKeySuMoNumber);
0053
0054 Bool_t ok_read = MyRunEB->ReadSampleAdcValues();
0055
0056 if (ok_read == kTRUE) {
0057 MyRunEB->GetReadyToCompute();
0058
0059
0060 MyRunEB->StandardCalculations();
0061
0062
0063
0064
0065
0066
0067
0068 Bool_t ok_root_file = MyRunEB->WriteNewRootFile(fKeyStdType.Data());
0069
0070 if (ok_root_file == kTRUE) {
0071 std::cout << "*EcnaCalculationsExample> Write ROOT file OK" << std::endl;
0072 } else {
0073 std::cout << "!EcnaCalculationsExample> Writing ROOT file failure." << fTTBELL << std::endl;
0074 }
0075 } else {
0076 std::cout << "!EcnaCalculationsExample> ROOT file not found." << fTTBELL << std::endl;
0077 }
0078
0079
0080 delete MyRunEB;
0081 xCdelete++;
0082
0083 std::cout << "*H4Cna(main)> End of the example." << std::endl;
0084
0085 if (xCnew != xCdelete) {
0086 std::cout << "!H4Cna(main)> WRONG MANAGEMENT OF ALLOCATIONS: xCnew = " << xCnew << ", xCdelete = " << xCdelete
0087 << '\007' << std::endl;
0088 } else {
0089
0090
0091 }
0092
0093 std::cout << "*EcnaCalculationsExample> Exiting main program." << std::endl;
0094 exit(0);
0095 }