]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSSDigits2Digits.C
Adding the correction for wrongly simulated pid TOF signal
[u/mrichter/AliRoot.git] / ITS / AliITSSDigits2Digits.C
index d7dead000ceebaf8a756e23f585c969b37a04af9..7ebdb2e4ada76fdfe832d3f1af261926d822d171 100644 (file)
@@ -1,15 +1,16 @@
-void writeAR(TFile * fin, TFile *fou);
 void AliITSSD2D(TString inFile, TString outFile);
 
-void AliITSSDigits2Digits(TString inFile= "galice.root", TString outFile = ""){
+void AliITSSDigits2Digits(TString inFile= "galice.root", TString outFile = "")
+ {
     // This macro takes SDigits and produces Digits. No merging is done
     // and only one galice.root file is used. 
     // Dynamically link some shared libs 
     TStopwatch timer;
-
-    if(gAlice){
-       delete gAlice;
-       gAlice = 0;
+    if(gAlice)
+     {
+       delete AliRunLoader::Instance();
+       delete gAlice;
+       gAlice = 0x0;
     } // end if gAlice
     cout << "Creating digits from summable digits for the ITS..." << endl;
     AliITSSD2D(inFile,outFile);
@@ -19,37 +20,11 @@ void AliITSSDigits2Digits(TString inFile= "galice.root", TString outFile = ""){
 
 void AliITSSD2D(TString inFile, TString outFile){
   AliRunDigitizer * manager = new AliRunDigitizer(1,1);
-  char ftmp[50];
-  sprintf(ftmp,"%s",inFile.Data());
-  manager->SetInputStream(0,ftmp);
+  manager->SetInputStream(0,inFile);
   if(outFile != "")manager->SetOutputFile(outFile);
   AliITSDigitizer *dITS  = new AliITSDigitizer(manager);
   manager->Exec("");
-  if(outFile != ""){ 
-    TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile);
-    TFile * file2 = new TFile(outFile,"UPDATE");
-    writeAR(file,file2);
-    file2->Close();
-  }
   delete manager;
-  delete gAlice; gAlice=0;
-}
-
-void writeAR(TFile * fin, TFile *fou) {
-  TDirectory *current = gDirectory;
-  TTree *Te;
-  TTree *TeNew;
-  AliHeader *alhe = new AliHeader();
-  Te = (TTree*)fin->Get("TE");
-  Te->SetBranchAddress("Header",&alhe);
-  Te->SetBranchStatus("*",1);
-  fou->cd();
-  TeNew = Te->CloneTree();
-  TeNew->Write(0,TObject::kOverwrite);
-  gAlice->Write(0,TObject::kOverwrite);
-  current->cd();
-  delete alhe;
-  cout<<"AliRun object written to file\n";
 }