CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Attributes
DDTOBAxCableAlgo Class Reference
Inheritance diagram for DDTOBAxCableAlgo:

Public Member Functions

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

Private Attributes

string idNameSpace
 
double sectorDeltaPhi_B
 
double sectorDz
 
vector< string > sectorMaterial_A
 
vector< string > sectorMaterial_B
 
vector< string > sectorMaterial_C
 
vector< string > sectorNumber
 
double sectorRin
 
double sectorRout
 
vector< double > sectorStartPhi
 

Detailed Description

Definition at line 23 of file DDTOBAxCableAlgo.cc.

Constructor & Destructor Documentation

◆ DDTOBAxCableAlgo()

DDTOBAxCableAlgo::DDTOBAxCableAlgo ( )

Definition at line 52 of file DDTOBAxCableAlgo.cc.

References LogDebug.

53  LogDebug("TOBGeom") << "DDTOBAxCableAlgo info: Creating an instance";
54 }
#define LogDebug(id)

◆ ~DDTOBAxCableAlgo()

DDTOBAxCableAlgo::~DDTOBAxCableAlgo ( )
override

Definition at line 56 of file DDTOBAxCableAlgo.cc.

56 {}

Member Function Documentation

◆ execute()

void DDTOBAxCableAlgo::execute ( DDCompactView cpv)
override

Definition at line 98 of file DDTOBAxCableAlgo.cc.

References DDSplit(), PVValHelper::dz, dqmdumpme::first, mps_fire::i, idNameSpace, createfilelist::int, LogDebug, Skims_PA_cff::name, class-composition::parent, DDCompactView::position(), edm::second(), sectorDeltaPhi_B, sectorDz, sectorMaterial_A, sectorMaterial_B, sectorMaterial_C, sectorNumber, sectorRin, sectorRout, sectorStartPhi, and DDSolidFactory::tubs().

98  {
99  LogDebug("TOBGeom") << "==>> Constructing DDTOBAxCableAlgo...";
100  DDName tubsName(parent().name());
101 
102  // Loop over sectors (sectorNumber vector)
103  for (int i = 0; i < (int)(sectorNumber.size()); i++) {
104  DDSolid solid;
105  string name;
106  double dz, rin, rout, startphi, widthphi, deltaphi;
107 
108  // Axial Services
109  // Each sector is divided in 3 parts from phi[i] to phi[i+1]
110 
111  widthphi = ((i + 1 == (int)(sectorStartPhi.size())) ? (sectorStartPhi[0] + CLHEP::twopi) - sectorStartPhi[i]
112  : (sectorStartPhi[i + 1] - sectorStartPhi[i]));
113 
114  // First Part: A
115  name = "TOBAxService_" + sectorNumber[i] + "A";
116  dz = sectorDz;
117  rin = sectorRin;
118  rout = sectorRout;
119  startphi = sectorStartPhi[i];
120  deltaphi = 0.5 * (widthphi - sectorDeltaPhi_B);
121 
122  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin, rout, startphi, deltaphi);
123 
124  LogDebug("TOBGeom") << "DDTOBAxCableAlgo test: " << DDName(name, idNameSpace) << " Tubs made of "
125  << sectorMaterial_A[i] << " from " << startphi / CLHEP::deg << " to "
126  << (startphi + deltaphi) / CLHEP::deg << " with Rin " << rin << " Rout " << rout << " ZHalf "
127  << dz;
128 
130  DDMaterial sectorMatter(sectorMatName);
131  DDLogicalPart sectorLogic(DDName(name, idNameSpace), sectorMatter, solid);
132 
133  cpv.position(DDName(name, idNameSpace), tubsName, i + 1, DDTranslation(), DDRotation());
134  LogDebug("TOBGeom") << "DDTOBAxCableAlgo test: " << DDName(name, idNameSpace) << " number " << i + 1
135  << " positioned in " << tubsName << " with no translation and no rotation";
136 
137  // Second Part: B
138  name = "TOBAxService_" + sectorNumber[i] + "B";
139  startphi += deltaphi;
140  deltaphi = sectorDeltaPhi_B;
141 
142  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin, rout, startphi, deltaphi);
143 
144  LogDebug("TOBGeom") << "DDTOBAxCableAlgo test: " << DDName(name, idNameSpace) << " Tubs made of "
145  << sectorMaterial_B[i] << " from " << startphi / CLHEP::deg << " to "
146  << (startphi + deltaphi) / CLHEP::deg << " with Rin " << rin << " Rout " << rout << " ZHalf "
147  << dz;
148 
150  sectorMatter = DDMaterial(sectorMatName);
151  sectorLogic = DDLogicalPart(DDName(name, idNameSpace), sectorMatter, solid);
152 
153  cpv.position(DDName(name, idNameSpace), tubsName, i + 1, DDTranslation(), DDRotation());
154  LogDebug("TOBGeom") << "DDTOBAxCableAlgo test: " << DDName(name, idNameSpace) << " number " << i + 1
155  << " positioned in " << tubsName << " with no translation and no rotation";
156 
157  // Third Part: C
158  name = "TOBAxService_" + sectorNumber[i] + "C";
159  startphi += deltaphi;
160  deltaphi = 0.5 * (widthphi - sectorDeltaPhi_B);
161 
162  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin, rout, startphi, deltaphi);
163 
164  LogDebug("TOBGeom") << "DDTOBAxCableAlgo test: " << DDName(name, idNameSpace) << " Tubs made of "
165  << sectorMaterial_C[i] << " from " << startphi / CLHEP::deg << " to "
166  << (startphi + deltaphi) / CLHEP::deg << " with Rin " << rin << " Rout " << rout << " ZHalf "
167  << dz;
168 
170  sectorMatter = DDMaterial(sectorMatName);
171  sectorLogic = DDLogicalPart(DDName(name, idNameSpace), sectorMatter, solid);
172 
173  cpv.position(DDName(name, idNameSpace), tubsName, i + 1, DDTranslation(), DDRotation());
174  LogDebug("TOBGeom") << "DDTOBAxCableAlgo test: " << DDName(name, idNameSpace) << " number " << i + 1
175  << " positioned in " << tubsName << " with no translation and no rotation";
176  }
177 
178  LogDebug("TOBGeom") << "<<== End of DDTOBAxCableAlgo construction ...";
179 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
vector< string > sectorNumber
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
vector< string > sectorMaterial_B
vector< string > sectorMaterial_A
vector< double > sectorStartPhi
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:667
vector< string > sectorMaterial_C
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
#define LogDebug(id)

