3 /**************************************************************************
4 * This file is property of and copyright by the Experimental Nuclear *
5 * Physics Group, Dep. of Physics *
6 * University of Oslo, Norway, 2007 *
8 * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
9 * Contributors are mentioned in the code where appropriate. *
10 * Please report bugs to perthi@fys.uio.no *
12 * Permission to use, copy, modify and distribute this software and its *
13 * documentation strictly for non-commercial purposes is hereby granted *
14 * without fee, provided that the above copyright notice appears in all *
15 * copies and that both the copyright notice and this permission notice *
16 * appear in the supporting documentation. The authors make no claims *
17 * about the suitability of this software for any purpose. It is *
18 * provided "as is" without express or implied warranty. *
19 **************************************************************************/
25 #include "AliEMCALRawResponse.h"
26 #include "AliCaloConstants.h"
29 using namespace EMCAL;
30 using namespace ALTRO;
32 Double_t AliEMCALRawResponse::fgTimeTrigger = 600E-9 ; // the time of the trigger as approximately seen in the data
33 Int_t AliEMCALRawResponse::fgThreshold = 1;
34 Int_t AliEMCALRawResponse::fgPedestalValue = 0; // pedestal value for digits2raw, default generate ZS data
35 Double_t AliEMCALRawResponse::fgFEENoise = 3.; // 3 ADC channels of noise (sampled)
39 ClassImp(AliEMCALRawResponse)
42 AliEMCALRawResponse::AliEMCALRawResponse()
47 AliEMCALRawResponse::~AliEMCALRawResponse()
54 AliEMCALRawResponse::RawResponseFunction(Double_t *x, Double_t *par)
56 // step response of the emcal electronincs
58 Double_t tau = par[2];
60 Double_t ped = par[4];
61 Double_t xx = ( x[0] - par[1] + tau ) / tau ;
66 signal = ped + par[0] * TMath::Power(xx , n) * TMath::Exp(n * (1 - xx )) ;
73 AliEMCALRawResponse::RawSampledResponse(const Double_t dtime, const Double_t damp, Int_t * adcH,
74 Int_t * adcL, const Int_t keyErr)
76 // step response of the emcal electronincs
77 Bool_t lowGain = kFALSE ;
78 TF1 signalF("signal", RawResponseFunction, 0, TIMEBINS, 5);
79 signalF.SetParameter(0, damp) ;
80 signalF.SetParameter(1, (dtime + fgTimeTrigger)/ TIMEBINWITH) ;
81 signalF.SetParameter(2, TAU) ;
82 signalF.SetParameter(3, ORDER);
83 signalF.SetParameter(4, fgPedestalValue);
85 Double_t signal=0.0, noise=0.0;
86 for (Int_t iTime = 0; iTime < TIMEBINS; iTime++) {
87 signal = signalF.Eval(iTime) ;
90 noise = gRandom->Gaus(0.,fgFEENoise);
94 adcH[iTime] = static_cast<Int_t>(signal + 0.5) ;
95 if ( adcH[iTime] > MAXBINVALUE ){ // larger than 10 bits
96 adcH[iTime] = MAXBINVALUE ;
100 adcL[iTime] = static_cast<Int_t>(signal + 0.5) ;
101 if ( adcL[iTime] > MAXBINVALUE ) // larger than 10 bits
102 adcL[iTime] = MAXBINVALUE ;