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());
168 Double_t lostenergy = fMC->Edep();
169 if (lostenergy < DBL_EPSILON && !isNewPartile) {
174 fMC->CurrentVolOffID(
177 fMC->CurrentVolOffID(3, strip);
179 fMC->CurrentVolOffID(2, cell);
181 if (superParent == mCurentSuperParent && detID == mCurrentCellID && mCurrentHit) {
189 for (Int_t itr = mHits->size() - 1; itr >= 0; itr--) {
190 Hit*
h = &(mHits->at(itr));
191 if (
h->GetTrackID() != superParent) {
194 if (
h->GetDetectorID() == detID) {
195 h->addEnergyLoss(lostenergy);
196 mCurentSuperParent = superParent;
197 mCurrentTrackID = partID;
198 mCurrentCellID = detID;
205 Float_t posX = 0., posY = 0., posZ = 0., momX = 0, momY = 0., momZ = 0., energy = 0.;
206 fMC->TrackPosition(posX, posY, posZ);
207 fMC->TrackMomentum(momX, momY, momZ, energy);
208 Double_t estart = fMC->Etot();
209 Double_t
time = fMC->TrackTime();
213 mCurentSuperParent = superParent;
214 mCurrentTrackID = partID;
215 mCurrentCellID = detID;
304 Float_t aX[3] = {207.19, 183.85, 16.0};
305 Float_t zX[3] = {82.0, 74.0, 8.0};
306 Float_t wX[3] = {1.0, 1.0, 4.0};
312 Material(
ID_AL,
"Al", 26.98, 13., 2.7, 8.9, 999.,
nullptr, 0);
316 Float_t aT[2] = {12.011, 1.00794};
324 Float_t aF[2] = {12.011, 1.00794};
332 Material(
ID_APD,
"Si", 28.0855, 14., 2.33, 9.36, 42.3,
nullptr, 0);
335 Float_t aTI[2] = {12.011, 1.00794};
343 Float_t aTX[4] = {16.0, 28.09, 12.011, 1.00794};
344 Float_t zTX[4] = {8.0, 14.0, 6.0, 1.0};
345 Float_t wTX[4] = {292.0, 68.0, 462.0, 736.0};
351 Float_t aG10[4] = {12., 1., 16., 28.};
352 Float_t zG10[4] = {6., 1., 8., 14.};
353 Float_t wG10[4] = {.259, .288, .248, .205};
359 Material(
ID_FE,
"Steel", 55.845, 26, 7.87, 1.76, 0.,
nullptr, 0);
362 Float_t aFG[4] = {16.0, 28.09, 12.011, 1.00794};
363 Float_t zFG[4] = {8.0, 14.0, 6.0, 1.0};
364 Float_t wFG[4] = {292.0, 68.0, 462.0, 736.0};
372 Float_t aCA[4] = {1., 12., 55.8, 63.5};
373 Float_t zCA[4] = {1., 6., 26., 29.};
374 Float_t wCA[4] = {.014, .086, .42, .48};
380 Float_t aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
381 Float_t zAir[4] = {6., 7., 8., 18.};
382 Float_t wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
398 Medium(
ID_PWO,
"Crystal",
ID_PWO, 1, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
400 Medium(
ID_PWO,
"Crystal",
ID_PWO, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
404 Medium(
ID_AL,
"Alparts",
ID_AL, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001,
nullptr, 0);
407 Medium(
ID_TYVEK,
"Tyvek",
ID_TYVEK, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001,
nullptr, 0);
410 Medium(
ID_POLYFOAM,
"Polyst.foam",
ID_POLYFOAM, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
413 Medium(
ID_APD,
"SiAPD",
ID_APD, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.01, 0.01,
nullptr, 0);
416 Medium(
ID_THERMOINS,
"ThermoInsul.",
ID_THERMOINS, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
419 Medium(
ID_TEXTOLIT,
"Textolit",
ID_TEXTOLIT, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
422 Medium(
ID_PRINTCIRC,
"G10",
ID_PRINTCIRC, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.01,
nullptr, 0);
425 Medium(
ID_FE,
"Steel",
ID_FE, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.0001,
nullptr, 0);
428 Medium(
ID_FIBERGLASS,
"Fiberglass",
ID_FIBERGLASS, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
431 Medium(
ID_CABLES,
"Cables",
ID_CABLES, 0, isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
434 Medium(
ID_AIR,
"Air",
ID_AIR, 0, isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0,
nullptr, 0);
452 for (ipar = 0; ipar < 3; ipar++) {
459 for (ipar = 0; ipar < 3; ipar++) {
465 for (ipar = 0; ipar < 3; ipar++) {
472 fMC->Gspos(
"PWRA", 1,
"PCEL", 0.0,
y, 0.0, 0,
"ONLY");
475 for (ipar = 0; ipar < 3; ipar++) {
481 fMC->Gspos(
"PXTL", 1,
"PWRA", 0.0, 0.0, 0.0, 0,
"ONLY");
484 for (ipar = 0; ipar < 3; ipar++) {
490 fMC->Gspos(
"PPIN", 1,
"PCEL", 0.0,
y, 0.0, 0,
"ONLY");
491 for (ipar = 0; ipar < 3; ipar++) {
496 fMC->Gspos(
"PREA", 1,
"PCEL", 0.0,
y, 0.0, 0,
"ONLY");
508 fMC->Gspos(
"PCEL", icel,
"PSTR",
x,
y, +
z, 0,
"ONLY");
509 fMC->Gspos(
"PCEL", icel + 1,
"PSTR",
x,
y, -
z, 0,
"ONLY");
513 for (ipar = 0; ipar < 3; ipar++) {
518 for (ipar = 0; ipar < 3; ipar++) {
523 fMC->Gspos(
"PSHO", 1,
"PSUP", 0.0, 0.0,
z, 0,
"ONLY");
526 fMC->Gspos(
"PSUP", 1,
"PSTR", 0.0,
y, 0.0, 0,
"ONLY");
529 for (ipar = 0; ipar < 3; ipar++) {
534 if (mCreateHalfMod) {
540 y = inthermo[1] - strip[1];
545 for (irow = 0; irow < geom->
getNStripX(); irow++) {
547 for (icol = 0; icol < geom->
getNStripZ(); icol++) {
548 z = (2 * icol + 1 - geom->
getNStripZ()) * strip[2];
549 fMC->Gspos(
"PSTR", nr,
"PTII",
x,
y,
z, 0,
"ONLY");
553 if (mCreateHalfMod) {
555 for (irow = 0; irow < geom->
getNStripX(); irow++) {
557 for (icol = 0; icol < geom->
getNStripZ(); icol++) {
558 z = (2 * icol + 1 - geom->
getNStripZ()) * strip[2];
560 fMC->Gspos(
"PSTR", nr,
"PTIH",
x,
y,
z, 0,
"ONLY");
568 for (ipar = 0; ipar < 3; ipar++) {
572 if (mCreateHalfMod) {
576 y = agap[1] - inthermo[1];
578 fMC->Gspos(
"PTII", 1,
"PAGA", 0.0,
y, 0.0, 0,
"ONLY");
579 if (mCreateHalfMod) {
580 fMC->Gspos(
"PTIH", 1,
"PAGH", 0.0,
y, 0.0, 0,
"ONLY");
584 for (ipar = 0; ipar < 3; ipar++) {
588 if (mCreateHalfMod) {
593 y = cooler[1] - agap[1];
595 fMC->Gspos(
"PAGA", 1,
"PCOR", 0.0,
y, 0.0, 0,
"ONLY");
596 if (mCreateHalfMod) {
597 fMC->Gspos(
"PAGH", 1,
"PCOH", 0.0,
y, 0.0, 0,
"ONLY");
601 for (ipar = 0; ipar < 4; ipar++) {
605 if (mCreateHalfMod) {
611 Matrix(idrotm, 90.0, 0.0, 0.0, 0.0, 90.0, 270.0);
614 z = outparams[3] - cooler[1];
615 fMC->Gspos(
"PCOR", 1,
"PTIO", 0., 0.0,
z, idrotm,
"ONLY");
616 if (mCreateHalfMod) {
617 fMC->Gspos(
"PCOH", 1,
"PIOH", 0., 0.0,
z, idrotm,
"ONLY");
621 for (ipar = 0; ipar < 4; ipar++) {
625 if (mCreateHalfMod) {
630 z = covparams[3] - outparams[3];
631 fMC->Gspos(
"PTIO", 1,
"PCOL", 0., 0.0,
z, 0,
"ONLY");
632 if (mCreateHalfMod) {
633 fMC->Gspos(
"PIOH", 1,
"PCLH", 0., 0.0,
z, 0,
"ONLY");
637 for (ipar = 0; ipar < 3; ipar++) {
642 fMC->Gspos(
"PFGC", 1,
"PCOL", 0., 0.0,
z, 0,
"ONLY");
643 if (mCreateHalfMod) {
644 fMC->Gspos(
"PFGC", 1,
"PCLH", 0., 0.0,
z, 0,
"ONLY");
650 for (ipar = 0; ipar < 3; ipar++) {
657 for (ipar = 0; ipar < 3; ipar++) {
662 z = -warmcov[2] + warmthermo[2];
664 fMC->Gspos(
"PWTI", 1,
"PWAR", 0., 0.0,
z, 0,
"ONLY");
667 for (ipar = 0; ipar < 3; ipar++) {
673 for (ipar = 0; ipar < 3; ipar++) {
681 fMC->Gspos(
"PBE1", isup,
"PCA1",
x, 0.0, 0.0, 0,
"ONLY");
684 z = -warmthermo[2] + cbox[2];
685 fMC->Gspos(
"PCA1", 1,
"PWTI", 0.0, 0.0,
z, 0,
"ONLY");
687 for (ipar = 0; ipar < 3; ipar++) {
693 for (ipar = 0; ipar < 3; ipar++) {
699 fMC->Gspos(
"PBE2", isup,
"PCA2",
x, 0.0, 0.0, 0,
"ONLY");
702 z = -warmthermo[2] + 2 * cbox[2] + cbox2[2];
703 fMC->Gspos(
"PCA2", 1,
"PWTI", 0.0, 0.0,
z, 0,
"ONLY");
706 for (ipar = 0; ipar < 3; ipar++) {
711 fMC->Gspos(
"PFRX", 1,
"PWTI", posit1[0], posit1[1], posit1[2], 0,
"ONLY");
712 fMC->Gspos(
"PFRX", 2,
"PWTI", posit1[0], -posit1[1], posit1[2], 0,
"ONLY");
714 for (ipar = 0; ipar < 3; ipar++) {
719 fMC->Gspos(
"PFRZ", 1,
"PWTI", posit2[0], posit2[1], posit2[2], 0,
"ONLY");
720 fMC->Gspos(
"PFRZ", 2,
"PWTI", -posit2[0], posit2[1], posit2[2], 0,
"ONLY");
723 for (ipar = 0; ipar < 3; ipar++) {
728 fMC->Gspos(
"PFG1", 1,
"PWTI", posit3[0], posit3[1], posit3[2], 0,
"ONLY");
729 fMC->Gspos(
"PFG1", 2,
"PWTI", posit3[0], -posit3[1], posit3[2], 0,
"ONLY");
731 for (ipar = 0; ipar < 3; ipar++) {
736 fMC->Gspos(
"PFG2", 1,
"PWTI", posit4[0], posit4[1], posit4[2], 0,
"ONLY");
737 fMC->Gspos(
"PFG2", 2,
"PWTI", -posit4[0], posit4[1], posit4[2], 0,
"ONLY");
738 for (ipar = 0; ipar < 3; ipar++) {
743 fMC->Gspos(
"PFG3", 1,
"PWTI", posit5[0], posit5[1], posit5[2], 0,
"ONLY");
744 fMC->Gspos(
"PFG3", 2,
"PWTI", posit5[0], -posit5[1], posit5[2], 0,
"ONLY");
746 for (ipar = 0; ipar < 3; ipar++) {
751 fMC->Gspos(
"PFG4", 1,
"PWTI", posit6[0], posit6[1], posit6[2], 0,
"ONLY");
752 fMC->Gspos(
"PFG4", 2,
"PWTI", -posit6[0], posit6[1], posit6[2], 0,
"ONLY");
755 for (ipar = 0; ipar < 3; ipar++) {
760 fMC->Gspos(
"PAFE", 1,
"PWTI", posit7[0], posit7[1], posit7[2], 0,
"ONLY");
763 for (ipar = 0; ipar < 4; ipar++) {
767 if (mCreateHalfMod) {
771 fMC->Gspos(
"PCOL", 1,
"PEMC", 0., 0.,
z, 0,
"ONLY");
772 if (mCreateHalfMod) {
773 fMC->Gspos(
"PCLH", 1,
"PEMH", 0., 0.,
z, 0,
"ONLY");
776 fMC->Gspos(
"PWAR", 1,
"PEMC", 0., 0.,
z, 0,
"ONLY");
777 if (mCreateHalfMod) {
778 fMC->Gspos(
"PWAR", 1,
"PEMH", 0., 0.,
z, 0,
"ONLY");
787 if (mCreateHalfMod) {
791 fMC->Gspos(
"PEMC", 1,
"PATB", 0., 0.,
z, 0,
"ONLY");
792 if (mCreateHalfMod) {
793 fMC->Gspos(
"PEMH", 1,
"PATH", 0., 0.,
z, 0,
"ONLY");
796 fMC->Gspos(
"PATB", 1,
"PHOS", 0., 0., 0., 0,
"ONLY");
797 if (mCreateHalfMod) {
798 fMC->Gspos(
"PATH", 1,
"PHOH", 0., 0., 0., 0,
"ONLY");