89 G4Track* pTrack = pStep->GetTrack();
93 G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
94 G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
96 G4TouchableHandle pTouchableHandle = pPreStepPoint->GetTouchableHandle();
99 int strawID = pTouchableHandle->GetReplicaNumber(
depth++);
104 sectorID = pTouchableHandle->GetReplicaNumber(
depth++);
106 int planeID = pTouchableHandle->GetReplicaNumber(
depth++);
108 int wheelID = pTouchableHandle->GetReplicaNumber(
depth);
110 G4ThreeVector globalPreStepPoint = pPreStepPoint->GetPosition();
114 if (globalPreStepPoint.z() > 0.)
136 G4ThreeVector globalPostStepPoint = pPostStepPoint->GetPosition();
138 const G4TouchableHistory* pTouchableHistory =
139 static_cast<const G4TouchableHistory*
>(pPreStepPoint->GetTouchable());
141 const G4AffineTransform& topTransform = pTouchableHistory->GetHistory()->
144 G4ThreeVector localPreStepPoint = topTransform.TransformPoint(globalPreStepPoint);
145 G4ThreeVector localPostStepPoint = topTransform.TransformPoint(globalPostStepPoint);
147 double preStepX = localPreStepPoint.x();
148 double preStepY = localPreStepPoint.y();
149 double preStepZ = localPreStepPoint.z();
150 double postStepX = localPostStepPoint.x();
151 double postStepY = localPostStepPoint.y();
152 double postStepZ = localPostStepPoint.z();
157 double preStepR = std::sqrt(preStepX * preStepX + preStepY * preStepY);
158 double postStepR = std::sqrt(postStepX * postStepX + postStepY * postStepY);
160 if (preStepR > 2.0000001 || postStepR > 2.0000001)
166 std::cout <<
"!!!!! End-caps. Error in local coordinates of hits!" << std::endl;
167 std::cout <<
" endCapID=" << endCapID <<
" wheelID=" << wheelID
168 <<
" planeID=" << planeID <<
" strawID=" << strawID
169 <<
" trackID=" << trHelp.GetUniqueID() << std::endl;
170 std::cout <<
" particleEncoding=" << particleEncoding;
172 if (kineticEnergy < 0.0001)
173 std::cout <<
" kineticEnergy=" << kineticEnergy * 1000000. <<
" eV";
174 else if (kineticEnergy < 0.1)
175 std::cout <<
" kineticEnergy=" << kineticEnergy * 1000. <<
" keV";
176 else if (kineticEnergy >= 100.)
177 std::cout <<
" kineticEnergy=" << kineticEnergy / 1000. <<
" GeV";
178 else if (kineticEnergy >= 100000.)
179 std::cout <<
" kineticEnergy=" << kineticEnergy / 1000000. <<
" TeV";
181 std::cout <<
" kineticEnergy=" << kineticEnergy <<
" MeV";
184 std::cout <<
" energyDeposit=" <<
energyDeposit * 1000. <<
" eV"
187 std::cout <<
" energyDeposit=" <<
energyDeposit / 1000. <<
" MeV"
190 std::cout <<
" energyDeposit=" <<
energyDeposit <<
" keV" << std::endl;
192 std::cout <<
" preStepX=" << preStepX <<
" mm preStepY=" << preStepY
193 <<
" mm preStepR=" << preStepR <<
" mm" << std::endl;
194 std::cout <<
" postStepX=" << postStepX <<
" mm postStepY=" << postStepY
195 <<
" mm postStepR=" << postStepR <<
" mm" << std::endl << std::endl;
199 double preStepGlobalTime = pPreStepPoint->GetGlobalTime();
200 double postStepGlobalTime = pPostStepPoint->GetGlobalTime();
201 double globalTime = (preStepGlobalTime + postStepGlobalTime) / 2.;
204 int numberOfStrawsInPlane;
205 int numberOfStrawsInIDSector;
228 strawID = (3*numberOfStrawsInPlane/2 - strawID - 1) % numberOfStrawsInPlane;
232 sectorID = strawID / numberOfStrawsInIDSector;
233 strawID %= numberOfStrawsInIDSector;
242 hitID += (wheelID << 15);
243 hitID += (sectorID << 10);
244 hitID += (planeID << 5);