CMS 3D CMS Logo

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

#include <DDPixBarLayerUpgradeAlgoCoverage.h>

Inheritance diagram for DDPixBarLayerUpgradeAlgoCoverage:

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 10 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Constructor & Destructor Documentation

DDPixBarLayerUpgradeAlgoCoverage::DDPixBarLayerUpgradeAlgoCoverage ( )

Definition at line 20 of file DDPixBarLayerUpgradeAlgoCoverage.cc.

References LogDebug.

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

Definition at line 24 of file DDPixBarLayerUpgradeAlgoCoverage.cc.

24 {}

Member Function Documentation

void DDPixBarLayerUpgradeAlgoCoverage::execute ( DDCompactView cpv)

Definition at line 72 of file DDPixBarLayerUpgradeAlgoCoverage.cc.

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

72  {
73 
74  DDName mother = parent().name();
75  std::string idName = DDSplit(mother).first;
76 
77  // Keep a running tally to check that there are no phi gaps.
78  double phi_coverage = 0.0; // Running total of Phi coverage
79  double dphi = CLHEP::twopi/number;
80  double d2 = 0.5*coolWidth;
81  double d1 = d2 - coolSide*sin(0.5*dphi);
82  double x1 = (d1+d2)/(2.*sin(0.5*dphi));
83  double x2 = coolDist*sin(0.5*dphi);
84  double rmin = (coolDist-0.5*(d1+d2))*cos(0.5*dphi)-0.5*ladderThick;
85  double rmax = (coolDist+0.5*(d1+d2))*cos(0.5*dphi)+0.5*ladderThick;
86  double rmxh = rmax + 0.5*ladderThick;
87  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgoCoverage test: Rmin/Rmax " << rmin
88  << ", " << rmax << " d1/d2 " << d1 << ", " << d2
89  << " x1/x2 " << x1 << ", " << x2;
90 
91  double rtmi = rmin - 0.5*ladderThick;
92  double rtmx = sqrt(rmxh*rmxh+ladderWidth*ladderWidth);
94  rtmi, rtmx, 0, CLHEP::twopi);
95  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgoCoverage test: "
96  << DDName(idName, idNameSpace) << " Tubs made of "
97  << genMat << " from 0 to " << CLHEP::twopi/CLHEP::deg
98  << " with Rin " << rtmi << " Rout " << rtmx
99  << " ZHalf " << 0.5*layerDz;
101  DDMaterial matter(matname);
102  DDLogicalPart layer(solid.ddname(), matter, solid);
103 
104  double rr = 0.5*(rmax+rmin);
105  double dr = 0.5*(rmax-rmin);
106  double h1 = 0.5*coolSide*cos(0.5*dphi);
107  std::string name = idName + "CoolTube";
108  solid = DDSolidFactory::trap(DDName(name,idNameSpace), 0.5*coolDz, 0, 0,
109  h1, d2, d1, 0, h1, d2, d1, 0);
110  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgoCoverage test: " <<solid.name()
111  << " Trap made of " << tubeMat << " of dimensions "
112  << 0.5*coolDz << ", 0, 0, " << h1 << ", " << d2
113  << ", " << d1 << ", 0, " << h1 << ", " << d2 << ", "
114  << d1 << ", 0";
115  matter = DDMaterial(DDName(DDSplit(tubeMat).first, DDSplit(tubeMat).second));
116  DDLogicalPart coolTube(solid.ddname(), matter, solid);
117 
118  name = idName + "Coolant";
119  h1 -= coolThick;
120  d1 -= coolThick;
121  d2 -= coolThick;
122  solid = DDSolidFactory::trap(DDName(name,idNameSpace), 0.5*coolDz, 0, 0,
123  h1, d2, d1, 0, h1, d2, d1, 0);
124  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgoCoverage test: " <<solid.name()
125  << " Trap made of " << coolMat << " of dimensions "
126  << 0.5*coolDz << ", 0, 0, " << h1 << ", " << d2
127  << ", " << d1 << ", 0, " << h1 << ", " << d2 << ", "
128  << d1 << ", 0";
129  matter = DDMaterial(DDName(DDSplit(coolMat).first, DDSplit(coolMat).second));
130  DDLogicalPart cool(solid.ddname(), matter, solid);
131  cpv.position (cool, coolTube, 1, DDTranslation(0.0, 0.0, 0.0), DDRotation());
132  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgoCoverage test: " << cool.name()
133  << " number 1 positioned in " << coolTube.name()
134  << " at (0,0,0) with no rotation";
135 
136  DDName ladderFull(DDSplit(ladder).first, DDSplit(ladder).second);
137  int copy=1, iup=(-1)*outerFirst;
138  for (int i=1; i<number+1; i++) {
139  double phi = i*dphi;
140  double phix, phiy, rrr;
141  std::string rots;
142  DDTranslation tran;
143  DDRotation rot;
144  iup =-iup;
145  rrr = rr + iup*dr;
146  tran = DDTranslation(rrr*cos(phi), rrr*sin(phi), 0);
147  rots = idName + std::to_string(copy);
148  if (iup > 0) phix = phi-90*CLHEP::deg;
149  else phix = phi+90*CLHEP::deg;
150  phiy = phix+90.*CLHEP::deg;
151  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgoCoverage test: Creating a new "
152  << "rotation: " << rots << "\t90., " << phix/CLHEP::deg
153  << ", 90.," << phiy/CLHEP::deg << ", 0, 0";
154  rot = DDrot(DDName(rots,idNameSpace), 90*CLHEP::deg, phix, 90*CLHEP::deg, phiy, 0.,0.);
155  cpv.position (ladderFull, layer, copy, tran, rot);
156  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgoCoverage test: " << ladderFull
157  << " number " << copy << " positioned in "
158  << layer.name() << " at " << tran << " with "
159  << rot;
160  double phi_coverage_i=2*atan2((activeWidth/2.0),(rrr+(ladderThick/2.0)));
161  //std::cout << " radius = " << rrr << " phi value " << phi_coverage_i << std::endl;
162  phi_coverage += phi_coverage_i;
163  copy++;
164  rrr = coolDist*cos(0.5*dphi);
165  tran = DDTranslation(rrr*cos(phi)-x2*sin(phi),
166  rrr*sin(phi)+x2*cos(phi), 0);
167  rots = idName + std::to_string(i+100);
168  phix = phi+0.5*dphi;
169  if (iup > 0) phix += 180*CLHEP::deg;
170  phiy = phix+90.*CLHEP::deg;
171  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgoCoverage 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 (coolTube, layer, i+1, tran, rot);
176  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgoCoverage test: " << coolTube.name()
177  << " number " << i+1 << " positioned in "
178  << layer.name() << " at " << tran << " with "<< rot;
179  }
180  std::cout<<"\nLayer covered "<<phi_coverage<<" radians in phi. (2Pi="<<CLHEP::twopi<<")" << std::endl;
181  if (phi_coverage>CLHEP::twopi) std::cout<<"\nPhi coverage is achieved"<< std::endl;
182 }
#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
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:16
A DDSolid represents the shape of a part.
Definition: DDSolid.h:37
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:64
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:863
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:794
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:80
void DDPixBarLayerUpgradeAlgoCoverage::initialize ( const DDNumericArguments nArgs,
const DDVectorArguments vArgs,
const DDMapArguments mArgs,
const DDStringArguments sArgs,
const DDStringVectorArguments vsArgs 
)

