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/TEcnaObject.h"
00015 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParEcal.h"
00016 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaHeader.h"
00017 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParCout.h"
00018 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParPaths.h"
00019 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaNumbering.h"
00020 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaParHistos.h"
00021 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaWrite.h"
00022 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaResultType.h"
00023 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEcnaRootFile.h"
00024
00351
00352 class TEcnaRead: public TObject {
00353
00354 private:
00355
00356
00357
00358
00359
00360 Int_t fgMaxCar;
00361
00362 Int_t fCnew;
00363 Int_t fCdelete;
00364
00365 TString fTTBELL;
00366
00367 TEcnaObject *fObjectManager;
00368
00369 TEcnaParCout *fCnaParCout;
00370 TEcnaParPaths *fCnaParPaths;
00371
00372 TEcnaHeader *fFileHeader;
00373 TEcnaParEcal *fEcal;
00374 TEcnaNumbering *fEcalNumbering;
00375 TEcnaParHistos *fCnaParHistos;
00376 TEcnaWrite *fCnaWrite;
00377
00378
00379
00380 TString fFlagSubDet;
00381 TString fStexName, fStinName;
00382
00383 Bool_t fOpenRootFile;
00384 TString fCurrentlyOpenFileName;
00385 TString fFlagNoFileOpen;
00386
00387 Int_t fReadyToReadRootFile;
00388 Int_t fLookAtRootFile;
00389
00390 Int_t* fT1d_StexStinFromIndex;
00391 Int_t* fTagStinNumbers;
00392 Int_t fMemoStinNumbers;
00393
00394
00395
00396 TString fPathRoot;
00397
00398 Int_t fNbChanByLine;
00399 Int_t fNbSampByLine;
00400
00401 Int_t fFlagPrint;
00402 Int_t fCodePrintComments, fCodePrintWarnings, fCodePrintAllComments, fCodePrintNoComment;
00403
00404
00405
00406 Bool_t fDataExist;
00407
00408
00409 Double_t*** fT3d_AdcValues;
00410 Double_t** fT3d2_AdcValues;
00411 Double_t* fT3d1_AdcValues;
00412
00413
00414
00415
00416
00417
00418
00419
00420 void fCopy(const TEcnaRead&);
00421
00422 public:
00423
00424
00425 TEcnaRead();
00426
00427 TEcnaRead(TEcnaObject*, const TString);
00428
00429 TEcnaRead(const TEcnaRead&);
00430
00431
00432 TEcnaRead& operator=(const TEcnaRead&);
00433
00434
00435 virtual ~TEcnaRead();
00436
00437
00438
00439
00440
00441
00442 void FileParameters(TString,
00443 const Int_t&, const Int_t&, const Int_t&,
00444 const Int_t&, const Int_t&, const Int_t&, TString);
00445
00446 Bool_t LookAtRootFile();
00447 Bool_t DataExist();
00448
00449 TVectorD Read1DHisto(const Int_t&, const TString, const Int_t&, const Int_t&, const Int_t&);
00450 TVectorD Read1DHisto(const Int_t&, const TString, const Int_t&);
00451 TVectorD Read1DHisto(const Int_t&, const TString, const TString);
00452
00453 TMatrixD ReadMatrix(const Int_t&, const TString, const TString, const Int_t&, const Int_t&);
00454 TMatrixD ReadMatrix(const Int_t&, const TString, const TString);
00455
00456
00457
00458
00459
00460
00461
00462 void Init();
00463 void SetEcalSubDetector(const TString);
00464
00465 void Anew(const TString);
00466 void Adelete(const TString);
00467
00468 Bool_t OpenRootFile(const Text_t *, TString);
00469 Bool_t CloseRootFile(const Text_t *);
00470 void TestArrayDimH1(const TString, const TString, const Int_t&, const Int_t&);
00471 void TestArrayDimH2(const TString, const TString, const Int_t&, const Int_t&);
00472
00473 Bool_t ReadRootFileHeader(const Int_t&);
00474
00475 TVectorD ReadSampleAdcValues(const Int_t&, const Int_t&, const Int_t&, const Int_t&);
00476
00477 TVectorD ReadSampleMeans(const Int_t&, const Int_t&, const Int_t&);
00478 TVectorD ReadSampleMeans(const Int_t&, const Int_t&);
00479
00480 TVectorD ReadSampleSigmas(const Int_t&, const Int_t&, const Int_t&);
00481 TVectorD ReadSampleSigmas(const Int_t&, const Int_t&);
00482
00483
00484 TVectorD ReadNumberOfEvents(const Int_t&);
00485 TVectorD ReadPedestals(const Int_t&);
00486 TVectorD ReadTotalNoise(const Int_t&);
00487 TVectorD ReadLowFrequencyNoise(const Int_t&);
00488 TVectorD ReadHighFrequencyNoise(const Int_t&);
00489 TVectorD ReadMeanCorrelationsBetweenSamples(const Int_t&);
00490 TVectorD ReadSigmaOfCorrelationsBetweenSamples(const Int_t&);
00491
00492
00493 TVectorD ReadAverageNumberOfEvents(const Int_t&);
00494 TVectorD ReadAveragePedestals(const Int_t&);
00495 TVectorD ReadAverageTotalNoise(const Int_t&);
00496 TVectorD ReadAverageLowFrequencyNoise(const Int_t&);
00497 TVectorD ReadAverageHighFrequencyNoise(const Int_t&);
00498 TVectorD ReadAverageMeanCorrelationsBetweenSamples(const Int_t&);
00499 TVectorD ReadAverageSigmaOfCorrelationsBetweenSamples(const Int_t&);
00500
00501
00502 TMatrixD ReadCovariancesBetweenSamples(const Int_t&, const Int_t&, const Int_t&);
00503 TMatrixD ReadCorrelationsBetweenSamples(const Int_t&, const Int_t&, const Int_t&);
00504
00505
00506 TMatrixD ReadLowFrequencyCovariancesBetweenChannels(const Int_t&, const Int_t&, const Int_t&);
00507 TMatrixD ReadHighFrequencyCovariancesBetweenChannels(const Int_t&, const Int_t&, const Int_t&);
00508
00509
00510 TMatrixD ReadLowFrequencyCorrelationsBetweenChannels(const Int_t&, const Int_t&, const Int_t&);
00511 TMatrixD ReadHighFrequencyCorrelationsBetweenChannels(const Int_t&, const Int_t&, const Int_t&);
00512
00513
00514
00515 TMatrixD ReadLowFrequencyCovariancesBetweenChannels(const Int_t&);
00516 TMatrixD ReadHighFrequencyCovariancesBetweenChannels(const Int_t&);
00517 TMatrixD ReadLowFrequencyCorrelationsBetweenChannels(const Int_t&);
00518 TMatrixD ReadHighFrequencyCorrelationsBetweenChannels(const Int_t&);
00519
00520
00521 TMatrixD ReadLowFrequencyMeanCorrelationsBetweenStins(const Int_t&);
00522 TMatrixD ReadHighFrequencyMeanCorrelationsBetweenStins(const Int_t&);
00523
00524
00525 TString GetAnalysisName();
00526 Int_t GetNbOfSamples();
00527 Int_t GetRunNumber();
00528 Int_t GetFirstReqEvtNumber();
00529 Int_t GetLastReqEvtNumber();
00530 Int_t GetReqNbOfEvts();
00531 Int_t GetStexNumber();
00532
00533 time_t GetStartTime();
00534 time_t GetStopTime();
00535 TString GetStartDate();
00536 TString GetStopDate();
00537 TString GetRootFileName();
00538 TString GetRootFileNameShort();
00539
00540 TString GetRunType();
00541
00542
00543 TVectorD ReadRelevantCorrelationsBetweenSamples(const Int_t&, const Int_t&, const Int_t&);
00544
00545
00546 Int_t GetStexStinFromIndex(const Int_t&);
00547 Int_t GetStinIndex(const Int_t&);
00548
00549 TVectorD ReadStinNumbers(const Int_t&);
00550 TMatrixD ReadNumberOfEventsForSamples(const Int_t&, const Int_t&, const Int_t&);
00551
00552 Double_t*** ReadSampleAdcValuesSameFile(const Int_t&, const Int_t&, const Int_t&);
00553
00554 Int_t GetNumberOfEvents(const Int_t&);
00555 Int_t GetNumberOfBinsSampleAsFunctionOfTime();
00556
00557 TString GetTypeOfQuantity(const CnaResultTyp);
00558
00559 TString GetTechReadCode(const TString, const TString);
00560
00561
00562
00563
00564 void PrintNoComment();
00565
00566 void PrintWarnings();
00567 void PrintComments();
00568
00569 void PrintAllComments();
00570
00571 ClassDef(TEcnaRead,1)
00572 };
00573
00574 #endif // CL_TEcnaRead_H
00575
00576