23#include "TGeoManager.h"
24#include "TGeoVolume.h"
27#include "TGeoCompositeShape.h"
28#include "TVirtualMC.h"
36#ifdef ZDC_FASTSIM_ONNX
45#define kRaddeg TMath::RadToDeg()
50 mHits(new
std::vector<
o2::zdc::
Hit>),
51 mXImpact(-999, -999, -999),
78 mXImpact(-999, -999, -999),
80 mMediumPMCid(
rhs.mMediumPMCid),
81 mMediumPMQid(
rhs.mMediumPMQid),
83 mNeutronResponseImage(
rhs.mNeutronResponseImage),
84 mProtonResponseImage(
rhs.mProtonResponseImage)
95void Detector::setupFastSim()
97#ifdef ZDC_FASTSIM_ONNX
102 if (!simparam.useZDCFastSim) {
103 LOG(info) <<
"FastSim module disabled";
104 }
else if (simparam.useZDCFastSim && !simparam.ZDCFastSimClassifierPath.empty() && !simparam.ZDCFastSimClassifierScales.empty()) {
105 if (!mClassifierScaler) {
108 if (!mModelScalerNeutron) {
111 if (!mModelScalerProton) {
115 if (!eonScales.has_value()) {
116 LOG(
error) <<
"Error while reading model scales from: "
117 <<
"'" << simparam.ZDCFastSimClassifierScales <<
"'";
118 LOG(
error) <<
"FastSim module disabled.";
120 mClassifierScaler->setScales(eonScales->first, eonScales->second);
123 if (simparam.useZDCFastSim && !simparam.ZDCFastSimModelPathNeutron.empty() && !simparam.ZDCFastSimModelScalesNeutron.empty()) {
126 if (!modelScalesNeutron.has_value()) {
127 LOG(
error) <<
"Error while reading model scales from: "
128 <<
"'" << simparam.ZDCFastSimModelScalesNeutron <<
"'";
129 LOG(
error) <<
"FastSim module disabled";
131 mModelScalerNeutron->setScales(modelScalesNeutron->first, modelScalesNeutron->second);
133 LOG(info) <<
"FastSim neutron module enabled";
136 if (simparam.useZDCFastSim && !simparam.ZDCFastSimModelPathProton.empty() && !simparam.ZDCFastSimModelScalesProton.empty()) {
139 if (!modelScalesProton.has_value()) {
140 LOG(
error) <<
"Error while reading model scales from: "
141 <<
"'" << simparam.ZDCFastSimModelScalesProton <<
"'";
142 LOG(
error) <<
"FastSim module disabled";
144 mModelScalerProton->setScales(modelScalesProton->first, modelScalesProton->second);
146 LOG(info) <<
"FastSim proton module enabled";
155#ifdef ZDC_FASTSIM_ONNX
158 delete (mFastSimClassifier);
159 delete (mFastSimModelNeutron);
160 delete (mFastSimModelProton);
161 delete (mClassifierScaler);
162 delete (mModelScalerNeutron);
163 delete (mModelScalerProton);
179 if (input.is_open()) {
180 while (input >>
value) {
182 table[beta][anglebin][radiusbin] =
value;
185 if (radiusbin % NRADBINS == 0) {
204 defineSensitiveVolumes();
206 std::string inputDir;
207 const char* aliceO2env = std::getenv(
"O2_ROOT");
209 inputDir = std::string(aliceO2env);
211 inputDir +=
"/share/Detectors/ZDC/simulation/data/";
213 loadLightTable(mLightTableZN, 0, ZNRADIUSBINS, inputDir +
"light22620362207s");
214 loadLightTable(mLightTableZN, 1, ZNRADIUSBINS, inputDir +
"light22620362208s");
215 loadLightTable(mLightTableZN, 2, ZNRADIUSBINS, inputDir +
"light22620362209s");
216 auto elements =
loadLightTable(mLightTableZN, 3, ZNRADIUSBINS, inputDir +
"light22620362210s");
217 assert(elements == ZNRADIUSBINS * ANGLEBINS);
226 loadLightTable(mLightTableZP, 0, ZPRADIUSBINS, inputDir +
"light22620552207s");
227 loadLightTable(mLightTableZP, 1, ZPRADIUSBINS, inputDir +
"light22620552208s");
228 loadLightTable(mLightTableZP, 2, ZPRADIUSBINS, inputDir +
"light22620552209s");
229 elements =
loadLightTable(mLightTableZP, 3, ZPRADIUSBINS, inputDir +
"light22620552210s");
230 assert(elements == ZPRADIUSBINS * ANGLEBINS);
236 LOG(
debug) <<
"Creating ZDC geometry\n";
241 createAsideBeamLine();
242 createCsideBeamLine();
245 LOG(info) <<
"ZDC: beam line, magnets and the ZN/ZP calorimeters are not built";
251void Detector::defineSensitiveVolumes()
253 LOG(info) <<
"defining sensitive for ZDC";
254 TGeoVolume* vol =
nullptr;
256 vol = gGeoManager->GetVolume(
"ZNENV");
259 mZNENVVolID = vol->GetNumber();
266 LOG(fatal) <<
"can't find volume ZNENV";
268 vol = gGeoManager->GetVolume(
"ZPENV");
271 mZPENVVolID = vol->GetNumber();
278 LOG(fatal) <<
"can't find volume ZPENV";
282 vol = gGeoManager->GetVolume(
"ZEM ");
285 mZEMVolID = vol->GetNumber();
288 LOG(fatal) <<
"can't find volume ZEM";
293void Detector::getDetIDandSecID(TString
const& volname, math_utils::Vector3D<float>
const&
x,
294 math_utils::Vector3D<float>& xDet,
int& detector,
int&
sector)
const
296 if (volname.BeginsWith(
"ZN")) {
303 }
else if (
x.Z() < 0) {
308 if (xDet.X() <= 0.) {
309 if (xDet.Y() <= 0.) {
315 if (xDet.Y() <= 0.) {
323 }
else if (volname.BeginsWith(
"ZP")) {
328 }
else if (
x.Z() < 0) {
341 for (
int i = 1;
i <= 4;
i++) {
342 if (xTow >= (
i - 3) && xTow < (
i - 2)) {
349 }
else if (volname.BeginsWith(
"ZE")) {
361void Detector::resetHitIndices()
364 for (
int det = 0; det < NUMDETS; ++det) {
365 for (
int sec = 0; sec < NUMSECS; ++sec) {
366 mCurrentHitsIndices[det][sec] = -1;
374void Detector::flushSpatialResponse()
378 std::fstream
output(
"o2sim-FullSimResult", std::fstream::out | std::fstream::app);
379 output <<
c[0] <<
" " <<
c[1] <<
" " <<
c[2] <<
" " <<
c[3] <<
" " <<
c[4] <<
"\n";
384 mResponses.push_back(std::make_pair(mCurrentPrincipalParticle,
385 std::make_pair(mNeutronResponseImage, mProtonResponseImage)));
387 mNeutronResponseImage.
reset();
388 mProtonResponseImage.
reset();
398 const auto m = part.GetMass();
399 constexpr auto SPEED_OF_LIGHT = 299792458.;
401 return z / SPEED_OF_LIGHT;
403 TLorentzVector lorentz;
404 part.Momentum(lorentz);
405 const auto gamma = lorentz.Gamma();
406 const auto speed = SPEED_OF_LIGHT * std::sqrt(1. - 1. / (gamma * gamma));
415 TString volname =
fMC->CurrentVolName();
416 float x[3] = {0., 0., 0.};
417 fMC->TrackPosition(
x[0],
x[1],
x[2]);
422 math_utils::Vector3D<float> xImp;
423 getDetIDandSecID(volname, math_utils::Vector3D<float>(
x[0],
x[1],
x[2]), xImp, detector,
sector);
426 int trackn =
stack->GetCurrentTrackNumber();
430 volID =
fMC->CurrentVolID(copy);
436 if ((
fMC->CurrentMedium() == mMediumPMCid) && (detector !=
ZEM)) {
442 if ((volID == mZNENVVolID || volID == mZPENVVolID || volID == mZEMVolID)) {
448 float p[3] = {0., 0., 0.};
449 float trackenergy = 0.;
450 fMC->TrackMomentum(p[0], p[1], p[2], trackenergy);
451 float eDep =
fMC->Edep();
453 int pdgCode =
fMC->TrackPid();
454 float lightoutput = 0.;
455 auto currentMediumid =
fMC->CurrentMedium();
457 if (((currentMediumid == mMediumPMCid) || (currentMediumid == mMediumPMQid))) {
459 int ibeta = 0, iangle = 0, iradius = 0;
460 Bool_t isLightProduced = calculateTableIndexes(ibeta, iangle, iradius);
461 if (isLightProduced) {
463 if (pdgCode < 10000) {
466 charge = TMath::Abs(pdgCode / 10000 - 100000);
470 if (TMath::Abs(
charge) > 0) {
471 if (detector == 1 || detector == 4) {
473 lightoutput =
charge *
charge * mLightTableZN[ibeta][iangle][iradius];
477 lightoutput =
charge *
charge * mLightTableZP[ibeta][iangle][iradius];
480 if (lightoutput > 0) {
489 auto tof = 1.e09 *
fMC->TrackTime();
494 if (detector ==
ZNA || detector ==
ZNC) {
499 if (detector ==
ZPA || detector ==
ZPC) {
508 if (mCurrentHitsIndices[detector - 1][
sector] == -1) {
509 bool issecondary = trackn !=
stack->getCurrentPrimaryIndex();
512 mTotLightPMC = mTotLightPMQ = 0;
513 if (currentMediumid == mMediumPMCid) {
515 }
else if (currentMediumid == mMediumPMQid) {
519 math_utils::Vector3D<float>
pos(
x[0],
x[1],
x[2]);
520 math_utils::Vector3D<float> mom(p[0], p[1], p[2]);
521 addHit(trackn, mLastPrincipalTrackEntered, issecondary, trackenergy, detector,
sector,
522 pos, mom, tof, xImp, eDep, mTotLightPMC, mTotLightPMQ);
524 mCurrentHitsIndices[detector - 1][
sector] = mHits->size() - 1;
532 auto& curHit = (*mHits)[mCurrentHitsIndices[detector - 1][
sector]];
534 curHit.setNoNumContributingSteps(curHit.getNumContributingSteps() + 1);
535 int nPMC{0}, nPMQ{0};
536 if (currentMediumid == mMediumPMCid) {
537 mTotLightPMC += nphe;
539 }
else if (currentMediumid == mMediumPMQid) {
540 mTotLightPMQ += nphe;
543 float incenloss = curHit.GetEnergyLoss() + eDep;
545 curHit.SetEnergyLoss(incenloss);
546 curHit.setPMCLightYield(curHit.getPMCLightYield() + nPMC);
547 curHit.setPMQLightYield(curHit.getPMQLightYield() + nPMQ);
562 math_utils::Vector3D<float> xImp(0., 0., 0.);
564 const int Nx =
image.getNx();
565 const int Ny =
image.getNy();
569 auto determineSectorID = [Nx, Ny](
int detector,
int x,
int y) {
570 if (detector ==
ZNA || detector ==
ZNC) {
571 if ((
x +
y) % 2 == 0) {
589 if (detector ==
ZPA || detector ==
ZPC) {
590 if ((
x +
y) % 2 == 0) {
593 auto i = (int)(4.f *
x / Nx);
599 auto determineMediumID = [
this](
int detector,
int x,
int y) {
601 return ((
x +
y) % 2 == 0) ? mMediumPMCid : mMediumPMQid;
605 for (
int x = 0;
x < Nx; ++
x) {
607 for (
int y = 0;
y < Ny; ++
y) {
609 int sector = determineSectorID(detector,
x,
y);
611 int currentMediumid = determineMediumID(detector,
x,
y);
615 float trackenergy = 0;
616 createOrAddHit(detector,
626 0. , 0 , 0. , 0. , 0. , 0. , 0. );
634 int32_t secID, math_utils::Vector3D<float>
pos, math_utils::Vector3D<float> mom,
float tof, math_utils::Vector3D<float> xImpact,
635 double energyloss, int32_t nphePMC, int32_t nphePMQ)
637 LOG(debug4) <<
"Adding hit for track " << trackID <<
" X (" <<
pos.X() <<
", " <<
pos.Y() <<
", "
638 <<
pos.Z() <<
") P (" << mom.X() <<
", " << mom.Y() <<
", " << mom.Z() <<
") Ekin "
639 << primaryEnergy <<
" lightPMC " << nphePMC <<
" lightPMQ " << nphePMQ << std::endl;
640 mHits->emplace_back(trackID, parentID, sFlag, primaryEnergy, detID, secID,
pos, mom,
641 tof, xImpact, energyloss, nphePMC, nphePMQ);
642 return &(mHits->back());
651 LOG(info) <<
"Detector::CreateMaterials >>>>> magnetic field: type " << ifield <<
" max " << fieldm <<
"\n";
655 float aW[3] = {183.85, 55.85, 58.71};
656 float zW[3] = {74., 26., 28.};
657 float wW[3] = {0.93, 0.03, 0.04};
661 float aCuZn[2] = {63.546, 65.39};
662 float zCuZn[2] = {29., 30.};
663 float wCuZn[2] = {0.63, 0.37};
667 float aq[2] = {28.0855, 15.9994};
668 float zq[2] = {14., 8.};
669 float wq[2] = {1., 2.};
676 float radPb = 6.37 / dPb;
677 float absPb = 199.6 / dPb;
683 float radCu = 12.86 / dCu;
684 float absCu = 137.3 / dCu;
691 float radFe = 13.84 / dFe;
692 float absFe = 132.1 / dFe;
698 float radAl = 24.01 / dAl;
699 float absAl = 107.2 / dAl;
705 float radCarb = 18.8;
706 float absCarb = 49.9;
709 float aResGas[3] = {1.008, 12.0107, 15.9994};
710 float zResGas[3] = {1., 6., 8.};
711 float wResGas[3] = {0.28, 0.28, 0.44};
712 float dResGas = 3.2E-14;
715 float aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
716 float zAir[4] = {6., 7., 8., 18.};
717 float wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
718 float dAir = 1.20479E-3;
721 int32_t notactiveMed = 0, sensMed = 1;
738 Mixture(0,
"Walloy$", aW, zW, dW, 3, wW);
739 Mixture(1,
"CuZn$", aCuZn, zCuZn, dCuZn, 2, wCuZn);
740 Mixture(2,
"SiO2$", aq, zq, dq, -2, wq);
741 Material(3,
"Pb $", aPb, zPb, dPb, radPb, absPb);
742 Material(4,
"Cu $", aCu, zCu, dCu, radCu, absCu);
743 Material(5,
"Fe $", aFe, zFe, dFe, radFe, absFe);
744 Material(6,
"Al $", aAl, zAl, dAl, radAl, absAl);
745 Material(7,
"graphite$", aCarb, zCarb, dCarb, radCarb, absCarb);
746 Mixture(8,
"residualGas$", aResGas, zResGas, dResGas, 3, wResGas);
747 Mixture(9,
"Air$", aAir, zAir, dAir, 4, wAir);
750 Medium(
kWalloy,
"Walloy$", 0, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
751 Medium(
kCuZn,
"CuZn$", 1, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
752 Medium(
kSiO2pmc,
"quartzPMC$", 2, sensMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
753 Medium(
kSiO2pmq,
"quartzPMQ$", 2, sensMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
754 Medium(
kPb,
"Lead$", 3, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
755 Medium(
kCu,
"Copper$", 4, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
756 Medium(
kCuLumi,
"CopperLowTh$", 4, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
757 Medium(
kFe,
"Iron$", 5, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
758 Medium(
kFeLowTh,
"IronLowTh$", 5, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
759 Medium(
kAl,
"Aluminum$", 6, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
760 Medium(
kGraphite,
"Graphite$", 7, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
761 Medium(
kVoidNoField,
"VoidNoField$", 8, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
762 Medium(
kVoidwField,
"VoidwField$", 8, notactiveMed, ifld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
763 Medium(
kAir,
"Air$", 9, notactiveMed, inofld, nofieldm, tmaxnofd, stemax, deemax, epsil, stmin);
767void Detector::createAsideBeamLine()
770 double tubpar[3] = {0., 0., 0};
771 double boxpar[3] = {0., 0., 0};
772 double tubspar[5] = {0., 0., 0., 0., 0.};
773 double conpar[15] = {0.};
787 TVirtualMC::GetMC()->Gspos(
"ZDCA", 1,
"cave", 0., 0., 0., 0,
"ONLY");
790 tubpar[0] = 6.0 / 2.;
791 tubpar[1] = 6.4 / 2.;
792 tubpar[2] = (386.28 - 0.18) / 2.;
793 TVirtualMC::GetMC()->Gsvolu(
"QA01",
"TUBE",
getMediumID(
kFe), tubpar, 3);
794 TVirtualMC::GetMC()->Gspos(
"QA01", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
796 zA += 2. * tubpar[2];
799 tubpar[0] = 6.3 / 2.;
800 tubpar[1] = 6.7 / 2.;
801 tubpar[2] = 3541.8 / 2.;
802 TVirtualMC::GetMC()->Gsvolu(
"QA02",
"TUBE",
getMediumID(
kFe), tubpar, 3);
803 TVirtualMC::GetMC()->Gspos(
"QA02", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
805 zA += 2. * tubpar[2];
815 tubpar[0] = 6.75 / 2.;
816 tubpar[1] = 7.15 / 2.;
817 tubpar[2] = (945.0 + 80.1) / 2.;
818 TVirtualMC::GetMC()->Gsvolu(
"QA03",
"TUBE",
getMediumID(
kFe), tubpar, 3);
819 TVirtualMC::GetMC()->Gspos(
"QA03", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
821 zA += 2. * tubpar[2];
824 conpar[0] = 2.5 / 2.;
825 conpar[1] = 6.75 / 2.;
826 conpar[2] = 7.15 / 2.;
827 conpar[3] = 8.0 / 2.;
828 conpar[4] = 8.4 / 2.;
829 TVirtualMC::GetMC()->Gsvolu(
"QA04",
"CONE",
getMediumID(
kFe), conpar, 5);
830 TVirtualMC::GetMC()->Gspos(
"QA04", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
832 zA += 2. * conpar[0];
834 tubpar[0] = 8.0 / 2.;
835 tubpar[1] = 8.4 / 2.;
836 tubpar[2] = (43.9 + 20. + 28.5 + 28.5) / 2.;
837 TVirtualMC::GetMC()->Gsvolu(
"QA05",
"TUBE",
getMediumID(
kFe), tubpar, 3);
838 TVirtualMC::GetMC()->Gspos(
"QA05", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
840 zA += 2. * tubpar[2];
843 conpar[0] = 4.0 / 2.;
844 conpar[1] = 8.0 / 2.;
845 conpar[2] = 8.4 / 2.;
846 conpar[3] = 9.8 / 2.;
847 conpar[4] = 10.2 / 2.;
848 TVirtualMC::GetMC()->Gsvolu(
"QAV1",
"CONE",
getMediumID(
kFe), conpar, 5);
849 TVirtualMC::GetMC()->Gspos(
"QAV1", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
851 zA += 2. * conpar[0];
854 conpar[0] = 1.0 / 2.;
855 conpar[1] = 9.8 / 2.;
856 conpar[2] = 10.2 / 2.;
857 conpar[3] = 9.0 / 2.;
858 conpar[4] = 9.4 / 2.;
859 TVirtualMC::GetMC()->Gsvolu(
"QAV2",
"CONE",
getMediumID(
kFe), conpar, 5);
860 TVirtualMC::GetMC()->Gspos(
"QAV2", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
862 zA += 2. * conpar[0];
865 tubpar[0] = 9.0 / 2.;
866 tubpar[1] = 9.4 / 2.;
867 tubpar[2] = 31.0 / 2.;
868 TVirtualMC::GetMC()->Gsvolu(
"QAV3",
"TUBE",
getMediumID(
kFe), tubpar, 3);
869 TVirtualMC::GetMC()->Gspos(
"QAV3", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
871 zA += 2. * tubpar[2];
876 conpar[0] = 1.3 / 2.;
877 conpar[1] = 9.0 / 2.;
878 conpar[2] = 13.0 / 2.;
879 conpar[3] = 9.6 / 2.;
880 conpar[4] = 13.0 / 2.;
881 TVirtualMC::GetMC()->Gsvolu(
"Q01T",
"CONE",
getMediumID(
kFe), conpar, 5);
882 TVirtualMC::GetMC()->Gspos(
"Q01T", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
884 zA += 2. * conpar[0];
887 tubpar[0] = 9.6 / 2.;
888 tubpar[1] = 10.0 / 2.;
889 tubpar[2] = 1.0 / 2.;
890 TVirtualMC::GetMC()->Gsvolu(
"Q02T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
891 TVirtualMC::GetMC()->Gspos(
"Q02T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
893 zA += 2. * tubpar[2];
896 conpar[0] = 9.04 / 2.;
897 conpar[1] = 9.6 / 2.;
898 conpar[2] = 10.0 / 2.;
899 conpar[3] = 13.8 / 2.;
900 conpar[4] = 14.2 / 2.;
901 TVirtualMC::GetMC()->Gsvolu(
"Q03T",
"CONE",
getMediumID(
kFe), conpar, 5);
902 TVirtualMC::GetMC()->Gspos(
"Q03T", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
904 zA += 2. * conpar[0];
907 tubpar[0] = 13.8 / 2.;
908 tubpar[1] = 14.2 / 2.;
909 tubpar[2] = 38.6 / 2.;
910 TVirtualMC::GetMC()->Gsvolu(
"Q04T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
911 TVirtualMC::GetMC()->Gspos(
"Q04T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
913 zA += 2. * tubpar[2];
916 tubpar[0] = 21.0 / 2.;
917 tubpar[1] = 21.4 / 2.;
918 tubpar[2] = 100.12 / 2.;
919 TVirtualMC::GetMC()->Gsvolu(
"Q05T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
920 TVirtualMC::GetMC()->Gspos(
"Q05T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
922 zA += 2. * tubpar[2];
925 tubpar[0] = 13.8 / 2.;
926 tubpar[1] = 14.2 / 2.;
927 tubpar[2] = 38.6 / 2.;
928 TVirtualMC::GetMC()->Gsvolu(
"Q06T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
929 TVirtualMC::GetMC()->Gspos(
"Q06T", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
931 zA += 2. * tubpar[2];
934 conpar[0] = 11.34 / 2.;
935 conpar[1] = 13.8 / 2.;
936 conpar[2] = 14.2 / 2.;
937 conpar[3] = 18.0 / 2.;
938 conpar[4] = 18.4 / 2.;
939 TVirtualMC::GetMC()->Gsvolu(
"Q07T",
"CONE",
getMediumID(
kFe), conpar, 5);
940 TVirtualMC::GetMC()->Gspos(
"Q07T", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
942 zA += 2. * conpar[0];
948 tubspar[0] = 0.0 / 2.;
949 tubspar[1] = 14.0 / 2.;
950 tubspar[2] = 100.0 / 2.;
953 TVirtualMC::GetMC()->Gsvolu(
"Q08T",
"TUBS",
getMediumID(
kFe), tubspar, 5);
956 boxpar[0] = 7.0 / 2.;
957 boxpar[1] = 2.2 / 2.;
958 boxpar[2] = 100. / 2.;
961 TVirtualMC::GetMC()->Gspos(
"Q09T", 1,
"Q08T", 0., 1.1, 0., 0,
"ONLY");
964 tubspar[0] = 0.0 / 2.;
965 tubspar[1] = 14.0 / 2.;
966 tubspar[2] = 100.0 / 2.;
969 TVirtualMC::GetMC()->Gsvolu(
"Q10T",
"TUBS",
getMediumID(
kFe), tubspar, 5);
971 boxpar[0] = 7.0 / 2.;
972 boxpar[1] = 2.2 / 2.;
973 boxpar[2] = 100. / 2.;
976 TVirtualMC::GetMC()->Gspos(
"Q11T", 1,
"Q10T", 0., -1.1, 0., 0,
"ONLY");
980 double TCDDAperturePos = 2.2;
981 double TCDDApertureNeg = 2.4;
982 TVirtualMC::GetMC()->Gspos(
"Q08T", 1,
"ZDCA", 0., TCDDAperturePos, -100. + zA, 0,
"ONLY");
983 TVirtualMC::GetMC()->Gspos(
"Q10T", 1,
"ZDCA", 0., -TCDDApertureNeg, -100. + zA, 0,
"ONLY");
986 boxpar[0] = 0.2 / 2.;
987 boxpar[1] = 4.0 / 2.;
988 boxpar[2] = 100. / 2.;
989 TVirtualMC::GetMC()->Gsvolu(
"Q12T",
"BOX ",
getMediumID(
kFe), boxpar, 3);
991 TVirtualMC::GetMC()->Gspos(
"Q12T", 1,
"ZDCA", tubspar[1] + boxpar[0], 0., -100. + zA, 0,
"ONLY");
992 TVirtualMC::GetMC()->Gspos(
"Q12T", 2,
"ZDCA", -tubspar[1] - boxpar[0], 0., -100. + zA, 0,
"ONLY");
998 tubpar[0] = 18.4 / 2.;
999 tubpar[1] = 7.4 / 2.;
1000 tubpar[2] = (78 + 9.3) / 2.;
1001 TVirtualMC::GetMC()->Gsvolu(
"QA06",
"ELTU",
getMediumID(
kFe), tubpar, 3);
1008 tubpar[0] = 18.0 / 2.;
1009 tubpar[1] = 7.0 / 2.;
1010 tubpar[2] = (78 + 9.3) / 2.;
1017 TVirtualMC::GetMC()->Gspos(
"QA06", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1018 TVirtualMC::GetMC()->Gspos(
"QA07", 1,
"QA06", 0., 0., 0., 0,
"ONLY");
1020 zA += 2. * tubpar[2];
1023 conpar[0] = 31.5 / 2.;
1024 conpar[1] = 18.0 / 2.;
1025 conpar[2] = 18.6 / 2.;
1026 conpar[3] = 21.27 / 2.;
1027 conpar[4] = 21.87 / 2.;
1028 TVirtualMC::GetMC()->Gsvolu(
"QA08",
"CONE",
getMediumID(
kFe), conpar, 5);
1029 TVirtualMC::GetMC()->Gspos(
"QA08", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1031 zA += 2. * conpar[0];
1034 int32_t irotpipe3, irotpipe4, irotpipe5;
1035 double rang3[6] = {90. - 1.8934, 0., 90., 90., 1.8934, 180.};
1036 double rang4[6] = {90. - 3.8, 0., 90., 90., 3.8, 180.};
1037 double rang5[6] = {90. + 9.8, 0., 90., 90., 9.8, 0.};
1038 TVirtualMC::GetMC()->Matrix(irotpipe3, rang3[0], rang3[1], rang3[2], rang3[3], rang3[4], rang3[5]);
1039 TVirtualMC::GetMC()->Matrix(irotpipe4, rang4[0], rang4[1], rang4[2], rang4[3], rang4[4], rang4[5]);
1040 TVirtualMC::GetMC()->Matrix(irotpipe5, rang5[0], rang5[1], rang5[2], rang5[3], rang5[4], rang5[5]);
1045 tubpar[0] = 21.27 / 2.;
1046 tubpar[1] = 21.87 / 2.;
1047 tubpar[2] = (195.7 + 148. + 78.) / 2.;
1048 TVirtualMC::GetMC()->Gsvolu(
"QA09",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1049 TVirtualMC::GetMC()->Gspos(
"QA09", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1051 zA += 2. * tubpar[2];
1054 conpar[0] = (50.0 - 0.73 - 1.13) / 2.;
1055 conpar[1] = 21.27 / 2.;
1056 conpar[2] = 21.87 / 2.;
1057 conpar[3] = 33.2 / 2.;
1058 conpar[4] = 33.8 / 2.;
1059 TVirtualMC::GetMC()->Gsvolu(
"QA10",
"CONE",
getMediumID(
kFe), conpar, 5);
1060 TVirtualMC::GetMC()->Gspos(
"QA10", 1,
"ZDCA", -1.66, 0., conpar[0] + 0.73 + zA, irotpipe4,
"ONLY");
1062 zA += 2. * conpar[0] + 0.73 + 1.13;
1066 tubpar[1] = 54.6 / 2.;
1067 tubpar[2] = 540.0 / 2.;
1069 TVirtualMC::GetMC()->Gspos(
"Q13TM", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1070 tubpar[0] = 54.0 / 2.;
1071 tubpar[1] = 54.6 / 2.;
1072 tubpar[2] = 540.0 / 2.;
1073 TVirtualMC::GetMC()->Gsvolu(
"Q13T",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1074 TVirtualMC::GetMC()->Gspos(
"Q13T", 1,
"Q13TM", 0., 0., 0., 0,
"ONLY");
1076 zA += 2. * tubpar[2];
1079 boxpar[0] = 11.0 / 2.;
1080 boxpar[1] = 9.0 / 2.;
1081 boxpar[2] = 418.5 / 2.;
1082 double TDIAperturePos = 6.;
1083 TVirtualMC::GetMC()->Gsvolu(
"QTD1",
"BOX ",
getMediumID(
kFe), boxpar, 3);
1084 TVirtualMC::GetMC()->Gspos(
"QTD1", 1,
"Q13TM", -3.8, boxpar[1] + TDIAperturePos, 0., 0,
"ONLY");
1085 boxpar[0] = 11.0 / 2.;
1086 boxpar[1] = 9.0 / 2.;
1087 boxpar[2] = 418.5 / 2.;
1088 TVirtualMC::GetMC()->Gsvolu(
"QTD2",
"BOX ",
getMediumID(
kFe), boxpar, 3);
1089 double TDIApertureNeg = 6.;
1090 TVirtualMC::GetMC()->Gspos(
"QTD2", 1,
"Q13TM", -3.8, -boxpar[1] - TDIApertureNeg, 0., 0,
"ONLY");
1091 boxpar[0] = 5.1 / 2.;
1092 boxpar[1] = 0.2 / 2.;
1093 boxpar[2] = 418.5 / 2.;
1094 TVirtualMC::GetMC()->Gsvolu(
"QTD3",
"BOX ",
getMediumID(
kFe), boxpar, 3);
1095 TVirtualMC::GetMC()->Gspos(
"QTD3", 1,
"Q13TM", -3.8 + 5.5 + boxpar[0], TDIAperturePos, 0., 0,
"ONLY");
1096 TVirtualMC::GetMC()->Gspos(
"QTD3", 2,
"Q13TM", -3.8 + 5.5 + boxpar[0], -TDIApertureNeg, 0., 0,
"ONLY");
1097 TVirtualMC::GetMC()->Gspos(
"QTD3", 3,
"Q13TM", -3.8 - 5.5 - boxpar[0], TDIAperturePos, 0., 0,
"ONLY");
1098 TVirtualMC::GetMC()->Gspos(
"QTD3", 4,
"Q13TM", -3.8 - 5.5 - boxpar[0], -TDIApertureNeg, 0., 0,
"ONLY");
1100 tubspar[0] = 12.0 / 2.;
1101 tubspar[1] = 12.4 / 2.;
1102 tubspar[2] = 418.5 / 2.;
1105 TVirtualMC::GetMC()->Gsvolu(
"QTD4",
"TUBS",
getMediumID(
kCu), tubspar, 5);
1106 TVirtualMC::GetMC()->Gspos(
"QTD4", 1,
"Q13TM", -3.8 - 10.6, 0., 0., 0,
"ONLY");
1107 tubspar[0] = 12.0 / 2.;
1108 tubspar[1] = 12.4 / 2.;
1109 tubspar[2] = 418.5 / 2.;
1112 TVirtualMC::GetMC()->Gsvolu(
"QTD5",
"TUBS",
getMediumID(
kCu), tubspar, 5);
1113 TVirtualMC::GetMC()->Gspos(
"QTD5", 1,
"Q13TM", -3.8 + 10.6, 0., 0., 0,
"ONLY");
1117 conpar[0] = (50.0 - 2.92 - 1.89) / 2.;
1118 conpar[1] = 33.2 / 2.;
1119 conpar[2] = 33.8 / 2.;
1120 conpar[3] = 21.27 / 2.;
1121 conpar[4] = 21.87 / 2.;
1122 TVirtualMC::GetMC()->Gsvolu(
"QA11",
"CONE",
getMediumID(
kFe), conpar, 5);
1123 TVirtualMC::GetMC()->Gspos(
"QA11", 1,
"ZDCA", 4.32 - 3.8, 0., conpar[0] + 2.92 + zA, irotpipe5,
"ONLY");
1125 zA += 2. * conpar[0] + 2.92 + 1.89;
1130 tubpar[0] = 21.27 / 2.;
1131 tubpar[1] = 21.87 / 2.;
1132 tubpar[2] = 210.0 / 2.;
1133 TVirtualMC::GetMC()->Gsvolu(
"QA12",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1134 TVirtualMC::GetMC()->Gspos(
"QA12", 1,
"ZDCA", 4., 0., tubpar[2] + zA, 0,
"ONLY");
1136 zA += 2. * tubpar[2];
1140 conpar[0] = (121.0 - 0.37 - 1.35) / 2.;
1141 conpar[1] = 21.27 / 2.;
1142 conpar[2] = 21.87 / 2.;
1143 conpar[3] = 79.7 / 2.;
1144 conpar[4] = 81.3 / 2.;
1145 TVirtualMC::GetMC()->Gsvolu(
"QA13",
"CONE",
getMediumID(
kFe), conpar, 5);
1146 TVirtualMC::GetMC()->Gspos(
"QA13", 1,
"ZDCA", 4. - 2., 0., conpar[0] + 0.37 + zA, irotpipe3,
"ONLY");
1148 zA += 2. * conpar[0] + 0.37 + 1.35;
1152 tubpar[0] = 79.7 / 2.;
1153 tubpar[1] = 81.3 / 2.;
1154 tubpar[2] = (2221. - 136.) / 2.;
1155 TVirtualMC::GetMC()->Gsvolu(
"QA14",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1156 TVirtualMC::GetMC()->Gspos(
"QA14", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1158 zA += 2. * tubpar[2];
1166 conpar[0] = 9.09 / 2.;
1167 conpar[1] = 79.7 / 2.;
1168 conpar[2] = 81.3 / 2.;
1169 conpar[3] = 74.82868 / 2.;
1170 conpar[4] = 76.42868 / 2.;
1171 TVirtualMC::GetMC()->Gsvolu(
"QA15",
"CONE",
getMediumID(
kFe), conpar, 5);
1172 TVirtualMC::GetMC()->Gspos(
"QA15", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1174 zA += 2. * conpar[0];
1177 conpar[0] = 96.2 / 2.;
1178 conpar[1] = 74.82868 / 2.;
1179 conpar[2] = 75.42868 / 2.;
1180 conpar[3] = 23.19588 / 2.;
1181 conpar[4] = 23.79588 / 2.;
1182 TVirtualMC::GetMC()->Gsvolu(
"QA16",
"CONE",
getMediumID(
kFe), conpar, 5);
1183 TVirtualMC::GetMC()->Gspos(
"QA16", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1185 zA += 2. * conpar[0];
1188 conpar[0] = 6.71 / 2.;
1189 conpar[1] = 23.19588 / 2.;
1190 conpar[2] = 24.79588 / 2.;
1191 conpar[3] = 19.6 / 2.;
1192 conpar[4] = 21.2 / 2.;
1193 TVirtualMC::GetMC()->Gsvolu(
"QA17",
"CONE",
getMediumID(
kFe), conpar, 5);
1194 TVirtualMC::GetMC()->Gspos(
"QA17", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1196 zA += 2. * conpar[0];
1199 tubpar[0] = 19.6 / 2.;
1200 tubpar[1] = 21.2 / 2.;
1201 tubpar[2] = 9.55 / 2.;
1202 TVirtualMC::GetMC()->Gsvolu(
"QA18",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1203 TVirtualMC::GetMC()->Gspos(
"QA18", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1205 zA += 2. * tubpar[2];
1208 tubpar[0] = 19.6 / 2.;
1209 tubpar[1] = 25.3 / 2.;
1210 tubpar[2] = 4.9 / 2.;
1211 TVirtualMC::GetMC()->Gsvolu(
"QF01",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1212 TVirtualMC::GetMC()->Gspos(
"QF01", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1214 zA += 2. * tubpar[2];
1217 tubpar[0] = 20.2 / 2.;
1218 tubpar[1] = 20.6 / 2.;
1219 tubpar[2] = 2.15 / 2.;
1220 TVirtualMC::GetMC()->Gsvolu(
"QA19",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1221 TVirtualMC::GetMC()->Gspos(
"QA19", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1223 zA += 2. * tubpar[2];
1225 conpar[0] = 6.9 / 2.;
1226 conpar[1] = 20.2 / 2.;
1227 conpar[2] = 20.6 / 2.;
1228 conpar[3] = 23.9 / 2.;
1229 conpar[4] = 24.3 / 2.;
1230 TVirtualMC::GetMC()->Gsvolu(
"QA20",
"CONE",
getMediumID(
kFe), conpar, 5);
1231 TVirtualMC::GetMC()->Gspos(
"QA20", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1233 zA += 2. * conpar[0];
1235 tubpar[0] = 23.9 / 2.;
1236 tubpar[1] = 25.5 / 2.;
1237 tubpar[2] = 17.0 / 2.;
1238 TVirtualMC::GetMC()->Gsvolu(
"QA21",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1239 TVirtualMC::GetMC()->Gspos(
"QA21", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1241 zA += 2. * tubpar[2];
1243 conpar[0] = 6.9 / 2.;
1244 conpar[1] = 23.9 / 2.;
1245 conpar[2] = 24.3 / 2.;
1246 conpar[3] = 20.2 / 2.;
1247 conpar[4] = 20.6 / 2.;
1248 TVirtualMC::GetMC()->Gsvolu(
"QA22",
"CONE",
getMediumID(
kFe), conpar, 5);
1249 TVirtualMC::GetMC()->Gspos(
"QA22", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1251 zA += 2. * conpar[0];
1253 tubpar[0] = 20.2 / 2.;
1254 tubpar[1] = 20.6 / 2.;
1255 tubpar[2] = 2.15 / 2.;
1256 TVirtualMC::GetMC()->Gsvolu(
"QA23",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1257 TVirtualMC::GetMC()->Gspos(
"QA23", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1259 zA += 2. * tubpar[2];
1262 tubpar[0] = 19.6 / 2.;
1263 tubpar[1] = 25.3 / 2.;
1264 tubpar[2] = 4.9 / 2.;
1265 TVirtualMC::GetMC()->Gsvolu(
"QF02",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1266 TVirtualMC::GetMC()->Gspos(
"QF02", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1268 zA += 2. * tubpar[2];
1271 tubpar[0] = 19.6 / 2.;
1272 tubpar[1] = 20.0 / 2.;
1273 tubpar[2] = 3.9 / 2.;
1274 TVirtualMC::GetMC()->Gsvolu(
"QA24",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1275 TVirtualMC::GetMC()->Gspos(
"QA24", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1277 zA += 2. * tubpar[2];
1280 conpar[0] = 32.55 / 2.;
1281 conpar[1] = 19.6 / 2.;
1282 conpar[2] = 20.0 / 2.;
1283 conpar[3] = 21.66 / 2.;
1284 conpar[4] = 22.06 / 2.;
1285 TVirtualMC::GetMC()->Gsvolu(
"QA25",
"CONE",
getMediumID(
kFe), conpar, 5);
1286 TVirtualMC::GetMC()->Gspos(
"QA25", 1,
"ZDCA", 0., 0., conpar[0] + zA, 0,
"ONLY");
1288 zA += 2. * conpar[0];
1291 tubpar[0] = 21.66 / 2.;
1292 tubpar[1] = 22.06 / 2.;
1293 tubpar[2] = 28.6 / 2.;
1294 TVirtualMC::GetMC()->Gsvolu(
"QA26",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1295 TVirtualMC::GetMC()->Gspos(
"QA26", 1,
"ZDCA", 0., 0., tubpar[2] + zA, 0,
"ONLY");
1297 zA += 2. * tubpar[2];
1302 double dx = -3.970000;
1303 double dy = 0.000000;
1306 double thx = 84.989100;
1307 double phx = 0.000000;
1308 double thy = 90.000000;
1309 double phy = 90.000000;
1310 double thz = 5.010900;
1311 double phz = 180.000000;
1312 TGeoRotation* rotMatrix1 =
new TGeoRotation(
"", thx, phx, thy, phy, thz, phz);
1314 TGeoCombiTrans* rotMatrix2 =
new TGeoCombiTrans(
"ZDC_c1", dx, dy, dz, rotMatrix1);
1315 rotMatrix2->RegisterYourself();
1318 double thx3 = 95.010900;
1319 double phx3 = 0.000000;
1320 double thy3 = 90.000000;
1321 double phy3 = 90.000000;
1322 double thz3 = 5.010900;
1323 double phz3 = 0.000000;
1324 TGeoRotation* rotMatrix3 =
new TGeoRotation(
"", thx3, phx3, thy3, phy3, thz3, phz3);
1325 TGeoCombiTrans* rotMatrix4 =
new TGeoCombiTrans(
"ZDC_c2", -dx, dy, dz, rotMatrix3);
1326 rotMatrix4->RegisterYourself();
1330 double rang1[6] = {90. - 1.0027, 0., 90., 90., 1.0027, 180.};
1331 double rang2[6] = {90. + 1.0027, 0., 90., 90., 1.0027, 0.};
1332 TVirtualMC::GetMC()->Matrix(irotpipe1, rang1[0], rang1[1], rang1[2], rang1[3], rang1[4], rang1[5]);
1333 TVirtualMC::GetMC()->Matrix(irotpipe2, rang2[0], rang2[1], rang2[2], rang2[3], rang2[4], rang2[5]);
1337 TGeoVolume* pZDCA = gGeoManager->GetVolume(
"ZDCA");
1339 conpar[0] = (90.1 - 0.95 - 0.26) / 2.;
1340 conpar[1] = 0.0 / 2.;
1341 conpar[2] = 21.6 / 2.;
1342 conpar[3] = 0.0 / 2.;
1343 conpar[4] = 5.8 / 2.;
1344 new TGeoCone(
"QALext", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1346 conpar[0] = (90.1 - 0.95 - 0.26) / 2.;
1347 conpar[1] = 0.0 / 2.;
1348 conpar[2] = 21.2 / 2.;
1349 conpar[3] = 0.0 / 2.;
1350 conpar[4] = 5.4 / 2.;
1351 new TGeoCone(
"QALint", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1354 TGeoCompositeShape* pOutTrousers =
new TGeoCompositeShape(
"outTrousers",
"QALext:ZDC_c1+QALext:ZDC_c2");
1359 TGeoVolume* pQALext =
new TGeoVolume(
"QALext", pOutTrousers, matmgr.getTGeoMedium(
"ZDC",
kFeLowTh));
1360 pQALext->SetLineColor(kBlue);
1361 pQALext->SetVisLeaves(kTRUE);
1363 TGeoTranslation* tr1 =
new TGeoTranslation(0., 0., (
double)conpar[0] + 0.95 + zA);
1364 pZDCA->AddNode(pQALext, 1, tr1);
1366 TGeoCompositeShape* pIntTrousers =
new TGeoCompositeShape(
"intTrousers",
"QALint:ZDC_c1+QALint:ZDC_c2");
1368 TGeoVolume* pQALint =
new TGeoVolume(
"QALint", pIntTrousers, matmgr.getTGeoMedium(
"ZDC",
kVoidNoField));
1369 pQALint->SetLineColor(kAzure);
1370 pQALint->SetVisLeaves(kTRUE);
1371 pQALext->AddNode(pQALint, 1);
1376 tubpar[0] = 5.4 / 2.;
1377 tubpar[1] = 5.8 / 2.;
1378 tubpar[2] = 40.0 / 2.;
1379 TVirtualMC::GetMC()->Gsvolu(
"QA27",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1380 TVirtualMC::GetMC()->Gspos(
"QA27", 1,
"ZDCA", -15.8 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1381 TVirtualMC::GetMC()->Gspos(
"QA27", 2,
"ZDCA", 15.8 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1383 zA += 2. * tubpar[2];
1386 conpar[0] = (10. - 1.) / 2.;
1387 conpar[1] = 5.4 / 2.;
1388 conpar[2] = 5.8 / 2.;
1389 conpar[3] = 6.3 / 2.;
1390 conpar[4] = 7.0 / 2.;
1391 TVirtualMC::GetMC()->Gsvolu(
"QA28",
"CONE",
getMediumID(
kFe), conpar, 5);
1392 TVirtualMC::GetMC()->Gspos(
"QA28", 1,
"ZDCA", -7.9 - 0.175, 0., conpar[0] + 0.5 + zA, irotpipe1,
"ONLY");
1393 TVirtualMC::GetMC()->Gspos(
"QA28", 2,
"ZDCA", 7.9 + 0.175, 0., conpar[0] + 0.5 + zA, irotpipe2,
"ONLY");
1395 zA += 2. * conpar[0] + 1.;
1398 tubpar[0] = 6.3 / 2.;
1399 tubpar[1] = 7.0 / 2.;
1400 tubpar[2] = (342.5 + 498.3) / 2.;
1401 TVirtualMC::GetMC()->Gsvolu(
"QA29",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1402 TVirtualMC::GetMC()->Gspos(
"QA29", 1,
"ZDCA", -16.5 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1403 TVirtualMC::GetMC()->Gspos(
"QA29", 2,
"ZDCA", 16.5 / 2., 0., tubpar[2] + zA, 0,
"ONLY");
1406 zA += 2. * tubpar[2];
1409 if (mLumiLength > 0.) {
1410 boxpar[0] = 8.0 / 2.;
1411 boxpar[1] = 8.0 / 2.;
1412 boxpar[2] = mLumiLength / 2.;
1414 TVirtualMC::GetMC()->Gspos(
"QLUA", 1,
"ZDCA", 0., 0.,
Geometry::ZNAPOSITION[1] - 66. - boxpar[2], 0,
"ONLY");
1415 LOG(
debug) <<
"A-side luminometer positioned in front of ZNA\n";
1420void Detector::createCsideBeamLine()
1422 double tubpar[3] = {0., 0., 0};
1423 double boxpar[3] = {0., 0., 0};
1424 double tubspar[5] = {0., 0., 0., 0., 0.};
1425 double conpar[15] = {
1430 float zCompensator = 1974.;
1435 conpar[3] = -13500.;
1438 conpar[6] = -zCompensator;
1441 conpar[9] = -zCompensator;
1443 conpar[11] = 6.7 / 2.;
1446 conpar[14] = 6.7 / 2.;
1448 TVirtualMC::GetMC()->Gspos(
"ZDCC", 1,
"cave", 0., 0., 0., 0,
"ONLY");
1451 tubpar[0] = 6.3 / 2.;
1452 tubpar[1] = 6.7 / 2.;
1454 tubpar[2] = (5838.3 - zC) / 2.;
1455 TVirtualMC::GetMC()->Gsvolu(
"QT01",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1456 TVirtualMC::GetMC()->Gspos(
"QT01", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1458 zC += 2. * tubpar[2];
1463 tubpar[0] = 6.94 / 2.;
1464 tubpar[1] = 7.34 / 2.;
1465 tubpar[2] = (6909.8 - zC) / 2.;
1466 TVirtualMC::GetMC()->Gsvolu(
"QT02",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1467 TVirtualMC::GetMC()->Gspos(
"QT02", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1469 zC += 2. * tubpar[2];
1471 tubpar[0] = 8. / 2.;
1472 tubpar[1] = 8.6 / 2.;
1473 tubpar[2] = (6958.3 - zC) / 2.;
1474 TVirtualMC::GetMC()->Gsvolu(
"QT0B",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1475 TVirtualMC::GetMC()->Gspos(
"QT0B", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1477 zC += 2. * tubpar[2];
1479 tubpar[0] = 9. / 2.;
1480 tubpar[1] = 9.6 / 2.;
1481 tubpar[2] = (7022.8 - zC) / 2.;
1482 TVirtualMC::GetMC()->Gsvolu(
"QT03",
"TUBE",
getMediumID(
kFe), tubpar, 3);
1483 TVirtualMC::GetMC()->Gspos(
"QT03", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1485 zC += 2. * tubpar[2];
1487 conpar[0] = 39.2 / 2.;
1488 conpar[1] = 18. / 2.;
1489 conpar[2] = 18.6 / 2.;
1490 conpar[3] = 9. / 2.;
1491 conpar[4] = 9.6 / 2.;
1492 TVirtualMC::GetMC()->Gsvolu(
"QC01",
"CONE",
getMediumID(
kFe), conpar, 5);
1493 TVirtualMC::GetMC()->Gspos(
"QC01", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1495 zC += conpar[0] * 2.;
1498 float totLength1 = 160.8 + 78. + 148. + 78. + 9.3;
1500 tubpar[0] = 18.6 / 2.;
1501 tubpar[1] = 7.6 / 2.;
1502 tubpar[2] = totLength1 / 2.;
1503 TVirtualMC::GetMC()->Gsvolu(
"QE01",
"ELTU",
getMediumID(
kFe), tubpar, 3);
1510 tubpar[0] = 18.0 / 2.;
1511 tubpar[1] = 7.0 / 2.;
1512 tubpar[2] = totLength1 / 2.;
1520 TVirtualMC::GetMC()->Gspos(
"QE01", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1521 TVirtualMC::GetMC()->Gspos(
"QE02", 1,
"QE01", 0., 0., 0., 0,
"ONLY");
1524 if (mTCLIAAPERTURE < 3.5) {
1525 boxpar[0] = 5.4 / 2.;
1526 boxpar[1] = (3.5 - mTCLIAAPERTURE - mVCollSideCCentreY - 0.7) / 2.;
1527 if (boxpar[1] < 0.) {
1530 boxpar[2] = 124.4 / 2.;
1532 TVirtualMC::GetMC()->Gspos(
"QCVC", 1,
"QE02", -boxpar[0], mTCLIAAPERTURE + mVCollSideCCentreY + boxpar[1], -totLength1 / 2. + 160.8 + 78. + 148. / 2., 0,
"ONLY");
1533 TVirtualMC::GetMC()->Gspos(
"QCVC", 2,
"QE02", -boxpar[0], -mTCLIAAPERTURENEG + mVCollSideCCentreY - boxpar[1], -totLength1 / 2. + 160.8 + 78. + 148. / 2., 0,
"ONLY");
1536 zC += tubpar[2] * 2.;
1539 conpar[0] = 31.5 / 2.;
1540 conpar[1] = 21.27 / 2.;
1541 conpar[2] = 21.87 / 2.;
1542 conpar[3] = 18.0 / 2.;
1543 conpar[4] = 18.6 / 2.;
1544 TVirtualMC::GetMC()->Gsvolu(
"QC02",
"CONE",
getMediumID(
kFe), conpar, 5);
1545 TVirtualMC::GetMC()->Gspos(
"QC02", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1547 zC += conpar[0] * 2.;
1550 float totLenght2 = (8373.3 - zC);
1551 tubpar[0] = 21.2 / 2.;
1552 tubpar[1] = 21.9 / 2.;
1553 tubpar[2] = totLenght2 / 2.;
1555 TVirtualMC::GetMC()->Gspos(
"QT04", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1557 zC += tubpar[2] * 2.;
1561 conpar[0] = 121. / 2.;
1562 conpar[1] = 79.7 / 2.;
1563 conpar[2] = 81.3 / 2.;
1564 conpar[3] = 21.27 / 2.;
1565 conpar[4] = 21.87 / 2.;
1567 TVirtualMC::GetMC()->Gspos(
"QC03", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1569 zC += 2. * conpar[0];
1572 tubpar[0] = 79.7 / 2.;
1573 tubpar[1] = 81.3 / 2.;
1574 tubpar[2] = (5 * 475.2 + 97. - 136) / 2.;
1576 TVirtualMC::GetMC()->Gspos(
"QT05", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1578 zC += 2. * tubpar[2];
1587 conpar[0] = 9.09 / 2.;
1588 conpar[1] = 74.82868 / 2.;
1589 conpar[2] = 76.42868 / 2.;
1590 conpar[3] = 79.7 / 2.;
1591 conpar[4] = 81.3 / 2.;
1593 TVirtualMC::GetMC()->Gspos(
"QC04", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1595 zC += 2. * conpar[0];
1598 conpar[0] = 96.2 / 2.;
1599 conpar[1] = 23.19588 / 2.;
1600 conpar[2] = 23.79588 / 2.;
1601 conpar[3] = 74.82868 / 2.;
1602 conpar[4] = 75.42868 / 2.;
1604 TVirtualMC::GetMC()->Gspos(
"QC05", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1606 zC += 2. * conpar[0];
1609 conpar[0] = 6.71 / 2.;
1610 conpar[1] = 19.6 / 2.;
1611 conpar[2] = 21.2 / 2.;
1612 conpar[3] = 23.19588 / 2.;
1613 conpar[4] = 24.79588 / 2.;
1615 TVirtualMC::GetMC()->Gspos(
"QC06", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1617 zC += 2. * conpar[0];
1620 tubpar[0] = 20.2 / 2.;
1621 tubpar[1] = 20.6 / 2.;
1622 tubpar[2] = 2.15 / 2.;
1624 TVirtualMC::GetMC()->Gspos(
"QT06", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1626 zC += 2. * tubpar[2];
1628 conpar[0] = 6.9 / 2.;
1629 conpar[1] = 23.9 / 2.;
1630 conpar[2] = 24.3 / 2.;
1631 conpar[3] = 20.2 / 2.;
1632 conpar[4] = 20.6 / 2.;
1634 TVirtualMC::GetMC()->Gspos(
"QC07", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1636 zC += 2. * conpar[0];
1638 tubpar[0] = 23.9 / 2.;
1639 tubpar[1] = 25.5 / 2.;
1640 tubpar[2] = 17.0 / 2.;
1642 TVirtualMC::GetMC()->Gspos(
"QT07", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1644 zC += 2. * tubpar[2];
1646 conpar[0] = 6.9 / 2.;
1647 conpar[1] = 20.2 / 2.;
1648 conpar[2] = 20.6 / 2.;
1649 conpar[3] = 23.9 / 2.;
1650 conpar[4] = 24.3 / 2.;
1652 TVirtualMC::GetMC()->Gspos(
"QC08", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1654 zC += 2. * conpar[0];
1656 tubpar[0] = 20.2 / 2.;
1657 tubpar[1] = 20.6 / 2.;
1658 tubpar[2] = 2.15 / 2.;
1660 TVirtualMC::GetMC()->Gspos(
"QT08", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1662 zC += 2. * tubpar[2];
1665 tubpar[0] = 19.6 / 2.;
1666 tubpar[1] = 25.3 / 2.;
1667 tubpar[2] = 4.9 / 2.;
1669 TVirtualMC::GetMC()->Gspos(
"QT09", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1671 zC += 2. * tubpar[2];
1674 tubpar[0] = 19.6 / 2.;
1675 tubpar[1] = 20.0 / 2.;
1676 tubpar[2] = 3.9 / 2.;
1678 TVirtualMC::GetMC()->Gspos(
"QT10", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1680 zC += 2. * tubpar[2];
1683 conpar[0] = 32.55 / 2.;
1684 conpar[1] = 21.66 / 2.;
1685 conpar[2] = 22.06 / 2.;
1686 conpar[3] = 19.6 / 2.;
1687 conpar[4] = 20.0 / 2.;
1689 TVirtualMC::GetMC()->Gspos(
"QC09", 1,
"ZDCC", 0., 0., -conpar[0] - zC, 0,
"ONLY");
1691 zC += 2. * conpar[0];
1694 tubpar[0] = 21.66 / 2.;
1695 tubpar[1] = 22.06 / 2.;
1696 tubpar[2] = 28.6 / 2.;
1698 TVirtualMC::GetMC()->Gspos(
"QT11", 1,
"ZDCC", 0., 0., -tubpar[2] - zC, 0,
"ONLY");
1700 zC += 2. * tubpar[2];
1705 double dx = -3.970000;
1706 double dy = 0.000000;
1709 double thx = 84.989100;
1710 double phx = 180.000000;
1711 double thy = 90.000000;
1712 double phy = 90.000000;
1713 double thz = 185.010900;
1714 double phz = 0.000000;
1715 TGeoRotation* rotMatrix1c =
new TGeoRotation(
"c", thx, phx, thy, phy, thz, phz);
1720 TGeoCombiTrans* rotMatrix2c =
new TGeoCombiTrans(
"ZDCC_c1", dx, dy, dz, rotMatrix1c);
1721 rotMatrix2c->RegisterYourself();
1731 thz = 180. - 5.010900;
1733 TGeoRotation* rotMatrix3c =
new TGeoRotation(
"", thx, phx, thy, phy, thz, phz);
1734 TGeoCombiTrans* rotMatrix4c =
new TGeoCombiTrans(
"ZDCC_c2", dx, dy, dz, rotMatrix3c);
1735 rotMatrix4c->RegisterYourself();
1739 TGeoVolume* pZDCC = gGeoManager->GetVolume(
"ZDCC");
1741 conpar[0] = (90.1 - 0.95 - 0.26 - 0.0085) / 2.;
1742 conpar[1] = 0.0 / 2.;
1743 conpar[2] = 21.6 / 2.;
1744 conpar[3] = 0.0 / 2.;
1745 conpar[4] = 5.8 / 2.;
1746 new TGeoCone(
"QCLext", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1748 conpar[0] = (90.1 - 0.95 - 0.26 - 0.0085) / 2.;
1749 conpar[1] = 0.0 / 2.;
1750 conpar[2] = 21.2 / 2.;
1751 conpar[3] = 0.0 / 2.;
1752 conpar[4] = 5.4 / 2.;
1753 new TGeoCone(
"QCLint", conpar[0], conpar[1], conpar[2], conpar[3], conpar[4]);
1756 TGeoCompositeShape* pOutTrousersC =
new TGeoCompositeShape(
"outTrousersC",
"QCLext:ZDCC_c1+QCLext:ZDCC_c2");
1761 TGeoMedium* medZDCFeLowTh = gGeoManager->GetMedium(
"ZDC_IronLowTh$");
1762 TGeoVolume* pQCLext =
new TGeoVolume(
"QCLext", pOutTrousersC, medZDCFeLowTh);
1763 pQCLext->SetLineColor(kAzure);
1764 pQCLext->SetVisLeaves(kTRUE);
1766 TGeoTranslation* tr1c =
new TGeoTranslation(0., 0., (
double)-conpar[0] - 0.95 - zC);
1768 pZDCC->AddNode(pQCLext, 1, tr1c);
1770 TGeoCompositeShape* pIntTrousersC =
new TGeoCompositeShape(
"intTrousersC",
"QCLint:ZDCC_c1+QCLint:ZDCC_c2");
1772 TGeoMedium* medZDCvoid = gGeoManager->GetMedium(
"ZDC_VoidNoField$");
1773 TGeoVolume* pQCLint =
new TGeoVolume(
"QCLint", pIntTrousersC, medZDCvoid);
1774 pQCLint->SetLineColor(kBlue);
1775 pQCLint->SetVisLeaves(kTRUE);
1776 pQCLext->AddNode(pQCLint, 1);
1783 tubpar[0] = 5.4 / 2.;
1784 tubpar[1] = 5.8 / 2.;
1785 tubpar[2] = 40.0 / 2.;
1787 TVirtualMC::GetMC()->Gspos(
"QT12", 1,
"ZDCC", -15.8 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1788 TVirtualMC::GetMC()->Gspos(
"QT12", 2,
"ZDCC", 15.8 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1790 zC += 2. * tubpar[2];
1794 double rang1[6] = {90. - 1.0027, 0., 90., 90., 1.0027, 180.};
1795 double rang2[6] = {90. + 1.0027, 0., 90., 90., 1.0027, 0.};
1796 TVirtualMC::GetMC()->Matrix(irotpipe1, rang1[0], rang1[1], rang1[2], rang1[3], rang1[4], rang1[5]);
1797 TVirtualMC::GetMC()->Matrix(irotpipe2, rang2[0], rang2[1], rang2[2], rang2[3], rang2[4], rang2[5]);
1800 conpar[0] = (10. - 0.2 -
offset) / 2.;
1801 conpar[1] = 6.3 / 2.;
1802 conpar[2] = 7.0 / 2.;
1803 conpar[3] = 5.4 / 2.;
1804 conpar[4] = 5.8 / 2.;
1806 TVirtualMC::GetMC()->Gspos(
"QC10", 1,
"ZDCC", -7.9 - 0.175, 0., -conpar[0] - 0.1 - zC, irotpipe1,
"ONLY");
1807 TVirtualMC::GetMC()->Gspos(
"QC10", 2,
"ZDCC", 7.9 + 0.175, 0., -conpar[0] - 0.1 - zC, irotpipe2,
"ONLY");
1809 zC += 2. * conpar[0] + 0.2;
1812 tubpar[0] = 6.3 / 2.;
1813 tubpar[1] = 7.0 / 2.;
1814 tubpar[2] = 639.8 / 2.;
1816 TVirtualMC::GetMC()->Gspos(
"QT13", 1,
"ZDCC", -16.5 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1817 TVirtualMC::GetMC()->Gspos(
"QT13", 2,
"ZDCC", 16.5 / 2., 0., -tubpar[2] - zC, 0,
"ONLY");
1819 zC += 2. * tubpar[2];
1822 if (mLumiLength > 0.) {
1823 boxpar[0] = 8.0 / 2.;
1824 boxpar[1] = 8.0 / 2.;
1825 boxpar[2] = mLumiLength / 2.;
1827 TVirtualMC::GetMC()->Gspos(
"QLUC", 1,
"ZDCC", 0., 0.,
Geometry::ZNCPOSITION[1] + 66. + boxpar[2], 0,
"ONLY");
1828 LOG(
debug) <<
"C-side luminometer positioned in front of ZNC\n";
1833void Detector::createMagnets()
1835 float tubpar[3] = {0., 0., 0.};
1836 float boxpar[3] = {0., 0., 0.};
1838 double zCompensatorField = 1972.5;
1839 double zITField = 2296.5;
1840 double zD1Field = 5838.3001;
1841 double zD2Field = 12167.8;
1852 tubpar[2] = 153. / 2.;
1854 TVirtualMC::GetMC()->Gspos(
"MBXW", 1,
"ZDCC", 0., 0., -tubpar[2] - zCompensatorField, 0,
"ONLY");
1859 tubpar[2] = 150. / 2.;
1861 TVirtualMC::GetMC()->Gspos(
"YMBX", 1,
"ZDCC", 0., 0., -tubpar[2] - zCompensatorField - 1.5, 0,
"ONLY");
1869 tubpar[2] = 637. / 2.;
1875 tubpar[2] = 637. / 2.;
1878 TVirtualMC::GetMC()->Gspos(
"MQXL", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField, 0,
"ONLY");
1879 TVirtualMC::GetMC()->Gspos(
"YMQL", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField, 0,
"ONLY");
1881 TVirtualMC::GetMC()->Gspos(
"MQXL", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 2400., 0,
"ONLY");
1882 TVirtualMC::GetMC()->Gspos(
"YMQL", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 2400., 0,
"ONLY");
1888 tubpar[2] = 550. / 2.;
1894 tubpar[2] = 550. / 2.;
1897 TVirtualMC::GetMC()->Gspos(
"MQX ", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField - 908.5, 0,
"ONLY");
1898 TVirtualMC::GetMC()->Gspos(
"YMQ ", 1,
"ZDCC", 0., 0., -tubpar[2] - zITField - 908.5, 0,
"ONLY");
1900 TVirtualMC::GetMC()->Gspos(
"MQX ", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 1558.5, 0,
"ONLY");
1901 TVirtualMC::GetMC()->Gspos(
"YMQ ", 2,
"ZDCC", 0., 0., -tubpar[2] - zITField - 1558.5, 0,
"ONLY");
1907 tubpar[2] = 945. / 2.;
1912 boxpar[0] = TMath::Sqrt(tubpar[1] * tubpar[1] - (2.98 + 0.2) * (2.98 + 0.2)) - 0.05;
1913 boxpar[1] = 0.2 / 2.;
1914 boxpar[2] = 945. / 2.;
1915 TVirtualMC::GetMC()->Gsvolu(
"MD1V",
"BOX ",
getMediumID(
kCu), boxpar, 3);
1916 TVirtualMC::GetMC()->Gspos(
"MD1V", 1,
"MD1 ", 0., 2.98 + boxpar[1], 0., 0,
"ONLY");
1917 TVirtualMC::GetMC()->Gspos(
"MD1V", 2,
"MD1 ", 0., -2.98 - boxpar[1], 0., 0,
"ONLY");
1921 tubpar[1] = 110. / 2.;
1922 tubpar[2] = 945. / 2.;
1925 TVirtualMC::GetMC()->Gspos(
"YD1 ", 1,
"ZDCC", 0., 0., -tubpar[2] - zD1Field, 0,
"ONLY");
1926 TVirtualMC::GetMC()->Gspos(
"MD1 ", 1,
"ZDCC", 0., 0., -tubpar[2] - zD1Field, 0,
"ONLY");
1931 tubpar[1] = 7.5 / 2.;
1932 tubpar[2] = 945. / 2.;
1938 tubpar[2] = 945. / 2.;
1940 TVirtualMC::GetMC()->Gspos(
"YD2 ", 1,
"ZDCC", 0., 0., -tubpar[2] - zD2Field, 0,
"ONLY");
1942 TVirtualMC::GetMC()->Gspos(
"MD2 ", 1,
"YD2 ", -9.4, 0., 0., 0,
"ONLY");
1943 TVirtualMC::GetMC()->Gspos(
"MD2 ", 2,
"YD2 ", 9.4, 0., 0., 0,
"ONLY");
1953 tubpar[2] = 153. / 2.;
1955 TVirtualMC::GetMC()->Gspos(
"MCBW", 1,
"ZDCA", 0., 0., tubpar[2] + zCompensatorField, 0,
"ONLY");
1960 tubpar[2] = 153. / 2.;
1962 TVirtualMC::GetMC()->Gspos(
"YMCB", 1,
"ZDCA", 0., 0., tubpar[2] + zCompensatorField, 0,
"ONLY");
1970 tubpar[2] = 637. / 2.;
1977 tubpar[2] = 637. / 2.;
1981 TVirtualMC::GetMC()->Gspos(
"MQX1", 1,
"ZDCA", 0., 0., tubpar[2] + zITField, 0,
"ONLY");
1982 TVirtualMC::GetMC()->Gspos(
"YMQ1", 1,
"ZDCA", 0., 0., tubpar[2] + zITField, 0,
"ONLY");
1985 tubpar[0] = 4.78 / 2.;
1986 tubpar[1] = 5.18 / 2.;
1987 tubpar[2] = 637. / 2.;
1988 TVirtualMC::GetMC()->Gsvolu(
"QBS1",
"TUBE",
getMediumID(
kCu), tubpar, 3);
1989 TVirtualMC::GetMC()->Gspos(
"QBS1", 1,
"MQX1", 0., 0., 0., 0,
"ONLY");
1991 boxpar[0] = 0.2 / 2.0;
1992 boxpar[1] = TMath::Sqrt(tubpar[0] * tubpar[0] - (1.9 + 0.2) * (1.9 + 0.2));
1993 boxpar[2] = 637. / 2.;
1994 TVirtualMC::GetMC()->Gsvolu(
"QBS2",
"BOX ",
getMediumID(
kCu), boxpar, 3);
1995 TVirtualMC::GetMC()->Gspos(
"QBS2", 1,
"MQX1", 1.9 + boxpar[0], 0., 0., 0,
"ONLY");
1996 TVirtualMC::GetMC()->Gspos(
"QBS2", 2,
"MQX1", -1.9 - boxpar[0], 0., 0., 0,
"ONLY");
1999 TVirtualMC::GetMC()->Gspos(
"MQX4", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 2400., 0,
"ONLY");
2000 TVirtualMC::GetMC()->Gspos(
"YMQ1", 2,
"ZDCA", 0., 0., tubpar[2] + zITField + 2400., 0,
"ONLY");
2003 tubpar[0] = 5.79 / 2.;
2004 tubpar[1] = 6.14 / 2.;
2005 tubpar[2] = 637. / 2.;
2006 TVirtualMC::GetMC()->Gsvolu(
"QBS3",
"TUBE",
getMediumID(
kCu), tubpar, 3);
2007 TVirtualMC::GetMC()->Gspos(
"QBS3", 1,
"MQX4", 0., 0., 0., 0,
"ONLY");
2009 boxpar[0] = 0.2 / 2.0;
2010 boxpar[1] = TMath::Sqrt(tubpar[0] * tubpar[0] - (2.405 + 0.2) * (2.405 + 0.2));
2011 boxpar[2] = 637. / 2.;
2012 TVirtualMC::GetMC()->Gsvolu(
"QBS4",
"BOX ",
getMediumID(
kCu), boxpar, 3);
2013 TVirtualMC::GetMC()->Gspos(
"QBS4", 1,
"MQX4", 2.405 + boxpar[0], 0., 0., 0,
"ONLY");
2014 TVirtualMC::GetMC()->Gspos(
"QBS4", 2,
"MQX4", -2.405 - boxpar[0], 0., 0., 0,
"ONLY");
2020 tubpar[2] = 550. / 2.;
2027 tubpar[2] = 550. / 2.;
2031 tubpar[0] = 5.79 / 2.;
2032 tubpar[1] = 6.14 / 2.;
2033 tubpar[2] = 550. / 2.;
2034 TVirtualMC::GetMC()->Gsvolu(
"QBS5",
"TUBE",
getMediumID(
kCu), tubpar, 3);
2036 boxpar[0] = 0.2 / 2.0;
2037 boxpar[1] = TMath::Sqrt(tubpar[0] * tubpar[0] - (2.405 + 0.2) * (2.405 + 0.2));
2038 boxpar[2] = 550. / 2.;
2039 TVirtualMC::GetMC()->Gsvolu(
"QBS6",
"BOX ",
getMediumID(
kCu), boxpar, 3);
2042 TVirtualMC::GetMC()->Gspos(
"MQX2", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 908.5, 0,
"ONLY");
2043 TVirtualMC::GetMC()->Gspos(
"QBS5", 1,
"MQX2", 0., 0., 0., 0,
"ONLY");
2044 TVirtualMC::GetMC()->Gspos(
"QBS6", 1,
"MQX2", 2.405 + boxpar[0], 0., 0., 0,
"ONLY");
2045 TVirtualMC::GetMC()->Gspos(
"QBS6", 2,
"MQX2", -2.405 - boxpar[0], 0., 0., 0,
"ONLY");
2046 TVirtualMC::GetMC()->Gspos(
"YMQ2", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 908.5, 0,
"ONLY");
2049 TVirtualMC::GetMC()->Gspos(
"MQX3", 1,
"ZDCA", 0., 0., tubpar[2] + zITField + 1558.5, 0,
"ONLY");
2050 TVirtualMC::GetMC()->Gspos(
"QBS5", 2,
"MQX3", 0., 0., 0., 0,
"ONLY");
2051 TVirtualMC::GetMC()->Gspos(
"QBS6", 3,
"MQX3", 2.405 + boxpar[0], 0., 0., 0,
"ONLY");
2052 TVirtualMC::GetMC()->Gspos(
"QBS6", 4,
"MQX3", -2.405 - boxpar[0], 0., 0., 0,
"ONLY");
2053 TVirtualMC::GetMC()->Gspos(
"YMQ2", 2,
"ZDCA", 0., 0., tubpar[2] + zITField + 1558.5, 0,
"ONLY");
2058 tubpar[1] = 6.75 / 2.;
2059 tubpar[2] = 945. / 2.;
2064 boxpar[0] = TMath::Sqrt(tubpar[1] * tubpar[1] - (2.885 + 0.2) * (2.885 + 0.2));
2065 boxpar[1] = 0.2 / 2.;
2066 boxpar[2] = 945. / 2.;
2067 TVirtualMC::GetMC()->Gsvolu(
"QBS7",
"BOX ",
getMediumID(
kCu), boxpar, 3);
2068 TVirtualMC::GetMC()->Gspos(
"QBS7", 1,
"MD1L", 0., 2.885 + boxpar[1], 0., 0,
"ONLY");
2069 TVirtualMC::GetMC()->Gspos(
"QBS7", 2,
"MD1L", 0., -2.885 - boxpar[1], 0., 0,
"ONLY");
2073 tubpar[1] = 110. / 2;
2074 tubpar[2] = 945. / 2.;
2077 TVirtualMC::GetMC()->Gspos(
"YD1L", 1,
"ZDCA", 0., 0., tubpar[2] + zD1Field, 0,
"ONLY");
2078 TVirtualMC::GetMC()->Gspos(
"MD1L", 1,
"ZDCA", 0., 0., tubpar[2] + zD1Field, 0,
"ONLY");
2083 tubpar[1] = 7.5 / 2.;
2084 tubpar[2] = 945. / 2.;
2090 tubpar[2] = 945. / 2.;
2092 TVirtualMC::GetMC()->Gspos(
"YD2L", 1,
"ZDCA", 0., 0., tubpar[2] + zD2Field, 0,
"ONLY");
2094 TVirtualMC::GetMC()->Gspos(
"MD2L", 1,
"YD2L", -9.4, 0., 0., 0,
"ONLY");
2095 TVirtualMC::GetMC()->Gspos(
"MD2L", 2,
"YD2L", 9.4, 0., 0., 0,
"ONLY");
2098void Detector::createDetectors()
2114void Detector::createZNZP()
2118 double znSupportBase[3] = {6.3, 4.57, 71.2};
2119 double znSupportBasePos[3] = {0., -14., 21.2};
2120 double znSupportScintillH[3] = {4.32 - 0.8, 0.8, 50.};
2121 double znSupportScintillV[3] = {0.8, 1.955, 50.};
2122 double znSupportWallsud[3] = {3.52, 1., 50.};
2123 double znSupportWallside[3] = {0.4, 5.52, 50.};
2125 float dimPb[6], dimVoid[6];
2136 TVirtualMC::GetMC()->Gsvolu(
"ZNF1",
"TUBE", mMediumPMCid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2137 TVirtualMC::GetMC()->Gsvolu(
"ZNF2",
"TUBE", mMediumPMQid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2138 TVirtualMC::GetMC()->Gsvolu(
"ZNF3",
"TUBE", mMediumPMQid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2139 TVirtualMC::GetMC()->Gsvolu(
"ZNF4",
"TUBE", mMediumPMCid,
const_cast<double*
>(
Geometry::ZNFIBRE), 3);
2159 TVirtualMC::GetMC()->Gspos(
"ZNG1", 1,
"ZNST", 0. - dx, 0. + dy, 0., 0,
"ONLY");
2160 TVirtualMC::GetMC()->Gspos(
"ZNG2", 1,
"ZNST", 0. + dx, 0. + dy, 0., 0,
"ONLY");
2161 TVirtualMC::GetMC()->Gspos(
"ZNG3", 1,
"ZNST", 0. - dx, 0. - dy, 0., 0,
"ONLY");
2162 TVirtualMC::GetMC()->Gspos(
"ZNG4", 1,
"ZNST", 0. + dx, 0. - dy, 0., 0,
"ONLY");
2165 TVirtualMC::GetMC()->Gspos(
"ZNF1", 1,
"ZNG1", 0., 0., 0., 0,
"ONLY");
2166 TVirtualMC::GetMC()->Gspos(
"ZNF2", 1,
"ZNG2", 0., 0., 0., 0,
"ONLY");
2167 TVirtualMC::GetMC()->Gspos(
"ZNF3", 1,
"ZNG3", 0., 0., 0., 0,
"ONLY");
2168 TVirtualMC::GetMC()->Gspos(
"ZNF4", 1,
"ZNG4", 0., 0., 0., 0,
"ONLY");
2173 double rangznc[6] = {90., 180., 90., 90., 180., 0.};
2174 TVirtualMC::GetMC()->Matrix(irotznc, rangznc[0], rangznc[1], rangznc[2], rangznc[3], rangznc[4], rangznc[5]);
2176 TVirtualMC::GetMC()->Gspos(
"ZNEU", 1,
"ZNENV", 0., 0., 0., 0,
"ONLY");
2186 TVirtualMC::GetMC()->Gsvolu(
"ZNBASE",
"BOX ",
getMediumID(
kAl), znSupportBase, 3);
2193 TVirtualMC::GetMC()->Gsvolu(
"ZNSCH",
"BOX ",
getMediumID(
kAl), znSupportScintillH, 3);
2199 TVirtualMC::GetMC()->Gsvolu(
"ZNSCV",
"BOX ",
getMediumID(
kAl), znSupportScintillV, 3);
2200 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 1,
"ZDCC",
Geometry::ZNCPOSITION[0] + znSupportBasePos[0] + znSupportScintillH[0] + znSupportScintillV[0],
2202 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 2,
"ZDCC",
Geometry::ZNCPOSITION[0] + znSupportBasePos[0] - znSupportScintillH[0] - znSupportScintillV[0],
2206 TVirtualMC::GetMC()->Gsvolu(
"ZNSCH",
"BOX ",
getMediumID(
kAl), znSupportScintillH, 3);
2212 TVirtualMC::GetMC()->Gsvolu(
"ZNSCV",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(znSupportScintillV), 3);
2213 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 1,
"ZDCA",
Geometry::ZNAPOSITION[0] + znSupportBasePos[0] + znSupportScintillH[0] + znSupportScintillV[0],
2215 TVirtualMC::GetMC()->Gspos(
"ZNSCV", 2,
"ZDCA",
Geometry::ZNAPOSITION[0] + znSupportBasePos[0] - znSupportScintillH[0] - znSupportScintillV[0],
2220 TVirtualMC::GetMC()->Gsvolu(
"ZNBH",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(znSupportWallsud), 3);
2231 TVirtualMC::GetMC()->Gsvolu(
"ZNBS",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(znSupportWallside), 3);
2243 double zpSupportBase1[3] = {12.5, 1.4, 75.};
2244 double zpSupportBase1Pos[3] = {0., -17., 0.};
2245 double zpSupportBase2[3] = {12.5, 2.5, 75.};
2246 double zpSupportBase2Pos[3] = {0., -9., 0.};
2247 double zpSupportBase3[3] = {1.5, 2.05, 75.};
2248 double zpSupportWallBottom[3] = {11.2, 0.25, 75.};
2249 double zpSupportWallup[3] = {11.2, 1., 75.};
2251 double zpSupportWallside[3] = {0.5, 6., 75.};
2280 TVirtualMC::GetMC()->Gspos(
"ZPG1", 1,
"ZPST", 0. - dx, 0. + dy, 0., 0,
"ONLY");
2281 TVirtualMC::GetMC()->Gspos(
"ZPG2", 1,
"ZPST", 0. + dx, 0. + dy, 0., 0,
"ONLY");
2282 TVirtualMC::GetMC()->Gspos(
"ZPG3", 1,
"ZPST", 0. - dx, 0. - dy, 0., 0,
"ONLY");
2283 TVirtualMC::GetMC()->Gspos(
"ZPG4", 1,
"ZPST", 0. + dx, 0. - dy, 0., 0,
"ONLY");
2286 TVirtualMC::GetMC()->Gspos(
"ZPF1", 1,
"ZPG1", 0., 0., 0., 0,
"ONLY");
2287 TVirtualMC::GetMC()->Gspos(
"ZPF2", 1,
"ZPG2", 0., 0., 0., 0,
"ONLY");
2288 TVirtualMC::GetMC()->Gspos(
"ZPF3", 1,
"ZPG3", 0., 0., 0., 0,
"ONLY");
2289 TVirtualMC::GetMC()->Gspos(
"ZPF4", 1,
"ZPG4", 0., 0., 0., 0,
"ONLY");
2293 TVirtualMC::GetMC()->Gspos(
"ZPRO", 1,
"ZPENV", 0., 0., 0., 0,
"ONLY");
2303 TVirtualMC::GetMC()->Gsvolu(
"ZPBASE1",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportBase1), 3);
2310 TVirtualMC::GetMC()->Gsvolu(
"ZPFOOT",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportBase3), 3);
2317 TVirtualMC::GetMC()->Gsvolu(
"ZPBASE2",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportBase2), 3);
2325 TVirtualMC::GetMC()->Gsvolu(
"ZPBB",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportWallBottom), 3);
2332 TVirtualMC::GetMC()->Gsvolu(
"ZPBT",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportWallup), 3);
2339 TVirtualMC::GetMC()->Gsvolu(
"ZPBS",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zpSupportWallside), 3);
2347void Detector::createZEM()
2352 LOG(warning) <<
"ZDC: the ZEM calorimeters are not built";
2356 double rangzem1[6] = {0., 0., 90., 90., -90., 0.};
2357 double rangzem2[6] = {180., 0., 90., 45. + 90., 90., 45.};
2358 TVirtualMC::GetMC()->Matrix(irotzem1, rangzem1[0], rangzem1[1], rangzem1[2], rangzem1[3], rangzem1[4], rangzem1[5]);
2359 TVirtualMC::GetMC()->Matrix(irotzem2, rangzem2[0], rangzem2[1], rangzem2[2], rangzem2[3], rangzem2[4], rangzem2[5]);
2362 double zemTranLength = zemLength / 20.;
2363 double zemPbSlice[6] = {0.15 * TMath::Sqrt(2), 3.5, 3.5, 45., 0., 0.};
2364 double zemVoidLayer[6] = {(zemTranLength - 2. * zemPbSlice[0]) / 2., 3.5, 3.5, 45., 0., 0.};
2366 double zemSupportTable[3] = {55. / 2., 1.5 / 2., 110. / 2.};
2367 double zemSupportBox[6] = {10.5 / 2., 100. / 2., 95. / 2., 0.25 / 2., 2. / 2., 2. / 2.};
2368 double zemSupport1[3] = {15. / 2, 3. / 2., 95. / 2.};
2369 double zemSupport2[3] = {2. / 2, 5. / 2., 95. / 2.};
2370 double zemSupport3[3] = {3.5, 2. / 2., zemLength};
2371 double zemSupport4[6] = {20. / 2., 3.5, 1.5 / 2., 45., 0., 0.};
2372 double zemWallH[3] = {10.5 / 2., 1., 95. / 2.};
2373 double zemWallVfwd[3] = {10.5 / 2., (100. - 2.) / 2., 0.2};
2374 double zemWallVbkw[3] = {10.5 / 2., (100. - 2.) / 2., 2. / 2.};
2375 double zemWallVside[3] = {0.25 / 2., (100. - 2.) / 2., (95. - 2.) / 2.};
2381 TVirtualMC::GetMC()->Gsvolu(
"ZEL0",
"PARA",
getMediumID(
kPb),
const_cast<double*
>(zemPbSlice), 6);
2382 TVirtualMC::GetMC()->Gsvolu(
"ZEL1",
"PARA",
getMediumID(
kPb),
const_cast<double*
>(zemPbSlice), 6);
2383 TVirtualMC::GetMC()->Gsvolu(
"ZEL2",
"PARA",
getMediumID(
kPb),
const_cast<double*
>(zemPbSlice), 6);
2386 TVirtualMC::GetMC()->Gspos(
"ZEL0", 1,
"ZETR", -zemTranLength + zemPbSlice[0], 0., 0., 0,
"ONLY");
2387 TVirtualMC::GetMC()->Gspos(
"ZEL1", 1,
"ZETR", zemPbSlice[0], 0., 0., 0,
"ONLY");
2398 TVirtualMC::GetMC()->Gspos(
"ZEMF", 1,
"ZES0", 0., 0., 0., irotzem2,
"ONLY");
2399 TVirtualMC::GetMC()->Gspos(
"ZEMF", 1,
"ZES1", 0., 0., 0., irotzem2,
"ONLY");
2403 TVirtualMC::GetMC()->Gspos(
"ZEV0", 1,
"ZETR", -zemVoidLayer[0], 0., 0., 0,
"ONLY");
2404 TVirtualMC::GetMC()->Gspos(
"ZEV1", 1,
"ZETR", -zemVoidLayer[0] + zemTranLength, 0., 0., 0,
"ONLY");
2411 const float y0 = 30.;
2427 float zbox = zSupport + zemSupportBox[2];
2430 TVirtualMC::GetMC()->Gsvolu(
"ZESH",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupport1), 3);
2435 TVirtualMC::GetMC()->Gsvolu(
"ZESV",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupport2), 3);
2436 TVirtualMC::GetMC()->Gspos(
"ZESV", 1,
"barrel",
Geometry::ZEMPOSITION[0] - zemSupportBox[0] + zemSupport2[0], ybox - zemSupportBox[1] - zemSupport2[1] +
y0, zbox, 0,
"ONLY");
2437 TVirtualMC::GetMC()->Gspos(
"ZESV", 2,
"barrel",
Geometry::ZEMPOSITION[0] + zemSupportBox[0] - zemSupport2[0], ybox - zemSupportBox[1] - zemSupport2[1] +
y0, zbox, 0,
"ONLY");
2438 TVirtualMC::GetMC()->Gspos(
"ZESV", 3,
"barrel", -(
Geometry::ZEMPOSITION[0] - zemSupportBox[0] + zemSupport2[0]), ybox - zemSupportBox[1] - zemSupport2[1] +
y0, zbox, 0,
"ONLY");
2439 TVirtualMC::GetMC()->Gspos(
"ZESV", 4,
"barrel", -(
Geometry::ZEMPOSITION[0] + zemSupportBox[0] - zemSupport2[0]), ybox - zemSupportBox[1] - zemSupport2[1] +
y0, zbox, 0,
"ONLY");
2442 TVirtualMC::GetMC()->Gsvolu(
"ZETA",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupportTable), 3);
2443 float ytable = ybridge - zemSupport1[1] - zemSupportTable[1];
2444 TVirtualMC::GetMC()->Gspos(
"ZETA", 1,
"barrel", 0.0, ytable +
y0, zbox, 0,
"ONLY");
2445 TVirtualMC::GetMC()->Gspos(
"ZETA", 2,
"barrel", 0.0, ytable - 13. + 2. * zemSupportTable[1] +
y0, zbox, 0,
"ONLY");
2448 TVirtualMC::GetMC()->Gsvolu(
"ZEFL",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemSupport3), 3);
2452 TVirtualMC::GetMC()->Gsvolu(
"ZELA",
"PARA",
getMediumID(
kAl),
const_cast<double*
>(zemSupport4), 6);
2459 TVirtualMC::GetMC()->Gsvolu(
"ZEW1",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemWallH), 3);
2460 TVirtualMC::GetMC()->Gsvolu(
"ZEW2",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemWallVfwd), 3);
2461 TVirtualMC::GetMC()->Gsvolu(
"ZEW3",
"BOX ",
getMediumID(
kAl),
const_cast<double*
>(zemWallVbkw), 3);
2462 TVirtualMC::GetMC()->Gsvolu(
"ZEW4",
"BOX ",
getMediumID(
kFe),
const_cast<double*
>(zemWallVside), 3);
2465 float zh1 = zSupport + zemWallH[2];
2467 TVirtualMC::GetMC()->Gspos(
"ZEW1", 2,
"barrel",
Geometry::ZEMPOSITION[0], yh1 + 2 * zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2469 TVirtualMC::GetMC()->Gspos(
"ZEW1", 4,
"barrel", -
Geometry::ZEMPOSITION[0], yh1 + 2 * zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2471 TVirtualMC::GetMC()->Gspos(
"ZEW2", 1,
"barrel",
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1] +
y0, zSupport - zemWallVfwd[2], 0,
"ONLY");
2472 TVirtualMC::GetMC()->Gspos(
"ZEW3", 1,
"barrel",
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1] +
y0, zSupport + 2 * zemWallH[2], 0,
"ONLY");
2473 TVirtualMC::GetMC()->Gspos(
"ZEW2", 2,
"barrel", -
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1] +
y0, zSupport - zemWallVfwd[2], 0,
"ONLY");
2474 TVirtualMC::GetMC()->Gspos(
"ZEW3", 2,
"barrel", -
Geometry::ZEMPOSITION[0], yh1 + zemSupportBox[1] +
y0, zSupport + 2 * zemWallH[2], 0,
"ONLY");
2478 TVirtualMC::GetMC()->Gspos(
"ZEW4", 1,
"barrel", xl1, yh1 + zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2479 TVirtualMC::GetMC()->Gspos(
"ZEW4", 2,
"barrel", xl2, yh1 + zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2480 TVirtualMC::GetMC()->Gspos(
"ZEW4", 3,
"barrel", -xl1, yh1 + zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2481 TVirtualMC::GetMC()->Gspos(
"ZEW4", 4,
"barrel", -xl2, yh1 + zemSupportBox[1] +
y0, zh1, 0,
"ONLY");
2493Bool_t Detector::withZEM()
2496 return std::find(modules.begin(), modules.end(),
"FOC") == modules.end();
2500Bool_t Detector::calculateTableIndexes(
int& ibeta,
int& iangle,
int& iradius)
2502 double x[3] = {0., 0., 0.}, xDet[3] = {0., 0., 0.},
p[3] = {0., 0., 0.}, energy = 0.;
2503 fMC->TrackPosition(
x[0],
x[1],
x[2]);
2504 fMC->TrackMomentum(p[0], p[1], p[2], energy);
2507 float ptot = TMath::Sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]);
2510 beta = ptot / energy;
2515 }
else if (beta > 0.75 && beta <= 0.85) {
2517 }
else if (beta > 0.85 && beta <= 0.95) {
2519 }
else if (beta > 0.95) {
2526 double umom[3] = {0., 0., 0.}, udet[3] = {0., 0., 0.};
2527 umom[0] =
p[0] / ptot;
2528 umom[1] =
p[1] / ptot;
2529 umom[2] =
p[2] / ptot;
2530 fMC->Gmtod(umom, udet, 2);
2531 double angleRad = TMath::ACos(udet[2]);
2532 double angleDeg = angleRad *
kRaddeg;
2533 if (angleDeg < 110.) {
2534 iangle =
int(0.5 + angleDeg / 2.);
2539 fMC->Gmtod(
x, xDet, 1);
2541 if (TMath::Abs(udet[0]) > 0) {
2542 float dcoeff = udet[1] / udet[0];
2543 radius = TMath::Abs((xDet[1] - dcoeff * xDet[0]) / TMath::Sqrt(dcoeff * dcoeff + 1.));
2545 radius = TMath::Abs(udet[0]);
2562 mLastPrincipalTrackEntered = -1;
2563 flushSpatialResponse();
2565#ifdef ZDC_FASTSIM_ONNX
2568 if (simparam.debugZDCFastSim && simparam.useZDCFastSim && mFastSimModelNeutron !=
nullptr && mFastSimModelProton !=
nullptr && mFastSimClassifier !=
nullptr) {
2569 std::fstream
output(
"o2sim-FastSimResult", std::fstream::out | std::fstream::app);
2571 LOG(
error) <<
"Could not open file.";
2574 for (
auto&
result : mFastSimResults) {
2578 mFastSimResults.clear();
2590 mLastPrincipalTrackEntered =
stack->GetCurrentTrackNumber();
2593 mCurrentPrincipalParticle = *
stack->GetCurrentTrack();
2595#ifdef ZDC_FASTSIM_ONNX
2598 if (simparam.useZDCFastSim && (mFastSimModelNeutron !=
nullptr || mFastSimModelProton !=
nullptr) && mFastSimClassifier !=
nullptr) {
2599 const std::vector<float> rawInput = {
static_cast<float>(mCurrentPrincipalParticle.Energy()),
2600 static_cast<float>(mCurrentPrincipalParticle.Vx()),
2601 static_cast<float>(mCurrentPrincipalParticle.Vy()),
2602 static_cast<float>(mCurrentPrincipalParticle.Vz()),
2603 static_cast<float>(mCurrentPrincipalParticle.Px()),
2604 static_cast<float>(mCurrentPrincipalParticle.Py()),
2605 static_cast<float>(mCurrentPrincipalParticle.Pz()),
2606 static_cast<float>(mCurrentPrincipalParticle.GetMass() * 1000.0),
2607 static_cast<float>(mCurrentPrincipalParticle.GetPDG()->Charge())};
2609 auto scaledClassParticle = mClassifierScaler->scale(rawInput);
2610 if (!scaledClassParticle.has_value()) {
2611 LOG(
error) <<
"FastSimModule: error occurred on scaling";
2613 vector<vector<float>> classifierInput = {std::move(*scaledClassParticle)};
2614 mFastSimClassifier->setInput(classifierInput);
2615 mFastSimClassifier->run();
2620 if (mModelScalerNeutron && mFastSimModelNeutron) {
2621 LOG(info) <<
"Generating fast hits for ZN";
2622 auto scaledModelParticleNeutron = mModelScalerNeutron->scale(rawInput);
2623 if (!scaledModelParticleNeutron.has_value()) {
2624 LOG(
error) <<
"FastSimModule: error occurred on scaling";
2627 mFastSimModelNeutron->setInput(modelInputNeutron);
2628 mFastSimModelNeutron->run();
2629 if (simparam.debugZDCFastSim) {
2633 bool forward = mCurrentPrincipalParticle.Pz() > 0.;
2634 FastSimToHits(mFastSimModelNeutron->getResult()[0], mCurrentPrincipalParticle, forward ?
ZNA :
ZNC);
2638 if (mModelScalerProton && mFastSimModelProton) {
2639 LOG(info) <<
"Generating fast hits for ZP";
2640 auto scaledModelParticleProton = mModelScalerProton->scale(rawInput);
2641 if (!scaledModelParticleProton.has_value()) {
2642 LOG(
error) <<
"FastSimModule: error occurred on scaling";
2645 mFastSimModelProton->setInput(modelInputProton);
2646 mFastSimModelProton->run();
2648 bool forward = mCurrentPrincipalParticle.Pz() > 0.;
2649 FastSimToHits(mFastSimModelProton->getResult()[0], mCurrentPrincipalParticle, forward ?
ZPA :
ZPC);
2681 mLastPrincipalTrackEntered = -1;
2689#ifdef ZDC_FASTSIM_ONNX
2690bool Detector::FastSimToHits(
const Ort::Value& response,
const TParticle& particle,
int detector)
2692 math_utils::Vector3D<float> xImp(0., 0., 0.);
2695 auto [Nx, Ny] = determineDetectorSize(detector);
2697 if (Nx == -1 || Ny == -1) {
2702 auto pixels = response.GetTensorData<
float>();
2704 auto determineSectorID = [&Nx = Nx, &Ny = Ny](
int detector,
int x,
int y) {
2705 if (detector ==
ZNA || detector ==
ZNC) {
2706 if ((
x +
y) % 2 == 0) {
2724 if (detector ==
ZPA || detector ==
ZPC) {
2725 if ((
x +
y) % 2 == 0) {
2728 auto i = (
int)(4.f *
x / Nx);
2729 return (
int)(
i + 1);
2734 auto determineMediumID = [
this](
int detector,
int x,
int y) {
2736 return ((
x +
y) % 2 == 0) ? mMediumPMCid : mMediumPMQid;
2740 if (detector ==
ZPA) {
2742 }
else if (detector ==
ZPC) {
2744 }
else if (detector ==
ZNA) {
2746 }
else if (detector ==
ZNC) {
2750 LOG(fatal) <<
"Unsupported detector in ZDC fast sim";
2757 for (
int x = 0;
x < Nx; ++
x) {
2759 for (
int y = 0;
y < Ny; ++
y) {
2761 int sector = determineSectorID(detector,
x,
y);
2763 int currentMediumid = determineMediumID(detector,
x,
y);
2769 float trackenergy = 0;
2770 createOrAddHit(detector,
2780 0. , 0 , 0. , 0. , 0. , 0. , 0. );
Definition of the Stack class.
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual sector
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
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 AddSensitiveVolume(TGeoVolume *v)
TVirtualMC * fMC
flag for initialisation
void RegisterAny(const char *name, T *&obj, Bool_t toFile)
static FairRootManager * Instance()
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"