CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

GeometricDet Class Reference

#include <GeometricDet.h>

List of all members.

Public Types

typedef std::vector
< GeometricDet const * > 
ConstGeometricDetContainer
typedef DDExpandedView::nav_type DDnav_type
enum  GDEnumType {
  unknown = 100, Tracker = 0, PixelBarrel = 1, PixelEndCap = 2,
  TIB = 3, TID = 4, TOB = 5, TEC = 6,
  layer = 8, wheel = 9, strng = 10, rod = 11,
  petal = 12, ring = 13, ladder = 14, mergedDet = 15,
  DetUnit = 16, disk = 17, panel = 18
}
typedef std::vector
< DDExpandedNode
GeoHistory
typedef std::vector
< GeometricDet const * > 
GeometricDetContainer
typedef enum
GeometricDet::GDEnumType 
GeometricEnumType
typedef DDExpandedView::nav_type nav_type
typedef DDExpandedView::NavRange NavRange
typedef Surface::PositionType Position
typedef Surface::RotationType Rotation

Public Member Functions

void addComponent (GeometricDet *)
void addComponents (GeometricDetContainer const &cont)
const Boundsbounds () const
void clearComponents ()
GeometricDetContainercomponents ()
GeometricDetContainer const & components () const
ConstGeometricDetContainer deepComponents () const
void deepComponents (GeometricDetContainer &cont) const
void deleteComponents ()
DetId geographicalID () const
DetId geographicalId () const
 GeometricDet (const PGeometricDet::Item &onePGD, GeometricEnumType dd)
 GeometricDet (DDFilteredView *fv, GeometricEnumType dd)
bool isLeaf () const
DDName const & name () const
NavRange navpos () const
NavRange navRange () const
nav_type const & navType () const
std::vector< double > const & params () const
double phi () const
double pixROCCols () const
double pixROCRows () const
double pixROCx () const
double pixROCy () const
Position positionBounds () const
double radLength () const
double rho () const
DDRotationMatrix const & rotation () const
Rotation rotationBounds () const
void setGeographicalID (DetId id) const
DDSolidShape const & shape () const
double siliconAPVNum () const
bool stereo () const
DDTranslation const & translation () const
GeometricEnumType type () const
double xi () const
 ~GeometricDet ()

Private Attributes

GeometricDetContainer _container
nav_type _ddd
DDName _ddname
DetId _geographicalID
std::vector< double > _params
double _phi
double _pixROCCols
double _pixROCRows
double _pixROCx
double _pixROCy
double _radLength
double _rho
DDRotationMatrix _rot
DDSolidShape _shape
double _siliconAPVNum
bool _stereo
DDTranslation _trans
GeometricEnumType _type
double _xi

Detailed Description

Composite class GeometricDet. A composite can contain other composites, and so on; You can understand what you are looking at via enum.

Definition at line 29 of file GeometricDet.h.


Member Typedef Documentation

Definition at line 35 of file GeometricDet.h.

Definition at line 32 of file GeometricDet.h.

Definition at line 42 of file GeometricDet.h.

typedef std::vector< GeometricDet const *> GeometricDet::GeometricDetContainer

Definition at line 36 of file GeometricDet.h.

Definition at line 43 of file GeometricDet.h.

Definition at line 33 of file GeometricDet.h.

Definition at line 45 of file GeometricDet.h.

Definition at line 46 of file GeometricDet.h.


Member Enumeration Documentation

Enumerator:
unknown 
Tracker 
PixelBarrel 
PixelEndCap 
TIB 
TID 
TOB 
TEC 
layer 
wheel 
strng 
rod 
petal 
ring 
ladder 
mergedDet 
DetUnit 
disk 
panel 

Definition at line 51 of file GeometricDet.h.

                          {unknown=100, Tracker=0, PixelBarrel=1, PixelEndCap=2,
                          TIB=3, TID=4, TOB=5, TEC=6,
                          layer=8, wheel=9, strng=10, rod=11, petal=12, ring=13,
                          ladder=14, mergedDet=15, DetUnit=16, disk=17, panel=18 } GeometricEnumType;

Constructor & Destructor Documentation

