Project
Loading...
Searching...
No Matches
Clusterer.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
14#ifndef ALICEO2_TOF_CLUSTERER_H
15#define ALICEO2_TOF_CLUSTERER_H
16
17#include <utility>
18#include <vector>
21#include "TOFBase/Geo.h"
25#include "TOFBase/CalibTOFapi.h"
27
28namespace o2
29{
30
31namespace tof
32{
34{
38 using Digit = o2::tof::Digit;
40
41 public:
42 Clusterer() = default;
43 ~Clusterer() = default;
44
45 Clusterer(const Clusterer&) = delete;
46 Clusterer& operator=(const Clusterer&) = delete;
47
48 void process(DataReader& r, std::vector<Cluster>& clusters, MCLabelContainer const* digitMCTruth);
49
51
52 void setCalibApi(CalibApi* calibApi)
53 {
54 mCalibApi = calibApi;
55 }
56
57 void addCalibFromCluster(int ch1, int8_t dch, float dtime, short tot1, short tot2);
58
59 void setFirstOrbit(uint64_t orb);
60 uint64_t getFirstOrbit() const { return mFirstOrbit; }
61
62 void setCalibFromCluster(bool val = 1) { mCalibFromCluster = val; }
63 bool isCalibFromCluster() const { return mCalibFromCluster; }
64
65 void setDeltaTforClustering(float val) { mDeltaTforClustering = val; }
66 float getDeltaTforClustering() const { return mDeltaTforClustering; }
67 std::vector<o2::tof::CalibInfoCluster>* getInfoFromCluster() { return &mCalibInfosFromCluster; }
68 void addDiagnostic(const Diagnostic& dia)
69 {
70 mDiagnosticFrequency.merge(&dia);
71 mDiagnosticFrequency.getNoisyMap(mIsNoisy);
72 };
74 {
75 memset(mIsNoisy, 0, Geo::NCHANNELS * sizeof(mIsNoisy[0]));
76 mDiagnosticFrequency.clear();
77 }
78
79 bool areCalibStored() const { return mAreCalibStored; }
80 void setCalibStored(bool val = true) { mAreCalibStored = val; }
81
82 private:
83 void calibrateStrip();
84 void processStrip(std::vector<Cluster>& clusters, MCLabelContainer const* digitMCTruth);
85 //void fetchMCLabels(const Digit* dig, std::array<Label, Cluster::maxLabels>& labels, int& nfilled) const;
86
87 StripData mStripData;
88
89 o2::dataformats::MCTruthContainer<o2::MCCompLabel>* mClsLabels = nullptr; // Cluster MC labels
90
91 Digit* mContributingDigit[6];
92 int mNumberOfContributingDigits;
93 void addContributingDigit(Digit* dig);
94 void buildCluster(Cluster& c, MCLabelContainer const* digitMCTruth);
95 CalibApi* mCalibApi = nullptr;
96 uint64_t mFirstOrbit = 0;
97 uint64_t mBCOffset = 0;
98
99 float mDeltaTforClustering = 5000;
100 bool mCalibFromCluster = false;
101 Diagnostic mDiagnosticFrequency;
102 bool mIsNoisy[Geo::NCHANNELS];
103
104 std::vector<o2::tof::CalibInfoCluster> mCalibInfosFromCluster;
105
106 bool mAreCalibStored = false;
107};
108
109} // namespace tof
110} // namespace o2
111#endif /* ALICEO2_TOF_CLUSTERER_H */
Class to use TOF calibration (decalibration, calibration)
Definition of the TOF cluster.
Definition of the TOF hit reader.
Definition of the TOF cluster.
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to process
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
Definition of a container to keep Monte Carlo truth external to simulation objects.
uint32_t c
Definition RawData.h:2
Cluster class for TOF.
Definition Cluster.h:37
void clearDiagnostic()
Definition Clusterer.h:73
uint64_t getFirstOrbit() const
Definition Clusterer.h:60
float getDeltaTforClustering() const
Definition Clusterer.h:66
bool isCalibFromCluster() const
Definition Clusterer.h:63
void setDeltaTforClustering(float val)
Definition Clusterer.h:65
void addCalibFromCluster(int ch1, int8_t dch, float dtime, short tot1, short tot2)
std::vector< o2::tof::CalibInfoCluster > * getInfoFromCluster()
Definition Clusterer.h:67
void setCalibStored(bool val=true)
Definition Clusterer.h:80
Clusterer(const Clusterer &)=delete
Clusterer & operator=(const Clusterer &)=delete
void setFirstOrbit(uint64_t orb)
bool areCalibStored() const
Definition Clusterer.h:79
void setCalibFromCluster(bool val=1)
Definition Clusterer.h:62
void setCalibApi(CalibApi *calibApi)
Definition Clusterer.h:52
void addDiagnostic(const Diagnostic &dia)
Definition Clusterer.h:68
~Clusterer()=default
void setMCTruthContainer(o2::dataformats::MCTruthContainer< o2::MCCompLabel > *truth)
Definition Clusterer.h:50
DataReader class for TOF.
Definition DataReader.h:28
Diagnostic class for TOF.
Definition Diagnostic.h:32
void merge(const Diagnostic *prev)
void getNoisyMap(Bool_t *output, int noisyThr=1) const
TOF digit implementation.
Definition Digit.h:31
static constexpr int NCHANNELS
Definition Geo.h:126
GLuint GLfloat * val
Definition glcorearb.h:1582
o2::dataformats::MCTruthContainer< o2::MCCompLabel > MCLabelContainer
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Transient data for single strip digits.
Definition DataReader.h:32
std::vector< Cluster > clusters