Commit 75a6c580 authored by Petja Skomina's avatar Petja Skomina
Browse files

First commit. Yay! Added graph model to CSADigitizer (not finished yet).

parent a8e92b25
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -167,6 +167,10 @@ CSADigitizerModule::CSADigitizerModule(Configuration& config, Messenger* messeng
        }

        LOG(DEBUG) << "Response function successfully initialized with " << parameters.size() << " parameters";
    } else if(model_ == DigitizerType::LUT) {
    //    Take the file (type to be determined) containing normalized electronics response and establish interpolation for every timestep
    //} excel -> csv, import, change to tgraph, add if statement for eval function
        
    }

    output_plots_ = config_.get<bool>("output_plots");
@@ -248,7 +252,11 @@ void CSADigitizerModule::run(Event* event) {
            impulse_response_function_.reserve(ntimepoints);
            for(size_t itimepoint = 0; itimepoint < ntimepoints; ++itimepoint) {
                impulse_response_function_.push_back(
                    if(model_ != DigitizerType::LUT) {
                        calculate_impulse_response_->Eval(timestep * static_cast<double>(itimepoint)));
                    } else {
                        graph_impulse_response_->Eval(timestep * static_cast<double>(itimepoint));
                    }
            }

            if(output_plots_) {
+2 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ namespace allpix {
            SIMPLE, ///< Simplified parametrisation
            CSA,    ///< Enter all contributions to the transfer function as parameters
            CUSTOM, ///< Custom impulse response function using a ROOT::TFormula expression
            GRAPH, ///< External graph in .csv format
        };

    public:
@@ -79,6 +80,7 @@ namespace allpix {

        // Function to calculate impulse response
        std::unique_ptr<TFormula> calculate_impulse_response_;
        std::unique_ptr<TGraph> graph_impulse_response_;

        // Parameters of the electronics: Noise, time-over-threshold logic
        double sigmaNoise_{}, clockToT_{}, clockToA_{}, threshold_{};