]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALHit.cxx
added a method to tell if the digit is in pre shower
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALHit.cxx
index 6d724d31148504a31b96a4e84d3cf413d6f83a48..027fd11e010777386900b2a1755c77515e155ec3 100644 (file)
@@ -26,8 +26,8 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <strstream.h>
-#include <iostream.h>
+#include <Rstrstream.h>
+#include <Riostream.h>
 
 // --- ROOT system ---
 #include <TLorentzVector.h>
 
 // --- ROOT system ---
 #include <TLorentzVector.h>
@@ -36,7 +36,8 @@
 #include "AliEMCALHit.h"
 #include "AliRun.h"
 #include "AliConst.h"
 #include "AliEMCALHit.h"
 #include "AliRun.h"
 #include "AliConst.h"
-
+#include "AliEMCALGeometry.h"
+#include "AliEMCALGetter.h"
 
 ClassImp(AliEMCALHit)
 
 
 ClassImp(AliEMCALHit)
 
@@ -46,6 +47,7 @@ AliEMCALHit::AliEMCALHit(){
    
     fId      = 0;
     fELOS    = 0.0;
    
     fId      = 0;
     fELOS    = 0.0;
+    fTime    = 0.0;
     fPrimary = 0;
     fTrack   = 0;
     fX       = 0.0;
     fPrimary = 0;
     fTrack   = 0;
     fX       = 0.0;
@@ -75,6 +77,7 @@ AliEMCALHit::AliEMCALHit(const AliEMCALHit & hit){
     fPe       = hit.fPe;
     fIparent = hit.fIparent;
     fIenergy = hit.fIenergy;
     fPe       = hit.fPe;
     fIparent = hit.fIparent;
     fIenergy = hit.fIenergy;
+    fTime    = hit.fTime  ;
 }
 //______________________________________________________________________
 AliEMCALHit::AliEMCALHit(Int_t shunt, Int_t primary, Int_t track,Int_t iparent, Float_t ienergy, Int_t id,
 }
 //______________________________________________________________________
 AliEMCALHit::AliEMCALHit(Int_t shunt, Int_t primary, Int_t track,Int_t iparent, Float_t ienergy, Int_t id,
@@ -85,8 +88,9 @@ AliEMCALHit::AliEMCALHit(Int_t shunt, Int_t primary, Int_t track,Int_t iparent,
     fX          = hits[0];
     fY          = hits[1];
     fZ          = hits[2];
     fX          = hits[0];
     fY          = hits[1];
     fZ          = hits[2];
+    fTime       = hits[3] ;
     fId         = id;
     fId         = id;
-    fELOS       = hits[3];
+    fELOS       = hits[4];
     fPrimary    = primary;
     fPx          = p[0];
     fPy          = p[1];
     fPrimary    = primary;
     fPx          = p[0];
     fPy          = p[1];
@@ -95,6 +99,7 @@ AliEMCALHit::AliEMCALHit(Int_t shunt, Int_t primary, Int_t track,Int_t iparent,
     fIparent    = iparent;
     fIenergy    = ienergy;
 }
     fIparent    = iparent;
     fIenergy    = ienergy;
 }
+
 //______________________________________________________________________
 Bool_t AliEMCALHit::operator==(AliEMCALHit const &rValue) const{ 
     // Two hits are identical if they have the same Id and originat
 //______________________________________________________________________
 Bool_t AliEMCALHit::operator==(AliEMCALHit const &rValue) const{ 
     // Two hits are identical if they have the same Id and originat
@@ -111,7 +116,10 @@ AliEMCALHit AliEMCALHit::operator+(const AliEMCALHit &rValue){
     // Add the energy of the hit
 
     fELOS += rValue.GetEnergy() ;
     // Add the energy of the hit
 
     fELOS += rValue.GetEnergy() ;
-
+    if(rValue.GetTime() < fTime)
+      fTime = rValue.GetTime() ;
     return *this;
 
 }
     return *this;
 
 }
@@ -122,6 +130,7 @@ ostream& operator << (ostream& out,AliEMCALHit& hit){
     out << "AliEMCALHit:";
     out << "id=" <<  hit.GetId();
     out << ", Eloss=" <<  hit.GetEnergy();
     out << "AliEMCALHit:";
     out << "id=" <<  hit.GetId();
     out << ", Eloss=" <<  hit.GetEnergy();
+    out << ", Time=" << hit.GetTime();
     out << "GeV , Track no.=" << hit.GetPrimary();
     out << ", (xyz)=(" << hit.X()<< ","<< hit.Y()<< ","<<hit.Z()<<") cm";
     out << ", fTrack=" << hit.GetTrack();
     out << "GeV , Track no.=" << hit.GetPrimary();
     out << ", (xyz)=(" << hit.X()<< ","<< hit.Y()<< ","<<hit.Z()<<") cm";
     out << ", fTrack=" << hit.GetTrack();