Commit 9569a25d authored by Lennart Huth's avatar Lennart Huth
Browse files

updating to new corry default nameing

parent b3206b2c
......@@ -12,13 +12,15 @@
using namespace corryvreckan;
AnalysisTracks::AnalysisTracks(Configuration config, std::vector<std::shared_ptr<Detector>> detectors)
AnalysisTracks::AnalysisTracks(Configuration& config, std::vector<std::shared_ptr<Detector>> detectors)
: Module(config, std::move(detectors)) {}
void AnalysisTracks::initialise() {
void AnalysisTracks::initialize() {
std::string title;
for(auto& detector : get_detectors()) {
if(detector->isAuxiliary())
continue;
LOG(DEBUG) << "Initialise for detector " + detector->getName();
TDirectory* directory = getROOTDirectory();
TDirectory* local_directory = directory->mkdir(detector->getName().c_str());
......@@ -40,7 +42,7 @@ void AnalysisTracks::initialise() {
eventNumber_ = 0;
}
StatusCode AnalysisTracks::run(std::shared_ptr<Clipboard> clipboard) {
StatusCode AnalysisTracks::run(const std::shared_ptr<Clipboard>& clipboard) {
// Loop over all detectors
for(auto& detector : get_detectors()) {
......@@ -57,6 +59,8 @@ StatusCode AnalysisTracks::run(std::shared_ptr<Clipboard> clipboard) {
return StatusCode::Success;
std::map<std::string, uint> clusters;
for(auto d : get_detectors()) {
if(d->isAuxiliary())
continue;
clusters[d->getName()] = clipboard->getData<Cluster>(d->getName()).size();
clusters_vs_tracks_.at(d->getName())->Fill(tracks.size(), clusters.at(d->getName()));
}
......@@ -65,6 +69,8 @@ StatusCode AnalysisTracks::run(std::shared_ptr<Clipboard> clipboard) {
std::map<std::string, std::vector<XYZPoint>> intersects; // local coordinates
for(auto& track : tracks) {
for(auto d : get_detectors()) {
if(d->isAuxiliary())
continue;
intersects[d->getName()].push_back(d->globalToLocal(track->getState(d->getName())));
if(d->isDUT() || track->getClusterFromDetector(d->getName()) == nullptr)
continue;
......@@ -93,7 +99,7 @@ StatusCode AnalysisTracks::run(std::shared_ptr<Clipboard> clipboard) {
return StatusCode::Success;
}
void AnalysisTracks::finalise() {
void AnalysisTracks::finalize(const std::shared_ptr<ReadonlyClipboard>& clipboard) {
LOG(DEBUG) << "Analysed " << eventNumber_ << " events";
}
......@@ -7,7 +7,8 @@
* In applying this license, CERN does not waive the privileges and immunities granted to it by virtue of its status as an
* Intergovernmental Organization or submit itself to any jurisdiction.
*/
#ifndef ANALYSISTRACKS_H
#define ANALYSISTRACKS_H 1
#include <TCanvas.h>
#include <TH1F.h>
#include <TH2F.h>
......@@ -31,22 +32,22 @@ namespace corryvreckan {
* @param config Configuration object for this module as retrieved from the steering file
* @param detectors Vector of pointers to the detectors
*/
AnalysisTracks(Configuration config, std::vector<std::shared_ptr<Detector>> detectors);
AnalysisTracks(Configuration& config, std::vector<std::shared_ptr<Detector>> detectors);
~AnalysisTracks() {}
/**
* @brief [Initialise this module]
*/
void initialise();
void initialize() override;
/**
* @brief [Run the function of this module]
*/
StatusCode run(std::shared_ptr<Clipboard> clipboard);
StatusCode run(const std::shared_ptr<Clipboard>& clipboard) override;
/**
* @brief [Finalise module]
*/
void finalise();
void finalize(const std::shared_ptr<ReadonlyClipboard>& clipboard) override;
private:
int eventNumber_;
......@@ -58,3 +59,4 @@ namespace corryvreckan {
};
} // namespace corryvreckan
#endif // ANALYSISTRACKS_H
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