|
| 1 | +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. |
| 2 | +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. |
| 3 | +// All rights not expressly granted are reserved. |
| 4 | +// |
| 5 | +// This software is distributed under the terms of the GNU General Public |
| 6 | +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". |
| 7 | +// |
| 8 | +// In applying this license CERN does not waive the privileges and immunities |
| 9 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 10 | +// or submit itself to any jurisdiction. |
| 11 | + |
| 12 | +#ifndef QC_MODULE_MCH_CLUSTERS_TASK_H |
| 13 | +#define QC_MODULE_MCH_CLUSTERS_TASK_H |
| 14 | + |
| 15 | +#include "QualityControl/TaskInterface.h" |
| 16 | +#include <MCHRawElecMap/Mapper.h> |
| 17 | +#include <TH1F.h> |
| 18 | +#include <TProfile.h> |
| 19 | +#include <gsl/span> |
| 20 | +#include <memory> |
| 21 | +#include "MCHGeometryTransformer/Transformations.h" |
| 22 | +#include "MUONCommon/HistPlotter.h" |
| 23 | + |
| 24 | +namespace o2::mch |
| 25 | +{ |
| 26 | +class Cluster; |
| 27 | +class TrackMCH; |
| 28 | +} // namespace o2::mch |
| 29 | + |
| 30 | +using namespace o2::quality_control::core; |
| 31 | + |
| 32 | +class TH1F; |
| 33 | + |
| 34 | +namespace o2::quality_control_modules::muonchambers |
| 35 | +{ |
| 36 | + |
| 37 | +class ClustersTask /*final*/ : public TaskInterface |
| 38 | +{ |
| 39 | + public: |
| 40 | + ClustersTask(); |
| 41 | + ~ClustersTask() override; |
| 42 | + |
| 43 | + void initialize(o2::framework::InitContext& ctx) override; |
| 44 | + void startOfActivity(Activity& activity) override; |
| 45 | + void startOfCycle() override; |
| 46 | + void monitorData(o2::framework::ProcessingContext& ctx) override; |
| 47 | + void endOfCycle() override; |
| 48 | + void endOfActivity(Activity& activity) override; |
| 49 | + void reset() override; |
| 50 | + |
| 51 | + private: |
| 52 | + /** check whether all the expected inputs are present.*/ |
| 53 | + bool assertInputs(o2::framework::ProcessingContext& ctx); |
| 54 | + |
| 55 | + /** create one histogram with relevant drawing options / stat box status.*/ |
| 56 | + template <typename T> |
| 57 | + std::unique_ptr<T> createHisto(const char* name, const char* title, |
| 58 | + int nbins, double xmin, double xmax, |
| 59 | + bool statBox = false, |
| 60 | + const char* drawOptions = "", |
| 61 | + const char* displayHints = ""); |
| 62 | + |
| 63 | + /** create histograms related to clusters (those attached to tracks) */ |
| 64 | + void createClusterHistos(); |
| 65 | + |
| 66 | + /** fill histogram related to each cluster */ |
| 67 | + void fillClusterHistos(gsl::span<const o2::mch::Cluster> clusters); |
| 68 | + |
| 69 | + private: |
| 70 | + int dsbinx(int deid, int dsid) const; |
| 71 | + |
| 72 | + std::unique_ptr<TH1F> mNofClustersPerDualSampa; //< aka cluster map |
| 73 | + std::unique_ptr<TH1F> mNofClustersPerTrack; ///< number of clusters per track |
| 74 | + std::unique_ptr<TProfile> mClusterSizePerChamber; ///< mean cluster size per chamber |
| 75 | + std::unique_ptr<TProfile> mNofClustersPerChamber; ///< mean number of clusters per chamber |
| 76 | + |
| 77 | + o2::mch::raw::Det2ElecMapper mDet2ElecMapper; |
| 78 | + o2::mch::raw::Solar2FeeLinkMapper mSolar2FeeLinkMapper; |
| 79 | + std::unique_ptr<o2::mch::geo::TransformationCreator> mTransformation; |
| 80 | + |
| 81 | + muon::HistPlotter mHistPlotter; |
| 82 | +}; |
| 83 | + |
| 84 | +} // namespace o2::quality_control_modules::muonchambers |
| 85 | + |
| 86 | +#endif |
0 commit comments