New AliITSclustererV2 class: update of V2 test macros
[u/mrichter/AliRoot.git] / ITS / AliITSFindClustersV2.C
CommitLineData
f2718ade 1/****************************************************************************
2 * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch *
3 ****************************************************************************/
4
03248e6d 5#ifndef __CINT__
f2718ade 6 #include <iostream.h>
03248e6d 7
8 #include "AliRun.h"
9 #include "AliITS.h"
10 #include "AliITSgeom.h"
f2718ade 11 #include "AliITSclustererV2.h"
03248e6d 12
13 #include "TFile.h"
f2718ade 14 #include "TStopwatch.h"
03248e6d 15#endif
16
f2718ade 17Int_t AliITSFindClustersV2(Char_t SlowOrFast='s',Int_t eventn=1) {
03248e6d 18
f2718ade 19 cerr<<"Looking for clusters...\n";
03248e6d 20
21 TFile *in=TFile::Open("galice.root");
f2718ade 22 if (!in->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 2;}
03248e6d 23 if (!(gAlice=(AliRun*)in->Get("gAlice"))) {
24 cerr<<"Can't find gAlice !\n";
25 return 2;
26 }
03248e6d 27 AliITS *ITS = (AliITS*)gAlice->GetModule("ITS");
28 if (!ITS) { cerr<<"Can't find the ITS !\n"; return 3; }
f2718ade 29
03248e6d 30 AliITSgeom *geom=ITS->GetITSgeom();
f2718ade 31
03248e6d 32 TFile *out=TFile::Open("AliITSclustersV2.root","new");
33 if (!out->IsOpen()) {
f2718ade 34 cerr<<"Delete old AliITSclustersV2.root !\n"; return 1;}
03248e6d 35 geom->Write();
36
f2718ade 37 TStopwatch timer;
38 AliITSclustererV2 clusterer(geom);
39 for (Int_t i=0; i<eventn; i++) {
40 cerr<<"Processing event number: "<<i<<endl;
41 gAlice->GetEvent(i);
42 //ITS->MakeTreeC(); //To make the V1 cluster finders happy
43 clusterer.SetEvent(i);
44 if (SlowOrFast=='s') clusterer.Digits2Clusters(in,out);
45 else clusterer.Hits2Clusters(in,out);
03248e6d 46 }
f2718ade 47 timer.Stop(); timer.Print();
03248e6d 48
49 delete gAlice; gAlice=0;
03248e6d 50 out->Close();
f2718ade 51 in->Close();
03248e6d 52
53 return 0;
03248e6d 54}
55
56
57