CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDPixBarLayerUpgradeAlgo Class Reference
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
 
string coolMat
 
string coolMatHalf
 
double coolRadius
 
double coolThick
 
string genMat
 
string idNameSpace
 
string ladder
 
double ladderOffset
 
double ladderThick
 
double ladderWidth
 
double layerDz
 
int number
 
int outerFirst
 
double phiFineTune
 
double rInnerFineTune
 
double rOuterFineTune
 
string tubeMat
 
string tubeMatHalf
 

Detailed Description

Definition at line 26 of file DDPixBarLayerUpgradeAlgo.cc.

Constructor & Destructor Documentation

◆ DDPixBarLayerUpgradeAlgo()

DDPixBarLayerUpgradeAlgo::DDPixBarLayerUpgradeAlgo ( )

Definition at line 65 of file DDPixBarLayerUpgradeAlgo.cc.

References LogDebug.

65  {
66  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo info: Creating an instance";
67 }
#define LogDebug(id)

◆ ~DDPixBarLayerUpgradeAlgo()

DDPixBarLayerUpgradeAlgo::~DDPixBarLayerUpgradeAlgo ( )
override

Definition at line 69 of file DDPixBarLayerUpgradeAlgo.cc.

69 {}

Member Function Documentation

◆ execute()

void DDPixBarLayerUpgradeAlgo::execute ( DDCompactView cpv)
override

Definition at line 113 of file DDPixBarLayerUpgradeAlgo.cc.

References filterCSVwithJSON::copy, funct::cos(), DDBase< N, C >::ddname(), DDrot(), DDSplit(), l1ctLayer1_cff::dr, first, mps_fire::i, versionedElectronIDProducer_cfi::idName, PVValHelper::ladder, phase1PixelTopology::layer, LogDebug, Skims_PA_cff::name, DDName::name(), DDBase< N, C >::name(), contentValuesFiles::number, class-composition::parent, pi, DDCompactView::position(), makeMuonMisalignmentScenario::rot, edm::second(), funct::sin(), mathSSE::sqrt(), cond::impl::to_string(), DDSolidFactory::tubs(), and testProducerWithPsetDescEmpty_cfi::x2.

