]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
AliRunDigitizer: a few bugs fixed to run under
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Dec 2001 16:01:00 +0000 (16:01 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Dec 2001 16:01:00 +0000 (16:01 +0000)
PHOS/AliPHOSDigitizer.cxx
PHOS/AliPHOSDigitizer.h
PHOS/AliPHOSGetter.cxx

index 4c3410c609152e06c0be9c5cce93987876a4fd42..77189e1f60e7cf6f018f0d68aa99994464ff05b2 100644 (file)
@@ -121,10 +121,8 @@ AliPHOSDigitizer::AliPHOSDigitizer(AliRunDigitizer * ard)
 {
   // ctor
   fARD = ard ;
-  SetName("Default");
-  SetTitle("aliroot") ;
-  Init() ;
-  
+  SetName("");     //Will call init in the digitizing
+  SetTitle("aliroot") ;  
 }
 
 //____________________________________________________________________________ 
@@ -146,9 +144,6 @@ void AliPHOSDigitizer::Digitize(const Int_t event)
   // This design avoids scanning over the list of digits to add 
   // contribution to new SDigits only.
 
-  if( strcmp(GetName(), "") == 0 )
-    Init() ;
-
   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
   TClonesArray * digits = gime->Digits(GetName()) ; 
   AliPHOSSDigitizer * sdiz = gime->SDigitizer(GetName()) ; 
@@ -446,7 +441,7 @@ void AliPHOSDigitizer::Exec(Option_t *option)
     if(fARD){
       Int_t input ;
       for(input = 0 ; input < fARD->GetNinputs(); input ++){
-       TTree * treeS = fARD->GetInputTreeS(input) ;
+       TTree * treeS = fARD->GetInputTreeS(input) ;
        if(!treeS){
          cerr << "AliPHOSDigitizer -> No Input " << endl ;
          return ;
@@ -516,19 +511,12 @@ Bool_t AliPHOSDigitizer::Init()
   fNADCcpv = (Int_t) TMath::Power(2,12);      // number of channels in CPV ADC
 
   fTimeThreshold = 0.001*10000000 ; //Means 1 MeV in terms of SDigits amplitude
-
-  // Makes all memory allocations
-  // Adds Digitizer task to the folder of PHOS tasks
-
-   //============================================================= YS
-  //  The initialisation is now done by AliPHOSGetter
     
+  SetName("Default") ;
+
   if( strcmp(GetTitle(), "") == 0 )
     SetTitle("galice.root") ;
   
-  // the SDigits name is stored by AliPHOSGetter as the name of the TClones Array 
-  // //YSAlice/WhiteBoard/SDigits/PHOS/headerFile/branchname and has branchTitle as title.    
-    
   AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), GetName()) ; 
   if ( gime == 0 ) {
     cerr << "ERROR: AliPHOSDigitizer::Init -> Could not obtain the Getter object !" << endl ; 
@@ -537,12 +525,12 @@ Bool_t AliPHOSDigitizer::Init()
   
   const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
   fEmcCrystals = geom->GetNModules() *  geom->GetNCristalsInModule() ;
-     
+  
   // create a folder on the white board //YSAlice/WhiteBoard/Digits/PHOS/headerFile/digitsTitle
   gime->PostDigits(GetName() ) ;   
   
   //add Task to //YSAlice/tasks/Digitizer/PHOS
-    gime->PostDigitizer(this) ;
+  gime->PostDigitizer(this) ;
   
   //Mark that we will use current header file
   if(!fARD){
index 9703f3156071ce9c9ced6cf0340ff7c91328388f..1830ab01903b33ed9a36f8d76d6e062de0e876d7 100644 (file)
@@ -15,7 +15,6 @@
 
 
 // --- ROOT system ---
-#include "TTask.h"
 #include "TObjString.h"
 class TArrayI ;
 // --- Standard library ---
@@ -25,7 +24,7 @@ class TArrayI ;
 class AliPHOSSDigitizer ;
 class AliRunDigitizer ;
 
-class AliPHOSDigitizer: public TTask {
+class AliPHOSDigitizer: public AliDigitizer {
 
 public:
   AliPHOSDigitizer() ;          // ctor
index fdbf1153b42c926be7a4ab33c6e62e275804dfe4..75871177b9cc061b17704955ee95e0156ae1fa35 100644 (file)
@@ -117,21 +117,21 @@ AliPHOSGetter::AliPHOSGetter(const char* headerFile, const char* branchTitle )
       }
       
       gAlice = static_cast<AliRun *>(file->Get("gAlice")) ;
-      
-      if (!gAlice) {
-       cerr << "ERROR : AliPHOSGetter::AliPHOSGetter -> Cannot find gAlice in " << fHeaderFile.Data() << endl ; 
-       abort() ; 
-      }
-      if (!PHOS()) {
-       if (fDebug)
-         cout << "INFO: AliPHOSGetter -> Posting PHOS to Folders" << endl ; 
-       AliConfig * conf = AliConfig::Instance() ; 
-       conf->Add(static_cast<AliDetector*>(gAlice->GetDetector("PHOS"))) ; 
-       conf->Add(static_cast<AliModule*>(gAlice->GetDetector("PHOS"))) ; 
-     }
     }
+  }
 
+  if (!gAlice) {
+    cerr << "ERROR : AliPHOSGetter::AliPHOSGetter -> Cannot find gAlice in " << fHeaderFile.Data() << endl ; 
+    abort() ; 
+  }
+  if (!PHOS()) {
+    if (fDebug)
+      cout << "INFO: AliPHOSGetter -> Posting PHOS to Folders" << endl ; 
+    AliConfig * conf = AliConfig::Instance() ; 
+    conf->Add(static_cast<AliDetector*>(gAlice->GetDetector("PHOS"))) ; 
+    conf->Add(static_cast<AliModule*>(gAlice->GetDetector("PHOS"))) ; 
   }
+  
   fDebug=0;
 }
 //____________________________________________________________________________ 
@@ -276,7 +276,7 @@ Bool_t AliPHOSGetter::PostSDigits(const char * name, const char * headerFile) co
       cerr <<"INFO: AliPHOSGetter::Post S -> Folder " << subdir 
           << " already exists!" << endl ;  
   }else{
-    TClonesArray * sdigits = new TClonesArray("AliPHOSDigit",1000) ;
+    TClonesArray * sdigits = new TClonesArray("AliPHOSDigit",1) ;
     sdigits->SetName(name) ;
     phosSubFolder->Add(sdigits) ;
   }
@@ -1450,8 +1450,7 @@ void AliPHOSGetter::ReadTreeS(Int_t event)
     if(fHeaderFile.CompareTo(folder->GetName()) == 0 ) 
       treeS=gAlice->TreeS() ;
     else{
-     cout << " AliPHOSGetter::ReadTreeS 2 " <<  folder->GetName() << endl ; 
-     file = static_cast<TFile*>(gROOT->GetFile(folder->GetName())); 
+      file = static_cast<TFile*>(gROOT->GetFile(folder->GetName())); 
       file->cd() ;
       
       // Get SDigits Tree header from file
@@ -1557,15 +1556,15 @@ void AliPHOSGetter::ReadTreeS(TTree * treeS, Int_t input)
     PostSDigits(sdigitsBranch->GetTitle(),filename) ;
 
   sdigitsBranch->SetAddress(SDigitsRef(sdigitsBranch->GetTitle(),filename)) ;
+  sdigitsBranch->GetEntry(0) ;
   
   TString sdname(sdigitsBranch->GetTitle()) ;
   sdname+=":" ;
   sdname+=filename ;
   if(!SDigitizer(sdigitsBranch->GetTitle()) )
     PostSDigitizer(sdigitsBranch->GetTitle(),filename) ;
+
   sdigitizerBranch->SetAddress(SDigitizerRef(sdname)) ;
-  
-  sdigitsBranch->GetEntry(0) ;
   sdigitizerBranch->GetEntry(0) ;
   
 }    
@@ -1673,7 +1672,7 @@ void AliPHOSGetter::Event(const Int_t event, const char* opt)
   if( strstr(opt,"Q") )
     ReadTreeQA() ;
 
-  //  if( strstr(opt,"P") )
+  if( strstr(opt,"P") || (strcmp(opt,"")==0) )
     ReadPrimaries() ;
 
 }