Week+of+5-13+to+5-19

This post should wrap up the summary of the code of the CMS GUI. I will pick up where I left off, which begins with the ‘Fpop’ callback. ‘Fpop’ is the popup menu for picking which field to specify for the cut tool. Other than the obvious, choosing an option from this menu and thus initiating this callback will also set up the static text for the filter’s logical process depending on which frame is in use. Then the ‘Fpop’ create function follows, the same as all the others. Next comes the ‘SGpush’ callback. The ‘SGpush’ button is the button for saving the GUI. The programmer used the ‘saveas’ command here to pull up a dialog box for the user to save the file. This dialog box plants the user in the folder for the GUI rather than starting from, say, “My Computer” and adding extra work for the user. The next object in the script is the ‘Flist’ list that is in the top right corner that keeps track of which cuts have been made on the data. This object is yet another case of a blank callback and the standard create function. The ‘Valet’ object follows. This object is the edit text box for the user to choose at which number to make the cut, located directly to the right of the “is less than”/“is greater than” box. This object also has a blank callback and a standard create function. Next is the ‘Lpop’ object, which is the “is less than”/“is greater than” box referenced above. It is merely a popup menu so the user can designate which kind of cut he is using. This object is yet another with unexciting callback and create functions. Following the ‘Lpop’ object is the code for an object called ‘Maxet’. By the programmer’s system, this should be some kind of edit text box for either entering some kind of maximum or something starting with M to do with a set of axes, but I cannot find this object in GUIDE and I can’t tell intuitively what it should be. Regardless, there’s not any interesting code to discuss because it is another simpleton object with no interesting code to do with its callback or create function. Next are the objects ‘LBpop’ and ‘LMpop’, both of which are also objects I cannot find in GUIDE and have no idea what they are for. They are obviously popup menus, and since they begin with L they could possibly be associated in some way with ‘Lpop’, but I have no idea. ‘LBpop’ is another uninteresting object, and ‘LMpop’ curiously has a script called in its callback but there is no such script in the folder. I have the feeling that these last three objects were abandoned ideas of the programmer he never fully cleaned up.</range id="435831092_4"> <span style="background-color: white; font-family: Arial,sans-serif; font-size: 10pt;">The callback for ‘ACpush’ follows. ‘ACpush’ is the “Apply Choices” button in the section for selecting the data set to use. This is a deceptively complex function, and was probably one of the most annoying parts for him to program. This function contains seven other functions he wrote for performing various tasks that need to be done when this button is pressed. First, the function ‘DSf’ imports the proper data set, then the ‘Tfilterf’ function uses the ‘find’ function to separate the ‘GG’ data and the ‘GT’ data (unless it is the dielectron set, in which case this function does nothing to the data). Next, ‘Cfilterf’ separates the data by charge as is selected in the ‘Cpop’ menu. Then ‘struct2tablef’, probably the most tough-looking function in the entire GUI, puts the data into the table depending on which rest frame is chosen, for each transforming a struct into a matrix and set the column titles. Then ‘Hfieldsf’, ‘Sfieldsf’, and ‘Ffieldsf’ each give the list of fields involved in the chosen data set to the corresponding popup menu for future use in the form of static text. Finally, this callback function clears all the previous cuts and passes the data set variable on to the table. <span style="background-color: white; font-family: Arial,sans-serif; font-size: 10pt;">Then follows the callback for ‘ASbox’, the checkbox for whether the histogram’s bins should be auto-scaled. This callback function’s only action is to reset the edit textbox for the bin width, ‘BWet’, if the auto-scale was just turned on, in order to cancel any previous edits since choosing autoscale means the bin width is not user-chosen. <span style="background-color: white; font-family: Arial,sans-serif; font-size: 10pt;">Next are the ‘Sopen’ and ‘Hopen’ callbacks, which are both empty because the act of checking the box doesn’t do anything for those, it just changes whether or not when the “Draw” button is pressed the figure pops up only on the axes or if it also comes up in its own figure. <span style="background-color: white; font-family: Arial,sans-serif; font-size: 10pt;">Then comes the ‘NDcheck’ callback, the callback for the checkbox titled “Normal Distribution.” Although the true use of this box is to display a normal curve on the graph once “Draw” is hit, when the “Normal Distribution” checkbox is clicked, the programmer also chose to have the statistics listings appear and disappear. This way, if the user is not concerned with the normal distribution, the unimportant values of mean and standard deviation are not shown. <span style="background-color: white; font-family: Arial,sans-serif; font-size: 10pt;">Next comes the ‘SHbox’ callback for the checkbox titled “Hold Plot” in the scatterplot, which has no immediate function when it is pressed, thus the callback does nothing. This box only affects whether the plot is held when the “Draw” button is hit. <span style="background-color: white; font-family: Arial,sans-serif; font-size: 10pt;">Then follows the ‘UFpush’ callback, which is the callback for the button that says “Unselect All,” which is essentially the reset button for the cuts. Thus, it runs ‘ACf’, ‘Hdrawf’, and ‘Sdrawf’ in order to reset the data to the full set and then redraw the graphs accordingly. This is another place I will need to visit if I attempt to get rid of graph-drawing that was not intended by the user. <span style="background-color: white; font-family: Arial,sans-serif; font-size: 10pt;">Finally, the GUIDE-default ‘figure1_ResizeFcn’ is listed. Since sometimes the graphs are opened in a figure, this is something MATLAB needs in order to rescale the graph in the figure when the user might change the size of the window.