CMS 3D CMS Logo

Functions
DDTrackerLinear.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_DDTrackerLinear)
 

Function Documentation

◆ algorithm()

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

Definition at line 9 of file DDTrackerLinear.cc.

9  {
10  cms::DDNamespace ns(ctxt, e, true);
11  DDAlgoArguments args(ctxt, e);
12  int startcn = args.find("StartCopyNo") ? args.value<int>("StartCopyNo") : 1;
13  int incrcn = args.find("IncrCopyNo") ? args.value<int>("IncrCopyNo") : 1;
14  int number = args.value<int>("Number");
15  double theta = args.value<double>("Theta");
16  double phi = args.value<double>("Phi");
17  double offset = args.value<double>("Offset");
18  double delta = args.value<double>("Delta");
19  vector<double> centre = args.value<vector<double> >("Center");
20  string rotMat = args.value<string>("Rotation");
21  Volume mother = ns.volume(args.parentName());
22  Volume child = ns.volume(args.value<string>("ChildName"));
23 
24  LogDebug("TrackerGeom") << "DDTrackerLinear +++ Executing Algorithm. rParent:" << mother.name();
25  LogDebug("TrackerGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace "
26  << ns.name() << "\tNumber " << number << "\tAxis (theta/phi) " << theta / dd4hep::deg << ", "
27  << phi / dd4hep::deg << "\t(Offset/Delta) " << offset << ", " << delta << "\tCentre "
28  << centre[0] << ", " << centre[1] << ", " << centre[2] << "\tRotation " << rotMat;
29 
30  Position direction(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta));
31  Position base(centre[0], centre[1], centre[2]);
32 
33  const Rotation3D& rot = ns.rotation(rotMat);
34 
35  for (int i = 0, ci = startcn; i < number; i++, ci += incrcn) {
36  Position tran = base + (offset + double(i) * delta) * direction;
37  mother.placeVolume(child, ci, Transform3D(rot, tran));
38 
39  LogDebug("TrackerGeom") << child.name() << " number " << ci << " positioned in " << mother.name() << " at " << tran
40  << " with " << rot;
41  }
42  return cms::s_executed;
43 }

References writedatasetfile::args, newFWLiteAna::base, funct::cos(), dumpMFGeometry_cfg::delta, MillePedeFileConverter_cfg::e, mps_fire::i, LogDebug, cms::DDNamespace::name(), contentValuesFiles::number, hltrates_dqm_sourceclient-live_cfg::offset, PixelTestBeamValidation_cfi::Position, makeMuonMisalignmentScenario::rot, cms::DDNamespace::rotation(), cms::s_executed, funct::sin(), theta(), and cms::DDNamespace::volume().

◆ DD4HEP_OPEN_PLUGIN()

DD4HEP_OPEN_PLUGIN ( dd4hep  ,
ddcms_det_element_DDCMS_track_DDTrackerLinear   
)

Definition at line 46 of file DDTrackerLinear.cc.

writedatasetfile.args
args
Definition: writedatasetfile.py:18
mps_fire.i
i
Definition: mps_fire.py:428
cms::DDNamespace
Definition: DDNamespace.h:16
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
PixelTestBeamValidation_cfi.Position
Position
Definition: PixelTestBeamValidation_cfi.py:75
cms::Volume
dd4hep::Volume Volume
Definition: DDFilteredView.h:47
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
PVValHelper::phi
Definition: PVValidationHelpers.h:68
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
cms::DDAlgoArguments
Definition: DDAlgoArguments.h:28
cms::s_executed
static constexpr long s_executed
Definition: DDAlgoArguments.h:16
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
child
Definition: simpleInheritance.h:11
newFWLiteAna.base
base
Definition: newFWLiteAna.py:92
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37