Constructor: Fix number of neighbours ("N") in the seed theta ring, fraction cross ("F"), radius ("R") with par = n or par = fraction (0.1-1.0) or par = radius [cm].
The sorted parameter will sort ascending thetaid and clockwise phi for the "N" case.
28{
29
30 std::vector<short int> fakeneighbours;
31 fakeneighbours.push_back(0);
33
34 int parToInt = int(par);
35
36
37 if (neighbourDef == "N") {
38 B2DEBUG(150, "ECLNeighbours::ECLNeighbours: initialize " << neighbourDef << ", n x n: " << parToInt * 2 + 1 << " x " << parToInt * 2
39 + 1);
40 if ((parToInt >= 0) and (parToInt < 11))
initializeN(parToInt, sorted);
41 else B2FATAL(
"ECLNeighbours::ECLNeighbours: " <<
LogVar(
"parameter", parToInt) <<
"Invalid parameter (must be between 0 and 10)!");
42 } else if (neighbourDef == "NC") {
43 B2DEBUG(150, "ECLNeighbours::ECLNeighbours: initialize " << neighbourDef << ", n x n (minus corners): " << parToInt * 2 + 1 << " x "
44 <<
45 parToInt * 2 + 1);
46 if ((parToInt >= 0) and (parToInt < 11))
initializeNC(parToInt);
47 else B2FATAL(
"ECLNeighbours::ECLNeighbours: " <<
LogVar(
"parameter", parToInt) <<
"Invalid parameter (must be between 0 and 10)!");
48 } else if (neighbourDef == "NLegacy") {
49 B2DEBUG(150, "ECLNeighbours::ECLNeighbours: initialize " << neighbourDef << ", n x n: " << parToInt * 2 + 1 << " x " << parToInt * 2
50 + 1);
52 else B2FATAL(
"ECLNeighbours::ECLNeighbours: " <<
LogVar(
"parameter", parToInt) <<
"Invalid parameter (must be between 0 and 10)!");
53 } else if (neighbourDef == "NCLegacy") {
54 B2DEBUG(150, "ECLNeighbours::ECLNeighbours: initialize " << neighbourDef << ", n x n (minus corners): " << parToInt * 2 + 1 << " x "
55 <<
56 parToInt * 2 + 1);
58 else B2FATAL(
"ECLNeighbours::ECLNeighbours: " <<
LogVar(
"parameter", parToInt) <<
"Invalid parameter (must be between 0 and 10)!");
59 }
60
61 else if (neighbourDef == "R") {
62 B2DEBUG(150, "ECLNeighbours::ECLNeighbours: initialize " << neighbourDef << ", radius: " << par << " cm");
64 else B2FATAL("ECLNeighbours::ECLNeighbours: " << par << " is an invalid parameter (must be between 0 cm and 30 cm)!");
65 }
66
67 else if (neighbourDef == "F") {
68 double parChecked = par;
69 if (parChecked > 1.0) parChecked = 1.0;
70 else if (parChecked < 0.1) parChecked = 0.1;
71 B2DEBUG(150, "ECLNeighbours::ECLNeighbours: initialize " << neighbourDef << ", fraction: " << parChecked);
73 }
74
75 else {
76 B2FATAL("ECLNeighbours::ECLNeighbours (constructor via std::string): Invalid option: " << neighbourDef <<
77 " (valid: N(n), NC(n), NLegacy(n), NCLegacy(n), R ( with R<30 cm), F (with 0.1<f<1)");
78 }
79
80}
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_neighbourMap
list of list of neighbour cids.
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.
static const double cm
Standard units with the value = 1.
Class to store variables with their name which were sent to the logging service.