ROOT logo
AliRoot » TPC » BASE » AliTPCcalibDButil

class AliTPCcalibDButil: public TObject


Class providing the calculation of derived quantities (mean,rms,fits,...)
of calibration entries





Function Members (Methods)

public:
AliTPCcalibDButil()
virtual~AliTPCcalibDButil()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
static TTree*ConnectCalPadTrees(TString baseDir, TString pattern, TTree* tMain, Bool_t checkAliases)
static TTree*ConnectDistortionTrees(TString baseDir, TString selection, TTree* tMain)
static TTree*ConnectGainTrees(TString baseDir)
static TTree*ConnectPulserTrees(TString baseDir, TTree* tree = 0)
virtual voidTObject::Copy(TObject& object) const
AliTPCCalPad*CreateCEOutlyerMap(Int_t& noutliersCE, AliTPCCalPad *const ceOut = 0, Float_t minSignal = 10, Float_t cutTrmsMin = 0.9, Float_t cutTrmsMax = 1.2, Float_t cutMaxDistT = 0.7)
Bool_tCreateGUIRefTree(const char* filename = "")
AliTPCCalPad*CreatePadTime0(Int_t model, Double_t& gyA, Double_t& gyC, Double_t& chi2A, Double_t& chi2C)
AliTPCCalPad*CreatePadTime0CE(TVectorD& fitResultsA, TVectorD& fitResultsC, Int_t& nOut, Double_t& chi2A, Double_t& chi2C, const char* dumpfile = 0)
AliTPCCalPad*CreatePulserOutlyerMap(Int_t& noutliersPulser, AliTPCCalPad *const pulserOut = 0, Float_t cutTime = 3, Float_t cutnRMSQ = 5, Float_t cutnRMSrms = 5)
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
static Double_tEvalGraphConst(TGraph *const graph, Double_t xref)
static Double_tEvalGraphConst(AliSplineFit* graph, Double_t xref)
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
static voidFilterCE(Double_t deltaT = 100, Double_t cutAbs = 10, Double_t cutSigma = 4., TTreeSRedirector *const pcstream = 0)
static voidFilterGoofie(AliDCSSensorArray* goofieArray, Double_t deltaT = 2, Double_t cutSigma = 4., Double_t minVdn = 8.5, Double_t maxVdn = 9.05, TTreeSRedirector *const pcstream = 0)
static TGraph*FilterGraphMedian(TGraph *const graph, Float_t sigmaCut, Double_t& medianY)
static TGraph*FilterGraphMedianAbs(TGraph* graph, Float_t cut, Double_t& medianY)
static TGraphErrors*FilterGraphMedianErr(TGraphErrors* graph, Float_t sigmaCut, Double_t& medianY)
static Float_tFilterSensor(AliDCSSensor* sensor, Double_t ymin, Double_t ymax, Double_t maxdy, Double_t sigmaCut)
static Float_tFilterTemperature(AliTPCSensorTempArray* tempArray, Double_t ymin = 15, Double_t ymax = 22, Double_t sigmaCut = 5)
static voidFilterTracks(Int_t run, Double_t cutSigma = 20., TTreeSRedirector *const pcstream = 0)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Int_tFindRunTPC(Int_t itime, Bool_t debug = kFALSE)
AliTPCCalPad*GetAltroMasked(const char* cdbPath, const char* name)
Int_tGetCurrentReferenceRun(const char* type) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
const char*GetGUIRefTreeDefaultName()
virtual const char*TObject::GetIconName() const
static Double_tGetLaserTime0(Int_t run, Int_t timeStamp, Int_t deltaT, Int_t side)
Float_tGetMeanAltro(const AliTPCCalROC* roc, const Int_t row, const Int_t pad, AliTPCCalROC *const rocOut = 0x0)
virtual const char*TObject::GetName() const
static Int_tGetNearest(TGraph* graph, Double_t xref, Double_t& dx, Double_t& y)
Int_tGetNPulserOutliers() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
AliTPCCalPad*GetPulserOutlierMap() const
AliTPCCalPad*GetRefALTROAcqStart() const
AliTPCCalPad*GetRefALTROAcqStop() const
AliTPCCalPad*GetRefALTROFPED() const
AliTPCCalPad*GetRefALTROMasked() const
AliTPCCalPad*GetRefALTROZsThr() const
AliTPCCalPad*GetRefCalPad(AliCDBEntry* entry)
AliTPCCalPad*GetRefCalPad(AliCDBEntry* entry, const char* objName)
AliTPCCalPad*GetRefCEMasked() const
AliTPCCalPad*GetRefCEQmean() const
AliTPCCalPad*GetRefCETmean() const
AliTPCCalPad*GetRefCETrms() const
AliCDBEntry*GetRefEntry(const char* cdbPath)
TMap*GetReferenceMap() const
Int_tGetReferenceRun(const char* type) const
AliTPCCalPad*GetRefPadNoise() const
AliTPCCalPad*GetRefPedestalMasked() const
AliTPCCalPad*GetRefPedestals() const
AliTPCCalPad*GetRefPulserMasked() const
AliTPCCalPad*GetRefPulserOutlier() const
AliTPCCalPad*GetRefPulserQmean() const
AliTPCCalPad*GetRefPulserTmean() const
AliTPCCalPad*GetRefPulserTrms() const
const char*GetRefValidity() const
static Double_tGetTime0TPCITS(Double_t& dist, Int_t run, Int_t timeStamp)
virtual const char*TObject::GetTitle() const
static Double_tGetTriggerOffsetTPC(Int_t run, Int_t timeStamp, Double_t deltaT = 86400, Double_t deltaTLaser = 3600, Int_t valType = 0)
virtual UInt_tTObject::GetUniqueID() const
static Double_tGetVDriftTPC(Double_t& dist, Int_t run, Int_t timeStamp, Double_t deltaT = 86400, Double_t deltaTLaser = 3600, Int_t valType = 0)
static Double_tGetVDriftTPCCE(Double_t& dist, Int_t run, Int_t timeStamp, Double_t deltaT = 43200, Int_t side = 2)
static Double_tGetVDriftTPCITS(Double_t& dist, Int_t run, Int_t timeStamp)
static Double_tGetVDriftTPCLaserTracks(Double_t& dist, Int_t run, Int_t timeStamp, Double_t deltaT = 43200, Int_t side = 2)
static Double_tGetVDriftTPCLaserTracksOnline(Double_t& dist, Int_t, Int_t timeStamp, Double_t deltaT = 43200, Int_t side = 2)
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
Bool_tHasRefChanged(const char* cdbPath)
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
Int_tMakeRunList(Int_t startRun, Int_t stopRun)
static TMatrixD*MakeStatRelKalman(TObjArray *const array, Float_t minFraction, Int_t minStat, Float_t maxvd)
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
voidProcessALTROConfig(Int_t& nMasked)
voidProcessCEdata(const char* fitFormula, TVectorD& fitResultsA, TVectorD& fitResultsC, Int_t& noutliersCE, Double_t& chi2A, Double_t& chi2C, AliTPCCalPad *const outCE = 0)
voidProcessCEgraphs(TVectorD& vecTEntries, TVectorD& vecTMean, TVectorD& vecTRMS, TVectorD& vecTMedian, TVectorD& vecQEntries, TVectorD& vecQMean, TVectorD& vecQRMS, TVectorD& vecQMedian, Float_t& driftTimeA, Float_t& driftTimeC)
voidProcessGoofie(TVectorD& vecEntries, TVectorD& vecMedian, TVectorD& vecMean, TVectorD& vecRMS)
voidProcessNoiseData(TVectorD& vNoiseMean, TVectorD& vNoiseMeanSenRegions, TVectorD& vNoiseRMS, TVectorD& vNoiseRMSSenRegions, Int_t& nonMaskedZero, Int_t& nNaN)
voidProcessNoiseVariations(TVectorF& noiseDeviations)
voidProcessPedestalVariations(TVectorF& pedestalDeviations)
voidProcessPulser(TVectorD& vMeanTime)
voidProcessPulserVariations(TVectorF& pulserQdeviations, Float_t& varQMean, Int_t& npadsOutOneTB, Int_t& npadsOffAdd)
voidProcessQAData(TVectorD& vQaOcc, TVectorD& vQaQtot, TVectorD& vQaQmax)
voidPulserOutlierMap(AliTPCCalPad* pulOut, const AliTPCCalPad* pulT, const AliTPCCalPad* pulQ)
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidSetALTROData(AliTPCCalPad *const masked)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetCEData(AliTPCCalPad *const tmean, AliTPCCalPad *const trms = 0x0, AliTPCCalPad *const qmean = 0x0)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetGoofieArray(AliDCSSensorArray *const arr)
voidSetNoisePedestal(AliTPCCalPad *const noise, AliTPCCalPad *const pedestal = 0x0)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetPulserData(AliTPCCalPad *const tmean, AliTPCCalPad *const trms = 0x0, AliTPCCalPad *const qmean = 0x0)
voidSetRefALTROData(AliTPCCalPad *const masked)
voidSetRefCEData(AliTPCCalPad *const tmean, AliTPCCalPad *const trms = 0x0, AliTPCCalPad *const qmean = 0x0)
voidSetReferenceRun(Int_t run = -1)
voidSetRefFile(const char* filename)
voidSetRefNoisePedestal(AliTPCCalPad *const noise, AliTPCCalPad *const pedestal = 0x0)
voidSetRefPulserData(AliTPCCalPad *const tmean, AliTPCCalPad *const trms = 0x0, AliTPCCalPad *const qmean = 0x0)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
static voidSmoothGraph(TGraph* graph, Double_t delta)
static TObjArray*SmoothRelKalman(TObjArray *const arrayP, TObjArray *const arrayM)
static TObjArray*SmoothRelKalman(TObjArray *const array, const TMatrixD& stat, Bool_t direction, Float_t sigmaCut)
static voidSort(TGraph* graph)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
voidUpdateFromCalibDB()
voidUpdatePulserOutlierMap()
voidUpdateRefDataFromOCDB()
voidUpdateRefPulserOutlierMap()
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
AliTPCcalibDButil(const AliTPCcalibDButil&)
static Double_tGetVDriftTPCLaserTracksCommon(Double_t& dist, Int_t timeStamp, Double_t deltaT, Int_t side, TObjArray *const array)
AliTPCcalibDButil&operator=(const AliTPCcalibDButil&)

