<commit_before>#ifndef ALIESDTRACK_H
#define ALIESDTRACK_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/* $Id$ */

//-------------------------------------------------------------------------
//                          Class AliESDtrack
//   This is the class to deal with during the physics analysis of data
//      
//         Origin: <NAME>, CERN, <EMAIL> 
//-------------------------------------------------------------------------
/*****************************************************************************
 *  Use GetExternalParameters() and GetExternalCovariance() to access the    *
 *      track information regardless of its internal representation.         *
 * This formation is now fixed in the following way:                         *
 *      external param0:   local Y-coordinate of a track (cm)                *
 *      external param1:   local Z-coordinate of a track (cm)                *
 *      external param2:   local sine of the track momentum azimuthal angle  *
 *      external param3:   tangent of the track momentum dip angle           *
 *      external param4:   1/pt (1/(GeV/c))                                  *
 *                                                                           *
 * The Get*Label() getters return the label of the associated MC particle.   *
 * The absolute value of this label is the index of the particle within the  *
 * MC stack. If the label is negative, this track was assigned a certain     *
 * number of clusters that did not in fact belong to this track.             *
 *****************************************************************************/

#include <TBits.h>
#include "AliExternalTrackParam.h"
#include "AliVTrack.h"
#include "AliPID.h"
#include "AliESDfriendTrack.h"

class TParticle;
class AliESDVertex;
class AliESDEvent;
class AliKalmanTrack;
class AliTrackPointArray;
class TPolyMarker3D;

