]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALGetter.cxx
Added a prototection to prevent deleting the run loader in case the getter is inoked...
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALGetter.cxx
index bbdcb011fc82e9655dd1c08c7c38998ab54ae4ce..888a3d2694345fb3b7a7125fe74e826080b33e34 100644 (file)
@@ -217,7 +217,6 @@ void AliEMCALGetter::Event(Int_t event, const char* opt)
   }
 
   AliRunLoader * rl = AliRunLoader::GetRunLoader(EmcalLoader()->GetTitle());
-
   // checks if we are dealing with test-beam data
 //   TBranch * btb = rl->TreeE()->GetBranch("AliEMCALBeamTestEvent") ;
 //   if(btb){
@@ -315,7 +314,8 @@ AliEMCALGetter * AliEMCALGetter::Instance(const char* alirunFileName, const char
     }
     else { 
       AliRunLoader * rl = AliRunLoader::GetRunLoader(fgEmcalLoader->GetTitle());
-      delete rl ; 
+      if ( strstr(version, AliConfig::fgkDefaultEventFolderName) ) // false in case of merging
+       delete rl ; 
       fgObjGetter = new AliEMCALGetter(alirunFileName, version, openingOption) ;      
     }
   }
@@ -520,7 +520,7 @@ Int_t AliEMCALGetter::ReadTreeS()
   
   
   // gets TreeS from the root file (EMCAL.SDigits.root)
-  if ( !IsLoaded("S") ) {
+   if ( !IsLoaded("S") ) {
     EmcalLoader()->LoadSDigits("UPDATE") ;
     EmcalLoader()->LoadSDigitizer("UPDATE") ;
     SetLoaded("S") ;