Project
Loading...
Searching...
No Matches
KrClusterFinder.h
Go to the documentation of this file.
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
15
16#ifndef O2_TRD_KRCLUSTERFINDER_H
17#define O2_TRD_KRCLUSTERFINDER_H
18
23
24#include "Rtypes.h"
25#include "TF1.h"
26#include "Fit/Fitter.h"
27#include "Fit/FitResult.h"
28
29#include <memory>
30#include <gsl/span>
31
32namespace o2
33{
34
35namespace trd
36{
37
39{
40
41 public:
42 KrClusterFinder() = default;
44 ~KrClusterFinder() = default;
45
47 double operator()(const double* par) const;
48 std::vector<float> x;
49 std::vector<float> y;
52 };
53
55 void init();
56
57 // Reset output containers
58 void reset();
59
61 void setInput(const gsl::span<const Digit>& digitsIn, const gsl::span<const TriggerRecord>& trigRecIn);
62
77 void findClusters();
78
80 double getRms(const std::vector<uint64_t>& adcIndices, int itTrunc, double nRmsTrunc, int minAdc, double& rmsTime, uint32_t& sumAdc) const;
81
83 const std::vector<KrCluster>& getKrClusters() const { return mKrClusters; }
84 const std::vector<KrClusterTriggerRecord>& getKrTrigRecs() const { return mTrigRecs; }
85
86 private:
87 // input
88 gsl::span<const Digit> mDigits;
89 gsl::span<const TriggerRecord> mTriggerRecords;
90 // output
91 std::vector<KrCluster> mKrClusters{};
92 std::vector<KrClusterTriggerRecord> mTrigRecs{};
93 // helpers
94 LandauChi2Functor mLandauChi2Functor;
95 std::shared_ptr<ROOT::Fit::FitResult> mFitResult{new ROOT::Fit::FitResult()};
96 ROOT::Fit::Fitter mFitter{mFitResult};
97 std::array<double, 3> mInitialFitParams{1., 1., 1.};
98 std::unique_ptr<TF1> mFuncLandauFit;
99 // settings
100 const int mBaselineAdc{10};
101 const int mMinAdcForMax{70};
102 const int mMinAdcClContrib{40};
103 const int mMinAdcForSecondMax{50};
104 const int mMinAdcClEoverT{60};
105
106 ClassDefNV(KrClusterFinder, 1);
107};
108
109} // namespace trd
110} // namespace o2
111
112#endif // O2_TRD_KRCLUSTERFINDER_H
A cluster formed from digits during TRD Krypton calibration.
void setInput(const gsl::span< const Digit > &digitsIn, const gsl::span< const TriggerRecord > &trigRecIn)
Provide digits and trigger records as input.
double getRms(const std::vector< uint64_t > &adcIndices, int itTrunc, double nRmsTrunc, int minAdc, double &rmsTime, uint32_t &sumAdc) const
Calculate some statistics for the given cluster constituent ADC values.
const std::vector< KrCluster > & getKrClusters() const
Output.
KrClusterFinder(const KrClusterFinder &)=delete
const std::vector< KrClusterTriggerRecord > & getKrTrigRecs() const
void init()
Initialization.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< float > y
ADC sum per time bin.
std::vector< float > x
the number of the time bin
double operator()(const double *par) const