113  {
114  DDName mother = parent().name();
115  const string& idName = mother.name();
116 
117  double dphi = CLHEP::twopi / number;
118  double x2 = coolDist * sin(0.5 * dphi);
119  double rtmi = coolDist * cos(0.5 * dphi) - (coolRadius + ladderThick) + rInnerFineTune;
120  double rmxh = coolDist * cos(0.5 * dphi) + (coolRadius + ladderThick + ladderOffset) + rOuterFineTune;
121  double rtmx = sqrt(rmxh * rmxh + ladderWidth * ladderWidth / 4);
122  DDSolid solid = DDSolidFactory::tubs(DDName(idName, idNameSpace), 0.5 * layerDz, rtmi, rtmx, 0, CLHEP::twopi);
123  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << DDName(idName, idNameSpace) << " Tubs made of "
124  << genMat << " from 0 to " << CLHEP::twopi / CLHEP::deg << " with Rin " << rtmi << " Rout "
125  << rtmx << " ZHalf " << 0.5 * layerDz;
127  DDMaterial matter(matname);
128  DDLogicalPart layer(solid.ddname(), matter, solid);
129 
130  // Full Tubes
131  string name = idName + "CoolTube";
132  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), 0.5 * coolDz, 0, coolRadius, 0, CLHEP::twopi);
133  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << tubeMat
134  << " from 0 to " << CLHEP::twopi / CLHEP::deg << " with Rout " << coolRadius << " ZHalf "
135  << 0.5 * coolDz;
137  DDLogicalPart coolTube(solid.ddname(), matter, solid);
138 
139  // Half Tubes
140  name = idName + "CoolTubeHalf";
142  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << tubeMatHalf
143  << " from 0 to " << CLHEP::twopi / CLHEP::deg << " with Rout " << coolRadius << " ZHalf "
144  << 0.5 * coolDz;
146  DDLogicalPart coolTubeHalf(solid.ddname(), matter, solid);
147 
148  // Full Coolant
149  name = idName + "Coolant";
150  solid = DDSolidFactory::tubs(DDName(name, idNameSpace), 0.5 * coolDz, 0, coolRadius - coolThick, 0, CLHEP::twopi);
151  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << tubeMat
152  << " from 0 to " << CLHEP::twopi / CLHEP::deg << " with Rout " << coolRadius - coolThick
153  << " ZHalf " << 0.5 * coolDz;
155  DDLogicalPart cool(solid.ddname(), matter, solid);
156  cpv.position(cool, coolTube, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
157  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << cool.name() << " number 1 positioned in "
158  << coolTube.name() << " at (0,0,0) with no rotation";
159 
160  // Half Coolant
161  name = idName + "CoolantHalf";
163  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << solid.name() << " Tubs made of " << tubeMatHalf
164  << " from 0 to " << CLHEP::twopi / CLHEP::deg << " with Rout " << coolRadius - coolThick
165  << " ZHalf " << 0.5 * coolDz;
167  DDLogicalPart coolHalf(solid.ddname(), matter, solid);
168  cpv.position(coolHalf, coolTubeHalf, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
169  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << cool.name() << " number 1 positioned in "
170  << coolTube.name() << " at (0,0,0) with no rotation";
171 
172  DDName ladderFull(DDSplit(ladder).first, DDSplit(ladder).second);
173  int copy = 1, iup = (-1) * outerFirst;
174  int copyoffset = number + 2;
175  for (int i = 1; i < number + 1; i++) {
176  double phi = i * dphi + 90 * CLHEP::deg - 0.5 * dphi + phiFineTune; //to start with the interface ladder
177  double phix, phiy, rrr, rrroffset;
178  string rots;
179  DDTranslation tran;
180  DDRotation rot;
181  iup = -iup;
182  double dr;
183  if ((i == 1) || (i == number / 2 + 1)) {
184  dr = coolRadius + 0.5 * ladderThick + ladderOffset; //interface ladder offset
185  } else {
186  dr = coolRadius + 0.5 * ladderThick;
187  }
188  if (i % 2 == 1) {
189  rrr = coolDist * cos(0.5 * dphi) + iup * dr + rOuterFineTune;
190  } else {
191  rrr = coolDist * cos(0.5 * dphi) + iup * dr + rInnerFineTune;
192  }
193  tran = DDTranslation(rrr * cos(phi), rrr * sin(phi), 0);
194  rots = idName + to_string(copy);
195  if (iup > 0)
196  phix = phi - 90 * CLHEP::deg;
197  else
198  phix = phi + 90 * CLHEP::deg;
199  phiy = phix + 90. * CLHEP::deg;
200  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: Creating a new "
201  << "rotation: " << rots << "\t90., " << phix / CLHEP::deg << ", 90.," << phiy / CLHEP::deg
202  << ", 0, 0";
203  rot = DDrot(DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
204  cpv.position(ladderFull, layer, copy, tran, rot);
205  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << ladderFull << " number " << copy << " positioned in "
206  << layer.name() << " at " << tran << " with " << rot;
207  copy++;
208  rrr = coolDist * cos(0.5 * dphi) + coolRadius / 2.;
209  rots = idName + to_string(i + 100);
210  phix = phi + 90. * CLHEP::deg;
211  if (iup < 0)
212  phix += dphi;
213  phiy = phix + 90. * CLHEP::deg;
214  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: Creating a new "
215  << "rotation: " << rots << "\t90., " << phix / CLHEP::deg << ", 90.," << phiy / CLHEP::deg
216  << ", 0, 0";
217  tran = DDTranslation(rrr * cos(phi) - x2 * sin(phi), rrr * sin(phi) + x2 * cos(phi), 0);
218  rot = DDrot(DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
219  cpv.position(coolTubeHalf, layer, i + 1, tran, rot);
220  if ((i == 1) || (i == number / 2 + 1)) {
221  rrroffset = coolDist * cos(0.5 * dphi) + iup * ladderOffset + rOuterFineTune;
222  tran = DDTranslation(
223  rrroffset * cos(phi) - cool1Offset * sin(phi), rrroffset * sin(phi) + cool1Offset * cos(phi), 0);
224  cpv.position(coolTube, layer, copyoffset, tran, DDRotation());
225  copyoffset++;
226  tran = DDTranslation(
227  rrroffset * cos(phi) - cool2Offset * sin(phi), rrroffset * sin(phi) + cool2Offset * cos(phi), 0);
228  cpv.position(coolTube, layer, copyoffset, tran, DDRotation());
229  copyoffset++;
230  }
231  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << coolTube.name() << " number " << i + 1
232  << " positioned in " << layer.name() << " at " << tran << " with " << rot;
233  }
234 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::string to_string(const V &value)
Definition: OMSAccess.h:71
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
constexpr std::array< uint8_t, layerIndexSize > layer
const Double_t pi
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
U second(std::pair< T, U > const &p)
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
T sqrt(T t)
Definition: SSEVec.h:19
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:67
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:667
const N & name() const
Definition: DDBase.h:59
const N & ddname() const
Definition: DDBase.h:61
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
#define LogDebug(id)

◆ initialize()

void DDPixBarLayerUpgradeAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)
override

Definition at line 71 of file DDPixBarLayerUpgradeAlgo.cc.

References createfilelist::int, PVValHelper::ladder, LogDebug, DDCurrentNamespace::ns(), contentValuesFiles::number, and class-composition::parent.

75  {
77  DDName parentName = parent().name();
78 
79  genMat = sArgs["GeneralMaterial"];
80  number = int(nArgs["Ladders"]);
81  layerDz = nArgs["LayerDz"];
82  coolDz = nArgs["CoolDz"];
83  coolThick = nArgs["CoolThick"];
84  coolRadius = nArgs["CoolRadius"];
85  coolDist = nArgs["CoolDist"];
86  cool1Offset = nArgs["Cool1Offset"];
87  cool2Offset = nArgs["Cool2Offset"];
88  coolMat = sArgs["CoolMaterial"];
89  tubeMat = sArgs["CoolTubeMaterial"];
90  coolMatHalf = sArgs["CoolMaterialHalf"];
91  tubeMatHalf = sArgs["CoolTubeMaterialHalf"];
92  phiFineTune = nArgs["PitchFineTune"];
93  rOuterFineTune = nArgs["OuterOffsetFineTune"];
94  rInnerFineTune = nArgs["InnerOffsetFineTune"];
95 
96  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo debug: Parent " << parentName << " NameSpace " << idNameSpace
97  << "\n"
98  << "\tLadders " << number << "\tGeneral Material " << genMat << "\tLength " << layerDz
99  << "\tSpecification of Cooling Pieces:\n"
100  << "\tLength " << coolDz << " Thickness of Shell " << coolThick << " Radial distance "
101  << coolDist << " Materials " << coolMat << ", " << tubeMat;
102 
103  ladder = sArgs["LadderName"];
104  ladderWidth = nArgs["LadderWidth"];
105  ladderThick = nArgs["LadderThick"];
106  ladderOffset = nArgs["LadderOffset"];
107  outerFirst = int(nArgs["OuterFirst"]);
108 
109  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo debug: Full Ladder " << ladder << " width/thickness "
110  << ladderWidth << ", " << ladderThick;
111 }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
static std::string & ns()
#define LogDebug(id)

Member Data Documentation

◆ cool1Offset

double DDPixBarLayerUpgradeAlgo::cool1Offset
private

Definition at line 49 of file DDPixBarLayerUpgradeAlgo.cc.

◆ cool2Offset

double DDPixBarLayerUpgradeAlgo::cool2Offset
private

Definition at line 50 of file DDPixBarLayerUpgradeAlgo.cc.

◆ coolDist

double DDPixBarLayerUpgradeAlgo::coolDist
private

Definition at line 48 of file DDPixBarLayerUpgradeAlgo.cc.

◆ coolDz

double DDPixBarLayerUpgradeAlgo::coolDz
private

Definition at line 45 of file DDPixBarLayerUpgradeAlgo.cc.

◆ coolMat

string DDPixBarLayerUpgradeAlgo::coolMat
private

Definition at line 51 of file DDPixBarLayerUpgradeAlgo.cc.

◆ coolMatHalf

string DDPixBarLayerUpgradeAlgo::coolMatHalf
private

Definition at line 53 of file DDPixBarLayerUpgradeAlgo.cc.

◆ coolRadius

double DDPixBarLayerUpgradeAlgo::coolRadius
private

Definition at line 47 of file DDPixBarLayerUpgradeAlgo.cc.

◆ coolThick

double DDPixBarLayerUpgradeAlgo::coolThick
private

Definition at line 46 of file DDPixBarLayerUpgradeAlgo.cc.

◆ genMat

string DDPixBarLayerUpgradeAlgo::genMat
private

Definition at line 42 of file DDPixBarLayerUpgradeAlgo.cc.

◆ idNameSpace

string DDPixBarLayerUpgradeAlgo::idNameSpace
private

Definition at line 41 of file DDPixBarLayerUpgradeAlgo.cc.

◆ ladder

string DDPixBarLayerUpgradeAlgo::ladder
private

Definition at line 55 of file DDPixBarLayerUpgradeAlgo.cc.

◆ ladderOffset

double DDPixBarLayerUpgradeAlgo::ladderOffset
private

Definition at line 58 of file DDPixBarLayerUpgradeAlgo.cc.

◆ ladderThick

double DDPixBarLayerUpgradeAlgo::ladderThick
private

Definition at line 57 of file DDPixBarLayerUpgradeAlgo.cc.

◆ ladderWidth

double DDPixBarLayerUpgradeAlgo::ladderWidth
private

Definition at line 56 of file DDPixBarLayerUpgradeAlgo.cc.

◆ layerDz

double DDPixBarLayerUpgradeAlgo::layerDz
private

Definition at line 44 of file DDPixBarLayerUpgradeAlgo.cc.

◆ number

int DDPixBarLayerUpgradeAlgo::number
private

Definition at line 43 of file DDPixBarLayerUpgradeAlgo.cc.

◆ outerFirst

int DDPixBarLayerUpgradeAlgo::outerFirst
private

Definition at line 59 of file DDPixBarLayerUpgradeAlgo.cc.

◆ phiFineTune

double DDPixBarLayerUpgradeAlgo::phiFineTune
private

Definition at line 60 of file DDPixBarLayerUpgradeAlgo.cc.

◆ rInnerFineTune

double DDPixBarLayerUpgradeAlgo::rInnerFineTune
private

Definition at line 62 of file DDPixBarLayerUpgradeAlgo.cc.

◆ rOuterFineTune

double DDPixBarLayerUpgradeAlgo::rOuterFineTune
private

Definition at line 61 of file DDPixBarLayerUpgradeAlgo.cc.

◆ tubeMat

string DDPixBarLayerUpgradeAlgo::tubeMat
private

Definition at line 52 of file DDPixBarLayerUpgradeAlgo.cc.

◆ tubeMatHalf

string DDPixBarLayerUpgradeAlgo::tubeMatHalf
private

Definition at line 54 of file DDPixBarLayerUpgradeAlgo.cc.