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
1f4ffd12
Commit
1f4ffd12
authored
2 years ago
by
Sergey Gorbunov
Committed by
Volker Friese
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add Sts->Tof matching efficiencies to CbmKFTrackQa task
parent
509201a1
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1066
KF: fixes in KFParticleFinder according to the new TOF geometry
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
reco/KF/KFQA/CbmKFTrackQa.cxx
+125
-62
125 additions, 62 deletions
reco/KF/KFQA/CbmKFTrackQa.cxx
reco/KF/KFQA/CbmKFTrackQa.h
+5
-0
5 additions, 0 deletions
reco/KF/KFQA/CbmKFTrackQa.h
with
130 additions
and
62 deletions
reco/KF/KFQA/CbmKFTrackQa.cxx
+
125
−
62
View file @
1f4ffd12
...
...
@@ -33,6 +33,7 @@
#include
"TH2F.h"
#include
"TMath.h"
#include
"TObject.h"
#include
"TProfile.h"
//c++ and std headers
#include
"CbmGlobalTrack.h"
...
...
@@ -220,7 +221,7 @@ CbmKFTrackQa::CbmKFTrackQa(const char* name, Int_t iVerbose, TString outFileName
gDirectory
->
mkdir
(
"TOF"
);
gDirectory
->
cd
(
"TOF"
);
{
TString
histoName2D
[
2
]
=
{
"M2P"
,
"M2dEdX"
};
TString
histoName2D
[
NTofHisto2D
]
=
{
"M2P"
,
"M2dEdX"
};
TString
xAxisName
[
NTofHisto2D
]
=
{
"p [GeV/c]"
,
"dE/dx [keV/(cm)]"
};
TString
yAxisName
[
NTofHisto2D
]
=
{
"m^{2} [GeV^{2}/c^{4}]"
,
"m^{2} [GeV^{2}/c^{4}]"
};
float
xMin
[
NTofHisto2D
]
=
{
-
15.
,
0.
};
...
...
@@ -230,6 +231,8 @@ CbmKFTrackQa::CbmKFTrackQa(const char* name, Int_t iVerbose, TString outFileName
float
yMax
[
NTofHisto2D
]
=
{
14.
,
14.
};
Int_t
yBins
[
NTofHisto2D
]
=
{
1600
,
1600
};
TString
profName
[
NTofProfiles
]
=
{
"MatchEff"
,
"Mismatch"
,
"No match"
};
TString
subdirs
[
14
]
=
{
"AllTracks"
,
"e"
,
"mu"
,
"pi"
,
"K"
,
"p"
,
"Fragments"
,
"Mismatch"
,
"GhostTrack"
,
"WrongTofPoint"
,
"d"
,
"t"
,
"He3"
,
"He4"
};
...
...
@@ -244,6 +247,11 @@ CbmKFTrackQa::CbmKFTrackQa(const char* name, Int_t iVerbose, TString outFileName
hTofHisto2D
[
iDir
][
iH
]
->
GetYaxis
()
->
SetTitle
(
yAxisName
[
iH
]);
}
for
(
int
iH
=
0
;
iH
<
NTofProfiles
;
iH
++
)
{
hTofProfiles
[
iDir
][
iH
]
=
new
TProfile
(
profName
[
iH
].
Data
(),
profName
[
iH
].
Data
(),
100
,
0.
,
15.
);
hTofProfiles
[
iDir
][
iH
]
->
GetXaxis
()
->
SetTitle
(
"p [GeV/c]"
);
}
gDirectory
->
cd
(
".."
);
//Tof
}
}
...
...
@@ -276,7 +284,7 @@ InitStatus CbmKFTrackQa::Init()
}
// Get mc event list
fMcEventList
=
static_cast
<
CbmMCEventList
*>
(
ioman
->
GetObject
(
"
fMcEventListBranchName
"
));
fMcEventList
=
static_cast
<
CbmMCEventList
*>
(
ioman
->
GetObject
(
fMcEventListBranchName
));
if
(
!
fMcEventList
)
{
Warning
(
"CbmKFTrackQa::Init"
,
"mc event list not found!"
);
return
kERROR
;
...
...
@@ -433,13 +441,13 @@ void CbmKFTrackQa::Exec(Option_t* /*opt*/)
if
(
trackMatch
[
iTr
]
>
-
1
)
pdg
[
iTr
]
=
mcTracks
[
trackMatch
[
iTr
]].
PDG
();
}
CbmKFVertex
kfVertex
;
CbmL1PFFitter
fitter
;
vector
<
float
>
vChiToPrimVtx
;
vector
<
CbmL1PFFitter
::
PFFieldRegion
>
vField
;
fitter
.
Fit
(
vRTracks
,
pdg
);
fitter
.
GetChiToVertex
(
vRTracks
,
vField
,
vChiToPrimVtx
,
kfVertex
,
3000000
);
// CbmKFVertex kfVertex; ! the MC vertex is not at 0,0,0 any longer. !
// vector<float> vChiToPrimVtx;
// fitter.GetChiToVertex(vRTracks, vField, vChiToPrimVtx, kfVertex, 3000000);
for
(
unsigned
int
iTr
=
0
;
iTr
<
vRTracks
.
size
();
iTr
++
)
{
if
(
trackMatch
[
iTr
]
<
0
)
continue
;
...
...
@@ -703,19 +711,75 @@ void CbmKFTrackQa::Exec(Option_t* /*opt*/)
}
}
//Check Tof quality
if
(
fTofHitArray
&&
fTofHitMatchArray
)
{
do
{
// Check Tof quality.
// ( the use of "do{ .. } while(0);" let us exit the scope with the "break" operator.
// it makes the code lighter. )
if
(
!
fTofHitArray
||
!
fTofHitMatchArray
)
{
break
;
}
Int_t
tofIndex
=
globalTrack
->
GetTofHitIndex
();
// for tof histo
Int_t
stsIndex
=
globalTrack
->
GetStsTrackIndex
();
// std::cout << "tofIndex: " << tofIndex << " stsIndex: " << stsIndex << std::endl;
if
(
tofIndex
>
-
1
&&
stsIndex
>
-
1
)
{
if
(
stsIndex
<
0
)
{
break
;
}
// check Sts -> Tof matching efficiency
bool
isReconstructible
=
0
;
for
(
Int_t
ih
=
0
;
ih
<
fTofHitMatchArray
->
GetEntriesFast
();
ih
++
)
{
CbmMatch
*
tofHitMatch
=
(
CbmMatch
*
)
fTofHitMatchArray
->
At
(
ih
);
CbmTofPoint
*
tofPoint
=
(
CbmTofPoint
*
)
fTofPoints
->
Get
(
tofHitMatch
->
GetMatchedLink
());
if
(
!
tofPoint
)
continue
;
Int_t
tofMCTrackId
=
tofPoint
->
GetTrackID
();
if
(
tofMCTrackId
==
stsTrackMCIndex
)
{
isReconstructible
=
1
;
break
;
}
}
if
(
stsTrackMCIndex
<
0
)
{
isReconstructible
=
0
;
}
if
(
isReconstructible
)
{
bool
reconstructed
=
0
;
bool
mismatched
=
0
;
bool
matched
=
0
;
if
(
tofIndex
>=
0
)
{
matched
=
1
;
mismatched
=
1
;
//CbmTofHit* tofHit = (CbmTofHit*) fTofHitArray->At(tofIndex);
CbmMatch
*
tofHitMatch
=
(
CbmMatch
*
)
fTofHitMatchArray
->
At
(
tofIndex
);
CbmTofPoint
*
tofPoint
=
(
CbmTofPoint
*
)
fTofPoints
->
Get
(
tofHitMatch
->
GetMatchedLink
());
Int_t
tofMCTrackId
=
tofPoint
->
GetTrackID
();
if
(
tofMCTrackId
==
stsTrackMCIndex
)
{
reconstructed
=
1
;
mismatched
=
0
;
}
}
int
iTrackCategory
=
GetHistoIndex
(
pdg
[
stsTrackIndex
]);
hTofProfiles
[
0
][
0
]
->
Fill
(
p
,
reconstructed
);
hTofProfiles
[
0
][
1
]
->
Fill
(
p
,
mismatched
);
hTofProfiles
[
0
][
2
]
->
Fill
(
p
,
!
matched
);
hTofProfiles
[
iTrackCategory
][
0
]
->
Fill
(
p
,
reconstructed
);
hTofProfiles
[
iTrackCategory
][
1
]
->
Fill
(
p
,
mismatched
);
hTofProfiles
[
iTrackCategory
][
2
]
->
Fill
(
p
,
!
matched
);
}
if
(
tofIndex
<
0
)
{
break
;
}
CbmTofHit
*
tofHit
=
(
CbmTofHit
*
)
fTofHitArray
->
At
(
tofIndex
);
CbmMatch
*
tofHitMatch
=
(
CbmMatch
*
)
fTofHitMatchArray
->
At
(
tofIndex
);
CbmTrackMatchNew
*
stsMatch
=
(
CbmTrackMatchNew
*
)
fStsTrackMatchArray
->
At
(
stsIndex
);
CbmLink
tofLink
=
tofHitMatch
->
GetMatchedLink
();
if
(
tofLink
.
GetFile
()
>=
0
&&
tofLink
.
GetEntry
()
>=
0
)
{
// the mc link is needed for the event time
// a valid mc link is needed to get the event time
if
(
tofLink
.
GetFile
()
<
0
||
tofLink
.
GetEntry
()
<
0
)
{
break
;
}
double
eventTime
=
fMcEventList
->
GetEventTime
(
tofLink
);
...
...
@@ -730,7 +794,8 @@ void CbmKFTrackQa::Exec(Option_t* /*opt*/)
hTofHisto2D
[
0
][
0
]
->
Fill
(
p
*
q
,
m2
);
hTofHisto2D
[
0
][
1
]
->
Fill
(
eloss
*
1e6
,
m2
);
if
(
tofHit
&&
tofHitMatch
&&
stsMatch
)
{
if
(
!
tofHit
||
!
tofHitMatch
||
!
stsMatch
)
{
break
;
}
CbmTofPoint
*
tofPoint
=
(
CbmTofPoint
*
)
fTofPoints
->
Get
(
tofLink
);
Int_t
tofMCTrackId
=
tofPoint
->
GetTrackID
();
// Double_t tofMCTime = tofPoint->GetTime();
...
...
@@ -752,10 +817,8 @@ void CbmKFTrackQa::Exec(Option_t* /*opt*/)
hTofHisto2D
[
iHitCategory
][
0
]
->
Fill
(
p
*
q
,
m2
);
hTofHisto2D
[
iHitCategory
][
1
]
->
Fill
(
eloss
*
1e6
,
m2
);
}
}
}
}
}
while
(
0
);
// Tof quality
}
}
}
...
...
This diff is collapsed.
Click to expand it.
reco/KF/KFQA/CbmKFTrackQa.h
+
5
−
0
View file @
1f4ffd12
...
...
@@ -22,6 +22,7 @@ class TFile;
class
TDirectory
;
class
TH1F
;
class
TH2F
;
class
TProfile
;
class
TObject
;
class
CbmMCDataArray
;
class
CbmMCEventList
;
...
...
@@ -125,6 +126,10 @@ private:
[
14
]
[
NTofHisto2D
];
//All tracks, electrons, muons, pions, kaons, protons, fragments, mismatch, ghost hit, ghost tof hit, d, t, He3, He4
static
const
int
NTofProfiles
=
3
;
TProfile
*
hTofProfiles
[
14
]
[
NTofProfiles
];
//All tracks, electrons, muons, pions, kaons, protons, fragments, mismatch, ghost hit, ghost tof hit, d, t, He3, He4
ClassDef
(
CbmKFTrackQa
,
1
);
};
...
...
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