Skip to content

Commit e459cf3

Browse files
committed
using direct test names so can run specific meson test. gstreamer test with 1 thread per event - no writing output yet
1 parent 8d49a7c commit e459cf3

12 files changed

Lines changed: 248 additions & 100 deletions

File tree

api/meson.build

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ python_exe = import('python').find_installation('python3')
33

44
install_subdir(meson.current_source_dir(), install_dir : '.')
55

6-
test(' ## templates help',
6+
test('api_template_help',
77
python_exe,
88
env : {'PYTHONDONTWRITEBYTECODE': '1'},
99
args : [api_dir + 'system_template.py', '-h'])
1010

11-
test(' ## templates show solid creators',
11+
test('api_show_solid _creators',
1212
python_exe,
1313
env : {'PYTHONDONTWRITEBYTECODE': '1'},
1414
args : [api_dir + 'system_template.py', '-sl'])
@@ -26,28 +26,28 @@ g4objects = {
2626

2727
foreach volume: g4objects.keys()
2828
pars = g4objects[volume]
29-
test(' ## template show code for volume ' + volume,
29+
test('api_show_template_code_for_' + volume,
3030
python_exe,
3131
env : {'PYTHONDONTWRITEBYTECODE': '1'},
3232
args : [api_dir + 'system_template.py', '-gv', volume])
33-
test(' ## template show code for volume ' + volume + ' with parameters ' + pars,
33+
test('api_template_show_code_for_volume' + volume + '_with_parameters_' + pars,
3434
python_exe,
3535
env : {'PYTHONDONTWRITEBYTECODE': '1'},
3636
args : [api_dir + 'system_template.py', '-gv', volume, '-gvp', pars])
3737
endforeach
3838

39-
test(' ## template show code for solid G4Cons in silent mode',
39+
test('api_show_template_code_for_G4Cons',
4040
python_exe,
4141
env : {'PYTHONDONTWRITEBYTECODE': '1'},
4242
args : [api_dir + 'system_template.py', '-gv', 'G4Cons', '-silent'])
4343

4444
test_dir = meson.current_build_dir() + '/../test'
45-
test(' ## template create system test',
45+
test('api_create_system',
4646
python_exe,
4747
env : {'PYTHONDONTWRITEBYTECODE': '1'},
4848
args : [api_dir + 'system_template.py', '-s', 'test'], priority : 10)
4949
foreach format : ['ascii', 'sqlite']
50-
test(' ## template build geometry in test for format ' + format,
50+
test('api_template_build_geometry_in_test_for_format_' + format,
5151
python_exe,
5252
env : {'PYTHONDONTWRITEBYTECODE': '1'},
5353
args : ['test.py', '-f', format], workdir : test_dir, priority : -10)
@@ -67,16 +67,16 @@ foreach volume: g4objects.keys()
6767
geo_py = '-write_to=geometry_test_' + volume + '.py'
6868
test_dir = meson.current_build_dir() + '/../' + test_name
6969
pars = g4objects[volume]
70-
test(' ## template create system test for volume' + volume,
70+
test('api_create_template_system_with' + volume,
7171
python_exe,
7272
env : {'PYTHONDONTWRITEBYTECODE': '1'},
7373
args : [api_dir + 'system_template.py', '-s', test_name], priority : 10)
74-
test(' ## template replace geometry in test with ' + volume,
74+
test('api_template_replace_geometry_with' + volume,
7575
python_exe,
7676
env : {'PYTHONDONTWRITEBYTECODE': '1'},
7777
args: [api_dir + 'system_template.py', '-gv', volume, '-gvp', pars, geo_py, sub_name], workdir : test_dir, priority : -10)
7878
foreach format : ['ascii', 'sqlite']
79-
test(' ## template build geometry in test of replacing geometry with ' + volume + ' with format ' + format,
79+
test('api_template_build_geometry_in_test_of_replacing_geometry_with' + volume + '_with_format' + format,
8080
python_exe,
8181
env : {'PYTHONDONTWRITEBYTECODE': '1'},
8282
args : [python_main, '-f', format], workdir : test_dir, priority : -20)

gdata/event/gEventDataCollectionHeader.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ class GEventDataCollectionHeader {
2323
* \param logger Pointer to a GLogger instance.
2424
*/
2525
GEventDataCollectionHeader(int n, int tid, std::shared_ptr<GLogger> logger) : g4localEventNumber(n), threadID(tid),
26-
log(logger) {
26+
log(logger) {
2727
timeStamp = assignTimeStamp();
2828
log->debug(CONSTRUCTOR, "GEventDataCollectionHeader");
29-
log->info(1, TPOINTITEM, " Event Number: ", g4localEventNumber);
30-
log->info(1, TPOINTITEM, " Thread ID: ", threadID);
31-
log->info(1, TPOINTITEM, " Time Stamp: ", timeStamp);
29+
log->info(1, "\n",
30+
TPOINTITEM, " Event Number: ", g4localEventNumber, "\n",
31+
TPOINTITEM, " Thread ID: ", threadID, "\n",
32+
TPOINTITEM, " Time Stamp: ", timeStamp);
3233
}
3334

3435
/**
@@ -77,4 +78,3 @@ class GEventDataCollectionHeader {
7778

7879
std::string timeStamp; ///< The timestamp.
7980
};
80-

gdynamicDigitization/examples/gplugin_test_example.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ bool GPlugin_test_example::defineReadoutSpecsImpl() {
88
double gridStartTime = 0; // defines the windows grid
99
auto hitBitSet = HitBitSet("100000"); // defines what information to be stored in the hit
1010

11-
readoutSpecs = new GReadoutSpecs(timeWindow, gridStartTime, hitBitSet, digi_logger);
11+
readoutSpecs = std::make_shared<GReadoutSpecs>(timeWindow, gridStartTime, hitBitSet, digi_logger);
1212

1313
return true;
1414
}
@@ -27,7 +27,8 @@ bool GPlugin_test_example::loadConstantsImpl(int runno, [[maybe_unused]] std::st
2727

2828
var4 = "hello";
2929

30-
digi_logger->info(0, " Constants loaded for run number ", runno, " for ctof. var1 is ", var1, " var2 pointer is ", var2, "variation is", variation);
30+
digi_logger->info(0, " Constants loaded for run number ", runno, " for ctof. var1 is ", var1,
31+
", var2 pointer is ", var2, ", variation is ", variation);
3132

3233
return true;
3334
}

gdynamicDigitization/gDosimeterDigitization.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bool GDosimeterDigitization::defineReadoutSpecsImpl() {
4242
auto hitBitSet = HitBitSet("000001"); // defines what information to be stored in the hit
4343

4444
// Create a new GReadoutSpecs object with the specified parameters.
45-
readoutSpecs = new GReadoutSpecs(timeWindow, gridStartTime, hitBitSet, digi_logger);
45+
readoutSpecs = std::make_shared<GReadoutSpecs>(timeWindow, gridStartTime, hitBitSet, digi_logger);
4646

4747
return true;
4848
}

gdynamicDigitization/gFluxDigitization.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ bool GFluxDigitization::defineReadoutSpecsImpl() {
2222

2323
// Create a new GReadoutSpecs object using the provided parameters.
2424
// The digi_logger (obtained via set_loggers()) is used for logging.
25-
readoutSpecs = new GReadoutSpecs(timeWindow, gridStartTime, hitBitSet, digi_logger);
25+
readoutSpecs = std::make_shared<GReadoutSpecs>(timeWindow, gridStartTime, hitBitSet, digi_logger);
2626

2727
return true;
2828
}

gdynamicDigitization/gParticleCounterDigitization.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ bool GParticleCounterDigitization::defineReadoutSpecsImpl() {
66
double gridStartTime = 0; // defines the window grid
77
auto hitBitSet = HitBitSet("000000"); // defines what information to be stored in the hit
88

9-
readoutSpecs = new GReadoutSpecs(timeWindow, gridStartTime, hitBitSet, digi_logger);
9+
readoutSpecs = std::make_shared<GReadoutSpecs>(timeWindow, gridStartTime, hitBitSet, digi_logger);
1010

1111
return true;
1212
}

gdynamicDigitization/gdynamicdigitization.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,9 @@ class GDynamicDigitization {
253253
};
254254
[[nodiscard]] virtual bool defineReadoutSpecsImpl() = 0;
255255

256-
/// Pointer to the readout specifications.
257-
GReadoutSpecs* readoutSpecs = nullptr;
258-
/// Pointer to the translation table.
259-
GTranslationTable* translationTable = nullptr;
256+
/// After init, we never mutate these:
257+
std::shared_ptr<const GReadoutSpecs> readoutSpecs;
258+
std::shared_ptr<const GTranslationTable> translationTable;
260259

261260
/**
262261
* \brief Dynamically instantiates a GDynamicDigitization object from a dynamic library.
@@ -292,7 +291,7 @@ class GDynamicDigitization {
292291
protected:
293292
/// Optional pointer to GOptions.
294293
std::optional<GOptions*> gopts;
295-
/// Data, Translation Tables and digitization loggers.
294+
/// Data, Translation Tables, and digitization loggers.
296295
std::shared_ptr<GLogger> data_logger, tt_logger, digi_logger;
297296

298297
/**

0 commit comments

Comments
 (0)