3 void ITSdigit (Int_t evNumber1=0,Int_t evNumber2=0,Int_t nsignal =25, Int_t size=-1)
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");
20 // Connect the Root Galice file containing Geometry, Kine and Hits
22 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
23 printf("file %p\n",file);
24 if (file) file->Close();
25 file = new TFile("galice.root","UPDATE");
28 printf ("I'm after Map \n");
30 // Get AliRun object from file or create it if not on file
33 gAlice = (AliRun*)file->Get("gAlice");
34 if (gAlice) printf("AliRun object found on file\n");
35 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
37 printf ("I'm after gAlice \n");
39 AliITS *ITS = (AliITS*) gAlice->GetModule("ITS");
42 AliITSgeom *geom = ITS->GetITSgeom();
51 // SDD compression param: 2 fDecrease, 2fTmin, 2fTmax or disable, 2 fTolerance
52 //Int_t cp[8]={5,7,17,17,20,20,0,0};
53 //Int_t cp[8]={0,0,21,21,21,21,0,0};
55 Int_t cp[8]={0,0,0,0,0,0,0,0};
57 AliITSDetType *iDetType=ITS->DetType(1);
58 AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel();
60 res1=new AliITSresponseSDD();
61 ITS->SetResponseModel(1,res1);
63 res1->SetZeroSupp("2D");
64 //res1->SetZeroSupp("1D");
65 res1->SetParamOptions("same","same");
66 //res1->SetFilenames(" ","$(ALICE_ROOT)/ITS/base.dat","$(ALICE_ROOT)/ITS/2D.dat ");
67 //res1->SetNoiseParam(3.,20.);
68 res1->SetNoiseParam(0.,0.);
69 res1->SetCompressParam(cp);
72 AliITSsegmentationSDD *seg1=(AliITSsegmentationSDD*)iDetType->GetSegmentationModel();
74 seg1 = new AliITSsegmentationSDD(geom,res1);
75 ITS->SetSegmentationModel(1,seg1);
78 AliITSsimulationSDD *sim1=new AliITSsimulationSDD(seg1,res1);
79 ITS->SetSimulationModel(1,sim1);
83 AliITSDetType *iDetType=ITS->DetType(0);
84 AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel();
85 AliITSresponseSPD *res0 = (AliITSresponseSPD*)iDetType->GetResponseModel();
86 AliITSsimulationSPD *sim0=new AliITSsimulationSPD(seg0,res0);
87 ITS->SetSimulationModel(0,sim0);
89 printf("SPD dimensions %f %f \n",seg0->Dx(),seg0->Dz());
90 printf("SPD npixels %d %d \n",seg0->Npz(),seg0->Npx());
91 printf("SPD pitches %d %d \n",seg0->Dpz(0),seg0->Dpx(0));
97 AliITSDetType *iDetType=ITS->DetType(2);
98 AliITSsegmentationSSD *seg2=(AliITSsegmentationSSD*)iDetType->GetSegmentationModel();
99 AliITSresponseSSD *res2 = (AliITSresponseSSD*)iDetType->GetResponseModel();
100 res2->SetSigmaSpread(3.,2.);
101 AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2);
102 ITS->SetSimulationModel(2,sim2);
106 printf("sim0 sim1 sim2 %p %p %p\n",sim0,sim1,sim2);
108 res1->GetNoiseParam(n,b);
109 printf("SDD: noise baseline %f %f zs option %s data type %s\n",n,b,res1->ZeroSuppOption(),res1->DataType());
110 printf("SDD: DriftSpeed %f TopValue %f\n",res1->DriftSpeed(),res1->MagicValue());
111 printf("SDD: DiffCoeff %f Qref %f\n",res1->DiffCoeff(),res1->Qref());
117 for (int nev=evNumber1; nev<= evNumber2; nev++) {
118 Int_t nparticles = gAlice->GetEvent(nev);
119 cout << "nev " <<nev<<endl;
120 cout << "nparticles " <<nparticles<<endl;
121 if (nev < evNumber1) continue;
122 if (nparticles <= 0) return;
124 Int_t nbgr_ev=Int_t(nev/nsignal);
125 //printf("nbgr_ev %d\n",nbgr_ev);
126 ITS->HitsToDigits(nev,nbgr_ev,evNumber2,size," ","All"," ");
127 //ITS->HitsToDigits(nev,nbgr_ev,evNumber2,size," ","SSD"," ");