Skip to content

Commit

Permalink
const properties always with unit
Browse files Browse the repository at this point in the history
  • Loading branch information
martinunland committed Aug 29, 2024
1 parent fe5b1b5 commit e3112d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion common/data/Materials/Surf_Generic_Photocathode_20nm.dat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"jFinish": "polished",
"jType": "coated",
"jConstProperties": {
"COATEDTHICKNESS": 20
"COATEDTHICKNESS": {
"jValue": 20,
"jUnit": "nm",
"jInvertUnit" : ""
}
},
"jProperties": {
"RINDEX": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"jName": "Radioactivity_Vitrovex",
"jMaterialName": "RiAbs_Glass_Vitrovex",
"ConstProperties": {
"jConstProperties": {
"K40_ACTIVITY": {
"jValue": 61,
"jUnit": "kg",
Expand Down
4 changes: 2 additions & 2 deletions common/framework/src/OMSimMaterialHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ void OMSimMaterialHandler::processConstProperties()
for (const auto &property : m_jsonTree.get_child("jConstProperties"))
{
G4String key = property.first;
G4double value = property.second.get_value<G4double>();
m_MPT->AddConstProperty(key.c_str(), value);
G4double value = m_fileData->getValueWithUnit(m_jsonTree.get<G4String>("jName"), "jConstProperties." + key);
m_MPT->AddConstProperty(key.c_str(), value, true);
}
}

Expand Down

0 comments on commit e3112d6

Please sign in to comment.