- Member AntTrigger::getRate ()
- Refactor the class so that this function is either deprecated or "thisrate" is implemented differently.
- Member AntTrigger::GetThresholds (Settings *settings1, Anita *anita1, int ilayer, double *thresholds)
- 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.
- Member 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 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.
- Member AntTrigger::rateToThreshold (double rate, int band)
- 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.
- Member GlobalTrigger::delay_align_antenna_waveforms (const vector< vector< vector< double > > > &waveforms, const vector< vector< unsigned int > > &delays, vector< vector< double > > &output)
- Instead of accepting nested vectors, boost::multi_array/_views or PayloadArray objects should be passed in and out.
- Member GlobalTrigger::FillInNadir (Anita *anita1, int *ant)
- Deprecate this function in favor of PayloadArray or boost::multi_array objects which provide the ability to have multiple indexing schemes for a given collection of objects. For this case specifically PayloadArray was designed to have iterators and accessors which "OR" the values of the neighboring antennas, and are optionally read-only.
- Member GlobalTrigger::FillInNadir (Settings *settings1, Anita *anita1, int ant)
- Deprecate this function in favor of PayloadArray or boost::multi_array objects which provide the ability to have multiple indexing schemes for a given collection of objects. For this case specifically PayloadArray was designed to have iterators and accessors which "OR" the values of the neighboring antennas, and are optionally read-only.
- Member GlobalTrigger::GetAnitaLayerPhiSector (Settings *settings1, int i, int j, int &whichlayer, int &whichphisector)
- Deprecate this function in favor of PayloadArray or boost::multi_array objects which provide the ability to have multiple indexing schemes for a given collection of objects.
- Member GlobalTrigger::GetPhiSector (Settings *settings1, int i, int j)
- Deprecate this function in favor of PayloadArray or boost::multi_array objects which provide the ability to have multiple indexing schemes for a given collection of objects.
- Member GlobalTrigger::L3Trigger (Settings *settings1, Anita *anita1, int loctrig[Anita::NLAYERS_MAX][Anita::NPHI_MAX], int *loctrig_nadironly, int discones_passing, int &l3trigy)
- The organization of this function needs to be changed so that a single variables turns on (or off) a single component of the trigger/simulation. The organization as it stands makes it difficult to know what features a particular trigger should be exhibiting.
- Member GlobalTrigger::PassesTrigger (Settings *settings1, Anita *anita1, int discones_passing, int mode, int &l3trig, int *l2trig, int *l1trig, int antennaclump, int loctrig[Anita::NLAYERS_MAX][Anita::NPHI_MAX], int *loctrig_nadironly, int inu)
- This function needs to be heavily refactored into either functions which perform some smaller part of every trigger, or some functions which perform one triggering system in its entirely, or a combination of the two.
- Member GlobalTrigger::square_waveform_elements (const vector< double > &waveform, vector< double > &output)
- This function should be deprecated because the same functionality is provided by the standard library:
- Member GlobalTrigger::sum_aligned_waveforms (const vector< vector< double > > &waveforms, vector< double > &output)
- This should not take nested vectors as a parameter but rather a boost::multi_array or boost::multi_array_view, or an instance of the PayloadArray class, which is a multi_array container modified to have circular indices. Also, the bounds of the for-loop should not be separately declared as it just adds another point of failure.
- Member GlobalTrigger::summed_power_window (const vector< double > &waveform, unsigned int start_index, unsigned int length)
- This function should be replaced as it is unnecessary – the same thing can be done more legibly with std::accumulate(...) :