CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
CmsDetConstruction< FilteredView > Class Template Reference

#include <CmsDetConstruction.h>

Inheritance diagram for CmsDetConstruction< FilteredView >:
CmsTrackerLevelBuilder< FilteredView > CmsTrackerAbstractConstruction< FilteredView >

Public Member Functions

void buildComponent (FilteredView &, GeometricDet *, const std::string &) override
 
template<>
void buildComponent (DDFilteredView &fv, GeometricDet *mother, const std::string &attribute)
 
template<>
void buildComponent (cms::DDFilteredView &fv, GeometricDet *mother, const std::string &attribute)
 
- Public Member Functions inherited from CmsTrackerLevelBuilder< FilteredView >
void build (FilteredView &, GeometricDet *, const std::string &) override
 
template<>
void build (DDFilteredView &fv, GeometricDet *tracker, const std::string &attribute)
 
template<>
void build (cms::DDFilteredView &fv, GeometricDet *tracker, const std::string &attribute)
 
 ~CmsTrackerLevelBuilder () override
 
- Public Member Functions inherited from CmsTrackerAbstractConstruction< FilteredView >
virtual ~CmsTrackerAbstractConstruction ()=default
 

Private Member Functions

void buildDets (const FilteredView &, GeometricDet *, const std::string &)
 
void buildSmallDetsforGlued (FilteredView &, GeometricDet *, const std::string &)
 
void buildSmallDetsforStack (FilteredView &, GeometricDet *, const std::string &)
 

Additional Inherited Members

- Protected Attributes inherited from CmsTrackerLevelBuilder< FilteredView >
CmsTrackerStringToEnum theCmsTrackerStringToEnum
 

Detailed Description

template<class FilteredView>
class CmsDetConstruction< FilteredView >

Adds GeometricDets representing final modules to the previous level

Definition at line 12 of file CmsDetConstruction.h.

Member Function Documentation

◆ buildComponent() [1/3]

template<class FilteredView>
void CmsDetConstruction< FilteredView >::buildComponent ( FilteredView &  ,
GeometricDet ,
const std::string &   
)
overridevirtual

◆ buildComponent() [2/3]

template<>
void CmsDetConstruction< DDFilteredView >::buildComponent ( DDFilteredView fv,
GeometricDet mother,
const std::string &  attribute 
)

Definition at line 52 of file CmsDetConstruction.cc.

References GeometricDet::addComponent(), DDFilteredView::firstChild(), ExtractStringFromDDD< FilteredView >::getString(), GeometricDet::mergedDet, DDFilteredView::nextSibling(), GeometricDet::OTPhase2Stack, DDFilteredView::parent(), and AlCaHLTBitMon_QueryRunRegistry::string.

54  {
55  // Mother volume
56  // Module with 2 sensors: the mother volume is the module volume.
57  // Module with 1 sensor: the mother volume is the ladder volume.
58  const std::string& myTopologicalNameInXMLs = ExtractStringFromDDD<DDFilteredView>::getString(attribute, &fv);
59  const GeometricDet::GDEnumType& myTopologicalType =
61 
62  GeometricDet* det = new GeometricDet(&fv, myTopologicalType);
63 
64  const bool isPhase1ModuleWith2Sensors = (myTopologicalType == GeometricDet::mergedDet);
65  const bool isPhase2ModuleWith2Sensors = (myTopologicalType == GeometricDet::OTPhase2Stack);
66 
67  // CASE A: MODULE HAS 2 SENSORS
68  if (isPhase1ModuleWith2Sensors || isPhase2ModuleWith2Sensors) {
69  // Go down in hierarchy: from module to sensor
70  bool dodets = fv.firstChild(); // very important
71  while (dodets) {
72  // PHASE 1 (MERGEDDET)
73  if (isPhase1ModuleWith2Sensors) {
74  buildSmallDetsforGlued(fv, det, attribute);
75  }
76  // PHASE 2 (STACKDET)
77  else if (isPhase2ModuleWith2Sensors) {
78  buildSmallDetsforStack(fv, det, attribute);
79  }
80 
81  dodets = fv.nextSibling();
82  }
83 
84  fv.parent();
85  }
86 
87  // CASE B: MODULE HAS 1 SENSOR: NOTHING SPECIFIC TO DO
88  // Indeed, we are not going to sort sensors within module, if there is only 1 sensor!
89 
90  // ALL CASES: add sensor to its mother volume (module or ladder).
91  mother->addComponent(det);
92 }
bool parent()
set the current node to the parent node ...
static std::string getString(const std::string &, FilteredView *)
void addComponent(GeometricDet *)
bool nextSibling()
set the current node to the next sibling ...
void buildSmallDetsforStack(FilteredView &, GeometricDet *, const std::string &)
void buildSmallDetsforGlued(FilteredView &, GeometricDet *, const std::string &)
bool firstChild()
set the current node to the first child ...

◆ buildComponent() [3/3]

