Skip to content

Commit 3066c25

Browse files
afursflp
andauthored
AFIT-101: new extended trg word(min bias), update for FT0 time offset collibration (#13514)
* FIT: new extended trg word(min bias), update for FT0 time offset functionality(for min bias usage) * adding Detectectors common data format to FIT det data format * turning off common digits for FT0 and FV0 for checking * turning off common digits for FDD * removing commented lines --------- Co-authored-by: flp <flp@flptestfit.cern.ch>
1 parent 2d60fa2 commit 3066c25

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+211
-1993
lines changed

DataFormats/Detectors/FIT/FDD/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ o2_add_library(DataFormatsFDD
1717
O2::DataFormatsFIT
1818
O2::SimulationDataFormat
1919
O2::CommonDataFormat
20+
O2::DetectorsCommonDataFormats
2021
)
2122

2223
o2_target_root_dictionary(DataFormatsFDD
@@ -28,3 +29,4 @@ o2_target_root_dictionary(DataFormatsFDD
2829
include/DataFormatsFDD/RawEventData.h
2930
include/DataFormatsFDD/LookUpTable.h
3031
include/DataFormatsFDD/CTF.h)
32+

DataFormats/Detectors/FIT/FT0/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ o2_add_library(DataFormatsFT0
2626
O2::CommonDataFormat
2727
O2::Headers
2828
O2::CCDB
29+
O2::DetectorsCommonDataFormats
2930
)
3031

3132
o2_target_root_dictionary(DataFormatsFT0

DataFormats/Detectors/FIT/FT0/include/DataFormatsFT0/ChannelData.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
/// \brief Class to describe fired and stored channels for the BC and to refer to channel data
1414
/// \author Alla.Maevskaya@cern.ch
1515

16-
#ifndef _FT0_CHANNELDATA_H_
17-
#define _FT0_CHANNELDATA_H_
16+
#ifndef O2_FT0_CHANNELDATA_H_
17+
#define O2_FT0_CHANNELDATA_H_
1818

1919
#include <Rtypes.h>
2020
#include <tuple>

DataFormats/Detectors/FIT/FT0/include/DataFormatsFT0/DigitFilterParam.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ struct DigitFilterParam : o2::conf::ConfigurableParamHelper<DigitFilterParam> {
2727
uint8_t mPMbitsGood = (1 << ChannelData::EEventDataBit::kIsCFDinADCgate) | (1 << ChannelData::EEventDataBit::kIsEventInTVDC);
2828
uint8_t mPMbitsBad = (1 << ChannelData::EEventDataBit::kIsDoubleEvent) | (1 << ChannelData::EEventDataBit::kIsTimeInfoNOTvalid) | (1 << ChannelData::EEventDataBit::kIsTimeInfoLate) | (1 << ChannelData::EEventDataBit::kIsAmpHigh) | (1 << ChannelData::EEventDataBit::kIsTimeInfoLost);
2929
uint8_t mPMbitsToCheck = mPMbitsGood | mPMbitsBad;
30-
uint8_t mTrgBitsGood = (1 << Triggers::bitVertex) | (1 << Triggers::bitDataIsValid);
31-
uint8_t mTrgBitsBad = (1 << Triggers::bitOutputsAreBlocked);
32-
uint8_t mTrgBitsToCheck = mTrgBitsGood | mTrgBitsBad;
30+
uint64_t mTrgBitsGood = Triggers::word(Triggers::bitVertex, Triggers::bitDataIsValid);
31+
uint64_t mTrgBitsBad = Triggers::word(Triggers::bitOutputsAreBlocked);
32+
uint64_t mTrgBitsToCheck = mTrgBitsGood | mTrgBitsBad;
3333

3434
O2ParamDef(DigitFilterParam, "FT0DigitFilterParam");
3535
};
@@ -41,12 +41,13 @@ struct ChannelFilterParam : o2::conf::ConfigurableParamHelper<ChannelFilterParam
4141
int16_t mTimeLower = -2050;
4242

4343
uint8_t mPMbitsGood = 0;
44-
uint8_t mPMbitsBad = 0; // no checking for bad bits
44+
uint8_t mPMbitsBad = 0; // no checking for bad bits
4545
uint8_t mPMbitsToCheck = mPMbitsGood | mPMbitsBad;
4646

47-
uint8_t mTrgBitsGood = 0;
48-
uint8_t mTrgBitsBad = 0; // Laser haven't been used in 2022, no check for bad bits
49-
uint8_t mTrgBitsToCheck = mTrgBitsGood | mTrgBitsBad;
47+
uint64_t mTrgBitsGood = 0;
48+
uint64_t mTrgBitsBad = 0; // Laser haven't been used in 2022, no check for bad bits
49+
uint64_t mTrgBitsToCheck = mTrgBitsGood | mTrgBitsBad;
50+
5051
bool checkPMbits(uint8_t pmBits) const
5152
{
5253
return (pmBits & mPMbitsToCheck) == mPMbitsGood;

DataFormats/Detectors/FIT/FT0/src/DataFormatsFT0LinkDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,5 @@
5555
#pragma link C++ class o2::ft0::GlobalOffsetsInfoObject + ;
5656
#pragma link C++ class std::pair < std::vector < double>, std::vector < double>> + ;
5757
#pragma link C++ class o2::ft0::SlewingCoef + ;
58+
5859
#endif

DataFormats/Detectors/FIT/FV0/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ o2_add_library(DataFormatsFV0
2222
O2::SimulationDataFormat
2323
O2::CommonDataFormat
2424
Microsoft.GSL::GSL
25+
O2::DetectorsCommonDataFormats
2526
)
2627

2728
o2_target_root_dictionary(DataFormatsFV0
@@ -34,5 +35,4 @@ o2_target_root_dictionary(DataFormatsFV0
3435
include/DataFormatsFV0/RecPoints.h
3536
include/DataFormatsFV0/RawEventData.h
3637
include/DataFormatsFV0/LookUpTable.h
37-
include/DataFormatsFV0/CTF.h
38-
)
38+
include/DataFormatsFV0/CTF.h)

DataFormats/Detectors/FIT/common/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ o2_add_library(DataFormatsFIT
2020
o2_target_root_dictionary(DataFormatsFIT
2121
HEADERS include/DataFormatsFIT/DCSDPValues.h
2222
include/DataFormatsFIT/LookUpTable.h
23-
include/DataFormatsFIT/Triggers.h)
23+
include/DataFormatsFIT/Triggers.h
24+
include/DataFormatsFIT/ChannelData.h
25+
include/DataFormatsFIT/Digit.h)
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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 Digit.h
13+
/// \brief FIT event entity
14+
/// \author Artur Furs afurs@cern.ch
15+
16+
#ifndef O2_FIT_DIGIT_H_
17+
#define O2_FIT_DIGIT_H_
18+
19+
#include "CommonDataFormat/InteractionRecord.h"
20+
#include "CommonDataFormat/RangeReference.h"
21+
#include "DetectorsCommonDataFormats/DetID.h"
22+
#include "DataFormatsFIT/ChannelData.h"
23+
#include "DataFormatsFIT/Triggers.h"
24+
25+
#include <gsl/span>
26+
#include <Rtypes.h>
27+
28+
namespace o2
29+
{
30+
namespace fit
31+
{
32+
using Triggers = o2::fit::Triggers;
33+
34+
template <o2::detectors::DetID::ID DetID>
35+
struct DigitBase {
36+
static constexpr o2::detectors::DetID sDetID = o2::detectors::DetID(DetID);
37+
typedef ChannelData<DetID> ChannelData_t; // related ChannelData entity
38+
o2::InteractionRecord mIR{}; // Interaction record (orbit, bc)
39+
o2::dataformats::RangeReference<int, int> mReference{};
40+
DigitBase() = default;
41+
DigitBase(int first, int nEntries, const o2::InteractionRecord& ir) : mIR(ir)
42+
{
43+
mReference.setFirstEntry(first);
44+
mReference.setEntries(nEntries);
45+
}
46+
uint32_t getOrbit() const { return mIR.orbit; }
47+
uint16_t getBC() const { return mIR.bc; }
48+
const o2::InteractionRecord& getIntRecord() const { return mIR; };
49+
gsl::span<const ChannelData_t> getBunchChannelData(const gsl::span<const ChannelData_t> channelData) const
50+
{
51+
return mReference.getEntries() ? gsl::span<const ChannelData_t>(&channelData[mReference.getFirstEntry()], mReference.getEntries()) : gsl::span<const ChannelData_t>();
52+
}
53+
ClassDefNV(DigitBase, 1);
54+
};
55+
56+
template <o2::detectors::DetID::ID DetID>
57+
struct Digit : public DigitBase<DetID> {
58+
uint8_t mTriggerWord{};
59+
Digit() = default;
60+
Digit(int first, int nEntries, const o2::InteractionRecord& ir, uint8_t trgWord) : DigitBase<DetID>(first, nEntries, ir), mTriggerWord(trgWord)
61+
{
62+
}
63+
ClassDefNV(Digit, 1);
64+
};
65+
66+
template <o2::detectors::DetID::ID DetID>
67+
struct DigitExt : public DigitBase<DetID> {
68+
Triggers mTriggers{};
69+
DigitExt() = default;
70+
DigitExt(int first, int nEntries, const o2::InteractionRecord& ir, const Triggers& triggers) : DigitBase<DetID>(first, nEntries, ir), mTriggers(triggers)
71+
{
72+
}
73+
ClassDefNV(DigitExt, 1);
74+
};
75+
76+
} // namespace fit
77+
} // namespace o2
78+
79+
#endif

DataFormats/Detectors/FIT/common/include/DataFormatsFIT/Triggers.h

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@ namespace o2
2525
{
2626
namespace fit
2727
{
28-
2928
class Triggers
3029
{
3130
public:
31+
template <typename... TrgBits>
32+
constexpr static uint64_t word(TrgBits&&... trgBits)
33+
{
34+
return ((1ull << std::forward<TrgBits>(trgBits)) | ...);
35+
}
36+
3237
enum { bitA = 0,
3338
bitC = 1, // alias of bitAOut (FT0/FDD)
3439
bitAOut = 1, // alias of bitC (FV0)
@@ -40,7 +45,8 @@ class Triggers
4045
bitAIn = 4, // alias of bitVertex (FV0)
4146
bitLaser = 5, // indicates the laser was triggered in this BC
4247
bitOutputsAreBlocked = 6, // indicates that laser-induced pulses should arrive from detector to FEE in this BC (and trigger outputs are blocked)
43-
bitDataIsValid = 7 }; // data is valid for processing
48+
bitDataIsValid = 7, // data is valid for processing
49+
bitMinBias = 8 }; // extra calculated bit, vrt & (cern || semicent)
4450
static const int16_t DEFAULT_TIME = -5000; // for average of one side (A or C)
4551
static const int16_t DEFAULT_AMP = 0;
4652
static const int16_t DEFAULT_ZERO = 0;
@@ -56,6 +62,15 @@ class Triggers
5662
timeA = atimeA;
5763
timeC = atimeC;
5864
}
65+
inline static bool checkMinBiasFT0(uint64_t trgWord)
66+
{
67+
return static_cast<bool>(trgWord & word(bitVertex)) && static_cast<bool>(trgWord & word(bitSCen, bitCen));
68+
}
69+
static uint64_t makeExtendedTrgWord(uint64_t trgWord)
70+
{
71+
return trgWord | (static_cast<uint64_t>(checkMinBiasFT0(trgWord)) << bitMinBias);
72+
}
73+
5974
bool getOrA() const { return (triggersignals & (1 << bitA)) != 0; }
6075
bool getOrC() const { return (triggersignals & (1 << bitC)) != 0; } // only used by FT0/FDD (same bit as OrAOut in FV0)
6176
bool getOrAOut() const { return (triggersignals & (1 << bitAOut)) != 0; } // only used by FV0 (same bit as OrC in FT0/FDD)
@@ -68,6 +83,8 @@ class Triggers
6883
bool getLaser() const { return (triggersignals & (1 << bitLaser)) != 0; }
6984
bool getOutputsAreBlocked() const { return (triggersignals & (1 << bitOutputsAreBlocked)) != 0; }
7085
bool getDataIsValid() const { return (triggersignals & (1 << bitDataIsValid)) != 0; }
86+
bool getMinBiasFT0() const { return checkMinBiasFT0(static_cast<uint64_t>(triggersignals)); }
87+
uint64_t getExtendedTrgWordFT0() const { return makeExtendedTrgWord(static_cast<uint64_t>(triggersignals)); }
7188

7289
uint8_t getTriggersignals() const { return triggersignals; }
7390
uint8_t getNChanA() const { return nChanA; }

0 commit comments

Comments
 (0)