Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Qiunan Zhang
cbmroot
Commits
5797f383
Commit
5797f383
authored
4 years ago
by
Dominik Smith
Browse files
Options
Downloads
Patches
Plain Diff
CbmBuildEventsQA now supports detectors other than STS.
parent
7d0d69b6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
reco/eventbuilder/digis/CbmBuildEventsQA.cxx
+80
-63
80 additions, 63 deletions
reco/eventbuilder/digis/CbmBuildEventsQA.cxx
reco/eventbuilder/digis/CbmBuildEventsQA.h
+2
-0
2 additions, 0 deletions
reco/eventbuilder/digis/CbmBuildEventsQA.h
with
82 additions
and
63 deletions
reco/eventbuilder/digis/CbmBuildEventsQA.cxx
+
80
−
63
View file @
5797f383
...
...
@@ -56,44 +56,57 @@ void CbmBuildEventsQA::Exec(Option_t*) {
<<
", links: "
<<
event
->
GetMatch
()
->
GetNofLinks
()
<<
", matched MC event number "
<<
mcEventNr
;
// --- Counters
Int_t
nDigis
=
event
->
GetNofData
(
ECbmDataType
::
kStsDigi
);
Int_t
nDigiCorrect
=
0
;
Int_t
nLinks
=
0
;
Int_t
nLinksCorrect
=
0
;
nMCEvents
+=
event
->
GetMatch
()
->
GetNofLinks
();
// --- Loop over STS digis
for
(
Int_t
iDigi
=
0
;
iDigi
<
nDigis
;
iDigi
++
)
{
UInt_t
index
=
event
->
GetIndex
(
ECbmDataType
::
kStsDigi
,
iDigi
);
const
CbmStsDigi
*
digi
=
fDigiMan
->
Get
<
CbmStsDigi
>
(
index
);
const
CbmMatch
*
digiMatch
=
fDigiMan
->
GetMatch
(
ECbmModuleId
::
kSts
,
index
);
assert
(
digi
);
assert
(
digiMatch
);
// --- Check MC event of digi match
if
(
digiMatch
->
GetMatchedLink
().
GetEntry
()
==
mcEventNr
)
nDigiCorrect
++
;
for
(
Int_t
iLink
=
0
;
iLink
<
digiMatch
->
GetNofLinks
();
iLink
++
)
{
Int_t
entry
=
digiMatch
->
GetLink
(
iLink
).
GetEntry
();
nLinks
++
;
if
(
entry
==
mcEventNr
)
nLinksCorrect
++
;
}
//# links in digi
}
//# digis
// --- QA output
LOG
(
info
)
<<
GetName
()
<<
": correct digis "
<<
nDigiCorrect
<<
" / "
<<
nDigis
<<
" = "
<<
100.
*
Double_t
(
nDigiCorrect
)
/
Double_t
(
nDigis
)
<<
" %, correct digi links "
<<
nLinksCorrect
<<
" / "
<<
nLinks
<<
" = "
<<
100.
*
Double_t
(
nLinksCorrect
)
/
Double_t
(
nLinks
)
<<
" % "
;
// --- Loop over all detector systems
for
(
ECbmModuleId
&
system
:
fSystems
)
{
// --- Skip system if no data branch or no match match present
if
(
!
fDigiMan
->
IsPresent
(
system
))
continue
;
if
(
!
fDigiMan
->
IsMatchPresent
(
system
))
continue
;
// --- Counters
Int_t
nDigis
=
event
->
GetNofData
(
GetDigiType
(
system
));
Int_t
nDigiCorrect
=
0
;
Int_t
nLinks
=
0
;
Int_t
nLinksCorrect
=
0
;
//LOG(info) << GetName() << ": Detector "
// << CbmModuleList::GetModuleNameCaps(system)
// << ", nDigis = " << nDigis;
// --- Loop over digis
for
(
Int_t
iDigi
=
0
;
iDigi
<
nDigis
;
iDigi
++
)
{
UInt_t
index
=
event
->
GetIndex
(
GetDigiType
(
system
),
iDigi
);
const
CbmMatch
*
digiMatch
=
fDigiMan
->
GetMatch
(
system
,
index
);
assert
(
digiMatch
);
// --- Check MC event of digi match
if
(
digiMatch
->
GetMatchedLink
().
GetEntry
()
==
mcEventNr
)
nDigiCorrect
++
;
//if (system == ECbmModuleId::kTof){ dev
// LOG(info) << "index = " <<index;
//}
for
(
Int_t
iLink
=
0
;
iLink
<
digiMatch
->
GetNofLinks
();
iLink
++
)
{
Int_t
entry
=
digiMatch
->
GetLink
(
iLink
).
GetEntry
();
nLinks
++
;
if
(
entry
==
mcEventNr
)
nLinksCorrect
++
;
}
//# links in digi
}
//# digis
// --- QA output
LOG
(
info
)
<<
GetName
()
<<
": Detector "
<<
CbmModuleList
::
GetModuleNameCaps
(
system
)
<<
", correct digis "
<<
nDigiCorrect
<<
" / "
<<
nDigis
<<
" = "
<<
100.
*
Double_t
(
nDigiCorrect
)
/
Double_t
(
nDigis
)
<<
" %, correct digi links "
<<
nLinksCorrect
<<
" / "
<<
nLinks
<<
" = "
<<
100.
*
Double_t
(
nLinksCorrect
)
/
Double_t
(
nLinks
)
<<
" % "
;
}
}
//# events
// Timer and counters
fNofEntries
++
;
timer
.
Stop
();
...
...
@@ -158,39 +171,43 @@ void CbmBuildEventsQA::MatchEvent(CbmEvent* event) {
LOG
(
info
)
<<
"No match data found in event. Creating new."
;
match
=
new
CbmMatch
();
event
->
SetMatch
(
match
);
}
else
{
LOG
(
info
)
<<
"Match data found in event. Clearing."
;
match
->
ClearLinks
();
}
//else{
// LOG(info) << "Match data found in event. Clearing.";
// match->ClearLinks();
// } //? event has no match
// LOG(info) << GetName() << ": Event " << event->GetNumber()
// << ", STS digis : " << event->GetNofData(ECbmDataType::kStsDigi);
// --- Loop over digis
for
(
Int_t
iDigi
=
0
;
iDigi
<
event
->
GetNofData
(
GetDigiType
(
ECbmModuleId
::
kSts
));
iDigi
++
)
{
Int_t
index
=
event
->
GetIndex
(
GetDigiType
(
ECbmModuleId
::
kSts
),
iDigi
);
//const CbmStsDigi* digi = fDigiMan->Get<CbmStsDigi>(index); not needed ?
const
CbmMatch
*
digiMatch
=
fDigiMan
->
GetMatch
(
ECbmModuleId
::
kSts
,
index
);
//assert(digi);
assert
(
digiMatch
);
// --- Update event match with digi links
// --- N.b.: The member "index" of CbmLink has here no meaning, since
// --- there is only one MC event per tree entry.
for
(
Int_t
iLink
=
0
;
iLink
<
digiMatch
->
GetNofLinks
();
iLink
++
)
{
Int_t
file
=
digiMatch
->
GetLink
(
iLink
).
GetFile
();
Int_t
entry
=
digiMatch
->
GetLink
(
iLink
).
GetEntry
();
Double_t
weight
=
digiMatch
->
GetLink
(
iLink
).
GetWeight
();
// LOG(info) << "Adding link (weight, entry, file): " << weight << " "
// << entry << " " << file;
match
->
AddLink
(
weight
,
0
,
entry
,
file
);
}
//# links in digi
}
//#digis
// --- Loop over all detector systems
for
(
ECbmModuleId
&
system
:
fSystems
)
{
// --- Skip system if no data branch or no match match present
if
(
!
fDigiMan
->
IsPresent
(
system
))
continue
;
if
(
!
fDigiMan
->
IsMatchPresent
(
system
))
continue
;
//only use reference detector for matching to MC event
if
(
system
!=
fRefDetector
)
continue
;
// --- Loop over digis
for
(
Int_t
iDigi
=
0
;
iDigi
<
event
->
GetNofData
(
GetDigiType
(
system
));
iDigi
++
)
{
Int_t
index
=
event
->
GetIndex
(
GetDigiType
(
system
),
iDigi
);
const
CbmMatch
*
digiMatch
=
fDigiMan
->
GetMatch
(
system
,
index
);
assert
(
digiMatch
);
// --- Update event match with digi links
// --- N.b.: The member "index" of CbmLink has here no meaning, since
// --- there is only one MC event per tree entry.
for
(
Int_t
iLink
=
0
;
iLink
<
digiMatch
->
GetNofLinks
();
iLink
++
)
{
Int_t
file
=
digiMatch
->
GetLink
(
iLink
).
GetFile
();
Int_t
entry
=
digiMatch
->
GetLink
(
iLink
).
GetEntry
();
Double_t
weight
=
digiMatch
->
GetLink
(
iLink
).
GetWeight
();
// LOG(info) << "Adding link (weight, entry, file): " << weight << " "
// << entry << " " << file;
match
->
AddLink
(
weight
,
0
,
entry
,
file
);
}
//# links in digi
}
//#digis
}
}
// ===========================================================================
...
...
This diff is collapsed.
Click to expand it.
reco/eventbuilder/digis/CbmBuildEventsQA.h
+
2
−
0
View file @
5797f383
...
...
@@ -52,6 +52,8 @@ private:
ECbmDataType
GetDigiType
(
ECbmModuleId
system
);
ECbmModuleId
fRefDetector
=
ECbmModuleId
::
kSts
;
CbmBuildEventsQA
(
const
CbmBuildEventsQA
&
);
CbmBuildEventsQA
&
operator
=
(
const
CbmBuildEventsQA
&
);
...
...
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