From 5fb454564710040efe7601bada7ace53baed12cc Mon Sep 17 00:00:00 2001 From: gconesab Date: Sun, 6 Nov 2011 09:20:02 +0000 Subject: [PATCH] Add gain fluctuations in simulation (Evi) --- EMCAL/AliEMCALDigitizer.cxx | 20 +++++++++---- EMCAL/AliEMCALDigitizer.h | 56 +++++++++++++++++++------------------ EMCAL/AliEMCALSimParam.cxx | 5 +++- EMCAL/AliEMCALSimParam.h | 7 ++++- 4 files changed, 53 insertions(+), 35 deletions(-) diff --git a/EMCAL/AliEMCALDigitizer.cxx b/EMCAL/AliEMCALDigitizer.cxx index 40b4ce9702c..86a775a009f 100644 --- a/EMCAL/AliEMCALDigitizer.cxx +++ b/EMCAL/AliEMCALDigitizer.cxx @@ -119,6 +119,7 @@ AliEMCALDigitizer::AliEMCALDigitizer() fEventNames(0x0), fDigitThreshold(0), fMeanPhotonElectron(0), + fGainFluctuations(0), fPinNoise(0), fTimeNoise(0), fTimeDelay(0), @@ -152,6 +153,7 @@ AliEMCALDigitizer::AliEMCALDigitizer(TString alirunFileName, TString eventFolder fEventNames(0), fDigitThreshold(0), fMeanPhotonElectron(0), + fGainFluctuations(0), fPinNoise(0), fTimeNoise(0), fTimeDelay(0), @@ -186,6 +188,7 @@ AliEMCALDigitizer::AliEMCALDigitizer(const AliEMCALDigitizer & d) fEventNames(d.fEventNames), fDigitThreshold(d.fDigitThreshold), fMeanPhotonElectron(d.fMeanPhotonElectron), + fGainFluctuations(d.fGainFluctuations), fPinNoise(d.fPinNoise), fTimeNoise(d.fTimeNoise), fTimeDelay(d.fTimeDelay), @@ -216,6 +219,7 @@ AliEMCALDigitizer::AliEMCALDigitizer(AliDigitizationInput * rd) fEventNames(0), fDigitThreshold(0), fMeanPhotonElectron(0), + fGainFluctuations(0), fPinNoise(0.), fTimeNoise(0.), fTimeDelay(0.), @@ -453,8 +457,10 @@ void AliEMCALDigitizer::Digitize(Int_t event) energy = fSDigitizer->Calibrate(digit->GetAmplitude()) ; // GeV // add fluctuations for photo-electron creation - energy *= static_cast(gRandom->Poisson(fMeanPhotonElectron)) / static_cast(fMeanPhotonElectron) ; - + // corrected fluctuations after comparison with beam test, Paraskevi Ganoti (06/11/2011) + Float_t fluct = static_cast((energy*fMeanPhotonElectron)/fGainFluctuations); + energy *= static_cast(gRandom->Poisson(fluct)) / fluct ; + //calculate and set time digit->SetTime(time) ; @@ -965,7 +971,9 @@ void AliEMCALDigitizer::InitParameters() AliWarning("Simulation Parameters not available in OCDB?"); } - fMeanPhotonElectron = simParam->GetMeanPhotonElectron();//4400; // electrons per GeV + fMeanPhotonElectron = simParam->GetMeanPhotonElectron() ; // 4400; // electrons per GeV + fGainFluctuations = simParam->GetGainFluctuations() ; // 15.0; + fPinNoise = simParam->GetPinNoise();//0.012; // pin noise in GeV from analysis test beam data if (fPinNoise < 0.0001 ) Warning("InitParameters", "No noise added\n") ; @@ -985,9 +993,9 @@ void AliEMCALDigitizer::InitParameters() fNADCEC = simParam->GetNADCEC();//(Int_t) TMath::Power(2,16) ; // number of channels in Tower ADC - 65536 - AliDebug(2,Form("Mean Photon Electron %d, Noise: APD %f, Time %f; Digit Threshold %d,Time Resolution Par0 %g Par1 %g,NADCEC %d", - fMeanPhotonElectron,fPinNoise,fTimeNoise, fDigitThreshold,fTimeResolutionPar0,fTimeResolutionPar1,fNADCEC)); - + AliDebug(2,Form("Mean Photon Electron %d, Gain Fluct. %2.1f; Noise: APD %f, Time %f; Digit Threshold %d,Time Resolution Par0 %g Par1 %g,NADCEC %d", + fMeanPhotonElectron, fGainFluctuations, fPinNoise,fTimeNoise, fDigitThreshold,fTimeResolutionPar0,fTimeResolutionPar1,fNADCEC)); + } //__________________________________________________________________ diff --git a/EMCAL/AliEMCALDigitizer.h b/EMCAL/AliEMCALDigitizer.h index e4f6eb48d19..051c2623b04 100644 --- a/EMCAL/AliEMCALDigitizer.h +++ b/EMCAL/AliEMCALDigitizer.h @@ -97,35 +97,37 @@ private: private: - Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized) - Int_t fDigitsInRun ; //! Total number of digits in one run - Bool_t fInit ; //! To avoid overwriting existing files - - Int_t fInput ; // Number of files to merge - TString *fInputFileNames ; //[fInput] List of file names to merge - TString *fEventNames ; //[fInput] List of event names to merge - - Int_t fDigitThreshold ; // Threshold for storing digits in EMC, ACD units - Int_t fMeanPhotonElectron ; // number of photon electrons per GeV deposited energy - Float_t fPinNoise ; // Electronics noise in EMC, APD - Double_t fTimeNoise; // Electronics noise in EMC, time - Double_t fTimeDelay; // Time delay to reproduce data delay - Double_t fTimeResolutionPar0 ; // Time resolution of FEE electronics - Double_t fTimeResolutionPar1 ; // Time resolution of FEE electronics - Float_t fADCchannelEC ; // calibration width of one ADC channel in EC section (GeV) - Float_t fADCpedestalEC ; // calibration pedestal for one ADC channel - Float_t fADCchannelECDecal ; // decalibration width of one ADC channel in EC section (GeV) - Float_t fTimeChannel ; // calibration time width for one channel - Float_t fTimeChannelDecal ; // calibration time width for one channel - Int_t fNADCEC ; // number of channels in EC section ADC - - TString fEventFolderName; // skowron: name of EFN to read data from in stand alone mode - Int_t fFirstEvent; // first event to process - Int_t fLastEvent; // last event to process + Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized) + Int_t fDigitsInRun ; //! Total number of digits in one run + Bool_t fInit ; //! To avoid overwriting existing files + + Int_t fInput ; // Number of files to merge + TString *fInputFileNames ; //[fInput] List of file names to merge + TString *fEventNames ; //[fInput] List of event names to merge + + Int_t fDigitThreshold ; // Threshold for storing digits in EMC, ACD units + Int_t fMeanPhotonElectron ; // number of photon electrons per GeV deposited energy + Float_t fGainFluctuations ; // correct fMeanPhotonElectron by the gain fluctuations + Float_t fPinNoise ; // Electronics noise in EMC, APD + Double_t fTimeNoise; // Electronics noise in EMC, time + Double_t fTimeDelay; // Time delay to reproduce data delay + Double_t fTimeResolutionPar0 ; // Time resolution of FEE electronics + Double_t fTimeResolutionPar1 ; // Time resolution of FEE electronics + Float_t fADCchannelEC ; // calibration width of one ADC channel in EC section (GeV) + Float_t fADCpedestalEC ; // calibration pedestal for one ADC channel + Float_t fADCchannelECDecal ; // decalibration width of one ADC channel in EC section (GeV) + Float_t fTimeChannel ; // calibration time width for one channel + Float_t fTimeChannelDecal ; // calibration time width for one channel + Int_t fNADCEC ; // number of channels in EC section ADC + + TString fEventFolderName; // skowron: name of EFN to read data from in stand alone mode + Int_t fFirstEvent; // first event to process + Int_t fLastEvent; // last event to process - AliEMCALCalibData * fCalibData; //Calibration data pointer + AliEMCALCalibData * fCalibData; // Calibration data pointer AliEMCALSDigitizer* fSDigitizer; // SDigitization object - ClassDef(AliEMCALDigitizer,12) // description + + ClassDef(AliEMCALDigitizer,13) }; diff --git a/EMCAL/AliEMCALSimParam.cxx b/EMCAL/AliEMCALSimParam.cxx index 9940fa9f814..45f36c4e843 100644 --- a/EMCAL/AliEMCALSimParam.cxx +++ b/EMCAL/AliEMCALSimParam.cxx @@ -35,6 +35,7 @@ AliEMCALSimParam::AliEMCALSimParam() : TNamed(), fDigitThreshold(0), fMeanPhotonElectron(0), +fGainFluctuations(0), fPinNoise(0), fTimeNoise(0), fTimeDelay(0), @@ -49,6 +50,7 @@ fECPrimThreshold(0.) //SDigitizer //Parameters in Digitizer fMeanPhotonElectron = 4400; // electrons per GeV + fGainFluctuations = 15.; // obtained empiricaly to match beam test, from Paraskevi Ganoti fPinNoise = 0.012; // APD noise in GeV from analysis test beam data fDigitThreshold = 3; // 3 ADC counts not anymore cut in energy: //fPinNoise * 3; // 3 * sigma fTimeNoise = 1.28e-5; // time noise in s @@ -71,6 +73,7 @@ AliEMCALSimParam::AliEMCALSimParam(const AliEMCALSimParam& ): TNamed(), fDigitThreshold(0), fMeanPhotonElectron(0), +fGainFluctuations(0), fPinNoise(0), fTimeNoise(0), fTimeDelay(0), @@ -123,7 +126,7 @@ void AliEMCALSimParam::Print(Option_t *) const printf("\t Time Resolution (fTimeResolutionPar0) = %g\n", fTimeResolutionPar0) ; printf("\t Time Resolution (fTimeResolutionPar1) = %g\n", fTimeResolutionPar1) ; printf("\t Time Delay (fTimeDelay) = %g\n", fTimeDelay) ; - printf("\t Mean Photon-Electron (fMeanPhotonElectron) = %d\n", fMeanPhotonElectron) ; + printf("\t Mean Photon-Electron (fMeanPhotonElectron) = %d, Gain Fluc. (fGainFluctuations) %2.1f\n", fMeanPhotonElectron,fGainFluctuations) ; printf("\t N channels in EC section ADC (fNADCEC) = %d\n", fNADCEC) ; printf("\n"); diff --git a/EMCAL/AliEMCALSimParam.h b/EMCAL/AliEMCALSimParam.h index 77c6614dc7f..befbf1d1ab9 100644 --- a/EMCAL/AliEMCALSimParam.h +++ b/EMCAL/AliEMCALSimParam.h @@ -34,6 +34,8 @@ public: Double_t GetTimeResolutionPar1() const { return fTimeResolutionPar1 ; } Int_t GetNADCEC() const { return fNADCEC ; } Int_t GetMeanPhotonElectron() const { return fMeanPhotonElectron ; } + Float_t GetGainFluctuations() const { return fGainFluctuations ; } + void SetDigitThreshold(Int_t val) { fDigitThreshold = val ; } void SetPinNoise(Float_t val) { fPinNoise = val ; } void SetTimeNoise(Float_t val) { fTimeNoise = val ; } @@ -42,11 +44,13 @@ public: void SetTimeResolutionPar1(Double_t val){ fTimeResolutionPar1 = val ; } void SetNADCED(Int_t val) { fNADCEC = val ; } void SetMeanPhotonElectron(Int_t val) { fMeanPhotonElectron = val ; } + void SetGainFluctuations(Float_t val) { fGainFluctuations = val ; } //Parameters used in SDigitizer Float_t GetA() const { return fA ; } Float_t GetB() const { return fB ; } Float_t GetECPrimaryThreshold() const { return fECPrimThreshold ; } + void SetA(Float_t val) { fA = val ; } void SetB(Float_t val) { fB = val ; } void SetECPrimaryThreshold(Float_t val) { fECPrimThreshold = val ; } @@ -60,6 +64,7 @@ private: // Digitizer Int_t fDigitThreshold ; // Threshold for storing digits in EMC Int_t fMeanPhotonElectron ; // number of photon electrons per GeV deposited energy + Float_t fGainFluctuations ; // correct fMeanPhotonElectron by the gain fluctuations Float_t fPinNoise ; // Electronics noise in EMC, APD Double_t fTimeNoise ; // Electronics noise in EMC, time Double_t fTimeDelay; // Time delay to reproduce data delay @@ -72,7 +77,7 @@ private: Float_t fB ; // Slope Digitizition parameters Float_t fECPrimThreshold ; // To store primary if EC Shower Elos > threshold - ClassDef(AliEMCALSimParam,5) + ClassDef(AliEMCALSimParam,6) }; #endif -- 2.39.3