Skip to content

Commit d9f827c

Browse files
JaehyeokRyujryu
andauthored
Add ITS stuck-pixel CCDB object output (#15468)
* Add ITS stuck-pixel CCDB object output * Address ITS stuck-pixel review comments * Add stuck-pixel dictionary entries * Remove trailing whitespace * Apply clang-format * Fix PrepareOutputCcdb call --------- Co-authored-by: jryu <jaehyeok.ryu@cern.ch>
1 parent 94d9198 commit d9f827c

5 files changed

Lines changed: 300 additions & 83 deletions

File tree

DataFormats/Detectors/ITSMFT/common/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ o2_target_root_dictionary(DataFormatsITSMFT
3535
include/DataFormatsITSMFT/GBTCalibData.h
3636
include/DataFormatsITSMFT/NoiseMap.h
3737
include/DataFormatsITSMFT/TimeDeadMap.h
38+
include/DataFormatsITSMFT/StuckPixelData.h
3839
include/DataFormatsITSMFT/Cluster.h
3940
include/DataFormatsITSMFT/CompCluster.h
4041
include/DataFormatsITSMFT/ClusterPattern.h
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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 StuckPixelData.h
13+
/// @brief CCDB-serializable container for stuck (repeating) pixel error records.
14+
///
15+
/// Design rationale
16+
/// ----------------
17+
/// TTree-based storage is intentionally avoided for CCDB objects because TTree
18+
/// branches hold internal file-pointer state; serialising an in-memory TTree
19+
/// via CcdbApi::createObjectImage() can silently drop the last unflushed basket.
20+
/// A plain std::vector<StuckPixelEntry> has no such issue: ROOT's TClass
21+
/// machinery serialises it correctly via the generated dictionary, exactly as
22+
/// it does for TimeDeadMap.
23+
24+
#ifndef ITSMFT_STUCKPIXELDATA_H
25+
#define ITSMFT_STUCKPIXELDATA_H
26+
27+
#include <vector>
28+
#include <cstdint>
29+
#include <Rtypes.h> // ClassDefNV
30+
31+
namespace o2
32+
{
33+
namespace itsmft
34+
{
35+
36+
/// One stuck-pixel (RepeatingPixel error) record.
37+
struct StuckPixelEntry {
38+
Long64_t orbit{0}; ///< first orbit of the TF in which the error was seen
39+
uint16_t chipID{0}; ///< global chip ID (ITS only)
40+
uint16_t row{0}; ///< pixel row
41+
uint16_t col{0}; ///< pixel column
42+
43+
StuckPixelEntry() = default;
44+
StuckPixelEntry(Long64_t o, uint16_t c, uint16_t r, uint16_t col_)
45+
: orbit(o), chipID(c), row(r), col(col_) {}
46+
47+
ClassDefNV(StuckPixelEntry, 1);
48+
};
49+
50+
/// CCDB payload object: a run-level collection of stuck-pixel records.
51+
class StuckPixelData
52+
{
53+
public:
54+
StuckPixelData() = default;
55+
~StuckPixelData() = default;
56+
57+
void addEntry(Long64_t orbit, uint16_t chipID, uint16_t row, uint16_t col)
58+
{
59+
mEntries.emplace_back(orbit, chipID, row, col);
60+
}
61+
62+
void clear() { mEntries.clear(); }
63+
64+
const std::vector<StuckPixelEntry>& getEntries() const { return mEntries; }
65+
std::size_t size() const { return mEntries.size(); }
66+
bool empty() const { return mEntries.empty(); }
67+
68+
private:
69+
std::vector<StuckPixelEntry> mEntries;
70+
71+
ClassDefNV(StuckPixelData, 1);
72+
};
73+
74+
} // namespace itsmft
75+
} // namespace o2
76+
77+
#endif // ITSMFT_STUCKPIXELDATA_H

DataFormats/Detectors/ITSMFT/common/src/ITSMFTDataFormatsLinkDef.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
#pragma link C++ class o2::itsmft::Digit + ;
2424
#pragma link C++ class o2::itsmft::NoiseMap + ;
2525
#pragma link C++ class o2::itsmft::TimeDeadMap + ;
26+
#pragma link C++ class o2::itsmft::StuckPixelEntry + ;
27+
#pragma link C++ class std::vector < o2::itsmft::StuckPixelEntry> + ;
28+
#pragma link C++ class o2::itsmft::StuckPixelData + ;
2629
#pragma link C++ class std::vector < o2::itsmft::Digit> + ;
2730

2831
#pragma link C++ class o2::itsmft::GBTCalibData + ;

Detectors/ITSMFT/common/workflow/include/ITSMFTWorkflow/DeadMapBuilderSpec.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
#include <ITSMFTReconstruction/RawPixelDecoder.h> //o2::itsmft::RawPixelDecoder
4545
#include "DataFormatsITSMFT/TimeDeadMap.h"
46+
#include "DataFormatsITSMFT/StuckPixelData.h"
4647
#include "DetectorsCalibration/Utils.h"
4748
#include "DetectorsCommonDataFormats/FileMetaData.h"
4849
#include "DetectorsBase/GRPGeomHelper.h"
@@ -132,6 +133,16 @@ class ITSMFTDeadMapBuilder : public Task
132133

133134
// Flag to avoid that endOfStream and stop are both done
134135
bool isEnded = false;
136+
137+
// Stuck pixel related members
138+
bool mDoStuckPixels = false;
139+
std::string mStuckPixelFileName = "";
140+
o2::itsmft::StuckPixelData mStuckPixelData;
141+
142+
Long64_t mErrOrbit = 0;
143+
UShort_t mErrChipID = 0;
144+
UShort_t mErrRow = 0;
145+
UShort_t mErrCol = 0;
135146
};
136147

137148
// Create a processor spec

0 commit comments

Comments
 (0)