Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
OutputLevel = INFO
)

from Configurables import RandomNoiseDigitizerSolution
random_noise_digitizer = RandomNoiseDigitizerSolution("RandomNoiseDigitizer",
from Configurables import RandomNoiseDigitizer
random_noise_digitizer = RandomNoiseDigitizer("RandomNoiseDigitizer",
InputCaloSimHitCollection=["simplecaloRO"],
OutputCaloDigiHitCollection=["CaloDigiHits"],
uidSvcName="uidSvc",
Expand All @@ -48,14 +48,8 @@
OutputLevel=INFO
)

from Configurables import MoliereRadiusSolution
moliere_radius = MoliereRadiusSolution ("MoliereRadius",
InputCaloHitCollection=random_noise_digitizer.OutputCaloDigiHitCollection,
InputBarycenter=eventStats_functional.OutputEnergyBarycentre,
InputTotalEnergy=eventStats_functional.OutputTotalEnergy)

app_mgr = ApplicationMgr(
TopAlg=[eventStats_functional, random_noise_digitizer, moliere_radius],
TopAlg=[eventStats_functional, random_noise_digitizer],
EvtSel='NONE',
EvtMax=-1,
ExtSvc=[EventDataSvc("EventDataSvc"), UniqueIDGenSvc("uidSvc"), audsvc],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#
# Copyright (c) 2020-2024 Key4hep-Project.
#
# This file is part of Key4hep.
# See https://key4hep.github.io/key4hep-doc/ for further info.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from Gaudi.Configuration import INFO
from k4FWCore import IOSvc, ApplicationMgr
from Configurables import EventDataSvc, UniqueIDGenSvc, ChronoAuditor, AuditorSvc

chra = ChronoAuditor()
audsvc = AuditorSvc()
audsvc.Auditors = [chra]

io_svc = IOSvc("IOSvc")
io_svc.Input = "../../data/simpleCalo_eventStats.root"
io_svc.Output = "../../data/simpleCalo_moliereRadius.root"

from Configurables import EventStats

eventStats_functional = EventStats("EventStats",
InputCaloHitCollection = ["simplecaloRO"],
OutputEnergyBarycentre = ["EnergyBarycentreX", "EnergyBarycentreY", "EnergyBarycentreZ"],
OutputTotalEnergy = ["TotalEnergy"],
SaveHistograms = True,
OutputLevel = INFO
)

from Configurables import RandomNoiseDigitizerSolution
random_noise_digitizer = RandomNoiseDigitizerSolution("RandomNoiseDigitizer",
InputCaloSimHitCollection=["simplecaloRO"],
OutputCaloDigiHitCollection=["CaloDigiHits"],
uidSvcName="uidSvc",
NoiseMean=1e-6,
NoiseWidth=1e-7,
OutputLevel=INFO
)

from Configurables import MoliereRadiusSolution
moliere_radius = MoliereRadiusSolution ("MoliereRadius",
InputCaloHitCollection=random_noise_digitizer.OutputCaloDigiHitCollection,
InputBarycenter=eventStats_functional.OutputEnergyBarycentre,
InputTotalEnergy=eventStats_functional.OutputTotalEnergy)

app_mgr = ApplicationMgr(
TopAlg=[eventStats_functional, random_noise_digitizer, moliere_radius],
EvtSel='NONE',
EvtMax=-1,
ExtSvc=[EventDataSvc("EventDataSvc"), UniqueIDGenSvc("uidSvc"), audsvc],
StopOnSignal=True,
)
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ set_test_env(test_EventStats)

add_test(NAME test_MoliereRadius
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND k4run GaudiTutorial/MoliereRadiusFunctional/options/runMoliereRadius.py --IOSvc.Input ${PROJECT_SOURCE_DIR}/GaudiTutorial/data/simpleCalo_simulation.root --IOSvc.Output ${PROJECT_SOURCE_DIR}/GaudiTutorial/data/simpleCalo_moliereRadius.root)
COMMAND k4run GaudiTutorial/MoliereRadiusFunctional/options/runMoliereRadiusSolution.py --IOSvc.Input ${PROJECT_SOURCE_DIR}/GaudiTutorial/data/simpleCalo_simulation.root --IOSvc.Output ${PROJECT_SOURCE_DIR}/GaudiTutorial/data/simpleCalo_moliereRadius.root)
set_test_env(test_MoliereRadius)

add_test(NAME test_RandomNoiseDigitizer
Expand Down
Loading