icemc
 All Classes Namespaces Files Functions Variables Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
AntTrigger Class Reference

Handles L0 and L1 Triggers for an antenna. More...

#include <trigger.hh>

Public Member Functions

 AntTrigger ()
 
 AntTrigger (Settings *settings1, int ilayer, int ifold, double *vmmhz, Anita *anita1, double hitangle_e, double hitangle_h, double e_component, double h_component, double *arrival_times, int rx_minarrivaltime_temp, double volts_rx_rfcm_lab_e_all[48][512], double volts_rx_rfcm_lab_h_all[48][512], int inu)
 
void ConvertHVtoLRTimedomain (const int nfour, double *vvolts, double *hvolts, double *left, double *right)
 
void L1Trigger (Anita *anita1, Settings *settings1, int ilayer, int ifold, double timedomain_output_1[5][Anita::NFOUR], double timedomain_output_2[5][Anita::NFOUR], double *powerthreshold, int *channels_passing_e_forglob, int *channels_passing_h_forglob, int &npass)
 The L1 trigger of the Anita trigger scheme. More...
 
double getRate ()
 Returns the thisrate variable value. More...
 
double rateToThreshold (double rate, int band)
 Calculates the trigger threshold for an antenna via a fit from the "singles" rate and band identifier. More...
 
void WhichBandsPass (Settings *settings1, Anita *anita1, GlobalTrigger *globaltrig1, Balloon *bn1, int ilayer, int ifold, int inu, double dangle, double emfrac, double hadfrac)
 
void GetThresholds (Settings *settings1, Anita *anita1, int ilayer, double *thresholds)
 Sets the threshold values based on which payload and where the antenna is located physically. More...
 
void addToChannelSums (Settings *settings1, Anita *anita1, int ibw, int k)
 

Static Public Member Functions

static void ConvertEHtoLREfield (double, double, double &, double &)
 
static void ConvertEHtoLREnergy (double, double, double &, double &)
 
static double GetNoise (Settings *settings1, double altitude_bn, double geoid, double theta, double bw, double temp)
 
static double FindPeak (double *waveform, int n)
 
static int IsItUnmasked (unsigned short surfTrigBandMask[9][2], int ibw, int ilayer, int ifold, int ipol)
 Returns whether the indicated antenna and band are "masked". More...
 

Public Attributes

vector< int > flag_e [5]
 
vector< int > flag_h [5]
 
double bwslice_volts_pol0 [5]
 
double bwslice_volts_pol1 [5]
 
double bwslice_energy_pol0 [5]
 
double bwslice_energy_pol1 [5]
 
double bwslice_volts_pol0_em [5]
 
double bwslice_volts_pol1_em [5]
 
double bwslice_volts_pole [5]
 
double bwslice_energy_pole [5]
 
double bwslice_volts_polh [5]
 
double bwslice_energy_polh [5]
 
double vm_banding_rfcm_e [5][Anita::NFREQ]
 
double vm_banding_rfcm_h [5][Anita::NFREQ]
 
double v_banding_rfcm_e [5][Anita::NFREQ]
 
double v_banding_rfcm_h [5][Anita::NFREQ]
 
double signal_eachband [2][Anita::NBANDS_MAX]
 
double threshold_eachband [2][Anita::NBANDS_MAX]
 
double noise_eachband [2][Anita::NBANDS_MAX]
 
int passes_eachband [2][Anita::NBANDS_MAX]
 
vector< double > vsignal_eachband [2]
 
vector< double > vthreshold_eachband [2]
 
vector< double > vnoise_eachband [2]
 
vector< int > vpasses_eachband [2]
 
double v_banding_rfcm_e_forfft [5][HALFNFOUR]
 
double v_banding_rfcm_h_forfft [5][HALFNFOUR]
 
double vm_banding_rfcm_1_forfft [5][HALFNFOUR]
 
double vm_banding_rfcm_2_forfft [5][HALFNFOUR]
 
double v_banding_rfcm_e_forfft_temp [5][HALFNFOUR]
 
double v_banding_rfcm_h_forfft_temp [5][HALFNFOUR]
 
double integral_vmmhz
 
int unwarned
 

Detailed Description

Handles L0 and L1 Triggers for an antenna.

Constructor & Destructor Documentation

AntTrigger::AntTrigger ( )
AntTrigger::AntTrigger ( Settings settings1,
int  ilayer,
int  ifold,
double *  vmmhz,
Anita anita1,
double  hitangle_e,
double  hitangle_h,
double  e_component,
double  h_component,
double *  arrival_times,
int  rx_minarrivaltime_temp,
double  volts_rx_rfcm_lab_e_all[48][512],
double  volts_rx_rfcm_lab_h_all[48][512],
int  inu 
)

Member Function Documentation

void AntTrigger::addToChannelSums ( Settings settings1,
Anita anita1,
int  ibw,
int  k 
)

Bug fix: Changed "vm_banding_rfcm_*" to "v_banding_rfcm_*" in all four of term_e, term_h, energyterm_e, and energyterm_h. Stephen Hoover, 10 August 2009

