+ AliInfo(Form("Exec: took %f seconds for Digitizing %f seconds per event",
+ gBenchmark->GetCpuTime("EMCALDigitizer"), gBenchmark->GetCpuTime("EMCALDigitizer")/nEvents )) ;
+ }
+}
+
+//____________________________________________________________________________
+Float_t AliEMCALDigitizer::FrontEdgeTime(TClonesArray * ticks)
+{
+ // Returns the shortest time among all time ticks
+
+ ticks->Sort() ; //Sort in accordance with times of ticks
+ TIter it(ticks) ;
+ AliEMCALTick * ctick = (AliEMCALTick *) it.Next() ;
+ Float_t time = ctick->CrossingTime(fTimeThreshold) ;
+
+ AliEMCALTick * t ;
+ while((t=(AliEMCALTick*) it.Next())){
+ if(t->GetTime() < time) //This tick starts before crossing
+ *ctick+=*t ;
+ else
+ return time ;
+
+ time = ctick->CrossingTime(fTimeThreshold) ;
+ }
+ return time ;
+}
+
+//____________________________________________________________________________
+Bool_t AliEMCALDigitizer::Init()
+{
+ // Makes all memory allocations
+ fInit = kTRUE ;
+ AliEMCALLoader *emcalLoader = dynamic_cast<AliEMCALLoader*>(AliRunLoader::GetRunLoader()->GetDetectorLoader("EMCAL"));
+
+ if ( emcalLoader == 0 ) {
+ Fatal("Init", "Could not obtain the AliEMCALLoader");
+ return kFALSE;
+ }
+
+ fFirstEvent = 0 ;
+ fLastEvent = fFirstEvent ;
+
+ if(fManager)
+ fInput = fManager->GetNinputs() ;
+ else
+ fInput = 1 ;
+
+ fInputFileNames = new TString[fInput] ;
+ fEventNames = new TString[fInput] ;
+ fInputFileNames[0] = GetTitle() ;
+ fEventNames[0] = fEventFolderName.Data() ;
+ Int_t index ;
+ 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