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
DDPixBarLayerUpgradeAlgo Class Reference

#include <DDPixBarLayerUpgradeAlgo.h>

Inheritance diagram for DDPixBarLayerUpgradeAlgo:

Public Member Functions

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

Private Attributes

double cool1Offset
 
double cool2Offset
 
double coolDist
 
double coolDz
 
std::string coolMat
 
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
 
std::string tubeMat
 

Detailed Description

Definition at line 10 of file DDPixBarLayerUpgradeAlgo.h.

Constructor & Destructor Documentation

DDPixBarLayerUpgradeAlgo::DDPixBarLayerUpgradeAlgo ( )

Definition at line 21 of file DDPixBarLayerUpgradeAlgo.cc.

References LogDebug.

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

Definition at line 25 of file DDPixBarLayerUpgradeAlgo.cc.

25 {}

Member Function Documentation

void DDPixBarLayerUpgradeAlgo::execute ( DDCompactView cpv)

Definition at line 68 of file DDPixBarLayerUpgradeAlgo.cc.

References cool1Offset, cool2Offset, coolDist, coolDz, coolMat, coolRadius, coolThick, filterCSVwithJSON::copy, funct::cos(), dbl_to_string(), DDBase< N, C >::ddname(), DDrot(), DDSplit(), first, genMat, i, idNameSpace, ladder, ladderOffset, ladderThick, ladderWidth, layerDz, LogDebug, DDName::name(), mergeVDriftHistosByStation::name, DDBase< N, C >::name(), number, outerFirst, dbtoconf::parent, phi, DDCompactView::position(), makeMuonMisalignmentScenario::rot, edm::second(), funct::sin(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, tubeMat, and DDSolidFactory::tubs().

68  {
69 
70  DDName mother = parent().name();
71  std::string idName = DDSplit(mother).first;
72 
73  double dphi = CLHEP::twopi/number;
74  double x2 = coolDist*sin(0.5*dphi);
75  double rtmi = coolDist*cos(0.5*dphi)-(coolRadius+ladderThick);
76  double rmxh = coolDist*cos(0.5*dphi)+(coolRadius+ladderThick+ladderOffset);
77  double rtmx = sqrt(rmxh*rmxh+ladderWidth*ladderWidth/4);
79  rtmi, rtmx, 0, CLHEP::twopi);
80  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: "
81  << DDName(idName, idNameSpace) << " Tubs made of "
82  << genMat << " from 0 to " << CLHEP::twopi/CLHEP::deg
83  << " with Rin " << rtmi << " Rout " << rtmx
84  << " ZHalf " << 0.5*layerDz;
86  DDMaterial matter(matname);
87  DDLogicalPart layer(solid.ddname(), matter, solid);
88 
89  double dr = coolRadius+0.5*ladderThick;
90  std::string name = idName + "CoolTube";
91  solid = DDSolidFactory::tubs(DDName(name,idNameSpace), 0.5*coolDz,
92  0, coolRadius, 0, CLHEP::twopi);
93  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " <<solid.name()
94  << " Tubs made of " << tubeMat << " from 0 to " <<
95  CLHEP::twopi/CLHEP::deg << " with Rout " << coolRadius <<
96  " ZHalf " << 0.5*coolDz;
98  DDLogicalPart coolTube(solid.ddname(), matter, solid);
99 
100  name = idName + "Coolant";
101  solid = DDSolidFactory::tubs(DDName(name,idNameSpace), 0.5*coolDz,
102  0, coolRadius-coolThick, 0, CLHEP::twopi);
103  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " <<solid.name()
104  << " Tubs made of " << tubeMat << " from 0 to " <<
105  CLHEP::twopi/CLHEP::deg << " with Rout " << coolRadius-coolThick <<
106  " ZHalf " << 0.5*coolDz;
107  matter = DDMaterial(DDName(DDSplit(coolMat).first, DDSplit(coolMat).second));
108  DDLogicalPart cool(solid.ddname(), matter, solid);
109  cpv.position (cool, coolTube, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
110  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << cool.name()
111  << " number 1 positioned in " << coolTube.name()
112  << " at (0,0,0) with no rotation";
113 
114  DDName ladderFull(DDSplit(ladder).first, DDSplit(ladder).second);
115  int copy=1, iup=(-1)*outerFirst;
116  int copyoffset=number+2;
117  for (int i=1; i<number+1; i++) {
118  double phi = i*dphi+90*CLHEP::deg-0.5*dphi; //to start with the interface ladder
119  double phix, phiy, rrr, rrroffset;
120  std::string rots;
121  DDTranslation tran;
122  DDRotation rot;
123  iup =-iup;
124  if ((i==1)||(i==number/2+1)){
125  dr=coolRadius+0.5*ladderThick+ladderOffset; //interface ladder offset
126  }else{
127  dr=coolRadius+0.5*ladderThick;
128  }
129  rrr = coolDist*cos(0.5*dphi)+iup*dr;
130  tran = DDTranslation(rrr*cos(phi), rrr*sin(phi), 0);
131  rots = idName + dbl_to_string(copy);
132  if (iup > 0) phix = phi-90*CLHEP::deg;
133  else phix = phi+90*CLHEP::deg;
134  phiy = phix+90.*CLHEP::deg;
135  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: Creating a new "
136  << "rotation: " << rots << "\t90., " << phix/CLHEP::deg
137  << ", 90.," << phiy/CLHEP::deg << ", 0, 0";
138  rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg, phiy, 0.,0.);
139  cpv.position (ladderFull, layer, copy, tran, rot);
140  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << ladderFull
141  << " number " << copy << " positioned in "
142  << layer.name() << " at " << tran << " with "
143  << rot;
144  copy++;
145  rrr = coolDist*cos(0.5*dphi);
146  tran = DDTranslation(rrr*cos(phi)-x2*sin(phi),
147  rrr*sin(phi)+x2*cos(phi), 0);
148  rots = idName + dbl_to_string(i+100);
149  phix = phi+0.5*dphi;
150  if (iup > 0) phix += 180*CLHEP::deg;
151  phiy = phix+90.*CLHEP::deg;
152  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: Creating a new "
153  << "rotation: " << rots << "\t90., " << phix/CLHEP::deg
154  << ", 90.," << phiy/CLHEP::deg << ", 0, 0";
155  rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg, phiy, 0.,0.);
156  cpv.position (coolTube, layer, i+1, tran, rot);
157  if ((i==1)||(i==number/2+1)){
158  rrroffset = coolDist*cos(0.5*dphi)+iup*ladderOffset;
159  tran = DDTranslation(rrroffset*cos(phi)-cool1Offset*sin(phi),
160  rrroffset*sin(phi)+cool1Offset*cos(phi), 0);
161  cpv.position (coolTube, layer, copyoffset, tran, DDRotation());
162  copyoffset++;
163  tran = DDTranslation(rrroffset*cos(phi)-cool2Offset*sin(phi),
164  rrroffset*sin(phi)+cool2Offset*cos(phi), 0);
165  cpv.position (coolTube, layer, copyoffset, tran, DDRotation());
166  copyoffset++;
167  }
168  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo test: " << coolTube.name()
169  << " number " << i+1 << " positioned in "
170  << layer.name() << " at " << tran << " with "<< rot;
171  }
172 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
const N & name() const
Definition: DDBase.h:82
list parent
Definition: dbtoconf.py:74
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
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
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
U second(std::pair< T, U > const &p)
T sqrt(T t)
Definition: SSEVec.h:48
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
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
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
const N & ddname() const
Definition: DDBase.h:84
Definition: DDAxes.h:10
void DDPixBarLayerUpgradeAlgo::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 27 of file DDPixBarLayerUpgradeAlgo.cc.

