#include "AliEMCALGeometry.h"
#include "AliEMCALTick.h"
#include "AliEMCALCalibData.h"
+#include "AliEMCALSimParam.h"
ClassImp(AliEMCALDigitizer)
fEventNames(0x0),
fDigitThreshold(0),
fMeanPhotonElectron(0),
- fPedestal(0),
- fSlope(0),
+// fPedestal(0), //Not used, remove?
+// fSlope(0), //Not used, remove?
fPinNoise(0),
fTimeResolution(0),
- fTimeThreshold(0),
- fTimeSignalLength(0),
+// fTimeThreshold(0), //Not used, remove?
+// fTimeSignalLength(0), //Not used, remove?
fADCchannelEC(0),
fADCpedestalEC(0),
fNADCEC(0),
fEventNames(0),
fDigitThreshold(0),
fMeanPhotonElectron(0),
- fPedestal(0),
- fSlope(0),
+// fPedestal(0),//Not used, remove?
+// fSlope(0), //Not used, remove?
fPinNoise(0),
fTimeResolution(0),
- fTimeThreshold(0),
- fTimeSignalLength(0),
+// fTimeThreshold(0), //Not used, remove?
+// fTimeSignalLength(0), //Not used, remove?
fADCchannelEC(0),
fADCpedestalEC(0),
fNADCEC(0),
fEventNames(d.fEventNames),
fDigitThreshold(d.fDigitThreshold),
fMeanPhotonElectron(d.fMeanPhotonElectron),
- fPedestal(d.fPedestal),
- fSlope(d.fSlope),
+// fPedestal(d.fPedestal), //Not used, remove?
+// fSlope(d.fSlope), //Not used, remove?
fPinNoise(d.fPinNoise),
fTimeResolution(d.fTimeResolution),
- fTimeThreshold(d.fTimeThreshold),
- fTimeSignalLength(d.fTimeSignalLength),
+// fTimeThreshold(d.fTimeThreshold), //Not used, remove?
+// fTimeSignalLength(d.fTimeSignalLength), //Not used, remove?
fADCchannelEC(d.fADCchannelEC),
fADCpedestalEC(d.fADCpedestalEC),
fNADCEC(d.fNADCEC),
fEventNames(0),
fDigitThreshold(0.),
fMeanPhotonElectron(0),
- fPedestal(0),
- fSlope(0.),
+// fPedestal(0), //Not used, remove?
+// fSlope(0.), //Not used, remove?
fPinNoise(0),
fTimeResolution(0.),
- fTimeThreshold(0),
- fTimeSignalLength(0),
+// fTimeThreshold(0), //Not used, remove?
+// fTimeSignalLength(0), //Not used, remove?
fADCchannelEC(0),
fADCpedestalEC(0),
fNADCEC(0),
}
//____________________________________________________________________________
-Float_t AliEMCALDigitizer::FrontEdgeTime(TClonesArray * ticks)
-{
- // Returns the shortest time among all time ticks
-
- ticks->Sort() ; //Sort in accordance with times of ticks
- TIter it(ticks) ;
- AliEMCALTick * ctick = (AliEMCALTick *) it.Next() ;
- Float_t time = ctick->CrossingTime(fTimeThreshold) ;
-
- AliEMCALTick * t ;
- while((t=(AliEMCALTick*) it.Next())){
- if(t->GetTime() < time) //This tick starts before crossing
- *ctick+=*t ;
- else
- return time ;
-
- time = ctick->CrossingTime(fTimeThreshold) ;
- }
- return time ;
-}
+//Float_t AliEMCALDigitizer::FrontEdgeTime(TClonesArray * ticks)
+//{
+// // Returns the shortest time among all time ticks
+//
+// ticks->Sort() ; //Sort in accordance with times of ticks
+// TIter it(ticks) ;
+// AliEMCALTick * ctick = (AliEMCALTick *) it.Next() ;
+// Float_t time = ctick->CrossingTime(fTimeThreshold) ;
+//
+// AliEMCALTick * t ;
+// while((t=(AliEMCALTick*) it.Next())){
+// if(t->GetTime() < time) //This tick starts before crossing
+// *ctick+=*t ;
+// else
+// return time ;
+//
+// time = ctick->CrossingTime(fTimeThreshold) ;
+// }
+// return time ;
+//}
+//
//____________________________________________________________________________
Bool_t AliEMCALDigitizer::Init()
void AliEMCALDigitizer::InitParameters()
{
// Parameter initialization for digitizer
- // Tune parameters - 24-nov-04; Apr 29, 2007
- // New parameters JLK 14-Apr-2008
-
- fMeanPhotonElectron = 4400; // electrons per GeV
- fPinNoise = 0.012; // pin noise in GeV from analysis test beam data
- if (fPinNoise == 0. )
+
+ fMeanPhotonElectron = AliEMCALSimParam::GetInstance()->GetMeanPhotonElectron();//4400; // electrons per GeV
+ fPinNoise = AliEMCALSimParam::GetInstance()->GetPinNoise();//0.012; // pin noise in GeV from analysis test beam data
+ if (fPinNoise < 0.0001 )
Warning("InitParameters", "No noise added\n") ;
- fDigitThreshold = fPinNoise * 3; // 3 * sigma
- fTimeResolution = 0.6e-9 ; // 600 psc
- fTimeSignalLength = 1.0e-9 ;
+ fDigitThreshold = AliEMCALSimParam::GetInstance()->GetDigitThreshold(); //fPinNoise * 3; // 3 * sigma
+ fTimeResolution = AliEMCALSimParam::GetInstance()->GetTimeResolution(); //0.6e-9 ; // 600 psc
// These defaults are normally not used.
// Values are read from calibration database instead
- fADCchannelEC = 0.0153; // Update 24 Apr 2007: 250./16/1024 - width of one ADC channel in GeV
- fADCpedestalEC = 0.0 ; // GeV
- fNADCEC = (Int_t) TMath::Power(2,16) ; // number of channels in Tower ADC - 65536
+ fADCchannelEC = 0.0153; // Update 24 Apr 2007: 250./16/1024 - width of one ADC channel in GeV
+ fADCpedestalEC = 0.0 ; // GeV
+
+ fNADCEC = AliEMCALSimParam::GetInstance()->GetNADCEC();//(Int_t) TMath::Power(2,16) ; // number of channels in Tower ADC - 65536
+
+ AliDebug(2,Form("Mean Photon Electron %d, Noise %f, E Threshold %f,Time Resolution %g,NADCEC %d",
+ fMeanPhotonElectron,fPinNoise,fDigitThreshold,fTimeResolution,fNADCEC));
- fTimeThreshold = 0.001*10000000 ; // Means 1 MeV in terms of SDigits amplitude ??
+ // Not used anymore, remove?
+ // fTimeSignalLength = 1.0e-9 ;
+ // fTimeThreshold = 0.001*10000000 ; // Means 1 MeV in terms of SDigits amplitude ??
}
void Exec(Option_t *option); // Supervising method
Float_t GetDigitThreshold() const { return fDigitThreshold;}
- Float_t GetPedestal() const { return fPedestal; }
+ //Float_t GetPedestal() const { return fPedestal; }
Float_t GetPinNoise() const { return fPinNoise;}
- Float_t GetSlope() const { return fSlope; }
+ //Float_t GetSlope() const { return fSlope; }
Float_t GetTimeResolution() const { return fTimeResolution ; }
Float_t GetECAchannel() const { return fADCchannelEC ; }
Float_t GetECApedestal() const { return fADCpedestalEC ; }
Float_t TimeOfNoise(void) ; // Calculate time signal generated by noise
//Calculate the time of crossing of the threshold by front edge
- Float_t FrontEdgeTime(TClonesArray * ticks) ;
+ //Float_t FrontEdgeTime(TClonesArray * ticks) ;
+
Int_t DigitizeEnergy(Float_t energy, Int_t AbsId) ;
private:
Float_t fDigitThreshold ; // Threshold for storing digits in EMC
Int_t fMeanPhotonElectron ; // number of photon electrons per GeV deposited energy
- Float_t fPedestal ; // Calibration parameters
- Float_t fSlope ; // read from SDigitizer
+ //Float_t fPedestal ; // Calibration parameters //Not used, remove?
+ //Float_t fSlope ; // read from SDigitizer //Not used, remove?
Float_t fPinNoise ; // Electronics noise in EMC
Float_t fTimeResolution ; // Time resolution of FEE electronics
- Float_t fTimeThreshold ; // Threshold to start timing for given crystall
- Float_t fTimeSignalLength ; // Length of the timing signal
+ //Float_t fTimeThreshold ; // Threshold to start timing for given crystall //Not used, remove?
+ //Float_t fTimeSignalLength ; // Length of the timing signal //Not used, remove?
Float_t fADCchannelEC ; // width of one ADC channel in EC section (GeV)
Float_t fADCpedestalEC ; // pedestal for one ADC channel
Int_t fNADCEC ; // number of channels in EC section ADC
AliEMCALCalibData * fCalibData; //Calibration data pointer
- ClassDef(AliEMCALDigitizer,7) // description
+ ClassDef(AliEMCALDigitizer,8) // description
};
#include "AliEMCALHit.h"
#include "AliEMCALSDigitizer.h"
#include "AliEMCALGeometry.h"
+#include "AliEMCALSimParam.h"
ClassImp(AliEMCALSDigitizer)
//Digitize() and Calibrate() methods
//
// Initializes parameters
- fA = 0;
- fB = 1.e+6; // Changed 24 Apr 2007. Dynamic range now 2 TeV
+ fA = AliEMCALSimParam::GetInstance()->GetA(); //0;
+ fB = AliEMCALSimParam::GetInstance()->GetB(); //1.e+6; // Changed 24 Apr 2007. Dynamic range now 2 TeV
fSampling = geom->GetSampling();
// threshold for deposit energy of hit
- fECPrimThreshold = 0.05;// GeV // 22-may-07 was 0// 24-nov-04 - was 1.e-6;
+ fECPrimThreshold = AliEMCALSimParam::GetInstance()->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)));
AliDebug(2,Form(" Sampling = %f\n", fSampling));
AliDebug(2,Form("---------------------------------------------------\n"));
-
}
//____________________________________________________________________________
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+ //
+ // Base class for the EMCAL simulation parameters.
+ //
+ //
+ */
+
+// --- Root header files ---
+#include "TMath.h"
+// --- AliRoot header files ---
+#include "AliEMCALSimParam.h"
+#include "AliLog.h"
+
+
+ClassImp(AliEMCALSimParam)
+
+AliEMCALSimParam * AliEMCALSimParam::fgSimParam = 0 ;
+//-----------------------------------------------------------------------------
+AliEMCALSimParam::AliEMCALSimParam() :
+TNamed(),
+fDigitThreshold(0),
+fMeanPhotonElectron(0),
+fPinNoise(0),
+fTimeResolution(0),
+//fTimeThreshold(0),
+//fTimeSignalLength(0),
+fNADCEC(0),//Digitizer
+fA(0.),
+fB(0.),
+fECPrimThreshold(0.) //SDigitizer
+{
+ //Constructor
+
+ //Parameters in Digitizer
+ fMeanPhotonElectron = 4400; // electrons per GeV
+ fPinNoise = 0.012; // pin noise in GeV from analysis test beam data
+ fDigitThreshold = fPinNoise * 3; // 3 * sigma
+ fTimeResolution = 0.6e-9 ; // 600 psc
+ //fTimeSignalLength = 1.0e-9 ;
+ fNADCEC = (Int_t) TMath::Power(2,16) ; // number of channels in Tower ADC - 65536
+ //fTimeThreshold = 0.001*10000000 ; // Means 1 MeV in terms of SDigits amplitude ??
+
+ //SDigitizer
+ fA = 0;
+ fB = 1.e+6; // Dynamic range now 2 TeV
+ fECPrimThreshold = 0.05; // GeV // threshold for deposit energy of hit
+
+}
+
+
+//-----------------------------------------------------------------------------
+AliEMCALSimParam::AliEMCALSimParam(const AliEMCALSimParam& ):
+TNamed(),
+fDigitThreshold(0),
+fMeanPhotonElectron(0),
+fPinNoise(0),
+fTimeResolution(0),
+//fTimeThreshold(0),
+//fTimeSignalLength(0),//Digitizer
+fNADCEC(0),
+fA(0.),
+fB(0.),
+fECPrimThreshold(0.)//SDigitizer
+{
+ //Copy constructor.
+ AliError("Should not use copy constructor for singleton") ;
+
+ fgSimParam = this ;
+
+}
+
+//-----------------------------------------------------------------------------
+AliEMCALSimParam * AliEMCALSimParam::GetInstance(){
+// Get Instance
+
+ if(!fgSimParam){
+ fgSimParam = new AliEMCALSimParam() ;
+ }
+
+ return fgSimParam ;
+
+}
+
+//-----------------------------------------------------------------------------
+AliEMCALSimParam& AliEMCALSimParam::operator = (const AliEMCALSimParam& simParam)
+{
+ //Assignment operator.
+
+ if(this != &simParam) {
+ AliError("Should not use operator= for singleton\n") ;
+ }
+
+ return *this;
+}
+
+//-----------------------------------------------------------------------------
+void AliEMCALSimParam::Print(Option_t *) const
+{
+ // Print simulation parameters to stdout
+
+ printf("=== Parameters in Digitizer === \n");
+ printf("\t Electronics noise in EMC (fPinNoise) = %f\n", fPinNoise) ;
+ printf("\t Threshold in EMC (fDigitThreshold) = %f\n", fDigitThreshold) ;
+ printf("\t Time Resolution (fTimeResolution) = %g\n", fTimeResolution) ;
+ printf("\t Mean Photon-Electron (fMeanPhotonElectron) = %d\n", fMeanPhotonElectron) ;
+ printf("\t N channels in EC section ADC (fNADCEC) = %d\n", fNADCEC) ;
+
+ printf("\n");
+
+ printf("=== Parameters in SDigitizer === \n");
+ printf("\t sdigitization parameters A = %f\n", fA);
+ printf("\t B = %f\n", fB);
+ printf("\t Threshold for EC Primary assignment = %f\n", fECPrimThreshold);
+
+}
+
--- /dev/null
+#ifndef ALIEMCALSIMPARAM_H
+#define ALIEMCALSIMPARAM_H
+/* Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id: AliEMCALSimParam.h $ */
+/*
+//
+// Base class for the EMCAL simulation parameters.
+//
+//
+*/
+
+#include "TNamed.h"
+
+class AliEMCALSimParam : public TNamed {
+
+public:
+
+ AliEMCALSimParam();
+ AliEMCALSimParam(const AliEMCALSimParam& recoParam);
+ AliEMCALSimParam& operator = (const AliEMCALSimParam& recoParam);
+ virtual ~AliEMCALSimParam() {}
+
+ static AliEMCALSimParam * GetInstance() ;
+ virtual void Print(Option_t * option="") const ;
+
+ //Parameters used in Digitizer
+ Float_t GetDigitThreshold() const { return fDigitThreshold;}
+ Float_t GetPinNoise() const { return fPinNoise;}
+ Float_t GetTimeResolution() const { return fTimeResolution ; }
+ Int_t GetNADCEC() const { return fNADCEC ; }
+ Int_t GetMeanPhotonElectron() const { return fMeanPhotonElectron ; }
+ void SetDigitThreshold(Float_t val) { fDigitThreshold = val ; }
+ void SetPinNoise(Float_t val) { fPinNoise = val ; }
+ void SetTimeResolution(Float_t val) { fTimeResolution = val ; }
+ void SetNADCED(Int_t val) { fNADCEC = val ; }
+ void SetMeanPhotonElectron(Int_t val){ fMeanPhotonElectron = 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 ;}
+
+private:
+
+ AliEMCALSimParam(Int_t i); //True constructor which should be called by GetInstance()
+
+private:
+
+
+ static AliEMCALSimParam * fgSimParam ; // pointer to the unique instance of the class
+
+ // Digitizer
+ Float_t fDigitThreshold ; // Threshold for storing digits in EMC
+ Int_t fMeanPhotonElectron ; // number of photon electrons per GeV deposited energy
+ Float_t fPinNoise ; // Electronics noise in EMC
+ Float_t fTimeResolution ; // Time resolution of FEE electronics
+ //Float_t fTimeThreshold ; // Threshold to start timing for given crystall
+ //Float_t fTimeSignalLength ; // Length of the timing signal
+ Int_t fNADCEC ; // number of channels in EC section ADC
+
+ // SDigitizer
+ Float_t fA ; // Pedestal parameter
+ Float_t fB ; // Slope Digitizition parameters
+ Float_t fECPrimThreshold ; // To store primary if EC Shower Elos > threshold
+
+ ClassDef(AliEMCALSimParam,1)
+};
+
+#endif
+
#pragma link C++ class AliCaloCalibSignal+;
#pragma link C++ class AliEMCALSurvey+;
#pragma link C++ class AliEMCALRecParam+;
+#pragma link C++ class AliEMCALSimParam+;
#pragma link C++ class AliEMCALQAChecker+;
#pragma link C++ class AliEMCALSpaceFrame+;
#pragma link C++ class AliEMCALSTURawStream+;
AliCaloCalibSignal.cxx \
AliEMCALSurvey.cxx \
AliEMCALRecParam.cxx \
+AliEMCALSimParam.cxx \
AliEMCALQAChecker.cxx \
AliEMCALSpaceFrame.cxx \
AliEMCALSTURawStream.cxx \