<commit_before>/**************************************************************************
 * 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.                  *
 **************************************************************************/
//-----------------------------------------------------------------
//           Implementation of the ESD track class
//   ESD = Event Summary Data
//   This is the class to deal with during the phisical analysis of data
//      Origin: <NAME>, CERN
//      e-mail: <EMAIL>
//-----------------------------------------------------------------

#include "TMath.h"
#include "TString.h"

#include "AliESDtrack.h"
#include "AliKalmanTrack.h"

ClassImp(AliESDtrack)

//_______________________________________________________________________
AliESDtrack::AliESDtrack() : 
fFlags(0),
fLabel(0),
fTrackLength(0),
fStopVertex(0),
fRalpha(0),
fRx(0),
fCalpha(0),
fCx(0),
fCchi2(1e10),
fIalpha(0),
fIx(0),
fTalpha(0),
fTx(0),
fOalpha(0),
fOx(0),
fITSchi2(0),
fITSncls(0),
fITSsignal(0),
fTPCchi2(0),
fTPCncls(0),
fTPCClusterMap(159),//number of padrows
fTPCsignal(0),
fTRDchi2(0),
fTRDncls(0),
fTRDncls0(0),
fTRDsignal(0),
fTOFchi2(0),
fTOFindex(0),
fTOFsignal(-1),
fPHOSsignal(-1),
fEMCALsignal(-1),
fRICHsignal(-1)
{
  //
  // The default ESD constructor 
  //
  for (Int_t i=0; i<kSPECIES; i++) {
    fTrackTime[i]=0.;
    fR[i]=1.;
    fITSr[i]=1.;
    fTPCr[i]=1.;
    fTRDr[i]=1.;
    fTOFr[i]=1.;
    fRICHr[i]=1.;
  }
  
  for (Int_t i=0; i<kSPECIESN; i++) {
    fPHOSr[i]  = 1.;
    fEMCALr[i] = 1.;
  }

 
  fPHOSpos[0]=fPHOSpos[1]=fPHOSpos[2]=0.;
  fEMCALpos[0]=fEMCALpos[1]=fEMCALpos[2]=0.;
  Int_t i;
  for (i=0; i<5; i++)  { fRp[i]=0.; fCp[i]=0.; fIp[i]=0.; fOp[i]=0.; fTp[i]=0.;}
  for (i=0; i<15; i++) { fRc[i]=0.; fCc[i]=0.; fIc[i]=0.; fOc[i]=0.; fTc[i]=0.;  }
  for (i=0; i<6; i++)  { fITSindex[i]=0; }
  for (i=0; i<180; i++){ fTPCindex[i]=0; }
  for (i=0; i<130; i++) { fTRDindex[i]=0; }
  fTPCLabel = 0;
  fTRDLabel = 0;
  fITSLabel = 0;
  fITStrack = 0;
  fTRDtrack = 0;  
}

//_______________________________________________________________________

