|
| 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 | +/// |
| 13 | +/// \file MIPCheck.h |
| 14 | +/// \author andreas.molander@cern.ch |
| 15 | +/// |
| 16 | + |
| 17 | +#ifndef QC_MODULE_FIT_FITMIPCHECK_H |
| 18 | +#define QC_MODULE_FIT_FITMIPCHECK_H |
| 19 | + |
| 20 | +#include "QualityControl/CheckInterface.h" |
| 21 | + |
| 22 | +namespace o2::quality_control_modules::fit |
| 23 | +{ |
| 24 | + |
| 25 | +/// \brief QC check on MIP peaks in channel amplitude spectra. Essentially it is a check on |
| 26 | +/// parameters of Gaussian fits of the MIP peaks. |
| 27 | +/// \author andreas.molander@cern.ch |
| 28 | +class MIPCheck : public o2::quality_control::checker::CheckInterface |
| 29 | +{ |
| 30 | + public: |
| 31 | + MIPCheck() = default; |
| 32 | + ~MIPCheck() override = default; |
| 33 | + |
| 34 | + void configure() override; |
| 35 | + Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override; |
| 36 | + void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override; |
| 37 | + std::string getAcceptedType() override; |
| 38 | + void startOfActivity(const Activity& activity) override; |
| 39 | + |
| 40 | + private: |
| 41 | + std::shared_ptr<Activity> mActivity; |
| 42 | + |
| 43 | + std::string mNameObjectToCheck = ""; //< Name of the MO to check |
| 44 | + |
| 45 | + /// Number of MIP peaks to fit. The resulting fit funcion is a sum of `mNPeaksToFit` Gaussians. |
| 46 | + int mNPeaksToFit = 2; |
| 47 | + |
| 48 | + /// Initial fit paramemters for the gaussian means. |
| 49 | + /// If omitted, the 1 MIP peak will default to the amplitude at the ampltude histogram max value. |
| 50 | + /// Other peaks will default to multiples of the initial 1 MIP peak mean (2 MIP peak mean = 2 * 1 MIP peak mean, and so on). |
| 51 | + /// The values are used as initial guesses and are not fixed. |
| 52 | + std::vector<float> mGausParamsMeans; |
| 53 | + |
| 54 | + /// The initial fit parameters for the MIP peak sigmas. The values are used as initial guesses and are not fixed. |
| 55 | + std::vector<float> mGausParamsSigmas; |
| 56 | + |
| 57 | + float mFitRangeLow = 11.0; //< Lower limit of the fit |
| 58 | + |
| 59 | + float mFitRangeHigh = 35.0; //< Upper limit of the fit |
| 60 | + |
| 61 | + /// Lower warning thresholds for the MIP peak means. |
| 62 | + /// The first element is for the first peak and so on. |
| 63 | + std::vector<float> mMeanWarningsLow; |
| 64 | + |
| 65 | + /// Upper warning thresholds for the MIP peak means. |
| 66 | + /// The first element is for the first peak and so on. |
| 67 | + std::vector<float> mMeanWarningsHigh; |
| 68 | + |
| 69 | + /// Lower error thresholds for the MIP peak means. |
| 70 | + /// The first element is for the first peak and so on. |
| 71 | + std::vector<float> mMeanErrorsLow; |
| 72 | + |
| 73 | + /// Upper error thresholds for the MIP peak means. |
| 74 | + /// The first element is for the first peak and so on. |
| 75 | + std::vector<float> mMeanErrorsHigh; |
| 76 | + |
| 77 | + /// Sigma warning thresholds. |
| 78 | + /// The first element is for the first peak and so on. |
| 79 | + std::vector<float> mSigmaWarnings; |
| 80 | + |
| 81 | + /// Sigma error thresholds. |
| 82 | + /// The first element is for the first peak and so on. |
| 83 | + std::vector<float> mSigmaErrors; |
| 84 | + |
| 85 | + /// Whether to draw the threhold lines. |
| 86 | + /// The first element is for the first peak and so on. |
| 87 | + std::vector<bool> mDrawMeanWarningsLow; |
| 88 | + std::vector<bool> mDrawMeanWarningsHigh; |
| 89 | + std::vector<bool> mDrawMeanErrorsLow; |
| 90 | + std::vector<bool> mDrawMeanErrorsHigh; |
| 91 | + std::vector<bool> mDrawSigmaWarnings; |
| 92 | + std::vector<bool> mDrawSigmaErrors; |
| 93 | + |
| 94 | + std::vector<double> mVecLabelPos{ 0.15, 0.2, 0.85, 0.45 }; //< Position of the check label |
| 95 | + |
| 96 | + ClassDefOverride(MIPCheck, 3); |
| 97 | +}; |
| 98 | + |
| 99 | +} // namespace o2::quality_control_modules::fit |
| 100 | + |
| 101 | +#endif // QC_MODULE_FIT_FITMIPCHECK_H |
0 commit comments