Re: gMC->Gstpar crash

From: Filimon Roukoutakis <Filimon.Roukoutakis_at_cern.ch>
Date: Thu, 21 Apr 2011 12:47:20 +0200


Hi, thanks, good point, indeed it was in my equivalent of ConstructGeometry, right after the media definition. Moving it in my equivalent of InitGeometry does not crash anymore, I suppose FinishGeometry does something behind the scenes...? I also made sure that it gets called before gMC->BuildPhysics() now -as instructed by the good'ol G3 doc- but still _not_ before gMC->InitMC(), hope this is not an issue. Maybe a check in some functions like Gstpar regarding the state of the initialization could avoid such errors with a meaningful message?
Anyway, it seems that setting the papameters is a required but not sufficient condition to get the correction in VMC. Checking also the documentation of G3 included in the G3_vmc distribution it mentions that GBIRK _may_ be called in GUSTEP and if the parameters are not defined the ret value is DESTEP. So it seems that the correction is not automatic. In this case, one has really to put a fortran function call in the VMC C++ scoring routine called in each step TVirtualCApplication::Stepping. Is this the intented usage or do I miss something? I suppose also there is no TGeant3::GBirk, right? Best regards, filimon

On 04/21/2011 10:33 AM, Ivana Hrivnacova wrote:
>
> Hi Filimon,
>
> I cannot reproduce the crash when I put your three lines in the E03
> example, in Ex03DetectorConstruction::SetCuts(). It runs ok with
> Geant3 and there are issued warnings when running with Geant4, saying
> that this parameter is not implemented.
> Did you put these calls in your MCApplication::InitGeometry()?
>
> Best regards,
>
> Ivana
>
>
> On 04/20/2011 08:50 PM, Filimon Roukoutakis wrote:
>> Hi, I am trying to enable Birk's attenuation under G3 through VMC. The
>> simplest way as far as I know would be to do
>>
>> gMC->Gstpar(3, "BIRK1", 1);
>> gMC->Gstpar(3, "BIRK2", 0.013);
>> gMC->Gstpar(3, "BIRK3", 9.6e-6);
>>
>> I suppose then that GBIRK is going to be called appropriately in the
>> step manager and the value gMC->Edep() is going to be the attenuated one
>> in principle right? (please verify) I would happily check this if the
>> crash below would not exist. The simulation seems to work ok if these
>> statements are not involved. Any ideas? Medium 3 is the expected one as
>> far as I can tell (but I am open to some suggestion to really verify
>> this also if needed). Thanks,
>> filimon
>>
>> ===========================================================
>> #10 0xb5f03098 in g3stpar_ (itmed=0xbff12824, chpar=0xa43917c,
>> parval=0xbff1280c, __g77_length_chpar=5) at gcons/gstpar.F:63
>> #11 0xb60db5a2 in TGeant3::Gstpar (this=0xa36ee88, itmed=3,
>> param=0xa43917c "BIRK2", parval=0.012999999999999999) at
>> TGeant3/TGeant3.cxx:3641
>> ===========================================================
>>
>

Received on Thu Apr 21 2011 - 12:47:26 CEST

This archive was generated by hypermail 2.2.0 : Thu May 12 2011 - 17:25:01 CEST