- }
-
-
-
- sdigits->Sort() ;
-
- Int_t NPrimarymax = -1 ;
-
- Int_t i ;
-
- for (i = 0 ; i < sdigits->GetEntriesFast() ; i++) {
-
- sdigit = dynamic_cast<AliEMCALDigit *>(sdigits->At(i)) ;
-
- sdigit->SetIndexInList(i) ;
-
- }
-
-
-
- for (i = 0 ; i < sdigits->GetEntriesFast() ; i++) {
-
- if (((dynamic_cast<AliEMCALDigit *>(sdigits->At(i)))->GetNprimary()) > NPrimarymax)
-
- NPrimarymax = ((dynamic_cast<AliEMCALDigit *>(sdigits->At(i)))->GetNprimary()) ;
-
- }
-
-
-
- //Now write SDigits
-
-
-
- if(gAlice->TreeS() == 0 || (fSplitFile)) //<--- To be checked: we should not create TreeS if it is already here
-
- gAlice->MakeTree("S",fSplitFile);
-
-
-
- if(fSplitFile)
-
- fSplitFile->cd() ;
-
-
-
- //First list of sdigits
-
- Int_t bufferSize = 32000 ;
-
- TBranch * sdigitsBranch = gAlice->TreeS()->Branch("EMCAL",&sdigits,bufferSize);
-
- sdigitsBranch->SetTitle(sdname);
-
-
-
- //NEXT - SDigitizer
-
- Int_t splitlevel = 0 ;
-
- AliEMCALSDigitizer * sd = this ;
-
- TBranch * sdigitizerBranch = gAlice->TreeS()->Branch("AliEMCALSDigitizer","AliEMCALSDigitizer",
-
- &sd,bufferSize,splitlevel);
-
- sdigitizerBranch->SetTitle(sdname);
-
-
-
- sdigitsBranch->Fill() ;
-
- sdigitizerBranch->Fill() ;
-
- gAlice->TreeS()->AutoSave() ;
-
-
-
- if(strstr(option,"deb"))
-
- PrintSDigits(option) ;
-
-
-
- }
-
-
-
- if(strstr(option,"tim")){
-
- gBenchmark->Stop("EMCALSDigitizer");
-
- cout << "AliEMCALSDigitizer:" << endl ;
-
- cout << " took " << gBenchmark->GetCpuTime("EMCALSDigitizer") << " seconds for SDigitizing "
-
- << gBenchmark->GetCpuTime("EMCALSDigitizer") << " seconds per event " << endl ;
-
- cout << endl ;
-
- }
-
-}
-
-
-
-//__________________________________________________________________
-
-void AliEMCALSDigitizer::SetSDigitsBranch(const char * title ){
-