]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALDigitizer.cxx
Logarithmic dependence of energy loss added as option.
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALDigitizer.cxx
index 9e3cf46d34aee556bf9566a0461a0d0d01745437..e1f289cfa9ec19273c616eeba0b834655b959fac 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)
 
 
@@ -89,6 +90,9 @@ ClassImp(AliEMCALDigitizer)
 
   InitParameters() ; 
   fDefaultInit = kTRUE ; 
+  fHitsFileName    = "" ;
+  fSDigitsFileName = "" ; 
 
 }
 
@@ -102,7 +106,10 @@ AliEMCALDigitizer::AliEMCALDigitizer(const char *headerFile,const char *name)
   InitParameters() ; 
   Init() ;
   fDefaultInit = kFALSE ; 
-
+  fSDigitsFileName = headerFile ; 
+  AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ; 
+  gime->Event(0, "S") ; 
+  fHitsFileName = gime->SDigitizer()->GetTitle() ; 
 }
 
 //____________________________________________________________________________ 
@@ -111,6 +118,12 @@ AliEMCALDigitizer::AliEMCALDigitizer(AliRunDigitizer * ard):AliDigitizer(ard)
   // ctor
   SetName("Default");    
   SetTitle("aliroot") ;  
+  fDefaultInit = kFALSE ; 
+  
+  fSDigitsFileName = fManager->GetInputFileName(0, 0) ;
+  AliEMCALGetter * gime = AliEMCALGetter::GetInstance(fSDigitsFileName, GetName()) ; 
+  gime->Event(0,"S") ; 
+  fHitsFileName = gime->SDigitizer()->GetTitle() ; 
 }
 
 //____________________________________________________________________________ 
@@ -544,31 +557,42 @@ 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 Int_t nStreams = GetNInputStreams() ; 
+    if (nStreams) {
+      Int_t index = 0 ;  
+      for (index = 0 ; index < nStreams ; index++)  
+       cout << "Adding SDigits " << GetName() << " from " <<  fManager->GetInputFileName(index, 0) << endl ; 
+      
       cout << endl ;
-      cout << "Writing digits to " << GetTitle() << endl ;
+      cout << "Writing digits to " <<   fManager->GetInputFileName(0, 0) << 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 " << GetSDigitsFileName() << 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 ;
 }
 
 //__________________________________________________________________
@@ -687,6 +711,8 @@ void AliEMCALDigitizer::SetSplitFile(const TString splitFileName)
     return ; 
   }
 
+  SetTitle(splitFileName) ; 
+
   TDirectory * cwd = gDirectory ;
   if ( !(gAlice->GetTreeDFileName() == splitFileName) ) {
     if (gAlice->GetTreeDFile() )