GeometricDet::GeometricDet ( DDFilteredView fv,
GeometricEnumType  dd 
)

Constructors to be used when looping over DDD

Definition at line 150 of file GeometricDet.cc.

References _ddd, DDFilteredView::navPos(), and nt.

                                                                     : 
  //
  // Set by hand the _ddd
  //
  _trans(fv->translation()),
  _phi(_trans.Phi()),
  _rho(_trans.Rho()),
  _rot(fv->rotation()),
  _shape(((fv->logicalPart()).solid()).shape()),
  _ddname(((fv->logicalPart()).ddname()).name()),
  _type(type),
  _params(((fv->logicalPart()).solid()).parameters()),
  //  want this :) _ddd(fv->navPos().begin(),fv->navPos().end()),
#ifdef GEOMTRICDETDEBUG
  _parents(fv->geoHistory().begin(),fv->geoHistory().end()),
  _volume(((fv->logicalPart()).solid()).volume()),
  _density(((fv->logicalPart()).material()).density()),
  //  _weight   = (fv->logicalPart()).weight();
  _weight(_density * ( _volume / 1000.)), // volume mm3->cm3
  _copy(fv->copyno()),
  _material(((fv->logicalPart()).material()).name().fullname()),
#endif
  _radLength(getDouble("TrackerRadLength",*fv)),
  _xi(getDouble("TrackerXi",*fv)),
  _pixROCRows(getDouble("PixelROCRows",*fv)),
  _pixROCCols(getDouble("PixelROCCols",*fv)),
  _pixROCx(getDouble("PixelROC_X",*fv)),
  _pixROCy(getDouble("PixelROC_Y",*fv)),
  _stereo(getString("TrackerStereoDetectors",*fv)==strue),
  _siliconAPVNum(getDouble("SiliconAPVNumber",*fv))
#ifdef GEOMTRICDETDEBUG
  ,
  _fromDD(true)
#endif
{
  //std::cout << "GeometricDet3" << std::endl;
  //  workaround instead of this at initialization _ddd(fv->navPos().begin(),fv->navPos().end()),
  const DDFilteredView::nav_type& nt = fv->navPos();
  _ddd = nav_type(nt.begin(), nt.end());
}
GeometricDet::GeometricDet ( const PGeometricDet::Item onePGD,
GeometricEnumType  dd 
)

Definition at line 193 of file GeometricDet.cc.

References _ddd, PGeometricDet::Item::_nt0, PGeometricDet::Item::_nt1, PGeometricDet::Item::_nt10, PGeometricDet::Item::_nt2, PGeometricDet::Item::_nt3, PGeometricDet::Item::_nt4, PGeometricDet::Item::_nt5, PGeometricDet::Item::_nt6, PGeometricDet::Item::_nt7, PGeometricDet::Item::_nt8, PGeometricDet::Item::_nt9, PGeometricDet::Item::_numnt, PGeometricDet::Item::_params0, PGeometricDet::Item::_params1, PGeometricDet::Item::_params10, PGeometricDet::Item::_params2, PGeometricDet::Item::_params3, PGeometricDet::Item::_params4, PGeometricDet::Item::_params5, PGeometricDet::Item::_params6, PGeometricDet::Item::_params7, PGeometricDet::Item::_params8, PGeometricDet::Item::_params9, and PGeometricDet::Item::_shape.

                                                                                    :
  _trans(onePGD._x, onePGD._y, onePGD._z),
  _phi(onePGD._phi), //_trans.Phi()),
  _rho(onePGD._rho), //_trans.Rho()),
  _rot(onePGD._a11, onePGD._a12, onePGD._a13, 
       onePGD._a21, onePGD._a22, onePGD._a23,
       onePGD._a31, onePGD._a32, onePGD._a33),
  _shape(DDSolidShapesName::index(onePGD._shape)),
  _ddd(), 
  _ddname(onePGD._name, onePGD._ns),//, "fromdb");
  _type(type),
  _params(),
  _geographicalID(onePGD._geographicalID),
