LDMX Software
DetUtils.h
1#pragma once
2
3#include <memory>
4#include <string>
5
6// DD4hep
7#include "DD4hep/DetFactoryHelper.h"
8#include "DD4hep/Detector.h"
9#include "DD4hep/Objects.h"
10#include "DD4hep/Segmentations.h"
11#include "DDSegmentation/BitField64.h"
12#include "DDSegmentation/CartesianGridXY.h"
13#include "DDSegmentation/CartesianGridXYZ.h"
14#include "DDSegmentation/PolarGridRPhi.h"
15#include "XML/XMLDetector.h"
16#include "XML/XMLElements.h"
17
18namespace Acts {
19class DigitizationModule;
20} // namespace Acts
21
28namespace det::utils {
29
35dd4hep::xml::Component getNodeByStrAttr(const dd4hep::xml::Handle_t& mother,
36 const std::string& nodeName,
37 const std::string& attrName,
38 const std::string& attrValue);
39
42double getAttrValueWithFallback(const dd4hep::xml::Component& node,
43 const std::string& attrName,
44 const double& defaultValue);
45} // namespace det::utils
Given a xml element with several daughters with the same name, e.g.
Definition DetUtils.h:28
double getAttrValueWithFallback(const dd4hep::xml::Component &node, const std::string &attrName, const double &defaultValue)
try to get attribute with double value, return defaultValue if attribute not found
dd4hep::xml::Component getNodeByStrAttr(const dd4hep::xml::Handle_t &mother, const std::string &nodeName, const std::string &attrName, const std::string &attrValue)
Retrieves the node component from a mother by the string names.