]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSSimParam.cxx
Coverity fixes
[u/mrichter/AliRoot.git] / PHOS / AliPHOSSimParam.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 // Base class for the PHOS simulation parameters.
17 // Do not use in the simulation; use derivative classes instead.
18 // Author: Dmitri Peressounko, RRC KI
19
20 // --- AliRoot header files ---
21 #include "AliPHOSSimParam.h"
22 #include "AliLog.h"
23
24 ClassImp(AliPHOSSimParam)
25
26 AliPHOSSimParam  * AliPHOSSimParam::fgSimParam = 0 ;
27 //-----------------------------------------------------------------------------
28 AliPHOSSimParam::AliPHOSSimParam() :
29   TNamed(),
30   fLightYieldMean(0.),fIntrinsicAPDEfficiency(0.),
31   fLightFactor(0.),fAPDFactor(0.),         
32   fAPDNoise(0.),fEMCDigitThreshold(0.),
33   fEMCADCchannel(0.),fTOFa(0.),fTOFb(0.),
34   fEMCSubtractPedestals(kFALSE),
35   fGlobalAltroOffset(0),fGlobalAltroThreshold(0),fEMCSampleQualityCut(0),
36   fADCpedestalCpv(0.),fADCchanelCpv(0.),
37   fCPVNoise(0.),fCPVDigitThreshold(0.),fNADCcpv(0),
38   fDigitizeE(0)
39 {
40   //Default constructor.
41   for(Int_t i=0; i<10; i++) fDStream[i] = 0 ;
42 }
43
44 //-----------------------------------------------------------------------------
45 AliPHOSSimParam::AliPHOSSimParam(Int_t) :
46   TNamed(),
47   fLightYieldMean(0.),fIntrinsicAPDEfficiency(0.),
48   fLightFactor(0.),fAPDFactor(0.),         
49   fAPDNoise(0.),fEMCDigitThreshold(0.),
50   fEMCADCchannel(0.),fTOFa(0.),fTOFb(0.),
51   fEMCSubtractPedestals(kFALSE),
52   fGlobalAltroOffset(0),fGlobalAltroThreshold(0),fEMCSampleQualityCut(0),
53   fADCpedestalCpv(0.),fADCchanelCpv(0.),
54   fCPVNoise(0.),fCPVDigitThreshold(0.),
55   fNADCcpv(0),
56   fDigitizeE(0)
57 {
58   //Real (private) constructor 
59   //Set default parameters
60
61   //Parameters describing energy deposition and light collection by APD, used in AliPHOSv1
62   //Photoelectron statistics:
63   // The light yield is a poissonian distribution of the number of
64   // photons created in the PbWo4 crystal, calculated using following formula
65   // NumberOfPhotons = EnergyLost * LightYieldMean* APDEfficiency 
66   // LightYieldMean is parameter calculated to be over 47000 photons per GeV
67   // APDEfficiency is 0.02655
68   // k_0 is 0.0045 from Valery Antonenko
69   // The number of electrons created in the APD is
70   // NumberOfElectrons = APDGain * LightYield
71   // The APD Gain is 300
72   fLightYieldMean = 47000;            //Average number of photoelectrons per GeV
73   fIntrinsicAPDEfficiency = 0.02655 ; //APD efficiency including geometric coverage
74 //  fLightYieldAttenuation  = 0.0045 ;  //light attenuation in PWO. Last analysis shows no z-position dependence
75 //                                      //so we removed this dependence from simulations 
76   fLightFactor            = fLightYieldMean * fIntrinsicAPDEfficiency ; //Average number of photons collected by 
77                             //APD per GeV deposited energy
78   fAPDFactor              = (13.418/fLightYieldMean/100.) * 300. ; //factor relating light yield and APD response
79                             //evaluated as (13.418/fLightYieldMean/100) * APDGain ;
80
81
82   //Parameters defining electronic noise calculation and Digits noise thresholds
83   //used in AliPHOSDigitizer
84   fAPDNoise           = 0.004 ;  // [GeV]
85   fEMCDigitThreshold  = 2.5   ;  // [ADC counts]
86   fEMCADCchannel      = 0.005 ;  // [GeV]
87   fTOFa               = 0.5e-9 ; // [sec] constant term
88   fTOFb               = 1.e-9 ;  // [sec/sqrt(GeV)]] stohastic term
89
90   fADCpedestalCpv     = 0.012 ;  // [aux units]
91   fADCchanelCpv       = 0.0012;  // [aux units]    
92   fCPVNoise           = 0.01;    // [aux units]
93   fCPVDigitThreshold  = 0.09 ;   // [aux units]
94   fNADCcpv  =  (Int_t)TMath::Power(2,12) ;
95
96   fGlobalAltroOffset = 10;
97   fGlobalAltroThreshold = 5;
98   fEMCSampleQualityCut = 4.;
99
100   //Imput streams for merging. If true => this stream contains digits (and thus noise) and not SDigits.
101   for(Int_t i=0; i<10; i++){
102     fDStream[i] = 0 ;
103   }
104   fgSimParam = this ;
105 }
106
107 //-----------------------------------------------------------------------------
108 AliPHOSSimParam::AliPHOSSimParam(const AliPHOSSimParam& ):
109   TNamed(),
110   fLightYieldMean(0.),fIntrinsicAPDEfficiency(0.),
111   fLightFactor(0.),fAPDFactor(0.),         
112   fAPDNoise(0.),fEMCDigitThreshold(0.),
113   fEMCADCchannel(0.),fTOFa(0.),fTOFb(0.),
114   fEMCSubtractPedestals(kFALSE),
115   fGlobalAltroOffset(0),fGlobalAltroThreshold(0),fEMCSampleQualityCut(1.),
116   fADCpedestalCpv(0.),fADCchanelCpv(0.),
117   fCPVNoise(0.),fCPVDigitThreshold(0.),fNADCcpv(0),
118   fDigitizeE(0)
119 {
120   //Copy constructor.
121   AliError("Should not use copy constructor for singleton") ;
122   for(Int_t  i=0; i<10; i++){
123     fDStream[i] = 0 ;
124   }
125   fgSimParam = this ;
126 }
127 //-----------------------------------------------------------------------------                                                            
128 AliPHOSSimParam * AliPHOSSimParam::GetInstance(){
129
130   if(!fgSimParam)
131     new AliPHOSSimParam(0) ;
132   return fgSimParam ;
133 }
134 //-----------------------------------------------------------------------------
135 AliPHOSSimParam& AliPHOSSimParam::operator = (const AliPHOSSimParam& simParam)
136 {
137   //Assignment operator.
138
139   if(this != &simParam) {
140     AliError("Should not use operator= for singleton\n") ;
141   }
142
143   return *this;
144 }
145