1 <!DOCTYPE HTML PUBLIC "-// IETF/DTD HTML 2.0// EN">
4 <!-- Author: ROOT team (rootdev@hpsalo.cern.ch) -->
6 <!-- Date: Mon Mar 26 12:10:35 2001 -->
9 <title>AliPHOSv3 - source file</title>
10 <link rev=made href="mailto:rootdev@root.cern.ch">
11 <meta name="rating" content="General">
12 <meta name="objecttype" content="Manual">
13 <meta name="keywords" content="software development, oo, object oriented, unix, x11, windows, c++, html, rene brun, fons rademakers">
14 <meta name="description" content="ROOT - An Object Oriented Framework For Large Scale Data Analysis.">
16 <body BGCOLOR="#ffffff" LINK="#0000ff" VLINK="#551a8b" ALINK="#ff0000" TEXT="#000000">
17 <a name="TopOfPage"></a>
19 /**************************************************************************
20 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
22 * Author: The ALICE Off-line Project. *
23 * Contributors are mentioned in the code where appropriate. *
25 * Permission to use, copy, modify and distribute this software and its *
26 * documentation strictly for non-commercial purposes is hereby granted *
27 * without fee, provided that the above copyright notice appears in all *
28 * copies and that both the copyright notice and this permission notice *
29 * appear in the supporting documentation. The authors make no claims *
30 * about the suitability of this software for any purpose. It is *
31 * provided "as is" without express or implied warranty. *
32 **************************************************************************/
36 <b>//_________________________________________________________________________</b>
37 <b>// Implementation version v0 of PHOS Manager class </b>
38 <b>// Layout EMC + PPSD has name GPS2 </b>
39 <b>// The main goal of this version of <a href=".././AliPHOS.html">AliPHOS</a> is to calculte the </b>
40 <b>// induced charged in the PIN diode, taking into account light</b>
41 <b>// tracking in the PbWO4 crystal, induced signal in the </b>
42 <b>// PIN due to MIPS particle and electronic noise.</b>
43 <b>// This is done in the StepManager </b>
45 <b>//*-- Author: Odd Harald Oddland & Gines Martinez (SUBATECH)</b>
48 <b>// --- ROOT system ---</b>
51 <b>// --- Standard library ---</b>
53 #include <stdio.h>
54 #include <string.h>
55 #include <stdlib.h>
56 #include <strstream.h>
58 <b>// --- AliRoot header files ---</b>
60 #include "<a href="../AliPHOSv3.h">AliPHOSv3.h</a>"
61 #include "AliPHOSHit.h"
62 #include "AliPHOSCPVDigit.h"
66 #include "AliPHOSGeometry.h"
70 <b>//____________________________________________________________________________</b>
71 <a name="AliPHOSv3:AliPHOSv3"> </a> <a href=".././AliPHOSv3.html#AliPHOSv3:AliPHOSv3">AliPHOSv3::AliPHOSv3</a>(const <a href="../ListOfTypes.html#char">char</a> *name, const <a href="../ListOfTypes.html#char">char</a> *title):
72 <a href=".././AliPHOSv1.html">AliPHOSv1</a>(name,title)
76 <b> // Number of electrons created in the PIN due to light collected in the PbWo4 crystal is calculated using </b>
77 <b> // following formula</b>
78 <b> // NumberOfElectrons = EnergyLost * LightYield * PINEfficiency * </b>
79 <b> // exp (-LightYieldAttenuation * DistanceToPINdiodeFromTheHit) *</b>
80 <b> // RecalibrationFactor ;</b>
81 <b> // LightYield is obtained as a Poissonian distribution with a mean at 700000 photons per GeV fromValery Antonenko</b>
82 <b> // PINEfficiency is 0.1875 from Odd Harald Odland work</b>
83 <b> // k_0 is 0.0045 from Valery Antonenko </b>
86 <a href=".././AliPHOSv3.html#AliPHOSv3:fLightYieldMean">fLightYieldMean</a> = 700000. ;
87 <a href=".././AliPHOSv3.html#AliPHOSv3:fIntrinsicPINEfficiency">fIntrinsicPINEfficiency</a> = 0.1875 ;
88 <a href=".././AliPHOSv3.html#AliPHOSv3:fLightYieldAttenuation">fLightYieldAttenuation</a> = 0.0045 ;
89 <a href=".././AliPHOSv3.html#AliPHOSv3:fRecalibrationFactor">fRecalibrationFactor</a> = 6.2 / <a href=".././AliPHOSv3.html#AliPHOSv3:fLightYieldMean">fLightYieldMean</a> ;
90 <a href=".././AliPHOSv3.html#AliPHOSv3:fElectronsPerGeV">fElectronsPerGeV</a> = 2.77e+8 ;
93 <b>// //____________________________________________________________________________</b>
94 <b>// <a href=".././AliPHOSv3.html#AliPHOSv3:AliPHOSv3">AliPHOSv3::AliPHOSv3</a>(<a href=".././AliPHOSReconstructioner.html">AliPHOSReconstructioner</a> * Reconstructioner, const <a href="../ListOfTypes.html#char">char</a> *name, const <a href="../ListOfTypes.html#char">char</a> *title):</b>
95 <b>// <a href=".././AliPHOSv1.html">AliPHOSv1</a>(Reconstructioner,name,title)</b>
99 <b>// // Number of electrons created in the PIN due to light collected in the PbWo4 crystal is calculated using </b>
100 <b>// // following formula</b>
101 <b>// // NumberOfElectrons = EnergyLost * LightYield * PINEfficiency * </b>
102 <b>// // exp (-LightYieldAttenuation * DistanceToPINdiodeFromTheHit) *</b>
103 <b>// // RecalibrationFactor ;</b>
104 <b>// // LightYield is obtained as a Poissonian distribution with a mean at 700000 photons per GeV fromValery Antonenko</b>
105 <b>// // PINEfficiency is 0.1875 from Odd Harald Odland work</b>
106 <b>// // k_0 is 0.0045 from Valery Antonenko </b>
108 <b>// <a href=".././AliPHOSv3.html#AliPHOSv3:fLightYieldMean">fLightYieldMean</a> = 700000.;</b>
109 <b>// <a href=".././AliPHOSv3.html#AliPHOSv3:fIntrinsicPINEfficiency">fIntrinsicPINEfficiency</a> = 0.1875 ;</b>
110 <b>// <a href=".././AliPHOSv3.html#AliPHOSv3:fLightYieldAttenuation">fLightYieldAttenuation</a> = 0.0045 ;</b>
111 <b>// <a href=".././AliPHOSv3.html#AliPHOSv3:fRecalibrationFactor">fRecalibrationFactor</a> = 6.2 / <a href=".././AliPHOSv3.html#AliPHOSv3:fLightYieldMean">fLightYieldMean</a> ;</b>
112 <b>// <a href=".././AliPHOSv3.html#AliPHOSv3:fElectronsPerGeV">fElectronsPerGeV</a> = 2.77e+8 ;</b>
114 <b>//____________________________________________________________________________</b>
116 <a name="AliPHOSv3:StepManager"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSv3.html#AliPHOSv3:StepManager">AliPHOSv3::StepManager</a>(<a href="../ListOfTypes.html#void">void</a>)
118 <b> // Accumulates hits as <a href="../ListOfTypes.html#long">long</a> as the track stays in a single crystal or PPSD gas Cell</b>
120 <b>// if (gMC->IsTrackEntering())</b>
121 <b>// cout << "Track enters the volume " << gMC->CurrentVolName() << endl;</b>
122 <b>// if (gMC->IsTrackExiting())</b>
123 <b>// cout << "Track leaves the volume " << gMC->CurrentVolName() << endl;</b>
125 <a href="../ListOfTypes.html#Int_t">Int_t</a> relid[4] ; // (box, layer, row, column) indices
126 <a href="../ListOfTypes.html#Int_t">Int_t</a> absid ; // absolute cell ID <a href="../ListOfTypes.html#number">number</a>
127 <a href="../ListOfTypes.html#Float_t">Float_t</a> xyze[4]={0,0,0,0} ; // position wrt MRS and energy deposited
128 TLorentzVector pos ; // Lorentz vector of the track current position
129 <a href="../ListOfTypes.html#Int_t">Int_t</a> copy ;
131 <a href="../ListOfTypes.html#Int_t">Int_t</a> tracknumber = gAlice->CurrentTrack() ;
132 <a href="../ListOfTypes.html#Int_t">Int_t</a> primary = gAlice->GetPrimary( gAlice->CurrentTrack() );
133 TString name = <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>->GetName() ;
136 if ( name == "GPS2" || name == "MIXT" ) { // ======> CPV is a GPS' PPSD
138 if( gMC->CurrentVolID(copy) == gMC->VolId("GCEL") ) // We are inside a gas cell
140 gMC->TrackPosition(pos) ;
144 xyze[3] = gMC->Edep() ;
146 if ( xyze[3] != 0) { // there is deposited energy
147 gMC->CurrentVolOffID(5, relid[0]) ; // get the PHOS Module <a href="../ListOfTypes.html#number">number</a>
148 if ( name == "MIXT" && strcmp(gMC->CurrentVolOffName(5),"PHO1") == 0 ){
149 relid[0] += <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>-><a href=".././AliPHOSGeometry.html#AliPHOSGeometry:GetNModules">GetNModules</a>() - <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>-><a href=".././AliPHOSGeometry.html#AliPHOSGeometry:GetNPPSDModules">GetNPPSDModules</a>();
151 gMC->CurrentVolOffID(3, relid[1]) ; // get the Micromegas Module <a href="../ListOfTypes.html#number">number</a>
152 <b> // 1-> <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>-><a href=".././AliPHOSGeometry.html#AliPHOSGeometry:GetNumberOfModulesPhi">GetNumberOfModulesPhi</a>() * <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>-><a href=".././AliPHOSGeometry.html#AliPHOSGeometry:GetNumberOfModulesZ">GetNumberOfModulesZ</a>() upper</b>
153 <b> // > <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>-><a href=".././AliPHOSGeometry.html#AliPHOSGeometry:GetNumberOfModulesPhi">GetNumberOfModulesPhi</a>() * <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>-><a href=".././AliPHOSGeometry.html#AliPHOSGeometry:GetNumberOfModulesZ">GetNumberOfModulesZ</a>() lower</b>
154 gMC->CurrentVolOffID(1, relid[2]) ; // get the row <a href="../ListOfTypes.html#number">number</a> of the cell
155 gMC->CurrentVolID(relid[3]) ; // get the column <a href="../ListOfTypes.html#number">number</a>
157 <b> // get the absolute Id <a href="../ListOfTypes.html#number">number</a></b>
159 <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>-><a href=".././AliPHOSGeometry.html#AliPHOSGeometry:RelToAbsNumbering">RelToAbsNumbering</a>(relid, absid) ;
161 <b> // add current hit to the hit list </b>
162 AddHit(fIshunt, primary, tracknumber, absid, xyze);
165 } // there is deposited energy
166 } // We are inside the gas of the CPV
167 } // GPS2 configuration
169 if ( name == "IHEP" || name == "MIXT" ) { // ======> CPV is a IHEP's one
171 <b> // Yuri Kharlov, 28 September 2000</b>
173 if( gMC->CurrentVolID(copy) == gMC->VolId("CPVQ") &&
174 gMC->IsTrackEntering() &&
175 gMC->TrackCharge() != 0) {
177 gMC -> TrackPosition(pos);
178 <a href="../ListOfTypes.html#Float_t">Float_t</a> xyzm[3], xyzd[3] ;
179 <a href="../ListOfTypes.html#Int_t">Int_t</a> i;
180 for (i=0; i<3; i++) xyzm[i] = pos[i];
181 gMC -> Gmtod (xyzm, xyzd, 1); // transform coordinate from master to daughter system
183 <a href="../ListOfTypes.html#Float_t">Float_t</a> xyd[3]={0,0,0} ; //local posiiton of the entering
189 <b> // Current momentum of the hit's track in the local ref. system</b>
190 TLorentzVector pmom ; //momentum of the particle initiated hit
191 gMC -> TrackMomentum(pmom);
192 <a href="../ListOfTypes.html#Float_t">Float_t</a> pm[3], pd[3];
193 for (i=0; i<3; i++) pm[i] = pmom[i];
194 gMC -> Gmtod (pm, pd, 2); // transform 3-momentum from master to daughter system
199 <b> // Digitize the current CPV hit:</b>
201 <b> // 1. find pad response and</b>
203 <a href="../ListOfTypes.html#Int_t">Int_t</a> moduleNumber;
204 gMC->CurrentVolOffID(3,moduleNumber);
208 TClonesArray *cpvDigits = new TClonesArray("<a href=".././AliPHOSCPVDigit.html">AliPHOSCPVDigit</a>",0); // array of digits for current hit
209 CPVDigitize(pmom,xyd,moduleNumber,cpvDigits);
211 <a href="../ListOfTypes.html#Float_t">Float_t</a> xmean = 0;
212 <a href="../ListOfTypes.html#Float_t">Float_t</a> zmean = 0;
213 <a href="../ListOfTypes.html#Float_t">Float_t</a> qsum = 0;
214 <a href="../ListOfTypes.html#Int_t">Int_t</a> idigit,ndigits;
216 <b> // 2. go through the current digit list and sum digits in pads</b>
218 ndigits = cpvDigits->GetEntriesFast();
219 for (idigit=0; idigit<ndigits-1; idigit++) {
220 <a href=".././AliPHOSCPVDigit.html">AliPHOSCPVDigit</a> *cpvDigit1 = (<a href=".././AliPHOSCPVDigit.html">AliPHOSCPVDigit</a>*) cpvDigits->UncheckedAt(idigit);
221 <a href="../ListOfTypes.html#Float_t">Float_t</a> x1 = cpvDigit1->GetXpad() ;
222 <a href="../ListOfTypes.html#Float_t">Float_t</a> z1 = cpvDigit1->GetYpad() ;
223 for (<a href="../ListOfTypes.html#Int_t">Int_t</a> jdigit=idigit+1; jdigit<ndigits; jdigit++) {
224 <a href=".././AliPHOSCPVDigit.html">AliPHOSCPVDigit</a> *cpvDigit2 = (<a href=".././AliPHOSCPVDigit.html">AliPHOSCPVDigit</a>*) cpvDigits->UncheckedAt(jdigit);
225 <a href="../ListOfTypes.html#Float_t">Float_t</a> x2 = cpvDigit2->GetXpad() ;
226 <a href="../ListOfTypes.html#Float_t">Float_t</a> z2 = cpvDigit2->GetYpad() ;
227 if (x1==x2 && z1==z2) {
228 <a href="../ListOfTypes.html#Float_t">Float_t</a> qsum = cpvDigit1->GetQpad() + cpvDigit2->GetQpad() ;
229 cpvDigit2->SetQpad(qsum) ;
230 cpvDigits->RemoveAt(idigit) ;
234 cpvDigits->Compress() ;
236 <b> // 3. add digits to temporary hit list fTmpHits</b>
238 ndigits = cpvDigits->GetEntriesFast();
239 for (idigit=0; idigit<ndigits; idigit++) {
240 <a href=".././AliPHOSCPVDigit.html">AliPHOSCPVDigit</a> *cpvDigit = (<a href=".././AliPHOSCPVDigit.html">AliPHOSCPVDigit</a>*) cpvDigits->UncheckedAt(idigit);
241 relid[0] = moduleNumber + 1 ; // CPV (or PHOS) module <a href="../ListOfTypes.html#number">number</a>
242 relid[1] =-1 ; // means CPV
243 relid[2] = cpvDigit->GetXpad() ; // column <a href="../ListOfTypes.html#number">number</a> of a pad
244 relid[3] = cpvDigit->GetYpad() ; // row <a href="../ListOfTypes.html#number">number</a> of a pad
246 <b> // get the absolute Id <a href="../ListOfTypes.html#number">number</a></b>
247 <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>-><a href=".././AliPHOSGeometry.html#AliPHOSGeometry:RelToAbsNumbering">RelToAbsNumbering</a>(relid, absid) ;
249 <b> // add current digit to the temporary hit list</b>
253 xyze[3] = cpvDigit->GetQpad() ; // amplitude in a pad
254 primary = -1; // No need in primary for CPV
255 AddHit(fIshunt, primary, tracknumber, absid, xyze);
257 if (cpvDigit->GetQpad() > 0.02) {
258 xmean += cpvDigit->GetQpad() * (cpvDigit->GetXpad() + 0.5);
259 zmean += cpvDigit->GetQpad() * (cpvDigit->GetYpad() + 0.5);
260 qsum += cpvDigit->GetQpad();
265 } // end of IHEP configuration
268 if(gMC->CurrentVolID(copy) == gMC->VolId("PXTL") ) { // We are inside a PBWO crystal
269 gMC->TrackPosition(pos) ;
273 xyze[3] = gMC->Edep() ;
276 if ( (xyze[3] != 0) ) { // Track is inside the crystal and deposits some energy
278 gMC->CurrentVolOffID(10, relid[0]) ; // get the PHOS module <a href="../ListOfTypes.html#number">number</a> ;
280 if ( name == "MIXT" && strcmp(gMC->CurrentVolOffName(10),"PHO1") == 0 )
281 relid[0] += <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>-><a href=".././AliPHOSGeometry.html#AliPHOSGeometry:GetNModules">GetNModules</a>() - <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>-><a href=".././AliPHOSGeometry.html#AliPHOSGeometry:GetNPPSDModules">GetNPPSDModules</a>();
283 relid[1] = 0 ; // means PBW04
284 gMC->CurrentVolOffID(4, relid[2]) ; // get the row <a href="../ListOfTypes.html#number">number</a> inside the module
285 gMC->CurrentVolOffID(3, relid[3]) ; // get the cell <a href="../ListOfTypes.html#number">number</a> inside the module
287 <b> // get the absolute Id <a href="../ListOfTypes.html#number">number</a></b>
288 <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>-><a href=".././AliPHOSGeometry.html#AliPHOSGeometry:RelToAbsNumbering">RelToAbsNumbering</a>(relid, absid) ;
290 <b> // add current hit to the hit list</b>
291 AddHit(fIshunt, primary,tracknumber, absid, xyze);
294 } // there is deposited energy
295 } // we are inside a PHOS Xtal
297 if(gMC->CurrentVolID(copy) == gMC->VolId("PPIN") ) // We are inside de PIN diode
299 gMC->TrackPosition(pos) ;
303 <a href="../ListOfTypes.html#Float_t">Float_t</a> lostenergy = gMC->Edep() ;
304 xyze[3] = gMC->Edep() ;
306 if ( xyze[3] != 0 ) {
307 gMC->CurrentVolOffID(11, relid[0]) ; // get the PHOS module <a href="../ListOfTypes.html#number">number</a> ;
308 relid[1] = 0 ; // means PW04 and PIN
309 gMC->CurrentVolOffID(5, relid[2]) ; // get the row <a href="../ListOfTypes.html#number">number</a> inside the module
310 gMC->CurrentVolOffID(4, relid[3]) ; // get the cell <a href="../ListOfTypes.html#number">number</a> inside the module
312 <b> // get the absolute Id <a href="../ListOfTypes.html#number">number</a></b>
314 <a href="../ListOfTypes.html#Int_t">Int_t</a> absid ;
315 <a href=".././AliPHOSv0.html#AliPHOSv0:fGeom">fGeom</a>-><a href=".././AliPHOSGeometry.html#AliPHOSGeometry:RelToAbsNumbering">RelToAbsNumbering</a>(relid,absid) ;
317 <b> // calculating <a href="../ListOfTypes.html#number">number</a> of electrons in the PIN diode asociated to this hit</b>
318 <a href="../ListOfTypes.html#Float_t">Float_t</a> nElectrons = lostenergy * <a href=".././AliPHOSv3.html#AliPHOSv3:fElectronsPerGeV">fElectronsPerGeV</a> ;
319 xyze[3] = nElectrons * <a href=".././AliPHOSv3.html#AliPHOSv3:fRecalibrationFactor">fRecalibrationFactor</a> ;
321 <b> // add current hit to the hit list</b>
322 AddHit(fIshunt, primary, tracknumber, absid, xyze);
323 <b> //printf("PIN volume is %d, %d, %d, %d n",relid[0],relid[1],relid[2],relid[3]);</b>
324 <b> //printf("Lost energy in the PIN is %f n",lostenergy) ;</b>
325 } // there is deposited energy
326 } // we are inside a PHOS XtalPHOS PIN diode
335 <a href="http://root.cern.ch/root/Welcome.html">ROOT page</a> - <a href="../ClassIndex.html">Class index</a> - <a href="#TopOfPage">Top of the page</a><br>
337 <hr>This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to <a href="mailto:rootdev@root.cern.ch">ROOT support</a>, or contact <a href="mailto:rootdev@root.cern.ch">the developers</a> with any questions or problems regarding ROOT.