]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFT0v1.h
Adding PiKP-only resolution histograms and switch to turn off many histograms which...
[u/mrichter/AliRoot.git] / TOF / AliTOFT0v1.h
index 9bab4065b3449823d342e74794fea334d5652c52..11cbb1e27643a390d786381b70e60ee409597307 100644 (file)
@@ -1,60 +1,72 @@
-#ifndef AliTOFT0v1_H
-#define AliTOFT0v1_H
+#ifndef ALITOFT0V1_H
+#define ALITOFT0V1_H
 
-#include "TString.h"
-#include "AliESDEvent.h"
-#include "AliStack.h"
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//----------------------------------------------------------------------------//
+//                                                                            //
+//   Description: class to performe an event time measurment with TOF.        //
+//                                                                            //
+//----------------------------------------------------------------------------//
+
+#include "TObject.h"
+
+#include "TObjArray.h"
 
 class AliESDtrack;
-class AliTOFcalibHisto;
+class AliESDEvent;
+class AliESDpid;
+
+class TObjArray;
 
 class AliTOFT0v1: public TObject {
 public:
   
-  AliTOFT0v1(AliESDEvent*) ;
-  AliTOFT0v1(const AliTOFT0v1 & tzero);
+  AliTOFT0v1(AliESDpid *extPID=NULL); // default constructor
+  AliTOFT0v1(AliESDEvent *event,AliESDpid *extPID=NULL); // overloaded constructor
   virtual ~AliTOFT0v1() ; // dtor
  
-  void SetCalib(AliTOFcalibHisto *calib){fCalib = calib;};
-
-  const char*   GetTZeroFile() const {return fT0File.Data();}   
-  Double_t* DefineT0(Option_t *option); 
-  Double_t* DefineT0RawCorrection(Option_t *option); 
-  
-  void      SetTimeResolution(Double_t timeresolution);// timeresolution in [s] e.g. for 120 ps -> 1.2e-10
-  
-  Double_t       GetTimeResolution(){return fTimeResolution;}
-  
-  void          SetTZeroFile(char* file) ;
+  Double_t* DefineT0(Option_t *option,Float_t pMinCut=3,Float_t pMaxCut=5); 
+    
   void          SetMomBounds(Float_t pLow, Float_t pUp) { fLowerMomBound=pLow; fUpperMomBound=pUp;} // momenta are expressed in [GeV/c]
   void          SetTimeCorr(Float_t timecorr) {fTimeCorr=timecorr;} //in ns!!!
-  void          SetT0Offset(Float_t t0offset){fT0Offset=t0offset;} //in ns!!!
-  void          SetLOffset(Float_t loffset){fT0Offset=loffset;}  //in m!!!
-  Float_t       GetMomError(Int_t index, Float_t mom, Float_t texp);
-  void  Print(Option_t* option) const ;
-  Bool_t   operator == (const AliTOFT0v1 & tzero) const ;
+  Float_t       GetMomError(Int_t index, Float_t mom, Float_t texp) const;
+  Double_t GetResult(Int_t i){if(i < 6) return fT0SigmaT0def[i]; else return -1.;};
+/*   void  Print(Option_t* option) const ; */
+
+  void   SetTimeResolution(Float_t /* timeres */){}; // obsolete
+  void SetOptimization(Bool_t flag=kFALSE){fOptFlag=flag;};
+  void Init(AliESDEvent *event); // init
 
  private:
 
-  Bool_t AcceptTrack(AliESDtrack *track); /* accept track */
-  Float_t GetSigmaToVertex(AliESDtrack *track); /* get sigma to vertex */
+  Float_t ToCalculatePower(Float_t base, Int_t exponent) const ;
+  Int_t   ToCalculatePower(Int_t base, Int_t exponent) const ;
 
-  AliTOFcalibHisto *fCalib;
+  AliTOFT0v1(const AliTOFT0v1 &);
+  AliTOFT0v1 & operator=(const AliTOFT0v1 &) ;
+
+  Bool_t AcceptTrack(AliESDtrack *track); /* accept track */
+  Float_t GetSigmaToVertex(AliESDtrack *track) const; /* get sigma to vertex */
+  Bool_t CheckTPCMatching(AliESDtrack *track,Int_t imass) const;
 
-  Double_t fTimeResolution;  // global time resolution used to calculate T0
-  Float_t fTimeCorr;  // global time resolution used to calculate T0
   Float_t fLowerMomBound;   // momentum lower bound for selected primary tracks   
-  Float_t fT0Offset;
-  Float_t fLOffset;
   Float_t fUpperMomBound;   // momentum upper bound for selected primary tracks 
-  Float_t fDeltaTfromMisallinement;
-
-  Double_t fT0SigmaT0def[4];
+  Float_t fTimeCorr;  // global time resolution used to calculate T0
   AliESDEvent* fEvent;      //evento per il quale si vuole calcolare il T0
-  //AliStack* fStack;         //stack associata all'evento fEvent
-  TString fT0File ;         // output file; it contains for time being only 3 histos 
+  Double_t fT0SigmaT0def[6]; // array with the event information ([0]=event time -- [1] = sigma -- [2] = tracks on the TOF -- [3] = tracks used for the event time)
+
+  Int_t fLookupPowerThree[15]; //! lookup table for power 3 to speed up the code
   
-  ClassDef(AliTOFT0v1,1);  // Calculate the time zero using TOF detector */
+  AliESDpid *fPIDesd; // class with the detector response
+
+  TObjArray *fTracks;   //! array of tracks
+  TObjArray *fGTracks;  //! array of good tracks
+  TObjArray *fTracksT0; //! array of tracks usefull for T0 estimate
+  Bool_t fOptFlag;    // use optimized code
+
+  ClassDef(AliTOFT0v1,5);  // Calculate the time zero using TOF detector */
   
 };