Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-14 09:20:50

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 // TODO: update to C++17 style
0012 #include "Acts/TrackFinding/GbtsConnector.hpp"
0013 
0014 #include <cmath>
0015 #include <map>
0016 #include <memory>
0017 #include <vector>
0018 
0019 namespace Acts::Experimental {
0020 class TrigInDetSiLayer {
0021  public:
0022   int m_subdet;  // combined ID
0023   int m_type;    // 0: barrel, +/-n : endcap
0024   float m_refCoord;
0025   float m_minBound, m_maxBound;
0026 
0027   TrigInDetSiLayer(int subdet, short int type, float center, float min,
0028                    float max)
0029       : m_subdet(subdet),
0030         m_type(type),
0031         m_refCoord(center),
0032         m_minBound(min),
0033         m_maxBound(max) {}
0034 };
0035 
0036 class GbtsLayer {
0037  public:
0038   GbtsLayer(const TrigInDetSiLayer& ls, float ew, int bin0);
0039   ~GbtsLayer();
0040 
0041   int getEtaBin(float zh, float rh) const;
0042 
0043   float getMinBinRadius(int idx) const;
0044   float getMaxBinRadius(int idx) const;
0045 
0046   int num_bins() const { return m_bins.size(); }
0047 
0048   bool verifyBin(const GbtsLayer* pL, int b1, int b2, float min_z0,
0049                  float max_z0) const;
0050 
0051   const TrigInDetSiLayer& m_layer;
0052   std::vector<int> m_bins;  // eta-bin indices
0053   std::vector<float> m_minRadius;
0054   std::vector<float> m_maxRadius;
0055   std::vector<float> m_minBinCoord;
0056   std::vector<float> m_maxBinCoord;
0057 
0058   float m_minEta, m_maxEta, m_etaBin;
0059 
0060  protected:
0061   float m_etaBinWidth;
0062 
0063   float m_r1, m_z1, m_r2, m_z2;
0064   int m_nBins;
0065 };
0066 
0067 class GbtsGeometry {
0068  public:
0069   GbtsGeometry(const std::vector<TrigInDetSiLayer>& layers,
0070                const std::unique_ptr<GbtsConnector>& conn);
0071   ~GbtsGeometry();
0072 
0073   const GbtsLayer* getGbtsLayerByKey(unsigned int key) const;
0074   const GbtsLayer* getGbtsLayerByIndex(int idx) const;
0075 
0076   int num_bins() const { return m_nEtaBins; }
0077   unsigned int num_layers() const { return m_layArray.size(); }
0078   const std::vector<std::pair<int, std::vector<int> > >& bin_groups() const {
0079     return m_binGroups;
0080   }
0081 
0082  protected:
0083   const GbtsLayer* addNewLayer(const TrigInDetSiLayer& l, int bin0);
0084 
0085   float m_etaBinWidth;
0086 
0087   std::map<unsigned int, GbtsLayer*> m_layMap;
0088   std::vector<GbtsLayer*> m_layArray;
0089 
0090   int m_nEtaBins{};
0091 
0092   std::vector<std::pair<int, std::vector<int> > > m_binGroups;
0093 };
0094 
0095 }  // namespace Acts::Experimental