|
| 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 | +/// \file ChannelData.h |
| 13 | +/// \brief Class represents enity with info per channel in given event |
| 14 | +/// \author Artur Furs afurs@cern.ch |
| 15 | + |
| 16 | +#ifndef _FT0_CHANNELDATA_H_ |
| 17 | +#define _FT0_CHANNELDATA_H_ |
| 18 | + |
| 19 | +#include <Rtypes.h> |
| 20 | +#include <map> |
| 21 | +#include <string> |
| 22 | +#include "DetectorsCommonDataFormats/DetID.h" |
| 23 | + |
| 24 | +namespace o2 |
| 25 | +{ |
| 26 | +namespace fit |
| 27 | +{ |
| 28 | + |
| 29 | +template <o2::detectors::DetID::ID DetID> |
| 30 | +struct ChannelData { |
| 31 | + static constexpr o2::detectors::DetID sDetID = o2::detectors::DetID(DetID); |
| 32 | + static constexpr uint8_t sDUMMY_CHANNEL_ID = 0xff; |
| 33 | + static constexpr uint8_t sDUMMY_PM_WORD = 0xff; |
| 34 | + static constexpr int16_t sDUMMY_TIME = -5000; |
| 35 | + static constexpr int16_t sDUMMY_AMP = -5000; |
| 36 | + uint8_t mChannelID = sDUMMY_CHANNEL_ID; // channel id |
| 37 | + uint8_t mWordPM = sDUMMY_PM_WORD; // PM word, based on EBitsPM |
| 38 | + int16_t mTime = sDUMMY_TIME; // time in TDC units |
| 39 | + int16_t mAmp = sDUMMY_AMP; // amplitude in ADC units |
| 40 | + enum EBitsPM { |
| 41 | + kNumberADC, |
| 42 | + kIsDoubleEvent, |
| 43 | + kIsTimeInfoNotValid, |
| 44 | + kIsCFDinADCgate, |
| 45 | + kIsTimeInfoLate, |
| 46 | + kIsAmpNotValid, |
| 47 | + kIsVertexEvent, |
| 48 | + kIsTimeInfoLost |
| 49 | + }; |
| 50 | + static const inline std::map<unsigned int, std::string> sMapBitsPM = { |
| 51 | + {EBitsPM::kNumberADC, "NumberADC"}, |
| 52 | + {EBitsPM::kIsDoubleEvent, "IsDoubleEvent"}, |
| 53 | + {EBitsPM::kIsTimeInfoNotValid, "IsTimeInfoNotValid"}, |
| 54 | + {EBitsPM::kIsCFDinADCgate, "IsCFDinADCgate"}, |
| 55 | + {EBitsPM::kIsTimeInfoLate, "IsTimeInfoLate"}, |
| 56 | + {EBitsPM::kIsAmpNotValid, "IsAmpNotValid"}, |
| 57 | + {EBitsPM::kIsVertexEvent, "IsVertexEvent"}, |
| 58 | + {EBitsPM::kIsTimeInfoLost, "IsTimeInfoLost"}}; |
| 59 | + ChannelData() = default; |
| 60 | + ChannelData(uint8_t channelID, uint8_t wordPM, int16_t time, int16_t amp) : mChannelID(channelID), mWordPM(wordPM), mTime(time), mAmp(amp) |
| 61 | + { |
| 62 | + } |
| 63 | + // void print() const; |
| 64 | + bool operator<=>(ChannelData const& other) const = default; |
| 65 | + bool operator==(ChannelData const& other) const = default; |
| 66 | + ClassDefNV(ChannelData, 1); |
| 67 | +}; |
| 68 | +} // namespace fit |
| 69 | +} // namespace o2 |
| 70 | +#endif |
0 commit comments