]>
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 | ||
21b825a4 | 26 | ITS->MakeTreeC(); |
7eba3bde | 27 | // Set the models for cluster finding |
28 | AliITSgeom *geom = ITS->GetITSgeom(); | |
29 | ||
30 | // SPD | |
31 | AliITSDetType *iDetType=ITS->DetType(0); | |
32 | AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel(); | |
33 | TClonesArray *dig0 = ITS->DigitsAddress(0); | |
34 | TClonesArray *recp0 = ITS->ClustersAddress(0); | |
35 | AliITSClusterFinderSPD *rec0=new AliITSClusterFinderSPD(seg0,dig0,recp0); | |
36 | ITS->SetReconstructionModel(0,rec0); | |
21b825a4 | 37 | // test |
38 | printf("SPD dimensions %f %f \n",seg0->Dx(),seg0->Dz()); | |
39 | printf("SPD npixels %d %d \n",seg0->Npz(),seg0->Npx()); | |
40 | ||
7eba3bde | 41 | |
42 | // SDD | |
7eba3bde | 43 | AliITSDetType *iDetType=ITS->DetType(1); |
44 | AliITSsegmentationSDD *seg1=(AliITSsegmentationSDD*)iDetType->GetSegmentationModel(); | |
45 | if (!seg1) seg1 = new AliITSsegmentationSDD(geom); | |
46 | AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel(); | |
47 | if (!res1) res1=new AliITSresponseSDD(); | |
1ef94a0c | 48 | Float_t baseline,noise; |
49 | res1->GetNoiseParam(noise,baseline); | |
50 | Float_t noise_after_el = res1->GetNoiseAfterElectronics(); | |
51 | Float_t thres = baseline; | |
52 | thres += (4.*noise_after_el); // TB // (4.*noise_after_el); | |
53 | printf("thres %f\n",thres); | |
54 | res1->Print(); | |
7eba3bde | 55 | TClonesArray *dig1 = ITS->DigitsAddress(1); |
56 | TClonesArray *recp1 = ITS->ClustersAddress(1); | |
57 | AliITSClusterFinderSDD *rec1=new AliITSClusterFinderSDD(seg1,res1,dig1,recp1); | |
90dea86a | 58 | rec1->SetCutAmplitude((int)thres); |
7eba3bde | 59 | ITS->SetReconstructionModel(1,rec1); |
60 | ||
61 | ||
62 | // SSD | |
63 | AliITSDetType *iDetType=ITS->DetType(2); | |
64 | AliITSsegmentationSSD *seg2=(AliITSsegmentationSSD*)iDetType->GetSegmentationModel(); | |
65 | TClonesArray *dig2 = ITS->DigitsAddress(2); | |
0687cf0b | 66 | AliITSClusterFinderSSD *rec2=new AliITSClusterFinderSSD(seg2,dig2); |
7eba3bde | 67 | ITS->SetReconstructionModel(2,rec2); |
68 | // test | |
69 | printf("SSD dimensions %f %f \n",seg2->Dx(),seg2->Dz()); | |
70 | printf("SSD nstrips %d %d \n",seg2->Npz(),seg2->Npx()); | |
71 | ||
72 | ||
73 | ||
0687cf0b | 74 | if(!gAlice->TreeR()) gAlice->MakeTree("R"); |
75 | //make branch | |
76 | ITS->MakeBranch("R"); | |
7eba3bde | 77 | |
78 | TStopwatch timer; | |
79 | ||
80 | switch (ver) { | |
81 | case 5: | |
82 | cerr<<"Looking for clusters...\n"; | |
83 | { | |
84 | timer.Start(); | |
1ef94a0c | 85 | ITS->DigitsToRecPoints(0,0,"All"); |
7eba3bde | 86 | } |
87 | break; | |
88 | default: | |
89 | cerr<<"Invalid ITS version !\n"; | |
90 | return 5; | |
91 | } | |
92 | ||
93 | timer.Stop(); timer.Print(); | |
94 | ||
95 | delete rec0; | |
96 | delete rec1; | |
97 | delete rec2; | |
98 | ||
99 | ||
100 | delete gAlice; gAlice=0; | |
101 | ||
102 | in->Close(); | |
103 | ||
104 | return 0; | |
105 | } |