CMS 3D CMS Logo

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 &)
 

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_
 

Detailed Description

Definition at line 18 of file LogicalPart.h.

Constructor & Destructor Documentation

◆ LogicalPart()

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

Definition at line 11 of file LogicalPart.cc.

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

Member Function Documentation

◆ addSpecifics()

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

Definition at line 24 of file LogicalPart.cc.

References DMR_cfg::cerr, hasDDValue_, l1ctLayer2EG_cff::id, alignCSCRings::s, and specifics_.

24  {
25  if (!(s.first && s.second)) {
26  // FIXME
27  std::cerr << "LogicalPart::addSpecific error pointer 0 " << s.first << "," << s.second << std::endl;
28  return;
29  }
30  specifics_.emplace_back(s);
31  for (const auto& it : *s.second) {
32  unsigned int id = it.first;
33  if (id < hasDDValue_.size()) {
34  hasDDValue_[id] = true;
35  } else {
36  hasDDValue_.resize(id + 1, false);
37  hasDDValue_[id] = true;
38  }
39  }
40 }
std::vector< bool > hasDDValue_
Definition: LogicalPart.h:44
std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > specifics_
Definition: LogicalPart.h:43

◆ attachedSpecifics()

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

Definition at line 30 of file LogicalPart.h.

References specifics_.

30  {
31  return specifics_;
32  }
std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > specifics_
Definition: LogicalPart.h:43

◆ category()

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:40

◆ hasDDValue()

bool LogicalPart::hasDDValue ( const DDValue v) const

Definition at line 42 of file LogicalPart.cc.

References hasDDValue_, l1ctLayer2EG_cff::id, mps_fire::result, and findQualityFiles::v.

42  {
43  bool result = false;
44  unsigned int id = v.id();
45  if (id < hasDDValue_.size()) {
47  }
48  return result;
49 }
std::vector< bool > hasDDValue_
Definition: LogicalPart.h:44

◆ material()

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:38

◆ mergedSpecifics()

DDsvalues_type LogicalPart::mergedSpecifics ( void  ) const

Definition at line 72 of file LogicalPart.cc.

References mergedSpecificsV().

72  {
73  DDsvalues_type merged;
74  mergedSpecificsV(merged);
75  return merged;
76 }
void mergedSpecificsV(DDsvalues_type &res) const
Definition: LogicalPart.cc:78
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12

◆ mergedSpecificsV()

void LogicalPart::mergedSpecificsV ( DDsvalues_type res) const

Definition at line 78 of file LogicalPart.cc.

References merge(), and specificsV().

Referenced by mergedSpecifics().

78  {
79  merged.clear();
80  std::vector<const DDsvalues_type*> unmerged;
81  specificsV(unmerged);
82  if (unmerged.size() == 1) {
83  merged = *(unmerged[0]);
84  } else if (unmerged.size() > 1) {
85  for (const auto& it : unmerged) {
86  merge(merged, *it);
87  }
88  }
89 }
int merge(int argc, char *argv[])
Definition: DiMuonVmerge.cc:27
void specificsV(std::vector< const DDsvalues_type *> &result) const
Definition: LogicalPart.cc:63

◆ removeSpecifics()

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

Definition at line 51 of file LogicalPart.cc.

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

51  {
52  std::vector<std::pair<const DDPartSelection*, const DDsvalues_type*> >::iterator it =
53  std::find(specifics_.begin(), specifics_.end(), s);
54  specifics_.erase(it);
55 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > specifics_
Definition: LogicalPart.h:43

◆ solid()

const DDSolid & LogicalPart::solid ( void  ) const

Definition at line 16 of file LogicalPart.cc.

References solid_.

Referenced by stream().

16 { return solid_; }

◆ specifics()

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

Definition at line 57 of file LogicalPart.cc.

References mps_fire::result, and specificsV().

57  {
58  std::vector<const DDsvalues_type*> result;
60  return result;
61 }
void specificsV(std::vector< const DDsvalues_type *> &result) const
Definition: LogicalPart.cc:63

◆ specificsV()

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

Definition at line 63 of file LogicalPart.cc.

References ddanylogp, mps_fire::result, and specifics_.

Referenced by mergedSpecificsV(), and specifics().

63  {
64  for (const auto& it : specifics_) {
65  const DDPartSelection& ps = *(it.first);
66  if (ps.size() == 1 && ps[0].selectionType_ == ddanylogp) {
67  result.emplace_back(it.second);
68  }
69  }
70 }
std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > specifics_
Definition: LogicalPart.h:43

◆ stream()

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

Definition at line 20 of file LogicalPart.cc.

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

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

Member Data Documentation

◆ cat_

DDEnums::Category DDI::LogicalPart::cat_
private

Definition at line 40 of file LogicalPart.h.

Referenced by category().

◆ hasDDValue_

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

Definition at line 44 of file LogicalPart.h.

Referenced by addSpecifics(), and hasDDValue().

◆ material_

DDMaterial DDI::LogicalPart::material_
private

Definition at line 38 of file LogicalPart.h.

Referenced by material().

◆ solid_

DDSolid DDI::LogicalPart::solid_
private

Definition at line 39 of file LogicalPart.h.

Referenced by solid().

◆ specifics_

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

Definition at line 43 of file LogicalPart.h.

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

◆ valToParsel_

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

Definition at line 42 of file LogicalPart.h.