Commit df6f3823 authored by Lennart Huth's avatar Lennart Huth
Browse files

pivot study part II

parent 51828e44
......@@ -261,6 +261,36 @@ void AnalysisEfficiency::initialize() {
auto nCols = static_cast<size_t>(m_detector->nPixels().X());
std::vector<double> v_row(nRows, 0.); // create vector will zeros of length <nRows>
prev_hit_ts.assign(nCols, v_row); // use vector v_row to construct matrix
// pivot study:
TDirectory* directory = getROOTDirectory();
TDirectory* local_directory = directory->mkdir("pivot_study");
local_directory->cd();
for(uint piv = 0; piv < 57; ++piv) {
std::string pivstring = std::to_string(piv) + "_eTotalEfficiency";
auto _eTotalEfficiency = new TEfficiency(pivstring.c_str(), "totalEfficiency;;#epsilon", 1, 0, 1);
pivstring = std::to_string(piv) + "_efficiencyColumns";
auto _efficiencyColumns = new TEfficiency(pivstring.c_str(),
"Efficiency vs. column number; column; #epsilon",
m_detector->nPixels().X(),
-0.5,
m_detector->nPixels().X() - 0.5);
pivstring = std::to_string(piv) + "_efficiencyRows";
auto _efficiencyRows = new TEfficiency(pivstring.c_str(),
"Efficiency vs. row number; row; #epsilon",
m_detector->nPixels().Y(),
-0.5,
m_detector->nPixels().Y() - 0.5);
pivstring = std::to_string(piv) + "_efficiencyVsTime";
auto _efficiencyVsTime =
new TEfficiency(pivstring.c_str(), "Efficiency vs. time; time [s]; #epsilon", 3000, 0, 3000);
pivot_eTotalEfficiency[int(piv)] = _eTotalEfficiency;
pivot_efficiencyColumns[int(piv)] = _efficiencyColumns;
pivot_efficiencyRows[int(piv)] = _efficiencyRows;
pivot_efficiencyVsTime[int(piv)] = _efficiencyVsTime;
}
}
StatusCode AnalysisEfficiency::run(const std::shared_ptr<Clipboard>& clipboard) {
......@@ -408,6 +438,12 @@ StatusCode AnalysisEfficiency::run(const std::shared_ptr<Clipboard>& clipboard)
efficiencyColumns->Fill(has_associated_cluster, m_detector->getColumn(localIntercept));
efficiencyRows->Fill(has_associated_cluster, m_detector->getRow(localIntercept));
efficiencyVsTime->Fill(has_associated_cluster, track->timestamp() / 1e9); // convert nanoseconds to seconds
int piv = track.get()->getClusters().front()->getSeedPixel()->raw() / 10;
pivot_eTotalEfficiency.at(piv)->Fill(has_associated_cluster, 0); // use 0th bin for total efficiency
pivot_efficiencyColumns.at(piv)->Fill(has_associated_cluster, m_detector->getColumn(localIntercept));
pivot_efficiencyVsTime.at(piv)->Fill(has_associated_cluster,
track->timestamp() / 1e9); // convert nanoseconds to seconds
pivot_efficiencyRows.at(piv)->Fill(has_associated_cluster, m_detector->getRow(localIntercept));
}
auto intercept_col = static_cast<size_t>(m_detector->getColumn(localIntercept));
......
......@@ -65,6 +65,13 @@ namespace corryvreckan {
TEfficiency* efficiencyRows;
TEfficiency* efficiencyVsTime;
// maps to store selected pivot ranges
std::map<int, TEfficiency*> pivot_eTotalEfficiency;
std::map<int, TEfficiency*> pivot_efficiencyColumns;
std::map<int, TEfficiency*> pivot_efficiencyRows;
std::map<int, TEfficiency*> pivot_efficiencyVsTime;
TH1D* hDistanceCluster;
TH1D* hTimeDiffPrevTrack_assocCluster;
TH1D* hTimeDiffPrevTrack_noAssocCluster;
......
......@@ -146,6 +146,8 @@ unsigned EventDefinitionM26::get_next_event_with_det(const eudaq::FileReaderUP&
}
pivotPixel_->Fill(piv);
begin = Units::get(piv * (115.2 / 576), "us") + timeshift_ + add_begin_;
// never shift more than a full frame
if(begin > Units::get(115.2, "us"))
begin -= Units::get(115.2, "us");
// begin = Units::get((576 - piv) * (115.2 / 576), "us") + timeshift_;
......
......@@ -434,6 +434,8 @@ PixelVector EventLoaderEUDAQ2::get_pixel_data(std::shared_ptr<eudaq::StandardEve
// redefined to time begin/end == trigger timestamp in get_trigger_position (see above), i.e. in
// that case, all pixel timestamp will be set to the corresponding trigger timestamp.
ts = static_cast<double>(evt->GetTimeBegin() + evt->GetTimeEnd()) / 2 / 1000 + detector_->timeOffset();
// FIXMe - not to be put to master
raw = static_cast<int>(plane.PivotPixel() / 16);
} else {
ts = static_cast<double>(plane.GetTimestamp(i)) / 1000 + detector_->timeOffset();
}
......
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