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
 
- 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, DDName::fullname(), DDFilteredView::logicalPart(), DDBase< N, C >::name(), CmsMTDLevelBuilder::theCmsMTDStringToEnum, and CmsMTDStringToEnum::type().

13  {
14 
15  CmsMTDModuleBuilder theCmsMTDModuleBuilder;
16 
20  theCmsMTDModuleBuilder.build(fv,subdet,side);
21  break;
22  default:
23  throw cms::Exception("CmsMTDTrayBuilder")<<" ERROR - I was expecting a Tray, I got a "<< fv.logicalPart().name().fullname();
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:74
CmsMTDStringToEnum theCmsMTDStringToEnum
void addComponent(GeometricTimingDet *)
const std::string fullname() const
Definition: DDName.h:43
void build(DDFilteredView &, GeometricTimingDet *, std::string) override
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(), mps_fire::i, LogTrace, MTDStablePhiSort(), mathSSE::sqrt(), and groupFilesInBlocks::temp.

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