NSL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
BetaInRange.h
Go to the documentation of this file.
1 #ifndef NSL_SELECTIONS_TOF_BETAINRANGE_H
2 #define NSL_SELECTIONS_TOF_BETAINRANGE_H
3 
4 // our headers
5 #include "NSL/Selection.h"
6 
7 namespace NSL {
8 namespace Selections {
9 
10 namespace Tof {
11 class BetaInRange : public Selection {
12 public:
13  BetaInRange(float min, float max, NAIA::Tof::BetaType type);
14 };
15 } // namespace Tof
16 
17 namespace { // hidden
18 namespace tof_base = ::NSL::Selections::Tof;
19 }
20 
21 namespace PG {
22 namespace Tof {
23 
24 namespace { // hidden
25 std::pair<float, float> betaLimits(unsigned int charge) {
26  switch (charge) {
27  case 1:
28  case 2:
29  return {0.3f, std::numeric_limits<float>::max()};
30  default:
31  return {0.0f, std::numeric_limits<float>::max()};
32  }
33 }
34 } // namespace
35 
37 public:
38  explicit BetaInRange(unsigned int charge, NAIA::Tof::BetaType type)
39  : tof_base::BetaInRange(betaLimits(charge).first, betaLimits(charge).second, type) {}
40 };
41 } // namespace Tof
42 } // namespace PG
43 
44 namespace Common {
45 namespace Tof {
46 
47 namespace { // hidden
48 std::pair<float, float> betaLimits(unsigned int charge) {
49  switch (charge) {
50  case 1:
51  case 2:
52  return {0.3f, std::numeric_limits<float>::max()};
53  default:
54  return {0.4f, std::numeric_limits<float>::max()};
55  }
56 }
57 } // namespace
58 
60 public:
61  explicit BetaInRange(unsigned int charge, NAIA::Tof::BetaType type)
62  : tof_base::BetaInRange(betaLimits(charge).first, betaLimits(charge).second, type) {}
63 };
64 } // namespace Tof
65 } // namespace Common
66 
67 } // namespace Selections
68 } // namespace NSL
69 
70 #endif
BetaInRange(unsigned int charge, NAIA::Tof::BetaType type)
Definition: BetaInRange.h:38
BetaInRange(float min, float max, NAIA::Tof::BetaType type)
Definition: BetaInRange.cpp:3
BetaInRange(unsigned int charge, NAIA::Tof::BetaType type)
Definition: BetaInRange.h:61