Skip to content
Snippets Groups Projects
Commit 75455bcc authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny:
Browse files

Fix crash on hardcoded position of PV by commenting call to useless...

Fix crash on hardcoded position of PV by commenting call to useless addAlignable (only prints log msgs)
parent a8943010
No related branches found
No related tags found
1 merge request!128GeoModelXml improvements: remove the automatic insertion of NameTags and Identifiers, expand Examples.
/* /*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/ */
// //
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
// Add transform from first child to list // Add transform from first child to list
// Create physvol using my second child; add it to list. // Create physvol using my second child; add it to list.
// //
// Updates:
// - 2022 Apr, Riccardo Maria BIANCHI <riccardo.maria.bianchi@cern.ch>
// Commented call to addAlignable
//
#include "GeoModelXml/TransformProcessor.h" #include "GeoModelXml/TransformProcessor.h"
#include <string> #include <string>
...@@ -50,7 +54,9 @@ char *tagName; ...@@ -50,7 +54,9 @@ char *tagName;
// //
DOMElement *transformation = element->getFirstElementChild(); DOMElement *transformation = element->getFirstElementChild();
tagName = XMLString::transcode(transformation->getTagName()); // transformation or transformationref tagName = XMLString::transcode(transformation->getTagName()); // transformation or transformationref
// ******* Should check here that an alignable transform is given an alignable transformation and object; to be done
// TODO: ******* Should check here that an alignable transform is given an alignable transformation and object; to be done
toAdd.push_back((GeoGraphNode *)(gmxUtil.geoItemRegistry.find(string(tagName))->process(transformation, gmxUtil))); toAdd.push_back((GeoGraphNode *)(gmxUtil.geoItemRegistry.find(string(tagName))->process(transformation, gmxUtil)));
XMLString::release(&tagName); XMLString::release(&tagName);
// //
...@@ -63,9 +69,15 @@ char *tagName; ...@@ -63,9 +69,15 @@ char *tagName;
map<string, int> index; map<string, int> index;
gmxUtil.positionIndex.incrementLevel(); // Logvol has unfortunately already decremented this; temp. restore it gmxUtil.positionIndex.incrementLevel(); // Logvol has unfortunately already decremented this; temp. restore it
gmxUtil.positionIndex.indices(index, gmxUtil.eval); gmxUtil.positionIndex.indices(index, gmxUtil.eval);
// the call to addAlignable below only prints log messages, it is not very useful at the moment.
// Since it accesses PV through an hard-coded [2] index, it crashes if the PV is not exactly at [2]
// for instance when a NameTag is omitted (which I am pushing, to save memory).
// NOTE: So, I comment it out for the moment... RMB
//
// ****** Using "[2]" is an ugly way to reach the PV. Define const int in LogvolProcessor? // ****** Using "[2]" is an ugly way to reach the PV. Define const int in LogvolProcessor?
gmxUtil.gmxInterface()->addAlignable(level, index, (GeoVFullPhysVol *) objectsToAdd[2], //gmxUtil.gmxInterface()->addAlignable(level, index, (GeoVFullPhysVol *) objectsToAdd[2],
(GeoAlignableTransform *) toAdd.back()); // (GeoAlignableTransform *) toAdd.back());
gmxUtil.positionIndex.decrementLevel(); gmxUtil.positionIndex.decrementLevel();
XMLString::release(&alignable_tmp); XMLString::release(&alignable_tmp);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment