Commit 1a9ccaeb authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Propagations: adapt to new LineGraph class

parent 076dc457
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ void GenericPropagationModule::run(Event* event) {
    std::vector<PropagatedCharge> propagated_charges;

    // List of points to plot to plot for output plots
    OutputPlotPoints output_plot_points;
    LineGraph::OutputPlotPoints output_plot_points;

    // Loop over all deposits for propagation
    LOG(TRACE) << "Propagating charges in sensor";
@@ -358,15 +358,18 @@ void GenericPropagationModule::run(Event* event) {

    // Output plots if required
    if(output_linegraphs_) {
        createLineGraphs(event->number, this, model_, config_, output_plot_points, CarrierState::UNKNOWN);
        LineGraph::Create(event->number, this, model_, config_, output_plot_points, CarrierState::UNKNOWN);
        if(output_linegraphs_collected_) {
            createLineGraphs(event->number, this, model_, config_, output_plot_points, CarrierState::HALTED);
            LineGraph::Create(event->number, this, model_, config_, output_plot_points, CarrierState::HALTED);
        }
        if(output_linegraphs_recombined_) {
            createLineGraphs(event->number, this, model_, config_, output_plot_points, CarrierState::RECOMBINED);
            LineGraph::Create(event->number, this, model_, config_, output_plot_points, CarrierState::RECOMBINED);
        }
        if(output_linegraphs_trapped_) {
            createLineGraphs(event->number, this, model_, config_, output_plot_points, CarrierState::TRAPPED);
            LineGraph::Create(event->number, this, model_, config_, output_plot_points, CarrierState::TRAPPED);
        }
        if(config_.get<bool>("output_animations")) {
            LineGraph::Animate(event->number, this, model_, config_, output_plot_points);
        }
    }

@@ -403,7 +406,7 @@ GenericPropagationModule::propagate(const ROOT::Math::XYZPoint& pos,
                                    const CarrierType& type,
                                    const double initial_time,
                                    RandomNumberGenerator& random_generator,
                                    OutputPlotPoints& output_plot_points) const {
                                    LineGraph::OutputPlotPoints& output_plot_points) const {
    // Create a runge kutta solver using the electric field as step function
    Eigen::Vector3d position(pos.x(), pos.y(), pos.z());

+6 −5
Original line number Diff line number Diff line
@@ -88,11 +88,12 @@ namespace allpix {
         * @return Tuple with the point where the deposit ended after propagation, the time the propagation took, the
         * cumulative gain and the final state of the charge carrier at the end of processing
         */
        std::tuple<ROOT::Math::XYZPoint, double, double, CarrierState> propagate(const ROOT::Math::XYZPoint& pos,
        std::tuple<ROOT::Math::XYZPoint, double, double, CarrierState>
        propagate(const ROOT::Math::XYZPoint& pos,
                  const CarrierType& type,
                  const double initial_time,
                  RandomNumberGenerator& random_generator,
                                                                                 OutputPlotPoints& output_plot_points) const;
                  LineGraph::OutputPlotPoints& output_plot_points) const;

        // Local copies of configuration parameters to avoid costly lookup:
        double temperature_{}, timestep_min_{}, timestep_max_{}, timestep_start_{}, integration_time_{},
+2 −2
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ void ProjectionPropagationModule::run(Event* event) {
    unsigned int recombined_charges_count = 0;

    // List of points to plot to plot for output plots
    OutputPlotPoints output_plot_points;
    LineGraph::OutputPlotPoints output_plot_points;

    // Loop over all deposits for propagation
    for(const auto& deposit : deposits_message->getData()) {
@@ -423,7 +423,7 @@ void ProjectionPropagationModule::run(Event* event) {

    // Output plots if required
    if(output_linegraphs_) {
        createLineGraphs(event->number, this, model_, config_, output_plot_points, CarrierState::UNKNOWN);
        LineGraph::Create(event->number, this, model_, config_, output_plot_points, CarrierState::UNKNOWN);
    }

    if(output_plots_) {
+9 −6
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ void TransientPropagationModule::run(Event* event) {
    unsigned int trapped_charges_count = 0;

    // List of points to plot to plot for output plots
    OutputPlotPoints output_plot_points;
    LineGraph::OutputPlotPoints output_plot_points;

    // Loop over all deposits for propagation
    LOG(TRACE) << "Propagating charges in sensor";
@@ -292,15 +292,18 @@ void TransientPropagationModule::run(Event* event) {

    // Output plots if required
    if(output_linegraphs_) {
        createLineGraphs(event->number, this, model_, config_, output_plot_points, CarrierState::UNKNOWN);
        LineGraph::Create(event->number, this, model_, config_, output_plot_points, CarrierState::UNKNOWN);
        if(output_linegraphs_collected_) {
            createLineGraphs(event->number, this, model_, config_, output_plot_points, CarrierState::HALTED);
            LineGraph::Create(event->number, this, model_, config_, output_plot_points, CarrierState::HALTED);
        }
        if(output_linegraphs_recombined_) {
            createLineGraphs(event->number, this, model_, config_, output_plot_points, CarrierState::RECOMBINED);
            LineGraph::Create(event->number, this, model_, config_, output_plot_points, CarrierState::RECOMBINED);
        }
        if(output_linegraphs_trapped_) {
            createLineGraphs(event->number, this, model_, config_, output_plot_points, CarrierState::TRAPPED);
            LineGraph::Create(event->number, this, model_, config_, output_plot_points, CarrierState::TRAPPED);
        }
        if(config_.get<bool>("output_animations")) {
            LineGraph::Animate(event->number, this, model_, config_, output_plot_points);
        }
    }

@@ -329,7 +332,7 @@ TransientPropagationModule::propagate(Event* event,
                                      const unsigned int charge,
                                      const double initial_time,
                                      std::map<Pixel::Index, Pulse>& pixel_map,
                                      OutputPlotPoints& output_plot_points) {
                                      LineGraph::OutputPlotPoints& output_plot_points) {
    Eigen::Vector3d position(pos.x(), pos.y(), pos.z());

    // Initialize gain
+6 −6
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ namespace allpix {
                                                                         const unsigned int charge,
                                                                         const double initial_time,
                                                                         std::map<Pixel::Index, Pulse>& pixel_map,
                                                                                 OutputPlotPoints& output_plot_points);
                                                                         LineGraph::OutputPlotPoints& output_plot_points);

        // Local copies of configuration parameters to avoid costly lookup:
        double temperature_{}, timestep_{}, integration_time_{}, output_plots_step_{};