References cool1Offset, cool2Offset, coolDist, coolDz, coolMat, coolRadius, coolThick, genMat, idNameSpace, ladder, ladderOffset, ladderThick, ladderWidth, layerDz, LogDebug, DDCurrentNamespace::ns(), number, outerFirst, dbtoconf::parent, and tubeMat.

31  {
32 
34  DDName parentName = parent().name();
35 
36  genMat = sArgs["GeneralMaterial"];
37  number = int(nArgs["Ladders"]);
38  layerDz = nArgs["LayerDz"];
39  coolDz = nArgs["CoolDz"];
40  coolThick = nArgs["CoolThick"];
41  coolRadius= nArgs["CoolRadius"];
42  coolDist = nArgs["CoolDist"];
43  cool1Offset = nArgs["Cool1Offset"];
44  cool2Offset = nArgs["Cool2Offset"];
45  coolMat = sArgs["CoolMaterial"];
46  tubeMat = sArgs["CoolTubeMaterial"];
47 
48 
49  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo debug: Parent " << parentName
50  << " NameSpace " << idNameSpace << "\n"
51  << "\tLadders " << number << "\tGeneral Material "
52  << genMat << "\tLength " << layerDz << "\tSpecification of Cooling Pieces:\n"
53  << "\tLength " << coolDz << " Thickness of Shell "
54  << coolThick << " Radial distance " << coolDist
55  << " Materials " << coolMat << ", " << tubeMat;
56 
57  ladder = sArgs["LadderName"];
58  ladderWidth = nArgs["LadderWidth"];
59  ladderThick = nArgs["LadderThick"];
60  ladderOffset = nArgs["LadderOffset"];
61  outerFirst = int(nArgs["OuterFirst"]);
62 
63  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgo debug: Full Ladder "
64  << ladder << " width/thickness " << ladderWidth
65  << ", " << ladderThick;
66 }
#define LogDebug(id)
list parent
Definition: dbtoconf.py:74
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
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().

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 38 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::ladderOffset
private

Definition at line 41 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::ladderThick
private

Definition at line 40 of file DDPixBarLayerUpgradeAlgo.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgo::ladderWidth
private

Definition at line 39 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 42 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().