Project
Loading...
Searching...
No Matches
FeeParam.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 O2_TRD_FEEPARAM_H
13#define O2_TRD_FEEPARAM_H
14
15
17// //
18// TRD front end electronics parameters class //
19// Contains all FEE (MCM, TRAP, PASA) related //
20// parameters, constants, and mapping. //
21// //
22// Author: //
23// Ken Oyama (oyama@physi.uni-heidelberg.de) //
24// Merging LTUParam in here for Run3 //
25// TrapChip configs remain inside the TrapConfig class reflecting //
26// the real memory structure of the TRAP (Jochen and a tiny bit of Sean) //
27// //
29
31#include "Rtypes.h"
32#include <array>
33#include <vector>
34
35
36namespace o2
37{
38namespace trd
39{
40//_____________________________________________________________________________
42{
43
44 public:
45 ~FeeParam() = default;
46 FeeParam(const FeeParam&) = delete;
47 FeeParam& operator=(const FeeParam&) = delete;
48
49 static FeeParam* instance(); // Singleton
50
51 // Translation from MCM to Pad and vice versa
52 static int getPadRowFromMCM(int irob, int imcm);
53 static int getPadColFromADC(int irob, int imcm, int iadc);
54 static int getExtendedPadColFromADC(int irob, int imcm, int iadc);
55 static int getMCMfromPad(int irow, int icol);
56 static int getMCMfromSharedPad(int irow, int icol);
57 static int getROBfromPad(int irow, int icol);
58 static int getROBfromSharedPad(int irow, int icol);
59 static int getROBSide(int irob);
60 static int getColSide(int icol);
61
62 // SCSN-related
63 static unsigned int aliToExtAli(int rob, int aliid); // Converts the MCM-ROB combination to the extended MCM ALICE ID (used to address MCMs on the SCSN Bus)
64 static int extAliToAli(unsigned int dest, unsigned short linkpair, unsigned short rocType, int* list, int listSize); // translates an extended MCM ALICE ID to a list of MCMs
65 static short chipmaskToMCMlist(unsigned int cmA, unsigned int cmB, unsigned short linkpair, int* mcmList, int listSize);
66 static short getRobAB(unsigned short robsel, unsigned short linkpair); // Returns the chamber side (A=0, B=0) of a ROB
67
68 // wiring
69 static int getORI(int detector, int readoutboard);
70 static void unpackORI(int link, int side, int& stack, int& layer, int& halfchamberside);
71 // void createORILookUpTable();
72
73 // tracklet simulation
74 bool getTracklet() const { return mTracklet; }
75 void setTracklet(bool trackletSim = true) { mTracklet = trackletSim; }
76 bool getRejectMultipleTracklets() const { return mRejectMultipleTracklets; }
77 void setRejectMultipleTracklets(bool rej = true) { mRejectMultipleTracklets = rej; }
78 bool getUseMisalignCorr() const { return mUseMisalignCorr; }
79 void setUseMisalignCorr(bool misalign = true) { mUseMisalignCorr = misalign; }
80 bool getUseTimeOffset() const { return mUseTimeOffset; }
81 void setUseTimeOffset(bool timeOffset = true) { mUseTimeOffset = timeOffset; }
82
83 // Concerning raw data format
84 int getRAWversion() const { return mRAWversion; }
85 void setRAWversion(int rawver);
86
87 short padMcmLUT(int index) { return mLUTPadNumbering[index]; }
88
89 // configuration settings
90 // called with special SCSN commands
91 void setPtMin(int data)
92 {
93 mPtMin = float(data) / 1000.;
94 mInvPtMin = 1 / mPtMin;
95 }
96 void setMagField(int data) { mMagField = float(data) / 1000.; }
97 void setOmegaTau(int data) { mOmegaTau = float(data) / 1.e6; }
98 void setNtimebins(int data) { mNtimebins = data; }
99 void setScaleQ0(int data) { mScaleQ0 = data; }
100 void setScaleQ1(int data) { mScaleQ1 = data; }
101 void setLengthCorrectionEnable(int data) { mPidTracklengthCorr = bool(data); }
102 void setTiltCorrectionEnable(int data) { mTiltCorr = bool(data); }
103 void setPIDgainCorrectionEnable(bool data) { mPidGainCorr = data; }
104
105 // set values directly
106 void setRawPtMin(float data) { mPtMin = data; }
107 void setRawMagField(float data) { mMagField = data; }
108 void setRawOmegaTau(float data) { mOmegaTau = data; }
109 void setRawNtimebins(int data) { mNtimebins = data; }
110 void setRawScaleQ0(int data) { mScaleQ0 = data; }
111 void setRawScaleQ1(int data) { mScaleQ1 = data; }
112 void setRawLengthCorrectionEnable(bool data) { mPidTracklengthCorr = data; }
113 void setRawTiltCorrectionEnable(bool data) { mTiltCorr = data; }
114 void setRawPIDgainCorrectionEnable(bool data) { mPidGainCorr = data; }
115
116 // retrieve the calculated information
117 // which is written to the TRAPs
118 int getDyCorrection(int det, int rob, int mcm) const;
119 void getDyRange(int det, int rob, int mcm, int ch, int& dyMinInt, int& dyMaxInt) const;
120 void getCorrectionFactors(int det, int rob, int mcm, int ch,
121 unsigned int& cor0, unsigned int& cor1, float gain = 1.) const;
122 int getNtimebins() const;
123
124 float getX(int det, int rob, int mcm) const;
125 float getLocalY(int det, int rob, int mcm, int ch) const;
126 float getLocalZ(int det, int rob, int mcm) const;
127
128 float getDist(int det, int rob, int mcm, int ch) const;
129 float getElongation(int det, int rob, int mcm, int) const;
130 float getPhi(int det, int rob, int mcm, int ch) const;
131 float getPerp(int det, int rob, int mcm, int ch) const;
132
133 private:
134 static FeeParam* mgInstance; // Singleton instance
135
136 std::array<short, constants::NCOLUMN> mLUTPadNumbering; // Lookup table mapping Pad to MCM
137
138 void fillPad2MCMLookUpTable();
139
140 // Tracklet processing on/off
141 bool mTracklet{true}; // tracklet processing
142 bool mRejectMultipleTracklets{false}; // only accept best tracklet if found more than once
143 bool mUseMisalignCorr{false}; // add correction for mis-alignment in y
144 bool mUseTimeOffset{false}; // add time offset in calculation of fit sums
145
146 // For raw production
147 int mRAWversion{3}; // Raw data production version
148 const int mkMaxRAWversion = 3; // Maximum raw version number supported
149
150 // geometry constants
151 std::array<float, constants::NCHAMBERPERSEC> mZrow{// z-position of pad row edge 6x5
152 301, 177, 53, -57, -181,
153 301, 177, 53, -57, -181,
154 315, 184, 53, -57, -188,
155 329, 191, 53, -57, -195,
156 343, 198, 53, -57, -202,
157 347, 200, 53, -57, -204};
158 std::array<float, constants::NLAYER> mX{300.65, 313.25, 325.85, 338.45, 351.05, 363.65}; // x-position for all layers
159 std::array<float, constants::NLAYER> mInvX; // inverse x-position for all layers (to remove divisions)
160 std::array<float, constants::NLAYER> mTiltingAngle{-2., 2., -2., 2., -2., 2.}; // tilting angle for every layer
161 std::array<float, constants::NLAYER> mTiltingAngleTan; // tan of tilting angle for every layer (look up table to avoid tan calculations)
162 std::array<float, constants::NLAYER> mWidthPad{0.635, 0.665, 0.695, 0.725, 0.755, 0.785}; // pad width for all layers
163 std::array<float, constants::NLAYER> mInvWidthPad; // inverse pad width for all layers (to remove divisions)
164 float mLengthInnerPadC0{9.f}; // inner pad length C0 chamber
165 float mLengthOuterPadC0{8.f}; // outer pad length C0 chamber
166 std::array<float, constants::NLAYER> mLengthInnerPadC1{7.5, 7.5, 8.0, 8.5, 9.0, 9.0}; // inner pad length C1 chambers
167 std::array<float, constants::NLAYER> mLengthOuterPadC1{7.5, 7.5, 7.5, 7.5, 7.5, 8.5}; // outer pad length C1 chambers
168 float mScalePad{256. * 32.}; // scaling factor for pad width
169 float mDriftLength{3.}; // length of the parse gaintbl Krypton_2009-01 drift region
170 // WARNING: This values for dY are valid for Run 1+2 format only
171 float mBinDy{140e-4}; // bin in dy (140 um)
172 int mDyMax{63}; // max dy for a tracklet (hard limit)
173 int mDyMin{-64}; // min dy for a tracklet (hard limit)
174 //std::array<int,30> mAsideLUT; // A side LUT to map ORI to stack/layer/side
175 //std::array<int,30> mCsideLUT; // C side LUT to map ORI to stack/layer/side
176
177 // settings
178 float mMagField{0.f}; // magnetic field
179 float mOmegaTau{0.f}; // omega tau, i.e. tan(Lorentz angle)
180 float mPtMin{.1f}; // min. pt for deflection cut
181 float mInvPtMin{1.f / mPtMin}; // min. pt for deflection cut (Inverted to remove division)
182 int mNtimebins{20 << 5}; // drift time in units of timebins << 5n
183 unsigned int mScaleQ0{0}; // scale factor for accumulated charge Q0
184 unsigned int mScaleQ1{0}; // scale factor for accumulated charge Q1
185 bool mPidTracklengthCorr{false}; // enable tracklet length correction
186 bool mTiltCorr{false}; // enable tilt correction
187 bool mPidGainCorr{false}; // enable MCM gain correction factor for PID
188
189 FeeParam();
190 ClassDefNV(FeeParam, 1);
191};
192
193} //namespace trd
194} //namespace o2
195#endif
uint16_t mcm
uint16_t rob
Global TRD definitions and constants.
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 e
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 trd
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 bool
configStandalone Reconstruction rec_tpc float
uint32_t side
Definition RawData.h:0
uint32_t stack
Definition RawData.h:1
void setTiltCorrectionEnable(int data)
Definition FeeParam.h:102
void setRawTiltCorrectionEnable(bool data)
Definition FeeParam.h:113
void setMagField(int data)
Definition FeeParam.h:96
void setScaleQ1(int data)
Definition FeeParam.h:100
void setRawScaleQ0(int data)
Definition FeeParam.h:110
static int getROBSide(int irob)
Definition FeeParam.cxx:207
bool getUseTimeOffset() const
Definition FeeParam.h:80
void setLengthCorrectionEnable(int data)
Definition FeeParam.h:101
void setScaleQ0(int data)
Definition FeeParam.h:99
int getNtimebins() const
Definition FeeParam.cxx:578
static int getPadRowFromMCM(int irob, int imcm)
Definition FeeParam.cxx:95
void setPtMin(int data)
Definition FeeParam.h:91
void setRawMagField(float data)
Definition FeeParam.h:107
void setRAWversion(int rawver)
Definition FeeParam.cxx:431
int getRAWversion() const
Definition FeeParam.h:84
static int getORI(int detector, int readoutboard)
void setRejectMultipleTracklets(bool rej=true)
Definition FeeParam.h:77
FeeParam & operator=(const FeeParam &)=delete
void setPIDgainCorrectionEnable(bool data)
Definition FeeParam.h:103
float getElongation(int det, int rob, int mcm, int) const
Definition FeeParam.cxx:543
static int getPadColFromADC(int irob, int imcm, int iadc)
Definition FeeParam.cxx:105
void getDyRange(int det, int rob, int mcm, int ch, int &dyMinInt, int &dyMaxInt) const
Definition FeeParam.cxx:485
void setTracklet(bool trackletSim=true)
Definition FeeParam.h:75
void setRawPIDgainCorrectionEnable(bool data)
Definition FeeParam.h:114
void setRawNtimebins(int data)
Definition FeeParam.h:109
static int getROBfromPad(int irow, int icol)
Definition FeeParam.cxx:184
void getCorrectionFactors(int det, int rob, int mcm, int ch, unsigned int &cor0, unsigned int &cor1, float gain=1.) const
Definition FeeParam.cxx:559
void setOmegaTau(int data)
Definition FeeParam.h:97
static int getExtendedPadColFromADC(int irob, int imcm, int iadc)
Definition FeeParam.cxx:124
float getLocalY(int det, int rob, int mcm, int ch) const
Definition FeeParam.cxx:593
static int getMCMfromSharedPad(int irow, int icol)
Definition FeeParam.cxx:153
void setRawScaleQ1(int data)
Definition FeeParam.h:111
float getX(int det, int rob, int mcm) const
Definition FeeParam.cxx:585
void setRawLengthCorrectionEnable(bool data)
Definition FeeParam.h:112
static short getRobAB(unsigned short robsel, unsigned short linkpair)
Definition FeeParam.cxx:316
void setRawPtMin(float data)
Definition FeeParam.h:106
static int extAliToAli(unsigned int dest, unsigned short linkpair, unsigned short rocType, int *list, int listSize)
Definition FeeParam.cxx:234
FeeParam(const FeeParam &)=delete
static short chipmaskToMCMlist(unsigned int cmA, unsigned int cmB, unsigned short linkpair, int *mcmList, int listSize)
Definition FeeParam.cxx:409
static unsigned int aliToExtAli(int rob, int aliid)
Definition FeeParam.cxx:225
short padMcmLUT(int index)
Definition FeeParam.h:87
float getDist(int det, int rob, int mcm, int ch) const
Definition FeeParam.cxx:647
void setRawOmegaTau(float data)
Definition FeeParam.h:108
static FeeParam * instance()
Definition FeeParam.cxx:58
void setNtimebins(int data)
Definition FeeParam.h:98
void setUseMisalignCorr(bool misalign=true)
Definition FeeParam.h:79
float getPerp(int det, int rob, int mcm, int ch) const
Definition FeeParam.cxx:630
static int getColSide(int icol)
Definition FeeParam.cxx:216
~FeeParam()=default
static void unpackORI(int link, int side, int &stack, int &layer, int &halfchamberside)
Definition FeeParam.cxx:391
static int getMCMfromPad(int irow, int icol)
Definition FeeParam.cxx:142
bool getUseMisalignCorr() const
Definition FeeParam.h:78
int getDyCorrection(int det, int rob, int mcm) const
Definition FeeParam.cxx:465
bool getTracklet() const
Definition FeeParam.h:74
float getLocalZ(int det, int rob, int mcm) const
Definition FeeParam.cxx:603
void setUseTimeOffset(bool timeOffset=true)
Definition FeeParam.h:81
bool getRejectMultipleTracklets() const
Definition FeeParam.h:76
static int getROBfromSharedPad(int irow, int icol)
Definition FeeParam.cxx:193
float getPhi(int det, int rob, int mcm, int ch) const
Definition FeeParam.cxx:640
GLuint index
Definition glcorearb.h:781
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...