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

reverted some changes

parent 691afda2
...@@ -22,17 +22,13 @@ EventLoaderMuPixTelescope::EventLoaderMuPixTelescope(Configuration config, std:: ...@@ -22,17 +22,13 @@ EventLoaderMuPixTelescope::EventLoaderMuPixTelescope(Configuration config, std::
m_runNumber = m_config.get<int>("Run", -1); // meaningless default runnumber m_runNumber = m_config.get<int>("Run", -1); // meaningless default runnumber
m_isSorted = m_config.get<bool>("isSorted", false); m_isSorted = m_config.get<bool>("isSorted", false);
m_ts2IsGray = m_config.get<bool>("ts2IsGray", false); m_ts2IsGray = m_config.get<bool>("ts2IsGray", false);
m_counter = 0;
// We need to check for the config files in case of scans... TBI // We need to check for the config files in case of scans... TBI
} }
void EventLoaderMuPixTelescope::initialise() { void EventLoaderMuPixTelescope::initialise() {
int i = 0;
for(auto& detector : get_detectors()) { for(auto& detector : get_detectors()) {
LOG(DEBUG) << "Initialise for detector " + detector->name(); LOG(DEBUG) << "Initialise for detector " + detector->name();
_sensors.push_back(new mudaq::SensorHistograms(i, detector->name(), false));
i++;
} }
// Need to check if the files do exist // Need to check if the files do exist
...@@ -91,24 +87,20 @@ StatusCode EventLoaderMuPixTelescope::run(std::shared_ptr<Clipboard> clipboard) ...@@ -91,24 +87,20 @@ StatusCode EventLoaderMuPixTelescope::run(std::shared_ptr<Clipboard> clipboard)
if(!m_blockFile->read_next(tf)) if(!m_blockFile->read_next(tf))
return StatusCode::EndRun; return StatusCode::EndRun;
else { else {
m_counter += 500;
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); 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);
Pixel* p = new Pixel(detectors.at(h.tag() / 4), h.row(), h.column(), 1, 0, true); Pixel* p = new Pixel(detectors.at(h.tag() / 4), h.row(), h.column(), 1, 0, true);
p->setTimestamp(static_cast<double>(m_counter)); // tf.timestamp()));//8*static_cast<double>(((tf.timestamp()>>2) p->setTimestamp(8 * static_cast<double>(((tf.timestamp() >> 2) & 0xFFFFF700) + h.timestamp_raw()));
// & 0xFFFFF700)+h.timestamp_raw())); p->setToT(0);
// p->setTimestamp(static_cast<double>(h.timestamp_raw()));
p->setToT(0); // int(h.get_tot_ns(0,8)));
if(!dataContainers.count(detectors.at(h.tag() / 4))) if(!dataContainers.count(detectors.at(h.tag() / 4)))
dataContainers[detectors.at(h.tag() / 4)] = new Objects(); dataContainers[detectors.at(h.tag() / 4)] = new Objects();
dataContainers.at(detectors.at(h.tag() / 4))->push_back(p); dataContainers.at(detectors.at(h.tag() / 4))->push_back(p);
hHitMap->Fill(h.column(), h.row()); hHitMap->Fill(h.column(), h.row());
hTimeStamp->Fill(h.timestamp_raw()); hTimeStamp->Fill(h.timestamp_raw());
_sensors.at(h.tag() / 4)->Fill({h.column()}, {h.row()});
} }
} }
...@@ -118,7 +110,7 @@ StatusCode EventLoaderMuPixTelescope::run(std::shared_ptr<Clipboard> clipboard) ...@@ -118,7 +110,7 @@ StatusCode EventLoaderMuPixTelescope::run(std::shared_ptr<Clipboard> clipboard)
try { try {
clipboard->put(d, "pixels", dataContainers[d]); clipboard->put(d, "pixels", dataContainers[d]);
} catch(ModuleError& e) { } catch(ModuleError& e) {
LOG(WARNING) << "Unknown detector "; LOG(ERROR) << "Unknown detector ";
} }
} }
// Increment event counter // Increment event counter
...@@ -130,6 +122,5 @@ StatusCode EventLoaderMuPixTelescope::run(std::shared_ptr<Clipboard> clipboard) ...@@ -130,6 +122,5 @@ StatusCode EventLoaderMuPixTelescope::run(std::shared_ptr<Clipboard> clipboard)
void EventLoaderMuPixTelescope::finalise() { void EventLoaderMuPixTelescope::finalise() {
_sensors.at(0)->Write();
LOG(DEBUG) << "Analysed " << m_eventNumber << " events"; LOG(DEBUG) << "Analysed " << m_eventNumber << " events";
} }
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "core/module/Module.hpp" #include "core/module/Module.hpp"
#include "blockfile.hpp" #include "blockfile.hpp"
#include "monitor_histograms.hpp" #include "telescope_frame.hpp"
namespace corryvreckan { namespace corryvreckan {
/** @ingroup Modules /** @ingroup Modules
...@@ -57,12 +57,10 @@ namespace corryvreckan { ...@@ -57,12 +57,10 @@ namespace corryvreckan {
bool m_isSorted; bool m_isSorted;
bool m_ts2IsGray; bool m_ts2IsGray;
int m_runNumber; int m_runNumber;
int m_counter;
BlockFile* m_blockFile; BlockFile* m_blockFile;
TelescopeFrame m_tf; TelescopeFrame m_tf;
// Histograms // Histograms
vector<mudaq::SensorHistograms*> _sensors;
TH2F* hHitMap; TH2F* hHitMap;
TH1F* hPixelToT; TH1F* hPixelToT;
// TH1F* hPixelToA; // TH1F* hPixelToA;
......
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