///_________________________________________________________________________________
// --- ROOT system ---
-#include "TFile.h"
#include "TTree.h"
#include "TSystem.h"
-#include "TROOT.h"
-#include "TFolder.h"
-#include "TObjString.h"
-#include "TGeometry.h"
#include "TBenchmark.h"
// --- Standard library ---
// --- AliRoot header files ---
-#include "AliRun.h"
-#include "AliHeader.h"
-#include "AliStream.h"
#include "AliRunDigitizer.h"
#include "AliEMCALDigit.h"
#include "AliEMCAL.h"
//____________________________________________________________________________
AliEMCALDigitizer::AliEMCALDigitizer(TString alirunFileName, TString eventFolderName):
- AliDigitizer("EMCAL"+AliConfig::fgkDigitizerTaskName, alirunFileName),
+ AliDigitizer("EMCAL"+AliConfig::Instance()->GetDigitizerTaskName(), alirunFileName),
fInputFileNames(0), fEventNames(0), fEventFolderName(eventFolderName)
{
// ctor
//____________________________________________________________________________
AliEMCALDigitizer::AliEMCALDigitizer(AliRunDigitizer * rd):
- AliDigitizer(rd,"EMCAL"+AliConfig::fgkDigitizerTaskName),
+ AliDigitizer(rd,"EMCAL"+AliConfig::Instance()->GetDigitizerTaskName()),
fEventFolderName(0)
{
- // ctor
+ // ctor Init() is called by RunDigitizer
fManager = rd ;
fEventFolderName = fManager->GetInputFolderName(0) ;
SetTitle(dynamic_cast<AliStream*>(fManager->GetInputStream(0))->GetFileName(0));
InitParameters() ;
- Init() ;
fDefaultInit = kFALSE ;
}
// contribution of any new SDigit.
AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle(), fEventFolderName) ;
+ Int_t ReadEvent = event ;
+ if (fManager)
+ ReadEvent = dynamic_cast<AliStream*>(fManager->GetInputStream(0))->GetCurrentEventNumber() ;
+ Info("Digitize", "Adding event %d from input stream 0 %s %s", ReadEvent, GetTitle(), fEventFolderName.Data()) ;
+ gime->Event(ReadEvent, "S") ;
TClonesArray * digits = gime->Digits() ;
digits->Clear() ;
const AliEMCALGeometry *geom = gime->EMCALGeometry() ;
- Int_t nEMC = 0 ;
- nEMC = geom->GetNPhi()*geom->GetNZ(); //max number of digits possible
+ Int_t nEMC = geom->GetNPhi()*geom->GetNZ(); //max number of digits possible
Int_t absID ;
TString tempo(fEventNames[i]) ;
tempo += i ;
AliEMCALGetter * gime = AliEMCALGetter::Instance(fInputFileNames[i], tempo) ;
- gime->Event(event,"S");
+ if (fManager)
+ ReadEvent = dynamic_cast<AliStream*>(fManager->GetInputStream(i))->GetCurrentEventNumber() ;
+ Info("Digitize", "Adding event %d from input stream %d %s %s", ReadEvent, i, fInputFileNames[i].Data(), tempo.Data()) ;
+ gime->Event(ReadEvent,"S");
sdigArray->AddAt(gime->SDigits(), i) ;
}
//____________________________________________________________________________
void AliEMCALDigitizer::Exec(Option_t *option)
{
- // Managing method
+ // Steering method to process digitization for events
+ // in the range from fFirstEvent to fLastEvent.
+ // This range is optionally set by SetEventRange().
+ // if fLastEvent=-1, then process events until the end.
+ // by default fLastEvent = fFirstEvent (process only one event)
if (!fInit) { // to prevent overwrite existing file
Error( "Exec", "Give a version name different from %s", fEventFolderName.Data() ) ;
if(strstr(option,"tim"))
gBenchmark->Start("EMCALDigitizer");
-
- if (fManager)
- fInput = fManager->GetNinputs() ;
-
- AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
- Int_t nevents = gime->MaxEvent() ;;
+ AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle()) ;
+
+ if (fLastEvent == -1)
+ fLastEvent = gime->MaxEvent() - 1 ;
+ else if (fManager)
+ fLastEvent = fFirstEvent ;
+
+ Int_t nEvents = fLastEvent - fFirstEvent + 1;
Int_t ievent ;
- for(ievent = 0; ievent < nevents; ievent++){
-
+ for (ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
+
gime->Event(ievent,"S") ;
Digitize(ievent) ; //Add prepared SDigits to digits and add the noise
if(strstr(option,"tim")){
gBenchmark->Stop("EMCALDigitizer");
printf("Exec: took %f seconds for Digitizing %f seconds per event",
- gBenchmark->GetCpuTime("EMCALDigitizer"), gBenchmark->GetCpuTime("EMCALDigitizer")/nevents ) ;
+ gBenchmark->GetCpuTime("EMCALDigitizer"), gBenchmark->GetCpuTime("EMCALDigitizer")/nEvents ) ;
}
}
// Post Digitizer to the white board
gime->PostDigitizer(this) ;
-
+
+ fFirstEvent = 0 ;
+ fLastEvent = fFirstEvent ;
+
if(fManager)
fInput = fManager->GetNinputs() ;
else
void AliEMCALDigitizer::InitParameters()
{
fMeanPhotonElectron = 18200 ; // electrons per GeV
- fPinNoise = 0.1 ; // noise equivalent GeV (random choice)
+ fPinNoise = 0.003 ; // noise equivalent GeV (random choice)
if (fPinNoise == 0. )
Warning("InitParameters", "No noise added\n") ;
fDigitThreshold = fPinNoise * 3; //2 sigma
fTimeResolution = 1.0e-9 ;
fTimeSignalLength = 1.0e-9 ;
- fADCchannelEC = 0.00050; // width of one ADC channel in GeV
+ fADCchannelEC = 0.00305; // width of one ADC channel in GeV - HG fix so that we see 200 GeV gammas
fADCpedestalEC = 0.005 ; // GeV
fNADCEC = (Int_t) TMath::Power(2,16) ; // number of channels in Tower ADC
// looking for the file which contains SDigits
AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
TString fileName( gime->GetSDigitsFileName() ) ;
- if ( eventFolderName != AliConfig::fgkDefaultEventFolderName) // only if not the default folder name
+ if ( eventFolderName != AliConfig::GetDefaultEventFolderName()) // only if not the default folder name
fileName = fileName.ReplaceAll(".root", "") + "_" + eventFolderName + ".root" ;
if ( (gSystem->AccessPathName(fileName)) ) {
Error("MixWith", "The file %s does not exist!", fileName.Data()) ;
tempo += index ;
AliEMCALGetter * gime = AliEMCALGetter::Instance(fInputFileNames[index], tempo) ;
TString fileName( gime->GetSDigitsFileName() ) ;
- if ( fEventNames[index] != AliConfig::fgkDefaultEventFolderName) // only if not the default folder name
+ if ( fEventNames[index] != AliConfig::GetDefaultEventFolderName()) // only if not the default folder name
fileName = fileName.ReplaceAll(".root", "") + "_" + fEventNames[index] + ".root" ;
printf ("Adding SDigits from %s %s\n", fInputFileNames[index].Data(), fileName.Data()) ;
}