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
Container registry
Model registry
Operate
Environments
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
EIC
Project Juggler
Merge requests
!1
Crystal Endcaps Digitization
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Crystal Endcaps Digitization
jihee.kim/juggler:master
into
master
Overview
4
Commits
5
Pipelines
0
Changes
1
Merged
Jihee Kim
requested to merge
jihee.kim/juggler:master
into
master
4 years ago
Overview
4
Commits
5
Pipelines
0
Changes
1
Expand
Added crystal endcaps digitization script.
Edited
4 years ago
by
Jihee Kim
0
0
Merge request reports
Compare
master
version 3
3be31892
4 years ago
version 2
9b38c346
4 years ago
version 1
ca599dad
4 years ago
master (base)
and
latest version
latest version
599e1a59
5 commits,
4 years ago
version 3
3be31892
4 commits,
4 years ago
version 2
9b38c346
2 commits,
4 years ago
version 1
ca599dad
1 commit,
4 years ago
1 file
+
64
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
JugDigi/src/components/CrystalEndcapsDigi.cpp
0 → 100644
+
64
−
0
Options
#include
<algorithm>
#include
"GaudiAlg/Transformer.h"
#include
"GaudiAlg/GaudiTool.h"
#include
"GaudiKernel/RndmGenerators.h"
#include
"GaudiKernel/Property.h"
// FCCSW
#include
"JugBase/DataHandle.h"
// Event Model related classes
#include
"eicd/RawCalorimeterHitCollection.h"
#include
"eicd/RawCalorimeterHitData.h"
#include
"dd4pod/CalorimeterHitCollection.h"
namespace
Jug
{
namespace
Digi
{
/** Crystal Endcaps Calorimeter detector digitization.
*
*
*/
class
CrystalEndcapsDigi
:
public
GaudiAlgorithm
{
public:
Gaudi
::
Property
<
double
>
m_energyResolution
{
this
,
"energyResolution"
,
0.02
};
// 2%sqrt(E)
Rndm
::
Numbers
m_gaussDist
;
DataHandle
<
dd4pod
::
CalorimeterHitCollection
>
m_inputHitCollection
{
"inputHitCollection"
,
Gaudi
::
DataHandle
::
Reader
,
this
};
DataHandle
<
eic
::
RawCalorimeterHitCollection
>
m_outputHitCollection
{
"outputHitCollection"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
// ill-formed: using GaudiAlgorithm::GaudiAlgorithm;
CrystalEndcapsDigi
(
const
std
::
string
&
name
,
ISvcLocator
*
svcLoc
)
:
GaudiAlgorithm
(
name
,
svcLoc
)
{
declareProperty
(
"inputHitCollection"
,
m_inputHitCollection
,
""
);
declareProperty
(
"outputHitCollection"
,
m_outputHitCollection
,
""
);
}
StatusCode
initialize
()
override
{
if
(
GaudiAlgorithm
::
initialize
().
isFailure
())
return
StatusCode
::
FAILURE
;
IRndmGenSvc
*
randSvc
=
svc
<
IRndmGenSvc
>
(
"RndmGenSvc"
,
true
);
StatusCode
sc
=
m_gaussDist
.
initialize
(
randSvc
,
Rndm
::
Gauss
(
0.0
,
m_energyResolution
.
value
()));
if
(
!
sc
.
isSuccess
())
{
return
StatusCode
::
FAILURE
;
}
return
StatusCode
::
SUCCESS
;
}
StatusCode
execute
()
override
{
// input collections
const
dd4pod
::
CalorimeterHitCollection
*
simhits
=
m_inputHitCollection
.
get
();
// Create output collections
auto
rawhits
=
m_outputHitCollection
.
createAndPut
();
eic
::
RawCalorimeterHitCollection
*
rawHitCollection
=
new
eic
::
RawCalorimeterHitCollection
();
for
(
const
auto
&
ahit
:
*
simhits
){
eic
::
RawCalorimeterHit
rawhit
((
long
long
)
ahit
.
cellID
(),
(
long
long
)
ahit
.
cellID
(),
(
long
long
)(
ahit
.
energyDeposit
()
+
m_gaussDist
*
sqrt
(
ahit
.
energyDeposit
()))
*
100.0
,
(
double
)
ahit
.
truth
().
time
);
rawhits
->
push_back
(
rawhit
);
}
return
StatusCode
::
SUCCESS
;
}
};
DECLARE_COMPONENT
(
CrystalEndcapsDigi
)
}
// namespace Digi
}
// namespace Jug
Loading