Belle II Software  release-05-02-19
ECLNeighbours.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Returns the list of neighbours for a given cell ID. *
6  * *
7  * Author: The Belle II Collaboration *
8  * Contributors: Torben Ferber (ferber@physics.ubc.ca) *
9  * *
10  * This software is provided "as is" without any warranty. *
11  **************************************************************************/
12 #ifndef ECLNEIGHBOURS_H
13 #define ECLNEIGHBOURS_H
14 
15 #include <vector>
16 #include <string>
17 
18 namespace Belle2 {
23  namespace ECL {
24 
28  class ECLNeighbours {
29 
30  public:
31 
33  ECLNeighbours(const std::string& neighbourDef, const double par);
34 
37 
39  const std::vector<short int>& getNeighbours(short int cid) const;
40 
42  short int getCrystalsPerRing(const short int thetaid) const { return m_crystalsPerRing[thetaid]; }
43 
44  private:
46  std::vector < std::vector < short int > > m_neighbourMap;
47 
49  std::vector < std::vector < short int > > m_neighbourMapTemp;
50 
52  const short m_crystalsPerRing[69] = {
53  48, 48, 64, 64, 64, 96, 96, 96, 96, 96, 96, 144, 144, //FWD up to 13
54  144, 144, 144, 144, 144, 144, 144, // BARREL up to 20
55  144, 144, 144, 144, 144, 144, 144, 144, 144, 144, // ...30
56  144, 144, 144, 144, 144, 144, 144, 144, 144, 144, // ...40
57  144, 144, 144, 144, 144, 144, 144, 144, 144, 144, // ...50
58  144, 144, 144, 144, 144, 144, 144, 144, 144, // BARREL up to 59
59  144, 144, 96, 96, 96, 96, 96, 64, 64, 64
60  }; //BWD
61 
62 
64  void initializeN(const int nneighbours);
65 
67  void initializeNC(const int nneighbours, const int corners);
68 
70  void initializeR(const double radius);
71 
73  void initializeF(const double fraction);
74 
76  short int decreasePhiId(const short int phiid, const short int thetaid, const short int n);
77 
79  short int increasePhiId(const short int phiid, const short int thetaid, const short int n);
80 
82  std::vector<short int> getPhiIdsInBetween(const short int phiInc, const short int phiDec, const short int theta);
83 
85  std::vector<short int> getPhiIdsInBetweenC(const short int phiInc, const short int phiDec, const short int theta,
86  const int corners);
87 
89  double getDistance(const double alpha, const double R);
90 
91  };
92 
93  } // end of namespace ECL
95 } // end of namespace Belle2
96 
97 #endif
Belle2::ECL::ECLNeighbours::getPhiIdsInBetweenC
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
Definition: ECLNeighbours.cc:352
Belle2::ECL::ECLNeighbours::initializeNC
void initializeNC(const int nneighbours, const int corners)
initialize the mask neighbour list, remove corners.
Definition: ECLNeighbours.cc:269
Belle2::ECL::ECLNeighbours::decreasePhiId
short int decreasePhiId(const short int phiid, const short int thetaid, const short int n)
return the previous phi id.
Definition: ECLNeighbours.cc:324
Belle2::ECL::ECLNeighbours::getDistance
double getDistance(const double alpha, const double R)
return the chord length between cells
Definition: ECLNeighbours.cc:372
Belle2::ECL::ECLNeighbours::ECLNeighbours
ECLNeighbours(const std::string &neighbourDef, const double par)
Constructor: Fix number of neighbours ("N") in the seed theta ring, fraction cross ("F"),...
Definition: ECLNeighbours.cc:29
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ECL::ECLNeighbours::~ECLNeighbours
~ECLNeighbours()
Destructor.
Definition: ECLNeighbours.cc:79
Belle2::ECL::ECLNeighbours::m_neighbourMapTemp
std::vector< std::vector< short int > > m_neighbourMapTemp
temporary list of list of neighbour cids.
Definition: ECLNeighbours.h:59
Belle2::ECL::ECLNeighbours::initializeF
void initializeF(const double fraction)
initialize the fractional cross neighbour list.
Definition: ECLNeighbours.cc:124
Belle2::ECL::ECLNeighbours::initializeN
void initializeN(const int nneighbours)
initialize the mask neighbour list.
Definition: ECLNeighbours.cc:223
Belle2::ECL::ECLNeighbours::increasePhiId
short int increasePhiId(const short int phiid, const short int thetaid, const short int n)
return the next phi id.
Definition: ECLNeighbours.cc:331
Belle2::ECL::ECLNeighbours::m_crystalsPerRing
const short m_crystalsPerRing[69]
Number of crystals in each theta ring.
Definition: ECLNeighbours.h:62
Belle2::ECL::ECLNeighbours::m_neighbourMap
std::vector< std::vector< short int > > m_neighbourMap
list of list of neighbour cids.
Definition: ECLNeighbours.h:56
Belle2::ECL::ECLNeighbours::getNeighbours
const std::vector< short int > & getNeighbours(short int cid) const
Return the neighbours for a given cell ID.
Definition: ECLNeighbours.cc:318
Belle2::ECL::ECLNeighbours::getCrystalsPerRing
short int getCrystalsPerRing(const short int thetaid) const
return number of crystals in a given theta ring
Definition: ECLNeighbours.h:52
Belle2::ECL::ECLNeighbours::getPhiIdsInBetween
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
Definition: ECLNeighbours.cc:338
Belle2::ECL::ECLNeighbours::initializeR
void initializeR(const double radius)
initialize the radius neighbour list.
Definition: ECLNeighbours.cc:84