14#include "FairRootManager.h"
15#include "FairVolume.h"
22#include "TGeoManager.h"
23#include "TGeoVolume.h"
26#include "TGeoCompositeShape.h"
27#include "TVirtualMC.h"
33#ifdef ZDC_FASTSIM_ONNX
42#define kRaddeg TMath::RadToDeg()
47 mHits(new
std::vector<
o2::zdc::
Hit>),
48 mXImpact(-999, -999, -999),
70#ifdef ZDC_FASTSIM_ONNX
75 if (!simparam.useZDCFastSim) {
76 LOG(info) <<
"FastSim module disabled";
77 }
else if (simparam.useZDCFastSim && !simparam.ZDCFastSimClassifierPath.empty() && !simparam.ZDCFastSimClassifierScales.empty()) {
78 if (!mClassifierScaler) {
81 if (!mModelScalerNeutron) {
84 if (!mModelScalerProton) {
88 if (!eonScales.has_value()) {
89 LOG(error) <<
"Error while reading model scales from: "
90 <<
"'" << simparam.ZDCFastSimClassifierScales <<
"'";
91 LOG(error) <<
"FastSim module disabled.";
93 mClassifierScaler->setScales(eonScales->first, eonScales->second);
96 if (simparam.useZDCFastSim && !simparam.ZDCFastSimModelPathNeutron.empty() && !simparam.ZDCFastSimModelScalesNeutron.empty()) {
99 if (!modelScalesNeutron.has_value()) {
100 LOG(error) <<
"Error while reading model scales from: "
101 <<
"'" << simparam.ZDCFastSimModelScalesNeutron <<
"'";
102 LOG(error) <<
"FastSim module disabled";
104 mModelScalerNeutron->setScales(modelScalesNeutron->first, modelScalesNeutron->second);
106 LOG(info) <<
"FastSim neutron module enabled";
109 if (simparam.useZDCFastSim && !simparam.ZDCFastSimModelPathProton.empty() && !simparam.ZDCFastSimModelScalesProton.empty()) {
112 if (!modelScalesProton.has_value()) {
113 LOG(error) <<
"Error while reading model scales from: "
114 <<
"'" << simparam.ZDCFastSimModelScalesProton <<
"'";
115 LOG(error) <<
"FastSim module disabled";
117 mModelScalerProton->setScales(modelScalesProton->first, modelScalesProton->second);
119 LOG(info) <<
"FastSim proton module enabled";
135#ifdef ZDC_FASTSIM_ONNX
138 delete (mFastSimClassifier);
139 delete (mFastSimModelNeutron);
140 delete (mFastSimModelProton);
141 delete (mClassifierScaler);
142 delete (mModelScalerNeutron);
143 delete (mModelScalerProton);
159 if (input.is_open()) {
160 while (input >>
value) {
162 table[beta][anglebin][radiusbin] =
value;
165 if (radiusbin % NRADBINS == 0) {
184 defineSensitiveVolumes();
186 std::string inputDir;
187 const char* aliceO2env = std::getenv(
"O2_ROOT");
189 inputDir = std::string(aliceO2env);
191 inputDir +=
"/share/Detectors/ZDC/simulation/data/";
193 loadLightTable(mLightTableZN, 0, ZNRADIUSBINS, inputDir +
"light22620362207s");
194 loadLightTable(mLightTableZN, 1, ZNRADIUSBINS, inputDir +
"light22620362208s");
195 loadLightTable(mLightTableZN, 2, ZNRADIUSBINS, inputDir +
"light22620362209s");
196 auto elements =
loadLightTable(mLightTableZN, 3, ZNRADIUSBINS, inputDir +
"light22620362210s");
197 assert(elements == ZNRADIUSBINS * ANGLEBINS);
206 loadLightTable(mLightTableZP, 0, ZPRADIUSBINS, inputDir +
"light22620552207s");
207 loadLightTable(mLightTableZP, 1, ZPRADIUSBINS, inputDir +
"light22620552208s");
208 loadLightTable(mLightTableZP, 2, ZPRADIUSBINS, inputDir +
"light22620552209s");
209 elements =
loadLightTable(mLightTableZP, 3, ZPRADIUSBINS, inputDir +
"light22620552210s");
210 assert(elements == ZPRADIUSBINS * ANGLEBINS);
216 LOG(
debug) <<
"Creating ZDC geometry\n";
220 createAsideBeamLine();
221 createCsideBeamLine();
227void Detector::defineSensitiveVolumes()
229 LOG(info) <<
"defining sensitive for ZDC";
230 auto vol = gGeoManager->GetVolume(
"ZNENV");
232 AddSensitiveVolume(vol);
233 mZNENVVolID = vol->GetNumber();
235 AddSensitiveVolume(gGeoManager->GetVolume(
"ZNF1"));
236 AddSensitiveVolume(gGeoManager->GetVolume(
"ZNF2"));
237 AddSensitiveVolume(gGeoManager->GetVolume(
"ZNF3"));
238 AddSensitiveVolume(gGeoManager->GetVolume(
"ZNF4"));
240 LOG(fatal) <<
"can't find volume ZNENV";
242 vol = gGeoManager->GetVolume(
"ZPENV");
244 AddSensitiveVolume(vol);
245 mZPENVVolID = vol->GetNumber();
247 AddSensitiveVolume(gGeoManager->GetVolume(
"ZPF1"));
248 AddSensitiveVolume(gGeoManager->GetVolume(
"ZPF2"));
249 AddSensitiveVolume(gGeoManager->GetVolume(
"ZPF3"));
250 AddSensitiveVolume(gGeoManager->GetVolume(
"ZPF4"));
252 LOG(fatal) <<
"can't find volume ZPENV";
255 vol = gGeoManager->GetVolume(
"ZEM ");
257 AddSensitiveVolume(vol);
258 mZEMVolID = vol->GetNumber();
259 AddSensitiveVolume(gGeoManager->GetVolume(
"ZEMF"));
261 LOG(fatal) <<
"can't find volume ZEM";
269 if (volname.BeginsWith(
"ZN")) {
276 }
else if (
x.Z() < 0) {
281 if (xDet.X() <= 0.) {
282 if (xDet.Y() <= 0.) {
288 if (xDet.Y() <= 0.) {
296 }
else if (volname.BeginsWith(
"ZP")) {
301 }
else if (
x.Z() < 0) {
314 for (
int i = 1;
i <= 4;
i++) {
315 if (xTow >= (
i - 3) && xTow < (
i - 2)) {
322 }
else if (volname.BeginsWith(
"ZE")) {
326 sector = (
x.X() > 0.) ?
Ch1 :
Ch2;
334void Detector::resetHitIndices()
337 for (
int det = 0; det < NUMDETS; ++det) {
338 for (
int sec = 0; sec < NUMSECS; ++sec) {
339 mCurrentHitsIndices[det][sec] = -1;
347void Detector::flushSpatialResponse()
351 std::fstream
output(
"o2sim-FullSimResult", std::fstream::out | std::fstream::app);
352 output <<
c[0] <<
" " <<
c[1] <<
" " <<
c[2] <<
" " <<
c[3] <<
" " <<
c[4] <<
"\n";
357 mResponses.push_back(std::make_pair(mCurrentPrincipalParticle,
358 std::make_pair(mNeutronResponseImage, mProtonResponseImage)));
360 mNeutronResponseImage.
reset();
361 mProtonResponseImage.
reset();
371 const auto m = part.GetMass();
372 constexpr auto SPEED_OF_LIGHT = 299792458.;
374 return z / SPEED_OF_LIGHT;
376 TLorentzVector lorentz;
377 part.Momentum(lorentz);
378 const auto gamma = lorentz.Gamma();
379 const auto speed = SPEED_OF_LIGHT * std::sqrt(1. - 1. / (gamma * gamma));
388 TString volname = fMC->CurrentVolName();
389 float x[3] = {0., 0., 0.};
390 fMC->TrackPosition(
x[0],
x[1],
x[2]);
399 int trackn =
stack->GetCurrentTrackNumber();
403 volID = fMC->CurrentVolID(copy);
409 if ((fMC->CurrentMedium() == mMediumPMCid) && (detector !=
ZEM)) {
415 if ((volID == mZNENVVolID || volID == mZPENVVolID || volID == mZEMVolID)) {
421 float p[3] = {0., 0., 0.};
422 float trackenergy = 0.;
423 fMC->TrackMomentum(p[0], p[1], p[2], trackenergy);
424 float eDep = fMC->Edep();
426 int pdgCode = fMC->TrackPid();
427 float lightoutput = 0.;
428 auto currentMediumid = fMC->CurrentMedium();
430 if (((currentMediumid == mMediumPMCid) || (currentMediumid == mMediumPMQid))) {
432 int ibeta = 0, iangle = 0, iradius = 0;
433 Bool_t isLightProduced = calculateTableIndexes(ibeta, iangle, iradius);
434 if (isLightProduced) {
436 if (pdgCode < 10000) {
437 charge = fMC->TrackCharge();
439 charge = TMath::Abs(pdgCode / 10000 - 100000);
443 if (TMath::Abs(
charge) > 0) {
444 if (detector == 1 || detector == 4) {
446 lightoutput =
charge *
charge * mLightTableZN[ibeta][iangle][iradius];
450 lightoutput =
charge *
charge * mLightTableZP[ibeta][iangle][iradius];
453 if (lightoutput > 0) {
454 nphe = gRandom->Poisson(lightoutput);
462 auto tof = 1.e09 * fMC->TrackTime();
467 if (detector ==
ZNA || detector ==
ZNC) {
472 if (detector ==
ZPA || detector ==
ZPC) {
481 if (mCurrentHitsIndices[detector - 1][sector] == -1) {
482 bool issecondary = trackn !=
stack->getCurrentPrimaryIndex();
485 mTotLightPMC = mTotLightPMQ = 0;
486 if (currentMediumid == mMediumPMCid) {
488 }
else if (currentMediumid == mMediumPMQid) {
494 addHit(trackn, mLastPrincipalTrackEntered, issecondary, trackenergy, detector, sector,
495 pos, mom, tof, xImp, eDep, mTotLightPMC, mTotLightPMQ);
496 stack->addHit(GetDetId());
497 mCurrentHitsIndices[detector - 1][sector] = mHits->size() - 1;
505 auto& curHit = (*mHits)[mCurrentHitsIndices[detector - 1][sector]];
507 curHit.setNoNumContributingSteps(curHit.getNumContributingSteps() + 1);
508 int nPMC{0}, nPMQ{0};
509 if (currentMediumid == mMediumPMCid) {
510 mTotLightPMC += nphe;
512 }
else if (currentMediumid == mMediumPMQid) {
513 mTotLightPMQ += nphe;
516 float incenloss = curHit.GetEnergyLoss() + eDep;
518 curHit.SetEnergyLoss(incenloss);
519 curHit.setPMCLightYield(curHit.getPMCLightYield() + nPMC);
520 curHit.setPMQLightYield(curHit.getPMQLightYield() + nPMQ);
536 const int Nx =
image.getNx();
537 const int Ny =
image.getNy();
541 auto determineSectorID = [Nx, Ny](
int detector,
int x,
int y) {
542 if (detector ==
ZNA || detector ==
ZNC) {
543 if ((
x +
y) % 2 == 0) {
561 if (detector ==
ZPA || detector ==
ZPC) {
562 if ((
x +
y) % 2 == 0) {
565 auto i = (
int)(4.f *
x / Nx);
571 auto determineMediumID = [
this](
int detector,
int x,
int y) {
573 return ((
x +
y) % 2 == 0) ? mMediumPMCid : mMediumPMQid;
577 for (
int x = 0;
x < Nx; ++
x) {
579 for (
int y = 0;
y < Ny; ++
y) {
581 int sector = determineSectorID(detector,
x,
y);
583 int currentMediumid = determineMediumID(detector,
x,
y);
587 float trackenergy = 0;
588 createOrAddHit(detector,
598 0. , 0 , 0. , 0. , 0. , 0. , 0. );
607 double energyloss, int32_t nphePMC, int32_t nphePMQ)
609 LOG(debug4) <<
"Adding hit for track " << trackID <<
" X (" <<
pos.X() <<
", " <<
pos.Y() <<
", "
610 <<
pos.Z() <<
") P (" << mom.X() <<
", " << mom.Y() <<
", " << mom.Z() <<
") Ekin "
611 << primaryEnergy <<
" lightPMC " << nphePMC <<
" lightPMQ " << nphePMQ << std::endl;
612 mHits->emplace_back(trackID, parentID, sFlag, primaryEnergy, detID, secID,
pos, mom,
613 tof, xImpact, energyloss, nphePMC, nphePMQ);
614 return &(mHits->back());
623 LOG(info) <<
"Detector::CreateMaterials >>>>> magnetic field: type " << ifield <<
" max " << fieldm <<
"\n";
627 float aW[3] = {183.85, 55.85, 58.71};
628 float zW[3] = {74., 26., 28.};
629 float wW[3] = {0.93, 0.03, 0.04};
633 float aCuZn[2] = {63.546, 65.39};
634 float zCuZn[2] = {29., 30.};
635 float wCuZn[2] = {0.63, 0.37};
639 float aq[2] = {28.0855, 15.9994};
640 float zq[2] = {14., 8.};
641 float wq[2] = {1., 2.};
648 float radPb = 6.37 / dPb;
649 float absPb = 199.6 / dPb;
655 float radCu = 12.86 / dCu;
656 float absCu = 137.3 / dCu;
663 float radFe = 13.84 / dFe;
664 float absFe = 132.1 / dFe;
670 float radAl = 24.01 / dAl;
671 float absAl = 107.2 / dAl;
677 float radCarb = 18.8;
678 float absCarb = 49.9;
681 float aResGas[3] = {1.008, 12.0107, 15.9994};
682 float zResGas[3] = {1., 6., 8.};
683 float wResGas[3] = {0.28, 0.28, 0.44};
684 float dResGas = 3.2E-14;
687 float aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
688 float zAir[4] = {6., 7., 8., 18.};
689 float wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
690 float dAir = 1.20479E-3;
693 int32_t notactiveMed = 0, sensMed = 1;
710 Mixture(0,
"Walloy$", aW, zW, dW, 3, wW);
711 Mixture(1,
"CuZn$", aCuZn, zCuZn, dCuZn, 2, wCuZn);
712 Mixture(2,
"SiO2$", aq, zq, dq, -2, wq);
713 Material(3,
"Pb $", aPb, zPb, dPb, radPb, absPb);
714 Material(4,
"Cu $", aCu, zCu, dCu, radCu, absCu);
715 Material(5,
"Fe $", aFe, zFe, dFe, radFe, absFe);
716 Material(6,
"Al $", aAl, zAl, dAl, radAl, absAl);
717 Material(7,
"graphite$", aCarb, zCarb, dCarb, radCarb, absCarb);
718 Mixture(8,
"residualGas$", aResGas, zResGas, dResGas, 3, wResGas);
719 Mixture(9,
"Air$", aAir, zAir, dAir, 4, wAir);
722 Medium(
kWalloy,
"Walloy$", 0, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
723 Medium(
kCuZn,
"CuZn$", 1, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
724 Medium(
kSiO2pmc,
"quartzPMC$", 2, sensMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
725 Medium(
kSiO2pmq,
"quartzPMQ$", 2, sensMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
726 Medium(
kPb,
"Lead$", 3, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
727 Medium(
kCu,
"Copper$", 4, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
728 Medium(
kCuLumi,
"CopperLowTh$", 4, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
729 Medium(
kFe,
"Iron$", 5, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
730 Medium(
kFeLowTh,
"IronLowTh$", 5, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
731 Medium(
kAl,
"Aluminum$", 6, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
732 Medium(
kGraphite,
"Graphite$", 7, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
733 Medium(
kVoidNoField,
"VoidNoField$", 8, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
734 Medium(
kVoidwField,
"VoidwField$", 8, notactiveMed, ifld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
735 Medium(
kAir,
"Air$", 9, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
739void Detector::createAsideBeamLine()
742 double tubpar[3] = {0., 0., 0};
743 float boxpar[3] = {0., 0., 0};
744 double tubspar[5] = {0., 0., 0., 0., 0.};
745 double conpar[15] = {0.};
759 TVirtualMC::GetMC()->Gspos(
"ZDCA", 1,
"cave", 0., 0., 0., 0,
"ONLY");
762 tubpar[0] = 6.0 / 2.;
763 tubpar[1] = 6.4 / 2.;
764 tubpar[2] = (386.28 - 0.18) / 2.;
765 TVirtualMC::GetMC()->Gsvolu(
"QA01",
"TUBE",
getMediumID(
kFe), tubpar, 3);
766 TVirtualMC::GetMC()->Gspos(
"QA01", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
768 zA += 2. * tubpar[2];
771 tubpar[0] = 6.3 / 2.;
772 tubpar[1] = 6.7 / 2.;
773 tubpar[2] = 3541.8 / 2.;
774 TVirtualMC::GetMC()->Gsvolu(
"QA02",
"TUBE",
getMediumID(
kFe), tubpar, 3);
775 TVirtualMC::GetMC()->Gspos(
"QA02", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
777 zA += 2. * tubpar[2];
787 tubpar[0] = 6.75 / 2.;
788 tubpar[1] = 7.15 / 2.;
789 tubpar[2] = (945.0 + 80.1) / 2.;
790 TVirtualMC::GetMC()->Gsvolu(
"QA03",
"TUBE",
getMediumID(
kFe), tubpar, 3);
791 TVirtualMC::GetMC()->Gspos(
"QA03", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
793 zA += 2. * tubpar[2];
796 conpar[0] = 2.5 / 2.;
797 conpar[1] = 6.75 / 2.;
798 conpar[2] = 7.15 / 2.;
799 conpar[3] = 8.0 / 2.;
800 conpar[4] = 8.4 / 2.;
801 TVirtualMC::GetMC()->Gsvolu(
"QA04",
"CONE",
getMediumID(
kFe), conpar, 5);
802 TVirtualMC::GetMC()->Gspos(
"QA04", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
804 zA += 2. * conpar[0];
806 tubpar[0] = 8.0 / 2.;
807 tubpar[1] = 8.4 / 2.;
808 tubpar[2] = (43.9 + 20. + 28.5 + 28.5) / 2.;
809 TVirtualMC::GetMC()->Gsvolu(
"QA05",
"TUBE",
getMediumID(
kFe), tubpar, 3);
810 TVirtualMC::GetMC()->Gspos(
"QA05", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
812 zA += 2. * tubpar[2];
815 conpar[0] = 4.0 / 2.;
816 conpar[1] = 8.0 / 2.;
817 conpar[2] = 8.4 / 2.;
818 conpar[3] = 9.8 / 2.;
819 conpar[4] = 10.2 / 2.;
820 TVirtualMC::GetMC()->Gsvolu(
"QAV1",
"CONE",
getMediumID(
kFe), conpar, 5);
821 TVirtualMC::GetMC()->Gspos(
"QAV1", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
823 zA += 2. * conpar[0];
826 conpar[0] = 1.0 / 2.;
827 conpar[1] = 9.8 / 2.;
828 conpar[2] = 10.2 / 2.;
829 conpar[3] = 9.0 / 2.;
830 conpar[4] = 9.4 / 2.;
831 TVirtualMC::GetMC()->Gsvolu(
"QAV2",
"CONE",
getMediumID(
kFe), conpar, 5);
832 TVirtualMC::GetMC()->Gspos(
"QAV2", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
834 zA += 2. * conpar[0];
837 tubpar[0] = 9.0 / 2.;
838 tubpar[1] = 9.4 / 2.;
839 tubpar[2] = 31.0 / 2.;
840 TVirtualMC::GetMC()->Gsvolu(
"QAV3",
"TUBE",
getMediumID(
kFe), tubpar, 3);
841 TVirtualMC::GetMC()->Gspos(
"QAV3", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
843 zA += 2. * tubpar[2];
848 conpar[0] = 1.3 / 2.;
849 conpar[1] = 9.0 / 2.;
850 conpar[2] = 13.0 / 2.;
851 conpar[3] = 9.6 / 2.;
852 conpar[4] = 13.0 / 2.;
853 TVirtualMC::GetMC()->Gsvolu(
"Q01T",
"CONE",
getMediumID(
kFe), conpar, 5);
854 TVirtualMC::GetMC()->Gspos(
"Q01T", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
856 zA += 2. * conpar[0];
859 tubpar[0] = 9.6 / 2.;
860 tubpar[1] = 10.0 / 2.;
861 tubpar[2] = 1.0 / 2.;
862 TVirtualMC::GetMC()->Gsvolu(
"Q02T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
863 TVirtualMC::GetMC()->Gspos(
"Q02T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
865 zA += 2. * tubpar[2];
868 conpar[0] = 9.04 / 2.;
869 conpar[1] = 9.6 / 2.;
870 conpar[2] = 10.0 / 2.;
871 conpar[3] = 13.8 / 2.;
872 conpar[4] = 14.2 / 2.;
873 TVirtualMC::GetMC()->Gsvolu(
"Q03T",
"CONE",
getMediumID(
kFe), conpar, 5);
874 TVirtualMC::GetMC()->Gspos(
"Q03T", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
876 zA += 2. * conpar[0];
879 tubpar[0] = 13.8 / 2.;
880 tubpar[1] = 14.2 / 2.;
881 tubpar[2] = 38.6 / 2.;
882 TVirtualMC::GetMC()->Gsvolu(
"Q04T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
883 TVirtualMC::GetMC()->Gspos(
"Q04T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
885 zA += 2. * tubpar[2];
888 tubpar[0] = 21.0 / 2.;
889 tubpar[1] = 21.4 / 2.;
890 tubpar[2] = 100.12 / 2.;
891 TVirtualMC::GetMC()->Gsvolu(
"Q05T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
892 TVirtualMC::GetMC()->Gspos(
"Q05T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
894 zA += 2. * tubpar[2];
897 tubpar[0] = 13.8 / 2.;
898 tubpar[1] = 14.2 / 2.;
899 tubpar[2] = 38.6 / 2.;
900 TVirtualMC::GetMC()->Gsvolu(
"Q06T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
901 TVirtualMC::GetMC()->Gspos(
"Q06T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
903 zA += 2. * tubpar[2];
906 conpar[0] = 11.34 / 2.;
907 conpar[1] = 13.8 / 2.;
908 conpar[2] = 14.2 / 2.;
909 conpar[3] = 18.0 / 2.;
910 conpar[4] = 18.4 / 2.;
911 TVirtualMC::GetMC()->Gsvolu(
"Q07T",
"CONE",
getMediumID(
kFe), conpar, 5);
912 TVirtualMC::GetMC()->Gspos(
"Q07T", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
914 zA += 2. * conpar[0];
920 tubspar[0] = 0.0 / 2.;
921 tubspar[1] = 14.0 / 2.;
922 tubspar[2] = 100.0 / 2.;
925 TVirtualMC::GetMC()->Gsvolu(
"Q08T",
"TUBS",
getMediumID(
kFe), tubspar, 5);
928 boxpar[0] = 7.0 / 2.;
929 boxpar[1] = 2.2 / 2.;
930 boxpar[2] = 100. / 2.;
933 TVirtualMC::GetMC()->Gspos(
"Q09T", 1,
"Q08T", 0., 1.1, 0., 0,
"ONLY");
936 tubspar[0] = 0.0 / 2.;
937 tubspar[1] = 14.0 / 2.;
938 tubspar[2] = 100.0 / 2.;
941 TVirtualMC::GetMC()->Gsvolu(
"Q10T",
"TUBS",
getMediumID(
kFe), tubspar, 5);
943 boxpar[0] = 7.0 / 2.;
944 boxpar[1] = 2.2 / 2.;
945 boxpar[2] = 100. / 2.;
948 TVirtualMC::GetMC()->Gspos(
"Q11T", 1,
"Q10T", 0., -1.1, 0., 0,
"ONLY");
952 double TCDDAperturePos = 2.2;
953 double TCDDApertureNeg = 2.4;
954 TVirtualMC::GetMC()->Gspos(
"Q08T", 1,
"ZDCA", 0., TCDDAperturePos, -100. + zA, 0,
"ONLY");
955 TVirtualMC::GetMC()->Gspos(
"Q10T", 1,
"ZDCA", 0., -TCDDApertureNeg, -100. + zA, 0,
"ONLY");
958 boxpar[0] = 0.2 / 2.;
959 boxpar[1] = 4.0 / 2.;
960 boxpar[2] = 100. / 2.;
961 TVirtualMC::GetMC()->Gsvolu(
"Q12T",
"BOX ",
getMediumID(
kFe), boxpar, 3);
963 TVirtualMC::GetMC()->Gspos(
"Q12T", 1,
"ZDCA", tubspar[1] + boxpar[0], 0., -100. + zA, 0,
"ONLY");
964 TVirtualMC::GetMC()->Gspos(
"Q12T", 2,
"ZDCA", -tubspar[1] - boxpar[0], 0., -100. + zA, 0,
"ONLY");
970 tubpar[0] = 18.4 / 2.;
971 tubpar[1] = 7.4 / 2.;
972 tubpar[2] = (78 + 9.3) / 2.;
973 TVirtualMC::GetMC()->Gsvolu(
"QA06",
"ELTU",
getMediumID(
kFe), tubpar, 3);
980 tubpar[0] = 18.0 / 2.;
981 tubpar[1] = 7.0 / 2.;
982 tubpar[2] = (78 + 9.3) / 2.;
989 TVirtualMC::GetMC()->Gspos(
"QA06", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
990 TVirtualMC::GetMC()->Gspos(
"QA07", 1,
"QA06", 0., 0., 0., 0,
"ONLY");
992 zA += 2. * tubpar[2];
995 conpar[0] = 31.5 / 2.;
996 conpar[1] = 18.0 / 2.;
997 conpar[2] = 18.6 / 2.;
998 conpar[3] = 21.27 / 2.;
999 conpar[4] = 21.87 / 2.;
1000 TVirtualMC::GetMC()->Gsvolu(
"QA08",
"CONE",
getMediumID(
kFe), conpar, 5);
1001 TVirtualMC::GetMC()->Gspos(
"QA08", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1003 zA += 2. * conpar[0];
1006 int32_t irotpipe3, irotpipe4, irotpipe5;
1007 double rang3[6] = {90. - 1.8934, 0., 90., 90., 1.8934, 180.};
1008 double rang4[6] = {90. - 3.8, 0., 90., 90., 3.8, 180.};
1009 double rang5[6] = {90. + 9.8, 0., 90., 90., 9.8, 0.};
1010 TVirtualMC::GetMC()->Matrix(irotpipe3, rang3[0], rang3[1], rang3[2], rang3[3], rang3[4], rang3[5]);
1011 TVirtualMC::GetMC()->Matrix(irotpipe4, rang4[0], rang4[1], rang4[2], rang4[3], rang4[4], rang4[5]);
1012 TVirtualMC::GetMC()->Matrix(irotpipe5, rang5[0], rang5[1], rang5[2], rang5[3], rang5[4], rang5[5]);
1017 tubpar[0] = 21.27 / 2.;
1018 tubpar[1] = 21.87 / 2.;
1019 tubpar[2] = (195.7 + 148. + 78.) / 2.;
1020 TVirtualMC::GetMC()->Gsvolu(
"QA09",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1021 TVirtualMC::GetMC()->Gspos(
"QA09", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1023 zA += 2. * tubpar[2];
1026 conpar[0] = (50.0 - 0.73 - 1.13) / 2.;
1027 conpar[1] = 21.27 / 2.;
1028 conpar[2] = 21.87 / 2.;
1029 conpar[3] = 33.2 / 2.;
1030 conpar[4] = 33.8 / 2.;
1031 TVirtualMC::GetMC()->Gsvolu(
"QA10",
"CONE",
getMediumID(
kFe), conpar, 5);
1032 TVirtualMC::GetMC()->Gspos(
"QA10", 1,
"ZDCA", -1.66, 0., conpar[0] + 0.73 + zA, irotpipe4,
"ONLY");
1034 zA += 2. * conpar[0] + 0.73 + 1.13;
1038 tubpar[1] = 54.6 / 2.;
1039 tubpar[2] = 540.0 / 2.;
1041 TVirtualMC::GetMC()->Gspos(
"Q13TM", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1042 tubpar[0] = 54.0 / 2.;
1043 tubpar[1] = 54.6 / 2.;
1044 tubpar[2] = 540.0 / 2.;
1045 TVirtualMC::GetMC()->Gsvolu(
"Q13T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1046 TVirtualMC::GetMC()->Gspos(
"Q13T", 1,
"Q13TM", 0., 0., 0., 0,
"ONLY");
1048 zA += 2. * tubpar[2];
1051 boxpar[0] = 11.0 / 2.;
1052 boxpar[1] = 9.0 / 2.;
1053 boxpar[2] = 418.5 / 2.;
1054 double TDIAperturePos = 6.;
1055 TVirtualMC::GetMC()->Gsvolu(
"QTD1",
"BOX ",
getMediumID(
kFe), boxpar, 3);
1056 TVirtualMC::GetMC()->Gspos(
"QTD1", 1,
"Q13TM", -3.8, boxpar[1] + TDIAperturePos, 0., 0,
"ONLY");
1057 boxpar[0] = 11.0 / 2.;
1058 boxpar[1] = 9.0 / 2.;
1059 boxpar[2] = 418.5 / 2.;
1060 TVirtualMC::GetMC()->Gsvolu(
"QTD2",
"BOX ",
getMediumID(
kFe), boxpar, 3);
1061 double TDIApertureNeg = 6.;
1062 TVirtualMC::GetMC()->Gspos(
"QTD2", 1,
"Q13TM", -3.8, -boxpar[1] - TDIApertureNeg, 0., 0,
"ONLY");
1063 boxpar[0] = 5.1 / 2.;
1064 boxpar[1] = 0.2 / 2.;
1065 boxpar[2] = 418.5 / 2.;
1066 TVirtualMC::GetMC()->Gsvolu(
"QTD3",
"BOX ",
getMediumID(
kFe), boxpar, 3);
1067 TVirtualMC::GetMC()->Gspos(
"QTD3", 1,
"Q13TM", -3.8 + 5.5 + boxpar[0], TDIAperturePos, 0., 0,
"ONLY");
1068 TVirtualMC::GetMC()->Gspos(
"QTD3", 2,
"Q13TM", -3.8 + 5.5 + boxpar[0], -TDIApertureNeg, 0., 0,
"ONLY");
1069 TVirtualMC::GetMC()->Gspos(
"QTD3", 3,
"Q13TM", -3.8 - 5.5 - boxpar[0], TDIAperturePos, 0., 0,
"ONLY");
1070 TVirtualMC::GetMC()->Gspos(
"QTD3", 4,
"Q13TM", -3.8 - 5.5 - boxpar[0], -TDIApertureNeg, 0., 0,
"ONLY");
1072 tubspar[0] = 12.0 / 2.;
1073 tubspar[1] = 12.4 / 2.;
1074 tubspar[2] = 418.5 / 2.;
1077 TVirtualMC::GetMC()->Gsvolu(
"QTD4",
"TUBS",
getMediumID(
kCu), tubspar, 5);
1078 TVirtualMC::GetMC()->Gspos(
"QTD4", 1,
"Q13TM", -3.8 - 10.6, 0., 0., 0,
"ONLY");
1079 tubspar[0] = 12.0 / 2.;
1080 tubspar[1] = 12.4 / 2.;
1081 tubspar[2] = 418.5 / 2.;
1084 TVirtualMC::GetMC()->Gsvolu(
"QTD5",
"TUBS",
getMediumID(
kCu), tubspar, 5);
1085 TVirtualMC::GetMC()->Gspos(
"QTD5", 1,
"Q13TM", -3.8 + 10.6, 0., 0., 0,
"ONLY");
1089 conpar[0] = (50.0 - 2.92 - 1.89) / 2.;
1090 conpar[1] = 33.2 / 2.;
1091 conpar[2] = 33.8 / 2.;
1092 conpar[3] = 21.27 / 2.;
1093 conpar[4] = 21.87 / 2.;
1094 TVirtualMC::GetMC()->Gsvolu(
"QA11",
"CONE",
getMediumID(
kFe), conpar, 5);
1095 TVirtualMC::GetMC()->Gspos(
"QA11", 1,
"ZDCA", 4.32 - 3.8, 0., conpar[0] + 2.92 + zA, irotpipe5,
"ONLY");
1097 zA += 2. * conpar[0] + 2.92 + 1.89;
1102 tubpar[0] = 21.27 / 2.;
1103 tubpar[1] = 21.87 / 2.;
1104 tubpar[2] = 210.0 / 2.;
1105 TVirtualMC::GetMC()->Gsvolu(
"QA12",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1106 TVirtualMC::GetMC()->Gspos(
"QA12", 1,
"ZDCA", 4., 0., tubpar[2] + zA, 0,
"ONLY");
1108 zA += 2. * tubpar[2];
1112 conpar[0] = (121.0 - 0.37 - 1.35) / 2.;
1113 conpar[1] = 21.27 / 2.;
1114 conpar[2] = 21.87 / 2.;
1115 conpar[3] = 79.7 / 2.;
1116 conpar[4] = 81.3 / 2.;
1117 TVirtualMC::GetMC()->Gsvolu(
"QA13",
"CONE",
getMediumID(
kFe), conpar, 5);
1118 TVirtualMC::GetMC()->Gspos(
"QA13", 1,
"ZDCA", 4. - 2., 0., conpar[0] + 0.37 + zA, irotpipe3,
"ONLY");
1120 zA += 2. * conpar[0] + 0.37 + 1.35;
1124 tubpar[0] = 79.7 / 2.;
1125 tubpar[1] = 81.3 / 2.;
1126 tubpar[2] = (2221. - 136.) / 2.;
1127 TVirtualMC::GetMC()->Gsvolu(
"QA14",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1128 TVirtualMC::GetMC()->Gspos(
"QA14", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1130 zA += 2. * tubpar[2];
1138 conpar[0] = 9.09 / 2.;
1139 conpar[1] = 79.7 / 2.;
1140 conpar[2] = 81.3 / 2.;
1141 conpar[3] = 74.82868 / 2.;
1142 conpar[4] = 76.42868 / 2.;
1143 TVirtualMC::GetMC()->Gsvolu(
"QA15",
"CONE",
getMediumID(
kFe), conpar, 5);
1144 TVirtualMC::GetMC()->Gspos(
"QA15", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1146 zA += 2. * conpar[0];
1149 conpar[0] = 96.2 / 2.;
1150 conpar[1] = 74.82868 / 2.;
1151 conpar[2] = 75.42868 / 2.;
1152 conpar[3] = 23.19588 / 2.;
1153 conpar[4] = 23.79588 / 2.;
1154 TVirtualMC::GetMC()->Gsvolu(
"QA16",
"CONE",
getMediumID(
kFe), conpar, 5);
1155 TVirtualMC::GetMC()->Gspos(
"QA16", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1157 zA += 2. * conpar[0];
1160 conpar[0] = 6.71 / 2.;
1161 conpar[1] = 23.19588 / 2.;
1162 conpar[2] = 24.79588 / 2.;
1163 conpar[3] = 19.6 / 2.;
1164 conpar[4] = 21.2 / 2.;
1165 TVirtualMC::GetMC()->Gsvolu(
"QA17",
"CONE",
getMediumID(
kFe), conpar, 5);
1166 TVirtualMC::GetMC()->Gspos(
"QA17", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1168 zA += 2. * conpar[0];
1171 tubpar[0] = 19.6 / 2.;
1172 tubpar[1] = 21.2 / 2.;
1173 tubpar[2] = 9.55 / 2.;
1174 TVirtualMC::GetMC()->Gsvolu(
"QA18",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1175 TVirtualMC::GetMC()->Gspos(
"QA18", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1177 zA += 2. * tubpar[2];
1180 tubpar[0] = 19.6 / 2.;
1181 tubpar[1] = 25.3 / 2.;
1182 tubpar[2] = 4.9 / 2.;
1183 TVirtualMC::GetMC()->Gsvolu(
"QF01",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1184 TVirtualMC::GetMC()->Gspos(
"QF01", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1186 zA += 2. * tubpar[2];
1189 tubpar[0] = 20.2 / 2.;
1190 tubpar[1] = 20.6 / 2.;
1191 tubpar[2] = 2.15 / 2.;
1192 TVirtualMC::GetMC()->Gsvolu(
"QA19",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1193 TVirtualMC::GetMC()->Gspos(
"QA19", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1195 zA += 2. * tubpar[2];
1197 conpar[0] = 6.9 / 2.;
1198 conpar[1] = 20.2 / 2.;
1199 conpar[2] = 20.6 / 2.;
1200 conpar[3] = 23.9 / 2.;
1201 conpar[4] = 24.3 / 2.;
1202 TVirtualMC::GetMC()->Gsvolu(
"QA20",
"CONE",
getMediumID(
kFe), conpar, 5);
1203 TVirtualMC::GetMC()->Gspos(
"QA20", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1205 zA += 2. * conpar[0];
1207 tubpar[0] = 23.9 / 2.;
1208 tubpar[1] = 25.5 / 2.;
1209 tubpar[2] = 17.0 / 2.;
1210 TVirtualMC::GetMC()->Gsvolu(
"QA21",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1211 TVirtualMC::GetMC()->Gspos(
"QA21", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1213 zA += 2. * tubpar[2];
1215 conpar[0] = 6.9 / 2.;
1216 conpar[1] = 23.9 / 2.;
1217 conpar[2] = 24.3 / 2.;
1218 conpar[3] = 20.2 / 2.;
1219 conpar[4] = 20.6 / 2.;
1220 TVirtualMC::GetMC()->Gsvolu(
"QA22",
"CONE",
getMediumID(
kFe), conpar, 5);
1221 TVirtualMC::GetMC()->Gspos(
"QA22", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1223 zA += 2. * conpar[0];
1225 tubpar[0] = 20.2 / 2.;
1226 tubpar[1] = 20.6 / 2.;
1227 tubpar[2] = 2.15 / 2.;
1228 TVirtualMC::GetMC()->Gsvolu(
"QA23",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1229 TVirtualMC::GetMC()->Gspos(
"QA23", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1231 zA += 2. * tubpar[2];
1234 tubpar[0] = 19.6 / 2.;
1235 tubpar[1] = 25.3 / 2.;
1236 tubpar[2] = 4.9 / 2.;
1237 TVirtualMC::GetMC()->Gsvolu(
"QF02",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1238 TVirtualMC::GetMC()->Gspos(
"QF02", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1240 zA += 2. * tubpar[2];
1243 tubpar[0] = 19.6 / 2.;
1244 tubpar[1] = 20.0 / 2.;
1245 tubpar[2] = 3.9 / 2.;
1246 TVirtualMC::GetMC()->Gsvolu(
"QA24",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1247 TVirtualMC::GetMC()->Gspos(
"QA24", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1249 zA += 2. * tubpar[2];
1252 conpar[0] = 32.55 / 2.;
1253 conpar[1] = 19.6 / 2.;
1254 conpar[2] = 20.0 / 2.;
1255 conpar[3] = 21.66 / 2.;
1256 conpar[4] = 22.06 / 2.;
1257 TVirtualMC::GetMC()->Gsvolu(
"QA25",
"CONE",
getMediumID(
kFe), conpar, 5);
1258 TVirtualMC::GetMC()->Gspos(
"QA25", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1260 zA += 2. * conpar[0];
1263 tubpar[0] = 21.66 / 2.;
1264 tubpar[1] = 22.06 / 2.;
1265 tubpar[2] = 28.6 / 2.;
1266 TVirtualMC::GetMC()->Gsvolu(
"QA26",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1267 TVirtualMC::GetMC()->Gspos(
"QA26", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1269 zA += 2. * tubpar[2];
1274 double dx = -3.970000;
1275 double dy = 0.000000;
1278 double thx = 84.989100;
1279 double phx = 0.000000;
1280 double thy = 90.000000;
1281 double phy = 90.000000;
1282 double thz = 5.010900;
1283 double phz = 180.000000;
1284 TGeoRotation* rotMatrix1 =
new TGeoRotation(
"", thx, phx, thy, phy, thz, phz);
1286 TGeoCombiTrans* rotMatrix2 =
new TGeoCombiTrans(
"ZDC_c1", dx, dy, dz, rotMatrix1);
1287 rotMatrix2->RegisterYourself();
1290 double thx3 = 95.010900;
1291 double phx3 = 0.000000;
1292 double thy3 = 90.000000;
1293 double phy3 = 90.000000;
1294 double thz3 = 5.010900;
1295 double phz3 = 0.000000;
1296 TGeoRotation* rotMatrix3 =
new TGeoRotation(
"", thx3, phx3, thy3, phy3, thz3, phz3);
1297 TGeoCombiTrans* rotMatrix4 =
new TGeoCombiTrans(
"ZDC_c2", -dx, dy, dz, rotMatrix3);
1298 rotMatrix4->RegisterYourself();
1301 int32_t irotpipe1, irotpipe2;
1302 double rang1[6] = {90. - 1.0027, 0., 90., 90., 1.0027, 180.};
1303 double rang2[6] = {90. + 1.0027, 0., 90., 90., 1.0027, 0.};
1304 TVirtualMC::GetMC()->Matrix(irotpipe1, rang1[0], rang1[1], rang1[2], rang1[3], rang1[4], rang1[5]);
1305 TVirtualMC::GetMC()->Matrix(irotpipe2, rang2[0], rang2[1], rang2[2], rang2[3], rang2[4], rang2[5]);
1309 TGeoVolume* pZDCA = gGeoManager->GetVolume(
"ZDCA");
1311 conpar[0] = (90.1 - 0.95 - 0.26) / 2.;
1312 conpar[1] = 0.0 / 2.;
1313 conpar[2] = 21.6 / 2.;
1314 conpar[3] = 0.0 / 2.;
1315 conpar[4] = 5.8 / 2.;
1316 new TGeoCone(
"QALext", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1318 conpar[0] = (90.1 - 0.95 - 0.26) / 2.;
1319 conpar[1] = 0.0 / 2.;
1320 conpar[2] = 21.2 / 2.;
1321 conpar[3] = 0.0 / 2.;
1322 conpar[4] = 5.4 / 2.;
1323 new TGeoCone(
"QALint", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1326 TGeoCompositeShape* pOutTrousers =
new TGeoCompositeShape(
"outTrousers",
"QALext:ZDC_c1+QALext:ZDC_c2");
1331 TGeoVolume* pQALext =
new TGeoVolume(
"QALext", pOutTrousers, matmgr.getTGeoMedium(
"ZDC",
kFeLowTh));
1332 pQALext->SetLineColor(kBlue);
1333 pQALext->SetVisLeaves(kTRUE);
1335 TGeoTranslation* tr1 =
new TGeoTranslation(0., 0., (
double)conpar[0] + 0.95 + zA);
1336 pZDCA->AddNode(pQALext, 1, tr1);
1338 TGeoCompositeShape* pIntTrousers =
new TGeoCompositeShape(
"intTrousers",
"QALint:ZDC_c1+QALint:ZDC_c2");
1340 TGeoVolume* pQALint =
new TGeoVolume(
"QALint", pIntTrousers, matmgr.getTGeoMedium(
"ZDC",
kVoidNoField));
1341 pQALint->SetLineColor(kAzure);
1342 pQALint->SetVisLeaves(kTRUE);
1343 pQALext->AddNode(pQALint, 1);
1348 tubpar[0] = 5.4 / 2.;
1349 tubpar[1] = 5.8 / 2.;
1350 tubpar[2] = 40.0 / 2.;
1351 TVirtualMC::GetMC()->Gsvolu(
"QA27",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1352 TVirtualMC::GetMC()->Gspos(
"QA27", 1,
"ZDCA", -15.8 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1353 TVirtualMC::GetMC()->Gspos(
"QA27", 2,
"ZDCA", 15.8 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1355 zA += 2. * tubpar[2];
1358 conpar[0] = (10. - 1.) / 2.;
1359 conpar[1] = 5.4 / 2.;
1360 conpar[2] = 5.8 / 2.;
1361 conpar[3] = 6.3 / 2.;
1362 conpar[4] = 7.0 / 2.;
1363 TVirtualMC::GetMC()->Gsvolu(
"QA28",
"CONE",
getMediumID(
kFe), conpar, 5);
1364 TVirtualMC::GetMC()->Gspos(
"QA28", 1,
"ZDCA", -7.9 - 0.175, 0., conpar[0] + 0.5 + zA, irotpipe1,
"ONLY");
1365 TVirtualMC::GetMC()->Gspos(
"QA28", 2,
"ZDCA", 7.9 + 0.175, 0., conpar[0] + 0.5 + zA, irotpipe2,
"ONLY");
1367 zA += 2. * conpar[0] + 1.;
1370 tubpar[0] = 6.3 / 2.;
1371 tubpar[1] = 7.0 / 2.;
1372 tubpar[2] = (342.5 + 498.3) / 2.;
1373 TVirtualMC::GetMC()->Gsvolu(
"QA29",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1374 TVirtualMC::GetMC()->Gspos(
"QA29", 1,
"ZDCA", -16.5 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1375 TVirtualMC::GetMC()->Gspos(
"QA29", 2,
"ZDCA", 16.5 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1378 zA += 2. * tubpar[2];
1381 if (mLumiLength > 0.) {
1382 boxpar[0] = 8.0 / 2.;
1383 boxpar[1] = 8.0 / 2.;
1384 boxpar[2] = mLumiLength / 2.;
1386 TVirtualMC::GetMC()->Gspos(
"QLUA", 1,
"ZDCA", 0., 0.,
Geometry::ZNAPOSITION[1] - 66. - boxpar[2], 0,
"ONLY");
1387 LOG(
debug) <<
"A-side luminometer positioned in front of ZNA\n";
1392void Detector::createCsideBeamLine()
1394 double tubpar[3] = {0., 0., 0};
1395 float boxpar[3] = {0., 0., 0};
1396 double tubspar[5] = {0., 0., 0., 0., 0.};
1397 double conpar[15] = {
1402 float zCompensator = 1974.;
1407 conpar[3] = -13500.;
1410 conpar[6] = -zCompensator;
1413 conpar[9] = -zCompensator;
1415 conpar[11] = 6.7 / 2.;
1418 conpar[14] = 6.7 / 2.;
1420 TVirtualMC::GetMC()->Gspos(
"ZDCC", 1,
"cave", 0., 0., 0., 0,
"ONLY");
1423 tubpar[0] = 6.3 / 2.;
1424 tubpar[1] = 6.7 / 2.;
1426 tubpar[2] = (5838.3 - zC) / 2.;
1427 TVirtualMC::GetMC()->Gsvolu(
"QT01",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1428 TVirtualMC::GetMC()->Gspos(
"QT01", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1430 zC += 2. * tubpar[2];
1435 tubpar[0] = 6.94 / 2.;
1436 tubpar[1] = 7.34 / 2.;
1437 tubpar[2] = (6909.8 - zC) / 2.;
1438 TVirtualMC::GetMC()->Gsvolu(
"QT02",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1439 TVirtualMC::GetMC()->Gspos(
"QT02", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1441 zC += 2. * tubpar[2];
1443 tubpar[0] = 8. / 2.;
1444 tubpar[1] = 8.6 / 2.;
1445 tubpar[2] = (6958.3 - zC) / 2.;
1446 TVirtualMC::GetMC()->Gsvolu(
"QT0B",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1447 TVirtualMC::GetMC()->Gspos(
"QT0B", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1449 zC += 2. * tubpar[2];
1451 tubpar[0] = 9. / 2.;
1452 tubpar[1] = 9.6 / 2.;
1453 tubpar[2] = (7022.8 - zC) / 2.;
1454 TVirtualMC::GetMC()->Gsvolu(
"QT03",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1455 TVirtualMC::GetMC()->Gspos(
"QT03", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1457 zC += 2. * tubpar[2];
1459 conpar[0] = 39.2 / 2.;
1460 conpar[1] = 18. / 2.;
1461 conpar[2] = 18.6 / 2.;
1462 conpar[3] = 9. / 2.;
1463 conpar[4] = 9.6 / 2.;
1464 TVirtualMC::GetMC()->Gsvolu(
"QC01",
"CONE",
getMediumID(
kFe), conpar, 5);
1465 TVirtualMC::GetMC()->Gspos(
"QC01", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1467 zC += conpar[0] * 2.;
1470 float totLength1 = 160.8 + 78. + 148. + 78. + 9.3;
1472 tubpar[0] = 18.6 / 2.;
1473 tubpar[1] = 7.6 / 2.;
1474 tubpar[2] = totLength1 / 2.;
1475 TVirtualMC::GetMC()->Gsvolu(
"QE01",
"ELTU",
getMediumID(
kFe), tubpar, 3);
1482 tubpar[0] = 18.0 / 2.;
1483 tubpar[1] = 7.0 / 2.;
1484 tubpar[2] = totLength1 / 2.;
1492 TVirtualMC::GetMC()->Gspos(
"QE01", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1493 TVirtualMC::GetMC()->Gspos(
"QE02", 1,
"QE01", 0., 0., 0., 0,
"ONLY");
1496 if (mTCLIAAPERTURE < 3.5) {
1497 boxpar[0] = 5.4 / 2.;
1498 boxpar[1] = (3.5 - mTCLIAAPERTURE - mVCollSideCCentreY - 0.7) / 2.;
1499 if (boxpar[1] < 0.) {
1502 boxpar[2] = 124.4 / 2.;
1504 TVirtualMC::GetMC()->Gspos(
"QCVC", 1,
"QE02", -boxpar[0], mTCLIAAPERTURE + mVCollSideCCentreY + boxpar[1], -totLength1 / 2. + 160.8 + 78. + 148. / 2., 0,
"ONLY");
1505 TVirtualMC::GetMC()->Gspos(
"QCVC", 2,
"QE02", -boxpar[0], -mTCLIAAPERTURENEG + mVCollSideCCentreY - boxpar[1], -totLength1 / 2. + 160.8 + 78. + 148. / 2., 0,
"ONLY");
1508 zC += tubpar[2] * 2.;
1511 conpar[0] = 31.5 / 2.;
1512 conpar[1] = 21.27 / 2.;
1513 conpar[2] = 21.87 / 2.;
1514 conpar[3] = 18.0 / 2.;
1515 conpar[4] = 18.6 / 2.;
1516 TVirtualMC::GetMC()->Gsvolu(
"QC02",
"CONE",
getMediumID(
kFe), conpar, 5);
1517 TVirtualMC::GetMC()->Gspos(
"QC02", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1519 zC += conpar[0] * 2.;
1522 float totLenght2 = (8373.3 - zC);
1523 tubpar[0] = 21.2 / 2.;
1524 tubpar[1] = 21.9 / 2.;
1525 tubpar[2] = totLenght2 / 2.;
1527 TVirtualMC::GetMC()->Gspos(
"QT04", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1529 zC += tubpar[2] * 2.;
1533 conpar[0] = 121. / 2.;
1534 conpar[1] = 79.7 / 2.;
1535 conpar[2] = 81.3 / 2.;
1536 conpar[3] = 21.27 / 2.;
1537 conpar[4] = 21.87 / 2.;
1539 TVirtualMC::GetMC()->Gspos(
"QC03", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1541 zC += 2. * conpar[0];
1544 tubpar[0] = 79.7 / 2.;
1545 tubpar[1] = 81.3 / 2.;
1546 tubpar[2] = (5 * 475.2 + 97. - 136) / 2.;
1548 TVirtualMC::GetMC()->Gspos(
"QT05", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1550 zC += 2. * tubpar[2];
1559 conpar[0] = 9.09 / 2.;
1560 conpar[1] = 74.82868 / 2.;
1561 conpar[2] = 76.42868 / 2.;
1562 conpar[3] = 79.7 / 2.;
1563 conpar[4] = 81.3 / 2.;
1565 TVirtualMC::GetMC()->Gspos(
"QC04", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1567 zC += 2. * conpar[0];
1570 conpar[0] = 96.2 / 2.;
1571 conpar[1] = 23.19588 / 2.;
1572 conpar[2] = 23.79588 / 2.;
1573 conpar[3] = 74.82868 / 2.;
1574 conpar[4] = 75.42868 / 2.;
1576 TVirtualMC::GetMC()->Gspos(
"QC05", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1578 zC += 2. * conpar[0];
1581 conpar[0] = 6.71 / 2.;
1582 conpar[1] = 19.6 / 2.;
1583 conpar[2] = 21.2 / 2.;
1584 conpar[3] = 23.19588 / 2.;
1585 conpar[4] = 24.79588 / 2.;
1587 TVirtualMC::GetMC()->Gspos(
"QC06", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1589 zC += 2. * conpar[0];
1592 tubpar[0] = 20.2 / 2.;
1593 tubpar[1] = 20.6 / 2.;
1594 tubpar[2] = 2.15 / 2.;
1596 TVirtualMC::GetMC()->Gspos(
"QT06", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1598 zC += 2. * tubpar[2];
1600 conpar[0] = 6.9 / 2.;
1601 conpar[1] = 23.9 / 2.;
1602 conpar[2] = 24.3 / 2.;
1603 conpar[3] = 20.2 / 2.;
1604 conpar[4] = 20.6 / 2.;
1606 TVirtualMC::GetMC()->Gspos(
"QC07", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1608 zC += 2. * conpar[0];
1610 tubpar[0] = 23.9 / 2.;
1611 tubpar[1] = 25.5 / 2.;
1612 tubpar[2] = 17.0 / 2.;
1614 TVirtualMC::GetMC()->Gspos(
"QT07", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1616 zC += 2. * tubpar[2];
1618 conpar[0] = 6.9 / 2.;
1619 conpar[1] = 20.2 / 2.;
1620 conpar[2] = 20.6 / 2.;
1621 conpar[3] = 23.9 / 2.;
1622 conpar[4] = 24.3 / 2.;
1624 TVirtualMC::GetMC()->Gspos(
"QC08", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1626 zC += 2. * conpar[0];
1628 tubpar[0] = 20.2 / 2.;
1629 tubpar[1] = 20.6 / 2.;
1630 tubpar[2] = 2.15 / 2.;
1632 TVirtualMC::GetMC()->Gspos(
"QT08", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1634 zC += 2. * tubpar[2];
1637 tubpar[0] = 19.6 / 2.;
1638 tubpar[1] = 25.3 / 2.;
1639 tubpar[2] = 4.9 / 2.;
1641 TVirtualMC::GetMC()->Gspos(
"QT09", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1643 zC += 2. * tubpar[2];
1646 tubpar[0] = 19.6 / 2.;
1647 tubpar[1] = 20.0 / 2.;
1648 tubpar[2] = 3.9 / 2.;
1650 TVirtualMC::GetMC()->Gspos(
"QT10", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1652 zC += 2. * tubpar[2];
1655 conpar[0] = 32.55 / 2.;
1656 conpar[1] = 21.66 / 2.;
1657 conpar[2] = 22.06 / 2.;
1658 conpar[3] = 19.6 / 2.;
1659 conpar[4] = 20.0 / 2.;
1661 TVirtualMC::GetMC()->Gspos(
"QC09", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1663 zC += 2. * conpar[0];
1666 tubpar[0] = 21.66 / 2.;
1667 tubpar[1] = 22.06 / 2.;
1668 tubpar[2] = 28.6 / 2.;
1670 TVirtualMC::GetMC()->Gspos(
"QT11", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1672 zC += 2. * tubpar[2];
1677 double dx = -3.970000;
1678 double dy = 0.000000;
1681 double thx = 84.989100;
1682 double phx = 180.000000;
1683 double thy = 90.000000;
1684 double phy = 90.000000;
1685 double thz = 185.010900;
1686 double phz = 0.000000;
1687 TGeoRotation* rotMatrix1c =
new TGeoRotation(
"c", thx, phx, thy, phy, thz, phz);
1692 TGeoCombiTrans* rotMatrix2c =
new TGeoCombiTrans(
"ZDCC_c1", dx, dy, dz, rotMatrix1c);
1693 rotMatrix2c->RegisterYourself();
1703 thz = 180. - 5.010900;
1705 TGeoRotation* rotMatrix3c =
new TGeoRotation(
"", thx, phx, thy, phy, thz, phz);
1706 TGeoCombiTrans* rotMatrix4c =
new TGeoCombiTrans(
"ZDCC_c2", dx, dy, dz, rotMatrix3c);
1707 rotMatrix4c->RegisterYourself();
1711 TGeoVolume* pZDCC = gGeoManager->GetVolume(
"ZDCC");
1713 conpar[0] = (90.1 - 0.95 - 0.26 - 0.0085) / 2.;
1714 conpar[1] = 0.0 / 2.;
1715 conpar[2] = 21.6 / 2.;
1716 conpar[3] = 0.0 / 2.;
1717 conpar[4] = 5.8 / 2.;
1718 new TGeoCone(
"QCLext", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1720 conpar[0] = (90.1 - 0.95 - 0.26 - 0.0085) / 2.;
1721 conpar[1] = 0.0 / 2.;
1722 conpar[2] = 21.2 / 2.;
1723 conpar[3] = 0.0 / 2.;
1724 conpar[4] = 5.4 / 2.;
1725 new TGeoCone(
"QCLint", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1728 TGeoCompositeShape* pOutTrousersC =
new TGeoCompositeShape(
"outTrousersC",
"QCLext:ZDCC_c1+QCLext:ZDCC_c2");
1733 TGeoMedium* medZDCFeLowTh = gGeoManager->GetMedium(
"ZDC_IronLowTh$");
1734 TGeoVolume* pQCLext =
new TGeoVolume(
"QCLext", pOutTrousersC, medZDCFeLowTh);
1735 pQCLext->SetLineColor(kAzure);
1736 pQCLext->SetVisLeaves(kTRUE);
1738 TGeoTranslation* tr1c =
new TGeoTranslation(0., 0., (
double)-conpar[0] - 0.95 - zC);
1740 pZDCC->AddNode(pQCLext, 1, tr1c);
1742 TGeoCompositeShape* pIntTrousersC =
new TGeoCompositeShape(
"intTrousersC",
"QCLint:ZDCC_c1+QCLint:ZDCC_c2");
1744 TGeoMedium* medZDCvoid = gGeoManager->GetMedium(
"ZDC_VoidNoField$");
1745 TGeoVolume* pQCLint =
new TGeoVolume(
"QCLint", pIntTrousersC, medZDCvoid);
1746 pQCLint->SetLineColor(kBlue);
1747 pQCLint->SetVisLeaves(kTRUE);
1748 pQCLext->AddNode(pQCLint, 1);
1755 tubpar[0] = 5.4 / 2.;
1756 tubpar[1] = 5.8 / 2.;
1757 tubpar[2] = 40.0 / 2.;
1759 TVirtualMC::GetMC()->Gspos(
"QT12", 1,
"ZDCC", -15.8 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1760 TVirtualMC::GetMC()->Gspos(
"QT12", 2,
"ZDCC", 15.8 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1762 zC += 2. * tubpar[2];
1765 int32_t irotpipe1, irotpipe2;
1766 double rang1[6] = {90. - 1.0027, 0., 90., 90., 1.0027, 180.};
1767 double rang2[6] = {90. + 1.0027, 0., 90., 90., 1.0027, 0.};
1768 TVirtualMC::GetMC()->Matrix(irotpipe1, rang1[0], rang1[1], rang1[2], rang1[3], rang1[4], rang1[5]);
1769 TVirtualMC::GetMC()->Matrix(irotpipe2, rang2[0], rang2[1], rang2[2], rang2[3], rang2[4], rang2[5]);
1772 conpar[0] = (10. - 0.2 -
offset) / 2.;
1773 conpar[1] = 6.3 / 2.;
1774 conpar[2] = 7.0 / 2.;
1775 conpar[3] = 5.4 / 2.;
1776 conpar[4] = 5.8 / 2.;
1778 TVirtualMC::GetMC()->Gspos(
"QC10", 1,
"ZDCC", -7.9 - 0.175, 0., -conpar[0] - 0.1 - zC, irotpipe1,
"ONLY");
1779 TVirtualMC::GetMC()->Gspos(
"QC10", 2,
"ZDCC", 7.9 + 0.175, 0., -conpar[0] - 0.1 - zC, irotpipe2,
"ONLY");
1781 zC += 2. * conpar[0] + 0.2;
1784 tubpar[0] = 6.3 / 2.;
1785 tubpar[1] = 7.0 / 2.;
1786 tubpar[2] = 639.8 / 2.;
1788 TVirtualMC::GetMC()->Gspos(
"QT13", 1,
"ZDCC", -16.5 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1789 TVirtualMC::GetMC()->Gspos(
"QT13", 2,
"ZDCC", 16.5 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1791 zC += 2. * tubpar[2];
1794 if (mLumiLength > 0.) {
1795 boxpar[0] = 8.0 / 2.;
1796 boxpar[1] = 8.0 / 2.;
1797 boxpar[2] = mLumiLength / 2.;
1799 TVirtualMC::GetMC()->Gspos(
"QLUC", 1,
"ZDCC", 0., 0.,
Geometry::ZNCPOSITION[1] + 66. + boxpar[2], 0,
"ONLY");
1800 LOG(
debug) <<
"C-side luminometer positioned in front of ZNC\n";
1805void Detector::createMagnets()
1807 float tubpar[3] = {0., 0., 0.};
1808 float boxpar[3] = {0., 0., 0.};
1810 double zCompensatorField = 1972.5;
1811 double zITField = 2296.5;
1812 double zD1Field = 5838.3001;
1813 double zD2Field = 12167.8;
1824 tubpar[2] = 153. / 2.;
1826 TVirtualMC::GetMC()->Gspos(
"MBXW", 1,
"ZDCC", 0., 0., -tubpar[2] - zCompensatorField, 0,
"ONLY");
1831 tubpar[2] = 150. / 2.;
1833 TVirtualMC::GetMC()->Gspos(
"YMBX", 1,
"ZDCC", 0., 0., -tubpar[2] - zCompensatorField - 1.5, 0,
"ONLY");
1841 tubpar[2] = 637. / 2.;
1847 tubpar[2] = 637. / 2.;
1850 TVirtualMC::GetMC()->Gspos(
"MQXL", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField, 0,
"ONLY");
1851 TVirtualMC::GetMC()->Gspos(
"YMQL", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField, 0,
"ONLY");
1853 TVirtualMC::GetMC()->Gspos(
"MQXL", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 2400., 0,
"ONLY");
1854 TVirtualMC::GetMC()->Gspos(
"YMQL", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 2400., 0,
"ONLY");
1860 tubpar[2] = 550. / 2.;
1866 tubpar[2] = 550. / 2.;
1869 TVirtualMC::GetMC()->Gspos(
"MQX ", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField - 908.5, 0,
"ONLY");
1870 TVirtualMC::GetMC()->Gspos(
"YMQ ", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField - 908.5, 0,
"ONLY");
1872 TVirtualMC::GetMC()->Gspos(
"MQX ", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 1558.5, 0,
"ONLY");
1873 TVirtualMC::GetMC()->Gspos(
"YMQ ", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 1558.5, 0,
"ONLY");
1879 tubpar[2] = 945. / 2.;
1884 boxpar[0] = TMath::Sqrt(tubpar[1] * tubpar[1] - (2.98 + 0.2) * (2.98 + 0.2)) - 0.05;
1885 boxpar[1] = 0.2 / 2.;
1886 boxpar[2] = 945. / 2.;
1887 TVirtualMC::GetMC()->Gsvolu(
"MD1V",
"BOX ",
getMediumID(
kCu), boxpar, 3);
1888 TVirtualMC::GetMC()->Gspos(
"MD1V", 1,
"MD1 ", 0., 2.98 + boxpar[1], 0., 0,
"ONLY");
1889 TVirtualMC::GetMC()->Gspos(
"MD1V", 2,
"MD1 ", 0., -2.98 - boxpar[1], 0., 0,
"ONLY");
1893 tubpar[1] = 110. / 2.;
1894 tubpar[2] = 945. / 2.;
1897 TVirtualMC::GetMC()->Gspos(
"YD1 ", 1,
"ZDCC", 0., 0., -tubpar[2] - zD1Field, 0,
"ONLY");
1898 TVirtualMC::GetMC()->Gspos(
"MD1 ", 1,
"ZDCC", 0., 0., -tubpar[2] - zD1Field, 0,
"ONLY");
1903 tubpar[1] = 7.5 / 2.;
1904 tubpar[2] = 945. / 2.;
1910 tubpar[2] = 945. / 2.;
1912 TVirtualMC::GetMC()->Gspos(
"YD2 ", 1,
"ZDCC", 0., 0., -tubpar[2] - zD2Field, 0,
"ONLY");
1914 TVirtualMC::GetMC()->Gspos(
"MD2 ", 1,
"YD2 ", -9.4, 0., 0., 0,
"ONLY");
1915 TVirtualMC::GetMC()->Gspos(
"MD2 ", 2,
"YD2 ", 9.4, 0., 0., 0,
"ONLY");
1925 tubpar[2] = 153. / 2.;
1927 TVirtualMC::GetMC()->Gspos(
"MCBW", 1,
"ZDCA", 0., 0., tubpar[2] + zCompensatorField, 0,
"ONLY");
1932 tubpar[2] = 153. / 2.;
1934 TVirtualMC::GetMC()->Gspos(
"YMCB", 1,
"ZDCA", 0., 0., tubpar[2] + zCompensatorField, 0,
"ONLY");
1942 tubpar[2] = 637. / 2.;
1949 tubpar[2] = 637. / 2.;
1953 TVirtualMC::GetMC()->Gspos(
"MQX1", 1,
"ZDCA", 0., 0., tubpar[2] + zITField, 0,
"ONLY");
1954 TVirtualMC::GetMC()->Gspos(
"YMQ1", 1,
"ZDCA", 0., 0., tubpar[2] + zITField, 0,
"ONLY");
1957 tubpar[0] = 4.78 / 2.;
1958 tubpar[1] = 5.18 / 2.;
1959 tubpar[2] = 637. / 2.;
1960 TVirtualMC::GetMC()->Gsvolu(
"QBS1",
"TUBE",
getMediumID(
kCu), tubpar, 3);
1961 TVirtualMC::GetMC()->Gspos(
"QBS1", 1,
"MQX1", 0., 0., 0., 0,
"ONLY");
1963 boxpar[0] = 0.2 / 2.0;
1964 boxpar[1] = TMath::Sqrt(tubpar[0] * tubpar[0] - (1.9 + 0.2) * (1.9 + 0.2));
1965 boxpar[2] = 637. / 2.;
1966 TVirtualMC::GetMC()->Gsvolu(
"QBS2",
"BOX ",
getMediumID(
kCu), boxpar, 3);
1967 TVirtualMC::GetMC()->Gspos(
"QBS2", 1,
"MQX1", 1.9 + boxpar[0], 0., 0., 0,
"ONLY");
1968 TVirtualMC::GetMC()->Gspos(
"QBS2", 2,
"MQX1", -1.9 - boxpar[0], 0., 0., 0,
"ONLY");
1971 TVirtualMC::GetMC()->Gspos(
"MQX4", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 2400., 0,
"ONLY");
1972 TVirtualMC::GetMC()->Gspos(
"YMQ1", 2,
"ZDCA", 0., 0., tubpar[2] + zITField + 2400., 0,
"ONLY");
1975 tubpar[0] = 5.79 / 2.;
1976 tubpar[1] = 6.14 / 2.;
1977 tubpar[2] = 637. / 2.;
1978 TVirtualMC::GetMC()->Gsvolu(
"QBS3",
"TUBE",
getMediumID(
kCu), tubpar, 3);
1979 TVirtualMC::GetMC()->Gspos(
"QBS3", 1,
"MQX4", 0., 0., 0., 0,
"ONLY");
1981 boxpar[0] = 0.2 / 2.0;
1982 boxpar[1] = TMath::Sqrt(tubpar[0] * tubpar[0] - (2.405 + 0.2) * (2.405 + 0.2));
1983 boxpar[2] = 637. / 2.;
1984 TVirtualMC::GetMC()->Gsvolu(
"QBS4",
"BOX ",
getMediumID(
kCu), boxpar, 3);
1985 TVirtualMC::GetMC()->Gspos(
"QBS4", 1,
"MQX4", 2.405 + boxpar[0], 0., 0., 0,
"ONLY");
1986 TVirtualMC::GetMC()->Gspos(
"QBS4", 2,
"MQX4", -2.405 - boxpar[0], 0., 0., 0,
"ONLY");
1992 tubpar[2] = 550. / 2.;
1999 tubpar[2] = 550. / 2.;
2003 tubpar[0] = 5.79 / 2.;
2004 tubpar[1] = 6.14 / 2.;
2005 tubpar[2] = 550. / 2.;
2006 TVirtualMC::GetMC()->Gsvolu(
"QBS5",
"TUBE",
getMediumID(
kCu), tubpar, 3);
2008 boxpar[0] = 0.2 / 2.0;
2009 boxpar[1] = TMath::Sqrt(tubpar[0] * tubpar[0] - (2.405 + 0.2) * (2.405 + 0.2));
2010 boxpar[2] = 550. / 2.;
2011 TVirtualMC::GetMC()->Gsvolu(
"QBS6",
"BOX ",
getMediumID(
kCu), boxpar, 3);
2014 TVirtualMC::GetMC()->Gspos(
"MQX2", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 908.5, 0,
"ONLY");
2015 TVirtualMC::GetMC()->Gspos(
"QBS5", 1,
"MQX2", 0., 0., 0., 0,
"ONLY");
2016 TVirtualMC::GetMC()->Gspos(
"QBS6", 1,
"MQX2", 2.405 + boxpar[0], 0., 0., 0,
"ONLY");
2017 TVirtualMC::GetMC()->Gspos(
"QBS6", 2,
"MQX2", -2.405 - boxpar[0], 0., 0., 0,
"ONLY");
2018 TVirtualMC::GetMC()->Gspos(
"YMQ2", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 908.5, 0,
"ONLY");
2021 TVirtualMC::GetMC()->Gspos(
"MQX3", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 1558.5, 0,
"ONLY");
2022 TVirtualMC::GetMC()->Gspos(
"QBS5", 2,
"MQX3", 0., 0., 0., 0,
"ONLY");
2023 TVirtualMC::GetMC()->Gspos(
"QBS6", 3,
"MQX3", 2.405 + boxpar[0], 0., 0., 0,
"ONLY");
2024 TVirtualMC::GetMC()->Gspos(
"QBS6", 4,
"MQX3", -2.405 - boxpar[0], 0., 0., 0,
"ONLY");
2025 TVirtualMC::GetMC()->Gspos(
"YMQ2", 2,
"ZDCA", 0., 0., tubpar[2] + zITField + 1558.5, 0,
"ONLY");
2030 tubpar[1] = 6.75 / 2.;
2031 tubpar[2] = 945. / 2.;
2036 boxpar[0] = TMath::Sqrt(tubpar[1] * tubpar[1] - (2.885 + 0.2) * (2.885 + 0.2));
2037 boxpar[1] = 0.2 / 2.;
2038 boxpar[2] = 945. / 2.;
2039 TVirtualMC::GetMC()->Gsvolu(
"QBS7",
"BOX ",
getMediumID(
kCu), boxpar, 3);
2040 TVirtualMC::GetMC()->Gspos(
"QBS7", 1,
"MD1L", 0., 2.885 + boxpar[1], 0., 0,
"ONLY");
2041 TVirtualMC::GetMC()->Gspos(
"QBS7", 2,
"MD1L", 0., -2.885 - boxpar[1], 0., 0,
"ONLY");
2045 tubpar[1] = 110. / 2;
2046 tubpar[2] = 945. / 2.;
2049 TVirtualMC::GetMC()->Gspos(
"YD1L", 1,
"ZDCA", 0., 0., tubpar[2] + zD1Field, 0,
"ONLY");
2050 TVirtualMC::GetMC()->Gspos(
"MD1L", 1,
"ZDCA", 0., 0., tubpar[2] + zD1Field, 0,
"ONLY");
2055 tubpar[1] = 7.5 / 2.;
2056 tubpar[2] = 945. / 2.;
2062 tubpar[2] = 945. / 2.;
2064 TVirtualMC::GetMC()->Gspos(
"YD2L", 1,
"ZDCA", 0., 0., tubpar[2] + zD2Field, 0,
"ONLY");
2066 TVirtualMC::GetMC()->Gspos(
"MD2L", 1,
"YD2L", -9.4, 0., 0., 0,
"ONLY");
2067 TVirtualMC::GetMC()->Gspos(
"MD2L", 2,
"YD2L", 9.4, 0., 0., 0,
"ONLY");
2070void Detector::createDetectors()
2074 double znSupportBase[3] = {6.3, 4.57, 71.2};
2075 double znSupportBasePos[3] = {0., -14., 21.2};
2076 double znSupportScintillH[3] = {4.32 - 0.8, 0.8, 50.};
2077 double znSupportScintillV[3] = {0.8, 1.955, 50.};
2078 double znSupportWallsud[3] = {3.52, 1., 50.};
2079 double znSupportWallside[3] = {0.4, 5.52, 50.};
2081 float dimPb[6], dimVoid[6];
2094 TVirtualMC::GetMC()->Gsvolu(
"ZNF1",
"TUBE", mMediumPMCid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2095 TVirtualMC::GetMC()->Gsvolu(
"ZNF2",
"TUBE", mMediumPMQid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2096 TVirtualMC::GetMC()->Gsvolu(
"ZNF3",
"TUBE", mMediumPMQid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2097 TVirtualMC::GetMC()->Gsvolu(
"ZNF4",
"TUBE", mMediumPMCid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2117 TVirtualMC::GetMC()->Gspos(
"ZNG1", 1,
"ZNST", 0. - dx, 0. + dy, 0., 0,
"ONLY");
2118 TVirtualMC::GetMC()->Gspos(
"ZNG2", 1,
"ZNST", 0. + dx, 0. + dy, 0., 0,
"ONLY");
2119 TVirtualMC::GetMC()->Gspos(
"ZNG3", 1,
"ZNST", 0. - dx, 0. - dy, 0., 0,
"ONLY");
2120 TVirtualMC::GetMC()->Gspos(
"ZNG4", 1,
"ZNST", 0. + dx, 0. - dy, 0., 0,
"ONLY");
2123 TVirtualMC::GetMC()->Gspos(
"ZNF1", 1,
"ZNG1", 0., 0., 0., 0,
"ONLY");
2124 TVirtualMC::GetMC()->Gspos(
"ZNF2", 1,
"ZNG2", 0., 0., 0., 0,
"ONLY");
2125 TVirtualMC::GetMC()->Gspos(
"ZNF3", 1,
"ZNG3", 0., 0., 0., 0,
"ONLY");
2126 TVirtualMC::GetMC()->Gspos(
"ZNF4", 1,
"ZNG4", 0., 0., 0., 0,
"ONLY");
2131 double rangznc[6] = {90., 180., 90., 90., 180., 0.};
2132 TVirtualMC::GetMC()->Matrix(irotznc, rangznc[0], rangznc[1], rangznc[2], rangznc[3], rangznc[4], rangznc[5]);
2134 TVirtualMC::GetMC()->Gspos(
"ZNEU", 1,
"ZNENV", 0., 0., 0., 0,
"ONLY");
2144 TVirtualMC::GetMC()->Gsvolu(
"ZNBASE",
"BOX ",
getMediumID(
kAl), znSupportBase, 3);
2151 TVirtualMC::GetMC()->Gsvolu(
"ZNSCH",
"BOX ",
getMediumID(
kAl), znSupportScintillH, 3);
2157 TVirtualMC::GetMC()->Gsvolu(
"ZNSCV",
"BOX ",
getMediumID(
kAl), znSupportScintillV, 3);
2158 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 1,
"ZDCC",
Geometry::ZNCPOSITION[0] + znSupportBasePos[0] + znSupportScintillH[0] + znSupportScintillV[0],
2160 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 2,
"ZDCC",
Geometry::ZNCPOSITION[0] + znSupportBasePos[0] - znSupportScintillH[0] - znSupportScintillV[0],
2164 TVirtualMC::GetMC()->Gsvolu(
"ZNSCH",
"BOX ",
getMediumID(
kAl), znSupportScintillH, 3);
2170 TVirtualMC::GetMC()->Gsvolu(
"ZNSCV",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(znSupportScintillV), 3);
2171 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 1,
"ZDCA",
Geometry::ZNAPOSITION[0] + znSupportBasePos[0] + znSupportScintillH[0] + znSupportScintillV[0],
2173 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 2,
"ZDCA",
Geometry::ZNAPOSITION[0] + znSupportBasePos[0] - znSupportScintillH[0] - znSupportScintillV[0],
2178 TVirtualMC::GetMC()->Gsvolu(
"ZNBH",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(znSupportWallsud), 3);
2189 TVirtualMC::GetMC()->Gsvolu(
"ZNBS",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(znSupportWallside), 3);
2201 double zpSupportBase1[3] = {12.5, 1.4, 75.};
2202 double zpSupportBase1Pos[3] = {0., -17., 0.};
2203 double zpSupportBase2[3] = {12.5, 2.5, 75.};
2204 double zpSupportBase2Pos[3] = {0., -9., 0.};
2205 double zpSupportBase3[3] = {1.5, 2.05, 75.};
2206 double zpSupportWallBottom[3] = {11.2, 0.25, 75.};
2207 double zpSupportWallup[3] = {11.2, 1., 75.};
2209 double zpSupportWallside[3] = {0.5, 6., 75.};
2238 TVirtualMC::GetMC()->Gspos(
"ZPG1", 1,
"ZPST", 0. - dx, 0. + dy, 0., 0,
"ONLY");
2239 TVirtualMC::GetMC()->Gspos(
"ZPG2", 1,
"ZPST", 0. + dx, 0. + dy, 0., 0,
"ONLY");
2240 TVirtualMC::GetMC()->Gspos(
"ZPG3", 1,
"ZPST", 0. - dx, 0. - dy, 0., 0,
"ONLY");
2241 TVirtualMC::GetMC()->Gspos(
"ZPG4", 1,
"ZPST", 0. + dx, 0. - dy, 0., 0,
"ONLY");
2244 TVirtualMC::GetMC()->Gspos(
"ZPF1", 1,
"ZPG1", 0., 0., 0., 0,
"ONLY");
2245 TVirtualMC::GetMC()->Gspos(
"ZPF2", 1,
"ZPG2", 0., 0., 0., 0,
"ONLY");
2246 TVirtualMC::GetMC()->Gspos(
"ZPF3", 1,
"ZPG3", 0., 0., 0., 0,
"ONLY");
2247 TVirtualMC::GetMC()->Gspos(
"ZPF4", 1,
"ZPG4", 0., 0., 0., 0,
"ONLY");
2251 TVirtualMC::GetMC()->Gspos(
"ZPRO", 1,
"ZPENV", 0., 0., 0., 0,
"ONLY");
2261 TVirtualMC::GetMC()->Gsvolu(
"ZPBASE1",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportBase1), 3);
2268 TVirtualMC::GetMC()->Gsvolu(
"ZPFOOT",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportBase3), 3);
2275 TVirtualMC::GetMC()->Gsvolu(
"ZPBASE2",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportBase2), 3);
2283 TVirtualMC::GetMC()->Gsvolu(
"ZPBB",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportWallBottom), 3);
2290 TVirtualMC::GetMC()->Gsvolu(
"ZPBT",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportWallup), 3);
2297 TVirtualMC::GetMC()->Gsvolu(
"ZPBS",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportWallside), 3);
2305 int32_t irotzem1, irotzem2;
2306 double rangzem1[6] = {0., 0., 90., 90., -90., 0.};
2307 double rangzem2[6] = {180., 0., 90., 45. + 90., 90., 45.};
2308 TVirtualMC::GetMC()->Matrix(irotzem1, rangzem1[0], rangzem1[1], rangzem1[2], rangzem1[3], rangzem1[4], rangzem1[5]);
2309 TVirtualMC::GetMC()->Matrix(irotzem2, rangzem2[0], rangzem2[1], rangzem2[2], rangzem2[3], rangzem2[4], rangzem2[5]);
2312 double zemTranLength = zemLength / 20.;
2313 double zemPbSlice[6] = {0.15 * TMath::Sqrt(2), 3.5, 3.5, 45., 0., 0.};
2314 double zemVoidLayer[6] = {(zemTranLength - 2. * zemPbSlice[0]) / 2., 3.5, 3.5, 45., 0., 0.};
2316 double zemSupportTable[3] = {55. / 2., 1.5 / 2., 110. / 2.};
2317 double zemSupportBox[6] = {10.5 / 2., 100. / 2., 95. / 2., 0.25 / 2., 2. / 2., 2. / 2.};
2318 double zemSupport1[3] = {15. / 2, 3. / 2., 95. / 2.};
2319 double zemSupport2[3] = {2. / 2, 5. / 2., 95. / 2.};
2320 double zemSupport3[3] = {3.5, 2. / 2., zemLength};
2321 double zemSupport4[6] = {20. / 2., 3.5, 1.5 / 2., 45., 0., 0.};
2322 double zemWallH[3] = {10.5 / 2., 1., 95. / 2.};
2323 double zemWallVfwd[3] = {10.5 / 2., (100. - 2.) / 2., 0.2};
2324 double zemWallVbkw[3] = {10.5 / 2., (100. - 2.) / 2., 2. / 2.};
2325 double zemWallVside[3] = {0.25 / 2., (100. - 2.) / 2., (95. - 2.) / 2.};
2331 TVirtualMC::GetMC()->Gsvolu(
"ZEL0",
"PARA",
getMediumID(
kPb),
const_cast<double*
>(zemPbSlice), 6);
2332 TVirtualMC::GetMC()->Gsvolu(
"ZEL1",
"PARA",
getMediumID(
kPb),
const_cast<double*
>(zemPbSlice), 6);
2333 TVirtualMC::GetMC()->Gsvolu(
"ZEL2",
"PARA",
getMediumID(
kPb),
const_cast<double*
>(zemPbSlice), 6);
2336 TVirtualMC::GetMC()->Gspos(
"ZEL0", 1,
"ZETR", -zemTranLength + zemPbSlice[0], 0., 0., 0,
"ONLY");
2337 TVirtualMC::GetMC()->Gspos(
"ZEL1", 1,
"ZETR", zemPbSlice[0], 0., 0., 0,
"ONLY");
2348 TVirtualMC::GetMC()->Gspos(
"ZEMF", 1,
"ZES0", 0., 0., 0., irotzem2,
"ONLY");
2349 TVirtualMC::GetMC()->Gspos(
"ZEMF", 1,
"ZES1", 0., 0., 0., irotzem2,
"ONLY");
2353 TVirtualMC::GetMC()->Gspos(
"ZEV0", 1,
"ZETR", -zemVoidLayer[0], 0., 0., 0,
"ONLY");
2354 TVirtualMC::GetMC()->Gspos(
"ZEV1", 1,
"ZETR", -zemVoidLayer[0] + zemTranLength, 0., 0., 0,
"ONLY");
2358 const float z0 = 1313.3475;
2374 float zbox = zSupport + zemSupportBox[2];
2377 TVirtualMC::GetMC()->Gsvolu(
"ZESH",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupport1), 3);
2379 TVirtualMC::GetMC()->Gspos(
"ZESH", 1,
"caveRB24",
Geometry::ZEMPOSITION[0], ybridge, zbox - z0, 0,
"ONLY");
2380 TVirtualMC::GetMC()->Gspos(
"ZESH", 2,
"caveRB24", -
Geometry::ZEMPOSITION[0], ybridge, zbox - z0, 0,
"ONLY");
2382 TVirtualMC::GetMC()->Gsvolu(
"ZESV",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupport2), 3);
2383 TVirtualMC::GetMC()->Gspos(
"ZESV", 1,
"caveRB24",
Geometry::ZEMPOSITION[0] - zemSupportBox[0] + zemSupport2[0], ybox - zemSupportBox[1] - zemSupport2[1], zbox - z0, 0,
"ONLY");
2384 TVirtualMC::GetMC()->Gspos(
"ZESV", 2,
"caveRB24",
Geometry::ZEMPOSITION[0] + zemSupportBox[0] - zemSupport2[0], ybox - zemSupportBox[1] - zemSupport2[1], zbox - z0, 0,
"ONLY");
2385 TVirtualMC::GetMC()->Gspos(
"ZESV", 3,
"caveRB24", -(
Geometry::ZEMPOSITION[0] - zemSupportBox[0] + zemSupport2[0]), ybox - zemSupportBox[1] - zemSupport2[1], zbox - z0, 0,
"ONLY");
2386 TVirtualMC::GetMC()->Gspos(
"ZESV", 4,
"caveRB24", -(
Geometry::ZEMPOSITION[0] + zemSupportBox[0] - zemSupport2[0]), ybox - zemSupportBox[1] - zemSupport2[1], zbox - z0, 0,
"ONLY");
2389 TVirtualMC::GetMC()->Gsvolu(
"ZETA",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupportTable), 3);
2390 float ytable = ybridge - zemSupport1[1] - zemSupportTable[1];
2391 TVirtualMC::GetMC()->Gspos(
"ZETA", 1,
"caveRB24", 0.0, ytable, zbox - z0, 0,
"ONLY");
2392 TVirtualMC::GetMC()->Gspos(
"ZETA", 2,
"caveRB24", 0.0, ytable - 13. + 2. * zemSupportTable[1], zbox - z0, 0,
"ONLY");
2395 TVirtualMC::GetMC()->Gsvolu(
"ZEFL",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupport3), 3);
2399 TVirtualMC::GetMC()->Gsvolu(
"ZELA",
"PARA",
getMediumID(
kAl),
const_cast<double*
>(zemSupport4), 6);
2406 TVirtualMC::GetMC()->Gsvolu(
"ZEW1",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemWallH), 3);
2407 TVirtualMC::GetMC()->Gsvolu(
"ZEW2",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemWallVfwd), 3);
2408 TVirtualMC::GetMC()->Gsvolu(
"ZEW3",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemWallVbkw), 3);
2409 TVirtualMC::GetMC()->Gsvolu(
"ZEW4",
"BOX ",
getMediumID(
kFe),
const_cast<double*
>(zemWallVside), 3);
2412 float zh1 = zSupport + zemWallH[2];
2413 TVirtualMC::GetMC()->Gspos(
"ZEW1", 1,
"caveRB24",
Geometry::ZEMPOSITION[0], yh1, zh1 - z0, 0,
"ONLY");
2414 TVirtualMC::GetMC()->Gspos(
"ZEW1", 2,
"caveRB24",
Geometry::ZEMPOSITION[0], yh1 + 2 * zemSupportBox[1], zh1 - z0, 0,
"ONLY");
2415 TVirtualMC::GetMC()->Gspos(
"ZEW1", 3,
"caveRB24", -
Geometry::ZEMPOSITION[0], yh1, zh1 - z0, 0,
"ONLY");
2416 TVirtualMC::GetMC()->Gspos(
"ZEW1", 4,
"caveRB24", -
Geometry::ZEMPOSITION[0], yh1 + 2 * zemSupportBox[1], zh1 - z0, 0,
"ONLY");
2418 TVirtualMC::GetMC()->Gspos(
"ZEW2", 1,
"caveRB24",
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1], zSupport - zemWallVfwd[2] - z0, 0,
"ONLY");
2419 TVirtualMC::GetMC()->Gspos(
"ZEW3", 1,
"caveRB24",
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1], zSupport + 2 * zemWallH[2] - z0, 0,
"ONLY");
2420 TVirtualMC::GetMC()->Gspos(
"ZEW2", 2,
"caveRB24", -
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1], zSupport - zemWallVfwd[2] - z0, 0,
"ONLY");
2421 TVirtualMC::GetMC()->Gspos(
"ZEW3", 2,
"caveRB24", -
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1], zSupport + 2 * zemWallH[2] - z0, 0,
"ONLY");
2425 TVirtualMC::GetMC()->Gspos(
"ZEW4", 1,
"caveRB24", xl1, yh1 + zemSupportBox[1], zh1 - z0, 0,
"ONLY");
2426 TVirtualMC::GetMC()->Gspos(
"ZEW4", 2,
"caveRB24", xl2, yh1 + zemSupportBox[1], zh1 - z0, 0,
"ONLY");
2427 TVirtualMC::GetMC()->Gspos(
"ZEW4", 3,
"caveRB24", -xl1, yh1 + zemSupportBox[1], zh1 - z0, 0,
"ONLY");
2428 TVirtualMC::GetMC()->Gspos(
"ZEW4", 4,
"caveRB24", -xl2, yh1 + zemSupportBox[1], zh1 - z0, 0,
"ONLY");
2432Bool_t Detector::calculateTableIndexes(
int& ibeta,
int& iangle,
int& iradius)
2434 double x[3] = {0., 0., 0.}, xDet[3] = {0., 0., 0.}, p[3] = {0., 0., 0.}, energy = 0.;
2435 fMC->TrackPosition(
x[0],
x[1],
x[2]);
2436 fMC->TrackMomentum(p[0], p[1], p[2], energy);
2439 float ptot = TMath::Sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]);
2442 beta = ptot / energy;
2447 }
else if (beta > 0.75 && beta <= 0.85) {
2449 }
else if (beta > 0.85 && beta <= 0.95) {
2451 }
else if (beta > 0.95) {
2458 double umom[3] = {0., 0., 0.}, udet[3] = {0., 0., 0.};
2459 umom[0] = p[0] / ptot;
2460 umom[1] = p[1] / ptot;
2461 umom[2] = p[2] / ptot;
2462 fMC->Gmtod(umom, udet, 2);
2463 double angleRad = TMath::ACos(udet[2]);
2464 double angleDeg = angleRad *
kRaddeg;
2465 if (angleDeg < 110.) {
2466 iangle =
int(0.5 + angleDeg / 2.);
2471 fMC->Gmtod(
x, xDet, 1);
2473 if (TMath::Abs(udet[0]) > 0) {
2474 float dcoeff = udet[1] / udet[0];
2475 radius = TMath::Abs((xDet[1] - dcoeff * xDet[0]) / TMath::Sqrt(dcoeff * dcoeff + 1.));
2477 radius = TMath::Abs(udet[0]);
2479 iradius =
int(radius * 1000. + 1.);
2494 mLastPrincipalTrackEntered = -1;
2495 flushSpatialResponse();
2497#ifdef ZDC_FASTSIM_ONNX
2500 if (simparam.debugZDCFastSim && simparam.useZDCFastSim && mFastSimModelNeutron !=
nullptr && mFastSimModelProton !=
nullptr && mFastSimClassifier !=
nullptr) {
2501 std::fstream
output(
"o2sim-FastSimResult", std::fstream::out | std::fstream::app);
2503 LOG(error) <<
"Could not open file.";
2506 for (
auto&
result : mFastSimResults) {
2510 mFastSimResults.clear();
2522 mLastPrincipalTrackEntered =
stack->GetCurrentTrackNumber();
2525 mCurrentPrincipalParticle = *
stack->GetCurrentTrack();
2527#ifdef ZDC_FASTSIM_ONNX
2530 if (simparam.useZDCFastSim && (mFastSimModelNeutron !=
nullptr || mFastSimModelProton !=
nullptr) && mFastSimClassifier !=
nullptr) {
2531 const std::vector<float> rawInput = {
static_cast<float>(mCurrentPrincipalParticle.Energy()),
2532 static_cast<float>(mCurrentPrincipalParticle.Vx()),
2533 static_cast<float>(mCurrentPrincipalParticle.Vy()),
2534 static_cast<float>(mCurrentPrincipalParticle.Vz()),
2535 static_cast<float>(mCurrentPrincipalParticle.Px()),
2536 static_cast<float>(mCurrentPrincipalParticle.Py()),
2537 static_cast<float>(mCurrentPrincipalParticle.Pz()),
2538 static_cast<float>(mCurrentPrincipalParticle.GetMass() * 1000.0),
2539 static_cast<float>(mCurrentPrincipalParticle.GetPDG()->Charge())};
2541 auto scaledClassParticle = mClassifierScaler->scale(rawInput);
2542 if (!scaledClassParticle.has_value()) {
2543 LOG(error) <<
"FastSimModule: error occurred on scaling";
2545 vector<vector<float>> classifierInput = {std::move(*scaledClassParticle)};
2546 mFastSimClassifier->setInput(classifierInput);
2547 mFastSimClassifier->run();
2552 if (mModelScalerNeutron && mFastSimModelNeutron) {
2553 LOG(info) <<
"Generating fast hits for ZN";
2554 auto scaledModelParticleNeutron = mModelScalerNeutron->scale(rawInput);
2555 if (!scaledModelParticleNeutron.has_value()) {
2556 LOG(error) <<
"FastSimModule: error occurred on scaling";
2559 mFastSimModelNeutron->setInput(modelInputNeutron);
2560 mFastSimModelNeutron->run();
2561 if (simparam.debugZDCFastSim) {
2565 bool forward = mCurrentPrincipalParticle.Pz() > 0.;
2566 FastSimToHits(mFastSimModelNeutron->getResult()[0], mCurrentPrincipalParticle, forward ?
ZNA :
ZNC);
2570 if (mModelScalerProton && mFastSimModelProton) {
2571 LOG(info) <<
"Generating fast hits for ZP";
2572 auto scaledModelParticleProton = mModelScalerProton->scale(rawInput);
2573 if (!scaledModelParticleProton.has_value()) {
2574 LOG(error) <<
"FastSimModule: error occurred on scaling";
2577 mFastSimModelProton->setInput(modelInputProton);
2578 mFastSimModelProton->run();
2580 bool forward = mCurrentPrincipalParticle.Pz() > 0.;
2581 FastSimToHits(mFastSimModelProton->getResult()[0], mCurrentPrincipalParticle, forward ?
ZPA :
ZPC);
2597 if (FairRootManager::Instance()) {
2598 FairRootManager::Instance()->RegisterAny(
addNameTo(
"Hit").
data(), mHits, kTRUE);
2601 FairRootManager::Instance()->RegisterAny(
addNameTo(
"ResponseImage").
data(), mResponsesPtr, kTRUE);
2613 mLastPrincipalTrackEntered = -1;
2621#ifdef ZDC_FASTSIM_ONNX
2622bool Detector::FastSimToHits(
const Ort::Value& response,
const TParticle& particle,
int detector)
2627 auto [Nx, Ny] = determineDetectorSize(detector);
2629 if (Nx == -1 || Ny == -1) {
2634 auto pixels = response.GetTensorData<
float>();
2636 auto determineSectorID = [&Nx = Nx, &Ny = Ny](
int detector,
int x,
int y) {
2637 if (detector ==
ZNA || detector ==
ZNC) {
2638 if ((
x +
y) % 2 == 0) {
2656 if (detector ==
ZPA || detector ==
ZPC) {
2657 if ((
x +
y) % 2 == 0) {
2660 auto i = (
int)(4.f *
x / Nx);
2661 return (
int)(
i + 1);
2666 auto determineMediumID = [
this](
int detector,
int x,
int y) {
2668 return ((
x +
y) % 2 == 0) ? mMediumPMCid : mMediumPMQid;
2672 if (detector ==
ZPA) {
2674 }
else if (detector ==
ZPC) {
2676 }
else if (detector ==
ZNA) {
2678 }
else if (detector ==
ZNC) {
2682 LOG(fatal) <<
"Unsupported detector in ZDC fast sim";
2689 for (
int x = 0;
x < Nx; ++
x) {
2691 for (
int y = 0;
y < Ny; ++
y) {
2693 int sector = determineSectorID(detector,
x,
y);
2695 int currentMediumid = determineMediumID(detector,
x,
y);
2701 float trackenergy = 0;
2702 createOrAddHit(detector,
2712 0. , 0 , 0. , 0. , 0. , 0. , 0. );
Definition of the Stack class.
int loadLightTable(T &table, int beta, int NRADBINS, std::string filename)
double estimateTimeOfFlight(TParticle const &part, double z)
ClassImp(o2::zdc::Detector)
void Mixture(Int_t imat, const char *name, Float_t *a, Float_t *z, Float_t dens, Int_t nlmat, Float_t *wmat)
void Medium(Int_t numed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Float_t fieldm, Float_t tmaxfd, Float_t stemax, Float_t deemax, Float_t epsil, Float_t stmin, Float_t *ubuf=nullptr, Int_t nbuf=0)
int getMediumID(int imed) const
static void initFieldTrackingParams(int &mode, float &maxfield)
void Material(Int_t imat, const char *name, Float_t a, Float_t z, Float_t dens, Float_t radl, Float_t absl, Float_t *buf=nullptr, Int_t nwbuf=0)
std::string addNameTo(const char *ext) const
static MaterialManager & Instance()
static const ZDCSimParam & Instance()
static ShmManager & Instance()
o2::zdc::Hit * addHit(int32_t trackID, int32_t parentID, int32_t sFlag, float primaryEnergy, int32_t detID, int32_t secID, math_utils::Vector3D< float > pos, math_utils::Vector3D< float > mom, float tof, math_utils::Vector3D< float > xImpact, double energyloss, int32_t nphePMC, int32_t nphePMQ)
void BeginPrimary() final
void ConstructGeometry() final
Detector(Bool_t active=true)
void InitializeO2Detector() final
void FinishPrimary() final
~Detector() override=default
Bool_t ProcessHits(FairVolume *v=nullptr) final
bool createHitsFromImage(SpatialPhotonResponse const &image, int detector)
static constexpr double ZNAPOSITION[3]
static constexpr double ZPFIBRE[3]
static constexpr double ZEMFIBRE[3]
static constexpr double ZNFIBRE[3]
static constexpr double ZPAPOSITION[3]
static constexpr double ZEMPOSITION[3]
static constexpr double ZNDIVISION[2]
static constexpr double ZPSECTORS[2]
static constexpr double ZPGROOVES[3]
static constexpr double ZPFIBREDIAMETER
static constexpr double ZNFIBREDIAMETER
static constexpr double ZEMDIVISION[3]
static constexpr double ZPCPOSITION[3]
static constexpr double ZNDIMENSION[3]
static constexpr double ZNGROOVES[3]
static constexpr double ZNSECTORS[2]
static constexpr double ZPDIVISION[2]
static constexpr double ZEMDIMENSION[6]
static constexpr double ZPDIMENSION[3]
static constexpr double ZNCPOSITION[3]
void addPhoton(double x, double y, int nphotons)
std::array< int, 5 > getPhotonsPerChannel() const
void setDetectorID(int det)
Derived class implementing interface for specific types of models.
GLsizei const GLfloat * value
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
GLdouble GLdouble GLdouble z
D const SVectorGPU< T, D > & rhs
std::vector< T, o2::pmr::polymorphic_allocator< T > > vector
struct o2::upgrades_utils::@463 zdc
structure to keep FT0 information
std::vector< int > readClassifier(const Ort::Value &value, size_t batchSize)
Reads predicted class as int.
std::vector< std::array< long, 5 > > calculateChannels(const Ort::Value &value, size_t batchSize)
Calculate 5 channels values from 44x44 float array (for every batch)
std::vector< float > normal_distribution(double mean, double stddev, size_t size)
Generates a vector of numbers with a given normal distribution and length.
std::optional< std::pair< std::vector< float >, std::vector< float > > > loadScales(const std::string &path)
loads and parse model scales from file at path
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"