]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCCalibTCF.h
Bug fix (Marian)
[u/mrichter/AliRoot.git] / TPC / 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"
14
15class TObject;
16class TGraph;
17class AliTPCRawStream;
18class TNtuple;
19class TH1F;
20
21class AliTPCCalibTCF : public TNamed {
22
23public:
24
25 AliTPCCalibTCF();
d0bd4fcc 26 AliTPCCalibTCF(Int_t gateWidth, Int_t Sample, Int_t pulseLength, Int_t lowPulseLim, Int_t upPulseLim, Double_t rmsLim, Double_t ratioIntLim);
eb7e0771 27 AliTPCCalibTCF(const AliTPCCalibTCF &sig);
28 virtual ~AliTPCCalibTCF();
29
30 AliTPCCalibTCF& operator = (const AliTPCCalibTCF &source);
31
32
33 void ProcessRawFile(const char *nameRawFile, const char *nameFileOut);//Int_t *tresholds);
34 void ProcessRawEvent(AliTPCRawStream *rawStream, const char *nameFileOut);
35
36 void MergeHistoPerSector(const char *nameFileIn);
37
d0bd4fcc 38 void AnalyzeRootFile(const char *nameFileIn, Int_t minNumPulse=1, Int_t histStart=1, Int_t histEnd=1000000);
eb7e0771 39 Int_t AnalyzePulse(TH1F *hisIn, Double_t *coefZ, Double_t *coefP);
40
41 void TestTCFonRootFile(const char *nameFileIn, const char *nameFileTCF, Int_t plotFlag=0, Int_t lowKey=1, Int_t upKey=1000000);
42 void TestTCFonRawFile(const char *nameRawFile, const char *nameFileOut, const char *nameFileTCF, Int_t plotFlag=0);
43
44 void DumpTCFparamToFile(const char *nameFileTCF,const char *nameFileOut);
45
46 TNtuple *PlotOccupSummary(const char *nameFile, Int_t nPulseMin=0);
47 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");
48
49 void PrintPulseThresholds();
50
d0bd4fcc 51 void MergeHistsPerFile(const char *fileNameIn, const char *fileSum);
52
eb7e0771 53
54private:
55
56 // tresholds for proper pulse finder (Analyze functions)
57 Int_t fGateWidth; // expected Gate fluctuation length
58 Int_t fSample; // expected usefull signal length
59 Int_t fPulseLength; // needed pulselength for TC characterisation
60 Int_t fLowPulseLim; // lower pulse height limit
61 Int_t fUpPulseLim; // upper pulse height limit
62 Double_t fRMSLim; // signal RMS limit
d0bd4fcc 63 Double_t fRatioIntLim;// ratio of signal-integral/pulse-integral limit
eb7e0771 64
65 Int_t FitPulse(TNtuple *dataTuple, Double_t *coefZ, Double_t *coefP);
66 static void FitFcn(Int_t &nPar, Double_t *grad, Double_t &f, Double_t *par, Int_t iflag);
67
68 Double_t* ExtractPZValues(Double_t *param);
d0bd4fcc 69 Int_t Equalization(TNtuple *dataTuple, Double_t *coefZ, Double_t *coefP);
eb7e0771 70
71 Int_t FindCorTCFparam(TH1F *hisIn, const char *nameFileTCF, Double_t *coefZ, Double_t *coefP);
72 Double_t *GetQualityOfTCF(TH1F *hisIn, Double_t *coefZ, Double_t *coefP,Int_t plotFlag=0);
73
74 TNtuple *ApplyTCFilter(TH1F *hisIn, Double_t *coefZ, Double_t *coefP, Int_t plotFlag=0);
75
76 ClassDef(AliTPCCalibTCF,1);
77
78};
79#endif