Skip to content
Snippets Groups Projects

GeoModelXml improvements: remove the automatic insertion of NameTags and Identifiers, expand Examples.

Closed Riccardo Maria Bianchi requested to merge gmx-shared into master
1 unresolved thread

This MR removes the automatic insertion of NameTag and Identifier GeoModel nodes when processing <logvol> XML entities in GeoModelXml.

Now, NameTags and Identifiers are inserted only when requested; i.e., when the relevant, optional flags are specified in the corresponding XML entity.

It also fixes a crash on hardcoded position of PV, by commenting call to the not-used addAlignable function (at the moment, it only prints log msgs).

Edited by Riccardo Maria Bianchi

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
169 237 gmxUtil.positionIndex.setCopyNo(m_map[name].id++);
170 238 gmxUtil.positionIndex.indices(index, gmxUtil.eval);
171 239 sensId = gmxUtil.gmxInterface()->sensorId(index);
172 // toAdd.push_back(new GeoIdentifierTag(m_map[name].id)); // Normal copy number
173 toAdd.push_back(new GeoIdentifierTag(sensId));
240 if(hasIdentifier) { //TODO: check if all "sensitive" volumes must have an identifier. If that's the case, then we can remove this "if" here
  • To answer the question in the comment here, I think the answer is "yes". We use these to distinguish which sensor a hit is in/measurement is on, so any volume that can record hits should in principle need to be distinguished by a unique Identifier.

  • Thanks, @nstyles ! So, I think we can remove the "if" there and make all sensitive volumes have an identifier

  • Please register or sign in to reply
  • Nicholas Styles
    Nicholas Styles @nstyles started a thread on commit 75455bcc
  • 58 64 //
    59 65 if (alignable) {
    60 66 int level;
    61 alignable_tmp = XMLString::transcode("alignable");
    67 alignable_tmp = XMLString::transcode("alignable");
    62 68 istringstream(XMLString::transcode(element->getAttribute(alignable_tmp))) >> level;
    63 69 map<string, int> index;
    64 70 gmxUtil.positionIndex.incrementLevel(); // Logvol has unfortunately already decremented this; temp. restore it
    65 71 gmxUtil.positionIndex.indices(index, gmxUtil.eval);
    66 // ****** Using "[2]" is an ugly way to reach the PV. Define const int in LogvolProcessor?
    67 gmxUtil.gmxInterface()->addAlignable(level, index, (GeoVFullPhysVol *) objectsToAdd[2],
    68 (GeoAlignableTransform *) toAdd.back());
    72
    73 // the call to addAlignable below only prints log messages, it is not very useful at the moment.
  • Nicholas Styles mentioned in issue #53

    mentioned in issue #53

  • Please register or sign in to reply
    Loading