Project
Loading...
Searching...
No Matches
PHOSTurnonCalibrator.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
12#ifndef O2_CALIBRATION_PHOSTURNON_CALIBRATOR_H
13#define O2_CALIBRATION_PHOSTURNON_CALIBRATOR_H
14
17
18#include "Framework/Task.h"
26
27using namespace o2::framework;
28
29namespace o2
30{
31namespace phos
32{
33
35{
36 public:
37 static constexpr short NCHANNELS = 3136;
38
39 PHOSTurnonSlot(bool useCCDB);
41
42 ~PHOSTurnonSlot() = default;
43
44 void print() const;
45 void fill(const gsl::span<const Cell>& cells, const gsl::span<const TriggerRecord>& trs,
46 const gsl::span<const Cluster>& clusters, const gsl::span<const TriggerRecord>& cluTR);
47 void fill(const gsl::span<const Cluster>& /*cells*/){}; //not used
48 void merge(const PHOSTurnonSlot* /*prev*/) {} //not used
49 void clear();
50
51 TurnOnHistos& getCollectedHistos() { return *mTurnOnHistos; }
52
53 void setRunStartTime(long tf) { mRunStartTime = tf; }
54
55 private:
56 void scanClusters(const gsl::span<const Cell>& cells, const TriggerRecord& celltr,
57 const gsl::span<const Cluster>& clusters, const TriggerRecord& clutr);
58
59 private:
60 bool mUseCCDB = false;
61 long mRunStartTime = 0;
62 std::bitset<NCHANNELS> mFiredTiles;
63 std::bitset<NCHANNELS> mNoisyTiles;
64 std::unique_ptr<TurnOnHistos> mTurnOnHistos;
65
66 ClassDefNV(PHOSTurnonSlot, 1);
67};
68
69//==========================================================================================
70class PHOSTurnonCalibrator final : public o2::calibration::TimeSlotCalibration<o2::phos::PHOSTurnonSlot>
71{
73
74 public:
76
77 bool hasEnoughData(const Slot& slot) const final { return true; } //no need to merge Slots
78 void initOutput() final {}
79 void finalizeSlot(Slot& slot) final;
80 Slot& emplaceNewSlot(bool front, TFType tstart, TFType tend) final;
81 bool process(uint64_t tf, const gsl::span<const Cell>& cells, const gsl::span<const TriggerRecord>& trs,
82 const gsl::span<const Cluster>& clusters, const gsl::span<const TriggerRecord>& cluTR);
83
84 TriggerMap& getCalibration() { return *mTriggerMap; }
85 void endOfStream();
86
87 private:
88 bool calculateCalibrations();
89
90 private:
91 bool mUseCCDB = false;
92 long mRunStartTime = 0;
93 std::unique_ptr<TurnOnHistos> mTurnOnHistos;
94 std::unique_ptr<TriggerMap> mTriggerMap;
95
96 ClassDefOverride(PHOSTurnonCalibrator, 1);
97};
98
100} // namespace phos
101} // namespace o2
102
103#endif
uint64_t TFType
bool hasEnoughData(const Slot &slot) const final
Slot & emplaceNewSlot(bool front, TFType tstart, TFType tend) final
void merge(const PHOSTurnonSlot *)
void fill(const gsl::span< const Cell > &cells, const gsl::span< const TriggerRecord > &trs, const gsl::span< const Cluster > &clusters, const gsl::span< const TriggerRecord > &cluTR)
static constexpr short NCHANNELS
Number of trigger channels.
TurnOnHistos & getCollectedHistos()
void fill(const gsl::span< const Cluster > &)
Header for data corresponding to the same hardware trigger adapted from DataFormatsEMCAL/TriggerRecor...
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
o2::framework::DataProcessorSpec getPHOSTunronCalibDeviceSpec(bool useCCDB)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::unique_ptr< GPUReconstructionTimeframe > tf
VectorOfTObjectPtrs other
std::vector< Cluster > clusters
std::vector< Cell > cells