#include "TFile.h"
#include "TSystem.h"
#include "TStopwatch.h"
- #include "TGeant3.h"
+ #include "TArrayF.h"
#include "AliMagF.h"
#include "AliRun.h"
#include "AliRunLoader.h"
#include "AliLoader.h"
+ #include "AliHeader.h"
+ #include "AliGenEventHeader.h"
#include "AliESD.h"
#include "AliESDpid.h"
#include "AliTRDPartID.h"
#include "AliTOFpidESD.h"
+ #include "AliTOF.h"
+ #include "AliTOFGeometry.h"
#endif
-extern TSystem *gSystem;
extern AliRun *gAlice;
extern TFile *gFile;
-Int_t AliESDtest(Int_t nev=1) {
+Int_t AliESDtest(Int_t nev=1,Int_t run=0) {
/**** Initialization of the NewIO *******/
gAlice=0;
}
- gSystem->Load("libgeant321"); // needed for the PID in TOF
- new TGeant3(""); // must be re-done !
-
AliRunLoader *rl = AliRunLoader::Open("galice.root");
if (rl == 0x0) {
cerr<<"Can not open session"<<endl;
//An instance of the ITS tracker
AliITStrackerV2 itsTracker(geom);
- {Double_t xyz[]={0.,0.,0.}, ers[]={0.005, 0.005, 0.010};
- itsTracker.SetVertex(xyz,ers);}
//An instance of the ITS PID maker
Double_t parITS[]={34.,0.15,10.};
/**** The TOF corner ********************/
+ AliTOF *dTOF = (AliTOF*)gAlice->GetDetector("TOF");
+ if (!dTOF) {
+ cerr<<"AliESDtest.C : Can not find the TOF detector !"<<endl;
+ return 4;
+ }
+ AliTOFGeometry *tofGeo = dTOF->GetGeometry();
+ if (!tofGeo) {
+ cerr<<"AliESDtest.C : Can not find the TOF geometry !"<<endl;
+ return 4;
+ }
AliLoader* tofl = rl->GetLoader("TOFLoader");
if (tofl == 0x0) {
for (Int_t i=0; i<nev; i++) {
cerr<<"\n\nProcessing event number : "<<i<<endl;
AliESD *event=new AliESD();
+ event->SetRunNumber(run);
+ event->SetEventNumber(i);
rl->GetEvent(i);
+//***** Primary vertex reconstruction (MC vertex position, for the moment)
+ TArrayF v(3);
+ rl->GetHeader()->GenEventHeader()->PrimaryVertex(v);
+ Double_t vtx[3]={v[0],v[1],v[2]};
+ Double_t cvtx[6]={
+ 0.005,
+ 0.000, 0.005,
+ 0.000, 0.000, 0.010
+ };
+ event->SetVertex(vtx,cvtx);
+ cvtx[1]=cvtx[0]; cvtx[2]=cvtx[5]; //trackers use only the diag.elements
//***** Initial path towards the primary vertex
+ tpcTracker.SetVertex(vtx,cvtx);
TTree *tpcTree=tpcl->TreeR();
if (!tpcTree) {
cerr<<"Can't get the TPC cluster tree !\n";
tpcTracker.LoadClusters(tpcTree);
rc+=tpcTracker.Clusters2Tracks(event);
+ itsTracker.SetVertex(vtx,cvtx);
TTree *itsTree=itsl->TreeR();
if (!itsTree) {
cerr<<"Can't get the ITS cluster tree !\n";
cerr<<"Can't get the TOF cluster tree !\n";
return 4;
}
- tofPID.LoadClusters(tofTree);
+ tofPID.LoadClusters(tofTree,tofGeo);
tofPID.MakePID(event);
tofPID.UnloadClusters();
//***** Hyperon reconstruction
+ vtxer.SetVertex(vtx);
rc+=vtxer.Tracks2V0vertices(event); // V0 finding
rc+=cvtxer.V0sTracks2CascadeVertices(event); // cascade finding