CMS 3D CMS Logo

CmsTrackerOTLayerBuilder.cc
Go to the documentation of this file.
11 
12 #include <vector>
13 #include <bitset>
14 
15 template <class FilteredView>
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 }
38 
39 template <class FilteredView>
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 }
122 
ExtractStringFromDDD::getString
static std::string getString(const std::string &, FilteredView *)
CmsTrackerLevelBuilder
Definition: CmsTrackerLevelBuilder.h:31
AlCaHLTBitMon_QueryRunRegistry.comp
string comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
GeometricDet::components
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:150
CmsTrackerOTLayerBuilder::sortNS
void sortNS(FilteredView &, GeometricDet *) override
Definition: CmsTrackerOTLayerBuilder.cc:40
CmsTrackerOTRingBuilder
Definition: CmsTrackerOTRingBuilder.h:12
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
CmsTrackerLevelBuilderHelper::isLessZ
static bool isLessZ(const GeometricDet *a, const GeometricDet *b)
Definition: CmsTrackerLevelBuilder.cc:30
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
DDFilteredView.h
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
GeometricDet
Definition: GeometricDet.h:31
CmsTrackerOTLayerBuilder::buildComponent
void buildComponent(FilteredView &, GeometricDet *, const std::string &) override
Definition: CmsTrackerOTLayerBuilder.cc:16
DDFilteredView.h
CmsTrackerOTRingBuilder.h
CmsTrackerLevelBuilder::build
void build(FilteredView &, GeometricDet *, const std::string &) override
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
GeometricDet::addComponents
void addComponents(GeometricDetContainer const &cont)
Definition: GeometricDet.cc:266
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
GeometricDet::panel
Definition: GeometricDet.h:67
CmsTrackerOTLayerBuilder.h
GeometricDet.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CmsTrackerOTLayerBuilder
Definition: CmsTrackerOTLayerBuilder.h:12
ExtractStringFromDDD.h
GeometricDet::component
GeometricDet * component(size_t index)
Definition: GeometricDet.h:146
GeometricDet::ConstGeometricDetContainer
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:34
DetId.h
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
trackerStablePhiSort.h
CmsTrackerLadderBuilder
Definition: CmsTrackerLadderBuilder.h:12
GeometricDet::GeometricDetContainer
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:35
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
GeometricDet::clearComponents
void clearComponents()
Definition: GeometricDet.h:161
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
CmsTrackerLadderBuilder.h