#ifdef GEOMTRICDETDEBUG
  _parents(), // will remain empty... hate wasting the space but want all methods to work.
  _volume(onePGD._volume),
  _density(onePGD._density),
  _weight(onePGD._weight),
  _copy(onePGD._copy),
  _material(onePGD._material),
#endif
  _radLength(onePGD._radLength),
  _xi(onePGD._xi),
  _pixROCRows(onePGD._pixROCRows),
  _pixROCCols(onePGD._pixROCCols),
  _pixROCx(onePGD._pixROCx),
  _pixROCy(onePGD._pixROCy),
  _stereo(onePGD._stereo),
  _siliconAPVNum(onePGD._siliconAPVNum)
#ifdef GEOMTRICDETDEBUG
  , // mind the tricky comma is needed.
  _fromDD(false)
#endif
{
  //std::cout << "GeometricDet4" << std::endl;
  
  if(onePGD._shape==1||onePGD._shape==3){ //The parms vector is neede only in the case of box or trap shape
    _params.reserve(11);
    _params.push_back(onePGD._params0);
    _params.push_back(onePGD._params1);
    _params.push_back(onePGD._params2);
    _params.push_back(onePGD._params3);
    _params.push_back(onePGD._params4);
    _params.push_back(onePGD._params5);
    _params.push_back(onePGD._params6);
    _params.push_back(onePGD._params7);
    _params.push_back(onePGD._params8);
    _params.push_back(onePGD._params9);
    _params.push_back(onePGD._params10);
  }
 
  _ddd.reserve(onePGD._numnt);
  _ddd.push_back(onePGD._nt0);
  _ddd.push_back(onePGD._nt1);
  _ddd.push_back(onePGD._nt2);
  _ddd.push_back(onePGD._nt3);
  if ( onePGD._numnt > 4 ) {
    _ddd.push_back(onePGD._nt4);
    if ( onePGD._numnt > 5 ) {
      _ddd.push_back(onePGD._nt5);
      if ( onePGD._numnt > 6 ) {
        _ddd.push_back(onePGD._nt6);
        if ( onePGD._numnt > 7 ) {
          _ddd.push_back(onePGD._nt7);
          if ( onePGD._numnt > 8 ) {
            _ddd.push_back(onePGD._nt8);
            if ( onePGD._numnt > 9 ) {
              _ddd.push_back(onePGD._nt9);
              if ( onePGD._numnt > 10 ) {
                _ddd.push_back(onePGD._nt10);
              }}}}}}
  }
 
}
GeometricDet::~GeometricDet ( )

What to do in the destructor? destroy all the daughters!

Definition at line 76 of file GeometricDet.cc.

References deleteComponents().

                           {
  //std::cout << "~GeometricDet5" << std::endl;
  deleteComponents();
}

Member Function Documentation

void GeometricDet::addComponent ( GeometricDet det)
void GeometricDet::addComponents ( GeometricDetContainer const &  cont)

Definition at line 289 of file GeometricDet.cc.

References _container, cont, and filterCSVwithJSON::copy.

Referenced by CmsTrackerStringBuilder::sortNS(), CmsTrackerDiskBuilder::sortNS(), CmsTrackerRingBuilder::sortNS(), CmsTrackerWheelBuilder::sortNS(), and CmsTrackerLayerBuilder::sortNS().

                                                                  {
  //std::cout << "addComponents" << std::endl;
  if (_container.empty()) {
    _container=cont;
    return;
  }
  _container.reserve(_container.size()+cont.size());
  std::copy(cont.begin(), cont.end(), back_inserter(_container));
}
const Bounds * GeometricDet::bounds ( ) const

bounds() returns the Bounds.

Definition at line 336 of file GeometricDet.cc.

References _params, _shape, and TrackerShapeToBounds::buildBounds().

                                         {
  //std::cout << "bounds" << std::endl;
  const std::vector<double>& par = _params;
  Bounds * bounds = 0;
  TrackerShapeToBounds shapeToBounds;
  bounds = shapeToBounds.buildBounds(_shape,par);
  return bounds;
}
void GeometricDet::clearComponents ( ) [inline]

clearComponents() only empties the container, the components are not deleted!

Definition at line 89 of file GeometricDet.h.

References _container.

