]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliAODParticle.cxx
Changes to be compliant with coding conventions - all the clusters in layer 1 are
[u/mrichter/AliRoot.git] / ANALYSIS / AliAODParticle.cxx
index be101d1496c0251b1458ddaf8e1fdcaad0c4e70a..90a4bd06f99f3a58c36ca4a93ea5694735fb121a 100644 (file)
@@ -1,4 +1,20 @@
-#include "AliAODParticle.h"
+/**************************************************************************
+ * 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.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
 //___________________________________________________________
 /////////////////////////////////////////////////////////////
 //
 //
 /////////////////////////////////////////////////////////////
 #include <TParticle.h>
-#include "AliTrackPoints.h"
+
+#include "AliAODParticle.h"
 #include "AliClusterMap.h"
+#include "AliLog.h"
+#include "AliTrackPoints.h"
 
 ClassImp(AliAODParticle)
 
@@ -107,7 +126,7 @@ AliAODParticle::AliAODParticle(const AliVAODParticle& in):
    fTPCTrackPoints(0x0),fITSTrackPoints(0x0),fClusterMap(0x0)
 {
  //Copy constructor
- Info("AliAODParticle(const AliVAODParticle& in)","");
+// Info("AliAODParticle(const AliVAODParticle& in)","");
  for(Int_t i = 0; i<in.GetNumberOfPids(); i++)
   {
     SetPIDprobability(in.GetNthPid(i),in.GetNthPidProb(i));
@@ -166,15 +185,19 @@ void AliAODParticle::Clear(Option_t*)
 }
 //______________________________________________________________________________
 
-AliAODParticle& AliAODParticle::operator=(const AliVAODParticle& in)
+AliVAODParticle& AliAODParticle::operator=(const AliVAODParticle& in)
 {
 //operator=
 //  Info("operator=(const AliVAODParticle& in)","AliAODParticle");
   
+  if (&in == this) return *this;
+
   delete [] fPids;
   delete [] fPidProb;
   fPids = 0x0;
   fPidProb = 0x0;
+  fNPids = 0;
+
   Int_t npids = in.GetNumberOfPids();
   for (Int_t i = 0; i < npids; i++)
    {
@@ -182,7 +205,7 @@ AliAODParticle& AliAODParticle::operator=(const AliVAODParticle& in)
    }
    
   SetPdgCode(in.GetPdgCode(),in.GetPidProb());
-  
+
   SetUID(in.GetUID());
 
   fCalcMass = in.Mass();
@@ -216,6 +239,7 @@ AliAODParticle& AliAODParticle::operator=(const AliAODParticle& in)
 {
 //assigment operator
 //  Info("operator=(const AliAODParticle& in)","AliAODParticle");
+  if (&in == this) return *this;
   fNPids = in.fNPids;
   delete [] fPids;
   delete [] fPidProb;
@@ -266,11 +290,12 @@ void AliAODParticle::SetPIDprobability(Int_t pdg, Float_t prob)
 //Ids are set in decreasing order
 //Check if total probability is not overcoming unity is performed
 //in case, warning is printed
-  if (GetDebug() > 9) Info("SetPIDprobability","Setting PID %d prob %f",pdg,prob);
+  AliDebug(9,Form("SetPIDprobability","Setting PID %d prob %f",pdg,prob));
 
   Float_t totprob = 0.0;//sums up probabilities
   Int_t idx = GetPidSlot(pdg);
   Int_t i;
+
   if (idx > -1) 
    {
      fPidProb[idx] = prob;
@@ -279,10 +304,7 @@ void AliAODParticle::SetPIDprobability(Int_t pdg, Float_t prob)
        {
          Warning("SetPIDprobability","Total probability greater than unity (%f)",totprob);
        }
-     if (GetDebug() > 9) 
-      {
-        Info("SetPIDprobability","Current Total probability: %f",totprob);
-      }
+     AliDebug(9,Form("Current Total probability: %f",totprob));
      return;
    }
     
@@ -295,7 +317,7 @@ void AliAODParticle::SetPIDprobability(Int_t pdg, Float_t prob)
    {
      if ( fPidProb[i] > prob)
       {
-        if (GetDebug()>9) Info("SetPID","Copying entry %d",i);
+        AliDebug(9,Form("Copying entry %d",i));
         aPidProbNew[i] = fPidProb[i];
         aPidsNew[i] = fPids[i];
         totprob+=fPidProb[i];
@@ -303,7 +325,7 @@ void AliAODParticle::SetPIDprobability(Int_t pdg, Float_t prob)
      else break;
    }
 
-  if (GetDebug() > 9) Info("SetPID","Setting new PID on entry %d",i);
+  AliDebug(9,Form("SetPID","Setting new PID on entry %d",i));
   aPidProbNew[i] = prob;
   aPidsNew[i] = pdg;
   totprob+=prob;
@@ -311,7 +333,7 @@ void AliAODParticle::SetPIDprobability(Int_t pdg, Float_t prob)
 
   for (Int_t j = fNPids-1; j > i ;j--)//copy rest of old arays 
    {
-     if (GetDebug() > 9) Info("SetPID","Copying from old entry %d to new entry %d",j-1,j);
+     AliDebug(9,Form("SetPID","Copying from old entry %d to new entry %d",j-1,j));
      aPidProbNew[j] = fPidProb[j-1];
      aPidsNew[j] = fPids[j-1];
      totprob+=fPidProb[j-1];
@@ -389,7 +411,7 @@ Float_t AliAODParticle::GetNthPidProb(Int_t idx) const
 }
 //______________________________________________________________________________
 
-void AliAODParticle::Print() const
+void AliAODParticle::Print(const Option_t * /*opt*/) const
 {
 //prints information about particle
   printf("____________________________________________________\n");
@@ -420,6 +442,10 @@ void AliAODParticle::Print() const
         printf("Not known\n");
       }
    }
+  
+  if (fITSTrackPoints) fITSTrackPoints->Print();
+  if (fTPCTrackPoints) fTPCTrackPoints->Print();
+   
 }
 
 //______________________________________________________________________________