c ///////////////////////////////////////////////////////////////// c c maximum number of planes we might have to deal with: parameter (max_planes=8) c c in general, dem1, dem2 are FEC-type chips, demm is a marebo, and demd c is a module. c common /event_display/ window_is_open, . ix11window1_id, ix11window1_x0, ix11window1_y0, . ix11window1_width, ix11window1_height, . ix11window1_width_default, ix11window1_height_default, . pixels_per_x, . pixels_per_y, pixels_per_zx, pixels_per_zy, . pixels_per_x_default, . pixels_per_y_default, pixels_per_zx_default, . pixels_per_zy_default, . factor_dem_z_exaggerate, . number_strips, number_rows_dem1, . number_rows_dem2, number_rows_demm, number_rows_demd, . number_cols_dem1, . number_cols_per_modchip, number_rows_per_modchip, . number_shared_rows, number_chips_per_mod, . number_cols_dem2, number_cols_demm, number_cols_demd, . number_fatcols_dem1, number_fatcols_dem2, . number_fatcols_demm, number_fatcols_demd, . pixel_at_x_0, pixel_at_y_0, pixel_at_zx_0, pixel_at_zy_0, . pixel_at_x_0_default, pixel_at_y_0_default, . pixel_at_zx_0_default, pixel_at_zy_0_default, . pixel_at_x_9, pixel_at_y_9, pixel_at_zx_9, pixel_at_zy_9, . pixel_at_x_9_default, pixel_at_y_9_default, . pixel_at_zx_9_default, pixel_at_zy_9_default, . xplane_x0(max_planes), xplane_z0(max_planes), . yplane_y0(max_planes), yplane_z0(max_planes), . xplane_x0_default(max_planes), xplane_z0_default(max_planes), . yplane_y0_default(max_planes), yplane_z0_default(max_planes), . strip_pitch, dem1_pitch_fine, dem1_pitch_coarse, . dem2_pitch_fine, dem2_pitch_coarse, . demm_pitch_fine, demm_pitch_coarse, . demd_pitch_fine, demd_pitch_coarse, demd_pitch_coarse2, . ipldem1, ipldem2, ipldemm, ipldemd, . icol_polarity_dem1, irow_polarity_dem1, iswap_rows_cols_dem1, . icol_polarity_dem2, irow_polarity_dem2, iswap_rows_cols_dem2, . icol_polarity_demm, irow_polarity_demm, iswap_rows_cols_demm, . icol_polarity_demd, irow_polarity_demd, iswap_rows_cols_demd, . phidem1, psidem1, thetadem1, phidem2, psidem2, thetadem2, . phidemm, psidemm, thetademm, . phidemd, psidemd, thetademd, . pixels_clearance, shift_right, top_edge_x, bot_edge_x, . top_edge_y, bot_edge_y, left_edge_z, right_edge_z, . message_left, message_right, message_top, message_bot, . message_height, . max_strip_pulseheight, max_dem1_pulseheight, . max_dem2_pulseheight, max_demm_pulseheight, . max_demd_pulseheight, . pixels_per_strip_pulseheightx, . pixels_per_dem1_pulseheightx, pixels_per_dem2_pulseheightx, . pixels_per_demm_pulseheightx, pixels_per_demd_pulseheightx, . pixels_per_strip_pulseheighty, . pixels_per_dem1_pulseheighty, pixels_per_dem2_pulseheighty, . pixels_per_demm_pulseheighty, pixels_per_demd_pulseheighty, . itext_pixels, button_row_height, number_of_buttons, . button_left(20), button_right(20), button_top(20), . button_bot(20), map_button(20), map_button_inverse(20), . next_event_button, . new_dem1_phi_button,new_dem1_psi_button,new_dem1_theta_button, . new_dem2_phi_button,new_dem2_psi_button,new_dem2_theta_button, . new_demm_phi_button,new_demm_psi_button,new_demm_theta_button, . new_demd_phi_button,new_demd_psi_button,new_demd_theta_button, . istop_button, i_want_to_stop, izoom_button, . delta_angle_per_click,iprevious_mouse_button,iprevious_button, . icurrent_mouse_button,icurrent_button, . icurrent_click_pixel_x, icurrent_click_pixel_y, . iprevious_click_pixel_x, iprevious_click_pixel_y, . icurrent_sample_pixel_x, icurrent_sample_pixel_y, . iprevious_sample_pixel_x, iprevious_sample_pixel_y, . lun_data, lun_parameters, lun_default_parameters, lun_control, . number_for_control_file, i_want_new_event, . index_color_white, index_color_black, index_color_red, . index_color_green, index_color_blue, index_color1, index_color2, . index_color3, index_color_button, index_color_message, . index_color_xview, index_color_yview, . iamzooming_x, iamzooming_y, x_has_been_zoomed, . y_has_been_zoomed, iamzooming, icurrent_click_in_x_window, . icurrent_click_in_y_window, iprevious_click_in_x_window, . iprevious_click_in_y_window, . irubber_cursor, idefault_cursor, . telescope_max_zx, . telescope_max_zy, telescope_max_x, telescope_max_y, . telescope_max_zx_default, telescope_max_zy_default, . telescope_max_x_default, telescope_max_y_default, . telescope_min_zx, . telescope_min_zy, telescope_min_x, telescope_min_y, . telescope_min_zx_default, telescope_min_zy_default, . telescope_min_x_default, telescope_min_y_default, . something_changed c real left_edge_z c logical window_is_open, i_want_to_stop, i_want_new_event logical iamzooming_x, iamzooming_y, iamzooming logical x_has_been_zoomed, y_has_been_zoomed logical icurrent_click_in_x_window, icurrent_click_in_y_window logical iprevious_click_in_x_window logical iprevious_click_in_y_window logical something_changed c c window_is_open is true if a graphics window has already been opened. c c ix11window1_id is a window ID for the main graphics window. c c ix11window1_x0, ix11window1_y are the initial x,y positions for X11 window 1 c in pixels: note that X coordinates have increasing x moving to the right on c the screen, increasing y moving down. origin is upper left corner of screen. c c ix11window1_width, ix11window1_height are width and height, in pixels, for c X11 window 1 c c ix11window1_title is the title for window 1. c c pixels_per_xy, pixels_per_z are pixels per millimeter in x (or y) and z c for the telescope's h8 lab frame. pixels_per_x, pixels_per_y are for5 c use in situations when i want separate scales in the two views. c ditto pixels_per_zx, pixels_per_zy. c c pixel_at_x_0, ...y_0, ...z_0 are the screen coordinates describing c where telescope coordinates x=0, z=0 and y=0, z=0 are to be plotted in c the display window. c c xplane_x0(7), xplane_z0(7) are telescope frame coordinates for the c four strip planes (1-4), dem1 plane (5), dem2 plane (6), and marebo (7). c Use these c to say where the "raw" detector coordinate (eg, the first strip at x=0) c lives in the lab frame relative to a perfectly aligned detector (units are c millimeters). I can use this at some point to work up alignments. c c yplane_y0(7), yplane_z0(7) work similarly. c c strip_pitch is the width of one strip, in millimeters. c c dem1_pitch_fine, dem1_pitch_coarse are fine and coarse pixel widths for c demonstrator 1. dem2_pitch_fine, dem2_pitch_coarse are for the other chip. c c ipldem1, ipldem2 are 5,6 to indicate which planes the pixel detectors are. c ipldemm is 7 for marebo. c c phidem1, psidem1, thetadem1 describe rotation angles (degrees) to describe c dem1's location in space. similar definitions for dem2... c c pixels_clearance is the number of pixels of white space I want to use in c various places... c c shift_right is an extra distance to shift stuff to the right so that I c gave space for some labels to the left of the first plane if desired. c c top_edge_x, bot_edge_x, top_edge_y, bot_edge_y are pixel vertical c coordinates for the upper and lower edges of the two telescope view plots. c c left_edge_z, right_edge_z are the pixel horizontal coordinates for the c two telescope views. c c message_left, message_right, message_top, message_bot are pixels for the c edges of the area meant to hold status messages. c c max_strip_pulseheight, max_dem1_pulseheight, max_dem2_pulseheight are c only used to give me an idea how large the signals migh be so I can c calculate the scaling required to keep the tickmarks from bumping into c the next plane. c c pixels_per_strip_pulseheight, pixels_per_dem1_pulseheight, and c pixels_per_dem2_pulseheight give the number of pixels per unit ADC count. c c itext_pixels is the approximate height, in pixels, of text I'll write. c c button_row_height is the number of pixels high I'll use to make a set c of buttons c c message_height is the height of the nmessage window. c c number_of_buttons is the number of buttons to put in this row. c c button_left(20), button_right(20), button_top(20), button_bot(20) are c pixel coordinates for the edges of up to 20 buttons. c c map_button(j) tells which button on the screen the particular button in c question actually maps to. c c next_event_button says which screen button refers to request for next event c c new_dem1_phi_button, new_dem1_psi_button , new_dem1_theta_button say which c buttons are for requests to enter new phi, psi, theta values for dem1. c similarly for dem2... c c delta_angle_per_click is the number of degrees per mouse button click to c change the phi, psi, theta angles. c c istop_button indicates which button to click to stop the program. c c icurrent_mouse_button, icurrent_button are numbers of most recently c detected mouse button that was clicked (1=left, 2=middle, 3=right) and c window button that was clicked. c c icurrent_click_pixel_x, icurrent_click_pixel_y are the x,y values for the c display window pixel of the most recent mouse click. c c iprevious_mouse_button,iprevious_button are similar, but for next-most- c recently detected button clicks. c c iprevious_click_pixel_x, iprevious_click_pixel_y are the x,y values for the c display window pixel of the previous mouse click. c c icol_polarity_dem1, irow_polarity_dem1, iswap_rows_cols_dem1 deal with c how I label the rows and columns. ditto for dem2... c c factor_dem_z_exaggerate is a scale factor to exaggerate how much I show c the change in z position of the corners of the pixel planes in order to c make it easier to see the rotations. c c lun_data is unit for event data. c c lun_control is unit for event data. c c lun_parameters is unit for a file holding various pieces of configuration c information, stuff like z positions. c c lun_default_parameters is the unit for a file I'll have the program write c which can serve as a template for the parameter file. c c file_data is the file name for event data c c file_default_parameters is the file name for the default parameters I'll c write c c i_want_to_stop is set .true. by the mouse event routine when it's time to c stop, since the user clicked the stop button. c c number_for_control_file is the number written to the control file: it is c the periodicity with which to write events to the buffeering file. make c it 1 to get the next available event, larger to skip a bunch of events. c c i_want_new_event is .true. if the user has asked for a new event. c c index_color_white, index_color_black, index_color_red, index_color_green, c and index_color_blue are color indices to use with the X11 routines. c index_color1, etc. refer to home-brewed colors I might want to use. c c iamzooming_x, iamzooming_y, iamzooming x_has_been_zoomed, y_has_been_zoomed c give status information about computing/executing zooms. c c icurrent_click_in_x_window, icurrent_click_in_y_window are set when the last c mouse click was in the x-view window or y-view window. c c irubber_cursor, idefault_cursor are cursor numbers for two kinds c of cursors. c c telescope_max_zx, telescope_max_zy, telescope_max_x, telescope_max_y are c telescope coordinates which map into the last pixels in the plot area. c c something_changed is true when the detector geometry, or X window size c has changed sine the last time event_display_initialize_geometry was called. c c c fortran tends to complain if character variables live in the same common c block as non-character variables, so segregate them: common /event_display_char/ hostname, ix11window1_title, . button_labels(20), . file_data, file_default_parameters, file_control, . file_data_cern, file_default_parameters_cern, . file_control_cern, . file_data_cppm, file_default_parameters_cppm, . file_control_cppm, . font_name(10), . web_document_url, web_document_url_IP, . web_document_url_path c character*120 hostname, ix11window1_title, button_labels character*120 file_data, file_default_parameters, file_control character*120 . file_data_cern, file_default_parameters_cern, . file_control_cern, . file_data_cppm, file_default_parameters_cppm, . file_control_cppm character*200 web_document_url character*100 web_document_url_IP, web_document_url_path character*80 font_name c c c hostname is name of device on which the graphics will be drawn. c c ix11window1_title is the X11 window1's title. c c button_labels are labels to put in the button boxes. c c file_data is the file name for event data c c file_default_parameters is the file name for the default parameters I'll c write to disk; can be used as a template for other parameter files. c c file_control is the name of a file I'll use to communicate with the c routine that launches display program this in standalone mode. c c ... _cern are the file names to be used when running at cern c ... _cppm are the file names to be used when I am running this at cppm c c font_name is an array holding a list of X11 font names I'd like c to try using. c c web_document_url is the URL of a web page describing the event display. c I build it up from web_document_url_IP, web_document_url_path since c URL names can be so long! c c \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\