ATLAS Offline Software
LayerProviderImpl.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include "TrkGeometry/Layer.h"
9 
10 // constructor
12  const std::string& n,
13  const IInterface* p)
14  : AthAlgTool(t, n, p)
15 {
16 }
17 
18 
19 const std::vector<Trk::Layer*>
20 Trk::LayerProviderImpl::cylindricalLayersToCentralLayers(std::unique_ptr<const std::vector<Trk::CylinderLayer*> > cylinderLayers)
21 {
22  // central layers
23  std::vector<Trk::Layer*> cLayers;
24  // loop over cylinderLayers and push into the return vector;
25  if (cylinderLayers) {
26  for (Trk::CylinderLayer* cL : (*cylinderLayers))
27  cLayers.push_back(cL);
28  }
29  // and return
30  return cLayers;
31 }
32 
33 
34 std::pair<const std::vector<Trk::Layer*>, const std::vector<Trk::Layer*> >
35  Trk::LayerProviderImpl::discLayersToEndcapLayers(std::unique_ptr<const std::vector<Trk::DiscLayer*> > discLayers)
36 {
37 
38  // get the disc layers
39  std::vector<Trk::Layer*> dLayers_pos;
40  std::vector<Trk::Layer*> dLayers_neg;
41  // loop and fill either dLayers
42  if (discLayers) {
43  // loop over and push into the return/cache vector
44  for (Trk::DiscLayer* dL : (*discLayers)) {
45  // get the center posituion
46  double zpos = dL->surfaceRepresentation().center().z();
47  if (zpos > 0.)
48  dLayers_pos.push_back(dL);
49  else
50  dLayers_neg.push_back(dL);
51  }
52  }
53  // and return
54  return std::make_pair(dLayers_pos, dLayers_neg);
55 }
56 
57 
58 
Trk::LayerProviderImpl::discLayersToEndcapLayers
static std::pair< const std::vector< Trk::Layer * >, const std::vector< Trk::Layer * > > discLayersToEndcapLayers(std::unique_ptr< const std::vector< Trk::DiscLayer * > > discLayers)
Definition: LayerProviderImpl.cxx:35
LayerProviderImpl.h
DiscLayer.h
Layer.h
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
beamspotman.n
n
Definition: beamspotman.py:731
CylinderLayer.h
Trk::DiscLayer
Definition: DiscLayer.h:45
Trk::CylinderLayer
Definition: CylinderLayer.h:43
Trk::LayerProviderImpl::cylindricalLayersToCentralLayers
static const std::vector< Trk::Layer * > cylindricalLayersToCentralLayers(std::unique_ptr< const std::vector< Trk::CylinderLayer * > > cylinderLayers)
Definition: LayerProviderImpl.cxx:20
Trk::LayerProviderImpl::LayerProviderImpl
LayerProviderImpl(const std::string &, const std::string &, const IInterface *)
Constructor.
Definition: LayerProviderImpl.cxx:11
AthAlgTool
Definition: AthAlgTool.h:26