Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
fe19f13e
Commit
fe19f13e
authored
3 years ago
by
Sergei Zharko
Committed by
Sergey Gorbunov
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
L1: bugfix in CbmTrackingInputQaSts
parent
193c38c1
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!888
L1: Prototypes for tracking input QA (STS) and tracking parameters configuration file reader/writer
Pipeline
#18177
failed
3 years ago
Stage: documentation
Stage: deploy
Changes
2
Pipelines
3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
reco/L1/qa/CbmTrackingInputQaSts.cxx
+36
-28
36 additions, 28 deletions
reco/L1/qa/CbmTrackingInputQaSts.cxx
reco/L1/qa/CbmTrackingInputQaSts.h
+5
-3
5 additions, 3 deletions
reco/L1/qa/CbmTrackingInputQaSts.h
with
41 additions
and
31 deletions
reco/L1/qa/CbmTrackingInputQaSts.cxx
+
36
−
28
View file @
fe19f13e
...
...
@@ -46,8 +46,6 @@ CbmTrackingInputQaSts::~CbmTrackingInputQaSts() { DeInit(); }
//
bool
CbmTrackingInputQaSts
::
CheckDistributions
()
{
std
::
cout
<<
"CALL CbmTrackingInputQaSts::CheckDistributions()
\n
"
;
bool
res
=
true
;
const
int
nStations
=
fpDetectorInterface
->
GetNtrackingStations
();
...
...
@@ -60,14 +58,14 @@ bool CbmTrackingInputQaSts::CheckDistributions()
// Checks sigma of distribution fit with unity
auto
*
pFitFunc
=
pHist
.
GetFunction
(
"gaus"
);
if
(
!
pFitFunc
)
{
throw
std
::
runtime_error
(
TString
(
"STS tracking input QA: attempt to check sigma of histogram
\"
"
)
+
pHist
.
GetName
()
+
"
\"
with undefined fit"
)
;
LOG
(
error
)
<<
"STS tracking input QA: fit function not found for histogram
\"
"
<<
pHist
.
GetName
()
<<
'\"'
;
return
false
;
}
auto
vSigma
=
pFitFunc
->
GetParameter
(
2
);
auto
eSigma
=
pFitFunc
->
GetParError
(
2
);
// Select 3 sigma interval
LOG
(
info
)
<<
"Checking histogram
\"
"
<<
pHist
.
GetName
()
<<
"
\"
:
fit result
= "
<<
vSigma
<<
" +/- "
<<
eSigma
;
LOG
(
info
)
<<
"Checking histogram
\"
"
<<
pHist
.
GetName
()
<<
"
\"
:
sigma(fit)
= "
<<
vSigma
<<
" +/- "
<<
eSigma
;
if
(
std
::
fabs
(
vSigma
-
1.
)
<
3.
*
eSigma
)
{
return
true
;
}
else
{
return
false
;
...
...
@@ -147,7 +145,7 @@ void CbmTrackingInputQaSts::DeInit()
//
void
CbmTrackingInputQaSts
::
Exec
(
Option_t
*
)
{
// Run resolution Q
a
// Run resolution Q
A
ResolutionQa
();
// Update number of events
...
...
@@ -158,19 +156,18 @@ void CbmTrackingInputQaSts::Exec(Option_t*)
//
void
CbmTrackingInputQaSts
::
Finish
()
{
std
::
cout
<<
"CALL CbmTrackingInputQaSts::Finish()
\n
"
;
// Fit histograms
this
->
FitHistograms
();
bool
isFitSucceed
=
this
->
FitHistograms
();
if
(
!
isFitSucceed
)
{
LOG
(
error
)
<<
"STS tracking input QA: histograms could not be fitted"
;
}
// Check accumulated distributions
bool
areResolutionsOk
=
isFitSucceed
&&
CheckDistributions
();
// Add output to a sink
auto
*
pSink
=
FairRootManager
::
Instance
()
->
GetSink
();
if
(
pSink
)
{
pSink
->
WriteObject
(
&
GetQa
(),
nullptr
);
}
// Check accumulated distributions
bool
areResolutionsOk
=
CheckDistributions
();
// TODO: Collect all the flags in one place and make a decission here (S.Zharko)
// TODO: Collect all the flags in one place and make a decision here (S.Zharko)
if
(
areResolutionsOk
)
{
LOG
(
info
)
<<
this
->
GetName
()
<<
":
\033
[1;32mtask succeeded
\033
[0m"
;
}
else
{
...
...
@@ -180,21 +177,35 @@ void CbmTrackingInputQaSts::Finish()
// ---------------------------------------------------------------------------------------------------------------------
//
void
CbmTrackingInputQaSts
::
FitHistograms
()
bool
CbmTrackingInputQaSts
::
FitHistograms
()
{
std
::
cout
<<
"CALL CbmTrackingInputQaSts::FitHistograms()
\n
"
;
bool
res
=
true
;
// flag: true - fit succeed, false - fit failed
// Function, which provides fit of a histogram with necessary checks
// If the histogram is empty, the function returns false.
auto
FitHistogram
=
[](
TH1
&
hist
,
const
char
*
fcnname
,
const
char
*
fitopt
)
{
if
(
hist
.
GetEntries
()
>
0
)
{
hist
.
Fit
(
fcnname
,
fitopt
);
return
true
;
}
else
{
LOG
(
warn
)
<<
"STS tracking input QA: attempt to fit an empty histogram
\"
"
<<
hist
.
GetName
()
<<
'\"'
;
return
false
;
}
};
const
int
nStations
=
fpDetectorInterface
->
GetNtrackingStations
();
for
(
int
iSt
=
0
;
iSt
<
nStations
;
++
iSt
)
{
// Fit histograms
fHistResidualX
[
iSt
].
Fit
(
"gaus"
,
"Q"
);
fHistResidualY
[
iSt
].
Fit
(
"gaus"
,
"Q"
);
fHistResidualT
[
iSt
].
Fit
(
"gaus"
,
"Q"
);
fHistPullX
[
iSt
].
Fit
(
"gaus"
,
"Q"
);
fHistPullY
[
iSt
].
Fit
(
"gaus"
,
"Q"
);
fHistPullT
[
iSt
].
Fit
(
"gaus"
,
"Q"
);
res
=
FitHistogram
(
fHistResidualX
[
iSt
],
"gaus"
,
"Q"
)
&&
res
;
res
=
FitHistogram
(
fHistResidualY
[
iSt
],
"gaus"
,
"Q"
)
&&
res
;
res
=
FitHistogram
(
fHistResidualT
[
iSt
],
"gaus"
,
"Q"
)
&&
res
;
res
=
FitHistogram
(
fHistPullX
[
iSt
],
"gaus"
,
"Q"
)
&&
res
;
res
=
FitHistogram
(
fHistPullY
[
iSt
],
"gaus"
,
"Q"
)
&&
res
;
res
=
FitHistogram
(
fHistPullT
[
iSt
],
"gaus"
,
"Q"
)
&&
res
;
}
return
res
;
}
// ---------------------------------------------------------------------------------------------------------------------
...
...
@@ -303,7 +314,7 @@ InitStatus CbmTrackingInputQaSts::InitCanvases()
fCanvEfficiencyR
.
Clear
();
fCanvEfficiencyXY
.
Clear
();
// D
e
vide canvases into sections to store plots vs. station ID
// D
i
vide canvases into sections to store plots vs. station ID
fCanvResidualX
.
Divide2D
(
fpDetectorInterface
->
GetNtrackingStations
());
fCanvResidualY
.
Divide2D
(
fpDetectorInterface
->
GetNtrackingStations
());
fCanvResidualT
.
Divide2D
(
fpDetectorInterface
->
GetNtrackingStations
());
...
...
@@ -470,7 +481,7 @@ CbmMatch CbmTrackingInputQaSts::MatchHits(const CbmStsHit* pHit, int iHit)
{
CbmMatch
res
;
// Matching result
// Front and back cluster inde
c
es
// Front and back cluster inde
x
es
const
int
iClusterF
=
pHit
->
GetFrontClusterId
();
if
(
iClusterF
<
0
)
{
LOG
(
error
)
<<
"STD: hit (id = "
<<
iHit
<<
") has incorrect front cluster index: "
<<
iClusterF
;
...
...
@@ -798,7 +809,4 @@ void CbmTrackingInputQaSts::ResolutionQa()
// ---------------------------------------------------------------------------------------------------------------------
//
void
CbmTrackingInputQaSts
::
SetParContainers
()
{
std
::
cout
<<
"
\033
[1;32mCALL:
\033
[0mCbmTrackingInputQaSts::SetParContainers()
\n
"
;
}
void
CbmTrackingInputQaSts
::
SetParContainers
()
{}
This diff is collapsed.
Click to expand it.
reco/L1/qa/CbmTrackingInputQaSts.h
+
5
−
3
View file @
fe19f13e
...
...
@@ -66,9 +66,6 @@ public:
/// FairTask: Action at hte end of the run
void
Finish
();
/// Fits histograms
void
FitHistograms
();
/// Gets maximum allowed distance between z-components of hit/MC-point position and the station center [cm]
double
GetMaxDistanceZ
()
const
{
return
fMaxDistanceZ
;
}
...
...
@@ -113,8 +110,13 @@ private:
void
DeInit
();
/// Fills distributions of residuals
/// \return Success status
bool
FillHistosResiduals
();
/// Fits histograms
/// \return Success status
bool
FitHistograms
();
/// Checks geometry
InitStatus
GeometryQa
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment