//____________________________________________________________________________
void AliPHOSDigitizer::Exec(Option_t *option)
{
- // Does the job
+ // 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 (!fInit) { // to prevent overwrite existing file
Error( "Exec", "Give a version name different from %s", fEventFolderName.Data() ) ;
AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
- Int_t nevents = gime->MaxEvent() ;
-
+ if (fLastEvent == -1)
+ fLastEvent = gime->MaxEvent() - 1 ;
+ else
+ fLastEvent = TMath::Min(fLastEvent,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") ;
message = " took %f seconds for Digitizing %f seconds per event\n" ;
Info("Exec", message.Data(),
gBenchmark->GetCpuTime("PHOSDigitizer"),
- gBenchmark->GetCpuTime("PHOSDigitizer")/nevents );
+ gBenchmark->GetCpuTime("PHOSDigitizer")/nEvents );
}
}
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
+ SetEventRange(0,-1) ;
}
void SetEMCpedestal(Float_t ped) { fADCpedestalEmc = ped ; }
void SetEventFolderName(TString name) { fEventFolderName = name ; }
void SetTimeResolution(Float_t res){ fTimeResolution = res ; }
+ void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
//General
const Int_t GetDigitsInRun() const { return fDigitsInRun ;}
Int_t fNADCcpv ; // number of channels in CPV ADC
TString fEventFolderName; // skowron: name of EFN to read data from in stand alone mode
-
- ClassDef(AliPHOSDigitizer,2) // description
+ Int_t fFirstEvent; // first event to process
+ Int_t fLastEvent; // last event to process
+
+ ClassDef(AliPHOSDigitizer,3) // description
};
fB = 10000000.;
fPrimThreshold = 0.01 ;
fSDigitsInRun = 0 ;
+ SetEventRange(0,-1) ;
}
//____________________________________________________________________________
void AliPHOSSDigitizer::Exec(Option_t *option)
{
- // Collects all hits in the same active volume into digit
+ // Steering method to produce summable digits 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.
+ //
+ // Summable digit is a sum of all hits in the same active
+ // volume into digit
if (strstr(option, "print") ) {
Print() ;
}
- Int_t nevents = gime->MaxEvent() ;
+ if (fLastEvent == -1)
+ fLastEvent = gime->MaxEvent() - 1 ;
+ else
+ fLastEvent = TMath::Min(fLastEvent,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,"H") ;
if(strstr(option,"tim")){
gBenchmark->Stop("PHOSSDigitizer");
Info("Exec"," took %f seconds for SDigitizing %f seconds per event",
- gBenchmark->GetCpuTime("PHOSSDigitizer"), gBenchmark->GetCpuTime("PHOSSDigitizer")/nevents) ;
+ gBenchmark->GetCpuTime("PHOSSDigitizer"), gBenchmark->GetCpuTime("PHOSSDigitizer")/nEvents) ;
}
}
const Int_t GetSDigitsInRun() const {return fSDigitsInRun ;}
virtual void Print() const ;
void SetEventFolderName(TString name) { fEventFolderName = name ; }
+ void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
Bool_t operator == (const AliPHOSSDigitizer & sd) const ;
AliPHOSSDigitizer & operator = (const AliPHOSSDigitizer & /*sd*/) {return *this ;}
TString fEventFolderName; // event folder name
Bool_t fInit ; //! tells if initialisation wennt OK, will revent exec if not
Int_t fSDigitsInRun ; //! Total number of sdigits in one run
+ Int_t fFirstEvent; // first event to process
+ Int_t fLastEvent; // last event to process
- ClassDef(AliPHOSSDigitizer,2) // description
+ ClassDef(AliPHOSSDigitizer,3) // description
};