CMS 3D CMS Logo

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

#include <DDPixBarLayerUpgradeAlgo.h>

Inheritance diagram for DDPixBarLayerUpgradeAlgo:

Public Member Functions

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

Private Attributes

double cool1Offset
 
double cool2Offset
 
double coolDist
 
double coolDz
 
std::string coolMat
 
std::string coolMatHalf
 
double coolRadius
 
double coolThick
 
std::string genMat
 
std::string idNameSpace
 
std::string ladder
 
double ladderOffset
 
double ladderThick
 
double ladderWidth
 
double layerDz
 
int number
 
int outerFirst
 
double phiFineTune
 
double rInnerFineTune
 
double rOuterFineTune
 
std::string tubeMat
 
std::string tubeMatHalf
 

Detailed Description

Definition at line 10 of file DDPixBarLayerUpgradeAlgo.h.

Constructor & Destructor Documentation

DDPixBarLayerUpgradeAlgo::DDPixBarLayerUpgradeAlgo ( )

Definition at line 20 of file DDPixBarLayerUpgradeAlgo.cc.

References LogDebug.

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

Definition at line 24 of file DDPixBarLayerUpgradeAlgo.cc.

24 {}

Member Function Documentation

void DDPixBarLayerUpgradeAlgo::execute ( DDCompactView cpv)
override

Definition at line 72 of file DDPixBarLayerUpgradeAlgo.cc.

