1 #ifndef ALITOFTENDERSUPPLY_H
2 #define ALITOFTENDERSUPPLY_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 ////////////////////////////////////////////////////////////////////////
9 // TOF tender, reapply pid on the fly //
11 ////////////////////////////////////////////////////////////////////////
13 #include <AliTenderSupply.h>
15 #include <AliESDpid.h>
22 class AliTOFTenderSupply: public AliTenderSupply {
26 AliTOFTenderSupply(const char *name, const AliTender *tender=NULL);
28 virtual ~AliTOFTenderSupply(){;}
31 virtual void ProcessEvent();
34 void SetTOFres(Float_t res){fTOFres=res;}
35 void SetIsMC(Bool_t flag=kFALSE){fIsMC=flag;}
36 void SetCorrectExpTimes(Bool_t flag=kTRUE){fCorrectExpTimes=flag;}
37 void SetT0DetectorAdjust(Bool_t flag=kFALSE){fT0DetectorAdjust=flag;}
38 void SetDebugLevel(Int_t flag=0){fDebugLevel=flag;}
39 void SetLHC10dPatch(Bool_t flag=kFALSE){
41 AliInfo(" **** TOF Tender: special setting LHC10d patch is ON");
42 AliInfo(" **** TOF Tender: this setting is valid only on LHC10d pass2");
47 void SetAutomaticSettings(Bool_t flag=kTRUE){fAutomaticSettings=flag;}
48 void SetUserRecoPass(Int_t flag=0){fUserRecoPass=flag;}
49 Int_t GetRecoPass(void){return fRecoPass;}
50 void DetectRecoPass();
51 virtual void SetTimeZeroType(AliESDpid::EStartTimeType_t tofTimeZeroType) {fTimeZeroType = tofTimeZeroType;}
53 /* theoretical expected time: related stuff for LHC10d patch */
54 static Float_t GetBetaTh(Float_t m, Float_t p) {return TMath::Sqrt(1. / (1. + m * m / (p * p)));}; // get beta th
55 static Float_t GetExpTimeTh(Float_t m, Float_t p, Float_t L) {return L / 2.99792457999999984e-02 / GetBetaTh(m, p);}; // get exp time th
56 void RecomputeTExp(AliESDEvent *event) const;
57 void RecomputeTExp(AliESDtrack *track) const;
58 void FixTRDBug(AliESDEvent *event);
59 void FixTRDBug(AliESDtrack *track);
61 void FindTRDFix(AliESDtrack *track,Double_t *corr);
62 Double_t EstimateLengthInTRD1(AliESDtrack *track);
63 Double_t EstimateLengthInTRD2(AliESDtrack *track);
64 Double_t EstimateLengthOutTRD(AliESDtrack *track);
65 void CorrectDeltaTimes(Double_t pT, Double_t length, Bool_t isTRDout, Double_t *corrections);
66 Double_t CorrectExpectedProtonTime(Double_t pT,Double_t length, Bool_t isTRDout);
67 Double_t CorrectExpectedKaonTime(Double_t pT,Double_t length, Bool_t isTRDout);
68 Double_t CorrectExpectedPionTime(Double_t pT,Double_t length, Bool_t isTRDout);
69 Int_t GetOCDBVersion(Int_t runNumber);
72 AliESDpid *fESDpid; //! ESD pid object
75 Bool_t fIsMC; // flag for MC data
76 Int_t fTimeZeroType; // flag to select timeZero type
77 Bool_t fCorrectExpTimes; // flag to apply Expected Time correction
78 Bool_t fCorrectTRDBug; // flag to fix wrong dE/dx inside TRD
79 Bool_t fLHC10dPatch; // flag to apply special patch for LHC10d (reconstructed with wrong geometry)
80 Bool_t fT0DetectorAdjust; // flag to apply offsets to T0 data (works only on some periods)
81 Int_t fDebugLevel; // debug purposes 0= no output, 1 Info, 2 lot of info....
82 Bool_t fAutomaticSettings; // enable/disable automatic (per run) settings
83 Int_t fRecoPass; // reconstruction pass: the tender applies different recipes depending on the pass
84 Int_t fUserRecoPass; // when reco pass is selected by user
86 // variables for TOF calibrations and timeZero setup
87 AliTOFcalib *fTOFCalib; // recalibrate TOF signal with OCDB
88 AliTOFT0maker *fTOFT0maker; // computation of TOF-T0
89 Float_t fTOFres; // TOF resolution
90 Float_t fT0shift[4]; // T0 detector correction from OCDB
91 Float_t fT0IntercalibrationShift; // extra-shift to adjust TOF/TO intercalibration issue in some period
93 // variables to parametrize MC
94 static Float_t fgT0Aresolution; // T0 resolution A-Side (MC)
95 static Float_t fgT0Cresolution; // T0 resolution C-Side (MC)
97 // variables to steer TRD bug fix
98 Bool_t fGeomSet; // steer loading GRP entry
99 Bool_t fIsEnteringInTRD;
101 Bool_t fIsComingOutTRD;
103 Float_t fRhoTRDin; // cm
104 Float_t fRhoTRDout; // cm
106 Double_t fMagField; // magnetic field value [kGauss]
109 AliTOFTenderSupply(const AliTOFTenderSupply&c);
110 AliTOFTenderSupply& operator= (const AliTOFTenderSupply&c);
112 ClassDef(AliTOFTenderSupply, 8);