PAASS
Software suite to Acquire and Analyze Data from Pixie16
|
#include <poll2_core.h>
Public Member Functions | |
Poll () | |
Default constructor. More... | |
~Poll () | |
Destructor. More... | |
bool | Initialize () |
Initialize the poll object. More... | |
void | SetBootFast (bool input_=true) |
void | SetWallClock (bool input_=true) |
void | SetQuietMode (bool input_=true) |
void | SetSendAlarm (bool input_=true) |
void | SetShowRates (bool input_=true) |
void | SetZeroClocks (bool input_=true) |
void | SetDebugMode (bool input_=true) |
void | SetShmMode (bool input_=true) |
void | SetPacmanMode (bool input_=true) |
void | SetNcards (const size_t &n_cards_) |
void | SetThreshWords (const size_t &thresh_) |
void | SetTerminal (Terminal *term) |
Set the terminal pointer. More... | |
bool | GetBootFast () |
bool | GetWallClock () |
bool | GetQuietMode () |
bool | GetSendAlarm () |
bool | GetShowRates () |
bool | GetZeroClocks () |
bool | GetDebugMode () |
bool | GetShmMode () |
bool | GetPacmanMode () |
size_t | GetNcards () |
size_t | GetThreshWords () |
void | PrintModuleInfo () |
Prints the information about each module. More... | |
void | CommandControl () |
Main control loop for handling user input. More... | |
void | RunControl () |
Main acquisition control loop for handling data acq. More... | |
bool | Close () |
Close the sockets, any open files, and clean up. More... | |
Private Types | |
typedef std::pair< unsigned int, unsigned int > | chanid_t |
Private Member Functions | |
void | help () |
Data packet for class shared-memory broadcast. More... | |
void | pchan_help () |
Print help dialogue for reading/writing pixie channel parameters. More... | |
void | pmod_help () |
Print help dialogue for reading/writing pixie module parameters. More... | |
bool | start_run (const bool &record_=true, const double &time_=-1.0) |
Start a data recording run. More... | |
bool | stop_run () |
Stop an active data recording run. More... | |
void | show_status () |
Display run status information. More... | |
void | show_thresh () |
Display polling threshold. More... | |
void | get_traces (int mod_, int chan_, int thresh_=0) |
Acquire raw traces from a pixie module. More... | |
std::vector< std::string > | TabComplete (const std::string &value_, const std::vector< std::string > &valid_) |
Method responsible for handling tab complete. More... | |
bool | ReadFIFO () |
Routine to read Pixie FIFOs. More... | |
void | ReadScalers () |
Routine to read Pixie scalers. More... | |
void | UpdateStatus () |
Routine to update the status message. More... | |
bool | synch_mods () |
Set IN_SYNCH and SYNCH_WAIT parameters on all modules. More... | |
std::string | get_filename () |
Return the current output filename. More... | |
bool | CloseOutputFile (const bool continueRun=false) |
Close the current output file, if one is open. More... | |
bool | OpenOutputFile (bool continueRun=false) |
Opens a new file if no file is currently open. More... | |
int | write_data (word_t *data, unsigned int nWords) |
Write a data spill to disk. More... | |
void | broadcast_data (word_t *data, unsigned int nWords) |
Broadcast a data spill onto the network. More... | |
void | broadcast_pac_data () |
Broadcast a data spill onto the network in the classic pacman format. More... | |
bool | SplitParameterArgs (const std::string &arg, int &start, int &stop) |
Splits the arguments to pread and pwrite on a colon delimeter. More... | |
Private Attributes | |
Terminal * | poll_term_ |
std::vector< word_t > * | partialEvents |
A vector to store the partial events. More... | |
double | startTime |
double | lastSpillTime |
Time when the acquistion was started. More... | |
struct tm * | time_info |
Time when the last spill finished. More... | |
Client * | client |
Server * | server |
UDP client for network access. More... | |
PixieInterface * | pif |
UDP server to listen for pacman commands. More... | |
std::string | sys_message_head |
The main pixie interface pointer. More... | |
bool | kill_all |
Command line message header. More... | |
bool | do_start_acq |
Set to true when the program is exiting. More... | |
bool | do_stop_acq |
Set to true when the command is given to start a run. More... | |
bool | record_data |
Set to true when the command is given to stop a run. More... | |
bool | do_reboot |
Set to true if data is to be recorded to disk. More... | |
bool | force_spill |
Set to true when the user tells POLL to reboot PIXIE. More... | |
bool | acq_running |
Force poll2 to dump the current data spill. More... | |
bool | run_ctrl_exit |
Set to true when run_command is recieving data from PIXIE. More... | |
bool | had_error |
Set to true when run_command exits. More... | |
bool | file_open |
time_t | raw_time |
bool | do_MCA_run |
MCA_args | mca_args |
Set to true when the "mca" command is received. More... | |
bool | boot_fast |
Structure to hold arguments for MCA program. More... | |
bool | insert_wall_clock |
bool | is_quiet |
bool | send_alarm |
bool | show_module_rates |
bool | zero_clocks |
bool | debug_mode |
bool | shm_mode |
bool | pac_mode |
New style shared-memory mode. More... | |
bool | init |
Pacman shared-memory mode. More... | |
double | runTime |
std::string | output_directory |
Time to run the acquisition, in seconds. More... | |
std::string | filename_prefix |
Set with 'fdir' command. More... | |
std::string | output_title |
Set with 'ouf' command. More... | |
unsigned int | next_run_num |
Set with 'htit' command. More... | |
unsigned int | output_format |
Set with 'hnum' command. More... | |
int | current_file_num |
Set with 'oform' command. More... | |
PollOutputFile | output_file |
unsigned int | udp_sequence |
Pacman related variables. More... | |
unsigned int | total_spill_chunks |
Total number of poll data spill chunks sent over the network. More... | |
size_t | n_cards |
size_t | threshWords |
std::map< chanid_t, PixieInterface::Histogram > | histoMap |
StatsHandler * | statsHandler |
std::vector< std::string > | commands_ |
data_pack | AcqBuf |
Static Private Attributes | |
static const int | statsInterval_ = 3 |
The amount time between scaler reads in seconds. More... | |
static const std::vector< std::string > | runControlCommands_ |
static const std::vector< std::string > | paramControlCommands_ |
static const std::vector< std::string > | pollStatusCommands_ |
Definition at line 103 of file poll2_core.h.
|
private |
Definition at line 168 of file poll2_core.h.
Poll::Poll | ( | ) |
Default constructor.
Definition at line 168 of file poll2_core.cpp.
Poll::~Poll | ( | ) |
Destructor.
Definition at line 223 of file poll2_core.cpp.
|
private |
Broadcast a data spill onto the network.
Definition at line 482 of file poll2_core.cpp.
|
private |
Broadcast a data spill onto the network in the classic pacman format.
Definition at line 570 of file poll2_core.cpp.
bool Poll::Close | ( | ) |
Close the sockets, any open files, and clean up.
Clean up things that are created during Poll::Initialize().
Definition at line 311 of file poll2_core.cpp.
|
private |
Close the current output file, if one is open.
Safely close current data file if one is open. The scalers are cleared when this is called.
[in] | continueRun | Flag indicating whether we are continuing the same run, but opening a new continuation file. |
Definition at line 345 of file poll2_core.cpp.
void Poll::CommandControl | ( | ) |
Main control loop for handling user input.
|
private |
Return the current output filename.
|
private |
Acquire raw traces from a pixie module.
Definition at line 776 of file poll2_core.cpp.
|
inline |
Definition at line 282 of file poll2_core.h.
|
inline |
Definition at line 294 of file poll2_core.h.
|
inline |
Definition at line 300 of file poll2_core.h.
|
inline |
|
inline |
Definition at line 286 of file poll2_core.h.
|
inline |
|
inline |
Definition at line 296 of file poll2_core.h.
|
inline |
Definition at line 290 of file poll2_core.h.
|
inline |
Definition at line 302 of file poll2_core.h.
|
inline |
Definition at line 284 of file poll2_core.h.
|
inline |
Definition at line 292 of file poll2_core.h.
|
private |
Data packet for class shared-memory broadcast.
Print help dialogue for POLL options.
Definition at line 628 of file poll2_core.cpp.
bool Poll::Initialize | ( | ) |
Initialize the poll object.
Definition at line 246 of file poll2_core.cpp.
|
private |
Opens a new file if no file is currently open.
Opens a new file if no file is currently open. The new file is determined from the output directory, run number and prefix. The run number may be iterated forward if a file already exists. If this is a continuation run the run number is not iterated and instead a suffix number is incremented.
The scalers are cleared when this is called if a file is not open already.
[in] | continueRun | Flag indicating that this file should be a continuation run and that the run number should not be iterated. |
Definition at line 391 of file poll2_core.cpp.
|
private |
Print help dialogue for reading/writing pixie channel parameters.
Definition at line 669 of file poll2_core.cpp.
|
private |
Print help dialogue for reading/writing pixie module parameters.
Definition at line 677 of file poll2_core.cpp.
void Poll::PrintModuleInfo | ( | ) |
Prints the information about each module.
Definition at line 231 of file poll2_core.cpp.
|
private |
Routine to read Pixie FIFOs.
|
private |
Routine to read Pixie scalers.
void Poll::RunControl | ( | ) |
Main acquisition control loop for handling data acq.
|
inline |
|
inline |
|
inline |
Definition at line 274 of file poll2_core.h.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 270 of file poll2_core.h.
|
inline |
|
inline |
Set the terminal pointer.
Definition at line 279 of file poll2_core.h.
|
inline |
|
inline |
|
inline |
|
private |
Display run status information.
Definition at line 743 of file poll2_core.cpp.
|
private |
Display polling threshold.
Definition at line 770 of file poll2_core.cpp.
|
private |
Splits the arguments to pread and pwrite on a colon delimeter.
[in] | arg | The argument to be split. |
[out] | start | The first value in the string indicating the first mod / ch. |
[out] | start | The second value in the string indicating the last mod / ch. |
|
private |
Start a data recording run.
Starts a data recording run. Open data file is closed, the run number is iterated and a new file is opened. If the file was successfully opened the acquisition is started. If a run is already started a warning is displayed and the process is stopped.
[in] | record_ | Record a data file. |
[in] | time_ | The approximate number of seconds to run the acquisition. |
Definition at line 692 of file poll2_core.cpp.
|
private |
Stop an active data recording run.
Current run is stopped. This includes disabling data recording. This command stops the acquisition even if data recording is not active.
Definition at line 721 of file poll2_core.cpp.
|
private |
Set IN_SYNCH and SYNCH_WAIT parameters on all modules.
Definition at line 433 of file poll2_core.cpp.
|
private |
Method responsible for handling tab complete.
|
private |
Routine to update the status message.
|
private |
Write a data spill to disk.
Definition at line 457 of file poll2_core.cpp.
|
private |
Force poll2 to dump the current data spill.
Definition at line 127 of file poll2_core.h.
|
private |
Definition at line 179 of file poll2_core.h.
|
private |
Structure to hold arguments for MCA program.
Definition at line 138 of file poll2_core.h.
|
private |
Definition at line 114 of file poll2_core.h.
|
private |
Definition at line 177 of file poll2_core.h.
|
private |
Set with 'oform' command.
Definition at line 158 of file poll2_core.h.
|
private |
Definition at line 144 of file poll2_core.h.
|
private |
Definition at line 134 of file poll2_core.h.
|
private |
Set to true if data is to be recorded to disk.
Definition at line 125 of file poll2_core.h.
|
private |
Set to true when the program is exiting.
Definition at line 122 of file poll2_core.h.
|
private |
Set to true when the command is given to start a run.
Definition at line 123 of file poll2_core.h.
|
private |
Definition at line 130 of file poll2_core.h.
|
private |
Set with 'fdir' command.
Definition at line 152 of file poll2_core.h.
|
private |
Set to true when the user tells POLL to reboot PIXIE.
Definition at line 126 of file poll2_core.h.
|
private |
Set to true when run_command exits.
Definition at line 129 of file poll2_core.h.
|
private |
Definition at line 169 of file poll2_core.h.
|
private |
Pacman shared-memory mode.
Definition at line 147 of file poll2_core.h.
|
private |
Definition at line 139 of file poll2_core.h.
|
private |
Definition at line 140 of file poll2_core.h.
|
private |
Command line message header.
Definition at line 121 of file poll2_core.h.
|
private |
Time when the acquistion was started.
Definition at line 110 of file poll2_core.h.
|
private |
Set to true when the "mca" command is received.
Definition at line 135 of file poll2_core.h.
|
private |
Definition at line 165 of file poll2_core.h.
|
private |
Set with 'htit' command.
Definition at line 154 of file poll2_core.h.
|
private |
Time to run the acquisition, in seconds.
Definition at line 151 of file poll2_core.h.
|
private |
Definition at line 159 of file poll2_core.h.
|
private |
Set with 'hnum' command.
Definition at line 155 of file poll2_core.h.
|
private |
Set with 'ouf' command.
Definition at line 153 of file poll2_core.h.
|
private |
New style shared-memory mode.
Definition at line 146 of file poll2_core.h.
|
staticprivate |
Definition at line 175 of file poll2_core.h.
|
private |
A vector to store the partial events.
Definition at line 107 of file poll2_core.h.
|
private |
UDP server to listen for pacman commands.
Definition at line 117 of file poll2_core.h.
|
private |
Definition at line 105 of file poll2_core.h.
|
staticprivate |
Definition at line 176 of file poll2_core.h.
|
private |
Definition at line 131 of file poll2_core.h.
|
private |
Set to true when the command is given to stop a run.
Definition at line 124 of file poll2_core.h.
|
private |
Set to true when run_command is recieving data from PIXIE.
Definition at line 128 of file poll2_core.h.
|
staticprivate |
Definition at line 174 of file poll2_core.h.
|
private |
Definition at line 148 of file poll2_core.h.
|
private |
Definition at line 141 of file poll2_core.h.
|
private |
UDP client for network access.
Definition at line 115 of file poll2_core.h.
|
private |
Definition at line 145 of file poll2_core.h.
|
private |
Definition at line 142 of file poll2_core.h.
|
private |
Definition at line 109 of file poll2_core.h.
|
private |
Definition at line 171 of file poll2_core.h.
|
staticprivate |
The amount time between scaler reads in seconds.
Definition at line 172 of file poll2_core.h.
|
private |
The main pixie interface pointer.
Definition at line 120 of file poll2_core.h.
|
private |
Definition at line 166 of file poll2_core.h.
|
private |
Time when the last spill finished.
Definition at line 112 of file poll2_core.h.
|
private |
Total number of poll data spill chunks sent over the network.
Definition at line 163 of file poll2_core.h.
|
private |
Pacman related variables.
The number of UDP packets transmitted.
Definition at line 162 of file poll2_core.h.
|
private |
Definition at line 143 of file poll2_core.h.