+ /// For boolean sustraction
+ double preShape6 = 0.2;
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = -preShape6; v0APts[1+8*i] = -fV0AR0+fV0AFraWd/2.-preShape6;
+ v0APts[2+8*i] = 0.0; v0APts[3+8*i] = -fV0AR0+fV0AFraWd/2.-preShape6;
+ v0APts[4+8*i] = 0.0; v0APts[5+8*i] = -fV0AR4-fV0AFraWd/2.+preShape6;
+ v0APts[6+8*i] = -preShape6; v0APts[7+8*i] = -fV0AR4-fV0AFraWd/2.+preShape6;
+ }
+ new TGeoArb8("sV0ACha16",fV0ASciWd/1.5,v0APts);
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = -fV0AR0*cos45+preShape6;
+ v0APts[1+8*i] = -(fV0AR0-fV0AFraWd)*sin45+preShape6;
+ v0APts[2+8*i] = -(fV0AR0-fV0AFraWd/2.)*cos45+preShape6;
+ v0APts[3+8*i] = -(fV0AR0-fV0AFraWd/2.)*sin45;
+ v0APts[4+8*i] = -(fV0AR4+fV0AFraWd/2.)*cos45-preShape6;
+ v0APts[5+8*i] = -(fV0AR4+fV0AFraWd/2.)*sin45-preShape6;
+ v0APts[6+8*i] = -(fV0AR4+fV0AFraWd)*cos45-preShape6;
+ v0APts[7+8*i] = -fV0AR4*sin45-preShape6;
+ }
+ new TGeoArb8("sV0ACha26", fV0ASciWd/2.+2.*preShape6, v0APts);
+ new TGeoCompositeShape("sV0ACha126","sV0ACha16+sV0ACha26");
+ new TGeoTube("sV0ANail16Hole", 0.0, 0.4, 1.65);
+ TGeoTranslation *pos16 = new TGeoTranslation("pos16",-0.51,-42.9,0.0);
+ pos16->RegisterYourself();
+ new TGeoTube("sV0ANail26Hole", 0.0, 0.4, 1.65);
+ TGeoTranslation *pos26 = new TGeoTranslation("pos26",-30.05,-30.79,0.0);
+ pos26->RegisterYourself();
+ new TGeoCompositeShape("sV0ANailsHoles6","sV0ANail16Hole:pos16+sV0ANail26Hole:pos26");
+ new TGeoCompositeShape("sV0ACha6","sV0ACha126+sV0ANailsHoles6");
+ new TGeoTubeSeg("sV0AFicR56", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape6, 225, 270.0);
+ new TGeoTube("sV0ANail1PlaInHole6", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
+ new TGeoTube("sV0ANail1PlaOuHole6", 0.0, 0.4, (fV0APlaAl)/2.);
+
+ /// Frame
+ TGeoVolume *v0AFra6 = new TGeoVolumeAssembly("V0AFra6");
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = -fV0AFraWd/2.; v0APts[1+8*i] = -fV0AR0-fV0AFraWd/2.;
+ v0APts[2+8*i] = 0.; v0APts[3+8*i] = -fV0AR0-fV0AFraWd/2.;
+ v0APts[4+8*i] = 0.; v0APts[5+8*i] = -fV0AR4+fV0AFraWd/2.;
+ v0APts[6+8*i] = -fV0AFraWd/2.; v0APts[7+8*i] = -fV0AR4+fV0AFraWd/2.;
+ }
+ TGeoArb8 *sV0AFraB16 = new TGeoArb8("sV0AFraB16",fV0ASciWd/2.,v0APts);
+ TGeoVolume *v0AFraB16 = new TGeoVolume("V0AFraB16",sV0AFraB16,medV0AFra);
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = -(fV0AR0+fV0AFraWd/2.)*cos45;
+ v0APts[1+8*i] = -(fV0AR0+fV0AFraWd/2.)*sin45;
+ v0APts[2+8*i] = -fV0AR0*cos45;
+ v0APts[3+8*i] = -(fV0AR0+fV0AFraWd)*sin45;
+ v0APts[4+8*i] = -(fV0AR4-fV0AFraWd/6.)*cos45;
+ v0APts[5+8*i] = -fV0AR4*sin45;
+ v0APts[6+8*i] = -(fV0AR4-fV0AFraWd)*cos45;
+ v0APts[7+8*i] = -(fV0AR4-fV0AFraWd/2.)*sin45;
+ }
+ TGeoArb8 *sV0AFraB26 = new TGeoArb8("sV0AFraB26", fV0ASciWd/2., v0APts);
+ TGeoVolume *v0AFraB26 = new TGeoVolume("V0AFraB26",sV0AFraB26,medV0AFra);
+ v0AFraB16->SetLineColor(kV0AColorFra); v0AFraB26->SetLineColor(kV0AColorFra);
+ v0AFra6->AddNode(v0AFraB16,1);
+ v0AFra6->AddNode(v0AFraB26,1); // Prefer 2 GeoObjects insted of 3 GeoMovements
+ new TGeoTubeSeg( "sV0AFraR1b6", fV0AR0-fV0AFraWd/2.,
+ fV0AR0+fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
+ new TGeoTubeSeg( "sV0AFraR2b6", fV0AR1-fV0AFraWd/2.,
+ fV0AR1+fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
+ new TGeoTubeSeg( "sV0AFraR3b6", fV0AR2-fV0AFraWd/2.,
+ fV0AR2+fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
+ new TGeoTubeSeg( "sV0AFraR4b6", fV0AR3-fV0AFraWd/2.,
+ fV0AR3+fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
+ new TGeoTubeSeg( "sV0AFraR5b6", fV0AR4-fV0AFraWd/2.,
+ fV0AR4+fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
+ TGeoCompositeShape *sV0AFraR16 = new TGeoCompositeShape("sV0AFraR16","sV0AFraR1b6-sV0ACha6");
+ TGeoCompositeShape *sV0AFraR26 = new TGeoCompositeShape("sV0AFraR26","sV0AFraR2b6-sV0ACha6");
+ TGeoCompositeShape *sV0AFraR36 = new TGeoCompositeShape("sV0AFraR36","sV0AFraR3b6-sV0ACha6");
+ TGeoCompositeShape *sV0AFraR46 = new TGeoCompositeShape("sV0AFraR46","sV0AFraR4b6-sV0ACha6");
+ TGeoCompositeShape *sV0AFraR56 = new TGeoCompositeShape("sV0AFraR56","sV0AFraR5b6-sV0ACha6");
+ TGeoVolume *v0AFraR16 = new TGeoVolume("V0AFraR16",sV0AFraR16,medV0AFra);
+ TGeoVolume *v0AFraR26 = new TGeoVolume("V0AFraR26",sV0AFraR26,medV0AFra);
+ TGeoVolume *v0AFraR36 = new TGeoVolume("V0AFraR36",sV0AFraR36,medV0AFra);
+ TGeoVolume *v0AFraR46 = new TGeoVolume("V0AFraR46",sV0AFraR46,medV0AFra);
+ TGeoVolume *v0AFraR56 = new TGeoVolume("V0AFraR56",sV0AFraR56,medV0AFra);
+ v0AFraR16->SetLineColor(kV0AColorFra); v0AFraR26->SetLineColor(kV0AColorFra);
+ v0AFraR36->SetLineColor(kV0AColorFra); v0AFraR46->SetLineColor(kV0AColorFra);
+ v0AFraR56->SetLineColor(kV0AColorFra);
+ v0AFra6->AddNode(v0AFraR16,1);
+ v0AFra6->AddNode(v0AFraR26,1);
+ v0AFra6->AddNode(v0AFraR36,1);
+ v0AFra6->AddNode(v0AFraR46,1);
+ v0AFra6->AddNode(v0AFraR56,1);
+ v0ASec6->AddNode(v0AFra6,1);
+
+ /// Sensitive scintilator
+ TGeoVolume *v0ASci6 = new TGeoVolumeAssembly("V0ASci6");
+ new TGeoTubeSeg( "sV0AR1b6", fV0AR0+fV0AFraWd/2.,
+ fV0AR1-fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
+ new TGeoTubeSeg( "sV0AR2b6", fV0AR1+fV0AFraWd/2.,
+ fV0AR2-fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
+ new TGeoTubeSeg( "sV0AR3b6", fV0AR2+fV0AFraWd/2.,
+ fV0AR3-fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
+ new TGeoTubeSeg( "sV0AR4b6", fV0AR3+fV0AFraWd/2.,
+ fV0AR4-fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
+ TGeoCompositeShape *sV0AR16 = new TGeoCompositeShape("sV0AR16","sV0AR1b6-sV0ACha6");
+ TGeoCompositeShape *sV0AR26 = new TGeoCompositeShape("sV0AR26","sV0AR2b6-sV0ACha6");
+ TGeoCompositeShape *sV0AR36 = new TGeoCompositeShape("sV0AR36","sV0AR3b6-sV0ACha6");
+ TGeoCompositeShape *sV0AR46 = new TGeoCompositeShape("sV0AR46","sV0AR4b6-sV0ACha6");
+ TGeoVolume *v0L16 = new TGeoVolume("V0L16",sV0AR16,medV0ASci);
+ TGeoVolume *v0L26 = new TGeoVolume("V0L26",sV0AR26,medV0ASci);
+ TGeoVolume *v0L36 = new TGeoVolume("V0L36",sV0AR36,medV0ASci);
+ TGeoVolume *v0L46 = new TGeoVolume("V0L46",sV0AR46,medV0ASci);
+ v0L16->SetLineColor(kV0AColorSci); v0L26->SetLineColor(kV0AColorSci);
+ v0L36->SetLineColor(kV0AColorSci); v0L46->SetLineColor(kV0AColorSci);
+ v0ASci6->AddNode(v0L16,1);
+ v0ASci6->AddNode(v0L26,1);
+ v0ASci6->AddNode(v0L36,1);
+ v0ASci6->AddNode(v0L46,1);
+
+ // Bunch of fibers
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = -10.0; v0APts[1+8*i] = 13.1;
+ v0APts[2+8*i] = 10.0; v0APts[3+8*i] = 13.1;
+ v0APts[4+8*i] = 8.0; v0APts[5+8*i] = -29.0;
+ v0APts[6+8*i] = -12.0; v0APts[7+8*i] = -12.0;
+ }
+ new TGeoArb8("sV0AFib16", 0.01, v0APts);
+ rot = new TGeoRotation("rot");
+ rot->RotateX(2.0);
+ rot->RotateY(180.0);
+ rot->RotateZ(90+22.5);
+ TGeoCombiTrans *fib16pos = new TGeoCombiTrans("fib16pos", -40.0 + 3.3, -50.0 + 1.5, 0.5, rot);
+ fib16pos->RegisterYourself();
+ TGeoCompositeShape *sV0AFib16Hole = new TGeoCompositeShape("sV0AFib16Hole", "sV0AFib16:fib16pos-sV0AFicR56");
+ TGeoVolume *v0AFib16Hole = new TGeoVolume("V0AFib16Hole",sV0AFib16Hole,medV0AFib);
+ v0AFib16Hole->SetLineColor(kV0AColorFib);
+ new TGeoArb8("sV0AFib26", 0.01, v0APts);
+ rot = new TGeoRotation("rot");
+ rot->RotateX(-2.0);
+ rot->RotateY(180.0);
+ rot->RotateZ(90+22.5);
+ TGeoCombiTrans *fib26pos = new TGeoCombiTrans("fib26pos", -40.0 + 3.3, -50.0 + 1.5, -0.5, rot);
+ fib26pos->RegisterYourself();
+ TGeoCompositeShape *sV0AFib26Hole = new TGeoCompositeShape("sV0AFib26Hole", "sV0AFib26:fib26pos-sV0AFicR56");
+ TGeoVolume *v0AFib26Hole = new TGeoVolume("V0AFib26Hole",sV0AFib26Hole,medV0AFib);
+ v0AFib26Hole->SetLineColor(kV0AColorFib);
+ TGeoVolume *v0AFib6 = new TGeoVolumeAssembly("V0AFib6");
+ v0AFib6->AddNode(v0AFib16Hole,1);
+ v0AFib6->AddNode(v0AFib26Hole,1);
+ v0ASec6->AddNode(v0AFib6,1);
+
+ /// Non-sensitive scintilator
+ new TGeoTubeSeg("sV0AR5S26", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape6, 225.0, 270.0);
+ TGeoCompositeShape *sV0AR56 = new TGeoCompositeShape("V0AR56","sV0AR5S26 - sV0ACha6");
+ TGeoVolume *v0AR56 = new TGeoVolume("V0AR56",sV0AR56,medV0ASci);
+ v0AR56->SetLineColor(kV0AColorSci);
+ v0ASci6->AddNode(v0AR56,1);
+ v0ASec6->AddNode(v0ASci6,1);
+
+ /// Segment of octagon
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = 0.; v0APts[1+8*i] = -(fV0AR7-fV0AOctH2)*sin654;
+ v0APts[2+8*i] = 0.; v0APts[3+8*i] = -fV0AR7*sin654;
+ v0APts[4+8*i] = -fV0AR7*cos654; v0APts[5+8*i] = -fV0AR7*sin654;
+ v0APts[6+8*i] = -(fV0AR7-fV0AOctH2)*cos654; v0APts[7+8*i] = -(fV0AR7-fV0AOctH2)*sin654;
+ }
+ TGeoArb8 *sV0AOct26 = new TGeoArb8("sV0AOct26", (fV0ASciWd+2*fV0AOctWd)/2., v0APts);
+ TGeoVolume *v0AOct26 = new TGeoVolume("V0AOct26", sV0AOct26,medV0ASup);
+ v0AOct26->SetLineColor(kV0AColorOct);
+ TGeoVolume *v0ASup6 = new TGeoVolumeAssembly("V0ASup6");
+ v0ASup6->AddNode(v0AOct26,1);
+ v0ASec6->AddNode(v0ASup6,1);
+
+ /// Plates
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = 0.; v0APts[1+8*i] = -fV0AR0;
+ v0APts[2+8*i] = 0.; v0APts[3+8*i] = -fV0AR7*sin654;
+ v0APts[4+8*i] = -fV0AR7*cos654; v0APts[5+8*i] = -fV0AR7*sin654;
+ v0APts[6+8*i] = -fV0AR0*cos654; v0APts[7+8*i] = -fV0AR0*sin654;
+ }
+ new TGeoArb8("sV0APlaIn6", (fV0APlaWd-2*fV0APlaAl)/2., v0APts);
+ TGeoCompositeShape *sV0APlaInNailsHoles6 = new TGeoCompositeShape("sV0APlaInNailsHoles6","sV0APlaIn6-sV0ANail1PlaInHole6:pos16");
+ TGeoVolume *v0APlaInNailsHoles6 = new TGeoVolume("V0APlaInNailsHoles6", sV0APlaInNailsHoles6, medV0APlaIn);
+ new TGeoArb8("sV0APlaOu6", fV0APlaAl/2., v0APts);
+ TGeoCompositeShape *sV0APlaOuNailsHoles6 = new TGeoCompositeShape("sV0APlaOuNailsHoles6","sV0APlaOu6-sV0ANail1PlaOuHole6:pos16");
+ TGeoVolume *v0APlaOuNailsHoles6 = new TGeoVolume("V0APlaOuNailsHoles6", sV0APlaOuNailsHoles6, medV0APlaOu);
+ v0APlaInNailsHoles6->SetLineColor(kV0AColorPlaIn); v0APlaOuNailsHoles6->SetLineColor(kV0AColorPlaOu);
+ TGeoVolume *v0APla6 = new TGeoVolumeAssembly("V0APla6");
+ v0APla6->AddNode(v0APlaInNailsHoles6,1);
+ v0APla6->AddNode(v0APlaOuNailsHoles6,1,new TGeoTranslation(0,0,(fV0APlaWd-fV0APlaAl)/2.));
+ v0APla6->AddNode(v0APlaOuNailsHoles6,2,new TGeoTranslation(0,0,-(fV0APlaWd-fV0APlaAl)/2.));
+ v0ASec6->AddNode(v0APla6,1,new TGeoTranslation(0,0,(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
+ v0ASec6->AddNode(v0APla6,2,new TGeoTranslation(0,0,-(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
+
+ /// PMBox
+ TGeoVolume* v0APM6 = new TGeoVolumeAssembly("V0APM6");
+ new TGeoBBox("sV0APMB16", fV0APMBWd/2., fV0APMBHt/2., fV0APMBTh/2.);
+ new TGeoBBox("sV0APMB26", fV0APMBWd/2.-fV0APMBWdW, fV0APMBHt/2.-fV0APMBHtW, fV0APMBTh/2.-fV0APMBThW);
+ TGeoCompositeShape *sV0APMB6 = new TGeoCompositeShape("sV0APMB6","sV0APMB16-sV0APMB26");
+ TGeoVolume *v0APMB6 = new TGeoVolume("V0APMB6",sV0APMB6, medV0APMAlum);
+ v0APMB6->SetLineColor(kV0AColorPMA);
+ v0APM6->AddNode(v0APMB6,1);
+
+ /// PMTubes
+ TGeoTube *sV0APMT16 = new TGeoTube("sV0APMT16", fV0APMTR1, fV0APMTR2, fV0APMTH/2.);
+ TGeoVolume *v0APMT16 = new TGeoVolume("V0APMT16", sV0APMT16, medV0APMGlass);
+ TGeoTube *sV0APMT26 = new TGeoTube("sV0APMT26", fV0APMTR3, fV0APMTR4, fV0APMTH/2.);
+ TGeoVolume *v0APMT26 = new TGeoVolume("V0APMT26", sV0APMT26, medV0APMAlum);
+ TGeoVolume *v0APMT6 = new TGeoVolumeAssembly("V0APMT6");
+ TGeoTube *sV0APMTT6 = new TGeoTube("sV0APMTT6", 0., fV0APMTR4, fV0APMTB/2.);
+ TGeoVolume *v0APMTT6 = new TGeoVolume("V0APMTT6", sV0APMTT6, medV0APMAlum);
+ v0APMT6->SetLineColor(kV0AColorPMG);
+ v0APMT26->SetLineColor(kV0AColorPMA);
+ v0APMTT6->SetLineColor(kV0AColorPMA);
+ rot = new TGeoRotation("rot", 90, 0, 180, 0, 90, 90);
+ v0APMT6->AddNode(v0APMT16,1,rot);
+ v0APMT6->AddNode(v0APMT26,1,rot);
+ v0APMT6->AddNode(v0APMTT6,1,new TGeoCombiTrans(0,(fV0APMTH+fV0APMTB)/2.,0,rot));
+ double autoShift6 = (fV0APMBWd-2*fV0APMBWdW)/4.;
+ v0APM6->AddNode(v0APMT6, 1, new TGeoTranslation(-1.5*autoShift6, 0, 0));
+ v0APM6->AddNode(v0APMT6, 2, new TGeoTranslation(-0.5*autoShift6, 0, 0));
+ v0APM6->AddNode(v0APMT6, 3, new TGeoTranslation(+0.5*autoShift6, 0, 0));
+ v0APM6->AddNode(v0APMT6, 4, new TGeoTranslation(+1.5*autoShift6, 0, 0));
+
+ /// PM
+ rot = new TGeoRotation("rot");
+ rot->RotateX(-90+30);
+ rot->RotateY(0);
+ rot->RotateZ(-65-3);
+ double cosAngPMB6 = TMath::Cos(fV0APMBAng*TMath::DegToRad());
+ double sinAngPMB6 = TMath::Sin(fV0APMBAng*TMath::DegToRad());
+ double shiftZ6 = fV0APMBHt/2. * cosAngPMB6
+ - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0APMBTh/2. * sinAngPMB6;
+ double shiftR6 = fV0AR6 + fV0AR1 + fV0AOctWd + fV0APlaAl/3.;
+ v0ASec6->AddNode(v0APM6,1, new TGeoCombiTrans( -shiftR6*cos45-1.3, -shiftR6*sin45, shiftZ6, rot));
+
+ /// Support
+ TGeoBBox *sV0ASuppbl = new TGeoBBox("sV0ASuppbl", 2.0, 18.13, fV0ASciWd/2.);
+ TGeoVolume *v0ASuppbl = new TGeoVolume("V0ASuppbl", sV0ASuppbl, medV0ASup);
+ v0ASuppbl->SetLineColor(kV0AColorOct);
+ v0ASec6->AddNode(v0ASuppbl,1,new TGeoTranslation(-2.0,-63.64,0.0));
+
+ // Aluminium nail
+ TGeoTube *sV0ANail61 = new TGeoTube("sV0ANail61", 0.0, 0.4, 5.09/2.);
+ TGeoVolume *v0ANail61 = new TGeoVolume("V0ANail61", sV0ANail61, medV0APMAlum);
+ v0ANail61->SetLineColor(kV0AColorPMA);// this is the color for aluminium
+ v0ASec6->AddNode(v0ANail61,1,new TGeoTranslation(-0.51,-42.9,0.0));
+ TGeoTube *sV0ANail62 = new TGeoTube("sV0ANail62", 0.0, 0.4, 5.09/2.);
+ TGeoVolume *v0ANail62 = new TGeoVolume("V0ANail62", sV0ANail62, medV0APMAlum);
+ v0ANail62->SetLineColor(kV0AColorPMA);
+ v0ASec6->AddNode(v0ANail62,1,new TGeoTranslation(-30.05,-30.79,0.0));
+
+ // Adding sector to v0LE volume
+ v0LE->AddNode(v0ASec6, 1);
+
+
+ //Definition of sector 7
+ TGeoVolume *v0ASec7 = new TGeoVolumeAssembly("V0ASec7");
+
+ /// For boolean sustraction
+ double preShape7 = 0.2;
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = 0.0; v0APts[1+8*i] = -fV0AR0+fV0AFraWd/2.-preShape7;
+ v0APts[2+8*i] = fV0AFraWd/2.; v0APts[3+8*i] = -fV0AR0+fV0AFraWd/2.-preShape7;
+ v0APts[4+8*i] = fV0AFraWd/2.; v0APts[5+8*i] = -fV0AR4-fV0AFraWd/2.+preShape7;
+ v0APts[6+8*i] = 0.0; v0APts[7+8*i] = -fV0AR4-fV0AFraWd/2.+preShape7;
+ }
+ new TGeoArb8("sV0ACha17",fV0ASciWd/1.5,v0APts);
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = (fV0AR0-fV0AFraWd/2.)*cos45-preShape7;
+ v0APts[1+8*i] = -(fV0AR0-fV0AFraWd/2.)*sin45;
+ v0APts[2+8*i] = fV0AR0*cos45-preShape7;
+ v0APts[3+8*i] = -(fV0AR0-fV0AFraWd)*sin45+preShape7;
+ v0APts[4+8*i] = (fV0AR4+fV0AFraWd)*cos45+preShape7;
+ v0APts[5+8*i] = -fV0AR4*sin45-preShape7;
+ v0APts[6+8*i] = (fV0AR4+fV0AFraWd/2.)*cos45+preShape7;
+ v0APts[7+8*i] = -(fV0AR4+fV0AFraWd/2.)*sin45-2.*preShape7;
+ }
+ new TGeoArb8("sV0ACha27", fV0ASciWd/2.+2.*preShape7, v0APts);
+ new TGeoCompositeShape("sV0ACha127","sV0ACha17+sV0ACha27");
+ new TGeoTube("sV0ANail17Hole", 0.0, 0.4, 1.65);
+ TGeoTranslation *pos17 = new TGeoTranslation("pos17",0.51,-42.9,0.0);
+ pos17->RegisterYourself();
+ new TGeoTube("sV0ANail27Hole", 0.0, 0.4, 1.65);
+ TGeoTranslation *pos27 = new TGeoTranslation("pos27",30.05,-30.79,0.0);
+ pos27->RegisterYourself();
+ new TGeoCompositeShape("sV0ANailsHoles7","sV0ANail17Hole:pos17+sV0ANail27Hole:pos27");
+ new TGeoCompositeShape("sV0ACha7","sV0ACha127+sV0ANailsHoles7");
+ new TGeoTubeSeg("sV0AFicR57", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape7, 270.0, 315.0);
+ new TGeoTube("sV0ANail1PlaInHole7", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
+ new TGeoTube("sV0ANail1PlaOuHole7", 0.0, 0.4, (fV0APlaAl)/2.);
+
+ /// Frame
+ TGeoVolume *v0AFra7 = new TGeoVolumeAssembly("V0AFra7");
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = 0.; v0APts[1+8*i] = -fV0AR0-fV0AFraWd/2.;
+ v0APts[2+8*i] = fV0AFraWd/2.; v0APts[3+8*i] = -fV0AR0-fV0AFraWd/2.;
+ v0APts[4+8*i] = fV0AFraWd/2.; v0APts[5+8*i] = -fV0AR4+fV0AFraWd/2.;
+ v0APts[6+8*i] = 0.; v0APts[7+8*i] = -fV0AR4+fV0AFraWd/2.;
+ }
+ TGeoArb8 *sV0AFraB17 = new TGeoArb8("sV0AFraB17",fV0ASciWd/2.,v0APts);
+ TGeoVolume *v0AFraB17 = new TGeoVolume("V0AFraB17",sV0AFraB17,medV0AFra);
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = fV0AR0*cos45-fV0AFraWd;
+ v0APts[1+8*i] = -(fV0AR0-fV0AFraWd)*sin45;
+ v0APts[2+8*i] = (fV0AR0-fV0AFraWd/2.)*cos45;
+ v0APts[3+8*i] = -(fV0AR0-fV0AFraWd/2.)*sin45;
+ v0APts[4+8*i] = (fV0AR4+fV0AFraWd/2.)*cos45/2.;
+ v0APts[5+8*i] = -fV0AR4*sin45/2.;
+ v0APts[6+8*i] = (fV0AR4+fV0AFraWd/4.)*cos45/2.;
+ v0APts[7+8*i] = -(fV0AR4+fV0AFraWd/2.)*sin45/2.;
+ }
+ TGeoArb8 *sV0AFraB27 = new TGeoArb8("sV0AFraB27", fV0ASciWd/2., v0APts);
+ TGeoVolume *v0AFraB27 = new TGeoVolume("V0AFraB27",sV0AFraB27,medV0AFra);
+ v0AFraB17->SetLineColor(kV0AColorFra); v0AFraB27->SetLineColor(kV0AColorFra);
+ v0AFra7->AddNode(v0AFraB17,1);
+ v0AFra7->AddNode(v0AFraB27,1); // Prefer 2 GeoObjects insted of 3 GeoMovements
+ new TGeoTubeSeg( "sV0AFraR1b7", fV0AR0-fV0AFraWd/2.,
+ fV0AR0+fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
+ new TGeoTubeSeg( "sV0AFraR2b7", fV0AR1-fV0AFraWd/2.,
+ fV0AR1+fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
+ new TGeoTubeSeg( "sV0AFraR3b7", fV0AR2-fV0AFraWd/2.,
+ fV0AR2+fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
+ new TGeoTubeSeg( "sV0AFraR4b7", fV0AR3-fV0AFraWd/2.,
+ fV0AR3+fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
+ new TGeoTubeSeg( "sV0AFraR5b7", fV0AR4-fV0AFraWd/2.,
+ fV0AR4+fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
+ TGeoCompositeShape *sV0AFraR17 = new TGeoCompositeShape("sV0AFraR17","sV0AFraR1b7-sV0ACha7");
+ TGeoCompositeShape *sV0AFraR27 = new TGeoCompositeShape("sV0AFraR27","sV0AFraR2b7-sV0ACha7");
+ TGeoCompositeShape *sV0AFraR37 = new TGeoCompositeShape("sV0AFraR37","sV0AFraR3b7-sV0ACha7");
+ TGeoCompositeShape *sV0AFraR47 = new TGeoCompositeShape("sV0AFraR47","sV0AFraR4b7-sV0ACha7");
+ TGeoCompositeShape *sV0AFraR57 = new TGeoCompositeShape("sV0AFraR57","sV0AFraR5b7-sV0ACha7");
+ TGeoVolume *v0AFraR17 = new TGeoVolume("V0AFraR17",sV0AFraR17,medV0AFra);
+ TGeoVolume *v0AFraR27 = new TGeoVolume("V0AFraR27",sV0AFraR27,medV0AFra);
+ TGeoVolume *v0AFraR37 = new TGeoVolume("V0AFraR37",sV0AFraR37,medV0AFra);
+ TGeoVolume *v0AFraR47 = new TGeoVolume("V0AFraR47",sV0AFraR47,medV0AFra);
+ TGeoVolume *v0AFraR57 = new TGeoVolume("V0AFraR57",sV0AFraR57,medV0AFra);
+ v0AFraR17->SetLineColor(kV0AColorFra); v0AFraR27->SetLineColor(kV0AColorFra);
+ v0AFraR37->SetLineColor(kV0AColorFra); v0AFraR47->SetLineColor(kV0AColorFra);
+ v0AFraR57->SetLineColor(kV0AColorFra);
+ v0AFra7->AddNode(v0AFraR17,1);
+ v0AFra7->AddNode(v0AFraR27,1);
+ v0AFra7->AddNode(v0AFraR37,1);
+ v0AFra7->AddNode(v0AFraR47,1);
+ v0AFra7->AddNode(v0AFraR57,1);
+ v0ASec7->AddNode(v0AFra7,1);
+
+ /// Sensitive scintilator
+ TGeoVolume *v0ASci7 = new TGeoVolumeAssembly("V0ASci7");
+ new TGeoTubeSeg( "sV0AR1b7", fV0AR0+fV0AFraWd/2.,
+ fV0AR1-fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
+ new TGeoTubeSeg( "sV0AR2b7", fV0AR1+fV0AFraWd/2.,
+ fV0AR2-fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
+ new TGeoTubeSeg( "sV0AR3b7", fV0AR2+fV0AFraWd/2.,
+ fV0AR3-fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
+ new TGeoTubeSeg( "sV0AR4b7", fV0AR3+fV0AFraWd/2.,
+ fV0AR4-fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
+ TGeoCompositeShape *sV0AR17 = new TGeoCompositeShape("sV0AR17","sV0AR1b7-sV0ACha7");
+ TGeoCompositeShape *sV0AR27 = new TGeoCompositeShape("sV0AR27","sV0AR2b7-sV0ACha7");
+ TGeoCompositeShape *sV0AR37 = new TGeoCompositeShape("sV0AR37","sV0AR3b7-sV0ACha7");
+ TGeoCompositeShape *sV0AR47 = new TGeoCompositeShape("sV0AR47","sV0AR4b7-sV0ACha7");
+ TGeoVolume *v0L17 = new TGeoVolume("V0L17",sV0AR17,medV0ASci);
+ TGeoVolume *v0L27 = new TGeoVolume("V0L27",sV0AR27,medV0ASci);
+ TGeoVolume *v0L37 = new TGeoVolume("V0L37",sV0AR37,medV0ASci);
+ TGeoVolume *v0L47 = new TGeoVolume("V0L47",sV0AR47,medV0ASci);
+ v0L17->SetLineColor(kV0AColorSci); v0L27->SetLineColor(kV0AColorSci);
+ v0L37->SetLineColor(kV0AColorSci); v0L47->SetLineColor(kV0AColorSci);
+ v0ASci7->AddNode(v0L17,1);
+ v0ASci7->AddNode(v0L27,1);
+ v0ASci7->AddNode(v0L37,1);
+ v0ASci7->AddNode(v0L47,1);
+
+ // Bunch of fibers
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = -10.0; v0APts[1+8*i] = 13.1;
+ v0APts[2+8*i] = 10.0; v0APts[3+8*i] = 13.1;
+ v0APts[4+8*i] = 8.0; v0APts[5+8*i] = -29.0;
+ v0APts[6+8*i] = -12.0; v0APts[7+8*i] = -12.0;
+ }
+ new TGeoArb8("sV0AFib17", 0.01, v0APts);
+ rot = new TGeoRotation("rot");
+ rot->RotateX(-2.0);
+ rot->RotateY(0.0);
+ rot->RotateZ(248.0);
+ TGeoCombiTrans *fib17pos = new TGeoCombiTrans("fib17pos", 40.0 - 3.3, -50.0 + 1.5, 0.5, rot);
+ fib17pos->RegisterYourself();
+ TGeoCompositeShape *sV0AFib17Hole = new TGeoCompositeShape("sV0AFib17Hole", "sV0AFib17:fib17pos-sV0AFicR57");
+ TGeoVolume *v0AFib17Hole = new TGeoVolume("V0AFib17Hole",sV0AFib17Hole,medV0AFib);
+ v0AFib17Hole->SetLineColor(kV0AColorFib);
+ new TGeoArb8("sV0AFib27", 0.01, v0APts);
+ rot = new TGeoRotation("rot");
+ rot->RotateX(2.0);
+ rot->RotateY(0.0);
+ rot->RotateZ(248.0);
+ TGeoCombiTrans *fib27pos = new TGeoCombiTrans("fib27pos", 40.0 - 3.3, -50.0 + 1.5, -0.5, rot);
+ fib27pos->RegisterYourself();
+ TGeoCompositeShape *sV0AFib27Hole = new TGeoCompositeShape("sV0AFib27Hole", "sV0AFib27:fib27pos-sV0AFicR57");
+ TGeoVolume *v0AFib27Hole = new TGeoVolume("V0AFib27Hole",sV0AFib27Hole,medV0AFib);
+ v0AFib27Hole->SetLineColor(kV0AColorFib);
+ TGeoVolume *v0AFib7 = new TGeoVolumeAssembly("V0AFib7");
+ v0AFib7->AddNode(v0AFib17Hole,1);
+ v0AFib7->AddNode(v0AFib27Hole,1);
+ v0ASec7->AddNode(v0AFib7,1);
+
+ /// Non-sensitive scintilator
+ new TGeoTubeSeg("sV0AR5S27", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape7, 270.0, 315.0);
+ TGeoCompositeShape *sV0AR57 = new TGeoCompositeShape("V0AR57","sV0AR5S27 - sV0ACha7");
+ TGeoVolume *v0AR57 = new TGeoVolume("V0AR57",sV0AR57,medV0ASci);
+ v0AR57->SetLineColor(kV0AColorSci);
+ v0ASci7->AddNode(v0AR57,1);
+ v0ASec7->AddNode(v0ASci7,1);
+
+ /// Segment of octagon
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = 0.; v0APts[1+8*i] = -fV0AR7*sin654;
+ v0APts[2+8*i] = 0.; v0APts[3+8*i] = -(fV0AR7-fV0AOctH2)*sin654;
+ v0APts[4+8*i] = (fV0AR7-fV0AOctH2)*cos654; v0APts[5+8*i] = -(fV0AR7-fV0AOctH2)*sin654;
+ v0APts[6+8*i] = fV0AR7*cos654; v0APts[7+8*i] = -fV0AR7*sin654;
+ }
+ TGeoArb8 *sV0AOct27 = new TGeoArb8("sV0AOct27", (fV0ASciWd+2*fV0AOctWd)/2., v0APts);
+ TGeoVolume *v0AOct27 = new TGeoVolume("V0AOct27", sV0AOct27,medV0ASup);
+ v0AOct27->SetLineColor(kV0AColorOct);
+ TGeoVolume *v0ASup7 = new TGeoVolumeAssembly("V0ASup7");
+ v0ASup7->AddNode(v0AOct27,1);
+ v0ASec7->AddNode(v0ASup7,1);
+
+ /// Plates
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = 0.; v0APts[1+8*i] = -fV0AR7*sin654;
+ v0APts[2+8*i] = 0.; v0APts[3+8*i] = -fV0AR0;
+ v0APts[4+8*i] = fV0AR0*cos654; v0APts[5+8*i] = -fV0AR0*sin654;
+ v0APts[6+8*i] = fV0AR7*cos654; v0APts[7+8*i] = -fV0AR7*sin654;
+ }
+ new TGeoArb8("sV0APlaIn7", (fV0APlaWd-2*fV0APlaAl)/2., v0APts);
+ TGeoCompositeShape *sV0APlaInNailsHoles7 = new TGeoCompositeShape("sV0APlaInNailsHoles7","sV0APlaIn7-sV0ANail1PlaInHole7:pos17");
+ TGeoVolume *v0APlaInNailsHoles7 = new TGeoVolume("V0APlaInNailsHoles7", sV0APlaInNailsHoles7, medV0APlaIn);
+ new TGeoArb8("sV0APlaOu7", fV0APlaAl/2., v0APts);
+ TGeoCompositeShape *sV0APlaOuNailsHoles7 = new TGeoCompositeShape("sV0APlaOuNailsHoles7","sV0APlaOu7-sV0ANail1PlaOuHole7:pos17");
+ TGeoVolume *v0APlaOuNailsHoles7 = new TGeoVolume("V0APlaOuNailsHoles7", sV0APlaOuNailsHoles7, medV0APlaOu);
+ v0APlaInNailsHoles7->SetLineColor(kV0AColorPlaIn); v0APlaOuNailsHoles7->SetLineColor(kV0AColorPlaOu);
+ TGeoVolume *v0APla7 = new TGeoVolumeAssembly("V0APla7");
+ v0APla7->AddNode(v0APlaInNailsHoles7,1);
+ v0APla7->AddNode(v0APlaOuNailsHoles7,1,new TGeoTranslation(0,0,(fV0APlaWd-fV0APlaAl)/2.));
+ v0APla7->AddNode(v0APlaOuNailsHoles7,2,new TGeoTranslation(0,0,-(fV0APlaWd-fV0APlaAl)/2.));
+ v0ASec7->AddNode(v0APla7,1,new TGeoTranslation(0,0,(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
+ v0ASec7->AddNode(v0APla7,2,new TGeoTranslation(0,0,-(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
+
+ /// PMBox
+ TGeoVolume* v0APM7 = new TGeoVolumeAssembly("V0APM7");
+ new TGeoBBox("sV0APMB17", fV0APMBWd/2., fV0APMBHt/2., fV0APMBTh/2.);
+ new TGeoBBox("sV0APMB27", fV0APMBWd/2.-fV0APMBWdW, fV0APMBHt/2.-fV0APMBHtW, fV0APMBTh/2.-fV0APMBThW);
+ TGeoCompositeShape *sV0APMB7 = new TGeoCompositeShape("sV0APMB7","sV0APMB17-sV0APMB27");
+ TGeoVolume *v0APMB7 = new TGeoVolume("V0APMB7",sV0APMB7, medV0APMAlum);
+ v0APMB7->SetLineColor(kV0AColorPMA);
+ v0APM7->AddNode(v0APMB7,1);
+
+ /// PMTubes
+ TGeoTube *sV0APMT17 = new TGeoTube("sV0APMT17", fV0APMTR1, fV0APMTR2, fV0APMTH/2.);
+ TGeoVolume *v0APMT17 = new TGeoVolume("V0APMT17", sV0APMT17, medV0APMGlass);
+ TGeoTube *sV0APMT27 = new TGeoTube("sV0APMT27", fV0APMTR3, fV0APMTR4, fV0APMTH/2.);
+ TGeoVolume *v0APMT27 = new TGeoVolume("V0APMT27", sV0APMT27, medV0APMAlum);
+ TGeoVolume *v0APMT7 = new TGeoVolumeAssembly("V0APMT7"); // pk si no choca con la 752 o con la 794
+ TGeoTube *sV0APMTT7 = new TGeoTube("sV0APMTT7", 0., fV0APMTR4, fV0APMTB/2.);
+ TGeoVolume *v0APMTT7 = new TGeoVolume("V0APMTT7", sV0APMTT7, medV0APMAlum);
+ v0APMT7->SetLineColor(kV0AColorPMG);
+ v0APMT27->SetLineColor(kV0AColorPMA);
+ v0APMTT7->SetLineColor(kV0AColorPMA);
+ rot = new TGeoRotation("rot", 90, 0, 180, 0, 90, 90);
+ v0APMT7->AddNode(v0APMT17,1,rot);
+ v0APMT7->AddNode(v0APMT27,1,rot);
+ v0APMT7->AddNode(v0APMTT7,1,new TGeoCombiTrans(0,(fV0APMTH+fV0APMTB)/2.,0,rot));
+ v0APM7->AddNode(v0APMT7, 1, new TGeoTranslation(-1.5*autoShiftSec1, 0, 0));
+ v0APM7->AddNode(v0APMT7, 2, new TGeoTranslation(-0.5*autoShiftSec1, 0, 0));
+ v0APM7->AddNode(v0APMT7, 3, new TGeoTranslation(+0.5*autoShiftSec1, 0, 0));
+ v0APM7->AddNode(v0APMT7, 4, new TGeoTranslation(+1.5*autoShiftSec1, 0, 0));
+
+ /// PM
+ rot = new TGeoRotation("rot");
+ rot->RotateX(-90+30);
+ rot->RotateY(0);
+ rot->RotateZ(65+3);
+ double shiftZ7 = fV0APMBHt/2. * cosAngPMBSec1
+ - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0APMBTh/2. * sinAngPMBSec1;
+ double shiftR7 = fV0AR6 + fV0AR1 + fV0AOctWd + fV0APlaAl/3.;
+ v0ASec7->AddNode(v0APM7,1, new TGeoCombiTrans( shiftR7*cos45+1.3, -shiftR7*sin45, shiftZ7, rot));
+
+ // Aluminium nail
+ TGeoTube *sV0ANail71 = new TGeoTube("sV0ANail71", 0.0, 0.4, 5.09/2.);
+ TGeoVolume *v0ANail71 = new TGeoVolume("V0ANail71", sV0ANail71, medV0APMAlum);
+ v0ANail71->SetLineColor(kV0AColorPMA);// this is the color for aluminium
+ v0ASec7->AddNode(v0ANail71,1,new TGeoTranslation(0.51,-42.9,0.0));
+ TGeoTube *sV0ANail72 = new TGeoTube("sV0ANail72", 0.0, 0.4, 5.09/2.);
+ TGeoVolume *v0ANail72 = new TGeoVolume("V0ANail72", sV0ANail72, medV0APMAlum);
+ v0ANail72->SetLineColor(kV0AColorPMA);
+ v0ASec7->AddNode(v0ANail72,1,new TGeoTranslation(30.05,-30.79,0.0));
+
+ // Support
+ TGeoBBox *sV0ASuppbr = new TGeoBBox("sV0ASuppbr", 2.0, 18.13, fV0ASciWd/2.);
+ TGeoVolume *v0ASuppbr = new TGeoVolume("V0ASuppbr", sV0ASuppbr, medV0ASup);
+ v0ASuppbr->SetLineColor(kV0AColorOct);
+ v0ASec7->AddNode(v0ASuppbr,1,new TGeoTranslation(2.0,-63.64,0.0));
+
+ // Adding sector to v0LE volume
+ v0LE->AddNode(v0ASec7,1);
+
+
+ //Definition of sector 8
+ TGeoVolume *v0ASec8 = new TGeoVolumeAssembly("V0ASec8");
+
+ /// For boolean sustraction
+ double preShape8 = 0.2;
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = fV0AR0-fV0AFraWd/2.; v0APts[1+8*i] = -2*preShape8;
+ v0APts[2+8*i] = fV0AR0-fV0AFraWd/2.; v0APts[3+8*i] = 0.0;
+ v0APts[4+8*i] = fV0AR4+fV0AFraWd/2.; v0APts[5+8*i] = 0.0;
+ v0APts[6+8*i] = fV0AR4+fV0AFraWd/2.; v0APts[7+8*i] = -2*preShape8;
+ }
+ new TGeoArb8("sV0ACha18",fV0ASciWd/1.5,v0APts);
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = (fV0AR0-fV0AFraWd/2.)*sin45-preShape8;
+ v0APts[1+8*i] = -(fV0AR0-fV0AFraWd/2.)*sin45;
+ v0APts[2+8*i] = fV0AR0*sin45-fV0AFraWd/2.-preShape8;
+ v0APts[3+8*i] = -(fV0AR0-fV0AFraWd)*sin45+preShape8;
+ v0APts[4+8*i] = (fV0AR4+3*fV0AFraWd/2.)*sin45+preShape8;
+ v0APts[5+8*i] = -fV0AR4*sin45-preShape8;
+ v0APts[6+8*i] = (fV0AR4+fV0AFraWd)*sin45+preShape8;
+ v0APts[7+8*i] = -(fV0AR4+fV0AFraWd/2.)*sin45-2.*preShape8;
+ }
+ new TGeoArb8("sV0ACha28", fV0ASciWd/2.+2.*preShape8, v0APts);
+ new TGeoCompositeShape("sV0ACha128","sV0ACha18+sV0ACha28");
+ new TGeoTube("sV0ANail18Hole", 0.0, 0.4, 1.65);
+ TGeoTranslation *pos18 = new TGeoTranslation("pos18",42.9,-.51,0.0);
+ pos18->RegisterYourself();
+ new TGeoTube("sV0ANail28Hole", 0.0, 0.4, 1.65);
+ TGeoTranslation *pos28 = new TGeoTranslation("pos28",30.8,-30.04,0.0);
+ pos28->RegisterYourself();
+ TGeoTranslation *pos38 = new TGeoTranslation("pos38",30.05,-30.79,0.0);
+ pos38->RegisterYourself();
+ new TGeoCompositeShape("sV0ANailsHoles8","sV0ANail18Hole:pos18+sV0ANail28Hole:pos28");
+ new TGeoCompositeShape("sV0ACha8","sV0ACha128+sV0ANailsHoles8");
+ new TGeoTubeSeg("sV0AFicR58", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2. +2*preShape8, 315.0, 360.0);
+ new TGeoTube("sV0ANail1PlaInHole8", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
+ new TGeoTube("sV0ANail2PlaInHole8", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
+ new TGeoTube("sV0ANail3PlaInHole8", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
+ new TGeoCompositeShape("sV0ANailsPlaInHoles8","sV0ANail1PlaInHole8:pos18+sV0ANail2PlaInHole8:pos28+sV0ANail3PlaInHole8:pos38");
+ new TGeoTube("sV0ANail1PlaOuHole8", 0.0, 0.4, (fV0APlaAl)/2.);
+ new TGeoTube("sV0ANail2PlaOuHole8", 0.0, 0.4, (fV0APlaAl)/2.);
+ new TGeoTube("sV0ANail3PlaOuHole8", 0.0, 0.4, (fV0APlaAl)/2.);
+ new TGeoCompositeShape("sV0ANailsPlaOuHoles8","sV0ANail1PlaOuHole8:pos18+sV0ANail2PlaOuHole8:pos28+sV0ANail3PlaOuHole8:pos38");
+
+ /// Frame
+ TGeoVolume *v0AFra8 = new TGeoVolumeAssembly("V0AFra8");
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = fV0AR0-fV0AFraWd/2.; v0APts[1+8*i] = 0.0;
+ v0APts[2+8*i] = fV0AR4+fV0AFraWd/2.; v0APts[3+8*i] = 0.0;
+ v0APts[4+8*i] = fV0AR4+fV0AFraWd/2.; v0APts[5+8*i] = -fV0AFraWd/8.;
+ v0APts[6+8*i] = fV0AR0-fV0AFraWd/2.; v0APts[7+8*i] = -fV0AFraWd/8.;
+ }
+ TGeoArb8 *sV0AFraB18 = new TGeoArb8("sV0AFraB18",fV0ASciWd/2.,v0APts);
+ TGeoVolume *v0AFraB18 = new TGeoVolume("V0AFraB18",sV0AFraB18,medV0AFra);
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = (fV0AR0-fV0AFraWd/4.)*sin45;
+ v0APts[1+8*i] = -(fV0AR0-fV0AFraWd/2.)*sin45;
+ v0APts[2+8*i] = fV0AR0*sin45-fV0AFraWd/2.;
+ v0APts[3+8*i] = -(fV0AR0-fV0AFraWd)*sin45;
+ v0APts[4+8*i] = (fV0AR4+3*fV0AFraWd/2.)*sin45/2.;
+ v0APts[5+8*i] = -fV0AR4*sin45/2.;
+ v0APts[6+8*i] = (fV0AR4+fV0AFraWd)*sin45/2.;
+ v0APts[7+8*i] = -(fV0AR4+fV0AFraWd/2.)*sin45/2.;
+ }
+ TGeoArb8 *sV0AFraB28 = new TGeoArb8("sV0AFraB28", fV0ASciWd/2., v0APts);
+ TGeoVolume *v0AFraB28 = new TGeoVolume("V0AFraB28",sV0AFraB28,medV0AFra);
+ v0AFraB18->SetLineColor(kV0AColorFra); v0AFraB28->SetLineColor(kV0AColorFra);
+ v0AFra8->AddNode(v0AFraB18,1);
+ v0AFra8->AddNode(v0AFraB28,1); // Prefer 2 GeoObjects insted of 3 GeoMovements
+ new TGeoTubeSeg( "sV0AFraR1b8", fV0AR0-fV0AFraWd/2.,
+ fV0AR0+fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
+ new TGeoTubeSeg( "sV0AFraR2b8", fV0AR1-fV0AFraWd/2.,
+ fV0AR1+fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
+ new TGeoTubeSeg( "sV0AFraR3b8", fV0AR2-fV0AFraWd/2.,
+ fV0AR2+fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
+ new TGeoTubeSeg( "sV0AFraR4b8", fV0AR3-fV0AFraWd/2.,
+ fV0AR3+fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
+ new TGeoTubeSeg( "sV0AFraR5b8", fV0AR4-fV0AFraWd/2.,
+ fV0AR4+fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
+ TGeoCompositeShape *sV0AFraR18 = new TGeoCompositeShape("sV0AFraR18","sV0AFraR1b8-sV0ACha8");
+ TGeoCompositeShape *sV0AFraR28 = new TGeoCompositeShape("sV0AFraR28","sV0AFraR2b8-sV0ACha8");
+ TGeoCompositeShape *sV0AFraR38 = new TGeoCompositeShape("sV0AFraR38","sV0AFraR3b8-sV0ACha8");
+ TGeoCompositeShape *sV0AFraR48 = new TGeoCompositeShape("sV0AFraR48","sV0AFraR4b8-sV0ACha8");
+ TGeoCompositeShape *sV0AFraR58 = new TGeoCompositeShape("sV0AFraR58","sV0AFraR5b8-sV0ACha8");
+ TGeoVolume *v0AFraR18 = new TGeoVolume("V0AFraR18",sV0AFraR18,medV0AFra);
+ TGeoVolume *v0AFraR28 = new TGeoVolume("V0AFraR28",sV0AFraR28,medV0AFra);
+ TGeoVolume *v0AFraR38 = new TGeoVolume("V0AFraR38",sV0AFraR38,medV0AFra);
+ TGeoVolume *v0AFraR48 = new TGeoVolume("V0AFraR48",sV0AFraR48,medV0AFra);
+ TGeoVolume *v0AFraR58 = new TGeoVolume("V0AFraR58",sV0AFraR58,medV0AFra);
+ v0AFraR18->SetLineColor(kV0AColorFra); v0AFraR28->SetLineColor(kV0AColorFra);
+ v0AFraR38->SetLineColor(kV0AColorFra); v0AFraR48->SetLineColor(kV0AColorFra);
+ v0AFraR58->SetLineColor(kV0AColorFra);
+ v0AFra8->AddNode(v0AFraR18,1);
+ v0AFra8->AddNode(v0AFraR28,1);
+ v0AFra8->AddNode(v0AFraR38,1);
+ v0AFra8->AddNode(v0AFraR48,1);
+ v0AFra8->AddNode(v0AFraR58,1);
+ v0ASec8->AddNode(v0AFra8,1);
+
+ /// Sensitive scintilator
+ TGeoVolume *v0ASci8 = new TGeoVolumeAssembly("V0ASci8");
+ new TGeoTubeSeg( "sV0AR1b8", fV0AR0+fV0AFraWd/2.,
+ fV0AR1-fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
+ new TGeoTubeSeg( "sV0AR2b8", fV0AR1+fV0AFraWd/2.,
+ fV0AR2-fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
+ new TGeoTubeSeg( "sV0AR3b8", fV0AR2+fV0AFraWd/2.,
+ fV0AR3-fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
+ new TGeoTubeSeg( "sV0AR4b8", fV0AR3+fV0AFraWd/2.,
+ fV0AR4-fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
+ TGeoCompositeShape *sV0AR18 = new TGeoCompositeShape("sV0AR18","sV0AR1b8-sV0ACha8");
+ TGeoCompositeShape *sV0AR28 = new TGeoCompositeShape("sV0AR28","sV0AR2b8-sV0ACha8");
+ TGeoCompositeShape *sV0AR38 = new TGeoCompositeShape("sV0AR38","sV0AR3b8-sV0ACha8");
+ TGeoCompositeShape *sV0AR48 = new TGeoCompositeShape("sV0AR48","sV0AR4b8-sV0ACha8");
+ TGeoVolume *v0L18 = new TGeoVolume("V0L18",sV0AR18,medV0ASci);
+ TGeoVolume *v0L28 = new TGeoVolume("V0L28",sV0AR28,medV0ASci);
+ TGeoVolume *v0L38 = new TGeoVolume("V0L38",sV0AR38,medV0ASci);
+ TGeoVolume *v0L48 = new TGeoVolume("V0L48",sV0AR48,medV0ASci);
+ v0L18->SetLineColor(kV0AColorSci); v0L28->SetLineColor(kV0AColorSci);
+ v0L38->SetLineColor(kV0AColorSci); v0L48->SetLineColor(kV0AColorSci);
+ v0ASci8->AddNode(v0L18,1);
+ v0ASci8->AddNode(v0L28,1);
+ v0ASci8->AddNode(v0L38,1);
+ v0ASci8->AddNode(v0L48,1);
+
+ /// Segment of octagon
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = fV0AR6; v0APts[1+8*i] = 0.;
+ v0APts[2+8*i] = fV0AR7*cos654; v0APts[3+8*i] = -fV0AR7*sin654;
+ v0APts[4+8*i] = (fV0AR7-fV0AOctH2)*cos654; v0APts[5+8*i] = -(fV0AR7-fV0AOctH2)*sin654;
+ v0APts[6+8*i] = fV0AR6-fV0AOctH2; v0APts[7+8*i] = 0.;
+ }
+ new TGeoArb8("sV0AOct28", (fV0ASciWd+2*fV0AOctWd)/2., v0APts);
+ TGeoCompositeShape *sV0AOct2FEEB8 = new TGeoCompositeShape("sV0AOct2FEEB8","sV0AOct28-sV0AFicFEEBSec1:posFicFEEBSec1-sV0AFicOct2Sec1:posFicOct2Sec1");
+ TGeoVolume *v0AOct28 = new TGeoVolume("V0AOct28", sV0AOct2FEEB8,medV0ASup);
+ v0AOct28->SetLineColor(kV0AColorOct);
+ TGeoVolume *v0ASup8 = new TGeoVolumeAssembly("V0ASup8");
+ v0ASup8->AddNode(v0AOct28,1);
+ v0ASec8->AddNode(v0ASup8,1);
+
+ //Bunch of fibers
+ v0APts[ 0] = v0APts[ 2] = -14.0;
+ v0APts[ 1] = v0APts[ 7] = (fV0ASciWd+fV0AOctWd)/2.-0.01;
+ v0APts[ 3] = v0APts[ 5] = (fV0ASciWd+fV0AOctWd)/2.+0.01;
+ v0APts[ 4] = v0APts[ 6] = +14.0;
+ v0APts[ 8] = v0APts[10] = -10.0;
+ v0APts[ 9] = v0APts[15] = 0.;
+ v0APts[11] = v0APts[13] = 0.25;
+ v0APts[12] = v0APts[14] = +10.0;
+ new TGeoArb8("sV0AFib18", 11.8, v0APts);
+ rot = new TGeoRotation("rot");
+ rot->RotateX(-90);
+ rot->RotateZ(-90-22.5);
+ TGeoCombiTrans *fib18pos = new TGeoCombiTrans("fib18pos", (fV0AR6-fV0AOctH2+fV0AR5)*cos225/2. - 3.3, -(fV0AR6-fV0AOctH2+fV0AR5)*sin225/2. + 1.5, 0, rot);
+ fib18pos->RegisterYourself();
+ TGeoCompositeShape *sV0AFib18Hole = new TGeoCompositeShape("sV0AFib18Hole", "sV0AFib18:fib18pos-sV0AFicR58");
+ TGeoVolume *v0AFib18Hole = new TGeoVolume("V0AFib18",sV0AFib18Hole,medV0AFib);
+ v0AFib18Hole->SetLineColor(kV0AColorFib);
+ new TGeoArb8("sV0AFib28", 11.8, v0APts);
+ rot = new TGeoRotation("rot");
+ rot->RotateX(-90);
+ rot->RotateY(180);
+ rot->RotateZ(-90-22.5);
+ TGeoCombiTrans *fib28pos = new TGeoCombiTrans("fib28pos", (fV0AR6-fV0AOctH2+fV0AR5)*cos225/2. - 3.3, -(fV0AR6-fV0AOctH2+fV0AR5)*sin225/2. + 1.5, 0, rot);
+ fib28pos->RegisterYourself();
+ TGeoCompositeShape *sV0AFib28Hole = new TGeoCompositeShape("sV0AFib28Hole", "sV0AFib28:fib28pos-sV0AFicR58");
+ TGeoVolume *v0AFib28Hole = new TGeoVolume("V0AFib28Hole",sV0AFib28Hole,medV0AFib);
+ v0AFib28Hole->SetLineColor(kV0AColorFib);
+ TGeoVolume *v0AFib8 = new TGeoVolumeAssembly("V0AFib8");
+ v0AFib8->AddNode(v0AFib18Hole,1);
+ v0AFib8->AddNode(v0AFib28Hole,1);
+ v0ASec8->AddNode(v0AFib8,1);
+
+ /// Non-sensitive scintilator
+ new TGeoTubeSeg("sV0AR5S28", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape8, 315.0, 360.0);
+ TGeoCompositeShape *sV0AR58 = new TGeoCompositeShape("V0AR58","sV0AR5S28 - sV0ACha8");
+ TGeoVolume *v0AR58 = new TGeoVolume("V0AR58",sV0AR58,medV0ASci);
+ v0AR58->SetLineColor(kV0AColorSci);
+ v0ASci8->AddNode(v0AR58,1);
+ v0ASec8->AddNode(v0ASci8,1);
+
+ /// Plates
+ for (int i=0;i<2;i++) {
+ v0APts[0+8*i] = fV0AR0; v0APts[1+8*i] = 0.;
+ v0APts[2+8*i] = fV0AR6; v0APts[3+8*i] = 0.;
+ v0APts[4+8*i] = fV0AR7*cos654; v0APts[5+8*i] = -fV0AR7*sin654;
+ v0APts[6+8*i] = fV0AR0*cos654; v0APts[7+8*i] = -fV0AR0*sin654;
+ }
+ new TGeoArb8("sV0APlaIn8", (fV0APlaWd-2*fV0APlaAl)/2., v0APts);
+ TGeoCompositeShape *sV0APlaInNailsHoles8 = new TGeoCompositeShape("sV0APlaInNailsHoles8","sV0APlaIn8-sV0ANailsPlaInHoles8-sV0AFicFEEBSec1:posFicFEEBSec1");
+ TGeoVolume *v0APlaInNailsHoles8 = new TGeoVolume("V0APlaInNailsHoles8", sV0APlaInNailsHoles8, medV0APlaIn);
+ new TGeoArb8("sV0APlaOu8", fV0APlaAl/2., v0APts);
+ TGeoCompositeShape *sV0APlaOuNailsHoles8 = new TGeoCompositeShape("sV0APlaOuNailsHoles8","sV0APlaOu8-sV0ANailsPlaOuHoles8-sV0AFicFEEBSec1:posFicFEEBSec1");
+ TGeoVolume *v0APlaOuNailsHoles8 = new TGeoVolume("V0APlaOuNailsHoles8", sV0APlaOuNailsHoles8, medV0APlaOu);
+ v0APlaInNailsHoles8->SetLineColor(kV0AColorPlaIn); v0APlaOuNailsHoles8->SetLineColor(kV0AColorPlaOu);
+ TGeoVolume *v0APla8 = new TGeoVolumeAssembly("V0APla8");
+ v0APla8->AddNode(v0APlaInNailsHoles8,1);
+ v0APla8->AddNode(v0APlaOuNailsHoles8,1,new TGeoTranslation(0,0,(fV0APlaWd-fV0APlaAl)/2.));
+ v0APla8->AddNode(v0APlaOuNailsHoles8,2,new TGeoTranslation(0,0,-(fV0APlaWd-fV0APlaAl)/2.));
+ v0ASec8->AddNode(v0APla8,1,new TGeoTranslation(0,0,(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
+ v0ASec8->AddNode(v0APla8,2,new TGeoTranslation(0,0,-(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
+
+ /// PMBox
+ TGeoVolume* v0APM8 = new TGeoVolumeAssembly("V0APM1");
+ new TGeoBBox("sV0APMB18", fV0APMBWd/2., fV0APMBHt/2., fV0APMBTh/2.);
+ new TGeoBBox("sV0APMB28", fV0APMBWd/2.-fV0APMBWdW, fV0APMBHt/2.-fV0APMBHtW, fV0APMBTh/2.-fV0APMBThW);
+ TGeoCompositeShape *sV0APMB8 = new TGeoCompositeShape("sV0APMB8","sV0APMB18-sV0APMB28");
+ TGeoVolume *v0APMB8 = new TGeoVolume("V0APMB8",sV0APMB8, medV0APMAlum);
+ v0APMB8->SetLineColor(kV0AColorPMA);
+ v0APM8->AddNode(v0APMB8,1);
+
+ /// PMTubes
+ TGeoTube *sV0APMT18 = new TGeoTube("sV0APMT18", fV0APMTR1, fV0APMTR2, fV0APMTH/2.);
+ TGeoVolume *v0APMT18 = new TGeoVolume("V0APMT18", sV0APMT18, medV0APMGlass);
+ TGeoTube *sV0APMT28 = new TGeoTube("sV0APMT28", fV0APMTR3, fV0APMTR4, fV0APMTH/2.);
+ TGeoVolume *v0APMT28 = new TGeoVolume("V0APMT28", sV0APMT28, medV0APMAlum);
+ TGeoVolume *v0APMT8 = new TGeoVolumeAssembly("V0APMT8");
+ TGeoTube *sV0APMTT8 = new TGeoTube("sV0APMTT8", 0., fV0APMTR4, fV0APMTB/2.);
+ TGeoVolume *v0APMTT8 = new TGeoVolume("V0APMTT8", sV0APMTT8, medV0APMAlum);
+ v0APMT8->SetLineColor(kV0AColorPMG);
+ v0APMT28->SetLineColor(kV0AColorPMA);
+ v0APMTT8->SetLineColor(kV0AColorPMA);
+ rot = new TGeoRotation("rot", 90, 0, 180, 0, 90, 90);
+ v0APMT8->AddNode(v0APMT18,1,rot);
+ v0APMT8->AddNode(v0APMT28,1,rot);
+ v0APMT8->AddNode(v0APMTT8,1,new TGeoCombiTrans(0,(fV0APMTH+fV0APMTB)/2.,0,rot));
+ double autoShift8 = (fV0APMBWd-2*fV0APMBWdW)/4.;
+ v0APM8->AddNode(v0APMT8, 1, new TGeoTranslation(-1.5*autoShift8, 0, 0));
+ v0APM8->AddNode(v0APMT8, 2, new TGeoTranslation(-0.5*autoShift8, 0, 0));
+ v0APM8->AddNode(v0APMT8, 3, new TGeoTranslation(+0.5*autoShift8, 0, 0));
+ v0APM8->AddNode(v0APMT8, 4, new TGeoTranslation(+1.5*autoShift8, 0, 0));
+
+ /// PM
+ rot = new TGeoRotation("rot");
+ rot->RotateX(-90+30);
+ rot->RotateY(0);
+ rot->RotateZ(65+3);
+ double shiftZ8 = fV0APMBHt/2. * cosAngPMBSec1
+ - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0APMBTh/2. * sinAngPMBSec1;
+ double shiftR8 = fV0AR6 + fV0AOctH2 + fV0APlaAl;
+ v0ASec8->AddNode(v0APM8,1, new TGeoCombiTrans( shiftR8*cos225 + 1.3, -shiftR8*sin225, shiftZ8, rot));
+
+ // Aluminium nails
+ TGeoTube *sV0ANail81 = new TGeoTube("sV0ANail81", 0.0, 0.4, 5.09/2.);
+ TGeoVolume *v0ANail81 = new TGeoVolume("V0ANail81", sV0ANail81, medV0APMAlum);
+ v0ANail81->SetLineColor(kV0AColorPMA);// this is the color for aluminium
+ v0ASec8->AddNode(v0ANail81,1,new TGeoTranslation(42.9,-.51,0.0));
+ TGeoTube *sV0ANail82 = new TGeoTube("sV0ANail82", 0.0, 0.4, 5.09/2.);
+ TGeoVolume *v0ANail82 = new TGeoVolume("V0ANail82", sV0ANail82, medV0APMAlum);
+ v0ANail82->SetLineColor(kV0AColorPMA);
+ v0ASec8->AddNode(v0ANail82,1,new TGeoTranslation(30.8,-30.04,0.0));
+
+ // Adding sector to v0LE volume
+ v0LE->AddNode(v0ASec8, 1);
+