Skip to content

Commit ae1b7f9

Browse files
authored
Merge branch 'dev' into prange
2 parents d9c993e + fb9ce04 commit ae1b7f9

141 files changed

Lines changed: 8513 additions & 5508 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Acquisition/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ add_subdirectory(PxiDump)
1616
add_subdirectory(Poll)
1717

1818
#Build the setup tools
19-
if (BUILD_SETUP)
19+
if (PAASS_BUILD_SETUP)
2020
add_subdirectory(Setup)
21-
endif()
21+
endif(PAASS_BUILD_SETUP)

Acquisition/Interface/source/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ set(Interface_SOURCES PixieInterface.cpp Lock.cpp)
22

33
add_library(PixieInterface STATIC ${Interface_SOURCES})
44

5-
#Order is important, PXI before PLX
6-
target_link_libraries(PixieInterface PaassCoreStatic ${PXI_LIBRARIES}
5+
#Order is important, XIA before PLX
6+
target_link_libraries(PixieInterface PaassCoreStatic ${XIA_LIBRARIES}
77
${PLX_LIBRARIES})
88

99
set(Support_SOURCES PixieSupport.cpp)

Acquisition/MCA/source/CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
#Determine the sources based on use flags
22
set (MCA_LIB_SOURCES MCA.cpp)
3-
if (${USE_ROOT})
3+
4+
if (PAASS_USE_ROOT)
45
set (MCA_LIB_SOURCES ${MCA_LIB_SOURCES} MCA_ROOT.cpp)
5-
endif()
6-
if (${USE_DAMM})
6+
endif(PAASS_USE_ROOT)
7+
8+
if (PAASS_USE_DAMM)
79
set (MCA_LIB_SOURCES ${MCA_LIB_SOURCES} MCA_DAMM.cpp HisDrr.cpp)
8-
endif()
10+
endif(PAASS_USE_DAMM)
911

1012
#build the MCA library
1113
add_library(MCA_LIBRARY STATIC ${MCA_LIB_SOURCES})
1214
target_link_libraries(MCA_LIBRARY PixieInterface Utility)
13-
if (${USE_ROOT})
15+
if (PAASS_USE_ROOT)
1416
target_link_libraries(MCA_LIBRARY ${ROOT_LIBRARIES})
15-
endif()
17+
endif(PAASS_USE_ROOT)
1618

1719
#If we can we build the MCA program
18-
if (${USE_DAMM} OR ${USE_ROOT})
20+
if (PAASS_USE_DAMM OR PAASS_USE_ROOT)
1921
add_executable(MCA MCA_exec.cpp)
2022
target_link_libraries(MCA MCA_LIBRARY)
2123
install(TARGETS MCA DESTINATION bin)

Acquisition/Poll/include/poll2_core.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ class Poll{
187187
/// Print help dialogue for reading/writing pixie module parameters.
188188
void pmod_help();
189189

190+
/// Print help dialogue for writing pixie DSP parameters.
191+
void save_help();
192+
190193
/// Start a data recording run.
191194
bool start_run(const bool &record_=true, const double &time_=-1.0);
192195

Acquisition/Poll/source/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
if(USE_NCURSES)
1+
if(PAASS_USE_NCURSES)
22
set(POLL2_SOURCES poll2.cpp poll2_core.cpp poll2_stats.cpp)
33
add_executable(poll2 ${POLL2_SOURCES})
44
target_link_libraries(poll2 PixieInterface PixieSupport Utility MCA_LIBRARY ${CMAKE_THREAD_LIBS_INIT})
55
install(TARGETS poll2 DESTINATION bin)
66
else()
77
message(WARNING "Cannot build poll2 without ncurses!")
8-
endif()
8+
endif(PAASS_USE_NCURSES)
99

1010
set(LISTENER_SOURCES listener.cpp)
1111
add_executable(listener ${LISTENER_SOURCES})

Acquisition/Poll/source/monitor.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,17 @@ int main(){
214214
<< std::setfill('-') << "";
215215
}
216216
std::cout << "|\n";
217+
218+
std::cout << " | ";
219+
for(unsigned int j = 0; j < (unsigned int)num_modules; j++){
217220

221+
std::cout << "ICR ";
222+
std::cout << " OCR ";
223+
std::cout << " Data ";
224+
std::cout << " Total | ";
225+
}
226+
std::cout << "\n";
227+
218228
for(unsigned int i = 0; i < 16; i++){
219229
std::cout << "C" << std::setw(2) << std:: setfill('0') << i << "|";
220230
for(unsigned int j = 0; j < (unsigned int)num_modules; j++){

Acquisition/Poll/source/poll2_core.cpp

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
* CTerminal. Pixie16 data acquisition is handled by interfacing
99
* with the PixieInterface library.
1010
*
11-
* \author Cory R. Thornsberry
11+
* \author Karl Smith, Robert Grzywacz, David Miller, and Cory R. Thornsberry
1212
*
13-
* \date Oct. 6th, 2015
13+
* \date Apr. 25th, 2017
1414
*
15-
* \version 1.3.10
15+
* \version 1.3.11
1616
*/
1717

1818
#include <algorithm>
@@ -51,8 +51,8 @@
5151
// Adjusted to help alleviate the issue with data corruption
5252
#define POLL_TRIES 100
5353

54-
// 4 GB. Maximum allowable .ldf file size in bytes
55-
#define MAX_FILE_SIZE 4294967296ll
54+
// 2 GB. Maximum allowable .ldf file size in bytes
55+
#define MAX_FILE_SIZE 2147483648ll
5656

5757
// Length of shm packet header (in bytes)
5858
#define PKT_HEAD_LEN 8
@@ -90,7 +90,7 @@ const std::vector<std::string> Poll::runControlCommands_ ({"run", "stop",
9090

9191
const std::vector<std::string> Poll::paramControlCommands_ ({"dump", "pread",
9292
"pmread", "pwrite", "pmwrite", "adjust_offsets", "find_tau", "toggle",
93-
"toggle_bit", "csr_test", "bit_test", "get_traces"});
93+
"toggle_bit", "csr_test", "bit_test", "get_traces", "save"});
9494

9595
const std::vector<std::string> Poll::pollStatusCommands_ ({"status", "thresh",
9696
"debug", "quiet", "quit", "help", "version"});
@@ -466,6 +466,7 @@ int Poll::write_data(word_t *data, unsigned int nWords){
466466
}
467467

468468
// Handle the writing of buffers to the file
469+
//65552 = 8194 * 4 * 2 , 2 EOF buffers are need 8194 words at 4 bytes per word
469470
std::streampos current_filesize = output_file.GetFilesize();
470471
if(current_filesize + (std::streampos)(4*nWords + 65552) > MAX_FILE_SIZE){
471472
// Adding nWords plus 2 EOF buffers to the file will push it over MAX_FILE_SIZE.
@@ -657,6 +658,7 @@ void Poll::help(){
657658
std::cout << " toggle_bit <mod> <chan> <param> <bit> - Toggle any bit of any parameter of 32 bits or less\n";
658659
std::cout << " csr_test <number> - Output the CSRA parameters for a given integer\n";
659660
std::cout << " bit_test <num_bits> <number> - Display active bits in a given integer up to 32 bits long\n";
661+
std::cout << " save [setFilename] - Writes the DSP Parameters to [setFileName] (default='active .set from pixie_cfg')\n";
660662
std::cout << " get_traces <mod> <chan> [threshold] - Get traces for all channels in a specified module\n";
661663
std::cout << " status - Display system status information\n";
662664
std::cout << " thresh [threshold] - Modify or display the current polling threshold.\n";
@@ -667,6 +669,11 @@ void Poll::help(){
667669
std::cout << " version (v) - Display Poll2 version information\n";
668670
}
669671

672+
void Poll::save_help() {
673+
std::cout << " Saves the DSP parameters to disk. Optionally, a file can be"
674+
"provided, otherwise the file set file from pixie.cfg is used.\n";
675+
}
676+
670677
/* Print help dialogue for reading/writing pixie channel parameters. */
671678
void Poll::pchan_help(){
672679
std::cout << " Valid Pixie16 channel parameters:\n";
@@ -1092,11 +1099,10 @@ void Poll::CommandControl(){
10921099
}
10931100

10941101
ParameterChannelWriter writer;
1095-
bool error = false;
1102+
10961103
if(forChannel(pif, modStart, modStop, chStart, chStop, writer, make_pair(arguments.at(2), value))){
1097-
error = true;
1098-
}
1099-
if (!error) pif->SaveDSPParameters();
1104+
pif->SaveDSPParameters();
1105+
}
11001106
}
11011107
else{
11021108
std::cout << sys_message_head << "Invalid number of parameters to pwrite\n";
@@ -1141,6 +1147,27 @@ void Poll::CommandControl(){
11411147
}
11421148
}
11431149
}
1150+
else if (cmd == "save") {
1151+
if(acq_running || do_MCA_run){
1152+
std::cout << sys_message_head << "Warning! Cannot view pixie parameters while acquisition is running\n\n";
1153+
continue;
1154+
}
1155+
if(p_args > 0 && arguments.at(0) == "help"){
1156+
save_help();
1157+
continue;
1158+
}
1159+
if(p_args == 0) {
1160+
pif->SaveDSPParameters();
1161+
}
1162+
else if (p_args == 1) {
1163+
pif->SaveDSPParameters(arguments.at(0).c_str());
1164+
}
1165+
else {
1166+
std::cout << sys_message_head << "Invalid number of parameters to save\n";
1167+
std::cout << sys_message_head << " -SYNTAX- save [setFilename]\n";
1168+
continue;
1169+
}
1170+
}
11441171
else if(cmd == "pread" || cmd == "pmread"){ // Read pixie parameters
11451172
if(acq_running || do_MCA_run){
11461173
std::cout << sys_message_head << "Warning! Cannot view pixie parameters while acquisition is running\n\n";

Acquisition/PxiDump/source/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ add_executable(set2ascii ${SET2ROOT_SOURCES})
44
target_link_libraries(set2ascii)
55
install(TARGETS set2ascii DESTINATION bin)
66

7-
if(USE_ROOT)
7+
if(PAASS_USE_ROOT)
88
add_executable(set2root ${SET2ROOT_SOURCES})
99
set_target_properties(set2root PROPERTIES COMPILE_FLAGS "-DUSE_ROOT_OUTPUT")
1010
target_link_libraries(set2root ${ROOT_LIBRARIES})
1111
install(TARGETS set2root DESTINATION bin)
12-
endif()
12+
endif(PAASS_USE_ROOT)

Acquisition/Setup/source/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ endforeach(UTIL)
1010

1111
install(TARGETS ${SETUP_UTILS} DESTINATION bin)
1212

13-
if(${USE_ROOT})
13+
if(PAASS_USE_ROOT)
1414
add_executable(paramScan paramScan.cpp)
1515
target_link_libraries(paramScan PixieInterface MCA_LIBRARY ${ROOT_LIBRARIES}
1616
"-lSpectrum")
1717
install(TARGETS paramScan DESTINATION bin)
18-
endif()
18+
endif(PAASS_USE_ROOT)

Analysis/CMakeLists.txt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
option(USE_HRIBF "Use HRIBF library for scan base." OFF)
2-
option(USE_GSL "Use GSL for Pulse Fitting" OFF)
1+
option(PAASS_USE_HRIBF "Use HRIBF library for scan base." OFF)
2+
CMAKE_DEPENDENT_OPTION(PAASS_USE_GSL "Compile with GSL" ON
3+
"PAASS_BUILD_UTKSCAN" OFF)
4+
mark_as_advanced(PAASS_USE_GSL)
35

46
#Check if GSL is installed
5-
if(USE_GSL)
7+
if(PAASS_USE_GSL)
68
find_package(GSL REQUIRED)
79
add_definitions("-D usegsl")
8-
endif(USE_GSL)
10+
endif(PAASS_USE_GSL)
911

1012
#Everything below is dependent on these two sets of libaries so we include the
1113
#headers.
1214
include_directories(Resources/include)
1315
include_directories(ScanLibraries/include)
1416

15-
if(USE_HRIBF)
17+
if(PAASS_USE_HRIBF)
1618
#Find HRIBF Libraries
1719
find_package(HRIBF REQUIRED)
1820
add_definitions("-D USE_HRIBF")
@@ -21,7 +23,7 @@ if(USE_HRIBF)
2123
# for the following code.
2224
include_directories(Scanor/include)
2325
add_subdirectory(Scanor)
24-
endif(USE_HRIBF)
26+
endif(PAASS_USE_HRIBF)
2527

2628
#We will always build these two since they include static lib for the rest
2729
add_subdirectory(ScanLibraries)
@@ -30,6 +32,6 @@ add_subdirectory(Resources)
3032
#Build utilities.
3133
add_subdirectory(Utilities)
3234

33-
if(BUILD_UTKSCAN)
35+
if(PAASS_BUILD_UTKSCAN)
3436
add_subdirectory(Utkscan)
35-
endif(BUILD_UTKSCAN)
37+
endif(PAASS_BUILD_UTKSCAN)

0 commit comments

Comments
 (0)