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
33 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(FileName);
34 if (file) {file->Close(); delete file; file = 0;}
35 if(acctype.Contains("U")){
36 file = new TFile(FileName,"update");
38 if(acctype.Contains("N") && !file){
39 file = new TFile(FileName,"recreate");
41 if(!file) file = new TFile(FileName); // default readonly
42 if (!file->IsOpen()) {
43 cerr<<"Can't open "<<FileName<<" !" << endl;
47 // Get AliRun object from file or return if not on file
48 if (gAlice) {delete gAlice; gAlice = 0;}
49 gAlice = (AliRun*)file->Get("gAlice");
51 cerr << "AliRun object not found on file"<< endl;