Referenced by CmsTrackerStringBuilder::sortNS(), CmsTrackerDiskBuilder::sortNS(), CmsTrackerRingBuilder::sortNS(), CmsTrackerWheelBuilder::sortNS(), and CmsTrackerLayerBuilder::sortNS().

                         {
    _container.clear();
    //std::cout<<"clearComponents"<<std::endl;
  }
GeometricDetContainer& GeometricDet::components ( ) [inline]
GeometricDetContainer const& GeometricDet::components ( ) const [inline]

Definition at line 167 of file GeometricDet.h.

References _container.

                                                   {
    //std::cout<<"const components2 "<<std::endl;
    return _container;
  }
GeometricDet::ConstGeometricDetContainer GeometricDet::deepComponents ( ) const

deepComponents() returns all the components below; please note that if the current GeometricDet is a leaf, it returns it!

Definition at line 268 of file GeometricDet.cc.

Referenced by GeometricDetLoader::beginJob(), PGeometricDetBuilder::beginRun(), TrackerGeomBuilderFromGeometricDet::build(), TouchableToHistory::buildAll(), TrackerMapDDDtoID::buildAllStep2(), deepComponents(), CmsTrackerLevelBuilder::ExtractPhiGluedModule::operator()(), CmsTrackerLevelBuilder::LessR_module::operator()(), and TrackerGeometricDetExtraESModule::produce().

                                                                          {
  //
  // iterate on all the components ;)
  //
  //std::cout << "deepComponents1" << std::endl;
  ConstGeometricDetContainer _temp;
  deepComponents(_temp);
  return _temp;
}
void GeometricDet::deepComponents ( GeometricDetContainer cont) const

Definition at line 278 of file GeometricDet.cc.

References _container, deepComponents(), and isLeaf().

                                                                    {
  //std::cout << "const deepComponents2" << std::endl;
  if (isLeaf())
    cont.push_back(const_cast<GeometricDet*>(this));
  else 
    std::for_each(_container.begin(),_container.end(), 
                  boost::bind(&GeometricDet::deepComponents,_1,boost::ref(cont))
                  );
}
void GeometricDet::deleteComponents ( )

deleteComponents() explicitly deletes the daughters

Definition at line 311 of file GeometricDet.cc.

References _container.

Referenced by ~GeometricDet().

                                   {
  //std::cout << "deleteComponents" << std::endl;
  std::for_each(_container.begin(),_container.end(),Deleter()); 
  _container.clear();
}
DetId GeometricDet::geographicalID ( ) const [inline]

geometricalID() returns the ID associated to the GeometricDet.

Definition at line 195 of file GeometricDet.h.

References _geographicalID.

Referenced by CmsTrackerDetIdBuilder::buildId(), PixelGeomDetUnit::PixelGeomDetUnit(), GeometricDetLoader::putOne(), PGeometricDetBuilder::putOne(), and StripGeomDetUnit::StripGeomDetUnit().

                                { 
    //std::cout<<"geographicalID"<<std::endl;
    return _geographicalID; 
  }
DetId GeometricDet::geographicalId ( ) const [inline]

Definition at line 199 of file GeometricDet.h.

References _geographicalID.

Referenced by TrackerGeometricDetExtraESModule::putOne().

                                { 
    //std::cout<<"geographicalId"<<std::endl; 
    return _geographicalID; 
  }
bool GeometricDet::isLeaf ( ) const [inline]

Definition at line 100 of file GeometricDet.h.

References _container.

Referenced by deepComponents().

                      { 
    //std::cout <<"isLeaf() ==" <<_container.empty()<<std::endl; 
    return _container.empty(); 
  }
DDName const& GeometricDet::name ( void  ) const [inline]

Definition at line 133 of file GeometricDet.h.

References _ddname.

Referenced by CmsTrackerDebugNavigator::iterate(), GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                              {
    //std::cout<<"name"<<std::endl;
    return _ddname;
  }
NavRange GeometricDet::navpos ( ) const [inline]

Definition at line 148 of file GeometricDet.h.

References _ddd.

                          {
    //std::cout<<"navpos"<<std::endl;
    return NavRange(&_ddd.front(),_ddd.size());
  }