References cool1Offset, cool2Offset, coolDist, coolDz, coolMat, coolMatHalf, coolRadius, coolThick, popcon2dropbox::copy(), funct::cos(), DDBase< N, C >::ddname(), DDrot(), DDSplit(), runTauDisplay::dr, plotBeamSpotDB::first, genMat, mps_fire::i, trivialCutFlow_cff::idName, idNameSpace, ladder, ladderOffset, ladderThick, ladderWidth, layerDz, LogDebug, DDName::name(), dataset::name, DDBase< N, C >::name(), number, outerFirst, class-composition::parent, phi, phiFineTune, pi, DDCompactView::position(), rInnerFineTune, makeMuonMisalignmentScenario::rot, rOuterFineTune, edm::second(), funct::sin(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, tubeMat, tubeMatHalf, and DDSolidFactory::tubs().

72  {
73 
74  DDName mother = parent().name();
75  std::string idName = DDSplit(mother).first;
76 
77  double dphi = CLHEP::twopi/number;
78  double x2 = coolDist*sin(0.5*dphi);
79  double rtmi = coolDist*cos(0.5*dphi)-(coolRadius+ladderThick)+rInnerFineTune;
81  double rtmx = sqrt(rmxh*rmxh+ladderWidth*ladderWidth/4);
83  rtmi, rtmx, 0, CLHEP::twopi);
84  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: "
85  << DDName(idName, idNameSpace) << " Tubs made of "
86  << genMat << " from 0 to " << CLHEP::twopi/CLHEP::deg
87  << " with Rin " << rtmi << " Rout " << rtmx
88  << " ZHalf " << 0.5*layerDz;
90  DDMaterial matter(matname);
91  DDLogicalPart layer(solid.ddname(), matter, solid);
92 
93  // Full Tubes
94  std::string name = idName + "CoolTube";
95  solid = DDSolidFactory::tubs(DDName(name,idNameSpace), 0.5*coolDz,
96  0, coolRadius, 0, CLHEP::twopi);
97  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " <<solid.name()
98  << " Tubs made of " << tubeMat << " from 0 to " <<
99  CLHEP::twopi/CLHEP::deg << " with Rout " << coolRadius <<
100  " ZHalf " << 0.5*coolDz;
101  matter = DDMaterial(DDName(DDSplit(tubeMat).first, DDSplit(tubeMat).second));
102  DDLogicalPart coolTube(solid.ddname(), matter, solid);
103 
104  // Half Tubes
105  name = idName + "CoolTubeHalf";
106  solid = DDSolidFactory::tubs(DDName(name,idNameSpace), 0.5*coolDz,
107  0, coolRadius, 0, CLHEP::pi);
108  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " <<solid.name()
109  << " Tubs made of " << tubeMatHalf << " from 0 to " <<
110  CLHEP::twopi/CLHEP::deg << " with Rout " << coolRadius <<
111  " ZHalf " << 0.5*coolDz;
113  DDLogicalPart coolTubeHalf(solid.ddname(), matter, solid);
114 
115  // Full Coolant
116  name = idName + "Coolant";
117  solid = DDSolidFactory::tubs(DDName(name,idNameSpace), 0.5*coolDz,
118  0, coolRadius-coolThick, 0, CLHEP::twopi);
119  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " <<solid.name()
120  << " Tubs made of " << tubeMat << " from 0 to " <<
121  CLHEP::twopi/CLHEP::deg << " with Rout " << coolRadius-coolThick <<
122  " ZHalf " << 0.5*coolDz;
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") << "DDPixBarLayerUpgradeAlgo test: " << cool.name()
127  << " number 1 positioned in " << coolTube.name()
128  << " at (0,0,0) with no rotation";
129 
130  // Half Coolant
131  name = idName + "CoolantHalf";
132  solid = DDSolidFactory::tubs(DDName(name,idNameSpace), 0.5*coolDz,
134  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " <<solid.name()
135  << " Tubs made of " << tubeMatHalf << " from 0 to " <<
136  CLHEP::twopi/CLHEP::deg << " with Rout " << coolRadius-coolThick <<
137  " ZHalf " << 0.5*coolDz;
139  DDLogicalPart coolHalf(solid.ddname(), matter, solid);
140  cpv.position (coolHalf, coolTubeHalf, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
141  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << cool.name()
142  << " number 1 positioned in " << coolTube.name()
143  << " at (0,0,0) with no rotation";
144 
145  DDName ladderFull(DDSplit(ladder).first, DDSplit(ladder).second);
146  int copy=1, iup=(-1)*outerFirst;
147  int copyoffset=number+2;
148  for (int i=1; i<number+1; i++) {
149  double phi = i*dphi+90*CLHEP::deg-0.5*dphi+phiFineTune; //to start with the interface ladder
150  double phix, phiy, rrr, rrroffset;
151  std::string rots;
152  DDTranslation tran;
153  DDRotation rot;
154  iup =-iup;
155  double dr;
156  if ((i==1)||(i==number/2+1)) {
157  dr=coolRadius+0.5*ladderThick+ladderOffset; //interface ladder offset
158  } else {
159  dr=coolRadius+0.5*ladderThick;
160  }
161  if(i % 2 == 1) {
162  rrr = coolDist*cos(0.5*dphi)+iup*dr+rOuterFineTune;
163  } else {
164  rrr = coolDist*cos(0.5*dphi)+iup*dr+rInnerFineTune;
165  }
166  tran = DDTranslation(rrr*cos(phi), rrr*sin(phi), 0);
167  rots = idName + std::to_string(copy);
168  if (iup > 0) phix = phi-90*CLHEP::deg;
169  else phix = phi+90*CLHEP::deg;
170  phiy = phix+90.*CLHEP::deg;
171  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: Creating a new "
172  << "rotation: " << rots << "\t90., " << phix/CLHEP::deg
173  << ", 90.," << phiy/CLHEP::deg << ", 0, 0";
174  rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg, phiy, 0.,0.);
175  cpv.position (ladderFull, layer, copy, tran, rot);
176  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << ladderFull
177  << " number " << copy << " positioned in "
178  << layer.name() << " at " << tran << " with "
179  << rot;
180  copy++;
181  rrr = coolDist*cos(0.5*dphi) + coolRadius/2.;
182  rots = idName + std::to_string(i+100);
183  phix = phi + 90.*CLHEP::deg;
184  if(iup < 0) phix += dphi;
185  phiy = phix+90.*CLHEP::deg;
186  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: Creating a new "
187  << "rotation: " << rots << "\t90., " << phix/CLHEP::deg
188  << ", 90.," << phiy/CLHEP::deg << ", 0, 0";
189  tran = DDTranslation(rrr*cos(phi)-x2*sin(phi), rrr*sin(phi)+x2*cos(phi), 0);
190  rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg, phiy, 0.,0.);
191  cpv.position (coolTubeHalf, layer, i+1, tran, rot);
192  if ((i==1)||(i==number/2+1)){
193  rrroffset = coolDist*cos(0.5*dphi)+iup*ladderOffset + rOuterFineTune;
194  tran = DDTranslation(rrroffset*cos(phi)-cool1Offset*sin(phi),
195  rrroffset*sin(phi)+cool1Offset*cos(phi), 0);
196  cpv.position (coolTube, layer, copyoffset, tran, DDRotation());
197  copyoffset++;
198  tran = DDTranslation(rrroffset*cos(phi)-cool2Offset*sin(phi),
199  rrroffset*sin(phi)+cool2Offset*cos(phi), 0);
200  cpv.position (coolTube, layer, copyoffset, tran, DDRotation());
201  copyoffset++;
202  }
203  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << coolTube.name()
204  << " number " << i+1 << " positioned in "
205  << layer.name() << " at " << tran << " with "<< rot;
206  }
207 }
#define LogDebug(id)
const N & name() const
Definition: DDBase.h:78
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
A DDSolid represents the shape of a part.
Definition: DDSolid.h:38
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
const Double_t pi
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
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:92
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:986
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
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 N & ddname() const
Definition: DDBase.h:80
void DDPixBarLayerUpgradeAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 26 of file DDPixBarLayerUpgradeAlgo.cc.

