1 #ifndef ALI_TPC_CALIB_TCF_H
2 #define ALI_TPC_CALIB_TCF_H
5 /* Copyright(c) 2007-08, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
8 ///////////////////////////////////////////////////////////////////////////////
9 // Class AliTPCCalibTCF //
10 // Class for Extraction and test of TCF parameters needed by the ALTRO chip //
11 ///////////////////////////////////////////////////////////////////////////////
17 class AliTPCRawStream;
21 class AliTPCCalibTCF : public TNamed {
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();
30 AliTPCCalibTCF& operator = (const AliTPCCalibTCF &source);
33 void ProcessRawFile(const char *nameRawFile, const char *nameFileOut);//Int_t *tresholds);
34 void ProcessRawEvent(AliTPCRawStream *rawStream, const char *nameFileOut);
36 void MergeHistoPerSector(const char *nameFileIn);
38 void AnalyzeRootFile(const char *nameFileIn, Int_t minNumPulse=1);
39 Int_t AnalyzePulse(TH1F *hisIn, Double_t *coefZ, Double_t *coefP);
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);
44 void DumpTCFparamToFile(const char *nameFileTCF,const char *nameFileOut);
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");
49 void PrintPulseThresholds();
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
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);
65 Double_t* ExtractPZValues(Double_t *param);
66 void Equalization(TNtuple *dataTuple, Double_t *coefZ, Double_t *coefP);
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);
71 TNtuple *ApplyTCFilter(TH1F *hisIn, Double_t *coefZ, Double_t *coefP, Int_t plotFlag=0);
73 ClassDef(AliTPCCalibTCF,1);