ROOT logo
#ifndef ALITPCTENDERSUPPLY_H
#define ALITPCTENDERSUPPLY_H

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

////////////////////////////////////////////////////////////////////////
//                                                                    //
//  TPC tender, reapply pid on the fly                                //
//                                                                    //
////////////////////////////////////////////////////////////////////////

#include <TString.h>

#include <AliTenderSupply.h>

class TObjArray;
class AliESDpid;
class AliSplineFit;
class AliGRPObject;
class TGraphErrors;
class AliAnalysisManager;
class TF1;

class AliTPCTenderSupply: public AliTenderSupply {
  
public:
  AliTPCTenderSupply();
  AliTPCTenderSupply(const char *name, const AliTender *tender=NULL);
  
  virtual ~AliTPCTenderSupply(){;}

  void SetGainCorrection(Bool_t gainCorr) {fGainCorrection=gainCorr;}
  void SetAttachmentCorrection(Bool_t attCorr) {fAttachmentCorrection=attCorr;}
  void SetDebugLevel(Int_t level)         {fDebugLevel=level;}
  void SetMip(Double_t mip)               {fMip=mip;}
  void SetResponseFunctions(TObjArray *arr) {fArrPidResponseMaster=arr;}
  Double_t GetMultiplicityCorrectionMean(Double_t tpcMulti);
  Double_t GetMultiplicityCorrectionSigma(Double_t tpcMulti);

  void AddSpecificStorage(const char* cdbPath, const char* storage);

  virtual void              Init();
  virtual void              ProcessEvent();
  
private:
  AliESDpid          *fESDpid;         //! ESD pid object
  AliSplineFit       *fGainNew;        //! New gain correction
  AliSplineFit       *fGainOld;        //! Old gain correction
  TGraphErrors       *fGainAttachment; //! new attachment correction

  Bool_t fIsMC;                      //! if or not we have MC analysis
  Bool_t fGainCorrection;            //  Perform gain correction
  Bool_t fAttachmentCorrection;      //  Perform attachment correction
  Bool_t fPcorrection;               //!Perform pressure correction
  Bool_t fMultiCorrection;           //!Perform multiplicity correction
  TObjArray *fArrPidResponseMaster;  //array with gain curves
  TF1 *fMultiCorrMean;               //!multiplicity correction for mean
  TF1 *fMultiCorrSigma;              //!multiplicity correction for resolution
  TObjArray *fSpecificStorages;      //array with specific storages
  
  Int_t fDebugLevel;                 //debug level
  Double_t fMip;                     //mip position
  
  AliGRPObject *fGRP;                //!GRP for pressure temperature correction

  TString fBeamType;                 //! beam type (PP) or (PBPB)
  TString fLHCperiod;                //! LHC period
  TString fMCperiod;                 //! corresponding MC period to use for the splines
  Int_t   fRecoPass;                 //! reconstruction pass

  void SetSplines();
  Double_t GetGainCorrection();

  Double_t GetTPCMultiplicityBin();

  void SetBeamType();
  
  void SetParametrisation();
  void SetRecoInfo();
  
  AliTPCTenderSupply(const AliTPCTenderSupply&c);
  AliTPCTenderSupply& operator= (const AliTPCTenderSupply&c);
  
  ClassDef(AliTPCTenderSupply, 2);  // TPC tender task
};


#endif

 AliTPCTenderSupply.h:1
 AliTPCTenderSupply.h:2
 AliTPCTenderSupply.h:3
 AliTPCTenderSupply.h:4
 AliTPCTenderSupply.h:5
 AliTPCTenderSupply.h:6
 AliTPCTenderSupply.h:7
 AliTPCTenderSupply.h:8
 AliTPCTenderSupply.h:9
 AliTPCTenderSupply.h:10
 AliTPCTenderSupply.h:11
 AliTPCTenderSupply.h:12
 AliTPCTenderSupply.h:13
 AliTPCTenderSupply.h:14
 AliTPCTenderSupply.h:15
 AliTPCTenderSupply.h:16
 AliTPCTenderSupply.h:17
 AliTPCTenderSupply.h:18
 AliTPCTenderSupply.h:19
 AliTPCTenderSupply.h:20
 AliTPCTenderSupply.h:21
 AliTPCTenderSupply.h:22
 AliTPCTenderSupply.h:23
 AliTPCTenderSupply.h:24
 AliTPCTenderSupply.h:25
 AliTPCTenderSupply.h:26
 AliTPCTenderSupply.h:27
 AliTPCTenderSupply.h:28
 AliTPCTenderSupply.h:29
 AliTPCTenderSupply.h:30
 AliTPCTenderSupply.h:31
 AliTPCTenderSupply.h:32
 AliTPCTenderSupply.h:33
 AliTPCTenderSupply.h:34
 AliTPCTenderSupply.h:35
 AliTPCTenderSupply.h:36
 AliTPCTenderSupply.h:37
 AliTPCTenderSupply.h:38
 AliTPCTenderSupply.h:39
 AliTPCTenderSupply.h:40
 AliTPCTenderSupply.h:41
 AliTPCTenderSupply.h:42
 AliTPCTenderSupply.h:43
 AliTPCTenderSupply.h:44
 AliTPCTenderSupply.h:45
 AliTPCTenderSupply.h:46
 AliTPCTenderSupply.h:47
 AliTPCTenderSupply.h:48
 AliTPCTenderSupply.h:49
 AliTPCTenderSupply.h:50
 AliTPCTenderSupply.h:51
 AliTPCTenderSupply.h:52
 AliTPCTenderSupply.h:53
 AliTPCTenderSupply.h:54
 AliTPCTenderSupply.h:55
 AliTPCTenderSupply.h:56
 AliTPCTenderSupply.h:57
 AliTPCTenderSupply.h:58
 AliTPCTenderSupply.h:59
 AliTPCTenderSupply.h:60
 AliTPCTenderSupply.h:61
 AliTPCTenderSupply.h:62
 AliTPCTenderSupply.h:63
 AliTPCTenderSupply.h:64
 AliTPCTenderSupply.h:65
 AliTPCTenderSupply.h:66
 AliTPCTenderSupply.h:67
 AliTPCTenderSupply.h:68
 AliTPCTenderSupply.h:69
 AliTPCTenderSupply.h:70
 AliTPCTenderSupply.h:71
 AliTPCTenderSupply.h:72
 AliTPCTenderSupply.h:73
 AliTPCTenderSupply.h:74
 AliTPCTenderSupply.h:75
 AliTPCTenderSupply.h:76
 AliTPCTenderSupply.h:77
 AliTPCTenderSupply.h:78
 AliTPCTenderSupply.h:79
 AliTPCTenderSupply.h:80
 AliTPCTenderSupply.h:81
 AliTPCTenderSupply.h:82
 AliTPCTenderSupply.h:83
 AliTPCTenderSupply.h:84
 AliTPCTenderSupply.h:85
 AliTPCTenderSupply.h:86
 AliTPCTenderSupply.h:87
 AliTPCTenderSupply.h:88
 AliTPCTenderSupply.h:89
 AliTPCTenderSupply.h:90