◆ initialize()

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

Definition at line 58 of file DDTOBAxCableAlgo.cc.

References mps_fire::i, idNameSpace, createfilelist::int, LogDebug, DDCurrentNamespace::ns(), class-composition::parent, sectorDeltaPhi_B, sectorDz, sectorMaterial_A, sectorMaterial_B, sectorMaterial_C, sectorNumber, sectorRin, sectorRout, and sectorStartPhi.

62  {
64  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Parent " << parent().name() << " NameSpace " << idNameSpace;
65 
66  sectorNumber = vsArgs["SectorNumber"];
67  sectorRin = nArgs["SectorRin"];
68  sectorRout = nArgs["SectorRout"];
69  sectorDz = nArgs["SectorDz"];
70  sectorDeltaPhi_B = nArgs["SectorDeltaPhi_B"];
71  sectorStartPhi = vArgs["SectorStartPhi"];
72  sectorMaterial_A = vsArgs["SectorMaterial_A"];
73  sectorMaterial_B = vsArgs["SectorMaterial_B"];
74  sectorMaterial_C = vsArgs["SectorMaterial_C"];
75 
76  for (int i = 0; i < (int)(sectorNumber.size()); i++)
77  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: sectorNumber[" << i << "] = " << sectorNumber[i];
78 
79  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Axial Service Sectors half-length " << sectorDz << "\tRin "
80  << sectorRin << "\tRout = " << sectorRout << "\tPhi of sectors position:";
81  for (int i = 0; i < (int)(sectorNumber.size()); i++)
82  LogDebug("TOBGeom") << "\t[" << i << "]\tPhi = " << sectorStartPhi[i];
83  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: List of materials for the sectors/3 parts";
84  //
85  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 A";
86  for (int i = 0; i < (int)(sectorNumber.size()); i++)
87  LogDebug("TOBGeom") << "\t[" << i << "]\tsectorMaterial_A = " << sectorMaterial_A[i];
88  //
89  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 B";
90  for (int i = 0; i < (int)(sectorNumber.size()); i++)
91  LogDebug("TOBGeom") << "\t[" << i << "]\tsectorMaterial_B = " << sectorMaterial_B[i];
92  //
93  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 C";
94  for (int i = 0; i < (int)(sectorNumber.size()); i++)
95  LogDebug("TOBGeom") << "\t[" << i << "]\tsectorMaterial_C = " << sectorMaterial_C[i];
96 }
static std::string & ns()
vector< string > sectorNumber
vector< string > sectorMaterial_B
vector< string > sectorMaterial_A
vector< double > sectorStartPhi
vector< string > sectorMaterial_C
#define LogDebug(id)

Member Data Documentation

◆ idNameSpace

string DDTOBAxCableAlgo::idNameSpace
private

Definition at line 38 of file DDTOBAxCableAlgo.cc.

Referenced by execute(), and initialize().

◆ sectorDeltaPhi_B

double DDTOBAxCableAlgo::sectorDeltaPhi_B
private

Definition at line 45 of file DDTOBAxCableAlgo.cc.

Referenced by execute(), and initialize().

◆ sectorDz

double DDTOBAxCableAlgo::sectorDz
private

Definition at line 44 of file DDTOBAxCableAlgo.cc.

Referenced by execute(), and initialize().

◆ sectorMaterial_A

vector<string> DDTOBAxCableAlgo::sectorMaterial_A
private

Definition at line 47 of file DDTOBAxCableAlgo.cc.

Referenced by execute(), and initialize().

◆ sectorMaterial_B

vector<string> DDTOBAxCableAlgo::sectorMaterial_B
private

Definition at line 48 of file DDTOBAxCableAlgo.cc.

Referenced by execute(), and initialize().

◆ sectorMaterial_C

vector<string> DDTOBAxCableAlgo::sectorMaterial_C
private

Definition at line 49 of file DDTOBAxCableAlgo.cc.

Referenced by execute(), and initialize().

◆ sectorNumber

vector<string> DDTOBAxCableAlgo::sectorNumber
private

Definition at line 40 of file DDTOBAxCableAlgo.cc.

Referenced by execute(), and initialize().

◆ sectorRin

double DDTOBAxCableAlgo::sectorRin
private

Definition at line 42 of file DDTOBAxCableAlgo.cc.

Referenced by execute(), and initialize().

◆ sectorRout

double DDTOBAxCableAlgo::sectorRout
private

Definition at line 43 of file DDTOBAxCableAlgo.cc.

Referenced by execute(), and initialize().

◆ sectorStartPhi

vector<double> DDTOBAxCableAlgo::sectorStartPhi
private

Definition at line 46 of file DDTOBAxCableAlgo.cc.

Referenced by execute(), and initialize().