/* History of cvs commits:
*
* $Log$
+ * Revision 1.112 2007/07/11 13:43:30 hristov
+ * New class AliESDEvent, backward compatibility with the old AliESD (Christian)
+ *
+ * Revision 1.111 2007/05/04 14:49:29 policheh
+ * AliPHOSRecPoint inheritance from AliCluster
+ *
+ * Revision 1.110 2007/04/24 10:08:03 kharlov
+ * Vertex extraction from GenHeader
+ *
+ * Revision 1.109 2007/04/18 09:34:05 kharlov
+ * Geometry bug fixes
+ *
+ * Revision 1.108 2007/04/16 09:03:37 kharlov
+ * Incedent angle correction fixed
+ *
* Revision 1.107 2007/04/02 15:00:16 cvetan
* No more calls to gAlice in the reconstruction
*
#include "AliPHOS.h"
#include "AliPHOSPIDv1.h"
#include "AliPHOSGetter.h"
-#include "AliESD.h"
+#include "AliESDEvent.h"
#include "AliESDVertex.h"
+#include "AliHeader.h"
+#include "AliGenEventHeader.h"
ClassImp( AliPHOSPIDv1)
//____________________________________________________________________________
AliPHOSPIDv1::AliPHOSPIDv1() :
+ AliPHOSPID(),
fBayesian(kFALSE),
fDefaultInit(kFALSE),
fWrite(kFALSE),
fPPi0(0),
fRecParticlesInRun(0),
fParameters(0),
+ fVtx(0.),
fTFphoton(0),
fTFpiong(0),
fTFkaong(0),
fPPi0(0),
fRecParticlesInRun(0),
fParameters(0),
+ fVtx(0.),
fTFphoton(0),
fTFpiong(0),
fTFkaong(0),
fPPi0(0),
fRecParticlesInRun(0),
fParameters(0),
+ fVtx(0.),
fTFphoton(0),
fTFpiong(0),
fTFkaong(0),
// However because of the poor position resolution of PPSD the direction is always taken as if we were
// in case 1.
- TVector3 dir(0,0,0) ;
- TMatrixF dummy ;
-
- emc->GetGlobalPosition(dir, dummy) ;
-
TVector3 local ;
emc->GetLocalPosition(local) ;
}
else{
AliError("Cluster with zero energy \n");
- }
+ }
//Apply Real vertex
phosgeom->GetIncidentVector(fVtx,emc->GetPHOSMod(),x,z,vInc) ;
Float_t depthx = 0.;
Float_t depthz = 0.;
if (energy > 0 && vInc.Y()!=0.) {
- depthx = ( para * TMath::Log(energy) + parb ) * vInc.X()/vInc.Y() ;
- depthz = ( para * TMath::Log(energy) + parb ) * vInc.Z()/vInc.Y() ;
+ depthx = ( para * TMath::Log(energy) + parb ) * vInc.X()/TMath::Abs(vInc.Y()) ;
+ depthz = ( para * TMath::Log(energy) + parb ) * vInc.Z()/TMath::Abs(vInc.Y()) ;
}
- dir.SetXYZ(dir.X()-(depthxOld-depthx)*TMath::Sin(dir.Phi()),
- dir.Y()-(depthxOld-depthx)*TMath::Cos(dir.Phi()),
- dir.Z()+depthzOld-depthz) ;
+ //Correct for the vertex position and shower depth
+ Double_t xd=x+(depthxOld-depthx) ;
+ Double_t zd=z+(depthzOld-depthz) ;
+ TVector3 dir(0,0,0) ;
+ phosgeom->Local2Global(emc->GetPHOSMod(),xd,zd,dir) ;
- //Correct for the vertex position
- dir = dir - fVtx ;
+ dir-=fVtx ;
dir.SetMag(1.) ;
return dir ;
AliPHOSTrackSegment * ts = gime->TrackSegment(rp->GetPHOSTSIndex()) ;
AliPHOSEmcRecPoint * erp = gime->EmcRecPoint(ts->GetEmcIndex()) ;
TVector3 pos ;
- geom->GetGlobal(erp, pos) ;
+ geom->GetGlobalPHOS(erp, pos) ;
rp->SetPos(pos);
index++ ;
}
//Try to extract vertex from data
if(fESD){
const AliESDVertex *esdVtx = fESD->GetVertex() ;
- if(esdVtx){
+ if(esdVtx && esdVtx->GetChi2()!=0.){
fVtx.SetXYZ(esdVtx->GetXv(),esdVtx->GetYv(),esdVtx->GetZv()) ;
return ;
}
}
+ if(gAlice && gAlice->GetHeader() && gAlice->GetHeader()->GenEventHeader()){
+ AliGenEventHeader *eh = gAlice->GetHeader()->GenEventHeader() ;
+ TArrayF ftx ;
+ eh->PrimaryVertex(ftx);
+ fVtx.SetXYZ(ftx[0],ftx[1],ftx[2]) ;
+ return ;
+ }
AliWarning("Can not read vertex from data, use fixed \n") ;
fVtx.SetXYZ(0.,0.,0.) ;