The event number to process is given by RunDigitizer so that event n from input i can be merged with event m from input j
AliDigitizer(rd,"EMCAL"+AliConfig::fgkDigitizerTaskName),
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", ReadEvent) ;
+ gime->Event(ReadEvent, "S") ;
TClonesArray * digits = gime->Digits() ;
digits->Clear() ;
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", ReadEvent, i) ;
+ 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() ;
+
+ if (fLastEvent == -1)
+ fLastEvent = gime->MaxEvent() - 1 ;
- Int_t nevents = gime->MaxEvent() ;;
+ 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
Float_t GetTimeResolution() const { return fTimeResolution ; }
Float_t GetECAchannel() const { return fADCchannelEC ; }
Float_t GetECApedestal() const { return fADCpedestalEC ; }
-
+ void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
void SetDigitThreshold(Float_t EMCThreshold) {fDigitThreshold = EMCThreshold;}
void SetPinNoise(Float_t PinNoise ) {fPinNoise = PinNoise;}
Int_t fNADCEC ; // number of channels in EC section ADC
TString fEventFolderName; // skowron: name of EFN to read data from in stand alone mode
+ Int_t fFirstEvent; // first event to process
+ Int_t fLastEvent; // last event to process
ClassDef(AliEMCALDigitizer,4) // description
AliDigitizer(rd,"PHOS"+AliConfig::fgkDigitizerTaskName),
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 to new SDigits only.
AliPHOSGetter * gime = AliPHOSGetter::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", ReadEvent) ;
+ gime->Event(ReadEvent, "S") ;
TClonesArray * digits = gime->Digits() ;
digits->Clear() ;
for(i = 1 ; i < fInput ; i++){
TString tempo(fEventNames[i]) ;
tempo += i ;
- AliPHOSGetter * gime = AliPHOSGetter::Instance(fInputFileNames[i], tempo) ;
- gime->Event(event,"S");
+ AliPHOSGetter * gime = AliPHOSGetter::Instance(fInputFileNames[i], tempo) ;
+ if (fManager)
+ ReadEvent = dynamic_cast<AliStream*>(fManager->GetInputStream(i))->GetCurrentEventNumber() ;
+ Info("Digitize", "Adding event %d from input stream %d", ReadEvent, i) ;
+ gime->Event(ReadEvent,"S");
sdigArray->AddAt(gime->SDigits(), i) ;
}
// Steering method to process digitization for events
// in the range from fFirstEvent to fLastEvent.
// This range is optionally set by SetEventRange().
- // if fLastEvent=-1 (by default), then process events until the end.
+ // 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("PHOSDigitizer");
- if (fManager)
- fInput = fManager->GetNinputs() ;
-
+// if (fManager)
+// fInput = fManager->GetNinputs() ;
+
AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
if (fLastEvent == -1)
fLastEvent = gime->MaxEvent() - 1 ;
- else
- fLastEvent = TMath::Min(fLastEvent,gime->MaxEvent());
+
Int_t nEvents = fLastEvent - fFirstEvent + 1;
Int_t ievent ;
// Post Digitizer to the white board
gime->PostDigitizer(this) ;
+ fFirstEvent = 0 ;
+ fLastEvent = fFirstEvent ;
if (fManager)
fInput = fManager->GetNinputs() ;
else
for (index = 1 ; index < fInput ; index++) {
fInputFileNames[index] = dynamic_cast<AliStream*>(fManager->GetInputStream(index))->GetFileName(0);
TString tempo = fManager->GetInputFolderName(index) ;
- fEventNames[index] = tempo.Remove(tempo.Length()-1) ; // strip of the stream number added bt fManager
+ fEventNames[index] = tempo.Remove(tempo.Length()-1) ; // strip of the stream number added by fManager
}
//to prevent cleaning of this object while GetEvent is called
//____________________________________________________________________________
void AliPHOSDigitizer::InitParameters()
{
- // Set initial parameters for Digitizer
+ // Set initial parameters Digitizer
fPinNoise = 0.004 ;
fEMCDigitThreshold = 0.012 ;