140 const std::vector<o2::dataformats::GlobalFwdTrack>&
getMatchedFwdTracks()
const {
return mMatchedTracks; }
143 const std::vector<o2::dataformats::MatchInfoFwd>&
getMFTMCHMatchInfo()
const {
return mMatchingInfo; }
144 const std::vector<o2::MCCompLabel>&
getMatchLabels()
const {
return mMatchLabels; }
152 void updateTimeDependentParams();
153 void fillBuiltinFunctions();
155 bool prepareMCHData();
156 bool prepareMFTData();
157 bool processMCHMIDMatches();
159 template <
int saveMode>
167 template <
int saveMode>
168 void ROFMatch(
int MFTROFId,
int firstMCHROFId,
int lastMCHROFId);
174 void setMFTRadLength(
float MFT_x2X0) { mMFTDiskThicknessInX0 = MFT_x2X0 / 5.0; }
175 void setAlignResiduals(
Float_t res) { mAlignResidual =
res; }
177 template <
typename T>
178 bool propagateToNextClusterWithMCS(T& track,
double z,
int& startingLayerID,
const int& newLayerID)
184 if (startingLayerID == newLayerID) {
185 LOG(
debug) <<
" => Propagate to next cluster with MCS : startingLayerID = " << startingLayerID <<
" = > "
186 <<
" newLayerID = " << newLayerID <<
" (NLayers = " << std::abs(newLayerID - startingLayerID)
187 <<
") ; track.getZ() = " << track.getZ() <<
" => "
188 <<
"destination cluster z = " <<
z <<
" ; => Same layer: no MCS effects.";
190 if (
z != track.getZ()) {
191 track.propagateToZ(
z, mBz);
197 auto startingZ =
track.getZ();
200 auto signum = [](
auto a) {
201 return (0 <
a) - (
a < 0);
203 int direction = signum(newLayerID - startingLayerID);
204 auto currentLayer = startingLayerID;
206 LOG(
debug) <<
" => Propagate to next cluster with MCS : startingLayerID = " << startingLayerID <<
" = > "
207 <<
" newLayerID = " << newLayerID <<
" (NLayers = " << std::abs(newLayerID - startingLayerID)
208 <<
") ; track.getZ() = " <<
track.getZ() <<
" => "
209 <<
"destination cluster z = " <<
z <<
" ; ";
212 while (currentLayer != newLayerID) {
213 auto nextlayer = currentLayer +
direction;
217 if (nextZ -
track.getZ() > 0) {
218 NDisksMS = (currentLayer % 2 == 0) ? (currentLayer - nextlayer) / 2 : (currentLayer - nextlayer + 1) / 2;
220 NDisksMS = (currentLayer % 2 == 0) ? (nextlayer - currentLayer + 1) / 2 : (nextlayer - currentLayer) / 2;
223 LOG(
debug) <<
"currentLayer = " << currentLayer <<
" ; "
224 <<
"nextlayer = " << nextlayer <<
" ; "
225 <<
"track.getZ() = " <<
track.getZ() <<
" ; "
226 <<
"nextZ = " << nextZ <<
" ; "
227 <<
"NDisksMS = " << NDisksMS;
229 if ((NDisksMS * mMFTDiskThicknessInX0) != 0) {
230 track.addMCSEffect(NDisksMS * mMFTDiskThicknessInX0);
231 LOG(
debug) <<
"Track covariances after MCS effects:";
235 LOG(
debug) <<
" BeforeExtrap: X = " <<
track.getX() <<
" Y = " <<
track.getY() <<
" Z = " <<
track.getZ() <<
" Tgl = " <<
track.getTanl() <<
" Phi = " <<
track.getPhi() <<
" pz = " <<
track.getPz() <<
" q/pt = " <<
track.getInvQPt() << std::endl;
237 track.propagateToZ(nextZ, mBz);
239 currentLayer = nextlayer;
242 track.propagateToZ(
z, mBz);
244 startingLayerID = newLayerID;
248 MatchingFunc_t mMatchFunc = [](
const GlobalFwdTrack& mchtrack,
const TrackParCovFwd& mfttrack) ->
double {
249 throw std::runtime_error(
"MatchGlobalFwd: matching function not configured!");
252 CutFunc_t mCutFunc = [](
const GlobalFwdTrack& mchtrack,
const TrackParCovFwd& mfttrack) ->
bool {
253 throw std::runtime_error(
"MatchGlobalFwd: track pair candidate cut function not configured!");
256 bool loadExternalMatchingFunction()
262 const auto& extFuncMacroFile = matchingParam.extMatchFuncFile;
263 const auto& extFuncName = matchingParam.extMatchFuncName;
265 LOG(info) <<
"Loading external MFTMCH matching function: function name = " << extFuncName <<
" ; Filename = " << extFuncMacroFile;
267 auto func = o2::conf::GetFromMacro<MatchingFunc_t*>(extFuncMacroFile.c_str(), extFuncName.c_str(),
"o2::globaltracking::MatchingFunc_t*",
"mtcFcn");
268 mMatchFunc = (*func);
272 bool loadExternalCutFunction()
278 const auto& extFuncMacroFile = matchingParam.extMatchFuncFile;
279 const auto& extFuncName = matchingParam.extCutFuncName;
281 LOG(info) <<
"Loading external MFTMCH cut function: function name = " << extFuncName <<
" ; Filename = " << extFuncMacroFile;
283 auto func = o2::conf::GetFromMacro<CutFunc_t*>(extFuncMacroFile.c_str(), extFuncName.c_str(),
"o2::globaltracking::CutFunc_t*",
"cutFcn");
290 Float_t mMFTDiskThicknessInX0 = 0.042 / 5;
293 int mMFTROFrameLengthInBC = 0;
294 float mMFTROFrameLengthMUS = -1.;
295 float mMFTROFrameLengthMUSInv = -1.;
296 int mMFTROFrameBiasInBC = 0;
297 float mMFTROFrameBiasMUS = -1.;
298 float mMFTROFrameBiasMUSInv = -1.;
300 std::map<std::string, MatchingFunc_t> mMatchingFunctionMap;
301 std::map<std::string, CutFunc_t> mCutFunctionMap;
304 std::array<int16_t, o2::constants::lhc::LHCMaxBunches> mClosestBunchAbove;
305 std::array<int16_t, o2::constants::lhc::LHCMaxBunches> mClosestBunchBelow;
307 bool mMFTTriggered =
false;
310 std::vector<int> mMFTTrackROFContMapping;
313 gsl::span<const o2::mch::TrackMCH> mMCHTracks;
314 gsl::span<const o2::mch::ROFRecord> mMCHTrackROFRec;
315 gsl::span<const o2::mft::TrackMFT> mMFTTracks;
316 gsl::span<const o2::itsmft::ROFRecord> mMFTTrackROFRec;
317 gsl::span<const o2::dataformats::TrackMCHMID> mMCHMIDMatches;
318 gsl::span<const int> mMFTTrackClusIdx;
319 gsl::span<const o2::itsmft::ROFRecord> mMFTClusterROFRec;
320 gsl::span<const o2::dataformats::MatchInfoFwd> mMatchingInfoUpstream;
321 gsl::span<const o2::MCCompLabel> mMFTTrkLabels;
322 gsl::span<const o2::MCCompLabel> mMCHTrkLabels;
324 std::vector<BracketF> mMCHROFTimes;
325 std::vector<TrackLocMCH> mMCHWork;
326 std::vector<int> mMCHID2Work;
327 std::vector<BracketF> mMFTROFTimes;
328 std::vector<TrackLocMFT> mMFTWork;
329 std::vector<MFTCluster> mMFTClusters;
330 std::vector<o2::dataformats::GlobalFwdTrack> mMatchedTracks;
331 std::vector<o2::MCCompLabel> mMatchLabels;
332 std::vector<o2::dataformats::MatchInfoFwd> mMatchingInfo;
333 std::vector<o2::mft::TrackMFT> mMFTMatchPlaneParams;
334 std::vector<o2::track::TrackParCovFwd> mMCHMatchPlaneParams;
336 std::map<int, std::vector<std::pair<float, int>>> mCandidates;
340 bool mMCTruthON =
false;
341 bool mUseMIDMCHMatch =
false;
342 bool mUseTrackTime =
false;
344 int mNCandidates = 5;
346 TGeoManager* mGeoManager;
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