ROOT logo
#ifndef ALI_TPC_COMPOSED_CORRECTION_H
#define ALI_TPC_COMPOSED_CORRECTION_H

/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
// AliTPCComposedCorrection class                                             //
//                                                                            //
// This class is creating a correction that is composed out of smaller        //
// corrections.                                                               //
// There are two ways the sub-corrections can be combined into this one:      //
// 1. kParallel: All corrections are applied at the given position x and      //
//    the dx terms are summed up (this commutes).                             //
// 2. kQueue: The corrections are called in order. The first one at the       //
//    given position x resulting in dx1, the second one is called at          //
//    the corrected position (x+dx1) resulting in dx2, the third one          //
//    is then called at position (x+dx1+dx2) and so forth. dx=dx1+dx2+...     //
//    is returned.                                                            //
// For the inverse of the correction this is taken into account by reversing  //
// the order the corrections are applied in the kQueue case (no issue for     //
// kParallel).                                                                //
//                                                                            //
// date: 27/04/2010                                                           //
// Authors: Magnus Mager, Stefan Rossegger, Jim Thomas                       //
////////////////////////////////////////////////////////////////////////////////

#include "AliTPCCorrection.h"
#include "TVectorD.h"

class TCollection;
class TTimeStamp;

class AliTPCComposedCorrection : public AliTPCCorrection {
public:
  enum CompositionType {kParallel,kQueue, kQueueResidual};

  AliTPCComposedCorrection();
  AliTPCComposedCorrection(TCollection *corrections,CompositionType mode);
  virtual ~AliTPCComposedCorrection();
  virtual Bool_t AddCorrectionCompact(AliTPCCorrection* corr, Double_t weight);
  void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2);

  TCollection* GetCorrections() const {return fCorrections;}
  void SetCorrections(const TCollection *corrections) {fCorrections=(TCollection*)corrections;}
  CompositionType GetMode() const {return fMode;}
  void SetMode(CompositionType mode) {fMode=mode;}
  
  virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
  virtual void GetDistortion(const Float_t x[],const Short_t roc,Float_t dx[]);
  virtual  AliTPCCorrection * GetSubCorrection(Int_t ipos);
  virtual  AliTPCCorrection * GetSubCorrection(const char * cname);

  virtual void Print(Option_t* option="") const;

  // initialization and update functions
  virtual void Init();
  virtual void Update(const TTimeStamp &timeStamp);
  void SetWeights(TVectorD * weights){fWeights= (TVectorD*) weights->Clone();}
  const  TVectorD * GetWeights() const {return fWeights;}

private:
  TCollection *fCorrections; // The corrections this one is composed of.
  CompositionType fMode;     // The way to apply the corrections (see general class documentation)
  TVectorD        *fWeights;  // optional vector with weights - used for fit benchmarking
  AliTPCComposedCorrection & operator = (const AliTPCComposedCorrection &); // dummy assignment operator
  AliTPCComposedCorrection(const AliTPCComposedCorrection&); //dummy copy contructor

  ClassDef(AliTPCComposedCorrection,2);
};


#endif
 AliTPCComposedCorrection.h:1
 AliTPCComposedCorrection.h:2
 AliTPCComposedCorrection.h:3
 AliTPCComposedCorrection.h:4
 AliTPCComposedCorrection.h:5
 AliTPCComposedCorrection.h:6
 AliTPCComposedCorrection.h:7
 AliTPCComposedCorrection.h:8
 AliTPCComposedCorrection.h:9
 AliTPCComposedCorrection.h:10
 AliTPCComposedCorrection.h:11
 AliTPCComposedCorrection.h:12
 AliTPCComposedCorrection.h:13
 AliTPCComposedCorrection.h:14
 AliTPCComposedCorrection.h:15
 AliTPCComposedCorrection.h:16
 AliTPCComposedCorrection.h:17
 AliTPCComposedCorrection.h:18
 AliTPCComposedCorrection.h:19
 AliTPCComposedCorrection.h:20
 AliTPCComposedCorrection.h:21
 AliTPCComposedCorrection.h:22
 AliTPCComposedCorrection.h:23
 AliTPCComposedCorrection.h:24
 AliTPCComposedCorrection.h:25
 AliTPCComposedCorrection.h:26
 AliTPCComposedCorrection.h:27
 AliTPCComposedCorrection.h:28
 AliTPCComposedCorrection.h:29
 AliTPCComposedCorrection.h:30
 AliTPCComposedCorrection.h:31
 AliTPCComposedCorrection.h:32
 AliTPCComposedCorrection.h:33
 AliTPCComposedCorrection.h:34
 AliTPCComposedCorrection.h:35
 AliTPCComposedCorrection.h:36
 AliTPCComposedCorrection.h:37
 AliTPCComposedCorrection.h:38
 AliTPCComposedCorrection.h:39
 AliTPCComposedCorrection.h:40
 AliTPCComposedCorrection.h:41
 AliTPCComposedCorrection.h:42
 AliTPCComposedCorrection.h:43
 AliTPCComposedCorrection.h:44
 AliTPCComposedCorrection.h:45
 AliTPCComposedCorrection.h:46
 AliTPCComposedCorrection.h:47
 AliTPCComposedCorrection.h:48
 AliTPCComposedCorrection.h:49
 AliTPCComposedCorrection.h:50
 AliTPCComposedCorrection.h:51
 AliTPCComposedCorrection.h:52
 AliTPCComposedCorrection.h:53
 AliTPCComposedCorrection.h:54
 AliTPCComposedCorrection.h:55
 AliTPCComposedCorrection.h:56
 AliTPCComposedCorrection.h:57
 AliTPCComposedCorrection.h:58
 AliTPCComposedCorrection.h:59
 AliTPCComposedCorrection.h:60
 AliTPCComposedCorrection.h:61
 AliTPCComposedCorrection.h:62
 AliTPCComposedCorrection.h:63
 AliTPCComposedCorrection.h:64
 AliTPCComposedCorrection.h:65
 AliTPCComposedCorrection.h:66
 AliTPCComposedCorrection.h:67
 AliTPCComposedCorrection.h:68
 AliTPCComposedCorrection.h:69
 AliTPCComposedCorrection.h:70
 AliTPCComposedCorrection.h:71
 AliTPCComposedCorrection.h:72
 AliTPCComposedCorrection.h:73
 AliTPCComposedCorrection.h:74