Commit b543fd5b authored by Jens Kroeger's avatar Jens Kroeger
Browse files

EventDefinitionM26: implement parameter for Mimosa26 response time

parent 44ddc118
......@@ -18,6 +18,7 @@ EventDefinitionM26::EventDefinitionM26(Configuration& config, std::vector<std::s
config_.setDefault<int>("time_shift", 0);
config_.setDefault<int>("shift_triggers", 0);
config_.setDefault<std::string>("eudaq_loglevel", "ERROR");
config_.setDefault<double>("response_time_m26", Units::get<double>(0, "us"));
detector_time_ = config_.get<std::string>("detector_event_time");
detector_duration_ = config_.get<std::string>("detector_event_duration");
......@@ -25,6 +26,7 @@ EventDefinitionM26::EventDefinitionM26(Configuration& config, std::vector<std::s
timestamp_ = config_.get<std::string>("file_timestamp");
timeshift_ = config_.get<double>("time_shift");
shift_triggers_ = config_.get<int>("shift_triggers");
response_time_m26_ = config_.get<double>("response_time_m26");
config_.setDefault<std::string>("eudaq_loglevel", "ERROR");
// Set EUDAQ log level to desired value:
......@@ -151,7 +153,7 @@ StatusCode EventDefinitionM26::run(const std::shared_ptr<Clipboard>& clipboard)
}
if(triggerTLU_ == triggerM26_) {
auto time_trig = (time_trig_start_ + time_trig_stop_) / 2.;
auto time_trig = time_trig_start_ - response_time_m26_;
if(time_trig - time_prev_ > 0) {
timebetweenMimosaEvents_->Fill(static_cast<double>(Units::convert(time_trig - time_prev_, "us")));
time_prev_ = time_trig;
......
......@@ -52,6 +52,7 @@ namespace corryvreckan {
std::vector<uint32_t> triggerIDs_{};
long double timeshift_{};
int shift_triggers_{};
double response_time_m26_{};
// EUDAQ2 readers for all required files
eudaq::FileReaderUP readerTime_;
......@@ -66,8 +67,9 @@ namespace corryvreckan {
TH1F* timebetweenMimosaEvents_;
TH1F* timebetweenTLUEvents_;
unsigned triggerTLU_{}, triggerM26_{};
unsigned triggerTLU_{999}, triggerM26_{999}; // not nice, find better solution here!!!
long double time_prev_{}, trig_prev_{}, time_trig_start_{}, time_trig_stop_{}, time_before_{}, time_after_{};
long double time_trig_stop_prev_{};
/**
* @brief get_next_event_with_det
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment