#if !defined( __CINT__) || defined(__MAKECINT__)
+#include <TROOT.h>
#include <TFile.h>
#include <TError.h>
#include <TH1.h>
#include "AliRunLoader.h"
#include "AliLoader.h"
-#include "AliESD.h"
+#include "AliESDEvent.h"
+#include "AliESDv0.h"
+#include "AliESDcascade.h"
+#include "AliESDMuonTrack.h"
+#include "AliESDCaloCluster.h"
#include "AliRun.h"
#include "AliStack.h"
#include "AliHeader.h"
#include "AliGenEventHeader.h"
#include "AliPID.h"
-#else
-const Int_t kXiMinus = 3312;
-const Int_t kOmegaMinus = 3334;
#endif
-
TH1F* CreateHisto(const char* name, const char* title,
Int_t nBins, Double_t xMin, Double_t xMax,
const char* xLabel = NULL, const char* yLabel = NULL)
Error("CheckESD", "opening ESD file %s failed", esdFileName);
return kFALSE;
}
- AliESD* esd = new AliESD;
+ AliESDEvent * esd = new AliESDEvent;
TTree* tree = (TTree*) esdFile->Get("esdTree");
if (!tree) {
Error("CheckESD", "no ESD tree found");
return kFALSE;
}
- tree->SetBranchAddress("ESD", &esd);
+ esd->ReadFromTree(tree);
- // efficienc and resolution histograms
+ // efficiency and resolution histograms
Int_t nBinsPt = 15;
Float_t minPt = 0.1;
Float_t maxPt = 3.1;
hResTOFWrong->SetLineColor(kRed);
// calorimeters
- TH1F* hEPHOS = CreateHisto("hEPHOS", "PHOS", 100, 0, 5, "E [GeV]", "N");
+ TH1F* hEPHOS = CreateHisto("hEPHOS", "PHOS", 100, 0, 50, "E [GeV]", "N");
TH1F* hEEMCAL = CreateHisto("hEEMCAL", "EMCAL", 100, 0, 50, "E [GeV]", "N");
// muons
runLoader->GetEvent(iEvent);
// select simulated primary particles, V0s and cascades
- AliStack* stack = gAlice->Stack();
+ AliStack* stack = runLoader->Stack();
Int_t nParticles = stack->GetNtrack();
TArrayF vertex(3);
runLoader->GetHeader()->GenEventHeader()->PrimaryVertex(vertex);
if (track->GetLabel() < 0) nFake++;
// resolutions
- Double_t p[3];
- track->GetConstrainedPxPyPz(p);
- TVector3 pTrack(p);
- hResPtInv->Fill(100. * (1./pTrack.Pt() - 1./particle->Pt()) *
+ hResPtInv->Fill(100. * (TMath::Abs(track->GetSigned1Pt()) - 1./particle->Pt()) *
particle->Pt());
- hResPhi->Fill(1000. * (pTrack.Phi() - particle->Phi()));
- hResTheta->Fill(1000. * (pTrack.Theta() - particle->Theta()));
+ hResPhi->Fill(1000. * (track->Phi() - particle->Phi()));
+ hResTheta->Fill(1000. * (track->Theta() - particle->Theta()));
// PID
if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) continue;
Double_t time[AliPID::kSPECIES];
track->GetIntegratedTimes(time);
if (iGen == iRec) {
- hDEdxRight->Fill(pTrack.Mag(), track->GetTPCsignal());
+ hDEdxRight->Fill(particle->P(), track->GetTPCsignal());
if ((track->GetStatus() & AliESDtrack::kTOFpid) != 0) {
hResTOFRight->Fill(track->GetTOFsignal() - time[iRec]);
}
} else {
- hDEdxWrong->Fill(pTrack.Mag(), track->GetTPCsignal());
+ hDEdxWrong->Fill(particle->P(), track->GetTPCsignal());
if ((track->GetStatus() & AliESDtrack::kTOFpid) != 0) {
hResTOFWrong->Fill(track->GetTOFsignal() - time[iRec]);
}
AliESDcascade* cascade = esd->GetCascade(iCascade);
Double_t v0q;
cascade->ChangeMassHypothesis(v0q,kXiMinus);
- hMassXi->Fill(cascade->GetEffMass());
+ hMassXi->Fill(cascade->GetEffMassXi());
cascade->ChangeMassHypothesis(v0q,kOmegaMinus);
- hMassOmega->Fill(cascade->GetEffMass());
+ hMassOmega->Fill(cascade->GetEffMassXi());
Int_t negLabel = TMath::Abs(esd->GetTrack(cascade->GetNindex())
->GetLabel());
nRecCascades++;
}
- // loop over the PHOS clusters
+ // loop over the 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());
+ for (Int_t iCluster=0; iCluster<esd->GetNumberOfCaloClusters(); iCluster++) {
+ AliESDCaloCluster * clust = esd->GetCaloCluster(iCluster);
+ if (clust->IsPHOS()) hEPHOS->Fill(clust->E());
+ if (clust->IsEMCAL()) hEEMCAL->Fill(clust->E());
+ }
}
- // 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