class AliESDtrack : public AliExternalTrackParam {
public:
  enum {
    kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
    kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
    kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
    kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
    kTOFmismatch=0x100000,
    kHMPIDout=0x10000,kHMPIDpid=0x20000,
    kEMCALmatch=0x40000,
    kPHOSmatch=0x200000,
    kTRDbackup =0x80000,
    kTRDStop=0x20000000,
    kESDpid=0x40000000,
    kTIME=0x80000000,
    kGlobalMerge=0x08000000,
    kITSpureSA=0x10000000,
    kMultInV0 =0x2000000,    //BIT(25): assumed to be belong to V0 in multiplicity estimates
    kMultSec  =0x4000000,     //BIT(26): assumed to be secondary (due to the DCA) in multiplicity estimates
    kEmbedded =0x8000000     // BIT(27), 1<<27: Is a track that has been embedded into the event      
  }; 
  enum {
    kTRDnPlanes = 6,
    kEMCALNoMatch = -4096
  };
  AliESDtrack();
  AliESDtrack(const AliESDtrack& track);
  AliESDtrack(const AliVTrack* track);
  AliESDtrack(TParticle * part);
  virtual ~AliESDtrack();
  virtual void Copy(TObject &obj) const;
  const AliESDfriendTrack *GetFriendTrack() const {return fFriendTrack;}
  void SetFriendTrack(const AliESDfriendTrack *t) {
    delete fFriendTrack; fFriendTrack=new AliESDfriendTrack(*t);
  }
  void ReleaseESDfriendTrack() { delete fFriendTrack;  fFriendTrack=0; }
  void AddCalibObject(TObject * object);     // add calib object to the list
  TObject *  GetCalibObject(Int_t index);    // return calib objct at given position
  void MakeMiniESDtrack();
  void SetID(Short_t id) { fID =id;}
  Int_t GetID() const { return fID;}
  void SetVertexID(Char_t id) { fVertexID=id;}
  Char_t GetVertexID() const { return fVertexID;}
  void SetStatus(ULong_t flags) {fFlags|=flags;}
  void ResetStatus(ULong_t flags) {fFlags&=~flags;}
  Bool_t UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags);
  void SetIntegratedLength(Double_t l) {fTrackLength=l;}
  void SetIntegratedTimes(const Double_t *times);
  void SetESDpid(const Double_t *p);
  void GetESDpid(Double_t *p) const;
  virtual const Double_t *PID() const { return fR; }

  Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
  ULong_t GetStatus() const {return fFlags;}
  Int_t GetLabel() const {return fLabel;}
  void SetLabel(Int_t label) {fLabel = label;}

  void GetExternalParameters(Double_t &x, Double_t p[5]) const;
  void GetExternalCovariance(Double_t cov[15]) const;

  Double_t GetIntegratedLength() const {return fTrackLength;}
  void GetIntegratedTimes(Double_t *times) const;
  Double_t GetMass() const;
  Double_t M() const;
  Double_t E() const;
  Double_t Y() const;

  Bool_t GetConstrainedPxPyPz(Double_t *p) const {
    if (!fCp) return kFALSE;
    return fCp->GetPxPyPz(p);
  }
  Bool_t GetConstrainedXYZ(Double_t *r) const {
    if (!fCp) return kFALSE;
    return fCp->GetXYZ(r);
  }
  const AliExternalTrackParam *GetConstrainedParam() const {return fCp;}
  Bool_t GetConstrainedExternalParameters
              (Double_t &alpha, Double_t &x, Double_t p[5]) const;
  Bool_t GetConstrainedExternalCovariance(Double_t cov[15]) const;
  Double_t GetConstrainedChi2() const {return fCchi2;}
  //
  
  // global track chi2
  void SetGlobalChi2(Double_t chi2) {fGlobalChi2 = chi2;}
  Double_t GetGlobalChi2() const {return fGlobalChi2;}

  Bool_t GetInnerPxPyPz(Double_t *p) const {
    if (!fIp) return kFALSE;
    return fIp->GetPxPyPz(p);
  }
  const AliExternalTrackParam * GetInnerParam() const { return fIp;}
  const AliExternalTrackParam * GetTPCInnerParam() const {return fTPCInner;}
  Bool_t FillTPCOnlyTrack(AliESDtrack &track);
  Bool_t GetInnerXYZ(Double_t *r) const {
    if (!fIp) return kFALSE;
    return fIp->GetXYZ(r);
  }
  Bool_t GetInnerExternalParameters
        (Double_t &alpha, Double_t &x, Double_t p[5]) const;
  Bool_t GetInnerExternalCovariance(Double_t cov[15]) const;
 
  void SetOuterParam(const AliExternalTrackParam *p, ULong_t flags);

  void SetOuterHmpParam(const AliExternalTrackParam *p, ULong_t flags);

  const AliExternalTrackParam * GetOuterParam() const { return fOp;}

  const AliExternalTrackParam * GetOuterHmpParam() const { return fHMPIDp;}
  
  Bool_t GetOuterPxPyPz(Double_t *p) const {
    if (!fOp) return kFALSE;
    return fOp->GetPxPyPz(p);
  }
  Bool_t GetOuterHmpPxPyPz(Double_t *p) const {
    if (!fHMPIDp) return kFALSE;
    return fHMPIDp->GetPxPyPz(p);
  }
  
  Bool_t GetOuterXYZ(Double_t *r) const {
    if (!fOp) return kFALSE;
    return fOp->GetXYZ(r);
  }
    Bool_t GetOuterHmpXYZ(Double_t *r) const {
    if (!fHMPIDp) return kFALSE;
    return fHMPIDp->GetXYZ(r);
  }

  Bool_t GetOuterExternalParameters
        (Double_t &alpha, Double_t &x, Double_t p[5]) const;
  Bool_t GetOuterExternalCovariance(Double_t cov[15]) const;

  Bool_t GetOuterHmpExternalParameters
        (Double_t &alpha, Double_t &x, Double_t p[5]) const;
  Bool_t GetOuterHmpExternalCovariance(Double_t cov[15]) const;

  
  Int_t GetNcls(Int_t idet) const;
  Int_t GetClusters(Int_t idet, Int_t *idx) const;
 
  void    SetITSpid(const Double_t *p);
  void    GetITSpid(Double_t *p) const;

  Double_t GetITSsignal() const {return fITSsignal;}
  void    SetITSdEdxSamples(const Double_t s[4]);
  void    GetITSdEdxSamples(Double_t *s) const;

  Double_t GetITSchi2() const {return fITSchi2;}
  Char_t   GetITSclusters(Int_t *idx) const;
  UChar_t GetITSClusterMap() const {return fITSClusterMap;}
  UChar_t GetITSSharedMap() const {return fITSSharedMap;}
  void    SetITSSharedMap(UChar_t map) {fITSSharedMap=map;}
  void    SetITSModuleIndex(Int_t ilayer,Int_t idx) {fITSModule[ilayer]=idx;}
  Int_t   GetITSModuleIndex(Int_t ilayer) const {return fITSModule[ilayer];}
  Bool_t  GetITSModuleIndexInfo(Int_t ilayer,Int_t &idet,Int_t &status,
				Float_t &xloc,Float_t &zloc) const;<commit_msg>Added getter/setter for ITS fake flag<commit_after>#ifndef ALIESDTRACK_H
#define ALIESDTRACK_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/* $Id$ */

