128 Int_t copyNoCellSmallCut = 0;
129 Int_t copyNoCellSmallCut_10mm = 0;
130 Int_t copyNoCellSmallCut_20mm = 0;
131 Int_t copyNoCellSmallTrap = 0;
132 Int_t copyNoCellSmallTrap_10mm = 0;
133 Int_t copyNoCellSmallTrap_20mm = 0;
134 Int_t copyNoCellLargeCut = 0;
135 Int_t copyNoCellLargeTrap = 0;
136 Int_t copyNoSLICECom = 0, copyNoCELLCom = 0;
138 TLorentzVector tPos1, tMom1;
139 TLorentzVector tPos, tMom;
141 Int_t slice = 0, cell = 0;
149 Double_t BirkConst = 12.6;
153 if (gMC->CurrentVolID(copyNoCellSmallCut) != fCellSmallCutVolId
154 && gMC->CurrentVolID(copyNoCellSmallTrap) != fCellSmallTrapVolId
155 && gMC->CurrentVolID(copyNoCellLargeCut) != fCellLargeCutVolId
156 && gMC->CurrentVolID(copyNoCellLargeTrap) != fCellLargeTrapVolId
157 && gMC->CurrentVolID(copyNoCellSmallCut_10mm) != fCellSmallCutVolId_10mm
158 && gMC->CurrentVolID(copyNoCellSmallCut_20mm) != fCellSmallCutVolId_20mm
159 && gMC->CurrentVolID(copyNoCellSmallTrap_10mm) != fCellSmallTrapVolId_10mm
160 && gMC->CurrentVolID(copyNoCellSmallTrap_20mm) != fCellSmallTrapVolId_20mm)
165 Int_t ivol = vol->getMCid();
167 if (gMC->CurrentVolID(copyNoCellSmallCut) == fCellSmallCutVolId
168 || gMC->CurrentVolID(copyNoCellSmallTrap) == fCellSmallTrapVolId
169 || gMC->CurrentVolID(copyNoCellLargeCut) == fCellLargeCutVolId
170 || gMC->CurrentVolID(copyNoCellLargeTrap) != fCellLargeTrapVolId
171 || gMC->CurrentVolID(copyNoCellSmallCut_10mm) == fCellSmallCutVolId_10mm
172 || gMC->CurrentVolID(copyNoCellSmallCut_20mm) == fCellSmallCutVolId_20mm
173 || gMC->CurrentVolID(copyNoCellSmallTrap_10mm) == fCellSmallTrapVolId_10mm
174 || gMC->CurrentVolID(copyNoCellSmallTrap_20mm) == fCellSmallTrapVolId_20mm)
177 gMC->CurrentVolOffID(0, slice);
178 gMC->CurrentVolOffID(1, cell);
179 copyNoSLICECom = slice;
180 copyNoCELLCom = cell;
186 if (gMC->IsTrackEntering()) {
194 TLorentzVector PosIn;
195 gMC->TrackPosition(PosIn);
196 fPos.SetXYZ(PosIn.X(), PosIn.Y(), PosIn.Z());
198 TLorentzVector MomIn;
199 gMC->TrackMomentum(MomIn);
200 fMom.SetXYZ(MomIn.Px(), MomIn.Py(), MomIn.Pz());
202 fTime = gMC->TrackTime() * 1.0e09;
203 fLength = gMC->TrackLength();
210 if (gMC->IsTrackInside()) {
212 gMC->TrackPosition(tPos);
213 gMC->TrackMomentum(tMom);
214 length += gMC->TrackStep();
218 if (gMC->TrackStep() > 0)
219 QCF = 1. + (BirkConst / gMC->TrackStep()) * gMC->Edep();
222 fELoss += (gMC->Edep()) / QCF;
224 time += gMC->TrackTime() * 1.0e09;
226 if (gMC->IsTrackStop() || gMC->IsTrackDisappeared()) {
232 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
247 if (copyNoSLICECom == slice && copyNoCELLCom == cell) {
248 if (!
GetHit(slice, cell)) {
249 AddHit(fTrackID, ivol, slice, cell, TVector3(tPos.X(), tPos.Y(), tPos.Z()),
250 TVector3(tMom.Px(), tMom.Py(), tMom.Pz()), time, length, fELoss);
253 ->
AddCELL(fTrackID, ivol, slice, cell, TVector3(tPos.X(), tPos.Y(), tPos.Z()),
254 TVector3(tMom.Px(), tMom.Py(), tMom.Pz()), time, length, fELoss);
262 if (gMC->IsTrackExiting()) {
264 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
265 time += gMC->TrackTime() * 1.0e09;
266 length += gMC->TrackLength();
270 if (gMC->TrackStep() > 0)
271 QCF = 1. + (BirkConst / gMC->TrackStep()) * gMC->Edep();
274 fELoss += (gMC->Edep()) / QCF;
276 gMC->TrackPosition(tPos);
277 gMC->TrackMomentum(tMom);
283 if (copyNoSLICECom == slice && copyNoCELLCom == cell) {
284 if (!
GetHit(slice, cell)) {
285 AddHit(fTrackID, ivol, slice, cell, TVector3(tPos.X(), tPos.Y(), tPos.Z()),
286 TVector3(tMom.Px(), tMom.Py(), tMom.Pz()), time, length, fELoss);
289 ->
AddCELL(fTrackID, ivol, slice, cell, TVector3(tPos.X(), tPos.Y(), tPos.Z()),
290 TVector3(tMom.Px(), tMom.Py(), tMom.Pz()), time, length, fELoss);
296 Int_t points = gMC->GetStack()->GetCurrentTrack()->GetMother(1);
297 points = (points & (~(1 << 30))) | (1 << 30);
299 gMC->GetStack()->GetCurrentTrack()->SetMother(1, points);