3 void ITSDigitsToClusters (Int_t evNumber1=0,Int_t evNumber2=0)
5 /////////////////////////////////////////////////////////////////////////
6 // This macro is a small example of a ROOT macro
7 // illustrating how to read the output of GALICE
8 // and do some analysis.
10 /////////////////////////////////////////////////////////////////////////
12 // Dynamically link some shared libs
14 if (gClassTable->GetID("AliRun") < 0) {
15 gROOT->LoadMacro("loadlibs.C");
23 // Connect the Root Galice file containing Geometry, Kine and Hits
25 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
26 printf("file %p\n",file);
27 if (file) file->Close();
28 file = new TFile("galice.root","UPDATE");
31 printf ("I'm after Map \n");
33 // Get AliRun object from file or create it if not on file
36 gAlice = (AliRun*)file->Get("gAlice");
37 if (gAlice) printf("AliRun object found on file\n");
38 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
40 printf ("I'm after gAlice \n");
42 AliITS *ITS = (AliITS*) gAlice->GetModule("ITS");
45 AliITSgeom *geom = ITS->GetITSgeom();
48 // NOTE: if you foresee to have (in segmentation or response) parameter
49 // values other than the default ones, and these values are used not only in
50 // simulation but in cluster finder as well, please set them via your
51 // local Config.C - the streamer will take care of writing the correct
52 // info and you'll no longer be obliged to set them again for your cluster
53 // finder as it's done in this macro
57 // Set the models for cluster finding
64 Int_t nparticles=gAlice->GetEvent(0);
66 AliITSDetType *iDetType=ITS->DetType(0);
67 AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel();
68 TClonesArray *dig0 = ITS->DigitsAddress(0);
69 TClonesArray *recp0 = ITS->ClustersAddress(0);
70 AliITSClusterFinderSPD *rec0=new AliITSClusterFinderSPD(seg0,dig0,recp0);
71 ITS->SetReconstructionModel(0,rec0);
75 AliITSDetType *iDetType=ITS->DetType(1);
76 AliITSgeom *geom = ITS->GetITSgeom();
78 AliITSsegmentationSDD *seg1=(AliITSsegmentationSDD*)iDetType->GetSegmentationModel();
79 if (!seg1) seg1 = new AliITSsegmentationSDD(geom);
80 AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel();
81 if (!res1) res1=new AliITSresponseSDD();
83 Float_t baseline,noise;
84 res1->GetNoiseParam(noise,baseline);
85 Float_t noise_after_el = res1->GetNoiseAfterElectronics();
86 Float_t thres = baseline;
87 thres += (4.*noise_after_el); // TB // (4.*noise_after_el);
88 printf("thres %f\n",thres);
91 TClonesArray *dig1 = ITS->DigitsAddress(iDet);
92 TClonesArray *recp1 = ITS->ClustersAddress(1);
93 AliITSClusterFinderSDD *rec1=new AliITSClusterFinderSDD(seg1,res1,dig1,recp1);
94 rec1->SetCutAmplitude((int)thres);
95 ITS->SetReconstructionModel(iDet,rec1);
100 AliITSDetType *iDetType=ITS->DetType(2);
101 AliITSsegmentationSSD *seg2=(AliITSsegmentationSSD*)iDetType->GetSegmentationModel();
102 TClonesArray *dig2 = ITS->DigitsAddress(2);
103 AliITSClusterFinderSSD *rec2=new AliITSClusterFinderSSD(seg2,dig2);
104 ITS->SetReconstructionModel(2,rec2);
106 //printf("SSD dimensions %f %f \n",seg2->Dx(),seg2->Dz());
107 //printf("SSD nstrips %d %d \n",seg2->Npz(),seg2->Npx());
115 cout << "Looking for clusters...\n";
119 if(!gAlice->TreeR()) gAlice->MakeTree("R");
121 ITS->MakeBranch("R");
123 for (int nev=evNumber1; nev<= evNumber2; nev++) {
125 nparticles = gAlice->GetEvent(nev);
126 gAlice->SetEvent(nev);
127 if(!gAlice->TreeR()) gAlice-> MakeTree("R");
128 ITS->MakeBranch("R");
130 cout << "nev " <<nev<<endl;
131 cout << "nparticles " <<nparticles<<endl;
132 if (nev < evNumber1) continue;
133 if (nparticles <= 0) return;
137 ITS->DigitsToRecPoints(nev,last_entry,"All");
138 timer.Stop(); timer.Print();