//-------------------------------------------------------------------------
//                          Class AliESDtrack
//   This is the class to deal with during the physics analysis of data
//      
//         Origin: <NAME>, CERN, <EMAIL> 
//-------------------------------------------------------------------------
/*****************************************************************************
 *  Use GetExternalParameters() and GetExternalCovariance() to access the    *
 *      track information regardless of its internal representation.         *
 * This formation is now fixed in the following way:                         *
 *      external param0:   local Y-coordinate of a track (cm)                *
 *      external param1:   local Z-coordinate of a track (cm)                *
 *      external param2:   local sine of the track momentum azimuthal angle  *
 *      external param3:   tangent of the track momentum dip angle           *
 *      external param4:   1/pt (1/(GeV/c))                                  *
 *                                                                           *
 * The Get*Label() getters return the label of the associated MC particle.   *
 * The absolute value of this label is the index of the particle within the  *
 * MC stack. If the label is negative, this track was assigned a certain     *
 * number of clusters that did not in fact belong to this track.             *
 *****************************************************************************/

#include <TBits.h>
#include "AliExternalTrackParam.h"
#include "AliVTrack.h"
#include "AliPID.h"
#include "AliESDfriendTrack.h"

class TParticle;
class AliESDVertex;
class AliESDEvent;
class AliKalmanTrack;
class AliTrackPointArray;
class TPolyMarker3D;

