CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 &)
 

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 ( 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) {}
const edm::EventSetup & c
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

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

Definition at line 24 of file LogicalPart.cc.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, hasDDValue_, gpuClustering::id, 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 }
uint16_t *__restrict__ id
std::vector< bool > hasDDValue_
Definition: LogicalPart.h:44
std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > specifics_
Definition: LogicalPart.h:43
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
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
bool LogicalPart::hasDDValue ( const DDValue v) const

Definition at line 42 of file LogicalPart.cc.

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

42  {
43  bool result = false;
44  unsigned int id = v.id();
45  if (id < hasDDValue_.size()) {
46  result = hasDDValue_[id];
47  }
48  return result;
49 }
uint16_t *__restrict__ id
unsigned int id(void) const
returns the ID of the DDValue
Definition: DDValue.h:48
tuple result
Definition: mps_fire.py:311
std::vector< bool > hasDDValue_
Definition: LogicalPart.h:44
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
DDsvalues_type LogicalPart::mergedSpecifics ( void  ) const

Definition at line 72 of file LogicalPart.cc.

References isotrackNtupler::merged, and mergedSpecificsV().

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

Definition at line 78 of file LogicalPart.cc.

References MatrixUtil::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 }
void specificsV(std::vector< const DDsvalues_type * > &result) const
Definition: LogicalPart.cc:63
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
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 57 of file LogicalPart.cc.

References mps_fire::result, and specificsV().

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

Definition at line 63 of file LogicalPart.cc.

References ddanylogp, 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 }
tuple result
Definition: mps_fire.py:311
std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > specifics_
Definition: LogicalPart.h:43
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

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

Definition at line 40 of file LogicalPart.h.

Referenced by category().

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

Definition at line 44 of file LogicalPart.h.

Referenced by addSpecifics(), and hasDDValue().

DDMaterial DDI::LogicalPart::material_
private

Definition at line 38 of file LogicalPart.h.

Referenced by material().

DDSolid DDI::LogicalPart::solid_
private

Definition at line 39 of file LogicalPart.h.

Referenced by solid().

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().

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

Definition at line 42 of file LogicalPart.h.