Message: adding new units to example B1 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question adding new units to example B1 

Forum: Documentation and Examples
Date: 18 Jul, 2017
From: Tim Meehan <Tim Meehan>

Im running Geant4-10.3.1 on a Mac, and I wanted to see if I could add a unit to example B1. It seems like the examples that I could find added the units in the constructor of a subclass of G4UserRunAction ... but it doesn't seem like there is a preferred location mentioned anywhere.

I wanted to define a new material using the G4NistManager::ConstructNewGasMaterial method, and the gauge that the experiment is using reads out in "Torr", so I wanted to add "Torr" as a unit.

I made sure to include all of the proper headers (or at least the compiler stopped complaining about missing things). I didn't bother adding the material yet, I just wanted to see if my application would print out something in my new unit - so in the constructor for B1DetectorConstruction I put:

new G4UnitDefinition("torr", "Torr", "Pressure", atmosphere/760.);

In B1DetectorConstruction::Construct(), I put a line:

G4cout << "1 pascal in Torr: " << pascal / torr << G4endl;

However, the compiler doesn't recognize torr as a unit, I thinks that I have misspelled "for" :(

Any ideas?

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: adding new units to example B1   (michel maire - 19 Jul, 2017)
1 Ok: Re: adding new units to example B1   (Tim Meehan - 19 Jul, 2017)
2 Feedback: Re: adding new units to example B1   (Michael H. Kelsey - 20 Jul, 2017)
 Add Message Add Message
to: "adding new units to example B1"

 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 ]