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

#include <TriggerConfiguration.h>

Classes

struct  CryoConfig
 
struct  GateConfig
 

Public Member Functions

float getGateWidth (std::size_t source) const
 returns the effective gate width corrected for the veto delay in us More...
 
float getDriftGateWidth (std::size_t source) const
 returns the width of the drift gate used for out-of-time light activity in us More...
 
unsigned int getOffBeamRate (std::size_t source) const
 returns the prescale value used to open the offbeam gates with respect to the total number of beam gates seen More...
 
unsigned int getMinBiasPrescale (std::size_t source) const
 returns the prescale value used to collect MinBias triggers with respect to the total number of gates seen of a particula type More...
 
void dump (std::ostream &out, std::string const &indent, std::string const &firstIndent, unsigned int verbosity=MaxDumpVerbosity) const
 Dumps the content of the configuration into out stream. More...
 
void dump (std::ostream &out, std::string const &indent="") const
 Dumps the content of the configuration into out stream. More...
 
void dumpGateConfig (std::ostream &out, icarus::TriggerConfiguration::GateConfig const &gateConfig, std::string const &indent) const
 Dumps the content of the gate configuration into out stream. More...
 
void dump (std::ostream &out, unsigned int verbosity, std::string const &indent="") const
 
bool operator== (TriggerConfiguration const &other) const noexcept
 Comparison: all fields need to have the same values. More...
 
bool operator!= (TriggerConfiguration const &other) const noexcept
 

Public Attributes

bool useWrTime = false
 Use the WR time reference. More...
 
unsigned int wrTimeOffset = 1'000'000'000
 Add an offset between the npt and tai time as used in the wr reference (normally it is 1 or 2 leap seconds) in ns. More...
 
unsigned int vetoDelay = 0
 Veto (this delay has to be subtracted to the gate width ). Value is in ns. More...
 
std::array< CryoConfig,
icarus::trigger::kNTriggerLocation
cryoConfig
 Cryostat configuration. More...
 
std::string majorityTriggerType
 Majority trigger type (consider triggers from one cryostats, either cryostats, or both cryostats) More...
 
std::string runType
 Force the run to be fully a MinBias, if runType=="MinBias". If runType=="Majority" does a majority run with some prescaled minbias triggers depending on the gate selection in use. More...
 
unsigned int tpcTriggerDelay = 0
 TPCTriggerDelay: distance between the Global trigger time and the output for the TPC. NB: It is in units of 400 ns. More...
 
std::array< GateConfig,
icarus::trigger::kNTriggerSource
gateConfig
 Gate Configuration. More...
 

Static Public Attributes

static constexpr unsigned int MaxDumpVerbosity = 2U
 Maximum supported verbosity level supported by dump(). More...
 
static constexpr unsigned int DefaultDumpVerbosity = MaxDumpVerbosity
 Default verbosity level for dump(). More...
 

Detailed Description

Definition at line 31 of file TriggerConfiguration.h.

Member Function Documentation

void icarus::TriggerConfiguration::dump ( std::ostream &  out,
std::string const &  indent,
std::string const &  firstIndent,
unsigned int  verbosity = MaxDumpVerbosity 
) const

Dumps the content of the configuration into out stream.

Parameters
outstream to dump the information into
indentindentation string
firstIndentspecial indentation string for the first line
verbosity(default: DefaultDumpVerbosity) level of verbosity

The indentation string is prepended to each new line of the dump. The first line indentation string is prepended before the first line of the dump. The dump ends on a new empty line.

The amount of information printed depends on the verbosity level:

  • 0: Boardreader configuration
  • 1: FPGA configuration
  • 2: SPEXI configuration

Definition at line 68 of file TriggerConfiguration.cxx.

