CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDTIDRingAlgo Class Reference
Inheritance diagram for DDTIDRingAlgo:

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 22 of file DDTIDRingAlgo.cc.

Constructor & Destructor Documentation

◆ DDTIDRingAlgo()

DDTIDRingAlgo::DDTIDRingAlgo ( )

Definition at line 50 of file DDTIDRingAlgo.cc.

50 { LogDebug("TIDGeom") << "DDTIDRingAlgo info: Creating an instance"; }

References LogDebug.

◆ ~DDTIDRingAlgo()

DDTIDRingAlgo::~DDTIDRingAlgo ( )
override

Definition at line 52 of file DDTIDRingAlgo.cc.

52 {}

Member Function Documentation

◆ execute()

void DDTIDRingAlgo::execute ( DDCompactView cpv)
override

Definition at line 80 of file DDTIDRingAlgo.cc.

80  {
81  double theta = 90. * CLHEP::deg;
82  double phiy = 0. * CLHEP::deg;
83  double dphi = CLHEP::twopi / number;
84 
85  DDName mother = parent().name();
86  DDName module;
88 
89  //Loop over modules
90  for (int i = 0; i < number; i++) {
91  //First the module
92  double phiz = startAngle + i * dphi;
93  double xpos = rModule * cos(phiz);
94  double ypos = rModule * sin(phiz);
95  double zpos, thetay, phix;
96  if (i % 2 == 0) {
97  phix = phiz + 90. * CLHEP::deg;
98  thetay = 0 * CLHEP::deg;
99  zpos = zModule[0];
101  } else {
102  phix = phiz - 90. * CLHEP::deg;
103  thetay = 180 * CLHEP::deg;
104  zpos = zModule[1];
106  }
107 
108  // stereo face inside toward structure, rphi face outside
109  phix = phix - 180. * CLHEP::deg;
110  thetay = thetay + 180. * CLHEP::deg;
111  //
112 
113  DDTranslation trmod(xpos, ypos, zpos);
114  double phideg = phiz / CLHEP::deg;
116  string rotstr = mother.name() + to_string(phideg * 10.);
118  if (!rotation) {
119  LogDebug("TIDGeom") << "DDTIDRingAlgo test: Creating a new rotation " << rotstr << "\t" << theta / CLHEP::deg
120  << ", " << phix / CLHEP::deg << ", " << thetay / CLHEP::deg << ", " << phiy / CLHEP::deg
121  << ", " << theta / CLHEP::deg << ", " << phiz / CLHEP::deg;
122  rotation = DDrot(DDName(rotstr, idNameSpace), theta, phix, thetay, phiy, theta, phiz);
123  }
124 
125  cpv.position(module, mother, i + 1, trmod, rotation);
126  LogDebug("TIDGeom") << "DDTIDRingAlgo test: " << module << " number " << i + 1 << " positioned in " << mother
127  << " at " << trmod << " with " << rotation;
128 
129  //Now the ICC
130  if (i % 2 == 0) {
131  zpos = zICC[0];
132  xpos = rICC * cos(phiz) + sICC * sin(phiz);
133  ypos = rICC * sin(phiz) - sICC * cos(phiz);
134  } else {
135  zpos = zICC[1];
136  xpos = rICC * cos(phiz) - sICC * sin(phiz);
137  ypos = rICC * sin(phiz) + sICC * cos(phiz);
138  }
139  DDTranslation tricc(xpos, ypos, zpos);
140  cpv.position(icc, mother, i + 1, tricc, rotation);
141  LogDebug("TIDGeom") << "DDTIDRingAlgo test: " << icc << " number " << i + 1 << " positioned in " << mother << " at "
142  << tricc << " with " << rotation;
143  }
144 }

References funct::cos(), DDrot(), DDSplit(), first, mps_fire::i, LogDebug, callgraph::module, EcalCalibMonitorClient_cfi::moduleName, DDName::name(), contentValuesFiles::number, class-composition::parent, DDCompactView::position(), idealTransformation::rotation, edm::second(), funct::sin(), and theta().

◆ initialize()

void DDTIDRingAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 54 of file DDTIDRingAlgo.cc.

