CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DDTIBRadCableAlgo_MTCC Class Reference

#include <DDTIBRadCableAlgo_MTCC.h>

Inheritance diagram for DDTIBRadCableAlgo_MTCC:

Public Member Functions

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

Private Attributes

std::vector< std::string > cableMat
 
double cableT
 
double cylinderT
 
double deltaR
 
std::string idNameSpace
 
std::vector< double > layers
 
std::vector< double > layRin
 
double rMax
 
double rMin
 
std::vector< std::string > strucMat
 
double supportDR
 
std::string supportMat
 
double supportT
 

Detailed Description

Definition at line 10 of file DDTIBRadCableAlgo_MTCC.h.

Constructor & Destructor Documentation

DDTIBRadCableAlgo_MTCC::DDTIBRadCableAlgo_MTCC ( )

Definition at line 21 of file DDTIBRadCableAlgo_MTCC.cc.

References LogDebug.

21  : layRin(0),cableMat(0),strucMat(0), layers(0) {
22  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC info: Creating an instance";
23 }
#define LogDebug(id)
std::vector< double > layers
std::vector< std::string > strucMat
std::vector< std::string > cableMat
std::vector< double > layRin
DDTIBRadCableAlgo_MTCC::~DDTIBRadCableAlgo_MTCC ( )
virtual

Definition at line 25 of file DDTIBRadCableAlgo_MTCC.cc.

25 {}

Member Function Documentation

void DDTIBRadCableAlgo_MTCC::execute ( DDCompactView cpv)

Definition at line 79 of file DDTIBRadCableAlgo_MTCC.cc.

References cableMat, cableT, cylinderT, dbl_to_string(), DDSplit(), deltaR, relativeConstraints::empty, first, i, idNameSpace, cuy::ii, j, layers, layRin, LogDebug, mergeVDriftHistosByStation::name, dbtoconf::parent, DDSolidFactory::polycone(), DDCompactView::position(), diffTwoXMLs::r1, diffTwoXMLs::r2, rMax, rMin, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, strucMat, supportDR, supportMat, supportT, and DDSolidFactory::tubs().

