Belle II Software development
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
9#pragma once
10
11/* C++ headers. */
12#include <string>
13#include <vector>
14
15namespace Belle2 {
20 namespace ECL {
21
26
27 public:
28
30 ECLNeighbours(const std::string& neighbourDef, const double par, const bool sorted = false);
31
34
36 const std::vector<short int>& getNeighbours(short int cid) const;
37
39 short int getCrystalsPerRing(const short int thetaid) const { return m_crystalsPerRing[thetaid]; }
40
41 private:
43 std::vector < std::vector < short int > > m_neighbourMap;
44
46 std::vector < std::vector < short int > > m_neighbourMapTemp;
47
49 const short m_crystalsPerRing[69] = {
50 48, 48, 64, 64, 64, 96, 96, 96, 96, 96, 96, 144, 144, //FWD up to 13
51 144, 144, 144, 144, 144, 144, 144, // BARREL up to 20
52 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, // ...30
53 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, // ...40
54 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, // ...50
55 144, 144, 144, 144, 144, 144, 144, 144, 144, // BARREL up to 59
56 144, 144, 96, 96, 96, 96, 96, 64, 64, 64
57 }; //BWD
58
59
61 void initializeN(const int nneighbours, const bool sorted = false);
62
64 void initializeNC(const int nneighbours);
65
67 void initializeNLegacy(const int nneighbours);
68
70 void initializeNCLegacy(const int nneighbours, const int corners);
71
73 void initializeR(const double radius);
74
76 void initializeF(const double fraction);
77
79 short int decreasePhiId(const short int phiid, const short int thetaid, const short int n);
80
82 short int increasePhiId(const short int phiid, const short int thetaid, const short int n);
83
85 std::vector<short int> getPhiIdsInBetween(const short int phiInc, const short int phiDec, const short int theta);
86
88 std::vector<short int> getPhiIdsInBetweenC(const short int phiInc, const short int phiDec, const short int theta,
89 const int corners);
90
92 double getDistance(const double alpha, const double R);
93
94 };
95
96 } // end of namespace ECL
98} // end of namespace Belle2
99
double R
typedef autogenerated by FFTW
Class to get the neighbours for a given cell id.
Definition: ECLNeighbours.h:25
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:39
const short m_crystalsPerRing[69]
Number of crystals in each theta ring.
Definition: ECLNeighbours.h:49
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 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:46
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:43
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 initializeN(const int nneighbours, const bool sorted=false)
initialize the mask neighbour list.
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.