CMS 3D CMS Logo

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

#include <CmsTrackerLayerBuilder.h>

Inheritance diagram for CmsTrackerLayerBuilder< 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 >
template<>
void build (cms::DDFilteredView &fv, GeometricDet *tracker, const std::string &attribute)
 
template<>
void build (DDFilteredView &fv, GeometricDet *tracker, const std::string &attribute)
 
void build (FilteredView &, GeometricDet *, const std::string &) override
 
 ~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 CmsTrackerLayerBuilder< FilteredView >

Class which contructs TIB/TOB layers

Definition at line 12 of file CmsTrackerLayerBuilder.h.

Member Function Documentation

◆ buildComponent()

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

Implements CmsTrackerLevelBuilder< FilteredView >.

Definition at line 17 of file CmsTrackerLayerBuilder.cc.

17  {
18  CmsTrackerStringBuilder<FilteredView> theCmsTrackerStringBuilder;
19  CmsTrackerRodBuilder<FilteredView> theCmsTrackerRodBuilder;
20  CmsTrackerLadderBuilder<FilteredView> theCmsTrackerLadderBuilder;
21 
22  GeometricDet* subdet = new GeometricDet(&fv,
28  theCmsTrackerStringBuilder.build(fv, subdet, s);
29  break;
30  case GeometricDet::rod:
31  theCmsTrackerRodBuilder.build(fv, subdet, s);
32  break;
34  theCmsTrackerLadderBuilder.build(fv, subdet, s);
35  break;
36  default:
37  edm::LogError("CmsTrackerLayerBuilder") << " ERROR - I was expecting a String, Rod or Ladder, I got a "
39  }
40  g->addComponent(subdet);
41 }

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

◆ sortNS()

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

Reimplemented from CmsTrackerLevelBuilder< FilteredView >.

Definition at line 44 of file CmsTrackerLayerBuilder.cc.

44  {
46 
47  // TIB
48  // SubDetector Side: 2 bits [TIB-:1 TIB+:2]
49  // Layer Part : 2 bits [internal:1 external:0]
50  // String Number : 6 bits [1,...,56 (at most)]
51  //
52  if (comp.front()->type() == GeometricDet::strng) {
53  float layerRadius = (det->params()[2] + det->params()[1]) / 2.;
54 
61  neg.clear();
62  pos.clear();
63  extneg.clear();
64  intneg.clear();
65  extpos.clear();
66  intpos.clear();
67 
68  for (size_t i = 0; i < comp.size(); ++i) {
69  auto component = det->component(i);
70  if (component->translation().z() < 0.) {
71  neg.emplace_back(component);
72  } else {
73  pos.emplace_back(component);
74  }
75  }
76 
77  for (auto& i : neg) {
78  double rPos = i->translation().Rho();
79  if (rPos > layerRadius) {
80  extneg.emplace_back(i);
81  } else {
82  intneg.emplace_back(i);
83  }
84  }
85 
86  for (auto& po : pos) {
87  double rPos = po->translation().Rho();
88  if (rPos > layerRadius) {
89  extpos.emplace_back(po);
90  } else {
91  intpos.emplace_back(po);
92  }
93  }
94 
95  trackerStablePhiSort(extneg.begin(), extneg.end(), CmsTrackerLevelBuilderHelper::getPhi);
96  trackerStablePhiSort(extpos.begin(), extpos.end(), CmsTrackerLevelBuilderHelper::getPhi);
97  trackerStablePhiSort(intneg.begin(), intneg.end(), CmsTrackerLevelBuilderHelper::getPhi);
98  trackerStablePhiSort(intpos.begin(), intpos.end(), CmsTrackerLevelBuilderHelper::getPhi);
99 
100  for (uint32_t i = 0; i < intneg.size(); i++) {
101  uint32_t temp = i + 1;
102  temp |= (1 << 8); // 1 : SubDetector Side TIB-
103  temp |= (1 << 6); // 1 : Layer Part int
104  intneg[i]->setGeographicalID(DetId(temp));
105  }
106 
107  for (uint32_t i = 0; i < extneg.size(); i++) {
108  uint32_t temp = i + 1;
109  temp |= (1 << 8); // 1 : SubDetector Side TIB-
110  temp |= (2 << 6); // 2 : Layer Part ext
111  extneg[i]->setGeographicalID(DetId(temp));
112  }
113 
114  for (uint32_t i = 0; i < intpos.size(); i++) {
115  uint32_t temp = i + 1;
116  temp |= (2 << 8); // 2 : SubDetector Side TIB+
117  temp |= (1 << 6); // 1 : Layer Part int
118  intpos[i]->setGeographicalID(DetId(temp));
119  }
120 
121  for (uint32_t i = 0; i < extpos.size(); i++) {
122  uint32_t temp = i + 1;
123  temp |= (2 << 8); // 2 : SubDetector Side TIB+
124  temp |= (2 << 6); // 2 : Layer Part ext
125  extpos[i]->setGeographicalID(DetId(temp));
126  }
127 
128  det->clearComponents();
129  det->addComponents(intneg);
130  det->addComponents(extneg);
131  det->addComponents(intpos);
132  det->addComponents(extpos);
133 
134  } else if (comp.front()->type() == GeometricDet::rod) {
137  neg.clear();
138  pos.clear();
139 
140  for (size_t i = 0; i < comp.size(); ++i) {
141  auto component = det->component(i);
142  if (component->translation().z() < 0.) {
143  neg.emplace_back(component);
144  } else {
145  pos.emplace_back(component);
146  }
147  }
148 
151 
152  for (uint32_t i = 0; i < neg.size(); i++) {
153  uint32_t temp = i + 1;
154  temp |= (1 << 7);
155  neg[i]->setGeographicalID(DetId(temp));
156  }
157 
158  for (uint32_t i = 0; i < pos.size(); i++) {
159  uint32_t temp = i + 1;
160  temp |= (2 << 7);
161  pos[i]->setGeographicalID(DetId(temp));
162  }
163 
164  det->clearComponents();
165  det->addComponents(neg);
166  det->addComponents(pos);
167 
168  } else if (det->components().front()->type() == GeometricDet::ladder) {
170 
171  for (uint32_t i = 0; i < comp.size(); i++) {
172  det->component(i)->setGeographicalID(DetId(i + 1));
173  }
174 
175  } else {
176  edm::LogError("CmsTrackerLayerBuilder")
177  << "ERROR - wrong SubDet to sort..... " << det->components().front()->type();
178  }
179 }

