#include <TText.h>
#include <TBenchmark.h>
#include <TStyle.h>
- #include <TKey.h>
+ #include <TFile.h>
#include <TROOT.h>
#include "AliStack.h"
return 5;
}
}
- TKey *key=0;
- TIter next(ef->GetListOfKeys());
-
+ AliESD* event = new AliESD;
+ TTree* esdTree = (TTree*) ef->Get("esdTree");
+ if (!esdTree) {
+ ::Error("AliCascadeComparison.C", "no ESD tree found");
+ return 6;
+ }
+ esdTree->SetBranchAddress("ESD", &event);
//******* Loop over events *********
Int_t e=0;
- while ((key=(TKey*)next())!=0) {
+ while (esdTree->GetEvent(e)) {
cout<<endl<<endl<<"********* Processing event number: "<<e<<"*******\n";
- AliESD *event=(AliESD*)key->ReadObj();
-
Int_t nentr=event->GetNumberOfCascades();
allfound+=nentr;
brefs->Clear();
prefs->Clear();
nrefs->Clear();
- delete event;
} //**** End of the loop over events
+ delete event;
ef->Close();
delete csTree;
#include <TText.h>
#include <TBenchmark.h>
#include <TStyle.h>
- #include <TKey.h>
+ #include <TFile.h>
#include <TROOT.h>
#include "AliStack.h"
return 4;
}
}
- TKey *key=0;
- TIter next(ef->GetListOfKeys());
-
+ AliESD* event = new AliESD;
+ TTree* esdTree = (TTree*) ef->Get("esdTree");
+ if (!esdTree) {
+ ::Error("AliITSComparison.C", "no ESD tree found");
+ return 6;
+ }
+ esdTree->SetBranchAddress("ESD", &event);
//******* Loop over events *********
Int_t e=0;
- while ((key=(TKey*)next())!=0) {
+ while (esdTree->GetEvent(e)) {
cout<<endl<<endl<<"********* Processing event number: "<<e<<"*******\n";
- AliESD *event=(AliESD*)key->ReadObj();
-
Float_t field=event->GetMagneticField();
AliKalmanTrack::SetConvConst(1000/0.299792458/field);
cout<<"Number of \"good\" tracks : "<<ngood<<endl;
refs->Clear();
- delete event;
} //***** End of the loop over events
+ delete event;
ef->Close();
delete itsTree;
#if !defined(__CINT__) || defined(__MAKECINT__)
#include "Riostream.h"
- #include "TKey.h"
+ #include "TFile.h"
+ #include "TTree.h"
#include "TStopwatch.h"
#include "AliRun.h"
#include "AliITSLoader.h"
#include "AliITS.h"
#include "AliITSgeom.h"
- #include "AliITStrackerV2.h"
+ #include "AliITStrackerANN.h"
#include "AliESD.h"
#endif
cerr<<"Can't AliESDtpc.root !\n";
return 1;
}
+ AliESD* event = new AliESD;
+ TTree* esdTree = (TTree*) tpcf->Get("esdTree");
+ if (!esdTree) {
+ cerr<<"no ESD tree found !\n";
+ return 1;
+ }
+ esdTree->SetBranchAddress("ESD", &event);
// Loop on events
- TKey *key=0;
- TIter next(tpcf->GetListOfKeys());
TStopwatch timer;
for (Int_t i = 0; i < nev; i++) {
- tpcf->cd();
- if ((key=(TKey*)next())==0) break;
cerr << "Processing event number: " << i << endl;
- AliESD *event=(AliESD*)key->ReadObj();
+ esdTree->GetEvent(i);
rl->GetEvent(i);
// End of operations: unload clusters
tracker.UnloadClusters();
- delete event;
}
timer.Stop();
timer.Print();
// Close files & delete objects
+ delete event;
tpcf->Close();
itsf->Close();
delete rl;
#include <TText.h>
#include <TBenchmark.h>
#include <TStyle.h>
- #include <TKey.h>
+ #include <TFile.h>
#include <TROOT.h>
#include "AliStack.h"
return 5;
}
}
- TKey *key=0;
- TIter next(ef->GetListOfKeys());
+ AliESD* event = new AliESD;
+ TTree* esdTree = (TTree*) ef->Get("esdTree");
+ if (!esdTree) {
+ ::Error("AliV0Comparison.C", "no ESD tree found");
+ return 6;
+ }
+ esdTree->SetBranchAddress("ESD", &event);
//******* Loop over events *********
Int_t e=0;
- while ((key=(TKey*)next())!=0) {
+ while (esdTree->GetEvent(e)) {
cout<<endl<<endl<<"********* Processing event number: "<<e<<"*******\n";
- AliESD *event=(AliESD*)key->ReadObj();
-
Int_t nentr=event->GetNumberOfV0s();
allfound+=nentr;
prefs->Clear();
nrefs->Clear();
- delete event;
} //**** End of the loop over events
+ delete event;
ef->Close();
delete v0Tree;
#if !defined( __CINT__) || defined(__MAKECINT__)
#include <Riostream.h>
- #include "TKey.h"
+ #include "TTree.h"
#include "TFile.h"
#include "TH1F.h"
#include "TCanvas.h"
//****** File with the ESD
TFile *ef=TFile::Open("AliESDcheck.root");
if (!ef || !ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;}
+ AliESD* event = new AliESD;
+ TTree* tree = (TTree*) ef->Get("esdTree");
+ if (!tree) {cerr<<"no ESD tree found\n"; return 1;};
+ tree->SetBranchAddress("ESD", &event);
Int_t n=0;
- TKey *key=0;
- TIter next(ef->GetListOfKeys());
//******* The loop over events
- while ((key=(TKey*)next())!=0) {
+ while (tree->GetEvent(n)) {
cout<<endl<<"Processing event number : "<<n++<<endl;
- AliESD *event=(AliESD*)key->ReadObj();
-
Int_t npmdcl=event->GetNumberOfPmdTracks();
cout<<"Number of PMD tracks : "<<npmdcl<<endl;
#include <TParticle.h>
#include <TCanvas.h>
#include <TBenchmark.h>
- #include <TKey.h>
+ #include <TFile.h>
+ #include <TTree.h>
#include <TROOT.h>
#include <AliStack.h>
delete rl;
return 1;
}
- TKey *key=0;
- TIter next(ef->GetListOfKeys());
+ AliESD* event = new AliESD;
+ TTree* tree = (TTree*) ef->Get("esdTree");
+ if (!tree) {
+ ::Error("AliESDComparison.C", "no ESD tree found");
+ delete rl;
+ return 1;
+ }
+ tree->SetBranchAddress("ESD", &event);
//****** Tentative particle type "concentrations"
Double_t c[5]={0.01, 0.01, 0.85, 0.10, 0.05};
//******* The loop over events
Int_t e=0;
- while ((key=(TKey*)next())!=0) {
+ while (tree->GetEvent(e)) {
cout<<endl<<endl<<"********* Processing event number: "<<e<<"*******\n";
- rl->GetEvent(e); ef->cd();
+ rl->GetEvent(e);
e++;
- AliESD *event=(AliESD*)key->ReadObj();
-
Int_t ntrk=event->GetNumberOfTracks();
cerr<<"Number of ESD tracks : "<<ntrk<<endl;
}
}
}
- delete event;
cout<<"Number of selected ESD tracks : "<<nsel<<endl;
cout<<"Number of selected pion ESD tracks : "<<pisel<<endl;
cout<<"Number of selected kaon ESD tracks : "<<kasel<<endl;
} // ***** End of the loop over events
+ delete event;
ef->Close();
TCanvas *c1=(TCanvas*)gROOT->FindObject("c1");
#if !defined( __CINT__) || defined(__MAKECINT__)
#include <Riostream.h>
- #include "TKey.h"
+ #include <TTree.h>
#include "TFile.h"
#include "TH1F.h"
#include "TCanvas.h"
//****** File with the ESD
TFile *ef=TFile::Open("AliESDs.root");
if (!ef || !ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;}
+ AliESD* event = new AliESD;
+ TTree* tree = (TTree*) ef->Get("esdTree");
+ if (!tree) {cerr<<"no ESD tree found\n"; return 1;};
+ tree->SetBranchAddress("ESD", &event);
Int_t n=0;
- TKey *key=0;
- TIter next(ef->GetListOfKeys());
//******* The loop over events
- while ((key=(TKey*)next())!=0) {
+ while (tree->GetEvent(n)) {
cout<<endl<<"Processing event number : "<<n++<<endl;
- AliESD *event=(AliESD*)key->ReadObj();
-
Int_t ntrk=event->GetNumberOfTracks();
cout<<"Number of ESD tracks : "<<ntrk<<endl;
Int_t nv0=event->GetNumberOfV0s();
}
+ delete event;
+ ef->Close();
+
timer.Stop(); timer.Print();
TCanvas *c1=new TCanvas("c1","",0,0,600,1200);
#if !defined( __CINT__) || defined(__MAKECINT__)
#include <Riostream.h>
- #include "TKey.h"
+ #include <TTree.h>
#include "TFile.h"
#include "TH1F.h"
#include "TH2F.h"
TFile *ef=TFile::Open("AliESDs.root");
if (!ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;}
+ AliESD* event = new AliESD;
+ TTree* tree = (TTree*) ef->Get("esdTree");
+ if (!tree) {cerr<<"no ESD tree found\n"; return 1;};
+ tree->SetBranchAddress("ESD", &event);
TStopwatch timer;
Int_t rc=0,n=0;
- TKey *key=0;
- TIter next(ef->GetListOfKeys());
//****** Tentative particle type "concentrations"
Double_t c[5]={0.0, 0.0, 0.1, 0.1, 0.1};
//******* The loop over events
- while ((key=(TKey*)next())!=0) {
+ while (tree->GetEvent(n)) {
cerr<<"Processing event number : "<<n++<<endl;
- AliESD *event=(AliESD*)key->ReadObj();
-
Int_t nv0=event->GetNumberOfV0s();
cerr<<"Number of ESD v0s : "<<nv0<<endl;
Double_t mass=v0->GetEffMass();
hm->Fill(mass);
}
- delete event;
}
+ delete event;
+ ef->Close();
+
timer.Stop(); timer.Print();
hm->Draw();
#include <TCanvas.h>
#include <TVector3.h>
#include <TPDGCode.h>
+#include <TParticle.h>
#include "AliRunLoader.h"
#include "AliLoader.h"
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;
}
// 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;
}
// 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();
+ for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
+ AliESDtrack* track = esd->GetTrack(iTrack);
+ if (track->IsPHOS()) {
+ hEPHOS->Fill(track->GetPHOSsignal());
+ } else if (track->IsEMCAL()) {
+ hEEMCAL->Fill(track->GetEMCALsignal());
}
}
delete hMassXi;
delete hMassOmega;
+ delete esd;
esdFile->Close();
delete esdFile;
#include <TText.h>
#include <TBenchmark.h>
#include <TStyle.h>
- #include <TKey.h>
+ #include <TFile.h>
#include <TROOT.h>
#include "AliStack.h"
delete rl;
return 4;
}
- TKey *key=0;
- TIter next(ef->GetListOfKeys());
+ AliESD* event = new AliESD;
+ TTree* esdTree = (TTree*) ef->Get("esdTree");
+ if (!esdTree) {
+ ::Error("AliTOFComparison.C", "no ESD tree found");
+ return 5;
+ }
+ esdTree->SetBranchAddress("ESD", &event);
//******* Loop over events *********
Int_t e=0;
- while ((key=(TKey*)next())!=0) {
+ while (esdTree->GetEvent(e)) {
cout<<endl<<endl<<"********* Processing event number: "<<e<<"*******\n";
- rl->GetEvent(e); ef->cd();
+ rl->GetEvent(e);
TTree *digTree=tofl->TreeD();
if (!digTree) {
- AliESD *event=(AliESD*)key->ReadObj();
Int_t ntrk=event->GetNumberOfTracks();
cerr<<"Number of ESD tracks : "<<ntrk<<endl;
allgood+=ngood; allmatched+=matched; allmismatched+=mismatched;
refs->Clear();
- delete event;
} //***** End of the loop over events
+ delete event;
ef->Close();
delete tofTree;
#include <TText.h>
#include <TBenchmark.h>
#include <TStyle.h>
- #include <TKey.h>
+ #include <TFile.h>
#include <TROOT.h>
#include "AliStack.h"
return 5;
}
}
- TKey *key=0;
- TIter next(ef->GetListOfKeys());
+ AliESD* event = new AliESD;
+ TTree* esdTree = (TTree*) ef->Get("esdTree");
+ if (!esdTree) {
+ ::Error("AliTPCComparison.C", "no ESD tree found");
+ return 6;
+ }
+ esdTree->SetBranchAddress("ESD", &event);
//******* Loop over events *********
Int_t e=0;
- while ((key=(TKey*)next())!=0) {
+ while (esdTree->GetEvent(e)) {
cout<<endl<<endl<<"********* Processing event number: "<<e<<"*******\n";
- AliESD *event=(AliESD*)key->ReadObj();
-
Int_t nentr=event->GetNumberOfTracks();
allfound+=nentr;
cout<<"Number of \"good\" tracks ="<<ngood<<endl;
refs->Clear();
- delete event;
}// ***** End of the loop over events
+ delete event;
ef->Close();
delete tpcTree;