]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSRecParticle.cxx
eff C++ warnings corrected.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSRecParticle.cxx
index 78224515d148b1011588586dd441e979dab4414c..0bf30b95ff0af907a4e5853a1342a7337bfdc958 100644 (file)
 #include "AliLog.h"
 
 //____________________________________________________________________________
-  AliPHOSRecParticle::AliPHOSRecParticle(): fPHOSTrackSegment(0)  ,  fDebug( kFALSE )
+AliPHOSRecParticle::AliPHOSRecParticle(): 
+  fPHOSTrackSegment(0),
+  fDebug(kFALSE),
+  fPos()
 {
   // ctor
   const Int_t nSPECIES = AliPID::kSPECIESN;
 
 
 //____________________________________________________________________________
- AliPHOSRecParticle::AliPHOSRecParticle(const AliPHOSRecParticle & rp)
-   : AliPHOSFastRecParticle(rp)
+AliPHOSRecParticle::AliPHOSRecParticle(const AliPHOSRecParticle & rp):
+  AliPHOSFastRecParticle(rp),
+  fPHOSTrackSegment(rp.fPHOSTrackSegment),
+  fDebug(kFALSE),
+  fPos()
 {
   // copy ctor
-
-  fPHOSTrackSegment = rp.fPHOSTrackSegment ; 
-  fDebug            = kFALSE ; 
   fType             = rp.fType ; 
   fIndexInList      = rp.fIndexInList ;
 
@@ -113,7 +116,9 @@ const TParticle * AliPHOSRecParticle::GetPrimary() const
   Int_t module ;
   const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
    Double_t x,z ;
-  geom->ImpactOnEmc(static_cast<double>(Theta()),static_cast<double>(Phi()), module,z,x);
+//DP to be fixed: Why do we use this method here??? M.B. use RecPoint???
+  Double_t vtx[3]={0.,0.,0.} ;
+  geom->ImpactOnEmc(vtx,static_cast<double>(Theta()),static_cast<double>(Phi()), module,z,x);
   Int_t amp = 0 ;
   Int_t iPrim=-1 ;
   if(module != 0){
@@ -177,7 +182,10 @@ Int_t AliPHOSRecParticle::GetPrimaryIndex() const
       bestDigitIndex = iDigit;
     }
   }
-  digit = gime->Digit(digitList[bestDigitIndex]);
+  if (bestDigitIndex>-1)
+    digit = gime->Digit(digitList[bestDigitIndex]);
+  if (digit==0) return -12345;
+
   
   // Get the list of primary tracks producing this digit
   // and find which track has more track energy.
@@ -220,6 +228,8 @@ Int_t AliPHOSRecParticle::GetPrimaryIndex() const
 
   AliPHOSHit *hit = 0;
   TClonesArray *hits = gime->Hits();
+  if (hits==0) return -12345;
+
   Double_t maxedep  =  0;
   Int_t    maxtrack = -1;
   Int_t    nHits    = hits ->GetEntries();