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 72 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().

72  {
73 
74  LogDebug("TOBGeom") << "==>> Constructing DDTOBAxCableAlgo...";
75  DDName tubsName(parent().name());
76 
77  // Loop over sectors (sectorNumber vector)
78  for (int i=0; i<(int)(sectorNumber.size()); i++) {
79 
80  DDSolid solid;
82  double dz, rin, rout, startphi, widthphi, deltaphi;
83 
84  // Axial Services
85  // Each sector is divided in 3 parts from phi[i] to phi[i+1]
86 
87  widthphi = ( (i+1 == (int)(sectorStartPhi.size())) ?
88  (sectorStartPhi[0]+CLHEP::twopi)-sectorStartPhi[i] :
90 
91  // First Part: A
92  name = "TOBAxService_" + sectorNumber[i] + "A";
93  dz = sectorDz;
94  rin = sectorRin;
95  rout = sectorRout;
96  startphi = sectorStartPhi[i];
97  deltaphi = 0.5 * (widthphi - sectorDeltaPhi_B);
98 
99  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin,
100  rout, startphi, deltaphi);
101 
102  LogDebug("TOBGeom") << "DDTOBAxCableAlgo test: "
103  << DDName(name, idNameSpace) << " Tubs made of "
104  << sectorMaterial_A[i] << " from "
105  << startphi/CLHEP::deg << " to "
106  << (startphi+deltaphi)/CLHEP::deg << " with Rin "
107  << rin << " Rout " << rout << " ZHalf " << dz;
108 
109  DDName sectorMatName(DDSplit(sectorMaterial_A[i]).first,
111  DDMaterial sectorMatter(sectorMatName);
112  DDLogicalPart sectorLogic(DDName(name, idNameSpace), sectorMatter, solid);
113 
114  cpv.position(DDName(name,idNameSpace), tubsName, i+1, DDTranslation(),
115  DDRotation());
116  LogDebug("TOBGeom") << "DDTOBAxCableAlgo test: "
117  << DDName(name,idNameSpace) << " number " << i+1
118  << " positioned in " << tubsName
119  << " with no translation and no rotation";
120 
121  // Second Part: B
122  name = "TOBAxService_" + sectorNumber[i] + "B";
123  startphi += deltaphi;
124  deltaphi = sectorDeltaPhi_B;
125 
126  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin,
127  rout, startphi, deltaphi);
128 
129  LogDebug("TOBGeom") << "DDTOBAxCableAlgo test: "
130  << DDName(name, idNameSpace) << " Tubs made of "
131  << sectorMaterial_B[i] << " from " << startphi/CLHEP::deg << " to " << (startphi+deltaphi)/CLHEP::deg
132  << " with Rin " << rin << " Rout " << rout
133  << " ZHalf " << dz;
134 
135  sectorMatName = DDName(DDSplit(sectorMaterial_B[i]).first,
137  sectorMatter = DDMaterial(sectorMatName);
138  sectorLogic = DDLogicalPart(DDName(name, idNameSpace), sectorMatter,
139  solid);
140 
141  cpv.position(DDName(name,idNameSpace), tubsName, i+1, DDTranslation(),
142  DDRotation());
143  LogDebug("TOBGeom") << "DDTOBAxCableAlgo test: "
144  << DDName(name,idNameSpace) << " number " << i+1
145  << " positioned in " << tubsName
146  << " with no translation and no rotation";
147 
148  // Third Part: C
149  name = "TOBAxService_" + sectorNumber[i] + "C";
150  startphi += deltaphi;
151  deltaphi = 0.5 * (widthphi - sectorDeltaPhi_B);
152 
153  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin,
154  rout, startphi, deltaphi);
155 
156  LogDebug("TOBGeom") << "DDTOBAxCableAlgo test: "
157  << DDName(name, idNameSpace) << " Tubs made of "
158  << sectorMaterial_C[i] << " from "
159  << startphi/CLHEP::deg << " to "
160  << (startphi+deltaphi)/CLHEP::deg << " with Rin "
161  << rin << " Rout " << rout << " ZHalf " << dz;
162 
163  sectorMatName = DDName(DDSplit(sectorMaterial_C[i]).first,
165  sectorMatter = DDMaterial(sectorMatName);
166  sectorLogic = DDLogicalPart(DDName(name, idNameSpace), sectorMatter,
167  solid);
168 
169  cpv.position(DDName(name,idNameSpace), tubsName, i+1, DDTranslation(),
170  DDRotation());
171  LogDebug("TOBGeom") << "DDTOBAxCableAlgo test: "
172  << DDName(name,idNameSpace) << " number " << i+1
173  << " positioned in " << tubsName
174  << " with no translation and no rotation";
175  }
176 
177  LogDebug("TOBGeom") << "<<== End of DDTOBAxCableAlgo construction ...";
178 }
#define LogDebug(id)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
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:39
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
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:93
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:865
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  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Parent " << parent().name()
35  << " NameSpace " << idNameSpace;
36 
37  sectorNumber = vsArgs["SectorNumber"];
38  sectorRin = nArgs["SectorRin"];
39  sectorRout = nArgs["SectorRout"];
40  sectorDz = nArgs["SectorDz"];
41  sectorDeltaPhi_B = nArgs["SectorDeltaPhi_B"];
42  sectorStartPhi = vArgs["SectorStartPhi"];
43  sectorMaterial_A = vsArgs["SectorMaterial_A"];
44  sectorMaterial_B = vsArgs["SectorMaterial_B"];
45  sectorMaterial_C = vsArgs["SectorMaterial_C"];
46 
47  for (int i=0; i<(int)(sectorNumber.size()); i++)
48  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: sectorNumber[" << i
49  << "] = " << sectorNumber[i];
50 
51  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Axial Service Sectors half-length " << sectorDz
52  << "\tRin " << sectorRin << "\tRout = " << sectorRout
53  << "\tPhi of sectors position:";
54  for (int i=0; i<(int)(sectorNumber.size()); i++)
55  LogDebug("TOBGeom") << "\t[" << i << "]\tPhi = " << sectorStartPhi[i];
56  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: List of materials for the sectors/3 parts";
57  //
58  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 A";
59  for (int i=0; i<(int)(sectorNumber.size()); i++)
60  LogDebug("TOBGeom") << "\t[" << i << "]\tsectorMaterial_A = " << sectorMaterial_A[i];
61  //
62  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 B";
63  for (int i=0; i<(int)(sectorNumber.size()); i++)
64  LogDebug("TOBGeom") << "\t[" << i << "]\tsectorMaterial_B = " << sectorMaterial_B[i];
65  //
66  LogDebug("TOBGeom") << "DDTOBAxCableAlgo debug: Sector/3 C";
67  for (int i=0; i<(int)(sectorNumber.size()); i++)
68  LogDebug("TOBGeom") << "\t[" << i << "]\tsectorMaterial_C = " << sectorMaterial_C[i];
69 
70 }
#define LogDebug(id)
std::vector< std::string > sectorMaterial_A
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().