NavRange GeometricDet::navRange ( ) const [inline]

Definition at line 143 of file GeometricDet.h.

References _ddd.

                            {
    //std::cout<<"navRange"<<std::endl;
    return NavRange(&_ddd.front(),_ddd.size());
  }
nav_type const& GeometricDet::navType ( ) const [inline]

Definition at line 138 of file GeometricDet.h.

References _ddd.

Referenced by TrackerGeometricDetExtraESModule::produce(), and PGeometricDetBuilder::putOne().

                                   {
    //std::cout<<"navType"<<std::endl; 
    return _ddd;
  }
std::vector<double> const& GeometricDet::params ( ) const [inline]

Definition at line 152 of file GeometricDet.h.

References _params.

Referenced by GeometricDetLoader::putOne(), PGeometricDetBuilder::putOne(), and CmsTrackerLayerBuilder::sortNS().

                                           {
    //std::cout<<"params"<<std::endl;
    return _params;
  }
double GeometricDet::phi ( void  ) const [inline]
double GeometricDet::pixROCCols ( ) const [inline]

Definition at line 255 of file GeometricDet.h.

References _pixROCCols.

Referenced by GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                            {
    //std::cout<<"pixROCCols"<<std::endl;
    return _pixROCCols;
  }
double GeometricDet::pixROCRows ( ) const [inline]

The following four pix* methods only return meaningful results for pixels.

Definition at line 251 of file GeometricDet.h.

References _pixROCRows.

Referenced by GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                            {
    //std::cout<<"pixROCRows"<<std::endl;
    return _pixROCRows;
  }
double GeometricDet::pixROCx ( ) const [inline]

Definition at line 259 of file GeometricDet.h.

References _pixROCx.

Referenced by GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                         {
    //std::cout<<"pixROCx"<<std::endl;
    return _pixROCx;
  }
double GeometricDet::pixROCy ( ) const [inline]

Definition at line 263 of file GeometricDet.h.

References _pixROCy.

Referenced by GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                         {
    //std::cout<<"pixROCy"<<std::endl;
    return _pixROCy;
  }
GeometricDet::Position GeometricDet::positionBounds ( ) const

positionBounds() returns the position in cm.

Definition at line 318 of file GeometricDet.cc.

References _trans.

                                                       {
  //std::cout << "positionBounds" << std::endl;
  Position _pos(float(_trans.x()/cm), 
                float(_trans.y()/cm), 
                float(_trans.z()/cm));
  return _pos;
}
double GeometricDet::radLength ( ) const [inline]

Definition at line 240 of file GeometricDet.h.

References _radLength.

Referenced by TrackerGeomBuilderFromGeometricDet::buildPlaneWithMaterial(), GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                           {
    //std::cout<<"radLength"<<std::endl;
    return _radLength;
  }
double GeometricDet::rho ( ) const [inline]

Definition at line 120 of file GeometricDet.h.

References _rho.

Referenced by CmsTrackerLevelBuilder::LessR::operator()(), GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                     { 
    //std::cout << "rho" <<std::endl; 
    return _rho; 
  }
DDRotationMatrix const& GeometricDet::rotation ( void  ) const [inline]

Access methods

Definition at line 108 of file GeometricDet.h.

References _rot.

Referenced by GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                                            {
    //std::cout<<"rotation" <<std::endl; 
    return _rot;
  }
GeometricDet::Rotation GeometricDet::rotationBounds ( ) const

rotationBounds() returns the rotation matrix.

Definition at line 326 of file GeometricDet.cc.

References _rot, x, detailsBasic3DVector::y, and z.

                                                       {
  //std::cout << "rotationBounds" << std::endl;
  DD3Vector x, y, z;
  _rot.GetComponents(x, y, z);
  Rotation _rotation(float(x.X()),float(x.Y()),float(x.Z()),
                     float(y.X()),float(y.Y()),float(y.Z()),
                     float(z.X()),float(z.Y()),float(z.Z())); 
  return _rotation;
}
void GeometricDet::setGeographicalID ( DetId  id) const [inline]

set or add or clear components

