CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
CmsTrackerLevelBuilder< FilteredView > Class Template Referenceabstract

#include <CmsTrackerLevelBuilder.h>

Inheritance diagram for CmsTrackerLevelBuilder< FilteredView >:
CmsTrackerAbstractConstruction< FilteredView > CmsDetConstruction< FilteredView > CmsTrackerBuilder< FilteredView > CmsTrackerDiskBuilder< FilteredView > CmsTrackerLadderBuilder< FilteredView > CmsTrackerLayerBuilder< FilteredView > CmsTrackerOTDiscBuilder< FilteredView > CmsTrackerOTLayerBuilder< FilteredView > CmsTrackerOTRingBuilder< FilteredView > CmsTrackerPanelBuilder< FilteredView > CmsTrackerPetalBuilder< FilteredView > CmsTrackerPhase1DiskBuilder< FilteredView > CmsTrackerPhase2TPDiskBuilder< FilteredView > CmsTrackerPixelPhase1EndcapBuilder< FilteredView > CmsTrackerPixelPhase2DiskBuilder< FilteredView > CmsTrackerPixelPhase2DoubleDiskBuilder< FilteredView > CmsTrackerPixelPhase2EndcapBuilder< FilteredView > CmsTrackerPixelPhase2RingBuilder< FilteredView > CmsTrackerPixelPhase2SubDiskBuilder< FilteredView > CmsTrackerRingBuilder< FilteredView > CmsTrackerRodBuilder< FilteredView > CmsTrackerStringBuilder< FilteredView > CmsTrackerSubStrctBuilder< FilteredView > CmsTrackerWheelBuilder< FilteredView >

Public Member Functions

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
 

Protected Attributes

CmsTrackerStringToEnum theCmsTrackerStringToEnum
 

Private Member Functions

virtual void buildComponent (FilteredView &, GeometricDet *, const std::string &)=0
 
virtual void sortNS (FilteredView &, GeometricDet *)
 

Private Attributes

CmsTrackerStringToEnum _CmsTrackerStringToEnum
 

Detailed Description

template<class FilteredView>
class CmsTrackerLevelBuilder< FilteredView >

Abstract Class to construct a Level in the hierarchy

Definition at line 31 of file CmsTrackerLevelBuilder.h.

Constructor & Destructor Documentation

◆ ~CmsTrackerLevelBuilder()

template<class FilteredView >
CmsTrackerLevelBuilder< FilteredView >::~CmsTrackerLevelBuilder ( )
inlineoverride

Definition at line 34 of file CmsTrackerLevelBuilder.h.

34 {}

Member Function Documentation

◆ build() [1/3]

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

◆ build() [2/3]

template<>
void CmsTrackerLevelBuilder< DDFilteredView >::build ( DDFilteredView fv,
GeometricDet tracker,
const std::string &  attribute 
)

Definition at line 146 of file CmsTrackerLevelBuilder.cc.

References DEBUG, DDFilteredView::firstChild(), DDFilteredView::geoHistory(), DDFilteredView::nextSibling(), DDFilteredView::parent(), and PbPb_ZMuSkimMuonDPG_cff::tracker.

148  {
149  if (DEBUG) {
150  edm::LogVerbatim("CmsTrackerLevelBuilder")
151  << "CmsTrackerLevelBuilder::build called on volume"
152  << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory()
153  << " tracker->type() = " << tracker->type();
154  }
155 
156  // Go down one level in hierarchy
157  bool doLayers = fv.firstChild();
158 
159  while (doLayers) {
160  if (DEBUG) {
161  edm::LogVerbatim("CmsTrackerLevelBuilder") << "Calling buildComponent, before";
162  }
163 
164  // Call build on sibling
165  buildComponent(fv, tracker, attribute);
166 
167  if (DEBUG) {
168  edm::LogVerbatim("CmsTrackerLevelBuilder") << "Calling buildComponent, after";
169  }
170 
171  // Go to next sibling
172  doLayers = fv.nextSibling();
173  }
174 
175  // Come back up
176  fv.parent();
177 
178  // Now that all GeometricDets of a given hierarchy level are built, sort them!
179  sortNS(fv, tracker);
180 
181  if (DEBUG) {
182  edm::LogVerbatim("CmsTrackerLevelBuilder")
183  << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls.";
184  }
185 }
Log< level::Info, true > LogVerbatim
virtual void sortNS(FilteredView &, GeometricDet *)
bool parent()
set the current node to the parent node ...
bool nextSibling()
set the current node to the next sibling ...
#define DEBUG
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
bool firstChild()
set the current node to the first child ...
virtual void buildComponent(FilteredView &, GeometricDet *, const std::string &)=0

