3 void ITSdigitBari (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 // Macro to run the Bari model on the SPDs
12 /////////////////////////////////////////////////////////////////////////
14 // Dynamically link some shared libs
16 if (gClassTable->GetID("AliRun") < 0) {
17 gROOT->LoadMacro("loadlibs.C");
22 // Connect the Root Galice file containing Geometry, Kine and Hits
24 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
25 printf("file %p\n",file);
26 if (file) file->Close();
27 file = new TFile("galice.root","UPDATE");
30 printf ("I'm after Map \n");
32 // Get AliRun object from file or create it if not on file
35 gAlice = (AliRun*)file->Get("gAlice");
36 if (gAlice) printf("AliRun object found on file\n");
37 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
39 printf ("I'm after gAlice \n");
41 AliITS *ITS = (AliITS*) gAlice->GetModule("ITS");
44 AliITSgeom *geom = ITS->GetITSgeom();
52 printf ("Beginning of SPD processing \n\n");
54 AliITSDetType *iDetType=ITS->DetType(0);
55 AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel();
56 // AliITSresponseSPDbari *res0=(AliITSresponseSPDbari*)iDetType->GetResponseModel();
57 AliITSresponseSPDbari *res0= new AliITSresponseSPDbari();
59 // to change or monitor the parameters
62 res0->SetThresholds(7.2e-6, 1.e-6);
63 Float_t thresh, sigma;
64 res0->Thresholds(thresh, sigma);
65 printf("SPDbari: threshold %e sigma %e\n",thresh, sigma);
68 res0->SetNoiseParam(0., 0.);
69 // res0->SetNoiseParam(0.04, 0.08);
71 res0->GetNoiseParam(col, row);
72 printf("SPDbari: Couplcol %e Couplrow %e\n",col, row);
74 ITS->SetResponseModel(0,res0);
77 AliITSsimulationSPDbari *sim0=new AliITSsimulationSPDbari(seg0,res0);
78 ITS->SetSimulationModel(0,sim0);
81 printf("SPD dimensions %f %f \n",seg0->Dx(),seg0->Dz());
82 printf("SPD npixels %d %d \n",seg0->Npz(),seg0->Npx());
83 printf("SPD pitches %d %d \n",seg0->Dpz(0),seg0->Dpx(0));
86 printf("End SPD processing \n\n");
94 for (int nev=evNumber1; nev<= evNumber2; nev++) {
95 Int_t nparticles = gAlice->GetEvent(nev);
96 cout << "nev " <<nev<<endl;
97 cout << "nparticles " <<nparticles<<endl;
98 if (nev < evNumber1) continue;
99 if (nparticles <= 0) return;
101 Int_t nbgr_ev=Int_t(nev/nsignal);
102 //printf("nbgr_ev %d\n",nbgr_ev);
103 // ITS->HitsToDigits(nev,nbgr_ev,evNumber2,size," ","All"," ");
104 ITS->HitsToDigits(nev,nbgr_ev,size," ","SPD"," ");