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");
62 AliITSclustererV2 clusterer(geom);
65 if (nev>rl->GetNumberOfEvents()) nev=rl->GetNumberOfEvents();
66 for (Int_t i=0; i<nev; i++) {
67 cerr<<"Processing event number: "<<i<<endl;
70 TTree *out=itsl->TreeR();
76 TTree *in=itsl->TreeD();
78 cerr<<"Can't get digits tree !\n";
81 clusterer.Digits2Clusters(in,out);
82 itsl->WriteRecPoints("OVERWRITE");
83 timer.Stop(); timer.Print();
88 for(Int_t i=0;i<3;i++){
89 ITS->SetSimulationModel(i,new AliITSsimulationFastPoints());
93 for (Int_t i=0; i<nev; i++) {
95 if(itsl->TreeR()== 0x0) itsl->MakeTree("R");
96 TTree* in = (TTree*)itsl->TreeH();
97 TTree* out= (TTree*)itsl->TreeR();
99 ITS->Hits2Clusters(in,out);
100 timer.Stop(); timer.Print();
101 itsl->WriteRecPoints("OVERWRITE");