#include <TCanvas.h>
#include <TVector3.h>
#include <TPDGCode.h>
+#include <TParticle.h>
#include "AliRunLoader.h"
#include "AliLoader.h"
#include "AliStack.h"
#include "AliHeader.h"
#include "AliGenEventHeader.h"
+#include "AliPID.h"
#else
const Int_t kXiMinus = 3312;
const Int_t kOmegaMinus = 3334;
Error("CheckESD", "opening ESD file %s failed", esdFileName);
return kFALSE;
}
+ AliESD* esd = new AliESD;
+ TTree* tree = (TTree*) esdFile->Get("esdTree");
+ if (!tree) {
+ Error("CheckESD", "no ESD tree found");
+ return kFALSE;
+ }
+ tree->SetBranchAddress("ESD", &esd);
// efficienc and resolution histograms
Int_t nBinsPt = 15;
"#theta_{rec}-#theta_{sim} [mrad]", "N");
// PID
- Int_t partCode[AliESDtrack::kSPECIES] =
+ Int_t partCode[AliPID::kSPECIES] =
{kElectron, kMuonMinus, kPiPlus, kKPlus, kProton};
- const char* partName[AliESDtrack::kSPECIES+1] =
+ const char* partName[AliPID::kSPECIES+1] =
{"electron", "muon", "pion", "kaon", "proton", "other"};
- Double_t partFrac[AliESDtrack::kSPECIES] =
+ Double_t partFrac[AliPID::kSPECIES] =
{0.01, 0.01, 0.85, 0.10, 0.05};
- Int_t identified[AliESDtrack::kSPECIES+1][AliESDtrack::kSPECIES];
- for (Int_t iGen = 0; iGen < AliESDtrack::kSPECIES+1; iGen++) {
- for (Int_t iRec = 0; iRec < AliESDtrack::kSPECIES; iRec++) {
+ Int_t identified[AliPID::kSPECIES+1][AliPID::kSPECIES];
+ for (Int_t iGen = 0; iGen < AliPID::kSPECIES+1; iGen++) {
+ for (Int_t iRec = 0; iRec < AliPID::kSPECIES; iRec++) {
identified[iGen][iRec] = 0;
}
}
// calorimeters
TH1F* hEPHOS = CreateHisto("hEPHOS", "PHOS", 100, 0, 5, "E [GeV]", "N");
- TH1F* hEEMCAL = CreateHisto("hEEMCAL", "EMCAL", 100, 0, 2, "E [GeV]", "N");
+ TH1F* hEEMCAL = CreateHisto("hEEMCAL", "EMCAL", 100, 0, 50, "E [GeV]", "N");
// muons
TH1F* hPtMUON = CreateHisto("hPtMUON", "MUON", 100, 0, 20,
}
// get the event summary data
- char esdName[256];
- sprintf(esdName, "ESD%d", iEvent);
- AliESD* esd = (AliESD*) esdFile->Get(esdName);
+ tree->GetEvent(iEvent);
if (!esd) {
Error("CheckESD", "no ESD object found for event %d", iEvent);
return kFALSE;
// PID
if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) continue;
Int_t iGen = 5;
- for (Int_t i = 0; i < AliESDtrack::kSPECIES; i++) {
+ for (Int_t i = 0; i < AliPID::kSPECIES; i++) {
if (TMath::Abs(particle->GetPdgCode()) == partCode[i]) iGen = i;
}
- Double_t probability[AliESDtrack::kSPECIES];
+ Double_t probability[AliPID::kSPECIES];
track->GetESDpid(probability);
Double_t pMax = 0;
Int_t iRec = 0;
- for (Int_t i = 0; i < AliESDtrack::kSPECIES; i++) {
+ for (Int_t i = 0; i < AliPID::kSPECIES; i++) {
probability[i] *= partFrac[i];
if (probability[i] > pMax) {
pMax = probability[i];
if (iGen == iRec) nIdentified++;
// dE/dx and TOF
- Double_t time[AliESDtrack::kSPECIES];
+ Double_t time[AliPID::kSPECIES];
track->GetIntegratedTimes(time);
if (iGen == iRec) {
hDEdxRight->Fill(pTrack.Mag(), track->GetTPCsignal());
}
}
- // loop over calo tracks
- for (Int_t iTrack = 0; iTrack < esd->GetNumberOfCaloTracks(); iTrack++) {
- AliESDCaloTrack* caloTrack = esd->GetCaloTrack(iTrack);
- TParticle* recParticle = caloTrack->GetRecParticle();
- if (recParticle->InheritsFrom("AliPHOSRecParticle")) {
- hEPHOS->Fill(recParticle->Energy());
- } else if (recParticle->InheritsFrom("AliEMCALRecParticle")) {
- hEEMCAL->Fill(recParticle->Energy());
- } else {
- Warning("CheckESD", "unknown calo particle");
- recParticle->Dump();
- }
- }
-
// loop over muon tracks
{
for (Int_t iTrack = 0; iTrack < esd->GetNumberOfMuonTracks(); iTrack++) {
selCascades.Remove(particle);
nRecCascades++;
}
+
+ // loop over the PHOS clusters
+ {
+ Int_t firstPHOSCluster = esd->GetFirstPHOSCluster();
+ Int_t lastPHOSCluster = firstPHOSCluster + esd->GetNumberOfPHOSClusters();
+ for (Int_t iCluster=firstPHOSCluster; iCluster<lastPHOSCluster; iCluster++)
+ hEPHOS->Fill(esd->GetCaloCluster(iCluster)->GetClusterEnergy());
+ }
+
+ // loop over the EMCAL clusters
+ {
+ Int_t firstEMCALCluster = esd->GetFirstEMCALCluster();
+ Int_t lastEMCALCluster = firstEMCALCluster + esd->GetNumberOfEMCALClusters();
+ for (Int_t iCluster=firstEMCALCluster; iCluster<lastEMCALCluster; iCluster++)
+ hEEMCAL->Fill(esd->GetCaloCluster(iCluster)->GetClusterEnergy());
+ }
}
// perform checks
}
printf("%9s:", "gen\\rec");
- for (Int_t iRec = 0; iRec < AliESDtrack::kSPECIES; iRec++) {
+ for (Int_t iRec = 0; iRec < AliPID::kSPECIES; iRec++) {
printf("%9s", partName[iRec]);
}
printf("\n");
- for (Int_t iGen = 0; iGen < AliESDtrack::kSPECIES+1; iGen++) {
+ for (Int_t iGen = 0; iGen < AliPID::kSPECIES+1; iGen++) {
printf("%9s:", partName[iGen]);
- for (Int_t iRec = 0; iRec < AliESDtrack::kSPECIES; iRec++) {
+ for (Int_t iRec = 0; iRec < AliPID::kSPECIES; iRec++) {
printf("%9d", identified[iGen][iRec]);
}
printf("\n");
delete hMassXi;
delete hMassOmega;
+ delete esd;
esdFile->Close();
delete esdFile;