]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALSimParam.cxx
- provide option to save all individual pads of all canvases, by default it is off
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALSimParam.cxx
1 /**************************************************************************
2  * Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved.      *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /*
17  //
18  // Base class for the EMCAL simulation parameters.
19  //
20  //
21  */
22
23 // --- Root header files ---
24 #include "TMath.h"
25 // --- AliRoot header files ---
26 #include "AliEMCALSimParam.h"
27 #include "AliLog.h"
28
29
30 ClassImp(AliEMCALSimParam)
31
32 AliEMCALSimParam  * AliEMCALSimParam::fgSimParam = 0 ;
33 //-----------------------------------------------------------------------------
34 AliEMCALSimParam::AliEMCALSimParam() :
35 TNamed(),    
36 fDigitThreshold(0),
37 fMeanPhotonElectron(0),
38 fPinNoise(0),
39 fTimeDelay(0),
40 fTimeResolution(0),
41 //fTimeThreshold(0),    
42 //fTimeSignalLength(0),
43 fNADCEC(0),//Digitizer
44 fA(0.),
45 fB(0.),
46 fECPrimThreshold(0.) //SDigitizer   
47 {
48         //Constructor 
49         
50         //Parameters in Digitizer
51         fMeanPhotonElectron = 4400;  // electrons per GeV 
52         fPinNoise           = 0.012; // pin noise in GeV from analysis test beam data 
53         fDigitThreshold     = 3; // 3 ADC counts not anymore cut in energy: //fPinNoise * 3; // 3 * sigma
54         fTimeResolution     = 0.6e-9 ; // 600 pc
55         fTimeDelay          = 600e-9 ; // 600 nc
56
57         //fTimeSignalLength   = 1.0e-9 ;
58         fNADCEC             = (Int_t) TMath::Power(2,16) ; // number of channels in Tower ADC - 65536
59         //fTimeThreshold      = 0.001*10000000 ; // Means 1 MeV in terms of SDigits amplitude ??
60         
61         //SDigitizer
62         fA                  = 0;
63         fB                  = 1.e+6; // Dynamic range now 2 TeV
64         fECPrimThreshold    = 0.05;  // GeV     // threshold for deposit energy of hit
65         
66 }
67
68
69 //-----------------------------------------------------------------------------
70 AliEMCALSimParam::AliEMCALSimParam(const AliEMCALSimParam& ):
71 TNamed(),
72 fDigitThreshold(0),
73 fMeanPhotonElectron(0),
74 fPinNoise(0),
75 fTimeDelay(0),
76 fTimeResolution(0),
77 //fTimeThreshold(0),    
78 //fTimeSignalLength(0),//Digitizer
79 fNADCEC(0),
80 fA(0.),
81 fB(0.),
82 fECPrimThreshold(0.)//SDigitizer
83 {
84   //Copy constructor.
85   AliError("Should not use copy constructor for singleton") ;
86
87   fgSimParam = this ;
88         
89 }
90
91 //-----------------------------------------------------------------------------                                                            
92 AliEMCALSimParam * AliEMCALSimParam::GetInstance(){
93 // Get Instance
94
95         if(!fgSimParam){
96                 fgSimParam = new AliEMCALSimParam() ;
97         }
98         
99         return fgSimParam ;
100         
101 }
102
103 //-----------------------------------------------------------------------------
104 AliEMCALSimParam& AliEMCALSimParam::operator = (const AliEMCALSimParam& simParam)
105 {
106   //Assignment operator.
107
108   if(this != &simParam) {
109     AliError("Should not use operator= for singleton\n") ;
110   }
111
112   return *this;
113 }
114
115 //-----------------------------------------------------------------------------
116 void AliEMCALSimParam::Print(Option_t *) const
117 {
118         // Print simulation parameters to stdout
119         
120         printf("=== Parameters in Digitizer === \n");
121         printf("\t Electronics noise in EMC (fPinNoise)       = %f\n", fPinNoise) ;
122         printf("\t Threshold  in EMC  (fDigitThreshold)       = %d\n", fDigitThreshold)  ;
123         printf("\t Time Resolution (fTimeResolution)          = %g\n", fTimeResolution) ;
124         printf("\t Time Delay (fTimeDelay)                    = %g\n", fTimeDelay) ;
125         printf("\t Mean Photon-Electron (fMeanPhotonElectron) = %d\n", fMeanPhotonElectron)  ;
126         printf("\t N channels in EC section ADC (fNADCEC)     = %d\n", fNADCEC) ;
127
128         printf("\n");
129         
130         printf("=== Parameters in SDigitizer === \n");
131         printf("\t sdigitization parameters       A = %f\n",     fA);
132         printf("\t                                B = %f\n",     fB);
133         printf("\t Threshold for EC Primary assignment  = %f\n", fECPrimThreshold);
134         
135 }
136