Data Members

private:
AliTPCCalPad*fALTROMaskedALTRO masked channels information
AliTPCCalPad*fCEQmeancentral electrode mean q information
Float_tfCETmaxLimitAbsmaximum variation in CE data before pads will be treated as outliers
AliTPCCalPad*fCETmeancentral electrode mean time information
AliTPCCalPad*fCETrmscentral electrode rms time information
AliTPCcalibDB*fCalibDBpointer to calibDB object
AliTPCCalibRaw*fCalibRawraw calibration object
TMap*fCurrentRefMapreference data map of entries currently loaded
AliTPCdataQA*fDataQAdata qa
AliDCSSensorArray*fGoofieArrayGoofie Data
Float_tfIrocTimeOffsettiming offset between IROC and OROC in timebins
AliTPCmapper*fMapperTPC mapping handler
Int_tfNpulserOutliersnumber of outliers from Pulser calibration
AliTPCCalPad*fPadNoisenoise information
AliTPCCalPad*fPedestalspedestal information
Float_tfPulQmaxLimitAbsmaximum variation of Pulser Signals (charge) before pads will be treated as outliers
Float_tfPulQminLimitminimum charge value for Pulser Signals before pads will be treated as outliers
Float_tfPulTmaxLimitAbsmaximum variation of Pulser Signals (time) before pads will be treated as outliers
AliTPCCalPad*fPulserOutlierpulser outlier map
AliTPCCalPad*fPulserQmeanpulser mean q information
AliTPCCalPad*fPulserTmeanpulser mean time information
AliTPCCalPad*fPulserTrmspulser rms time information
AliTPCCalPad*fRefALTROAcqStartReference accquistion start time bin
AliTPCCalPad*fRefALTROAcqStopReference accquistion stop time bin
AliTPCCalPad*fRefALTROFPEDReference fixed pedestal value
AliTPCCalPad*fRefALTROMaskedReference ALTRO masked channels information
AliTPCCalPad*fRefALTROZsThrReference zero suppression threshol
AliTPCCalPad*fRefCEMaskedReference masked channels in laser run
AliTPCCalPad*fRefCEQmeanReference central electrode mean q information
AliTPCCalPad*fRefCETmeanReference central electrode mean time information
AliTPCCalPad*fRefCETrmsReference central electrode rms time information
AliTPCCalibRaw*fRefCalibRawReference raw calibration object
AliTPCdataQA*fRefDataQAReference data QA
TMap*fRefMaplatest map to reference information
AliTPCCalPad*fRefPadNoiseReference noise information
AliTPCCalPad*fRefPedestalMaskedReference masked channels in pedestal run
AliTPCCalPad*fRefPedestalsReference pedestal information
AliTPCCalPad*fRefPulserMaskedReference masked channels in pulser run
AliTPCCalPad*fRefPulserOutlierReference pulser outlier map
AliTPCCalPad*fRefPulserQmeanReference pulser mean q information
AliTPCCalPad*fRefPulserTmeanReference pulser mean time information
AliTPCCalPad*fRefPulserTrmsReference pulser rms time information
TStringfRefValidityvalidity range of reference data
TArrayIfRunsrun list with OCDB info
TArrayIfRunsStartstart time for given run
TArrayIfRunsStopstop time for given run

