Adding AliTPCComparisonPID class
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibDButil.h
892226be 1#ifndef AliTPCcalibDButil_H
2#define AliTPCcalibDButil_H
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
8// //
9// Class providing the calculation of derived quantities (mean,rms,fits,...) //
10// of calibration entries //
11// //
14#include <TObject.h>
16class AliDCSSensorArray;
17class AliTPCcalibDB;
18class AliTPCCalPad;
19class AliTPCmapper;
6e7d7dc4 20class AliTPCCalibRaw;
817766d5 21class TGraph;
892226be 22
23class AliTPCcalibDButil : public TObject
26 AliTPCcalibDButil();
27 virtual ~AliTPCcalibDButil();
29 void UpdateFromCalibDB();
30 //data processing functions
7390f655 31 void ProcessCEdata(const char* fitFormula, TVectorD &fitResultsA, TVectorD &fitResultsC,
2cb269df 32 Int_t &noutliersCE, Double_t & chi2A, Double_t &chi2C, AliTPCCalPad *outCE=0);
892226be 33 void ProcessCEgraphs(TVectorD &vecTEntries, TVectorD &vecTMean, TVectorD &vecTRMS, TVectorD &vecTMedian,
34 TVectorD &vecQEntries, TVectorD &vecQMean, TVectorD &vecQRMS, TVectorD &vecQMedian,
35 Float_t &driftTimeA, Float_t &driftTimeC );
36 void ProcessNoiseData(TVectorD &vNoiseMean, TVectorD &vNoiseMeanSenRegions,
37 TVectorD &vNoiseRMS, TVectorD &vNoiseRMSSenRegions,
38 Int_t &nonMaskedZero);
39 void ProcessPulser(TVectorD &vMeanTime);
40 void ProcessALTROConfig(Int_t &nMasked);
41 void ProcessGoofie(TVectorD & vecEntries, TVectorD & vecMedian, TVectorD &vecMean, TVectorD &vecRMS);
7390f655 42 //processing functions using reference data
43 void ProcessPedestalVariations(TVectorF &pedestalDeviations);
44 void ProcessNoiseVariations(TVectorF &noiseDeviations);
45 void ProcessPulserVariations(TVectorF &pulserQdeviations, Float_t &varQMean, Int_t &npadsOutOneTB, Int_t &npadsOffAdd);
892226be 46 //getter preprocess information
47 Int_t GetNPulserOutliers() const {return fNpulserOutliers;}
48 Float_t GetMeanAltro(const AliTPCCalROC *roc, const Int_t row, const Int_t pad, AliTPCCalROC *rocOut=0x0);
49 AliTPCCalPad *GetPulserOutlierMap() const {return fPulserOutlier;}
50 //setters for pad by pad information
51 void SetPulserData(AliTPCCalPad *tmean, AliTPCCalPad *trms=0x0, AliTPCCalPad *qmean=0x0)
52 {fPulserTmean=tmean; fPulserTrms=trms; fPulserQmean=qmean;}
53 void SetCEData(AliTPCCalPad *tmean, AliTPCCalPad *trms=0x0, AliTPCCalPad *qmean=0x0)
54 {fCETmean=tmean; fCETrms=trms; fCEQmean=qmean;}
55 void SetNoisePedestal(AliTPCCalPad *noise, AliTPCCalPad *pedestal=0x0)
56 {fPadNoise=noise; fPedestals=pedestal;}
57 void SetALTROData(AliTPCCalPad *masked)
58 {fALTROMasked=masked;}
59 void SetGoofieArray(AliDCSSensorArray *arr) {fGoofieArray=arr;}
7390f655 60 //setters for pad by pad information
61 void SetRefFile(const char* filename);
62 void SetRefPulserData(AliTPCCalPad *tmean, AliTPCCalPad *trms=0x0, AliTPCCalPad *qmean=0x0)
63 {fRefPulserTmean=tmean; fRefPulserTrms=trms; fRefPulserQmean=qmean;}
64 void SetRefCEData(AliTPCCalPad *tmean, AliTPCCalPad *trms=0x0, AliTPCCalPad *qmean=0x0)
65 {fRefCETmean=tmean; fRefCETrms=trms; fRefCEQmean=qmean;}
66 void SetRefNoisePedestal(AliTPCCalPad *noise, AliTPCCalPad *pedestal=0x0)
67 {fRefPadNoise=noise; fRefPedestals=pedestal;}
68 void SetRefALTROData(AliTPCCalPad *masked)
69 {fRefALTROMasked=masked;}
892226be 71 //creation of derived pad by pad calibration data
2cb269df 72 AliTPCCalPad *CreatePadTime0(Int_t model, Double_t &gyA, Double_t &gyC, Double_t &chi2A, Double_t &chi2C);
892226be 73 //
2cb269df 74 // create outlyer maps
75 //
76 AliTPCCalPad *CreateCEOutlyerMap(Int_t &noutliersCE, AliTPCCalPad *ceOut=0, Float_t minSignal=10, Float_t cutTrmsMin=0.9, Float_t cutTrmsMax=1.2, Float_t cutMaxDistT=0.7);
77 AliTPCCalPad *CreatePulserOutlyerMap(Int_t &noutliersPulser, AliTPCCalPad *pulserOut=0, Float_t cutTime=3, Float_t cutnRMSQ=5, Float_t cutnRMSrms=5);
78 //
79 AliTPCCalPad *CreatePadTime0CE(TVectorD &fitResultsA, TVectorD&fitResultsC, Int_t &nOut, Double_t &chi2A, Double_t &chi2C, const char *dumpfile=0);
80 //
892226be 82 void UpdatePulserOutlierMap();
7390f655 83 void UpdateRefPulserOutlierMap();
84 void PulserOutlierMap(AliTPCCalPad *pulOut, const AliTPCCalPad *pulT, const AliTPCCalPad *pulQ);
817766d5 85
86 //
87 // graph tools
88 //
89 static Double_t GetTriggerOffsetTPC(Int_t run, Int_t timeStamp, Double_t deltaT=86400, Double_t deltaTLaser=3600, Int_t valType=0);
90 static Double_t GetVDriftTPC(Int_t run, Int_t timeStamp, Double_t deltaT=86400, Double_t deltaTLaser=3600, Int_t valType=0);
91 static Int_t GetNearest(TGraph *graph, Double_t xref, Double_t &dx, Double_t &y);
892226be 92private:
93 AliTPCcalibDB *fCalibDB; //pointer to calibDB object
94 AliTPCCalPad *fPadNoise; //noise information
95 AliTPCCalPad *fPedestals; //pedestal information
96 AliTPCCalPad *fPulserTmean; //pulser mean time information
97 AliTPCCalPad *fPulserTrms; //pulser rms time information
98 AliTPCCalPad *fPulserQmean; //pulser mean q information
99 AliTPCCalPad *fPulserOutlier; //pulser outlier map
100 AliTPCCalPad *fCETmean; //central electrode mean time information
101 AliTPCCalPad *fCETrms; //central electrode rms time information
102 AliTPCCalPad *fCEQmean; //central electrode mean q information
103 AliTPCCalPad *fALTROMasked; //ALTRO masked channels information
104 //
6e7d7dc4 105 AliTPCCalibRaw *fCalibRaw; //raw calibration object
7390f655 106 //reference data
107 AliTPCCalPad *fRefPadNoise; //Reference noise information
108 AliTPCCalPad *fRefPedestals; //Reference pedestal information
109 AliTPCCalPad *fRefPulserTmean; //Reference pulser mean time information
110 AliTPCCalPad *fRefPulserTrms; //Reference pulser rms time information
111 AliTPCCalPad *fRefPulserQmean; //Reference pulser mean q information
112 AliTPCCalPad *fRefPulserOutlier; //Reference pulser outlier map
113 AliTPCCalPad *fRefCETmean; //Reference central electrode mean time information
114 AliTPCCalPad *fRefCETrms; //Reference central electrode rms time information
115 AliTPCCalPad *fRefCEQmean; //Reference central electrode mean q information
116 AliTPCCalPad *fRefALTROMasked; //Reference ALTRO masked channels information
117 //
118 AliTPCCalibRaw *fRefCalibRaw; //Reference raw calibration object
6e7d7dc4 120 //
892226be 121 AliDCSSensorArray* fGoofieArray; //Goofie Data
122 //
123 AliTPCmapper *fMapper; //TPC mapping handler
124 Int_t fNpulserOutliers; //number of outliers from Pulser calibration
126 Float_t fIrocTimeOffset; //timing offset between IROC and OROC in timebins
127 Float_t fCETmaxLimitAbs; //maximum variation in CE data before pads will be treated as outliers
128 Float_t fPulTmaxLimitAbs; //maximum variation of Pulser Signals (time) before pads will be treated as outliers
129 Float_t fPulQmaxLimitAbs; //maximum variation of Pulser Signals (charge) before pads will be treated as outliers
130 Float_t fPulQminLimit; //minimum charge value for Pulser Signals before pads will be treated as outliers
132 AliTPCcalibDButil (const AliTPCcalibDButil& );
133 AliTPCcalibDButil& operator= (const AliTPCcalibDButil& );
136 ClassDef(AliTPCcalibDButil,0)