28 Double_t cellLength = 200.0;
29 Double_t alveoleThickness = 0.2;
31 Double_t cellEnvelopeWidth = cellFaceSize + 2*alveoleThickness;
33 Double_t cellEnvelopeLength = cellLength + 2*alveoleThickness;
39 calo->SetTopVolumeTransformation(
new TGeoTranslation(0.0, 0.0, 0.1 * beamLineOffset));
43 unsigned lgroup = calo->AddLogicalVolumeGroup(cellNum, cellNum);
47 auto alveole =
new TGeoBBox(
"CaloCellAlveole",
48 0.1 * cellEnvelopeWidth/2,
49 0.1 * cellEnvelopeWidth/2,
50 0.1 * cellEnvelopeLength/2);
52 auto valveole =
new TGeoVolume(
"CaloCellAlveole", alveole, calo->GetMedium(
"CarbonFiber"));
55 auto crystal =
new TGeoBBox(
"CaloCrystal",
59 auto vcrystal =
new TGeoVolume(
"CaloCrystal", crystal, calo->GetMedium(
"pwo"));
62 valveole->AddNode(vcrystal, 0,
new TGeoCombiTrans(0.0, 0.0, 0.0,
new TGeoRotation()));
71 auto gmapCr = calo->CreateNewMap();
73 gmapCr->AddGeantVolumeLevel(
"CaloCrystal", 1);
74 gmapCr->AddGeantVolumeLevel(
"CaloCellAlveole", cellNum * cellNum);
75 gmapCr->SetSingleSensorContainerVolume(
"CaloCellAlveole");
79 auto gmapAl = calo->CreateNewMap();
81 gmapAl->AddGeantVolumeLevel(
"CaloCellAlveole", cellNum * cellNum);
82 gmapAl->SetSingleSensorContainerVolume(
"CaloCellAlveole");
86 unsigned tcounter = 0;
87 for(
unsigned ix=0; ix<cellNum; ix++)
89 double xx = cellEnvelopeWidth*(ix - (cellNum-1)/2.);
91 for(
unsigned iy=0; iy<cellNum; iy++)
93 double yy = cellEnvelopeWidth*(iy - (cellNum-1)/2.);
97 UInt_t
id[2] = {0, tcounter}, logical[2] = {ix, iy};
98 if (calo->SetMappingTableEntry(gmapCr,
id+0, lgroup, logical) ||
99 calo->SetMappingTableEntry(gmapAl,
id+1, lgroup, logical)) {
100 cout <<
"Failed to set mapping table entry!" << endl;
114 calo->GetTopVolume()->AddNode(valveole, tcounter++,
115 new TGeoCombiTrans(0.1 * xx, 0.1 * yy, 0.0,
new TGeoRotation()));
119 calo->GetColorTable()->AddExactMatch (
"CaloCrystal", kBlue);
120 calo->GetTransparencyTable()->AddExactMatch(
"CaloCrystal", 50);
125 calo->FinalizeOutput();