Class Charts

Inheritance Chart:
TObject
AliTPCcalibDButil

Function documentation

AliTPCcalibDButil()
 Default ctor

~AliTPCcalibDButil()
 dtor

void UpdateFromCalibDB()
 Update pointers from calibDB

void ProcessCEdata(const char* fitFormula, TVectorD& fitResultsA, TVectorD& fitResultsC, Int_t& noutliersCE, Double_t& chi2A, Double_t& chi2C, AliTPCCalPad *const outCE = 0)
 Process the CE data for this run
 the return TVectorD arrays contian the results of the fit
 noutliersCE contains the number of pads marked as outliers,
   not including masked and edge pads

void ProcessCEgraphs(TVectorD& vecTEntries, TVectorD& vecTMean, TVectorD& vecTRMS, TVectorD& vecTMedian, TVectorD& vecQEntries, TVectorD& vecQMean, TVectorD& vecQRMS, TVectorD& vecQMedian, Float_t& driftTimeA, Float_t& driftTimeC)
 Calculate statistical information from the CE graphs for drift time and charge

void ProcessNoiseData(TVectorD& vNoiseMean, TVectorD& vNoiseMeanSenRegions, TVectorD& vNoiseRMS, TVectorD& vNoiseRMSSenRegions, Int_t& nonMaskedZero, Int_t& nNaN)
 process noise data
 vNoiseMean/RMS contains the Mean/RMS noise of the complete TPC [0], IROCs only [1],
    OROCs small pads [2] and OROCs large pads [3]
 vNoiseMean/RMSsenRegions constains the same information, but only for the sensitive regions (edge pads, corners, IROC spot)
 nonMaskedZero contains the number of pads which show zero noise and were not masked. This might indicate an error

