{
// ctor
fARD = ard ;
- SetName("Default");
- SetTitle("aliroot") ;
- Init() ;
-
+ SetName(""); //Will call init in the digitizing
+ SetTitle("aliroot") ;
}
//____________________________________________________________________________
// 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()) ;
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 ;
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 ;
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){
// --- ROOT system ---
-#include "TTask.h"
#include "TObjString.h"
class TArrayI ;
// --- Standard library ---
class AliPHOSSDigitizer ;
class AliRunDigitizer ;
-class AliPHOSDigitizer: public TTask {
+class AliPHOSDigitizer: public AliDigitizer {
public:
AliPHOSDigitizer() ; // ctor
}
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;
}
//____________________________________________________________________________
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) ;
}
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
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) ;
}
if( strstr(opt,"Q") )
ReadTreeQA() ;
- // if( strstr(opt,"P") )
+ if( strstr(opt,"P") || (strcmp(opt,"")==0) )
ReadPrimaries() ;
}