CMS 3D CMS Logo

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

#include <DDTOBAxCableAlgo.h>

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

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

Detailed Description

Definition at line 10 of file DDTOBAxCableAlgo.h.

Constructor & Destructor Documentation

DDTOBAxCableAlgo::DDTOBAxCableAlgo ( )

Definition at line 20 of file DDTOBAxCableAlgo.cc.

References LogDebug.

20  :
22  LogDebug("TOBGeom") <<"DDTOBAxCableAlgo info: Creating an instance";
23 }
#define LogDebug(id)
DDTOBAxCableAlgo::~DDTOBAxCableAlgo ( )
override

Definition at line 25 of file DDTOBAxCableAlgo.cc.

25 {}

Member Function Documentation

void DDTOBAxCableAlgo::execute ( DDCompactView cpv)
override

Definition at line 73 of file DDTOBAxCableAlgo.cc.

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

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

Definition at line 27 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.

31  {
32 
34  DDName parentName = parent().name();
35  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Parent " << parentName
36  << " NameSpace " << idNameSpace;
37 
38  sectorNumber = vsArgs["SectorNumber"];
39  sectorRin = nArgs["SectorRin"];
40  sectorRout = nArgs["SectorRout"];
41  sectorDz = nArgs["SectorDz"];
42  sectorDeltaPhi_B = nArgs["SectorDeltaPhi_B"];
43  sectorStartPhi = vArgs["SectorStartPhi"];
44  sectorMaterial_A = vsArgs["SectorMaterial_A"];
45  sectorMaterial_B = vsArgs["SectorMaterial_B"];
46  sectorMaterial_C = vsArgs["SectorMaterial_C"];
47 
48  for (int i=0; i<(int)(sectorNumber.size()); i++)
49  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: sectorNumber[" << i
50  << "] = " << sectorNumber[i];
51 
52  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Axial Service Sectors half-length " << sectorDz
53  << "\tRin " << sectorRin << "\tRout = " << sectorRout
54  << "\tPhi of sectors position:";
55  for (int i=0; i<(int)(sectorNumber.size()); i++)
56  LogDebug("TOBGeom") << "\t[" << i << "]\tPhi = " << sectorStartPhi[i];
57  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: List of materials for the sectors/3 parts";
58  //
59  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 A";
60  for (int i=0; i<(int)(sectorNumber.size()); i++)
61  LogDebug("TOBGeom") << "\t[" << i << "]\tsectorMaterial_A = " << sectorMaterial_A[i];
62  //
63  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 B";
64  for (int i=0; i<(int)(sectorNumber.size()); i++)
65  LogDebug("TOBGeom") << "\t[" << i << "]\tsectorMaterial_B = " << sectorMaterial_B[i];
66  //
67  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 C";
68  for (int i=0; i<(int)(sectorNumber.size()); i++)
69  LogDebug("TOBGeom") << "\t[" << i << "]\tsectorMaterial_C = " << sectorMaterial_C[i];
70 
71 }
#define LogDebug(id)
std::vector< std::string > sectorMaterial_A
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
std::vector< std::string > sectorNumber
static std::string & ns()
std::string idNameSpace
std::vector< std::string > sectorMaterial_C
std::vector< double > sectorStartPhi
std::vector< std::string > sectorMaterial_B

Member Data Documentation

std::string DDTOBAxCableAlgo::idNameSpace
private

Definition at line 26 of file DDTOBAxCableAlgo.h.

Referenced by execute(), and initialize().

double DDTOBAxCableAlgo::sectorDeltaPhi_B
private

Definition at line 33 of file DDTOBAxCableAlgo.h.

Referenced by execute(), and initialize().

double DDTOBAxCableAlgo::sectorDz
private

Definition at line 32 of file DDTOBAxCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDTOBAxCableAlgo::sectorMaterial_A
private

Definition at line 35 of file DDTOBAxCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDTOBAxCableAlgo::sectorMaterial_B
private

Definition at line 36 of file DDTOBAxCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDTOBAxCableAlgo::sectorMaterial_C
private

Definition at line 37 of file DDTOBAxCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDTOBAxCableAlgo::sectorNumber
private

Definition at line 28 of file DDTOBAxCableAlgo.h.

Referenced by execute(), and initialize().

double DDTOBAxCableAlgo::sectorRin
private

Definition at line 30 of file DDTOBAxCableAlgo.h.

Referenced by execute(), and initialize().

double DDTOBAxCableAlgo::sectorRout
private

Definition at line 31 of file DDTOBAxCableAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDTOBAxCableAlgo::sectorStartPhi
private

Definition at line 34 of file DDTOBAxCableAlgo.h.

Referenced by execute(), and initialize().