1 #ifndef CHANTRIGGER_HH_ 2 #define CHANTRIGGER_HH_ 34 double ADCCountstoPowerThreshold(
Anita *anita1,
int ipol,
int iant);
36 const static int NSURF=9;
37 const static int NSURFPLUSONE=10;
38 const static int NSURFMINUSONE=8;
39 const static int NCHANNELS=32;
40 const static int NPOINTS=4073;
41 static const unsigned NFOUR = 1024;
42 static const unsigned HALFNFOUR = 512;
45 double thispowerthresh;
49 double e_component_kvector;
50 double h_component_kvector;
51 double n_component_kvector;
161 void L1Trigger(
Anita *anita1,
double timedomain_output_1[5][Anita::NFOUR],
double timedomain_output_2[5][Anita::NFOUR],
double powerthreshold[2][5],
int *channels_passing_e_forglob,
int *channels_passing_h_forglob,
int &npass);
198 static double GetNoise(
Settings *settings1,
double altitude_bn,
double geoid,
double theta,
double bw,
double temp);
250 static double FindPeak(
double *waveform,
int n);
278 void DiodeConvolution(
Settings *settings1,
Anita *anita1,
GlobalTrigger *globaltrig1,
int ilayer,
int ifold,
double mindiodeconvl[5],
double onediodeconvl[5],
double psignal[5][Anita::NFOUR],
double timedomain_output[5][Anita::NFOUR],
double timedomain_output_justNoise[5][Anita::NFOUR],
int ibinshift,
int ipol,
double thresholds[2][5]);
302 static int IsItUnmasked(
unsigned short surfTrigBandMask[9][2],
int ibw,
int ilayer,
int ifold,
int ipol);
390 void injectImpulseAtSurf(
Anita *anita1,
double volts_triggerPath_e[Anita::HALFNFOUR],
double volts_triggerPath_h[Anita::HALFNFOUR],
int ant);
401 void calculateCW(
Anita *anita1,
double frequency,
double phase,
double amplitude);
void injectImpulseAtSurf(Anita *anita1, double volts_triggerPath_e[Anita::HALFNFOUR], double volts_triggerPath_h[Anita::HALFNFOUR], int ant)
Inject pulse at the surf (used for trigger efficiency scans)
double cw_digPath[2][Anita::HALFNFOUR]
For digitizer path, time domain cw.
void WhichBandsPassTrigger2(Settings *settings1, Anita *anita1, GlobalTrigger *globaltrig1, Balloon *bn1, int ilayer, int ifold, double dangle, double emfrac, double hadfrac, double thresholds[2][5])
Which bands passes the trigger (for trigger scheme larger than 2)
double justNoise_digPath[2][Anita::HALFNFOUR]
For digitizer path, time domain noise from flight.
double bwslice_energy_polh[5]
Square the sum of voltage for each slice in bandwidth for h polarization. The 5th element is the full...
ChanTrigger()
Channel trigger constructur.
double justNoise_trigPath[2][Anita::HALFNFOUR]
For trigger path, time domain noise from flight.
static const int NBANDS_MAX
max number of bands
double getRate()
Returns the thisrate variable value (in MHz)
void InitializeEachBand(Anita *anita1)
Initialize trigger bands.
double bwslice_volts_pol0[5]
Sum voltage for each slice in bandwidth for the lcp polarization.
double bwslice_energy_pol0[5]
Square the sum of voltage for each slice in bandwidth for the 0th polarization.
void TriggerPath(Settings *settings1, Anita *anita1, int ant, Balloon *bn1)
Apply trigger path.
void WhichBandsPassTrigger1(Settings *settings1, Anita *anita1, GlobalTrigger *globaltrig1, Balloon *bn1, int ilayer, int ifold, double thresholds[2][5])
Which bands passes the trigger (for trigger scheme 0 and 1)
double rateToThreshold(double rate, int band)
Calculates the trigger threshold for an antenna via a fit from the "singles" rate and band identifier...
double bwslice_energy_pole[5]
Square the sum of voltage for each slice in bandwidth for e polarization. The 5th element is the full...
vector< double > vthreshold_eachband[2]
Threshold in each band.
void L1Trigger(Anita *anita1, double timedomain_output_1[5][Anita::NFOUR], double timedomain_output_2[5][Anita::NFOUR], double powerthreshold[2][5], int *channels_passing_e_forglob, int *channels_passing_h_forglob, int &npass)
The L1 trigger of the Anita trigger scheme.
vector< int > flag_e[5]
Which bands pass trigger e.
double bwslice_volts_pol0_em[5]
Component of the voltage that comes from the em shower for 0th polarization.
void applyImpulseResponseDigitizer(Settings *settings1, Anita *anita1, int nPoints, int ant, double *x, double y[512], bool pol)
Apply impulse response to digitizer path.
void ApplyAntennaGain(Settings *settings1, Anita *anita1, Balloon *bn1, Screen *panel1, int ant, Vector &n_eplane, Vector &n_hplane, Vector &n_normal)
Apply the antenna gain.
double vhz_rx[2][5][Anita::NFREQ]
Array of amplitudes in the Fourier domain (V/Hz) after the antenna gain. Indeces stand for [ipol][iba...
void applyImpulseResponseTrigger(Settings *settings1, Anita *anita1, int ant, double y[512], double *vhz, bool pol)
Apply impulse response to trigger path.
void TimeShiftAndSignalFluct(Settings *settings1, Anita *anita1, int ilayer, int ifold, double volts_rx_rfcm_lab_e_all[48][512], double volts_rx_rfcm_lab_h_all[48][512])
Time shift and fluctuate signal.
double bwslice_volts_pol1[5]
Sum voltage for each slice in bandwidth for the rcp polarization.
static void ConvertEHtoLREnergy(double, double, double &, double &)
Convert E and H to left and right energy.
double volts_rx_forfft[2][5][Anita::HALFNFOUR]
Array of time domain after the antenna gain. Indeces stand for [ipol][iband][itime].
vector< double > vnoise_eachband[2]
Noise in each band.
void saveTriggerWaveforms(Anita *anita1, double sig0[48], double sig1[48], double noise0[48], double noise1[48])
Save signal and noise waveforms at trigger.
double noise_eachband[2][Anita::NBANDS_MAX]
Noise in each band.
double volts_rx_rfcm_lab[2][Anita::HALFNFOUR]
For digitizer path, time domain voltage vs. time after rx, rfcm's and lab.
Class that handles the channel trigger.
double applyButterworthFilter(double ff, double ampl, int notchStatus[3])
Apply Butterworth Filter.
Reads in and stores input settings for the run.
static double GetNoise(Settings *settings1, double altitude_bn, double geoid, double theta, double bw, double temp)
Get Noise.
void saveDigitizerWaveforms(Anita *anita1, double sig0[48], double sig1[48], double noise0[48], double noise1[48])
Save signal and noise waveforms at digitizer.
void getNoiseFromFlight(Settings *settings1, Anita *anita1, int ant, bool also_digi=true)
Add noise from ANITA-3 flight to the time domain waveforms.
double v_banding_rfcm[2][5][Anita::NFREQ]
This is Volts/m as a function of frequency after rfcm's and banding.
double integral_vmmhz
Electric field integral.
static void ConvertEHtoLREfield(double, double, double &, double &)
Convert E and H to left and right e field.
vector< int > vpasses_eachband[2]
Whether the signal passes or not each band.
void DigitizerPath(Settings *settings1, Anita *anita1, int ant, Balloon *bn1)
Apply digitizer path.
Contains everything about positions within payload and signals it sees for each event, in both the trigger and signal paths.
void addToChannelSums(Settings *settings1, Anita *anita1, int ibw, int k)
Increment the volts in each band.
double justSig_trigPath[2][Anita::HALFNFOUR]
Just signal in trigger path.
double threshold_eachband[2][Anita::NBANDS_MAX]
Threshold in each band.
double bwslice_volts_pol1_em[5]
Component of the voltage that comes from the em shower for 1st polarization.
static double FindPeak(double *waveform, int n)
Find peak voltage of a waveform.
double v_banding_rfcm_forfft[2][5][HALFNFOUR]
Starts out as V/s vs. freq after banding, rfcm, after fft it is V vs. t.
double justSig_digPath[2][Anita::HALFNFOUR]
Just signal in trigger path.
int passes_eachband[2][Anita::NBANDS_MAX]
Whether the signal passes or not each band.
double vm_banding_rfcm_forfft[2][5][HALFNFOUR]
Tunnel diode input (signal + noise)
int unwarned
Whether we have warned the user about resetting thresholds when they are beyond the measured bounds...
double bwslice_volts_polh[5]
Sum voltage for each slice in bandwidth for the h polarization.
TGraph * getPulserAtAMPA(Anita *anita1, int ant)
Get time domain graph of pulse at AMPA (used for trigger efficiency scans)
void WhichBandsPass(Settings *settings1, Anita *anita1, GlobalTrigger *globaltrig1, Balloon *bn1, int ilayer, int ifold, double dangle, double emfrac, double hadfrac, double thresholds[2][5])
Which bands passes the trigger.
void DiodeConvolution(Settings *settings1, Anita *anita1, GlobalTrigger *globaltrig1, int ilayer, int ifold, double mindiodeconvl[5], double onediodeconvl[5], double psignal[5][Anita::NFOUR], double timedomain_output[5][Anita::NFOUR], double timedomain_output_justNoise[5][Anita::NFOUR], int ibinshift, int ipol, double thresholds[2][5])
Apply the diode convolution.
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".
vector< double > vsignal_eachband[2]
Signal in each band.
Handles everything related to balloon positions, payload orientation over the course of a flight...
This class represents a three-vector. Operators are overloaded to provide for the familiar operations...
void GetThresholds(Settings *settings1, Anita *anita1, int ilayer, double thresholds[2][5])
Sets the threshold values based on which payload and where the antenna is located physically...
double bwslice_volts_pole[5]
Sum voltage for each slice in bandwidth for the e polarization.
double volts_rx_rfcm_lab_all[2][48][Anita::HALFNFOUR]
For digitizer path, time domain voltage vs. time after rx, rfcm's and lab.
void injectImpulseAfterAntenna(Anita *anita1, int ant)
Inject pulse after the antenna (used for trigger efficiency scans)
vector< int > flag_h[5]
Which bands pass trigger h.
double bwslice_energy_pol1[5]
Square the sum of voltage for each slice in bandwidth for the 1st polarization.
double v_banding_rfcm_forfft_temp[2][5][HALFNFOUR]
Use for the averaging over 10 neighboring bins.
double signal_eachband[2][Anita::NBANDS_MAX]
Signal in each band.
double vm_banding_rfcm_forfft_justNoise[2][5][HALFNFOUR]
Tunnel diode input (just noise)
double volts_rx_rfcm[2][Anita::HALFNFOUR]
For digitizer path, time domain voltage vs. time after rx, rfcm's.
void calculateCW(Anita *anita1, double frequency, double phase, double amplitude)
Add CW.
Ice thicknesses and water depth.