Thank you Marc for sharing your expertise on G4FastSimulation.
Your comments are very informative.
Just for my curiosity and to be right from the next time,
can you elaborate how the "standard request" should be?
- i.e., can you explain why my request was "not standard"?
Regrading to your comment on the approach, I'd like to add little
more details and a practical example with the skeleton code in the
previous mail.
I am shooting 20 GeV a pion to envelopes (PbWO4 in front followed
by Brass, a.k.a., CMS ECAL+HCAL) of which interaction lengths are
around 22cm and 16cm, respectively and want to parameterize its
hadronic shower energy distribution with a fast simulation model.
It is important to trigger the model at the first (primary) hadronic
shower starting point so that the longitudinal profile of shower is
correctly distribute over two envelopes - we still want to follow
the full geant4 with a list hadronic physics for the dE/dx type of
energy loss before it reach to the fist hadronic shower starting point.
As a first naive trial, I implemented a condition for "ModelTrigger"
only with the process defined the step as similar to what you suggest;
if( procName == "PionPlusInelastic" ||
procName == "PionMinusInelastic" ) trigger = true;
which selected the shower starting point much shorter
than what I expected. Then I printed out the process name
in each step inside envelopes and found that energy losses for most of
first PionPlusInelastic are very small (see the example below),
- inside "ModelTrigger"
procName Nsec StepLength Energy
(cm) (GeV)
-----------------------------------------
hElastic 0 0.15939 19.8697
hElastic 0 0.02025 19.8697
........................................
hElastic 0 4.50236 19.8172
PionPlusInelastic 0 11.6331 19.6992 <- 1st inelastic
Decay 0 3.98176 19.641
PionPlusInelastic 0 0.03306 19.641
PionPlusInelastic 0 0.02481 19.6409
Decay 0 0.05787 19.6408
PionPlusInelastic 0 0.24786 19.6408
Decay 0 0.005793 19.6407
PionPlusInelastic 0 0.34509 19.6407
Decay 0 0.35864 19.6362
PionPlusInelastic 0 0.37265 19.6362
PionPlusInelastic 0 0.17602 19.6359
Decay 0 0.07549 19.6357
PionPlusInelastic 0 0.02397 19.6357
Decay 0 1.24381 19.6234
Decay 0 0.50385 19.6234
PionPlusInelastic 0 1.64877 19.6234 <- proposed trigger
PionPlusInelastic 14 2.46423 3.13696 <- actual trigger
- inside "DoIt"
DoIt for Energy = 3.13696 results Parameterized Energy = 5.36714
- end of the example
Hinted by Michel (see the following link
http://geant4-hn.slac.stanford.edu:5090/HyperNews/public/get/hadronprocess/676/2/1/1.html
under the "Hadronic Processes" forum), I convinced myself that
additional condition ((*secondary).size() > 0) might be required
to get the first major (or real) hadronic shower starting point
correctly. However, the energy (3.13696 GeV in the example) at
the step with secondaries is the one after a major energy lost
has happened in the step (G4Step are already updated).
I think that the right place to fulfill the "ModelTrigger" is
the step, at the "proposed trigger" in above example which is the
one step "ahead" the step "actual trigger" - i.e., I want to
parameterize "19.6234 GeV" (before interaction), but not "3.13696 GeV"
(after interaction) which is the kinetic energy that I get in the
DoIt step. This was my problem that I asked in the previous mail.
Further more, I have another curiosity for the major energy
loss point in the tracking process with the same example code -
probably this question should go to the "Hadronic Process" forum.
Anyway, I categorize the step that loses a big energy loss;
case 1) PionPlusInelastic and secondaries > 0 (example above)
case 2) PionPlusInelastic and GetStepLength() == 0
procName Nsec StepLength Energy
-------------------------------------------
PionPlusInelastic 0 0.11139726 19.491284
PionPlusInelastic 0 0 5.5933457
case 3) hElastic and secondaries > 0
PionPlusInelastic 0 1 0.03415558 19.810742
hElastic 30 1 12.014869 3.5630114
case 4) hElastic and GetStepLength() == 0
PionPlusInelastic 0 1 0.05562974 19.626172
hElastic 2.3803647 0 1 0 2.3803647
I wonder why hElastic (by G4HadronElasticPhysics) process
produces secondaries or loses a big energy. Anyway, with requiring
these type of cases, the envisaged first shower point (x) makes much
a sense roughly following by e^{-x/interaction_length}.
With the example shown above, I believe that I mostly answered to
your question concerning to the condition (*secondary).size() > 0)
in the ModelTrigger step. Just to confirm one more time, the
conditional statement,
if( procName == "PionPlusInelastic" && (*secondary).size() > 0 ) {
trigger =true;
}
is fulfilled in "ModelTrigger" as shown the example.
To your last point, I didn't mean that the primary track information
is changed from the stage at "ModelTrigger" to at "DoIt". What I
meant was that the kinetic energy in DoIt step is whatever left over
"after" the hadronic process that fulfills conditions in ModelTrigger.
Sorry for verbose descriptions, but thanks for any additional comment.
Regards,
---Soon
|