CMS 3D CMS Logo

List of all members | Private Member Functions
CmsMTDTrayBuilder Class Reference

#include <CmsMTDTrayBuilder.h>

Inheritance diagram for CmsMTDTrayBuilder:
CmsMTDLevelBuilder CmsMTDAbstractConstruction

Private Member Functions

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

Additional Inherited Members

- Public Member Functions inherited from CmsMTDLevelBuilder
void build (DDFilteredView &, GeometricTimingDet *, std::string) override
 
 ~CmsMTDLevelBuilder () override
 
- Public Member Functions inherited from CmsMTDAbstractConstruction
virtual ~CmsMTDAbstractConstruction ()=default
 
- 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

Class which contructs BTL trays

Definition at line 10 of file CmsMTDTrayBuilder.h.

Member Function Documentation

void CmsMTDTrayBuilder::buildComponent ( DDFilteredView fv,
GeometricTimingDet g,
std::string  side 
)
overrideprivatevirtual

Implements CmsMTDLevelBuilder.

Definition at line 13 of file CmsMTDTrayBuilder.cc.

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

13  {
14  CmsMTDModuleBuilder theCmsMTDModuleBuilder;
15 
17  switch (theCmsMTDStringToEnum.type(fv.logicalPart().name().name())) {
19  theCmsMTDModuleBuilder.build(fv, subdet, side);
20  break;
21  default:
22  throw cms::Exception("CmsMTDTrayBuilder")
23  << " ERROR - I was expecting a Tray, I got a " << fv.logicalPart().name().name();
24  }
25 
26  g->addComponent(subdet);
27 }
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 CmsMTDTrayBuilder::sortNS ( DDFilteredView fv,
GeometricTimingDet det 
)
overrideprivatevirtual

Reimplemented from CmsMTDLevelBuilder.

Definition at line 29 of file CmsMTDTrayBuilder.cc.

References GeometricTimingDet::addComponents(), GeometricTimingDet::BTLTray, GeometricTimingDet::clearComponents(), AlCaHLTBitMon_QueryRunRegistry::comp, GeometricTimingDet::component(), GeometricTimingDet::components(), CmsMTDLevelBuilder::getPhi(), mps_fire::i, LogTrace, mtdStablePhiSort(), mathSSE::sqrt(), and groupFilesInBlocks::temp.

29  {
31 
32  //order ladder and rings together
34  rods.clear();
35 
36  for (uint32_t i = 0; i < comp.size(); i++) {
37  auto component = det->component(i);
38  if (component->type() == GeometricTimingDet::BTLTray) {
39  rods.emplace_back(component);
40  } else {
41  edm::LogError("CmsMTDOTLayerBuilder")
42  << "ERROR - wrong SubDet to sort..... " << det->components().front()->type();
43  }
44  }
45 
46  // rods
47  if (!rods.empty()) {
48  mtdStablePhiSort(rods.begin(), rods.end(), getPhi);
49  uint32_t totalrods = rods.size();
50 
51  LogTrace("DetConstruction") << " Rods ordered by phi: ";
52  for (uint32_t rod = 0; rod < totalrods; rod++) {
53  uint32_t temp = rod + 1;
54  temp |= (3 << 8);
55  rods[rod]->setGeographicalID(DetId(temp));
56  LogTrace("BuildingMTDDetId") << "\t\t\t DetId >> " << temp << "(r: " << sqrt(rods[rod]->translation().Perp2())
57  << ", phi: " << rods[rod]->phi() << ", z: " << rods[rod]->translation().z() << ")";
58  }
59  }
60 
61  det->clearComponents();
62  det->addComponents(rods);
63 }
static double getPhi(const GeometricTimingDet *a)
void addComponents(GeometricTimingDetContainer const &cont)
ConstGeometricTimingDetContainer & components()
T sqrt(T t)
Definition: SSEVec.h:19
GeometricTimingDet * component(size_t index)
#define LogTrace(id)
Definition: DetId.h:17
std::vector< GeometricTimingDet const * > ConstGeometricTimingDetContainer
std::vector< GeometricTimingDet * > GeometricTimingDetContainer
void mtdStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)