Definition at line 74 of file GeometricDet.h.

References _geographicalID.

Referenced by CmsTrackerDetIdBuilder::buildId(), and CmsDetConstruction::buildSmallDets().

                                         {
    _geographicalID = id; 
    //std::cout <<"setGeographicalID " << int(id) << std::endl;
  }
DDSolidShape const& GeometricDet::shape ( void  ) const [inline]

Definition at line 125 of file GeometricDet.h.

References _shape.

Referenced by GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                                      {
    //std::cout<<"shape"<<std::endl;
    return _shape;
  }
double GeometricDet::siliconAPVNum ( ) const [inline]

Definition at line 275 of file GeometricDet.h.

References _siliconAPVNum.

Referenced by GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                               {
    //std::cout<<"siliconAPVNum"<<std::endl;
    return _siliconAPVNum;
  }
bool GeometricDet::stereo ( ) const [inline]

The following two are only meaningful for the silicon tracker.

Definition at line 271 of file GeometricDet.h.

References _stereo.

Referenced by GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                      {
    //std::cout<<"stereo"<<std::endl;
    return _stereo;
  }
DDTranslation const& GeometricDet::translation ( void  ) const [inline]
GeometricEnumType GeometricDet::type ( ) const [inline]

Definition at line 129 of file GeometricDet.h.

References _type.

Referenced by CmsTrackerLevelBuilder::subDetByType::operator()(), GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                                 {
    //std::cout<<"type"<<std::endl;
    return _type;
  }
double GeometricDet::xi ( ) const [inline]

Definition at line 244 of file GeometricDet.h.

References _xi.

Referenced by TrackerGeomBuilderFromGeometricDet::buildPlaneWithMaterial(), GeometricDetLoader::putOne(), and PGeometricDetBuilder::putOne().

                    {
    //std::cout<<"xi - chi"<<std::endl;
    return _xi;
  }

Member Data Documentation

what it says... used the DD in memory model to build the geometry... or not.

Definition at line 292 of file GeometricDet.h.

Referenced by addComponent(), addComponents(), clearComponents(), components(), deepComponents(), deleteComponents(), and isLeaf().

Definition at line 298 of file GeometricDet.h.

Referenced by GeometricDet(), navpos(), navRange(), and navType().

Definition at line 299 of file GeometricDet.h.

Referenced by name().

Definition at line 303 of file GeometricDet.h.

Referenced by geographicalId(), geographicalID(), and setGeographicalID().

std::vector<double> GeometricDet::_params [private]

Definition at line 301 of file GeometricDet.h.

Referenced by bounds(), and params().

double GeometricDet::_phi [private]

Definition at line 294 of file GeometricDet.h.

Referenced by phi().

double GeometricDet::_pixROCCols [private]

Definition at line 315 of file GeometricDet.h.

Referenced by pixROCCols().

double GeometricDet::_pixROCRows [private]

Definition at line 314 of file GeometricDet.h.

Referenced by pixROCRows().

double GeometricDet::_pixROCx [private]

Definition at line 316 of file GeometricDet.h.

Referenced by pixROCx().

double GeometricDet::_pixROCy [private]

Definition at line 317 of file GeometricDet.h.

Referenced by pixROCy().

double GeometricDet::_radLength [private]

Definition at line 312 of file GeometricDet.h.

Referenced by radLength().

double GeometricDet::_rho [private]

Definition at line 295 of file GeometricDet.h.

Referenced by rho().

Definition at line 296 of file GeometricDet.h.

Referenced by rotation(), and rotationBounds().

Definition at line 297 of file GeometricDet.h.

Referenced by bounds(), and shape().

double GeometricDet::_siliconAPVNum [private]

Definition at line 319 of file GeometricDet.h.

Referenced by siliconAPVNum().

bool GeometricDet::_stereo [private]

Definition at line 318 of file GeometricDet.h.

Referenced by stereo().

Definition at line 293 of file GeometricDet.h.

Referenced by positionBounds(), and translation().

Definition at line 300 of file GeometricDet.h.

Referenced by type().

double GeometricDet::_xi [private]

Definition at line 313 of file GeometricDet.h.

Referenced by xi().