]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrackLight.cxx
print number of reconstructible/reconstructed/MC-matched pairs
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackLight.cxx
index 7582223d4a5b7769c302d45a73241f62bc1dece1..1dd51a4d858ee5b7e42565cf660a058325a17bd4 100644 (file)
@@ -50,6 +50,8 @@
 #include "TParticle.h"
 #include "TString.h"
 
+#include <cstdio>
+
 ClassImp(AliMUONTrackLight) 
 
 //===================================================================
@@ -143,6 +145,41 @@ AliMUONTrackLight::~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){
@@ -328,22 +365,22 @@ void AliMUONTrackLight::PrintInfo(const Option_t* opt){
     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());
@@ -380,7 +417,7 @@ Bool_t AliMUONTrackLight::IsParentPionOrKaon(Int_t idparent){
   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;