Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Project Juggler
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
Wouter Deconinck
Project Juggler
Commits
93d6e22a
Commit
93d6e22a
authored
4 years ago
by
Sylvester Joosten
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "More realistic smearing in dummyrecon"
parent
b7d57689
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
JugBase/src/components/MC2DummyParticle.cpp
+23
-15
23 additions, 15 deletions
JugBase/src/components/MC2DummyParticle.cpp
with
23 additions
and
15 deletions
JugBase/src/components/MC2DummyParticle.cpp
+
23
−
15
View file @
93d6e22a
#include
<algorithm>
#include
<cmath>
#include
"GaudiAlg/Transformer.h"
#include
"GaudiAlg/Producer.h"
#include
"GaudiAlg/GaudiTool.h"
#include
"Gaudi/Algorithm.h"
#include
"GaudiAlg/GaudiTool.h"
#include
"GaudiAlg/Producer.h"
#include
"GaudiAlg/Transformer.h"
#include
"GaudiKernel/RndmGenerators.h"
#include
<algorithm>
#include
<cmath>
// FCCSW
#include
"JugBase/DataHandle.h"
...
...
@@ -13,16 +13,16 @@
#include
"dd4pod/Geant4ParticleCollection.h"
#include
"eicd/ReconstructedParticleCollection.h"
namespace
Jug
{
namespace
Base
{
class
MC2DummyParticle
:
public
GaudiAlgorithm
{
public:
DataHandle
<
dd4pod
::
Geant4ParticleCollection
>
m_inputHitCollection
{
"mcparticles"
,
Gaudi
::
DataHandle
::
Reader
,
this
};
DataHandle
<
eic
::
ReconstructedParticleCollection
>
m_outputHitCollection
{
"DummyReconstructedParticles"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
Rndm
::
Numbers
m_gaussDist
;
Gaudi
::
Property
<
double
>
m_smearing
{
this
,
"smearing"
,
0.01
/* 1 percent*/
};
DataHandle
<
dd4pod
::
Geant4ParticleCollection
>
m_inputHitCollection
{
"mcparticles"
,
Gaudi
::
DataHandle
::
Reader
,
this
};
DataHandle
<
eic
::
ReconstructedParticleCollection
>
m_outputHitCollection
{
"DummyReconstructedParticles"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
Rndm
::
Numbers
m_gaussDist
;
Gaudi
::
Property
<
double
>
m_smearing
{
this
,
"smearing"
,
0.01
/* 1 percent*/
};
MC2DummyParticle
(
const
std
::
string
&
name
,
ISvcLocator
*
svcLoc
)
:
GaudiAlgorithm
(
name
,
svcLoc
)
{
...
...
@@ -51,10 +51,18 @@ namespace Jug {
if
(
p
.
genStatus
()
!=
1
)
{
continue
;
}
double
momentum
=
std
::
hypot
(
p
.
psx
(),
p
.
psy
(),
p
.
psz
());
double
energy
=
std
::
hypot
(
momentum
,
p
.
mass
());
eic
::
ReconstructedParticle
rec_part
(
p
.
pdgID
(),
energy
*
m_gaussDist
(),
{
p
.
psx
()
*
m_gaussDist
(),
p
.
psy
()
*
m_gaussDist
(),
p
.
psz
()
*
m_gaussDist
()},
(
double
)
p
.
charge
(),
p
.
mass
());
// for now just use total momentum smearing as this is the largest effect,
// ideally we should also smear the angles but this should be good enough
// for now.
const
double
pgen
=
std
::
hypot
(
p
.
psx
(),
p
.
psy
(),
p
.
psz
());
const
double
momentum
=
pgen
*
m_gaussDist
();
const
double
energy
=
std
::
hypot
(
momentum
,
p
.
mass
());
const
double
px
=
p
.
psx
()
*
momentum
/
pgen
;
const
double
py
=
p
.
psy
()
*
momentum
/
pgen
;
const
double
pz
=
p
.
psz
()
*
momentum
/
pgen
;
eic
::
ReconstructedParticle
rec_part
{
p
.
pdgID
(),
energy
,
{
px
,
py
,
pz
},
(
double
)
p
.
charge
(),
p
.
mass
()};
out_parts
->
push_back
(
rec_part
);
}
return
StatusCode
::
SUCCESS
;
...
...
@@ -64,5 +72,5 @@ namespace Jug {
DECLARE_COMPONENT
(
MC2DummyParticle
)
}
// namespace Base
}
// namespace
Gaudi
}
// namespace
Jug
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