Fatal("InitParameters", "Sampling factor not set !") ;
}
+ // Get the parameters from the OCDB via the loader
+ AliRunLoader *rl = AliRunLoader::Instance();
+ AliEMCALLoader *emcalLoader = dynamic_cast<AliEMCALLoader*>(rl->GetDetectorLoader("EMCAL"));
+ AliEMCALSimParam * simParam = 0x0;
+ if(emcalLoader) simParam = emcalLoader->SimulationParameters();
+
+ if(!simParam){
+ simParam = AliEMCALSimParam::GetInstance();
+ AliWarning("Simulation Parameters not available in OCDB?");
+ }
+
//
//JLK 26-Jun-2008 THIS SHOULD HAVE BEEN EXPLAINED AGES AGO:
//
//Digitize() and Calibrate() methods
//
// Initializes parameters
- fA = AliEMCALSimParam::GetInstance()->GetA(); //0;
- fB = AliEMCALSimParam::GetInstance()->GetB(); //1.e+6; // Changed 24 Apr 2007. Dynamic range now 2 TeV
+ fA = simParam->GetA(); //0;
+ fB = simParam->GetB(); //1.e+6; // Changed 24 Apr 2007. Dynamic range now 2 TeV
fSampling = geom->GetSampling();
// threshold for deposit energy of hit
- fECPrimThreshold = AliEMCALSimParam::GetInstance()->GetECPrimaryThreshold();//0.05;// GeV // 22-may-07 was 0// 24-nov-04 - was 1.e-6;
+ fECPrimThreshold = simParam->GetECPrimaryThreshold();//0.05;// GeV // 22-may-07 was 0// 24-nov-04 - was 1.e-6;
AliDebug(2,Form("Print: \n------------------- %s -------------\n",GetName()));
AliDebug(2,Form(" fInit %i\n", int(fInit)));
return ;
}
-
+
+
if(strstr(option,"tim"))
gBenchmark->Start("EMCALSDigitizer");
Int_t nSdigits = 0 ;
Int_t i;
- AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
+
+ AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
for ( i = 0 ; i < hits->GetEntries() ; i++ ) {
AliEMCALHit * hit = dynamic_cast<AliEMCALHit*>(hits->At(i)) ;
AliEMCALDigit * curSDigit = 0 ;
// Assign primary number only if deposited energy is significant
curSDigit = new AliEMCALDigit( hit->GetPrimary(),
hit->GetIparent(), hit->GetId(),
- Digitize(energy), hit->GetTime(),
+ Digitize(energy), hit->GetTime(),kFALSE,
-1, energy ) ;
else
- curSDigit = new AliEMCALDigit( -1 ,
- -1 ,
+ curSDigit = new AliEMCALDigit( -1,
+ -1,
hit->GetId(),
- Digitize(energy), hit->GetTime(),
+ Digitize(energy), hit->GetTime(),kFALSE,
-1, energy ) ;
} else {
Warning("Exec"," abs id %i is bad \n", hit->GetId());
}
//__________________________________________________________________
-Int_t AliEMCALSDigitizer::Digitize(Float_t energy)const {
+Float_t AliEMCALSDigitizer::Digitize(Float_t energy)const {
// Digitize the energy
//
//JLK 26-Jun-2008 EXPLANATION LONG OVERDUE:
AliWarning(Form("Too big or too small energy %f",aSignal));
aSignal = TMath::Sign((Double_t)2147483647,aSignal);
}
- return (Int_t ) aSignal;
+
+ return (Float_t ) aSignal;
}
//__________________________________________________________________
-Float_t AliEMCALSDigitizer::Calibrate(Int_t amp)const {
+Float_t AliEMCALSDigitizer::Calibrate(Float_t amp)const {
//
// Convert the amplitude back to energy in GeV
//
//loop over digits
AliEMCALDigit * digit;
printf("\n Id Amplitude Time Index Nprim: Primaries list \n") ;
- Int_t index, isum=0;
+ Int_t index = 0;
+ Float_t isum = 0.;
char * tempo = new char[8192];
for (index = 0 ; index < sdigits->GetEntries() ; index++) {
digit = dynamic_cast<AliEMCALDigit *>( sdigits->At(index) ) ;
- sprintf(tempo, "\n%6d %8d %6.5e %4d %2d :",
- digit->GetId(), digit->GetAmp(), digit->GetTime(), digit->GetIndexInList(), digit->GetNprimary()) ;
+ sprintf(tempo, "\n%6d %8f %6.5e %4d %2d :",
+ digit->GetId(), digit->GetAmplitude(), digit->GetTime(), digit->GetIndexInList(), digit->GetNprimary()) ;
printf("%s",tempo);
- isum += digit->GetAmp();
+ isum += digit->GetAmplitude();
Int_t iprimary;
for (iprimary=0; iprimary<digit->GetNprimary(); iprimary++) {
printf("%s",tempo);
}
}
- delete tempo ;
- printf("\n** Sum %i : %10.3f GeV/c **\n ", isum, Calibrate(isum));
+ delete [] tempo ;
+ printf("\n** Sum %2.3f : %10.3f GeV/c **\n ", isum, Calibrate(isum));
} else printf("\n");
}