AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliTPCCalibTCF.h
Go to the documentation of this file.
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 
10 
11 #include "TSystem.h"
12 #include <exception>
13 
14 
15 class TObject;
16 class TGraph;
17 class AliRawReader;
18 class AliTPCRawStreamV3;
19 class TNtuple;
20 class TH1F;
21 class TH2F;
22 
23 class AliTPCCalibTCF : public TNamed {
24 
25 public:
26 
28  AliTPCCalibTCF(Int_t gateWidth, Int_t Sample, Int_t pulseLength, Int_t lowPulseLim, Int_t upPulseLim, Double_t rmsLim, Double_t ratioIntLim);
29  AliTPCCalibTCF(const AliTPCCalibTCF &sig);
30  virtual ~AliTPCCalibTCF();
31 
33 
34 
35  void ProcessRawFileV3(const char *nameRawFile, const char *nameFileOut);
36  void ProcessRawEventV3(AliRawReader *rawReader,AliTPCRawStreamV3 *rawStream, const char *nameFileOut);
37 
38  void MergeHistoPerSector(const char *nameFileIn);
39 
40  void AnalyzeRootFile(const char *nameFileIn, Int_t minNumPulse=1, Int_t histStart=1, Int_t histEnd=1000000);
41  Int_t AnalyzePulse(TH1F * const hisIn, Double_t *coefZ, Double_t *coefP);
42 
43  void TestTCFonRootFile(const char *nameFileIn, const char *nameFileTCF, Int_t nPulseMin=0, Int_t plotFlag=0, Int_t lowKey=1, Int_t upKey=1000000);
44  void TestTCFonRawFile(const char *nameRawFile, const char *nameFileOut, const char *nameFileTCF, Int_t nPulseMin=0, Int_t plotFlag=0, bool bUseHLTOUT=false);
45 
46  Int_t DumpTCFparamToFilePerSector(const char *nameFileTCFPerSec, const char *nameMappingFile="$ALICE_ROOT/TPC/Calib/tpcMapping.root");
47  Int_t DumpTCFparamToFilePerPad(const char *nameFileTCFPerPad,const char *nameFileTCFPerSec, const char *nameMappingFile="$ALICE_ROOT/TPC/Calib/tpcMapping.root");
48 
49  TH2F *PlotOccupSummary2Dhist(const char *nameFileIn, Int_t side=0);
50  void PlotOccupSummary(const char *nameFile, Int_t side=0, Int_t nPulseMin=0);
51 
52  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");
53 
54  void PrintPulseThresholds();
55 
56  void MergeHistoPerFile(const char *fileNameIn, const char *fileSum, Int_t mode=0);
57  void MergeToOneFile(const char *nameFileSum);
58 
59 private:
60 
61  // tresholds for proper pulse finder (Analyze functions)
62  Int_t fGateWidth;
63  Int_t fSample;
64  Int_t fPulseLength;
65  Int_t fLowPulseLim;
66  Int_t fUpPulseLim;
67  Double_t fRMSLim;
68  Double_t fRatioIntLim;
69 
70  Int_t FitPulse(TNtuple *dataTuple, Double_t *coefZ, Double_t *coefP);
71  static void FitFcn(Int_t &nPar, Double_t *grad, Double_t &f, Double_t * const par, Int_t iflag);
72 
73  Double_t* ExtractPZValues(Double_t *param);
74  Int_t Equalization(TNtuple *dataTuple, Double_t *coefZ, Double_t *coefP);
75 
76  Int_t FindCorTCFparam(TH1F * const hisIn, const char *nameFileTCF, Double_t *coefZ, Double_t *coefP);
77  Double_t *GetQualityOfTCF(TH1F *hisIn, Double_t *coefZ, Double_t *coefP,Int_t plotFlag=0);
78 
79  TNtuple *ApplyTCFilter(TH1F * const hisIn, Double_t * const coefZ, Double_t * const coefP, Int_t plotFlag=0);
80 
82 
83 };
84 #endif
Int_t fUpPulseLim
upper pulse height limit
Int_t fPulseLength
needed pulselength for TC characterisation
Int_t fSample
expected usefull signal length
Int_t DumpTCFparamToFilePerSector(const char *nameFileTCFPerSec, const char *nameMappingFile="$ALICE_ROOT/TPC/Calib/tpcMapping.root")
void MergeHistoPerSector(const char *nameFileIn)
TFile f("CalibObjects.root")
ClassDef(AliTPCCalibTCF, 1)
TH2F * PlotOccupSummary2Dhist(const char *nameFileIn, Int_t side=0)
Int_t fGateWidth
expected Gate fluctuation length
Int_t Equalization(TNtuple *dataTuple, Double_t *coefZ, Double_t *coefP)
Int_t DumpTCFparamToFilePerPad(const char *nameFileTCFPerPad, const char *nameFileTCFPerSec, const char *nameMappingFile="$ALICE_ROOT/TPC/Calib/tpcMapping.root")
void MergeToOneFile(const char *nameFileSum)
virtual ~AliTPCCalibTCF()
This class provides access to TPC digits in raw data.
void MergeHistoPerFile(const char *fileNameIn, const char *fileSum, Int_t mode=0)
Int_t FindCorTCFparam(TH1F *const hisIn, const char *nameFileTCF, Double_t *coefZ, Double_t *coefP)
Int_t FitPulse(TNtuple *dataTuple, Double_t *coefZ, Double_t *coefP)
static void FitFcn(Int_t &nPar, Double_t *grad, Double_t &f, Double_t *const par, Int_t iflag)
Int_t fLowPulseLim
lower pulse height limit
Double_t fRMSLim
signal RMS limit
void PlotOccupSummary(const char *nameFile, Int_t side=0, Int_t nPulseMin=0)
void AnalyzeRootFile(const char *nameFileIn, Int_t minNumPulse=1, Int_t histStart=1, Int_t histEnd=1000000)
void TestTCFonRootFile(const char *nameFileIn, const char *nameFileTCF, Int_t nPulseMin=0, Int_t plotFlag=0, Int_t lowKey=1, Int_t upKey=1000000)
void ProcessRawFileV3(const char *nameRawFile, const char *nameFileOut)
TNtuple * ApplyTCFilter(TH1F *const hisIn, Double_t *const coefZ, Double_t *const coefP, Int_t plotFlag=0)
Int_t AnalyzePulse(TH1F *const hisIn, Double_t *coefZ, Double_t *coefP)
void TestTCFonRawFile(const char *nameRawFile, const char *nameFileOut, const char *nameFileTCF, Int_t nPulseMin=0, Int_t plotFlag=0, bool bUseHLTOUT=false)
Double_t fRatioIntLim
ratio of signal-integral/pulse-integral limit
Extraction and test of TCF parameters needed by the ALTRO chip.
TCut cut
Definition: MakeGlobalFit.C:75
AliTPCCalibTCF & operator=(const AliTPCCalibTCF &source)
void ProcessRawEventV3(AliRawReader *rawReader, AliTPCRawStreamV3 *rawStream, const char *nameFileOut)
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")
Double_t * GetQualityOfTCF(TH1F *hisIn, Double_t *coefZ, Double_t *coefP, Int_t plotFlag=0)
Double_t * ExtractPZValues(Double_t *param)