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, SensitiveDetector &)
 
 DD4HEP_OPEN_PLUGIN (dd4hep, ddcms_det_element_DDCMS_track_DDTrackerZPosAlgo)
 

Function Documentation

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

Definition at line 10 of file DDTrackerZPosAlgo.cc.

References writedatasetfile::args, popcon2dropbox::copy(), cms::DDAlgoArguments::find(), mps_fire::i, createfilelist::int, LogDebug, cms::DDNamespace::name(), cms::DDAlgoArguments::parentName(), makeMuonMisalignmentScenario::rot, cms::DDNamespace::rotation(), cms::DDAlgoArguments::value(), and cms::DDNamespace::volume().

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

Definition at line 46 of file DDTrackerZPosAlgo.cc.