All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
icarus::trigger::WindowPattern Struct Reference

Specification of the requirement of sliding window firing pattern. More...

#include <WindowPattern.h>

Public Member Functions

bool isMainRequirementRelevant () const
 
bool isSumRequirementRelevant () const
 
std::string tag () const
 Returns a tag summarizing the pattern. More...
 
std::string description () const
 Returns a description of the pattern. More...
 

Public Attributes

bool requireUpstreamWindow = false
 Whether a window location with no upstream window should be discarded. More...
 
bool requireDownstreamWindow = false
 Whether a window location with no downstream window should be discarded. More...
 
Minimum required number of open trigger primitives per window.
unsigned int minInMainWindow = 0U
 
unsigned int minInUpstreamWindow = 0U
 
unsigned int minInDownstreamWindow = 0U
 
unsigned int minInOppositeWindow = 0U
 
unsigned int minSumInOppositeWindows = 0U
 

Detailed Description

Specification of the requirement of sliding window firing pattern.

This structure contains the requirements of a trigger on a ("main") window. The main window is supposed to have neighbors upstream and downstream of it (the "stream" being the neutrino beam's), and a single window opposite to it. The requirements are a minimum activity (as a count of LVDS signals open at the same time) for each of the windows. A minimum requirement of 0 is considered to be always satisfied (even if effectively the window it refers to does not exist).

Special requirements are whether it is mandatory for the window to have a upstream and/or downstream window (the presence of an opposite window is assumed to always be optional).

Definition at line 51 of file WindowPattern.h.

Member Function Documentation

std::string icarus::trigger::WindowPattern::description ( ) const

Returns a description of the pattern.

Definition at line 71 of file WindowPattern.cxx.

71  {
72  using namespace std::string_literals;
73 
74  bool const useMain = isMainRequirementRelevant();
75  bool const useSum = isSumRequirementRelevant();
76 
77  std::string s = "required:";
78 
79  if (useMain || !useSum)
81  else
82  s += " "s + std::to_string(minSumInOppositeWindows) + " (main+opposite)"s;
83 
84  if (minInOppositeWindow > 0U)
85  s += " + "s + std::to_string(minInOppositeWindow) + " (opposite)"s;
86 
87  if (useMain && useSum)
88  s += " (and "s + std::to_string(minSumInOppositeWindows) + " main+opposite)"s;
89 
93  s += " (downstream"s;
94  if (requireDownstreamWindow) s+= ", mandatory)"s;
95  s += ")"s;
96  } // if downstream
97 
100  s += " (upstream"s;
101  if (requireUpstreamWindow) s+= ", mandatory)"s;
102  s += ")"s;
103  } // if upstream
104 
105  return s;
106 } // icarus::trigger::WindowPattern::description()
bool requireDownstreamWindow
Whether a window location with no downstream window should be discarded.
Definition: WindowPattern.h:66
std::string to_string(WindowPattern const &pattern)
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
bool requireUpstreamWindow
Whether a window location with no upstream window should be discarded.
Definition: WindowPattern.h:63
bool icarus::trigger::WindowPattern::isMainRequirementRelevant ( ) const

Returns whether the main requirement (M) contributes to specification. This is not the case when S is specified that is twice M or when its value is 0.

Definition at line 14 of file WindowPattern.cxx.

14  {
15 
16  /*
17  * If the main window requirement is no larger than half the requested sum
18  * (rounded up) then the requirement is not relevant, although in the special
19  * cases where `S` is odd and `M` is its half rounded up (e.g. `M3S5`), the
20  * main window requirement may be used to decide to which side of the TPC
21  * the trigger should be assigned.
22  */
23 
24  unsigned int const maxIrrelevant
26 
27  return minInMainWindow > maxIrrelevant;
28 
29 } // icarus::trigger::WindowPattern::isMainRequirementRelevant()
bool icarus::trigger::WindowPattern::isSumRequirementRelevant ( ) const

Returns whether the sum requirement (S) contributes to specification. This is not the case when S is not larger than the sum of M and O.

Definition at line 33 of file WindowPattern.cxx.

33  {
34 
36 
37 } // icarus::trigger::WindowPattern::isSumRequirementRelevant()
std::string icarus::trigger::WindowPattern::tag ( ) const

Returns a tag summarizing the pattern.

The tag encodes the requirements on the main window (R(M)), its opposite window (R(O)), their minimum sum (R(S)) and downstream (R(D)) and upstream (R(U)) windows. A requirement R(X) is in the format X##[req], where X is the tag letter of the requirement, ## is the requirement level for that window, and the optional req tag means that if for a main window this window does not exist, that main window is not considered (e.g. the downstream window of a main window which is the most downstream in the detector).

For example, M5O2D2reqU1 requires 5 openings in the main window (M5), 2 in the window opposite to the main one (O2) and also 2 on the window downstream of the main one (D2req) and also 1 on the window upstream of the main one (U1); in addition, if the main window has no downstream window (i.e. it's at the "far end" of the detector), the downstream requirement is never satisfied and the trigger is considered to never fire. Instead, if there is no upstream window (i.e. the main window is in the "near end" of the detector) the upstream window requirement is considered to be satisfied (or ignored).

Redundant requirements are omitted (except for M0 if not superseded by a sum requirement).

Definition at line 41 of file WindowPattern.cxx.

41  {
42  using namespace std::string_literals;
43 
44  std::string s;
45 
46  // `M` is added last, because it may be needed even if irrelevant
47  if (minInOppositeWindow > 0U)
49 
52 
55  if (requireDownstreamWindow) s+= "req"s;
56  } // if downstream
57 
60  if (requireUpstreamWindow) s+= "req"s;
61  } // if upstream
62 
63  if (isMainRequirementRelevant() || s.empty())
65 
66  return s;
67 } // icarus::trigger::WindowPattern::description()
bool requireDownstreamWindow
Whether a window location with no downstream window should be discarded.
Definition: WindowPattern.h:66
std::string to_string(WindowPattern const &pattern)
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
bool requireUpstreamWindow
Whether a window location with no upstream window should be discarded.
Definition: WindowPattern.h:63

Member Data Documentation

unsigned int icarus::trigger::WindowPattern::minInDownstreamWindow = 0U

Definition at line 57 of file WindowPattern.h.

unsigned int icarus::trigger::WindowPattern::minInMainWindow = 0U

Definition at line 55 of file WindowPattern.h.

unsigned int icarus::trigger::WindowPattern::minInOppositeWindow = 0U

Definition at line 58 of file WindowPattern.h.

unsigned int icarus::trigger::WindowPattern::minInUpstreamWindow = 0U

Definition at line 56 of file WindowPattern.h.

unsigned int icarus::trigger::WindowPattern::minSumInOppositeWindows = 0U

Definition at line 59 of file WindowPattern.h.

bool icarus::trigger::WindowPattern::requireDownstreamWindow = false

Whether a window location with no downstream window should be discarded.

Definition at line 66 of file WindowPattern.h.

bool icarus::trigger::WindowPattern::requireUpstreamWindow = false

Whether a window location with no upstream window should be discarded.

Definition at line 63 of file WindowPattern.h.


The documentation for this struct was generated from the following files: