LCOV - code coverage report
Current view: top level - PHOS/PHOSbase - AliPHOSSimParam.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 41 77 53.2 %
Date: 2016-06-14 17:26:59 Functions: 4 9 44.4 %

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

Generated by: LCOV version 1.11