CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDPixBarLayerAlgo Class Reference
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
 
string coolMat
 
double coolSide
 
double coolThick
 
double coolWidth
 
string genMat
 
string idNameSpace
 
vector< string > ladder
 
vector< double > ladderThick
 
vector< double > ladderWidth
 
double layerDz
 
int number
 
double sensorEdge
 
string tubeMat
 

Detailed Description

Definition at line 26 of file DDPixBarLayerAlgo.cc.

Constructor & Destructor Documentation

◆ DDPixBarLayerAlgo()

DDPixBarLayerAlgo::DDPixBarLayerAlgo ( )

Definition at line 58 of file DDPixBarLayerAlgo.cc.

58 { LogDebug("PixelGeom") << "DDPixBarLayerAlgo info: Creating an instance"; }

References LogDebug.

◆ ~DDPixBarLayerAlgo()

DDPixBarLayerAlgo::~DDPixBarLayerAlgo ( )
override

Definition at line 60 of file DDPixBarLayerAlgo.cc.

60 {}

Member Function Documentation

◆ execute()

void DDPixBarLayerAlgo::execute ( DDCompactView cpv)
override

Definition at line 98 of file DDPixBarLayerAlgo.cc.

98  {
99  DDName mother = parent().name();
100  const string& idName = mother.name();
101 
102  double dphi = CLHEP::twopi / number;
103  double d2 = 0.5 * coolWidth;
104  double d1 = d2 - coolSide * sin(0.5 * dphi);
105  double x1 = (d1 + d2) / (2. * sin(0.5 * dphi));
106  double x2 = coolDist * sin(0.5 * dphi);
107  double rmin = (coolDist - 0.5 * (d1 + d2)) * cos(0.5 * dphi) - 0.5 * ladderThick[0];
108  double rmax = (coolDist + 0.5 * (d1 + d2)) * cos(0.5 * dphi) + 0.5 * ladderThick[0];
109  double rmxh = rmax - 0.5 * ladderThick[0] + ladderThick[1];
110  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Rmin/Rmax " << rmin << ", " << rmax << " d1/d2 " << d1 << ", " << d2
111  << " x1/x2 " << x1 << ", " << x2;
112 
113  double rtmi = rmin + 0.5 * ladderThick[0] - ladderThick[1];
114  double rtmx = sqrt(rmxh * rmxh + ladderWidth[1] * ladderWidth[1]);
115  DDSolid solid = DDSolidFactory::tubs(DDName(idName, idNameSpace), 0.5 * layerDz, rtmi, rtmx, 0, CLHEP::twopi);
116  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << DDName(idName, idNameSpace) << " Tubs made of " << genMat
117  << " from 0 to " << CLHEP::twopi / CLHEP::deg << " with Rin " << rtmi << " Rout " << rtmx
118  << " ZHalf " << 0.5 * layerDz;
120  DDMaterial matter(matname);
121  DDLogicalPart layer(solid.ddname(), matter, solid);
122 
123  double rr = 0.5 * (rmax + rmin);
124  double dr = 0.5 * (rmax - rmin);
125  double h1 = 0.5 * coolSide * cos(0.5 * dphi);
126  string name = idName + "CoolTube";
127  solid = DDSolidFactory::trap(DDName(name, idNameSpace), 0.5 * coolDz, 0, 0, h1, d2, d1, 0, h1, d2, d1, 0);
128  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << solid.name() << " Trap made of " << tubeMat
129  << " of dimensions " << 0.5 * coolDz << ", 0, 0, " << h1 << ", " << d2 << ", " << d1 << ", 0, "
130  << h1 << ", " << d2 << ", " << d1 << ", 0";
132  DDLogicalPart coolTube(solid.ddname(), matter, solid);
133 
134  name = idName + "Coolant";
135  h1 -= coolThick;
136  d1 -= coolThick;
137  d2 -= coolThick;
138  solid = DDSolidFactory::trap(DDName(name, idNameSpace), 0.5 * coolDz, 0, 0, h1, d2, d1, 0, h1, d2, d1, 0);
139  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << solid.name() << " Trap made of " << coolMat
140  << " of dimensions " << 0.5 * coolDz << ", 0, 0, " << h1 << ", " << d2 << ", " << d1 << ", 0, "
141  << h1 << ", " << d2 << ", " << d1 << ", 0";
143  DDLogicalPart cool(solid.ddname(), matter, solid);
144  cpv.position(cool, coolTube, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
145  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << cool.name() << " number 1 positioned in " << coolTube.name()
146  << " at (0,0,0) with no rotation";
147 
148  DDName ladderFull(DDSplit(ladder[0]).first, DDSplit(ladder[0]).second);
149  DDName ladderHalf(DDSplit(ladder[1]).first, DDSplit(ladder[1]).second);
150 
151  int nphi = number / 2, copy = 1, iup = -1;
152  double phi0 = 90 * CLHEP::deg;
153  for (int i = 0; i < number; i++) {
154  double phi = phi0 + i * dphi;
155  double phix, phiy, rrr, xx;
156  string rots;
157  DDTranslation tran;
158  DDRotation rot;
159  if (i == 0 || i == nphi) {
160  rrr = rr + dr + 0.5 * (ladderThick[1] - ladderThick[0]);
161  xx = (0.5 * ladderWidth[1] - sensorEdge) * sin(phi);
162  tran = DDTranslation(xx, rrr * sin(phi), 0);
163  rots = idName + to_string(copy);
164  phix = phi - 90 * CLHEP::deg;
165  phiy = 90 * CLHEP::deg + phix;
166  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new "
167  << "rotation: " << rots << "\t90., " << phix / CLHEP::deg << ", 90.," << phiy / CLHEP::deg
168  << ", 0, 0";
169  rot = DDrot(DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
170  cpv.position(ladderHalf, layer, copy, tran, rot);
171  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << ladderHalf << " number " << copy << " positioned in "
172  << layer.name() << " at " << tran << " with " << rot;
173  copy++;
174  iup = -1;
175  rrr = rr - dr - 0.5 * (ladderThick[1] - ladderThick[0]);
176  tran = DDTranslation(-xx, rrr * sin(phi), 0);
177  rots = idName + to_string(copy);
178  phix = phi + 90 * CLHEP::deg;
179  phiy = 90 * CLHEP::deg + phix;
180  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new "
181  << "rotation: " << rots << "\t90., " << phix / CLHEP::deg << ", 90.," << phiy / CLHEP::deg
182  << ", 0, 0";
183  rot = DDrot(DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
184  cpv.position(ladderHalf, layer, copy, tran, rot);
185  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << ladderHalf << " number " << copy << " positioned in "
186  << layer.name() << " at " << tran << " with " << rot;
187  copy++;
188  } else {
189  iup = -iup;
190  rrr = rr + iup * dr;
191  tran = DDTranslation(rrr * cos(phi), rrr * sin(phi), 0);
192  rots = idName + to_string(copy);
193  if (iup > 0)
194  phix = phi - 90 * CLHEP::deg;
195  else
196  phix = phi + 90 * CLHEP::deg;
197  phiy = phix + 90. * CLHEP::deg;
198  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new "
199  << "rotation: " << rots << "\t90., " << phix / CLHEP::deg << ", 90.," << phiy / CLHEP::deg
200  << ", 0, 0";
201  rot = DDrot(DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
202  cpv.position(ladderFull, layer, copy, tran, rot);
203  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << ladderFull << " number " << copy << " positioned in "
204  << layer.name() << " at " << tran << " with " << rot;
205  copy++;
206  }
207  rrr = coolDist * cos(0.5 * dphi);
208  tran = DDTranslation(rrr * cos(phi) - x2 * sin(phi), rrr * sin(phi) + x2 * cos(phi), 0);
209  rots = idName + to_string(i + 100);
210  phix = phi + 0.5 * dphi;
211  if (iup > 0)
212  phix += 180 * CLHEP::deg;
213  phiy = phix + 90. * CLHEP::deg;
214  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: Creating a new "
215  << "rotation: " << rots << "\t90., " << phix / CLHEP::deg << ", 90.," << phiy / CLHEP::deg
216  << ", 0, 0";
217  rot = DDrot(DDName(rots, idNameSpace), 90 * CLHEP::deg, phix, 90 * CLHEP::deg, phiy, 0., 0.);
218  cpv.position(coolTube, layer, i + 1, tran, rot);
219  LogDebug("PixelGeom") << "DDPixBarLayerAlgo test: " << coolTube.name() << " number " << i + 1 << " positioned in "
220  << layer.name() << " at " << tran << " with " << rot;
221  }
222 }

References filterCSVwithJSON::copy, funct::cos(), d1, DDBase< N, C >::ddname(), DDrot(), DDSplit(), flavorHistoryFilter_cfi::dr, dqmdumpme::first, mps_fire::i, versionedElectronIDProducer_cfi::idName, PVValHelper::ladder, LogDebug, Skims_PA_cff::name, DDName::name(), DDBase< N, C >::name(), nphi, contentValuesFiles::number, class-composition::parent, DDCompactView::position(), makeMuonMisalignmentScenario::rot, findQualityFiles::rr, edm::second(), funct::sin(), mathSSE::sqrt(), DDSolidFactory::trap(), DDSolidFactory::tubs(), testProducerWithPsetDescEmpty_cfi::x1, testProducerWithPsetDescEmpty_cfi::x2, and geometryCSVtoXML::xx.

◆ initialize()

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

Definition at line 62 of file DDPixBarLayerAlgo.cc.

66  {
68  DDName parentName = parent().name();
69 
70  genMat = sArgs["GeneralMaterial"];
71  number = int(nArgs["Ladders"]);
72  layerDz = nArgs["LayerDz"];
73  sensorEdge = nArgs["SensorEdge"];
74  coolDz = nArgs["CoolDz"];
75  coolWidth = nArgs["CoolWidth"];
76  coolSide = nArgs["CoolSide"];
77  coolThick = nArgs["CoolThick"];
78  coolDist = nArgs["CoolDist"];
79  coolMat = sArgs["CoolMaterial"];
80  tubeMat = sArgs["CoolTubeMaterial"];
81 
82  LogDebug("PixelGeom") << "DDPixBarLayerAlgo debug: Parent " << parentName << " NameSpace " << idNameSpace << "\n"
83  << "\tLadders " << number << "\tGeneral Material " << genMat << "\tLength " << layerDz
84  << "\tSensorEdge " << sensorEdge << "\tSpecification of Cooling Pieces:\n"
85  << "\tLength " << coolDz << " Width " << coolWidth << " Side " << coolSide
86  << " Thickness of Shell " << coolThick << " Radial distance " << coolDist << " Materials "
87  << coolMat << ", " << tubeMat;
88 
89  ladder = vsArgs["LadderName"];
90  ladderWidth = vArgs["LadderWidth"];
91  ladderThick = vArgs["LadderThick"];
92 
93  LogDebug("PixelGeom") << "DDPixBarLayerAlgo debug: Full Ladder " << ladder[0] << " width/thickness " << ladderWidth[0]
94  << ", " << ladderThick[0] << "\tHalf Ladder " << ladder[1] << " width/thickness "
95  << ladderWidth[1] << ", " << ladderThick[1];
96 }

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

Member Data Documentation

◆ coolDist

double DDPixBarLayerAlgo::coolDist
private

Definition at line 50 of file DDPixBarLayerAlgo.cc.

◆ coolDz

double DDPixBarLayerAlgo::coolDz
private

Definition at line 46 of file DDPixBarLayerAlgo.cc.

◆ coolMat

string DDPixBarLayerAlgo::coolMat
private

Definition at line 51 of file DDPixBarLayerAlgo.cc.

◆ coolSide

double DDPixBarLayerAlgo::coolSide
private

Definition at line 48 of file DDPixBarLayerAlgo.cc.

◆ coolThick

double DDPixBarLayerAlgo::coolThick
private

Definition at line 49 of file DDPixBarLayerAlgo.cc.

◆ coolWidth

double DDPixBarLayerAlgo::coolWidth
private

Definition at line 47 of file DDPixBarLayerAlgo.cc.

◆ genMat

string DDPixBarLayerAlgo::genMat
private

Definition at line 42 of file DDPixBarLayerAlgo.cc.

◆ idNameSpace

string DDPixBarLayerAlgo::idNameSpace
private

Definition at line 41 of file DDPixBarLayerAlgo.cc.

◆ ladder

vector<string> DDPixBarLayerAlgo::ladder
private

Definition at line 53 of file DDPixBarLayerAlgo.cc.

◆ ladderThick

vector<double> DDPixBarLayerAlgo::ladderThick
private

Definition at line 55 of file DDPixBarLayerAlgo.cc.

◆ ladderWidth

vector<double> DDPixBarLayerAlgo::ladderWidth
private

Definition at line 54 of file DDPixBarLayerAlgo.cc.

◆ layerDz

double DDPixBarLayerAlgo::layerDz
private

Definition at line 44 of file DDPixBarLayerAlgo.cc.

◆ number

int DDPixBarLayerAlgo::number
private

Definition at line 43 of file DDPixBarLayerAlgo.cc.

◆ sensorEdge

double DDPixBarLayerAlgo::sensorEdge
private

Definition at line 45 of file DDPixBarLayerAlgo.cc.

◆ tubeMat

string DDPixBarLayerAlgo::tubeMat
private

Definition at line 52 of file DDPixBarLayerAlgo.cc.

mps_fire.i
i
Definition: mps_fire.py:428
DDrot
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
DDPixBarLayerAlgo::coolDz
double coolDz
Definition: DDPixBarLayerAlgo.cc:46
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
findQualityFiles.rr
string rr
Definition: findQualityFiles.py:185
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
DDPixBarLayerAlgo::genMat
string genMat
Definition: DDPixBarLayerAlgo.cc:42
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
versionedElectronIDProducer_cfi.idName
idName
Definition: versionedElectronIDProducer_cfi.py:11
DDPixBarLayerAlgo::number
int number
Definition: DDPixBarLayerAlgo.cc:43
dqmdumpme.first
first
Definition: dqmdumpme.py:55
DDPixBarLayerAlgo::idNameSpace
string idNameSpace
Definition: DDPixBarLayerAlgo.cc:41
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
nphi
const int nphi
Definition: CMTRawAnalyzer.h:424
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
DDMaterial
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDPixBarLayerAlgo::ladderWidth
vector< double > ladderWidth
Definition: DDPixBarLayerAlgo.cc:54
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDBase::name
const N & name() const
Definition: DDBase.h:59
DDSolidFactory::tubs
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:653
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
DDBase::ddname
const N & ddname() const
Definition: DDBase.h:61
DDPixBarLayerAlgo::coolMat
string coolMat
Definition: DDPixBarLayerAlgo.cc:51
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
createfilelist.int
int
Definition: createfilelist.py:10
DDPixBarLayerAlgo::ladder
vector< string > ladder
Definition: DDPixBarLayerAlgo.cc:53
DDPixBarLayerAlgo::tubeMat
string tubeMat
Definition: DDPixBarLayerAlgo.cc:52
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
DDPixBarLayerAlgo::coolDist
double coolDist
Definition: DDPixBarLayerAlgo.cc:50
DDPixBarLayerAlgo::coolWidth
double coolWidth
Definition: DDPixBarLayerAlgo.cc:47
DDAxes::phi
DDCurrentNamespace::ns
static std::string & ns()
Definition: DDCurrentNamespace.cc:3
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDPixBarLayerAlgo::coolThick
double coolThick
Definition: DDPixBarLayerAlgo.cc:49
DDPixBarLayerAlgo::sensorEdge
double sensorEdge
Definition: DDPixBarLayerAlgo.cc:45
DDPixBarLayerAlgo::ladderThick
vector< double > ladderThick
Definition: DDPixBarLayerAlgo.cc:55
DDSolidFactory::trap
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:595
DDPixBarLayerAlgo::coolSide
double coolSide
Definition: DDPixBarLayerAlgo.cc:48
class-composition.parent
parent
Definition: class-composition.py:88
DDPixBarLayerAlgo::layerDz
double layerDz
Definition: DDPixBarLayerAlgo.cc:44
d1
static constexpr float d1
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
DDSplit
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
Definition: DDSplit.cc:3
DDCompactView::position
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
Definition: DDCompactView.cc:76
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:18