Commit 8c392439 authored by Lennart Huth's avatar Lennart Huth Committed by Jens Kroeger
Browse files

added namespaces to MuPixTelescope Loader and fixed small cout error

(cherry picked from commit ede3cab5)
parent aa19e040
...@@ -54,7 +54,7 @@ void EventLoaderMuPixTelescope::initialise() { ...@@ -54,7 +54,7 @@ void EventLoaderMuPixTelescope::initialise() {
LOG(INFO) << "File found" << endl; LOG(INFO) << "File found" << endl;
string file = (m_inputDirectory + "/" + entry->d_name); string file = (m_inputDirectory + "/" + entry->d_name);
LOG(INFO) << "reading " << file; LOG(INFO) << "reading " << file;
m_blockFile = new BlockFile(file); m_blockFile = new mudaq::BlockFile(file);
if(!m_blockFile->open_read()) { if(!m_blockFile->open_read()) {
LOG(ERROR) << "File cannot be read" << endl; LOG(ERROR) << "File cannot be read" << endl;
return; return;
...@@ -76,13 +76,16 @@ StatusCode EventLoaderMuPixTelescope::run(std::shared_ptr<Clipboard> clipboard) ...@@ -76,13 +76,16 @@ StatusCode EventLoaderMuPixTelescope::run(std::shared_ptr<Clipboard> clipboard)
LOG(DEBUG) << "Detector with name " << detectorName; LOG(DEBUG) << "Detector with name " << detectorName;
} }
map<string, std::shared_ptr<PixelVector>> dataContainers; map<string, std::shared_ptr<PixelVector>> dataContainers;
TelescopeFrame tf; mudaq::TelescopeFrame tf;
double frame_start = std::numeric_limits<double>::max();
double frame_end = std::numeric_limits<double>::min();
if(!m_blockFile->read_next(tf)) if(!m_blockFile->read_next(tf))
return StatusCode::EndRun; return StatusCode::EndRun;
else { else {
LOG(DEBUG) << "Found " << tf.num_hits() << " in event " << m_eventNumber; LOG(DEBUG) << "Found " << tf.num_hits() << " in event " << m_eventNumber;
for(uint i = 0; i < tf.num_hits(); ++i) { for(uint i = 0; i < tf.num_hits(); ++i) {
RawHit h = tf.get_hit(i); mudaq::RawHit h = tf.get_hit(i);
if(h.tag() == 0x4) if(h.tag() == 0x4)
h = tf.get_hit(i, 66); h = tf.get_hit(i, 66);
double px_timestamp = 8 * static_cast<double>(((tf.timestamp() >> 2) & 0xFFFFF700) + h.timestamp_raw()); double px_timestamp = 8 * static_cast<double>(((tf.timestamp() >> 2) & 0xFFFFF700) + h.timestamp_raw());
...@@ -105,9 +108,12 @@ StatusCode EventLoaderMuPixTelescope::run(std::shared_ptr<Clipboard> clipboard) ...@@ -105,9 +108,12 @@ StatusCode EventLoaderMuPixTelescope::run(std::shared_ptr<Clipboard> clipboard)
LOG(ERROR) << "Unknown detector "; LOG(ERROR) << "Unknown detector ";
} }
} }
// Increment event counter
m_eventNumber++; // Store current frame time and the length of the event:
LOG(DEBUG) << "Frame with " << tf.num_hits(); LOG(DEBUG) << "Frame with " << tf.num_hits() << " hits, time: " << Units::display(frame_start, {"ns", "us", "s"})
<< ", length: " << Units::display((frame_end - frame_start), {"ns", "us", "s"});
clipboard->putEvent(std::make_shared<Event>(frame_start, frame_end));
// Return value telling analysis to keep running // Return value telling analysis to keep running
return StatusCode::Success; return StatusCode::Success;
} }
......
...@@ -54,8 +54,8 @@ namespace corryvreckan { ...@@ -54,8 +54,8 @@ namespace corryvreckan {
bool m_isSorted; bool m_isSorted;
bool m_ts2IsGray; bool m_ts2IsGray;
int m_runNumber; int m_runNumber;
BlockFile* m_blockFile; mudaq::BlockFile* m_blockFile;
TelescopeFrame m_tf; mudaq::TelescopeFrame m_tf;
// Histograms // Histograms
TH2F* hHitMap; TH2F* hHitMap;
......
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