AliESDtrack::AliESDtrack(const AliESDtrack& track):TObject(track){
  //
  //copy constructor
  //
  fFlags = track.fFlags;
  fLabel =track.fLabel;
  fTrackLength =track.fTrackLength;
  for (Int_t i=0;i<kSPECIES;i++) fTrackTime[i] =track.fTrackTime[i];
  for (Int_t i=0;i<kSPECIES;i++)  fR[i] =track.fR[i];
  fStopVertex =track.fStopVertex;
  //
  fRalpha =track.fRalpha;
  fRx =track.fRx;
  for (Int_t i=0;i<5;i++) fRp[i] =track.fRp[i];
  for (Int_t i=0;i<15;i++) fRc[i] =track.fRc[i];
  //
  fCalpha =track.fCalpha;
  fCx =track.fCx;
  for (Int_t i=0;i<5;i++) fCp[i] =track.fCp[i];
  for (Int_t i=0;i<15;i++)  fCc[i] =track.fCc[i];
  fCchi2 =track.fCchi2;
  //
  fIalpha =track.fIalpha;
  fIx =track.fIx;
  for (Int_t i=0;i<5;i++) fIp[i] =track.fIp[i];
  for (Int_t i=0;i<15;i++)  fIc[i] =track.fIc[i];
  //
  fTalpha =track.fTalpha;
  fTx =track.fTx;
  for (Int_t i=0;i<5;i++) fTp[i] =track.fTp[i];
  for (Int_t i=0;i<15;i++)  fTc[i] =track.fTc[i];
  //
  fOalpha =track.fOalpha;
  fOx =track.fOx;
  for (Int_t i=0;i<5;i++) fOp[i] =track.fOp[i];
  for (Int_t i=0;i<15;i++)  fOc[i] =track.fOc[i];
  //
  fXalpha =track.fXalpha;
  fXx =track.fXx;
  for (Int_t i=0;i<5;i++) fXp[i] =track.fXp[i];
  for (Int_t i=0;i<15;i++) fXc[i] =track.fXc[i];
  //
  fITSchi2 =track.fITSchi2;
  for (Int_t i=0;i<12;i++) fITSchi2MIP[i] =track.fITSchi2MIP[i];
  fITSncls =track.fITSncls;       
  for (Int_t i=0;i<6;i++) fITSindex[i]=track.fITSindex[i];    
  fITSsignal =track.fITSsignal;     
  for (Int_t i=0;i<kSPECIES;i++) fITSr[i]=track.fITSr[i]; 
  fITSLabel =track.fITSLabel;       
  fITSFakeRatio =track.fITSFakeRatio;   
  fITStrack =0;  //coping separatelly - in user code
  //
  fTPCchi2 =track.fTPCchi2;       
  fTPCncls =track.fTPCncls;       
  for (Int_t i=0;i<180;i++) fTPCindex[i]=track.fTPCindex[i];  
  fTPCClusterMap=track.fTPCClusterMap;  
  fTPCsignal=track.fTPCsignal;      
  for (Int_t i=0;i<kSPECIES;i++) fTPCr[i]=track.fTPCr[i]; 
  fTPCLabel=track.fTPCLabel;       
  //
  fTRDchi2=track.fTRDchi2;        
  fTRDncls=track.fTRDncls;       
  fTRDncls0=track.fTRDncls0;       
  for (Int_t i=0;i<130;i++) fTRDindex[i]=track.fTRDindex[i];   
  fTRDsignal=track.fTRDsignal;      
  for (Int_t i=0;i<kSPECIES;i++) fTRDr[i]=track.fTRDr[i]; 
  fTRDLabel=track.fTRDLabel;       
  fTRDtrack=0; 
  //
  fTOFchi2=track.fTOFchi2;        
  fTOFindex=track.fTOFindex;       
  fTOFsignal=track.fTOFsignal;      
  for (Int_t i=0;i<kSPECIES;i++) fTOFr[i]=track.fTOFr[i];
  //
  for (Int_t i=0;i<3;i++) fPHOSpos[i]=track.fPHOSpos[i]; 
  fPHOSsignal=track.fPHOSsignal; 
  for (Int_t i=0;i<kSPECIES;i++) fPHOSr[i]=track.fPHOSr[i]; 
  //
  for (Int_t i=0;i<3;i++) fEMCALpos[i]=track.fEMCALpos[i]; 
  fEMCALsignal=track.fEMCALsignal; 
  for (Int_t i=0;i<kSPECIES;i++) fEMCALr[i]=track.fEMCALr[i]; 
  //
  fRICHsignal=track.fRICHsignal;     
  for (Int_t i=0;i<kSPECIES;i++) fRICHr[i]=track.fRICHr[i];
  
  
}
//_______________________________________________________________________
AliESDtrack::~AliESDtrack(){ 
  //
  // This is destructor according Coding Conventrions 
  //
  //printf("Delete track\n");
  if (fITStrack) delete fITStrack;
  if (fTRDtrack) delete fTRDtrack;  
}

