CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDTIDRingAlgo Class Reference

#include <DDTIDRingAlgo.h>

Inheritance diagram for DDTIDRingAlgo:

Public Member Functions

 DDTIDRingAlgo ()
 
void execute (DDCompactView &cpv)
 
void initialize (const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
 
virtual ~DDTIDRingAlgo ()
 

Private Attributes

std::string iccName
 
std::string idNameSpace
 
std::vector< std::string > moduleName
 
int number
 
double rICC
 
double rModule
 
double sICC
 
double startAngle
 
std::vector< double > zICC
 
std::vector< double > zModule
 

Detailed Description

Definition at line 10 of file DDTIDRingAlgo.h.

Constructor & Destructor Documentation

DDTIDRingAlgo::DDTIDRingAlgo ( )

Definition at line 19 of file DDTIDRingAlgo.cc.

References LogDebug.

19  {
20  LogDebug("TIDGeom") << "DDTIDRingAlgo info: Creating an instance";
21 }
#define LogDebug(id)
DDTIDRingAlgo::~DDTIDRingAlgo ( )
virtual

Definition at line 23 of file DDTIDRingAlgo.cc.

23 {}

Member Function Documentation

void DDTIDRingAlgo::execute ( DDCompactView cpv)

Definition at line 56 of file DDTIDRingAlgo.cc.

References funct::cos(), DDrot(), DDSplit(), plotBeamSpotDB::first, mps_fire::i, iccName, idNameSpace, LogDebug, python.rootplot.argparse::module, moduleName, DDName::name(), number, class-composition::parent, DDCompactView::position(), rICC, rModule, idealTransformation::rotation, edm::second(), sICC, funct::sin(), startAngle, AlCaHLTBitMon_QueryRunRegistry::string, theta(), zICC, and zModule.

56  {
57 
58  double theta = 90.*CLHEP::deg;
59  double phiy = 0.*CLHEP::deg;
60  double dphi = CLHEP::twopi/number;
61 
62  DDName mother = parent().name();
63  DDName module;
65 
66  //Loop over modules
67  for (int i=0; i<number; i++) {
68 
69  //First the module
70  double phiz = startAngle + i*dphi;
71  double xpos = rModule*cos(phiz);
72  double ypos = rModule*sin(phiz);
73  double zpos, thetay, phix;
74  if (i%2 == 0) {
75  phix = phiz + 90.*CLHEP::deg;
76  thetay = 0*CLHEP::deg;
77  zpos = zModule[0];
78  module = DDName(DDSplit(moduleName[0]).first,
80  } else {
81  phix = phiz - 90.*CLHEP::deg;
82  thetay = 180*CLHEP::deg;
83  zpos = zModule[1];
84  module = DDName(DDSplit(moduleName[1]).first,
86  }
87 
88  // stereo face inside toward structure, rphi face outside
89  phix = phix - 180.*CLHEP::deg;
90  thetay = thetay + 180.*CLHEP::deg;
91  //
92 
93  DDTranslation trmod(xpos, ypos, zpos);
94  double phideg = phiz/CLHEP::deg;
96  std::string rotstr = mother.name() + std::to_string(phideg*10.);
97  rotation = DDRotation(DDName(rotstr, idNameSpace));
98  if (!rotation) {
99  LogDebug("TIDGeom") << "DDTIDRingAlgo test: Creating a new rotation "
100  << rotstr << "\t" << theta/CLHEP::deg << ", "
101  << phix/CLHEP::deg << ", " << thetay/CLHEP::deg
102  << ", " << phiy/CLHEP::deg << ", "
103  << theta/CLHEP::deg << ", " << phiz/CLHEP::deg;
104  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, thetay, phiy,
105  theta, phiz);
106  }
107 
108  cpv.position(module, mother, i+1, trmod, rotation);
109  LogDebug("TIDGeom") << "DDTIDRingAlgo test: " << module << " number "
110  << i+1 << " positioned in " << mother << " at "
111  << trmod << " with " << rotation;
112 
113  //Now the ICC
114  if (i%2 == 0 ) {
115  zpos = zICC[0];
116  xpos = rICC*cos(phiz) + sICC*sin(phiz);
117  ypos = rICC*sin(phiz) - sICC*cos(phiz);
118  } else {
119  zpos = zICC[1];
120  xpos = rICC*cos(phiz) - sICC*sin(phiz);
121  ypos = rICC*sin(phiz) + sICC*cos(phiz);
122  }
123  DDTranslation tricc(xpos, ypos, zpos);
124  cpv.position(icc, mother, i+1, tricc, rotation);
125  LogDebug("TIDGeom") << "DDTIDRingAlgo test: " << icc << " number "
126  << i+1 << " positioned in " << mother << " at "
127  << tricc << " with " << rotation;
128 
129  }
130 }
#define LogDebug(id)
double startAngle
Definition: DDTIDRingAlgo.h:32
std::vector< double > zICC
Definition: DDTIDRingAlgo.h:37
std::string idNameSpace
Definition: DDTIDRingAlgo.h:27
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:64
U second(std::pair< T, U > const &p)
std::vector< std::string > moduleName
Definition: DDTIDRingAlgo.h:28
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::string iccName
Definition: DDTIDRingAlgo.h:29
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
std::vector< double > zModule
Definition: DDTIDRingAlgo.h:34
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
void DDTIDRingAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 25 of file DDTIDRingAlgo.cc.

References iccName, idNameSpace, createfilelist::int, LogDebug, moduleName, DDCurrentNamespace::ns(), number, class-composition::parent, rICC, rModule, sICC, startAngle, zICC, and zModule.

29  {
30 
32  moduleName = vsArgs["ModuleName"];
33  iccName = sArgs["ICCName"];
34  DDName parentName = parent().name();
35  LogDebug("TIDGeom") << "DDTIDRingAlgo debug: Parent " << parentName
36  << "\tModule " << moduleName[0] << ", "
37  << moduleName[1] << "\tICC " << iccName
38  << "\tNameSpace " << idNameSpace;
39 
40  number = int (nArgs["Number"]);
41  startAngle = nArgs["StartAngle"];
42  rModule = nArgs["ModuleR"];
43  zModule = vArgs["ModuleZ"];
44  rICC = nArgs["ICCR"];
45  sICC = nArgs["ICCShift"];
46  zICC = vArgs["ICCZ"];
47 
48  LogDebug("TIDGeom") <<"DDTIDRingAlgo debug: Parameters for positioning--"
49  << " StartAngle " << startAngle/CLHEP::deg
50  << " Copy Numbers " << number << " Modules at R "
51  << rModule << " Z " << zModule[0] << ", " << zModule[1]
52  << " ICCs at R " << rICC << " Z " << zICC[0] << ", "
53  << zICC[1];
54 }
#define LogDebug(id)
double startAngle
Definition: DDTIDRingAlgo.h:32
std::vector< double > zICC
Definition: DDTIDRingAlgo.h:37
std::string idNameSpace
Definition: DDTIDRingAlgo.h:27
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()
std::vector< std::string > moduleName
Definition: DDTIDRingAlgo.h:28
std::string iccName
Definition: DDTIDRingAlgo.h:29
std::vector< double > zModule
Definition: DDTIDRingAlgo.h:34

Member Data Documentation

std::string DDTIDRingAlgo::iccName
private

Definition at line 29 of file DDTIDRingAlgo.h.

Referenced by execute(), and initialize().

std::string DDTIDRingAlgo::idNameSpace
private

Definition at line 27 of file DDTIDRingAlgo.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDTIDRingAlgo::moduleName
private

Definition at line 28 of file DDTIDRingAlgo.h.

Referenced by execute(), and initialize().

int DDTIDRingAlgo::number
private

Definition at line 31 of file DDTIDRingAlgo.h.

Referenced by execute(), and initialize().

double DDTIDRingAlgo::rICC
private

Definition at line 35 of file DDTIDRingAlgo.h.

Referenced by execute(), and initialize().

double DDTIDRingAlgo::rModule
private

Definition at line 33 of file DDTIDRingAlgo.h.

Referenced by execute(), and initialize().

double DDTIDRingAlgo::sICC
private

Definition at line 36 of file DDTIDRingAlgo.h.

Referenced by execute(), and initialize().

double DDTIDRingAlgo::startAngle
private

Definition at line 32 of file DDTIDRingAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTIDRingAlgo::zICC
private

Definition at line 37 of file DDTIDRingAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTIDRingAlgo::zModule
private

Definition at line 34 of file DDTIDRingAlgo.h.

Referenced by execute(), and initialize().