9 #include "CLHEP/Units/GlobalSystemOfUnits.h"
11 #include <boost/bind.hpp>
21 template<
typename DDView>
22 double getDouble(
const char *
s, DDView
const &
ev) {
24 std::vector<const DDsvalues_type *>
result;
25 ev.specificsV(result);
26 std::vector<const DDsvalues_type *>::iterator it = result.begin();
28 for (; it != result.end(); ++it)
35 const std::vector<std::string> &
temp = val.strings();
38 throw cms::Exception(
"Configuration") <<
"I need 1 "<< s <<
" tags";
40 return double(::atof(temp[0].c_str()));
45 template<
typename DDView>
46 std::string getString(
const char * s, DDView
const & ev) {
48 std::vector<const DDsvalues_type *>
result;
49 ev.specificsV(result);
50 std::vector<const DDsvalues_type *>::iterator it = result.begin();
52 for (; it != result.end(); ++it)
60 const std::vector<std::string> & temp = val.strings();
63 throw cms::Exception(
"Configuration") <<
"I need 1 "<< s <<
" tags";
80 #ifdef GEOMETRICDETDEBUG
83 _ddd(navtype.
begin(),navtype.
end()), _type(type){
99 _parents =
GeoHistory(ev.geoHistory().begin(),ev.geoHistory().end()) ;
100 _volume = ((ev.logicalPart()).solid()).volume();
101 _density = ((ev.logicalPart()).material()).density();
103 _weight = _density * ( _volume / 1000.);
105 _material = ((ev.logicalPart()).material()).
name().
fullname();
106 _radLength = getDouble(
"TrackerRadLength",ev);
107 _xi = getDouble(
"TrackerXi",ev);
110 _pixROCx = getDouble(
"PixelROC_X",ev);
111 _pixROCy = getDouble(
"PixelROC_Y",ev);
112 _stereo = getString(
"TrackerStereoDetectors",ev)==strue;
133 _density = ((fv->
logicalPart()).material()).density();
135 _weight = _density * ( _volume / 1000.);
138 _radLength = getDouble(
"TrackerRadLength",*fv);
139 _xi = getDouble(
"TrackerXi",*fv);
142 _pixROCx = getDouble(
"PixelROC_X",*fv);
143 _pixROCy = getDouble(
"PixelROC_Y",*fv);
144 _stereo = getString(
"TrackerStereoDetectors",*fv)==
"true";
154 _trans(fv->translation()),
158 _shape(((fv->logicalPart()).solid()).shape()),
159 _ddname(((fv->logicalPart()).ddname()).
name()),
161 _params(((fv->logicalPart()).solid()).
parameters()),
163 #ifdef GEOMTRICDETDEBUG
164 _parents(fv->geoHistory().
begin(),fv->geoHistory().
end()),
165 _volume(((fv->logicalPart()).solid()).volume()),
166 _density(((fv->logicalPart()).material()).density()),
168 _weight(_density * ( _volume / 1000.)),
170 _material(((fv->logicalPart()).material()).
name().fullname()),
172 _radLength(getDouble(
"TrackerRadLength",*fv)),
173 _xi(getDouble(
"TrackerXi",*fv)),
174 _pixROCRows(getDouble(
"PixelROCRows",*fv)),
175 _pixROCCols(getDouble(
"PixelROCCols",*fv)),
176 _pixROCx(getDouble(
"PixelROC_X",*fv)),
177 _pixROCy(getDouble(
"PixelROC_Y",*fv)),
178 _stereo(getString(
"TrackerStereoDetectors",*fv)==strue),
179 _siliconAPVNum(getDouble(
"SiliconAPVNumber",*fv))
180 #ifdef GEOMTRICDETDEBUG
194 _trans(onePGD._x, onePGD._y, onePGD._z),
197 _rot(onePGD._a11, onePGD._a12, onePGD._a13,
198 onePGD._a21, onePGD._a22, onePGD._a23,
199 onePGD._a31, onePGD._a32, onePGD._a33),
202 _ddname(onePGD._name, onePGD._ns),
205 _geographicalID(onePGD._geographicalID),
206 #ifdef GEOMTRICDETDEBUG
208 _volume(onePGD._volume),
209 _density(onePGD._density),
210 _weight(onePGD._weight),
212 _material(onePGD._material),
214 _radLength(onePGD._radLength),
216 _pixROCRows(onePGD._pixROCRows),
217 _pixROCCols(onePGD._pixROCCols),
218 _pixROCx(onePGD._pixROCx),
219 _pixROCy(onePGD._pixROCy),
220 _stereo(onePGD._stereo),
221 _siliconAPVNum(onePGD._siliconAPVNum)
222 #ifdef GEOMTRICDETDEBUG
249 if ( onePGD.
_numnt > 4 ) {
251 if ( onePGD.
_numnt > 5 ) {
253 if ( onePGD.
_numnt > 6 ) {
255 if ( onePGD.
_numnt > 7 ) {
257 if ( onePGD.
_numnt > 8 ) {
259 if ( onePGD.
_numnt > 9 ) {
261 if ( onePGD.
_numnt > 10 ) {
281 cont.push_back(
this);
285 iDet->deepComponents(cont);
331 _rot.GetComponents(x, y, z);
332 Rotation _rotation(
float(x.X()),
float(x.Y()),
float(x.Z()),
333 float(y.X()),
float(y.Y()),
float(y.Z()),
334 float(z.X()),
float(z.Y()),
float(z.Z()));
340 const std::vector<double>& par =
_params;
ConstGeometricDetContainer _container
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
void addComponent(GeometricDet *)
DDSolidShape const & shape() const
nav_type navPos() const
return the stack of sibling numbers
type of data representation of DDCompactView
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
std::vector< GeometricDet * > GeometricDetContainer
enum GeometricDet::GDEnumType GeometricEnumType
nav_type navPos() const
return the stack of sibling numbers which indicates the current position in the DDExpandedView ...
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
DDName const & name() const
Bounds * buildBounds(const DDSolidShape &, const std::vector< double > &) const
Position positionBounds() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
const std::string fullname() const
std::vector< double > _params
GeometricDet(DDFilteredView *fv, GeometricEnumType dd)
std::unique_ptr< Bounds > bounds() const
const DDTranslation & translation() const
The absolute translation of the current node.
std::vector< GeometricDet const * > ConstGeometricDetContainer
int copyno() const
Copy number associated with the current node.
ConstGeometricDetContainer deepComponents() const
DDExpandedView::nav_type nav_type
void addComponents(GeometricDetContainer const &cont)
Rotation rotationBounds() const
DDExpandedView::nav_type nav_type
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
volatile std::atomic< bool > shutdown_flag false
Provides an exploded view of the detector (tree-view)
std::vector< DDExpandedNode > GeoHistory