#include "TParticle.h"
#include "TString.h"
+#include <cstdio>
+
ClassImp(AliMUONTrackLight)
//===================================================================
/// Destructor
}
+//============================================
+AliMUONTrackLight& AliMUONTrackLight::operator=(const AliMUONTrackLight& muonCopy)
+{
+ // check assignment to self
+ if (this == &muonCopy) return *this;
+
+ // base class assignment
+ TObject::operator=(muonCopy);
+
+ // assignment operator
+ fPrec = muonCopy.fPrec;
+ fIsTriggered = muonCopy.fIsTriggered;
+ fCharge = muonCopy.fCharge;
+ fChi2 = muonCopy.fChi2;
+ fCentr = muonCopy.fCentr;
+ fPgen = muonCopy.fPgen;
+ fTrackPythiaLine = muonCopy.fTrackPythiaLine;
+ fTrackPDGCode = muonCopy.fTrackPDGCode;
+ fOscillation = muonCopy.fOscillation;
+ fNParents = muonCopy.fNParents;
+ fWeight = muonCopy.fWeight;
+
+ for (Int_t i=0; i<3; i++) fXYZ[i]=muonCopy.fXYZ[i];
+ for (Int_t npar = 0; npar < fgkNParentsMax; npar++){
+ fParentPDGCode[npar] = muonCopy.fParentPDGCode[npar];
+ fParentPythiaLine[npar] = muonCopy.fParentPythiaLine[npar];
+ }
+ for (Int_t i = 0; i < 4; i++){
+ fQuarkPDGCode[i] = muonCopy.fQuarkPDGCode[i];
+ fQuarkPythiaLine[i] = muonCopy.fQuarkPythiaLine[i];
+ }
+
+ return *this;
+}
+
//============================================
void AliMUONTrackLight::FillFromAliMUONTrack(AliMUONTrack *trackReco,Double_t zvert){
TString pdg = "", line = "";
for(int i = 3; i >= 0; i--){
if(this->GetQuarkPythiaLine(i)>= 0){
- sprintf(name, "%4d --> ", this->GetQuarkPythiaLine(i));
+ snprintf(name, 100, "%4d --> ", this->GetQuarkPythiaLine(i));
line += name;
- sprintf(name, "%4d --> ", this->GetQuarkPDGCode(i));
+ snprintf(name, 100, "%4d --> ", this->GetQuarkPDGCode(i));
pdg += name;
}
}
for(int i = 0; i < fNParents; i++){
if(this->GetParentPythiaLine(i)>= 0){
- sprintf(name, "%7d --> ", this->GetParentPythiaLine(i));
+ snprintf(name, 100, "%7d --> ", this->GetParentPythiaLine(i));
line += name;
- sprintf(name, "%7d --> ", this->GetParentPDGCode(i));
+ snprintf(name, 100, "%7d --> ", this->GetParentPDGCode(i));
pdg += name;
}
}
- sprintf(name, "%4d", this->GetTrackPythiaLine()); line += name;
- sprintf(name, "%4d", this->GetTrackPDGCode()); pdg += name;
+ snprintf(name, 100, "%4d", this->GetTrackPythiaLine()); line += name;
+ snprintf(name, 100, "%4d", this->GetTrackPDGCode()); pdg += name;
printf("\nmuon's decay history:\n");
printf(" PDG: %s\n", pdg.Data());
else return kFALSE;
}
//====================================
-Bool_t AliMUONTrackLight::IsDiquark(Int_t pdg){
+Bool_t AliMUONTrackLight::IsDiquark(Int_t pdg) const{
/// check if the provided pdg code corresponds to a diquark
pdg = TMath::Abs(pdg);
if((pdg > 1000) && (pdg%100 < 10)) return kTRUE;