]>
Commit | Line | Data |
---|---|---|
7eba3bde | 1 | Int_t AliITSFindClusters() { |
2 | ||
3 | printf("FindClusters\n"); | |
4 | ||
5 | TFile *in=TFile::Open("galice.root","UPDATE"); | |
6 | if (!in->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 2;} | |
7 | ||
8 | in->ls(); | |
9 | ||
10 | if (!(gAlice=(AliRun*)in->Get("gAlice"))) { | |
11 | cerr<<"gAlice have not been found on galice.root !\n"; | |
12 | return 2; | |
13 | } | |
14 | ||
15 | ||
16 | gAlice->GetEvent(0); | |
17 | ||
18 | AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS"); | |
19 | if (!ITS) { | |
20 | cerr<<"ITSFindClusters.C : AliITS object not found on file\n"; | |
21 | return 3; | |
22 | } | |
23 | Int_t ver = ITS->IsVersion(); | |
24 | cerr<<"ITS version "<<ver<<" has been found !\n"; | |
25 | ||
26 | // Set the models for cluster finding | |
27 | AliITSgeom *geom = ITS->GetITSgeom(); | |
28 | ||
29 | // SPD | |
30 | AliITSDetType *iDetType=ITS->DetType(0); | |
31 | AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel(); | |
32 | TClonesArray *dig0 = ITS->DigitsAddress(0); | |
33 | TClonesArray *recp0 = ITS->ClustersAddress(0); | |
34 | AliITSClusterFinderSPD *rec0=new AliITSClusterFinderSPD(seg0,dig0,recp0); | |
35 | ITS->SetReconstructionModel(0,rec0); | |
36 | // test | |
37 | printf("SPD dimensions %f %f \n",seg0->Dx(),seg0->Dz()); | |
38 | printf("SPD npixels %d %d \n",seg0->Npz(),seg0->Npx()); | |
39 | ||
40 | ||
41 | // SDD | |
42 | Float_t baseline = 10.; | |
43 | Float_t noise = 1.67; | |
fe71ba6b | 44 | Int_t thres = baseline+3.*noise; |
7eba3bde | 45 | |
46 | AliITSDetType *iDetType=ITS->DetType(1); | |
47 | AliITSsegmentationSDD *seg1=(AliITSsegmentationSDD*)iDetType->GetSegmentationModel(); | |
48 | if (!seg1) seg1 = new AliITSsegmentationSDD(geom); | |
49 | AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel(); | |
50 | if (!res1) res1=new AliITSresponseSDD(); | |
b210b385 | 51 | |
52 | ||
53 | //res1->SetNoiseParam(noise,baseline); | |
54 | ||
7eba3bde | 55 | res1->SetNoiseParam(noise,baseline); |
b210b385 | 56 | Float_t magic = res1->MagicValue(); |
57 | Float_t top = res1->MaxAdc(); | |
58 | thres *= top/magic; | |
59 | ||
7eba3bde | 60 | TClonesArray *dig1 = ITS->DigitsAddress(1); |
61 | TClonesArray *recp1 = ITS->ClustersAddress(1); | |
62 | AliITSClusterFinderSDD *rec1=new AliITSClusterFinderSDD(seg1,res1,dig1,recp1); | |
63 | rec1->SetMinNCells(6); | |
64 | rec1->SetTimeCorr(70.); | |
65 | rec1->SetCutAmplitude(thres); | |
66 | ITS->SetReconstructionModel(1,rec1); | |
67 | ||
68 | ||
69 | // SSD | |
70 | AliITSDetType *iDetType=ITS->DetType(2); | |
71 | AliITSsegmentationSSD *seg2=(AliITSsegmentationSSD*)iDetType->GetSegmentationModel(); | |
72 | TClonesArray *dig2 = ITS->DigitsAddress(2); | |
73 | TClonesArray *recp2 = ITS->ClustersAddress(2); | |
74 | AliITSClusterFinderSSD *rec2=new AliITSClusterFinderSSD(seg2,dig2,recp2); | |
75 | ITS->SetReconstructionModel(2,rec2); | |
76 | // test | |
77 | printf("SSD dimensions %f %f \n",seg2->Dx(),seg2->Dz()); | |
78 | printf("SSD nstrips %d %d \n",seg2->Npz(),seg2->Npx()); | |
79 | ||
80 | ||
81 | ||
82 | ||
83 | TStopwatch timer; | |
84 | ||
85 | switch (ver) { | |
86 | case 5: | |
87 | cerr<<"Looking for clusters...\n"; | |
88 | { | |
89 | timer.Start(); | |
90 | ITS->DigitsToRecPoints(0,1,"All"); | |
91 | } | |
92 | break; | |
93 | default: | |
94 | cerr<<"Invalid ITS version !\n"; | |
95 | return 5; | |
96 | } | |
97 | ||
98 | timer.Stop(); timer.Print(); | |
99 | ||
100 | delete rec0; | |
101 | delete rec1; | |
102 | delete rec2; | |
103 | ||
104 | ||
105 | delete gAlice; gAlice=0; | |
106 | ||
107 | in->Close(); | |
108 | ||
109 | return 0; | |
110 | } |