63 new TGeoManager(
"Gflash_geometry",
"Gflash VMC example geometry");
68 TGeoElement* elN =
new TGeoElement(
"Nitrogen",
"N", z = 7., a = 14.01);
69 TGeoElement* elO =
new TGeoElement(
"Oxygen",
"O", z = 8., a = 16.00);
70 TGeoElement* elW =
new TGeoElement(
"Tungsten",
"W", z = 74., a = 183.84);
71 TGeoElement* elPb =
new TGeoElement(
"Lead",
"Pb", z = 82., a = 207.2);
77 TGeoMixture* matAir =
new TGeoMixture(
"AirA", 2, density = 1.29e-03);
78 matAir->AddElement(elN, 0.7);
79 matAir->AddElement(elO, 0.3);
82 TGeoMixture* matAir2 =
new TGeoMixture(
"AirB", 2, density = 1.29e-03);
83 matAir2->AddElement(elN, 0.7);
84 matAir2->AddElement(elO, 0.3);
87 TGeoMixture* matPbWO4 =
new TGeoMixture(
"PbWO4", 3, density = 8.28);
88 matPbWO4->AddElement(elO, 4);
89 matPbWO4->AddElement(elW, 1);
90 matPbWO4->AddElement(elPb, 1);
105 for (Int_t i = 8; i < 20; ++i) param[i] = 0.;
108 TGeoMedium* medAir =
new TGeoMedium(
"AirA", ++mediumId, matAir, param);
109 TGeoMedium* medAir2 =
new TGeoMedium(
"AirB", ++mediumId, matAir2, param);
110 TGeoMedium* medPbWO4 =
new TGeoMedium(
"PbWO4", ++mediumId, matPbWO4, param);
116 Double_t experimentalHall_x = 1000.;
117 Double_t experimentalHall_y = 1000.;
118 Double_t experimentalHall_z = 1000.;
120 TGeoShape* experimentalHall_box =
new TGeoBBox(
"expHall_box",
125 TGeoVolume* experimentalHall_log =
126 new TGeoVolume(
"ExpHall_log", experimentalHall_box, medAir);
127 gGeoManager->SetTopVolume(experimentalHall_log);
134 Int_t nbOfCrystals = 10;
140 Double_t crystalWidth = 3.;
141 Double_t crystalLenght = 24.;
142 Double_t calo_xside = (crystalWidth * nbOfCrystals) + 1.;
143 Double_t calo_yside = (crystalWidth * nbOfCrystals) + 1.;
144 Double_t calo_zside = crystalLenght;
146 TGeoShape* calo_box =
new TGeoBBox(
"CMS_calorimeter",
148 calo_yside / 2., calo_zside / 2.);
149 TGeoVolume* calo_log =
new TGeoVolume(
"Calo_log", calo_box, medAir2);
153 Double_t Zpos = 100.0;
159 experimentalHall_log->AddNode(
160 calo_log, 1,
new TGeoTranslation(Xpos, Ypos, Zpos));
162 TGeoShape* crystal_box =
new TGeoBBox(
163 "Crystal", crystalWidth / 2, crystalWidth / 2, crystalLenght / 2);
164 TGeoVolume* crystal_log =
165 new TGeoVolume(
"Crystal_log", crystal_box, medPbWO4);
167 for (Int_t i = 0; i < nbOfCrystals; i++) {
168 for (Int_t j = 0; j < nbOfCrystals; j++) {
169 Int_t n = i * nbOfCrystals + j;
171 Double_t crystalPos_x = (i * crystalWidth) - 13.5;
172 Double_t crystalPos_y = (j * crystalWidth) - 13.5;
173 Double_t crystalPos_z = 0;
174 calo_log->AddNode(crystal_log, n,
175 new TGeoTranslation(crystalPos_x, crystalPos_y, crystalPos_z));
180 gGeoManager->CloseGeometry();
183 gMC->SetRootGeometry();
185 cout <<
"There are " << nbOfCrystals
186 <<
" crystals per row in the calorimeter, so in total "
187 << nbOfCrystals * nbOfCrystals <<
" crystals" << endl;
188 cout <<
"The have width of " << crystalWidth <<
" cm and a lenght of "
189 << crystalLenght <<
" cm. The Material is PbWO4" << endl;