TriggerDefines.h
Go to the documentation of this file.
1 #ifndef TRIGGERDEFINES_H
2 #define TRIGGERDEFINES_H
3 
4 #include <sys/types.h>
5 
6 //! This header contains all of the enumerated data that specify the trigger types
7 // See https://cdcvs.fnal.gov/redmine/documents/253 for more info
8 
9 namespace daqdataformats{
10 
11  //! Trigger Source Enumeration
12  enum trigSource {
13  // These are the source type that is issuing the trigger
14 
15  /*************************************************************************
16  * Standard Systems (these are predefined and guaranteed not to change *
17  *************************************************************************/
18  // Beam Time Stamp Systems (i.e. tdu master)
20  // Pulser System (Software)
22  // Pulser System (Hardware)
24  // Software Trigger from Buffer Nodes
26  // Trigger Originating from Global Trigger System (e.g. software pulser)
28  // Manual Triggering of the event
30  // Simulated Event Play back trigger
32  // External SNEWS trigger
34  // External LIGO trigger
36  /*************************************************************************
37  * User Defined Sources (these should be named when they are first used) *
38  *************************************************************************/
43  /*************************************************************************
44  * Catch all sources (if you don't have something defined yet) *
45  *************************************************************************/
46  // Unknown Source
48  // Dummy Source for testing
51  };
52 
54  // Beam Time Stamp Source (i.e. TDU Masters) by location
55  TRIGSRC_ID_BEAMSTAMP_NUMI_1 = 1, // Location: NuMI Cavern
56  TRIGSRC_ID_BEAMSTAMP_NUMI_2, // same, but from kNuMItclk instead of just kNuMI
57  TRIGSRC_ID_BEAMSTAMP_NDOS_1 = 10, // Location: Near Detector on the Surface Building
61  TRIGSRC_ID_BEAMSTAMP_MINOS_1 = 20, // Location: Minos Service Building
63  TRIGSRC_ID_BEAMSTAMP_FEYNMAN_1 = 30, // Location: FCC3
65  TRIGSRC_ID_BEAMSTAMP_BOOSTER_1 = 40, // Location: MI-12
66  TRIGSRC_ID_BEAMSTAMP_BOOSTER_2, // same, but from kBNBtclk instead of just kBNB
67  TRIGSRC_ID_BEAMSTAMP_PPS = 50, // from the accelerator PPS signal
68  TRIGSRC_ID_BEAMSTAMP_TESTBEAM = 60, // from the NOvA testbeam
70  TRIGSRC_ID_BEAMSTAMP_MAX = 99, // Maximum ID for a TDU source
71 
72  // Pulser Source Block
73  TRIGSRC_ID_PULSER_P1 =200, // cal_per
75  TRIGSRC_ID_PULSER_P3, // stream_per
76  TRIGSRC_ID_PULSER_P4, // stream_rnd
87 
88  // Global Trigger Source Block
97 
98  // SNEWS Trigger Sources
103 
104  // LIGO Trigger Sources
109 
110  // Buffer Node Sources
134 
137  TRIGSRC_ID_MAX = 0xFFFF
138 
139  };
140 
142  // These are the specific units or some other sub-ID name
143  // to fully enumerate a given source of a trigger
144  // these need not have unique values outside of their
145  // given source class (i.e. TDU-01 could have the same
146  // number as DCM-01 since both have different parent
147  // classes. The maximum value of this field is 0xFF.
156 
165 
171 
175 
179 
181 
183  };
184 
186  // These are the clock sources which caused the trigger
187  // This corresponds to the system which ISSUED the
188  // initial trigger (i.e. for beam spill triggers this
189  // is typically a TDU's clock, while for a software
190  // pulser this would be the Unix system clock)
191 
192  // GPS Based Clocks (Extend from 1-99)
196 
200 
204 
207 
210 
213 
216 
217  // Unix System Clocks
221 
225 
229 
232 
235 
239 
242 
245 
248 
252  };
253 
254 #define MAX_TRIGGER_BITS 88
255 
256  // Once defined these are forever set in stone
257  // DO NOT MODIFY ANY TRIGGER VALUE IN THIS BLOCK
258  enum trigID{
269 
270  // Data Driven ones
279 
283 
285 
310  };
311 
312  enum trigBitID{
313  // Precomputed Trigger Masks
315  TRIG_BIT_BEAM_NUMI =0x01, // A NuMI beam trigger
316  TRIG_BIT_BEAM_BOONE =0x02, // A Booster beam trigger
317  TRIG_BIT_SOFT_CAL_PER =0x04, // A calibration periodic trigger
318  TRIG_BIT_SOFT_CAL_RND =0x08, // A calibration random trigger
319  TRIG_BIT_SOFT_MANUAL =0x10, // A manually issued trigger
320  TRIG_BIT_BEAM_1PPS =0x20, // An accelerator 1 pulse/sec trigger
321  TRIG_BIT_SOFT_STREAM_PER =0x40, // A streamer periodic trigger
322  TRIG_BIT_SOFT_STREAM_RND =0x80, // A streamer random trigger
323  TRIG_BIT_SOFT_DAQ_STATUS =0x100, // A DAQ status block trigger
324  TRIG_BIT_SOFT_MONTECARLO =0x800000, // A Montecarlo Trigger
325 
326  /***********************************************************************
327  * Data Driven Triggers, one for each algorithm. *
328  * There is also room in the "trigger mod" field in the trigger header *
329  * to encode further info, eg, what version of the algorithm *
330  ***********************************************************************/
331  TRIG_BIT_DATA_SN =0x001000, // a SN trigger
332  TRIG_BIT_DATA_ENERGY =0x002000, // big-energy events (brehms, air showers)
333  TRIG_BIT_DATA_CALMU =0x004000, // a calibration muon trigger
334  TRIG_BIT_DATA_UPMU =0x008000, // upgoing muon trigger
335  TRIG_BIT_DATA_NUMU =0x010000, // contained nu-induced muons
336  TRIG_BIT_DATA_NUE =0x020000, // electron showers
337  TRIG_BIT_DATA_FASTMONO =0x040000, // fast monopoles
338  TRIG_BIT_DATA_SLOWMONO =0x080000, // slow monopoles
339  TRIG_BIT_DATA_FEBOVERFLOW=0x100000, // FEB Overflow error trigger
340  TRIG_BIT_DATA_ACTIVITY_1 =0x200000, // Activity Trigger Variant 1 (Near Det)
341  TRIG_BIT_DATA_ACTIVITY_2 =0x400000, // Activity Trigger Variant 2 (Near Det)
342 
343  // warning: SNEWS Trigger on up uses mid word
344  TRIG_BIT_SNEWS_TRIGGER =0x00000001, // SNEWS Trigger, mid word
345  TRIG_BIT_SNEWS_BEAT_SLOW =0x00000002, // SNEWS Heart Beat Slow, mid word
346  TRIG_BIT_SNEWS_BEAT_FAST =0x00000004, // SNEWS Heart Beat Fast, mid word
347  TRIG_BIT_DATA_CONTAINED =0x00000008, // a contained vertex trigger, mid word
348  TRIG_BIT_DATA_MOON =0x00000010, // muon from near moon, mid word
349  TRIG_BIT_DATA_SUN =0x00000020, // muon from near sun, mid word
350  TRIG_BIT_DATA_MICHEL =0x00000040, // michel electron, mid word
351  TRIG_BIT_DATA_SNXTRIG =0x00000080, // The other detector has seen a SN
352  TRIG_BIT_DATA_MICHEL_VAR2 =0x00000100, // Michel electron trigger (production)
353  TRIG_BIT_DATA_MICHEL_VAR3 =0x00000200, // Michel electron trigger variant 2
354  TRIG_BIT_DATA_MICHEL_VAR4 =0x00000400, // Michel electron trigger variant 3
355  TRIG_BIT_DATA_MICHEL_TEST =0x00000800, // Michel electron test trigger (test)
356  TRIG_BIT_DATA_FASTMONO_NN =0x00001000, // Fast Monopole using Neural Network (production)
357  TRIG_BIT_DATA_FASTMONO_NN_VAR2 =0x00002000, // Fast Monopole using Neural Network Variant 2 (production)
358  TRIG_BIT_DATA_FASTMONO_NN_VAR3 =0x00004000, // Fast Monopole using Neural Network Variant 3 (production)
359  TRIG_BIT_DATA_FASTMONO_NN_TEST =0x00008000, // Fast Monopole test trigger using Neural Network (test)
360  TRIG_BIT_LIGO_TRIGGER =0x00010000, // LIGO Trigger, mid word
361  TRIG_BIT_LIGO_BEAT_SLOW =0x00020000, // LIGO Heart Beat Slow, mid word
362  TRIG_BIT_LIGO_BEAT_FAST =0x00040000, // LIGO Heart Beat Fast, mid word
363  TRIG_BIT_TESTBEAM_SPILL =0x00080000, // Testbeam whole spill
364  TRIG_BIT_TESTBEAM_TRIGGERED =0x00100000, // Testbeam triggered particle
365  TRIG_BIT_DATA_NNBAR =0x00200000, // N-Nbar oscillation trigger
366  TRIG_BIT_DATA_H_MU =0x00400000, // Horizontal muon trigger
367  TRIG_BIT_MID24 =0x00800000, // New Triggers
368  TRIG_BIT_MID25 =0x01000000, // New Triggers
369  TRIG_BIT_MID26 =0x02000000, // New Triggers
370  TRIG_BIT_MID27 =0x04000000, // New Triggers
371  TRIG_BIT_MID28 =0x08000000, // New Triggers
372  TRIG_BIT_MID29 =0x10000000, // New Triggers
373  TRIG_BIT_MID30 =0x20000000, // New Triggers
374  TRIG_BIT_MID31 =0x40000000, // New Triggers
375  TRIG_BIT_MID32 =0x80000000 // New Triggers
376 
377 
378  };
379 
380  // Trigger Definition Strings
381  // These are initialized in
382  extern const char* trigIDStrings[];
383  extern const char* trigIDShortStrings[];
384 
385  const char* getTriggerName(trigID triggerID);
386  const char* getTriggerNameFromMask( unsigned int trigmask);
387 
388  const char* getTriggerShortName(trigID triggerID);
389  const char* getTriggerShortNameFromMask( unsigned int trigmask);
390 
391  trigID DecodeTrigMask(unsigned int trigmask );
392  trigBitID EncodeTrigMask(trigID triggerID);
393 
394  trigID DecodeTrigMask32(unsigned int trigmask );
395  trigBitID EncodeTrigMask32(trigID triggerID);
396 
399 
400 } /* endnamespace */
401 
402 #endif /* TRIGGERDEFINES_H */
const char * trigIDStrings[]
trigBitID EncodeTrigMask32(trigID triggerID)
const char * getTriggerShortNameFromMask(unsigned int trigmask)
const char * trigIDShortStrings[]
trigSourceSubID PartitionToSubID(int32_t)
trigID DecodeTrigMask(unsigned int trigmask)
trigID DecodeTrigMask32(unsigned int trigmask)
trigBitID EncodeTrigMask(trigID triggerID)
const char * getTriggerName(trigID triggerID)
trigSource
Trigger Source Enumeration.
const char * getTriggerNameFromMask(unsigned int trigmask)
Class to hold the data from the FEBs in correct formats.
int32_t SubIDtoPartition(trigSourceSubID)
const char * getTriggerShortName(trigID triggerID)