5 #include "DD4hep/DetFactoryHelper.h" 16 int numberPhi =
args.value<
int>(
"NumberPhi");
18 std::vector<double> areaSection =
args.value<std::vector<double> >(
"AreaSection");
19 std::vector<double> rStart =
args.value<std::vector<double> >(
"RadiusStart");
20 std::vector<double> rEnd =
args.value<std::vector<double> >(
"RadiusEnd");
21 std::vector<int> bundle =
args.value<std::vector<int> >(
"Bundles");
22 double tilt =
args.value<
double>(
"TiltAngle");
25 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalFibreBundle: Parent " <<
args.parentName() <<
" with " << bundle.size()
26 <<
" children with prefix " << childPrefix <<
", material " << material <<
" with " 27 << numberPhi <<
" bundles along phi; width of" 29 <<
" along phi and with " << rStart.size() <<
" different bundle types";
30 for (
unsigned int i = 0;
i < areaSection.size(); ++
i)
36 for (
unsigned int i = 0;
i < bundle.size(); ++
i) {
38 <<
" with Type " << bundle[
i];
47 std::vector<dd4hep::Rotation3D>
rotation;
48 dd4hep::Rotation3D
rot;
49 for (
int i = 0;
i < numberPhi; ++
i) {
50 double phi = -0.5 *
deltaPhi + (
i + 0.5) * dPhi;
51 rot = dd4hep::RotationZ(phi);
54 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalFibreBundle: Creating a new rotation " << 90 <<
"," << phideg <<
"," << 90
55 <<
"," << (phideg + 90) <<
", 0, 0";
61 std::vector<dd4hep::Volume> logs;
62 for (
unsigned int i = 0;
i < areaSection.size(); ++
i) {
64 double dStart = areaSection[
i] / (2 * dPhi * rStart[
i]);
65 double dEnd = areaSection[
i] / (2 * dPhi * r0);
67 dd4hep::Solid solid = dd4hep::ConeSegment(
68 name, 0.5 *
deltaZ, rStart[
i] - dStart, rStart[
i] + dStart, r0 - dEnd, r0 + dEnd, -0.5 * dPhi, 0.5 * dPhi);
70 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalFibreBundle: Creating a new solid " <<
name <<
" a cons with dZ " 77 logs.emplace_back(
log);
82 int nY =
static_cast<int>(bundle.size()) / numberPhi;
83 for (
unsigned int i = 0;
i < bundle.size();
i++) {
84 int ir =
static_cast<int>(
i) / nY;
89 if (
ib >= 0 &&
ib < (
int)(logs.size())) {
93 <<
" positioned in " << mother.name() <<
" at (0, 0, 0) with " <<
rotation[ir];
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
constexpr NumType convert2mm(NumType length)
std::string to_string(const V &value)
dd4hep::Material material(const std::string &name) const
#define DECLARE_DDCMS_DETELEMENT(name, func)
static constexpr long s_executed
std::string_view name() const
Cos< T >::type cos(const T &t)
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e)
dd4hep::Volume volume(const std::string &name, bool exc=true) const