ATLAS Offline Software
Loading...
Searching...
No Matches
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
19const std::vector<Trk::Layer*>
20Trk::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
34std::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
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Class to describe a cylindrical detector layer for tracking, it inhertis from both,...
Class to describe a disc-like detector layer for tracking, it inhertis from both, Layer base class an...
Definition DiscLayer.h:45
LayerProviderImpl(const std::string &, const std::string &, const IInterface *)
Constructor.
static const std::vector< Trk::Layer * > cylindricalLayersToCentralLayers(std::unique_ptr< const std::vector< Trk::CylinderLayer * > > cylinderLayers)
static std::pair< const std::vector< Trk::Layer * >, const std::vector< Trk::Layer * > > discLayersToEndcapLayers(std::unique_ptr< const std::vector< Trk::DiscLayer * > > discLayers)