//_______________________________________________________________________
Double_t AliESDtrack::GetMass() const {
  // Returns the mass of the most probable particle type
  Float_t max=0.;
  Int_t k=-1;
  for (Int_t i=0; i<kSPECIES; i++) {<commit_msg>bugfix in copy constructor<commit_after>/**************************************************************************
 * 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.                  *
 **************************************************************************/
//-----------------------------------------------------------------
//           Implementation of the ESD track class
//   ESD = Event Summary Data
//   This is the class to deal with during the phisical analysis of data
//      Origin: <NAME>, CERN
//      e-mail: <EMAIL>
//-----------------------------------------------------------------

#include "TMath.h"
#include "TString.h"

#include "AliESDtrack.h"
#include "AliKalmanTrack.h"

ClassImp(AliESDtrack)

//_______________________________________________________________________
AliESDtrack::AliESDtrack() : 
fFlags(0),
fLabel(0),
fTrackLength(0),
fStopVertex(0),
fRalpha(0),
fRx(0),
fCalpha(0),
fCx(0),
fCchi2(1e10),
fIalpha(0),
fIx(0),
fTalpha(0),
fTx(0),
fOalpha(0),
fOx(0),
fITSchi2(0),
fITSncls(0),
fITSsignal(0),
fTPCchi2(0),
fTPCncls(0),
fTPCClusterMap(159),//number of padrows
fTPCsignal(0),
fTRDchi2(0),
fTRDncls(0),
fTRDncls0(0),
fTRDsignal(0),
fTOFchi2(0),
fTOFindex(0),
fTOFsignal(-1),
fPHOSsignal(-1),
fEMCALsignal(-1),
fRICHsignal(-1)
{
  //
  // The default ESD constructor 
  //
  for (Int_t i=0; i<kSPECIES; i++) {
    fTrackTime[i]=0.;
    fR[i]=1.;
    fITSr[i]=1.;
    fTPCr[i]=1.;
    fTRDr[i]=1.;
    fTOFr[i]=1.;
    fRICHr[i]=1.;
  }
  
  for (Int_t i=0; i<kSPECIESN; i++) {
    fPHOSr[i]  = 1.;
    fEMCALr[i] = 1.;
  }

 
  fPHOSpos[0]=fPHOSpos[1]=fPHOSpos[2]=0.;
  fEMCALpos[0]=fEMCALpos[1]=fEMCALpos[2]=0.;
  Int_t i;
  for (i=0; i<5; i++)  { fRp[i]=0.; fCp[i]=0.; fIp[i]=0.; fOp[i]=0.; fTp[i]=0.;}
  for (i=0; i<15; i++) { fRc[i]=0.; fCc[i]=0.; fIc[i]=0.; fOc[i]=0.; fTc[i]=0.;  }
  for (i=0; i<6; i++)  { fITSindex[i]=0; }
  for (i=0; i<180; i++){ fTPCindex[i]=0; }
  for (i=0; i<130; i++) { fTRDindex[i]=0; }
  fTPCLabel = 0;
  fTRDLabel = 0;
  fITSLabel = 0;
  fITStrack = 0;
  fTRDtrack = 0;  
}

//_______________________________________________________________________

AliESDtrack::AliESDtrack(const AliESDtrack& track):TObject(track){
  //
  //copy constructor
  //
  fFlags = track.fFlags;
  fLabel =track.fLabel;
  fTrackLength =track.fTrackLength;
  for (Int_t i=0;i<kSPECIES;i++) fTrackTime[i] =track.fTrackTime[i];
  for (Int_t i=0;i<kSPECIES;i++)  fR[i] =track.fR[i];
  fStopVertex =track.fStopVertex;
  //
  fRalpha =track.fRalpha;
  fRx =track.fRx;
  for (Int_t i=0;i<5;i++) fRp[i] =track.fRp[i];
  for (Int_t i=0;i<15;i++) fRc[i] =track.fRc[i];
  //
  fCalpha =track.fCalpha;
  fCx =track.fCx;
  for (Int_t i=0;i<5;i++) fCp[i] =track.fCp[i];
  for (Int_t i=0;i<15;i++)  fCc[i] =track.fCc[i];
  fCchi2 =track.fCchi2;
  //
  fIalpha =track.fIalpha;
  fIx =track.fIx;
  for (Int_t i=0;i<5;i++) fIp[i] =track.fIp[i];
  for (Int_t i=0;i<15;i++)  fIc[i] =track.fIc[i];
  //
  fTalpha =track.fTalpha;
  fTx =track.fTx;
  for (Int_t i=0;i<5;i++) fTp[i] =track.fTp[i];
  for (Int_t i=0;i<15;i++)  fTc[i] =track.fTc[i];
  //
  fOalpha =track.fOalpha;
  fOx =track.fOx;
  for (Int_t i=0;i<5;i++) fOp[i] =track.fOp[i];
  for (Int_t i=0;i<15;i++)  fOc[i] =track.fOc[i];
  //
  fXalpha =track.fXalpha;
  fXx =track.fXx;
  for (Int_t i=0;i<5;i++) fXp[i] =track.fXp[i];
  for (Int_t i=0;i<15;i++) fXc[i] =track.fXc[i];
  //
  fITSchi2 =track.fITSchi2;
  for (Int_t i=0;i<12;i++) fITSchi2MIP[i] =track.fITSchi2MIP[i];
  fITSncls =track.fITSncls;       
  for (Int_t i=0;i<6;i++) fITSindex[i]=track.fITSindex[i];    
  fITSsignal =track.fITSsignal;     
  for (Int_t i=0;i<kSPECIES;i++) fITSr[i]=track.fITSr[i]; 
  fITSLabel =track.fITSLabel;       
  fITSFakeRatio =track.fITSFakeRatio;   
  fITStrack =0;  //coping separatelly - in user code
  //
  fTPCchi2 =track.fTPCchi2;       
  fTPCncls =track.fTPCncls;       
  for (Int_t i=0;i<180;i++) fTPCindex[i]=track.fTPCindex[i];  
  fTPCClusterMap=track.fTPCClusterMap;  
  fTPCsignal=track.fTPCsignal;      
  for (Int_t i=0;i<kSPECIES;i++) fTPCr[i]=track.fTPCr[i]; 
  fTPCLabel=track.fTPCLabel;       
  //
  fTRDchi2=track.fTRDchi2;        
  fTRDncls=track.fTRDncls;       
  fTRDncls0=track.fTRDncls0;       
  for (Int_t i=0;i<130;i++) fTRDindex[i]=track.fTRDindex[i];   
  fTRDsignal=track.fTRDsignal;      
  for (Int_t i=0;i<kSPECIES;i++) fTRDr[i]=track.fTRDr[i]; 
  fTRDLabel=track.fTRDLabel;       
  fTRDtrack=0; 
  //
  fTOFchi2=track.fTOFchi2;        
  fTOFindex=track.fTOFindex;       
  fTOFsignal=track.fTOFsignal;      
  for (Int_t i=0;i<kSPECIES;i++) fTOFr[i]=track.fTOFr[i];
  //
  for (Int_t i=0;i<3;i++) fPHOSpos[i]=track.fPHOSpos[i]; 
  fPHOSsignal=track.fPHOSsignal; 
  for (Int_t i=0;i<kSPECIESN;i++) fPHOSr[i]=track.fPHOSr[i]; 
  //
  for (Int_t i=0;i<3;i++) fEMCALpos[i]=track.fEMCALpos[i]; 
  fEMCALsignal=track.fEMCALsignal; 
  for (Int_t i=0;i<kSPECIESN;i++) fEMCALr[i]=track.fEMCALr[i]; 
  //
  fRICHsignal=track.fRICHsignal;     
  for (Int_t i=0;i<kSPECIES;i++) fRICHr[i]=track.fRICHr[i];
  
  
}
//_______________________________________________________________________
AliESDtrack::~AliESDtrack(){ 
  //
  // This is destructor according Coding Conventrions 
  //
  //printf("Delete track\n");
  if (fITStrack) delete fITStrack;
  if (fTRDtrack) delete fTRDtrack;  
}

//_______________________________________________________________________
Double_t AliESDtrack::GetMass() const {
  // Returns the mass of the most probable particle type
  Float_t max=0.;
  Int_t k=-1;
  for (Int_t i=0; i<kSPECIES; i++) {
{'fraction_non_alphanumeric': 0.20631809986673982, 'fraction_numerical': 0.027749470878733244, 'mean_word_length': 3.063057324840764, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7110107', 'n_tokens_mistral': 5577, 'n_tokens_neox': 5358, 'n_words': 949}