Skip to content

Commit 18a4728

Browse files
authored
Merge pull request #10 from s6anloes/main
Added noise digitizer solution and updated test
2 parents c2784c2 + 751ac10 commit 18a4728

File tree

3 files changed

+61
-3
lines changed

3 files changed

+61
-3
lines changed

GaudiTutorial/RandomNoiseDigitizer/options/runRandomNoiseDigitizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
OutputLevel=INFO
4040
)
4141

42-
from Configurables import RandomNoiseDigitizerSolution
43-
random_noise_digitizer = RandomNoiseDigitizerSolution("RandomNoiseDigitizer",
42+
from Configurables import RandomNoiseDigitizer
43+
random_noise_digitizer = RandomNoiseDigitizer("RandomNoiseDigitizer",
4444
InputCaloSimHitCollection=["simplecaloRO"],
4545
OutputCaloDigiHitCollection=["CaloDigiHits"],
4646
uidSvcName="uidSvc",
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#
2+
# Copyright (c) 2020-2024 Key4hep-Project.
3+
#
4+
# This file is part of Key4hep.
5+
# See https://key4hep.github.io/key4hep-doc/ for further info.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
from Gaudi.Configuration import INFO
20+
from k4FWCore import IOSvc, ApplicationMgr
21+
from Configurables import EventDataSvc, UniqueIDGenSvc, ChronoAuditor, AuditorSvc
22+
23+
chra = ChronoAuditor()
24+
audsvc = AuditorSvc()
25+
audsvc.Auditors = [chra]
26+
27+
io_svc = IOSvc("IOSvc")
28+
io_svc.Input = "../../data/simpleCalo_simulation.root"
29+
io_svc.Output = "../../data/simpleCalo_noiseDigitizer.root"
30+
31+
from Configurables import EventStats
32+
33+
eventStats_functional = EventStats("EventStats",
34+
35+
InputCaloHitCollection=["simplecaloRO"],
36+
OutputEnergyBarycentre=["EnergyBarycentreX", "EnergyBarycentreY", "EnergyBarycentreZ"],
37+
OutputTotalEnergy=["TotalEnergy"],
38+
SaveHistograms=True,
39+
OutputLevel=INFO
40+
)
41+
42+
from Configurables import RandomNoiseDigitizerSolution
43+
random_noise_digitizer = RandomNoiseDigitizerSolution("RandomNoiseDigitizer",
44+
InputCaloSimHitCollection=["simplecaloRO"],
45+
OutputCaloDigiHitCollection=["CaloDigiHits"],
46+
uidSvcName="uidSvc",
47+
NoiseMean=1e-3,
48+
NoiseWidth=1e-4,
49+
OutputLevel=INFO
50+
)
51+
52+
app_mgr = ApplicationMgr(
53+
TopAlg=[eventStats_functional, random_noise_digitizer],
54+
EvtSel='NONE',
55+
EvtMax=-1,
56+
ExtSvc=[EventDataSvc("EventDataSvc"), UniqueIDGenSvc("uidSvc"), audsvc],
57+
StopOnSignal=True,
58+
)

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ set_test_env(test_MoliereRadius)
4848

4949
add_test(NAME test_RandomNoiseDigitizer
5050
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
51-
COMMAND k4run GaudiTutorial/RandomNoiseDigitizer/options/runRandomNoiseDigitizer.py --IOSvc.Input ${PROJECT_SOURCE_DIR}/GaudiTutorial/data/simpleCalo_simulation.root --IOSvc.Output ${PROJECT_SOURCE_DIR}/GaudiTutorial/data/simpleCalo_noiseDigitizer.root)
51+
COMMAND k4run GaudiTutorial/RandomNoiseDigitizer/options/runRandomNoiseDigitizerSolution.py --IOSvc.Input ${PROJECT_SOURCE_DIR}/GaudiTutorial/data/simpleCalo_simulation.root --IOSvc.Output ${PROJECT_SOURCE_DIR}/GaudiTutorial/data/simpleCalo_noiseDigitizer.root)
5252
set_test_env(test_MoliereRadius)
5353

5454
# For LD_LIBRARY_PATH

0 commit comments

Comments
 (0)