void ProcessQAData(TVectorD& vQaOcc, TVectorD& vQaQtot, TVectorD& vQaQmax)
 process QA data

 vQaOcc/Qtot/Qmax contains the Mean occupancy/Qtot/Qmax for each sector

void ProcessPulser(TVectorD& vMeanTime)
 Process the Pulser information
 vMeanTime:     pulser mean time position in IROC-A, IROC-C, OROC-A, OROC-C

void ProcessALTROConfig(Int_t& nMasked)
 Get Values from ALTRO configuration data

void ProcessGoofie(TVectorD& vecEntries, TVectorD& vecMedian, TVectorD& vecMean, TVectorD& vecRMS)
 Proces Goofie values, return statistical information of the currently set goofieArray
 The meaning of the entries are given below

  1       TPC_ANODE_I_A00_STAT
  2       TPC_DVM_CO2
  3       TPC_DVM_DriftVelocity
  4       TPC_DVM_FCageHV
  5       TPC_DVM_GainFar
  6       TPC_DVM_GainNear
  7       TPC_DVM_N2
  8       TPC_DVM_NumberOfSparks
  9       TPC_DVM_PeakAreaFar
  10      TPC_DVM_PeakAreaNear
  11      TPC_DVM_PeakPosFar
  12      TPC_DVM_PeakPosNear
  13      TPC_DVM_PickupHV
  14      TPC_DVM_Pressure
  15      TPC_DVM_T1_Over_P
  16      TPC_DVM_T2_Over_P
  17      TPC_DVM_T_Over_P
  18      TPC_DVM_TemperatureS1

void ProcessPedestalVariations(TVectorF& pedestalDeviations)
 check the variations of the pedestal data to the reference pedestal data
 thresholds are 0.5, 1.0, 1.5 and 2 timebins respectively.

void ProcessNoiseVariations(TVectorF& noiseDeviations)
 check the variations of the noise data to the reference noise data
 thresholds are 5, 10, 15 and 20 percent respectively.

void ProcessPulserVariations(TVectorF& pulserQdeviations, Float_t& varQMean, Int_t& npadsOutOneTB, Int_t& npadsOffAdd)
 check the variations of the pulserQmean data to the reference pulserQmean data: pulserQdeviations
 thresholds are .5, 1, 5 and 10 percent respectively.


void UpdatePulserOutlierMap()
 Update the outlier map of the pulser data

void UpdateRefPulserOutlierMap()
 Update the outlier map of the pulser reference data

void PulserOutlierMap(AliTPCCalPad* pulOut, const AliTPCCalPad* pulT, const AliTPCCalPad* pulQ)
 Create a map that contains outliers from the Pulser calibration data.
 The outliers include masked channels, edge pads and pads with
   too large timing and charge variations.
 fNpulserOutliers is the number of outliers in the Pulser calibration data.
   those do not contain masked and edge pads

AliTPCCalPad* CreatePadTime0(Int_t model, Double_t& gyA, Double_t& gyC, Double_t& chi2A, Double_t& chi2C)
 Create pad time0 object from pulser and/or CE data, depending on the selected model
 Model 0: normalise each readout chamber to its mean, outlier cutted, only Pulser
 Model 1: normalise IROCs/OROCs of each readout side to its mean, only Pulser
 Model 2: use CE data and a combination CE fit + pulser in the outlier regions.

 In case model 2 is invoked - gy arival time gradient is also returned

