139 Int_t superParent = -1;
140 Bool_t isNewPartile =
false;
141 if (partID != mCurrentTrackID) {
142 auto itTr = mSuperParents.find(partID);
143 if (itTr == mSuperParents.end()) {
145 Int_t parentID =
stack->GetCurrentTrack()->GetMother(0);
146 itTr = mSuperParents.find(parentID);
147 if (itTr == mSuperParents.end()) {
148 mSuperParents[partID] = partID;
149 superParent = partID;
152 superParent = itTr->second;
153 mSuperParents[partID] = superParent;
154 mCurrentTrackID = partID;
157 superParent = itTr->second;
158 mCurrentTrackID = partID;
161 superParent = mCurentSuperParent;
165 stack->addHit(GetDetId());
169 Double_t lostenergy = fMC->Edep();
170 if (lostenergy < DBL_EPSILON && !isNewPartile) {
174 stack->modifiesHit(GetDetId());
178 fMC->CurrentVolOffID(
181 fMC->CurrentVolOffID(3, strip);
183 fMC->CurrentVolOffID(2, cell);
185 if (superParent == mCurentSuperParent && detID == mCurrentCellID && mCurrentHit) {
193 for (Int_t itr = mHits->size() - 1; itr >= 0; itr--) {
194 Hit*
h = &(mHits->at(itr));
195 if (
h->GetTrackID() != superParent) {
198 if (
h->GetDetectorID() == detID) {
199 h->addEnergyLoss(lostenergy);
200 mCurentSuperParent = superParent;
201 mCurrentTrackID = partID;
202 mCurrentCellID = detID;
209 Float_t posX = 0., posY = 0., posZ = 0., momX = 0, momY = 0., momZ = 0., energy = 0.;
210 fMC->TrackPosition(posX, posY, posZ);
211 fMC->TrackMomentum(momX, momY, momZ, energy);
212 Double_t estart = fMC->Etot();
213 Double_t
time = fMC->TrackTime();
215 mCurrentHit =
addHit(superParent, detID, math_utils::Point3D<float>(posX, posY, posZ), math_utils::Vector3D<float>(momX, momY, momZ), estart,
217 mCurentSuperParent = superParent;
218 mCurrentTrackID = partID;
219 mCurrentCellID = detID;
308 Float_t aX[3] = {207.19, 183.85, 16.0};
309 Float_t zX[3] = {82.0, 74.0, 8.0};
310 Float_t wX[3] = {1.0, 1.0, 4.0};
316 Material(
ID_AL,
"Al", 26.98, 13., 2.7, 8.9, 999.,
nullptr, 0);
320 Float_t aT[2] = {12.011, 1.00794};
328 Float_t aF[2] = {12.011, 1.00794};
336 Material(
ID_APD,
"Si", 28.0855, 14., 2.33, 9.36, 42.3,
nullptr, 0);
339 Float_t aTI[2] = {12.011, 1.00794};
347 Float_t aTX[4] = {16.0, 28.09, 12.011, 1.00794};
348 Float_t zTX[4] = {8.0, 14.0, 6.0, 1.0};
349 Float_t wTX[4] = {292.0, 68.0, 462.0, 736.0};
355 Float_t aG10[4] = {12., 1., 16., 28.};
356 Float_t zG10[4] = {6., 1., 8., 14.};
357 Float_t wG10[4] = {.259, .288, .248, .205};
363 Material(
ID_FE,
"Steel", 55.845, 26, 7.87, 1.76, 0.,
nullptr, 0);
366 Float_t aFG[4] = {16.0, 28.09, 12.011, 1.00794};
367 Float_t zFG[4] = {8.0, 14.0, 6.0, 1.0};
368 Float_t wFG[4] = {292.0, 68.0, 462.0, 736.0};
376 Float_t aCA[4] = {1., 12., 55.8, 63.5};
377 Float_t zCA[4] = {1., 6., 26., 29.};
378 Float_t wCA[4] = {.014, .086, .42, .48};
384 Float_t aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
385 Float_t zAir[4] = {6., 7., 8., 18.};
386 Float_t wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
402 Medium(
ID_PWO,
"Crystal",
ID_PWO, 1, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
404 Medium(
ID_PWO,
"Crystal",
ID_PWO, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
408 Medium(
ID_AL,
"Alparts",
ID_AL, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001,
nullptr, 0);
411 Medium(
ID_TYVEK,
"Tyvek",
ID_TYVEK, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001,
nullptr, 0);
414 Medium(
ID_POLYFOAM,
"Polyst.foam",
ID_POLYFOAM, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
417 Medium(
ID_APD,
"SiAPD",
ID_APD, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.01, 0.01,
nullptr, 0);
420 Medium(
ID_THERMOINS,
"ThermoInsul.",
ID_THERMOINS, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
423 Medium(
ID_TEXTOLIT,
"Textolit",
ID_TEXTOLIT, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
426 Medium(
ID_PRINTCIRC,
"G10",
ID_PRINTCIRC, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.01,
nullptr, 0);
429 Medium(
ID_FE,
"Steel",
ID_FE, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.0001,
nullptr, 0);
432 Medium(
ID_FIBERGLASS,
"Fiberglass",
ID_FIBERGLASS, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
435 Medium(
ID_CABLES,
"Cables",
ID_CABLES, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
438 Medium(
ID_AIR,
"Air",
ID_AIR, 0, isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0,
nullptr, 0);
452 Double_t par[4] = {0};
456 for (ipar = 0; ipar < 3; ipar++) {
463 for (ipar = 0; ipar < 3; ipar++) {
469 for (ipar = 0; ipar < 3; ipar++) {
475 Double_t
y = (geom->
getAirGapLed() - 2 * pin[1] - 2 * preamp[1]) / 2;
476 fMC->Gspos(
"PWRA", 1,
"PCEL", 0.0,
y, 0.0, 0,
"ONLY");
479 for (ipar = 0; ipar < 3; ipar++) {
485 fMC->Gspos(
"PXTL", 1,
"PWRA", 0.0, 0.0, 0.0, 0,
"ONLY");
488 for (ipar = 0; ipar < 3; ipar++) {
494 fMC->Gspos(
"PPIN", 1,
"PCEL", 0.0,
y, 0.0, 0,
"ONLY");
495 for (ipar = 0; ipar < 3; ipar++) {
500 fMC->Gspos(
"PREA", 1,
"PCEL", 0.0,
y, 0.0, 0,
"ONLY");
510 Double_t
z = acel[2];
512 fMC->Gspos(
"PCEL", icel,
"PSTR",
x,
y, +
z, 0,
"ONLY");
513 fMC->Gspos(
"PCEL", icel + 1,
"PSTR",
x,
y, -
z, 0,
"ONLY");
517 for (ipar = 0; ipar < 3; ipar++) {
522 for (ipar = 0; ipar < 3; ipar++) {
527 fMC->Gspos(
"PSHO", 1,
"PSUP", 0.0, 0.0,
z, 0,
"ONLY");
530 fMC->Gspos(
"PSUP", 1,
"PSTR", 0.0,
y, 0.0, 0,
"ONLY");
533 for (ipar = 0; ipar < 3; ipar++) {
538 if (mCreateHalfMod) {
544 y = inthermo[1] - strip[1];
549 for (irow = 0; irow < geom->
getNStripX(); irow++) {
550 Double_t
x = (2 * irow + 1 - geom->
getNStripX()) * strip[0];
551 for (icol = 0; icol < geom->
getNStripZ(); icol++) {
552 z = (2 * icol + 1 - geom->
getNStripZ()) * strip[2];
553 fMC->Gspos(
"PSTR", nr,
"PTII",
x,
y,
z, 0,
"ONLY");
557 if (mCreateHalfMod) {
559 for (irow = 0; irow < geom->
getNStripX(); irow++) {
560 Double_t
x = (2 * irow + 1 - geom->
getNStripX()) * strip[0];
561 for (icol = 0; icol < geom->
getNStripZ(); icol++) {
562 z = (2 * icol + 1 - geom->
getNStripZ()) * strip[2];
564 fMC->Gspos(
"PSTR", nr,
"PTIH",
x,
y,
z, 0,
"ONLY");
572 for (ipar = 0; ipar < 3; ipar++) {
576 if (mCreateHalfMod) {
580 y = agap[1] - inthermo[1];
582 fMC->Gspos(
"PTII", 1,
"PAGA", 0.0,
y, 0.0, 0,
"ONLY");
583 if (mCreateHalfMod) {
584 fMC->Gspos(
"PTIH", 1,
"PAGH", 0.0,
y, 0.0, 0,
"ONLY");
588 for (ipar = 0; ipar < 3; ipar++) {
592 if (mCreateHalfMod) {
597 y = cooler[1] - agap[1];
599 fMC->Gspos(
"PAGA", 1,
"PCOR", 0.0,
y, 0.0, 0,
"ONLY");
600 if (mCreateHalfMod) {
601 fMC->Gspos(
"PAGH", 1,
"PCOH", 0.0,
y, 0.0, 0,
"ONLY");
605 for (ipar = 0; ipar < 4; ipar++) {
609 if (mCreateHalfMod) {
615 Matrix(idrotm, 90.0, 0.0, 0.0, 0.0, 90.0, 270.0);
618 z = outparams[3] - cooler[1];
619 fMC->Gspos(
"PCOR", 1,
"PTIO", 0., 0.0,
z, idrotm,
"ONLY");
620 if (mCreateHalfMod) {
621 fMC->Gspos(
"PCOH", 1,
"PIOH", 0., 0.0,
z, idrotm,
"ONLY");
625 for (ipar = 0; ipar < 4; ipar++) {
629 if (mCreateHalfMod) {
634 z = covparams[3] - outparams[3];
635 fMC->Gspos(
"PTIO", 1,
"PCOL", 0., 0.0,
z, 0,
"ONLY");
636 if (mCreateHalfMod) {
637 fMC->Gspos(
"PIOH", 1,
"PCLH", 0., 0.0,
z, 0,
"ONLY");
641 for (ipar = 0; ipar < 3; ipar++) {
646 fMC->Gspos(
"PFGC", 1,
"PCOL", 0., 0.0,
z, 0,
"ONLY");
647 if (mCreateHalfMod) {
648 fMC->Gspos(
"PFGC", 1,
"PCLH", 0., 0.0,
z, 0,
"ONLY");
654 for (ipar = 0; ipar < 3; ipar++) {
661 for (ipar = 0; ipar < 3; ipar++) {
666 z = -warmcov[2] + warmthermo[2];
668 fMC->Gspos(
"PWTI", 1,
"PWAR", 0., 0.0,
z, 0,
"ONLY");
671 for (ipar = 0; ipar < 3; ipar++) {
677 for (ipar = 0; ipar < 3; ipar++) {
684 Double_t
x = -cbox[0] + beams[0] + (2 * beams[0] + geom->
getTSupportDist()) * isup;
685 fMC->Gspos(
"PBE1", isup,
"PCA1",
x, 0.0, 0.0, 0,
"ONLY");
688 z = -warmthermo[2] + cbox[2];
689 fMC->Gspos(
"PCA1", 1,
"PWTI", 0.0, 0.0,
z, 0,
"ONLY");
691 for (ipar = 0; ipar < 3; ipar++) {
697 for (ipar = 0; ipar < 3; ipar++) {
702 Double_t
x = -cbox[0] + beams[0] + (2 * beams[0] + geom->
getTSupportDist()) * isup;
703 fMC->Gspos(
"PBE2", isup,
"PCA2",
x, 0.0, 0.0, 0,
"ONLY");
706 z = -warmthermo[2] + 2 * cbox[2] + cbox2[2];
707 fMC->Gspos(
"PCA2", 1,
"PWTI", 0.0, 0.0,
z, 0,
"ONLY");
710 for (ipar = 0; ipar < 3; ipar++) {
715 fMC->Gspos(
"PFRX", 1,
"PWTI", posit1[0], posit1[1], posit1[2], 0,
"ONLY");
716 fMC->Gspos(
"PFRX", 2,
"PWTI", posit1[0], -posit1[1], posit1[2], 0,
"ONLY");
718 for (ipar = 0; ipar < 3; ipar++) {
723 fMC->Gspos(
"PFRZ", 1,
"PWTI", posit2[0], posit2[1], posit2[2], 0,
"ONLY");
724 fMC->Gspos(
"PFRZ", 2,
"PWTI", -posit2[0], posit2[1], posit2[2], 0,
"ONLY");
727 for (ipar = 0; ipar < 3; ipar++) {
732 fMC->Gspos(
"PFG1", 1,
"PWTI", posit3[0], posit3[1], posit3[2], 0,
"ONLY");
733 fMC->Gspos(
"PFG1", 2,
"PWTI", posit3[0], -posit3[1], posit3[2], 0,
"ONLY");
735 for (ipar = 0; ipar < 3; ipar++) {
740 fMC->Gspos(
"PFG2", 1,
"PWTI", posit4[0], posit4[1], posit4[2], 0,
"ONLY");
741 fMC->Gspos(
"PFG2", 2,
"PWTI", -posit4[0], posit4[1], posit4[2], 0,
"ONLY");
742 for (ipar = 0; ipar < 3; ipar++) {
747 fMC->Gspos(
"PFG3", 1,
"PWTI", posit5[0], posit5[1], posit5[2], 0,
"ONLY");
748 fMC->Gspos(
"PFG3", 2,
"PWTI", posit5[0], -posit5[1], posit5[2], 0,
"ONLY");
750 for (ipar = 0; ipar < 3; ipar++) {
755 fMC->Gspos(
"PFG4", 1,
"PWTI", posit6[0], posit6[1], posit6[2], 0,
"ONLY");
756 fMC->Gspos(
"PFG4", 2,
"PWTI", -posit6[0], posit6[1], posit6[2], 0,
"ONLY");
759 for (ipar = 0; ipar < 3; ipar++) {
764 fMC->Gspos(
"PAFE", 1,
"PWTI", posit7[0], posit7[1], posit7[2], 0,
"ONLY");
767 for (ipar = 0; ipar < 4; ipar++) {
771 if (mCreateHalfMod) {
775 fMC->Gspos(
"PCOL", 1,
"PEMC", 0., 0.,
z, 0,
"ONLY");
776 if (mCreateHalfMod) {
777 fMC->Gspos(
"PCLH", 1,
"PEMH", 0., 0.,
z, 0,
"ONLY");
780 fMC->Gspos(
"PWAR", 1,
"PEMC", 0., 0.,
z, 0,
"ONLY");
781 if (mCreateHalfMod) {
782 fMC->Gspos(
"PWAR", 1,
"PEMH", 0., 0.,
z, 0,
"ONLY");
791 if (mCreateHalfMod) {
795 fMC->Gspos(
"PEMC", 1,
"PATB", 0., 0.,
z, 0,
"ONLY");
796 if (mCreateHalfMod) {
797 fMC->Gspos(
"PEMH", 1,
"PATH", 0., 0.,
z, 0,
"ONLY");
800 fMC->Gspos(
"PATB", 1,
"PHOS", 0., 0., 0., 0,
"ONLY");
801 if (mCreateHalfMod) {
802 fMC->Gspos(
"PATH", 1,
"PHOH", 0., 0., 0., 0,
"ONLY");