20 #include "Identifier/Identifier.h"
33 ISvcLocator* svcLocator = Gaudi::svcLocator();
35 if (svcLocator->service(
"DetectorStore",
detStore).isFailure()) {
36 throw std::runtime_error(
37 "DiscOverlapDescriptor can not locate DetectorStore");
45 const PixelID* pixIdHelper =
nullptr;
46 if (
detStore->retrieve(pixIdHelper,
"PixelID").isFailure()) {
47 throw std::runtime_error(
"DiscOverlapDescriptor can not locate PixelID");
55 const SCT_ID* sctIdHelper =
nullptr;
56 if (
detStore->retrieve(sctIdHelper,
"SCT_ID").isFailure()) {
57 throw std::runtime_error(
"DiscOverlapDescriptor can not locate SCT_ID");
65 std::vector<Trk::BinUtility*>* singleBinUtils,
67 m_bin_array(bin_array),
68 m_singleBinUtils(singleBinUtils),
94 size_t newCapacity = surfaces.size() + 19;
95 if (pElement->
otherSide()) newCapacity += 19;
96 surfaces.reserve(newCapacity);
131 (*(surf[
offset])).associatedDetectorElementIdentifier())
133 (*(surf[
offset])).associatedDetectorElementIdentifier());
136 etamod > (etaModule + 1)) {
137 offset += (std::as_const(*m_singleBinUtils).at(
bin))->
bins();
141 double PrevDeltaPhi = 9999.;
142 double NextDeltaPhi = -9999.;
144 if (
etamod == (etaModule-1) ) {
145 if( tsf.
center().phi() == (*(surf[
ss])).center().phi() )
146 samePhi_PrevEta = surf[
ss];
147 double DeltaPhi = tsf.
center().phi() - (*(surf[
ss])).center().phi();
148 if( DeltaPhi < PrevDeltaPhi && DeltaPhi > 0) {
149 previousPhi_PrevEta = surf[
ss];
150 PrevDeltaPhi = DeltaPhi;
152 if( DeltaPhi > NextDeltaPhi && DeltaPhi < 0) {
153 nextPhi_PrevEta = surf[
ss];
154 NextDeltaPhi = DeltaPhi;
156 }
else if (
etamod == (etaModule+1) ) {
157 if( tsf.
center().phi() == (*(surf[
ss])).center().phi() )
158 samePhi_NextEta = surf[
ss];
159 double DeltaPhi = tsf.
center().phi() - (*(surf[
ss])).center().phi();
160 if( DeltaPhi < PrevDeltaPhi && DeltaPhi > 0) {
161 previousPhi_NextEta = surf[
ss];
162 PrevDeltaPhi = DeltaPhi;
165 if( DeltaPhi > NextDeltaPhi && DeltaPhi < 0) {
166 nextPhi_NextEta = surf[
ss];
167 NextDeltaPhi = DeltaPhi;
171 offset += (std::as_const(*m_singleBinUtils).at(
bin))->
bins();
174 if (samePhi_PrevEta) {
176 if (PhiEta_Element) {
182 if (previousPhi_PrevEta) {
184 if (PhiEta_Element) {
193 if (nextPhi_PrevEta) {
195 if (PhiEta_Element) {
204 if (samePhi_NextEta) {
206 if (PhiEta_Element) {
212 if (previousPhi_NextEta) {
214 if (PhiEta_Element) {
223 if (nextPhi_NextEta) {
225 if (PhiEta_Element) {
241 std::cout <<
"Dumping Surfaces for " << (
m_pixelCase ?
"Pixel " :
"SCT ")
242 <<
"with size = " << surfaces.size() << std::endl;
247 for (
auto & surface : surfaces) {
248 Identifier hitId = (surface.object)->associatedDetectorElementIdentifier();
250 std::cout <<
"barrel_ec " << pixIdHelper->
barrel_ec(hitId)
251 <<
", layer_disk " << pixIdHelper->
layer_disk(hitId)
252 <<
", phi_module " << pixIdHelper->
phi_module(hitId)
253 <<
", eta_module " << pixIdHelper->
eta_module(hitId) << std::endl;
255 std::cout <<
"barrel_ec " << sctIdHelper->
barrel_ec(hitId)
256 <<
", layer_disk " << sctIdHelper->
layer_disk(hitId)
257 <<
", phi_module " << sctIdHelper->
phi_module(hitId)
258 <<
", eta_module " << sctIdHelper->
eta_module(hitId)
259 <<
", side " << sctIdHelper->
side(hitId) << std::endl;