CMS 3D CMS Logo

DDI::LogicalPart Class Reference

#include <DetectorDescription/Core/src/LogicalPart.h>

List of all members.

Public Member Functions

void addSpecifics (const std::pair< DDPartSelection *, DDsvalues_type * > &)
const std::vector< std::pair
< DDPartSelection *,
DDsvalues_type * > > & 
attachedSpecifics () const
DDEnums::Category category () const
bool hasDDValue (const DDValue &) const
 LogicalPart (const DDMaterial &, const DDSolid &, DDEnums::Category=DDEnums::unspecified)
const DDMaterialmaterial () const
DDsvalues_type mergedSpecifics () const
void mergedSpecificsV (DDsvalues_type &res) const
void removeSpecifics (const std::pair< DDPartSelection *, DDsvalues_type * > &)
const DDSolidsolid () const
std::vector< const
DDsvalues_type * > 
specifics () const
void specificsV (std::vector< const DDsvalues_type * > &result) const
void stream (std::ostream &)
double & weight ()

Private Attributes

DDEnums::Category cat_
std::vector< boolhasDDValue_
DDMaterial material_
DDSolid solid_
std::vector< std::pair
< DDPartSelection *,
DDsvalues_type * > > 
specifics_
std::map< DDValue, std::vector
< DDPartSelection * > > 
valToParsel_
double weight_


Detailed Description

Definition at line 18 of file LogicalPart.h.


Constructor & Destructor Documentation

LogicalPart::LogicalPart ( const DDMaterial m,
const DDSolid s,
DDEnums::Category  c = DDEnums::unspecified 
)

Definition at line 11 of file LogicalPart.cc.

00014  : material_(m), solid_(s), cat_(c), weight_(0), specifics_(0), hasDDValue_(1,false)
00015 { }


Member Function Documentation

void LogicalPart::addSpecifics ( const std::pair< DDPartSelection *, DDsvalues_type * > &  s  ) 

Definition at line 30 of file LogicalPart.cc.

References TestMuL1L2Filter_cff::cerr, DCOUT, lat::endl(), flush(), hasDDValue_, it, and specifics_.

00031 {
00032   if ( ! (s.first && s.second) ) {
00033     // FIXME
00034     std::cerr << "LogicalPart::addSpecific error pointer 0 " 
00035               << s.first << "," << s.second << std::endl;
00036     return;
00037   }
00038   specifics_.push_back(s);
00039   DDsvalues_type::const_iterator it = s.second->begin();
00040   DDsvalues_type::const_iterator ed = s.second->end();
00041   for (; it != ed; ++it) {
00042     unsigned int id = it->first;
00043     if ( id < hasDDValue_.size() ) {
00044       hasDDValue_[id] = true;
00045     }
00046     else {
00047       hasDDValue_.resize(id+1,false);
00048       hasDDValue_[id] = true;
00049     }
00050     
00051     DCOUT('S', "hasValue_.size()=" << hasDDValue_.size() << " DDValue_id=" << id << std::flush
00052           << " DDValue_name=" << DDValue(id).name() << std::flush 
00053            << " DDValue_string=" << DDValue(id).strings().size() );
00054   }
00055 }

const std::vector<std::pair< DDPartSelection*, DDsvalues_type* > >& DDI::LogicalPart::attachedSpecifics (  )  const [inline]

Definition at line 34 of file LogicalPart.h.

References specifics_.

00034 { return specifics_; }

DDEnums::Category LogicalPart::category (  )  const

Definition at line 22 of file LogicalPart.cc.

References cat_.

00022 { return cat_; }

bool LogicalPart::hasDDValue ( const DDValue v  )  const

Definition at line 57 of file LogicalPart.cc.

References hasDDValue_, DDValue::id(), and HLT_VtxMuL3::result.

00058 {
00059    bool result = false;
00060    unsigned int id = v.id();
00061    if ( id < hasDDValue_.size()) {
00062      result = hasDDValue_[id];
00063    }
00064    return result; 
00065 }

const DDMaterial & LogicalPart::material (  )  const

Definition at line 20 of file LogicalPart.cc.

References material_.

Referenced by stream().

00020 { return material_; }

DDsvalues_type LogicalPart::mergedSpecifics (  )  const

Definition at line 96 of file LogicalPart.cc.

References mergedSpecificsV().

