Could you please give an advice on the following.
I need manually add track in VMC simulation in detector class. I’m trying to do it using:
gMC->GetStack()->PushTrack(1, 0, thirdIonPDG,
pThirdIon->E(), curPos.X(), curPos.Y(), curPos.Z(),
gMC->TrackTime(), 0., 0., 0.,
kPDecay, newTrackNb, pThirdIon->GetMass(), 0);
s works with TGeant3 simulation engine and dont works with TGeant4.
In both cases track is in stack. But in Geant4 case it is not propagated.
Could you please have a look, what can be wrong?
When running with Geant4, you have to activate the “stackPopper” special process;
see more details how to do this here:
Please, note also, there that VMC has its dedicated mailing list:
I have tried to add stackPopper special process to configuration:
= new TG4RunConfiguration("geomRoot", "QBBC", "stepLimiter+specialCuts+specialControls+stackPopper");
But it was not helpful.
I have checked creating of special process in my log file:
[code]### Hadron physics constructed.
Processes mapped to VMC controls ok.
Step limiter physics constructed.
Special Cuts constructed.
Stack popper physics constructed.
User particles physics constructed.
Processes mapped to VMC codes ok.[/code]
Please, have a look in E06 example, which includes a stackPopper test.
To run the example with user defined tracks during event processing:
.x test_E06_2.C("g4Config1.C", kFALSE)
See Ex06MCApplication::GenerateFeedback() and Ex06MCApplication::Stepping() functions where adding tracks to the stack is implemented.