template<>
void CmsDetConstruction< cms::DDFilteredView >::buildComponent ( cms::DDFilteredView fv,
GeometricDet mother,
const std::string &  attribute 
)

Definition at line 100 of file CmsDetConstruction.cc.

References GeometricDet::addComponent(), cms::DDFilteredView::firstChild(), ExtractStringFromDDD< FilteredView >::getString(), cms::DDFilteredView::level(), GeometricDet::mergedDet, GeometricDet::OTPhase2Stack, and AlCaHLTBitMon_QueryRunRegistry::string.

102  {
103  // Mother volume
104  // Module with 2 sensors: the mother volume is the module volume.
105  // Module with 1 sensor: the mother volume is the ladder volume.
106  const std::string& myTopologicalNameInXMLs = ExtractStringFromDDD<cms::DDFilteredView>::getString(attribute, &fv);
107  const GeometricDet::GDEnumType& myTopologicalType =
109  GeometricDet* det = new GeometricDet(&fv, myTopologicalType);
110 
111  const bool isPhase1ModuleWith2Sensors = (myTopologicalType == GeometricDet::mergedDet);
112  const bool isPhase2ModuleWith2Sensors = (myTopologicalType == GeometricDet::OTPhase2Stack);
113 
114  // CASE A: MODULE HAS 2 SENSORS
115  if (isPhase1ModuleWith2Sensors || isPhase2ModuleWith2Sensors) {
116  // Go down in hierarchy: from module to sensor
117  if (!fv.firstChild()) { // very important
118  edm::LogError("CmsDetConstruction::buildComponent. Cannot go down to sensor volume.");
119  return;
120  }
121 
122  // This is the sensor hierarchy level
123  const int sensorHierarchyLevel = fv.level();
124 
125  // Loop on all siblings (ie, on all sensors)
126  while (fv.level() == sensorHierarchyLevel) {
127  // PHASE 1 (MERGEDDET)
128  if (isPhase1ModuleWith2Sensors) {
129  buildSmallDetsforGlued(fv, det, attribute);
130  }
131  // PHASE 2 (STACKDET)
132  else if (isPhase2ModuleWith2Sensors) {
133  buildSmallDetsforStack(fv, det, attribute);
134  }
135 
136  // Go to the next volume in FilteredView.
137  // NB: If this volume is another sensor of the same module, will stay in the loop.
138  // Otherwise, it is very important to access the next volume to be treated anyway.
139  fv.firstChild();
140  }
141  }
142 
143  // CASE B: MODULE HAS 1 SENSOR: NOTHING SPECIFIC TO DO
144  // Indeed, we are not going to sort sensors within module, if there is only 1 sensor!
145  else {
146  // Go to the next volume in FilteredView.
147  fv.firstChild();
148  }
149 
150  // ALL CASES: add sensor to its mother volume (module or ladder).
151  mother->addComponent(det);
152 }
static std::string getString(const std::string &, FilteredView *)
void addComponent(GeometricDet *)
void buildSmallDetsforStack(FilteredView &, GeometricDet *, const std::string &)
Log< level::Error, false > LogError
const int level() const
get Iterator level
void buildSmallDetsforGlued(FilteredView &, GeometricDet *, const std::string &)
bool firstChild()
set the current node to the first child

◆ buildDets()

template<class FilteredView>
void CmsDetConstruction< FilteredView >::buildDets ( const FilteredView &  ,
GeometricDet ,
const std::string &   
)
private

◆ buildSmallDetsforGlued()

template<class FilteredView >
void CmsDetConstruction< FilteredView >::buildSmallDetsforGlued ( FilteredView &  fv,
GeometricDet mother,
const std::string &  attribute 
)
private

◆ buildSmallDetsforStack()

template<class FilteredView >
void CmsDetConstruction< FilteredView >::buildSmallDetsforStack ( FilteredView &  fv,
GeometricDet mother,
const std::string &  attribute 
)
private

Definition at line 27 of file CmsDetConstruction.cc.

References GeometricDet::addComponent(), GeometricDet::isLowerSensor(), GeometricDet::isUpperSensor(), GeometricDet::setGeographicalID(), and groupFilesInBlocks::temp.

29  {
30  GeometricDet* det = new GeometricDet(&fv,
33 
34  if (det->isLowerSensor()) {
35  uint32_t temp = 1;
37  } else if (det->isUpperSensor()) {
38  uint32_t temp = 2;
40  } else {
41  edm::LogError("DetConstruction") << " module defined in a Stack but not upper either lower!? ";
42  }
43  mother->addComponent(det);
44 }
void addComponent(GeometricDet *)
bool isUpperSensor() const
Definition: GeometricDet.h:140
void setGeographicalID(DetId id)
Definition: GeometricDet.h:99
Log< level::Error, false > LogError
bool isLowerSensor() const
Definition: GeometricDet.h:139
Definition: DetId.h:17