1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //_________________________________________________________________________
17 // Manager class for PHOS version SUBATECH
18 //*-- Author : Odd Harald Oddland & Gines Martinez Feb-2000
19 // The main goal of this version of AliPHOS is to calculted the
20 // induced charged in the PIN diode, taking into account light
21 // tracking in the PbWO4 crystal, induced signal in the
22 // PIN due to MIPS particle and electronic noise.
23 // In this respect, this class derived from AliPHOSv0 and
24 // only the StepManager function has been "surcharged"
25 //////////////////////////////////////////////////////////////////////////////
27 // --- ROOT system ---
30 // --- Standard library ---
38 // --- AliRoot header files ---
40 #include "AliPHOSv1.h"
41 #include "AliPHOSHit.h"
42 #include "AliPHOSDigit.h"
48 //____________________________________________________________________________
49 AliPHOSv1::AliPHOSv1() :
54 //____________________________________________________________________________
55 AliPHOSv1::AliPHOSv1(const char *name, const char *title):
58 fLightYieldMean = 700000. ;
59 fIntrinsicPINEfficiency = 0.1875 ;
60 fLightYieldAttenuation = 0.0045 ;
61 fRecalibrationFactor = 6.2 / fLightYieldMean ;
62 fElectronsPerGeV = 36000.;
64 //____________________________________________________________________________
65 AliPHOSv1::AliPHOSv1(AliPHOSReconstructioner * Reconstructioner, const char *name, const char *title):
66 AliPHOSv0(Reconstructioner,name,title)
68 fLightYieldMean = 700000.;
69 fIntrinsicPINEfficiency = 0.1875 ;
70 fLightYieldAttenuation = 0.0045 ;
71 fRecalibrationFactor = 6.2 / fLightYieldMean ;
72 fElectronsPerGeV = 1/3.61 * 1.e+9 ; // Odd Harald work
75 //____________________________________________________________________________
76 AliPHOSv1::~AliPHOSv1()
81 //____________________________________________________________________________
88 //____________________________________________________________________________
89 void AliPHOSv1::StepManager(void)
91 Int_t relid[4] ; // (box, layer, row, column) indices
92 Float_t xyze[4] ; // position wrt MRS and energy deposited
95 Float_t lightyield ; // Light Yield per GeV
96 Float_t nElectrons ; // Number of electrons in the PIN diode
97 TString name = fGeom->GetName() ;
102 if ( name == "GPS2" ) { // the CPV is a PPSD
103 if( gMC->CurrentVolID(copy) == gMC->VolId("GCEL") )
104 // if( strcmp ( gMC->CurrentVolName(), "GCEL" ) == 0 ) // We are inside a gas cell
106 gMC->TrackPosition(pos) ;
110 xyze[3] = gMC->Edep() ;
113 if ( xyze[3] != 0 ) { // there is deposited energy
114 gMC->CurrentVolOffID(5, relid[0]) ; // get the PHOS Module number
115 gMC->CurrentVolOffID(3, relid[1]) ; // get the Micromegas Module number
116 // 1-> Geom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() upper
117 // > fGeom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() lower
118 gMC->CurrentVolOffID(1, relid[2]) ; // get the row number of the cell
119 gMC->CurrentVolID(relid[3]) ; // get the column number
121 // get the absolute Id number
124 fGeom->RelToAbsNumbering(relid,absid) ;
127 AddHit(gAlice->CurrentTrack(), absid, xyze );
129 } // there is deposited energy
130 } // We are inside the gas of the CPV
131 } // GPS2 configuration
133 if(gMC->CurrentVolID(copy) == gMC->VolId("PXTL") )
134 // if( strcmp ( gMC->CurrentVolName(), "PXTL" ) == 0 ) { // We are inside a PWO crystal
136 gMC->TrackPosition(pos) ;
140 lostenergy = gMC->Edep() ;
141 xyze[3] = gMC->Edep() ;
147 if ( xyze[3] != 0 ) {
148 gMC->CurrentVolOffID(10, relid[0]) ; // get the PHOS module number ;
149 relid[1] = 0 ; // means PW04
150 gMC->CurrentVolOffID(4, relid[2]) ; // get the row number inside the module
151 gMC->CurrentVolOffID(3, relid[3]) ; // get the cell number inside the module
153 // get the absolute Id number
156 fGeom->RelToAbsNumbering(relid,absid) ;
157 gMC->Gmtod(global, local, 1) ;
159 // calculating number of electrons in the PIN diode asociated to this hit
160 lightyield = gRandom->Poisson(fLightYieldMean) ;
161 nElectrons = lostenergy * lightyield * fIntrinsicPINEfficiency *
162 exp(-fLightYieldAttenuation * (local[1]+fGeom->GetCrystalSize(1)/2.0 ) ) ;
164 xyze[3] = nElectrons * fRecalibrationFactor ;
165 // add current hit to the hit list
166 AddHit(gAlice->CurrentTrack(), absid, xyze);
168 } // there is deposited energy
169 } // we are inside a PHOS Xtal
171 if(gMC->CurrentVolID(copy) == gMC->VolId("PPIN") ) // We are inside de PIN diode
173 gMC->TrackPosition(pos) ;
177 lostenergy = gMC->Edep() ;
178 xyze[3] = gMC->Edep() ;
180 if ( xyze[3] != 0 ) {
181 gMC->CurrentVolOffID(11, relid[0]) ; // get the PHOS module number ;
182 relid[1] = 0 ; // means PW04and PIN
183 gMC->CurrentVolOffID(5, relid[2]) ; // get the row number inside the module
184 gMC->CurrentVolOffID(4, relid[3]) ; // get the cell number inside the module
186 // get the absolute Id number
189 fGeom->RelToAbsNumbering(relid,absid) ;
191 // calculating number of electrons in the PIN diode asociated to this hit
192 nElectrons = lostenergy * fElectronsPerGeV ;
193 xyze[3] = nElectrons * fRecalibrationFactor ;
195 // add current hit to the hit list
196 AddHit(gAlice->CurrentTrack(), absid, xyze);
197 //printf("PIN volume is %d, %d, %d, %d \n",relid[0],relid[1],relid[2],relid[3]);
198 //printf("Lost energy in the PIN is %f \n",lostenergy) ;
199 } // there is deposited energy
200 } // we are inside a PHOS XtalPHOS PIN diode