#include "AliHBTReaderESD.h"
+//____________________________________________________________________
+//////////////////////////////////////////////////////////////////////
+// //
+// class AliHBTReaderESD //
+// //
+// reader for ALICE Event Summary Data (ESD). //
+// //
+// Piotr.Skowronski@cern.ch //
+// //
+//////////////////////////////////////////////////////////////////////
#include <TPDGCode.h>
#include <TString.h>
AliHBTReaderESD::~AliHBTReaderESD()
{
//desctructor
- delete fFile;
delete fRunLoader;
+ delete fFile;
}
/**********************************************************/
Int_t AliHBTReaderESD::ReadNext()
Double_t mom[3];//momentum
Double_t pos[3];//position
- if (AliHBTParticle::fgDebug)
+ if (AliHBTParticle::GetDebug())
Info("ReadNext","Entered");
TDatabasePDG* pdgdb = TDatabasePDG::Instance();
AliESD* esd = dynamic_cast<AliESD*>(fFile->Get(esdname));
if (esd == 0x0)
{
- if (AliHBTParticle::fgDebug > 2 )
+ if (AliHBTParticle::GetDebug() > 2 )
{
Info("ReadNext","Can not find ESD object named %s.",esdname.Data());
}
delete fFile;//we have to assume there is no more ESD objects in the fFile
delete fRunLoader;
fFile = 0x0;
+ fRunLoader = 0x0;
continue;
}
AliStack* stack = 0x0;
Error("Next","Can not get track %d", i);
continue;
}
+
+ //if (esdtrack->HasVertexParameters() == kFALSE)
+ if ((esdtrack->GetStatus() & AliESDtrack::kITSrefit) == kFALSE)
+ {
+ if (AliHBTParticle::GetDebug() > 2)
+ Info("ReadNext","Particle skipped: Data at vertex not available.");
+ continue;
+ }
+
if ((esdtrack->GetStatus()&AliESDtrack::kESDpid) == kFALSE)
{
- if (AliHBTParticle::fgDebug > 2)
+ if (AliHBTParticle::GetDebug() > 2)
Info("ReadNext","Particle skipped: PID BIT is not set.");
continue;
}
-
+
esdtrack->GetESDpid(pidtable);
+ //esdtrack->GetVertexPxPyPz(mom[0],mom[1],mom[2]);
esdtrack->GetPxPyPz(mom);
+ //esdtrack->GetVertexXYZ(pos[0],pos[1],pos[2]);
esdtrack->GetXYZ(pos);
Double_t extx;
for (Int_t s=0; s<AliESDtrack::kSPECIES; s++) rc+=concentr[s]*pidtable[s];
if (rc==0.0)
{
- if (AliHBTParticle::fgDebug > 2)
+ if (AliHBTParticle::GetDebug() > 2)
Info("ReadNext","Particle rejected since total bayessian PID probab. is zero.");
continue;
}
for (Int_t s=0; s<AliESDtrack::kSPECIES; s++) w[s]=concentr[s]*pidtable[s]/rc;
- if (AliHBTParticle::fgDebug > 4)
+ if (AliHBTParticle::GetDebug() > 4)
{
Info("ReadNext","###########################################################################");
Info("ReadNext","Momentum: %f %f %f",mom[0],mom[1],mom[2]);
msg+=")";
}
Info("ReadNext","%s",msg.Data());
- }//if (AliHBTParticle::fgDebug>4)
+ }//if (AliHBTParticle::GetDebug()>4)
for (Int_t s = 0; s<kNSpecies; s++)
{
if (particle) fParticlesEvent->AddParticle(particle);
keeppart = kTRUE;
- if (AliHBTParticle::fgDebug > 4 )
+ if (AliHBTParticle::GetDebug() > 4 )
{
Info("ReadNext","\n\nAdding Particle with incarnation %d",pdgcode);
track->Print();
/**********************************************************/
void AliHBTReaderESD::Rewind()
{
+ //rewinds reading
delete fFile;
fFile = 0;
delete fRunLoader;
fCurrentDir = 0;
fNEventsRead = 0;
fCurrentEvent++;
-
}
/**********************************************************/