CMS 3D CMS Logo

Functions
DDTrackerZPosAlgo.cc File Reference
#include "DD4hep/DetFactoryHelper.h"
#include "DetectorDescription/DDCMS/interface/DDPlugins.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

Go to the source code of this file.

Functions

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

Function Documentation

◆ algorithm()

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

Definition at line 9 of file DDTrackerZPosAlgo.cc.

References writedatasetfile::args, filterCSVwithJSON::copy, MillePedeFileConverter_cfg::e, mps_fire::i, createfilelist::int, cms::DDNamespace::name(), PixelTestBeamValidation_cfi::Position, makeMuonMisalignmentScenario::rot, cms::DDNamespace::rotation(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::rotMat, and cms::DDNamespace::volume().

9  {
10  cms::DDNamespace ns(ctxt, e, true);
11  DDAlgoArguments args(ctxt, e);
12  int startCopyNo = args.find("StartCopyNo") ? args.value<int>("StartCopyNo") : 1;
13  int incrCopyNo = args.find("IncrCopyNo") ? args.value<int>("IncrCopyNo") : 1;
14  Volume mother = ns.volume(args.parentName());
15  Volume child = ns.volume(args.value<string>("ChildName"));
16  vector<double> zvec = args.value<vector<double> >("ZPositions"); // Z positions
17  vector<string> rotMat = args.value<vector<string> >("Rotations"); // Names of rotation matrices
18 
19  edm::LogVerbatim("TrackerGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace "
20  << ns.name() << "\tCopyNo (Start/Increment) " << startCopyNo << ", " << incrCopyNo
21  << "\tNumber " << zvec.size();
22  for (int i = 0; i < (int)(zvec.size()); i++)
23  edm::LogVerbatim("TrackerGeom") << "\t[" << i << "]\tZ = " << zvec[i] << ", Rot.Matrix = " << rotMat[i];
24 
25  for (int i = 0, copy = startCopyNo; i < (int)(zvec.size()); i++, copy += incrCopyNo) {
26  Position tran(0, 0, zvec[i]);
27  Rotation3D rot;
28  /* PlacedVolume pv = */ rotMat[i] != "NULL"
29  ? mother.placeVolume(child, copy, Transform3D(ns.rotation(rotMat[i]), tran))
30  : mother.placeVolume(child, copy, tran);
31  edm::LogVerbatim("TrackerGeom") << "test: " << child.name() << " number " << copy << " positioned in "
32  << mother.name() << " at " << tran << " with " << rot;
33  }
34  return 1;
35 }
Log< level::Info, true > LogVerbatim
dd4hep::Volume Volume

◆ DD4HEP_OPEN_PLUGIN()

DD4HEP_OPEN_PLUGIN ( dd4hep  ,
ddcms_det_element_DDCMS_track_DDTrackerZPosAlgo   
)

Definition at line 38 of file DDTrackerZPosAlgo.cc.