]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSSDigits2Digits.C
New version and structure of ITS V11 geometry. Work still in progress.
[u/mrichter/AliRoot.git] / ITS / AliITSSDigits2Digits.C
CommitLineData
cc2535cd 1void writeAR(TFile * fin, TFile *fou);
2void AliITSSD2D(TString inFile, TString outFile);
3
4void AliITSSDigits2Digits(TString inFile= "galice.root", TString outFile = ""){
af8e1c2d 5 // This macro takes SDigits and produces Digits. No merging is done
6 // and only one galice.root file is used.
7 // Dynamically link some shared libs
8 TStopwatch timer;
9
10 if(gAlice){
11 delete gAlice;
12 gAlice = 0;
13 } // end if gAlice
14 cout << "Creating digits from summable digits for the ITS..." << endl;
cc2535cd 15 AliITSSD2D(inFile,outFile);
16 timer.Stop();
17 timer.Print();
18}
19
20void AliITSSD2D(TString inFile, TString outFile){
21 AliRunDigitizer * manager = new AliRunDigitizer(1,1);
22 char ftmp[50];
23 sprintf(ftmp,"%s",inFile.Data());
24 manager->SetInputStream(0,ftmp);
25 if(outFile != "")manager->SetOutputFile(outFile);
26 AliITSDigitizer *dITS = new AliITSDigitizer(manager);
27 manager->Exec("");
cc2535cd 28 if(outFile != ""){
45f33dc2 29 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile);
30 TFile * file2 = new TFile(outFile,"UPDATE");
cc2535cd 31 writeAR(file,file2);
cc2535cd 32 file2->Close();
cc2535cd 33 }
45f33dc2 34 delete manager;
35 delete gAlice; gAlice=0;
af8e1c2d 36}
cc2535cd 37
38void writeAR(TFile * fin, TFile *fou) {
39 TDirectory *current = gDirectory;
40 TTree *Te;
41 TTree *TeNew;
42 AliHeader *alhe = new AliHeader();
43 Te = (TTree*)fin->Get("TE");
44 Te->SetBranchAddress("Header",&alhe);
45 Te->SetBranchStatus("*",1);
46 fou->cd();
47 TeNew = Te->CloneTree();
48 TeNew->Write(0,TObject::kOverwrite);
49 gAlice->Write(0,TObject::kOverwrite);
50 current->cd();
51 delete alhe;
52 cout<<"AliRun object written to file\n";
53}
54
55
56
57
58
59