Message: Re: example: Cexmc preinit exception Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: example: Cexmc preinit exception 

Forum: Documentation and Examples
Re: Question example: Cexmc preinit exception (George Peterson)
Date: 12 Nov, 2012
From: Luciano Pandola <Luciano Pandola>

Ciao,

I post the following message on behalf of Alexey Radkov.

---

Hi George.

My name is Alexey. I am responsible for ChargeExchangeMC maintenance in Geant4.

Such an exception without '-p' option is normal because ChargeExchangeMC needs preinit macro which normally contains overall settings. Its default content is:

# specify gdml file and production model here.
# histogram manager verbosity level and option to validate gdml file
# may also be put here.
# do not set gun parameters or anything else.

/cexmc/geometry/gdmlFile lht.gdml /cexmc/geometry/validateGdmlFile /cexmc/histo/verbose 0

/cexmc/physics/productionModel eta

If you run 'ChargeExchangeMC -ppreinit.mac' (no matter if you put space after -p or not) then normally you will see good but very fast run because absence of -g and -i implies a batch mode and no beamOn has been specified. On my computer I see following:

*************************************************************
 Geant4 version Name: geant4-09-06-beta-01    (29-June-2012)
                      Copyright : Geant4 Collaboration
                      Reference : NIM A 506 (2003), 250-303
                            WWW : http://cern.ch/geant4
*************************************************************

<<< Geant4 Physics List simulation engine: QGSP_BERT 3.4

--- Cexmc --- Production model 'ChargeExchange' instantiated

G4GDML: Reading '/home/lyokha/geant4/pnpi/cexmc_geant4src/lht.gdml'...
G4GDML: VALIDATION ERROR! value 'NCrystalsHor' does not match regular
expression facet '[+\-]?[0-9]+' at line: 452 G4GDML: VALIDATION ERROR! value 'NCrystalsVert' does not match regular expression facet '[+\-]?[0-9]+' at line: 464 G4GDML: VALIDATION ERROR! ID attribute 'G4_Galactic' is referenced but was never declared at line: 637 G4GDML: VALIDATION ERROR! ID attribute 'G4_AIR' is referenced but was never declared at line: 637 G4GDML: VALIDATION ERROR! ID attribute 'G4_Al' is referenced but was never declared at line: 637 G4GDML: VALIDATION ERROR! ID attribute 'G4_Cu' is referenced but was never declared at line: 637 G4GDML: VALIDATION ERROR! ID attribute 'G4_lH2' is referenced but was never declared at line: 637 G4GDML: VALIDATION ERROR! ID attribute 'G4_MYLAR' is referenced but was never declared at line: 637 G4GDML: VALIDATION ERROR! ID attribute 'G4_Fe' is referenced but was never declared at line: 637
G4GDML: Reading definitions...
G4GDML: Reading materials...
G4GDML: Reading solids...
G4GDML: Reading structure...
G4GDML: Reading setup...
G4GDML: Reading '/home/lyokha/geant4/pnpi/cexmc_geant4src/lht.gdml' done!
Stripping off GDML names of materials, solids and volumes ... --- Cexmc --- Monitor volume 'vMonitor' registered --- Cexmc --- ED Scorer of detector role 'Monitor' in volume 'vMonitor' --- Cexmc --- TP Scorer of detector role 'Monitor' in volume 'vMonitor' --- Cexmc --- Target volume 'vTarget' registered --- Cexmc --- TP Scorer of detector role 'Target' in volume 'vTarget' --- Cexmc --- ED Scorer of detector role 'Calorimeter' in volume 'vCrystal' --- Cexmc --- TP Scorer of detector role 'Calorimeter' in volume 'vCrystal' --- Cexmc --- Calorimeter volume 'vCalorimeter' registered --- Cexmc --- Sensitive Region for logical volume 'vCalorimeter' registered --- Cexmc --- VetoCounter volume 'vVetoCounter' registered --- Cexmc --- ED Scorer of detector role 'VetoCounter' in volume 'vVetoCounter' --- Cexmc --- TP Scorer of detector role 'VetoCounter' in volume 'vVetoCounter' ### Adding tracking cuts for neutron TimeCut(ns)= 10000 KinEnergyCut(MeV)= 0

Do not be confused with G4GDML: VALIDATION ERROR! These errors are in fact harmless. But if you still get preinit exception then you probably run the program not from its home directory: 1). make sure that preinit.mac is located in the directory from which you run ChargeExchangeMC, or give correct path to -p option (e.g. if you run ChargeExchangeMC from $HOME and program sources are located in $HOME/geant4/ChargeExchangeMC then you would run it as ChargeExchangeMC -pgeant4/ChargeExchangeMC/preinit.mac); 2). preinit.mac refers GDML file lht.gdml: if you run ChargeExchangeMC from another directory, then the line in preinit.mac should also contain correct path, for example

/cexmc/geometry/gdmlFile $HOME/geant4/ChargeExchangeMC/lht.gdml

etc.

But, normally you'd better run this from its home directory (where sources are located) as follows:

ChargeExchangeMC -g -ppreinit.mac -minit.mac

This should work. Please let me know me if this helps or not.

Cheers, Alexey.

 Add Message Add Message
to: "Re: example: Cexmc preinit exception"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]