AliEMCALSDigitizer::AliEMCALSDigitizer():TTask("","")
{
// ctor
- InitParameters() ;
+ fFirstEvent = fLastEvent = 0 ;
fDefaultInit = kTRUE ;
}
//____________________________________________________________________________
-AliEMCALSDigitizer::AliEMCALSDigitizer(const char * alirunFileName, const char * eventFolderName):
- TTask("EMCAL"+AliConfig::fgkSDigitizerTaskName, alirunFileName),
+AliEMCALSDigitizer::AliEMCALSDigitizer(const char * alirunFileName,
+ const char * eventFolderName):
+ TTask("EMCAL"+AliConfig::Instance()->GetSDigitizerTaskName(), alirunFileName),
fEventFolderName(eventFolderName)
{
// ctor
+ fFirstEvent = fLastEvent = 0 ; // runs one event by defaut
Init();
InitParameters() ;
fDefaultInit = kFALSE ;
AliEMCALSDigitizer::AliEMCALSDigitizer(const AliEMCALSDigitizer & sd) : TTask(sd) {
//cpy ctor
+ fFirstEvent = sd.fFirstEvent ;
+ fLastEvent = sd.fLastEvent ;
fA = sd.fA ;
fB = sd.fB ;
fECPrimThreshold = sd.fECPrimThreshold ;
AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
const AliEMCALGeometry * geom = gime->EMCALGeometry() ;
if (geom->GetSampling() == 0.) {
- printf("InitParameters: Sampling factor not set !") ;
- abort() ;
+ Fatal("InitParameters", "Sampling factor not set !") ;
}
- else
- printf("InitParameters: Sampling factor set to %f\n", geom->GetSampling()) ;
+// else
+// Info("InitParameters", "Sampling factor set to %f", geom->GetSampling()) ;
// this threshold corresponds approximately to 100 MeV
- fECPrimThreshold = 100E-3 / ( geom->GetSampling() * geom->GetNECLayers()) * geom->GetNECLayers() ;
+ fECPrimThreshold = 100E-3;
}
//____________________________________________________________________________
if(strstr(option,"tim"))
gBenchmark->Start("EMCALSDigitizer");
- AliEMCALGetter * gime = AliEMCALGetter::Instance() ;
+ AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle()) ;
//switch off reloading of this task while getting event
if (!fInit) { // to prevent overwrite existing file
return ;
}
- Int_t nevents = gime->MaxEvent() ;
+ if (fLastEvent == -1)
+ fLastEvent = gime->MaxEvent() - 1 ;
+ else
+ fLastEvent = TMath::Min(fFirstEvent, gime->MaxEvent()); // only ine event at the time
+ 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") ;
-
TTree * treeS = gime->TreeS();
TClonesArray * hits = gime->Hits() ;
TClonesArray * sdigits = gime->SDigits() ;
if(strstr(option,"tim")){
gBenchmark->Stop("EMCALSDigitizer");
printf("Exec: took %f seconds for SDigitizing %f seconds per event",
- gBenchmark->GetCpuTime("EMCALSDigitizer"), gBenchmark->GetCpuTime("EMCALSDigitizer") ) ;
+ gBenchmark->GetCpuTime("EMCALSDigitizer"), gBenchmark->GetCpuTime("EMCALSDigitizer")/nEvents ) ;
}
}