79  {
80 
81  LogDebug("TIBGeom") << "==>> Constructing DDTIBRadCableAlgo_MTCC...";
82  DDName diskName = parent().name();
83 
84  DDSolid solid;
86  double rin, rout;
87 
88  // Loop over sub disks
90  DDMaterial suppMatter(suppName);
91  double diskDz = 0.5 * (supportT + cableT*layRin.size());
92  double dz = 0.5*supportT;
93 
94  for (unsigned int i=0; i<layRin.size(); i++) {
95 
96  // fill only layers in layers list
97  bool empty=true;
98  for(unsigned int j=0; j<layers.size(); j++) {
99  if(i+1==(unsigned int)layers[j]) {
100  empty=false;
101  }
102  }
103 
104  if(!empty) {
105  //Support disks
106  name = "TIBSupportSideDisk" + dbl_to_string(i);
107  rin = layRin[i]+0.5*(deltaR-cylinderT)-supportDR;
108  rout = layRin[i]+0.5*(deltaR+cylinderT)+supportDR;
109  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin,
110  rout, 0, CLHEP::twopi);
111  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: "
112  << DDName(name, idNameSpace) << " Tubs made of "
113  << supportMat << " from 0 to "
114  << CLHEP::twopi/CLHEP::deg << " with Rin " << rin
115  << " Rout " << rout << " ZHalf " << dz;
116  DDLogicalPart suppLogic(DDName(name, idNameSpace), suppMatter, solid);
117 
118  DDTranslation r1(0, 0, (dz-diskDz));
119  cpv.position(DDName(name,idNameSpace), diskName, i+1, r1, DDRotation());
120  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: "
121  << DDName(name,idNameSpace) << " number " << i+1
122  << " positioned in " << diskName << " at " << r1
123  << " with no rotation";
124 
125  //Open Structure
126  name = "TIBOpenZone" + dbl_to_string(i);
127  rout = rin;
128  if (i == 0) rin = rMin;
129  else rin = layRin[i-1]+0.5*(deltaR+cylinderT)+supportDR;
130  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin,
131  rout, 0, CLHEP::twopi);
132  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: "
133  << DDName(name, idNameSpace) << " Tubs made of "
134  << strucMat[i] << " from 0 to "
135  << CLHEP::twopi/CLHEP::deg << " with Rin " << rin
136  << " Rout " << rout << " ZHalf " << dz;
137  DDName strucName(DDSplit(strucMat[i]).first, DDSplit(strucMat[i]).second);
138  DDMaterial strucMatter(strucName);
139  DDLogicalPart strucLogic(DDName(name, idNameSpace), strucMatter, solid);
140 
141  DDTranslation r2(0, 0, (dz-diskDz));
142  cpv.position(DDName(name,idNameSpace), diskName, i+1, r2, DDRotation());
143  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: "
144  << DDName(name,idNameSpace) << " number " << i+1
145  << " positioned in " << diskName
146  << " at " << r2 << " with no rotation";
147 
148  //Now the radial cable
149  name = "TIBRadCable" + dbl_to_string(i);
150  double rv = layRin[i]+0.5*deltaR;
151  std::vector<double> pgonZ;
152  pgonZ.push_back(-0.5*cableT);
153  pgonZ.push_back(cableT*(rv/rMax-0.5));
154  pgonZ.push_back(0.5*cableT);
155  std::vector<double> pgonRmin;
156  pgonRmin.push_back(rv);
157  pgonRmin.push_back(rv);
158  pgonRmin.push_back(rv);
159  std::vector<double> pgonRmax;
160  pgonRmax.push_back(rMax);
161  pgonRmax.push_back(rMax);
162  pgonRmax.push_back(rv);
163  solid = DDSolidFactory::polycone(DDName(name, idNameSpace), 0,
164  CLHEP::twopi,pgonZ, pgonRmin, pgonRmax);
165  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: "
166  << DDName(name, idNameSpace)
167  << " Polycone made of " << cableMat[i]
168  << " from 0 to " << CLHEP::twopi/CLHEP::deg
169  << " and with " << pgonZ.size() << " sections";
170  for (unsigned int ii = 0; ii <pgonZ.size(); ii++)
171  LogDebug("TIBGeom") << "\t" << "\tZ = " << pgonZ[ii] << "\tRmin = "
172  << pgonRmin[ii] << "\tRmax = " << pgonRmax[ii];
173  DDName cableName(DDSplit(cableMat[i]).first,DDSplit(cableMat[i]).second);
174  LogDebug("TIBGeom") << " material cableName " << i << " " << cableName;
175  DDMaterial cableMatter(cableName);
176  DDLogicalPart cableLogic(DDName(name, idNameSpace), cableMatter, solid);
177 
178  DDTranslation r3(0, 0, (diskDz-(i+0.5)*cableT));
179  cpv.position(DDName(name,idNameSpace), diskName, i+1, r3, DDRotation());
180  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: "
181  << DDName(name,idNameSpace) << " number " << i+1
182  << " positioned in " << diskName << " at "
183  << r3 << " with no rotation";
184 
185  }
186  //
187 
188  // fill only layers in layers list
189  empty=true;
190  for(unsigned int j=0; j<layers.size(); j++) {
191  if(i+1==(unsigned int)layers[j]) {
192  empty=false;
193  }
194  }
195 
196  if(!empty) {
197  //Now the last open zone
198  unsigned int i = layRin.size();
199  rin = layRin[i-1]+0.5*(deltaR+cylinderT)+supportDR;
200  rout = rMax;
201  name = "TIBOpenZone" + dbl_to_string(i);
202  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), dz, rin,
203  rout, 0, CLHEP::twopi);
204  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: "
205  << DDName(name, idNameSpace) << " Tubs made of "
206  << strucMat[i] << " from 0 to "
207  << CLHEP::twopi/CLHEP::deg << " with Rin " << rin
208  << " Rout " << rout << " ZHalf " << dz;
209  DDName strucName(DDSplit(strucMat[i]).first,DDSplit(strucMat[i]).second);
210  DDMaterial strucMatter(strucName);
211  DDLogicalPart strucLogic(DDName(name, idNameSpace), strucMatter, solid);
212 
213  DDTranslation r2(0, 0, (dz-diskDz));
214  cpv.position(DDName(name,idNameSpace), diskName, i+1, r2, DDRotation());
215  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC test: "
216  << DDName(name,idNameSpace) << " number " << i+1
217  << " positioned in " << diskName
218  << " at " << r2 << " with no rotation";
219  }
220  }
221  LogDebug("TIBGeom") << "<<== End of DDTIBRadCableAlgo_MTCC construction ...";
222 
223 }
#define LogDebug(id)
std::vector< double > layers
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
static DDSolid polycone(const DDName &name, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polycone (refere to Geant3 or Geant4 documentation)
Definition: DDSolid.cc:656
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
int ii
Definition: cuy.py:588
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
std::vector< std::string > strucMat
U second(std::pair< T, U > const &p)
std::vector< std::string > cableMat
int j
Definition: DBlmapReader.cc:9
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
std::vector< double > layRin
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:788
bool first
Definition: L1TdeRCT.cc:79
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
void DDTIBRadCableAlgo_MTCC::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 27 of file DDTIBRadCableAlgo_MTCC.cc.

References cableMat, cableT, cylinderT, deltaR, i, idNameSpace, layers, layRin, LogDebug, DDCurrentNamespace::ns(), dbtoconf::parent, rMax, rMin, strucMat, supportDR, supportMat, and supportT.

31  {
32 
34  unsigned int i;
35  DDName parentName = parent().name();
36  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: Parent " << parentName
37  << " NameSpace " << idNameSpace;
38 
39  rMin = nArgs["RMin"];
40  rMax = nArgs["RMax"];
41  layRin = vArgs["RadiusLo"];
42  deltaR = nArgs["DeltaR"];
43  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: Disk Rmin " << rMin
44  << "\tRMax " << rMax << "\tSeparation of layers "
45  << deltaR <<" with " << layRin.size() <<" layers at R =";
46  for (i = 0; i < layRin.size(); i++)
47  LogDebug("TIBGeom") << " " << i << " : " << layRin[i];
48 
49  cylinderT = nArgs["CylinderThick"];
50  supportT = nArgs["SupportThick"];
51  supportDR = nArgs["SupportDR"];
52  supportMat = sArgs["SupportMaterial"];
53  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: SupportCylinder "
54  << "Thickness " << cylinderT << "\tSupportDisk "
55  << "Thickness " << supportT << "\tExtra width along R "
56  << supportDR << "\tMaterial: " << supportMat;
57 
58  cableT = nArgs["CableThick"];
59  cableMat = vsArgs["CableMaterial"];
60  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: Cable Thickness "
61  << cableT << " with materials: ";
62  for (i = 0; i < cableMat.size(); i++)
63  LogDebug("TIBGeom") << " " << i << " : " << cableMat[i];
64 
65  strucMat = vsArgs["StructureMaterial"];
66  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: " << strucMat.size()
67  << " materials for open structure:";
68  for (i=0; i<strucMat.size(); i++)
69  LogDebug("TIBGeom") << " " << i << " : " << strucMat[i];
70 
71  layers = vArgs["Layers"];
72  LogDebug("TIBGeom") << "DDTIBRadCableAlgo_MTCC debug: " << layers.size()
73  << " layers:";
74  for (i=0; i<layers.size(); i++)
75  LogDebug("TIBGeom") << " " << i << " : " << layers[i];
76 
77 }
#define LogDebug(id)
std::vector< double > layers
int i
Definition: DBlmapReader.cc:9
list parent
Definition: dbtoconf.py:74
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
static std::string & ns()
std::vector< std::string > strucMat
std::vector< std::string > cableMat
std::vector< double > layRin

Member Data Documentation

std::vector<std::string> DDTIBRadCableAlgo_MTCC::cableMat
private

Definition at line 37 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::cableT
private

Definition at line 36 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::cylinderT
private

Definition at line 32 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::deltaR
private

Definition at line 31 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::string DDTIBRadCableAlgo_MTCC::idNameSpace
private

Definition at line 26 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::vector<double> DDTIBRadCableAlgo_MTCC::layers
private

Definition at line 39 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::vector<double> DDTIBRadCableAlgo_MTCC::layRin
private

Definition at line 30 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::rMax
private

Definition at line 29 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::rMin
private

Definition at line 28 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDTIBRadCableAlgo_MTCC::strucMat
private

Definition at line 38 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::supportDR
private

Definition at line 34 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

std::string DDTIBRadCableAlgo_MTCC::supportMat
private

Definition at line 35 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().

double DDTIBRadCableAlgo_MTCC::supportT
private

Definition at line 33 of file DDTIBRadCableAlgo_MTCC.h.

Referenced by execute(), and initialize().