X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FtestITSMultReco.C;h=b4ff7d947a4ac09c41e3694f5da774093e16a638;hb=e236b0eb6aa86adbd25d32e8a0a4654285dcafcb;hp=49572f63c79aae83dd012e5f77a049eb84cc698e;hpb=ac903f1b3a3d49cedaca16dfc5e899181f4cca5e;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/testITSMultReco.C b/ITS/testITSMultReco.C index 49572f63c79..b4ff7d947a4 100755 --- a/ITS/testITSMultReco.C +++ b/ITS/testITSMultReco.C @@ -3,79 +3,57 @@ #include #include #include -#include +#include #include "AliRunLoader.h" -#include "AliESD.h" #include "AliRun.h" +#include "AliESDEvent.h" -#include "AliITS.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(); - // ######################################################### - // setup galice and runloader + // get runloader if (gAlice) { - delete gAlice->GetRunLoader(); + delete AliRunLoader::Instance(); delete gAlice; 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"<LoadgAlice(); - gAlice = runLoader->GetAliRun(); - runLoader->LoadKinematics(); - runLoader->LoadHeader(); + // open the ESD file and get the tree - // ######################################################### - // open esd file and get the tree + sprintf(fileName,"%s/AliESDs.root",dir); + TFile esdFile(fileName, "READ"); + esdTree = (TTree*)esdFile.Get("esdTree"); + esd->ReadFromTree(esdTree); - // close it first to avoid memory leak - if (esdFile) - if (esdFile->IsOpen()) - esdFile->Close(); + // setup ITS stuff - sprintf(str,"%s/AliESDs.root",dir); - esdFile = TFile::Open(str); - esdTree = (TTree*)esdFile->Get("esdTree"); - TBranch * esdBranch = esdTree->GetBranch("ESD"); - esdBranch->SetAddress(&esd); - - - // ######################################################### - // setup its stuff - - AliITS* its=(AliITS*)runLoader->GetAliRun()->GetDetector("ITS"); - if (!its) { - cout << " Can't get the ITS!" << endl; - return ; - } - AliITSgeom* itsGeo=its->GetITSgeom(); - if (!itsGeo) { - cout << " Can't get the ITS geometry!" << endl; - return ; - } AliITSLoader* itsLoader = (AliITSLoader*)runLoader->GetLoader("ITSLoader"); if (!itsLoader) { cout << " Can't get the ITS loader!" << endl; @@ -83,15 +61,13 @@ void testITSMultReco(Char_t* dir = ".") { } 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!!!" @@ -99,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); @@ -118,23 +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); - - for (Int_t t=0; tGetNTracklets(); t++) { + cout <<"Number of tracklets: "<GetNTracklets()<GetNTracklets(); itr++) { + + cout << " tracklet " << itr + << " , theta = " << multReco->GetTracklet(itr)[0] + << " , phi = " << multReco->GetTracklet(itr)[1] + << " , DeltaPhi = " << multReco->GetTracklet(itr)[2]<< endl; + + } + cout<<""<GetNSingleClusters()<GetNSingleClusters(); iscl++) { - cout << " tracklet " << t - << " , theta = " << multReco->GetTracklet(t)[0] - << " , phi = " << multReco->GetTracklet(t)[1] << endl; + cout << " cluster " << iscl + << " , theta = " << multReco->GetCluster(iscl)[0] + << " , phi = " << multReco->GetCluster(iscl)[1] << endl; } }