Stack->PushTrack() in VMC

Dear colleagues,

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->pX(),pThirdIon->pY(),pThirdIon->pZ(), pThirdIon->E(), curPos.X(), curPos.Y(), curPos.Z(), gMC->TrackTime(), 0., 0., 0., kPDecay, newTrackNb, pThirdIon->GetMass(), 0);

Its 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?

Dear Vitally,

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:

Best regards,

Ivana Hrivnacova

Dear Ivana,

I have tried to add stackPopper special process to configuration:

TG4RunConfiguration* runConfiguration = 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 load_g4.C .x test_E06_2.C("g4Config1.C", kFALSE)
See Ex06MCApplication::GenerateFeedback() and Ex06MCApplication::Stepping() functions where adding tracks to the stack is implemented.