}
}
+
+ //Apply non-linearity
+ if(AliPHOSSimParam::GetInstance()->IsCellNonlinearityOn()){ //Apply non-lineairyt on cell level
+ const Double_t aNL = AliPHOSSimParam::GetInstance()->GetCellNonLineairyA() ;
+ const Double_t bNL = AliPHOSSimParam::GetInstance()->GetCellNonLineairyB() ;
+ for(Int_t i = 0 ; i < nEMC ; i++){
+ digit = static_cast<AliPHOSDigit*>( digits->At(i) ) ;
+ Double_t e= digit->GetEnergy() ;
+ // version(1) digit->SetEnergy(e*(1+a*TMath::Exp(-e/b))) ;
+ digit->SetEnergy(e*(1.+aNL*TMath::Exp(-e*e/2./bNL/bNL))) ; //Better agreement with data...
+ }
+ }
+
+
//distretize energy if necessary
if(AliPHOSSimParam::GetInstance()->IsEDigitizationOn()){
Float_t adcW=AliPHOSSimParam::GetInstance()->GetADCchannelW() ;
digit->SetEnergy(adcW*ceil(digit->GetEnergy()/adcW)) ;
}
}
+
//Apply decalibration if necessary
for(Int_t i = 0 ; i < nEMC ; i++){
digit = static_cast<AliPHOSDigit*>( digits->At(i) ) ;
Decalibrate(digit) ;
}
-
// ticks->Delete() ;
// delete ticks ;
geom->AbsToRelNumbering(digit->GetId(),relId);
- digit->SetEnergy(TMath::Ceil(digit->GetEnergy())-0.9999) ;
+// digit->SetEnergy(TMath::Ceil(digit->GetEnergy())-0.9999) ;
Float_t tres = TimeResolution(digit->GetEnergy()) ;
digit->SetTime(gRandom->Gaus(digit->GetTime(), tres) ) ;
Int_t row =relId[2];
Int_t column=relId[3];
if(relId[1]==0){ //This Is EMC
- Float_t decalib = fcdb->GetADCchannelEmcDecalib(module,column,row); // O(1)
- Float_t calibration = fcdb->GetADCchannelEmc(module,column,row)*decalib;
+ Float_t calibration = fcdb->GetADCchannelEmc(module,column,row);
Float_t energy = digit->GetEnergy()/calibration;
digit->SetEnergy(energy); //Now digit measures E in ADC counts
Float_t time = digit->GetTime() ;
fLightFactor(0.),fAPDFactor(0.),
fAPDNoise(0.),fEMCDigitThreshold(0.),
fEMCADCchannel(0.),fTOFa(0.),fTOFb(0.),
+ fCellNonLineaityA(0.),fCellNonLineaityB(1.),
fEMCSubtractPedestals(kFALSE),
fGlobalAltroOffset(0),fGlobalAltroThreshold(0),fEMCSampleQualityCut(0),
fADCpedestalCpv(0.),fADCchanelCpv(0.),
fCPVNoise(0.),fCPVDigitThreshold(0.),fNADCcpv(0),
- fDigitizeE(0)
+ fDigitizeE(0),fCellNonLineaityOn(0)
{
//Default constructor.
for(Int_t i=0; i<10; i++) fDStream[i] = 0 ;
fLightFactor(0.),fAPDFactor(0.),
fAPDNoise(0.),fEMCDigitThreshold(0.),
fEMCADCchannel(0.),fTOFa(0.),fTOFb(0.),
+ fCellNonLineaityA(0.),fCellNonLineaityB(1.),
fEMCSubtractPedestals(kFALSE),
fGlobalAltroOffset(0),fGlobalAltroThreshold(0),fEMCSampleQualityCut(0),
fADCpedestalCpv(0.),fADCchanelCpv(0.),
fCPVNoise(0.),fCPVDigitThreshold(0.),
fNADCcpv(0),
- fDigitizeE(0)
+ fDigitizeE(0),fCellNonLineaityOn(0)
{
//Real (private) constructor
//Set default parameters
fEMCADCchannel = 0.005 ; // [GeV]
fTOFa = 0.5e-9 ; // [sec] constant term
fTOFb = 1.e-9 ; // [sec/sqrt(GeV)]] stohastic term
+ fCellNonLineaityA = 0.30 ; //Amp of non-linearity of cell responce
+ fCellNonLineaityB = 0.109; //Scale of non-linearity of cell responce
fADCpedestalCpv = 0.012 ; // [aux units]
fADCchanelCpv = 0.0012; // [aux units]
fLightFactor(0.),fAPDFactor(0.),
fAPDNoise(0.),fEMCDigitThreshold(0.),
fEMCADCchannel(0.),fTOFa(0.),fTOFb(0.),
+ fCellNonLineaityA(0.),fCellNonLineaityB(1.),
fEMCSubtractPedestals(kFALSE),
fGlobalAltroOffset(0),fGlobalAltroThreshold(0),fEMCSampleQualityCut(1.),
fADCpedestalCpv(0.),fADCchanelCpv(0.),
fCPVNoise(0.),fCPVDigitThreshold(0.),fNADCcpv(0),
- fDigitizeE(0)
+ fDigitizeE(0),fCellNonLineaityOn(0)
{
//Copy constructor.
AliError("Should not use copy constructor for singleton") ;
Float_t GetAPDNoise() const { return fAPDNoise; } //RMS of APD noise
void SetAPDNoise(Float_t noise=0.012){fAPDNoise = noise; }
+ //Parameters to apply non-lineary on cell level
+ Bool_t IsCellNonlinearityOn() const {return fCellNonLineaityOn;}
+ void SetCellNonLinearity(Bool_t on=kTRUE){fCellNonLineaityOn=on;} //default: on=kFALSE
+ Double_t GetCellNonLineairyA(void) const {return fCellNonLineaityA; }
+ Double_t GetCellNonLineairyB(void) const {return fCellNonLineaityB; }
+ void SetCellNonLineairyA(Double_t a=0.30) {fCellNonLineaityA = a; }
+ void SetCellNonLineairyB(Double_t b=0.109){fCellNonLineaityB = b; }
+
+
+
Float_t GetEmcDigitsThreshold() const { return fEMCDigitThreshold ; } //Minimal energy to keep digit
void SetEMCDigitsThreshold(Float_t thresh=0.01){fEMCDigitThreshold=thresh;}
Float_t fEMCADCchannel ; //width of ADC channel in GeV
Float_t fTOFa ; //constant term of TOF resolution
Float_t fTOFb ; //stohastic term of TOF resolution
+ Float_t fCellNonLineaityA ; //Amp of cel non-linearity
+ Float_t fCellNonLineaityB ; //Energy scale of cel non-linearity
//Parameters used for RAW embedding
Bool_t fEMCSubtractPedestals; // true if pedestal should be subtracted (in non-ZS)
Bool_t fDStream[10] ; //Mark mixing stream contains digits or SDigits
Bool_t fDigitizeE ; //Use energy digitization in simulation or left to Digits2Raw()
-
+ Bool_t fCellNonLineaityOn ; //Model scintillator non-linearity in AliPHOSDigitizer
+
static AliPHOSSimParam * fgSimParam ; // pointer to the unique instance of the class
ClassDef(AliPHOSSimParam,2)