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

template<>
void buildComponent (cms::DDFilteredView &fv, GeometricDet *mother, const std::string &attribute)
 
template<>
void buildComponent (DDFilteredView &fv, GeometricDet *mother, const std::string &attribute)
 
void buildComponent (FilteredView &, GeometricDet *, const std::string &) override
 
- Public Member Functions inherited from CmsTrackerLevelBuilder< FilteredView >
template<>
void build (cms::DDFilteredView &fv, GeometricDet *tracker, const std::string &attribute)
 
template<>
void build (DDFilteredView &fv, GeometricDet *tracker, const std::string &attribute)
 
void build (FilteredView &, GeometricDet *, const std::string &) override
 
 ~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<>
void CmsDetConstruction< cms::DDFilteredView >::buildComponent ( cms::DDFilteredView fv,
GeometricDet mother,
const std::string &  attribute 
)

Definition at line 100 of file CmsDetConstruction.cc.

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 }

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

◆ buildComponent() [2/3]

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

Definition at line 52 of file CmsDetConstruction.cc.

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 }

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

◆ buildComponent() [3/3]

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

◆ 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

Definition at line 9 of file CmsDetConstruction.cc.

11  {
12  GeometricDet* det = new GeometricDet(&fv,
15  if (det->stereo()) {
16  uint32_t temp = 1;
18  } else {
19  uint32_t temp = 2;
21  }
22 
23  mother->addComponent(det);
24 }

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

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

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 }

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

ExtractStringFromDDD::getString
static std::string getString(const std::string &, FilteredView *)
CmsTrackerLevelBuilder
Definition: CmsTrackerLevelBuilder.h:31
GeometricDet::isLowerSensor
bool isLowerSensor() const
Definition: GeometricDet.h:137
DDFilteredView::parent
bool parent()
set the current node to the parent node ...
Definition: DDFilteredView.cc:161
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
ExtractStringFromDDD
Definition: ExtractStringFromDDD.h:12
CmsDetConstruction::buildSmallDetsforStack
void buildSmallDetsforStack(FilteredView &, GeometricDet *, const std::string &)
Definition: CmsDetConstruction.cc:27
DetId
Definition: DetId.h:17
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
GeometricDet::mergedDet
Definition: GeometricDet.h:64
GeometricDet::setGeographicalID
void setGeographicalID(DetId id)
Definition: GeometricDet.h:97
cms::DDFilteredView::firstChild
bool firstChild()
set the current node to the first child
Definition: DDFilteredView.cc:268
GeometricDet
Definition: GeometricDet.h:31
DDFilteredView::nextSibling
bool nextSibling()
set the current node to the next sibling ...
Definition: DDFilteredView.cc:124
CmsDetConstruction::buildSmallDetsforGlued
void buildSmallDetsforGlued(FilteredView &, GeometricDet *, const std::string &)
Definition: CmsDetConstruction.cc:9
GeometricDet::GDEnumType
GDEnumType
Definition: GeometricDet.h:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GeometricDet::stereo
bool stereo() const
Definition: GeometricDet.h:136
cms::DDFilteredView::level
const int level() const
get Iterator level
Definition: DDFilteredView.cc:636
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
GeometricDet::OTPhase2Stack
Definition: GeometricDet.h:74
GeometricDet::addComponent
void addComponent(GeometricDet *)
Definition: GeometricDet.cc:250
GeometricDet::isUpperSensor
bool isUpperSensor() const
Definition: GeometricDet.h:138