// -*- Mode: C++ -*- //------------------------------------------------------------------------------ // Created on Feb 3 2000 by Elena Gerchtein (lena@fnal.gov) // // $Author: rico $ // $Date: 2002/01/28 00:08:29 $ // $Id: Miniplug_calorimeter.cc,v 1.6 2002/01/28 00:08:29 rico Exp $ //______________________________________________________________________________ // description of CDF miniplug calorimeter (MINIPLUG_CALORIMETER class) // ---------------------------------------------------------------------------- #include #include #include #include "geant_i/TGeant3.h" #include "inc/misc.hh" #include "Calor/Miniplug_calorimeter.hh" #include "CalorGeometry/MiniplugGeometry.hh" // currently info for CdfGeometry.hh is in Miniplug.hh //#include "Geometry/CdfGeometry.hh" #include "Geometry/TCdfGeometryManager.hh" extern "C" { // Rotation functions: float xRotP60(float x,float y) { // minus 60 degrees float xNew = x * 0.5 - y * sqrt(3.)/2.; return xNew; } float yRotP60(float x,float y) { // minus 60 degrees float yNew = y * 0.5 + x * sqrt(3.)/2.; return yNew; } float xRotM60(float x,float y) { // plus 60 degrees float xNew = x * 0.5 + y * sqrt(3.)/2.; return xNew; } float yRotM60(float x,float y) { // plus 60 degrees float yNew = y * 0.5 - x * sqrt(3.)/2.; return yNew; } } static MINIPLUG_CALORIMETER* gMiniplug; MINIPLUG_SCINT_VOLUME::MINIPLUG_SCINT_VOLUME() { } MINIPLUG_SCINT_VOLUME::~MINIPLUG_SCINT_VOLUME() { } int MINIPLUG_SCINT_VOLUME::initGeometry(int geomLevel, MINIPLUG* mother) { TCdfGeometryManager* gm = TCdfGeometryManager::Instance(); TGeant3* gnt = TGeant3::Instance(); // useful variables float coord[3] = {0.0, 0.0, 0.0}; float xCur, yCur; int cNumber; char tmpname[] = "...."; char name[] = "...."; char scin[] = "SCN."; scin[3] = mother->Number()+48; char fsla[] = "FSL."; fsla[3] = mother->Number()+48; char alu1[] = "AL1."; alu1[3] = mother->Number()+48; char fal1[] = "FA1."; fal1[3] = mother->Number()+48; char hal1[] = "HA1."; hal1[3] = mother->Number()+48; char epo1[] = "EP1."; epo1[3] = mother->Number()+48; char fep1[] = "FE1."; fep1[3] = mother->Number()+48; char hep1[] = "HE1."; hep1[3] = mother->Number()+48; char lead[] = "LEA."; lead[3] = mother->Number()+48; char fpbp[] = "FPB."; fpbp[3] = mother->Number()+48; char hpbp[] = "HPB."; hpbp[3] = mother->Number()+48; char epo2[] = "EP2."; epo2[3] = mother->Number()+48; char fep2[] = "FE2."; fep2[3] = mother->Number()+48; char hep2[] = "HE2."; hep2[3] = mother->Number()+48; char alu2[] = "AL2."; alu2[3] = mother->Number()+48; char fal2[] = "FA2."; fal2[3] = mother->Number()+48; char hal2[] = "HA2."; hal2[3] = mother->Number()+48; char scint[] = "SCT."; scint[3] = mother->Number()+48; char alu1t[] = "A1T."; alu1t[3] = mother->Number()+48; char epo1t[] = "E1T."; epo1t[3] = mother->Number()+48; char leadt[] = "LET."; leadt[3] = mother->Number()+48; char epo2t[] = "E2T."; epo2t[3] = mother->Number()+48; char alu2t[] = "A2T."; alu2t[3] = mother->Number()+48; char mama[] = "...."; char tower[] = "TOW."; tower[3] = mother->Number()+48; char tower2[] = "TRW."; tower2[3] = mother->Number()+48; char washerS[] = "WAS."; washerS[3] = mother->Number()+48; char washerB[] = "WAB."; washerB[3] = mother->Number()+48; char rodS[] = "ROS."; rodS[3] = mother->Number()+48; char rodB[] = "ROB."; rodB[3] = mother->Number()+48; GeomLevel = geomLevel; float zLastLayer = 0.0; //////////////////////////////////////////////////////////////////////// // GeomLevel = 2 - the detailed GEANT geometry; //////////////////////////////////////////////////////////////////////// if (GeomLevel==2) { float dims[3] = {L_RMIN, L_RMAX, 0.0}; // tube parameters float fdim[3] = {0.0, R_FIBER, 0.0}; float hdim[3] = {0.0, R_HOLE, 0.0}; float dimst[10] = { P_PHI1, P_DPHI, P_NPDV, P_NZ, -P_Z, P_RMIN, P_RMAX, P_Z, P_RMIN, P_RMAX }; // polygon parameters // First position the SCINT* containment volume strcpy(mama,"SCI."); mama[3] = mother->Number()+48; G3_TUBE::init(mama, TGeant3::kTube, gm->TmedAir(), SCINT_CONT_DIMENSIONS, MINIPLUG_DETECTOR_TYPE, mother->volume(), SCINT_CONT_POSITION, SCINT_CONT_ROTATION, "MANY", MINIPLUG_DETECTOR_SET ); // Position scintillator (25" - 25" 1/4) in SCINT* containment volume strcpy(name,"STT."); name[3] = mother->Number()+48; MiniplugScintTube.init ( name, TGeant3::kTube, gm->TmedScintillatorNoBfield(), SCINT_SUB_DIMENSIONS, MINIPLUG_DETECTOR_TYPE ); coord[0] = 0.0; coord[1] = 0.0; coord[2] = 0.0; gnt->Gspos( name, 1, mama, coord[0], coord[1], coord[2], 0, "MANY"); // Create 1/3 "tower" volume; 1 tower = 3 poligons; dimst[4] = -SCINT_CONT_DIMENSIONS[2]; dimst[7] = SCINT_CONT_DIMENSIONS[2]; MiniplugTower.init ( tower, TGeant3::kPgon, gm->TmedScintillatorNoBfield(), dimst, MINIPLUG_DETECTOR_TYPE ); MiniplugTowerR.init ( tower2, TGeant3::kPgon, gm->TmedScintillatorNoBfield(), dimst, MINIPLUG_DETECTOR_TYPE ); // init washers and rods MiniplugRodSmall.init ( rodS, TGeant3::kTube, gMiniplug->TmedMiniplugSteel(), ST_RODS_DIMS, 0 ); MiniplugRodBig.init ( rodB, TGeant3::kTube, gMiniplug->TmedMiniplugSteel(), ST_RODB_DIMS, 0 ); MiniplugWasherSmall.init (washerS, TGeant3::kTube, gMiniplug->TmedMiniplugAl(), AL_WASHERS_DIMS, 0 ); MiniplugWasherBig.init ( washerB, TGeant3::kTube, gMiniplug->TmedMiniplugAl(), AL_WASHERB_DIMS, 0 ); // Position big rod into tower gnt->Gspos( rodB, 1 , tower2, 0, 0, 0, 0, "ONLY"); /////////////////////////////////////////// Init layers volumes //scint + alum1 + epoxy1 + lead + epoxy2 + alum2 dims[2] = SCIN_ZMAX; dimst[4] = -SCIN_ZMAX; dimst[7] = SCIN_ZMAX; fdim[2] = SCIN_ZMAX; MiniplugScintLayer.init( scin, TGeant3::kTube, gMiniplug->TmedMiniplugScint(), dims, MINIPLUG_DETECTOR_TYPE ); MiniplugScintLayerT.init(scint, TGeant3::kPgon, gMiniplug->TmedMiniplugScint(), dimst, MINIPLUG_DETECTOR_TYPE ); dims[2] = ALUM1_ZMAX; dimst[4] = -ALUM1_ZMAX; dimst[7] = ALUM1_ZMAX; fdim[2] = ALUM1_ZMAX; hdim[2] = ALUM1_ZMAX; MiniplugAlum1.init( alu1, TGeant3::kTube, gMiniplug->TmedMiniplugAl(), dims, 0 ); MiniplugAlum1T.init( alu1t, TGeant3::kPgon, gMiniplug->TmedMiniplugAl(), dimst, 0 ); MiniplugFAl1.init ( fal1, TGeant3::kTube, gMiniplug->TmedMiniplugScint(), fdim, 0 ); MiniplugHAl1.init ( hal1, TGeant3::kTube, gMiniplug->TmedMiniplugScint(), hdim, MINIPLUG_DETECTOR_TYPE ); // Put fiber into hole coord[1] = - R_HOLE + R_FIBER; gnt->Gspos( fal1, 1 , hal1, coord[0], coord[1], coord[2], 0, "ONLY"); // Position hole with fiber in hexagon coord[2] = 0.0; for (int i=0; i<6; i++){ coord[0] = (MINIPLUG_FIBER_C[i][0]) * 0.75 * i2mm; coord[1] = (MINIPLUG_FIBER_C[i][1]) * 0.75 * i2mm * sqrt(3.)/2.; gnt->Gspos( hal1, i+1 , alu1t, coord[0], coord[1], coord[2], 0, "ONLY"); } dims[2] = EPOX1_ZMAX; dimst[4] = -EPOX1_ZMAX; dimst[7] = EPOX1_ZMAX; fdim[2] = EPOX1_ZMAX; hdim[2] = EPOX1_ZMAX; MiniplugEpoxy1.init( epo1, TGeant3::kTube, gMiniplug->TmedMiniplugEpoxy(), dims, 0 ); MiniplugEpoxy1T.init( epo1t, TGeant3::kPgon, gMiniplug->TmedMiniplugEpoxy(), dimst, 0 ); MiniplugFEp1.init ( fep1, TGeant3::kTube, gMiniplug->TmedMiniplugScint(), fdim, 0 ); MiniplugHEp1.init ( hep1, TGeant3::kTube, gMiniplug->TmedMiniplugScint(), hdim, MINIPLUG_DETECTOR_TYPE ); // Put fiber into hole coord[1] = - R_HOLE + R_FIBER; gnt->Gspos( fep1, 1 , hep1, coord[0], coord[1], coord[2], 0, "ONLY"); // Position hole with fiber in hexagon for (int i=0; i<6; i++){ coord[0] = (MINIPLUG_FIBER_C[i][0]) * 0.75 * i2mm; coord[1] = (MINIPLUG_FIBER_C[i][1]) * 0.75 * i2mm * sqrt(3.)/2.; gnt->Gspos( hep1, i+1 , epo1t, coord[0], coord[1], coord[2], 0, "ONLY"); } dims[2] = LEAD_ZMAX; dimst[4] = -LEAD_ZMAX; dimst[7] = LEAD_ZMAX; fdim[2] = LEAD_ZMAX; hdim[2] = LEAD_ZMAX; MiniplugPbPlate.init( lead, TGeant3::kTube, gMiniplug->TmedMiniplugLead(), dims, 0 ); MiniplugPbPlateT.init( leadt, TGeant3::kPgon, gMiniplug->TmedMiniplugLead(), dimst, 0 ); MiniplugFPbP.init ( fpbp, TGeant3::kTube, gMiniplug->TmedMiniplugScint(), fdim, 0 ); MiniplugHPbP.init ( hpbp, TGeant3::kTube, gMiniplug->TmedMiniplugScint(), hdim, MINIPLUG_DETECTOR_TYPE ); // Put fiber into hole coord[1] = - R_HOLE + R_FIBER; gnt->Gspos( fpbp, 1 , hpbp, coord[0], coord[1], coord[2], 0, "ONLY"); // Position hole with fiber in hexagon for (int i=0; i<6; i++){ coord[0] = (MINIPLUG_FIBER_C[i][0]) * 0.75 * i2mm; coord[1] = (MINIPLUG_FIBER_C[i][1]) * 0.75 * i2mm * sqrt(3.)/2.; gnt->Gspos( hpbp, i+1 , leadt, coord[0], coord[1], coord[2], 0, "ONLY"); } dims[2] = EPOX2_ZMAX; dimst[4] = -EPOX2_ZMAX; dimst[7] = EPOX2_ZMAX; fdim[2] = EPOX2_ZMAX; hdim[2] = EPOX2_ZMAX; MiniplugEpoxy2.init( epo2 , TGeant3::kTube, gMiniplug->TmedMiniplugEpoxy(), dims, 0 ); MiniplugEpoxy2T.init( epo2t, TGeant3::kPgon, gMiniplug->TmedMiniplugEpoxy(), dimst, 0 ); MiniplugFEp2.init ( fep2, TGeant3::kTube, gMiniplug->TmedMiniplugScint(), fdim, 0 ); MiniplugHEp2.init ( hep2, TGeant3::kTube, gMiniplug->TmedMiniplugScint(), hdim, MINIPLUG_DETECTOR_TYPE ); // Put fiber into hole coord[1] = - R_HOLE + R_FIBER; gnt->Gspos( fep2, 1 , hep2, coord[0], coord[1], coord[2], 0, "ONLY"); // Position hole with fiber in hexagon for (int i=0; i<6; i++){ coord[0] = (MINIPLUG_FIBER_C[i][0]) * 0.75 * i2mm; coord[1] = (MINIPLUG_FIBER_C[i][1]) * 0.75 * i2mm * sqrt(3.)/2.; gnt->Gspos( hep2, i+1 , epo2t, coord[0], coord[1], coord[2], 0, "ONLY"); } dims[2] = ALUM2_ZMAX; dimst[4] = -ALUM2_ZMAX; dimst[7] = ALUM2_ZMAX; fdim[2] = ALUM2_ZMAX; hdim[2] = ALUM2_ZMAX; MiniplugAlum2.init( alu2, TGeant3::kTube, gMiniplug->TmedMiniplugAl(), dims, 0 ); MiniplugAlum2T.init( alu2t, TGeant3::kPgon, gMiniplug->TmedMiniplugAl(), dimst, 0 ); MiniplugFAl2.init ( fal2, TGeant3::kTube, gMiniplug->TmedMiniplugScint(), fdim, 0 ); MiniplugHAl2.init ( hal2, TGeant3::kTube, gMiniplug->TmedMiniplugScint(), hdim, MINIPLUG_DETECTOR_TYPE ); // Put fiber into hole coord[1] = - R_HOLE + R_FIBER; gnt->Gspos( fal2, 1 , hal2, coord[0], coord[1], coord[2], 0, "ONLY"); // Position hole with fiber in hexagon for (int i=0; i<6; i++){ coord[0] = (MINIPLUG_FIBER_C[i][0]) * 0.75 * i2mm; coord[1] = (MINIPLUG_FIBER_C[i][1]) * 0.75 * i2mm * sqrt(3.)/2.; gnt->Gspos( hal2, i+1 , alu2t, coord[0], coord[1], coord[2], 0, "ONLY"); } /////////////////////////////////////////////////// Iterate over "layers" : //scint + alum1 + epoxy1 + lead + epoxy2 + alum2 for (int i = 0; i < 34; i++) { // Scintillator coord[2] = SCINT_ZPOS + i * L_STEP; gnt->Gspos( scin, i, mama, 0.0, 0.0 , coord[2], 0, "MANY"); gnt->Gspos(scint, i, tower, 0.0, 0.0, coord[2], 0, "MANY"); // Washers out of towers coord[0]= 0.0; coord[1]= 12. * i2mm; gnt->Gspos( washerB, 1+i*6, mama, coord[0], coord[1], coord[2], 0, "ONLY"); gnt->Gspos( washerB, 2+i*6, mama, -coord[0], -coord[1], coord[2], 0, "ONLY"); xCur = xRotM60(coord[0],coord[1]); yCur = yRotM60(coord[0],coord[1]); gnt->Gspos( washerB, 3+i*6, mama, xCur, yCur, coord[2], 0, "ONLY"); gnt->Gspos( washerB, 4+i*6, mama, -xCur, -yCur, coord[2], 0, "ONLY"); coord[0] = xRotM60(xCur,yCur); coord[1] = yRotM60(xCur,yCur); gnt->Gspos( washerB, 5+i*6, mama, coord[0], coord[1], coord[2], 0, "ONLY"); gnt->Gspos( washerB, 6+i*6, mama, -coord[0], -coord[1], coord[2], 0, "ONLY"); coord[1]= 3. * i2mm; coord[0]= 0.0; gnt->Gspos( washerS, 1+i*9, mama, coord[0], coord[1], coord[2], 0, "ONLY"); gnt->Gspos( washerS, 2+i*9, mama, -coord[0], -coord[1], coord[2], 0, "ONLY"); gnt->Gspos( washerS, 3+i*9, tower2,0.,0., coord[2], 0, "ONLY"); xCur = xRotM60(coord[0],coord[1]); yCur = yRotM60(coord[0],coord[1]); gnt->Gspos( washerS, 4+i*9, mama, xCur, yCur, coord[2], 0, "ONLY"); gnt->Gspos( washerS, 5+i*9, mama, -xCur, -yCur, coord[2], 0, "ONLY"); gnt->Gspos( washerS, 6+i*9, tower2,0.,0., coord[2], 0, "ONLY"); coord[0] = xRotM60(xCur,yCur); coord[1] = yRotM60(xCur,yCur); gnt->Gspos( washerS, 7+i*9, mama, coord[0], coord[1], coord[2], 0, "ONLY"); gnt->Gspos( washerS, 8+i*9, mama, -coord[0], -coord[1], coord[2], 0, "ONLY"); gnt->Gspos( washerS, 9+i*9, tower2,0.,0., coord[2], 0, "ONLY"); // Aluminum 1 coord[2] = ALUM1_ZPOS + i * L_STEP; gnt->Gspos( alu1, i, mama, 0.0, 0.0, coord[2], 0, "MANY"); gnt->Gspos( alu1t, i, tower, 0.0, 0.0, coord[2], 0, "MANY"); gnt->Gspos( alu1t, i, tower2, 0.0, 0.0, coord[2], 0, "MANY"); // Epoxy 1 coord[2] = EPOX1_ZPOS + i * L_STEP; gnt->Gspos( epo1, i, mama, 0.0, 0.0, coord[2], 0, "MANY"); gnt->Gspos( epo1t, i, tower, 0.0, 0.0, coord[2], 0, "MANY"); gnt->Gspos( epo1t, i, tower2, 0.0, 0.0, coord[2], 0, "MANY"); // Lead coord[2] = LEAD_ZPOS + i * L_STEP; gnt->Gspos( lead, i, mama, 0.0, 0.0, coord[2], 0, "MANY"); gnt->Gspos( leadt, i, tower, 0.0, 0.0, coord[2], 0, "MANY"); gnt->Gspos( leadt, i, tower2, 0.0, 0.0, coord[2], 0, "MANY"); // Epoxy 2 coord[2] = EPOX2_ZPOS + i * L_STEP; gnt->Gspos( epo2, i, mama, 0.0, 0.0, coord[2], 0, "MANY"); gnt->Gspos( epo2t, i, tower, 0.0, 0.0, coord[2], 0, "MANY"); gnt->Gspos( epo2t, i, tower2, 0.0, 0.0, coord[2], 0, "MANY"); // Aluminum 2 coord[2] = ALUM2_ZPOS + i * L_STEP; gnt->Gspos( alu2, i, mama, 0.0, 0.0, coord[2], 0, "MANY"); gnt->Gspos( alu2t, i, tower, 0.0, 0.0, coord[2], 0, "MANY"); gnt->Gspos( alu2t, i, tower2, 0.0, 0.0, coord[2], 0, "MANY"); // z cordinate of the beginning of the rest of scintillator zLastLayer =+ L_STEP; } // 35?th "layer" (the rest of scint) coord[0] = 0.0; coord[1] = 0.0; dims[1] = SCINT_CONT_RMAX; dims[2] = (SCINT_CONT_ZMAX - zLastLayer)/2.; coord[2] = zLastLayer + dims[2]; strcpy(name,"SCL."); name[3] = mother->Number() + 48; MiniplugScintEnd.init( name, TGeant3::kTube, gm->TmedScintillatorNoBfield(), dims, MINIPLUG_DETECTOR_TYPE ); gnt->Gspos( name, 1, mama, coord[0], coord[1], coord[2], 0, "MANY"); strcpy(name,"SLT."); name[3] = mother->Number() + 48; dimst[4] = -(SCINT_CONT_ZMAX - zLastLayer)/2.; dimst[7] = (SCINT_CONT_ZMAX - zLastLayer)/2.; fdim[2] = (SCINT_CONT_ZMAX - zLastLayer)/2.; MiniplugScintEndT.init ( name, TGeant3::kPgon, gm->TmedScintillatorNoBfield(), dimst, MINIPLUG_DETECTOR_TYPE ); MiniplugFSLa.init ( fsla, TGeant3::kTube, gMiniplug->TmedMiniplugScint(), fdim, 0 ); // Position hole with fiber in hexagon for (int i=0; i<6; i++){ coord[0] = (MINIPLUG_FIBER_C[i][0]) * 0.75 * i2mm; coord[1] = (MINIPLUG_FIBER_C[i][1]) * 0.75 * i2mm * sqrt(3.)/2.; gnt->Gspos( name, i+1 , fsla, coord[0], coord[1], coord[2], 0, "ONLY"); } // put the rest of scintillator gnt->Gspos( name, 1, tower, coord[0], coord[1], coord[2], 0, "MANY"); gnt->Gspos( name, 1, tower2, coord[0], coord[1], coord[2], 0, "MANY"); // Position rods sets 1 and 3 coord[0]= 0.0; coord[1]= 12. * i2mm; coord[2]= 0.0; gnt->Gspos( rodB, 1, mama, coord[0], coord[1], coord[2], 0, "ONLY"); gnt->Gspos( rodB, 2, mama, -coord[0], -coord[1], coord[2], 0, "ONLY"); xCur = xRotM60(coord[0],coord[1]); yCur = yRotM60(coord[0],coord[1]); gnt->Gspos( rodB, 3, mama, xCur, yCur, coord[2], 0, "ONLY"); gnt->Gspos( rodB, 4, mama, -xCur, -yCur, coord[2], 0, "ONLY"); coord[0] = xRotM60(xCur,yCur); coord[1] = yRotM60(xCur,yCur); gnt->Gspos( rodB, 5, mama, coord[0], coord[1], coord[2], 0, "ONLY"); gnt->Gspos( rodB, 6, mama, -coord[0], -coord[1], coord[2], 0, "ONLY"); coord[1]= 3. * i2mm; coord[0]= 0.0; gnt->Gspos( rodS, 1, mama, coord[0], coord[1], coord[2], 0, "ONLY"); gnt->Gspos( rodS, 2, mama, -coord[0], -coord[1], coord[2], 0, "ONLY"); xCur = xRotM60(coord[0],coord[1]); yCur = yRotM60(coord[0],coord[1]); gnt->Gspos( rodS, 3, mama, xCur, yCur, coord[2], 0, "ONLY"); gnt->Gspos( rodS, 4, mama, -xCur, -yCur, coord[2], 0, "ONLY"); coord[0] = xRotM60(xCur,yCur); coord[1] = yRotM60(xCur,yCur); gnt->Gspos( rodS, 5, mama, coord[0], coord[1], coord[2], 0, "ONLY"); gnt->Gspos( rodS, 6, mama, -coord[0], -coord[1], coord[2], 0, "ONLY"); // Position polygon 14(sector)*3*6 times. // N tower = sector * 100 + copyNumber; cNumber = 1; coord[2] = 0.0; for (int i=0; i<14 ; i++ ) { coord[0] = MINIPLUG_TOWER_C[i][0] * 0.75 * 0.5 * i2mm; coord[0] = coord[0] - 0.75 * 0.5 * i2mm; coord[1] = MINIPLUG_TOWER_C[i][1] * 0.75 * sqrt(3.) * 0.5 * i2mm; coord[1] = coord[1] + 0.75 * sqrt(3.)/2. * i2mm; gnt->Gspos( tower,cNumber+100, mama, coord[0], coord[1], coord[2], 0, "ONLY"); gnt->Gspos( tower,cNumber+400, mama,-coord[0],-coord[1], coord[2], 0, "ONLY"); xCur = xRotM60(coord[0],coord[1]); yCur = yRotM60(coord[0],coord[1]); gnt->Gspos( tower,cNumber+200, mama, xCur, yCur, coord[2], 0, "ONLY"); gnt->Gspos( tower,cNumber+500, mama,-xCur,-yCur, coord[2], 0, "ONLY"); xCur = xRotP60(coord[0],coord[1]); yCur = yRotP60(coord[0],coord[1]); gnt->Gspos( tower,cNumber+600, mama, xCur, yCur, coord[2], 0, "ONLY"); gnt->Gspos( tower,cNumber+300, mama,-xCur,-yCur, coord[2], 0, "ONLY"); cNumber++; coord[1] = (MINIPLUG_TOWER_C[i][1]-1.) * 0.75 * sqrt(3.) * 0.5 * i2mm; gnt->Gspos( tower,cNumber+100, mama, coord[0], coord[1], coord[2], 0,"ONLY"); gnt->Gspos( tower,cNumber+400, mama,-coord[0],-coord[1], coord[2], 0, "ONLY"); xCur = xRotM60(coord[0],coord[1]); yCur = yRotM60(coord[0],coord[1]); gnt->Gspos( tower,cNumber+200, mama,xCur,yCur , coord[2], 0, "ONLY"); gnt->Gspos( tower,cNumber+500, mama,-xCur,-yCur, coord[2], 0, "ONLY"); xCur = xRotP60(coord[0],coord[1]); yCur = yRotP60(coord[0],coord[1]); gnt->Gspos( tower,cNumber+600, mama, xCur, yCur, coord[2], 0, "ONLY"); gnt->Gspos( tower,cNumber+300, mama,-xCur,-yCur, coord[2], 0, "ONLY"); cNumber++; coord[0] = MINIPLUG_TOWER_C[i][0] * 0.75 * 0.5 * i2mm; coord[0] = coord[0] + 0.75 * i2mm; coord[1] = MINIPLUG_TOWER_C[i][1] * 0.75 * sqrt(3.) * 0.5 * i2mm; if ( cNumber==27 ) { strcpy(tmpname,tower); strcpy(tower,tower2); } gnt->Gspos( tower,cNumber+100, mama, coord[0], coord[1], coord[2], 0, "ONLY"); gnt->Gspos( tower,cNumber+400, mama,-coord[0],-coord[1], coord[2], 0, "ONLY"); xCur = xRotM60(coord[0],coord[1]); yCur = yRotM60(coord[0],coord[1]); gnt->Gspos( tower,cNumber+200, mama, xCur, yCur, coord[2], 0, "ONLY"); gnt->Gspos( tower,cNumber+500, mama,-xCur,-yCur, coord[2], 0, "ONLY"); xCur = xRotP60(coord[0],coord[1]); yCur = yRotP60(coord[0],coord[1]); gnt->Gspos( tower,cNumber+600, mama, xCur, yCur, coord[2], 0, "ONLY"); gnt->Gspos( tower,cNumber+300, mama,-xCur,-yCur, coord[2], 0, "ONLY"); if ( cNumber==27 ) { strcpy(tower,tmpname); } cNumber++; } } //////////////////////////////////////////////////////////////////////// // GeomLevel = 0 - non-detailed GEANT geometry; //////////////////////////////////////////////////////////////////////// if (GeomLevel==0 || GeomLevel==1) { // Averaged volume strcpy(mama,"SCI."); mama[3] = mother->Number()+48; G3_TUBE::init(mama, TGeant3::kTube, gMiniplug->TmedMiniplug(), SCINT_CONT_DIMENSIONS, MINIPLUG_DETECTOR_TYPE, mother->volume(), SCINT_CONT_POSITION, SCINT_CONT_ROTATION, "MANY", MINIPLUG_DETECTOR_SET ); } return 1; } MINIPLUG::MINIPLUG() { } MINIPLUG::~MINIPLUG() { } //------------------------------------------------------------------------------ // define 2 miniplugs as separate objects (not just as GEANT copies) to use this // description in the reconstruction - we definitely need 2 separate objects // until we describe the single calorimeter object, consisting of both miniplugs. //------------------------------------------------------------------------------ int MINIPLUG::initGeometry( int geomLevel ) { char name[] = "MPL."; char tmp[] = "...."; tmp[3] = fNumber + 48; name[3] = fNumber + 48; float coord[3] = {0.0, 0.0, 0.0}; TCdfGeometryManager* gm = TCdfGeometryManager::Instance(); // initialize miniplug containment volume G3_TUBE::init(name, TGeant3::kTube, gm->TmedAir(), MINIPLUG_DIMENSIONS, fNumber+1, gCdfDetector.volume(), MINIPLUG_POSITION[fNumber], MINIPLUG_ROTATION[fNumber], "ONLY", MINIPLUG_DETECTOR_SET); // Put the Miniplug subvolumes inside //------------------------------------------------------------------------------ // aluminum endplate and frontplate: tube //------------------------------------------------------------------------------ tmp[0] = 65; // A tmp[1] = 76; // L tmp[2] = 70; // F tmp[3] = fNumber + 48; // number MiniplugAlumFront.init( tmp, TGeant3::kTube, gm->TmedAluminumNoBfield(), AL_FRONT_DIMS, fNumber+1, this->volume(), AL_FRONT_POSITION, 0, "MANY", 0); tmp[0] = 65; // A tmp[1] = 76; // L tmp[2] = 69; // E tmp[3] = fNumber + 48; // number MiniplugAlumEnd.init( tmp, TGeant3::kTube, gm->TmedAluminumNoBfield(), AL_END_DIMS, fNumber+1, this->volume(), AL_END_POSITION, 0, "MANY", 0); //------------------------------------------------------------------------------ // inner aluminum tube: tube //------------------------------------------------------------------------------ tmp[0] = 65; // A tmp[1] = 76; // L tmp[2] = 73; // I tmp[3] = fNumber + 48; // number MiniplugAlumInnerTube.init( tmp, TGeant3::kTube, gm->TmedAluminumNoBfield(), AL_TUBE_DIMS, fNumber+1, this->volume(), AL_TUBE_POSITION, 0, "ONLY", 0); //------------------------------------------------------------------------------ // outer steel tube: tube //------------------------------------------------------------------------------ tmp[0] = 83; // S tmp[1] = 84; // T tmp[2] = 79; // O tmp[3] = fNumber + 48; // number MiniplugBigSteelTube.init( tmp, TGeant3::kTube, gm->TmedAluminumNoBfield(), ST_TUBE_DIMS, fNumber+1, this->volume(), ST_TUBE_POSITION, 0, "ONLY", 0); //------------------------------------------------------------------------------ // scintillator with layers of plates //------------------------------------------------------------------------------ MiniplugScintVolume.initGeometry(geomLevel,this); // all done return 1; } //------------------------------------------------------------------------------ // ********** class MINIPLUG_CALORIMETER ********** //------------------------------------------------------------------------------ MINIPLUG_CALORIMETER::MINIPLUG_CALORIMETER() : POBJECT ("MPLU",_POBJECT_TYPE_DETECTOR_,1) { Used = 1; } //------------------------------------------------------------------------------ // global initialization routine //------------------------------------------------------------------------------ int MINIPLUG_CALORIMETER::init(int geomLevel) { // initialize geometry initGeometry(geomLevel); // initialize more if needed... // all done return 1; } //------------------------------------------------------------------------------ // level = 0 : use include files to initialize geometry // level = 1 : read information from the database (not implemented yet) //------------------------------------------------------------------------------ int MINIPLUG_CALORIMETER::initGeometry(int geomLevel) { // create materials and tmed's anyway // may want to move it later on float par[10]; float precision; int np = 0; int call_geant = G3_VOLUME::CallGeant; if (! Used) { G3_VOLUME::CallGeant = 0; } TCdfGeometryManager* gm = TCdfGeometryManager::Instance(); gMiniplug = this; //------------------------------------------------------------------------------ // create materials used by detailed Miniplug geom. //------------------------------------------------------------------------------ // Stainless Steel - Standard 18-8, 304LN. Elemental fractions by weight: Fe(71%), // Cr(19%), Ni(10%) float mplug_steel_a[3] = { 52.00, 58.69, 55.85 }; float mplug_steel_z[3] = { 24.0 , 28.0 , 26.0 }; float mplug_steel_w[3] = { 0.19, 0.10, 0.71 }; fMaterialMiniplugSteel = gm->AddMaterial("Miniplug Stainless", mplug_steel_a, mplug_steel_z, 8.044, 3, mplug_steel_w); // scintillator // BC-517l (http://www.bicron.com/bc517L.htm) float mplug_scint_a[2] = { 12.01, 1.01 }; float mplug_scint_z[2] = { 6.0 , 1.0 }; float mplug_scint_w[2] = { 0.7339 , 0.1245 }; fMaterialMiniplugScint = gm->AddMaterial("Miniplug Scintillator", mplug_scint_a, mplug_scint_z, 1.032, -2, mplug_scint_w); // Epoxy = Aluminum ( until I know how thick is epoxy layer ) // QUESTION: how thick is epoxy? float mplug_epoxy_a[2] = { 12.01, 1.01 }; float mplug_epoxy_z[2] = { 6.0 , 1.0 }; float mplug_epoxy_w[2] = { 0.7339 , 0.1245}; fMaterialMiniplugEpoxy = gm->AddMaterial("Miniplug Epoxy", mplug_epoxy_a, mplug_epoxy_z, 1.032, -2, mplug_epoxy_w); // WLS fiber = scintillator ( untill I know more ) float mplug_fiber_a[2] = { 12.01, 1.01 }; float mplug_fiber_z[2] = { 6.0 , 1.0 }; float mplug_fiber_w[2] = { 0.7339 , 0.1245 }; fMaterialMiniplugFiber = gm->AddMaterial("Miniplug Fiber", mplug_fiber_a, mplug_fiber_z, 1.032, -2, mplug_fiber_w); // mixture of materials float amplmix[5] = { 11.154, 11.154, 55.85 , 14.6 , 207.20 }; float zmplmix[5] = { 5.615 , 5.615 , 26.0 , 7.3 , 82.00 }; float wmplmix[5] = { 6.19244E-02, 5.15521E-02, .1203086, 3.48025E-05, .76618}; float dmpl = 4.4; // Density fMaterialMiniplug = gm->AddMaterial("MPLG_Mix",amplmix,zmplmix,dmpl,5,wmplmix); //------------------------------------------------------------------------------ // miniplug tracking media //------------------------------------------------------------------------------ precision = (BOUNDARY_PRECISION < 10.) ? BOUNDARY_PRECISION : 10.; gm->AddTrackingMedium(fTmedMiniplugAir, "Miniplug air", TGeant3::kAir, TGeant3::kSensitiveVolume, TGeant3::kNoMagneticField, CDF_MAG_FIELD, TGeant3::kAuto, TGeant3::kAuto, TGeant3::kAuto, precision, TGeant3::kAuto,par,np); precision = (BOUNDARY_PRECISION < 10.) ? BOUNDARY_PRECISION : 10.; gm->AddTrackingMedium(fTmedMiniplugLead, "Miniplug lead", TGeant3::kLead, TGeant3::kSensitiveVolume, TGeant3::kNoMagneticField, CDF_MAG_FIELD, TGeant3::kAuto, TGeant3::kAuto, TGeant3::kAuto, precision, TGeant3::kAuto,par,np); precision = (BOUNDARY_PRECISION < 10.) ? BOUNDARY_PRECISION : 10.; gm->AddTrackingMedium(fTmedMiniplugScint, "Miniplug scintillator", fMaterialMiniplugScint, TGeant3::kSensitiveVolume, TGeant3::kNoMagneticField, CDF_MAG_FIELD, TGeant3::kAuto, TGeant3::kAuto, TGeant3::kAuto, precision, TGeant3::kAuto,par,np); precision = (BOUNDARY_PRECISION < 10.) ? BOUNDARY_PRECISION : 10.; gm->AddTrackingMedium(fTmedMiniplugEpoxy, "Miniplug Epoxy", fMaterialMiniplugEpoxy, TGeant3::kSensitiveVolume, TGeant3::kNoMagneticField, CDF_MAG_FIELD, TGeant3::kAuto, TGeant3::kAuto, TGeant3::kAuto, precision, TGeant3::kAuto,par,np); precision = (BOUNDARY_PRECISION < 10.) ? BOUNDARY_PRECISION : 10.; gm->AddTrackingMedium(fTmedMiniplugSteel, "Miniplug steel", fMaterialMiniplugSteel, TGeant3::kSensitiveVolume, TGeant3::kNoMagneticField, CDF_MAG_FIELD, TGeant3::kAuto, TGeant3::kAuto, TGeant3::kAuto, precision, TGeant3::kAuto,par,np); precision = (BOUNDARY_PRECISION < 10.) ? BOUNDARY_PRECISION : 10.; gm->AddTrackingMedium(fTmedMiniplugFiber, "Miniplug fiber", fMaterialMiniplugFiber, TGeant3::kSensitiveVolume, TGeant3::kNoMagneticField, CDF_MAG_FIELD, TGeant3::kAuto, TGeant3::kAuto, TGeant3::kAuto, precision, TGeant3::kAuto,par,np); precision = (BOUNDARY_PRECISION < 10.) ? BOUNDARY_PRECISION : 10.; gm->AddTrackingMedium(fTmedMiniplugAl, "Miniplug Aluminium", TGeant3::kAluminum, TGeant3::kSensitiveVolume, TGeant3::kNoMagneticField, CDF_MAG_FIELD, TGeant3::kAuto, TGeant3::kAuto, TGeant3::kAuto, precision, TGeant3::kAuto,par,np); // Miniplug average precision = (BOUNDARY_PRECISION < 10.) ? BOUNDARY_PRECISION : 10.; gm->AddTrackingMedium(fTmedMiniplug, "Miniplug average medium", fMaterialMiniplug, TGeant3::kSensitiveVolume, TGeant3::kNoMagneticField, CDF_MAG_FIELD, TGeant3::kAuto, TGeant3::kAuto, TGeant3::kAuto, precision, TGeant3::kAuto,par,np); //------------------------------------------------------------------------------ for (int i=0; i<2; i++) { Module[i].SetNumber(i); if ( this->Used ) Module[i].initGeometry(geomLevel); } // all done // restore CallGeant flag on exit G3_VOLUME::CallGeant = call_geant; // 0 means successfull return return 0; }