]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCCalibTCF.h
Adding base class for TPC calibration components
[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();
26 AliTPCCalibTCF(Int_t gateWidth, Int_t Sample, Int_t pulseLength, Int_t lowPulseLim, Int_t upPulseLim, Double_t rmsLim);
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
38 void AnalyzeRootFile(const char *nameFileIn, Int_t minNumPulse=1);
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
51
52private:
53
54 // tresholds for proper pulse finder (Analyze functions)
55 Int_t fGateWidth; // expected Gate fluctuation length
56 Int_t fSample; // expected usefull signal length
57 Int_t fPulseLength; // needed pulselength for TC characterisation
58 Int_t fLowPulseLim; // lower pulse height limit
59 Int_t fUpPulseLim; // upper pulse height limit
60 Double_t fRMSLim; // signal RMS limit
61
62 Int_t FitPulse(TNtuple *dataTuple, Double_t *coefZ, Double_t *coefP);
63 static void FitFcn(Int_t &nPar, Double_t *grad, Double_t &f, Double_t *par, Int_t iflag);
64
65 Double_t* ExtractPZValues(Double_t *param);
66 void Equalization(TNtuple *dataTuple, Double_t *coefZ, Double_t *coefP);
67
68 Int_t FindCorTCFparam(TH1F *hisIn, const char *nameFileTCF, Double_t *coefZ, Double_t *coefP);
69 Double_t *GetQualityOfTCF(TH1F *hisIn, Double_t *coefZ, Double_t *coefP,Int_t plotFlag=0);
70
71 TNtuple *ApplyTCFilter(TH1F *hisIn, Double_t *coefZ, Double_t *coefP, Int_t plotFlag=0);
72
73 ClassDef(AliTPCCalibTCF,1);
74
75};
76#endif