1 /****************************************************************************
2 * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch *
3 ****************************************************************************/
5 #if !defined(__CINT__) || defined(__MAKECINT__)
9 #include "AliRunLoader.h"
10 #include "AliITSLoader.h"
12 #include "AliITSgeom.h"
13 #include "AliITSclustererV2.h"
16 #include "TStopwatch.h"
19 extern AliRun *gAlice;
21 Int_t AliITSFindClustersV2(Int_t nev=5, Char_t SlowOrFast='s') {
23 cerr<<"Looking for clusters...\n";
26 delete gAlice->GetRunLoader();
31 AliRunLoader *rl = AliRunLoader::Open("galice.root");
33 cerr<<"AliITSFindClustersV2.C : Can not open session RL=NULL"<< endl;
37 AliITSLoader *itsl = (AliITSLoader*)rl->GetLoader("ITSLoader");
39 cerr<<"AliITSFindClustersV2.C : can not get ITS loader"<< endl;
45 Int_t retval = rl->LoadgAlice();
47 cerr<<"AliITSFindClustersV2.C : LoadgAlice returned error"<< endl;
52 gAlice=rl->GetAliRun();
53 AliITS *ITS = (AliITS*)gAlice->GetModule("ITS");
54 if (!ITS) { cerr<<"Can't find the ITS !\n"; delete rl; return 3; }
55 AliITSgeom *geom=ITS->GetITSgeom();
57 itsl->LoadRecPoints("recreate");
58 if (SlowOrFast=='s') itsl->LoadDigits("read");
59 else itsl->LoadHits("read");
61 AliITSclustererV2 clusterer(geom);
64 if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
65 for (Int_t i=0; i<nev; i++) {
66 cerr<<"Processing event number: "<<i<<endl;
69 TTree *out=itsl->TreeR();
75 if (SlowOrFast=='s') {
76 TTree *in=itsl->TreeD();
78 cerr<<"Can't get digits tree !\n";
81 clusterer.Digits2Clusters(in,out);
83 TTree *in=itsl->TreeH();
85 cerr<<"Can't get hits tree !\n";
88 clusterer.Hits2Clusters(in,out);
91 itsl->WriteRecPoints("OVERWRITE");
93 timer.Stop(); timer.Print();