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 buildSmallDetsfor3D (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 72 of file CmsDetConstruction.cc.

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

74  {
75  // Mother volume
76  // Module with 2 sensors: the mother volume is the module volume.
77  // Module with 1 sensor: the mother volume is the ladder volume.
78  const std::string& myTopologicalNameInXMLs = ExtractStringFromDDD<DDFilteredView>::getString(attribute, &fv);
79  const GeometricDet::GDEnumType& myTopologicalType =
81 
82  GeometricDet* det = new GeometricDet(&fv, myTopologicalType);
83 
84  const bool isPhase1ModuleWith2Sensors = (myTopologicalType == GeometricDet::mergedDet);
85  const bool isPhase2ModuleWith2Sensors = (myTopologicalType == GeometricDet::OTPhase2Stack);
86  const bool isPhase2BarrelModuleWith2Sensors = (myTopologicalType == GeometricDet::ITPhase2Combined);
87 
88  // CASE A: MODULE HAS 2 SENSORS
89  if (isPhase1ModuleWith2Sensors || isPhase2ModuleWith2Sensors || isPhase2BarrelModuleWith2Sensors) {
90  // Go down in hierarchy: from module to sensor
91  bool dodets = fv.firstChild(); // very important
92  while (dodets) {
93  // PHASE 1 (MERGEDDET)
94  if (isPhase1ModuleWith2Sensors) {
95  buildSmallDetsforGlued(fv, det, attribute);
96  }
97  // PHASE 2 (STACKDET)
98  else if (isPhase2ModuleWith2Sensors) {
99  buildSmallDetsforStack(fv, det, attribute);
100  } else if (isPhase2BarrelModuleWith2Sensors) {
101  buildSmallDetsfor3D(fv, det, attribute);
102  }
103 
104  dodets = fv.nextSibling();
105  }
106 
107  fv.parent();
108  }
109 
110  // CASE B: MODULE HAS 1 SENSOR: NOTHING SPECIFIC TO DO
111  // Indeed, we are not going to sort sensors within module, if there is only 1 sensor!
112 
113  // ALL CASES: add sensor to its mother volume (module or ladder).
114  mother->addComponent(det);
115 }
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 buildSmallDetsfor3D(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 123 of file CmsDetConstruction.cc.

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

125  {
126  // Mother volume
127  // Module with 2 sensors: the mother volume is the module volume.
128  // Module with 1 sensor: the mother volume is the ladder volume.
129  const std::string& myTopologicalNameInXMLs = ExtractStringFromDDD<cms::DDFilteredView>::getString(attribute, &fv);
130  const GeometricDet::GDEnumType& myTopologicalType =
132  GeometricDet* det = new GeometricDet(&fv, myTopologicalType);
133 
134  const bool isPhase1ModuleWith2Sensors = (myTopologicalType == GeometricDet::mergedDet);
135  const bool isPhase2ModuleWith2Sensors = (myTopologicalType == GeometricDet::OTPhase2Stack);
136  const bool isPhase2BarrelModuleWith2Sensors = (myTopologicalType == GeometricDet::ITPhase2Combined);
137 
138  // CASE A: MODULE HAS 2 SENSORS
139  if (isPhase1ModuleWith2Sensors || isPhase2ModuleWith2Sensors || isPhase2BarrelModuleWith2Sensors) {
140  // Go down in hierarchy: from module to sensor
141  if (!fv.firstChild()) { // very important
142  edm::LogError("CmsDetConstruction::buildComponent. Cannot go down to sensor volume.");
143  return;
144  }
145 
146  // This is the sensor hierarchy level
147  const int sensorHierarchyLevel = fv.level();
148 
149  // Loop on all siblings (ie, on all sensors)
150  while (fv.level() == sensorHierarchyLevel) {
151  // PHASE 1 (MERGEDDET)
152  if (isPhase1ModuleWith2Sensors) {
153  buildSmallDetsforGlued(fv, det, attribute);
154  }
155  // PHASE 2 (STACKDET)
156  else if (isPhase2ModuleWith2Sensors) {
157  buildSmallDetsforStack(fv, det, attribute);
158  } else if (isPhase2BarrelModuleWith2Sensors) {
159  buildSmallDetsfor3D(fv, det, attribute);
160  }
161 
162  // Go to the next volume in FilteredView.
163  // NB: If this volume is another sensor of the same module, will stay in the loop.
164  // Otherwise, it is very important to access the next volume to be treated anyway.
165  fv.firstChild();
166  }
167  }
168 
169  // CASE B: MODULE HAS 1 SENSOR: NOTHING SPECIFIC TO DO
170  // Indeed, we are not going to sort sensors within module, if there is only 1 sensor!
171  else {
172  // Go to the next volume in FilteredView.
173  fv.firstChild();
174  }
175 
176  // ALL CASES: add sensor to its mother volume (module or ladder).
177  mother->addComponent(det);
178 }
static std::string getString(const std::string &, FilteredView *)
void addComponent(GeometricDet *)
void buildSmallDetsforStack(FilteredView &, GeometricDet *, const std::string &)
Log< level::Error, false > LogError
void buildSmallDetsfor3D(FilteredView &, GeometricDet *, const std::string &)
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

◆ buildSmallDetsfor3D()

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

Definition at line 47 of file CmsDetConstruction.cc.

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

49  {
50  GeometricDet* det = new GeometricDet(&fv,
53 
54  if (det->isFirstSensor()) {
55  uint32_t temp = 1;
57  } else if (det->isSecondSensor()) {
58  uint32_t temp = 2;
60  } else {
61  edm::LogError("DetConstruction") << " module defined in a 3D module but not first or second sensor!? ";
62  }
63  mother->addComponent(det);
64 }
void addComponent(GeometricDet *)
void setGeographicalID(DetId id)
Definition: GeometricDet.h:100
Log< level::Error, false > LogError
Definition: DetId.h:17
bool isSecondSensor() const
Definition: GeometricDet.h:143
bool isFirstSensor() const
Definition: GeometricDet.h:142

◆ 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:141
void setGeographicalID(DetId id)
Definition: GeometricDet.h:100
Log< level::Error, false > LogError
bool isLowerSensor() const
Definition: GeometricDet.h:140
Definition: DetId.h:17