Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sergei Zharko
cbmroot
Commits
62cecb63
Commit
62cecb63
authored
Apr 27, 2022
by
Sergei Zharko
Browse files
L1Algo init: updates
parent
c7a86743
Changes
10
Hide whitespace changes
Inline
Side-by-side
reco/L1/CbmL1.cxx
View file @
62cecb63
...
...
@@ -95,6 +95,7 @@ CbmL1* CbmL1::fInstance = 0;
CbmL1
::
CbmL1
()
:
FairTask
(
"L1"
)
{
if
(
!
fInstance
)
fInstance
=
this
;
if
(
!
fpInitManager
)
{
fpInitManager
=
algo_static
.
GetInitManager
();
}
}
CbmL1
::
CbmL1
(
const
char
*
name
,
Int_t
iVerbose
,
Int_t
_fPerformance
,
int
fSTAPDataMode_
,
TString
fSTAPDataDir_
,
...
...
@@ -106,6 +107,7 @@ CbmL1::CbmL1(const char* name, Int_t iVerbose, Int_t _fPerformance, int fSTAPDat
,
fFindParticlesMode
(
findParticleMode_
)
{
if
(
!
fInstance
)
fInstance
=
this
;
if
(
!
fpInitManager
)
{
fpInitManager
=
algo_static
.
GetInitManager
();
}
}
CbmL1
::~
CbmL1
()
...
...
@@ -386,9 +388,10 @@ InitStatus CbmL1::Init()
NTOFStation
=
0
;
NStation
=
0
;
// TODO: Replace algo initialization in the constructor (S.Zharko)
algo
=
&
algo_static
;
L1Vector
<
fscal
>
geo
(
"geo"
);
geo
.
reserve
(
10000
);
...
...
@@ -629,10 +632,6 @@ InitStatus CbmL1::Init()
CbmMuchLayer
*
layer
=
station
->
GetLayer
((
ist
-
NMvdStations
-
NStsStations
)
%
3
);
// CbmMuchModuleGem* module = (CbmMuchModuleGem*) CbmMuchGeoScheme::Instance()->GetModule(0,0,0,0);
// vector<CbmMuchPad*> pads = module->GetPads();
z
=
layer
->
GetZ
();
geo
.
push_back
(
2
);
...
...
@@ -824,37 +823,34 @@ InitStatus CbmL1::Init()
********************************************************************************************************************/
{
//L1Algo new init start
// Step 0: Get reference to the L1Algo initialization manager
L1InitManager
*
initMan
=
algo
->
GetInitManager
();
// Step 1: Initialize magnetic field function
// Set magnetic field slices
auto
fieldGetterFcn
=
[](
const
double
(
&
inPos
)[
3
],
double
(
&
outB
)[
3
])
{
CbmKF
::
Instance
()
->
GetMagneticField
()
->
GetFieldValue
(
inPos
,
outB
);
};
i
nitMan
->
SetFieldFunction
(
fieldGetterFcn
);
fpI
nitMan
ager
->
SetFieldFunction
(
fieldGetterFcn
);
// Step 2: Initialize target
auto
&
target
=
CbmKF
::
Instance
()
->
vTargets
[
0
];
i
nitMan
->
SetTargetPosition
(
target
.
x
,
target
.
y
,
target
.
z
);
fpI
nitMan
ager
->
SetTargetPosition
(
target
.
x
,
target
.
y
,
target
.
z
);
// Step 3: Initialize primary vertex field
i
nitMan
->
InitTargetField
(
2.5
);
fpI
nitMan
ager
->
InitTargetField
(
2.5
);
// Step 4: initialize IDs of detectors active in tracking
// TODO: temporary for tests, must be initialized somewhere in run_reco.C or similar (S.Zh.)
fActiveTrackingDetectorIDs
=
{
L1DetectorID
::
kMvd
,
L1DetectorID
::
kSts
};
i
nitMan
->
SetActiveDetectorIDs
(
fActiveTrackingDetectorIDs
);
fpI
nitMan
ager
->
SetActiveDetectorIDs
(
fActiveTrackingDetectorIDs
);
constexpr
double
PI
=
3.14159265358
;
// TODO: why cmath is not used? (S.Zh.)
// Step 5: initialize number of stations for each detector ID
i
nitMan
->
SetStationsNumberCrosscheck
(
L1DetectorID
::
kMvd
,
NMvdStations
);
i
nitMan
->
SetStationsNumberCrosscheck
(
L1DetectorID
::
kSts
,
NStsStations
);
i
nitMan
->
SetStationsNumberCrosscheck
(
L1DetectorID
::
kMuch
,
NMuchStations
);
i
nitMan
->
SetStationsNumberCrosscheck
(
L1DetectorID
::
kTrd
,
NTrdStations
);
i
nitMan
->
SetStationsNumberCrosscheck
(
L1DetectorID
::
kTof
,
NTOFStation
);
fpI
nitMan
ager
->
SetStationsNumberCrosscheck
(
L1DetectorID
::
kMvd
,
NMvdStations
);
fpI
nitMan
ager
->
SetStationsNumberCrosscheck
(
L1DetectorID
::
kSts
,
NStsStations
);
fpI
nitMan
ager
->
SetStationsNumberCrosscheck
(
L1DetectorID
::
kMuch
,
NMuchStations
);
fpI
nitMan
ager
->
SetStationsNumberCrosscheck
(
L1DetectorID
::
kTrd
,
NTrdStations
);
fpI
nitMan
ager
->
SetStationsNumberCrosscheck
(
L1DetectorID
::
kTof
,
NTOFStation
);
// Step 6: setup station info
...
...
@@ -879,7 +875,7 @@ InitStatus CbmL1::Init()
fscal
mvdFrontSigma
=
mvdStationPar
->
GetXRes
(
iSt
)
/
10000
;
fscal
mvdBackSigma
=
mvdStationPar
->
GetYRes
(
iSt
)
/
10000
;
stationInfo
.
SetFrontBackStripsGeometry
(
mvdFrontPhi
,
mvdFrontSigma
,
mvdBackPhi
,
mvdBackSigma
);
i
nitMan
->
AddStation
(
stationInfo
);
fpI
nitMan
ager
->
AddStation
(
stationInfo
);
}
// Setup STS stations info
...
...
@@ -907,7 +903,7 @@ InitStatus CbmL1::Init()
fscal
stsFrontSigma
=
cbmSts
->
GetSensorPitch
(
0
)
/
sqrt
(
12
);
fscal
stsBackSigma
=
stsFrontSigma
;
stationInfo
->
SetFrontBackStripsGeometry
(
stsFrontPhi
,
stsFrontSigma
,
stsBackPhi
,
stsBackSigma
);
i
nitMan
->
AddStation
(
stationInfo
);
fpI
nitMan
ager
->
AddStation
(
stationInfo
);
}
// Setup MuCh stations info
...
...
@@ -932,7 +928,7 @@ InitStatus CbmL1::Init()
fscal
muchFrontSigma
=
0.1
;
fscal
muchBackSigma
=
0.1
;
stationInfo
.
SetFrontBackStripsGeometry
(
muchFrontPhi
,
muchFrontSigma
,
muchBackPhi
,
muchBackSigma
);
i
nitMan
->
AddStation
(
stationInfo
);
fpI
nitMan
ager
->
AddStation
(
stationInfo
);
}
// Setup TRD stations info
...
...
@@ -958,6 +954,7 @@ InitStatus CbmL1::Init()
fscal
trdFrontSigma
=
1.
;
fscal
trdBackSigma
=
1.
;
stationInfo
.
SetFrontBackStripsGeometry
(
trdFrontPhi
,
trdFrontSigma
,
trdBackPhi
,
trdBackSigma
);
fpInitManager
->
AddStation
(
stationInfo
);
}
// Setup TOF stations info
...
...
@@ -976,6 +973,7 @@ InitStatus CbmL1::Init()
fscal
tofFrontSigma
=
1.
;
fscal
tofBackSigma
=
1.
;
stationInfo
.
SetFrontBackStripsGeometry
(
tofFrontPhi
,
tofFrontSigma
,
tofBackPhi
,
tofBackSigma
);
fpInitManager
->
AddStation
(
stationInfo
);
}
//initMan->PrintStations(/*vebosity = */ 1);
...
...
@@ -1112,25 +1110,25 @@ InitStatus CbmL1::Init()
trackingIterAllPrimJump
.
SetMaxInvMom
(
1.0
/
0.3
);
trackingIterAllSecJump
.
SetMaxInvMom
(
1.0
/
0.3
);
i
nitMan
->
SetCAIterationsNumberCrosscheck
(
4
);
fpI
nitMan
ager
->
SetCAIterationsNumberCrosscheck
(
4
);
// Initialize CA track finder iterations sequence
i
nitMan
->
PushBackCAIteration
(
trackingIterFastPrim
);
i
nitMan
->
PushBackCAIteration
(
trackingIterAllPrim
);
i
nitMan
->
PushBackCAIteration
(
trackingIterAllPrimJump
);
i
nitMan
->
PushBackCAIteration
(
trackingIterAllSec
);
fpI
nitMan
ager
->
PushBackCAIteration
(
trackingIterFastPrim
);
fpI
nitMan
ager
->
PushBackCAIteration
(
trackingIterAllPrim
);
fpI
nitMan
ager
->
PushBackCAIteration
(
trackingIterAllPrimJump
);
fpI
nitMan
ager
->
PushBackCAIteration
(
trackingIterAllSec
);
}
else
{
i
nitMan
->
SetCAIterationsNumberCrosscheck
(
4
);
fpI
nitMan
ager
->
SetCAIterationsNumberCrosscheck
(
4
);
// Initialize CA track finder iterations sequence
i
nitMan
->
PushBackCAIteration
(
trackingIterFastPrim
);
i
nitMan
->
PushBackCAIteration
(
trackingIterAllPrim
);
i
nitMan
->
PushBackCAIteration
(
trackingIterAllPrimJump
);
i
nitMan
->
PushBackCAIteration
(
trackingIterAllSec
);
//
i
nitMan->PushBackCAIteration(trackingIterAllPrimE);
//
i
nitMan->PushBackCAIteration(trackingIterAllSecE);
//
i
nitMan->PushBackCAIteration(trackingIterFastPrimJump);
//
i
nitMan->PushBackCAIteration(trackingIterFastPrim2);
//
i
nitMan->PushBackCAIteration(trackingIterAllSecJump);
fpI
nitMan
ager
->
PushBackCAIteration
(
trackingIterFastPrim
);
fpI
nitMan
ager
->
PushBackCAIteration
(
trackingIterAllPrim
);
fpI
nitMan
ager
->
PushBackCAIteration
(
trackingIterAllPrimJump
);
fpI
nitMan
ager
->
PushBackCAIteration
(
trackingIterAllSec
);
//
fpI
nitMan
ager
->PushBackCAIteration(trackingIterAllPrimE);
//
fpI
nitMan
ager
->PushBackCAIteration(trackingIterAllSecE);
//
fpI
nitMan
ager
->PushBackCAIteration(trackingIterFastPrimJump);
//
fpI
nitMan
ager
->PushBackCAIteration(trackingIterFastPrim2);
//
fpI
nitMan
ager
->PushBackCAIteration(trackingIterAllSecJump);
}
// Set special cuts
...
...
reco/L1/CbmL1.h
View file @
62cecb63
...
...
@@ -98,22 +98,6 @@ enum class L1DetectorID
kTrd
};
/// Enumeration for the CA Track finder iterations
/// NOTE: L1CAItrationType
enum
class
L1CAIterationType
{
kFastPrim
,
///< primary fast tracks
kAllPrim
,
///< primary all tracks
kAllPrimJump
,
///< primary all tracks with jumped triplets
kAllSec
,
///< secondary all tracks
kAllPrimE
,
///< primary all electron tracks
kAllSecE
,
///< secondary all electron tracks
kFastPrimJump
,
///< primary fast tracks with jumped triplets
kAllSecJump
,
///< secondary all tracks with jumped triplets
kEND
///< dummy item, represents number of iterations
};
// TODO: insert documentation! (S.Zh.)
//
/// L1Algo runtime constants modification can be performed in run_reco.C. Example:
...
...
@@ -158,8 +142,8 @@ public:
~
CbmL1
(
/*if (targetFieldSlice) delete;*/
);
//
L1Parameters* GetParameters() { return &fParameters; }
//
/ Gets a pointer to L1InitManager (for access in run_reco.C)
L1InitManager
*
GetInitManager
()
{
return
fpInitManager
;
}
/// Gets a set of active detectors used in tracking
// TODO: think about return (value, reference or const reference?) (S.Zh.)
std
::
set
<
L1DetectorID
>
GetActiveTrackingDetectorIDs
()
const
{
return
fActiveTrackingDetectorIDs
;
}
...
...
reco/L1/L1Algo/L1Algo.h
View file @
62cecb63
...
...
@@ -664,14 +664,14 @@ private:
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
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
L1FieldValue
fTargB
_fvecalignment
{};
// field in the target point
L1XYMeasurementInfo
TargetXYInfo
_fvecalignment
{};
// target constraint [cm]
...
...
reco/L1/L1Algo/L1CAIteration.cxx
View file @
62cecb63
...
...
@@ -119,7 +119,8 @@ std::string L1CAIteration::ToString(int indentLevel) const
constexpr
char
indentChar
=
'\t'
;
std
::
string
indent
(
indentLevel
,
indentChar
);
aStream
<<
indent
<<
"L1CAIteration: "
<<
fName
<<
'\n'
;
aStream
<<
indent
<<
indentChar
<<
"Is primary: "
<<
fControlFlags
[
static_cast
<
int
>
(
ControlFlag
::
kePrimary
)]
<<
'\n'
;
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'
;
...
...
reco/L1/L1Algo/L1CAIteration.h
View file @
62cecb63
...
...
@@ -19,7 +19,8 @@
/// flags.
///
class
L1CAIteration
{
enum
class
ControlFlag
{
enum
class
ControlFlag
{
kePrimary
,
///< true - track is primary, false - track is secondary (not primary)
keEnd
};
...
...
@@ -65,7 +66,7 @@ public:
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
)];
}
...
...
@@ -123,7 +124,6 @@ private:
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
reco/L1/L1Algo/L1CAMergeClones.cxx
View file @
62cecb63
;
/* 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] */
...
...
reco/L1/L1Algo/L1CATrackFinder.cxx
View file @
62cecb63
...
...
@@ -1372,6 +1372,7 @@ inline void L1Algo::DupletsStaPort(
/// Find the doublets. Reformat data in the portion of doublets.
// TODO: repalce with constexpr if (C++17) (S.Zharko)
#ifdef DOUB_PERFORMANCE
L1Vector
<
THitI
>
hitsl_2
(
"L1CATrackFinder::hitsl_2"
);
#endif // DOUB_PERFORMANCE
...
...
@@ -1866,7 +1867,7 @@ 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) ||
...
...
@@ -1883,12 +1884,14 @@ void L1Algo::CATrackFinder()
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
(
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;
...
...
@@ -1912,7 +1915,7 @@ 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
=
caIteration
.
GetMaxDZ
();
//0;
fMaxDZ
=
caIteration
.
GetMaxDZ
();
//0;
//fMaxDZ = 0;
//if ((isec == kAllPrimIter) || (isec == kAllPrimEIter) || (isec == kAllPrimJumpIter) || (isec == kAllSecIter)
// || (isec == kAllSecEIter) || (isec == kAllSecJumpIter))
...
...
reco/L1/L1Algo/L1InitManager.cxx
View file @
62cecb63
...
...
@@ -154,7 +154,7 @@ void L1InitManager::PushBackCAIteration(const L1CAIteration& iteration)
// TODO: probably some checks must be inserted here (S.Zharko)
bool
control
=
fInitController
.
GetFlag
(
InitKey
::
keCAIterationsNumberCrosscheck
);
//std::cout << "L1InitManager::PushBackCAIteration " << control << '\n';
L1MASSERT
(
0
,
control
,
//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
();
...
...
reco/L1/L1Algo/L1InitManager.h
View file @
62cecb63
...
...
@@ -189,6 +189,7 @@ private:
/* Stations related fields */
std
::
set
<
L1BaseStationInfo
>
fStationsInfo
{};
///< Set of L1BaseStationInfo objects
/// Map of station numbers used for initialization crosscheck
L1DetectorIDIntMap_t
fStationsNumberCrosscheck
{};
/// A function which returns magnetic field vector B in a radius-vector xyz
...
...
reco/L1/L1Algo/L1Utils.h
View file @
62cecb63
...
...
@@ -11,17 +11,17 @@
#define L1Utils_h 1
#include
<iomanip>
#include
<limits>
#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
()};
static
constexpr
float
kNaN
{
std
::
numeric_limits
<
float
>::
signaling_NaN
()};
/// Hash for unordered_map with enum class keys
struct
EnumClassHash
{
...
...
@@ -78,4 +78,4 @@ struct L1Utils {
}
};
#endif // L1Utils_h
#endif
// L1Utils_h
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment