]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSHit.cxx
Coverity fix
[u/mrichter/AliRoot.git] / PHOS / AliPHOSHit.cxx
index 03c803cc624f76238657e842cb436d82c1a69e09..4c1bf85e1aef92feb44bff7797af99dd4406de08 100644 (file)
 // --- ROOT system ---
 
 // --- Standard library ---
-#include <string.h>
-#include <stdlib.h>
-#include <strstream.h>
 
 // --- AliRoot header files ---
 #include "AliPHOSHit.h"
-#include "AliRun.h"
-#include "AliConst.h"
-#include "AliPHOSGetter.h"
-#include "AliPHOSGeometry.h"
-#include "AliPHOS.h"
 
 ClassImp(AliPHOSHit)
   
   //____________________________________________________________________________
-  AliPHOSHit::AliPHOSHit(const AliPHOSHit & hit) 
+AliPHOSHit::AliPHOSHit(const AliPHOSHit & hit) :
+  AliHit(hit),fId(hit.fId),fELOS(hit.fELOS),fTime(hit.fTime)
 {
   // copy ctor
-  fX       = hit.fX ; 
-  fY       = hit.fY ; 
-  fZ       = hit.fZ ; 
-  fId      = hit.fId ; 
-  fELOS    = hit.fELOS ;
-  fPrimary = hit.fPrimary ; 
-  fTrack   = hit.fTrack ; 
-  fTime    = hit.fTime  ;
-  
 } 
 
 //____________________________________________________________________________
-AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_t *hits): AliHit(shunt, track)
+AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t track, Int_t id, Float_t *hits) : 
+  AliHit(shunt, track),fId(0),fELOS(0),fTime(0)
 {
   //
   // Create a CPV hit object
@@ -66,49 +51,6 @@ AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_
   fTime       = hits[3] ;
   fId         = id ;
   fELOS       = hits[4] ;
-  fPrimary    = primary ;
-}
-//____________________________________________________________________________
-Float_t AliPHOSHit::X() const
-{
-  //  if(fX < -1000.){
-    TVector3  pos ;
-    AliPHOS * phos = static_cast<AliPHOS*> (gAlice->GetDetector("PHOS")) ;
-    phos->GetGeometry() ->RelPosInAlice(GetId(),  pos) ;
-    return pos.X() ;
-    //    fX = pos.X() ;
-    //    fY = pos.Y() ;
-    //    fZ = pos.Z() ;
-    //  }
-    //  return fX;
-}
-//____________________________________________________________________________
-Float_t AliPHOSHit::Y() const
-{
-  //  if(fY < -1000.){
-    TVector3  pos ;
-    AliPHOS * phos = static_cast<AliPHOS*> (gAlice->GetDetector("PHOS")) ;
-    phos->GetGeometry() ->RelPosInAlice(GetId(),  pos) ;
-    return pos.Y(); 
-    //    fX = pos.X() ;
-    //    fY = pos.Y() ;
-    //    fZ = pos.Z() ;
-    //  }
-    //  return fY;
-}
-//____________________________________________________________________________
-Float_t AliPHOSHit::Z() const
-{
-  //  if(fY < -1000.){
-    TVector3  pos ;
-    AliPHOS * phos = static_cast<AliPHOS*> (gAlice->GetDetector("PHOS")) ;
-    phos->GetGeometry() ->RelPosInAlice(GetId(),  pos) ;
-    return pos.Z() ;
-    //    fX = pos.X() ;
-    //    fY = pos.Y() ;
-    //    fZ = pos.Z() ;
-    //  }
-    //  return fZ;
 }
 //____________________________________________________________________________
 Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const
@@ -117,12 +59,18 @@ Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const
 
   Bool_t rv = kFALSE ; 
 
-  if ( (fId == rValue.GetId()) && ( fPrimary == rValue.GetPrimary() ) )
+  if ( (fId == rValue.GetId()) && ( fTrack == rValue.GetPrimary() ) )
     rv = kTRUE;
   
   return rv;
 }
 
+//____________________________________________________________________________
+AliPHOSHit & AliPHOSHit::operator = (const AliPHOSHit &)
+{
+  Fatal("operator =", "not implemented");
+  return *this;
+}
 //____________________________________________________________________________
 AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue)
 {
@@ -137,14 +85,3 @@ AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue)
 
 }
 
-//____________________________________________________________________________
-ostream& operator << (ostream& out, const AliPHOSHit& hit) 
-{
-  // Print out Id and energy 
-  
-  out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << "  " << hit.GetTime() << endl ;
-  return out ;
-}
-
-
-