Float_t GetMeanAltro(const AliTPCCalROC* roc, const Int_t row, const Int_t pad, AliTPCCalROC *const rocOut = 0x0)
 GetMeanAlto information

void SetRefFile(const char* filename)
 load cal pad objects form the reference file

void UpdateRefDataFromOCDB()
 set reference data from OCDB Reference map

AliTPCCalPad* GetRefCalPad(AliCDBEntry* entry, const char* objName)
 TObjArray object type case
 find 'objName' in 'arr' cast is to a calPad and store it in 'pad'

AliTPCCalPad* GetRefCalPad(AliCDBEntry* entry)
 AliTPCCalPad object type case
 cast object to a calPad and store it in 'pad'

AliTPCCalPad* GetAltroMasked(const char* cdbPath, const char* name)
 set altro masked channel map for 'cdbPath'

void SetReferenceRun(Int_t run = -1)
 Get Reference map

Bool_t HasRefChanged(const char* cdbPath)
 check whether a reference cdb entry has changed

AliCDBEntry* GetRefEntry(const char* cdbPath)
 get the reference AliCDBEntry for 'cdbPath'

Int_t GetCurrentReferenceRun(const char* type) const
 Get reference run number for the specified OCDB path

Int_t GetReferenceRun(const char* type) const
 Get reference run number for the specified OCDB path

AliTPCCalPad * CreateCEOutlyerMap(Int_t& noutliersCE, AliTPCCalPad *const ceOut = 0, Float_t minSignal = 10, Float_t cutTrmsMin = 0.9, Float_t cutTrmsMax = 1.2, Float_t cutMaxDistT = 0.7)
 Author:  marian.ivanov@cern.ch

 Create outlier map for CE study
 Parameters:
  Return value - outlyer map
  noutlyersCE  - number of outlyers
  minSignal    - minimal total Q signal
  cutRMSMin    - minimal width of the signal in respect to the median
  cutRMSMax    - maximal width of the signal in respect to the median
  cutMaxDistT  - maximal deviation from time median per chamber

 Outlyers criteria:
 0. Exclude masked pads
 1. Exclude first two rows in IROC and last two rows in OROC
 2. Exclude edge pads
 3. Exclude channels with too large variations
 4. Exclude pads with too small signal
 5. Exclude signal with outlyers RMS
 6. Exclude channels to far from the chamber median
AliTPCCalPad * CreatePulserOutlyerMap(Int_t& noutliersPulser, AliTPCCalPad *const pulserOut = 0, Float_t cutTime = 3, Float_t cutnRMSQ = 5, Float_t cutnRMSrms = 5)
 Author: marian.ivanov@cern.ch

 Create outlier map for Pulser
 Parameters:
  Return value     - outlyer map
  noutlyersPulser  - number of outlyers
  cutTime          - absolute cut - distance to the median of chamber
  cutnRMSQ         - nsigma cut from median  q distribution per chamber
  cutnRMSrms       - nsigma cut from median  rms distribution
 Outlyers criteria:
 0. Exclude masked pads
 1. Exclude time outlyers (default 3 time bins)
 2. Exclude q outlyers    (default 5 sigma)
 3. Exclude rms outlyers  (default 5 sigma)
AliTPCCalPad * CreatePadTime0CE(TVectorD& fitResultsA, TVectorD& fitResultsC, Int_t& nOut, Double_t& chi2A, Double_t& chi2C, const char* dumpfile = 0)
 Author : Marian Ivanov
 Create pad time0 correction map using information from the CE and from pulser


 Return PadTime0 to be used for time0 relative alignment
 if dump file specified intermediat results are dumped to the fiel and can be visualized
 using $ALICE_ROOT/TPC/script/gui application

 fitResultsA - fitParameters A side
 fitResultsC - fitParameters C side
 chi2A       - chi2/ndf for A side (assuming error 1 time bin)
 chi2C       - chi2/ndf for C side (assuming error 1 time bin)


 Algorithm:
 1. Find outlier map for CE
 2. Find outlier map for Pulser
 3. Replace outlier by median at given sector  (median without outliers)
 4. Substract from the CE data pulser
 5. Fit the CE with formula
    5.1) (IROC-OROC) offset
    5.2) gx
    5.3) gy
    5.4) (lx-xmid)
    5.5) (IROC-OROC)*(lx-xmid)
    5.6) (ly/lx)^2
 6. Substract gy fit dependence from the CE data
 7. Add pulser back to CE data
 8. Replace outliers by fit value - median of diff per given chamber -GY fit
 9. return CE data

 Time0 <= padCE = padCEin  -padCEfitGy  - if not outlier
 Time0 <= padCE = padFitAll-padCEfitGy  - if outlier
