CMS 3D CMS Logo

List of all members | Private Member Functions
CmsTrackerOTLayerBuilder< FilteredView > Class Template Reference

#include <CmsTrackerOTLayerBuilder.h>

Inheritance diagram for CmsTrackerOTLayerBuilder< FilteredView >:
CmsTrackerLevelBuilder< FilteredView > CmsTrackerAbstractConstruction< FilteredView >

Private Member Functions

void buildComponent (FilteredView &, GeometricDet *, const std::string &) override
 
void sortNS (FilteredView &, GeometricDet *) override
 

Additional Inherited Members

- 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
 
- Protected Attributes inherited from CmsTrackerLevelBuilder< FilteredView >
CmsTrackerStringToEnum theCmsTrackerStringToEnum
 

Detailed Description

template<class FilteredView>
class CmsTrackerOTLayerBuilder< FilteredView >

Class which contructs TIB/TOB layers

Definition at line 12 of file CmsTrackerOTLayerBuilder.h.

Member Function Documentation

◆ buildComponent()

template<class FilteredView >
void CmsTrackerOTLayerBuilder< FilteredView >::buildComponent ( FilteredView &  fv,
GeometricDet g,
const std::string &  s 
)
overrideprivatevirtual

Implements CmsTrackerLevelBuilder< FilteredView >.

Definition at line 16 of file CmsTrackerOTLayerBuilder.cc.

References CmsTrackerLevelBuilder< FilteredView >::build(), g, ExtractStringFromDDD< FilteredView >::getString(), GeometricDet::ladder, LogTrace, GeometricDet::panel, and alignCSCRings::s.

16  {
17  LogTrace("DetConstruction") << " CmsTrackerOTLayerBuilder::buildComponent ";
18  CmsTrackerLadderBuilder<FilteredView> theCmsTrackerLadderBuilder;
19  CmsTrackerOTRingBuilder<FilteredView> theCmsTrackerOTRingBuilder;
20 
21  GeometricDet* subdet = new GeometricDet(&fv,
27  theCmsTrackerLadderBuilder.build(fv, subdet, s);
28  break;
30  theCmsTrackerOTRingBuilder.build(fv, subdet, s);
31  break;
32  default:
33  edm::LogError("CmsTrackerOTLayerBuilder") << " ERROR - I was expecting a ladder or a panel, I got a "
35  }
36  g->addComponent(subdet);
37 }
static std::string getString(const std::string &, FilteredView *)
Log< level::Error, false > LogError
void build(FilteredView &, GeometricDet *, const std::string &) override
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
#define LogTrace(id)

◆ sortNS()

template<class FilteredView >
void CmsTrackerOTLayerBuilder< FilteredView >::sortNS ( FilteredView &  fv,
GeometricDet det 
)
overrideprivatevirtual

Reimplemented from CmsTrackerLevelBuilder< FilteredView >.

Definition at line 40 of file CmsTrackerOTLayerBuilder.cc.

References GeometricDet::addComponents(), GeometricDet::clearComponents(), AlCaHLTBitMon_QueryRunRegistry::comp, GeometricDet::component(), GeometricDet::components(), CmsTrackerLevelBuilderHelper::getPhi(), mps_fire::i, CmsTrackerLevelBuilderHelper::isLessZ(), GeometricDet::ladder, LogTrace, GeometricDet::panel, relativeConstraints::ring, jetUpdater_cfi::sort, mathSSE::sqrt(), groupFilesInBlocks::temp, and trackerStablePhiSort().

40  {
42 
43  //order ladder and rings together
47  rods.clear();
48  ringsNeg.clear();
49  ringsPos.clear();
50 
51  for (uint32_t i = 0; i < comp.size(); i++) {
52  auto component = det->component(i);
53  if (component->type() == GeometricDet::ladder) {
54  rods.emplace_back(component);
55  } else if (component->type() == GeometricDet::panel) {
56  if (component->translation().z() < 0.) {
57  ringsNeg.emplace_back(component);
58  } else if (component->translation().z() > 0.) {
59  ringsPos.emplace_back(component);
60  }
61  } else {
62  edm::LogError("CmsTrackerOTLayerBuilder")
63  << "ERROR - wrong SubDet to sort..... " << det->components().front()->type();
64  }
65  }
66 
67  // negative rings
68  if (!ringsNeg.empty()) {
69  std::sort(ringsNeg.begin(), ringsNeg.end(), CmsTrackerLevelBuilderHelper::isLessZ);
70  uint32_t totalringsNeg = ringsNeg.size();
71 
72  LogTrace("DetConstruction") << " Neg rings ordered by z: ";
73  for (uint32_t ring = 0; ring < totalringsNeg; ring++) {
74  uint32_t temp = ring + 1;
75  temp |= (1 << 8);
76  ringsNeg[ring]->setGeographicalID(temp);
77  LogTrace("BuildingTrackerDetId") << "\t\t\t DetId >> " << temp
78  << "(r: " << sqrt(ringsNeg[ring]->translation().Perp2())
79  << ", phi: " << ringsNeg[ring]->phi()
80  << ", z: " << ringsNeg[ring]->translation().z() << ")";
81  }
82  }
83 
84  // rods
85  if (!rods.empty()) {
87  uint32_t totalrods = rods.size();
88 
89  LogTrace("DetConstruction") << " Rods ordered by phi: ";
90  for (uint32_t rod = 0; rod < totalrods; rod++) {
91  uint32_t temp = rod + 1;
92  temp |= (3 << 8);
93  rods[rod]->setGeographicalID(DetId(temp));
94  LogTrace("BuildingTrackerDetId") << "\t\t\t DetId >> " << temp << "(r: " << sqrt(rods[rod]->translation().Perp2())
95  << ", phi: " << rods[rod]->phi() << ", z: " << rods[rod]->translation().z()
96  << ")";
97  }
98  }
99 
100  // positive rings
101  if (!ringsPos.empty()) {
102  std::sort(ringsPos.begin(), ringsPos.end(), CmsTrackerLevelBuilderHelper::isLessZ);
103  uint32_t totalringsPos = ringsPos.size();
104 
105  LogTrace("DetConstruction") << " Pos rings ordered by z: ";
106  for (uint32_t ring = 0; ring < totalringsPos; ring++) {
107  uint32_t temp = ring + 1;
108  temp |= (2 << 8);
109  ringsPos[ring]->setGeographicalID(temp);
110  LogTrace("BuildingTrackerDetId") << "\t\t\t DetId >> " << temp
111  << "(r: " << sqrt(ringsPos[ring]->translation().Perp2())
112  << ", phi: " << ringsPos[ring]->phi()
113  << ", z: " << ringsPos[ring]->translation().z() << ")";
114  }
115  }
116 
117  det->clearComponents();
118  det->addComponents(ringsNeg);
119  det->addComponents(rods);
120  det->addComponents(ringsPos);
121 }
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:35
static bool isLessZ(const GeometricDet *a, const GeometricDet *b)
void clearComponents()
Definition: GeometricDet.h:163
Log< level::Error, false > LogError
#define LogTrace(id)
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:152
T sqrt(T t)
Definition: SSEVec.h:19
GeometricDet * component(size_t index)
Definition: GeometricDet.h:148
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:34
void trackerStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
Definition: DetId.h:17
void addComponents(GeometricDetContainer const &cont)
static double getPhi(const GeometricDet *a)