AliTPCTempMap.h AliTPCTempMap.cxx - Filter values before fits - range 15-25 C
[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>
a23ba1c3 15#include <TArrayI.h>
892226be 16
17class AliDCSSensorArray;
18class AliTPCcalibDB;
19class AliTPCCalPad;
20class AliTPCmapper;
6e7d7dc4 21class AliTPCCalibRaw;
817766d5 22class TGraph;
a23ba1c3 23class TGraphErrors;
24class TTreeSRedirector;
892226be 25
26class AliTPCcalibDButil : public TObject
29 AliTPCcalibDButil();
30 virtual ~AliTPCcalibDButil();
32 void UpdateFromCalibDB();
33 //data processing functions
7390f655 34 void ProcessCEdata(const char* fitFormula, TVectorD &fitResultsA, TVectorD &fitResultsC,
2cb269df 35 Int_t &noutliersCE, Double_t & chi2A, Double_t &chi2C, AliTPCCalPad *outCE=0);
892226be 36 void ProcessCEgraphs(TVectorD &vecTEntries, TVectorD &vecTMean, TVectorD &vecTRMS, TVectorD &vecTMedian,
37 TVectorD &vecQEntries, TVectorD &vecQMean, TVectorD &vecQRMS, TVectorD &vecQMedian,
38 Float_t &driftTimeA, Float_t &driftTimeC );
39 void ProcessNoiseData(TVectorD &vNoiseMean, TVectorD &vNoiseMeanSenRegions,
40 TVectorD &vNoiseRMS, TVectorD &vNoiseRMSSenRegions,
41 Int_t &nonMaskedZero);
42 void ProcessPulser(TVectorD &vMeanTime);
43 void ProcessALTROConfig(Int_t &nMasked);
44 void ProcessGoofie(TVectorD & vecEntries, TVectorD & vecMedian, TVectorD &vecMean, TVectorD &vecRMS);
7390f655 45 //processing functions using reference data
46 void ProcessPedestalVariations(TVectorF &pedestalDeviations);
47 void ProcessNoiseVariations(TVectorF &noiseDeviations);
48 void ProcessPulserVariations(TVectorF &pulserQdeviations, Float_t &varQMean, Int_t &npadsOutOneTB, Int_t &npadsOffAdd);
892226be 49 //getter preprocess information
50 Int_t GetNPulserOutliers() const {return fNpulserOutliers;}
51 Float_t GetMeanAltro(const AliTPCCalROC *roc, const Int_t row, const Int_t pad, AliTPCCalROC *rocOut=0x0);
52 AliTPCCalPad *GetPulserOutlierMap() const {return fPulserOutlier;}
53 //setters for pad by pad information
54 void SetPulserData(AliTPCCalPad *tmean, AliTPCCalPad *trms=0x0, AliTPCCalPad *qmean=0x0)
55 {fPulserTmean=tmean; fPulserTrms=trms; fPulserQmean=qmean;}
56 void SetCEData(AliTPCCalPad *tmean, AliTPCCalPad *trms=0x0, AliTPCCalPad *qmean=0x0)
57 {fCETmean=tmean; fCETrms=trms; fCEQmean=qmean;}
58 void SetNoisePedestal(AliTPCCalPad *noise, AliTPCCalPad *pedestal=0x0)
59 {fPadNoise=noise; fPedestals=pedestal;}
60 void SetALTROData(AliTPCCalPad *masked)
61 {fALTROMasked=masked;}
62 void SetGoofieArray(AliDCSSensorArray *arr) {fGoofieArray=arr;}
7390f655 63 //setters for pad by pad information
64 void SetRefFile(const char* filename);
65 void SetRefPulserData(AliTPCCalPad *tmean, AliTPCCalPad *trms=0x0, AliTPCCalPad *qmean=0x0)
66 {fRefPulserTmean=tmean; fRefPulserTrms=trms; fRefPulserQmean=qmean;}
67 void SetRefCEData(AliTPCCalPad *tmean, AliTPCCalPad *trms=0x0, AliTPCCalPad *qmean=0x0)
68 {fRefCETmean=tmean; fRefCETrms=trms; fRefCEQmean=qmean;}
69 void SetRefNoisePedestal(AliTPCCalPad *noise, AliTPCCalPad *pedestal=0x0)
70 {fRefPadNoise=noise; fRefPedestals=pedestal;}
71 void SetRefALTROData(AliTPCCalPad *masked)
72 {fRefALTROMasked=masked;}
892226be 74 //creation of derived pad by pad calibration data
2cb269df 75 AliTPCCalPad *CreatePadTime0(Int_t model, Double_t &gyA, Double_t &gyC, Double_t &chi2A, Double_t &chi2C);
892226be 76 //
2cb269df 77 // create outlyer maps
78 //
79 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);
80 AliTPCCalPad *CreatePulserOutlyerMap(Int_t &noutliersPulser, AliTPCCalPad *pulserOut=0, Float_t cutTime=3, Float_t cutnRMSQ=5, Float_t cutnRMSrms=5);
81 //
82 AliTPCCalPad *CreatePadTime0CE(TVectorD &fitResultsA, TVectorD&fitResultsC, Int_t &nOut, Double_t &chi2A, Double_t &chi2C, const char *dumpfile=0);
83 //
892226be 85 void UpdatePulserOutlierMap();
7390f655 86 void UpdateRefPulserOutlierMap();
87 void PulserOutlierMap(AliTPCCalPad *pulOut, const AliTPCCalPad *pulT, const AliTPCCalPad *pulQ);
817766d5 88
89 //
90 // graph tools
91 //
a23ba1c3 92 static Double_t GetLaserTime0(Int_t run, Int_t timeStamp, Int_t deltaT, Int_t side);
93 static TGraph* FilterGraphMedian(TGraph * graph, Float_t sigmaCut, Double_t &medianY);
94 static TGraph* FilterGraphMedianAbs(TGraph * graph, Float_t cut, Double_t &medianY);
95 static TGraphErrors* FilterGraphMedianErr(TGraphErrors * graph, Float_t sigmaCut,Double_t &medianY);
96 //
97 static void Sort(TGraph *graph);
98 static void SmoothGraph(TGraph *graph, Double_t delta);
817766d5 99 static Int_t GetNearest(TGraph *graph, Double_t xref, Double_t &dx, Double_t &y);
a23ba1c3 100 static Double_t EvalGraphConst(TGraph *graph, Double_t xref);
102 void FilterCE(Double_t deltaT=100, Double_t cutAbs=10, Double_t cutSigma=4., TTreeSRedirector *pcstream=0);
103 void FilterTracks(Int_t run, Double_t cutSigma=20., TTreeSRedirector *pcstream=0);
105 void FilterGoofie(AliDCSSensorArray * goofieArray, Double_t deltaT=2, Double_t cutSigma=4., TTreeSRedirector *pcstream=0);
106 static Double_t GetTriggerOffsetTPC(Int_t run, Int_t timeStamp, Double_t deltaT=86400, Double_t deltaTLaser=3600, Int_t valType=0);
107 static Double_t GetVDriftTPC(Double_t &dist, Int_t run, Int_t timeStamp, Double_t deltaT=86400, Double_t deltaTLaser=3600, Int_t valType=0);
108 static Double_t GetVDriftTPCLaserTracks(Double_t &dist,Int_t run, Int_t timeStamp, Double_t deltaT=43200, Int_t side=2);
109 static Double_t GetVDriftTPCCE(Double_t &dist, Int_t run, Int_t timeStamp, Double_t deltaT=43200, Int_t side=2);
110 Int_t MakeRunList(Int_t startRun, Int_t stopRun); // find the list of usable runs
111 Int_t FindRunTPC(Int_t itime, Bool_t debug=kFALSE);
892226be 112private:
113 AliTPCcalibDB *fCalibDB; //pointer to calibDB object
114 AliTPCCalPad *fPadNoise; //noise information
115 AliTPCCalPad *fPedestals; //pedestal information
116 AliTPCCalPad *fPulserTmean; //pulser mean time information
117 AliTPCCalPad *fPulserTrms; //pulser rms time information
118 AliTPCCalPad *fPulserQmean; //pulser mean q information
119 AliTPCCalPad *fPulserOutlier; //pulser outlier map
120 AliTPCCalPad *fCETmean; //central electrode mean time information
121 AliTPCCalPad *fCETrms; //central electrode rms time information
122 AliTPCCalPad *fCEQmean; //central electrode mean q information
123 AliTPCCalPad *fALTROMasked; //ALTRO masked channels information
124 //
6e7d7dc4 125 AliTPCCalibRaw *fCalibRaw; //raw calibration object
7390f655 126 //reference data
127 AliTPCCalPad *fRefPadNoise; //Reference noise information
128 AliTPCCalPad *fRefPedestals; //Reference pedestal information
129 AliTPCCalPad *fRefPulserTmean; //Reference pulser mean time information
130 AliTPCCalPad *fRefPulserTrms; //Reference pulser rms time information
131 AliTPCCalPad *fRefPulserQmean; //Reference pulser mean q information
132 AliTPCCalPad *fRefPulserOutlier; //Reference pulser outlier map
133 AliTPCCalPad *fRefCETmean; //Reference central electrode mean time information
134 AliTPCCalPad *fRefCETrms; //Reference central electrode rms time information
135 AliTPCCalPad *fRefCEQmean; //Reference central electrode mean q information
136 AliTPCCalPad *fRefALTROMasked; //Reference ALTRO masked channels information
137 //
138 AliTPCCalibRaw *fRefCalibRaw; //Reference raw calibration object
6e7d7dc4 140 //
892226be 141 AliDCSSensorArray* fGoofieArray; //Goofie Data
142 //
143 AliTPCmapper *fMapper; //TPC mapping handler
144 Int_t fNpulserOutliers; //number of outliers from Pulser calibration
146 Float_t fIrocTimeOffset; //timing offset between IROC and OROC in timebins
147 Float_t fCETmaxLimitAbs; //maximum variation in CE data before pads will be treated as outliers
148 Float_t fPulTmaxLimitAbs; //maximum variation of Pulser Signals (time) before pads will be treated as outliers
149 Float_t fPulQmaxLimitAbs; //maximum variation of Pulser Signals (charge) before pads will be treated as outliers
150 Float_t fPulQminLimit; //minimum charge value for Pulser Signals before pads will be treated as outliers
a23ba1c3 151
152 //
153 // helpers to get the run number for given time stamps
154 //
155 // filters
892226be 156
a23ba1c3 157public:
158 TArrayI fRuns; // run list with OCDB info
159 TArrayI fRunsStart; // start time for given run
160 TArrayI fRunsStop; // stop time for given run
892226be 162 AliTPCcalibDButil (const AliTPCcalibDButil& );
163 AliTPCcalibDButil& operator= (const AliTPCcalibDButil& );
166 ClassDef(AliTPCcalibDButil,0)