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.

References LogDebug.

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

◆ ~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.

References funct::cos(), DDrot(), DDSplit(), dqmdumpme::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(), theta(), and to_string().

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 }
vector< double > zModule
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
static std::string to_string(const XMLCh *ch)
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
string idNameSpace
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
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
vector< string > moduleName
vector< double > zICC
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
Geom::Theta< T > theta() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
#define LogDebug(id)

◆ 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.

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

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 }
vector< double > zModule
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
static std::string & ns()
string idNameSpace
vector< string > moduleName
vector< double > zICC
#define LogDebug(id)

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.