CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DDI::LogicalPart Class Reference

#include <LogicalPart.h>

Public Member Functions

void addSpecifics (const std::pair< const DDPartSelection *, const DDsvalues_type * > &)
 
const std::vector< std::pair
< const DDPartSelection
*, const 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< const DDPartSelection *, const 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< bool > hasDDValue_
 
DDMaterial material_
 
DDSolid solid_
 
std::vector< std::pair< const
DDPartSelection *, const
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 8 of file LogicalPart.cc.

11  : material_(m), solid_(s), cat_(c), weight_(0), specifics_(0), hasDDValue_(1,false)
12 { }
std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > specifics_
Definition: LogicalPart.h:47
std::vector< bool > hasDDValue_
Definition: LogicalPart.h:48
DDMaterial material_
Definition: LogicalPart.h:40
DDEnums::Category cat_
Definition: LogicalPart.h:42

Member Function Documentation

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

Definition at line 27 of file LogicalPart.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, DCOUT, hasDDValue_, DDValue::name(), specifics_, and DDValue::strings().

28 {
29  if ( ! (s.first && s.second) ) {
30  // FIXME
31  std::cerr << "LogicalPart::addSpecific error pointer 0 "
32  << s.first << "," << s.second << std::endl;
33  return;
34  }
35  specifics_.push_back(s);
36  for( const auto& it : *s.second ) {
37  unsigned int id = it.first;
38  if ( id < hasDDValue_.size() ) {
39  hasDDValue_[id] = true;
40  }
41  else {
42  hasDDValue_.resize(id+1,false);
43  hasDDValue_[id] = true;
44  }
45 
46  DCOUT('S', "hasValue_.size()=" << hasDDValue_.size() << " DDValue_id=" << id << std::flush
47  << " DDValue_name=" << DDValue(id).name() << std::flush
48  << " DDValue_string=" << DDValue(id).strings().size() );
49  }
50 }
const std::string & name(void) const
the name of the DDValue
Definition: DDValue.h:55
std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > specifics_
Definition: LogicalPart.h:47
std::vector< bool > hasDDValue_
Definition: LogicalPart.h:48
const std::vector< std::string > & strings() const
a reference to the std::string-valued values stored in the given instance of DDValue ...
Definition: DDValue.h:62
#define DCOUT(M_v_Y, M_v_S)
Definition: DDdebug.h:53
const std::vector<std::pair<const DDPartSelection*,const DDsvalues_type* > >& DDI::LogicalPart::attachedSpecifics ( ) const
inline

Definition at line 34 of file LogicalPart.h.

References specifics_.

34 { return specifics_; }
std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > specifics_
Definition: LogicalPart.h:47
DDEnums::Category LogicalPart::category ( void  ) const

Definition at line 18 of file LogicalPart.cc.

References cat_.

18 { return cat_; }
DDEnums::Category cat_
Definition: LogicalPart.h:42
bool LogicalPart::hasDDValue ( const DDValue v) const

Definition at line 52 of file LogicalPart.cc.

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

53 {
54  bool result = false;
55  unsigned int id = v.id();
56  if ( id < hasDDValue_.size()) {
57  result = hasDDValue_[id];
58  }
59  return result;
60 }
unsigned int id(void) const
returns the ID of the DDValue
Definition: DDValue.h:49
tuple result
Definition: mps_fire.py:84
std::vector< bool > hasDDValue_
Definition: LogicalPart.h:48
const DDMaterial & LogicalPart::material ( void  ) const

Definition at line 14 of file LogicalPart.cc.

References material_.

Referenced by stream().

14 { return material_; }
DDMaterial material_
Definition: LogicalPart.h:40
DDsvalues_type LogicalPart::mergedSpecifics ( void  ) const

Definition at line 87 of file LogicalPart.cc.

References mergedSpecificsV().

87  {
88  DDsvalues_type merged;
89  mergedSpecificsV(merged);
90  return merged;
91 }
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:19
void mergedSpecificsV(DDsvalues_type &res) const
Definition: LogicalPart.cc:93
void LogicalPart::mergedSpecificsV ( DDsvalues_type res) const

Definition at line 93 of file LogicalPart.cc.

References MatrixUtil::merge(), and specificsV().

Referenced by mergedSpecifics().

93  {
94  merged.clear();
95  std::vector<const DDsvalues_type *> unmerged;
96  specificsV(unmerged);
97  if (unmerged.size()==1) {
98  merged = *(unmerged[0]);
99  }
100  else if (unmerged.size()>1) {
101  for( const auto& it : unmerged ) {
102  merge(merged, *it);
103  }
104  }
105 }
void specificsV(std::vector< const DDsvalues_type * > &result) const
Definition: LogicalPart.cc:77
void LogicalPart::removeSpecifics ( const std::pair< const DDPartSelection *, const DDsvalues_type * > &  s)

Definition at line 62 of file LogicalPart.cc.

References spr::find(), alignCSCRings::s, and specifics_.

63 {
64  std::vector<std::pair<const DDPartSelection*, const DDsvalues_type* > >::iterator it =
65  std::find(specifics_.begin(),specifics_.end(),s);
66  specifics_.erase(it);
67 }
std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > specifics_
Definition: LogicalPart.h:47
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const DDSolid & LogicalPart::solid ( void  ) const

Definition at line 16 of file LogicalPart.cc.

References solid_.

Referenced by stream().

16 { return solid_; }
std::vector< const DDsvalues_type * > LogicalPart::specifics ( void  ) const

Definition at line 69 of file LogicalPart.cc.

References mps_fire::result, and specificsV().

70 {
71  std::vector<const DDsvalues_type*> result;
72  specificsV(result);
73  return result;
74 
75 }
tuple result
Definition: mps_fire.py:84
void specificsV(std::vector< const DDsvalues_type * > &result) const
Definition: LogicalPart.cc:77
void LogicalPart::specificsV ( std::vector< const DDsvalues_type * > &  result) const

Definition at line 77 of file LogicalPart.cc.

References ddanylogp, and specifics_.

Referenced by mergedSpecificsV(), and specifics().

78 {
79  for( const auto& it : specifics_ ) {
80  const DDPartSelection & ps = *(it.first);
81  if (ps.size()==1 && ps[0].selectionType_==ddanylogp) {
82  result.push_back(it.second);
83  }
84  }
85 }
std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > specifics_
Definition: LogicalPart.h:47
tuple result
Definition: mps_fire.py:84
void LogicalPart::stream ( std::ostream &  os)

Definition at line 20 of file LogicalPart.cc.

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

21 {
22  os << std::endl << " mat=" << material().ddname() << std::endl << " solid=" << solid();
23 }
const DDMaterial & material() const
Definition: LogicalPart.cc:14
const DDSolid & solid() const
Definition: LogicalPart.cc:16
const N & ddname() const
Definition: DDBase.h:80
double & LogicalPart::weight ( void  )

Definition at line 25 of file LogicalPart.cc.

References weight_.

25 { 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<const DDPartSelection*, const 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().