CMS 3D CMS Logo

Functions
DDRPDPosition.cc File Reference
#include "DataFormats/Math/interface/GeantUnits.h"
#include "DetectorDescription/Core/interface/DDSplit.h"
#include "DetectorDescription/DDCMS/interface/DDPlugins.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DD4hep/DetFactoryHelper.h"
#include <string>
#include <vector>
#include <sstream>

Go to the source code of this file.

Functions

static long algorithm (dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e)
 
 DD4HEP_OPEN_PLUGIN (dd4hep, ddcms_det_element_DDCMS_rpdalgo_DDRPDPosition)
 

Function Documentation

◆ algorithm()

static long algorithm ( dd4hep::Detector &  ,
cms::DDParsingContext ctxt,
xml_h  e 
)
static

Definition at line 13 of file DDRPDPosition.cc.

References writedatasetfile::args, MillePedeFileConverter_cfg::e, findQualityFiles::jj, class-composition::parent, PixelTestBeamValidation_cfi::Position, cms::DDNamespace::prepend(), cms::s_executed, AlCaHLTBitMon_QueryRunRegistry::string, cms::DDNamespace::volume(), and x.

13  {
14  cms::DDNamespace ns(ctxt, e, true);
16 
17  const auto& xpos = args.value<std::vector<double> >("positionX");
18  const auto& ypos = args.value<double>("positionY");
19  const auto& zpos = args.value<double>("positionZ");
20  const auto& childName = args.value<std::string>("ChildName");
21 
22  dd4hep::Volume parent = ns.volume(args.parentName());
23  dd4hep::Volume child = ns.volume(ns.prepend(childName));
24 #ifdef EDM_ML_DEBUG
25  edm::LogVerbatim("ForwardGeom") << "DDRPDPosition: Parameters for positioning-- " << xpos.size() << " copies of "
26  << child.name() << " to be positioned inside " << parent.name() << " at y = " << ypos
27  << ", z = " << zpos << " and at x = (";
28  std::ostringstream st1;
29  for (const auto& x : xpos)
30  st1 << x << " ";
31  edm::LogVerbatim("ForwardGeom") << st1.str() << ")";
32 #endif
33 
34  for (unsigned int jj = 0; jj < xpos.size(); jj++) {
35  dd4hep::Position tran(xpos[jj], ypos, zpos);
36  parent.placeVolume(child, jj + 1, tran);
37 #ifdef EDM_ML_DEBUG
38  edm::LogVerbatim("ForwardGeom") << "DDRPDPosition: " << child.name() << " number " << jj + 1 << " positioned in "
39  << parent.name() << " at " << tran << " with no rotation";
40 #endif
41  }
42  return cms::s_executed;
43 }
Log< level::Info, true > LogVerbatim
static constexpr long s_executed
dd4hep::Volume Volume
float x

◆ DD4HEP_OPEN_PLUGIN()

DD4HEP_OPEN_PLUGIN ( dd4hep  ,
ddcms_det_element_DDCMS_rpdalgo_DDRPDPosition   
)

Definition at line 46 of file DDRPDPosition.cc.