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 = 2.77e+8 ;
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 = 2.77e+8 ; // 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 Int_t primary = gAlice->GetPrimary( gAlice->CurrentTrack() );
104 if ( name == "GPS2" ) { // the CPV is a PPSD
105 if( gMC->CurrentVolID(copy) == gMC->VolId("GCEL") )
106 // if( strcmp ( gMC->CurrentVolName(), "GCEL" ) == 0 ) // We are inside a gas cell
108 gMC->TrackPosition(pos) ;
112 xyze[3] = gMC->Edep() ;
115 if ( xyze[3] != 0 ) { // there is deposited energy
116 gMC->CurrentVolOffID(5, relid[0]) ; // get the PHOS Module number
117 gMC->CurrentVolOffID(3, relid[1]) ; // get the Micromegas Module number
118 // 1-> Geom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() upper
119 // > fGeom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() lower
120 gMC->CurrentVolOffID(1, relid[2]) ; // get the row number of the cell
121 gMC->CurrentVolID(relid[3]) ; // get the column number
123 // get the absolute Id number
126 fGeom->RelToAbsNumbering(relid,absid) ;
129 AddHit(primary, absid, xyze );
131 } // there is deposited energy
132 } // We are inside the gas of the CPV
133 } // GPS2 configuration
135 if(gMC->CurrentVolID(copy) == gMC->VolId("PXTL") )
136 // if( strcmp ( gMC->CurrentVolName(), "PXTL" ) == 0 ) { // We are inside a PWO crystal
138 gMC->TrackPosition(pos) ;
142 lostenergy = gMC->Edep() ;
143 xyze[3] = gMC->Edep() ;
149 if ( xyze[3] != 0 ) {
150 gMC->CurrentVolOffID(10, relid[0]) ; // get the PHOS module number ;
151 relid[1] = 0 ; // means PW04
152 gMC->CurrentVolOffID(4, relid[2]) ; // get the row number inside the module
153 gMC->CurrentVolOffID(3, relid[3]) ; // get the cell number inside the module
155 // get the absolute Id number
158 fGeom->RelToAbsNumbering(relid,absid) ;
159 gMC->Gmtod(global, local, 1) ;
161 // calculating number of electrons in the PIN diode asociated to this hit
162 lightyield = gRandom->Poisson(fLightYieldMean) ;
163 nElectrons = lostenergy * lightyield * fIntrinsicPINEfficiency *
164 exp(-fLightYieldAttenuation * (local[1]+fGeom->GetCrystalSize(1)/2.0 ) ) ;
166 xyze[3] = nElectrons * fRecalibrationFactor ;
167 // add current hit to the hit list
168 AddHit(primary, absid, xyze);
170 } // there is deposited energy
171 } // we are inside a PHOS Xtal
173 if(gMC->CurrentVolID(copy) == gMC->VolId("PPIN") ) // We are inside de PIN diode
175 gMC->TrackPosition(pos) ;
179 lostenergy = gMC->Edep() ;
180 xyze[3] = gMC->Edep() ;
182 if ( xyze[3] != 0 ) {
183 gMC->CurrentVolOffID(11, relid[0]) ; // get the PHOS module number ;
184 relid[1] = 0 ; // means PW04and PIN
185 gMC->CurrentVolOffID(5, relid[2]) ; // get the row number inside the module
186 gMC->CurrentVolOffID(4, relid[3]) ; // get the cell number inside the module
188 // get the absolute Id number
191 fGeom->RelToAbsNumbering(relid,absid) ;
193 // calculating number of electrons in the PIN diode asociated to this hit
194 nElectrons = lostenergy * fElectronsPerGeV ;
195 xyze[3] = nElectrons * fRecalibrationFactor ;
197 // add current hit to the hit list
198 AddHit(primary, absid, xyze);
199 //printf("PIN volume is %d, %d, %d, %d \n",relid[0],relid[1],relid[2],relid[3]);
200 //printf("Lost energy in the PIN is %f \n",lostenergy) ;
201 } // there is deposited energy
202 } // we are inside a PHOS XtalPHOS PIN diode