Project
Loading...
Searching...
No Matches
DigitDump.h
Go to the documentation of this file.
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#ifndef ALICEO2_TPC_DIGITDUMP_H_
13#define ALICEO2_TPC_DIGITDUMP_H_
14
17
18#include <string>
19#include <vector>
20#include <array>
21#include <algorithm>
22#include <memory>
23
24#include "Rtypes.h"
25#include "TFile.h"
26
27#include "DataFormatsTPC/Defs.h"
28#include "TPCBase/CalDet.h"
29#include "TPCBase/CRU.h"
30#include "TPCBase/Sector.h"
33
34class TTree;
35
36namespace o2
37{
38namespace tpc
39{
40
47
48class DigitDump : public CalibRawBase
49{
50 public:
52 DigitDump(PadSubset padSubset = PadSubset::ROC) : CalibRawBase(padSubset) {}
53
55 void setDigitFileName(std::string_view fileName) { mDigitFile = fileName; }
56
58 void setPedestalAndNoiseFile(std::string_view fileName) { mPedestalAndNoiseFile = fileName; }
59
61 ~DigitDump() override;
62
64 void init();
65
73 Int_t updateROC(const Int_t roc, const Int_t row, const Int_t pad,
74 const Int_t timeBin, const Float_t signal) final { return 0; }
75
77 Int_t updateCRU(const CRU& cru, const Int_t row, const Int_t pad,
78 const Int_t timeBin, const Float_t signal) final;
79
81 void setPedestals(const CalPad* pedestal) { mPedestal.reset(pedestal); }
82
84 void setNoise(const CalPad* noise) { mNoise.reset(noise); }
85
89 const CalPad& getPedestal() const { return *mPedestal.get(); }
90
94 const CalPad& getNoise() const { return *mNoise.get(); }
95
97 void addPadMask(int roc, int row, int pad) { mPadMask.push_back({roc, row, pad}); }
98
100 void setNoiseThreshold(float noiseThreshold) { mNoiseThreshold = noiseThreshold; }
101
103 void setADCRange(float minADC, float maxADC)
104 {
105 mADCMin = minADC;
106 mADCMax = maxADC;
107 }
108
110 void setTimeBinRange(int first, int last)
111 {
112 mFirstTimeBin = first;
113 mLastTimeBin = last;
114 }
115
117 void sortDigits();
118
121 {
122 for (auto& digits : mDigits) {
123 digits.clear();
124 }
125
126 std::fill(mTimeBinOccupancy.begin(), mTimeBinOccupancy.end(), 0);
127 }
128
130 void setInMemoryOnly(bool mode = true) { mInMemoryOnly = mode; }
131
133 bool getInMemoryMode() const { return mInMemoryOnly; }
134
136 std::vector<Digit>& getDigits(int sector) { return mDigits[sector]; }
137
139 const auto& getDigits() const { return mDigits; }
140 auto& getDigits() { return mDigits; }
141
143 void addDigit(const CRU& cru, const float signal, const int rowInSector, const int padInRow, const int timeBin)
144 {
145 mDigits[cru.sector()].emplace_back(cru, signal, rowInSector, padInRow, timeBin);
146 }
147
149 void initInputOutput();
150
152 void endEvent() final;
153
156
158 void removeCEdigits(uint32_t removeNtimeBinsBefore = 10, uint32_t removeNtimeBinsAfter = 100, std::array<std::vector<Digit>, Sector::MAXSECTOR>* removedDigits = nullptr);
159
160 private:
161 std::unique_ptr<const CalPad> mPedestal{};
162 std::unique_ptr<const CalPad> mNoise{};
163
164 TTree* mTree{nullptr};
165 std::unique_ptr<TFile> mFile{};
166
167 std::array<std::vector<Digit>, Sector::MAXSECTOR> mDigits;
168 std::string mDigitFile{};
169 std::string mPedestalAndNoiseFile{};
170
171 std::vector<std::array<int, 3>> mPadMask;
172
173 std::vector<size_t> mTimeBinOccupancy;
174
175 int mFirstTimeBin{0};
176 int mLastTimeBin{1000};
177 float mADCMin{-100};
178 float mADCMax{1024};
179 float mNoiseThreshold{-1};
180 bool mInMemoryOnly{false};
181 bool mInitialized{false};
182
184 void setupOutputTree();
185
187 void loadNoiseAndPedestal();
188
190 void resetEvent() final {}
191};
192
193} // namespace tpc
194
195} // namespace o2
196#endif
Definition of the TPC Digit.
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual sector
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions false
uint32_t roc
Definition RawData.h:3
const Sector sector() const
Definition CRU.h:65
Base class for raw data calibrations.
Pedestal calibration class.
Definition DigitDump.h:49
void clearDigits()
clear the digits
Definition DigitDump.h:120
Int_t updateROC(const Int_t roc, const Int_t row, const Int_t pad, const Int_t timeBin, const Float_t signal) final
Definition DigitDump.h:73
void setTimeBinRange(int first, int last)
set the timeBin range
Definition DigitDump.h:110
void checkDuplicates(bool removeDuplicates=false)
check duplicates and remove the if removeDuplicates is true
void addPadMask(int roc, int row, int pad)
add a masked pad
Definition DigitDump.h:97
void sortDigits()
sort the digits
const CalPad & getPedestal() const
Definition DigitDump.h:89
void removeCEdigits(uint32_t removeNtimeBinsBefore=10, uint32_t removeNtimeBinsAfter=100, std::array< std::vector< Digit >, Sector::MAXSECTOR > *removedDigits=nullptr)
remove digits close to the CE
void setPedestals(const CalPad *pedestal)
Set a custom pedestal object.
Definition DigitDump.h:81
void addDigit(const CRU &cru, const float signal, const int rowInSector, const int padInRow, const int timeBin)
directly add a digit
Definition DigitDump.h:143
void endEvent() final
End event function.
void initInputOutput()
initialize
void init()
initialize DigitDump from DigitDumpParam
Definition DigitDump.cxx:37
std::vector< Digit > & getDigits(int sector)
return digits for specific sector
Definition DigitDump.h:136
void setPedestalAndNoiseFile(std::string_view fileName)
pedestal file name
Definition DigitDump.h:58
void setInMemoryOnly(bool mode=true)
set in memory only mode
Definition DigitDump.h:130
const auto & getDigits() const
return digit array
Definition DigitDump.h:139
void setADCRange(float minADC, float maxADC)
set the adc range
Definition DigitDump.h:103
bool getInMemoryMode() const
get in memory mode
Definition DigitDump.h:133
void setDigitFileName(std::string_view fileName)
output file name
Definition DigitDump.h:55
void setNoiseThreshold(float noiseThreshold)
set noise threshold
Definition DigitDump.h:100
void setNoise(const CalPad *noise)
Set a custom noise object.
Definition DigitDump.h:84
Int_t updateCRU(const CRU &cru, const Int_t row, const Int_t pad, const Int_t timeBin, const Float_t signal) final
not used
Definition DigitDump.cxx:56
~DigitDump() override
default destructor
Definition DigitDump.cxx:29
DigitDump(PadSubset padSubset=PadSubset::ROC)
default constructor
Definition DigitDump.h:52
const CalPad & getNoise() const
Definition DigitDump.h:94
static constexpr int MAXSECTOR
Definition Sector.h:44
void removeDuplicates(std::vector< int > &vec)
GLenum mode
Definition glcorearb.h:266
GLint first
Definition glcorearb.h:399
PadSubset
Definition of the different pad subsets.
Definition Defs.h:65
@ ROC
ROCs (up to 72)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< Digit > digits
std::vector< int > row