Int_t GetNearest(TGraph* graph, Double_t xref, Double_t& dx, Double_t& y)
 find the closest point to xref  in x  direction
 return dx and value
Double_t GetTriggerOffsetTPC(Int_t run, Int_t timeStamp, Double_t deltaT = 86400, Double_t deltaTLaser = 3600, Int_t valType = 0)
 Get the correction of the trigger offset
 combining information from the laser track calibration
 and from cosmic calibration

 run       - run number
 timeStamp - tim stamp in seconds
 deltaT    - integration period to calculate offset
 deltaTLaser -max validity of laser data
 valType   - 0 - median, 1- mean

 Integration vaues are just recomendation - if not possible to get points
 automatically increase the validity by factor 2
 (recursive algorithm until one month of data taking)


Double_t GetVDriftTPC(Double_t& dist, Int_t run, Int_t timeStamp, Double_t deltaT = 86400, Double_t deltaTLaser = 3600, Int_t valType = 0)
 Get the correction of the drift velocity
 combining information from the laser track calibration
 and from cosmic calibration

 dist      - return value - distance to closest point in graph
 run       - run number
 timeStamp - tim stamp in seconds
 deltaT    - integration period to calculate time0 offset
 deltaTLaser -max validity of laser data
 valType   - 0 - median, 1- mean

 Integration vaues are just recomendation - if not possible to get points
 automatically increase the validity by factor 2
 (recursive algorithm until one month of data taking)



const char* GetGUIRefTreeDefaultName()
 Create a default name for the gui file

Bool_t CreateGUIRefTree(const char* filename = "")
 Create a gui reference tree
 if dirname and filename are empty default values will be used
 this is the recommended way of using this function
 it allows to check whether a file with the given run validity alredy exists

Double_t GetVDriftTPCLaserTracks(Double_t& dist, Int_t run, Int_t timeStamp, Double_t deltaT = 43200, Int_t side = 2)
 Get the correction of the drift velocity using the offline laser tracks calbration

 run       - run number
 timeStamp - tim stamp in seconds
 deltaT    - integration period to calculate time0 offset
 side      - 0 - A side,  1 - C side, 2 - mean from both sides
 Note in case no data form both A and C side - the value from active side used
Double_t GetVDriftTPCLaserTracksOnline(Double_t& dist, Int_t , Int_t timeStamp, Double_t deltaT = 43200, Int_t side = 2)
 Get the correction of the drift velocity using the online laser tracks calbration

 run       - run number
 timeStamp - tim stamp in seconds
 deltaT    - integration period to calculate time0 offset
 side      - 0 - A side,  1 - C side, 2 - mean from both sides
 Note in case no data form both A and C side - the value from active side used
Double_t GetVDriftTPCLaserTracksCommon(Double_t& dist, Int_t timeStamp, Double_t deltaT, Int_t side, TObjArray *const array)
 common drift velocity retrieval for online and offline method

Double_t GetVDriftTPCCE(Double_t& dist, Int_t run, Int_t timeStamp, Double_t deltaT = 43200, Int_t side = 2)
 Get the correction of the drift velocity using the CE laser data
 combining information from the CE,  laser track calibration
 and P/T calibration

 run       - run number
 timeStamp - tim stamp in seconds
 deltaT    - integration period to calculate time0 offset
 side      - 0 - A side,  1 - C side, 2 - mean from both sides
Double_t GetVDriftTPCITS(Double_t& dist, Int_t run, Int_t timeStamp)
 return drift velocity using the TPC-ITS matchin method
 return also distance to the closest point

Double_t GetTime0TPCITS(Double_t& dist, Int_t run, Int_t timeStamp)
 Get time dependent time 0 (trigger delay in cm) correction
 Arguments:
 timestamp - timestamp
 run       - run number

 Notice - Extrapolation outside of calibration range  - using constant function

Int_t MakeRunList(Int_t startRun, Int_t stopRun)
 VERY obscure method - we need something in framework
 Find the TPC runs with temperature OCDB entry
 cache the start and end of the run

Int_t FindRunTPC(Int_t itime, Bool_t debug = kFALSE)
 binary search - find the run for given time stamp

TGraph* FilterGraphMedian(TGraph *const graph, Float_t sigmaCut, Double_t& medianY)
 filter outlyer measurement
 Only points around median +- sigmaCut filtered
TGraph* FilterGraphMedianAbs(TGraph* graph, Float_t cut, Double_t& medianY)
 filter outlyer measurement
 Only points around median +- cut filtered
TGraphErrors* FilterGraphMedianErr(TGraphErrors* graph, Float_t sigmaCut, Double_t& medianY)
 filter outlyer measurement
 Only points with normalized errors median +- sigmaCut filtered

void Sort(TGraph* graph)
 sort array - neccessay for approx