void AntTrigger::ConvertEHtoLREfield ( double  e_component,
double  h_component,
double &  lcp_component,
double &  rcp_component 
)
static
void AntTrigger::ConvertEHtoLREnergy ( double  e_component,
double  h_component,
double &  lcp_component,
double &  rcp_component 
)
static
void AntTrigger::ConvertHVtoLRTimedomain ( const int  nfour,
double *  vvolts,
double *  hvolts,
double *  left,
double *  right 
)
double AntTrigger::FindPeak ( double *  waveform,
int  n 
)
static
double AntTrigger::GetNoise ( Settings settings1,
double  altitude_bn,
double  geoid,
double  theta,
double  bw,
double  temp 
)
static
double AntTrigger::getRate ( )

Returns the thisrate variable value.

Todo:
Refactor the class so that this function is either deprecated or "thisrate" is implemented differently.
void AntTrigger::GetThresholds ( Settings settings1,
Anita anita1,
int  ilayer,
double *  thresholds 
)

Sets the threshold values based on which payload and where the antenna is located physically.

The nadir antennas had a separate threshold from the other antennas due to the way that they were "OR"'d between their two neighbors.

Todo:
Deprecate in favor of the more robust boost::multi_array or the more specialized PayloadArray class. Both have multi-index access to the same items.
int AntTrigger::IsItUnmasked ( unsigned short  surfTrigBandMask[9][2],
int  ibw,
int  ilayer,
int  ifold,
int  ipol 
)
static

Returns whether the indicated antenna and band are "masked".

void AntTrigger::L1Trigger ( Anita anita1,
Settings settings1,
int  ilayer,
int  ifold,
double  timedomain_output_1[5][Anita::NFOUR],
double  timedomain_output_2[5][Anita::NFOUR],
double *  powerthreshold,
int *  channels_passing_e_forglob,
int *  channels_passing_h_forglob,
int &  npass 
)

The L1 trigger of the Anita trigger scheme.

Todo:
The number of parameters this function accepts is rather high and should be reduced. In many cases an argument is a member object of another argument which was already passed to this function, which leads to intent confusion. The member objects like "flag_e" and "flag_h" are manipulated here but also in other places, and it makes tracking the changes through code difficult. Also, when dealing with std::vector containers, using "clear" and "push_back" is typically much slower than accessing each element by index, since the number of allocations/deallocations is guaranteed to be zero.
double AntTrigger::rateToThreshold ( double  rate,
int  band 
)

Calculates the trigger threshold for an antenna via a fit from the "singles" rate and band identifier.

This code is stolen from Stephen's AnitaHardwareTrigger in his Aesop software "rate" is the desired singles rate, in MHz. "band" ranges from 0 to 3 The output is the trigger threshold, in units of Diode Output / <Diode output>=""> The output is good for all antennas, and the curves are good fits in the region ~1 MHz to 25 MHz. The curves look like they should continue beyond that range as well.

Todo:
The hard-coded values should be explained and the band dependence should be more explicit, because the actual bands can be modified elsewhere in the code and this function won't be changed unless the user specifically knows to.
void AntTrigger::WhichBandsPass ( Settings settings1,
Anita anita1,
GlobalTrigger globaltrig1,
Balloon bn1,
int  ilayer,
int  ifold,
int  inu,
double  dangle,
double  emfrac,
double  hadfrac 
)

Member Data Documentation

double AntTrigger::bwslice_energy_pol0[5]
double AntTrigger::bwslice_energy_pol1[5]
double AntTrigger::bwslice_energy_pole[5]
double AntTrigger::bwslice_energy_polh[5]
double AntTrigger::bwslice_volts_pol0[5]
double AntTrigger::bwslice_volts_pol0_em[5]
double AntTrigger::bwslice_volts_pol1[5]
double AntTrigger::bwslice_volts_pol1_em[5]
double AntTrigger::bwslice_volts_pole[5]
double AntTrigger::bwslice_volts_polh[5]
vector<int> AntTrigger::flag_e[5]
vector<int> AntTrigger::flag_h[5]
double AntTrigger::integral_vmmhz
double AntTrigger::noise_eachband[2][Anita::NBANDS_MAX]
int AntTrigger::passes_eachband[2][Anita::NBANDS_MAX]
double AntTrigger::signal_eachband[2][Anita::NBANDS_MAX]
double AntTrigger::threshold_eachband[2][Anita::NBANDS_MAX]
int AntTrigger::unwarned
double AntTrigger::v_banding_rfcm_e[5][Anita::NFREQ]
double AntTrigger::v_banding_rfcm_e_forfft[5][HALFNFOUR]
double AntTrigger::v_banding_rfcm_e_forfft_temp[5][HALFNFOUR]
double AntTrigger::v_banding_rfcm_h[5][Anita::NFREQ]
double AntTrigger::v_banding_rfcm_h_forfft[5][HALFNFOUR]
double AntTrigger::v_banding_rfcm_h_forfft_temp[5][HALFNFOUR]
double AntTrigger::vm_banding_rfcm_1_forfft[5][HALFNFOUR]
double AntTrigger::vm_banding_rfcm_2_forfft[5][HALFNFOUR]
double AntTrigger::vm_banding_rfcm_e[5][Anita::NFREQ]
double AntTrigger::vm_banding_rfcm_h[5][Anita::NFREQ]
vector<double> AntTrigger::vnoise_eachband[2]
vector<int> AntTrigger::vpasses_eachband[2]
vector<double> AntTrigger::vsignal_eachband[2]
vector<double> AntTrigger::vthreshold_eachband[2]

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