]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changed Print() to take into account the case where merging was used (AliRunDigitizer)
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 12 Jul 2002 09:51:11 +0000 (09:51 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 12 Jul 2002 09:51:11 +0000 (09:51 +0000)
EMCAL/AliEMCALDigitizer.cxx
PHOS/AliPHOSDigitizer.cxx

index 78cf83fe221c243554ef4dcdbc41d3876606bd12..2820bb4cd7361e947aa2b66ad71c045200334492 100644 (file)
@@ -70,6 +70,8 @@
 
 #include "AliRun.h"
 #include "AliHeader.h"
+#include "AliStream.h"
+#include "AliRunDigitizer.h"
 #include "AliEMCALDigit.h"
 #include "AliEMCALHit.h"
 #include "AliEMCALTick.h"
@@ -78,7 +80,6 @@
 #include "AliEMCALSDigitizer.h"
 #include "AliEMCALGeometry.h"
 #include "AliEMCALGetter.h"
-#include "AliRunDigitizer.h"
 ClassImp(AliEMCALDigitizer)
 
 
@@ -545,31 +546,48 @@ if( strcmp(GetName(), "") == 0 )
  
 //__________________________________________________________________
 void AliEMCALDigitizer::Print(Option_t* option)const {
   if( strcmp(GetName(), "") != 0) {
     
     cout << "------------------- "<< GetName() << " -------------" << endl ;
-    cout << "Digitizing sDigits from file(s): " <<endl ;
-    
-  TCollection * folderslist = ((TFolder*)gROOT->FindObjectAny("Folders/RunMC/Event/Data/EMCAL/SDigits"))->GetListOfFolders() ; 
-    TIter next(folderslist) ; 
-    TFolder * folder = 0 ;
-    while ( (folder = (TFolder*)next()) ) 
-      if ( folder->FindObject(GetName())  ) 
-       {
-       cout << "Adding SDigits " << GetName() << " from " << folder->GetName() << endl ; 
+    const AliRunDigitizer * rd = Manager() ; 
+    if (rd) {
+      Int_t ninput = rd->GetInputStreams()->GetEntries() ;
+      Int_t index = 0 ; 
+      const AliStream * st = 0 ; 
+      TString out("") ; 
+      for (index = 0 ; index < ninput ; index++) { 
+       st = static_cast<AliStream*>(rd->GetInputStreams()->At(index))  ;
+       if (index == 0 ) 
+         out = st->GetFileNames()->At(0)->GetName() ; 
+       cout << "Adding SDigits " << GetName() << " from " <<   st->GetFileNames()->At(0)->GetName() << endl ; 
+      }
       cout << endl ;
-      cout << "Writing digits to " << GetTitle() << endl ;
+      cout << "Writing digits to " <<  out.Data() << endl ;   
+    } else { 
+      AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;  
+      gime->Folder("sdigits")  ;
+      cout << "Digitizing sDigits from file(s): " <<endl ;
+      TCollection * folderslist = gime->Folder("sdigits")->GetListOfFolders() ; 
+      TIter next(folderslist) ; 
+      TFolder * folder = 0 ; 
       
+      while ( (folder = (TFolder*)next()) ) {
+       if ( folder->FindObject(GetName())  ) 
+         cout << "Adding SDigits " << GetName() << " from " << folder->GetName() << endl ; 
+      }
       cout << endl ;
-      cout << "With following parameters: " << endl ;
-      cout << "     Electronics noise in EMC (fPinNoise) = " << fPinNoise << endl ;
-      cout << "  Threshold  in EMC  (fTowerDigitThreshold) = " << fTowerDigitThreshold  << endl;
-      cout << "  Threshold  in PreShower  (fPreShowerDigitThreshold) = " << fPreShowerDigitThreshold  << endl ; ;
-      cout << "---------------------------------------------------" << endl ;
-    }
-    else
-      cout << "AliEMCALDigitizer not initialized " << endl ;
-    }
+      cout << "Writing digits to " << GetTitle() << endl ;
+    }       
+    cout << endl ;
+    cout << "With following parameters: " << endl ;
+    cout << "     Electronics noise in EMC (fPinNoise) = " << fPinNoise << endl ;
+    cout << "  Threshold  in EMC  (fTowerDigitThreshold) = " << fTowerDigitThreshold  << endl;
+    cout << "  Threshold  in PreShower  (fPreShowerDigitThreshold) = " << fPreShowerDigitThreshold  << endl ; ;
+    cout << "---------------------------------------------------" << endl ;
+  }
+  else
+    cout << "AliEMCALDigitizer not initialized " << endl ;
 }
 
 //__________________________________________________________________