58  {
60  moduleName = vsArgs["ModuleName"];
61  iccName = sArgs["ICCName"];
62  DDName parentName = parent().name();
63  LogDebug("TIDGeom") << "DDTIDRingAlgo debug: Parent " << parentName << "\tModule " << moduleName[0] << ", "
64  << moduleName[1] << "\tICC " << iccName << "\tNameSpace " << idNameSpace;
65 
66  number = int(nArgs["Number"]);
67  startAngle = nArgs["StartAngle"];
68  rModule = nArgs["ModuleR"];
69  zModule = vArgs["ModuleZ"];
70  rICC = nArgs["ICCR"];
71  sICC = nArgs["ICCShift"];
72  zICC = vArgs["ICCZ"];
73 
74  LogDebug("TIDGeom") << "DDTIDRingAlgo debug: Parameters for positioning--"
75  << " StartAngle " << startAngle / CLHEP::deg << " Copy Numbers " << number << " Modules at R "
76  << rModule << " Z " << zModule[0] << ", " << zModule[1] << " ICCs at R " << rICC << " Z "
77  << zICC[0] << ", " << zICC[1];
78 }

References createfilelist::int, LogDebug, EcalCalibMonitorClient_cfi::moduleName, DDCurrentNamespace::ns(), contentValuesFiles::number, and class-composition::parent.

Member Data Documentation

◆ iccName

string DDTIDRingAlgo::iccName
private

Definition at line 39 of file DDTIDRingAlgo.cc.

◆ idNameSpace

string DDTIDRingAlgo::idNameSpace
private

Definition at line 37 of file DDTIDRingAlgo.cc.

◆ moduleName

vector<string> DDTIDRingAlgo::moduleName
private

Definition at line 38 of file DDTIDRingAlgo.cc.

◆ number

int DDTIDRingAlgo::number
private

Definition at line 41 of file DDTIDRingAlgo.cc.

◆ rICC

double DDTIDRingAlgo::rICC
private

Definition at line 45 of file DDTIDRingAlgo.cc.

◆ rModule

double DDTIDRingAlgo::rModule
private

Definition at line 43 of file DDTIDRingAlgo.cc.

◆ sICC

double DDTIDRingAlgo::sICC
private

Definition at line 46 of file DDTIDRingAlgo.cc.

◆ startAngle

double DDTIDRingAlgo::startAngle
private

Definition at line 42 of file DDTIDRingAlgo.cc.

◆ zICC

vector<double> DDTIDRingAlgo::zICC
private

Definition at line 47 of file DDTIDRingAlgo.cc.

◆ zModule

vector<double> DDTIDRingAlgo::zModule
private

Definition at line 44 of file DDTIDRingAlgo.cc.

mps_fire.i
i
Definition: mps_fire.py:428
DDrot
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
DDTIDRingAlgo::rModule
double rModule
Definition: DDTIDRingAlgo.cc:43
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
DDTIDRingAlgo::iccName
string iccName
Definition: DDTIDRingAlgo.cc:39
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
DDTIDRingAlgo::zModule
vector< double > zModule
Definition: DDTIDRingAlgo.cc:44
DDTIDRingAlgo::zICC
vector< double > zICC
Definition: DDTIDRingAlgo.cc:47
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
DDTIDRingAlgo::idNameSpace
string idNameSpace
Definition: DDTIDRingAlgo.cc:37
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
createfilelist.int
int
Definition: createfilelist.py:10
DDTIDRingAlgo::number
int number
Definition: DDTIDRingAlgo.cc:41
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
DDTIDRingAlgo::rICC
double rICC
Definition: DDTIDRingAlgo.cc:45
callgraph.module
module
Definition: callgraph.py:61
DDTIDRingAlgo::sICC
double sICC
Definition: DDTIDRingAlgo.cc:46
DDTIDRingAlgo::startAngle
double startAngle
Definition: DDTIDRingAlgo.cc:42
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
class-composition.parent
parent
Definition: class-composition.py:98
DDSplit
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Definition: DDSplit.cc:3
DDCompactView::position
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Definition: DDCompactView.cc:76
DDTIDRingAlgo::moduleName
vector< string > moduleName
Definition: DDTIDRingAlgo.cc:38