void SmoothGraph(TGraph* graph, Double_t delta)
 smmoth graph - mean on the interval

Double_t EvalGraphConst(TGraph *const graph, Double_t xref)
 Use constant interpolation outside of range

Double_t EvalGraphConst(AliSplineFit* graph, Double_t xref)
 Use constant interpolation outside of range also for spline fits

Float_t FilterSensor(AliDCSSensor* sensor, Double_t ymin, Double_t ymax, Double_t maxdy, Double_t sigmaCut)
 Filter DCS sensor information
   ymin     - minimal value
   ymax     - max value
   maxdy    - maximal deirivative
   sigmaCut - cut on values and derivative in terms of RMS distribution
 Return value - accepted fraction

 Algorithm:

 0. Calculate median and rms of values in specified range
 1. Filter out outliers - median+-sigmaCut*rms
    values replaced by median

Float_t FilterTemperature(AliTPCSensorTempArray* tempArray, Double_t ymin = 15, Double_t ymax = 22, Double_t sigmaCut = 5)
 Filter temperature array
 tempArray    - array of temperatures         -
 ymin         - minimal accepted temperature  - default 15
 ymax         - maximal accepted temperature  - default 22
 sigmaCut     - values filtered on interval median+-sigmaCut*rms - defaut 5
 return value - fraction of filtered sensors
void FilterCE(Double_t deltaT = 100, Double_t cutAbs = 10, Double_t cutSigma = 4., TTreeSRedirector *const pcstream = 0)
 Filter CE data
 Input parameters:
    deltaT   - smoothing window (in seconds)
    cutAbs   - max distance of the time info to the median (in time bins)
    cutSigma - max distance (in the RMS)
    pcstream - optional debug streamer to store original and filtered info
 Hardwired parameters:
    kMinPoints =10;       // minimal number of points to define the CE
    kMinSectors=12;       // minimal number of sectors to define sideCE
 Algorithm:
 0. Filter almost emty graphs (kMinPoints=10)
 1. calculate median and RMS per side
 2. Filter graphs - in respect with side medians
                  - cutAbs and cutDelta used
 3. Cut in respect wit the graph median - cutAbs and cutRMS used
 4. Calculate mean for A side and C side

void FilterTracks(Int_t run, Double_t cutSigma = 20., TTreeSRedirector *const pcstream = 0)
 Filter Drift velocity measurement using the tracks
 0.  remove outlyers - error based
     cutSigma


Double_t GetLaserTime0(Int_t run, Int_t timeStamp, Int_t deltaT, Int_t side)

 get laser time offset
 median around timeStamp+-deltaT
 QA - chi2 needed for later usage - to be added
    - currently cut on error

void FilterGoofie(AliDCSSensorArray* goofieArray, Double_t deltaT = 2, Double_t cutSigma = 4., Double_t minVdn = 8.5, Double_t maxVdn = 9.05, TTreeSRedirector *const pcstream = 0)
 Filter Goofie data
 goofieArray - points will be filtered
 deltaT      - smmothing time window
 cutSigma    - outler sigma cut in rms
 minVn, maxVd- range absolute cut for variable vd/pt
             - to be tuned

 Ignore goofie if not enough points

TMatrixD* MakeStatRelKalman(TObjArray *const array, Float_t minFraction, Int_t minStat, Float_t maxvd)
 Make a statistic matrix
 Input parameters:
   array        - TObjArray of AliRelKalmanAlign
   minFraction  - minimal ration of accepted tracks
   minStat      - minimal statistic (number of accepted tracks)
   maxvd        - maximal deviation for the 1
 Output matrix:
    columns    - Mean, Median, RMS
    row        - parameter type (rotation[3], translation[3], drift[3])
TObjArray * SmoothRelKalman(TObjArray *const array, const TMatrixD& stat, Bool_t direction, Float_t sigmaCut)
 Smooth the array of AliRelKalmanAlign - detector alignment and drift calibration)
 Input:
   array     - input array
   stat      - mean parameters statistic
   direction -
   sigmaCut  - maximal allowed deviation from mean in terms of RMS
TObjArray * SmoothRelKalman(TObjArray *const arrayP, TObjArray *const arrayM)
 Merge 2 RelKalman arrays
 Input:
   arrayP    - rel kalman in direction plus
   arrayM    - rel kalman in direction minus
TTree* ConnectGainTrees(TString baseDir)
 baseDir:   Base directory with the raw Kr calibration trees
            and the trees from the calibQA
            it assumes to following structure below:
            KryptonCalib/<year>/calibKr/calibKr.<year>.<id>.root
            calibQAdEdx/<year>/calibQA.<year>.<perid>.tree.root
            map/treeMapping.root

