|
| 1 | +// Copyright CERN and copyright holders of ALICE O2. This software is |
| 2 | +// distributed under the terms of the GNU General Public License v3 (GPL |
| 3 | +// Version 3), copied verbatim in the file "COPYING". |
| 4 | +// |
| 5 | +// See http://alice-o2.web.cern.ch/license for full licensing information. |
| 6 | +// |
| 7 | +// In applying this license CERN does not waive the privileges and immunities |
| 8 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 9 | +// or submit itself to any jurisdiction. |
| 10 | + |
| 11 | +/// |
| 12 | +/// \file Tracks.cxx |
| 13 | +/// \author Stefan Heckel, sheckel@cern.ch |
| 14 | +/// |
| 15 | + |
| 16 | +// root includes |
| 17 | +#include <TCanvas.h> |
| 18 | +#include <TH1.h> |
| 19 | +#include <TH2.h> |
| 20 | +//#include <gsl/span> |
| 21 | + |
| 22 | +// O2 includes |
| 23 | +#include "Framework/ProcessingContext.h" |
| 24 | +#include "DataFormatsTPC/TrackTPC.h" |
| 25 | + |
| 26 | +// QC includes |
| 27 | +#include "QualityControl/QcInfoLogger.h" |
| 28 | +#include "TPC/Tracks.h" |
| 29 | + |
| 30 | +namespace o2::quality_control_modules::tpc |
| 31 | +{ |
| 32 | + |
| 33 | +void Tracks::initialize(o2::framework::InitContext& /*ctx*/) |
| 34 | +{ |
| 35 | + QcInfoLogger::GetInstance() << "initialize TPC Tracks QC task" << AliceO2::InfoLogger::InfoLogger::endm; |
| 36 | + |
| 37 | + mQCTracks.initializeHistograms(); |
| 38 | + |
| 39 | + for (auto& hist : mQCTracks.getHistograms1D()) { |
| 40 | + getObjectsManager()->startPublishing(&hist); |
| 41 | + getObjectsManager()->addMetadata(hist.GetName(), "custom", "34"); |
| 42 | + } |
| 43 | + |
| 44 | + for (auto& hist2 : mQCTracks.getHistograms2D()) { |
| 45 | + getObjectsManager()->startPublishing(&hist2); |
| 46 | + getObjectsManager()->addMetadata(hist2.GetName(), "custom", "42"); |
| 47 | + } |
| 48 | +} |
| 49 | + |
| 50 | +void Tracks::startOfActivity(Activity& /*activity*/) |
| 51 | +{ |
| 52 | + QcInfoLogger::GetInstance() << "startOfActivity" << AliceO2::InfoLogger::InfoLogger::endm; |
| 53 | + mQCTracks.resetHistograms(); |
| 54 | +} |
| 55 | + |
| 56 | +void Tracks::startOfCycle() |
| 57 | +{ |
| 58 | + QcInfoLogger::GetInstance() << "startOfCycle" << AliceO2::InfoLogger::InfoLogger::endm; |
| 59 | +} |
| 60 | + |
| 61 | +void Tracks::monitorData(o2::framework::ProcessingContext& ctx) |
| 62 | +{ |
| 63 | + using TrackType = std::vector<o2::tpc::TrackTPC>; |
| 64 | + auto tracks = ctx.inputs().get<TrackType>("inputTracks"); |
| 65 | + //using TracksType = gsl::span<o2::tpc::TrackTPC>; |
| 66 | + //const auto tracks = ctx.inputs().get<TracksType>("inputTracks"); |
| 67 | + QcInfoLogger::GetInstance() << "monitorData: " << tracks.size() << AliceO2::InfoLogger::InfoLogger::endm; |
| 68 | + |
| 69 | + for (auto const& track : tracks) { |
| 70 | + mQCTracks.processTrack(track); |
| 71 | + } |
| 72 | + //mQCTracks.processAllTracks(tracks); |
| 73 | +} |
| 74 | + |
| 75 | +void Tracks::endOfCycle() |
| 76 | +{ |
| 77 | + QcInfoLogger::GetInstance() << "endOfCycle" << AliceO2::InfoLogger::InfoLogger::endm; |
| 78 | +} |
| 79 | + |
| 80 | +void Tracks::endOfActivity(Activity& /*activity*/) |
| 81 | +{ |
| 82 | + QcInfoLogger::GetInstance() << "endOfActivity" << AliceO2::InfoLogger::InfoLogger::endm; |
| 83 | +} |
| 84 | + |
| 85 | +void Tracks::reset() |
| 86 | +{ |
| 87 | + // clean all the monitor objects here |
| 88 | + |
| 89 | + QcInfoLogger::GetInstance() << "Resetting the histogram" << AliceO2::InfoLogger::InfoLogger::endm; |
| 90 | + mQCTracks.resetHistograms(); |
| 91 | +} |
| 92 | + |
| 93 | +} // namespace o2::quality_control_modules::tpc |
0 commit comments