CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
CmsMTDBuilder Class Reference

#include <CmsMTDBuilder.h>

Inheritance diagram for CmsMTDBuilder:
CmsMTDLevelBuilder CmsMTDAbstractConstruction

Public Member Functions

 CmsMTDBuilder ()
 
- Public Member Functions inherited from CmsMTDLevelBuilder
void build (DDFilteredView &, GeometricTimingDet *, std::string) override
 
 ~CmsMTDLevelBuilder () override
 
- Public Member Functions inherited from CmsMTDAbstractConstruction
virtual ~CmsMTDAbstractConstruction ()=default
 

Private Member Functions

void buildComponent (DDFilteredView &, GeometricTimingDet *, std::string) override
 
void sortNS (DDFilteredView &, GeometricTimingDet *) override
 

Additional Inherited Members

- Static Public Member Functions inherited from CmsMTDLevelBuilder
static double getPhi (const GeometricTimingDet *a)
 
static double getPhiGluedModule (const GeometricTimingDet *a)
 
static double getPhiGluedModuleMirror (const GeometricTimingDet *a)
 
static double getPhiMirror (const GeometricTimingDet *a)
 
static double getPhiModule (const GeometricTimingDet *a)
 
static double getPhiModuleMirror (const GeometricTimingDet *a)
 
static bool isLessModZ (const GeometricTimingDet *a, const GeometricTimingDet *b)
 
static bool isLessR (const GeometricTimingDet *a, const GeometricTimingDet *b)
 
static bool isLessRModule (const GeometricTimingDet *a, const GeometricTimingDet *b)
 
static bool isLessZ (const GeometricTimingDet *a, const GeometricTimingDet *b)
 
static bool phiSortNP (const GeometricTimingDet *a, const GeometricTimingDet *b)
 
static bool subDetByType (const GeometricTimingDet *a, const GeometricTimingDet *b)
 
- Protected Attributes inherited from CmsMTDLevelBuilder
CmsMTDStringToEnum theCmsMTDStringToEnum
 

Detailed Description

Abstract Class to construct a Level in the hierarchy

Definition at line 11 of file CmsMTDBuilder.h.

Constructor & Destructor Documentation

CmsMTDBuilder::CmsMTDBuilder ( )

Definition at line 13 of file CmsMTDBuilder.cc.

13 {}

Member Function Documentation

void CmsMTDBuilder::buildComponent ( DDFilteredView fv,
GeometricTimingDet g,
std::string  s 
)
overrideprivatevirtual

Implements CmsMTDLevelBuilder.

Definition at line 15 of file CmsMTDBuilder.cc.

References GeometricTimingDet::addComponent(), GeometricTimingDet::BTL, CmsMTDLevelBuilder::build(), GeometricTimingDet::ETL, Exception, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), CmsMTDLevelBuilder::theCmsMTDStringToEnum, and CmsMTDStringToEnum::type().

15  {
16  CmsMTDSubStrctBuilder theCmsMTDSubStrctBuilder;
17  CmsMTDEndcapBuilder theCmsMTDEndcapBuilder;
18 
20 
21  switch (theCmsMTDStringToEnum.type(fv.logicalPart().name().name())) {
23  theCmsMTDEndcapBuilder.build(fv, subdet, s);
24  break;
26  theCmsMTDSubStrctBuilder.build(fv, subdet, s);
27  break;
28  default:
29  throw cms::Exception("CmsMTDBuilder")
30  << " ERROR - I was expecting a SubDet, I got a " << fv.logicalPart().name().name();
31  }
32 
33  g->addComponent(subdet);
34 }
GeometricTimingDet::GeometricTimingEnumType type(std::string const &) const
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:59
CmsMTDStringToEnum theCmsMTDStringToEnum
void addComponent(GeometricTimingDet *)
void build(DDFilteredView &, GeometricTimingDet *, std::string) override
const std::string & name() const
Returns the name.
Definition: DDName.cc:40
void CmsMTDBuilder::sortNS ( DDFilteredView fv,
GeometricTimingDet det 
)
overrideprivatevirtual

Reimplemented from CmsMTDLevelBuilder.

Definition at line 38 of file CmsMTDBuilder.cc.

References GeometricTimingDet::BTL, AlCaHLTBitMon_QueryRunRegistry::comp, GeometricTimingDet::component(), GeometricTimingDet::components(), GeometricTimingDet::ETL, Exception, mps_fire::i, GeometricTimingDet::setGeographicalID(), CmsMTDLevelBuilder::subDetByType(), and GeometricTimingDet::translation().

38  {
40  std::stable_sort(comp.begin(), comp.end(), subDetByType);
41 
42  for (uint32_t i = 0; i < comp.size(); i++) {
43  const uint32_t side = det->component(i)->translation().z() > 0 ? 1 : 0;
44  switch (comp[i]->type()) {
46  det->component(i)->setGeographicalID(BTLDetId(0, 0, 0, 0, 0));
47  break;
49  det->component(i)->setGeographicalID(ETLDetId(side, 0, 0, 0));
50  break;
51  default:
52  throw cms::Exception("CmsMTDBuilder") << " ERROR - I was expecting a SubDet, I got a " << comp[i]->name();
53  }
54  }
55 }
type
Definition: HCALResponse.h:21
static bool subDetByType(const GeometricTimingDet *a, const GeometricTimingDet *b)
ConstGeometricTimingDetContainer & components()
GeometricTimingDet * component(size_t index)
void setGeographicalID(DetId id)
std::vector< GeometricTimingDet const * > ConstGeometricTimingDetContainer
Detector identifier class for the Endcap Timing Layer.
Definition: ETLDetId.h:15
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
Definition: BTLDetId.h:18
Translation const & translation() const