Skip to content

Commit 0e1c898

Browse files
author
jryu
committed
Add ITS stuck-pixel CCDB object output
1 parent ab643bf commit 0e1c898

4 files changed

Lines changed: 300 additions & 84 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

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,19 @@ class ITSMFTDeadMapBuilder : public Task
132132

133133
// Flag to avoid that endOfStream and stop are both done
134134
bool isEnded = false;
135+
<<<<<<< HEAD
136+
=======
137+
138+
std::string mStuckPixelFileName = "";
139+
140+
TTree* mErrorTree = nullptr;
141+
Long64_t mErrOrbit = 0;
142+
UShort_t mErrChipID = 0;
143+
UShort_t mErrRow = 0;
144+
UShort_t mErrCol = 0;
145+
>>>>>>> 5df4d36ff6 (Add ITS stuck-pixel CCDB object output)
135146
};
136-
147+
6
137148
// Create a processor spec
138149
o2::framework::DataProcessorSpec getITSMFTDeadMapBuilderSpec(std::string datasource, bool doMFT);
139150

0 commit comments

Comments
 (0)