Commit 7861a865 authored by Jens Kroeger's avatar Jens Kroeger
Browse files

EventLoaderATLASpix: remove function 'read_legacy_data'

parent 777802b9
......@@ -526,72 +526,6 @@ bool EventLoaderATLASpix::read_caribou_data() { // return false when reaching eo
return true;
}
Pixels* EventLoaderATLASpix::read_legacy_data(double, double) {
// Pixel container
Pixels* pixels = new Pixels();
// Read file and load data
while(!m_file.eof()) {
int col, row, tot, ts;
unsigned long long int toa, TriggerDebugTS, dummy, bincounter;
m_file >> col >> row >> ts >> tot >> dummy >> dummy >> bincounter >> TriggerDebugTS;
// If this pixel is masked, do not save it
if(m_detector->masked(col, row)) {
continue;
}
// TOT
if(tot <= (ts * 2 & 0x3F)) {
tot = 64 + tot - (ts * 2 & 0x3F);
} else {
tot = tot - (ts * 2 & 0x3F);
}
// Apply calibration:
double cal_tot = tot * m_calibrationFactors.at(static_cast<size_t>(row * 25 + col));
LOG(TRACE) << "Hit " << row << "\t" << col << ": " << m_calibrationFactors.at(static_cast<size_t>(row * 25 + col))
<< " * " << tot << " = " << cal_tot;
ts &= 0xFF;
ts *= 2; // atlaspix timestamp runs at 10MHz, multiply by to to get 20.
if((bincounter & 0x1FF) < static_cast<unsigned long long>(ts)) {
toa = ((bincounter & 0xFFFFFFFFFFFFFE00) - (1 << 9)) | (ts & 0x1FF);
} else {
toa = (bincounter & 0xFFFFFFFFFFFFFE00) | (ts & 0x1FF);
}
if(((toa + 10000) & 0xFFFFF000) < (m_oldtoa & 0xFFFFF000)) {
m_overflowcounter++;
LOG(DEBUG) << "Overflow detected " << m_overflowcounter << " " << (toa & 0xFFFFF000) << " "
<< (m_oldtoa & 0xFFFFF000);
} // Atlaspix only! Toa has overflow at 32 bits.
toa += (0x100000000 * m_overflowcounter);
m_oldtoa = toa & 0xFFFFFFFF;
LOG(DEBUG) << " " << row << "\t" << col << ": " << tot << " " << ts << " " << bincounter << " " << toa << " "
<< (TriggerDebugTS - toa);
// TriggerDebugTS *= 4096. / 5; // runs with 200MHz, divide by 5 to scale counter value to 40MHz
double toa_timestamp =
4096. * 2 * static_cast<double>(toa); // runs with 20MHz, multiply by 2 to scale counter value to 40MHz
// Convert TOA to nanoseconds:
toa_timestamp /= (4096. * 40); // Conversion to nanoseconds: not sure here
// when calibration is not available, set charge = tot
Pixel* pixel = new Pixel(m_detector->name(), col, row, tot, tot, toa_timestamp);
pixel->setCharge(cal_tot);
pixels->push_back(pixel);
}
return pixels;
}
void EventLoaderATLASpix::finalise() {
LOG(INFO) << "Identifier distribution:";
......
......@@ -38,11 +38,6 @@ namespace corryvreckan {
*/
uint32_t gray_decode(uint32_t gray);
/*
* @brief Read data in the format written by the Karlsruhe readout system
*/
Pixels* read_legacy_data(double start_time, double end_time);
/*
* @brief Read data in the format written by the Caribou readout system
*/
......
Supports Markdown
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