CMS 3D CMS Logo

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

#include <DDPixBarLayerAlgo.h>

Inheritance diagram for DDPixBarLayerAlgo:

Public Member Functions

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

Private Attributes

double coolDist
 
double coolDz
 
std::string coolMat
 
double coolSide
 
double coolThick
 
double coolWidth
 
std::string genMat
 
std::string idNameSpace
 
std::vector< std::string > ladder
 
std::vector< double > ladderThick
 
std::vector< double > ladderWidth
 
double layerDz
 
int number
 
double sensorEdge
 
std::string tubeMat
 

Detailed Description

Definition at line 10 of file DDPixBarLayerAlgo.h.

Constructor & Destructor Documentation

DDPixBarLayerAlgo::DDPixBarLayerAlgo ( )

Definition at line 20 of file DDPixBarLayerAlgo.cc.

References LogDebug.

20  {
21  LogDebug("PixelGeom") <<"DDPixBarLayerAlgo info: Creating an instance";
22 }
#define LogDebug(id)
DDPixBarLayerAlgo::~DDPixBarLayerAlgo ( )
override

Definition at line 24 of file DDPixBarLayerAlgo.cc.

24 {}

Member Function Documentation

void DDPixBarLayerAlgo::execute ( DDCompactView cpv)
override

Definition at line 68 of file DDPixBarLayerAlgo.cc.