TTree* ConnectPulserTrees(TString baseDir, TTree* tree = 0)
 baseDir:   Base directory with Pulser information
 TTrees are added to the base tree as a friend tree

 === add the calibPulser trees ======================================
TTree* ConnectDistortionTrees(TString baseDir, TString selection, TTree* tMain)
 baseDir:   Base directory with Distortion information
 TTrees are added to the base tree as a friend tree
 If base tree not provide - first tree from list is used as base

 === add the calibDistortion trees ======================================
TString inputTreesDistortionCalib       = gSystem->GetFromPipe(Form("ls %s/calibDistortion/20*/*.tree.root",baseDir.Data()));
 TString baseDir="$NOTES/reconstruction/distortionFit/"; TTree *tMain=0;
 AliTPCcalibDButil::ConnectDistortionTrees("$NOTES/reconstruction/distortionFit/", "calibTimeResHisto.root", 0);
TTree* ConnectCalPadTrees(TString baseDir, TString pattern, TTree* tMain, Bool_t checkAliases)
 baseDir:   Base directory with per Pad information
 TTrees are added to the base tree as a friend tree
 Example usage
   TString baseDir="/hera/alice/fsozzi/summarymaps/calib2/";  // prefix directory with calibration with slash at the end
   TString pattern="QA/*/*root";
   TTree * tree =  AliTPCcalibDButil::ConnectCalPadTrees(baseDir,pattern,0);   //create tree and attach calibration as friends
AliTPCcalibDButil()
Int_t GetNPulserOutliers() const
getter preprocess information
AliTPCCalPad * GetPulserOutlierMap() const
{return fPulserOutlier;}
TMap * GetReferenceMap() const
getters ref data
{return fRefMap;}
const char* GetRefValidity() const
{return fRefValidity.Data();}
AliTPCCalPad* GetRefPadNoise() const
{return fRefPadNoise;}
AliTPCCalPad* GetRefPedestals() const
{return fRefPedestals;}
AliTPCCalPad* GetRefPedestalMasked() const
AliTPCCalPad* GetRefPulserTmean() const
{return fRefPulserTmean;}
AliTPCCalPad* GetRefPulserTrms() const
{return fRefPulserTrms;}
AliTPCCalPad* GetRefPulserQmean() const
{return fRefPulserQmean;}
AliTPCCalPad* GetRefPulserOutlier() const
AliTPCCalPad* GetRefPulserMasked() const
AliTPCCalPad* GetRefCETmean() const
{return fRefCETmean;}
AliTPCCalPad* GetRefCETrms() const
{return fRefCETrms;}
AliTPCCalPad* GetRefCEQmean() const
{return fRefCEQmean;}
AliTPCCalPad* GetRefCEMasked() const
{return fRefCEMasked;}
AliTPCCalPad* GetRefALTROFPED() const
{return fRefALTROFPED;}
AliTPCCalPad* GetRefALTROZsThr() const
{return fRefALTROZsThr;}
AliTPCCalPad* GetRefALTROAcqStart() const
AliTPCCalPad* GetRefALTROAcqStop() const
AliTPCCalPad* GetRefALTROMasked() const
{return fRefALTROMasked;}
void SetPulserData(AliTPCCalPad *const tmean, AliTPCCalPad *const trms = 0x0, AliTPCCalPad *const qmean = 0x0)
setters for pad by pad information
{fPulserTmean=tmean; fPulserTrms=trms; fPulserQmean=qmean;}
void SetCEData(AliTPCCalPad *const tmean, AliTPCCalPad *const trms = 0x0, AliTPCCalPad *const qmean = 0x0)
{fCETmean=tmean; fCETrms=trms; fCEQmean=qmean;}
void SetNoisePedestal(AliTPCCalPad *const noise, AliTPCCalPad *const pedestal = 0x0)
{fPadNoise=noise; fPedestals=pedestal;}
void SetALTROData(AliTPCCalPad *const masked)
{fALTROMasked=masked;}
void SetGoofieArray(AliDCSSensorArray *const arr)
void SetRefPulserData(AliTPCCalPad *const tmean, AliTPCCalPad *const trms = 0x0, AliTPCCalPad *const qmean = 0x0)
void SetRefCEData(AliTPCCalPad *const tmean, AliTPCCalPad *const trms = 0x0, AliTPCCalPad *const qmean = 0x0)
{fRefCETmean=tmean; fRefCETrms=trms; fRefCEQmean=qmean;}
void SetRefNoisePedestal(AliTPCCalPad *const noise, AliTPCCalPad *const pedestal = 0x0)
{fRefPadNoise=noise; fRefPedestals=pedestal;}
void SetRefALTROData(AliTPCCalPad *const masked)
{fRefALTROMasked=masked;}
AliTPCcalibDButil& operator=(const AliTPCcalibDButil& )