]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSMerge.C
example for the creation of fast and slow points on separate files
[u/mrichter/AliRoot.git] / ITS / AliITSMerge.C
1 void AliITSMerge(Int_t Nfiles=1,const char* file0="galice.root",
2                  const char* file1="galice_bg.root"){
3     //
4  
5     TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(file0);
6     if (file) {file->Close(); delete file;}
7     cout << "AliITSMerge" << endl;
8     file = new TFile(file0,"UPDATE");
9     if (!file->IsOpen()) {
10         cerr<<"Can't open "<<file0<<" !" << endl;
11         return;
12     } // end if !file
13     file->ls();
14  
15     // Get AliRun object from file or return if not on file
16     if (gAlice) delete gAlice;
17     gAlice = (AliRun*)file->Get("gAlice");
18     if (!gAlice) {
19         cerr << "AliITSMerge.C : AliRun object not found on file" << endl;
20         return;
21     } // end if !gAlice
22
23     if(Nfiles>2) Nfiles = 2;
24     if(Nfiles<1) Nfiles = 1;
25     AliRunDigitizer *manager = new AliRunDigitizer(Nfiles,1); 
26     manager->SetInputStream(0,file0);
27     if(Nfiles>1) manager->SetInputStream(1,file1);
28     manager->SetOutputFile(file0);
29     AliITSDigitizer *dITS = new AliITSDigitizer(manager);
30     manager->Exec("");
31 }