|
| 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 | +) |
0 commit comments