ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/
//
// Static function member which can be used in standalone cases
// especially as utils for AliTPCCosmicTrackfit
//
// detailed description can be found inside individual function
//
// grep "exitreport" in output log to check abnormal termination
//
//  Xianguo Lu 
//  lu@physi.uni-heidelberg.de
//  Xianguo.Lu@cern.ch
//

#ifndef ALITPCCOSMICUTILS_H
#define ALITPCCOSMICUTILS_H

class TVector3;

class AliESDfriend;

class AliTPCCosmicUtils
{
 public:
  enum{
    k0OB0=1,
    k0OB1=2,
    k0HWU=4,
    kTRDCO2=8,
    kAMU=16,
    kSCO=32
  };
  
  static Double_t GetMinPhi(const AliExternalTrackParam *params[]);
  static Int_t GetBField(const AliESDEvent *esd);
  static Int_t GetTrigger(const AliESDEvent *esd);
  static AliTPCseed * GetTPCseed(const AliESDtrack *esdtrack);
  static Bool_t GetESD(AliESDEvent *& esdevent, AliESDfriend *& esdfriend);
  //===========================

  static AliExternalTrackParam *MakeSeed(const AliTPCseed *tseed);

  static void SingleFit(AliExternalTrackParam * trackInOld, AliExternalTrackParam * trackOutOld, const AliTPCseed *tseed, const Bool_t kinward, const Int_t rowstartshift, const Int_t rowstep, const Double_t xmin, const Double_t xmax, Int_t &nfit, Int_t &nmiss, Double_t &pchi2, Double_t &lfit, TTreeSRedirector *debugstreamer=0x0);

  static void CombinedFit(AliExternalTrackParam *trackPars[],  const AliTPCseed *seeds[],  const Int_t rowstartshift, const Int_t rowstep, const Double_t xmin, const Double_t xmax, Int_t &nfit, Int_t &nmiss, Double_t &pchi2, Double_t &lfit, Double_t &vtxD, Double_t &vtxZ, TTreeSRedirector *debugstreamer=0x0);

  static void DrawTracks(AliESDtrack *esdtrks[], const TString tag, const TString outputformat="png");
  static void DrawSeeds(const AliTPCseed * seeds[], const TString tag, const TString outputformat="png");
  static void PrintTrackParam(const Int_t id, const AliExternalTrackParam * trackpar, const char *tag="");
  static Bool_t RotateSafe(AliExternalTrackParam *trackPar, const Double_t aa);
  static Double_t AngleInRange(Double_t phi);
  static Double_t Point2LineDist(const TVector3 p0, const TVector3 l1, const TVector3 l2, TVector3 *vtx = 0x0);

  static Int_t NRow(){ return 159;}           //number of pad rows
  static Int_t NclsMin(){ return 40;}         //minimum requirement of number of TPC cluster
  static Double_t Mass(){ return 0.105658;}   //muon mass

  //---------------------------

 private:

  static Int_t XMin(){ return 80;}            //minimum x (tracking system) to use in propagation
  static Int_t Niter(){ return 2;}            //number of iteration in SingleFit and CombinedFit, 1 is not enough, 3 is the same as 2

  static void IniCov(AliExternalTrackParam *trackPar, const Double_t ncl);
  static void SubCombined(AliExternalTrackParam *trackPar, const AliTPCseed *seeds[], const Int_t tk0, const Int_t tk1, const Int_t rowstartshift, const Int_t rowstep, const Double_t xmin, const Double_t xmax, const Double_t eloss, Int_t &nfit, Int_t &nmiss, Double_t &pchi2, Double_t &lfit, Double_t &vtxD, Double_t &vtxZ, TTreeSRedirector *debugstreamer=0x0);

  static void FitKernel(AliExternalTrackParam *trackPar, const AliTPCseed *tseed, const Int_t rowstart, const Int_t rowstop, const Int_t drow, const Double_t xmin, const Double_t xmax, const Double_t eloss, Int_t &ksite, Int_t &nfit, Int_t &nmiss, Double_t &pchi2, TVector3 &gposStart, TVector3 &gposStop, TTreeSRedirector *debugstreamer, const Bool_t kinicov);
};

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