1 TFile* AccessFile(TString inFile="galice.root", TString acctype="R");
3 void AliITSDigits2RecPoints(TString inFile="galice.root", TString outFile="galice.root"){
6 if(outFile.Data() == inFile.Data()){
7 file = AccessFile(inFile,"U");
10 file = AccessFile(inFile);
15 cout << "Creating reconstructed points from digits for the ITS..." << endl;
17 AliITSreconstruction *itsr = new AliITSreconstruction(nulptr);
18 if(outFile.Data() != inFile.Data())itsr->SetOutputFile(outFile);
27 //-------------------------------------------------------------------
28 TFile * AccessFile(TString FileName, TString acctype){
30 // Function used to open the input file and fetch the AliRun object
32 if (gAlice) {delete gAlice; gAlice = 0;}
34 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(FileName);
35 if (file) {file->Close(); delete file; file = 0;}
36 if(acctype.Contains("U")){
37 file = new TFile(FileName,"update");
39 if(acctype.Contains("N") && !file){
40 file = new TFile(FileName,"recreate");
42 if(!file) file = new TFile(FileName); // default readonly
43 if (!file->IsOpen()) {
44 cerr<<"Can't open "<<FileName<<" !" << endl;
48 // Get AliRun object from file or return if not on file
49 // if (gAlice) {delete gAlice; gAlice = 0;}
50 gAlice = (AliRun*)file->Get("gAlice");
52 cerr << "AliRun object not found on file"<< endl;