Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the possibility of not storing particles table #229

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions source/persistency/PersistencyManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ PersistencyManagerBase(), msg_(0), output_file_("nexus_out"), ready_(false),
interacting_evt_(false), save_ie_numb_(false), event_type_("other"),
saved_evts_(0), interacting_evts_(0), pmt_bin_size_(-1), sipm_bin_size_(-1),
nevt_(0), start_id_(0), first_evt_(true), h5writer_(0),
str_counter_(0), save_str_(true)
str_counter_(0), save_str_(true), particles_(true)
{
msg_ = new G4GenericMessenger(this, "/nexus/persistency/");
msg_->DeclareProperty("output_file", output_file_, "Path of output file.");
Expand All @@ -57,6 +57,8 @@ PersistencyManagerBase(), msg_(0), output_file_("nexus_out"), ready_(false),
"Starting event ID for this job.");
msg_->DeclareProperty("save_strings", save_str_,
"True if volume, process... names are saved as strings.");
msg_->DeclareProperty("save_particles", particles_,
"True if particles table is saved.");

init_macro_ = "";
macros_.clear();
Expand Down Expand Up @@ -126,7 +128,9 @@ G4bool PersistencyManager::Store(const G4Event* event)
StoreSteps();

// Store the trajectories of the event
StoreTrajectories(event->GetTrajectoryContainer());
if (particles_) {
StoreTrajectories(event->GetTrajectoryContainer());
}

// Store ionization hits and sensor hits
ihits_ = nullptr;
Expand Down
1 change: 1 addition & 0 deletions source/persistency/PersistencyManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ namespace nexus {

G4int str_counter_; ///< incrementing counter for string map
G4bool save_str_; ///< Should we store strings as volume names etc.?
G4bool particles_; ///< Store particles table

std::map<G4String, G4double> sensdet_bin_;
};
Expand Down
Loading