From c7a86743755d5da4928dbf62c8eb17c5e3c8bb47 Mon Sep 17 00:00:00 2001 From: "s.zharko@gsi.de" <s.zharko@gsi.de> Date: Thu, 21 Apr 2022 17:50:52 +0200 Subject: [PATCH] L1Algo: Track finder iteration parameters updates --- reco/L1/CbmL1.cxx | 16 +++++++ reco/L1/L1Algo/L1Algo.h | 32 +++++++------- reco/L1/L1Algo/L1CAIteration.cxx | 36 ++++++++++++---- reco/L1/L1Algo/L1CAIteration.h | 26 ++++++++++-- reco/L1/L1Algo/L1CAMergeClones.cxx | 2 +- reco/L1/L1Algo/L1CATrackFinder.cxx | 67 +++++++++++++++++++----------- reco/L1/L1Algo/L1InitManager.cxx | 4 +- reco/L1/L1Algo/L1Utils.h | 8 ++++ 8 files changed, 134 insertions(+), 57 deletions(-) diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 1f32cc5d8c..958a259770 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -995,6 +995,8 @@ InitStatus CbmL1::Init() trackingIterFastPrim.SetMaxSlopePV(1.1f); trackingIterFastPrim.SetMaxSlope(2.748f); trackingIterFastPrim.SetMaxDZ(0); + trackingIterFastPrim.SetTargetPosSigmaXY(1, 1); + trackingIterFastPrim.SetPrimary(true); auto trackingIterAllPrim = L1CAIteration("AllPrimIter"); trackingIterAllPrim.SetTrackChi2Cut(10.f); @@ -1006,6 +1008,8 @@ InitStatus CbmL1::Init() trackingIterAllPrim.SetMaxSlopePV(1.1f); trackingIterAllPrim.SetMaxSlope(2.748f); trackingIterAllPrim.SetMaxDZ(0.1); + trackingIterAllPrim.SetTargetPosSigmaXY(1, 1); + trackingIterAllPrim.SetPrimary(true); auto trackingIterFastPrim2 = L1CAIteration("FastPrim2Iter"); trackingIterFastPrim2.SetTrackChi2Cut(10.f); @@ -1017,6 +1021,8 @@ InitStatus CbmL1::Init() trackingIterFastPrim2.SetMaxSlopePV(1.1f); trackingIterFastPrim2.SetMaxSlope(2.748f); trackingIterFastPrim2.SetMaxDZ(0); + trackingIterFastPrim2.SetTargetPosSigmaXY(5, 5); + trackingIterFastPrim2.SetPrimary(true); auto trackingIterAllSec = L1CAIteration("AllSecIter"); trackingIterAllSec.SetTrackChi2Cut(10.f); @@ -1028,6 +1034,8 @@ InitStatus CbmL1::Init() trackingIterAllSec.SetMaxSlopePV(1.5f); trackingIterAllSec.SetMaxSlope(2.748f); trackingIterAllSec.SetMaxDZ(0.1); + trackingIterAllSec.SetTargetPosSigmaXY(10, 10); + trackingIterAllSec.SetPrimary(false); auto trackingIterFastPrimJump = L1CAIteration("FastPrimJumpIter"); trackingIterFastPrimJump.SetTrackChi2Cut(10.f); @@ -1039,6 +1047,8 @@ InitStatus CbmL1::Init() trackingIterFastPrimJump.SetMaxSlopePV(1.1f); trackingIterFastPrimJump.SetMaxSlope(2.748f); trackingIterFastPrimJump.SetMaxDZ(0); + trackingIterFastPrimJump.SetTargetPosSigmaXY(5, 5); + trackingIterFastPrimJump.SetPrimary(true); auto trackingIterAllPrimJump = L1CAIteration("AllPrimJumpIter"); trackingIterAllPrimJump.SetTrackChi2Cut(10.f); @@ -1050,6 +1060,8 @@ InitStatus CbmL1::Init() trackingIterAllPrimJump.SetMaxSlopePV(1.1f); trackingIterAllPrimJump.SetMaxSlope(2.748f); trackingIterAllPrimJump.SetMaxDZ(0.1); + trackingIterAllPrimJump.SetTargetPosSigmaXY(5, 5); + trackingIterAllPrimJump.SetPrimary(true); auto trackingIterAllSecJump = L1CAIteration("AllSecJumpIter"); trackingIterAllSecJump.SetTrackChi2Cut(10.f); @@ -1061,6 +1073,7 @@ InitStatus CbmL1::Init() trackingIterAllSecJump.SetMaxSlopePV(1.5f); trackingIterAllSecJump.SetMaxSlope(2.748f); trackingIterAllSecJump.SetMaxDZ(0.1); + trackingIterAllSecJump.SetTargetPosSigmaXY(10, 10); auto trackingIterAllPrimE = L1CAIteration("AllPrimEIter"); trackingIterAllPrimE.SetTrackChi2Cut(10.f); @@ -1072,6 +1085,8 @@ InitStatus CbmL1::Init() trackingIterAllPrimE.SetMaxSlopePV(1.1f); trackingIterAllPrimE.SetMaxSlope(2.748f); trackingIterAllPrimE.SetMaxDZ(0.1); + trackingIterAllPrimE.SetTargetPosSigmaXY(1, 1); + trackingIterAllPrimE.SetPrimary(true); auto trackingIterAllSecE = L1CAIteration("AllSecEIter"); trackingIterAllSecE.SetTrackChi2Cut(10.f); @@ -1083,6 +1098,7 @@ InitStatus CbmL1::Init() trackingIterAllSecE.SetMaxSlopePV(1.5f); trackingIterAllSecE.SetMaxSlope(2.748f); trackingIterAllSecE.SetMaxDZ(0.1); + trackingIterAllSecE.SetTargetPosSigmaXY(10, 10); // Select default track finder if (fTrackingMode == L1Algo::TrackingMode::kMcbm) { diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h index 52cb703c50..d46ca91c29 100644 --- a/reco/L1/L1Algo/L1Algo.h +++ b/reco/L1/L1Algo/L1Algo.h @@ -68,6 +68,7 @@ class L1AlgoDraw; #include "L1TrackPar.h" #include "L1TrackParFit.h" #include "L1Triplet.h" +#include "L1Utils.h" #include "L1Vector.h" #ifdef _OPENMP @@ -647,9 +648,6 @@ private: map<int, int> threadNumberToCpuMap {}; - /// TODO: move to separate header with predefined utility values (S.Zharko) - static constexpr float kNaN {std::numeric_limits<float>::signaling_NaN()}; - float fTrackChi2Cut {10.f}; float fTripletChi2Cut {5.f}; // cut for selecting triplets before collecting tracks.per one DoF float fDoubletChi2Cut {5.f}; @@ -657,23 +655,23 @@ private: float fTimeCut2 {0.f}; /// correction in order to take into account overlaping and iff z. if sort by y then it is max diff between same station's modules (~0.4cm) - fvec fMaxDZ {kNaN}; + fvec fMaxDZ {L1Utils::kNaN}; /// parameters which are different for different iterations. Set in the begin of CAL1TrackFinder - float fPickGather {kNaN}; // same for attaching additional hits to track - float fPickNeighbour {kNaN}; // (fPickNeighbour < dp/dp_error) => triplets are neighbours - fvec fMaxInvMom {kNaN}; // max considered q/p for tracks - fvec fMaxSlopePV {kNaN}; // max slope (tx\ty) in prim vertex - float fMaxSlope {kNaN}; // max slope (tx\ty) in 3d hit position of a triplet - fvec fCbmTargetX {kNaN}; // target position - fvec fCbmTargetY {kNaN}; - fvec fCbmTargetZ {kNaN}; - fvec fTargX {kNaN}; // target position for the current iteration - fvec fTargY {kNaN}; - fvec fTargZ {kNaN}; - - L1FieldValue targB _fvecalignment {}; // field in the target point + float fPickGather {L1Utils::kNaN}; // same for attaching additional hits to track + float fPickNeighbour {L1Utils::kNaN}; // (fPickNeighbour < dp/dp_error) => triplets are neighbours + fvec fMaxInvMom {L1Utils::kNaN}; // max considered q/p for tracks + fvec fMaxSlopePV {L1Utils::kNaN}; // max slope (tx\ty) in prim vertex + float fMaxSlope {L1Utils::kNaN}; // max slope (tx\ty) in 3d hit position of a triplet + fvec fCbmTargetX {L1Utils::kNaN}; // target position + fvec fCbmTargetY {L1Utils::kNaN}; + fvec fCbmTargetZ {L1Utils::kNaN}; + fvec fTargX {L1Utils::kNaN}; // target position for the current iteration + fvec fTargY {L1Utils::kNaN}; + fvec fTargZ {L1Utils::kNaN}; + + L1FieldValue fTargB _fvecalignment {}; // field in the target point L1XYMeasurementInfo TargetXYInfo _fvecalignment {}; // target constraint [cm] diff --git a/reco/L1/L1Algo/L1CAIteration.cxx b/reco/L1/L1Algo/L1CAIteration.cxx index 647f7956a4..71d5ce732b 100644 --- a/reco/L1/L1Algo/L1CAIteration.cxx +++ b/reco/L1/L1Algo/L1CAIteration.cxx @@ -17,6 +17,7 @@ L1CAIteration::L1CAIteration() noexcept { LOG(debug) << "L1CAIteration: Default L1CAIteration::L1CAIteration(const L1CAIteration& other) noexcept // Basic fields : fName(other.fName) + , fControlFlags(other.fControlFlags) // Cuts , fTrackChi2Cut(other.fTrackChi2Cut) , fTripletChi2Cut(other.fTripletChi2Cut) @@ -27,6 +28,8 @@ L1CAIteration::L1CAIteration(const L1CAIteration& other) noexcept , fMaxSlopePV(other.fMaxSlopePV) , fMaxSlope(other.fMaxSlope) , fMaxDZ(other.fMaxDZ) + , fTargetPosSigmaX(other.fTargetPosSigmaX) + , fTargetPosSigmaY(other.fTargetPosSigmaY) { LOG(debug) << "L1CAIteration: Copy constructor called: " << &other << " was copied into " << this; } @@ -79,12 +82,21 @@ void L1CAIteration::Print(int verbosityLevel) const if (verbosityLevel > 0) { LOG(info) << ToString(0); } } +//---------------------------------------------------------------------------------------------------------------------- +// +void L1CAIteration::SetTargetPosSigmaXY(float sigmaX, float sigmaY) +{ + fTargetPosSigmaX = sigmaX; + fTargetPosSigmaY = sigmaY; +} + //---------------------------------------------------------------------------------------------------------------------- // void L1CAIteration::Swap(L1CAIteration& other) noexcept { // Basic fields std::swap(fName, other.fName); + std::swap(fControlFlags, other.fControlFlags); // Cuts std::swap(fTrackChi2Cut, other.fTrackChi2Cut); std::swap(fTripletChi2Cut, other.fTripletChi2Cut); @@ -95,6 +107,8 @@ void L1CAIteration::Swap(L1CAIteration& other) noexcept std::swap(fMaxSlopePV, other.fMaxSlopePV); std::swap(fMaxSlope, other.fMaxSlope); std::swap(fMaxDZ, other.fMaxDZ); + std::swap(fTargetPosSigmaX, other.fTargetPosSigmaX); + std::swap(fTargetPosSigmaY, other.fTargetPosSigmaY); } //---------------------------------------------------------------------------------------------------------------------- @@ -105,14 +119,18 @@ std::string L1CAIteration::ToString(int indentLevel) const constexpr char indentChar = '\t'; std::string indent(indentLevel, indentChar); aStream << indent << "L1CAIteration: " << fName << '\n'; - aStream << indent << indentChar << "Track chi2 cut: " << fTrackChi2Cut << '\n'; - aStream << indent << indentChar << "Triplet chi2 cut: " << fTripletChi2Cut << '\n'; - aStream << indent << indentChar << "Doublet chi2 cut: " << fDoubletChi2Cut << '\n'; - aStream << indent << indentChar << "Pick gather: " << fPickGather << '\n'; - aStream << indent << indentChar << "Pick neighbour: " << fPickNeighbour << '\n'; - aStream << indent << indentChar << "Max invariant momentum: " << fMaxInvMom << '\n'; - aStream << indent << indentChar << "Max slope at primary vertex: " << fMaxSlopePV << '\n'; - aStream << indent << indentChar << "Max slope: " << fMaxSlope << '\n'; - aStream << indent << indentChar << "Max DZ: " << fMaxDZ; + aStream << indent << indentChar << "Is primary: " << fControlFlags[static_cast<int>(ControlFlag::kePrimary)] << '\n'; + aStream << indent << indentChar << "Track chi2 cut: " << fTrackChi2Cut << '\n'; + aStream << indent << indentChar << "Triplet chi2 cut: " << fTripletChi2Cut << '\n'; + aStream << indent << indentChar << "Doublet chi2 cut: " << fDoubletChi2Cut << '\n'; + aStream << indent << indentChar << "Pick gather: " << fPickGather << '\n'; + aStream << indent << indentChar << "Pick neighbour: " << fPickNeighbour << '\n'; + aStream << indent << indentChar << "Max invariant momentum: " << fMaxInvMom << '\n'; + aStream << indent << indentChar << "Max slope at primary vertex: " << fMaxSlopePV << '\n'; + aStream << indent << indentChar << "Max slope: " << fMaxSlope << '\n'; + aStream << indent << indentChar << "Max DZ: " << fMaxDZ << '\n'; + aStream << indent << indentChar << "Target position sigma X [cm]: " << fTargetPosSigmaX << '\n'; + aStream << indent << indentChar << "Target position sigma Y [cm]: " << fTargetPosSigmaY; + return aStream.str(); } diff --git a/reco/L1/L1Algo/L1CAIteration.h b/reco/L1/L1Algo/L1CAIteration.h index 8f8fa7ad71..ded1f0b4f4 100644 --- a/reco/L1/L1Algo/L1CAIteration.h +++ b/reco/L1/L1Algo/L1CAIteration.h @@ -12,12 +12,19 @@ #ifndef L1CAIteration_h #define L1CAIteration_h 1 +#include <bitset> #include <string> /// Class L1CAIteration describes L1 Track finder iteration. Each iteration contains specific cuts and special /// flags. /// class L1CAIteration { + enum class ControlFlag { + kePrimary, ///< true - track is primary, false - track is secondary (not primary) + keEnd + }; + using ControlFlags_t = std::bitset<static_cast<int>(ControlFlag::keEnd)>; + public: /// Default constructor L1CAIteration() noexcept; @@ -50,10 +57,17 @@ public: float GetPickGather() const { return fPickGather; } /// float GetPickNeighbour() const { return fPickNeighbour; } + /// Gets sigma target position in X direction [cm] + float GetTargetPosSigmaX() const { return fTargetPosSigmaX; } + /// Gets sigma target position in Y direction [cm] + float GetTargetPosSigmaY() const { return fTargetPosSigmaY; } /// Gets track chi2 upper cut float GetTrackChi2Cut() const { return fTrackChi2Cut; } /// Gets triplet chi2 upper cut float GetTripletChi2Cut() const { return fTripletChi2Cut; } + + /// flag check: primary tracks - true, secondary tracks - false + bool IsPrimary() const { return fControlFlags[static_cast<int>(ControlFlag::kePrimary)]; } /// Prints iteration options void Print(int verbosityLevel = 0) const; @@ -74,6 +88,10 @@ public: void SetPickGather(float input) { fPickGather = input; } /// void SetPickNeighbour(float input) { fPickNeighbour = input; } + /// Sets flag: primary tracks - true, secondary tracks - false + void SetPrimary(bool flag) { fControlFlags[static_cast<int>(ControlFlag::kePrimary)] = flag; } + /// Sets sigma of target positions in XY plane (in cm) + void SetTargetPosSigmaXY(float sigmaX, float sigmaY); /// Sets track chi2 upper cut void SetTrackChi2Cut(float input) { fTrackChi2Cut = input; } /// Sets triplet chi2 upper cut @@ -86,9 +104,8 @@ public: private: //------------------------------------------------------------------------------------------------------------------- - // Basic class fields - //------------------------------------------------------------------------------------------------------------------- - std::string fName {""}; ///< Iteration name + std::string fName {""}; ///< Iteration name + ControlFlags_t fControlFlags {}; ///< bitset flags to control iteration behaviour //------------------------------------------------------------------------------------------------------------------- // Track finder dependent cuts @@ -104,6 +121,9 @@ private: float fMaxSlopePV {1.1}; ///> max slope (tx\ty) in prim vertex float fMaxSlope {2.748}; ///> max slope (tx\ty) in 3d hit position of a triplet float fMaxDZ {0.f}; ///> Correction for accounting overlaping and iff z + float fTargetPosSigmaX {0}; ///> Constraint on target position in X direction [cm] + float fTargetPosSigmaY {0}; ///> Constraint on target position in Y direction [cm] + }; #endif // L1CAIteration_h diff --git a/reco/L1/L1Algo/L1CAMergeClones.cxx b/reco/L1/L1Algo/L1CAMergeClones.cxx index 030a892d18..c476999b44 100644 --- a/reco/L1/L1Algo/L1CAMergeClones.cxx +++ b/reco/L1/L1Algo/L1CAMergeClones.cxx @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt +;/* Copyright (C) 2010-2018 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt SPDX-License-Identifier: GPL-3.0-only Authors: Maksym Zyzak [committer] */ diff --git a/reco/L1/L1Algo/L1CATrackFinder.cxx b/reco/L1/L1Algo/L1CATrackFinder.cxx index 570528a45f..e648f06363 100644 --- a/reco/L1/L1Algo/L1CATrackFinder.cxx +++ b/reco/L1/L1Algo/L1CATrackFinder.cxx @@ -203,16 +203,16 @@ inline void L1Algo::f11( /// input 1st stage of singlet search stac_global.fieldSlice.GetFieldValue(fTargX + tx * (zstac_global - fTargZ), fTargY + ty * (zstac_global - fTargZ), centB_global); - if (istac != istal) fld0.Set(l_B, stal.z, centB, stac.z, targB, fTargZ); + if (istac != istal) fld0.Set(l_B, stal.z, centB, stac.z, fTargB, fTargZ); else - fld0.Set(l_B, zstal, targB, fTargZ); + fld0.Set(l_B, zstal, fTargB, fTargZ); // estimate field for the next extrapolations stam.fieldSlice.GetFieldValue(fTargX + tx * (zstam - fTargZ), fTargY + ty * (zstam - fTargZ), m_B); #define USE_3HITS // TODO: move this directive to more suitable place #ifndef USE_3HITS if (istac != istal) fld1.Set(m_B, zstam, l_B, zstal, centB, zstac); else - fld1.Set(m_B, zstam, l_B, zstal, targB, fTargZ); + fld1.Set(m_B, zstam, l_B, zstal, fTargB, fTargZ); #else // if USE_3HITS // the best now L1FieldValue r_B _fvecalignment; L1Station& star = vStations[istam + 1]; @@ -1821,8 +1821,10 @@ void L1Algo::CATrackFinder() // FIRSTCASTATION = 2; fDoubletChi2Cut = caIteration.GetDoubletChi2Cut(); //11.3449 * 2.f / 3.f; // prob = 0.1 + //fDoubletChi2Cut = 11.3449 * 2.f / 3.f; // prob = 0.1 fTripletChi2Cut = caIteration.GetTripletChi2Cut(); //21.1075; // prob = 0.01% + //fTripletChi2Cut = 21.1075; // prob = 0.01% //switch (isec) { // case kFastPrimIter: @@ -1843,16 +1845,19 @@ void L1Algo::CATrackFinder() /// coefficient for size of region for attach new hits to the created track fPickGather = caIteration.GetPickGather(); //3.0; + //fPickGather = 3.0; //if ((isec == kAllPrimIter) || (isec == kAllPrimEIter) || (isec == kAllPrimJumpIter) || (isec == kAllSecIter) // || (isec == kAllSecEIter) || (isec == kAllSecJumpIter)) // fPickGather = 4.0; // (fPickNeighbour < dp/dp_error) => triplets are neighbours fPickNeighbour = caIteration.GetPickNeighbour(); //5.0; - // if ( (isec == kFastPrimIter) ) - // fPickNeighbour = 5.0*0.5; // TODO understand why works with 0.2 + //fPickNeighbour = 5.0; + //if ( (isec == kFastPrimIter) ) + // fPickNeighbour = 5.0*0.5; // TODO understand why works with 0.2 fMaxInvMom = caIteration.GetMaxInvMom(); //1.0 / 0.5; // max considered q/p + //fMaxInvMom = 1.0 / 0.5; // max considered q/p //if (fTrackingMode == kMcbm) fMaxInvMom = 1 / 0.3; // max considered q/p //if ((isec == kAllPrimJumpIter) || (isec == kAllSecIter) || (isec == kAllSecJumpIter)) fMaxInvMom = 1.0 / 0.1; @@ -1861,34 +1866,44 @@ void L1Algo::CATrackFinder() //if ((isec == kAllPrimIter) || (isec == kAllPrimEIter) || (isec == kAllSecEIter)) // if (fTrackingMode == kMcbm) fMaxInvMom = 1 / 0.1; // max considered q/p + fMaxSlopePV = caIteration.GetMaxSlopePV(); //1.1; + //fMaxSlopePV = 1.1; //if ( // (isec == kAllPrimIter) || (isec == kAllPrimEIter) || (isec == kAllPrimJumpIter) || // (isec == kAllSecIter) || (isec == kAllSecEIter) || (isec == kAllSecJumpIter)) // fMaxSlopePV = 1.5; fMaxSlope = caIteration.GetMaxSlope(); //2.748; // corresponds to 70 grad + //fMaxSlope = 2.748; // corresponds to 70 grad // define the target fTargX = fCbmTargetX; fTargY = fCbmTargetY; fTargZ = fCbmTargetZ; - float SigmaTargetX = 0, SigmaTargetY = 0; // target constraint [cm] - if ((isec == kFastPrimIter) || (isec == kFastPrimIter2) || (isec == kFastPrimJumpIter) || (isec == kAllPrimIter) - || (isec == kAllPrimEIter) || (isec == kAllPrimJumpIter)) { // target - targB = vtxFieldValue; - if ((isec == kFastPrimIter) || (isec == kAllPrimIter) || (isec == kAllPrimEIter)) - SigmaTargetX = SigmaTargetY = 1; // target - else - SigmaTargetX = SigmaTargetY = 5; - } - if ((isec == kAllSecIter) || (isec == kAllSecEIter) - || (isec == kAllSecJumpIter)) { //use outer radius of the 1st station as a constraint - L1Station& st = vStations[0]; - SigmaTargetX = SigmaTargetY = 10; //st.Rmax[0]; - fTargZ = fCbmTargetZ; // fCbmTargetZ-1.; - st.fieldSlice.GetFieldValue(0, 0, targB); - } + float SigmaTargetX = caIteration.GetTargetPosSigmaX(); + float SigmaTargetY = caIteration.GetTargetPosSigmaY(); // target constraint [cm] + + // Select magnetic field. For primary tracks - vtxFieldValue, for secondary tracks - st.fieldSlice + if (caIteration.IsPrimary()) { fTargB = vtxFieldValue; } + else { vStations[0].fieldSlice.GetFieldValue(0, 0, fTargB); } // NOTE: calculates field fTargB in the center of 0th station + + + //if ((isec == kFastPrimIter) || (isec == kFastPrimIter2) || (isec == kFastPrimJumpIter) || (isec == kAllPrimIter) + // || (isec == kAllPrimEIter) || (isec == kAllPrimJumpIter)) { // target + // fTargB = vtxFieldValue; + // if ((isec == kFastPrimIter) || (isec == kAllPrimIter) || (isec == kAllPrimEIter)) + // SigmaTargetX = SigmaTargetY = 1; // target + // else + // SigmaTargetX = SigmaTargetY = 5; + //} + //if ((isec == kAllSecIter) || (isec == kAllSecEIter) + // || (isec == kAllSecJumpIter)) { //use outer radius of the 1st station as a constraint // ? + // L1Station& st = vStations[0]; + // SigmaTargetX = SigmaTargetY = 10; //st.Rmax[0]; + // fTargZ = fCbmTargetZ; // fCbmTargetZ-1.; + // st.fieldSlice.GetFieldValue(0, 0, fTargB); + //} TargetXYInfo.C00 = SigmaTargetX * SigmaTargetX; TargetXYInfo.C10 = 0; @@ -1897,11 +1912,13 @@ void L1Algo::CATrackFinder() /// Set correction in order to take into account overlaping and iff z. /// The reason is that low momentum tracks are too curved and goes not from target direction. That's why sort by hit_y/hit_z is not work idealy /// If sort by y then it is max diff between same station's modules (~0.4cm) - fMaxDZ = 0; - if ((isec == kAllPrimIter) || (isec == kAllPrimEIter) || (isec == kAllPrimJumpIter) || (isec == kAllSecIter) - || (isec == kAllSecEIter) || (isec == kAllSecJumpIter)) - fMaxDZ = 0.1; + fMaxDZ = caIteration.GetMaxDZ(); //0; + //fMaxDZ = 0; + //if ((isec == kAllPrimIter) || (isec == kAllPrimEIter) || (isec == kAllPrimJumpIter) || (isec == kAllSecIter) + // || (isec == kAllSecEIter) || (isec == kAllSecJumpIter)) + // fMaxDZ = 0.1; + // TODO: to be removed, because this condition is checked in L1InitManager (S.Zharko) if (NStations > (int) L1Parameters::kMaxNstations) cout << " CATrackFinder: Error: Too many Stations" << endl; } diff --git a/reco/L1/L1Algo/L1InitManager.cxx b/reco/L1/L1Algo/L1InitManager.cxx index ed3c22f14c..adea27836d 100644 --- a/reco/L1/L1Algo/L1InitManager.cxx +++ b/reco/L1/L1Algo/L1InitManager.cxx @@ -152,9 +152,9 @@ void L1InitManager::PrintStations(int verbosityLevel) const void L1InitManager::PushBackCAIteration(const L1CAIteration& iteration) { // TODO: probably some checks must be inserted here (S.Zharko) - //bool control = fInitController.GetFlag(InitKey::keCAIterationsNumberCrosscheck); + bool control = fInitController.GetFlag(InitKey::keCAIterationsNumberCrosscheck); //std::cout << "L1InitManager::PushBackCAIteration " << control << '\n'; - L1MASSERT(0, fInitController.GetFlag(InitKey::keCAIterationsNumberCrosscheck), + L1MASSERT(0, control, //fInitController.GetFlag(InitKey::keCAIterationsNumberCrosscheck), "Attempt to push back a CA track finder iteration before the number of iterations was defined"); L1Vector<L1CAIteration>& iterationsContainer = fpParameters->CAIterationsContainer(); diff --git a/reco/L1/L1Algo/L1Utils.h b/reco/L1/L1Algo/L1Utils.h index 97fff9bee4..7fe2e81cba 100644 --- a/reco/L1/L1Algo/L1Utils.h +++ b/reco/L1/L1Algo/L1Utils.h @@ -7,16 +7,22 @@ * @brief File contains some general purpose functions for L1Algo * @since 12.01.2022 ***********************************************************************************************************/ +#ifndef L1Utils_h +#define L1Utils_h 1 #include <iomanip> #include <map> #include <sstream> #include <string> #include <unordered_map> +#include <limits> /// Class contains some utility functions for L1Algo struct L1Utils { + /// Some constants + static constexpr float kNaN {std::numeric_limits<float>::signaling_NaN()}; + /// Hash for unordered_map with enum class keys struct EnumClassHash { template<typename T> @@ -71,3 +77,5 @@ struct L1Utils { return token.str(); } }; + +#endif // L1Utils_h -- GitLab