References GeometricDet::addComponents(), GeometricDet::clearComponents(), AlCaHLTBitMon_QueryRunRegistry::comp, GeometricDet::component(), GeometricDet::components(), CmsTrackerLevelBuilderHelper::getPhi(), mps_fire::i, GeometricDet::ladder, GeometricDet::params(), GeometricDet::rod, GeometricDet::setGeographicalID(), GeometricDet::strng, groupFilesInBlocks::temp, and trackerStablePhiSort().

ExtractStringFromDDD::getString
static std::string getString(const std::string &, FilteredView *)
CmsTrackerLevelBuilder
Definition: CmsTrackerLevelBuilder.h:31
mps_fire.i
i
Definition: mps_fire.py:428
GeometricDet::rod
Definition: GeometricDet.h:60
GeometricDet::components
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:149
pos
Definition: PixelAliasList.h:18
GeometricDet::ladder
Definition: GeometricDet.h:63
trackerStablePhiSort
void trackerStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
Definition: trackerStablePhiSort.h:9
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
ExtractStringFromDDD
Definition: ExtractStringFromDDD.h:12
CmsTrackerLevelBuilderHelper::getPhi
static double getPhi(const GeometricDet *a)
Definition: CmsTrackerLevelBuilder.cc:44
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
GeometricDet::params
const std::vector< double > & params() const
Definition: GeometricDet.h:116
GeometricDet::setGeographicalID
void setGeographicalID(DetId id)
Definition: GeometricDet.h:97
GeometricDet
Definition: GeometricDet.h:31
CmsTrackerLevelBuilder::build
void build(FilteredView &, GeometricDet *, const std::string &) override
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
GeometricDet::addComponents
void addComponents(GeometricDetContainer const &cont)
Definition: GeometricDet.cc:256
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
GeometricDet::component
GeometricDet * component(size_t index)
Definition: GeometricDet.h:145
GeometricDet::ConstGeometricDetContainer
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:34
CmsTrackerStringBuilder
Definition: CmsTrackerStringBuilder.h:12
CmsTrackerLadderBuilder
Definition: CmsTrackerLadderBuilder.h:12
GeometricDet::GeometricDetContainer
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:35
CmsTrackerRodBuilder
Definition: CmsTrackerRodBuilder.h:12
GeometricDet::clearComponents
void clearComponents()
Definition: GeometricDet.h:160
g
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
GeometricDet::strng
Definition: GeometricDet.h:59