References coolDist, coolDz, coolMat, coolSide, coolThick, coolWidth, popcon2dropbox::copy(), funct::cos(), DDBase< N, C >::ddname(), DDrot(), DDSplit(), runTauDisplay::dr, plotBeamSpotDB::first, genMat, mps_fire::i, trivialCutFlow_cff::idName, idNameSpace, ladder, ladderThick, ladderWidth, layerDz, LogDebug, DDName::name(), dataset::name, DDBase< N, C >::name(), number, class-composition::parent, phi, DDCompactView::position(), makeMuonMisalignmentScenario::rot, findQualityFiles::rr, edm::second(), sensorEdge, funct::sin(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, DDSolidFactory::trap(), tubeMat, DDSolidFactory::tubs(), globals_cff::x1, globals_cff::x2, and geometryCSVtoXML::xx.

68  {
69 
70  DDName mother = parent().name();
71  const std::string &idName = mother.name();
72 
73  double dphi = CLHEP::twopi/number;
74  double d2 = 0.5*coolWidth;
75  double d1 = d2 - coolSide*sin(0.5*dphi);
76  double x1 = (d1+d2)/(2.*sin(0.5*dphi));
77  double x2 = coolDist*sin(0.5*dphi);
78  double rmin = (coolDist-0.5*(d1+d2))*cos(0.5*dphi)-0.5*ladderThick[0];
79  double rmax = (coolDist+0.5*(d1+d2))*cos(0.5*dphi)+0.5*ladderThick[0];
80  double rmxh = rmax - 0.5*ladderThick[0] + ladderThick[1];
81  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Rmin/Rmax " << rmin
82  << ", " << rmax << " d1/d2 " << d1 << ", " << d2
83  << " x1/x2 " << x1 << ", " << x2;
84 
85  double rtmi = rmin + 0.5*ladderThick[0] - ladderThick[1];
86  double rtmx = sqrt(rmxh*rmxh+ladderWidth[1]*ladderWidth[1]);
88  rtmi, rtmx, 0, CLHEP::twopi);
89  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: "
90  << DDName(idName, idNameSpace) << " Tubs made of "
91  << genMat << " from 0 to " << CLHEP::twopi/CLHEP::deg
92  << " with Rin " << rtmi << " Rout " << rtmx
93  << " ZHalf " << 0.5*layerDz;
95  DDMaterial matter(matname);
96  DDLogicalPart layer(solid.ddname(), matter, solid);
97 
98  double rr = 0.5*(rmax+rmin);
99  double dr = 0.5*(rmax-rmin);
100  double h1 = 0.5*coolSide*cos(0.5*dphi);
101  std::string name = idName + "CoolTube";
102  solid = DDSolidFactory::trap(DDName(name,idNameSpace), 0.5*coolDz, 0, 0,
103  h1, d2, d1, 0, h1, d2, d1, 0);
104  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " <<solid.name()
105  << " Trap made of " << tubeMat << " of dimensions "
106  << 0.5*coolDz << ", 0, 0, " << h1 << ", " << d2
107  << ", " << d1 << ", 0, " << h1 << ", " << d2 << ", "
108  << d1 << ", 0";
109  matter = DDMaterial(DDName(DDSplit(tubeMat).first, DDSplit(tubeMat).second));
110  DDLogicalPart coolTube(solid.ddname(), matter, solid);
111 
112  name = idName + "Coolant";
113  h1 -= coolThick;
114  d1 -= coolThick;
115  d2 -= coolThick;
116  solid = DDSolidFactory::trap(DDName(name,idNameSpace), 0.5*coolDz, 0, 0,
117  h1, d2, d1, 0, h1, d2, d1, 0);
118  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " <<solid.name()
119  << " Trap made of " << coolMat << " of dimensions "
120  << 0.5*coolDz << ", 0, 0, " << h1 << ", " << d2
121  << ", " << d1 << ", 0, " << h1 << ", " << d2 << ", "
122  << d1 << ", 0";
123  matter = DDMaterial(DDName(DDSplit(coolMat).first, DDSplit(coolMat).second));
124  DDLogicalPart cool(solid.ddname(), matter, solid);
125  cpv.position(cool, coolTube, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
126  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << cool.name()
127  << " number 1 positioned in " << coolTube.name()
128  << " at (0,0,0) with no rotation";
129 
130  DDName ladderFull(DDSplit(ladder[0]).first, DDSplit(ladder[0]).second);
131  DDName ladderHalf(DDSplit(ladder[1]).first, DDSplit(ladder[1]).second);
132 
133  int nphi=number/2, copy=1, iup=-1;
134  double phi0 = 90*CLHEP::deg;
135  for (int i=0; i<number; i++) {
136 
137  double phi = phi0 + i*dphi;
138  double phix, phiy, rrr, xx;
139  std::string rots;
140  DDTranslation tran;
141  DDRotation rot;
142  if (i == 0 || i == nphi) {
143  rrr = rr + dr + 0.5*(ladderThick[1]-ladderThick[0]);
144  xx = (0.5*ladderWidth[1] - sensorEdge) * sin(phi);
145  tran = DDTranslation(xx, rrr*sin(phi), 0);
146  rots = idName + std::to_string(copy);
147  phix = phi-90*CLHEP::deg;
148  phiy = 90*CLHEP::deg+phix;
149  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new "
150  << "rotation: " << rots << "\t90., "
151  << phix/CLHEP::deg << ", 90.," << phiy/CLHEP::deg
152  << ", 0, 0";
153  rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg,
154  phiy, 0.,0.);
155  cpv.position(ladderHalf, layer, copy, tran, rot);
156  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << ladderHalf
157  << " number " << copy << " positioned in "
158  << layer.name() << " at " << tran << " with "
159  << rot;
160  copy++;
161  iup = -1;
162  rrr = rr - dr - 0.5*(ladderThick[1]-ladderThick[0]);
163  tran = DDTranslation(-xx, rrr*sin(phi), 0);
164  rots = idName + std::to_string(copy);
165  phix = phi+90*CLHEP::deg;
166  phiy = 90*CLHEP::deg+phix;
167  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new "
168  << "rotation: " << rots << "\t90., "
169  << phix/CLHEP::deg << ", 90.," << phiy/CLHEP::deg
170  << ", 0, 0";
171  rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg,
172  phiy, 0.,0.);
173  cpv.position(ladderHalf, layer, copy, tran, rot);
174  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << ladderHalf
175  << " number " << copy << " positioned in "
176  << layer.name() << " at " << tran << " with "
177  << rot;
178  copy++;
179  } else {
180  iup =-iup;
181  rrr = rr + iup*dr;
182  tran = DDTranslation(rrr*cos(phi), rrr*sin(phi), 0);
183  rots = idName + std::to_string(copy);
184  if (iup > 0) phix = phi-90*CLHEP::deg;
185  else phix = phi+90*CLHEP::deg;
186  phiy = phix+90.*CLHEP::deg;
187  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new "
188  << "rotation: " << rots << "\t90., "
189  << phix/CLHEP::deg << ", 90.," << phiy/CLHEP::deg
190  << ", 0, 0";
191  rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg,
192  phiy, 0.,0.);
193  cpv.position(ladderFull, layer, copy, tran, rot);
194  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << ladderFull
195  << " number " << copy << " positioned in "
196  << layer.name() << " at " << tran << " with "
197  << rot;
198  copy++;
199  }
200  rrr = coolDist*cos(0.5*dphi);
201  tran = DDTranslation(rrr*cos(phi)-x2*sin(phi),
202  rrr*sin(phi)+x2*cos(phi), 0);
203  rots = idName + std::to_string(i+100);
204  phix = phi+0.5*dphi;
205  if (iup > 0) phix += 180*CLHEP::deg;
206  phiy = phix+90.*CLHEP::deg;
207  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new "
208  << "rotation: " << rots << "\t90., "
209  << phix/CLHEP::deg << ", 90.," << phiy/CLHEP::deg
210  << ", 0, 0";
211  rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg,
212  phiy, 0.,0.);
213  cpv.position(coolTube, layer, i+1, tran, rot);
214  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << coolTube.name()
215  << " number " << i+1 << " positioned in "
216  << layer.name() << " at " << tran << " with "<< rot;
217  }
218 }
#define LogDebug(id)
const N & name() const
Definition: DDBase.h:74
def copy(args, dbName)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
std::string idNameSpace
std::vector< std::string > ladder
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)
T sqrt(T t)
Definition: SSEVec.h:18
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:80
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:865
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:792
std::vector< double > ladderWidth
std::vector< double > ladderThick
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
const std::string & name() const
Returns the name.
Definition: DDName.cc:53
const N & ddname() const
Definition: DDBase.h:76
void DDPixBarLayerAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 26 of file DDPixBarLayerAlgo.cc.

