test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 20 of file DDTIDRingAlgo.cc.

References LogDebug.

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

Definition at line 24 of file DDTIDRingAlgo.cc.

24 {}

Member Function Documentation

void DDTIDRingAlgo::execute ( DDCompactView cpv)

Definition at line 57 of file DDTIDRingAlgo.cc.

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

57  {
58 
59  double theta = 90.*CLHEP::deg;
60  double phiy = 0.*CLHEP::deg;
61  double dphi = CLHEP::twopi/number;
62 
63  DDName mother = parent().name();
64  DDName module;
66 
67  //Loop over modules
68  for (int i=0; i<number; i++) {
69 
70  //First the module
71  double phiz = startAngle + i*dphi;
72  double xpos = rModule*cos(phiz);
73  double ypos = rModule*sin(phiz);
74  double zpos, thetay, phix;
75  if (i%2 == 0) {
76  phix = phiz + 90.*CLHEP::deg;
77  thetay = 0*CLHEP::deg;
78  zpos = zModule[0];
79  module = DDName(DDSplit(moduleName[0]).first,
81  } else {
82  phix = phiz - 90.*CLHEP::deg;
83  thetay = 180*CLHEP::deg;
84  zpos = zModule[1];
85  module = DDName(DDSplit(moduleName[1]).first,
87  }
88 
89  // stereo face inside toward structure, rphi face outside
90  phix = phix - 180.*CLHEP::deg;
91  thetay = thetay + 180.*CLHEP::deg;
92  //
93 
94  DDTranslation trmod(xpos, ypos, zpos);
95  double phideg = phiz/CLHEP::deg;
97  std::string rotstr = mother.name() + dbl_to_string(phideg*10.);
98  rotation = DDRotation(DDName(rotstr, idNameSpace));
99  if (!rotation) {
100  LogDebug("TIDGeom") << "DDTIDRingAlgo test: Creating a new rotation "
101  << rotstr << "\t" << theta/CLHEP::deg << ", "
102  << phix/CLHEP::deg << ", " << thetay/CLHEP::deg
103  << ", " << phiy/CLHEP::deg << ", "
104  << theta/CLHEP::deg << ", " << phiz/CLHEP::deg;
105  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, thetay, phiy,
106  theta, phiz);
107  }
108 
109  cpv.position(module, mother, i+1, trmod, rotation);
110  LogDebug("TIDGeom") << "DDTIDRingAlgo test: " << module << " number "
111  << i+1 << " positioned in " << mother << " at "
112  << trmod << " with " << rotation;
113 
114  //Now the ICC
115  if (i%2 == 0 ) {
116  zpos = zICC[0];
117  xpos = rICC*cos(phiz) + sICC*sin(phiz);
118  ypos = rICC*sin(phiz) - sICC*cos(phiz);
119  } else {
120  zpos = zICC[1];
121  xpos = rICC*cos(phiz) - sICC*sin(phiz);
122  ypos = rICC*sin(phiz) + sICC*cos(phiz);
123  }
124  DDTranslation tricc(xpos, ypos, zpos);
125  cpv.position(icc, mother, i+1, tricc, rotation);
126  LogDebug("TIDGeom") << "DDTIDRingAlgo test: " << icc << " number "
127  << i+1 << " positioned in " << mother << " at "
128  << tricc << " with " << rotation;
129 
130  }
131 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
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:14
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
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:87
void DDTIDRingAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 26 of file DDTIDRingAlgo.cc.

References iccName, idNameSpace, LogDebug, moduleName, DDCurrentNamespace::ns(), number, dbtoconf::parent, rICC, rModule, sICC, startAngle, zICC, and zModule.

30  {
31 
33  moduleName = vsArgs["ModuleName"];
34  iccName = sArgs["ICCName"];
35  DDName parentName = parent().name();
36  LogDebug("TIDGeom") << "DDTIDRingAlgo debug: Parent " << parentName
37  << "\tModule " << moduleName[0] << ", "
38  << moduleName[1] << "\tICC " << iccName
39  << "\tNameSpace " << idNameSpace;
40 
41  number = int (nArgs["Number"]);
42  startAngle = nArgs["StartAngle"];
43  rModule = nArgs["ModuleR"];
44  zModule = vArgs["ModuleZ"];
45  rICC = nArgs["ICCR"];
46  sICC = nArgs["ICCShift"];
47  zICC = vArgs["ICCZ"];
48 
49  LogDebug("TIDGeom") <<"DDTIDRingAlgo debug: Parameters for positioning--"
50  << " StartAngle " << startAngle/CLHEP::deg
51  << " Copy Numbers " << number << " Modules at R "
52  << rModule << " Z " << zModule[0] << ", " << zModule[1]
53  << " ICCs at R " << rICC << " Z " << zICC[0] << ", "
54  << zICC[1];
55 }
#define LogDebug(id)
list parent
Definition: dbtoconf.py:74
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:14
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().