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) {}

Member Function Documentation

◆ addSpecifics()

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

Definition at line 24 of file LogicalPart.cc.

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 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, hasDDValue_, triggerObjects_cff::id, alignCSCRings::s, and specifics_.

◆ 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.

30  {
31  return specifics_;
32  }

References specifics_.

◆ category()

DDEnums::Category LogicalPart::category ( void  ) const

Definition at line 18 of file LogicalPart.cc.

18 { return cat_; }

References cat_.

◆ hasDDValue()

bool LogicalPart::hasDDValue ( const DDValue v) const

Definition at line 42 of file LogicalPart.cc.

42  {
43  bool result = false;
44  unsigned int id = v.id();
45  if (id < hasDDValue_.size()) {
47  }
48  return result;
49 }

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

◆ material()

const DDMaterial & LogicalPart::material ( void  ) const

Definition at line 14 of file LogicalPart.cc.

14 { return material_; }

References material_.

Referenced by stream().

◆ mergedSpecifics()

DDsvalues_type LogicalPart::mergedSpecifics ( void  ) const

Definition at line 72 of file LogicalPart.cc.

72  {
73  DDsvalues_type merged;
74  mergedSpecificsV(merged);
75  return merged;
76 }

References mergedSpecificsV().

◆ mergedSpecificsV()

void LogicalPart::mergedSpecificsV ( DDsvalues_type res) const

Definition at line 78 of file LogicalPart.cc.

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 }

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

Referenced by mergedSpecifics().

◆ removeSpecifics()

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

Definition at line 51 of file LogicalPart.cc.

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 }

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

◆ solid()

const DDSolid & LogicalPart::solid ( void  ) const

Definition at line 16 of file LogicalPart.cc.

16 { return solid_; }

References solid_.

Referenced by stream().

◆ specifics()

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

Definition at line 57 of file LogicalPart.cc.

57  {
58  std::vector<const DDsvalues_type*> result;
60  return result;
61 }

References mps_fire::result, and specificsV().

◆ specificsV()

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

Definition at line 63 of file LogicalPart.cc.

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 }

References ddanylogp, mps_fire::result, and specifics_.

Referenced by mergedSpecificsV(), and specifics().

◆ stream()

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

Definition at line 20 of file LogicalPart.cc.

20  {
21  os << std::endl << " mat=" << material().ddname() << std::endl << " solid=" << solid();
22 }

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

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.

DDI::LogicalPart::solid
const DDSolid & solid() const
Definition: LogicalPart.cc:16
DDI::LogicalPart::solid_
DDSolid solid_
Definition: LogicalPart.h:39
DDI::LogicalPart::mergedSpecificsV
void mergedSpecificsV(DDsvalues_type &res) const
Definition: LogicalPart.cc:78
DDI::LogicalPart::hasDDValue_
std::vector< bool > hasDDValue_
Definition: LogicalPart.h:44
DDPartSelection
Definition: DDPartSelection.h:37
findQualityFiles.v
v
Definition: findQualityFiles.py:179
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
DDI::LogicalPart::specificsV
void specificsV(std::vector< const DDsvalues_type * > &result) const
Definition: LogicalPart.cc:63
DDI::LogicalPart::material
const DDMaterial & material() const
Definition: LogicalPart.cc:14
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DDI::LogicalPart::material_
DDMaterial material_
Definition: LogicalPart.h:38
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
DDBase::ddname
const N & ddname() const
Definition: DDBase.h:61
DDI::LogicalPart::specifics_
std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > specifics_
Definition: LogicalPart.h:43
ddanylogp
Definition: DDPartSelection.h:15
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
DDI::LogicalPart::cat_
DDEnums::Category cat_
Definition: LogicalPart.h:40
mps_fire.result
result
Definition: mps_fire.py:311
MatrixUtil.merge
def merge(dictlist, TELL=False)
Definition: MatrixUtil.py:201
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
DDsvalues_type
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12