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";
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]);
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) {
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);
545 const int Nx =
image.getNx();
546 const int Ny =
image.getNy();
550 auto determineSectorID = [Nx, Ny](
int detector,
int x,
int y) {
551 if (detector ==
ZNA || detector ==
ZNC) {
552 if ((
x +
y) % 2 == 0) {
570 if (detector ==
ZPA || detector ==
ZPC) {
571 if ((
x +
y) % 2 == 0) {
574 auto i = (
int)(4.f *
x / Nx);
580 auto determineMediumID = [
this](
int detector,
int x,
int y) {
582 return ((
x +
y) % 2 == 0) ? mMediumPMCid : mMediumPMQid;
586 for (
int x = 0;
x < Nx; ++
x) {
588 for (
int y = 0;
y < Ny; ++
y) {
590 int sector = determineSectorID(detector,
x,
y);
592 int currentMediumid = determineMediumID(detector,
x,
y);
596 float trackenergy = 0;
597 createOrAddHit(detector,
607 0. , 0 , 0. , 0. , 0. , 0. , 0. );
616 double energyloss, int32_t nphePMC, int32_t nphePMQ)
618 LOG(debug4) <<
"Adding hit for track " << trackID <<
" X (" <<
pos.X() <<
", " <<
pos.Y() <<
", "
619 <<
pos.Z() <<
") P (" << mom.X() <<
", " << mom.Y() <<
", " << mom.Z() <<
") Ekin "
620 << primaryEnergy <<
" lightPMC " << nphePMC <<
" lightPMQ " << nphePMQ << std::endl;
621 mHits->emplace_back(trackID, parentID, sFlag, primaryEnergy, detID, secID,
pos, mom,
622 tof, xImpact, energyloss, nphePMC, nphePMQ);
623 return &(mHits->back());
632 LOG(info) <<
"Detector::CreateMaterials >>>>> magnetic field: type " << ifield <<
" max " << fieldm <<
"\n";
636 float aW[3] = {183.85, 55.85, 58.71};
637 float zW[3] = {74., 26., 28.};
638 float wW[3] = {0.93, 0.03, 0.04};
642 float aCuZn[2] = {63.546, 65.39};
643 float zCuZn[2] = {29., 30.};
644 float wCuZn[2] = {0.63, 0.37};
648 float aq[2] = {28.0855, 15.9994};
649 float zq[2] = {14., 8.};
650 float wq[2] = {1., 2.};
657 float radPb = 6.37 / dPb;
658 float absPb = 199.6 / dPb;
664 float radCu = 12.86 / dCu;
665 float absCu = 137.3 / dCu;
672 float radFe = 13.84 / dFe;
673 float absFe = 132.1 / dFe;
679 float radAl = 24.01 / dAl;
680 float absAl = 107.2 / dAl;
686 float radCarb = 18.8;
687 float absCarb = 49.9;
690 float aResGas[3] = {1.008, 12.0107, 15.9994};
691 float zResGas[3] = {1., 6., 8.};
692 float wResGas[3] = {0.28, 0.28, 0.44};
693 float dResGas = 3.2E-14;
696 float aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
697 float zAir[4] = {6., 7., 8., 18.};
698 float wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
699 float dAir = 1.20479E-3;
702 int32_t notactiveMed = 0, sensMed = 1;
719 Mixture(0,
"Walloy$", aW, zW, dW, 3, wW);
720 Mixture(1,
"CuZn$", aCuZn, zCuZn, dCuZn, 2, wCuZn);
721 Mixture(2,
"SiO2$", aq, zq, dq, -2, wq);
722 Material(3,
"Pb $", aPb, zPb, dPb, radPb, absPb);
723 Material(4,
"Cu $", aCu, zCu, dCu, radCu, absCu);
724 Material(5,
"Fe $", aFe, zFe, dFe, radFe, absFe);
725 Material(6,
"Al $", aAl, zAl, dAl, radAl, absAl);
726 Material(7,
"graphite$", aCarb, zCarb, dCarb, radCarb, absCarb);
727 Mixture(8,
"residualGas$", aResGas, zResGas, dResGas, 3, wResGas);
728 Mixture(9,
"Air$", aAir, zAir, dAir, 4, wAir);
731 Medium(
kWalloy,
"Walloy$", 0, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
732 Medium(
kCuZn,
"CuZn$", 1, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
733 Medium(
kSiO2pmc,
"quartzPMC$", 2, sensMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
734 Medium(
kSiO2pmq,
"quartzPMQ$", 2, sensMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
735 Medium(
kPb,
"Lead$", 3, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
736 Medium(
kCu,
"Copper$", 4, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
737 Medium(
kCuLumi,
"CopperLowTh$", 4, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
738 Medium(
kFe,
"Iron$", 5, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
739 Medium(
kFeLowTh,
"IronLowTh$", 5, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
740 Medium(
kAl,
"Aluminum$", 6, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
741 Medium(
kGraphite,
"Graphite$", 7, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
742 Medium(
kVoidNoField,
"VoidNoField$", 8, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
743 Medium(
kVoidwField,
"VoidwField$", 8, notactiveMed, ifld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
744 Medium(
kAir,
"Air$", 9, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
748void Detector::createAsideBeamLine()
751 double tubpar[3] = {0., 0., 0};
752 float boxpar[3] = {0., 0., 0};
753 double tubspar[5] = {0., 0., 0., 0., 0.};
754 double conpar[15] = {0.};
768 TVirtualMC::GetMC()->Gspos(
"ZDCA", 1,
"cave", 0., 0., 0., 0,
"ONLY");
771 tubpar[0] = 6.0 / 2.;
772 tubpar[1] = 6.4 / 2.;
773 tubpar[2] = (386.28 - 0.18) / 2.;
774 TVirtualMC::GetMC()->Gsvolu(
"QA01",
"TUBE",
getMediumID(
kFe), tubpar, 3);
775 TVirtualMC::GetMC()->Gspos(
"QA01", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
777 zA += 2. * tubpar[2];
780 tubpar[0] = 6.3 / 2.;
781 tubpar[1] = 6.7 / 2.;
782 tubpar[2] = 3541.8 / 2.;
783 TVirtualMC::GetMC()->Gsvolu(
"QA02",
"TUBE",
getMediumID(
kFe), tubpar, 3);
784 TVirtualMC::GetMC()->Gspos(
"QA02", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
786 zA += 2. * tubpar[2];
796 tubpar[0] = 6.75 / 2.;
797 tubpar[1] = 7.15 / 2.;
798 tubpar[2] = (945.0 + 80.1) / 2.;
799 TVirtualMC::GetMC()->Gsvolu(
"QA03",
"TUBE",
getMediumID(
kFe), tubpar, 3);
800 TVirtualMC::GetMC()->Gspos(
"QA03", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
802 zA += 2. * tubpar[2];
805 conpar[0] = 2.5 / 2.;
806 conpar[1] = 6.75 / 2.;
807 conpar[2] = 7.15 / 2.;
808 conpar[3] = 8.0 / 2.;
809 conpar[4] = 8.4 / 2.;
810 TVirtualMC::GetMC()->Gsvolu(
"QA04",
"CONE",
getMediumID(
kFe), conpar, 5);
811 TVirtualMC::GetMC()->Gspos(
"QA04", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
813 zA += 2. * conpar[0];
815 tubpar[0] = 8.0 / 2.;
816 tubpar[1] = 8.4 / 2.;
817 tubpar[2] = (43.9 + 20. + 28.5 + 28.5) / 2.;
818 TVirtualMC::GetMC()->Gsvolu(
"QA05",
"TUBE",
getMediumID(
kFe), tubpar, 3);
819 TVirtualMC::GetMC()->Gspos(
"QA05", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
821 zA += 2. * tubpar[2];
824 conpar[0] = 4.0 / 2.;
825 conpar[1] = 8.0 / 2.;
826 conpar[2] = 8.4 / 2.;
827 conpar[3] = 9.8 / 2.;
828 conpar[4] = 10.2 / 2.;
829 TVirtualMC::GetMC()->Gsvolu(
"QAV1",
"CONE",
getMediumID(
kFe), conpar, 5);
830 TVirtualMC::GetMC()->Gspos(
"QAV1", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
832 zA += 2. * conpar[0];
835 conpar[0] = 1.0 / 2.;
836 conpar[1] = 9.8 / 2.;
837 conpar[2] = 10.2 / 2.;
838 conpar[3] = 9.0 / 2.;
839 conpar[4] = 9.4 / 2.;
840 TVirtualMC::GetMC()->Gsvolu(
"QAV2",
"CONE",
getMediumID(
kFe), conpar, 5);
841 TVirtualMC::GetMC()->Gspos(
"QAV2", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
843 zA += 2. * conpar[0];
846 tubpar[0] = 9.0 / 2.;
847 tubpar[1] = 9.4 / 2.;
848 tubpar[2] = 31.0 / 2.;
849 TVirtualMC::GetMC()->Gsvolu(
"QAV3",
"TUBE",
getMediumID(
kFe), tubpar, 3);
850 TVirtualMC::GetMC()->Gspos(
"QAV3", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
852 zA += 2. * tubpar[2];
857 conpar[0] = 1.3 / 2.;
858 conpar[1] = 9.0 / 2.;
859 conpar[2] = 13.0 / 2.;
860 conpar[3] = 9.6 / 2.;
861 conpar[4] = 13.0 / 2.;
862 TVirtualMC::GetMC()->Gsvolu(
"Q01T",
"CONE",
getMediumID(
kFe), conpar, 5);
863 TVirtualMC::GetMC()->Gspos(
"Q01T", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
865 zA += 2. * conpar[0];
868 tubpar[0] = 9.6 / 2.;
869 tubpar[1] = 10.0 / 2.;
870 tubpar[2] = 1.0 / 2.;
871 TVirtualMC::GetMC()->Gsvolu(
"Q02T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
872 TVirtualMC::GetMC()->Gspos(
"Q02T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
874 zA += 2. * tubpar[2];
877 conpar[0] = 9.04 / 2.;
878 conpar[1] = 9.6 / 2.;
879 conpar[2] = 10.0 / 2.;
880 conpar[3] = 13.8 / 2.;
881 conpar[4] = 14.2 / 2.;
882 TVirtualMC::GetMC()->Gsvolu(
"Q03T",
"CONE",
getMediumID(
kFe), conpar, 5);
883 TVirtualMC::GetMC()->Gspos(
"Q03T", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
885 zA += 2. * conpar[0];
888 tubpar[0] = 13.8 / 2.;
889 tubpar[1] = 14.2 / 2.;
890 tubpar[2] = 38.6 / 2.;
891 TVirtualMC::GetMC()->Gsvolu(
"Q04T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
892 TVirtualMC::GetMC()->Gspos(
"Q04T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
894 zA += 2. * tubpar[2];
897 tubpar[0] = 21.0 / 2.;
898 tubpar[1] = 21.4 / 2.;
899 tubpar[2] = 100.12 / 2.;
900 TVirtualMC::GetMC()->Gsvolu(
"Q05T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
901 TVirtualMC::GetMC()->Gspos(
"Q05T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
903 zA += 2. * tubpar[2];
906 tubpar[0] = 13.8 / 2.;
907 tubpar[1] = 14.2 / 2.;
908 tubpar[2] = 38.6 / 2.;
909 TVirtualMC::GetMC()->Gsvolu(
"Q06T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
910 TVirtualMC::GetMC()->Gspos(
"Q06T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
912 zA += 2. * tubpar[2];
915 conpar[0] = 11.34 / 2.;
916 conpar[1] = 13.8 / 2.;
917 conpar[2] = 14.2 / 2.;
918 conpar[3] = 18.0 / 2.;
919 conpar[4] = 18.4 / 2.;
920 TVirtualMC::GetMC()->Gsvolu(
"Q07T",
"CONE",
getMediumID(
kFe), conpar, 5);
921 TVirtualMC::GetMC()->Gspos(
"Q07T", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
923 zA += 2. * conpar[0];
929 tubspar[0] = 0.0 / 2.;
930 tubspar[1] = 14.0 / 2.;
931 tubspar[2] = 100.0 / 2.;
934 TVirtualMC::GetMC()->Gsvolu(
"Q08T",
"TUBS",
getMediumID(
kFe), tubspar, 5);
937 boxpar[0] = 7.0 / 2.;
938 boxpar[1] = 2.2 / 2.;
939 boxpar[2] = 100. / 2.;
942 TVirtualMC::GetMC()->Gspos(
"Q09T", 1,
"Q08T", 0., 1.1, 0., 0,
"ONLY");
945 tubspar[0] = 0.0 / 2.;
946 tubspar[1] = 14.0 / 2.;
947 tubspar[2] = 100.0 / 2.;
950 TVirtualMC::GetMC()->Gsvolu(
"Q10T",
"TUBS",
getMediumID(
kFe), tubspar, 5);
952 boxpar[0] = 7.0 / 2.;
953 boxpar[1] = 2.2 / 2.;
954 boxpar[2] = 100. / 2.;
957 TVirtualMC::GetMC()->Gspos(
"Q11T", 1,
"Q10T", 0., -1.1, 0., 0,
"ONLY");
961 double TCDDAperturePos = 2.2;
962 double TCDDApertureNeg = 2.4;
963 TVirtualMC::GetMC()->Gspos(
"Q08T", 1,
"ZDCA", 0., TCDDAperturePos, -100. + zA, 0,
"ONLY");
964 TVirtualMC::GetMC()->Gspos(
"Q10T", 1,
"ZDCA", 0., -TCDDApertureNeg, -100. + zA, 0,
"ONLY");
967 boxpar[0] = 0.2 / 2.;
968 boxpar[1] = 4.0 / 2.;
969 boxpar[2] = 100. / 2.;
970 TVirtualMC::GetMC()->Gsvolu(
"Q12T",
"BOX ",
getMediumID(
kFe), boxpar, 3);
972 TVirtualMC::GetMC()->Gspos(
"Q12T", 1,
"ZDCA", tubspar[1] + boxpar[0], 0., -100. + zA, 0,
"ONLY");
973 TVirtualMC::GetMC()->Gspos(
"Q12T", 2,
"ZDCA", -tubspar[1] - boxpar[0], 0., -100. + zA, 0,
"ONLY");
979 tubpar[0] = 18.4 / 2.;
980 tubpar[1] = 7.4 / 2.;
981 tubpar[2] = (78 + 9.3) / 2.;
982 TVirtualMC::GetMC()->Gsvolu(
"QA06",
"ELTU",
getMediumID(
kFe), tubpar, 3);
989 tubpar[0] = 18.0 / 2.;
990 tubpar[1] = 7.0 / 2.;
991 tubpar[2] = (78 + 9.3) / 2.;
998 TVirtualMC::GetMC()->Gspos(
"QA06", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
999 TVirtualMC::GetMC()->Gspos(
"QA07", 1,
"QA06", 0., 0., 0., 0,
"ONLY");
1001 zA += 2. * tubpar[2];
1004 conpar[0] = 31.5 / 2.;
1005 conpar[1] = 18.0 / 2.;
1006 conpar[2] = 18.6 / 2.;
1007 conpar[3] = 21.27 / 2.;
1008 conpar[4] = 21.87 / 2.;
1009 TVirtualMC::GetMC()->Gsvolu(
"QA08",
"CONE",
getMediumID(
kFe), conpar, 5);
1010 TVirtualMC::GetMC()->Gspos(
"QA08", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1012 zA += 2. * conpar[0];
1015 int32_t irotpipe3, irotpipe4, irotpipe5;
1016 double rang3[6] = {90. - 1.8934, 0., 90., 90., 1.8934, 180.};
1017 double rang4[6] = {90. - 3.8, 0., 90., 90., 3.8, 180.};
1018 double rang5[6] = {90. + 9.8, 0., 90., 90., 9.8, 0.};
1019 TVirtualMC::GetMC()->Matrix(irotpipe3, rang3[0], rang3[1], rang3[2], rang3[3], rang3[4], rang3[5]);
1020 TVirtualMC::GetMC()->Matrix(irotpipe4, rang4[0], rang4[1], rang4[2], rang4[3], rang4[4], rang4[5]);
1021 TVirtualMC::GetMC()->Matrix(irotpipe5, rang5[0], rang5[1], rang5[2], rang5[3], rang5[4], rang5[5]);
1026 tubpar[0] = 21.27 / 2.;
1027 tubpar[1] = 21.87 / 2.;
1028 tubpar[2] = (195.7 + 148. + 78.) / 2.;
1029 TVirtualMC::GetMC()->Gsvolu(
"QA09",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1030 TVirtualMC::GetMC()->Gspos(
"QA09", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1032 zA += 2. * tubpar[2];
1035 conpar[0] = (50.0 - 0.73 - 1.13) / 2.;
1036 conpar[1] = 21.27 / 2.;
1037 conpar[2] = 21.87 / 2.;
1038 conpar[3] = 33.2 / 2.;
1039 conpar[4] = 33.8 / 2.;
1040 TVirtualMC::GetMC()->Gsvolu(
"QA10",
"CONE",
getMediumID(
kFe), conpar, 5);
1041 TVirtualMC::GetMC()->Gspos(
"QA10", 1,
"ZDCA", -1.66, 0., conpar[0] + 0.73 + zA, irotpipe4,
"ONLY");
1043 zA += 2. * conpar[0] + 0.73 + 1.13;
1047 tubpar[1] = 54.6 / 2.;
1048 tubpar[2] = 540.0 / 2.;
1050 TVirtualMC::GetMC()->Gspos(
"Q13TM", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1051 tubpar[0] = 54.0 / 2.;
1052 tubpar[1] = 54.6 / 2.;
1053 tubpar[2] = 540.0 / 2.;
1054 TVirtualMC::GetMC()->Gsvolu(
"Q13T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1055 TVirtualMC::GetMC()->Gspos(
"Q13T", 1,
"Q13TM", 0., 0., 0., 0,
"ONLY");
1057 zA += 2. * tubpar[2];
1060 boxpar[0] = 11.0 / 2.;
1061 boxpar[1] = 9.0 / 2.;
1062 boxpar[2] = 418.5 / 2.;
1063 double TDIAperturePos = 6.;
1064 TVirtualMC::GetMC()->Gsvolu(
"QTD1",
"BOX ",
getMediumID(
kFe), boxpar, 3);
1065 TVirtualMC::GetMC()->Gspos(
"QTD1", 1,
"Q13TM", -3.8, boxpar[1] + TDIAperturePos, 0., 0,
"ONLY");
1066 boxpar[0] = 11.0 / 2.;
1067 boxpar[1] = 9.0 / 2.;
1068 boxpar[2] = 418.5 / 2.;
1069 TVirtualMC::GetMC()->Gsvolu(
"QTD2",
"BOX ",
getMediumID(
kFe), boxpar, 3);
1070 double TDIApertureNeg = 6.;
1071 TVirtualMC::GetMC()->Gspos(
"QTD2", 1,
"Q13TM", -3.8, -boxpar[1] - TDIApertureNeg, 0., 0,
"ONLY");
1072 boxpar[0] = 5.1 / 2.;
1073 boxpar[1] = 0.2 / 2.;
1074 boxpar[2] = 418.5 / 2.;
1075 TVirtualMC::GetMC()->Gsvolu(
"QTD3",
"BOX ",
getMediumID(
kFe), boxpar, 3);
1076 TVirtualMC::GetMC()->Gspos(
"QTD3", 1,
"Q13TM", -3.8 + 5.5 + boxpar[0], TDIAperturePos, 0., 0,
"ONLY");
1077 TVirtualMC::GetMC()->Gspos(
"QTD3", 2,
"Q13TM", -3.8 + 5.5 + boxpar[0], -TDIApertureNeg, 0., 0,
"ONLY");
1078 TVirtualMC::GetMC()->Gspos(
"QTD3", 3,
"Q13TM", -3.8 - 5.5 - boxpar[0], TDIAperturePos, 0., 0,
"ONLY");
1079 TVirtualMC::GetMC()->Gspos(
"QTD3", 4,
"Q13TM", -3.8 - 5.5 - boxpar[0], -TDIApertureNeg, 0., 0,
"ONLY");
1081 tubspar[0] = 12.0 / 2.;
1082 tubspar[1] = 12.4 / 2.;
1083 tubspar[2] = 418.5 / 2.;
1086 TVirtualMC::GetMC()->Gsvolu(
"QTD4",
"TUBS",
getMediumID(
kCu), tubspar, 5);
1087 TVirtualMC::GetMC()->Gspos(
"QTD4", 1,
"Q13TM", -3.8 - 10.6, 0., 0., 0,
"ONLY");
1088 tubspar[0] = 12.0 / 2.;
1089 tubspar[1] = 12.4 / 2.;
1090 tubspar[2] = 418.5 / 2.;
1093 TVirtualMC::GetMC()->Gsvolu(
"QTD5",
"TUBS",
getMediumID(
kCu), tubspar, 5);
1094 TVirtualMC::GetMC()->Gspos(
"QTD5", 1,
"Q13TM", -3.8 + 10.6, 0., 0., 0,
"ONLY");
1098 conpar[0] = (50.0 - 2.92 - 1.89) / 2.;
1099 conpar[1] = 33.2 / 2.;
1100 conpar[2] = 33.8 / 2.;
1101 conpar[3] = 21.27 / 2.;
1102 conpar[4] = 21.87 / 2.;
1103 TVirtualMC::GetMC()->Gsvolu(
"QA11",
"CONE",
getMediumID(
kFe), conpar, 5);
1104 TVirtualMC::GetMC()->Gspos(
"QA11", 1,
"ZDCA", 4.32 - 3.8, 0., conpar[0] + 2.92 + zA, irotpipe5,
"ONLY");
1106 zA += 2. * conpar[0] + 2.92 + 1.89;
1111 tubpar[0] = 21.27 / 2.;
1112 tubpar[1] = 21.87 / 2.;
1113 tubpar[2] = 210.0 / 2.;
1114 TVirtualMC::GetMC()->Gsvolu(
"QA12",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1115 TVirtualMC::GetMC()->Gspos(
"QA12", 1,
"ZDCA", 4., 0., tubpar[2] + zA, 0,
"ONLY");
1117 zA += 2. * tubpar[2];
1121 conpar[0] = (121.0 - 0.37 - 1.35) / 2.;
1122 conpar[1] = 21.27 / 2.;
1123 conpar[2] = 21.87 / 2.;
1124 conpar[3] = 79.7 / 2.;
1125 conpar[4] = 81.3 / 2.;
1126 TVirtualMC::GetMC()->Gsvolu(
"QA13",
"CONE",
getMediumID(
kFe), conpar, 5);
1127 TVirtualMC::GetMC()->Gspos(
"QA13", 1,
"ZDCA", 4. - 2., 0., conpar[0] + 0.37 + zA, irotpipe3,
"ONLY");
1129 zA += 2. * conpar[0] + 0.37 + 1.35;
1133 tubpar[0] = 79.7 / 2.;
1134 tubpar[1] = 81.3 / 2.;
1135 tubpar[2] = (2221. - 136.) / 2.;
1136 TVirtualMC::GetMC()->Gsvolu(
"QA14",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1137 TVirtualMC::GetMC()->Gspos(
"QA14", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1139 zA += 2. * tubpar[2];
1147 conpar[0] = 9.09 / 2.;
1148 conpar[1] = 79.7 / 2.;
1149 conpar[2] = 81.3 / 2.;
1150 conpar[3] = 74.82868 / 2.;
1151 conpar[4] = 76.42868 / 2.;
1152 TVirtualMC::GetMC()->Gsvolu(
"QA15",
"CONE",
getMediumID(
kFe), conpar, 5);
1153 TVirtualMC::GetMC()->Gspos(
"QA15", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1155 zA += 2. * conpar[0];
1158 conpar[0] = 96.2 / 2.;
1159 conpar[1] = 74.82868 / 2.;
1160 conpar[2] = 75.42868 / 2.;
1161 conpar[3] = 23.19588 / 2.;
1162 conpar[4] = 23.79588 / 2.;
1163 TVirtualMC::GetMC()->Gsvolu(
"QA16",
"CONE",
getMediumID(
kFe), conpar, 5);
1164 TVirtualMC::GetMC()->Gspos(
"QA16", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1166 zA += 2. * conpar[0];
1169 conpar[0] = 6.71 / 2.;
1170 conpar[1] = 23.19588 / 2.;
1171 conpar[2] = 24.79588 / 2.;
1172 conpar[3] = 19.6 / 2.;
1173 conpar[4] = 21.2 / 2.;
1174 TVirtualMC::GetMC()->Gsvolu(
"QA17",
"CONE",
getMediumID(
kFe), conpar, 5);
1175 TVirtualMC::GetMC()->Gspos(
"QA17", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1177 zA += 2. * conpar[0];
1180 tubpar[0] = 19.6 / 2.;
1181 tubpar[1] = 21.2 / 2.;
1182 tubpar[2] = 9.55 / 2.;
1183 TVirtualMC::GetMC()->Gsvolu(
"QA18",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1184 TVirtualMC::GetMC()->Gspos(
"QA18", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1186 zA += 2. * tubpar[2];
1189 tubpar[0] = 19.6 / 2.;
1190 tubpar[1] = 25.3 / 2.;
1191 tubpar[2] = 4.9 / 2.;
1192 TVirtualMC::GetMC()->Gsvolu(
"QF01",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1193 TVirtualMC::GetMC()->Gspos(
"QF01", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1195 zA += 2. * tubpar[2];
1198 tubpar[0] = 20.2 / 2.;
1199 tubpar[1] = 20.6 / 2.;
1200 tubpar[2] = 2.15 / 2.;
1201 TVirtualMC::GetMC()->Gsvolu(
"QA19",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1202 TVirtualMC::GetMC()->Gspos(
"QA19", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1204 zA += 2. * tubpar[2];
1206 conpar[0] = 6.9 / 2.;
1207 conpar[1] = 20.2 / 2.;
1208 conpar[2] = 20.6 / 2.;
1209 conpar[3] = 23.9 / 2.;
1210 conpar[4] = 24.3 / 2.;
1211 TVirtualMC::GetMC()->Gsvolu(
"QA20",
"CONE",
getMediumID(
kFe), conpar, 5);
1212 TVirtualMC::GetMC()->Gspos(
"QA20", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1214 zA += 2. * conpar[0];
1216 tubpar[0] = 23.9 / 2.;
1217 tubpar[1] = 25.5 / 2.;
1218 tubpar[2] = 17.0 / 2.;
1219 TVirtualMC::GetMC()->Gsvolu(
"QA21",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1220 TVirtualMC::GetMC()->Gspos(
"QA21", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1222 zA += 2. * tubpar[2];
1224 conpar[0] = 6.9 / 2.;
1225 conpar[1] = 23.9 / 2.;
1226 conpar[2] = 24.3 / 2.;
1227 conpar[3] = 20.2 / 2.;
1228 conpar[4] = 20.6 / 2.;
1229 TVirtualMC::GetMC()->Gsvolu(
"QA22",
"CONE",
getMediumID(
kFe), conpar, 5);
1230 TVirtualMC::GetMC()->Gspos(
"QA22", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1232 zA += 2. * conpar[0];
1234 tubpar[0] = 20.2 / 2.;
1235 tubpar[1] = 20.6 / 2.;
1236 tubpar[2] = 2.15 / 2.;
1237 TVirtualMC::GetMC()->Gsvolu(
"QA23",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1238 TVirtualMC::GetMC()->Gspos(
"QA23", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1240 zA += 2. * tubpar[2];
1243 tubpar[0] = 19.6 / 2.;
1244 tubpar[1] = 25.3 / 2.;
1245 tubpar[2] = 4.9 / 2.;
1246 TVirtualMC::GetMC()->Gsvolu(
"QF02",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1247 TVirtualMC::GetMC()->Gspos(
"QF02", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1249 zA += 2. * tubpar[2];
1252 tubpar[0] = 19.6 / 2.;
1253 tubpar[1] = 20.0 / 2.;
1254 tubpar[2] = 3.9 / 2.;
1255 TVirtualMC::GetMC()->Gsvolu(
"QA24",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1256 TVirtualMC::GetMC()->Gspos(
"QA24", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1258 zA += 2. * tubpar[2];
1261 conpar[0] = 32.55 / 2.;
1262 conpar[1] = 19.6 / 2.;
1263 conpar[2] = 20.0 / 2.;
1264 conpar[3] = 21.66 / 2.;
1265 conpar[4] = 22.06 / 2.;
1266 TVirtualMC::GetMC()->Gsvolu(
"QA25",
"CONE",
getMediumID(
kFe), conpar, 5);
1267 TVirtualMC::GetMC()->Gspos(
"QA25", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1269 zA += 2. * conpar[0];
1272 tubpar[0] = 21.66 / 2.;
1273 tubpar[1] = 22.06 / 2.;
1274 tubpar[2] = 28.6 / 2.;
1275 TVirtualMC::GetMC()->Gsvolu(
"QA26",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1276 TVirtualMC::GetMC()->Gspos(
"QA26", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1278 zA += 2. * tubpar[2];
1283 double dx = -3.970000;
1284 double dy = 0.000000;
1287 double thx = 84.989100;
1288 double phx = 0.000000;
1289 double thy = 90.000000;
1290 double phy = 90.000000;
1291 double thz = 5.010900;
1292 double phz = 180.000000;
1293 TGeoRotation* rotMatrix1 =
new TGeoRotation(
"", thx, phx, thy, phy, thz, phz);
1295 TGeoCombiTrans* rotMatrix2 =
new TGeoCombiTrans(
"ZDC_c1", dx, dy, dz, rotMatrix1);
1296 rotMatrix2->RegisterYourself();
1299 double thx3 = 95.010900;
1300 double phx3 = 0.000000;
1301 double thy3 = 90.000000;
1302 double phy3 = 90.000000;
1303 double thz3 = 5.010900;
1304 double phz3 = 0.000000;
1305 TGeoRotation* rotMatrix3 =
new TGeoRotation(
"", thx3, phx3, thy3, phy3, thz3, phz3);
1306 TGeoCombiTrans* rotMatrix4 =
new TGeoCombiTrans(
"ZDC_c2", -dx, dy, dz, rotMatrix3);
1307 rotMatrix4->RegisterYourself();
1310 int32_t irotpipe1, irotpipe2;
1311 double rang1[6] = {90. - 1.0027, 0., 90., 90., 1.0027, 180.};
1312 double rang2[6] = {90. + 1.0027, 0., 90., 90., 1.0027, 0.};
1313 TVirtualMC::GetMC()->Matrix(irotpipe1, rang1[0], rang1[1], rang1[2], rang1[3], rang1[4], rang1[5]);
1314 TVirtualMC::GetMC()->Matrix(irotpipe2, rang2[0], rang2[1], rang2[2], rang2[3], rang2[4], rang2[5]);
1318 TGeoVolume* pZDCA = gGeoManager->GetVolume(
"ZDCA");
1320 conpar[0] = (90.1 - 0.95 - 0.26) / 2.;
1321 conpar[1] = 0.0 / 2.;
1322 conpar[2] = 21.6 / 2.;
1323 conpar[3] = 0.0 / 2.;
1324 conpar[4] = 5.8 / 2.;
1325 new TGeoCone(
"QALext", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1327 conpar[0] = (90.1 - 0.95 - 0.26) / 2.;
1328 conpar[1] = 0.0 / 2.;
1329 conpar[2] = 21.2 / 2.;
1330 conpar[3] = 0.0 / 2.;
1331 conpar[4] = 5.4 / 2.;
1332 new TGeoCone(
"QALint", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1335 TGeoCompositeShape* pOutTrousers =
new TGeoCompositeShape(
"outTrousers",
"QALext:ZDC_c1+QALext:ZDC_c2");
1340 TGeoVolume* pQALext =
new TGeoVolume(
"QALext", pOutTrousers, matmgr.getTGeoMedium(
"ZDC",
kFeLowTh));
1341 pQALext->SetLineColor(kBlue);
1342 pQALext->SetVisLeaves(kTRUE);
1344 TGeoTranslation* tr1 =
new TGeoTranslation(0., 0., (
double)conpar[0] + 0.95 + zA);
1345 pZDCA->AddNode(pQALext, 1, tr1);
1347 TGeoCompositeShape* pIntTrousers =
new TGeoCompositeShape(
"intTrousers",
"QALint:ZDC_c1+QALint:ZDC_c2");
1349 TGeoVolume* pQALint =
new TGeoVolume(
"QALint", pIntTrousers, matmgr.getTGeoMedium(
"ZDC",
kVoidNoField));
1350 pQALint->SetLineColor(kAzure);
1351 pQALint->SetVisLeaves(kTRUE);
1352 pQALext->AddNode(pQALint, 1);
1357 tubpar[0] = 5.4 / 2.;
1358 tubpar[1] = 5.8 / 2.;
1359 tubpar[2] = 40.0 / 2.;
1360 TVirtualMC::GetMC()->Gsvolu(
"QA27",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1361 TVirtualMC::GetMC()->Gspos(
"QA27", 1,
"ZDCA", -15.8 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1362 TVirtualMC::GetMC()->Gspos(
"QA27", 2,
"ZDCA", 15.8 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1364 zA += 2. * tubpar[2];
1367 conpar[0] = (10. - 1.) / 2.;
1368 conpar[1] = 5.4 / 2.;
1369 conpar[2] = 5.8 / 2.;
1370 conpar[3] = 6.3 / 2.;
1371 conpar[4] = 7.0 / 2.;
1372 TVirtualMC::GetMC()->Gsvolu(
"QA28",
"CONE",
getMediumID(
kFe), conpar, 5);
1373 TVirtualMC::GetMC()->Gspos(
"QA28", 1,
"ZDCA", -7.9 - 0.175, 0., conpar[0] + 0.5 + zA, irotpipe1,
"ONLY");
1374 TVirtualMC::GetMC()->Gspos(
"QA28", 2,
"ZDCA", 7.9 + 0.175, 0., conpar[0] + 0.5 + zA, irotpipe2,
"ONLY");
1376 zA += 2. * conpar[0] + 1.;
1379 tubpar[0] = 6.3 / 2.;
1380 tubpar[1] = 7.0 / 2.;
1381 tubpar[2] = (342.5 + 498.3) / 2.;
1382 TVirtualMC::GetMC()->Gsvolu(
"QA29",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1383 TVirtualMC::GetMC()->Gspos(
"QA29", 1,
"ZDCA", -16.5 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1384 TVirtualMC::GetMC()->Gspos(
"QA29", 2,
"ZDCA", 16.5 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1387 zA += 2. * tubpar[2];
1390 if (mLumiLength > 0.) {
1391 boxpar[0] = 8.0 / 2.;
1392 boxpar[1] = 8.0 / 2.;
1393 boxpar[2] = mLumiLength / 2.;
1395 TVirtualMC::GetMC()->Gspos(
"QLUA", 1,
"ZDCA", 0., 0.,
Geometry::ZNAPOSITION[1] - 66. - boxpar[2], 0,
"ONLY");
1396 LOG(
debug) <<
"A-side luminometer positioned in front of ZNA\n";
1401void Detector::createCsideBeamLine()
1403 double tubpar[3] = {0., 0., 0};
1404 float boxpar[3] = {0., 0., 0};
1405 double tubspar[5] = {0., 0., 0., 0., 0.};
1406 double conpar[15] = {
1411 float zCompensator = 1974.;
1416 conpar[3] = -13500.;
1419 conpar[6] = -zCompensator;
1422 conpar[9] = -zCompensator;
1424 conpar[11] = 6.7 / 2.;
1427 conpar[14] = 6.7 / 2.;
1429 TVirtualMC::GetMC()->Gspos(
"ZDCC", 1,
"cave", 0., 0., 0., 0,
"ONLY");
1432 tubpar[0] = 6.3 / 2.;
1433 tubpar[1] = 6.7 / 2.;
1435 tubpar[2] = (5838.3 - zC) / 2.;
1436 TVirtualMC::GetMC()->Gsvolu(
"QT01",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1437 TVirtualMC::GetMC()->Gspos(
"QT01", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1439 zC += 2. * tubpar[2];
1444 tubpar[0] = 6.94 / 2.;
1445 tubpar[1] = 7.34 / 2.;
1446 tubpar[2] = (6909.8 - zC) / 2.;
1447 TVirtualMC::GetMC()->Gsvolu(
"QT02",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1448 TVirtualMC::GetMC()->Gspos(
"QT02", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1450 zC += 2. * tubpar[2];
1452 tubpar[0] = 8. / 2.;
1453 tubpar[1] = 8.6 / 2.;
1454 tubpar[2] = (6958.3 - zC) / 2.;
1455 TVirtualMC::GetMC()->Gsvolu(
"QT0B",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1456 TVirtualMC::GetMC()->Gspos(
"QT0B", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1458 zC += 2. * tubpar[2];
1460 tubpar[0] = 9. / 2.;
1461 tubpar[1] = 9.6 / 2.;
1462 tubpar[2] = (7022.8 - zC) / 2.;
1463 TVirtualMC::GetMC()->Gsvolu(
"QT03",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1464 TVirtualMC::GetMC()->Gspos(
"QT03", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1466 zC += 2. * tubpar[2];
1468 conpar[0] = 39.2 / 2.;
1469 conpar[1] = 18. / 2.;
1470 conpar[2] = 18.6 / 2.;
1471 conpar[3] = 9. / 2.;
1472 conpar[4] = 9.6 / 2.;
1473 TVirtualMC::GetMC()->Gsvolu(
"QC01",
"CONE",
getMediumID(
kFe), conpar, 5);
1474 TVirtualMC::GetMC()->Gspos(
"QC01", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1476 zC += conpar[0] * 2.;
1479 float totLength1 = 160.8 + 78. + 148. + 78. + 9.3;
1481 tubpar[0] = 18.6 / 2.;
1482 tubpar[1] = 7.6 / 2.;
1483 tubpar[2] = totLength1 / 2.;
1484 TVirtualMC::GetMC()->Gsvolu(
"QE01",
"ELTU",
getMediumID(
kFe), tubpar, 3);
1491 tubpar[0] = 18.0 / 2.;
1492 tubpar[1] = 7.0 / 2.;
1493 tubpar[2] = totLength1 / 2.;
1501 TVirtualMC::GetMC()->Gspos(
"QE01", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1502 TVirtualMC::GetMC()->Gspos(
"QE02", 1,
"QE01", 0., 0., 0., 0,
"ONLY");
1505 if (mTCLIAAPERTURE < 3.5) {
1506 boxpar[0] = 5.4 / 2.;
1507 boxpar[1] = (3.5 - mTCLIAAPERTURE - mVCollSideCCentreY - 0.7) / 2.;
1508 if (boxpar[1] < 0.) {
1511 boxpar[2] = 124.4 / 2.;
1513 TVirtualMC::GetMC()->Gspos(
"QCVC", 1,
"QE02", -boxpar[0], mTCLIAAPERTURE + mVCollSideCCentreY + boxpar[1], -totLength1 / 2. + 160.8 + 78. + 148. / 2., 0,
"ONLY");
1514 TVirtualMC::GetMC()->Gspos(
"QCVC", 2,
"QE02", -boxpar[0], -mTCLIAAPERTURENEG + mVCollSideCCentreY - boxpar[1], -totLength1 / 2. + 160.8 + 78. + 148. / 2., 0,
"ONLY");
1517 zC += tubpar[2] * 2.;
1520 conpar[0] = 31.5 / 2.;
1521 conpar[1] = 21.27 / 2.;
1522 conpar[2] = 21.87 / 2.;
1523 conpar[3] = 18.0 / 2.;
1524 conpar[4] = 18.6 / 2.;
1525 TVirtualMC::GetMC()->Gsvolu(
"QC02",
"CONE",
getMediumID(
kFe), conpar, 5);
1526 TVirtualMC::GetMC()->Gspos(
"QC02", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1528 zC += conpar[0] * 2.;
1531 float totLenght2 = (8373.3 - zC);
1532 tubpar[0] = 21.2 / 2.;
1533 tubpar[1] = 21.9 / 2.;
1534 tubpar[2] = totLenght2 / 2.;
1536 TVirtualMC::GetMC()->Gspos(
"QT04", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1538 zC += tubpar[2] * 2.;
1542 conpar[0] = 121. / 2.;
1543 conpar[1] = 79.7 / 2.;
1544 conpar[2] = 81.3 / 2.;
1545 conpar[3] = 21.27 / 2.;
1546 conpar[4] = 21.87 / 2.;
1548 TVirtualMC::GetMC()->Gspos(
"QC03", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1550 zC += 2. * conpar[0];
1553 tubpar[0] = 79.7 / 2.;
1554 tubpar[1] = 81.3 / 2.;
1555 tubpar[2] = (5 * 475.2 + 97. - 136) / 2.;
1557 TVirtualMC::GetMC()->Gspos(
"QT05", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1559 zC += 2. * tubpar[2];
1568 conpar[0] = 9.09 / 2.;
1569 conpar[1] = 74.82868 / 2.;
1570 conpar[2] = 76.42868 / 2.;
1571 conpar[3] = 79.7 / 2.;
1572 conpar[4] = 81.3 / 2.;
1574 TVirtualMC::GetMC()->Gspos(
"QC04", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1576 zC += 2. * conpar[0];
1579 conpar[0] = 96.2 / 2.;
1580 conpar[1] = 23.19588 / 2.;
1581 conpar[2] = 23.79588 / 2.;
1582 conpar[3] = 74.82868 / 2.;
1583 conpar[4] = 75.42868 / 2.;
1585 TVirtualMC::GetMC()->Gspos(
"QC05", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1587 zC += 2. * conpar[0];
1590 conpar[0] = 6.71 / 2.;
1591 conpar[1] = 19.6 / 2.;
1592 conpar[2] = 21.2 / 2.;
1593 conpar[3] = 23.19588 / 2.;
1594 conpar[4] = 24.79588 / 2.;
1596 TVirtualMC::GetMC()->Gspos(
"QC06", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1598 zC += 2. * conpar[0];
1601 tubpar[0] = 20.2 / 2.;
1602 tubpar[1] = 20.6 / 2.;
1603 tubpar[2] = 2.15 / 2.;
1605 TVirtualMC::GetMC()->Gspos(
"QT06", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1607 zC += 2. * tubpar[2];
1609 conpar[0] = 6.9 / 2.;
1610 conpar[1] = 23.9 / 2.;
1611 conpar[2] = 24.3 / 2.;
1612 conpar[3] = 20.2 / 2.;
1613 conpar[4] = 20.6 / 2.;
1615 TVirtualMC::GetMC()->Gspos(
"QC07", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1617 zC += 2. * conpar[0];
1619 tubpar[0] = 23.9 / 2.;
1620 tubpar[1] = 25.5 / 2.;
1621 tubpar[2] = 17.0 / 2.;
1623 TVirtualMC::GetMC()->Gspos(
"QT07", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1625 zC += 2. * tubpar[2];
1627 conpar[0] = 6.9 / 2.;
1628 conpar[1] = 20.2 / 2.;
1629 conpar[2] = 20.6 / 2.;
1630 conpar[3] = 23.9 / 2.;
1631 conpar[4] = 24.3 / 2.;
1633 TVirtualMC::GetMC()->Gspos(
"QC08", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1635 zC += 2. * conpar[0];
1637 tubpar[0] = 20.2 / 2.;
1638 tubpar[1] = 20.6 / 2.;
1639 tubpar[2] = 2.15 / 2.;
1641 TVirtualMC::GetMC()->Gspos(
"QT08", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1643 zC += 2. * tubpar[2];
1646 tubpar[0] = 19.6 / 2.;
1647 tubpar[1] = 25.3 / 2.;
1648 tubpar[2] = 4.9 / 2.;
1650 TVirtualMC::GetMC()->Gspos(
"QT09", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1652 zC += 2. * tubpar[2];
1655 tubpar[0] = 19.6 / 2.;
1656 tubpar[1] = 20.0 / 2.;
1657 tubpar[2] = 3.9 / 2.;
1659 TVirtualMC::GetMC()->Gspos(
"QT10", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1661 zC += 2. * tubpar[2];
1664 conpar[0] = 32.55 / 2.;
1665 conpar[1] = 21.66 / 2.;
1666 conpar[2] = 22.06 / 2.;
1667 conpar[3] = 19.6 / 2.;
1668 conpar[4] = 20.0 / 2.;
1670 TVirtualMC::GetMC()->Gspos(
"QC09", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1672 zC += 2. * conpar[0];
1675 tubpar[0] = 21.66 / 2.;
1676 tubpar[1] = 22.06 / 2.;
1677 tubpar[2] = 28.6 / 2.;
1679 TVirtualMC::GetMC()->Gspos(
"QT11", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1681 zC += 2. * tubpar[2];
1686 double dx = -3.970000;
1687 double dy = 0.000000;
1690 double thx = 84.989100;
1691 double phx = 180.000000;
1692 double thy = 90.000000;
1693 double phy = 90.000000;
1694 double thz = 185.010900;
1695 double phz = 0.000000;
1696 TGeoRotation* rotMatrix1c =
new TGeoRotation(
"c", thx, phx, thy, phy, thz, phz);
1701 TGeoCombiTrans* rotMatrix2c =
new TGeoCombiTrans(
"ZDCC_c1", dx, dy, dz, rotMatrix1c);
1702 rotMatrix2c->RegisterYourself();
1712 thz = 180. - 5.010900;
1714 TGeoRotation* rotMatrix3c =
new TGeoRotation(
"", thx, phx, thy, phy, thz, phz);
1715 TGeoCombiTrans* rotMatrix4c =
new TGeoCombiTrans(
"ZDCC_c2", dx, dy, dz, rotMatrix3c);
1716 rotMatrix4c->RegisterYourself();
1720 TGeoVolume* pZDCC = gGeoManager->GetVolume(
"ZDCC");
1722 conpar[0] = (90.1 - 0.95 - 0.26 - 0.0085) / 2.;
1723 conpar[1] = 0.0 / 2.;
1724 conpar[2] = 21.6 / 2.;
1725 conpar[3] = 0.0 / 2.;
1726 conpar[4] = 5.8 / 2.;
1727 new TGeoCone(
"QCLext", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1729 conpar[0] = (90.1 - 0.95 - 0.26 - 0.0085) / 2.;
1730 conpar[1] = 0.0 / 2.;
1731 conpar[2] = 21.2 / 2.;
1732 conpar[3] = 0.0 / 2.;
1733 conpar[4] = 5.4 / 2.;
1734 new TGeoCone(
"QCLint", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1737 TGeoCompositeShape* pOutTrousersC =
new TGeoCompositeShape(
"outTrousersC",
"QCLext:ZDCC_c1+QCLext:ZDCC_c2");
1742 TGeoMedium* medZDCFeLowTh = gGeoManager->GetMedium(
"ZDC_IronLowTh$");
1743 TGeoVolume* pQCLext =
new TGeoVolume(
"QCLext", pOutTrousersC, medZDCFeLowTh);
1744 pQCLext->SetLineColor(kAzure);
1745 pQCLext->SetVisLeaves(kTRUE);
1747 TGeoTranslation* tr1c =
new TGeoTranslation(0., 0., (
double)-conpar[0] - 0.95 - zC);
1749 pZDCC->AddNode(pQCLext, 1, tr1c);
1751 TGeoCompositeShape* pIntTrousersC =
new TGeoCompositeShape(
"intTrousersC",
"QCLint:ZDCC_c1+QCLint:ZDCC_c2");
1753 TGeoMedium* medZDCvoid = gGeoManager->GetMedium(
"ZDC_VoidNoField$");
1754 TGeoVolume* pQCLint =
new TGeoVolume(
"QCLint", pIntTrousersC, medZDCvoid);
1755 pQCLint->SetLineColor(kBlue);
1756 pQCLint->SetVisLeaves(kTRUE);
1757 pQCLext->AddNode(pQCLint, 1);
1764 tubpar[0] = 5.4 / 2.;
1765 tubpar[1] = 5.8 / 2.;
1766 tubpar[2] = 40.0 / 2.;
1768 TVirtualMC::GetMC()->Gspos(
"QT12", 1,
"ZDCC", -15.8 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1769 TVirtualMC::GetMC()->Gspos(
"QT12", 2,
"ZDCC", 15.8 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1771 zC += 2. * tubpar[2];
1774 int32_t irotpipe1, irotpipe2;
1775 double rang1[6] = {90. - 1.0027, 0., 90., 90., 1.0027, 180.};
1776 double rang2[6] = {90. + 1.0027, 0., 90., 90., 1.0027, 0.};
1777 TVirtualMC::GetMC()->Matrix(irotpipe1, rang1[0], rang1[1], rang1[2], rang1[3], rang1[4], rang1[5]);
1778 TVirtualMC::GetMC()->Matrix(irotpipe2, rang2[0], rang2[1], rang2[2], rang2[3], rang2[4], rang2[5]);
1781 conpar[0] = (10. - 0.2 -
offset) / 2.;
1782 conpar[1] = 6.3 / 2.;
1783 conpar[2] = 7.0 / 2.;
1784 conpar[3] = 5.4 / 2.;
1785 conpar[4] = 5.8 / 2.;
1787 TVirtualMC::GetMC()->Gspos(
"QC10", 1,
"ZDCC", -7.9 - 0.175, 0., -conpar[0] - 0.1 - zC, irotpipe1,
"ONLY");
1788 TVirtualMC::GetMC()->Gspos(
"QC10", 2,
"ZDCC", 7.9 + 0.175, 0., -conpar[0] - 0.1 - zC, irotpipe2,
"ONLY");
1790 zC += 2. * conpar[0] + 0.2;
1793 tubpar[0] = 6.3 / 2.;
1794 tubpar[1] = 7.0 / 2.;
1795 tubpar[2] = 639.8 / 2.;
1797 TVirtualMC::GetMC()->Gspos(
"QT13", 1,
"ZDCC", -16.5 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1798 TVirtualMC::GetMC()->Gspos(
"QT13", 2,
"ZDCC", 16.5 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1800 zC += 2. * tubpar[2];
1803 if (mLumiLength > 0.) {
1804 boxpar[0] = 8.0 / 2.;
1805 boxpar[1] = 8.0 / 2.;
1806 boxpar[2] = mLumiLength / 2.;
1808 TVirtualMC::GetMC()->Gspos(
"QLUC", 1,
"ZDCC", 0., 0.,
Geometry::ZNCPOSITION[1] + 66. + boxpar[2], 0,
"ONLY");
1809 LOG(
debug) <<
"C-side luminometer positioned in front of ZNC\n";
1814void Detector::createMagnets()
1816 float tubpar[3] = {0., 0., 0.};
1817 float boxpar[3] = {0., 0., 0.};
1819 double zCompensatorField = 1972.5;
1820 double zITField = 2296.5;
1821 double zD1Field = 5838.3001;
1822 double zD2Field = 12167.8;
1833 tubpar[2] = 153. / 2.;
1835 TVirtualMC::GetMC()->Gspos(
"MBXW", 1,
"ZDCC", 0., 0., -tubpar[2] - zCompensatorField, 0,
"ONLY");
1840 tubpar[2] = 150. / 2.;
1842 TVirtualMC::GetMC()->Gspos(
"YMBX", 1,
"ZDCC", 0., 0., -tubpar[2] - zCompensatorField - 1.5, 0,
"ONLY");
1850 tubpar[2] = 637. / 2.;
1856 tubpar[2] = 637. / 2.;
1859 TVirtualMC::GetMC()->Gspos(
"MQXL", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField, 0,
"ONLY");
1860 TVirtualMC::GetMC()->Gspos(
"YMQL", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField, 0,
"ONLY");
1862 TVirtualMC::GetMC()->Gspos(
"MQXL", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 2400., 0,
"ONLY");
1863 TVirtualMC::GetMC()->Gspos(
"YMQL", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 2400., 0,
"ONLY");
1869 tubpar[2] = 550. / 2.;
1875 tubpar[2] = 550. / 2.;
1878 TVirtualMC::GetMC()->Gspos(
"MQX ", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField - 908.5, 0,
"ONLY");
1879 TVirtualMC::GetMC()->Gspos(
"YMQ ", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField - 908.5, 0,
"ONLY");
1881 TVirtualMC::GetMC()->Gspos(
"MQX ", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 1558.5, 0,
"ONLY");
1882 TVirtualMC::GetMC()->Gspos(
"YMQ ", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 1558.5, 0,
"ONLY");
1888 tubpar[2] = 945. / 2.;
1893 boxpar[0] = TMath::Sqrt(tubpar[1] * tubpar[1] - (2.98 + 0.2) * (2.98 + 0.2)) - 0.05;
1894 boxpar[1] = 0.2 / 2.;
1895 boxpar[2] = 945. / 2.;
1896 TVirtualMC::GetMC()->Gsvolu(
"MD1V",
"BOX ",
getMediumID(
kCu), boxpar, 3);
1897 TVirtualMC::GetMC()->Gspos(
"MD1V", 1,
"MD1 ", 0., 2.98 + boxpar[1], 0., 0,
"ONLY");
1898 TVirtualMC::GetMC()->Gspos(
"MD1V", 2,
"MD1 ", 0., -2.98 - boxpar[1], 0., 0,
"ONLY");
1902 tubpar[1] = 110. / 2.;
1903 tubpar[2] = 945. / 2.;
1906 TVirtualMC::GetMC()->Gspos(
"YD1 ", 1,
"ZDCC", 0., 0., -tubpar[2] - zD1Field, 0,
"ONLY");
1907 TVirtualMC::GetMC()->Gspos(
"MD1 ", 1,
"ZDCC", 0., 0., -tubpar[2] - zD1Field, 0,
"ONLY");
1912 tubpar[1] = 7.5 / 2.;
1913 tubpar[2] = 945. / 2.;
1919 tubpar[2] = 945. / 2.;
1921 TVirtualMC::GetMC()->Gspos(
"YD2 ", 1,
"ZDCC", 0., 0., -tubpar[2] - zD2Field, 0,
"ONLY");
1923 TVirtualMC::GetMC()->Gspos(
"MD2 ", 1,
"YD2 ", -9.4, 0., 0., 0,
"ONLY");
1924 TVirtualMC::GetMC()->Gspos(
"MD2 ", 2,
"YD2 ", 9.4, 0., 0., 0,
"ONLY");
1934 tubpar[2] = 153. / 2.;
1936 TVirtualMC::GetMC()->Gspos(
"MCBW", 1,
"ZDCA", 0., 0., tubpar[2] + zCompensatorField, 0,
"ONLY");
1941 tubpar[2] = 153. / 2.;
1943 TVirtualMC::GetMC()->Gspos(
"YMCB", 1,
"ZDCA", 0., 0., tubpar[2] + zCompensatorField, 0,
"ONLY");
1951 tubpar[2] = 637. / 2.;
1958 tubpar[2] = 637. / 2.;
1962 TVirtualMC::GetMC()->Gspos(
"MQX1", 1,
"ZDCA", 0., 0., tubpar[2] + zITField, 0,
"ONLY");
1963 TVirtualMC::GetMC()->Gspos(
"YMQ1", 1,
"ZDCA", 0., 0., tubpar[2] + zITField, 0,
"ONLY");
1966 tubpar[0] = 4.78 / 2.;
1967 tubpar[1] = 5.18 / 2.;
1968 tubpar[2] = 637. / 2.;
1969 TVirtualMC::GetMC()->Gsvolu(
"QBS1",
"TUBE",
getMediumID(
kCu), tubpar, 3);
1970 TVirtualMC::GetMC()->Gspos(
"QBS1", 1,
"MQX1", 0., 0., 0., 0,
"ONLY");
1972 boxpar[0] = 0.2 / 2.0;
1973 boxpar[1] = TMath::Sqrt(tubpar[0] * tubpar[0] - (1.9 + 0.2) * (1.9 + 0.2));
1974 boxpar[2] = 637. / 2.;
1975 TVirtualMC::GetMC()->Gsvolu(
"QBS2",
"BOX ",
getMediumID(
kCu), boxpar, 3);
1976 TVirtualMC::GetMC()->Gspos(
"QBS2", 1,
"MQX1", 1.9 + boxpar[0], 0., 0., 0,
"ONLY");
1977 TVirtualMC::GetMC()->Gspos(
"QBS2", 2,
"MQX1", -1.9 - boxpar[0], 0., 0., 0,
"ONLY");
1980 TVirtualMC::GetMC()->Gspos(
"MQX4", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 2400., 0,
"ONLY");
1981 TVirtualMC::GetMC()->Gspos(
"YMQ1", 2,
"ZDCA", 0., 0., tubpar[2] + zITField + 2400., 0,
"ONLY");
1984 tubpar[0] = 5.79 / 2.;
1985 tubpar[1] = 6.14 / 2.;
1986 tubpar[2] = 637. / 2.;
1987 TVirtualMC::GetMC()->Gsvolu(
"QBS3",
"TUBE",
getMediumID(
kCu), tubpar, 3);
1988 TVirtualMC::GetMC()->Gspos(
"QBS3", 1,
"MQX4", 0., 0., 0., 0,
"ONLY");
1990 boxpar[0] = 0.2 / 2.0;
1991 boxpar[1] = TMath::Sqrt(tubpar[0] * tubpar[0] - (2.405 + 0.2) * (2.405 + 0.2));
1992 boxpar[2] = 637. / 2.;
1993 TVirtualMC::GetMC()->Gsvolu(
"QBS4",
"BOX ",
getMediumID(
kCu), boxpar, 3);
1994 TVirtualMC::GetMC()->Gspos(
"QBS4", 1,
"MQX4", 2.405 + boxpar[0], 0., 0., 0,
"ONLY");
1995 TVirtualMC::GetMC()->Gspos(
"QBS4", 2,
"MQX4", -2.405 - boxpar[0], 0., 0., 0,
"ONLY");
2001 tubpar[2] = 550. / 2.;
2008 tubpar[2] = 550. / 2.;
2012 tubpar[0] = 5.79 / 2.;
2013 tubpar[1] = 6.14 / 2.;
2014 tubpar[2] = 550. / 2.;
2015 TVirtualMC::GetMC()->Gsvolu(
"QBS5",
"TUBE",
getMediumID(
kCu), tubpar, 3);
2017 boxpar[0] = 0.2 / 2.0;
2018 boxpar[1] = TMath::Sqrt(tubpar[0] * tubpar[0] - (2.405 + 0.2) * (2.405 + 0.2));
2019 boxpar[2] = 550. / 2.;
2020 TVirtualMC::GetMC()->Gsvolu(
"QBS6",
"BOX ",
getMediumID(
kCu), boxpar, 3);
2023 TVirtualMC::GetMC()->Gspos(
"MQX2", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 908.5, 0,
"ONLY");
2024 TVirtualMC::GetMC()->Gspos(
"QBS5", 1,
"MQX2", 0., 0., 0., 0,
"ONLY");
2025 TVirtualMC::GetMC()->Gspos(
"QBS6", 1,
"MQX2", 2.405 + boxpar[0], 0., 0., 0,
"ONLY");
2026 TVirtualMC::GetMC()->Gspos(
"QBS6", 2,
"MQX2", -2.405 - boxpar[0], 0., 0., 0,
"ONLY");
2027 TVirtualMC::GetMC()->Gspos(
"YMQ2", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 908.5, 0,
"ONLY");
2030 TVirtualMC::GetMC()->Gspos(
"MQX3", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 1558.5, 0,
"ONLY");
2031 TVirtualMC::GetMC()->Gspos(
"QBS5", 2,
"MQX3", 0., 0., 0., 0,
"ONLY");
2032 TVirtualMC::GetMC()->Gspos(
"QBS6", 3,
"MQX3", 2.405 + boxpar[0], 0., 0., 0,
"ONLY");
2033 TVirtualMC::GetMC()->Gspos(
"QBS6", 4,
"MQX3", -2.405 - boxpar[0], 0., 0., 0,
"ONLY");
2034 TVirtualMC::GetMC()->Gspos(
"YMQ2", 2,
"ZDCA", 0., 0., tubpar[2] + zITField + 1558.5, 0,
"ONLY");
2039 tubpar[1] = 6.75 / 2.;
2040 tubpar[2] = 945. / 2.;
2045 boxpar[0] = TMath::Sqrt(tubpar[1] * tubpar[1] - (2.885 + 0.2) * (2.885 + 0.2));
2046 boxpar[1] = 0.2 / 2.;
2047 boxpar[2] = 945. / 2.;
2048 TVirtualMC::GetMC()->Gsvolu(
"QBS7",
"BOX ",
getMediumID(
kCu), boxpar, 3);
2049 TVirtualMC::GetMC()->Gspos(
"QBS7", 1,
"MD1L", 0., 2.885 + boxpar[1], 0., 0,
"ONLY");
2050 TVirtualMC::GetMC()->Gspos(
"QBS7", 2,
"MD1L", 0., -2.885 - boxpar[1], 0., 0,
"ONLY");
2054 tubpar[1] = 110. / 2;
2055 tubpar[2] = 945. / 2.;
2058 TVirtualMC::GetMC()->Gspos(
"YD1L", 1,
"ZDCA", 0., 0., tubpar[2] + zD1Field, 0,
"ONLY");
2059 TVirtualMC::GetMC()->Gspos(
"MD1L", 1,
"ZDCA", 0., 0., tubpar[2] + zD1Field, 0,
"ONLY");
2064 tubpar[1] = 7.5 / 2.;
2065 tubpar[2] = 945. / 2.;
2071 tubpar[2] = 945. / 2.;
2073 TVirtualMC::GetMC()->Gspos(
"YD2L", 1,
"ZDCA", 0., 0., tubpar[2] + zD2Field, 0,
"ONLY");
2075 TVirtualMC::GetMC()->Gspos(
"MD2L", 1,
"YD2L", -9.4, 0., 0., 0,
"ONLY");
2076 TVirtualMC::GetMC()->Gspos(
"MD2L", 2,
"YD2L", 9.4, 0., 0., 0,
"ONLY");
2079void Detector::createDetectors()
2095void Detector::createZNZP()
2099 double znSupportBase[3] = {6.3, 4.57, 71.2};
2100 double znSupportBasePos[3] = {0., -14., 21.2};
2101 double znSupportScintillH[3] = {4.32 - 0.8, 0.8, 50.};
2102 double znSupportScintillV[3] = {0.8, 1.955, 50.};
2103 double znSupportWallsud[3] = {3.52, 1., 50.};
2104 double znSupportWallside[3] = {0.4, 5.52, 50.};
2106 float dimPb[6], dimVoid[6];
2117 TVirtualMC::GetMC()->Gsvolu(
"ZNF1",
"TUBE", mMediumPMCid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2118 TVirtualMC::GetMC()->Gsvolu(
"ZNF2",
"TUBE", mMediumPMQid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2119 TVirtualMC::GetMC()->Gsvolu(
"ZNF3",
"TUBE", mMediumPMQid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2120 TVirtualMC::GetMC()->Gsvolu(
"ZNF4",
"TUBE", mMediumPMCid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2140 TVirtualMC::GetMC()->Gspos(
"ZNG1", 1,
"ZNST", 0. - dx, 0. + dy, 0., 0,
"ONLY");
2141 TVirtualMC::GetMC()->Gspos(
"ZNG2", 1,
"ZNST", 0. + dx, 0. + dy, 0., 0,
"ONLY");
2142 TVirtualMC::GetMC()->Gspos(
"ZNG3", 1,
"ZNST", 0. - dx, 0. - dy, 0., 0,
"ONLY");
2143 TVirtualMC::GetMC()->Gspos(
"ZNG4", 1,
"ZNST", 0. + dx, 0. - dy, 0., 0,
"ONLY");
2146 TVirtualMC::GetMC()->Gspos(
"ZNF1", 1,
"ZNG1", 0., 0., 0., 0,
"ONLY");
2147 TVirtualMC::GetMC()->Gspos(
"ZNF2", 1,
"ZNG2", 0., 0., 0., 0,
"ONLY");
2148 TVirtualMC::GetMC()->Gspos(
"ZNF3", 1,
"ZNG3", 0., 0., 0., 0,
"ONLY");
2149 TVirtualMC::GetMC()->Gspos(
"ZNF4", 1,
"ZNG4", 0., 0., 0., 0,
"ONLY");
2154 double rangznc[6] = {90., 180., 90., 90., 180., 0.};
2155 TVirtualMC::GetMC()->Matrix(irotznc, rangznc[0], rangznc[1], rangznc[2], rangznc[3], rangznc[4], rangznc[5]);
2157 TVirtualMC::GetMC()->Gspos(
"ZNEU", 1,
"ZNENV", 0., 0., 0., 0,
"ONLY");
2167 TVirtualMC::GetMC()->Gsvolu(
"ZNBASE",
"BOX ",
getMediumID(
kAl), znSupportBase, 3);
2174 TVirtualMC::GetMC()->Gsvolu(
"ZNSCH",
"BOX ",
getMediumID(
kAl), znSupportScintillH, 3);
2180 TVirtualMC::GetMC()->Gsvolu(
"ZNSCV",
"BOX ",
getMediumID(
kAl), znSupportScintillV, 3);
2181 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 1,
"ZDCC",
Geometry::ZNCPOSITION[0] + znSupportBasePos[0] + znSupportScintillH[0] + znSupportScintillV[0],
2183 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 2,
"ZDCC",
Geometry::ZNCPOSITION[0] + znSupportBasePos[0] - znSupportScintillH[0] - znSupportScintillV[0],
2187 TVirtualMC::GetMC()->Gsvolu(
"ZNSCH",
"BOX ",
getMediumID(
kAl), znSupportScintillH, 3);
2193 TVirtualMC::GetMC()->Gsvolu(
"ZNSCV",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(znSupportScintillV), 3);
2194 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 1,
"ZDCA",
Geometry::ZNAPOSITION[0] + znSupportBasePos[0] + znSupportScintillH[0] + znSupportScintillV[0],
2196 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 2,
"ZDCA",
Geometry::ZNAPOSITION[0] + znSupportBasePos[0] - znSupportScintillH[0] - znSupportScintillV[0],
2201 TVirtualMC::GetMC()->Gsvolu(
"ZNBH",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(znSupportWallsud), 3);
2212 TVirtualMC::GetMC()->Gsvolu(
"ZNBS",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(znSupportWallside), 3);
2224 double zpSupportBase1[3] = {12.5, 1.4, 75.};
2225 double zpSupportBase1Pos[3] = {0., -17., 0.};
2226 double zpSupportBase2[3] = {12.5, 2.5, 75.};
2227 double zpSupportBase2Pos[3] = {0., -9., 0.};
2228 double zpSupportBase3[3] = {1.5, 2.05, 75.};
2229 double zpSupportWallBottom[3] = {11.2, 0.25, 75.};
2230 double zpSupportWallup[3] = {11.2, 1., 75.};
2232 double zpSupportWallside[3] = {0.5, 6., 75.};
2261 TVirtualMC::GetMC()->Gspos(
"ZPG1", 1,
"ZPST", 0. - dx, 0. + dy, 0., 0,
"ONLY");
2262 TVirtualMC::GetMC()->Gspos(
"ZPG2", 1,
"ZPST", 0. + dx, 0. + dy, 0., 0,
"ONLY");
2263 TVirtualMC::GetMC()->Gspos(
"ZPG3", 1,
"ZPST", 0. - dx, 0. - dy, 0., 0,
"ONLY");
2264 TVirtualMC::GetMC()->Gspos(
"ZPG4", 1,
"ZPST", 0. + dx, 0. - dy, 0., 0,
"ONLY");
2267 TVirtualMC::GetMC()->Gspos(
"ZPF1", 1,
"ZPG1", 0., 0., 0., 0,
"ONLY");
2268 TVirtualMC::GetMC()->Gspos(
"ZPF2", 1,
"ZPG2", 0., 0., 0., 0,
"ONLY");
2269 TVirtualMC::GetMC()->Gspos(
"ZPF3", 1,
"ZPG3", 0., 0., 0., 0,
"ONLY");
2270 TVirtualMC::GetMC()->Gspos(
"ZPF4", 1,
"ZPG4", 0., 0., 0., 0,
"ONLY");
2274 TVirtualMC::GetMC()->Gspos(
"ZPRO", 1,
"ZPENV", 0., 0., 0., 0,
"ONLY");
2284 TVirtualMC::GetMC()->Gsvolu(
"ZPBASE1",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportBase1), 3);
2291 TVirtualMC::GetMC()->Gsvolu(
"ZPFOOT",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportBase3), 3);
2298 TVirtualMC::GetMC()->Gsvolu(
"ZPBASE2",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportBase2), 3);
2306 TVirtualMC::GetMC()->Gsvolu(
"ZPBB",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportWallBottom), 3);
2313 TVirtualMC::GetMC()->Gsvolu(
"ZPBT",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportWallup), 3);
2320 TVirtualMC::GetMC()->Gsvolu(
"ZPBS",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportWallside), 3);
2328void Detector::createZEM()
2333 LOG(warning) <<
"ZDC: the ZEM calorimeters are not built";
2336 int32_t irotzem1, irotzem2;
2337 double rangzem1[6] = {0., 0., 90., 90., -90., 0.};
2338 double rangzem2[6] = {180., 0., 90., 45. + 90., 90., 45.};
2339 TVirtualMC::GetMC()->Matrix(irotzem1, rangzem1[0], rangzem1[1], rangzem1[2], rangzem1[3], rangzem1[4], rangzem1[5]);
2340 TVirtualMC::GetMC()->Matrix(irotzem2, rangzem2[0], rangzem2[1], rangzem2[2], rangzem2[3], rangzem2[4], rangzem2[5]);
2343 double zemTranLength = zemLength / 20.;
2344 double zemPbSlice[6] = {0.15 * TMath::Sqrt(2), 3.5, 3.5, 45., 0., 0.};
2345 double zemVoidLayer[6] = {(zemTranLength - 2. * zemPbSlice[0]) / 2., 3.5, 3.5, 45., 0., 0.};
2347 double zemSupportTable[3] = {55. / 2., 1.5 / 2., 110. / 2.};
2348 double zemSupportBox[6] = {10.5 / 2., 100. / 2., 95. / 2., 0.25 / 2., 2. / 2., 2. / 2.};
2349 double zemSupport1[3] = {15. / 2, 3. / 2., 95. / 2.};
2350 double zemSupport2[3] = {2. / 2, 5. / 2., 95. / 2.};
2351 double zemSupport3[3] = {3.5, 2. / 2., zemLength};
2352 double zemSupport4[6] = {20. / 2., 3.5, 1.5 / 2., 45., 0., 0.};
2353 double zemWallH[3] = {10.5 / 2., 1., 95. / 2.};
2354 double zemWallVfwd[3] = {10.5 / 2., (100. - 2.) / 2., 0.2};
2355 double zemWallVbkw[3] = {10.5 / 2., (100. - 2.) / 2., 2. / 2.};
2356 double zemWallVside[3] = {0.25 / 2., (100. - 2.) / 2., (95. - 2.) / 2.};
2362 TVirtualMC::GetMC()->Gsvolu(
"ZEL0",
"PARA",
getMediumID(
kPb),
const_cast<double*
>(zemPbSlice), 6);
2363 TVirtualMC::GetMC()->Gsvolu(
"ZEL1",
"PARA",
getMediumID(
kPb),
const_cast<double*
>(zemPbSlice), 6);
2364 TVirtualMC::GetMC()->Gsvolu(
"ZEL2",
"PARA",
getMediumID(
kPb),
const_cast<double*
>(zemPbSlice), 6);
2367 TVirtualMC::GetMC()->Gspos(
"ZEL0", 1,
"ZETR", -zemTranLength + zemPbSlice[0], 0., 0., 0,
"ONLY");
2368 TVirtualMC::GetMC()->Gspos(
"ZEL1", 1,
"ZETR", zemPbSlice[0], 0., 0., 0,
"ONLY");
2379 TVirtualMC::GetMC()->Gspos(
"ZEMF", 1,
"ZES0", 0., 0., 0., irotzem2,
"ONLY");
2380 TVirtualMC::GetMC()->Gspos(
"ZEMF", 1,
"ZES1", 0., 0., 0., irotzem2,
"ONLY");
2384 TVirtualMC::GetMC()->Gspos(
"ZEV0", 1,
"ZETR", -zemVoidLayer[0], 0., 0., 0,
"ONLY");
2385 TVirtualMC::GetMC()->Gspos(
"ZEV1", 1,
"ZETR", -zemVoidLayer[0] + zemTranLength, 0., 0., 0,
"ONLY");
2392 const float y0 = 30.;
2408 float zbox = zSupport + zemSupportBox[2];
2411 TVirtualMC::GetMC()->Gsvolu(
"ZESH",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupport1), 3);
2416 TVirtualMC::GetMC()->Gsvolu(
"ZESV",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupport2), 3);
2417 TVirtualMC::GetMC()->Gspos(
"ZESV", 1,
"barrel",
Geometry::ZEMPOSITION[0] - zemSupportBox[0] + zemSupport2[0], ybox - zemSupportBox[1] - zemSupport2[1] +
y0, zbox, 0,
"ONLY");
2418 TVirtualMC::GetMC()->Gspos(
"ZESV", 2,
"barrel",
Geometry::ZEMPOSITION[0] + zemSupportBox[0] - zemSupport2[0], ybox - zemSupportBox[1] - zemSupport2[1] +
y0, zbox, 0,
"ONLY");
2419 TVirtualMC::GetMC()->Gspos(
"ZESV", 3,
"barrel", -(
Geometry::ZEMPOSITION[0] - zemSupportBox[0] + zemSupport2[0]), ybox - zemSupportBox[1] - zemSupport2[1] +
y0, zbox, 0,
"ONLY");
2420 TVirtualMC::GetMC()->Gspos(
"ZESV", 4,
"barrel", -(
Geometry::ZEMPOSITION[0] + zemSupportBox[0] - zemSupport2[0]), ybox - zemSupportBox[1] - zemSupport2[1] +
y0, zbox, 0,
"ONLY");
2423 TVirtualMC::GetMC()->Gsvolu(
"ZETA",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupportTable), 3);
2424 float ytable = ybridge - zemSupport1[1] - zemSupportTable[1];
2425 TVirtualMC::GetMC()->Gspos(
"ZETA", 1,
"barrel", 0.0, ytable +
y0, zbox, 0,
"ONLY");
2426 TVirtualMC::GetMC()->Gspos(
"ZETA", 2,
"barrel", 0.0, ytable - 13. + 2. * zemSupportTable[1] +
y0, zbox, 0,
"ONLY");
2429 TVirtualMC::GetMC()->Gsvolu(
"ZEFL",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupport3), 3);
2433 TVirtualMC::GetMC()->Gsvolu(
"ZELA",
"PARA",
getMediumID(
kAl),
const_cast<double*
>(zemSupport4), 6);
2440 TVirtualMC::GetMC()->Gsvolu(
"ZEW1",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemWallH), 3);
2441 TVirtualMC::GetMC()->Gsvolu(
"ZEW2",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemWallVfwd), 3);
2442 TVirtualMC::GetMC()->Gsvolu(
"ZEW3",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemWallVbkw), 3);
2443 TVirtualMC::GetMC()->Gsvolu(
"ZEW4",
"BOX ",
getMediumID(
kFe),
const_cast<double*
>(zemWallVside), 3);
2446 float zh1 = zSupport + zemWallH[2];
2448 TVirtualMC::GetMC()->Gspos(
"ZEW1", 2,
"barrel",
Geometry::ZEMPOSITION[0], yh1 + 2 * zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2450 TVirtualMC::GetMC()->Gspos(
"ZEW1", 4,
"barrel", -
Geometry::ZEMPOSITION[0], yh1 + 2 * zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2452 TVirtualMC::GetMC()->Gspos(
"ZEW2", 1,
"barrel",
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1] +
y0, zSupport - zemWallVfwd[2], 0,
"ONLY");
2453 TVirtualMC::GetMC()->Gspos(
"ZEW3", 1,
"barrel",
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1] +
y0, zSupport + 2 * zemWallH[2], 0,
"ONLY");
2454 TVirtualMC::GetMC()->Gspos(
"ZEW2", 2,
"barrel", -
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1] +
y0, zSupport - zemWallVfwd[2], 0,
"ONLY");
2455 TVirtualMC::GetMC()->Gspos(
"ZEW3", 2,
"barrel", -
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1] +
y0, zSupport + 2 * zemWallH[2], 0,
"ONLY");
2459 TVirtualMC::GetMC()->Gspos(
"ZEW4", 1,
"barrel", xl1, yh1 + zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2460 TVirtualMC::GetMC()->Gspos(
"ZEW4", 2,
"barrel", xl2, yh1 + zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2461 TVirtualMC::GetMC()->Gspos(
"ZEW4", 3,
"barrel", -xl1, yh1 + zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2462 TVirtualMC::GetMC()->Gspos(
"ZEW4", 4,
"barrel", -xl2, yh1 + zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2474Bool_t Detector::withZEM()
2477 return std::find(modules.begin(), modules.end(),
"FOC") == modules.end();
2481Bool_t Detector::calculateTableIndexes(
int& ibeta,
int& iangle,
int& iradius)
2483 double x[3] = {0., 0., 0.}, xDet[3] = {0., 0., 0.},
p[3] = {0., 0., 0.}, energy = 0.;
2484 fMC->TrackPosition(
x[0],
x[1],
x[2]);
2485 fMC->TrackMomentum(p[0], p[1], p[2], energy);
2488 float ptot = TMath::Sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]);
2491 beta = ptot / energy;
2496 }
else if (beta > 0.75 && beta <= 0.85) {
2498 }
else if (beta > 0.85 && beta <= 0.95) {
2500 }
else if (beta > 0.95) {
2507 double umom[3] = {0., 0., 0.}, udet[3] = {0., 0., 0.};
2508 umom[0] =
p[0] / ptot;
2509 umom[1] =
p[1] / ptot;
2510 umom[2] =
p[2] / ptot;
2511 fMC->Gmtod(umom, udet, 2);
2512 double angleRad = TMath::ACos(udet[2]);
2513 double angleDeg = angleRad *
kRaddeg;
2514 if (angleDeg < 110.) {
2515 iangle =
int(0.5 + angleDeg / 2.);
2520 fMC->Gmtod(
x, xDet, 1);
2522 if (TMath::Abs(udet[0]) > 0) {
2523 float dcoeff = udet[1] / udet[0];
2524 radius = TMath::Abs((xDet[1] - dcoeff * xDet[0]) / TMath::Sqrt(dcoeff * dcoeff + 1.));
2526 radius = TMath::Abs(udet[0]);
2528 iradius =
int(radius * 1000. + 1.);
2543 mLastPrincipalTrackEntered = -1;
2544 flushSpatialResponse();
2546#ifdef ZDC_FASTSIM_ONNX
2549 if (simparam.debugZDCFastSim && simparam.useZDCFastSim && mFastSimModelNeutron !=
nullptr && mFastSimModelProton !=
nullptr && mFastSimClassifier !=
nullptr) {
2550 std::fstream
output(
"o2sim-FastSimResult", std::fstream::out | std::fstream::app);
2552 LOG(error) <<
"Could not open file.";
2555 for (
auto&
result : mFastSimResults) {
2559 mFastSimResults.clear();
2571 mLastPrincipalTrackEntered =
stack->GetCurrentTrackNumber();
2574 mCurrentPrincipalParticle = *
stack->GetCurrentTrack();
2576#ifdef ZDC_FASTSIM_ONNX
2579 if (simparam.useZDCFastSim && (mFastSimModelNeutron !=
nullptr || mFastSimModelProton !=
nullptr) && mFastSimClassifier !=
nullptr) {
2580 const std::vector<float> rawInput = {
static_cast<float>(mCurrentPrincipalParticle.Energy()),
2581 static_cast<float>(mCurrentPrincipalParticle.Vx()),
2582 static_cast<float>(mCurrentPrincipalParticle.Vy()),
2583 static_cast<float>(mCurrentPrincipalParticle.Vz()),
2584 static_cast<float>(mCurrentPrincipalParticle.Px()),
2585 static_cast<float>(mCurrentPrincipalParticle.Py()),
2586 static_cast<float>(mCurrentPrincipalParticle.Pz()),
2587 static_cast<float>(mCurrentPrincipalParticle.GetMass() * 1000.0),
2588 static_cast<float>(mCurrentPrincipalParticle.GetPDG()->Charge())};
2590 auto scaledClassParticle = mClassifierScaler->scale(rawInput);
2591 if (!scaledClassParticle.has_value()) {
2592 LOG(error) <<
"FastSimModule: error occurred on scaling";
2594 vector<vector<float>> classifierInput = {std::move(*scaledClassParticle)};
2595 mFastSimClassifier->setInput(classifierInput);
2596 mFastSimClassifier->run();
2601 if (mModelScalerNeutron && mFastSimModelNeutron) {
2602 LOG(info) <<
"Generating fast hits for ZN";
2603 auto scaledModelParticleNeutron = mModelScalerNeutron->scale(rawInput);
2604 if (!scaledModelParticleNeutron.has_value()) {
2605 LOG(error) <<
"FastSimModule: error occurred on scaling";
2608 mFastSimModelNeutron->setInput(modelInputNeutron);
2609 mFastSimModelNeutron->run();
2610 if (simparam.debugZDCFastSim) {
2614 bool forward = mCurrentPrincipalParticle.Pz() > 0.;
2615 FastSimToHits(mFastSimModelNeutron->getResult()[0], mCurrentPrincipalParticle, forward ?
ZNA :
ZNC);
2619 if (mModelScalerProton && mFastSimModelProton) {
2620 LOG(info) <<
"Generating fast hits for ZP";
2621 auto scaledModelParticleProton = mModelScalerProton->scale(rawInput);
2622 if (!scaledModelParticleProton.has_value()) {
2623 LOG(error) <<
"FastSimModule: error occurred on scaling";
2626 mFastSimModelProton->setInput(modelInputProton);
2627 mFastSimModelProton->run();
2629 bool forward = mCurrentPrincipalParticle.Pz() > 0.;
2630 FastSimToHits(mFastSimModelProton->getResult()[0], mCurrentPrincipalParticle, forward ?
ZPA :
ZPC);
2646 if (FairRootManager::Instance()) {
2647 FairRootManager::Instance()->RegisterAny(
addNameTo(
"Hit").
data(), mHits, kTRUE);
2650 FairRootManager::Instance()->RegisterAny(
addNameTo(
"ResponseImage").
data(), mResponsesPtr, kTRUE);
2662 mLastPrincipalTrackEntered = -1;
2670#ifdef ZDC_FASTSIM_ONNX
2671bool Detector::FastSimToHits(
const Ort::Value& response,
const TParticle& particle,
int detector)
2676 auto [Nx, Ny] = determineDetectorSize(detector);
2678 if (Nx == -1 || Ny == -1) {
2683 auto pixels = response.GetTensorData<
float>();
2685 auto determineSectorID = [&Nx = Nx, &Ny = Ny](
int detector,
int x,
int y) {
2686 if (detector ==
ZNA || detector ==
ZNC) {
2687 if ((
x +
y) % 2 == 0) {
2705 if (detector ==
ZPA || detector ==
ZPC) {
2706 if ((
x +
y) % 2 == 0) {
2709 auto i = (
int)(4.f *
x / Nx);
2710 return (
int)(
i + 1);
2715 auto determineMediumID = [
this](
int detector,
int x,
int y) {
2717 return ((
x +
y) % 2 == 0) ? mMediumPMCid : mMediumPMQid;
2721 if (detector ==
ZPA) {
2723 }
else if (detector ==
ZPC) {
2725 }
else if (detector ==
ZNA) {
2727 }
else if (detector ==
ZNC) {
2731 LOG(fatal) <<
"Unsupported detector in ZDC fast sim";
2738 for (
int x = 0;
x < Nx; ++
x) {
2740 for (
int y = 0;
y < Ny; ++
y) {
2742 int sector = determineSectorID(detector,
x,
y);
2744 int currentMediumid = determineMediumID(detector,
x,
y);
2750 float trackenergy = 0;
2751 createOrAddHit(detector,
2761 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()
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
D const SVectorGPU< T, D > & rhs
std::vector< T, fair::mq::pmr::polymorphic_allocator< T > > vector
struct o2::upgrades_utils::@478 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"