71  {
72 
73  do {
74  // fake look for easy break: `goto` in disguise;
75  // `break` will add a final `'\n'`, `return` will not.
76 
77  // start a new line with indentation:
78  auto const outnl
79  = [&out,&indent]() -> std::ostream& { return out << '\n' << indent; };
80 
81  unsigned int level = 0U;
82 
83 
84  // --- verbosity: 0+ -------------------------------------------------------
85  out << firstIndent
86  << "Basic trigger configuration:";
87  outnl() << " Use WR time: " << std::boolalpha << useWrTime << std::noboolalpha;
88  outnl() << " WR time offset: " << wrTimeOffset << " ns";
89 
90  if (++level > verbosity) break;
91  // --- verbosity: 1+ -------------------------------------------------------
92 
93  auto printWindowMode = [&out](unsigned int slidingWindow){
94  switch (slidingWindow) {
95  case 0: out << "fixed"; break;
96  case 1: out << "sliding"; break;
97  default: out << "unknown";
98  } // switch
99  out << " (" << slidingWindow << ")";
100  };
101 
102  outnl() << "FPGA Configuration:";
103  outnl() << " Veto Delay: " << vetoDelay << " ns";
104  outnl() << " MajLevelBeamCryoEAST: " << cryoConfig[icarus::trigger::kEast].majLevelInTime;
105  outnl() << " MajLevelEnableCryoEAST: " << cryoConfig[icarus::trigger::kEast].majLevelDrift;
106  outnl() << " WindowCryoEAST: ";
107  printWindowMode(cryoConfig[icarus::trigger::kEast].slidingWindow);
108  outnl() << " MajLevelBeamCryoWEST: " << cryoConfig[icarus::trigger::kWest].majLevelInTime;
109  outnl() << " MajLevelEnableCryoWEST: " << cryoConfig[icarus::trigger::kWest].majLevelDrift;
110  outnl() << " WindowCryoWEST: ";
111  printWindowMode(cryoConfig[icarus::trigger::kWest].slidingWindow);
112  outnl() << " MajorityTriggerType: '" << majorityTriggerType << "'";
113  outnl() << " RunType: '" << runType << "'";
114 
115  out << "\n";
116 
117  if (++level > verbosity) return;
118  // --- verbosity: 2+ -------------------------------------------------------
119 
120  out << indent // absorb the newline from the previous level
121  << "SPEXI Configuration:\n";
122 
123  out << indent << " TPCTriggerDelay: " << (tpcTriggerDelay * 0.0004) << " ms ("
124  << tpcTriggerDelay << " x 400 ns)\n";
125 
126  out << indent << " BNB:\n";
127  dumpGateConfig( out, gateConfig[icarus::trigger::kBNB], indent+" - " );
128 
129  out << indent << " NuMI:\n";
130  dumpGateConfig( out, gateConfig[icarus::trigger::kNuMI], indent+" - " );
131 
132  out << indent << " Offbeam BNB:\n";
133  dumpGateConfig( out, gateConfig[icarus::trigger::kOffBeamBNB], indent + " - " );
134 
135  out << indent << " Offbeam NuMI:\n";
137 
138 
139  out << indent << " Calibration:\n";
142  out << indent << " - " << "Period: " << gateConfig[icarus::trigger::kCalibration].period << " ns\n";
143  }
144 
145  if (++level > verbosity) break;
146  // --- verbosity: 3+ -------------------------------------------------------
147 
148  assert(level == MaxDumpVerbosity + 1U);
149 
150  // this is more debug information than anything else: verbosity was too high
151  outnl() << "No more information available (reached level " << level << ").";
152 
153  } while(false);
154 
155  out << "\n";
156 
157 } // icarus::TriggerConfiguration::dump()
std::string runType
Force the run to be fully a MinBias, if runType==&quot;MinBias&quot;. If runType==&quot;Majority&quot; does a majority ru...
static constexpr std::size_t kOffBeamNuMI
Definition: BeamBits.h:370
static constexpr std::size_t kWest
Definition: BeamBits.h:364
std::array< CryoConfig, icarus::trigger::kNTriggerLocation > cryoConfig
Cryostat configuration.
static constexpr std::size_t kBNB
Definition: BeamBits.h:367
void dumpGateConfig(std::ostream &out, icarus::TriggerConfiguration::GateConfig const &gateConfig, std::string const &indent) const
Dumps the content of the gate configuration into out stream.
static constexpr std::size_t kCalibration
Definition: BeamBits.h:371
unsigned int wrTimeOffset
Add an offset between the npt and tai time as used in the wr reference (normally it is 1 or 2 leap se...
static constexpr std::size_t kNuMI
Definition: BeamBits.h:368
static constexpr std::size_t kOffBeamBNB
Definition: BeamBits.h:369
std::array< GateConfig, icarus::trigger::kNTriggerSource > gateConfig
Gate Configuration.
bool useWrTime
Use the WR time reference.
unsigned int tpcTriggerDelay
TPCTriggerDelay: distance between the Global trigger time and the output for the TPC. NB: It is in units of 400 ns.
unsigned int vetoDelay
Veto (this delay has to be subtracted to the gate width ). Value is in ns.
static constexpr std::size_t kEast
Definition: BeamBits.h:363
static constexpr unsigned int MaxDumpVerbosity
Maximum supported verbosity level supported by dump().
std::string majorityTriggerType
Majority trigger type (consider triggers from one cryostats, either cryostats, or both cryostats) ...
void icarus::TriggerConfiguration::dump ( std::ostream &  out,
std::string const &  indent = "" 
) const
inline

Dumps the content of the configuration into out stream.

Parameters
outstream to dump the information into
indentindentation level
See Also
dump(std::ostream&, std::string const&, std::string const&, unsigned int) const

Version of dump() with same first indentation level as the rest, and default verbosity.

Definition at line 254 of file TriggerConfiguration.h.

255  { dump(out, indent, indent); }
void dump(std::ostream &out, std::string const &indent, std::string const &firstIndent, unsigned int verbosity=MaxDumpVerbosity) const
Dumps the content of the configuration into out stream.
void icarus::TriggerConfiguration::dump ( std::ostream &  out,
unsigned int  verbosity,
std::string const &  indent = "" 
) const
inline

Definition at line 272 of file TriggerConfiguration.h.

276  { dump(out, indent, indent, verbosity); }
void dump(std::ostream &out, std::string const &indent, std::string const &firstIndent, unsigned int verbosity=MaxDumpVerbosity) const
Dumps the content of the configuration into out stream.
void icarus::TriggerConfiguration::dumpGateConfig ( std::ostream &  out,
icarus::TriggerConfiguration::GateConfig const &  gateConfig,
std::string const &  indent 
) const

Dumps the content of the gate configuration into out stream.

Parameters
outstream to dump the information into
gateConfigthe gate to be dumped
indent(default: none) indentation string
See Also
dump(std::ostream&, std::string const&, std::string const&, unsigned int) const

Version of dump() with the specified verbosity level and same first indentation level as the rest.

Definition at line 22 of file TriggerConfiguration.cxx.

23 {
24  out << std::boolalpha
25  << indent << "Gate Active: " << gateConfig.hasGate << "\n";
26  if (gateConfig.hasGate) {
27 
28  // gates
29  out
30  << indent << "Drift gate Active: " << gateConfig.hasDriftGate << "\n"
31  << indent << "MinBias Gate Active: " << gateConfig.hasMinBiasGate << "\n"
32  ;
33  if (gateConfig.hasMinBiasGate)
34  out << indent << "MinBias Drift Gate Active: " << gateConfig.hasMinBiasDriftGate << "\n";
35  else if (gateConfig.hasMinBiasDriftGate)
36  out << indent << "MinBias Drift Gate Active: " << gateConfig.hasMinBiasDriftGate << " (ignored)\n";
37 
38  // gate durations and offsets
39  out << indent << "BeamWidth: " << (gateConfig.gateWidth - vetoDelay) << " ns";
40  if (vetoDelay != 0)
41  out << " (plus the veto of " << vetoDelay << " ns)";
42  out << "\n";
43  if (gateConfig.hasDriftGate)
44  out << indent << "EnableWidth: " << gateConfig.driftGateWidth << " ns\n";
45  out << indent << "EarlyWarningOffset: " << gateConfig.earlyWarningOffset << " ns\n";
46  if (gateConfig.hasDriftGate)
47  out << indent << "EarlyEarlyWarningOffset: " << gateConfig.earlyEarlyWarningOffset << " ns\n";
48 
49  if (gateConfig.hasMinBiasGate)
50  out << indent << "MinBias PreScale: " << gateConfig.prescaleMinBias << "\n";
51  }
52  else {
53 
54  if (gateConfig.hasDriftGate)
55  out << indent << "Drift gate Active: " << gateConfig.hasDriftGate << " (ignored)\n";
56  if (gateConfig.hasMinBiasGate)
57  out << indent << "MinBias Gate Active: " << gateConfig.hasMinBiasGate << " (ignored)\n";
58  if (gateConfig.hasMinBiasDriftGate)
59  out << indent << "MinBias Drift Gate Active: " << gateConfig.hasMinBiasDriftGate << " (ignored)\n";
60 
61  }
62 
63  out << std::noboolalpha;
64 }
std::array< GateConfig, icarus::trigger::kNTriggerSource > gateConfig
Gate Configuration.
unsigned int vetoDelay
Veto (this delay has to be subtracted to the gate width ). Value is in ns.
float icarus::TriggerConfiguration::getDriftGateWidth ( std::size_t  source) const
inline

returns the width of the drift gate used for out-of-time light activity in us

Parameters
sourceis the value of the sbn::bits::triggerSource enum type corresponding to the type of gate

Definition at line 164 of file TriggerConfiguration.h.

164  {
165 
166  return gateConfig[source].hasDriftGate ?
167  static_cast<float>( gateConfig[source].driftGateWidth )/1000. : 0U;
168 
169  }
do source
std::array< GateConfig, icarus::trigger::kNTriggerSource > gateConfig
Gate Configuration.
float icarus::TriggerConfiguration::getGateWidth ( std::size_t  source) const
inline

returns the effective gate width corrected for the veto delay in us

Parameters
sourceis the value of the sbn::bits::triggerSource enum type corresponding to the type of gate

Definition at line 148 of file TriggerConfiguration.h.

148  {
149 
150  // We really want the vetoDelay to be shorter than the gateWidth
151  assert(!gateConfig[source].hasGate || (gateConfig[source].gateWidth >= vetoDelay));
152 
153  return gateConfig[source].hasGate ?
154  static_cast<float>( gateConfig[source].gateWidth - vetoDelay )/1000. : 0.;
155 
156  }
do source
std::array< GateConfig, icarus::trigger::kNTriggerSource > gateConfig
Gate Configuration.
unsigned int vetoDelay
Veto (this delay has to be subtracted to the gate width ). Value is in ns.
unsigned int icarus::TriggerConfiguration::getMinBiasPrescale ( std::size_t  source) const
inline

returns the prescale value used to collect MinBias triggers with respect to the total number of gates seen of a particula type

Parameters
sourceis the value of the sbn::bits::triggerSource enum type corresponding to the type of gate

Definition at line 189 of file TriggerConfiguration.h.

189  {
190 
191  return gateConfig[source].hasGate ? gateConfig[source].prescaleMinBias : 0U;
192 
193  }
do source
std::array< GateConfig, icarus::trigger::kNTriggerSource > gateConfig
Gate Configuration.
unsigned int icarus::TriggerConfiguration::getOffBeamRate ( std::size_t  source) const
inline

returns the prescale value used to open the offbeam gates with respect to the total number of beam gates seen

Parameters
sourceis the value of the sbn::bits::triggerSource enum type corresponding to the type of gate

Definition at line 177 of file TriggerConfiguration.h.

177  {
178 
179  return gateConfig[source].hasGate ? gateConfig[source].offBeamGateRate : 0U;
180 
181  }
do source
std::array< GateConfig, icarus::trigger::kNTriggerSource > gateConfig
Gate Configuration.
bool icarus::TriggerConfiguration::operator!= ( TriggerConfiguration const &  other) const
inlinenoexcept

Definition at line 202 of file TriggerConfiguration.h.

203  { return ! this->operator== (other); }
bool operator==(TriggerConfiguration const &other) const noexcept
Comparison: all fields need to have the same values.
bool icarus::TriggerConfiguration::operator== ( icarus::TriggerConfiguration const &  other) const
inlinenoexcept

Comparison: all fields need to have the same values.

Definition at line 289 of file TriggerConfiguration.h.

290 {
291 
292  if ( useWrTime != other.useWrTime ) return false;
293  if ( wrTimeOffset != other.wrTimeOffset ) return false;
294  if ( vetoDelay != other.vetoDelay ) return false;
295  if ( majorityTriggerType != other.majorityTriggerType ) return false;
296  if ( runType != other.runType ) return false;
297  if ( tpcTriggerDelay != other.tpcTriggerDelay ) return false;
298 
299 
300  return true;
301 
302 }
std::string runType
Force the run to be fully a MinBias, if runType==&quot;MinBias&quot;. If runType==&quot;Majority&quot; does a majority ru...
unsigned int wrTimeOffset
Add an offset between the npt and tai time as used in the wr reference (normally it is 1 or 2 leap se...
bool useWrTime
Use the WR time reference.
unsigned int tpcTriggerDelay
TPCTriggerDelay: distance between the Global trigger time and the output for the TPC. NB: It is in units of 400 ns.
unsigned int vetoDelay
Veto (this delay has to be subtracted to the gate width ). Value is in ns.
std::string majorityTriggerType
Majority trigger type (consider triggers from one cryostats, either cryostats, or both cryostats) ...

Member Data Documentation

std::array<CryoConfig, icarus::trigger::kNTriggerLocation> icarus::TriggerConfiguration::cryoConfig

Cryostat configuration.

Definition at line 125 of file TriggerConfiguration.h.

constexpr unsigned int icarus::TriggerConfiguration::DefaultDumpVerbosity = MaxDumpVerbosity
static

Default verbosity level for dump().

Definition at line 218 of file TriggerConfiguration.h.

std::array<GateConfig, icarus::trigger::kNTriggerSource> icarus::TriggerConfiguration::gateConfig

Gate Configuration.

Definition at line 137 of file TriggerConfiguration.h.

std::string icarus::TriggerConfiguration::majorityTriggerType

Majority trigger type (consider triggers from one cryostats, either cryostats, or both cryostats)

Definition at line 128 of file TriggerConfiguration.h.

constexpr unsigned int icarus::TriggerConfiguration::MaxDumpVerbosity = 2U
static

Maximum supported verbosity level supported by dump().

Definition at line 215 of file TriggerConfiguration.h.

std::string icarus::TriggerConfiguration::runType

Force the run to be fully a MinBias, if runType=="MinBias". If runType=="Majority" does a majority run with some prescaled minbias triggers depending on the gate selection in use.

Definition at line 131 of file TriggerConfiguration.h.

unsigned int icarus::TriggerConfiguration::tpcTriggerDelay = 0

TPCTriggerDelay: distance between the Global trigger time and the output for the TPC. NB: It is in units of 400 ns.

Definition at line 134 of file TriggerConfiguration.h.

bool icarus::TriggerConfiguration::useWrTime = false

Use the WR time reference.

Definition at line 116 of file TriggerConfiguration.h.

unsigned int icarus::TriggerConfiguration::vetoDelay = 0

Veto (this delay has to be subtracted to the gate width ). Value is in ns.

Definition at line 122 of file TriggerConfiguration.h.

unsigned int icarus::TriggerConfiguration::wrTimeOffset = 1'000'000'000

Add an offset between the npt and tai time as used in the wr reference (normally it is 1 or 2 leap seconds) in ns.

Definition at line 119 of file TriggerConfiguration.h.


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