]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSFindClustersV2.C
9521a59e4bc0dbe32d3e9a5cf6418d79dfa8a716
[u/mrichter/AliRoot.git] / ITS / AliITSFindClustersV2.C
1 /****************************************************************************
2  *           Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch                 *
3  ****************************************************************************/
4
5 #ifndef __CINT__
6   #include <iostream.h>
7
8   #include "AliRun.h"
9   #include "AliITS.h"
10   #include "AliITSgeom.h"
11   #include "AliITSclustererV2.h"
12
13   #include "TFile.h"
14   #include "TStopwatch.h"
15 #endif
16
17 Int_t AliITSFindClustersV2(Char_t SlowOrFast='s',Int_t eventn=1) {
18
19    cerr<<"Looking for clusters...\n";
20
21    TFile *in=TFile::Open("galice.root");
22    if (!in->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 2;}
23    if (!(gAlice=(AliRun*)in->Get("gAlice"))) {
24       cerr<<"Can't find gAlice !\n";
25       return 2;
26    }
27    AliITS *ITS  = (AliITS*)gAlice->GetModule("ITS");
28    if (!ITS) { cerr<<"Can't find the ITS !\n"; return 3; }
29
30    AliITSgeom *geom=ITS->GetITSgeom();
31
32    TFile *out=TFile::Open("AliITSclustersV2.root","new");
33    if (!out->IsOpen()) {
34       cerr<<"Delete old AliITSclustersV2.root !\n"; return 1;}
35    geom->Write();
36
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);
46    }
47    timer.Stop(); timer.Print();
48
49    delete gAlice; gAlice=0;
50    out->Close();
51    in->Close();
52
53    return 0;
54 }
55
56
57