X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSv0.cxx;h=72c87dfe1e74f04b34b6c5f987ba2a1a613bb29f;hb=4951e00319bd2e94edc59bbb2611816c320987f3;hp=0c620d1ef1c321698697d6b16a5fba9dc3412601;hpb=ff4c968a9ec8ba73486e1ea669f5760047fad9c7;p=u%2Fmrichter%2FAliRoot.git
diff --git a/PHOS/AliPHOSv0.cxx b/PHOS/AliPHOSv0.cxx
index 0c620d1ef1c..72c87dfe1e7 100644
--- a/PHOS/AliPHOSv0.cxx
+++ b/PHOS/AliPHOSv0.cxx
@@ -12,536 +12,304 @@
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
+/* $Id$ */
+
+/* History of cvs commits:
+ *
+ * $Log$
+ * Revision 1.79 2005/05/28 14:19:05 schutz
+ * Compilation warnings fixed by T.P.
+ *
+ */
//_________________________________________________________________________
-// Manager class for PHOS version SUBATECH
-//*-- Author : Y. Schutz SUBATECH
-//////////////////////////////////////////////////////////////////////////////
+// Implementation version v0 of PHOS Manager class
+// An object of this class does not produce hits nor digits
+// It is the one to use if you do not want to produce outputs in TREEH or TREED
+//
+//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
+
// --- ROOT system ---
-#include "TBRIK.h"
-#include "TNode.h"
-#include "TRandom.h"
+#include
+
+ PHOS in ALICE displayed by root
+
+
+
+
+
+
CPV perspective view | +CPV front view | +
+ | + |
+ */ + //END_HTML + + // Get pointer to the array containing media indexes Int_t *idtmed = fIdtmed->GetArray() - 699 ; - // --- - // --- Define PHOS box volume, fPUFPill with thermo insulating foam --- - // --- Foam Thermo Insulating outer cover dimensions --- - // --- Put it in bigbox = PHOS + AliPHOSGeometry * geom = GetGeometry() ; + AliPHOSEMCAGeometry * emcg = geom->GetEMCAGeometry() ; - Float_t dphos[3] ; - dphos[0] = fGeom->GetOuterBoxSize(0) / 2.0 ; - dphos[1] = fGeom->GetOuterBoxSize(1) / 2.0 ; - dphos[2] = fGeom->GetOuterBoxSize(2) / 2.0 ; + // ======= Define the strip =============== - gMC->Gsvolu("EMCA", "BOX ", idtmed[706], dphos, 3) ; + gMC->Gsvolu("PSTR", "BOX ", idtmed[716], emcg->GetStripHalfSize(), 3) ; //Made of stell + + // --- define air volume (cell of the honeycomb) + gMC->Gsvolu("PCEL", "BOX ", idtmed[798], emcg->GetAirCellHalfSize(), 3); - Float_t yO = - fGeom->GetPPSDBoxSize(1) / 2.0 ; + // --- define wrapped crystal and put it into AirCell - gMC->Gspos("EMCA", 1, "PHOS", 0.0, yO, 0.0, 0, "ONLY") ; + gMC->Gsvolu("PWRA", "BOX ", idtmed[702], emcg->GetWrappedHalfSize(), 3); + Float_t * pin = emcg->GetAPDHalfSize() ; + Float_t * preamp = emcg->GetPreampHalfSize() ; + Float_t y = (emcg->GetAirGapLed()-2*pin[1]-2*preamp[1])/2; + gMC->Gspos("PWRA", 1, "PCEL", 0.0, y, 0.0, 0, "ONLY") ; + + // --- Define crystall and put it into wrapped crystall --- + gMC->Gsvolu("PXTL", "BOX ", idtmed[699], emcg->GetCrystalHalfSize(), 3) ; + gMC->Gspos("PXTL", 1, "PWRA", 0.0, 0.0, 0.0, 0, "ONLY") ; + + // --- define APD/PIN preamp and put it into AirCell + + gMC->Gsvolu("PPIN", "BOX ", idtmed[705], emcg->GetAPDHalfSize(), 3) ; + Float_t * crystal = emcg->GetCrystalHalfSize() ; + y = crystal[1] + emcg->GetAirGapLed() /2 - preamp[1]; + gMC->Gspos("PPIN", 1, "PCEL", 0.0, y, 0.0, 0, "ONLY") ; + + gMC->Gsvolu("PREA", "BOX ", idtmed[711], emcg->GetPreampHalfSize(), 3) ; // Here I assumed preamp + // as a printed Circuit + y = crystal[1] + emcg->GetAirGapLed() /2 + pin[1] ; // May it should be changed + gMC->Gspos("PREA", 1, "PCEL", 0.0, y, 0.0, 0, "ONLY") ; // to ceramics? + - // --- - // --- Define Textolit Wall box, position inside EMCA --- - // --- Textolit Wall box dimentions --- - - - Float_t dptxw[3]; - dptxw[0] = fGeom->GetTextolitBoxSize(0) / 2.0 ; - dptxw[1] = fGeom->GetTextolitBoxSize(1) / 2.0 ; - dptxw[2] = fGeom->GetTextolitBoxSize(2) / 2.0 ; + // --- Fill strip with wrapped cristalls in Air Cells - gMC->Gsvolu("PTXW", "BOX ", idtmed[707], dptxw, 3); + Float_t* splate = emcg->GetSupportPlateHalfSize(); + y = -splate[1] ; + Float_t* acel = emcg->GetAirCellHalfSize() ; + Int_t icel ; + for(icel = 1; icel <= emcg->GetNCellsInStrip(); icel++){ + Float_t x = (2*icel - 1 - emcg->GetNCellsInStrip())* acel[0] ; + gMC->Gspos("PCEL", icel, "PSTR", x, y, 0.0, 0, "ONLY") ; + } - yO = ( fGeom->GetOuterBoxThickness(1) - fGeom->GetUpperPlateThickness() ) / 2. ; - - gMC->Gspos("PTXW", 1, "EMCA", 0.0, yO, 0.0, 0, "ONLY") ; + // --- define the support plate, hole in it and position it in strip ---- + gMC->Gsvolu("PSUP", "BOX ", idtmed[701], emcg->GetSupportPlateHalfSize(), 3) ; - // --- - // --- Define Upper Polystyrene Foam Plate, place inside PTXW --- - // --- immediately below Foam Thermo Insulation Upper plate --- + gMC->Gsvolu("PSHO", "BOX ", idtmed[798], emcg->GetSupportPlateInHalfSize(), 3) ; + Float_t z = emcg->GetSupportPlateThickness()/2 ; + gMC->Gspos("PSHO", 1, "PSUP", 0.0, 0.0, z, 0, "ONLY") ; - // --- Upper Polystyrene Foam plate thickness --- - - Float_t dpufp[3] ; - dpufp[0] = fGeom->GetTextolitBoxSize(0) / 2.0 ; - dpufp[1] = fGeom->GetSecondUpperPlateThickness() / 2. ; - dpufp[2] = fGeom->GetTextolitBoxSize(2) /2.0 ; + y = acel[1] ; + gMC->Gspos("PSUP", 1, "PSTR", 0.0, y, 0.0, 0, "ONLY") ; - gMC->Gsvolu("PUFP", "BOX ", idtmed[703], dpufp, 3) ; - - yO = ( fGeom->GetTextolitBoxSize(1) - fGeom->GetSecondUpperPlateThickness() ) / 2.0 ; - - gMC->Gspos("PUFP", 1, "PTXW", 0.0, yO, 0.0, 0, "ONLY") ; - - // --- - // --- Define air-filled box, place inside PTXW --- - // --- Inner AIR volume dimensions --- - - Float_t dpair[3] ; - dpair[0] = fGeom->GetAirFilledBoxSize(0) / 2.0 ; - dpair[1] = fGeom->GetAirFilledBoxSize(1) / 2.0 ; - dpair[2] = fGeom->GetAirFilledBoxSize(2) / 2.0 ; + // ========== Fill module with strips and put them into inner thermoinsulation============= + gMC->Gsvolu("PTII", "BOX ", idtmed[706], emcg->GetInnerThermoHalfSize(), 3) ; - gMC->Gsvolu("PAIR", "BOX ", idtmed[798], dpair, 3) ; - - yO = ( fGeom->GetTextolitBoxSize(1) - fGeom->GetAirFilledBoxSize(1) ) / 2.0 - fGeom->GetSecondUpperPlateThickness() ; - - gMC->Gspos("PAIR", 1, "PTXW", 0.0, yO, 0.0, 0, "ONLY") ; + Float_t * inthermo = emcg->GetInnerThermoHalfSize() ; + Float_t * strip = emcg->GetStripHalfSize() ; + y = inthermo[1] - strip[1] ; + Int_t irow; + Int_t nr = 1 ; + Int_t icol ; -// --- Dimensions of PbWO4 crystal --- + for(irow = 0; irow < emcg->GetNStripX(); irow ++){ + Float_t x = (2*irow + 1 - emcg->GetNStripX())* strip[0] ; + for(icol = 0; icol < emcg->GetNStripZ(); icol ++){ + z = (2*icol + 1 - emcg->GetNStripZ()) * strip[2] ; + gMC->Gspos("PSTR", nr, "PTII", x, y, z, 0, "ONLY") ; + nr++ ; + } + } + - Float_t xtlX = fGeom->GetCrystalSize(0) ; - Float_t xtlY = fGeom->GetCrystalSize(1) ; - Float_t xtlZ = fGeom->GetCrystalSize(2) ; + // ------- define the air gap between thermoinsulation and cooler + gMC->Gsvolu("PAGA", "BOX ", idtmed[798], emcg->GetAirGapHalfSize(), 3) ; + Float_t * agap = emcg->GetAirGapHalfSize() ; + y = agap[1] - inthermo[1] ; + + gMC->Gspos("PTII", 1, "PAGA", 0.0, y, 0.0, 0, "ONLY") ; - Float_t dptcb[3] ; - dptcb[0] = fGeom->GetNPhi() * ( xtlX + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 + fGeom->GetModuleBoxThickness() ; - dptcb[1] = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 - + fGeom->GetModuleBoxThickness() / 2.0 ; - dptcb[2] = fGeom->GetNZ() * ( xtlZ + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 + fGeom->GetModuleBoxThickness() ; - - gMC->Gsvolu("PTCB", "BOX ", idtmed[706], dptcb, 3) ; - yO = fGeom->GetAirFilledBoxSize(1) / 2.0 - dptcb[1] - - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetModuleBoxThickness() - - fGeom->GetUpperPlateThickness() - fGeom->GetSecondUpperPlateThickness() ) ; - - gMC->Gspos("PTCB", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ; - // --- - // --- Define Crystal BLock filled with air, position it inside PTCB --- - Float_t dpcbl[3] ; - - dpcbl[0] = fGeom->GetNPhi() * ( xtlX + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 ; - dpcbl[1] = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 ; - dpcbl[2] = fGeom->GetNZ() * ( xtlZ + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 ; - - gMC->Gsvolu("PCBL", "BOX ", idtmed[798], dpcbl, 3) ; - - // --- Divide PCBL in X (phi) and Z directions -- - gMC->Gsdvn("PROW", "PCBL", Int_t (fGeom->GetNPhi()), 1) ; - gMC->Gsdvn("PCEL", "PROW", Int_t (fGeom->GetNZ()), 3) ; + // ------- define the Al passive cooler + gMC->Gsvolu("PCOR", "BOX ", idtmed[701], emcg->GetCoolerHalfSize(), 3) ; + Float_t * cooler = emcg->GetCoolerHalfSize() ; + y = cooler[1] - agap[1] ; + + gMC->Gspos("PAGA", 1, "PCOR", 0.0, y, 0.0, 0, "ONLY") ; - yO = -fGeom->GetModuleBoxThickness() / 2.0 ; - - gMC->Gspos("PCBL", 1, "PTCB", 0.0, yO, 0.0, 0, "ONLY") ; + // ------- define the outer thermoinsulating cover + gMC->Gsvolu("PTIO", "TRD1", idtmed[706], emcg->GetOuterThermoParams(), 4) ; + Float_t * outparams = emcg->GetOuterThermoParams() ; - // --- - // --- Define STeel (actually, it's titanium) Cover volume, place inside PCEL - Float_t dpstc[3] ; - - dpstc[0] = ( xtlX + 2 * fGeom->GetCrystalWrapThickness() ) / 2.0 ; - dpstc[1] = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 ; - dpstc[2] = ( xtlZ + 2 * fGeom->GetCrystalWrapThickness() + 2 * fGeom->GetCrystalHolderThickness() ) / 2.0 ; - - gMC->Gsvolu("PSTC", "BOX ", idtmed[704], dpstc, 3) ; + Int_t idrotm[99] ; + AliMatrix(idrotm[1], 90.0, 0.0, 0.0, 0.0, 90.0, 270.0) ; + // Frame in outer thermoinsulation and so on: z out of beam, y along beam, x across beam + + z = outparams[3] - cooler[1] ; + gMC->Gspos("PCOR", 1, "PTIO", 0., 0.0, z, idrotm[1], "ONLY") ; + + // -------- Define the outer Aluminium cover ----- + gMC->Gsvolu("PCOL", "TRD1", idtmed[701], emcg->GetAlCoverParams(), 4) ; + Float_t * covparams = emcg->GetAlCoverParams() ; + z = covparams[3] - outparams[3] ; + gMC->Gspos("PTIO", 1, "PCOL", 0., 0.0, z, 0, "ONLY") ; - gMC->Gspos("PSTC", 1, "PCEL", 0.0, 0.0, 0.0, 0, "ONLY") ; + // --------- Define front fiberglass cover ----------- + gMC->Gsvolu("PFGC", "BOX ", idtmed[717], emcg->GetFiberGlassHalfSize(), 3) ; + z = - outparams[3] ; + gMC->Gspos("PFGC", 1, "PCOL", 0., 0.0, z, 0, "ONLY") ; - // --- - // --- Define Tyvek volume, place inside PSTC --- - Float_t dppap[3] ; + //=============This is all with cold section============== - dppap[0] = xtlX / 2.0 + fGeom->GetCrystalWrapThickness() ; - dppap[1] = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() ) / 2.0 ; - dppap[2] = xtlZ / 2.0 + fGeom->GetCrystalWrapThickness() ; - - gMC->Gsvolu("PPAP", "BOX ", idtmed[702], dppap, 3) ; - - yO = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() ) / 2.0 - - ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 ; - - gMC->Gspos("PPAP", 1, "PSTC", 0.0, yO, 0.0, 0, "ONLY") ; - // --- - // --- Define PbWO4 crystal volume, place inside PPAP --- - Float_t dpxtl[3] ; + //------ Warm Section -------------- + gMC->Gsvolu("PWAR", "BOX ", idtmed[701], emcg->GetWarmAlCoverHalfSize(), 3) ; + Float_t * warmcov = emcg->GetWarmAlCoverHalfSize() ; - dpxtl[0] = xtlX / 2.0 ; - dpxtl[1] = xtlY / 2.0 ; - dpxtl[2] = xtlZ / 2.0 ; - - gMC->Gsvolu("PXTL", "BOX ", idtmed[699], dpxtl, 3) ; + // --- Define the outer thermoinsulation --- + gMC->Gsvolu("PWTI", "BOX ", idtmed[706], emcg->GetWarmThermoHalfSize(), 3) ; + Float_t * warmthermo = emcg->GetWarmThermoHalfSize() ; + z = -warmcov[2] + warmthermo[2] ; - yO = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() ) / 2.0 - xtlY / 2.0 - fGeom->GetCrystalWrapThickness() ; - - gMC->Gspos("PXTL", 1, "PPAP", 0.0, yO, 0.0, 0, "ONLY") ; + gMC->Gspos("PWTI", 1, "PWAR", 0., 0.0, z, 0, "ONLY") ; + + // --- Define cables area and put in it T-supports ---- + gMC->Gsvolu("PCA1", "BOX ", idtmed[718], emcg->GetTCables1HalfSize(), 3) ; + Float_t * cbox = emcg->GetTCables1HalfSize() ; - // --- - // --- Define crystal support volume, place inside PPAP --- - Float_t dpsup[3] ; + gMC->Gsvolu("PBE1", "BOX ", idtmed[701], emcg->GetTSupport1HalfSize(), 3) ; + Float_t * beams = emcg->GetTSupport1HalfSize() ; + Int_t isup ; + for(isup = 0; isup < emcg->GetNTSuppots(); isup++){ + Float_t x = -cbox[0] + beams[0] + (2*beams[0]+emcg->GetTSupportDist())*isup ; + gMC->Gspos("PBE1", isup, "PCA1", x, 0.0, 0.0, 0, "ONLY") ; + } - dpsup[0] = xtlX / 2.0 + fGeom->GetCrystalWrapThickness() ; - dpsup[1] = fGeom->GetCrystalSupportHeight() / 2.0 ; - dpsup[2] = xtlZ / 2.0 + fGeom->GetCrystalWrapThickness() ; + z = -warmthermo[2] + cbox[2] ; + gMC->Gspos("PCA1", 1, "PWTI", 0.0, 0.0, z, 0, "ONLY") ; - gMC->Gsvolu("PSUP", "BOX ", idtmed[798], dpsup, 3) ; + gMC->Gsvolu("PCA2", "BOX ", idtmed[718], emcg->GetTCables2HalfSize(), 3) ; + Float_t * cbox2 = emcg->GetTCables2HalfSize() ; - yO = fGeom->GetCrystalSupportHeight() / 2.0 - ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() ) / 2.0 ; + gMC->Gsvolu("PBE2", "BOX ", idtmed[701], emcg->GetTSupport2HalfSize(), 3) ; + for(isup = 0; isup < emcg->GetNTSuppots(); isup++){ + Float_t x = -cbox[0] + beams[0] + (2*beams[0]+emcg->GetTSupportDist())*isup ; + gMC->Gspos("PBE2", isup, "PCA2", x, 0.0, 0.0, 0, "ONLY") ; + } - gMC->Gspos("PSUP", 1, "PPAP", 0.0, yO, 0.0, 0, "ONLY") ; + z = -warmthermo[2] + 2*cbox[2] + cbox2[2]; + gMC->Gspos("PCA2", 1, "PWTI", 0.0, 0.0, z, 0, "ONLY") ; - // --- - // --- Define PIN-diode volume and position it inside crystal support --- - // --- right behind PbWO4 crystal - // --- PIN-diode dimensions --- + // --- Define frame --- + gMC->Gsvolu("PFRX", "BOX ", idtmed[716], emcg->GetFrameXHalfSize(), 3) ; + Float_t * posit = emcg->GetFrameXPosition() ; + gMC->Gspos("PFRX", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ; + gMC->Gspos("PFRX", 2, "PWTI", posit[0], -posit[1], posit[2], 0, "ONLY") ; - - Float_t dppin[3] ; - dppin[0] = fGeom->GetPinDiodeSize(0) / 2.0 ; - dppin[1] = fGeom->GetPinDiodeSize(1) / 2.0 ; - dppin[2] = fGeom->GetPinDiodeSize(2) / 2.0 ; - - gMC->Gsvolu("PPIN", "BOX ", idtmed[705], dppin, 3) ; - - yO = fGeom->GetCrystalSupportHeight() / 2.0 - fGeom->GetPinDiodeSize(1) / 2.0 ; - - gMC->Gspos("PPIN", 1, "PSUP", 0.0, yO, 0.0, 0, "ONLY") ; + gMC->Gsvolu("PFRZ", "BOX ", idtmed[716], emcg->GetFrameZHalfSize(), 3) ; + posit = emcg->GetFrameZPosition() ; + gMC->Gspos("PFRZ", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ; + gMC->Gspos("PFRZ", 2, "PWTI", -posit[0], posit[1], posit[2], 0, "ONLY") ; - // --- - // --- Define Upper Cooling Panel, place it on top of PTCB --- - Float_t dpucp[3] ; - // --- Upper Cooling Plate thickness --- - - dpucp[0] = dptcb[0] ; - dpucp[1] = fGeom->GetUpperCoolingPlateThickness() ; - dpucp[2] = dptcb[2] ; - - gMC->Gsvolu("PUCP", "BOX ", idtmed[701], dpucp,3) ; - - yO = ( fGeom->GetAirFilledBoxSize(1) - fGeom->GetUpperCoolingPlateThickness() ) / 2. - - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetModuleBoxThickness() - - fGeom->GetUpperPlateThickness() - fGeom->GetSecondUpperPlateThickness() - fGeom->GetUpperCoolingPlateThickness() ) ; - - gMC->Gspos("PUCP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ; + // --- Define Fiber Glass support --- + gMC->Gsvolu("PFG1", "BOX ", idtmed[717], emcg->GetFGupXHalfSize(), 3) ; + posit = emcg->GetFGupXPosition() ; + gMC->Gspos("PFG1", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ; + gMC->Gspos("PFG1", 2, "PWTI", posit[0], -posit[1], posit[2], 0, "ONLY") ; - // --- - // --- Define Al Support Plate, position it inside PAIR --- - // --- right beneath PTCB --- - // --- Al Support Plate thickness --- - - Float_t dpasp[3] ; - dpasp[0] = fGeom->GetAirFilledBoxSize(0) / 2.0 ; - dpasp[1] = fGeom->GetSupportPlateThickness() / 2.0 ; - dpasp[2] = fGeom->GetAirFilledBoxSize(2) / 2.0 ; - - gMC->Gsvolu("PASP", "BOX ", idtmed[701], dpasp, 3) ; - - yO = ( fGeom->GetAirFilledBoxSize(1) - fGeom->GetSupportPlateThickness() ) / 2. - - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - - fGeom->GetUpperPlateThickness() - fGeom->GetSecondUpperPlateThickness() + dpcbl[1] * 2 ) ; - - gMC->Gspos("PASP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ; + gMC->Gsvolu("PFG2", "BOX ", idtmed[717], emcg->GetFGupZHalfSize(), 3) ; + posit = emcg->GetFGupZPosition() ; + gMC->Gspos("PFG2", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ; + gMC->Gspos("PFG2", 2, "PWTI", -posit[0], posit[1], posit[2], 0, "ONLY") ; - // --- - // --- Define Thermo Insulating Plate, position it inside PAIR --- - // --- right beneath PASP --- - // --- Lower Thermo Insulating Plate thickness --- - - Float_t dptip[3] ; - dptip[0] = fGeom->GetAirFilledBoxSize(0) / 2.0 ; - dptip[1] = fGeom->GetLowerThermoPlateThickness() / 2.0 ; - dptip[2] = fGeom->GetAirFilledBoxSize(2) / 2.0 ; + gMC->Gsvolu("PFG3", "BOX ", idtmed[717], emcg->GetFGlowXHalfSize(), 3) ; + posit = emcg->GetFGlowXPosition() ; + gMC->Gspos("PFG3", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ; + gMC->Gspos("PFG3", 2, "PWTI", posit[0], -posit[1], posit[2], 0, "ONLY") ; - gMC->Gsvolu("PTIP", "BOX ", idtmed[706], dptip, 3) ; + gMC->Gsvolu("PFG4", "BOX ", idtmed[717], emcg->GetFGlowZHalfSize(), 3) ; + posit = emcg->GetFGlowZPosition() ; + gMC->Gspos("PFG4", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ; + gMC->Gspos("PFG4", 2, "PWTI", -posit[0], posit[1], posit[2], 0, "ONLY") ; - yO = ( fGeom->GetAirFilledBoxSize(1) - fGeom->GetLowerThermoPlateThickness() ) / 2. - - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetUpperPlateThickness() - - fGeom->GetSecondUpperPlateThickness() + dpcbl[1] * 2 + fGeom->GetSupportPlateThickness() ) ; + // --- Define Air Gap for FEE electronics ----- - gMC->Gspos("PTIP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ; + gMC->Gsvolu("PAFE", "BOX ", idtmed[798], emcg->GetFEEAirHalfSize(), 3) ; + posit = emcg->GetFEEAirPosition() ; + gMC->Gspos("PAFE", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ; - // --- - // --- Define Textolit Plate, position it inside PAIR --- - // --- right beneath PTIP --- - // --- Lower Textolit Plate thickness --- - - Float_t dptxp[3] ; - dptxp[0] = fGeom->GetAirFilledBoxSize(0) / 2.0 ; - dptxp[1] = fGeom->GetLowerTextolitPlateThickness() / 2.0 ; - dptxp[2] = fGeom->GetAirFilledBoxSize(2) / 2.0 ; + // Define the EMC module volume and combine Cool and Warm sections - gMC->Gsvolu("PTXP", "BOX ", idtmed[707], dptxp, 3) ; + gMC->Gsvolu("PEMC", "TRD1", idtmed[798], emcg->GetEMCParams(), 4) ; - yO = ( fGeom->GetAirFilledBoxSize(1) - fGeom->GetLowerTextolitPlateThickness() ) / 2. - - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetUpperPlateThickness() - - fGeom->GetSecondUpperPlateThickness() + dpcbl[1] * 2 + fGeom->GetSupportPlateThickness() - + fGeom->GetLowerThermoPlateThickness() ) ; + z = - warmcov[2] ; + gMC->Gspos("PCOL", 1, "PEMC", 0., 0., z, 0, "ONLY") ; + z = covparams[3] ; + gMC->Gspos("PWAR", 1, "PEMC", 0., 0., z, 0, "ONLY") ; - gMC->Gspos("PTXP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ; + // Put created EMC geometry into PHOS volume + + z = geom->GetCPVBoxSize(1) / 2. ; + gMC->Gspos("PEMC", 1, "PHOS", 0., 0., z, 0, "ONLY") ; + } //____________________________________________________________________________ -void AliPHOSv0::CreateGeometryforPPSD() +void AliPHOSv0::CreateGeometryforCPV() { - // Get pointer to the array containing media indeces + // Create the PHOS-CPV geometry for GEANT + // Author: Yuri Kharlov 11 September 2000 + //BEGIN_HTML + /* +
CPV perspective view | +CPV front view | +
+ | + |
One CPV module, perspective view | +One CPV module, front view (extended in vertical direction) | +
+ | + |
+ */ + //END_HTML + + Float_t par[5], x0,y0,z0 ; + Int_t i,j,copy; + + // Get pointer to the array containing media indexes + Int_t *idtmed = fIdtmed->GetArray() - 699 ; - gMC->Gsvolu("LPPS", "BOX ", idtmed[709], lpppsd, 3) ; - - y0 = y0 - fGeom->GetPCThickness() / 2. - fGeom->GetCompositeThickness() / 2. ; + AliPHOSGeometry * geom = GetGeometry() ; - gMC->Gspos("LPPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ; + // --- Dummy box containing two rails on which PHOS support moves + // --- Put these rails to the bottom of the L3 magnet - // Position the fNumberOfModulesPhi x fNumberOfModulesZ modules (mppsd) inside PPSD to cover a PHOS module - // the top and bottom one's (which are assumed identical) : + par[0] = geom->GetRailRoadSize(0) / 2.0 ; + par[1] = geom->GetRailRoadSize(1) / 2.0 ; + par[2] = geom->GetRailRoadSize(2) / 2.0 ; + gMC->Gsvolu("PRRD", "BOX ", idtmed[798], par, 3) ; - Float_t yt = ( fGeom->GetPPSDBoxSize(1) - fGeom->GetMicromegas1Thickness() ) / 2. ; - Float_t yb = - ( fGeom->GetPPSDBoxSize(1) - fGeom->GetMicromegas2Thickness() ) / 2. ; + y0 = -(geom->GetRailsDistanceFromIP() - geom->GetRailRoadSize(1) / 2.0) ; + gMC->Gspos("PRRD", 1, "ALIC", 0.0, y0, 0.0, 0, "ONLY") ; - Int_t copyNumbertop = 0 ; - Int_t copyNumberbot = fGeom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() ; + // --- Dummy box containing one rail - Float_t x = ( fGeom->GetPPSDBoxSize(0) - fGeom->GetPPSDModuleSize(0) ) / 2. ; + par[0] = geom->GetRailOuterSize(0) / 2.0 ; + par[1] = geom->GetRailOuterSize(1) / 2.0 ; + par[2] = geom->GetRailOuterSize(2) / 2.0 ; + gMC->Gsvolu("PRAI", "BOX ", idtmed[798], par, 3) ; - for ( Int_t iphi = 1; iphi <= fGeom->GetNumberOfModulesPhi(); iphi++ ) { // the number of micromegas modules in phi per PHOS module - Float_t z = ( fGeom->GetPPSDBoxSize(2) - fGeom->GetPPSDModuleSize(2) ) / 2. ; + for (i=0; i<2; i++) { + x0 = (2*i-1) * geom->GetDistanceBetwRails() / 2.0 ; + gMC->Gspos("PRAI", i, "PRRD", x0, 0.0, 0.0, 0, "ONLY") ; + } - for ( Int_t iz = 1; iz <= fGeom->GetNumberOfModulesZ(); iz++ ) { // the number of micromegas modules in z per PHOS module - gMC->Gspos("MPPS", ++copyNumbertop, "PPSD", x, yt, z, 0, "ONLY") ; - gMC->Gspos("MPPS", ++copyNumberbot, "PPSD", x, yb, z, 0, "ONLY") ; - z = z - fGeom->GetPPSDModuleSize(2) ; - } // end of Z module loop - x = x - fGeom->GetPPSDModuleSize(0) ; - } // end of phi module loop + // --- Upper and bottom steel parts of the rail - // The Lead converter between two air gaps - // 1. Upper air gap + par[0] = geom->GetRailPart1(0) / 2.0 ; + par[1] = geom->GetRailPart1(1) / 2.0 ; + par[2] = geom->GetRailPart1(2) / 2.0 ; + gMC->Gsvolu("PRP1", "BOX ", idtmed[716], par, 3) ; - Float_t uappsd[3] ; - uappsd[0] = fGeom->GetPPSDBoxSize(0) / 2.0 ; - uappsd[1] = fGeom->GetMicro1ToLeadGap() / 2.0 ; - uappsd[2] = fGeom->GetPPSDBoxSize(2) / 2.0 ; + y0 = - (geom->GetRailOuterSize(1) - geom->GetRailPart1(1)) / 2.0 ; + gMC->Gspos("PRP1", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ; + y0 = (geom->GetRailOuterSize(1) - geom->GetRailPart1(1)) / 2.0 - geom->GetRailPart3(1); + gMC->Gspos("PRP1", 2, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ; - gMC->Gsvolu("UAPPSD", "BOX ", idtmed[798], uappsd, 3) ; + // --- The middle vertical steel parts of the rail - y0 = ( fGeom->GetPPSDBoxSize(1) - 2 * fGeom->GetMicromegas1Thickness() - fGeom->GetMicro1ToLeadGap() ) / 2. ; + par[0] = geom->GetRailPart2(0) / 2.0 ; + par[1] = geom->GetRailPart2(1) / 2.0 ; + par[2] = geom->GetRailPart2(2) / 2.0 ; + gMC->Gsvolu("PRP2", "BOX ", idtmed[716], par, 3) ; - gMC->Gspos("UAPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ; + y0 = - geom->GetRailPart3(1) / 2.0 ; + gMC->Gspos("PRP2", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ; - // 2. Lead converter - - Float_t lcppsd[3] ; - lcppsd[0] = fGeom->GetPPSDBoxSize(0) / 2.0 ; - lcppsd[1] = fGeom->GetLeadConverterThickness() / 2.0 ; - lcppsd[2] = fGeom->GetPPSDBoxSize(2) / 2.0 ; - - gMC->Gsvolu("LCPPSD", "BOX ", idtmed[712], lcppsd, 3) ; - - y0 = y0 - fGeom->GetMicro1ToLeadGap() / 2. - fGeom->GetLeadConverterThickness() / 2. ; + // --- The most upper steel parts of the rail - gMC->Gspos("LCPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ; + par[0] = geom->GetRailPart3(0) / 2.0 ; + par[1] = geom->GetRailPart3(1) / 2.0 ; + par[2] = geom->GetRailPart3(2) / 2.0 ; + gMC->Gsvolu("PRP3", "BOX ", idtmed[716], par, 3) ; - // 3. Lower air gap + y0 = (geom->GetRailOuterSize(1) - geom->GetRailPart3(1)) / 2.0 ; + gMC->Gspos("PRP3", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ; - Float_t lappsd[3] ; - lappsd[0] = fGeom->GetPPSDBoxSize(0) / 2.0 ; - lappsd[1] = fGeom->GetLeadToMicro2Gap() / 2.0 ; - lappsd[2] = fGeom->GetPPSDBoxSize(2) / 2.0 ; + // --- The wall of the cradle + // --- The wall is empty: steel thin walls and air inside - gMC->Gsvolu("LAPPSD", "BOX ", idtmed[798], lappsd, 3) ; - - y0 = y0 - fGeom->GetLeadConverterThickness() / 2. - fGeom->GetLeadToMicro2Gap() / 2. ; - - gMC->Gspos("LAPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ; - -} + par[1] = TMath::Sqrt(TMath::Power((geom->GetIPtoCPVDistance() + geom->GetOuterBoxSize(3)),2) + + TMath::Power((geom->GetOuterBoxSize(1)/2),2))+10. ; + par[0] = par[1] - geom->GetCradleWall(1) ; + par[2] = geom->GetCradleWall(2) / 2.0 ; + par[3] = geom->GetCradleWall(3) ; + par[4] = geom->GetCradleWall(4) ; + gMC->Gsvolu("PCRA", "TUBS", idtmed[716], par, 5) ; -//___________________________________________________________________________ -Int_t AliPHOSv0::Digitize(Float_t Energy){ - Float_t fB = 100000000. ; - Float_t fA = 0. ; - Int_t chan = Int_t(fA + Energy*fB ) ; - return chan ; -} -//___________________________________________________________________________ -void AliPHOSv0::FinishEvent() -{ - // cout << "//_____________________________________________________" << endl ; - // cout << " AliPHOSv0::FinishEvent() -- Starting digitalization" << endl ; - Int_t i ; - Int_t j ; - TClonesArray &lDigits = *fDigits ; - AliPHOSHit * hit ; - AliPHOSDigit * newdigit ; - AliPHOSDigit * curdigit ; - Bool_t deja = kFALSE ; - - for ( i = 0 ; i < fNTmpHits ; i++ ) { - hit = (AliPHOSHit*)fTmpHits->At(i) ; - cout << "FinishEvent hit" << hit->GetPrimary() << " " << hit->GetId() << endl ; - newdigit = new AliPHOSDigit( hit->GetPrimary(), hit->GetId(), Digitize( hit->GetEnergy() ) ) ; - for ( j = 0 ; j < fNdigits ; j++) { - curdigit = (AliPHOSDigit*) lDigits[j] ; - if ( *curdigit == *newdigit) { - *curdigit = *newdigit + *curdigit ; - deja = kTRUE ; - } - } - if ( !deja ) { - new(lDigits[fNdigits]) AliPHOSDigit(* newdigit) ; - fNdigits++ ; - } - - delete newdigit ; - } - - for ( i = 0 ; i < fNdigits ; i++ ) { - newdigit = (AliPHOSDigit*)lDigits[i] ; - Int_t * prim = newdigit->GetPrimary() ; - for ( j = 0 ; j < newdigit->GetNprimary() ; j++) - cout << "FinishEvent digit " << prim[j] << " " << newdigit->GetId() << endl ; - } + par[0] += geom->GetCradleWallThickness() ; + par[1] -= geom->GetCradleWallThickness() ; + par[2] -= geom->GetCradleWallThickness() ; + gMC->Gsvolu("PCRE", "TUBS", idtmed[798], par, 5) ; + gMC->Gspos ("PCRE", 1, "PCRA", 0.0, 0.0, 0.0, 0, "ONLY") ; - Float_t energyandnoise ; - for ( i = 0 ; i < fNdigits ; i++ ) { - newdigit = (AliPHOSDigit * ) fDigits->At(i) ; - energyandnoise = newdigit->GetAmp() + Digitize(gRandom->Gaus(0., fPINElectronicNoise)) ; - if (energyandnoise < 0 ) energyandnoise = 0 ; - newdigit->SetAmp(energyandnoise) ; - + for (i=0; i<2; i++) { + z0 = (2*i-1) * (geom->GetOuterBoxSize(2) + geom->GetCradleWall(2) )/ 2.0 ; + gMC->Gspos("PCRA", i, "ALIC", 0.0, 0.0, z0, 0, "ONLY") ; } + // --- The "wheels" of the cradle + + par[0] = geom->GetCradleWheel(0) / 2; + par[1] = geom->GetCradleWheel(1) / 2; + par[2] = geom->GetCradleWheel(2) / 2; + gMC->Gsvolu("PWHE", "BOX ", idtmed[716], par, 3) ; + + y0 = -(geom->GetRailsDistanceFromIP() - geom->GetRailRoadSize(1) - + geom->GetCradleWheel(1)/2) ; + for (i=0; i<2; i++) { + z0 = (2*i-1) * ((geom->GetOuterBoxSize(2) + geom->GetCradleWheel(2))/ 2.0 + + geom->GetCradleWall(2)); + for (j=0; j<2; j++) { + copy = 2*i + j; + x0 = (2*j-1) * geom->GetDistanceBetwRails() / 2.0 ; + gMC->Gspos("PWHE", copy, "ALIC", x0, y0, z0, 0, "ONLY") ; + } + } - // Reset the array of all the "accumulated hits" of this event. - fNTmpHits = 0 ; - fTmpHits->Delete(); } //____________________________________________________________________________ -void AliPHOSv0::Init(void) +Float_t AliPHOSv0::ZMin(void) const { - - Int_t i; + // Overall dimension of the PHOS (min) - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" PHOS_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); - - // Here the PHOS initialisation code (if any!) - - for(i=0;i<80;i++) printf("*"); - printf("\n"); - -} + AliPHOSGeometry * geom = GetGeometry() ; -//___________________________________________________________________________ -void AliPHOSv0::MakeBranch(Option_t* opt) -{ - // - // Create a new branch in the current Root Tree - // The branch of fHits is automatically split - // - AliDetector::MakeBranch(opt) ; - - char branchname[10]; - sprintf(branchname,"%s",GetName()); - char *cd = strstr(opt,"D"); - - if (fDigits && gAlice->TreeD() && cd) { - gAlice->TreeD()->Branch(branchname,&fDigits, fBufferSize); - printf("* AliPHOS::MakeBranch * Making Branch %s for digits\n",branchname); - } + return -geom->GetOuterBoxSize(2)/2.; } -//_____________________________________________________________________________ -void AliPHOSv0::Reconstruction(AliPHOSReconstructioner * Reconstructioner) -{ - // reinitializes the existing RecPoint Lists and steers the reconstruction processes - - fReconstructioner = Reconstructioner ; - - if (fEmcClusters) { - fEmcClusters->Delete() ; - delete fEmcClusters ; - fEmcClusters = 0 ; - } - fEmcClusters= new RecPointsList("AliPHOSEmcRecPoint", 100) ; - - if (fPpsdClusters) { - fPpsdClusters->Delete() ; - delete fPpsdClusters ; - fPpsdClusters = 0 ; - } - fPpsdClusters = new RecPointsList("AliPHOSPpsdRecPoint", 100) ; - - if (fTrackSegments) { - fTrackSegments->Delete() ; - delete fTrackSegments ; - fTrackSegments = 0 ; - } - fTrackSegments = new TrackSegmentsList(100) ; - - if (fRecParticles) { - fRecParticles->Delete() ; - delete fRecParticles ; - fRecParticles = 0 ; - } - fRecParticles = new RecParticlesList("AliPHOSRecParticle", 100) ; +//____________________________________________________________________________ +Float_t AliPHOSv0::ZMax(void) const +{ + // Overall dimension of the PHOS (max) - fReconstructioner->Make(fDigits, fEmcClusters, fPpsdClusters, fTrackSegments, fRecParticles); + AliPHOSGeometry * geom = GetGeometry() ; + return geom->GetOuterBoxSize(2)/2.; } //____________________________________________________________________________ -void AliPHOSv0::StepManager(void) +void AliPHOSv0::Init(void) { - Int_t relid[4] ; // (box, layer, row, column) indices - Float_t xyze[4] ; // position wrt MRS and energy deposited - TLorentzVector pos ; - Int_t copy ; - - Int_t primary = gAlice->GetPrimary( gAlice->CurrentTrack() ); - TString name = fGeom->GetName() ; - - if ( name == "GPS2" ) { // the CPV is a PPSD - if( gMC->CurrentVolID(copy) == gMC->VolId("GCEL") ) - { - gMC->TrackPosition(pos) ; - xyze[0] = pos[0] ; - xyze[1] = pos[1] ; - xyze[2] = pos[2] ; - xyze[3] = gMC->Edep() ; - - if ( xyze[3] != 0 ) { // there is deposited energy - gMC->CurrentVolOffID(5, relid[0]) ; // get the PHOS Module number - gMC->CurrentVolOffID(3, relid[1]) ; // get the Micromegas Module number - // 1-> Geom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() upper - // > fGeom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() lower - gMC->CurrentVolOffID(1, relid[2]) ; // get the row number of the cell - gMC->CurrentVolID(relid[3]) ; // get the column number - - // get the absolute Id number - - Int_t absid ; - fGeom->RelToAbsNumbering(relid, absid) ; - - // add current hit to the hit list - AddHit(primary, absid, xyze); - - } // there is deposited energy - } // We are inside the gas of the CPV - } // GPS2 configuration + // Just prints an information message - if(gMC->CurrentVolID(copy) == gMC->VolId("PXTL") ) // We are inside a PBWO crystal - { - gMC->TrackPosition(pos) ; - xyze[0] = pos[0] ; - xyze[1] = pos[1] ; - xyze[2] = pos[2] ; - xyze[3] = gMC->Edep() ; - - if ( xyze[3] != 0 ) { - gMC->CurrentVolOffID(10, relid[0]) ; // get the PHOS module number ; - relid[1] = 0 ; // means PBW04 - gMC->CurrentVolOffID(4, relid[2]) ; // get the row number inside the module - gMC->CurrentVolOffID(3, relid[3]) ; // get the cell number inside the module - - // get the absolute Id number - - Int_t absid ; - fGeom->RelToAbsNumbering(relid, absid) ; - - // add current hit to the hit list + Int_t i; - AddHit(primary, absid, xyze); + if(AliLog::GetGlobalDebugLevel()>0) { + TString st ; + for(i=0;i<35;i++) + st += "*"; + Info("Init", "%s", st.Data()) ; + // Here the PHOS initialisation code (if any!) - } // there is deposited energy - } // we are inside a PHOS Xtal -} + AliPHOSGeometry * geom = GetGeometry() ; + if (geom!=0) + Info("Init", "AliPHOS%s: PHOS geometry intialized for %s", Version().Data(), geom->GetName()) ; + else + Info("Init", "AliPHOS%s: PHOS geometry initialization failed !", Version().Data()) ; + + Info("Init", "%s", st.Data()) ; + } +}