Project
Loading...
Searching...
No Matches
IDCSim.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
16
17#ifndef ALICEO2_TPC_IDCSIM_H_
18#define ALICEO2_TPC_IDCSIM_H_
19
20#include <vector>
21#include <array>
24#include "TPCBase/Mapper.h"
25#include <gsl/span>
26#include "Rtypes.h"
27
28namespace o2::utils
29{
30class TreeStreamRedirector;
31}
32
33namespace o2::tpc
34{
35
36class Digit;
37
42
43class IDCSim
44{
45 public:
49 IDCSim(const unsigned int sector = 0, const unsigned int nOrbits = 12) : mSector{sector}, mNOrbits{nOrbits} {}
50
51 // integrate IDCs for one TF
53 void integrateDigitsForOneTF(const gsl::span<const o2::tpc::Digit>& digits);
54
57 static void setNOrbitsPerTF(const unsigned int nOrbitsPerTF) { mOrbitsPerTF = nOrbitsPerTF; }
58
61 void dumpIDCs(const char* outFileName, const char* outName = "IDCSim") const;
62
65 void createDebugTree(const char* nameTree) const;
66
70 static void createDebugTreeForAllSectors(const char* nameTree, const char* filename);
71
73 const auto& get() const { return mIDCs[!mBufferIndex]; }
74
76 unsigned int getSector() const { return mSector; }
77
79 static unsigned int getNOrbitsPerTF() { return mOrbitsPerTF; }
80
82 unsigned int getNOrbitsPerIntegrationInterval() const { return mNOrbits; }
83
85 unsigned int getNTimeStampsPerIntegrationInterval() const { return mTimeStampsPerIntegrationInterval; }
86
88 bool additionalInterval() const { return mAddInterval; }
89
91 unsigned int getNIntegrationIntervalsPerTF() const { return mIntegrationIntervalsPerTF; }
92
94 unsigned int getNTimeStampsRemainder() const { return mTimeStampsRemainder; }
95
97 int getTimeBinsOff() const { return mTimeBinsOff; }
98
102 void drawIDCs(const unsigned int integrationInterval = 0, const std::string filename = "IDCs.pdf") const;
103
105 unsigned int getMaxIDCs(const unsigned int region) const { return mMaxIDCs[region]; }
106
107 private:
108 inline static unsigned int mOrbitsPerTF{256};
109 const unsigned int mSector{};
110 const unsigned int mNOrbits{12};
111 const unsigned int mTimeStampsPerIntegrationInterval{(o2::constants::lhc::LHCMaxBunches * mNOrbits) / o2::tpc::constants::LHCBCPERTIMEBIN};
112 const bool mAddInterval{(mOrbitsPerTF % mNOrbits) > 0 ? true : false};
113 const unsigned int mIntegrationIntervalsPerTF{mOrbitsPerTF / mNOrbits + mAddInterval};
114 const unsigned int mTimeStampsRemainder{mTimeStampsPerIntegrationInterval * (mOrbitsPerTF % mNOrbits) / mNOrbits};
115 int mTimeBinsOff{};
116 bool mBufferIndex{false};
117 const std::array<unsigned int, Mapper::NREGIONS> mMaxIDCs{
118 Mapper::PADSPERREGION[0] * mIntegrationIntervalsPerTF, // region 0
119 Mapper::PADSPERREGION[1] * mIntegrationIntervalsPerTF, // region 1
120 Mapper::PADSPERREGION[2] * mIntegrationIntervalsPerTF, // region 2
121 Mapper::PADSPERREGION[3] * mIntegrationIntervalsPerTF, // region 3
122 Mapper::PADSPERREGION[4] * mIntegrationIntervalsPerTF, // region 4
123 Mapper::PADSPERREGION[5] * mIntegrationIntervalsPerTF, // region 5
124 Mapper::PADSPERREGION[6] * mIntegrationIntervalsPerTF, // region 6
125 Mapper::PADSPERREGION[7] * mIntegrationIntervalsPerTF, // region 7
126 Mapper::PADSPERREGION[8] * mIntegrationIntervalsPerTF, // region 8
127 Mapper::PADSPERREGION[9] * mIntegrationIntervalsPerTF // region 9
128 };
129 std::array<std::vector<float>, Mapper::NREGIONS> mIDCs[2]{
130 {std::vector<float>(mMaxIDCs[0]), // region 0
131 std::vector<float>(mMaxIDCs[1]), // region 1
132 std::vector<float>(mMaxIDCs[2]), // region 2
133 std::vector<float>(mMaxIDCs[3]), // region 3
134 std::vector<float>(mMaxIDCs[4]), // region 4
135 std::vector<float>(mMaxIDCs[5]), // region 5
136 std::vector<float>(mMaxIDCs[6]), // region 6
137 std::vector<float>(mMaxIDCs[7]), // region 7
138 std::vector<float>(mMaxIDCs[8]), // region 8
139 std::vector<float>(mMaxIDCs[9])}, // region 9
140 {std::vector<float>(mMaxIDCs[0]), // region 0
141 std::vector<float>(mMaxIDCs[1]), // region 1
142 std::vector<float>(mMaxIDCs[2]), // region 2
143 std::vector<float>(mMaxIDCs[3]), // region 3
144 std::vector<float>(mMaxIDCs[4]), // region 4
145 std::vector<float>(mMaxIDCs[5]), // region 5
146 std::vector<float>(mMaxIDCs[6]), // region 6
147 std::vector<float>(mMaxIDCs[7]), // region 7
148 std::vector<float>(mMaxIDCs[8]), // region 8
149 std::vector<float>(mMaxIDCs[9])} // region 9
150 };
151
153 unsigned int getLastTimeBinForSwitch() const;
154
155 // set offset for the next time frame
156 void setNewOffset();
157
159 void resetIDCs();
160
162 unsigned int getOrbit(const unsigned int timeStamp) const { return static_cast<unsigned int>((timeStamp + mTimeBinsOff) / mTimeStampsPerIntegrationInterval); }
163
169 unsigned int getIndex(const unsigned int timeStamp, const unsigned int region, const unsigned int row, const unsigned int pad) const { return getOrbit(timeStamp) * Mapper::PADSPERREGION[region] + Mapper::getLocalPadNumber(row, pad); }
170
171 static void createDebugTree(const IDCSim& idcsim, o2::utils::TreeStreamRedirector& pcstream);
172
173 ClassDefNV(IDCSim, 1)
174};
175
176} // namespace o2::tpc
177
178#endif
uint32_t getOrbit() const
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
Header to collect LHC related constants.
static unsigned int getNOrbitsPerTF()
Definition IDCSim.h:79
bool additionalInterval() const
Definition IDCSim.h:88
IDCSim(const unsigned int sector=0, const unsigned int nOrbits=12)
Definition IDCSim.h:49
static void setNOrbitsPerTF(const unsigned int nOrbitsPerTF)
Definition IDCSim.h:57
void createDebugTree(const char *nameTree) const
Definition IDCSim.cxx:95
unsigned int getMaxIDCs(const unsigned int region) const
Definition IDCSim.h:105
unsigned int getNIntegrationIntervalsPerTF() const
Definition IDCSim.h:91
const auto & get() const
Definition IDCSim.h:73
unsigned int getNTimeStampsPerIntegrationInterval() const
Definition IDCSim.h:85
unsigned int getNTimeStampsRemainder() const
Definition IDCSim.h:94
int getTimeBinsOff() const
Definition IDCSim.h:97
unsigned int getNOrbitsPerIntegrationInterval() const
Definition IDCSim.h:82
unsigned int getSector() const
Definition IDCSim.h:76
void integrateDigitsForOneTF(const gsl::span< const o2::tpc::Digit > &digits)
Definition IDCSim.cxx:25
void dumpIDCs(const char *outFileName, const char *outName="IDCSim") const
Definition IDCSim.cxx:88
void drawIDCs(const unsigned int integrationInterval=0, const std::string filename="IDCs.pdf") const
Definition IDCSim.cxx:180
static void createDebugTreeForAllSectors(const char *nameTree, const char *filename)
Definition IDCSim.cxx:103
static constexpr unsigned int NREGIONS
total number of regions in one sector
Definition Mapper.h:527
static constexpr unsigned int PADSPERREGION[NREGIONS]
number of pads per CRU
Definition Mapper.h:530
static unsigned int getLocalPadNumber(const unsigned int row, const unsigned int pad)
Definition Mapper.h:69
o2::cpv::Digit Digit
Global TPC definitions and constants.
std::string filename()
std::vector< Digit > digits
std::vector< int > row