Skip to content
Snippets Groups Projects
Commit bcc70a30 authored by Frank Gaede's avatar Frank Gaede
Browse files

- added utility DD4hep::XML::setDetectorTypeFlag()

   to set the TypeFlag from xml element <type_flag type="0x42"/>
parent d85269fd
No related branches found
No related tags found
No related merge requests found
...@@ -47,6 +47,17 @@ namespace DD4hep { ...@@ -47,6 +47,17 @@ namespace DD4hep {
Geometry::Volume createPlacedEnvelope( DD4hep::Geometry::LCDD& lcdd, DD4hep::XML::Handle_t e , Geometry::Volume createPlacedEnvelope( DD4hep::Geometry::LCDD& lcdd, DD4hep::XML::Handle_t e ,
DD4hep::Geometry::DetElement sdet ) ; DD4hep::Geometry::DetElement sdet ) ;
/** Sets the type flag specified in the \<type_flags\> element for the given DetElement, example: <br>
@verbatim
<type_flags type=" DetType_TRACKER + DetType_PIXEL + DetType_VERTEX "/>
@endverbatim
* @author F.Gaede, DESY
*/
void setDetectorTypeFlag( DD4hep::XML::Handle_t e, DD4hep::Geometry::DetElement sdet ) ;
} /* End namespace XML */ } /* End namespace XML */
} /* End namespace DD4hep */ } /* End namespace DD4hep */
#endif /* DD4hep_XML_XMLUTILITIES_H */ #endif /* DD4hep_XML_XMLUTILITIES_H */
...@@ -122,3 +122,19 @@ Geometry::Volume DD4hep::XML::createPlacedEnvelope( DD4hep::Geometry::LCDD& lcdd ...@@ -122,3 +122,19 @@ Geometry::Volume DD4hep::XML::createPlacedEnvelope( DD4hep::Geometry::LCDD& lcdd
return envelope ; return envelope ;
} }
void DD4hep::XML::setDetectorTypeFlag( DD4hep::XML::Handle_t e, DD4hep::Geometry::DetElement sdet ){
xml_det_t x_det = e;
string det_name = x_det.nameStr();
xml_comp_t x_dettype = x_det.child( DD4hep::XML::Strng_t("type_flags") ) ;
unsigned int typeFlag = x_dettype.type() ;
printout(DEBUG,"Utilities","+++ setDetectorTypeFlags for detector :%s set to 0x%x", det_name.c_str(), typeFlag ) ;
sdet.setTypeFlag( typeFlag ) ;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment