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