20 #include "ui_trackinggeometrycontrollerform.h"
24 #include <Inventor/nodes/SoRotationXYZ.h>
25 #include <Inventor/nodes/SoSeparator.h>
26 #include <Inventor/nodes/SoMaterial.h>
27 #include <Inventor/nodes/SoSwitch.h>
28 #include <Inventor/nodes/SoClipPlane.h>
34 #include "GaudiKernel/ISvcLocator.h"
42 #include <QInputDialog>
262 "This system displays the tracking geometry.",
263 "Andreas.Salzburger@cern.ch"),
465 for ( ; sepHelperIter != sepHelperIterEnd; ++sepHelperIter){
466 if ((*sepHelperIter)) {
467 SoSeparator *
sep = (*sepHelperIter)->topSeparator();
468 delete (*sepHelperIter);
490 message(
"TrackingGeometry has already been successfully retrieved");
502 message(
"Error: Geometry not configured!");
507 message(
"Error: retrieveTrackingGeometry() invoked before controller built!");
519 message(
"Error: Got NULL pointer to the service locator!");
526 message(
"Trying to retrieve TrackingGeometrySvc '" +
529 auto trackingGeometrySvc =
532 if( !trackingGeometrySvc )
534 message(
"Error: Could not retrieve TrackingGeometrySvc '" +
536 "Check spelling and if you have added the correct jobOptions fragment");
540 message(
"Successfully retrieved TrackingGeometrySvc '" +
549 message(
"Trying to retrieve default TrackingGeometry");
550 trackingGeometry = trackingGeometrySvc->trackingGeometry();
552 if( !trackingGeometry)
554 message(
"Error: Could not retrieve default TrackingGeometry");
559 message(
"Successfully retrieved default TrackingGeometry");
564 message(
"Trying to retrieve TrackingGeometry '" +
566 "' from DetectorStore");
569 message(
"Error: Got NULL detectorstore.");
575 message(
"Error: Could not retrieve TrackingGeometry '" +
577 "' from DetectorStore.");
582 message(
"Successfully retrieved TrackingGeometry '" +
641 SoSeparator* sep_beamPipe =
new SoSeparator(); sep_beamPipe->ref();
642 SoSeparator* sep_pixSurfBarrel =
new SoSeparator(); sep_pixSurfBarrel->ref();
643 SoSeparator* sep_pixSurfECA =
new SoSeparator(); sep_pixSurfECA->ref();
644 SoSeparator* sep_pixSurfECC =
new SoSeparator(); sep_pixSurfECC->ref();
645 SoSeparator* sep_pixLayBarrel =
new SoSeparator(); sep_pixLayBarrel->ref();
646 SoSeparator* sep_pixLayECA =
new SoSeparator(); sep_pixLayECA->ref();
647 SoSeparator* sep_pixLayECC =
new SoSeparator(); sep_pixLayECC->ref();
648 SoSeparator* sep_sctSurfBarrel =
new SoSeparator(); sep_sctSurfBarrel->ref();
649 SoSeparator* sep_sctSurfECA =
new SoSeparator(); sep_sctSurfECA->ref();
650 SoSeparator* sep_sctSurfECC =
new SoSeparator(); sep_sctSurfECC->ref();
651 SoSeparator* sep_sctLayBarrel =
new SoSeparator(); sep_sctLayBarrel->ref();
652 SoSeparator* sep_sctLayECA =
new SoSeparator(); sep_sctLayECA->ref();
653 SoSeparator* sep_sctLayECC =
new SoSeparator(); sep_sctLayECC->ref();
654 SoSeparator* sep_trtSurfBarrel =
new SoSeparator(); sep_trtSurfBarrel->ref();
655 SoSeparator* sep_trtSurfECA =
new SoSeparator(); sep_trtSurfECA->ref();
656 SoSeparator* sep_trtSurfECC =
new SoSeparator(); sep_trtSurfECC->ref();
657 SoSeparator* sep_trtLayBarrel =
new SoSeparator(); sep_trtLayBarrel->ref();
658 SoSeparator* sep_trtLayECA =
new SoSeparator(); sep_trtLayECA->ref();
659 SoSeparator* sep_trtLayECC =
new SoSeparator(); sep_trtLayECC->ref();
660 SoSeparator* sep_passiveLayBarrel =
new SoSeparator(); sep_passiveLayBarrel->ref();
661 SoSeparator* sep_passiveLayECA =
new SoSeparator(); sep_passiveLayECA->ref();
662 SoSeparator* sep_passiveLayECC =
new SoSeparator(); sep_passiveLayECC->ref();
751 SoSeparator * sep_vol =
new SoSeparator; sep_vol->ref();
752 SoSeparator * sep_msB =
new SoSeparator; sep_msB->ref();
753 SoSeparator * sep_msI =
new SoSeparator; sep_msI->ref();
754 SoSeparator * sep_msO =
new SoSeparator; sep_msO->ref();
755 SoSeparator * sep_msBI =
new SoSeparator; sep_msBI->ref();
756 SoSeparator * sep_msBM =
new SoSeparator; sep_msBM->ref();
757 SoSeparator * sep_msBO =
new SoSeparator; sep_msBO->ref();
758 SoSeparator * sep_msEI =
new SoSeparator; sep_msEI->ref();
759 SoSeparator * sep_msEM =
new SoSeparator; sep_msEM->ref();
760 SoSeparator * sep_msEO =
new SoSeparator; sep_msEO->ref();
761 SoSeparator * sep_msCS =
new SoSeparator; sep_msCS->ref();
762 SoSeparator * sep_msTG =
new SoSeparator; sep_msTG->ref();
763 SoSeparator * sep_msBIlay =
new SoSeparator; sep_msBIlay->ref();
764 SoSeparator * sep_msBMlay =
new SoSeparator; sep_msBMlay->ref();
765 SoSeparator * sep_msBOlay =
new SoSeparator; sep_msBOlay->ref();
766 SoSeparator * sep_msEIlay =
new SoSeparator; sep_msEIlay->ref();
767 SoSeparator * sep_msEMlay =
new SoSeparator; sep_msEMlay->ref();
768 SoSeparator * sep_msEOlay =
new SoSeparator; sep_msEOlay->ref();
769 SoSeparator * sep_msCSlay =
new SoSeparator; sep_msCSlay->ref();
770 SoSeparator * sep_msTGlay =
new SoSeparator; sep_msTGlay->ref();
771 SoSeparator * sep_msBTenv =
new SoSeparator; sep_msBTenv->ref();
772 SoSeparator * sep_msETenv =
new SoSeparator; sep_msETenv->ref();
773 SoSeparator * sep_msShenv =
new SoSeparator; sep_msShenv->ref();
774 SoSeparator * sep_msFeenv =
new SoSeparator; sep_msFeenv->ref();
775 SoSeparator * sep_msRaenv =
new SoSeparator; sep_msRaenv->ref();
776 SoSeparator * sep_msBTdl =
new SoSeparator; sep_msBTdl->ref();
777 SoSeparator * sep_msETdl =
new SoSeparator; sep_msETdl->ref();
778 SoSeparator * sep_msShdl =
new SoSeparator; sep_msShdl->ref();
779 SoSeparator * sep_msFedl =
new SoSeparator; sep_msFedl->ref();
780 SoSeparator * sep_msRadl =
new SoSeparator; sep_msRadl->ref();
867 std::cout <<
"To here !" << std::endl;
871 if (!highestVolume) {
872 message(
"Error: No highest tracking volume registered.");
886 SoRotationXYZ* rotClip =
new SoRotationXYZ;
888 rotClip->angle.setValue( -
M_PI/2.);
1013 message(
"Error: Volume shape not implemented");
1017 QString volumeName(tvol->
volumeName().c_str());
1025 if (confinedLayers){
1029 for ( ; layerIter != layerVector.end(); ++layerIter){
1037 if (!layIndex.
value())
continue;
1046 if ( volumeName.contains(
"BeamPipe") > 0 ) {
1048 }
else if (volumeName.contains(
"Pixel") > 0 ) {
1050 if ( volumeName.contains(
"Barrel") > 0 ){
1054 }
else if ( volumeName.contains(
"Endcap") > 0 ){
1056 if ( volumeName.contains(
"Pos") > 0){
1064 }
else if ((volumeName.contains(
"SCT") > 0) or (volumeName.contains(
"Strip") > 0)) {
1066 if ( volumeName.contains(
"Barrel") > 0 ){
1070 }
else if ( volumeName.contains(
"Endcap") > 0 ){
1072 if ( volumeName.contains(
"Pos") > 0){
1080 }
else if (volumeName.contains(
"TRT") > 0) {
1082 if ( volumeName.contains(
"Barrel") > 0 ){
1086 }
else if ( volumeName.contains(
"Endcap") > 0 ){
1088 if ( volumeName.contains(
"Pos") > 0 ){
1097 if ( volumeName.contains(
"Barrel") > 0 ){
1100 }
else if ( volumeName.contains(
"Endcap") > 0 ){
1102 if ( volumeName.contains(
"Pos") > 0 ){
1110 std::cout <<
" VolumeName " << tvol->
volumeName() <<
" / seperators : " << layerSepHelper <<
" / " << surfaceSepHelper << std::endl;
1115 if (layerSubSurfaces && surfaceSepHelper){
1118 for ( ; surfaceIter != surfaceVector.end(); ++surfaceIter ){
1130 if (confinedVolumes){
1134 for ( ; volIter != volIterEnd; ++volIter)
1152 message(
"Error: Volume shape not implemented");
1156 if (
name.substr(0,4) ==
"Muon" && tvol->
colorCode() > 0 ) {
1164 unsigned int colorCode = 17;
1165 if (
name.substr(0,3)==
"MDT") colorCode = 2;
1166 if (
name.substr(0,3)==
"RPC") colorCode = 4;
1167 if (
name.substr(0,2)==
"CS") colorCode = 5;
1168 if (
name.substr(0,1)==
"T") colorCode = 6;
1171 }
else if ( layHelper ) {
1172 unsigned int colorCode = 13;
1179 if (confinedVolumes){
1183 for ( ; volIter != volIterEnd; ++volIter)
1189 if (!detVols.empty()) {
1192 for ( ;dIter!=detVols.end(); ++dIter) {
1193 if ( (tvol->
inside((*dIter)->trackingVolume()->center(),0.) || (*dIter)->trackingVolume()->center().perp()<0.001) ) {
1194 std::string
name = (*dIter)->name();
1211 else if (
name.substr(0,2) ==
"BT" ||
name.substr(0,6) ==
"EdgeBT" ||
name.substr(0,6) ==
"HeadBT" )
1213 else if (
name.substr(0,3) ==
"BAR" )
1216 else if (
name.substr(0,9) ==
"ForwardSh" ||
name.substr(0,8) ==
"ToroidSh" ||
name.substr(0,6) ==
"DiskSh" )
1218 else if (
name.substr(0,5) ==
"StdFe" ||
name.substr(0,6) ==
"ExtrFe" ||
name.substr(0,6) ==
"ConnFe" )
1220 else if (
name.substr(0,4) ==
"Feet" )
1225 std::string
name = (*dIter)->name();
1227 if (
name.substr(0,3) ==
"BAR" &&
1228 name.substr(0,18) ==
"BAR_ToroidBAR_Cold" )
1231 if (sepHelper)
processMsVolume( (*dIter)->trackingVolume(), sepHelper, layHelper);
1232 sepHelper =
nullptr; layHelper =
nullptr;
1240 unsigned int colorCode)
1242 if (!tlayer)
return;
1246 std::cout <<
"Adding Layer to Separator helper: " << sepLayerHelper << std::endl;
1253 unsigned int colorCode)
1267 if (confinedLayers){
1271 for ( ; layerIter != layerVector.end(); ++layerIter){
1275 if (
node && layHelper ) {
1276 if ((*layerIter)->layerType()>0)
1286 if (!confALays.empty()) {
1288 for (
const Trk::Layer*
const layerIter : confALays) {
1292 layerIter->surfaceRepresentation());
1293 if (
node && layHelper) {
1294 if (layerIter->layerType() > 0)
1306 if (!confVols.empty()){
1307 auto volIter = confVols.begin();
1308 for ( ; volIter != confVols.end(); ++volIter){
1309 if (*volIter && sepHelper )
processMsVolume( *volIter,
nullptr, layHelper );
1325 return new QLabel(
"Geometry not configured.");
1328 QWidget * controller =
new QWidget(
nullptr);
1329 Ui::TrackingGeometryControllerForm ui;
1330 ui.setupUi(controller);
1337 ui.groupBox_idandcalogeometry->setVisible(
false);
1340 ui.groupBox_muonframe->setVisible(
false);
1341 ui.groupBox_muonactivematerial->setVisible(
false);
1342 ui.groupBox_muoninertmaterial->setVisible(
false);
1399 connect( ui.lineEdit_TrackingGeometrySvcName, SIGNAL( returnPressed()),
1400 ui.pushButton_Retrieve, SIGNAL( clicked()));
1401 connect( ui.lineEdit_TrackingGeometryName, SIGNAL( returnPressed()),
1402 ui.pushButton_Retrieve, SIGNAL( clicked()));
1479 for ( ; chbMapIter != chbMapIterEnd; ++chbMapIter ){
1480 QCheckBox* checkBox =
dynamic_cast<QCheckBox*
>((chbMapIter)->
first);
1481 if (checkBox) checkBox->setChecked( ((chbMapIter)->second).
second );
1556 if ( chbMapIter != chbMapIterEnd ) {
1557 QCheckBox* checkBox =
dynamic_cast<QCheckBox*
>((chbMapIter)->
first);
1558 SoSwitch* soswitch = ((chbMapIter)->
second).first;
1559 if (checkBox && soswitch)
1560 soswitch->whichChild = checkBox->isChecked() ? SO_SWITCH_ALL : SO_SWITCH_NONE;
1562 message(
"ERROR: Unknown checkbox");
1570 messageDebug(
"WARNING: VP1TrackingGeometrySystem persistification disabled for now due to crashes!");
1606 messageDebug(
"WARNING: VP1TrackingGeometrySystem persistification disabled for now due to crashes!");