Loading src/modules/DepositionGeant4/ActionInitializationG4.hpp +2 −5 Original line number Diff line number Diff line Loading @@ -18,14 +18,12 @@ #include "SetTrackInfoUserHookG4.hpp" namespace allpix { class DepositionGeant4Module; /** * @brief Initializer for the tracker and generator actions, required for \ref RunManager */ class ActionInitializationG4 : public G4VUserActionInitialization { public: explicit ActionInitializationG4(const Configuration& config, DepositionGeant4Module* module) : config_(config), module_(module){}; explicit ActionInitializationG4(const Configuration& config) : config_(config){}; /** * @brief Build the user action to be executed by the worker Loading @@ -36,7 +34,7 @@ namespace allpix { SetUserAction(new GeneratorActionG4(config_)); // tracker hook SetUserAction(new SetTrackInfoUserHookG4(module_)); SetUserAction(new SetTrackInfoUserHookG4()); }; /** Loading @@ -57,7 +55,6 @@ namespace allpix { private: const Configuration& config_; DepositionGeant4Module* module_; }; } // namespace allpix Loading src/modules/DepositionGeant4/DepositionGeant4Module.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -245,7 +245,7 @@ void DepositionGeant4Module::initialize() { // User hook to store additional information at track initialization and termination as well as custom track ids LOG(TRACE) << "Constructing particle source"; auto* action_initialization = new ActionInitializationG4(config_, this); auto* action_initialization = new ActionInitializationG4(config_); run_manager_g4_->SetUserInitialization(action_initialization); // Get the creation energy for charge (default is silicon electron hole pair energy) Loading src/modules/DepositionGeant4/SetTrackInfoUserHookG4.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ using namespace allpix; void SetTrackInfoUserHookG4::PreUserTrackingAction(const G4Track* aTrack) { auto theTrack = const_cast<G4Track*>(aTrack); // NOLINT if(aTrack->GetUserInformation() == nullptr) { auto trackInfo = module_->track_info_manager_->makeTrackInfo(aTrack); auto trackInfo = DepositionGeant4Module::track_info_manager_->makeTrackInfo(aTrack); // Release ownership of the TrackInfoG4 instance theTrack->SetUserInformation(trackInfo.release()); } Loading @@ -30,5 +30,5 @@ void SetTrackInfoUserHookG4::PostUserTrackingAction(const G4Track* aTrack) { auto userInfoOwningPtr = std::unique_ptr<TrackInfoG4>(userInfo); auto theTrack = const_cast<G4Track*>(aTrack); // NOLINT theTrack->SetUserInformation(nullptr); module_->track_info_manager_->storeTrackInfo(std::move(userInfoOwningPtr)); DepositionGeant4Module::track_info_manager_->storeTrackInfo(std::move(userInfoOwningPtr)); } src/modules/DepositionGeant4/SetTrackInfoUserHookG4.hpp +1 −6 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ #include "TrackInfoManager.hpp" namespace allpix { class DepositionGeant4Module; /** * @brief Assigns every G4Track a TrackInfoG4 which carries various information, including the custom track id */ Loading @@ -28,7 +27,7 @@ namespace allpix { * @brief Constructor taking a TrackInfoManager* * @param module Pointer to the DepositionGeant4 module, required to create the TrackInfoG4 instances */ explicit SetTrackInfoUserHookG4(DepositionGeant4Module* module) : module_(module){}; explicit SetTrackInfoUserHookG4() = default; /** * @brief Default destructor Loading @@ -46,10 +45,6 @@ namespace allpix { * @param aTrack The pointer to the G4Track for which this routine is called */ void PostUserTrackingAction(const G4Track* aTrack) override; private: // Raw ptr to module holding track info manager to create instances of TrackInfoG4 DepositionGeant4Module* module_; }; } // namespace allpix Loading src/modules/DetectorHistogrammer/DetectorHistogrammerModule.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ void DetectorHistogrammerModule::initialize() { // Create cluster size plots, preventing a zero-bin histogram by scaling with integer ceiling: (x + y - 1) / y std::string cluster_size_title = "Cluster size for " + detector_->getName() + ";cluster size [px];clusters"; cluster_size = CreateHistogram<TH1D>( "cluster_size", cluster_size_title.c_str(), (xpixels * ypixels + 9) / 10, 0.5, (xpixels * ypixels + 9) / 10 + 0.5); "cluster_size", cluster_size_title.c_str(), (xpixels * ypixels + 9) / 10, 0.5, (xpixels * ypixels + 9.0) / 10 + 0.5); std::string cluster_size_x_title = "Cluster size X for " + detector_->getName() + ";cluster size x [px];clusters"; cluster_size_x = CreateHistogram<TH1D>("cluster_size_x", cluster_size_x_title.c_str(), xpixels, 0.5, xpixels + 0.5); Loading Loading
src/modules/DepositionGeant4/ActionInitializationG4.hpp +2 −5 Original line number Diff line number Diff line Loading @@ -18,14 +18,12 @@ #include "SetTrackInfoUserHookG4.hpp" namespace allpix { class DepositionGeant4Module; /** * @brief Initializer for the tracker and generator actions, required for \ref RunManager */ class ActionInitializationG4 : public G4VUserActionInitialization { public: explicit ActionInitializationG4(const Configuration& config, DepositionGeant4Module* module) : config_(config), module_(module){}; explicit ActionInitializationG4(const Configuration& config) : config_(config){}; /** * @brief Build the user action to be executed by the worker Loading @@ -36,7 +34,7 @@ namespace allpix { SetUserAction(new GeneratorActionG4(config_)); // tracker hook SetUserAction(new SetTrackInfoUserHookG4(module_)); SetUserAction(new SetTrackInfoUserHookG4()); }; /** Loading @@ -57,7 +55,6 @@ namespace allpix { private: const Configuration& config_; DepositionGeant4Module* module_; }; } // namespace allpix Loading
src/modules/DepositionGeant4/DepositionGeant4Module.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -245,7 +245,7 @@ void DepositionGeant4Module::initialize() { // User hook to store additional information at track initialization and termination as well as custom track ids LOG(TRACE) << "Constructing particle source"; auto* action_initialization = new ActionInitializationG4(config_, this); auto* action_initialization = new ActionInitializationG4(config_); run_manager_g4_->SetUserInitialization(action_initialization); // Get the creation energy for charge (default is silicon electron hole pair energy) Loading
src/modules/DepositionGeant4/SetTrackInfoUserHookG4.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ using namespace allpix; void SetTrackInfoUserHookG4::PreUserTrackingAction(const G4Track* aTrack) { auto theTrack = const_cast<G4Track*>(aTrack); // NOLINT if(aTrack->GetUserInformation() == nullptr) { auto trackInfo = module_->track_info_manager_->makeTrackInfo(aTrack); auto trackInfo = DepositionGeant4Module::track_info_manager_->makeTrackInfo(aTrack); // Release ownership of the TrackInfoG4 instance theTrack->SetUserInformation(trackInfo.release()); } Loading @@ -30,5 +30,5 @@ void SetTrackInfoUserHookG4::PostUserTrackingAction(const G4Track* aTrack) { auto userInfoOwningPtr = std::unique_ptr<TrackInfoG4>(userInfo); auto theTrack = const_cast<G4Track*>(aTrack); // NOLINT theTrack->SetUserInformation(nullptr); module_->track_info_manager_->storeTrackInfo(std::move(userInfoOwningPtr)); DepositionGeant4Module::track_info_manager_->storeTrackInfo(std::move(userInfoOwningPtr)); }
src/modules/DepositionGeant4/SetTrackInfoUserHookG4.hpp +1 −6 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ #include "TrackInfoManager.hpp" namespace allpix { class DepositionGeant4Module; /** * @brief Assigns every G4Track a TrackInfoG4 which carries various information, including the custom track id */ Loading @@ -28,7 +27,7 @@ namespace allpix { * @brief Constructor taking a TrackInfoManager* * @param module Pointer to the DepositionGeant4 module, required to create the TrackInfoG4 instances */ explicit SetTrackInfoUserHookG4(DepositionGeant4Module* module) : module_(module){}; explicit SetTrackInfoUserHookG4() = default; /** * @brief Default destructor Loading @@ -46,10 +45,6 @@ namespace allpix { * @param aTrack The pointer to the G4Track for which this routine is called */ void PostUserTrackingAction(const G4Track* aTrack) override; private: // Raw ptr to module holding track info manager to create instances of TrackInfoG4 DepositionGeant4Module* module_; }; } // namespace allpix Loading
src/modules/DetectorHistogrammer/DetectorHistogrammerModule.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ void DetectorHistogrammerModule::initialize() { // Create cluster size plots, preventing a zero-bin histogram by scaling with integer ceiling: (x + y - 1) / y std::string cluster_size_title = "Cluster size for " + detector_->getName() + ";cluster size [px];clusters"; cluster_size = CreateHistogram<TH1D>( "cluster_size", cluster_size_title.c_str(), (xpixels * ypixels + 9) / 10, 0.5, (xpixels * ypixels + 9) / 10 + 0.5); "cluster_size", cluster_size_title.c_str(), (xpixels * ypixels + 9) / 10, 0.5, (xpixels * ypixels + 9.0) / 10 + 0.5); std::string cluster_size_x_title = "Cluster size X for " + detector_->getName() + ";cluster size x [px];clusters"; cluster_size_x = CreateHistogram<TH1D>("cluster_size_x", cluster_size_x_title.c_str(), xpixels, 0.5, xpixels + 0.5); Loading