Skip to content

Commit 6d28097

Browse files
committed
Please consider the following formatting changes
1 parent 9808d50 commit 6d28097

3 files changed

Lines changed: 33 additions & 34 deletions

File tree

DataFormats/Detectors/TPC/include/DataFormatsTPC/CMV.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,56 +25,57 @@
2525
namespace o2::tpc::cmv
2626
{
2727

28-
static constexpr uint32_t NTimeBins = 3564; ///< number of time bins (spans 8 orbits)
29-
static constexpr uint32_t SignificantBits = 2; ///< number of bits used for floating point precision
30-
static constexpr float FloatConversion = 1.f / float(1 << SignificantBits); ///< conversion factor from integer representation to float
28+
static constexpr uint32_t NTimeBins = 3564; ///< number of time bins (spans 8 orbits)
29+
static constexpr uint32_t SignificantBits = 2; ///< number of bits used for floating point precision
30+
static constexpr float FloatConversion = 1.f / float(1 << SignificantBits); ///< conversion factor from integer representation to float
3131

3232
/// Header definition of the CMVs
3333
struct Header {
3434
static constexpr uint8_t MagicWord = 0xDC;
3535
union {
36-
uint32_t word0 = 0; ///< bits 0 - 31
36+
uint32_t word0 = 0; ///< bits 0 - 31
3737
struct {
38-
uint8_t version : 8; ///< version
39-
uint8_t packetID : 8; ///< packet id
40-
uint8_t errorCode : 8; ///< errors
41-
uint8_t magicWord : 8; ///< magic word
38+
uint8_t version : 8; ///< version
39+
uint8_t packetID : 8; ///< packet id
40+
uint8_t errorCode : 8; ///< errors
41+
uint8_t magicWord : 8; ///< magic word
4242
};
4343
};
4444
union {
45-
uint32_t word1 = 0; ///< bits 32 - 63
45+
uint32_t word1 = 0; ///< bits 32 - 63
4646
struct {
47-
uint32_t heartbeatOrbit : 32; ///< first heart beat timing of the package
47+
uint32_t heartbeatOrbit : 32; ///< first heart beat timing of the package
4848
};
4949
};
5050
union {
51-
uint16_t word2 = 0; ///< bits 64 - 79
51+
uint16_t word2 = 0; ///< bits 64 - 79
5252
struct {
53-
uint16_t heartbeatBC : 16; ///< first BC id of the package
53+
uint16_t heartbeatBC : 16; ///< first BC id of the package
5454
};
5555
};
5656
};
5757

5858
/// CMV single data container
5959
struct Data {
60-
uint16_t CMV{0}; ///< 16bit ADC value
61-
60+
uint16_t CMV{0}; ///< 16bit ADC value
61+
6262
// Raw integer accessors
6363
uint16_t getCMV() const { return CMV; }
6464
void setCMV(uint16_t value) { CMV = value; }
65-
65+
6666
// Float helpers using SignificantBits for fixed-point conversion
6767
float getCMVFloat() const { return static_cast<float>(CMV) * FloatConversion; }
68-
void setCMVFloat(float value) {
68+
void setCMVFloat(float value)
69+
{
6970
// round to nearest representable fixed-point value
7071
setCMV(uint32_t((value + 0.5f * FloatConversion) / FloatConversion));
7172
}
7273
};
7374

7475
/// CMV full data container: one packet carries NTimeBins time bins
7576
struct Container {
76-
Header header; ///< CMV data header
77-
Data data[NTimeBins]; ///< data values for given number of time bins
77+
Header header; ///< CMV data header
78+
Data data[NTimeBins]; ///< data values for given number of time bins
7879

7980
// Header and data accessors
8081
const Header& getHeader() const { return header; }
@@ -89,7 +90,6 @@ struct Container {
8990

9091
float getCMVFloat(uint32_t timeBin) const { return data[timeBin].getCMVFloat(); }
9192
void setCMVFloat(uint32_t timeBin, float value) { data[timeBin].setCMVFloat(value); }
92-
9393
};
9494
} // namespace o2::tpc::cmv
9595

Detectors/TPC/workflow/include/TPCWorkflow/CMVToVectorSpec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ o2::framework::DataProcessorSpec getCMVToVectorSpec(const std::string inputSpec,
2828

2929
} // end namespace o2::tpc
3030

31-
#endif //TPC_CMVToVectorSpec_H_
31+
#endif // TPC_CMVToVectorSpec_H_

Detectors/TPC/workflow/src/CMVToVectorSpec.cxx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -263,17 +263,17 @@ class CMVToVectorDevice : public o2::framework::Task
263263
bool matches(uint32_t orbit, int16_t bc) const { return ((heartbeatOrbit == orbit) && (heartbeatBC == bc)); }
264264
};
265265

266-
int mRawDataType{0}; ///< type of raw data to dump in case of errors
267-
bool mWriteDebug{false}; ///< write a debug output
268-
bool mWriteDebugOnError{false}; ///< write a debug output in case of errors
269-
bool mWriteRawDataOnError{false}; ///< write raw data in case of errors
270-
std::vector<uint32_t> mCRUs; ///< CRUs expected for this device
271-
std::unordered_map<uint32_t, std::vector<float>> mCMVvectors; ///< decoded CMVs per cru over all CMV packets in the TF
272-
std::unordered_map<uint32_t, std::vector<CMVInfo>> mCMVInfos; ///< CMV packet information within the TF
273-
std::string mDebugStreamFileName; ///< name of the debug stream output file
274-
std::unique_ptr<o2::utils::TreeStreamRedirector> mDebugStream; ///< debug output streamer
275-
std::ofstream mRawOutputFile; ///< raw output file
276-
std::string mRawOutputFileName; ///< name of the raw output file
266+
int mRawDataType{0}; ///< type of raw data to dump in case of errors
267+
bool mWriteDebug{false}; ///< write a debug output
268+
bool mWriteDebugOnError{false}; ///< write a debug output in case of errors
269+
bool mWriteRawDataOnError{false}; ///< write raw data in case of errors
270+
std::vector<uint32_t> mCRUs; ///< CRUs expected for this device
271+
std::unordered_map<uint32_t, std::vector<float>> mCMVvectors; ///< decoded CMVs per cru over all CMV packets in the TF
272+
std::unordered_map<uint32_t, std::vector<CMVInfo>> mCMVInfos; ///< CMV packet information within the TF
273+
std::string mDebugStreamFileName; ///< name of the debug stream output file
274+
std::unique_ptr<o2::utils::TreeStreamRedirector> mDebugStream; ///< debug output streamer
275+
std::ofstream mRawOutputFile; ///< raw output file
276+
std::string mRawOutputFileName; ///< name of the raw output file
277277

278278
//____________________________________________________________________________
279279
bool snapshotCMVs(DataAllocator& output, uint32_t tfCounter)
@@ -336,17 +336,16 @@ class CMVToVectorDevice : public o2::framework::Task
336336
if (mCMVInfos.find(cru) == mCMVInfos.end()) {
337337
continue;
338338
}
339-
339+
340340
auto& infos = mCMVInfos[cru];
341341
auto& cmvVec = mCMVvectors[cru];
342-
342+
343343
stream << "cru=" << cru
344344
<< "tfCounter=" << tfCounter
345345
<< "nCMVs=" << cmvVec.size()
346346
<< "cmvs=" << cmvVec
347347
<< "\n";
348348
}
349-
350349
}
351350

352351
void writeRawData(InputRecord& inputs)

0 commit comments

Comments
 (0)