1 Int_t AliITSHits2Digits()
4 // Connect the Root Galice file containing Geometry, Kine and Hits
6 const char * inFile = "galice.root";
7 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile);
8 if (file) {file->Close(); delete file;}
9 printf("Hits2Digits\n");
10 file = new TFile(inFile,"UPDATE");
11 if (!file->IsOpen()) {
12 cerr<<"Can't open "<<inFile<<" !\n";
17 // Get AliRun object from file or return if not on file
18 if (gAlice) delete gAlice;
19 gAlice = (AliRun*)file->Get("gAlice");
21 cerr<<"ITSHits2Digits.C : AliRun object not found on file\n";
26 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
28 cerr<<"ITSHits2Digits.C : AliITS object not found on file\n";
32 // Set the simulation models for the three detector types
33 AliITSgeom *geom = ITS->GetITSgeom();
36 AliITSDetType *iDetType=ITS->DetType(0);
37 AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel();
38 AliITSresponseSPD *res0 = (AliITSresponseSPD*)iDetType->GetResponseModel();
39 AliITSsimulationSPD *sim0=new AliITSsimulationSPD(seg0,res0);
40 ITS->SetSimulationModel(0,sim0);
42 printf("SPD dimensions %f %f \n",seg0->Dx(),seg0->Dz());
43 printf("SPD npixels %d %d \n",seg0->Npz(),seg0->Npx());
44 printf("SPD pitches %d %d \n",seg0->Dpz(0),seg0->Dpx(0));
48 //Set response functions
49 Float_t baseline = 10.;
52 AliITSDetType *iDetType=ITS->DetType(1);
53 AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel();
55 res1=new AliITSresponseSDD();
56 ITS->SetResponseModel(1,res1);
59 // SDD compression param: 2 fDecrease, 2fTmin, 2fTmax or disable, 2 fTolerance
60 //Float_t fCutAmp = baseline + 2.*noise;
62 Float_t maxadc = res1->MaxAdc();
63 Float_t topValue = res1->MagicValue();
64 Float_t norm = maxadc/topValue;
66 Float_t fCutAmp = baseline + 2.*noise;
69 Int_t cp[8]={0,0,fCutAmp,fCutAmp,0,0,0,0};
72 //res1->SetZeroSupp("2D");
73 res1->SetZeroSupp("1D");
74 res1->SetNoiseParam(noise,baseline);
75 res1->SetDo10to8(kTRUE);
76 res1->SetCompressParam(cp);
78 res1->SetDiffCoeff(3.6,40.);
79 res1->SetMagicValue(96.95);
81 AliITSsegmentationSDD *seg1=(AliITSsegmentationSDD*)iDetType->GetSegmentationModel();
83 seg1 = new AliITSsegmentationSDD(geom,res1);
84 ITS->SetSegmentationModel(1,seg1);
86 AliITSsimulationSDD *sim1=new AliITSsimulationSDD(seg1,res1);
88 sim1->SetCheckNoise(kFALSE);
89 ITS->SetSimulationModel(1,sim1);
92 AliITSDetType *iDetType=ITS->DetType(2);
93 AliITSsegmentationSSD *seg2=(AliITSsegmentationSSD*)iDetType->GetSegmentationModel();
94 AliITSresponseSSD *res2 = (AliITSresponseSSD*)iDetType->GetResponseModel();
95 res2->SetSigmaSpread(3.,2.);
96 AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2);
97 ITS->SetSimulationModel(2,sim2);
100 cerr<<"Digitizing ITS...\n";
104 ITS->HitsToDigits(0,0,-1," ","All"," ");
105 timer.Stop(); timer.Print();
112 delete gAlice; gAlice=0;