From ee9b73fc95653fa753f803040e9d378555fc01c3 Mon Sep 17 00:00:00 2001 From: masera Date: Wed, 30 Jan 2008 17:02:41 +0000 Subject: [PATCH] Adapted to new ESD format (M. Nicassio) --- ITS/testITSMultReco.C | 105 ++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 61 deletions(-) diff --git a/ITS/testITSMultReco.C b/ITS/testITSMultReco.C index 2afeea8f548..048ca32bff4 100755 --- a/ITS/testITSMultReco.C +++ b/ITS/testITSMultReco.C @@ -3,31 +3,27 @@ #include #include #include -#include #include #include "AliRunLoader.h" -#include "AliESD.h" #include "AliRun.h" +#include "AliESDEvent.h" -#include "AliITSgeom.h" #include "AliITSLoader.h" #include "AliITSMultReconstructor.h" +#include "AliGeomManager.h" #endif -void testITSMultReco(Char_t* dir = ".") { + void testITSMultReco(Char_t* dir = ".") { - Char_t str[256]; + Char_t fileName[256]; - // ######################################################## // defining pointers AliRunLoader* runLoader; - TFile* esdFile = 0; TTree* esdTree = 0; - AliESD* esd = 0; + AliESDEvent* esd = new AliESDEvent(); - // ######################################################### // get runloader if (gAlice) { @@ -36,58 +32,42 @@ void testITSMultReco(Char_t* dir = ".") { gAlice=0; } - sprintf(str,"%s/galice.root",dir); - runLoader = AliRunLoader::Open(str); - if (runLoader == 0x0) { + sprintf(fileName,"%s/galice.root",dir); + runLoader = AliRunLoader::Open(fileName); +/* if (runLoader == 0x0) { cout << "Can not open session"<IsOpen()) - esdFile->Close(); - - sprintf(str,"%s/AliESDs.root",dir); - esdFile = TFile::Open(str); - esdTree = (TTree*)esdFile->Get("esdTree"); - TBranch * esdBranch = esdTree->GetBranch("ESD"); - esdBranch->SetAddress(&esd); - + sprintf(fileName,"%s/AliESDs.root",dir); + TFile esdFile(fileName, "READ"); + esdTree = (TTree*)esdFile.Get("esdTree"); + esd->ReadFromTree(esdTree); - // ######################################################### - // setup its stuff + // setup ITS stuff AliITSLoader* itsLoader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); if (!itsLoader) { cout << " Can't get the ITS loader!" << endl; return ; } - AliITSgeom* itsGeo=itsLoader->GetITSgeom(); itsLoader->LoadRecPoints("read"); - // ######################################################### AliITSMultReconstructor* multReco = new AliITSMultReconstructor(); - multReco->SetGeometry(itsGeo); +// multReco->SetGeometry(itsGeo); - // ######################################################### // getting number of events Int_t nEvents = (Int_t)runLoader->GetNumberOfEvents(); - Int_t nESDEvents = esdBranch->GetEntries(); + Int_t nESDEvents = esdTree->GetEntries(); if (nEvents!=nESDEvents) { cout << " Different number of events from runloader and esdtree!!!" @@ -95,18 +75,17 @@ void testITSMultReco(Char_t* dir = ".") { return; } - // ######################################################## // loop over number of events cout << nEvents << " event(s) found in the file set" << endl; - for(Int_t i=0; iGetEvent(i); - esdBranch->GetEntry(i); + runLoader->GetEvent(iEv); + esdTree->GetEvent(iEv); + + // get the ESD vertex - // ######################################################## - // get the EDS vertex const AliESDVertex* vtxESD = esd->GetVertex(); Double_t vtx[3]; vtxESD->GetXYZ(vtx); @@ -114,31 +93,35 @@ void testITSMultReco(Char_t* dir = ".") { esdVtx[0] = vtx[0]; esdVtx[1] = vtx[1]; esdVtx[2] = vtx[2]; - - ///######################################################### +// cout<<"vertex Z->"<TreeR(); if (!itsClusterTree) { cerr<< " Can't get the ITS cluster tree !\n"; return; } + multReco->SetHistOn(kTRUE); multReco->Reconstruct(itsClusterTree, esdVtx, esdVtx); - cout <<" >>>> Number of tracklets: "<GetNTracklets()<GetNTracklets(); t++) { + cout <<"Number of tracklets: "<GetNTracklets()<GetNTracklets(); itr++) { - cout << " tracklet " << t - << " , theta = " << multReco->GetTracklet(t)[0] - << " , phi = " << multReco->GetTracklet(t)[1] - << " , DeltaPhi = " << multReco->GetTracklet(t)[2]<< endl; + cout << " tracklet " << itr + << " , theta = " << multReco->GetTracklet(itr)[0] + << " , phi = " << multReco->GetTracklet(itr)[1] + << " , DeltaPhi = " << multReco->GetTracklet(itr)[2]<< endl; + } - cout <<" >>>> Number of single layer 1 clusters: "<GetNSingleClusters()<GetNSingleClusters(); t++) { + cout<<""<GetNSingleClusters()<GetNSingleClusters(); iscl++) { - cout << " cluster " << t - << " , theta = " << multReco->GetCluster(t)[0] - << " , phi = " << multReco->GetCluster(t)[1] << endl; + cout << " cluster " << iscl + << " , theta = " << multReco->GetCluster(iscl)[0] + << " , phi = " << multReco->GetCluster(iscl)[1] << endl; } } @@ -150,4 +133,4 @@ void testITSMultReco(Char_t* dir = ".") { fout->Close(); -} +} \ No newline at end of file -- 2.43.0