Definition at line 26 of file DDPixBarLayerUpgradeAlgoCoverage.cc.

References activeWidth, coolDist, coolDz, coolMat, coolSide, coolThick, coolWidth, gather_cfg::cout, genMat, idNameSpace, createfilelist::int, ladder, ladderThick, ladderWidth, layerDz, LogDebug, DDCurrentNamespace::ns(), number, outerFirst, 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 
48  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgoCoverage debug: Parent " << parentName
49  << " NameSpace " << idNameSpace << "\n"
50  << "\tLadders " << number << "\tGeneral Material "
51  << genMat << "\tLength " << layerDz << "\tSensorEdge "
52  << sensorEdge << "\tSpecification of Cooling Pieces:\n"
53  << "\tLength " << coolDz << " Width " << coolWidth
54  << " Side " << coolSide << " Thickness of Shell "
55  << coolThick << " Radial distance " << coolDist
56  << " Materials " << coolMat << ", " << tubeMat;
57 
58  ladder = sArgs["LadderName"];
59  ladderWidth = nArgs["LadderWidth"];
60  ladderThick = nArgs["LadderThick"];
61  activeWidth = nArgs["ActiveWidth"];
62  outerFirst = int(nArgs["OuterFirst"]);
63 
64  LogDebug("PixelGeom") << "DDPixBarLayerUpgradeAlgoCoverage debug: Full Ladder "
65  << ladder << " width/thickness " << ladderWidth
66  << ", " << ladderThick;
67  std::cout << " LadderThick = " << ladderThick << std::endl;
68  std::cout << " LadderWidth = " << ladderWidth << std::endl;
69  std::cout << " ActiveWidth = " << activeWidth << std::endl;
70 }
#define LogDebug(id)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
static std::string & ns()

Member Data Documentation

double DDPixBarLayerUpgradeAlgoCoverage::activeWidth
private

Definition at line 41 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgoCoverage::coolDist
private

Definition at line 35 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgoCoverage::coolDz
private

Definition at line 31 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerUpgradeAlgoCoverage::coolMat
private

Definition at line 36 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgoCoverage::coolSide
private

Definition at line 33 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgoCoverage::coolThick
private

Definition at line 34 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgoCoverage::coolWidth
private

Definition at line 32 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerUpgradeAlgoCoverage::genMat
private

Definition at line 27 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerUpgradeAlgoCoverage::idNameSpace
private

Definition at line 26 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

std::string DDPixBarLayerUpgradeAlgoCoverage::ladder
private

Definition at line 38 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgoCoverage::ladderThick
private

Definition at line 40 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgoCoverage::ladderWidth
private

Definition at line 39 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgoCoverage::layerDz
private

Definition at line 29 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

int DDPixBarLayerUpgradeAlgoCoverage::number
private

Definition at line 28 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

int DDPixBarLayerUpgradeAlgoCoverage::outerFirst
private

Definition at line 42 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().

double DDPixBarLayerUpgradeAlgoCoverage::sensorEdge
private

Definition at line 30 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by initialize().

std::string DDPixBarLayerUpgradeAlgoCoverage::tubeMat
private

Definition at line 37 of file DDPixBarLayerUpgradeAlgoCoverage.h.

Referenced by execute(), and initialize().