Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
EIC
Project Juggler
Commits
211aad01
Commit
211aad01
authored
Sep 22, 2020
by
Jihee Kim
Browse files
Merge branch 'master' into crystal_digi
parents
805118e6
e44ba587
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
211aad01
...
...
@@ -12,18 +12,18 @@ stages:
compile
:
stage
:
build
tags
:
-
s
odium
-
s
ilicon
before_script
:
-
pwd && ls -lrth
script
:
-
export homedir=$(pwd) && pwd && cd /tmp && git clone --depth=1 https://eicweb.phy.anl.gov/EIC/NPDet.git && mkdir build && cd build && cmake ../NPDet/. && make -j20 install
-
cd /tmp && git clone --depth=1 https://eicweb.phy.anl.gov/EIC/eicd.git && mkdir eicd_build && cd eicd_build && cmake ../eicd/. && make -j20 install
-
cd $homedir && ls -lrth && mkdir build && cd build && cmake .. && make -j
2
0
-
cd $homedir && ls -lrth && mkdir build && cd build && cmake .. && make -j
1
0
run_example
:
stage
:
run
tags
:
-
s
odium
-
s
ilicon
script
:
-
./build/run gaudirun.py Examples/options/hello_world.py
...
...
@@ -31,6 +31,6 @@ run_example2:
image
:
eicweb.phy.anl.gov:4567/eic/npdet/npdet:latest
stage
:
run
tags
:
-
s
odium
-
s
ilicon
script
:
-
./build/run gaudirun.py JugBase/tests/options/simple_reader.py
JugDigi/src/components/CrystalEndcapsDigi.cpp
View file @
211aad01
...
...
@@ -9,10 +9,9 @@
#include
"JugBase/DataHandle.h"
// Event Model related classes
#include
"eicd/CalorimeterHitCollection.h"
#include
"eicd/CalorimeterHitData.h"
#include
"eicd/
Raw
CalorimeterHitCollection.h"
#include
"eicd/
Raw
CalorimeterHitData.h"
#include
"dd4pod/CalorimeterHitCollection.h"
#include
"dd4pod/Geant4ParticleCollection.h"
namespace
Jug
{
namespace
Digi
{
...
...
@@ -24,7 +23,7 @@ namespace Jug {
class
CrystalEndcapsDigi
:
public
GaudiAlgorithm
{
public:
Gaudi
::
Property
<
double
>
m_energyResolution
{
this
,
"energyResolution"
,
0.02
};
// 2%
sqrt(E)
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
};
...
...
@@ -53,7 +52,7 @@ namespace Jug {
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
*
100.0
+
m_gaussDist
*
sqrt
(
ahit
.
energyDeposit
)
,
(
double
)
ahit
.
truth
.
time
);
(
long
long
)
(
ahit
.
energyDeposit
()
+
m_gaussDist
*
sqrt
(
ahit
.
energyDeposit
()))
*
100.0
,
(
double
)
ahit
.
truth
()
.
time
);
rawhits
->
push_back
(
rawhit
);
}
return
StatusCode
::
SUCCESS
;
...
...
JugDigi/src/components/HadronicCalDigi.cpp
0 → 100644
View file @
211aad01
#include
<algorithm>
#include
"GaudiAlg/Transformer.h"
#include
"GaudiAlg/Producer.h"
#include
"GaudiAlg/GaudiTool.h"
#include
"GaudiKernel/RndmGenerators.h"
#include
"Gaudi/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
{
/** Hadronic Calorimeter Digitization.
*
* \f$ \sigma/E = a/\sqrt{E} \oplus b \f$
*
* \param a stochastic term (0.5 is 50%)
* \param b constant term (0.05 is 5%)
*
* Resolution terms are added in quadrature.
* When digitizing they are assumed to be independent random variables and are sampled as such.
*
*
*/
class
HadronicCalDigi
:
public
GaudiAlgorithm
{
public:
Gaudi
::
Property
<
double
>
m_energyResolution_a
{
this
,
"energyResolution_a"
,
0.5
/*50 percent*/
};
Gaudi
::
Property
<
double
>
m_energyResolution_b
{
this
,
"energyResolution_b"
,
0.05
/* 5 percent*/
};
Rndm
::
Numbers
m_gaussDist_a
;
Rndm
::
Numbers
m_gaussDist_b
;
DataHandle
<
dd4pod
::
CalorimeterHitCollection
>
m_inputHitCollection
{
"inputHitCollection"
,
Gaudi
::
DataHandle
::
Reader
,
this
};
DataHandle
<
eic
::
RawCalorimeterHitCollection
>
m_outputHitCollection
{
"outputHitCollection"
,
Gaudi
::
DataHandle
::
Writer
,
this
};
public:
HadronicCalDigi
(
const
std
::
string
&
name
,
ISvcLocator
*
svcLoc
)
:
GaudiAlgorithm
(
name
,
svcLoc
)
{
declareProperty
(
"inputHitCollection"
,
m_inputHitCollection
,
""
);
declareProperty
(
"outputHitCollection"
,
m_outputHitCollection
,
""
);
}
StatusCode
initialize
()
override
{
IRndmGenSvc
*
randSvc
=
svc
<
IRndmGenSvc
>
(
"RndmGenSvc"
,
true
);
StatusCode
sc
=
m_gaussDist_a
.
initialize
(
randSvc
,
Rndm
::
Gauss
(
0.0
,
m_energyResolution_a
.
value
()
));
if
(
!
sc
.
isSuccess
())
{
return
StatusCode
::
FAILURE
;
}
sc
=
m_gaussDist_b
.
initialize
(
randSvc
,
Rndm
::
Gauss
(
0.0
,
m_energyResolution_b
.
value
()));
if
(
!
sc
.
isSuccess
())
{
return
StatusCode
::
FAILURE
;
}
if
(
GaudiAlgorithm
::
initialize
().
isFailure
())
return
StatusCode
::
FAILURE
;
// f_counter = m_starting_value.value();
return
StatusCode
::
SUCCESS
;
}
StatusCode
execute
()
override
{
// input collection
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
)
{
// std::cout << ahit << "\n";
double
sqrtE
=
std
::
sqrt
(
ahit
.
energyDeposit
())
;
double
aterm
=
m_gaussDist_a
()
*
sqrtE
;
double
bterm
=
ahit
.
energyDeposit
()
*
m_gaussDist_b
();
// here 1000 is arbitrary scale factor
eic
::
RawCalorimeterHit
rawhit
((
long
long
)
ahit
.
cellID
(),
(
long
long
)
ahit
.
cellID
(),
(
long
long
)(
ahit
.
energyDeposit
()
+
aterm
+
bterm
)
*
1000
,
0
);
rawhits
->
push_back
(
rawhit
);
}
return
StatusCode
::
SUCCESS
;
}
};
DECLARE_COMPONENT
(
HadronicCalDigi
)
}
// namespace Digi
}
// namespace Jug
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment