X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=TPC%2FAliTPCFindTracksMI.C;h=e0b19a1676e496e5187f90a693803fcd941df707;hp=7e3acc0d6cd0abf17a14792e32afe1dacdcc8e8d;hb=434772a9396e80b01832df4e87583439d0328841;hpb=1c53abe24c5f70da7045524e204946b440fe5b21 diff --git a/TPC/AliTPCFindTracksMI.C b/TPC/AliTPCFindTracksMI.C index 7e3acc0d6cd..e0b19a1676e 100644 --- a/TPC/AliTPCFindTracksMI.C +++ b/TPC/AliTPCFindTracksMI.C @@ -3,47 +3,114 @@ ****************************************************************************/ #ifndef __CINT__ -#include -#include "AliTPCParam.h" -#include "AliTPCtrackerMI.h" -#include "TFile.h" -#include "TStopwatch.h" -#include "AliRun.h" -#include "AliMagF.h" + #include + #include "AliTPCParam.h" + #include "AliTPCtracker.h" + + #include "TFile.h" + #include "TStopwatch.h" #endif -Int_t AliTPCFindTracks(Int_t eventn=1) { +Int_t AliTPCFindTracksMI(Int_t N=-1) { + cerr<<"Looking for tracks...\n"; - TFile f("galice.root"); - gAlice = (AliRun*)f.Get("gAlice"); - AliKalmanTrack::SetConvConst(1000/0.299792458/gAlice->Field()->SolenoidField()); - TFile *out=TFile::Open("AliTPCtracks.root","new"); - if (!out->IsOpen()) {cerr<<"Delete old AliTPCtracks.root !\n"; return 1;} - TFile *in=TFile::Open("AliTPCclusters.root"); - if (!in->IsOpen()) {cerr<<"Can't open AliTPCclusters.root !\n"; return 2;} + if (gAlice) + { + delete gAlice->GetRunLoader(); + delete gAlice; + gAlice = 0x0; + } + + rl = AliRunLoader::Open("galice.root"); + if (rl == 0x0) + { + cerr<<"Can not open session"<GetLoader("TPCLoader"); + if (tpcl == 0x0) + { + cerr<<"Can not get TPC Loader"<LoadgAlice()) + { + cerr<<"Error occured while l"<GetAliRun()->Field()->SolenoidField()); + rl->UnloadgAlice(); + + rl->CdGAFile(); + + AliTPCParam *dig=(AliTPCParam *)gDirectory->Get("75x40_100x60_150x60"); + if (!dig) + { + dig=(AliTPCParam *)gDirectory->Get("75x40_100x60"); + if (!param) + { + cerr<<"TPC parameters have not been found !\n"; + return 1; + } + else + { + cout<<"TPC 75x40_100x60 geometry found"<Get("75x40_100x60_150x60"); - if (!par) {cerr<<"Can't get TPC parameters !\n"; return 3;} - + + tpcl->LoadTracks("recreate"); + + Int_t eventn; + if (N<=0) + { + eventn = rl->GetNumberOfEvents(); + rl->UnloadHeader(); + } + else + eventn = N; + TStopwatch timer; - Int_t rc=0; - for (Int_t i=0;iSetVertex(xyz); //primary vertex - rc=tracker->Clusters2Tracks(0,out); - delete tracker; - } + for (Int_t i=0;iTreeR(); + if (input == 0x0) + { + tpcl->LoadRecPoints("read"); + input = tpcl->TreeR(); + if (input == 0x0) + { + cerr << "Problems with input tree (TreeR) for event " << i <TreeT(); + if (output == 0x0) + { + tpcl->MakeTree("T"); + output = tpcl->TreeT(); + if (output == 0x0) + { + cerr << "Problems with output tree (TreeT) for event " << i <Clusters2Tracks(); + delete tracker; + } timer.Stop(); timer.Print(); - delete par; //Thanks to Mariana Bondila - - in->Close(); - out->Close(); - + delete dig; //Thanks to Mariana Bondila + delete rl; return rc; }