| Summary: | aTrack->GetGlobalTime() for secondaries in hadElastic processes | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Sergey <morozovs> |
| Component: | track | Assignee: | kurasige |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | ||
| Priority: | P5 | ||
| Version: | other | ||
| Hardware: | PC | ||
| OS: | Linux | ||
|
Description
Sergey
2012-08-13 12:52:43 CEST
May be this can help. I have found a change here:
source/processes/hadronic/management/src/G4HadronicProcess.cc
in 9.4.p03:
-------------------------------------------------------------------------------
for(G4int i=0; i<aR->GetNumberOfSecondaries(); ++i)
{
G4LorentzVector theM = aR->GetSecondary(i)->GetParticle()->Get4Momentum();
theM.rotate(rotation, it);
theM*=aR->GetTrafoToLab();
aR->GetSecondary(i)->GetParticle()->Set4Momentum(theM);
G4double time = aR->GetSecondary(i)->GetTime();
if(time<0) time = aT.GetGlobalTime();
G4Track* track = new G4Track(aR->GetSecondary(i)->GetParticle(),
time,
aT.GetPosition());
------------------------------------------------------------------------------
in 9.5.p01:
------------------------------------------------------------------------------
// check secondaries: apply rotation and Lorentz transformation
G4int nSec = aR->GetNumberOfSecondaries();
theTotalResult->SetNumberOfSecondaries(nSec);
if(nSec > 0) {
G4double time0 = aT.GetGlobalTime();
for(G4int i=0; i<nSec; ++i)
{
G4LorentzVector theM = aR->GetSecondary(i)->GetParticle()->Get4Momentum();
theM.rotate(rotation, it);
theM *= aR->GetTrafoToLab();
aR->GetSecondary(i)->GetParticle()->Set4Momentum(theM);
G4double time = aR->GetSecondary(i)->GetTime();
if(time<time0) { time = time0; }
G4Track* track = new G4Track(aR->GetSecondary(i)->GetParticle(),
time,
aT.GetPosition());
------------------------------------------------------------------------------
Well, as I see from 9.6.b01 (beta version) this piece of code has been improved:
-----------------------------------------------------------------------------
// time of interaction starts from zero
G4double time = aR->GetSecondary(i)->GetTime();
if (time < 0.0) { time = 0.0; }
// take into account global time
time += time0;
G4Track* track = new G4Track(aR->GetSecondary(i)->GetParticle(),
time, aT.GetPosition());
-----------------------------------------------------------------------------
So GEANT4 knows about this problem and fixed it for the future releases..
Hi The problem has been reported #1305 http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1305 The fix will be included in following patch and future release. Thanks *** This problem has been marked as a duplicate of problem 1305 *** |