Project
Loading...
Searching...
No Matches
NoiseCalibrator.cxx
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
13
15
16#include <fairlogger/Logger.h>
17#include "TFile.h"
22
23namespace o2
24{
25namespace mft
26{
28 gsl::span<const o2::itsmft::Digit> const& digits,
29 gsl::span<const o2::itsmft::ROFRecord> const& rofs)
30{
31 static int nTF = 0;
32 LOG(detail) << "Processing TF# " << nTF++;
33
34 for (const auto& rof : rofs) {
35 auto digitsInFrame = rof.getROFData(digits);
36 for (const auto& d : digitsInFrame) {
37 auto id = d.getChipIndex();
38 auto row = d.getRow();
39 auto col = d.getColumn();
40
41 mNoiseMap.increaseNoiseCount(id, row, col);
42 }
43 }
44 mNumberOfStrobes += rofs.size();
45 return (mNumberOfStrobes > mMinROFs) ? true : false;
46}
47
49 gsl::span<const o2::itsmft::CompClusterExt> const& clusters,
50 gsl::span<const unsigned char> const& patterns,
51 gsl::span<const o2::itsmft::ROFRecord> const& rofs)
52{
53 static int nTF = 0;
54 LOG(detail) << "Processing TF# " << nTF++;
55
56 auto pattIt = patterns.begin();
57 for (const auto& rof : rofs) {
58 auto clustersInFrame = rof.getROFData(clusters);
59 for (const auto& c : clustersInFrame) {
60 auto pattID = c.getPatternID();
62 auto row = c.getRow();
63 auto col = c.getCol();
64 if (mDict->getSize() == 0) {
66 patt.acquirePattern(pattIt);
67 } else {
68 LOG(fatal) << "Clusters contain pattern IDs, but no dictionary is provided...";
69 }
70 } else if (pattID == o2::itsmft::CompCluster::InvalidPatternID) {
71 patt.acquirePattern(pattIt);
72 } else if (mDict->isGroup(pattID)) {
73 patt.acquirePattern(pattIt);
74 float xCOG = 0., zCOG = 0.;
75 patt.getCOG(xCOG, zCOG); // for grouped patterns the reference pixel is at COG
76 row -= round(xCOG);
77 col -= round(zCOG);
78 } else {
79 patt = mDict->getPattern(pattID);
80 }
81 auto id = c.getSensorID();
82 auto colSpan = patt.getColumnSpan();
83 auto rowSpan = patt.getRowSpan();
84
85 // Fast 1-pixel calibration
86 if ((rowSpan == 1) && (colSpan == 1)) {
87 mNoiseMap.increaseNoiseCount(id, row, col);
88 continue;
89 }
90
91 // All-pixel calibration
92 auto nBits = rowSpan * colSpan;
93 int ic = 0, ir = 0;
94 for (unsigned int i = 2; i < patt.getUsedBytes() + 2; i++) {
95 unsigned char tempChar = patt.getByte(i);
96 int s = 128; // 0b10000000
97 while (s > 0) {
98 if ((tempChar & s) != 0) {
99 mNoiseMap.increaseNoiseCount(id, row + ir, col + ic);
100 }
101 ic++;
102 s >>= 1;
103 if ((ir + 1) * ic == nBits) {
104 break;
105 }
106 if (ic == colSpan) {
107 ic = 0;
108 ir++;
109 }
110 }
111 if ((ir + 1) * ic == nBits) {
112 break;
113 }
114 }
115 }
116 }
117 mNumberOfStrobes += rofs.size();
118 return (mNumberOfStrobes > mMinROFs) ? true : false;
119}
120
122{
123 LOG(info) << "Number of processed strobes is " << mNumberOfStrobes;
124 mNoiseMap.applyProbThreshold(mProbabilityThreshold, mNumberOfStrobes);
125 mNoiseMap.print();
126}
127
128} // namespace mft
129} // namespace o2
Definition of the ITSMFT compact cluster.
Definition of the ITSMFT digit.
int32_t i
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events d
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 true
Definition of the ITSMFT ROFrame (trigger) record.
uint32_t col
Definition RawData.h:4
uint32_t c
Definition RawData.h:2
int getRowSpan() const
Returns the number of rows.
void acquirePattern(iterator &pattIt)
int getColumnSpan() const
Returns the number of columns.
static int getCOG(int rowSpan, int colSpan, const unsigned char patt[MaxPatternBytes], float &xCOG, float &zCOG)
Static: Compute pattern's COG position. Returns the number of fired pixels.
unsigned char getByte(int n) const
Returns a specific byte of the pattern.
int getUsedBytes() const
Returns the number of bytes used for the pattern.
static constexpr unsigned short InvalidPatternID
Definition CompCluster.h:46
void increaseNoiseCount(int chip, int row, int col)
Definition NoiseMap.h:66
void applyProbThreshold(float t, long int n, float relErr=0.2f, int minChipID=0, int maxChipID=24119)
Definition NoiseMap.h:105
int getSize() const
Returns the number of elements in the dicionary;.
const ClusterPattern & getPattern(int n) const
Returns the pattern of the topology.
bool isGroup(int n) const
Returns true if the element corresponds to a group of rare topologies.
bool processTimeFrame(calibration::TFType tf, gsl::span< const o2::itsmft::Digit > const &digits, gsl::span< const o2::itsmft::ROFRecord > const &rofs)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::unique_ptr< GPUReconstructionTimeframe > tf
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
o2::InteractionRecord ir(0, 0)
std::vector< Cluster > clusters
std::vector< Digit > digits
std::vector< int > row