Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LHCb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
LHCb
LHCb
Commits
0db48478
Commit
0db48478
authored
1 year ago
by
Christopher Rob Jones
Browse files
Options
Downloads
Patches
Plain Diff
DecodedDataFromMCRichHits: Add readout inefficiency emulation
parent
1d24bf71
No related branches found
No related tags found
1 merge request
!4337
Misc. improvements to support RICH 4D Reco
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Rich/RichFutureMCUtils/src/component/DecodedDataFromMCRichHits.cpp
+21
-2
21 additions, 2 deletions
...FutureMCUtils/src/component/DecodedDataFromMCRichHits.cpp
with
21 additions
and
2 deletions
Rich/RichFutureMCUtils/src/component/DecodedDataFromMCRichHits.cpp
+
21
−
2
View file @
0db48478
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
// Gaudi (must be first)
// Gaudi (must be first)
#include
"GaudiKernel/ParsersFactory.h"
#include
"GaudiKernel/ParsersFactory.h"
#include
"GaudiKernel/RndmGenerators.h"
#include
"GaudiKernel/StdArrayAsProperty.h"
#include
"GaudiKernel/StdArrayAsProperty.h"
// Rich (Future) Kernel
// Rich (Future) Kernel
...
@@ -64,6 +65,12 @@ namespace Rich::Future::MC {
...
@@ -64,6 +65,12 @@ namespace Rich::Future::MC {
}
}
public
:
public
:
/// Initialize
StatusCode
initialize
()
override
{
return
MultiTransformer
::
initialize
().
andThen
(
[
&
]
{
m_randZeroOne
=
Rndm
::
Numbers
(
randSvc
(),
Rndm
::
Flat
(
0.0
,
1.0
)
);
}
);
}
/// Algorithm execution via transform
/// Algorithm execution via transform
OutData
operator
()(
LHCb
::
MCRichHits
const
&
main_mchits
)
const
override
{
OutData
operator
()(
LHCb
::
MCRichHits
const
&
main_mchits
)
const
override
{
...
@@ -111,8 +118,7 @@ namespace Rich::Future::MC {
...
@@ -111,8 +118,7 @@ namespace Rich::Future::MC {
continue
;
continue
;
}
}
// Are we inside the 0-25 ns window ?
// Are we inside the 0-25 ns window ?
const
auto
hitT
=
getTime
(
mchit
);
const
auto
hitT
=
getTime
(
mchit
);
// time with shift for each RICH
const
auto
hitTShifted
=
hitT
-
m_timeShift
[
id
.
rich
()];
const
auto
hitTShifted
=
hitT
-
m_timeShift
[
id
.
rich
()];
_ri_verbo
<<
"Shifted time = "
<<
hitTShifted
<<
endmsg
;
_ri_verbo
<<
"Shifted time = "
<<
hitTShifted
<<
endmsg
;
if
(
hitTShifted
>=
0.0
&&
hitTShifted
<=
25.0
)
{
if
(
hitTShifted
>=
0.0
&&
hitTShifted
<=
25.0
)
{
...
@@ -148,6 +154,9 @@ namespace Rich::Future::MC {
...
@@ -148,6 +154,9 @@ namespace Rich::Future::MC {
// Should never fail but just in case...
// Should never fail but just in case...
if
(
hits
.
empty
()
)
{
continue
;
}
if
(
hits
.
empty
()
)
{
continue
;
}
// Apply random inefficiency for each RICH
if
(
m_randZeroOne
.
shoot
()
>
m_detEff
[
id
.
rich
()]
)
{
continue
;
}
// temporary copy of SmartID
// temporary copy of SmartID
auto
newID
=
id
;
auto
newID
=
id
;
...
@@ -206,6 +215,12 @@ namespace Rich::Future::MC {
...
@@ -206,6 +215,12 @@ namespace Rich::Future::MC {
return
out_data
;
return
out_data
;
}
}
private
:
// data
/// random number between 0 and 1
Rndm
::
Numbers
m_randZeroOne
{};
private
:
private
:
// Handles to access MCRichHits other than Signal, as they are not necessary there
// Handles to access MCRichHits other than Signal, as they are not necessary there
DataObjectReadHandle
<
LHCb
::
MCRichHits
>
m_prevHits
{
this
,
"PrevLocation"
,
"Prev/"
+
LHCb
::
MCRichHitLocation
::
Default
};
DataObjectReadHandle
<
LHCb
::
MCRichHits
>
m_prevHits
{
this
,
"PrevLocation"
,
"Prev/"
+
LHCb
::
MCRichHitLocation
::
Default
};
...
@@ -240,6 +255,10 @@ namespace Rich::Future::MC {
...
@@ -240,6 +255,10 @@ namespace Rich::Future::MC {
/// Time window shift for each RICH
/// Time window shift for each RICH
Gaudi
::
Property
<
DetectorArray
<
double
>>
m_timeShift
{
Gaudi
::
Property
<
DetectorArray
<
double
>>
m_timeShift
{
this
,
"TimeCalib"
,
{
0.
,
40.
},
"Global time shift for each RICH, to get both to same calibrated point"
};
this
,
"TimeCalib"
,
{
0.
,
40.
},
"Global time shift for each RICH, to get both to same calibrated point"
};
/// RICH Detector efficiency factor
Gaudi
::
Property
<
DetectorArray
<
double
>>
m_detEff
{
this
,
"ReadoutEfficiency"
,
{
0.95
,
0.95
},
"Readout efficiency to emulate for each RICH"
};
};
};
// Declaration of the Algorithm Factory
// Declaration of the Algorithm Factory
...
...
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