References cool1Offset, cool2Offset, coolDist, coolDz, coolMat, coolMatHalf, coolRadius, coolThick, genMat, idNameSpace, createfilelist::int, ladder, ladderOffset, ladderThick, ladderWidth, layerDz, LogDebug, DDCurrentNamespace::ns(), number, outerFirst, class-composition::parent, phiFineTune, rInnerFineTune, rOuterFineTune, tubeMat, and tubeMatHalf.

30  {
31 
33  DDName parentName = parent().name();
34 
35  genMat = sArgs["GeneralMaterial"];
36  number = int(nArgs["Ladders"]);
37  layerDz = nArgs["LayerDz"];
38  coolDz = nArgs["CoolDz"];
39  coolThick = nArgs["CoolThick"];
40  coolRadius= nArgs["CoolRadius"];
41  coolDist = nArgs["CoolDist"];
42  cool1Offset = nArgs["Cool1Offset"];
43  cool2Offset = nArgs["Cool2Offset"];
44  coolMat = sArgs["CoolMaterial"];
45  tubeMat = sArgs["CoolTubeMaterial"];
46  coolMatHalf = sArgs["CoolMaterialHalf"];
47  tubeMatHalf = sArgs["CoolTubeMaterialHalf"];
48  phiFineTune = nArgs["PitchFineTune"];
49  rOuterFineTune = nArgs["OuterOffsetFineTune"];
50  rInnerFineTune = nArgs["InnerOffsetFineTune"];
51 
52 
53  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo debug: Parent " << parentName
54  << " NameSpace " << idNameSpace << "\n"
55  << "\tLadders " << number << "\tGeneral Material "
56  << genMat << "\tLength " << layerDz << "\tSpecification of Cooling Pieces:\n"
57  << "\tLength " << coolDz << " Thickness of Shell "
58  << coolThick << " Radial distance " << coolDist
59  << " Materials " << coolMat << ", " << tubeMat;
60 
61  ladder = sArgs["LadderName"];
62  ladderWidth = nArgs["LadderWidth"];
63  ladderThick = nArgs["LadderThick"];
64  ladderOffset = nArgs["LadderOffset"];
65  outerFirst = int(nArgs["OuterFirst"]);
66 
67  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo debug: Full Ladder "
68  << ladder << " width/thickness " << ladderWidth
69  << ", " << ladderThick;
70 }
#define LogDebug(id)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
static std::string & ns()

Member Data Documentation

double DDPixBarLayerUpgradeAlgo::cool1Offset
private

Definition at line 34 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::cool2Offset
private

Definition at line 35 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::coolDist
private

Definition at line 33 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::coolDz
private

Definition at line 30 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerUpgradeAlgo::coolMat
private

Definition at line 36 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerUpgradeAlgo::coolMatHalf
private

Definition at line 38 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::coolRadius
private

Definition at line 32 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::coolThick
private

Definition at line 31 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerUpgradeAlgo::genMat
private

Definition at line 27 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerUpgradeAlgo::idNameSpace
private

Definition at line 26 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerUpgradeAlgo::ladder
private

Definition at line 40 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::ladderOffset
private

Definition at line 43 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::ladderThick
private

Definition at line 42 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::ladderWidth
private

Definition at line 41 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::layerDz
private

Definition at line 29 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

int DDPixBarLayerUpgradeAlgo::number
private

Definition at line 28 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

int DDPixBarLayerUpgradeAlgo::outerFirst
private

Definition at line 44 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::phiFineTune
private

Definition at line 45 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::rInnerFineTune
private

Definition at line 47 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::rOuterFineTune
private

Definition at line 46 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerUpgradeAlgo::tubeMat
private

Definition at line 37 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerUpgradeAlgo::tubeMatHalf
private

Definition at line 39 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().