◆ build() [3/3]

template<>
void CmsTrackerLevelBuilder< cms::DDFilteredView >::build ( cms::DDFilteredView fv,
GeometricDet tracker,
const std::string &  attribute 
)

Definition at line 191 of file CmsTrackerLevelBuilder.cc.

References DEBUG, cms::DDFilteredView::firstChild(), cms::DDFilteredView::geoHistory(), ExtractStringFromDDD< FilteredView >::getString(), gammaJetAnalysis_CHSJECs_cff::level, cms::DDFilteredView::level(), AlCaHLTBitMon_QueryRunRegistry::string, and PbPb_ZMuSkimMuonDPG_cff::tracker.

193  {
194  if (DEBUG) {
195  edm::LogVerbatim("CmsTrackerLevelBuilder")
196  << "CmsTrackerLevelBuilder::build called on volume"
197  << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory()
198  << " tracker->type() = " << tracker->type();
199  }
200 
201  // Go down one level in hierarchy
202  fv.firstChild();
203 
204  // This is the siblings hierarchy level
205  const int level = fv.level();
207 
208  // Treat all siblings of a given hierarchy level
209  while (fv.level() == level) {
210  if (DEBUG) {
211  edm::LogVerbatim("CmsTrackerLevelBuilder")
212  << "Calling buildComponent, before."
213  << " level = " << level << " type = " << type << " fv.level() = " << fv.level()
214  << " fv.type() = " << ExtractStringFromDDD<cms::DDFilteredView>::getString(attribute, &fv);
215  }
216 
217  // Call build on sibling
218  buildComponent(fv, tracker, attribute);
219 
220  if (DEBUG) {
221  edm::LogVerbatim("CmsTrackerLevelBuilder")
222  << "Calling buildComponent, after."
223  << " level = " << level << " type = " << type << " fv.level() = " << fv.level()
224  << " fv.type() = " << ExtractStringFromDDD<cms::DDFilteredView>::getString(attribute, &fv);
225  }
226  }
227 
228  // Now that all GeometricDets of a given hierarchy level are built, sort them!
229  sortNS(fv, tracker);
230 
231  if (DEBUG) {
232  edm::LogVerbatim("CmsTrackerLevelBuilder")
233  << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls.";
234  }
235 }
Log< level::Info, true > LogVerbatim
virtual void sortNS(FilteredView &, GeometricDet *)
static std::string getString(const std::string &, FilteredView *)
const std::vector< const Node * > geoHistory() const
const int level() const
get Iterator level
#define DEBUG
bool firstChild()
set the current node to the first child
virtual void buildComponent(FilteredView &, GeometricDet *, const std::string &)=0

◆ buildComponent()

template<class FilteredView >
virtual void CmsTrackerLevelBuilder< FilteredView >::buildComponent ( FilteredView &  ,
GeometricDet ,
const std::string &   
)
privatepure virtual

◆ sortNS()

template<class FilteredView >
virtual void CmsTrackerLevelBuilder< FilteredView >::sortNS ( FilteredView &  ,
GeometricDet  
)
inlineprivatevirtual

Member Data Documentation

◆ _CmsTrackerStringToEnum

template<class FilteredView >
CmsTrackerStringToEnum CmsTrackerLevelBuilder< FilteredView >::_CmsTrackerStringToEnum
private

Definition at line 44 of file CmsTrackerLevelBuilder.h.

◆ theCmsTrackerStringToEnum

template<class FilteredView >
CmsTrackerStringToEnum CmsTrackerLevelBuilder< FilteredView >::theCmsTrackerStringToEnum
protected

Definition at line 40 of file CmsTrackerLevelBuilder.h.