Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GeoModelG4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
GeoModelDev
GeoModelG4
Commits
ed2ee84f
Commit
ed2ee84f
authored
5 years ago
by
Marilena Bandieramonte
Browse files
Options
Downloads
Patches
Plain Diff
Handle the new variants of EMEC with GeoUnidentifiedShape
parent
3d84f27d
No related branches found
No related tags found
1 merge request
!2
Master new EMEC variants
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GeoModel2G4/src/Geo2G4SolidFactory.cxx
+91
-60
91 additions, 60 deletions
GeoModel2G4/src/Geo2G4SolidFactory.cxx
with
91 additions
and
60 deletions
GeoModel2G4/src/Geo2G4SolidFactory.cxx
+
91
−
60
View file @
ed2ee84f
...
...
@@ -518,13 +518,12 @@ G4VSolid *Geo2G4SolidFactory::Build(const GeoShape* geoShape, std::string name)
//
// Custom Shapes (presently LAr shapes only)
//
//LAr custom shape
else
if
(
geoShape
->
typeID
()
==
GeoUnidentifiedShape
::
getClassTypeID
())
{
//const GeoUnidentifiedShape* customShape = dynamic_cast<const GeoUnidentifiedShape*> (geoShape);
//LAr custom shape :: to be removed and tested with new EMEC variants .db file
else
if
(
geoShape
->
typeID
()
==
LArCustomShape
::
getClassTypeID
())
{
const
LArCustomShape
*
customShape
=
dynamic_cast
<
const
LArCustomShape
*>
(
geoShape
);
if
(
nullptr
==
customShape
)
throw
std
::
runtime_error
(
"TypeID did not match cast for custom shape"
);
if
(
customShape
->
name
()
==
"LArCustomShape"
)
{
//
if (customShape->name()=="LArCustomShape") {
//std::string customName = customShape->asciiData();
std
::
string
customName
=
customShape
->
name
();
customSolidMap
::
const_iterator
it
=
customSolids
.
find
(
customName
);
...
...
@@ -532,68 +531,100 @@ G4VSolid *Geo2G4SolidFactory::Build(const GeoShape* geoShape, std::string name)
theSolid
=
it
->
second
;
else
{
std
::
cout
<<
" custom Name to find "
<<
customName
<<
" !!!"
<<
std
::
endl
;
theSolid
=
nullptr
;
// if(customName == "LAr::EMEC::InnerWheel::Absorber" || customName == "LAr::EMEC::Pos::InnerWheel::Absorber"){
// theSolid = new LArWheelSolid(customName, InnerAbsorberWheel, 1);
// } else if(customName == "LAr::EMEC::OuterWheel::Absorber" || customName == "LAr::EMEC::Pos::OuterWheel::Absorber"){
// theSolid = new LArWheelSolid(customName, OuterAbsorberWheel, 1);
// } else if(customName == "LAr::EMEC::InnerWheel::Electrode" || customName == "LAr::EMEC::Pos::InnerWheel::Electrode"){
// theSolid = new LArWheelSolid(customName, InnerElectrodWheel, 1);
// } else if(customName == "LAr::EMEC::OuterWheel::Electrode" || customName == "LAr::EMEC::Pos::OuterWheel::Electrode"){
// theSolid = new LArWheelSolid(customName, OuterElectrodWheel, 1);
// } else if(customName == "LAr::EMEC::Neg::InnerWheel::Absorber"){
// theSolid = new LArWheelSolid(customName, InnerAbsorberWheel, -1);
// } else if(customName == "LAr::EMEC::Neg::OuterWheel::Absorber"){
// theSolid = new LArWheelSolid(customName, OuterAbsorberWheel, -1);
// } else if(customName == "LAr::EMEC::Neg::InnerWheel::Electrode"){
// theSolid = new LArWheelSolid(customName, InnerElectrodWheel, -1);
// } else if(customName == "LAr::EMEC::Neg::OuterWheel::Electrode"){
// theSolid = new LArWheelSolid(customName, OuterElectrodWheel, -1);
// } else if(customName == "LAr::EMEC::InnerModule::Absorber"){
// theSolid = new LArWheelSolid(customName, InnerAbsorberModule, 1);
// } else if(customName == "LAr::EMEC::OuterModule::Absorber"){
// theSolid = new LArWheelSolid(customName, OuterAbsorberModule, 1);
// } else if(customName == "LAr::EMEC::InnerModule::Electrode"){
// theSolid = new LArWheelSolid(customName, InnerElectrodModule, 1);
// } else if(customName == "LAr::EMEC::OuterModule::Electrode"){
// theSolid = new LArWheelSolid(customName, OuterElectrodModule, 1);
// } else if(customName == "LAr::EMEC::InnerWheel::Glue" || customName == "LAr::EMEC::Pos::InnerWheel::Glue"){
// theSolid = new LArWheelSolid(customName, InnerGlueWheel, 1);
// } else if(customName == "LAr::EMEC::InnerWheel::Lead" || customName == "LAr::EMEC::Pos::InnerWheel::Lead"){
// theSolid = new LArWheelSolid(customName, InnerLeadWheel, 1);
// } else if(customName == "LAr::EMEC::OuterWheel::Glue" || customName == "LAr::EMEC::Pos::OuterWheel::Glue"){
// theSolid = new LArWheelSolid(customName, OuterGlueWheel, 1);
// } else if(customName == "LAr::EMEC::OuterWheel::Lead" || customName == "LAr::EMEC::Pos::OuterWheel::Lead"){
// theSolid = new LArWheelSolid(customName, OuterLeadWheel, 1);
// } else if(customName == "LAr::EMEC::Neg::InnerWheel::Glue"){
// theSolid = new LArWheelSolid(customName, InnerGlueWheel, -1);
// } else if(customName == "LAr::EMEC::Neg::InnerWheel::Lead"){
// theSolid = new LArWheelSolid(customName, InnerLeadWheel, -1);
// } else if(customName == "LAr::EMEC::Neg::OuterWheel::Glue"){
// theSolid = new LArWheelSolid(customName, OuterGlueWheel, -1);
// } else if(customName == "LAr::EMEC::Neg::OuterWheel::Lead"){
// theSolid = new LArWheelSolid(customName, OuterLeadWheel, -1);
// }
if
(
customName
.
find
(
"Slice"
)
!=
std
::
string
::
npos
){
theSolid
=
createLArWheelSliceSolid
(
customShape
);
}
else
{
theSolid
=
createLArWheelSolid
(
customName
,
s_lwsTypes
.
at
(
customName
)
);
// map.at throws std::out_of_range exception on unknown shape name
}
if
(
nullptr
==
theSolid
)
{
std
::
string
error
=
std
::
string
(
"Can't create LArWheelSolid for name "
)
+
customName
+
" in Geo2G4SolidFactory::Build"
;
throw
std
::
runtime_error
(
error
);
}
if
(
customName
.
find
(
"Slice"
)
!=
std
::
string
::
npos
){
theSolid
=
createLArWheelSliceSolid
(
customShape
);
}
else
{
std
::
cout
<<
" Name doesn't contain slice"
<<
customName
<<
" !!!"
<<
std
::
endl
;
theSolid
=
createLArWheelSolid
(
customName
,
s_lwsTypes
.
at
(
customName
)
);
// map.at throws std::out_of_range exception on unknown shape name
}
if
(
nullptr
==
theSolid
)
{
std
::
string
error
=
std
::
string
(
"Can't create LArWheelSolid for name "
)
+
customName
+
" in Geo2G4SolidFactory::Build"
;
throw
std
::
runtime_error
(
error
);
}
if
(
theSolid
!=
nullptr
)
customSolids
[
customName
]
=
theSolid
;
}
// }
}
else
if
(
geoShape
->
typeID
()
==
GeoUnidentifiedShape
::
getClassTypeID
())
{
const
GeoUnidentifiedShape
*
customShape
=
dynamic_cast
<
const
GeoUnidentifiedShape
*>
(
geoShape
);
//const LArCustomShape* customShape = dynamic_cast<const LArCustomShape*> (geoShape);
if
(
nullptr
==
customShape
)
throw
std
::
runtime_error
(
"TypeID did not match cast for custom shape"
);
if
(
customShape
->
name
()
==
"LArCustomShape"
)
{
std
::
string
customName
=
customShape
->
asciiData
();
customSolidMap
::
const_iterator
it
=
customSolids
.
find
(
customName
);
if
(
it
!=
customSolids
.
end
())
theSolid
=
it
->
second
;
else
{
theSolid
=
nullptr
;
// if(customName == "LAr::EMEC::InnerWheel::Absorber" || customName == "LAr::EMEC::Pos::InnerWheel::Absorber"){
// theSolid = new LArWheelSolid(customName, InnerAbsorberWheel, 1);
// } else if(customName == "LAr::EMEC::OuterWheel::Absorber" || customName == "LAr::EMEC::Pos::OuterWheel::Absorber"){
// theSolid = new LArWheelSolid(customName, OuterAbsorberWheel, 1);
// } else if(customName == "LAr::EMEC::InnerWheel::Electrode" || customName == "LAr::EMEC::Pos::InnerWheel::Electrode"){
// theSolid = new LArWheelSolid(customName, InnerElectrodWheel, 1);
// } else if(customName == "LAr::EMEC::OuterWheel::Electrode" || customName == "LAr::EMEC::Pos::OuterWheel::Electrode"){
// theSolid = new LArWheelSolid(customName, OuterElectrodWheel, 1);
// } else if(customName == "LAr::EMEC::Neg::InnerWheel::Absorber"){
// theSolid = new LArWheelSolid(customName, InnerAbsorberWheel, -1);
// } else if(customName == "LAr::EMEC::Neg::OuterWheel::Absorber"){
// theSolid = new LArWheelSolid(customName, OuterAbsorberWheel, -1);
// } else if(customName == "LAr::EMEC::Neg::InnerWheel::Electrode"){
// theSolid = new LArWheelSolid(customName, InnerElectrodWheel, -1);
// } else if(customName == "LAr::EMEC::Neg::OuterWheel::Electrode"){
// theSolid = new LArWheelSolid(customName, OuterElectrodWheel, -1);
// } else if(customName == "LAr::EMEC::InnerModule::Absorber"){
// theSolid = new LArWheelSolid(customName, InnerAbsorberModule, 1);
// } else if(customName == "LAr::EMEC::OuterModule::Absorber"){
// theSolid = new LArWheelSolid(customName, OuterAbsorberModule, 1);
// } else if(customName == "LAr::EMEC::InnerModule::Electrode"){
// theSolid = new LArWheelSolid(customName, InnerElectrodModule, 1);
// } else if(customName == "LAr::EMEC::OuterModule::Electrode"){
// theSolid = new LArWheelSolid(customName, OuterElectrodModule, 1);
// } else if(customName == "LAr::EMEC::InnerWheel::Glue" || customName == "LAr::EMEC::Pos::InnerWheel::Glue"){
// theSolid = new LArWheelSolid(customName, InnerGlueWheel, 1);
// } else if(customName == "LAr::EMEC::InnerWheel::Lead" || customName == "LAr::EMEC::Pos::InnerWheel::Lead"){
// theSolid = new LArWheelSolid(customName, InnerLeadWheel, 1);
// } else if(customName == "LAr::EMEC::OuterWheel::Glue" || customName == "LAr::EMEC::Pos::OuterWheel::Glue"){
// theSolid = new LArWheelSolid(customName, OuterGlueWheel, 1);
// } else if(customName == "LAr::EMEC::OuterWheel::Lead" || customName == "LAr::EMEC::Pos::OuterWheel::Lead"){
// theSolid = new LArWheelSolid(customName, OuterLeadWheel, 1);
// } else if(customName == "LAr::EMEC::Neg::InnerWheel::Glue"){
// theSolid = new LArWheelSolid(customName, InnerGlueWheel, -1);
// } else if(customName == "LAr::EMEC::Neg::InnerWheel::Lead"){
// theSolid = new LArWheelSolid(customName, InnerLeadWheel, -1);
// } else if(customName == "LAr::EMEC::Neg::OuterWheel::Glue"){
// theSolid = new LArWheelSolid(customName, OuterGlueWheel, -1);
// } else if(customName == "LAr::EMEC::Neg::OuterWheel::Lead"){
// theSolid = new LArWheelSolid(customName, OuterLeadWheel, -1);
// }
if
(
customName
.
find
(
"Slice"
)
!=
std
::
string
::
npos
){
const
LArCustomShape
*
larShape
=
dynamic_cast
<
const
LArCustomShape
*>
(
customShape
);
theSolid
=
createLArWheelSliceSolid
(
larShape
);
}
else
{
theSolid
=
createLArWheelSolid
(
customName
,
s_lwsTypes
.
at
(
customName
)
);
// map.at throws std::out_of_range exception on unknown shape name
}
if
(
nullptr
==
theSolid
)
{
std
::
string
error
=
std
::
string
(
"Can't create LArWheelSolid for name "
)
+
customName
+
" in Geo2G4SolidFactory::Build"
;
throw
std
::
runtime_error
(
error
);
}
// theSolid = createLArWheelSolid(customName, s_lwsTypes.at(customName) ); // map.at throws std::out_of_range exception on unknown shape name
// if ( nullptr == theSolid ) {
// std::string error = std::string("Can't create LArWheelSolid for name ") + customName + " in Geo2G4SolidFactory::Build";
// throw std::runtime_error(error);
// }
if
(
theSolid
!=
nullptr
)
customSolids
[
customName
]
=
theSolid
;
}
if
(
theSolid
!=
nullptr
)
customSolids
[
customName
]
=
theSolid
;
}
}
}
//
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment