]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/ESD/AliESD.cxx
make it compile
[u/mrichter/AliRoot.git] / STEER / ESD / AliESD.cxx
index c88e5598ea715867270e2588e2562080074cb82f..6a3156dee6fa408914c12e2cba0d3c4c78668495 100644 (file)
@@ -13,7 +13,7 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/* $Id$ */
+/* $Id: AliESD.cxx 54579 2012-02-14 12:22:34Z shahoian $ */
 
 //-----------------------------------------------------------------
 //           Implementation of the ESD class
@@ -74,10 +74,8 @@ AliESD::AliESD():
   fESDFMD(0x0),
   fESDVZERO(0x0),
   fESDACORDE(0x0),
+  fESDAD(0x0),
   fErrorLogs("AliRawDataErrorLog",5)
-  #ifdef MFT_UPGRADE
- // ,fESDMFT(0x0)
-  #endif
 {
   // 
   // Standar constructor
@@ -140,10 +138,8 @@ AliESD::AliESD(const AliESD& esd):
   fESDFMD(esd.fESDFMD),
   fESDVZERO(esd.fESDVZERO),
   fESDACORDE(esd.fESDACORDE),
+  fESDAD(esd.fESDAD),
   fErrorLogs(*((TClonesArray*)esd.fErrorLogs.Clone()))
-  #ifdef MFT_UPGRADE
-  //, fESDMFT(esd.fESDMFT)
-  #endif
 {
   // 
   // copy constructor
@@ -180,9 +176,7 @@ AliESD::~AliESD()
   delete fPHOSTriggerPosition;
   delete fPHOSTriggerAmplitudes;
   delete fESDACORDE;
-  #ifdef MFT_UPGRADE
-//  delete fESDMFT;
-  #endif
+  delete fESDAD;
   fErrorLogs.Delete();
 
 }
@@ -263,13 +257,13 @@ void AliESD::Reset()
       fESDACORDE->~AliESDACORDE();
       new (fESDACORDE) AliESDACORDE(); 
   }    
+
+ if (fESDAD){
+      fESDAD->~AliESDAD();
+      new (fESDAD) AliESDAD(); 
+  }    
+
 //
-  #ifdef MFT_UPGRADE
- // if (fESDMFT){
-//       fESDMFT->~AliESDMFT();
-//       new (fESDMFT) AliESDMFT();    
-//  }
-  #endif
 //
   fErrorLogs.Delete();
 }
@@ -416,6 +410,7 @@ Bool_t  AliESD::RemoveTrack(Int_t rm) {
   if (rm==last) return kTRUE;
 
   AliESDtrack *t=GetTrack(last);
+  if (!t) {AliFatal(Form("NULL pointer for ESD track %d",last)); return kFALSE;}
   t->SetID(rm);
   new (a[rm]) AliESDtrack(*t);
   delete a.RemoveAt(last);
@@ -535,6 +530,7 @@ Bool_t AliESD::Clean(Float_t *cleanPars) {
   Int_t nTracks=GetNumberOfTracks();
   for (Int_t i=nTracks-1; i>=0; i--) {
     AliESDtrack *track=GetTrack(i);
+    if (!track) {AliFatal(Form("NULL pointer for ESD track %d",i)); return kFALSE;}
     Float_t xy,z; track->GetImpactParameters(xy,z);
     if ((TMath::Abs(xy) > dmax) || (vtxOK && (TMath::Abs(z) > zmax))) {
       if (RemoveTrack(i)) rc=kTRUE;
@@ -592,9 +588,6 @@ void AliESD::Print(Option_t *) const
   printf("                 emcal     %d\n", GetNumberOfEMCALClusters());
   printf("                 FMD       %s\n", (fESDFMD ? "yes" : "no"));
   printf("                 VZERO     %s\n", (fESDVZERO ? "yes" : "no"));
-  #ifdef MFT_UPGRADE
- // printf("                 MFT       %s\n", (fESDMFT ? "yes" : "no"));
-  #endif
 }
 
 void AliESD::SetESDfriend(const AliESDfriend *ev) {
@@ -607,6 +600,7 @@ void AliESD::SetESDfriend(const AliESDfriend *ev) {
 
   for (Int_t i=0; i<ntrk; i++) {
     const AliESDfriendTrack *f=ev->GetTrack(i);
+    if (!f) {AliFatal(Form("NULL pointer for ESD track %d",i));}
     GetTrack(i)->SetFriendTrack(f);
   }
 }
@@ -621,6 +615,7 @@ void AliESD::GetESDfriend(AliESDfriend *ev) const {
 
   for (Int_t i=0; i<ntrk; i++) {
     AliESDtrack *t=GetTrack(i);
+    if (!t) {AliFatal(Form("NULL pointer for ESD track %d",i));}
     const AliESDfriendTrack *f=t->GetFriendTrack();
     ev->AddTrack(f);