00096                                                   {
00097   DDsvalues_type merged;
00098   mergedSpecificsV(merged);  
00099   return merged;
00100 }

void LogicalPart::mergedSpecificsV ( DDsvalues_type res  )  const

Definition at line 103 of file LogicalPart.cc.

References it, merge(), and specificsV().

Referenced by mergedSpecifics().

00103                                                                 {
00104   merged.clear();
00105   std::vector<const DDsvalues_type *> unmerged; specificsV(unmerged);
00106   if (unmerged.size()==1) {
00107     merged = *(unmerged[0]);
00108   }
00109   else if (unmerged.size()>1) {
00110     std::vector<const DDsvalues_type *>::const_iterator it = unmerged.begin();
00111     std::vector<const DDsvalues_type *>::const_iterator ed = unmerged.end();
00112     for (; it != ed; ++it) {
00113       merge(merged, **it);
00114     } 
00115   }
00116 }  

void LogicalPart::removeSpecifics ( const std::pair< DDPartSelection *, DDsvalues_type * > &  s  ) 

Definition at line 67 of file LogicalPart.cc.

References find(), it, and specifics_.

00068 {
00069    std::vector<std::pair<DDPartSelection*,DDsvalues_type* > >::iterator it = 
00070      std::find(specifics_.begin(),specifics_.end(),s);
00071    specifics_.erase(it);
00072 }

const DDSolid & LogicalPart::solid (  )  const

Definition at line 21 of file LogicalPart.cc.

References solid_.

Referenced by stream().

00021 { return solid_; }

std::vector< const DDsvalues_type * > LogicalPart::specifics (  )  const

Definition at line 75 of file LogicalPart.cc.

References HLT_VtxMuL3::result, and specificsV().

00076 {
00077    std::vector<const DDsvalues_type*> result;
00078    specificsV(result);
00079    return result;
00080 
00081 }

void LogicalPart::specificsV ( std::vector< const DDsvalues_type * > &  result  )  const

Definition at line 83 of file LogicalPart.cc.

References ddanylogp, it, and specifics_.

Referenced by mergedSpecificsV(), and specifics().

00084 {
00085   typedef std::vector<std::pair<DDPartSelection*,DDsvalues_type* > > sp_type;
00086   sp_type::const_iterator it = specifics_.begin();
00087   sp_type::const_iterator ed = specifics_.end();
00088   for (; it != ed; ++it) {
00089     DDPartSelection & ps = *(it->first);
00090     if (ps.size()==1 && ps[0].selectionType_==ddanylogp) {
00091       result.push_back(it->second);
00092     }
00093   }
00094 }

void LogicalPart::stream ( std::ostream &  os  ) 

Definition at line 23 of file LogicalPart.cc.

References DDBase< N, C >::ddname(), lat::endl(), material(), and solid().

00024 {
00025   os << std::endl << " mat=" << material().ddname() << std::endl << " solid=" << solid();
00026 }

double & LogicalPart::weight (  ) 

Definition at line 28 of file LogicalPart.cc.

References weight_.

00028 { return weight_; }


Member Data Documentation

DDEnums::Category DDI::LogicalPart::cat_ [private]

Definition at line 42 of file LogicalPart.h.

Referenced by category().

std::vector<bool> DDI::LogicalPart::hasDDValue_ [private]

Definition at line 48 of file LogicalPart.h.

Referenced by addSpecifics(), and hasDDValue().

DDMaterial DDI::LogicalPart::material_ [private]

Definition at line 40 of file LogicalPart.h.

Referenced by material().

DDSolid DDI::LogicalPart::solid_ [private]

Definition at line 41 of file LogicalPart.h.

Referenced by solid().

std::vector<std::pair<DDPartSelection*,DDsvalues_type* > > DDI::LogicalPart::specifics_ [private]

Definition at line 47 of file LogicalPart.h.

Referenced by addSpecifics(), attachedSpecifics(), removeSpecifics(), and specificsV().

std::map<DDValue, std::vector<DDPartSelection*> > DDI::LogicalPart::valToParsel_ [private]

Definition at line 46 of file LogicalPart.h.

double DDI::LogicalPart::weight_ [private]

Definition at line 43 of file LogicalPart.h.

Referenced by weight().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:37:09 2009 for CMSSW by  doxygen 1.5.4