Belle II Software  release-06-02-00
ECLNeighbours.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <vector>
11 #include <string>
12 
13 namespace Belle2 {
18  namespace ECL {
19 
23  class ECLNeighbours {
24 
25  public:
26 
28  ECLNeighbours(const std::string& neighbourDef, const double par);
29 
32 
34  const std::vector<short int>& getNeighbours(short int cid) const;
35 
37  short int getCrystalsPerRing(const short int thetaid) const { return m_crystalsPerRing[thetaid]; }
38 
39  private:
41  std::vector < std::vector < short int > > m_neighbourMap;
42 
44  std::vector < std::vector < short int > > m_neighbourMapTemp;
45 
47  const short m_crystalsPerRing[69] = {
48  48, 48, 64, 64, 64, 96, 96, 96, 96, 96, 96, 144, 144, //FWD up to 13
49  144, 144, 144, 144, 144, 144, 144, // BARREL up to 20
50  144, 144, 144, 144, 144, 144, 144, 144, 144, 144, // ...30
51  144, 144, 144, 144, 144, 144, 144, 144, 144, 144, // ...40
52  144, 144, 144, 144, 144, 144, 144, 144, 144, 144, // ...50
53  144, 144, 144, 144, 144, 144, 144, 144, 144, // BARREL up to 59
54  144, 144, 96, 96, 96, 96, 96, 64, 64, 64
55  }; //BWD
56 
57 
59  void initializeN(const int nneighbours);
60 
62  void initializeNC(const int nneighbours);
63 
65  void initializeNLegacy(const int nneighbours);
66 
68  void initializeNCLegacy(const int nneighbours, const int corners);
69 
71  void initializeR(const double radius);
72 
74  void initializeF(const double fraction);
75 
77  short int decreasePhiId(const short int phiid, const short int thetaid, const short int n);
78 
80  short int increasePhiId(const short int phiid, const short int thetaid, const short int n);
81 
83  std::vector<short int> getPhiIdsInBetween(const short int phiInc, const short int phiDec, const short int theta);
84 
86  std::vector<short int> getPhiIdsInBetweenC(const short int phiInc, const short int phiDec, const short int theta,
87  const int corners);
88 
90  double getDistance(const double alpha, const double R);
91 
92  };
93 
94  } // end of namespace ECL
96 } // end of namespace Belle2
97 
Class to get the neighbours for a given cell id.
Definition: ECLNeighbours.h:23
std::vector< short int > getPhiIdsInBetweenC(const short int phiInc, const short int phiDec, const short int theta, const int corners)
return a list of phi ids between two phi ids minus edges
const std::vector< short int > & getNeighbours(short int cid) const
Return the neighbours for a given cell ID.
short int getCrystalsPerRing(const short int thetaid) const
return number of crystals in a given theta ring
Definition: ECLNeighbours.h:37
const short m_crystalsPerRing[69]
Number of crystals in each theta ring.
Definition: ECLNeighbours.h:47
void initializeNCLegacy(const int nneighbours, const int corners)
initialize the mask neighbour list, remove corners, legacy code.
void initializeF(const double fraction)
initialize the fractional cross neighbour list.
void initializeN(const int nneighbours)
initialize the mask neighbour list.
ECLNeighbours(const std::string &neighbourDef, const double par)
Constructor: Fix number of neighbours ("N") in the seed theta ring, fraction cross ("F"),...
void initializeR(const double radius)
initialize the radius neighbour list.
std::vector< std::vector< short int > > m_neighbourMapTemp
temporary list of list of neighbour cids.
Definition: ECLNeighbours.h:44
short int increasePhiId(const short int phiid, const short int thetaid, const short int n)
return the next phi id.
std::vector< std::vector< short int > > m_neighbourMap
list of list of neighbour cids.
Definition: ECLNeighbours.h:41
std::vector< short int > getPhiIdsInBetween(const short int phiInc, const short int phiDec, const short int theta)
return a list of phi ids between two phi ids
void initializeNC(const int nneighbours)
initialize the mask neighbour list, remove corners.
void initializeNLegacy(const int nneighbours)
initialize the mask neighbour list, legacy code.
double getDistance(const double alpha, const double R)
return the chord length between cells
short int decreasePhiId(const short int phiid, const short int thetaid, const short int n)
return the previous phi id.
Abstract base class for different kinds of events.