14#include "FairRootManager.h"
15#include "FairVolume.h"
22#include "TGeoManager.h"
23#include "TGeoVolume.h"
26#include "TGeoCompositeShape.h"
27#include "TVirtualMC.h"
35#ifdef ZDC_FASTSIM_ONNX
44#define kRaddeg TMath::RadToDeg()
49 mHits(new
std::vector<
o2::zdc::
Hit>),
50 mXImpact(-999, -999, -999),
72#ifdef ZDC_FASTSIM_ONNX
77 if (!simparam.useZDCFastSim) {
78 LOG(info) <<
"FastSim module disabled";
79 }
else if (simparam.useZDCFastSim && !simparam.ZDCFastSimClassifierPath.empty() && !simparam.ZDCFastSimClassifierScales.empty()) {
80 if (!mClassifierScaler) {
83 if (!mModelScalerNeutron) {
86 if (!mModelScalerProton) {
90 if (!eonScales.has_value()) {
91 LOG(
error) <<
"Error while reading model scales from: "
92 <<
"'" << simparam.ZDCFastSimClassifierScales <<
"'";
93 LOG(
error) <<
"FastSim module disabled.";
95 mClassifierScaler->setScales(eonScales->first, eonScales->second);
98 if (simparam.useZDCFastSim && !simparam.ZDCFastSimModelPathNeutron.empty() && !simparam.ZDCFastSimModelScalesNeutron.empty()) {
101 if (!modelScalesNeutron.has_value()) {
102 LOG(
error) <<
"Error while reading model scales from: "
103 <<
"'" << simparam.ZDCFastSimModelScalesNeutron <<
"'";
104 LOG(
error) <<
"FastSim module disabled";
106 mModelScalerNeutron->setScales(modelScalesNeutron->first, modelScalesNeutron->second);
108 LOG(info) <<
"FastSim neutron module enabled";
111 if (simparam.useZDCFastSim && !simparam.ZDCFastSimModelPathProton.empty() && !simparam.ZDCFastSimModelScalesProton.empty()) {
114 if (!modelScalesProton.has_value()) {
115 LOG(
error) <<
"Error while reading model scales from: "
116 <<
"'" << simparam.ZDCFastSimModelScalesProton <<
"'";
117 LOG(
error) <<
"FastSim module disabled";
119 mModelScalerProton->setScales(modelScalesProton->first, modelScalesProton->second);
121 LOG(info) <<
"FastSim proton module enabled";
137#ifdef ZDC_FASTSIM_ONNX
140 delete (mFastSimClassifier);
141 delete (mFastSimModelNeutron);
142 delete (mFastSimModelProton);
143 delete (mClassifierScaler);
144 delete (mModelScalerNeutron);
145 delete (mModelScalerProton);
161 if (input.is_open()) {
162 while (input >>
value) {
164 table[beta][anglebin][radiusbin] =
value;
167 if (radiusbin % NRADBINS == 0) {
186 defineSensitiveVolumes();
188 std::string inputDir;
189 const char* aliceO2env = std::getenv(
"O2_ROOT");
191 inputDir = std::string(aliceO2env);
193 inputDir +=
"/share/Detectors/ZDC/simulation/data/";
195 loadLightTable(mLightTableZN, 0, ZNRADIUSBINS, inputDir +
"light22620362207s");
196 loadLightTable(mLightTableZN, 1, ZNRADIUSBINS, inputDir +
"light22620362208s");
197 loadLightTable(mLightTableZN, 2, ZNRADIUSBINS, inputDir +
"light22620362209s");
198 auto elements =
loadLightTable(mLightTableZN, 3, ZNRADIUSBINS, inputDir +
"light22620362210s");
199 assert(elements == ZNRADIUSBINS * ANGLEBINS);
208 loadLightTable(mLightTableZP, 0, ZPRADIUSBINS, inputDir +
"light22620552207s");
209 loadLightTable(mLightTableZP, 1, ZPRADIUSBINS, inputDir +
"light22620552208s");
210 loadLightTable(mLightTableZP, 2, ZPRADIUSBINS, inputDir +
"light22620552209s");
211 elements =
loadLightTable(mLightTableZP, 3, ZPRADIUSBINS, inputDir +
"light22620552210s");
212 assert(elements == ZPRADIUSBINS * ANGLEBINS);
218 LOG(
debug) <<
"Creating ZDC geometry\n";
223 createAsideBeamLine();
224 createCsideBeamLine();
227 LOG(info) <<
"ZDC: beam line, magnets and the ZN/ZP calorimeters are not built";
233void Detector::defineSensitiveVolumes()
235 LOG(info) <<
"defining sensitive for ZDC";
236 TGeoVolume* vol =
nullptr;
238 vol = gGeoManager->GetVolume(
"ZNENV");
240 AddSensitiveVolume(vol);
241 mZNENVVolID = vol->GetNumber();
243 AddSensitiveVolume(gGeoManager->GetVolume(
"ZNF1"));
244 AddSensitiveVolume(gGeoManager->GetVolume(
"ZNF2"));
245 AddSensitiveVolume(gGeoManager->GetVolume(
"ZNF3"));
246 AddSensitiveVolume(gGeoManager->GetVolume(
"ZNF4"));
248 LOG(fatal) <<
"can't find volume ZNENV";
250 vol = gGeoManager->GetVolume(
"ZPENV");
252 AddSensitiveVolume(vol);
253 mZPENVVolID = vol->GetNumber();
255 AddSensitiveVolume(gGeoManager->GetVolume(
"ZPF1"));
256 AddSensitiveVolume(gGeoManager->GetVolume(
"ZPF2"));
257 AddSensitiveVolume(gGeoManager->GetVolume(
"ZPF3"));
258 AddSensitiveVolume(gGeoManager->GetVolume(
"ZPF4"));
260 LOG(fatal) <<
"can't find volume ZPENV";
264 vol = gGeoManager->GetVolume(
"ZEM ");
266 AddSensitiveVolume(vol);
267 mZEMVolID = vol->GetNumber();
268 AddSensitiveVolume(gGeoManager->GetVolume(
"ZEMF"));
270 LOG(fatal) <<
"can't find volume ZEM";
275void Detector::getDetIDandSecID(TString
const& volname, math_utils::Vector3D<float>
const&
x,
276 math_utils::Vector3D<float>& xDet,
int& detector,
int& sector)
const
278 if (volname.BeginsWith(
"ZN")) {
285 }
else if (
x.Z() < 0) {
290 if (xDet.X() <= 0.) {
291 if (xDet.Y() <= 0.) {
297 if (xDet.Y() <= 0.) {
305 }
else if (volname.BeginsWith(
"ZP")) {
310 }
else if (
x.Z() < 0) {
323 for (
int i = 1;
i <= 4;
i++) {
324 if (xTow >= (
i - 3) && xTow < (
i - 2)) {
331 }
else if (volname.BeginsWith(
"ZE")) {
335 sector = (
x.X() > 0.) ?
Ch1 :
Ch2;
343void Detector::resetHitIndices()
346 for (
int det = 0; det < NUMDETS; ++det) {
347 for (
int sec = 0; sec < NUMSECS; ++sec) {
348 mCurrentHitsIndices[det][sec] = -1;
356void Detector::flushSpatialResponse()
360 std::fstream
output(
"o2sim-FullSimResult", std::fstream::out | std::fstream::app);
361 output <<
c[0] <<
" " <<
c[1] <<
" " <<
c[2] <<
" " <<
c[3] <<
" " <<
c[4] <<
"\n";
366 mResponses.push_back(std::make_pair(mCurrentPrincipalParticle,
367 std::make_pair(mNeutronResponseImage, mProtonResponseImage)));
369 mNeutronResponseImage.
reset();
370 mProtonResponseImage.
reset();
380 const auto m = part.GetMass();
381 constexpr auto SPEED_OF_LIGHT = 299792458.;
383 return z / SPEED_OF_LIGHT;
385 TLorentzVector lorentz;
386 part.Momentum(lorentz);
387 const auto gamma = lorentz.Gamma();
388 const auto speed = SPEED_OF_LIGHT * std::sqrt(1. - 1. / (gamma * gamma));
397 TString volname = fMC->CurrentVolName();
398 float x[3] = {0., 0., 0.};
399 fMC->TrackPosition(
x[0],
x[1],
x[2]);
404 math_utils::Vector3D<float> xImp;
405 getDetIDandSecID(volname, math_utils::Vector3D<float>(
x[0],
x[1],
x[2]), xImp, detector, sector);
408 int trackn =
stack->GetCurrentTrackNumber();
412 volID = fMC->CurrentVolID(copy);
418 if ((fMC->CurrentMedium() == mMediumPMCid) && (detector !=
ZEM)) {
424 if ((volID == mZNENVVolID || volID == mZPENVVolID || volID == mZEMVolID)) {
430 float p[3] = {0., 0., 0.};
431 float trackenergy = 0.;
432 fMC->TrackMomentum(p[0], p[1], p[2], trackenergy);
433 float eDep = fMC->Edep();
435 int pdgCode = fMC->TrackPid();
436 float lightoutput = 0.;
437 auto currentMediumid = fMC->CurrentMedium();
439 if (((currentMediumid == mMediumPMCid) || (currentMediumid == mMediumPMQid))) {
441 int ibeta = 0, iangle = 0, iradius = 0;
442 Bool_t isLightProduced = calculateTableIndexes(ibeta, iangle, iradius);
443 if (isLightProduced) {
445 if (pdgCode < 10000) {
446 charge = fMC->TrackCharge();
448 charge = TMath::Abs(pdgCode / 10000 - 100000);
452 if (TMath::Abs(
charge) > 0) {
453 if (detector == 1 || detector == 4) {
455 lightoutput =
charge *
charge * mLightTableZN[ibeta][iangle][iradius];
459 lightoutput =
charge *
charge * mLightTableZP[ibeta][iangle][iradius];
462 if (lightoutput > 0) {
463 nphe = gRandom->Poisson(lightoutput);
471 auto tof = 1.e09 * fMC->TrackTime();
476 if (detector ==
ZNA || detector ==
ZNC) {
481 if (detector ==
ZPA || detector ==
ZPC) {
490 if (mCurrentHitsIndices[detector - 1][sector] == -1) {
491 bool issecondary = trackn !=
stack->getCurrentPrimaryIndex();
494 mTotLightPMC = mTotLightPMQ = 0;
495 if (currentMediumid == mMediumPMCid) {
497 }
else if (currentMediumid == mMediumPMQid) {
501 math_utils::Vector3D<float>
pos(
x[0],
x[1],
x[2]);
502 math_utils::Vector3D<float> mom(p[0], p[1], p[2]);
503 addHit(trackn, mLastPrincipalTrackEntered, issecondary, trackenergy, detector, sector,
504 pos, mom, tof, xImp, eDep, mTotLightPMC, mTotLightPMQ);
505 stack->addHit(GetDetId());
506 mCurrentHitsIndices[detector - 1][sector] = mHits->size() - 1;
514 auto& curHit = (*mHits)[mCurrentHitsIndices[detector - 1][sector]];
516 curHit.setNoNumContributingSteps(curHit.getNumContributingSteps() + 1);
517 int nPMC{0}, nPMQ{0};
518 if (currentMediumid == mMediumPMCid) {
519 mTotLightPMC += nphe;
521 }
else if (currentMediumid == mMediumPMQid) {
522 mTotLightPMQ += nphe;
525 float incenloss = curHit.GetEnergyLoss() + eDep;
527 curHit.SetEnergyLoss(incenloss);
528 curHit.setPMCLightYield(curHit.getPMCLightYield() + nPMC);
529 curHit.setPMQLightYield(curHit.getPMQLightYield() + nPMQ);
530 stack->modifiesHit(GetDetId());
544 math_utils::Vector3D<float> xImp(0., 0., 0.);
546 const int Nx =
image.getNx();
547 const int Ny =
image.getNy();
551 auto determineSectorID = [Nx, Ny](
int detector,
int x,
int y) {
552 if (detector ==
ZNA || detector ==
ZNC) {
553 if ((
x +
y) % 2 == 0) {
571 if (detector ==
ZPA || detector ==
ZPC) {
572 if ((
x +
y) % 2 == 0) {
575 auto i = (int)(4.f *
x / Nx);
581 auto determineMediumID = [
this](
int detector,
int x,
int y) {
583 return ((
x +
y) % 2 == 0) ? mMediumPMCid : mMediumPMQid;
587 for (
int x = 0;
x < Nx; ++
x) {
589 for (
int y = 0;
y < Ny; ++
y) {
591 int sector = determineSectorID(detector,
x,
y);
593 int currentMediumid = determineMediumID(detector,
x,
y);
597 float trackenergy = 0;
598 createOrAddHit(detector,
608 0. , 0 , 0. , 0. , 0. , 0. , 0. );
616 int32_t secID, math_utils::Vector3D<float>
pos, math_utils::Vector3D<float> mom,
float tof, math_utils::Vector3D<float> xImpact,
617 double energyloss, int32_t nphePMC, int32_t nphePMQ)
619 LOG(debug4) <<
"Adding hit for track " << trackID <<
" X (" <<
pos.X() <<
", " <<
pos.Y() <<
", "
620 <<
pos.Z() <<
") P (" << mom.X() <<
", " << mom.Y() <<
", " << mom.Z() <<
") Ekin "
621 << primaryEnergy <<
" lightPMC " << nphePMC <<
" lightPMQ " << nphePMQ << std::endl;
622 mHits->emplace_back(trackID, parentID, sFlag, primaryEnergy, detID, secID,
pos, mom,
623 tof, xImpact, energyloss, nphePMC, nphePMQ);
624 return &(mHits->back());
633 LOG(info) <<
"Detector::CreateMaterials >>>>> magnetic field: type " << ifield <<
" max " << fieldm <<
"\n";
637 float aW[3] = {183.85, 55.85, 58.71};
638 float zW[3] = {74., 26., 28.};
639 float wW[3] = {0.93, 0.03, 0.04};
643 float aCuZn[2] = {63.546, 65.39};
644 float zCuZn[2] = {29., 30.};
645 float wCuZn[2] = {0.63, 0.37};
649 float aq[2] = {28.0855, 15.9994};
650 float zq[2] = {14., 8.};
651 float wq[2] = {1., 2.};
658 float radPb = 6.37 / dPb;
659 float absPb = 199.6 / dPb;
665 float radCu = 12.86 / dCu;
666 float absCu = 137.3 / dCu;
673 float radFe = 13.84 / dFe;
674 float absFe = 132.1 / dFe;
680 float radAl = 24.01 / dAl;
681 float absAl = 107.2 / dAl;
687 float radCarb = 18.8;
688 float absCarb = 49.9;
691 float aResGas[3] = {1.008, 12.0107, 15.9994};
692 float zResGas[3] = {1., 6., 8.};
693 float wResGas[3] = {0.28, 0.28, 0.44};
694 float dResGas = 3.2E-14;
697 float aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
698 float zAir[4] = {6., 7., 8., 18.};
699 float wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
700 float dAir = 1.20479E-3;
703 int32_t notactiveMed = 0, sensMed = 1;
720 Mixture(0,
"Walloy$", aW, zW, dW, 3, wW);
721 Mixture(1,
"CuZn$", aCuZn, zCuZn, dCuZn, 2, wCuZn);
722 Mixture(2,
"SiO2$", aq, zq, dq, -2, wq);
723 Material(3,
"Pb $", aPb, zPb, dPb, radPb, absPb);
724 Material(4,
"Cu $", aCu, zCu, dCu, radCu, absCu);
725 Material(5,
"Fe $", aFe, zFe, dFe, radFe, absFe);
726 Material(6,
"Al $", aAl, zAl, dAl, radAl, absAl);
727 Material(7,
"graphite$", aCarb, zCarb, dCarb, radCarb, absCarb);
728 Mixture(8,
"residualGas$", aResGas, zResGas, dResGas, 3, wResGas);
729 Mixture(9,
"Air$", aAir, zAir, dAir, 4, wAir);
732 Medium(
kWalloy,
"Walloy$", 0, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
733 Medium(
kCuZn,
"CuZn$", 1, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
734 Medium(
kSiO2pmc,
"quartzPMC$", 2, sensMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
735 Medium(
kSiO2pmq,
"quartzPMQ$", 2, sensMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
736 Medium(
kPb,
"Lead$", 3, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
737 Medium(
kCu,
"Copper$", 4, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
738 Medium(
kCuLumi,
"CopperLowTh$", 4, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
739 Medium(
kFe,
"Iron$", 5, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
740 Medium(
kFeLowTh,
"IronLowTh$", 5, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
741 Medium(
kAl,
"Aluminum$", 6, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
742 Medium(
kGraphite,
"Graphite$", 7, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
743 Medium(
kVoidNoField,
"VoidNoField$", 8, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
744 Medium(
kVoidwField,
"VoidwField$", 8, notactiveMed, ifld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
745 Medium(
kAir,
"Air$", 9, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
749void Detector::createAsideBeamLine()
752 double tubpar[3] = {0., 0., 0};
753 double boxpar[3] = {0., 0., 0};
754 double tubspar[5] = {0., 0., 0., 0., 0.};
755 double conpar[15] = {0.};
769 TVirtualMC::GetMC()->Gspos(
"ZDCA", 1,
"cave", 0., 0., 0., 0,
"ONLY");
772 tubpar[0] = 6.0 / 2.;
773 tubpar[1] = 6.4 / 2.;
774 tubpar[2] = (386.28 - 0.18) / 2.;
775 TVirtualMC::GetMC()->Gsvolu(
"QA01",
"TUBE",
getMediumID(
kFe), tubpar, 3);
776 TVirtualMC::GetMC()->Gspos(
"QA01", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
778 zA += 2. * tubpar[2];
781 tubpar[0] = 6.3 / 2.;
782 tubpar[1] = 6.7 / 2.;
783 tubpar[2] = 3541.8 / 2.;
784 TVirtualMC::GetMC()->Gsvolu(
"QA02",
"TUBE",
getMediumID(
kFe), tubpar, 3);
785 TVirtualMC::GetMC()->Gspos(
"QA02", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
787 zA += 2. * tubpar[2];
797 tubpar[0] = 6.75 / 2.;
798 tubpar[1] = 7.15 / 2.;
799 tubpar[2] = (945.0 + 80.1) / 2.;
800 TVirtualMC::GetMC()->Gsvolu(
"QA03",
"TUBE",
getMediumID(
kFe), tubpar, 3);
801 TVirtualMC::GetMC()->Gspos(
"QA03", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
803 zA += 2. * tubpar[2];
806 conpar[0] = 2.5 / 2.;
807 conpar[1] = 6.75 / 2.;
808 conpar[2] = 7.15 / 2.;
809 conpar[3] = 8.0 / 2.;
810 conpar[4] = 8.4 / 2.;
811 TVirtualMC::GetMC()->Gsvolu(
"QA04",
"CONE",
getMediumID(
kFe), conpar, 5);
812 TVirtualMC::GetMC()->Gspos(
"QA04", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
814 zA += 2. * conpar[0];
816 tubpar[0] = 8.0 / 2.;
817 tubpar[1] = 8.4 / 2.;
818 tubpar[2] = (43.9 + 20. + 28.5 + 28.5) / 2.;
819 TVirtualMC::GetMC()->Gsvolu(
"QA05",
"TUBE",
getMediumID(
kFe), tubpar, 3);
820 TVirtualMC::GetMC()->Gspos(
"QA05", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
822 zA += 2. * tubpar[2];
825 conpar[0] = 4.0 / 2.;
826 conpar[1] = 8.0 / 2.;
827 conpar[2] = 8.4 / 2.;
828 conpar[3] = 9.8 / 2.;
829 conpar[4] = 10.2 / 2.;
830 TVirtualMC::GetMC()->Gsvolu(
"QAV1",
"CONE",
getMediumID(
kFe), conpar, 5);
831 TVirtualMC::GetMC()->Gspos(
"QAV1", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
833 zA += 2. * conpar[0];
836 conpar[0] = 1.0 / 2.;
837 conpar[1] = 9.8 / 2.;
838 conpar[2] = 10.2 / 2.;
839 conpar[3] = 9.0 / 2.;
840 conpar[4] = 9.4 / 2.;
841 TVirtualMC::GetMC()->Gsvolu(
"QAV2",
"CONE",
getMediumID(
kFe), conpar, 5);
842 TVirtualMC::GetMC()->Gspos(
"QAV2", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
844 zA += 2. * conpar[0];
847 tubpar[0] = 9.0 / 2.;
848 tubpar[1] = 9.4 / 2.;
849 tubpar[2] = 31.0 / 2.;
850 TVirtualMC::GetMC()->Gsvolu(
"QAV3",
"TUBE",
getMediumID(
kFe), tubpar, 3);
851 TVirtualMC::GetMC()->Gspos(
"QAV3", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
853 zA += 2. * tubpar[2];
858 conpar[0] = 1.3 / 2.;
859 conpar[1] = 9.0 / 2.;
860 conpar[2] = 13.0 / 2.;
861 conpar[3] = 9.6 / 2.;
862 conpar[4] = 13.0 / 2.;
863 TVirtualMC::GetMC()->Gsvolu(
"Q01T",
"CONE",
getMediumID(
kFe), conpar, 5);
864 TVirtualMC::GetMC()->Gspos(
"Q01T", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
866 zA += 2. * conpar[0];
869 tubpar[0] = 9.6 / 2.;
870 tubpar[1] = 10.0 / 2.;
871 tubpar[2] = 1.0 / 2.;
872 TVirtualMC::GetMC()->Gsvolu(
"Q02T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
873 TVirtualMC::GetMC()->Gspos(
"Q02T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
875 zA += 2. * tubpar[2];
878 conpar[0] = 9.04 / 2.;
879 conpar[1] = 9.6 / 2.;
880 conpar[2] = 10.0 / 2.;
881 conpar[3] = 13.8 / 2.;
882 conpar[4] = 14.2 / 2.;
883 TVirtualMC::GetMC()->Gsvolu(
"Q03T",
"CONE",
getMediumID(
kFe), conpar, 5);
884 TVirtualMC::GetMC()->Gspos(
"Q03T", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
886 zA += 2. * conpar[0];
889 tubpar[0] = 13.8 / 2.;
890 tubpar[1] = 14.2 / 2.;
891 tubpar[2] = 38.6 / 2.;
892 TVirtualMC::GetMC()->Gsvolu(
"Q04T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
893 TVirtualMC::GetMC()->Gspos(
"Q04T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
895 zA += 2. * tubpar[2];
898 tubpar[0] = 21.0 / 2.;
899 tubpar[1] = 21.4 / 2.;
900 tubpar[2] = 100.12 / 2.;
901 TVirtualMC::GetMC()->Gsvolu(
"Q05T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
902 TVirtualMC::GetMC()->Gspos(
"Q05T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
904 zA += 2. * tubpar[2];
907 tubpar[0] = 13.8 / 2.;
908 tubpar[1] = 14.2 / 2.;
909 tubpar[2] = 38.6 / 2.;
910 TVirtualMC::GetMC()->Gsvolu(
"Q06T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
911 TVirtualMC::GetMC()->Gspos(
"Q06T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
913 zA += 2. * tubpar[2];
916 conpar[0] = 11.34 / 2.;
917 conpar[1] = 13.8 / 2.;
918 conpar[2] = 14.2 / 2.;
919 conpar[3] = 18.0 / 2.;
920 conpar[4] = 18.4 / 2.;
921 TVirtualMC::GetMC()->Gsvolu(
"Q07T",
"CONE",
getMediumID(
kFe), conpar, 5);
922 TVirtualMC::GetMC()->Gspos(
"Q07T", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
924 zA += 2. * conpar[0];
930 tubspar[0] = 0.0 / 2.;
931 tubspar[1] = 14.0 / 2.;
932 tubspar[2] = 100.0 / 2.;
935 TVirtualMC::GetMC()->Gsvolu(
"Q08T",
"TUBS",
getMediumID(
kFe), tubspar, 5);
938 boxpar[0] = 7.0 / 2.;
939 boxpar[1] = 2.2 / 2.;
940 boxpar[2] = 100. / 2.;
943 TVirtualMC::GetMC()->Gspos(
"Q09T", 1,
"Q08T", 0., 1.1, 0., 0,
"ONLY");
946 tubspar[0] = 0.0 / 2.;
947 tubspar[1] = 14.0 / 2.;
948 tubspar[2] = 100.0 / 2.;
951 TVirtualMC::GetMC()->Gsvolu(
"Q10T",
"TUBS",
getMediumID(
kFe), tubspar, 5);
953 boxpar[0] = 7.0 / 2.;
954 boxpar[1] = 2.2 / 2.;
955 boxpar[2] = 100. / 2.;
958 TVirtualMC::GetMC()->Gspos(
"Q11T", 1,
"Q10T", 0., -1.1, 0., 0,
"ONLY");
962 double TCDDAperturePos = 2.2;
963 double TCDDApertureNeg = 2.4;
964 TVirtualMC::GetMC()->Gspos(
"Q08T", 1,
"ZDCA", 0., TCDDAperturePos, -100. + zA, 0,
"ONLY");
965 TVirtualMC::GetMC()->Gspos(
"Q10T", 1,
"ZDCA", 0., -TCDDApertureNeg, -100. + zA, 0,
"ONLY");
968 boxpar[0] = 0.2 / 2.;
969 boxpar[1] = 4.0 / 2.;
970 boxpar[2] = 100. / 2.;
971 TVirtualMC::GetMC()->Gsvolu(
"Q12T",
"BOX ",
getMediumID(
kFe), boxpar, 3);
973 TVirtualMC::GetMC()->Gspos(
"Q12T", 1,
"ZDCA", tubspar[1] + boxpar[0], 0., -100. + zA, 0,
"ONLY");
974 TVirtualMC::GetMC()->Gspos(
"Q12T", 2,
"ZDCA", -tubspar[1] - boxpar[0], 0., -100. + zA, 0,
"ONLY");
980 tubpar[0] = 18.4 / 2.;
981 tubpar[1] = 7.4 / 2.;
982 tubpar[2] = (78 + 9.3) / 2.;
983 TVirtualMC::GetMC()->Gsvolu(
"QA06",
"ELTU",
getMediumID(
kFe), tubpar, 3);
990 tubpar[0] = 18.0 / 2.;
991 tubpar[1] = 7.0 / 2.;
992 tubpar[2] = (78 + 9.3) / 2.;
999 TVirtualMC::GetMC()->Gspos(
"QA06", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1000 TVirtualMC::GetMC()->Gspos(
"QA07", 1,
"QA06", 0., 0., 0., 0,
"ONLY");
1002 zA += 2. * tubpar[2];
1005 conpar[0] = 31.5 / 2.;
1006 conpar[1] = 18.0 / 2.;
1007 conpar[2] = 18.6 / 2.;
1008 conpar[3] = 21.27 / 2.;
1009 conpar[4] = 21.87 / 2.;
1010 TVirtualMC::GetMC()->Gsvolu(
"QA08",
"CONE",
getMediumID(
kFe), conpar, 5);
1011 TVirtualMC::GetMC()->Gspos(
"QA08", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1013 zA += 2. * conpar[0];
1016 int32_t irotpipe3, irotpipe4, irotpipe5;
1017 double rang3[6] = {90. - 1.8934, 0., 90., 90., 1.8934, 180.};
1018 double rang4[6] = {90. - 3.8, 0., 90., 90., 3.8, 180.};
1019 double rang5[6] = {90. + 9.8, 0., 90., 90., 9.8, 0.};
1020 TVirtualMC::GetMC()->Matrix(irotpipe3, rang3[0], rang3[1], rang3[2], rang3[3], rang3[4], rang3[5]);
1021 TVirtualMC::GetMC()->Matrix(irotpipe4, rang4[0], rang4[1], rang4[2], rang4[3], rang4[4], rang4[5]);
1022 TVirtualMC::GetMC()->Matrix(irotpipe5, rang5[0], rang5[1], rang5[2], rang5[3], rang5[4], rang5[5]);
1027 tubpar[0] = 21.27 / 2.;
1028 tubpar[1] = 21.87 / 2.;
1029 tubpar[2] = (195.7 + 148. + 78.) / 2.;
1030 TVirtualMC::GetMC()->Gsvolu(
"QA09",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1031 TVirtualMC::GetMC()->Gspos(
"QA09", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1033 zA += 2. * tubpar[2];
1036 conpar[0] = (50.0 - 0.73 - 1.13) / 2.;
1037 conpar[1] = 21.27 / 2.;
1038 conpar[2] = 21.87 / 2.;
1039 conpar[3] = 33.2 / 2.;
1040 conpar[4] = 33.8 / 2.;
1041 TVirtualMC::GetMC()->Gsvolu(
"QA10",
"CONE",
getMediumID(
kFe), conpar, 5);
1042 TVirtualMC::GetMC()->Gspos(
"QA10", 1,
"ZDCA", -1.66, 0., conpar[0] + 0.73 + zA, irotpipe4,
"ONLY");
1044 zA += 2. * conpar[0] + 0.73 + 1.13;
1048 tubpar[1] = 54.6 / 2.;
1049 tubpar[2] = 540.0 / 2.;
1051 TVirtualMC::GetMC()->Gspos(
"Q13TM", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1052 tubpar[0] = 54.0 / 2.;
1053 tubpar[1] = 54.6 / 2.;
1054 tubpar[2] = 540.0 / 2.;
1055 TVirtualMC::GetMC()->Gsvolu(
"Q13T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1056 TVirtualMC::GetMC()->Gspos(
"Q13T", 1,
"Q13TM", 0., 0., 0., 0,
"ONLY");
1058 zA += 2. * tubpar[2];
1061 boxpar[0] = 11.0 / 2.;
1062 boxpar[1] = 9.0 / 2.;
1063 boxpar[2] = 418.5 / 2.;
1064 double TDIAperturePos = 6.;
1065 TVirtualMC::GetMC()->Gsvolu(
"QTD1",
"BOX ",
getMediumID(
kFe), boxpar, 3);
1066 TVirtualMC::GetMC()->Gspos(
"QTD1", 1,
"Q13TM", -3.8, boxpar[1] + TDIAperturePos, 0., 0,
"ONLY");
1067 boxpar[0] = 11.0 / 2.;
1068 boxpar[1] = 9.0 / 2.;
1069 boxpar[2] = 418.5 / 2.;
1070 TVirtualMC::GetMC()->Gsvolu(
"QTD2",
"BOX ",
getMediumID(
kFe), boxpar, 3);
1071 double TDIApertureNeg = 6.;
1072 TVirtualMC::GetMC()->Gspos(
"QTD2", 1,
"Q13TM", -3.8, -boxpar[1] - TDIApertureNeg, 0., 0,
"ONLY");
1073 boxpar[0] = 5.1 / 2.;
1074 boxpar[1] = 0.2 / 2.;
1075 boxpar[2] = 418.5 / 2.;
1076 TVirtualMC::GetMC()->Gsvolu(
"QTD3",
"BOX ",
getMediumID(
kFe), boxpar, 3);
1077 TVirtualMC::GetMC()->Gspos(
"QTD3", 1,
"Q13TM", -3.8 + 5.5 + boxpar[0], TDIAperturePos, 0., 0,
"ONLY");
1078 TVirtualMC::GetMC()->Gspos(
"QTD3", 2,
"Q13TM", -3.8 + 5.5 + boxpar[0], -TDIApertureNeg, 0., 0,
"ONLY");
1079 TVirtualMC::GetMC()->Gspos(
"QTD3", 3,
"Q13TM", -3.8 - 5.5 - boxpar[0], TDIAperturePos, 0., 0,
"ONLY");
1080 TVirtualMC::GetMC()->Gspos(
"QTD3", 4,
"Q13TM", -3.8 - 5.5 - boxpar[0], -TDIApertureNeg, 0., 0,
"ONLY");
1082 tubspar[0] = 12.0 / 2.;
1083 tubspar[1] = 12.4 / 2.;
1084 tubspar[2] = 418.5 / 2.;
1087 TVirtualMC::GetMC()->Gsvolu(
"QTD4",
"TUBS",
getMediumID(
kCu), tubspar, 5);
1088 TVirtualMC::GetMC()->Gspos(
"QTD4", 1,
"Q13TM", -3.8 - 10.6, 0., 0., 0,
"ONLY");
1089 tubspar[0] = 12.0 / 2.;
1090 tubspar[1] = 12.4 / 2.;
1091 tubspar[2] = 418.5 / 2.;
1094 TVirtualMC::GetMC()->Gsvolu(
"QTD5",
"TUBS",
getMediumID(
kCu), tubspar, 5);
1095 TVirtualMC::GetMC()->Gspos(
"QTD5", 1,
"Q13TM", -3.8 + 10.6, 0., 0., 0,
"ONLY");
1099 conpar[0] = (50.0 - 2.92 - 1.89) / 2.;
1100 conpar[1] = 33.2 / 2.;
1101 conpar[2] = 33.8 / 2.;
1102 conpar[3] = 21.27 / 2.;
1103 conpar[4] = 21.87 / 2.;
1104 TVirtualMC::GetMC()->Gsvolu(
"QA11",
"CONE",
getMediumID(
kFe), conpar, 5);
1105 TVirtualMC::GetMC()->Gspos(
"QA11", 1,
"ZDCA", 4.32 - 3.8, 0., conpar[0] + 2.92 + zA, irotpipe5,
"ONLY");
1107 zA += 2. * conpar[0] + 2.92 + 1.89;
1112 tubpar[0] = 21.27 / 2.;
1113 tubpar[1] = 21.87 / 2.;
1114 tubpar[2] = 210.0 / 2.;
1115 TVirtualMC::GetMC()->Gsvolu(
"QA12",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1116 TVirtualMC::GetMC()->Gspos(
"QA12", 1,
"ZDCA", 4., 0., tubpar[2] + zA, 0,
"ONLY");
1118 zA += 2. * tubpar[2];
1122 conpar[0] = (121.0 - 0.37 - 1.35) / 2.;
1123 conpar[1] = 21.27 / 2.;
1124 conpar[2] = 21.87 / 2.;
1125 conpar[3] = 79.7 / 2.;
1126 conpar[4] = 81.3 / 2.;
1127 TVirtualMC::GetMC()->Gsvolu(
"QA13",
"CONE",
getMediumID(
kFe), conpar, 5);
1128 TVirtualMC::GetMC()->Gspos(
"QA13", 1,
"ZDCA", 4. - 2., 0., conpar[0] + 0.37 + zA, irotpipe3,
"ONLY");
1130 zA += 2. * conpar[0] + 0.37 + 1.35;
1134 tubpar[0] = 79.7 / 2.;
1135 tubpar[1] = 81.3 / 2.;
1136 tubpar[2] = (2221. - 136.) / 2.;
1137 TVirtualMC::GetMC()->Gsvolu(
"QA14",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1138 TVirtualMC::GetMC()->Gspos(
"QA14", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1140 zA += 2. * tubpar[2];
1148 conpar[0] = 9.09 / 2.;
1149 conpar[1] = 79.7 / 2.;
1150 conpar[2] = 81.3 / 2.;
1151 conpar[3] = 74.82868 / 2.;
1152 conpar[4] = 76.42868 / 2.;
1153 TVirtualMC::GetMC()->Gsvolu(
"QA15",
"CONE",
getMediumID(
kFe), conpar, 5);
1154 TVirtualMC::GetMC()->Gspos(
"QA15", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1156 zA += 2. * conpar[0];
1159 conpar[0] = 96.2 / 2.;
1160 conpar[1] = 74.82868 / 2.;
1161 conpar[2] = 75.42868 / 2.;
1162 conpar[3] = 23.19588 / 2.;
1163 conpar[4] = 23.79588 / 2.;
1164 TVirtualMC::GetMC()->Gsvolu(
"QA16",
"CONE",
getMediumID(
kFe), conpar, 5);
1165 TVirtualMC::GetMC()->Gspos(
"QA16", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1167 zA += 2. * conpar[0];
1170 conpar[0] = 6.71 / 2.;
1171 conpar[1] = 23.19588 / 2.;
1172 conpar[2] = 24.79588 / 2.;
1173 conpar[3] = 19.6 / 2.;
1174 conpar[4] = 21.2 / 2.;
1175 TVirtualMC::GetMC()->Gsvolu(
"QA17",
"CONE",
getMediumID(
kFe), conpar, 5);
1176 TVirtualMC::GetMC()->Gspos(
"QA17", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1178 zA += 2. * conpar[0];
1181 tubpar[0] = 19.6 / 2.;
1182 tubpar[1] = 21.2 / 2.;
1183 tubpar[2] = 9.55 / 2.;
1184 TVirtualMC::GetMC()->Gsvolu(
"QA18",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1185 TVirtualMC::GetMC()->Gspos(
"QA18", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1187 zA += 2. * tubpar[2];
1190 tubpar[0] = 19.6 / 2.;
1191 tubpar[1] = 25.3 / 2.;
1192 tubpar[2] = 4.9 / 2.;
1193 TVirtualMC::GetMC()->Gsvolu(
"QF01",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1194 TVirtualMC::GetMC()->Gspos(
"QF01", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1196 zA += 2. * tubpar[2];
1199 tubpar[0] = 20.2 / 2.;
1200 tubpar[1] = 20.6 / 2.;
1201 tubpar[2] = 2.15 / 2.;
1202 TVirtualMC::GetMC()->Gsvolu(
"QA19",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1203 TVirtualMC::GetMC()->Gspos(
"QA19", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1205 zA += 2. * tubpar[2];
1207 conpar[0] = 6.9 / 2.;
1208 conpar[1] = 20.2 / 2.;
1209 conpar[2] = 20.6 / 2.;
1210 conpar[3] = 23.9 / 2.;
1211 conpar[4] = 24.3 / 2.;
1212 TVirtualMC::GetMC()->Gsvolu(
"QA20",
"CONE",
getMediumID(
kFe), conpar, 5);
1213 TVirtualMC::GetMC()->Gspos(
"QA20", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1215 zA += 2. * conpar[0];
1217 tubpar[0] = 23.9 / 2.;
1218 tubpar[1] = 25.5 / 2.;
1219 tubpar[2] = 17.0 / 2.;
1220 TVirtualMC::GetMC()->Gsvolu(
"QA21",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1221 TVirtualMC::GetMC()->Gspos(
"QA21", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1223 zA += 2. * tubpar[2];
1225 conpar[0] = 6.9 / 2.;
1226 conpar[1] = 23.9 / 2.;
1227 conpar[2] = 24.3 / 2.;
1228 conpar[3] = 20.2 / 2.;
1229 conpar[4] = 20.6 / 2.;
1230 TVirtualMC::GetMC()->Gsvolu(
"QA22",
"CONE",
getMediumID(
kFe), conpar, 5);
1231 TVirtualMC::GetMC()->Gspos(
"QA22", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1233 zA += 2. * conpar[0];
1235 tubpar[0] = 20.2 / 2.;
1236 tubpar[1] = 20.6 / 2.;
1237 tubpar[2] = 2.15 / 2.;
1238 TVirtualMC::GetMC()->Gsvolu(
"QA23",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1239 TVirtualMC::GetMC()->Gspos(
"QA23", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1241 zA += 2. * tubpar[2];
1244 tubpar[0] = 19.6 / 2.;
1245 tubpar[1] = 25.3 / 2.;
1246 tubpar[2] = 4.9 / 2.;
1247 TVirtualMC::GetMC()->Gsvolu(
"QF02",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1248 TVirtualMC::GetMC()->Gspos(
"QF02", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1250 zA += 2. * tubpar[2];
1253 tubpar[0] = 19.6 / 2.;
1254 tubpar[1] = 20.0 / 2.;
1255 tubpar[2] = 3.9 / 2.;
1256 TVirtualMC::GetMC()->Gsvolu(
"QA24",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1257 TVirtualMC::GetMC()->Gspos(
"QA24", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1259 zA += 2. * tubpar[2];
1262 conpar[0] = 32.55 / 2.;
1263 conpar[1] = 19.6 / 2.;
1264 conpar[2] = 20.0 / 2.;
1265 conpar[3] = 21.66 / 2.;
1266 conpar[4] = 22.06 / 2.;
1267 TVirtualMC::GetMC()->Gsvolu(
"QA25",
"CONE",
getMediumID(
kFe), conpar, 5);
1268 TVirtualMC::GetMC()->Gspos(
"QA25", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1270 zA += 2. * conpar[0];
1273 tubpar[0] = 21.66 / 2.;
1274 tubpar[1] = 22.06 / 2.;
1275 tubpar[2] = 28.6 / 2.;
1276 TVirtualMC::GetMC()->Gsvolu(
"QA26",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1277 TVirtualMC::GetMC()->Gspos(
"QA26", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1279 zA += 2. * tubpar[2];
1284 double dx = -3.970000;
1285 double dy = 0.000000;
1288 double thx = 84.989100;
1289 double phx = 0.000000;
1290 double thy = 90.000000;
1291 double phy = 90.000000;
1292 double thz = 5.010900;
1293 double phz = 180.000000;
1294 TGeoRotation* rotMatrix1 =
new TGeoRotation(
"", thx, phx, thy, phy, thz, phz);
1296 TGeoCombiTrans* rotMatrix2 =
new TGeoCombiTrans(
"ZDC_c1", dx, dy, dz, rotMatrix1);
1297 rotMatrix2->RegisterYourself();
1300 double thx3 = 95.010900;
1301 double phx3 = 0.000000;
1302 double thy3 = 90.000000;
1303 double phy3 = 90.000000;
1304 double thz3 = 5.010900;
1305 double phz3 = 0.000000;
1306 TGeoRotation* rotMatrix3 =
new TGeoRotation(
"", thx3, phx3, thy3, phy3, thz3, phz3);
1307 TGeoCombiTrans* rotMatrix4 =
new TGeoCombiTrans(
"ZDC_c2", -dx, dy, dz, rotMatrix3);
1308 rotMatrix4->RegisterYourself();
1311 int32_t irotpipe1, irotpipe2;
1312 double rang1[6] = {90. - 1.0027, 0., 90., 90., 1.0027, 180.};
1313 double rang2[6] = {90. + 1.0027, 0., 90., 90., 1.0027, 0.};
1314 TVirtualMC::GetMC()->Matrix(irotpipe1, rang1[0], rang1[1], rang1[2], rang1[3], rang1[4], rang1[5]);
1315 TVirtualMC::GetMC()->Matrix(irotpipe2, rang2[0], rang2[1], rang2[2], rang2[3], rang2[4], rang2[5]);
1319 TGeoVolume* pZDCA = gGeoManager->GetVolume(
"ZDCA");
1321 conpar[0] = (90.1 - 0.95 - 0.26) / 2.;
1322 conpar[1] = 0.0 / 2.;
1323 conpar[2] = 21.6 / 2.;
1324 conpar[3] = 0.0 / 2.;
1325 conpar[4] = 5.8 / 2.;
1326 new TGeoCone(
"QALext", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1328 conpar[0] = (90.1 - 0.95 - 0.26) / 2.;
1329 conpar[1] = 0.0 / 2.;
1330 conpar[2] = 21.2 / 2.;
1331 conpar[3] = 0.0 / 2.;
1332 conpar[4] = 5.4 / 2.;
1333 new TGeoCone(
"QALint", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1336 TGeoCompositeShape* pOutTrousers =
new TGeoCompositeShape(
"outTrousers",
"QALext:ZDC_c1+QALext:ZDC_c2");
1341 TGeoVolume* pQALext =
new TGeoVolume(
"QALext", pOutTrousers, matmgr.getTGeoMedium(
"ZDC",
kFeLowTh));
1342 pQALext->SetLineColor(kBlue);
1343 pQALext->SetVisLeaves(kTRUE);
1345 TGeoTranslation* tr1 =
new TGeoTranslation(0., 0., (
double)conpar[0] + 0.95 + zA);
1346 pZDCA->AddNode(pQALext, 1, tr1);
1348 TGeoCompositeShape* pIntTrousers =
new TGeoCompositeShape(
"intTrousers",
"QALint:ZDC_c1+QALint:ZDC_c2");
1350 TGeoVolume* pQALint =
new TGeoVolume(
"QALint", pIntTrousers, matmgr.getTGeoMedium(
"ZDC",
kVoidNoField));
1351 pQALint->SetLineColor(kAzure);
1352 pQALint->SetVisLeaves(kTRUE);
1353 pQALext->AddNode(pQALint, 1);
1358 tubpar[0] = 5.4 / 2.;
1359 tubpar[1] = 5.8 / 2.;
1360 tubpar[2] = 40.0 / 2.;
1361 TVirtualMC::GetMC()->Gsvolu(
"QA27",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1362 TVirtualMC::GetMC()->Gspos(
"QA27", 1,
"ZDCA", -15.8 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1363 TVirtualMC::GetMC()->Gspos(
"QA27", 2,
"ZDCA", 15.8 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1365 zA += 2. * tubpar[2];
1368 conpar[0] = (10. - 1.) / 2.;
1369 conpar[1] = 5.4 / 2.;
1370 conpar[2] = 5.8 / 2.;
1371 conpar[3] = 6.3 / 2.;
1372 conpar[4] = 7.0 / 2.;
1373 TVirtualMC::GetMC()->Gsvolu(
"QA28",
"CONE",
getMediumID(
kFe), conpar, 5);
1374 TVirtualMC::GetMC()->Gspos(
"QA28", 1,
"ZDCA", -7.9 - 0.175, 0., conpar[0] + 0.5 + zA, irotpipe1,
"ONLY");
1375 TVirtualMC::GetMC()->Gspos(
"QA28", 2,
"ZDCA", 7.9 + 0.175, 0., conpar[0] + 0.5 + zA, irotpipe2,
"ONLY");
1377 zA += 2. * conpar[0] + 1.;
1380 tubpar[0] = 6.3 / 2.;
1381 tubpar[1] = 7.0 / 2.;
1382 tubpar[2] = (342.5 + 498.3) / 2.;
1383 TVirtualMC::GetMC()->Gsvolu(
"QA29",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1384 TVirtualMC::GetMC()->Gspos(
"QA29", 1,
"ZDCA", -16.5 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1385 TVirtualMC::GetMC()->Gspos(
"QA29", 2,
"ZDCA", 16.5 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1388 zA += 2. * tubpar[2];
1391 if (mLumiLength > 0.) {
1392 boxpar[0] = 8.0 / 2.;
1393 boxpar[1] = 8.0 / 2.;
1394 boxpar[2] = mLumiLength / 2.;
1396 TVirtualMC::GetMC()->Gspos(
"QLUA", 1,
"ZDCA", 0., 0.,
Geometry::ZNAPOSITION[1] - 66. - boxpar[2], 0,
"ONLY");
1397 LOG(
debug) <<
"A-side luminometer positioned in front of ZNA\n";
1402void Detector::createCsideBeamLine()
1404 double tubpar[3] = {0., 0., 0};
1405 double boxpar[3] = {0., 0., 0};
1406 double tubspar[5] = {0., 0., 0., 0., 0.};
1407 double conpar[15] = {
1412 float zCompensator = 1974.;
1417 conpar[3] = -13500.;
1420 conpar[6] = -zCompensator;
1423 conpar[9] = -zCompensator;
1425 conpar[11] = 6.7 / 2.;
1428 conpar[14] = 6.7 / 2.;
1430 TVirtualMC::GetMC()->Gspos(
"ZDCC", 1,
"cave", 0., 0., 0., 0,
"ONLY");
1433 tubpar[0] = 6.3 / 2.;
1434 tubpar[1] = 6.7 / 2.;
1436 tubpar[2] = (5838.3 - zC) / 2.;
1437 TVirtualMC::GetMC()->Gsvolu(
"QT01",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1438 TVirtualMC::GetMC()->Gspos(
"QT01", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1440 zC += 2. * tubpar[2];
1445 tubpar[0] = 6.94 / 2.;
1446 tubpar[1] = 7.34 / 2.;
1447 tubpar[2] = (6909.8 - zC) / 2.;
1448 TVirtualMC::GetMC()->Gsvolu(
"QT02",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1449 TVirtualMC::GetMC()->Gspos(
"QT02", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1451 zC += 2. * tubpar[2];
1453 tubpar[0] = 8. / 2.;
1454 tubpar[1] = 8.6 / 2.;
1455 tubpar[2] = (6958.3 - zC) / 2.;
1456 TVirtualMC::GetMC()->Gsvolu(
"QT0B",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1457 TVirtualMC::GetMC()->Gspos(
"QT0B", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1459 zC += 2. * tubpar[2];
1461 tubpar[0] = 9. / 2.;
1462 tubpar[1] = 9.6 / 2.;
1463 tubpar[2] = (7022.8 - zC) / 2.;
1464 TVirtualMC::GetMC()->Gsvolu(
"QT03",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1465 TVirtualMC::GetMC()->Gspos(
"QT03", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1467 zC += 2. * tubpar[2];
1469 conpar[0] = 39.2 / 2.;
1470 conpar[1] = 18. / 2.;
1471 conpar[2] = 18.6 / 2.;
1472 conpar[3] = 9. / 2.;
1473 conpar[4] = 9.6 / 2.;
1474 TVirtualMC::GetMC()->Gsvolu(
"QC01",
"CONE",
getMediumID(
kFe), conpar, 5);
1475 TVirtualMC::GetMC()->Gspos(
"QC01", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1477 zC += conpar[0] * 2.;
1480 float totLength1 = 160.8 + 78. + 148. + 78. + 9.3;
1482 tubpar[0] = 18.6 / 2.;
1483 tubpar[1] = 7.6 / 2.;
1484 tubpar[2] = totLength1 / 2.;
1485 TVirtualMC::GetMC()->Gsvolu(
"QE01",
"ELTU",
getMediumID(
kFe), tubpar, 3);
1492 tubpar[0] = 18.0 / 2.;
1493 tubpar[1] = 7.0 / 2.;
1494 tubpar[2] = totLength1 / 2.;
1502 TVirtualMC::GetMC()->Gspos(
"QE01", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1503 TVirtualMC::GetMC()->Gspos(
"QE02", 1,
"QE01", 0., 0., 0., 0,
"ONLY");
1506 if (mTCLIAAPERTURE < 3.5) {
1507 boxpar[0] = 5.4 / 2.;
1508 boxpar[1] = (3.5 - mTCLIAAPERTURE - mVCollSideCCentreY - 0.7) / 2.;
1509 if (boxpar[1] < 0.) {
1512 boxpar[2] = 124.4 / 2.;
1514 TVirtualMC::GetMC()->Gspos(
"QCVC", 1,
"QE02", -boxpar[0], mTCLIAAPERTURE + mVCollSideCCentreY + boxpar[1], -totLength1 / 2. + 160.8 + 78. + 148. / 2., 0,
"ONLY");
1515 TVirtualMC::GetMC()->Gspos(
"QCVC", 2,
"QE02", -boxpar[0], -mTCLIAAPERTURENEG + mVCollSideCCentreY - boxpar[1], -totLength1 / 2. + 160.8 + 78. + 148. / 2., 0,
"ONLY");
1518 zC += tubpar[2] * 2.;
1521 conpar[0] = 31.5 / 2.;
1522 conpar[1] = 21.27 / 2.;
1523 conpar[2] = 21.87 / 2.;
1524 conpar[3] = 18.0 / 2.;
1525 conpar[4] = 18.6 / 2.;
1526 TVirtualMC::GetMC()->Gsvolu(
"QC02",
"CONE",
getMediumID(
kFe), conpar, 5);
1527 TVirtualMC::GetMC()->Gspos(
"QC02", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1529 zC += conpar[0] * 2.;
1532 float totLenght2 = (8373.3 - zC);
1533 tubpar[0] = 21.2 / 2.;
1534 tubpar[1] = 21.9 / 2.;
1535 tubpar[2] = totLenght2 / 2.;
1537 TVirtualMC::GetMC()->Gspos(
"QT04", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1539 zC += tubpar[2] * 2.;
1543 conpar[0] = 121. / 2.;
1544 conpar[1] = 79.7 / 2.;
1545 conpar[2] = 81.3 / 2.;
1546 conpar[3] = 21.27 / 2.;
1547 conpar[4] = 21.87 / 2.;
1549 TVirtualMC::GetMC()->Gspos(
"QC03", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1551 zC += 2. * conpar[0];
1554 tubpar[0] = 79.7 / 2.;
1555 tubpar[1] = 81.3 / 2.;
1556 tubpar[2] = (5 * 475.2 + 97. - 136) / 2.;
1558 TVirtualMC::GetMC()->Gspos(
"QT05", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1560 zC += 2. * tubpar[2];
1569 conpar[0] = 9.09 / 2.;
1570 conpar[1] = 74.82868 / 2.;
1571 conpar[2] = 76.42868 / 2.;
1572 conpar[3] = 79.7 / 2.;
1573 conpar[4] = 81.3 / 2.;
1575 TVirtualMC::GetMC()->Gspos(
"QC04", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1577 zC += 2. * conpar[0];
1580 conpar[0] = 96.2 / 2.;
1581 conpar[1] = 23.19588 / 2.;
1582 conpar[2] = 23.79588 / 2.;
1583 conpar[3] = 74.82868 / 2.;
1584 conpar[4] = 75.42868 / 2.;
1586 TVirtualMC::GetMC()->Gspos(
"QC05", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1588 zC += 2. * conpar[0];
1591 conpar[0] = 6.71 / 2.;
1592 conpar[1] = 19.6 / 2.;
1593 conpar[2] = 21.2 / 2.;
1594 conpar[3] = 23.19588 / 2.;
1595 conpar[4] = 24.79588 / 2.;
1597 TVirtualMC::GetMC()->Gspos(
"QC06", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1599 zC += 2. * conpar[0];
1602 tubpar[0] = 20.2 / 2.;
1603 tubpar[1] = 20.6 / 2.;
1604 tubpar[2] = 2.15 / 2.;
1606 TVirtualMC::GetMC()->Gspos(
"QT06", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1608 zC += 2. * tubpar[2];
1610 conpar[0] = 6.9 / 2.;
1611 conpar[1] = 23.9 / 2.;
1612 conpar[2] = 24.3 / 2.;
1613 conpar[3] = 20.2 / 2.;
1614 conpar[4] = 20.6 / 2.;
1616 TVirtualMC::GetMC()->Gspos(
"QC07", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1618 zC += 2. * conpar[0];
1620 tubpar[0] = 23.9 / 2.;
1621 tubpar[1] = 25.5 / 2.;
1622 tubpar[2] = 17.0 / 2.;
1624 TVirtualMC::GetMC()->Gspos(
"QT07", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1626 zC += 2. * tubpar[2];
1628 conpar[0] = 6.9 / 2.;
1629 conpar[1] = 20.2 / 2.;
1630 conpar[2] = 20.6 / 2.;
1631 conpar[3] = 23.9 / 2.;
1632 conpar[4] = 24.3 / 2.;
1634 TVirtualMC::GetMC()->Gspos(
"QC08", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1636 zC += 2. * conpar[0];
1638 tubpar[0] = 20.2 / 2.;
1639 tubpar[1] = 20.6 / 2.;
1640 tubpar[2] = 2.15 / 2.;
1642 TVirtualMC::GetMC()->Gspos(
"QT08", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1644 zC += 2. * tubpar[2];
1647 tubpar[0] = 19.6 / 2.;
1648 tubpar[1] = 25.3 / 2.;
1649 tubpar[2] = 4.9 / 2.;
1651 TVirtualMC::GetMC()->Gspos(
"QT09", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1653 zC += 2. * tubpar[2];
1656 tubpar[0] = 19.6 / 2.;
1657 tubpar[1] = 20.0 / 2.;
1658 tubpar[2] = 3.9 / 2.;
1660 TVirtualMC::GetMC()->Gspos(
"QT10", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1662 zC += 2. * tubpar[2];
1665 conpar[0] = 32.55 / 2.;
1666 conpar[1] = 21.66 / 2.;
1667 conpar[2] = 22.06 / 2.;
1668 conpar[3] = 19.6 / 2.;
1669 conpar[4] = 20.0 / 2.;
1671 TVirtualMC::GetMC()->Gspos(
"QC09", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1673 zC += 2. * conpar[0];
1676 tubpar[0] = 21.66 / 2.;
1677 tubpar[1] = 22.06 / 2.;
1678 tubpar[2] = 28.6 / 2.;
1680 TVirtualMC::GetMC()->Gspos(
"QT11", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1682 zC += 2. * tubpar[2];
1687 double dx = -3.970000;
1688 double dy = 0.000000;
1691 double thx = 84.989100;
1692 double phx = 180.000000;
1693 double thy = 90.000000;
1694 double phy = 90.000000;
1695 double thz = 185.010900;
1696 double phz = 0.000000;
1697 TGeoRotation* rotMatrix1c =
new TGeoRotation(
"c", thx, phx, thy, phy, thz, phz);
1702 TGeoCombiTrans* rotMatrix2c =
new TGeoCombiTrans(
"ZDCC_c1", dx, dy, dz, rotMatrix1c);
1703 rotMatrix2c->RegisterYourself();
1713 thz = 180. - 5.010900;
1715 TGeoRotation* rotMatrix3c =
new TGeoRotation(
"", thx, phx, thy, phy, thz, phz);
1716 TGeoCombiTrans* rotMatrix4c =
new TGeoCombiTrans(
"ZDCC_c2", dx, dy, dz, rotMatrix3c);
1717 rotMatrix4c->RegisterYourself();
1721 TGeoVolume* pZDCC = gGeoManager->GetVolume(
"ZDCC");
1723 conpar[0] = (90.1 - 0.95 - 0.26 - 0.0085) / 2.;
1724 conpar[1] = 0.0 / 2.;
1725 conpar[2] = 21.6 / 2.;
1726 conpar[3] = 0.0 / 2.;
1727 conpar[4] = 5.8 / 2.;
1728 new TGeoCone(
"QCLext", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1730 conpar[0] = (90.1 - 0.95 - 0.26 - 0.0085) / 2.;
1731 conpar[1] = 0.0 / 2.;
1732 conpar[2] = 21.2 / 2.;
1733 conpar[3] = 0.0 / 2.;
1734 conpar[4] = 5.4 / 2.;
1735 new TGeoCone(
"QCLint", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1738 TGeoCompositeShape* pOutTrousersC =
new TGeoCompositeShape(
"outTrousersC",
"QCLext:ZDCC_c1+QCLext:ZDCC_c2");
1743 TGeoMedium* medZDCFeLowTh = gGeoManager->GetMedium(
"ZDC_IronLowTh$");
1744 TGeoVolume* pQCLext =
new TGeoVolume(
"QCLext", pOutTrousersC, medZDCFeLowTh);
1745 pQCLext->SetLineColor(kAzure);
1746 pQCLext->SetVisLeaves(kTRUE);
1748 TGeoTranslation* tr1c =
new TGeoTranslation(0., 0., (
double)-conpar[0] - 0.95 - zC);
1750 pZDCC->AddNode(pQCLext, 1, tr1c);
1752 TGeoCompositeShape* pIntTrousersC =
new TGeoCompositeShape(
"intTrousersC",
"QCLint:ZDCC_c1+QCLint:ZDCC_c2");
1754 TGeoMedium* medZDCvoid = gGeoManager->GetMedium(
"ZDC_VoidNoField$");
1755 TGeoVolume* pQCLint =
new TGeoVolume(
"QCLint", pIntTrousersC, medZDCvoid);
1756 pQCLint->SetLineColor(kBlue);
1757 pQCLint->SetVisLeaves(kTRUE);
1758 pQCLext->AddNode(pQCLint, 1);
1765 tubpar[0] = 5.4 / 2.;
1766 tubpar[1] = 5.8 / 2.;
1767 tubpar[2] = 40.0 / 2.;
1769 TVirtualMC::GetMC()->Gspos(
"QT12", 1,
"ZDCC", -15.8 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1770 TVirtualMC::GetMC()->Gspos(
"QT12", 2,
"ZDCC", 15.8 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1772 zC += 2. * tubpar[2];
1775 int32_t irotpipe1, irotpipe2;
1776 double rang1[6] = {90. - 1.0027, 0., 90., 90., 1.0027, 180.};
1777 double rang2[6] = {90. + 1.0027, 0., 90., 90., 1.0027, 0.};
1778 TVirtualMC::GetMC()->Matrix(irotpipe1, rang1[0], rang1[1], rang1[2], rang1[3], rang1[4], rang1[5]);
1779 TVirtualMC::GetMC()->Matrix(irotpipe2, rang2[0], rang2[1], rang2[2], rang2[3], rang2[4], rang2[5]);
1782 conpar[0] = (10. - 0.2 -
offset) / 2.;
1783 conpar[1] = 6.3 / 2.;
1784 conpar[2] = 7.0 / 2.;
1785 conpar[3] = 5.4 / 2.;
1786 conpar[4] = 5.8 / 2.;
1788 TVirtualMC::GetMC()->Gspos(
"QC10", 1,
"ZDCC", -7.9 - 0.175, 0., -conpar[0] - 0.1 - zC, irotpipe1,
"ONLY");
1789 TVirtualMC::GetMC()->Gspos(
"QC10", 2,
"ZDCC", 7.9 + 0.175, 0., -conpar[0] - 0.1 - zC, irotpipe2,
"ONLY");
1791 zC += 2. * conpar[0] + 0.2;
1794 tubpar[0] = 6.3 / 2.;
1795 tubpar[1] = 7.0 / 2.;
1796 tubpar[2] = 639.8 / 2.;
1798 TVirtualMC::GetMC()->Gspos(
"QT13", 1,
"ZDCC", -16.5 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1799 TVirtualMC::GetMC()->Gspos(
"QT13", 2,
"ZDCC", 16.5 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1801 zC += 2. * tubpar[2];
1804 if (mLumiLength > 0.) {
1805 boxpar[0] = 8.0 / 2.;
1806 boxpar[1] = 8.0 / 2.;
1807 boxpar[2] = mLumiLength / 2.;
1809 TVirtualMC::GetMC()->Gspos(
"QLUC", 1,
"ZDCC", 0., 0.,
Geometry::ZNCPOSITION[1] + 66. + boxpar[2], 0,
"ONLY");
1810 LOG(
debug) <<
"C-side luminometer positioned in front of ZNC\n";
1815void Detector::createMagnets()
1817 float tubpar[3] = {0., 0., 0.};
1818 float boxpar[3] = {0., 0., 0.};
1820 double zCompensatorField = 1972.5;
1821 double zITField = 2296.5;
1822 double zD1Field = 5838.3001;
1823 double zD2Field = 12167.8;
1834 tubpar[2] = 153. / 2.;
1836 TVirtualMC::GetMC()->Gspos(
"MBXW", 1,
"ZDCC", 0., 0., -tubpar[2] - zCompensatorField, 0,
"ONLY");
1841 tubpar[2] = 150. / 2.;
1843 TVirtualMC::GetMC()->Gspos(
"YMBX", 1,
"ZDCC", 0., 0., -tubpar[2] - zCompensatorField - 1.5, 0,
"ONLY");
1851 tubpar[2] = 637. / 2.;
1857 tubpar[2] = 637. / 2.;
1860 TVirtualMC::GetMC()->Gspos(
"MQXL", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField, 0,
"ONLY");
1861 TVirtualMC::GetMC()->Gspos(
"YMQL", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField, 0,
"ONLY");
1863 TVirtualMC::GetMC()->Gspos(
"MQXL", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 2400., 0,
"ONLY");
1864 TVirtualMC::GetMC()->Gspos(
"YMQL", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 2400., 0,
"ONLY");
1870 tubpar[2] = 550. / 2.;
1876 tubpar[2] = 550. / 2.;
1879 TVirtualMC::GetMC()->Gspos(
"MQX ", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField - 908.5, 0,
"ONLY");
1880 TVirtualMC::GetMC()->Gspos(
"YMQ ", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField - 908.5, 0,
"ONLY");
1882 TVirtualMC::GetMC()->Gspos(
"MQX ", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 1558.5, 0,
"ONLY");
1883 TVirtualMC::GetMC()->Gspos(
"YMQ ", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 1558.5, 0,
"ONLY");
1889 tubpar[2] = 945. / 2.;
1894 boxpar[0] = TMath::Sqrt(tubpar[1] * tubpar[1] - (2.98 + 0.2) * (2.98 + 0.2)) - 0.05;
1895 boxpar[1] = 0.2 / 2.;
1896 boxpar[2] = 945. / 2.;
1897 TVirtualMC::GetMC()->Gsvolu(
"MD1V",
"BOX ",
getMediumID(
kCu), boxpar, 3);
1898 TVirtualMC::GetMC()->Gspos(
"MD1V", 1,
"MD1 ", 0., 2.98 + boxpar[1], 0., 0,
"ONLY");
1899 TVirtualMC::GetMC()->Gspos(
"MD1V", 2,
"MD1 ", 0., -2.98 - boxpar[1], 0., 0,
"ONLY");
1903 tubpar[1] = 110. / 2.;
1904 tubpar[2] = 945. / 2.;
1907 TVirtualMC::GetMC()->Gspos(
"YD1 ", 1,
"ZDCC", 0., 0., -tubpar[2] - zD1Field, 0,
"ONLY");
1908 TVirtualMC::GetMC()->Gspos(
"MD1 ", 1,
"ZDCC", 0., 0., -tubpar[2] - zD1Field, 0,
"ONLY");
1913 tubpar[1] = 7.5 / 2.;
1914 tubpar[2] = 945. / 2.;
1920 tubpar[2] = 945. / 2.;
1922 TVirtualMC::GetMC()->Gspos(
"YD2 ", 1,
"ZDCC", 0., 0., -tubpar[2] - zD2Field, 0,
"ONLY");
1924 TVirtualMC::GetMC()->Gspos(
"MD2 ", 1,
"YD2 ", -9.4, 0., 0., 0,
"ONLY");
1925 TVirtualMC::GetMC()->Gspos(
"MD2 ", 2,
"YD2 ", 9.4, 0., 0., 0,
"ONLY");
1935 tubpar[2] = 153. / 2.;
1937 TVirtualMC::GetMC()->Gspos(
"MCBW", 1,
"ZDCA", 0., 0., tubpar[2] + zCompensatorField, 0,
"ONLY");
1942 tubpar[2] = 153. / 2.;
1944 TVirtualMC::GetMC()->Gspos(
"YMCB", 1,
"ZDCA", 0., 0., tubpar[2] + zCompensatorField, 0,
"ONLY");
1952 tubpar[2] = 637. / 2.;
1959 tubpar[2] = 637. / 2.;
1963 TVirtualMC::GetMC()->Gspos(
"MQX1", 1,
"ZDCA", 0., 0., tubpar[2] + zITField, 0,
"ONLY");
1964 TVirtualMC::GetMC()->Gspos(
"YMQ1", 1,
"ZDCA", 0., 0., tubpar[2] + zITField, 0,
"ONLY");
1967 tubpar[0] = 4.78 / 2.;
1968 tubpar[1] = 5.18 / 2.;
1969 tubpar[2] = 637. / 2.;
1970 TVirtualMC::GetMC()->Gsvolu(
"QBS1",
"TUBE",
getMediumID(
kCu), tubpar, 3);
1971 TVirtualMC::GetMC()->Gspos(
"QBS1", 1,
"MQX1", 0., 0., 0., 0,
"ONLY");
1973 boxpar[0] = 0.2 / 2.0;
1974 boxpar[1] = TMath::Sqrt(tubpar[0] * tubpar[0] - (1.9 + 0.2) * (1.9 + 0.2));
1975 boxpar[2] = 637. / 2.;
1976 TVirtualMC::GetMC()->Gsvolu(
"QBS2",
"BOX ",
getMediumID(
kCu), boxpar, 3);
1977 TVirtualMC::GetMC()->Gspos(
"QBS2", 1,
"MQX1", 1.9 + boxpar[0], 0., 0., 0,
"ONLY");
1978 TVirtualMC::GetMC()->Gspos(
"QBS2", 2,
"MQX1", -1.9 - boxpar[0], 0., 0., 0,
"ONLY");
1981 TVirtualMC::GetMC()->Gspos(
"MQX4", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 2400., 0,
"ONLY");
1982 TVirtualMC::GetMC()->Gspos(
"YMQ1", 2,
"ZDCA", 0., 0., tubpar[2] + zITField + 2400., 0,
"ONLY");
1985 tubpar[0] = 5.79 / 2.;
1986 tubpar[1] = 6.14 / 2.;
1987 tubpar[2] = 637. / 2.;
1988 TVirtualMC::GetMC()->Gsvolu(
"QBS3",
"TUBE",
getMediumID(
kCu), tubpar, 3);
1989 TVirtualMC::GetMC()->Gspos(
"QBS3", 1,
"MQX4", 0., 0., 0., 0,
"ONLY");
1991 boxpar[0] = 0.2 / 2.0;
1992 boxpar[1] = TMath::Sqrt(tubpar[0] * tubpar[0] - (2.405 + 0.2) * (2.405 + 0.2));
1993 boxpar[2] = 637. / 2.;
1994 TVirtualMC::GetMC()->Gsvolu(
"QBS4",
"BOX ",
getMediumID(
kCu), boxpar, 3);
1995 TVirtualMC::GetMC()->Gspos(
"QBS4", 1,
"MQX4", 2.405 + boxpar[0], 0., 0., 0,
"ONLY");
1996 TVirtualMC::GetMC()->Gspos(
"QBS4", 2,
"MQX4", -2.405 - boxpar[0], 0., 0., 0,
"ONLY");
2002 tubpar[2] = 550. / 2.;
2009 tubpar[2] = 550. / 2.;
2013 tubpar[0] = 5.79 / 2.;
2014 tubpar[1] = 6.14 / 2.;
2015 tubpar[2] = 550. / 2.;
2016 TVirtualMC::GetMC()->Gsvolu(
"QBS5",
"TUBE",
getMediumID(
kCu), tubpar, 3);
2018 boxpar[0] = 0.2 / 2.0;
2019 boxpar[1] = TMath::Sqrt(tubpar[0] * tubpar[0] - (2.405 + 0.2) * (2.405 + 0.2));
2020 boxpar[2] = 550. / 2.;
2021 TVirtualMC::GetMC()->Gsvolu(
"QBS6",
"BOX ",
getMediumID(
kCu), boxpar, 3);
2024 TVirtualMC::GetMC()->Gspos(
"MQX2", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 908.5, 0,
"ONLY");
2025 TVirtualMC::GetMC()->Gspos(
"QBS5", 1,
"MQX2", 0., 0., 0., 0,
"ONLY");
2026 TVirtualMC::GetMC()->Gspos(
"QBS6", 1,
"MQX2", 2.405 + boxpar[0], 0., 0., 0,
"ONLY");
2027 TVirtualMC::GetMC()->Gspos(
"QBS6", 2,
"MQX2", -2.405 - boxpar[0], 0., 0., 0,
"ONLY");
2028 TVirtualMC::GetMC()->Gspos(
"YMQ2", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 908.5, 0,
"ONLY");
2031 TVirtualMC::GetMC()->Gspos(
"MQX3", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 1558.5, 0,
"ONLY");
2032 TVirtualMC::GetMC()->Gspos(
"QBS5", 2,
"MQX3", 0., 0., 0., 0,
"ONLY");
2033 TVirtualMC::GetMC()->Gspos(
"QBS6", 3,
"MQX3", 2.405 + boxpar[0], 0., 0., 0,
"ONLY");
2034 TVirtualMC::GetMC()->Gspos(
"QBS6", 4,
"MQX3", -2.405 - boxpar[0], 0., 0., 0,
"ONLY");
2035 TVirtualMC::GetMC()->Gspos(
"YMQ2", 2,
"ZDCA", 0., 0., tubpar[2] + zITField + 1558.5, 0,
"ONLY");
2040 tubpar[1] = 6.75 / 2.;
2041 tubpar[2] = 945. / 2.;
2046 boxpar[0] = TMath::Sqrt(tubpar[1] * tubpar[1] - (2.885 + 0.2) * (2.885 + 0.2));
2047 boxpar[1] = 0.2 / 2.;
2048 boxpar[2] = 945. / 2.;
2049 TVirtualMC::GetMC()->Gsvolu(
"QBS7",
"BOX ",
getMediumID(
kCu), boxpar, 3);
2050 TVirtualMC::GetMC()->Gspos(
"QBS7", 1,
"MD1L", 0., 2.885 + boxpar[1], 0., 0,
"ONLY");
2051 TVirtualMC::GetMC()->Gspos(
"QBS7", 2,
"MD1L", 0., -2.885 - boxpar[1], 0., 0,
"ONLY");
2055 tubpar[1] = 110. / 2;
2056 tubpar[2] = 945. / 2.;
2059 TVirtualMC::GetMC()->Gspos(
"YD1L", 1,
"ZDCA", 0., 0., tubpar[2] + zD1Field, 0,
"ONLY");
2060 TVirtualMC::GetMC()->Gspos(
"MD1L", 1,
"ZDCA", 0., 0., tubpar[2] + zD1Field, 0,
"ONLY");
2065 tubpar[1] = 7.5 / 2.;
2066 tubpar[2] = 945. / 2.;
2072 tubpar[2] = 945. / 2.;
2074 TVirtualMC::GetMC()->Gspos(
"YD2L", 1,
"ZDCA", 0., 0., tubpar[2] + zD2Field, 0,
"ONLY");
2076 TVirtualMC::GetMC()->Gspos(
"MD2L", 1,
"YD2L", -9.4, 0., 0., 0,
"ONLY");
2077 TVirtualMC::GetMC()->Gspos(
"MD2L", 2,
"YD2L", 9.4, 0., 0., 0,
"ONLY");
2080void Detector::createDetectors()
2096void Detector::createZNZP()
2100 double znSupportBase[3] = {6.3, 4.57, 71.2};
2101 double znSupportBasePos[3] = {0., -14., 21.2};
2102 double znSupportScintillH[3] = {4.32 - 0.8, 0.8, 50.};
2103 double znSupportScintillV[3] = {0.8, 1.955, 50.};
2104 double znSupportWallsud[3] = {3.52, 1., 50.};
2105 double znSupportWallside[3] = {0.4, 5.52, 50.};
2107 float dimPb[6], dimVoid[6];
2118 TVirtualMC::GetMC()->Gsvolu(
"ZNF1",
"TUBE", mMediumPMCid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2119 TVirtualMC::GetMC()->Gsvolu(
"ZNF2",
"TUBE", mMediumPMQid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2120 TVirtualMC::GetMC()->Gsvolu(
"ZNF3",
"TUBE", mMediumPMQid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2121 TVirtualMC::GetMC()->Gsvolu(
"ZNF4",
"TUBE", mMediumPMCid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2141 TVirtualMC::GetMC()->Gspos(
"ZNG1", 1,
"ZNST", 0. - dx, 0. + dy, 0., 0,
"ONLY");
2142 TVirtualMC::GetMC()->Gspos(
"ZNG2", 1,
"ZNST", 0. + dx, 0. + dy, 0., 0,
"ONLY");
2143 TVirtualMC::GetMC()->Gspos(
"ZNG3", 1,
"ZNST", 0. - dx, 0. - dy, 0., 0,
"ONLY");
2144 TVirtualMC::GetMC()->Gspos(
"ZNG4", 1,
"ZNST", 0. + dx, 0. - dy, 0., 0,
"ONLY");
2147 TVirtualMC::GetMC()->Gspos(
"ZNF1", 1,
"ZNG1", 0., 0., 0., 0,
"ONLY");
2148 TVirtualMC::GetMC()->Gspos(
"ZNF2", 1,
"ZNG2", 0., 0., 0., 0,
"ONLY");
2149 TVirtualMC::GetMC()->Gspos(
"ZNF3", 1,
"ZNG3", 0., 0., 0., 0,
"ONLY");
2150 TVirtualMC::GetMC()->Gspos(
"ZNF4", 1,
"ZNG4", 0., 0., 0., 0,
"ONLY");
2155 double rangznc[6] = {90., 180., 90., 90., 180., 0.};
2156 TVirtualMC::GetMC()->Matrix(irotznc, rangznc[0], rangznc[1], rangznc[2], rangznc[3], rangznc[4], rangznc[5]);
2158 TVirtualMC::GetMC()->Gspos(
"ZNEU", 1,
"ZNENV", 0., 0., 0., 0,
"ONLY");
2168 TVirtualMC::GetMC()->Gsvolu(
"ZNBASE",
"BOX ",
getMediumID(
kAl), znSupportBase, 3);
2175 TVirtualMC::GetMC()->Gsvolu(
"ZNSCH",
"BOX ",
getMediumID(
kAl), znSupportScintillH, 3);
2181 TVirtualMC::GetMC()->Gsvolu(
"ZNSCV",
"BOX ",
getMediumID(
kAl), znSupportScintillV, 3);
2182 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 1,
"ZDCC",
Geometry::ZNCPOSITION[0] + znSupportBasePos[0] + znSupportScintillH[0] + znSupportScintillV[0],
2184 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 2,
"ZDCC",
Geometry::ZNCPOSITION[0] + znSupportBasePos[0] - znSupportScintillH[0] - znSupportScintillV[0],
2188 TVirtualMC::GetMC()->Gsvolu(
"ZNSCH",
"BOX ",
getMediumID(
kAl), znSupportScintillH, 3);
2194 TVirtualMC::GetMC()->Gsvolu(
"ZNSCV",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(znSupportScintillV), 3);
2195 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 1,
"ZDCA",
Geometry::ZNAPOSITION[0] + znSupportBasePos[0] + znSupportScintillH[0] + znSupportScintillV[0],
2197 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 2,
"ZDCA",
Geometry::ZNAPOSITION[0] + znSupportBasePos[0] - znSupportScintillH[0] - znSupportScintillV[0],
2202 TVirtualMC::GetMC()->Gsvolu(
"ZNBH",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(znSupportWallsud), 3);
2213 TVirtualMC::GetMC()->Gsvolu(
"ZNBS",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(znSupportWallside), 3);
2225 double zpSupportBase1[3] = {12.5, 1.4, 75.};
2226 double zpSupportBase1Pos[3] = {0., -17., 0.};
2227 double zpSupportBase2[3] = {12.5, 2.5, 75.};
2228 double zpSupportBase2Pos[3] = {0., -9., 0.};
2229 double zpSupportBase3[3] = {1.5, 2.05, 75.};
2230 double zpSupportWallBottom[3] = {11.2, 0.25, 75.};
2231 double zpSupportWallup[3] = {11.2, 1., 75.};
2233 double zpSupportWallside[3] = {0.5, 6., 75.};
2262 TVirtualMC::GetMC()->Gspos(
"ZPG1", 1,
"ZPST", 0. - dx, 0. + dy, 0., 0,
"ONLY");
2263 TVirtualMC::GetMC()->Gspos(
"ZPG2", 1,
"ZPST", 0. + dx, 0. + dy, 0., 0,
"ONLY");
2264 TVirtualMC::GetMC()->Gspos(
"ZPG3", 1,
"ZPST", 0. - dx, 0. - dy, 0., 0,
"ONLY");
2265 TVirtualMC::GetMC()->Gspos(
"ZPG4", 1,
"ZPST", 0. + dx, 0. - dy, 0., 0,
"ONLY");
2268 TVirtualMC::GetMC()->Gspos(
"ZPF1", 1,
"ZPG1", 0., 0., 0., 0,
"ONLY");
2269 TVirtualMC::GetMC()->Gspos(
"ZPF2", 1,
"ZPG2", 0., 0., 0., 0,
"ONLY");
2270 TVirtualMC::GetMC()->Gspos(
"ZPF3", 1,
"ZPG3", 0., 0., 0., 0,
"ONLY");
2271 TVirtualMC::GetMC()->Gspos(
"ZPF4", 1,
"ZPG4", 0., 0., 0., 0,
"ONLY");
2275 TVirtualMC::GetMC()->Gspos(
"ZPRO", 1,
"ZPENV", 0., 0., 0., 0,
"ONLY");
2285 TVirtualMC::GetMC()->Gsvolu(
"ZPBASE1",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportBase1), 3);
2292 TVirtualMC::GetMC()->Gsvolu(
"ZPFOOT",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportBase3), 3);
2299 TVirtualMC::GetMC()->Gsvolu(
"ZPBASE2",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportBase2), 3);
2307 TVirtualMC::GetMC()->Gsvolu(
"ZPBB",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportWallBottom), 3);
2314 TVirtualMC::GetMC()->Gsvolu(
"ZPBT",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportWallup), 3);
2321 TVirtualMC::GetMC()->Gsvolu(
"ZPBS",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportWallside), 3);
2329void Detector::createZEM()
2334 LOG(warning) <<
"ZDC: the ZEM calorimeters are not built";
2337 int32_t irotzem1, irotzem2;
2338 double rangzem1[6] = {0., 0., 90., 90., -90., 0.};
2339 double rangzem2[6] = {180., 0., 90., 45. + 90., 90., 45.};
2340 TVirtualMC::GetMC()->Matrix(irotzem1, rangzem1[0], rangzem1[1], rangzem1[2], rangzem1[3], rangzem1[4], rangzem1[5]);
2341 TVirtualMC::GetMC()->Matrix(irotzem2, rangzem2[0], rangzem2[1], rangzem2[2], rangzem2[3], rangzem2[4], rangzem2[5]);
2344 double zemTranLength = zemLength / 20.;
2345 double zemPbSlice[6] = {0.15 * TMath::Sqrt(2), 3.5, 3.5, 45., 0., 0.};
2346 double zemVoidLayer[6] = {(zemTranLength - 2. * zemPbSlice[0]) / 2., 3.5, 3.5, 45., 0., 0.};
2348 double zemSupportTable[3] = {55. / 2., 1.5 / 2., 110. / 2.};
2349 double zemSupportBox[6] = {10.5 / 2., 100. / 2., 95. / 2., 0.25 / 2., 2. / 2., 2. / 2.};
2350 double zemSupport1[3] = {15. / 2, 3. / 2., 95. / 2.};
2351 double zemSupport2[3] = {2. / 2, 5. / 2., 95. / 2.};
2352 double zemSupport3[3] = {3.5, 2. / 2., zemLength};
2353 double zemSupport4[6] = {20. / 2., 3.5, 1.5 / 2., 45., 0., 0.};
2354 double zemWallH[3] = {10.5 / 2., 1., 95. / 2.};
2355 double zemWallVfwd[3] = {10.5 / 2., (100. - 2.) / 2., 0.2};
2356 double zemWallVbkw[3] = {10.5 / 2., (100. - 2.) / 2., 2. / 2.};
2357 double zemWallVside[3] = {0.25 / 2., (100. - 2.) / 2., (95. - 2.) / 2.};
2363 TVirtualMC::GetMC()->Gsvolu(
"ZEL0",
"PARA",
getMediumID(
kPb),
const_cast<double*
>(zemPbSlice), 6);
2364 TVirtualMC::GetMC()->Gsvolu(
"ZEL1",
"PARA",
getMediumID(
kPb),
const_cast<double*
>(zemPbSlice), 6);
2365 TVirtualMC::GetMC()->Gsvolu(
"ZEL2",
"PARA",
getMediumID(
kPb),
const_cast<double*
>(zemPbSlice), 6);
2368 TVirtualMC::GetMC()->Gspos(
"ZEL0", 1,
"ZETR", -zemTranLength + zemPbSlice[0], 0., 0., 0,
"ONLY");
2369 TVirtualMC::GetMC()->Gspos(
"ZEL1", 1,
"ZETR", zemPbSlice[0], 0., 0., 0,
"ONLY");
2380 TVirtualMC::GetMC()->Gspos(
"ZEMF", 1,
"ZES0", 0., 0., 0., irotzem2,
"ONLY");
2381 TVirtualMC::GetMC()->Gspos(
"ZEMF", 1,
"ZES1", 0., 0., 0., irotzem2,
"ONLY");
2385 TVirtualMC::GetMC()->Gspos(
"ZEV0", 1,
"ZETR", -zemVoidLayer[0], 0., 0., 0,
"ONLY");
2386 TVirtualMC::GetMC()->Gspos(
"ZEV1", 1,
"ZETR", -zemVoidLayer[0] + zemTranLength, 0., 0., 0,
"ONLY");
2393 const float y0 = 30.;
2409 float zbox = zSupport + zemSupportBox[2];
2412 TVirtualMC::GetMC()->Gsvolu(
"ZESH",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupport1), 3);
2417 TVirtualMC::GetMC()->Gsvolu(
"ZESV",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupport2), 3);
2418 TVirtualMC::GetMC()->Gspos(
"ZESV", 1,
"barrel",
Geometry::ZEMPOSITION[0] - zemSupportBox[0] + zemSupport2[0], ybox - zemSupportBox[1] - zemSupport2[1] +
y0, zbox, 0,
"ONLY");
2419 TVirtualMC::GetMC()->Gspos(
"ZESV", 2,
"barrel",
Geometry::ZEMPOSITION[0] + zemSupportBox[0] - zemSupport2[0], ybox - zemSupportBox[1] - zemSupport2[1] +
y0, zbox, 0,
"ONLY");
2420 TVirtualMC::GetMC()->Gspos(
"ZESV", 3,
"barrel", -(
Geometry::ZEMPOSITION[0] - zemSupportBox[0] + zemSupport2[0]), ybox - zemSupportBox[1] - zemSupport2[1] +
y0, zbox, 0,
"ONLY");
2421 TVirtualMC::GetMC()->Gspos(
"ZESV", 4,
"barrel", -(
Geometry::ZEMPOSITION[0] + zemSupportBox[0] - zemSupport2[0]), ybox - zemSupportBox[1] - zemSupport2[1] +
y0, zbox, 0,
"ONLY");
2424 TVirtualMC::GetMC()->Gsvolu(
"ZETA",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupportTable), 3);
2425 float ytable = ybridge - zemSupport1[1] - zemSupportTable[1];
2426 TVirtualMC::GetMC()->Gspos(
"ZETA", 1,
"barrel", 0.0, ytable +
y0, zbox, 0,
"ONLY");
2427 TVirtualMC::GetMC()->Gspos(
"ZETA", 2,
"barrel", 0.0, ytable - 13. + 2. * zemSupportTable[1] +
y0, zbox, 0,
"ONLY");
2430 TVirtualMC::GetMC()->Gsvolu(
"ZEFL",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupport3), 3);
2434 TVirtualMC::GetMC()->Gsvolu(
"ZELA",
"PARA",
getMediumID(
kAl),
const_cast<double*
>(zemSupport4), 6);
2441 TVirtualMC::GetMC()->Gsvolu(
"ZEW1",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemWallH), 3);
2442 TVirtualMC::GetMC()->Gsvolu(
"ZEW2",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemWallVfwd), 3);
2443 TVirtualMC::GetMC()->Gsvolu(
"ZEW3",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemWallVbkw), 3);
2444 TVirtualMC::GetMC()->Gsvolu(
"ZEW4",
"BOX ",
getMediumID(
kFe),
const_cast<double*
>(zemWallVside), 3);
2447 float zh1 = zSupport + zemWallH[2];
2449 TVirtualMC::GetMC()->Gspos(
"ZEW1", 2,
"barrel",
Geometry::ZEMPOSITION[0], yh1 + 2 * zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2451 TVirtualMC::GetMC()->Gspos(
"ZEW1", 4,
"barrel", -
Geometry::ZEMPOSITION[0], yh1 + 2 * zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2453 TVirtualMC::GetMC()->Gspos(
"ZEW2", 1,
"barrel",
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1] +
y0, zSupport - zemWallVfwd[2], 0,
"ONLY");
2454 TVirtualMC::GetMC()->Gspos(
"ZEW3", 1,
"barrel",
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1] +
y0, zSupport + 2 * zemWallH[2], 0,
"ONLY");
2455 TVirtualMC::GetMC()->Gspos(
"ZEW2", 2,
"barrel", -
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1] +
y0, zSupport - zemWallVfwd[2], 0,
"ONLY");
2456 TVirtualMC::GetMC()->Gspos(
"ZEW3", 2,
"barrel", -
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1] +
y0, zSupport + 2 * zemWallH[2], 0,
"ONLY");
2460 TVirtualMC::GetMC()->Gspos(
"ZEW4", 1,
"barrel", xl1, yh1 + zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2461 TVirtualMC::GetMC()->Gspos(
"ZEW4", 2,
"barrel", xl2, yh1 + zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2462 TVirtualMC::GetMC()->Gspos(
"ZEW4", 3,
"barrel", -xl1, yh1 + zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2463 TVirtualMC::GetMC()->Gspos(
"ZEW4", 4,
"barrel", -xl2, yh1 + zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2475Bool_t Detector::withZEM()
2478 return std::find(modules.begin(), modules.end(),
"FOC") == modules.end();
2482Bool_t Detector::calculateTableIndexes(
int& ibeta,
int& iangle,
int& iradius)
2484 double x[3] = {0., 0., 0.}, xDet[3] = {0., 0., 0.},
p[3] = {0., 0., 0.}, energy = 0.;
2485 fMC->TrackPosition(
x[0],
x[1],
x[2]);
2486 fMC->TrackMomentum(p[0], p[1], p[2], energy);
2489 float ptot = TMath::Sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]);
2492 beta = ptot / energy;
2497 }
else if (beta > 0.75 && beta <= 0.85) {
2499 }
else if (beta > 0.85 && beta <= 0.95) {
2501 }
else if (beta > 0.95) {
2508 double umom[3] = {0., 0., 0.}, udet[3] = {0., 0., 0.};
2509 umom[0] =
p[0] / ptot;
2510 umom[1] =
p[1] / ptot;
2511 umom[2] =
p[2] / ptot;
2512 fMC->Gmtod(umom, udet, 2);
2513 double angleRad = TMath::ACos(udet[2]);
2514 double angleDeg = angleRad *
kRaddeg;
2515 if (angleDeg < 110.) {
2516 iangle =
int(0.5 + angleDeg / 2.);
2521 fMC->Gmtod(
x, xDet, 1);
2523 if (TMath::Abs(udet[0]) > 0) {
2524 float dcoeff = udet[1] / udet[0];
2525 radius = TMath::Abs((xDet[1] - dcoeff * xDet[0]) / TMath::Sqrt(dcoeff * dcoeff + 1.));
2527 radius = TMath::Abs(udet[0]);
2544 mLastPrincipalTrackEntered = -1;
2545 flushSpatialResponse();
2547#ifdef ZDC_FASTSIM_ONNX
2550 if (simparam.debugZDCFastSim && simparam.useZDCFastSim && mFastSimModelNeutron !=
nullptr && mFastSimModelProton !=
nullptr && mFastSimClassifier !=
nullptr) {
2551 std::fstream
output(
"o2sim-FastSimResult", std::fstream::out | std::fstream::app);
2553 LOG(
error) <<
"Could not open file.";
2556 for (
auto&
result : mFastSimResults) {
2560 mFastSimResults.clear();
2572 mLastPrincipalTrackEntered =
stack->GetCurrentTrackNumber();
2575 mCurrentPrincipalParticle = *
stack->GetCurrentTrack();
2577#ifdef ZDC_FASTSIM_ONNX
2580 if (simparam.useZDCFastSim && (mFastSimModelNeutron !=
nullptr || mFastSimModelProton !=
nullptr) && mFastSimClassifier !=
nullptr) {
2581 const std::vector<float> rawInput = {
static_cast<float>(mCurrentPrincipalParticle.Energy()),
2582 static_cast<float>(mCurrentPrincipalParticle.Vx()),
2583 static_cast<float>(mCurrentPrincipalParticle.Vy()),
2584 static_cast<float>(mCurrentPrincipalParticle.Vz()),
2585 static_cast<float>(mCurrentPrincipalParticle.Px()),
2586 static_cast<float>(mCurrentPrincipalParticle.Py()),
2587 static_cast<float>(mCurrentPrincipalParticle.Pz()),
2588 static_cast<float>(mCurrentPrincipalParticle.GetMass() * 1000.0),
2589 static_cast<float>(mCurrentPrincipalParticle.GetPDG()->Charge())};
2591 auto scaledClassParticle = mClassifierScaler->scale(rawInput);
2592 if (!scaledClassParticle.has_value()) {
2593 LOG(
error) <<
"FastSimModule: error occurred on scaling";
2595 vector<vector<float>> classifierInput = {std::move(*scaledClassParticle)};
2596 mFastSimClassifier->setInput(classifierInput);
2597 mFastSimClassifier->run();
2602 if (mModelScalerNeutron && mFastSimModelNeutron) {
2603 LOG(info) <<
"Generating fast hits for ZN";
2604 auto scaledModelParticleNeutron = mModelScalerNeutron->scale(rawInput);
2605 if (!scaledModelParticleNeutron.has_value()) {
2606 LOG(
error) <<
"FastSimModule: error occurred on scaling";
2609 mFastSimModelNeutron->setInput(modelInputNeutron);
2610 mFastSimModelNeutron->run();
2611 if (simparam.debugZDCFastSim) {
2615 bool forward = mCurrentPrincipalParticle.Pz() > 0.;
2616 FastSimToHits(mFastSimModelNeutron->getResult()[0], mCurrentPrincipalParticle, forward ?
ZNA :
ZNC);
2620 if (mModelScalerProton && mFastSimModelProton) {
2621 LOG(info) <<
"Generating fast hits for ZP";
2622 auto scaledModelParticleProton = mModelScalerProton->scale(rawInput);
2623 if (!scaledModelParticleProton.has_value()) {
2624 LOG(
error) <<
"FastSimModule: error occurred on scaling";
2627 mFastSimModelProton->setInput(modelInputProton);
2628 mFastSimModelProton->run();
2630 bool forward = mCurrentPrincipalParticle.Pz() > 0.;
2631 FastSimToHits(mFastSimModelProton->getResult()[0], mCurrentPrincipalParticle, forward ?
ZPA :
ZPC);
2647 if (FairRootManager::Instance()) {
2648 FairRootManager::Instance()->RegisterAny(
addNameTo(
"Hit").
data(), mHits, kTRUE);
2651 FairRootManager::Instance()->RegisterAny(
addNameTo(
"ResponseImage").
data(), mResponsesPtr, kTRUE);
2663 mLastPrincipalTrackEntered = -1;
2671#ifdef ZDC_FASTSIM_ONNX
2672bool Detector::FastSimToHits(
const Ort::Value& response,
const TParticle& particle,
int detector)
2674 math_utils::Vector3D<float> xImp(0., 0., 0.);
2677 auto [Nx, Ny] = determineDetectorSize(detector);
2679 if (Nx == -1 || Ny == -1) {
2684 auto pixels = response.GetTensorData<
float>();
2686 auto determineSectorID = [&Nx = Nx, &Ny = Ny](
int detector,
int x,
int y) {
2687 if (detector ==
ZNA || detector ==
ZNC) {
2688 if ((
x +
y) % 2 == 0) {
2706 if (detector ==
ZPA || detector ==
ZPC) {
2707 if ((
x +
y) % 2 == 0) {
2710 auto i = (
int)(4.f *
x / Nx);
2711 return (
int)(
i + 1);
2716 auto determineMediumID = [
this](
int detector,
int x,
int y) {
2718 return ((
x +
y) % 2 == 0) ? mMediumPMCid : mMediumPMQid;
2722 if (detector ==
ZPA) {
2724 }
else if (detector ==
ZPC) {
2726 }
else if (detector ==
ZNA) {
2728 }
else if (detector ==
ZNC) {
2732 LOG(fatal) <<
"Unsupported detector in ZDC fast sim";
2739 for (
int x = 0;
x < Nx; ++
x) {
2741 for (
int y = 0;
y < Ny; ++
y) {
2743 int sector = determineSectorID(detector,
x,
y);
2745 int currentMediumid = determineMediumID(detector,
x,
y);
2751 float trackenergy = 0;
2752 createOrAddHit(detector,
2762 0. , 0 , 0. , 0. , 0. , 0. , 0. );
Definition of the Stack class.
char error[CURL_ERROR_SIZE]
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()
std::vector< std::string > const & getActiveModules() const
static SimConfig & 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
GLuint GLfloat GLfloat y0
GLdouble GLdouble GLdouble z
uint8_t int statusCode int
D const SVectorGPU< T, D > & rhs
std::vector< T, fair::mq::pmr::polymorphic_allocator< T > > vector
struct o2::upgrades_utils::@482 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 ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"