A DDLogicalPart aggregates information concerning material, solid and sensitveness ... More...
#include <DDLogicalPart.h>
Public Member Functions | |
void | addSpecifics (const std::pair< const DDPartSelection *, const DDsvalues_type * > &) |
don't use, internal only /todo make it private More... | |
const std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > & | attachedSpecifics (void) const |
DDEnums::Category | category (void) const |
Returns the categorization of the DDLogicalPart (sensitive detector element, cable, ...) More... | |
DDLogicalPart (void) | |
The default constructor provides an uninitialzed reference object. More... | |
DDLogicalPart (const DDName &name) | |
Creates a reference object referring to the appropriate XML specification. More... | |
DDLogicalPart (const DDName &name, const DDMaterial &material, const DDSolid &solid, DDEnums::Category cat=DDEnums::unspecified) | |
Registers (creates) a reference object representing a LogicalPart. More... | |
bool | hasDDValue (const DDValue &) const |
const DDMaterial & | material (void) const |
Returns a reference object of the material this LogicalPart is made of. More... | |
DDsvalues_type | mergedSpecifics (void) const |
returns the merged-specifics, i.e. the last specified specifics of this logical-part More... | |
void | removeSpecifics (const std::pair< DDPartSelection *, DDsvalues_type * > &) |
const DDSolid & | solid (void) const |
Returns a reference object of the solid being the shape of this LogicalPart. More... | |
std::vector< const DDsvalues_type * > | specifics (void) const |
returns the specific-data attached to the LogicalPart only (not to a DDExpandedNode) More... | |
double & | weight (void) |
Weight of the LogicalPart viewed as a component, if cached, else -1. More... | |
Public Member Functions inherited from DDBase< DDName, DDI::LogicalPart * > | |
DDBase () | |
const DDName & | ddname () const |
def_type | isDefined () const |
bool | isValid () const |
true, if the wrapped pointer is valid More... | |
const DDName & | name () const |
operator bool () const | |
bool | operator< (const DDBase &b) const |
bool | operator== (const DDBase &b) const |
bool | operator> (const DDBase &b) const |
const DDI::rep_traits< DDName, DDI::LogicalPart * >::reference | rep () const |
DDI::rep_traits< DDName, DDI::LogicalPart * >::reference | rep () |
std::string | toString () const |
const DDI::rep_traits< DDName, DDI::LogicalPart * >::reference | val () const |
const DDI::rep_traits< DDName, DDI::LogicalPart * >::reference | val () |
virtual | ~DDBase () |
Friends | |
std::ostream & | operator<< (std::ostream &, const DDLogicalPart &) |
Additional Inherited Members | |
Public Types inherited from DDBase< DDName, DDI::LogicalPart * > | |
typedef std::pair< const DDName *, bool > | def_type |
typedef DDI::LogicalPart * | pimpl_type |
typedef DDI::rep_type< DDName, pimpl_type > * | prep_type |
typedef DDI::Singleton< DDI::Store< DDName, DDI::LogicalPart * > > | StoreT |
Static Public Member Functions inherited from DDBase< DDName, DDI::LogicalPart * > | |
static auto | begin () |
static void | clear () |
static auto | end () |
static size_t | size () |
Protected Attributes inherited from DDBase< DDName, DDI::LogicalPart * > | |
prep_type | prep_ |
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
... of a unpositioned volume. DDLogicalPart provides thus an interface to its XML representation <LogicalPart ... </LogicalPart>.
An object of this class is a reference-object and thus lightweighted. It can be copied by value without having a large overhead. Assigning to the reference-object invalidates the object which was referred to before. Assigning also effects all other instances of this class which were created using the same value of DDName. In fact, the value of DDName identifies a LogicalPart uniquely.
Current Restriction: Only the name part of DDName identifies the LogicalPart.
Three kind of reference objects can be distinguished:
An unititialized reference object is somehow comparable to an anonymous structure. The default constructor (no arguments) is used to create it. No DDName was specified. It's not very useful unless you assign an initialized or defined reference object.
An initialized reference object is a reference object which was created first using only the constructor taking a single DDName as an argument. It's comparable to a variable declaration with default initialization (like std::vector
<
int
>
v
). The default object is registered using the DDName as index in some from the user hidden registry. After an initialized reference object has been created it can be used (copied, assigned to, beeing assigned to, ..) like a built in type like int
. As soon as an defined reference object with the same DDName is create, all already existing initialized reference object become defined reference object immidiately (some kind of one-definition-rule).
A defined reference object is a reference object which was created using a constructor taking DDName and additional arguments or using appropriate factory functions (e.g. DDbox) returning a defined reference object. As soon as one defined reference object A1
is created with a unique DDName N1
, every reference object A2
created by the constructor which only take DDName N2
as an argument and N2
== N1
, is also a defined reference object referring to the same object than A1
. Hence A1
== A2
is true. Further any previously created initialized reference objects having the same DDName also become references to the newly created defined reference object A1
.
To find out whether an instance of a reference object is defined or not, operator
bool
can be used, i.e.
Definition at line 92 of file DDLogicalPart.h.
|
inline |
The default constructor provides an uninitialzed reference object.
Definition at line 98 of file DDLogicalPart.h.
References eostools::cat(), python.rootplot.argparse::category, DDIsValid(), dataset::name, mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, DDEnums::unspecified, and mps_merge::weight.
Referenced by DDIsValid().
DDLogicalPart::DDLogicalPart | ( | const DDName & | name | ) |
Creates a reference object referring to the appropriate XML specification.
In order to use an uninitialized reference object one has to assign to it an initialized object of the same class.
Example:
One has to distinguish two cases:
Example:
Definition at line 103 of file DDLogicalPart.cc.
References DD_NC(), DDI::Singleton< I >::instance(), and DDBase< DDName, DDI::LogicalPart * >::prep_.
DDLogicalPart::DDLogicalPart | ( | const DDName & | ddname, |
const DDMaterial & | material, | ||
const DDSolid & | solid, | ||
DDEnums::Category | cat = DDEnums::unspecified |
||
) |
Registers (creates) a reference object representing a LogicalPart.
An object representing a logicalpart uniquely identified by its DDName name will be created. If reference objects of the same name already exist, they will refere to the newly created object. DDMaterial material and DDSolid solid are themselves reference objects to a material and solid specification. The need not be defined yet as long as they were constructed using unique DDName-objects.
This constructor is intended to be called by the XML parsing software, not by the DDD user. It decouples the input technologies (i.e. XML) and forms the transition to the runtime DDD representation. However, it could also be used for 'programming' a detector description.
Definition at line 122 of file DDLogicalPart.cc.
References DD_NC(), DDI::Singleton< I >::instance(), and DDBase< DDName, DDI::LogicalPart * >::prep_.
void DDLogicalPart::addSpecifics | ( | const std::pair< const DDPartSelection *, const DDsvalues_type * > & | s | ) |
don't use, internal only /todo make it private
Definition at line 244 of file DDLogicalPart.cc.
References DDBase< DDName, DDI::LogicalPart * >::rep().
const std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > & DDLogicalPart::attachedSpecifics | ( | void | ) | const |
Definition at line 409 of file DDLogicalPart.cc.
References DDBase< DDName, DDI::LogicalPart * >::rep().
Referenced by DDSpecificsHasNamedValueFilter::accept(), DDSpecificsMatchesValueFilter::accept(), DDSpecificsFilter::accept_impl(), OutputMagneticFieldDDToDDL::addToSpecStore(), OutputDDToDDL::addToSpecStore(), GeometryInfoDump::dumpInfo(), DDExpandedView::mergedSpecificsV(), and DDExpandedView::specificsV().
DDEnums::Category DDLogicalPart::category | ( | void | ) | const |
Returns the categorization of the DDLogicalPart (sensitive detector element, cable, ...)
Definition at line 140 of file DDLogicalPart.cc.
References DDBase< DDName, DDI::LogicalPart * >::rep().
Referenced by DDHtmlLpDetails::details().
bool DDLogicalPart::hasDDValue | ( | const DDValue & | v | ) | const |
Definition at line 252 of file DDLogicalPart.cc.
References relativeConstraints::empty, match(), AlCaHLTBitMon_ParallelJobs::p, DDBase< DDName, DDI::LogicalPart * >::rep(), alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.
Referenced by DDSpecificsHasNamedValueFilter::accept(), DDSpecificsMatchesValueFilter::accept(), and DDSpecificsFilter::accept_impl().
const DDMaterial & DDLogicalPart::material | ( | void | ) | const |
Returns a reference object of the material this LogicalPart is made of.
Definition at line 146 of file DDLogicalPart.cc.
References DDBase< DDName, DDI::LogicalPart * >::rep().
Referenced by ListIds::analyze(), OutputMagneticFieldDDToDDL::beginRun(), OutputDDToDDL::beginRun(), DDG4Builder::convertLV(), DDCheckLP(), DDHtmlLpDetails::details(), HCalSD::HCalSD(), HcalTB06BeamSD::HcalTB06BeamSD(), ECalSD::initMap(), DDCoreToDDXMLOutput::logicalPart(), DDDividedConsRho::makeDDLogicalPart(), DDDividedTrdX::makeDDLogicalPart(), DDDividedTubsRho::makeDDLogicalPart(), DDDividedBoxX::makeDDLogicalPart(), DDDividedPolyconeRho::makeDDLogicalPart(), DDDividedPolyhedraRho::makeDDLogicalPart(), DDDividedConsPhi::makeDDLogicalPart(), DDDividedTubsPhi::makeDDLogicalPart(), DDDividedTrdY::makeDDLogicalPart(), DDDividedBoxY::makeDDLogicalPart(), DDDividedPolyconePhi::makeDDLogicalPart(), DDDividedPolyhedraPhi::makeDDLogicalPart(), DDDividedConsZ::makeDDLogicalPart(), DDDividedTubsZ::makeDDLogicalPart(), DDDividedBoxZ::makeDDLogicalPart(), DDDividedTrdZ::makeDDLogicalPart(), DDDividedPolyconeZ::makeDDLogicalPart(), DDDividedPolyhedraZ::makeDDLogicalPart(), output(), MagGeoBuilderFromDDD::volumeHandle::volumeHandle(), and DDCompactViewImpl::weight().
DDsvalues_type DDLogicalPart::mergedSpecifics | ( | void | ) | const |
returns the merged-specifics, i.e. the last specified specifics of this logical-part
Definition at line 236 of file DDLogicalPart.cc.
References DDBase< DDName, DDI::LogicalPart * >::rep(), and mps_fire::result.
void DDLogicalPart::removeSpecifics | ( | const std::pair< DDPartSelection *, DDsvalues_type * > & | s | ) |
Definition at line 248 of file DDLogicalPart.cc.
References DDBase< DDName, DDI::LogicalPart * >::rep().
const DDSolid & DDLogicalPart::solid | ( | void | ) | const |
Returns a reference object of the solid being the shape of this LogicalPart.
Definition at line 152 of file DDLogicalPart.cc.
References DDBase< DDName, DDI::LogicalPart * >::rep().
Referenced by PrintGeomSummary::addSolid(), OutputMagneticFieldDDToDDL::beginRun(), OutputDDToDDL::beginRun(), CSCGeometryParsFromDD::build(), ME0GeometryBuilderFromDDD10EtaPart::buildChamber(), GEMGeometryBuilderFromDDD::buildChamber(), ME0GeometryBuilderFromDDD10EtaPart::buildEtaPartition(), GEMGeometryBuilderFromDDD::buildEtaPartition(), ME0GeometryParsFromDD::buildGeometry(), ME0GeometryBuilderFromDDD10EtaPart::buildGeometry(), GEMGeometryParsFromDD::buildGeometry(), ME0GeometryBuilderFromDDD::buildGeometry(), RPCGeometryBuilderFromDDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), ME0GeometryBuilderFromDDD10EtaPart::buildLayer(), GEMGeometryBuilderFromDDD::buildSuperChamber(), DDDividedTrdX::checkParametersValidity(), DDDividedPolyhedraRho::checkParametersValidity(), DDDividedPolyconeRho::checkParametersValidity(), DDDividedTrdY::checkParametersValidity(), DDDividedPolyhedraPhi::checkParametersValidity(), DDDividedTrdZ::checkParametersValidity(), DDDividedPolyconeZ::checkParametersValidity(), DDDividedPolyhedraZ::checkParametersValidity(), DDG4Builder::convertLV(), DDCheckLP(), DDDividedBoxX::DDDividedBoxX(), DDDividedBoxY::DDDividedBoxY(), DDDividedBoxZ::DDDividedBoxZ(), DDDividedConsPhi::DDDividedConsPhi(), DDDividedConsRho::DDDividedConsRho(), DDDividedConsZ::DDDividedConsZ(), DDDividedPolyconePhi::DDDividedPolyconePhi(), DDDividedPolyconeRho::DDDividedPolyconeRho(), DDDividedPolyconeZ::DDDividedPolyconeZ(), DDDividedPolyhedraPhi::DDDividedPolyhedraPhi(), DDDividedPolyhedraRho::DDDividedPolyhedraRho(), DDDividedPolyhedraZ::DDDividedPolyhedraZ(), DDDividedTrdX::DDDividedTrdX(), DDDividedTrdY::DDDividedTrdY(), DDDividedTrdZ::DDDividedTrdZ(), DDDividedTubsPhi::DDDividedTubsPhi(), DDDividedTubsRho::DDDividedTubsRho(), DDDividedTubsZ::DDDividedTubsZ(), HGCalSimHitValidation::defineGeometry(), DDHtmlLpDetails::details(), DTGeometryBuilderFromDDD::extractParameters(), DTGeometryParsFromDD::extractParameters(), DDDividedTubsRho::getMaxParameter(), DDDividedConsRho::getMaxParameter(), DDDividedTrdX::getMaxParameter(), DDDividedBoxX::getMaxParameter(), DDDividedPolyhedraRho::getMaxParameter(), DDDividedPolyconeRho::getMaxParameter(), DDDividedTubsPhi::getMaxParameter(), DDDividedConsPhi::getMaxParameter(), DDDividedBoxY::getMaxParameter(), DDDividedTrdY::getMaxParameter(), DDDividedPolyconePhi::getMaxParameter(), DDDividedPolyhedraPhi::getMaxParameter(), DDDividedTubsZ::getMaxParameter(), DDDividedConsZ::getMaxParameter(), DDDividedBoxZ::getMaxParameter(), DDDividedTrdZ::getMaxParameter(), DDDividedPolyconeZ::getMaxParameter(), DDDividedPolyhedraZ::getMaxParameter(), DreamSD::initMap(), ECalSD::initMap(), HcalTB02SD::initMap(), HcalGeomParameters::loadGeometry(), HGCalGeomParameters::loadGeometryHexagon(), HGCalGeomParameters::loadGeometrySquare(), DDCoreToDDXMLOutput::logicalPart(), DDDividedTubsRho::makeDDLogicalPart(), DDDividedConsRho::makeDDLogicalPart(), DDDividedTrdX::makeDDLogicalPart(), DDDividedBoxX::makeDDLogicalPart(), DDDividedPolyconeRho::makeDDLogicalPart(), DDDividedPolyhedraRho::makeDDLogicalPart(), DDDividedTubsPhi::makeDDLogicalPart(), DDDividedConsPhi::makeDDLogicalPart(), DDDividedBoxY::makeDDLogicalPart(), DDDividedTrdY::makeDDLogicalPart(), DDDividedPolyconePhi::makeDDLogicalPart(), DDDividedPolyhedraPhi::makeDDLogicalPart(), DDDividedTubsZ::makeDDLogicalPart(), DDDividedConsZ::makeDDLogicalPart(), DDDividedBoxZ::makeDDLogicalPart(), DDDividedTrdZ::makeDDLogicalPart(), DDDividedPolyconeZ::makeDDLogicalPart(), DDDividedPolyhedraZ::makeDDLogicalPart(), DDDividedTrdX::makeDDTranslation(), DDDividedBoxX::makeDDTranslation(), DDDividedBoxY::makeDDTranslation(), DDDividedTrdY::makeDDTranslation(), DDDividedTubsZ::makeDDTranslation(), DDDividedConsZ::makeDDTranslation(), DDDividedBoxZ::makeDDTranslation(), DDDividedTrdZ::makeDDTranslation(), DDDividedPolyconeZ::makeDDTranslation(), DDDividedPolyhedraZ::makeDDTranslation(), DDLDivision::makeDivider(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), DDCompareLP::operator()(), output(), DDLDivision::processElement(), DDI::Division::stream(), and DDCompactViewImpl::weight().
std::vector< const DDsvalues_type * > DDLogicalPart::specifics | ( | void | ) | const |
returns the specific-data attached to the LogicalPart only (not to a DDExpandedNode)
The method will only return specific data attached to a DDLogicalPart. If DDL-XML is used to define specific data, the path-attribute of <PartSelector> addressing only LogicalParts only consists of a "//" and the name of the LogicalPart (or a regexp for the name):
The above XML assigns specific data to a DDLogicalPart with name "BarrelDetector" and to all DDLogicalParts whose names match the regexp "ForwardSector1.*Cable.", e.g. "ForwardSector123abCable7" Two parameters are attached as specific data: "rgb" - a std::vector of three values, and "visible" - a std::vector of one value.
The method DDLogicalPart::specifics() now returns a std::vector<const DDsvalues_type *> V which correspond to these two values. Every entry in V comes from a different <SpecPar> tag. In our example above, V would have size 1, e.g. V.size() == 1.
A <Paramter> is std::mapped to DDValue. 'value' of <Parameter> is kept as a std::string and as a double. If the std::string does not evaluate correctly to double, 0 is the assigned.
Here's the code to retrieve the 'rgb' Parameter:
Definition at line 228 of file DDLogicalPart.cc.
References DDBase< DDName, DDI::LogicalPart * >::rep(), and mps_fire::result.
Referenced by DDG4Builder::getDouble(), MuonDDDNumbering::getInt(), DDG4Builder::getInt(), and DDG4SensitiveConverter::getString().
double & DDLogicalPart::weight | ( | void | ) |
Weight of the LogicalPart viewed as a component, if cached, else -1.
Definition at line 169 of file DDLogicalPart.cc.
References DDBase< DDName, DDI::LogicalPart * >::rep().
Referenced by DDCompactViewImpl::weight().
|
friend |
Definition at line 33 of file DDLogicalPart.cc.