References coolDist, coolDz, coolMat, coolSide, coolThick, coolWidth, genMat, idNameSpace, createfilelist::int, ladder, ladderThick, ladderWidth, layerDz, LogDebug, DDCurrentNamespace::ns(), number, class-composition::parent, sensorEdge, and tubeMat.

30  {
31 
33  DDName parentName = parent().name();
34 
35  genMat = sArgs["GeneralMaterial"];
36  number = int(nArgs["Ladders"]);
37  layerDz = nArgs["LayerDz"];
38  sensorEdge= nArgs["SensorEdge"];
39  coolDz = nArgs["CoolDz"];
40  coolWidth = nArgs["CoolWidth"];
41  coolSide = nArgs["CoolSide"];
42  coolThick = nArgs["CoolThick"];
43  coolDist = nArgs["CoolDist"];
44  coolMat = sArgs["CoolMaterial"];
45  tubeMat = sArgs["CoolTubeMaterial"];
46 
47  LogDebug("PixelGeom") << "DDPixBarLayerAlgo debug: Parent " << parentName
48  << " NameSpace " << idNameSpace << "\n"
49  << "\tLadders " << number << "\tGeneral Material "
50  << genMat << "\tLength " << layerDz << "\tSensorEdge "
51  << sensorEdge << "\tSpecification of Cooling Pieces:\n"
52  << "\tLength " << coolDz << " Width " << coolWidth
53  << " Side " << coolSide << " Thickness of Shell "
54  << coolThick << " Radial distance " << coolDist
55  << " Materials " << coolMat << ", " << tubeMat;
56 
57  ladder = vsArgs["LadderName"];
58  ladderWidth = vArgs["LadderWidth"];
59  ladderThick = vArgs["LadderThick"];
60 
61  LogDebug("PixelGeom") << "DDPixBarLayerAlgo debug: Full Ladder "
62  << ladder[0] << " width/thickness " << ladderWidth[0]
63  << ", " << ladderThick[0] << "\tHalf Ladder "
64  << ladder[1] << " width/thickness " << ladderWidth[1]
65  << ", " << ladderThick[1];
66 }
#define LogDebug(id)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
std::string idNameSpace
static std::string & ns()
std::vector< std::string > ladder
std::vector< double > ladderWidth
std::vector< double > ladderThick

Member Data Documentation

double DDPixBarLayerAlgo::coolDist
private

Definition at line 35 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerAlgo::coolDz
private

Definition at line 31 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerAlgo::coolMat
private

Definition at line 36 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerAlgo::coolSide
private

Definition at line 33 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerAlgo::coolThick
private

Definition at line 34 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerAlgo::coolWidth
private

Definition at line 32 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerAlgo::genMat
private

Definition at line 27 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerAlgo::idNameSpace
private

Definition at line 26 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::vector<std::string> DDPixBarLayerAlgo::ladder
private

Definition at line 38 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDPixBarLayerAlgo::ladderThick
private

Definition at line 40 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::vector<double> DDPixBarLayerAlgo::ladderWidth
private

Definition at line 39 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerAlgo::layerDz
private

Definition at line 29 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

int DDPixBarLayerAlgo::number
private

Definition at line 28 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerAlgo::sensorEdge
private

Definition at line 30 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerAlgo::tubeMat
private

Definition at line 37 of file DDPixBarLayerAlgo.h.

Referenced by execute(), and initialize().