1 Int_t AliITSHits2DigitsDubna(const char *inFile = "galice.root"){
2 // Dynamically link some shared libs
3 if (gClassTable->GetID("AliRun") < 0) {
4 gROOT->LoadMacro("loadlibs.C");
8 // Connect the Root Galice file containing Geometry, Kine and Hits
10 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile);
11 if (file) {file->Close(); delete file;}
12 cout << "AliITSHits2DigitsDubna" << endl;
13 file = new TFile(inFile,"UPDATE");
14 if (!file->IsOpen()) {
15 cerr<<"Can't open "<<inFile<<" !" << endl;
20 // Get AliRun object from file or return if not on file
21 if (gAlice) delete gAlice;
22 gAlice = (AliRun*)file->Get("gAlice");
24 cerr<<"AliITSHits2DigitsDubna.C : AliRun object not found on file"
30 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
32 cerr<<"ITSHits2Digits.C : AliITS object not found on file" << endl;
35 if(!(ITS->GetITSgeom())){
36 cerr << " AliITSgeom not found. Can't digitize with out it." << endl;
41 cout << "Having to create the Digits Tree." << endl;
42 gAlice->MakeTree("D");
43 } // end if !gAlice->TreeD()
46 ITS->SetTreeAddress();
49 cout << "Changing from Default SPD simulation, and responce." << endl;
50 AliITSDetType *iDetType=ITS->DetType(0);
51 AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->
52 GetSegmentationModel();
53 AliITSresponseSPDdubna *res0 = new AliITSresponseSPDdubna();
54 ITS->SetResponseModel(0,res0);
55 AliITSsimulationSPDdubna *sim0=new AliITSsimulationSPDdubna(seg0,res0);
56 ITS->SetSimulationModel(0,sim0);
58 cout << "SPD dimensions " << seg0->Dx() << " " << seg0->Dz() << endl;
59 cout << "SPD npixels " << seg0->Npz() << " " << seg0->Npx() << endl;
60 cout << "SPD pitches " << seg0->Dpz(0) << " " << seg0->Dpx(0) << endl;
64 cout << "Changing from Default SDD simulation, and responce." << endl;
65 //Set response functions
66 Float_t baseline = 10.;
68 // SDD compression param: 2 fDecrease, 2fTmin, 2fTmax or disable,
70 AliITSDetType *iDetType=ITS->DetType(1);
71 AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel();
73 res1=new AliITSresponseSDD();
74 ITS->SetResponseModel(1,res1);
76 Float_t fCutAmp = baseline + 2.*noise;
77 Int_t cp[8]={0,0,fCutAmp,fCutAmp,0,0,0,0}; //1D
79 //res1->SetZeroSupp("2D");
80 res1->SetZeroSupp("1D");
81 res1->SetNoiseParam(noise,baseline);
82 res1->SetDo10to8(kTRUE);
83 res1->SetCompressParam(cp);
85 res1->SetDiffCoeff(3.6,40.);
86 AliITSsegmentationSDD *seg1=(AliITSsegmentationSDD*)iDetType->
87 GetSegmentationModel();
89 seg1 = new AliITSsegmentationSDD(ITS->GetITSgeom(),res1);
90 ITS->SetSegmentationModel(1,seg1);
92 AliITSsimulationSDD *sim1 = new AliITSsimulationSDD(seg1,res1);
94 sim1->SetCheckNoise(kFALSE);
95 ITS->SetSimulationModel(1,sim1);
98 cout << "Changing from Default SSD simulation, and responce." << endl;
99 AliITSDetType *iDetType = ITS->DetType(2);
100 AliITSsegmentationSSD *seg2 = (AliITSsegmentationSSD*)iDetType->
101 GetSegmentationModel();
102 AliITSresponseSSD *res2 = (AliITSresponseSSD*)iDetType->GetResponseModel();
103 res2->SetSigmaSpread(3.,2.);
104 AliITSsimulationSSD *sim2 = new AliITSsimulationSSD(seg2,res2);
105 ITS->SetSimulationModel(2,sim2);
107 cout << "Digitizing ITS..." << endl;
110 Long_t size0 = file->GetSize();
113 timer.Stop(); timer.Print();
115 delete gAlice; gAlice=0;
117 Long_t size1 = file->GetSize();
118 cout << "File size before = " << size0 << " file size after = " << size1;
119 cout << "Increase in file size is " << size1-size0 << " Bytes" << endl;