class AliESDtrack : public AliExternalTrackParam {
public:
  enum {
    kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
    kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
    kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
    kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
    kTOFmismatch=0x100000,
    kHMPIDout=0x10000,kHMPIDpid=0x20000,
    kEMCALmatch=0x40000,
    kPHOSmatch=0x200000,
    kTRDbackup =0x80000,
    kTRDStop=0x20000000,
    kESDpid=0x40000000,
    kTIME=0x80000000,
    kGlobalMerge=0x08000000,
    kITSpureSA=0x10000000,
    kMultInV0 =0x2000000,    //BIT(25): assumed to be belong to V0 in multiplicity estimates
    kMultSec  =0x4000000,     //BIT(26): assumed to be secondary (due to the DCA) in multiplicity estimates
    kEmbedded =0x8000000     // BIT(27), 1<<27: Is a track that has been embedded into the event      
  }; 
  enum {
    kTRDnPlanes = 6,
    kEMCALNoMatch = -4096
  };
  AliESDtrack();
  AliESDtrack(const AliESDtrack& track);
  AliESDtrack(const AliVTrack* track);
  AliESDtrack(TParticle * part);
  virtual ~AliESDtrack();
  virtual void Copy(TObject &obj) const;
  const AliESDfriendTrack *GetFriendTrack() const {return fFriendTrack;}
  void SetFriendTrack(const AliESDfriendTrack *t) {
    delete fFriendTrack; fFriendTrack=new AliESDfriendTrack(*t);
  }
  void ReleaseESDfriendTrack() { delete fFriendTrack;  fFriendTrack=0; }
  void AddCalibObject(TObject * object);     // add calib object to the list
  TObject *  GetCalibObject(Int_t index);    // return calib objct at given position
  void MakeMiniESDtrack();
  void SetID(Short_t id) { fID =id;}
  Int_t GetID() const { return fID;}
  void SetVertexID(Char_t id) { fVertexID=id;}
  Char_t GetVertexID() const { return fVertexID;}
  void SetStatus(ULong_t flags) {fFlags|=flags;}
  void ResetStatus(ULong_t flags) {fFlags&=~flags;}
  Bool_t UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags);
  void SetIntegratedLength(Double_t l) {fTrackLength=l;}
  void SetIntegratedTimes(const Double_t *times);
  void SetESDpid(const Double_t *p);
  void GetESDpid(Double_t *p) const;
  virtual const Double_t *PID() const { return fR; }

  Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
  ULong_t GetStatus() const {return fFlags;}
  Int_t GetLabel() const {return fLabel;}
  void SetLabel(Int_t label) {fLabel = label;}

  void GetExternalParameters(Double_t &x, Double_t p[5]) const;
  void GetExternalCovariance(Double_t cov[15]) const;

  Double_t GetIntegratedLength() const {return fTrackLength;}
  void GetIntegratedTimes(Double_t *times) const;
  Double_t GetMass() const;
  Double_t M() const;
  Double_t E() const;
  Double_t Y() const;

  Bool_t GetConstrainedPxPyPz(Double_t *p) const {
    if (!fCp) return kFALSE;
    return fCp->GetPxPyPz(p);
  }
  Bool_t GetConstrainedXYZ(Double_t *r) const {
    if (!fCp) return kFALSE;
    return fCp->GetXYZ(r);
  }
  const AliExternalTrackParam *GetConstrainedParam() const {return fCp;}
  Bool_t GetConstrainedExternalParameters
              (Double_t &alpha, Double_t &x, Double_t p[5]) const;
  Bool_t GetConstrainedExternalCovariance(Double_t cov[15]) const;
  Double_t GetConstrainedChi2() const {return fCchi2;}
  //
  
  // global track chi2
  void SetGlobalChi2(Double_t chi2) {fGlobalChi2 = chi2;}
  Double_t GetGlobalChi2() const {return fGlobalChi2;}

  Bool_t GetInnerPxPyPz(Double_t *p) const {
    if (!fIp) return kFALSE;
    return fIp->GetPxPyPz(p);
  }
  const AliExternalTrackParam * GetInnerParam() const { return fIp;}
  const AliExternalTrackParam * GetTPCInnerParam() const {return fTPCInner;}
  Bool_t FillTPCOnlyTrack(AliESDtrack &track);
  Bool_t GetInnerXYZ(Double_t *r) const {
    if (!fIp) return kFALSE;
    return fIp->GetXYZ(r);
  }
  Bool_t GetInnerExternalParameters
        (Double_t &alpha, Double_t &x, Double_t p[5]) const;
  Bool_t GetInnerExternalCovariance(Double_t cov[15]) const;
 
  void SetOuterParam(const AliExternalTrackParam *p, ULong_t flags);

  void SetOuterHmpParam(const AliExternalTrackParam *p, ULong_t flags);

  const AliExternalTrackParam * GetOuterParam() const { return fOp;}

  const AliExternalTrackParam * GetOuterHmpParam() const { return fHMPIDp;}
  
  Bool_t GetOuterPxPyPz(Double_t *p) const {
    if (!fOp) return kFALSE;
    return fOp->GetPxPyPz(p);
  }
  Bool_t GetOuterHmpPxPyPz(Double_t *p) const {
    if (!fHMPIDp) return kFALSE;
    return fHMPIDp->GetPxPyPz(p);
  }
  
  Bool_t GetOuterXYZ(Double_t *r) const {
    if (!fOp) return kFALSE;
    return fOp->GetXYZ(r);
  }
    Bool_t GetOuterHmpXYZ(Double_t *r) const {
    if (!fHMPIDp) return kFALSE;
    return fHMPIDp->GetXYZ(r);
  }

  Bool_t GetOuterExternalParameters
        (Double_t &alpha, Double_t &x, Double_t p[5]) const;
  Bool_t GetOuterExternalCovariance(Double_t cov[15]) const;

  Bool_t GetOuterHmpExternalParameters
        (Double_t &alpha, Double_t &x, Double_t p[5]) const;
  Bool_t GetOuterHmpExternalCovariance(Double_t cov[15]) const;

  
  Int_t GetNcls(Int_t idet) const;
  Int_t GetClusters(Int_t idet, Int_t *idx) const;
 
  void    SetITSpid(const Double_t *p);
  void    GetITSpid(Double_t *p) const;

  Double_t GetITSsignal() const {return fITSsignal;}
  void    SetITSdEdxSamples(const Double_t s[4]);
  void    GetITSdEdxSamples(Double_t *s) const;

  Double_t GetITSchi2() const {return fITSchi2;}
  Char_t   GetITSclusters(Int_t *idx) const;
  UChar_t GetITSClusterMap() const {return fITSClusterMap;}
  UChar_t GetITSSharedMap() const {return fITSSharedMap;}
  void    SetITSSharedFlag(int lr) {fITSSharedMap |= 0x1<<lr;}
  Bool_t  GetITSFakeFlag()   const {return (fITSSharedMap&BIT(7))!=0;}
  void    SetITSFakeFlag(Bool_t v=kTRUE)  {if (v) fITSSharedMap|=BIT(7); else fITSSharedMap&=~BIT(7);}  
  void    SetITSSharedMap(UChar_t map) {fITSSharedMap=map;}
  void    SetITSModuleIndex(Int_t ilayer,Int_t idx) {fITSModule[ilayer]=idx;}
  Int_t   GetITSModuleIndex(Int_t ilayer) const {return fITSModule[ilayer];}
  Bool_t  GetITSModuleIndexInfo(Int_t ilayer,Int_t &idet,Int_t &status,
				Float_t &xloc,Float_t &zloc) const;
{'fraction_non_alphanumeric': 0.12968857267677714, 'fraction_numerical': 0.03132996317793172, 'mean_word_length': 3.5112612612612613, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 8, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6111961', 'n_tokens_mistral': 5946, 'n_tokens_neox': 5466, 'n_words': 1366}