]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/Attic/AliTPCCalibTCF.h
updated
[u/mrichter/AliRoot.git] / TPC / Attic / AliTPCCalibTCF.h
CommitLineData
eb7e0771 1#ifndef ALI_TPC_CALIB_TCF_H
2#define ALI_TPC_CALIB_TCF_H
3
4
5/* Copyright(c) 2007-08, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
7
8///////////////////////////////////////////////////////////////////////////////
9// Class AliTPCCalibTCF //
10// Class for Extraction and test of TCF parameters needed by the ALTRO chip //
11///////////////////////////////////////////////////////////////////////////////
12
13#include "TSystem.h"
40377546 14#include <exception>
15
eb7e0771 16
17class TObject;
18class TGraph;
752b0cc7 19class AliRawReader;
752b0cc7 20class AliTPCRawStreamV3;
eb7e0771 21class TNtuple;
22class TH1F;
df4cfd77 23class TH2F;
eb7e0771 24
25class AliTPCCalibTCF : public TNamed {
26
27public:
28
29 AliTPCCalibTCF();
d0bd4fcc 30 AliTPCCalibTCF(Int_t gateWidth, Int_t Sample, Int_t pulseLength, Int_t lowPulseLim, Int_t upPulseLim, Double_t rmsLim, Double_t ratioIntLim);
eb7e0771 31 AliTPCCalibTCF(const AliTPCCalibTCF &sig);
32 virtual ~AliTPCCalibTCF();
33
34 AliTPCCalibTCF& operator = (const AliTPCCalibTCF &source);
35
36
752b0cc7 37 void ProcessRawFileV3(const char *nameRawFile, const char *nameFileOut);
38 void ProcessRawEventV3(AliRawReader *rawReader,AliTPCRawStreamV3 *rawStream, const char *nameFileOut);
39
eb7e0771 40 void MergeHistoPerSector(const char *nameFileIn);
41
d0bd4fcc 42 void AnalyzeRootFile(const char *nameFileIn, Int_t minNumPulse=1, Int_t histStart=1, Int_t histEnd=1000000);
56c85970 43 Int_t AnalyzePulse(TH1F * const hisIn, Double_t *coefZ, Double_t *coefP);
eb7e0771 44
df4cfd77 45 void TestTCFonRootFile(const char *nameFileIn, const char *nameFileTCF, Int_t nPulseMin=0, Int_t plotFlag=0, Int_t lowKey=1, Int_t upKey=1000000);
55f06b51 46 void TestTCFonRawFile(const char *nameRawFile, const char *nameFileOut, const char *nameFileTCF, Int_t nPulseMin=0, Int_t plotFlag=0, bool bUseHLTOUT=false);
df4cfd77 47
48 Int_t DumpTCFparamToFilePerSector(const char *nameFileTCFPerSec, const char *nameMappingFile="$ALICE_ROOT/TPC/Calib/tpcMapping.root");
49 Int_t DumpTCFparamToFilePerPad(const char *nameFileTCFPerPad,const char *nameFileTCFPerSec, const char *nameMappingFile="$ALICE_ROOT/TPC/Calib/tpcMapping.root");
50
51 TH2F *PlotOccupSummary2Dhist(const char *nameFileIn, Int_t side=0);
52 void PlotOccupSummary(const char *nameFile, Int_t side=0, Int_t nPulseMin=0);
eb7e0771 53
eb7e0771 54 void PlotQualitySummary(const char *nameFileQuality, const char *plotSpec="widthRed:maxUndershot", const char *cut="maxUndershot<0.1&&maxUndershot>-40&&widthRed>0&&widthRed<100", const char *pOpt="LEGO2Z");
55
56 void PrintPulseThresholds();
57
df4cfd77 58 void MergeHistoPerFile(const char *fileNameIn, const char *fileSum, Int_t mode=0);
59 void MergeToOneFile(const char *nameFileSum);
eb7e0771 60
61private:
62
63 // tresholds for proper pulse finder (Analyze functions)
64 Int_t fGateWidth; // expected Gate fluctuation length
65 Int_t fSample; // expected usefull signal length
66 Int_t fPulseLength; // needed pulselength for TC characterisation
67 Int_t fLowPulseLim; // lower pulse height limit
68 Int_t fUpPulseLim; // upper pulse height limit
69 Double_t fRMSLim; // signal RMS limit
d0bd4fcc 70 Double_t fRatioIntLim;// ratio of signal-integral/pulse-integral limit
eb7e0771 71
72 Int_t FitPulse(TNtuple *dataTuple, Double_t *coefZ, Double_t *coefP);
56c85970 73 static void FitFcn(Int_t &nPar, Double_t *grad, Double_t &f, Double_t * const par, Int_t iflag);
eb7e0771 74
75 Double_t* ExtractPZValues(Double_t *param);
d0bd4fcc 76 Int_t Equalization(TNtuple *dataTuple, Double_t *coefZ, Double_t *coefP);
eb7e0771 77
56c85970 78 Int_t FindCorTCFparam(TH1F * const hisIn, const char *nameFileTCF, Double_t *coefZ, Double_t *coefP);
eb7e0771 79 Double_t *GetQualityOfTCF(TH1F *hisIn, Double_t *coefZ, Double_t *coefP,Int_t plotFlag=0);
80
56c85970 81 TNtuple *ApplyTCFilter(TH1F * const hisIn, Double_t * const coefZ, Double_t * const coefP, Int_t plotFlag=0);
eb7e0771 82
83 ClassDef(AliTPCCalibTCF,1);
84
85};
86#endif