index cc172937e16b896bfc88883294a126a0221ca23f..0d057f09885972634d6c25575b052e0adaacd267 100644 (file)
@@ -71,6 +71,7 @@
 
 #include "AliRun.h"
 #include "AliHeader.h"
+#include "AliStream.h"
 #include "AliRunDigitizer.h"
 #include "AliPHOSDigit.h"
 #include "AliPHOS.h"
@@ -96,6 +97,7 @@ ClassImp(AliPHOSDigitizer)
 AliPHOSDigitizer::AliPHOSDigitizer(const char *headerFile,const char * name)
 {
   // ctor
+
   SetTitle(headerFile) ;
   SetName(name) ;
   fManager = 0 ;                     // We work in the standalong mode
@@ -113,7 +115,7 @@ AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * ard):AliDigitizer(ard)
   SetTitle("aliroot") ;
   SetName("Default") ;
   InitParameters() ; 
-  fDefaultInit = kFALSE ; 
+  fDefaultInit = kTRUE ; 
 }
 
 //____________________________________________________________________________ 
@@ -124,7 +126,7 @@ AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * ard):AliDigitizer(ard)
   
   if (!fDefaultInit) {
     AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
-    
    // remove the task from the folder list
    gime->RemoveTask("S",GetName()) ;
    gime->RemoveTask("D",GetName()) ;
@@ -654,19 +656,36 @@ void AliPHOSDigitizer::Print(Option_t* option)const {
   if( strcmp(GetName(), "") != 0 ){
     
     cout << "------------------- "<< GetName() << " -------------" << endl ;
-    cout << "Digitizing sDigits from file(s): " <<endl ;
-    
-    TCollection * folderslist = ((TFolder*)gROOT->FindObjectAny("Folders/RunMC/Event/Data/SDigits/PHOS"))->GetListOfFolders() ; 
-    TIter next(folderslist) ; 
-    TFolder * folder = 0 ; 
-    
-    while ( (folder = (TFolder*)next()) ) {
-      if ( folder->FindObject(GetName())  ) 
-       cout << "Adding SDigits " << GetName() << " from " << folder->GetName() << endl ; 
+    const AliRunDigitizer * rd = Manager() ; 
+    if (rd) {
+      Int_t ninput = rd->GetInputStreams()->GetEntries() ;
+      Int_t index = 0 ; 
+      const AliStream * st = 0 ; 
+      TString out("") ; 
+      for (index = 0 ; index < ninput ; index++) { 
+       st = static_cast<AliStream*>(rd->GetInputStreams()->At(index))  ;
+       if (index == 0 ) 
+         out = st->GetFileNames()->At(0)->GetName() ; 
+       cout << "Adding SDigits " << GetName() << " from " <<   st->GetFileNames()->At(0)->GetName() << endl ; 
+      }
+      cout << endl ;
+      cout << "Writing digits to " <<  out.Data() << endl ;   
     }
-    cout << endl ;
-    cout << "Writing digits to " << GetTitle() << endl ;
-    
+    else { 
+      AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;  
+      gime->Folder("sdigits")  ;
+      cout << "Digitizing sDigits from file(s): " <<endl ;
+      TCollection * folderslist = gime->Folder("sdigits")->GetListOfFolders() ; 
+      TIter next(folderslist) ; 
+      TFolder * folder = 0 ; 
+      
+      while ( (folder = (TFolder*)next()) ) {
+       if ( folder->FindObject(GetName())  ) 
+         cout << "Adding SDigits " << GetName() << " from " << folder->GetName() << endl ; 
+      }
+      cout << endl ;
+      cout << "Writing digits to " << GetTitle() << endl ;
+    }    
     cout << endl ;
     cout << "With following parameters: " << endl ;
     cout << "     Electronics noise in EMC (fPinNoise) = " << fPinNoise << endl ;