3 void ITSHitsToDigitsBari (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");
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 if (!file) 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");
46 // Set the simulation models
48 AliITSgeom *geom = ITS->GetITSgeom();
51 // SDD compression param: 2 fDecrease, 2fTmin, 2fTmax or disable, 2 fTolerance
52 Float_t baseline = 10.;
56 AliITSDetType *iDetType=ITS->DetType(1);
57 AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel();
59 res1=new AliITSresponseSDD();
60 ITS->SetResponseModel(1,res1);
62 res1->SetMagicValue(900.);
64 Float_t maxadc = res1->MaxAdc();
65 Float_t topValue = res1->MagicValue();
66 Float_t norm = maxadc/topValue;
68 Float_t fCutAmp = baseline + 2.*noise;
70 Int_t cp[8]={0,0,fCutAmp,fCutAmp,0,0,0,0}; //1D
72 //res1->SetZeroSupp("2D");
73 res1->SetZeroSupp("1D");
74 res1->SetNoiseParam(noise,baseline);
75 res1->SetDo10to8(kTRUE);
77 res1->SetCompressParam(cp);
78 res1->SetDiffCoeff(3.6,40.);
80 AliITSsegmentationSDD *seg1=(AliITSsegmentationSDD*)iDetType->GetSegmentationModel();
82 seg1 = new AliITSsegmentationSDD(geom,res1);
83 ITS->SetSegmentationModel(1,seg1);
86 AliITSsimulationSDD *sim1=new AliITSsimulationSDD(seg1,res1);
88 sim1->SetCheckNoise(kFALSE);
90 ITS->SetSimulationModel(1,sim1);
96 AliITSDetType *iDetType=ITS->DetType(0);
97 AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel();
98 AliITSresponseSPDbari *res0 = (AliITSresponseSPDbari*)iDetType->GetResponseModel();
99 AliITSsimulationSPDbari *sim0=new AliITSsimulationSPDbari(seg0,res0);
100 ITS->SetSimulationModel(0,sim0);
102 //printf("SPD dimensions %f %f \n",seg0->Dx(),seg0->Dz());
103 //printf("SPD npixels %d %d \n",seg0->Npz(),seg0->Npx());
104 //printf("SPD pitches %d %d \n",seg0->Dpz(0),seg0->Dpx(0));
110 AliITSDetType *iDetType=ITS->DetType(2);
111 AliITSsegmentationSSD *seg2=(AliITSsegmentationSSD*)iDetType->GetSegmentationModel();
112 AliITSresponseSSD *res2 = (AliITSresponseSSD*)iDetType->GetResponseModel();
113 res2->SetSigmaSpread(3.,2.);
114 AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2);
115 ITS->SetSimulationModel(2,sim2);
124 for (Int_t nev=evNumber1; nev<= evNumber2; nev++) {
125 cout << "nev " <<nev<<endl;
126 Int_t nparticles = gAlice->GetEvent(nev);
127 cout << "nparticles " <<nparticles<<endl;
128 if (nev < evNumber1) continue;
129 if (nparticles <= 0) return;
132 if(nsignal) nbgr_ev=Int_t(nev/nsignal);
133 ITS->HitsToDigits(nev,nbgr_ev,size," ","All"," ");