Skip to content

Commit

Permalink
Add dead material correction to the test config (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrieucF authored Mar 10, 2022
1 parent b5110f1 commit d391a3c
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions RecFCCeeCalorimeter/tests/options/runCaloSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from GaudiKernel.SystemOfUnits import MeV, GeV, tesla

from Configurables import ApplicationMgr
ApplicationMgr().EvtSel = 'NONE'
ApplicationMgr().EvtSel = 'NONE'
ApplicationMgr().EvtMax = 2
ApplicationMgr().OutputLevel = INFO
ApplicationMgr().StopOnSignal = True
Expand Down Expand Up @@ -58,13 +58,6 @@
# Geant4 service
# Configures the Geant simulation: geometry, physics list and user actions

# Uncomment if history from Geant4 decays is needed (e.g. to get the photons from pi0) and set actions=actions in SimG4Svc
#from Configurables import SimG4FullSimActions
#actions = SimG4FullSimActions()
#actions.enableHistory=True
#actions.energyCut = 0.2 * GeV
# from Configurables import SimG4SaveParticleHistory
#saveHistTool = SimG4SaveParticleHistory("saveHistory")

# Geant4 service
# Configures the Geant simulation: geometry, physics list and user actions
Expand Down Expand Up @@ -127,6 +120,16 @@
geantsim.eventProvider = particle_converter
ApplicationMgr().TopAlg += [geantsim]

# Uncomment the following if history from Geant4 decays is needed (e.g. to get the photons from pi0)
#from Configurables import SimG4FullSimActions, SimG4SaveParticleHistory
#actions = SimG4FullSimActions()
#actions.enableHistory = True
#actions.energyCut = 0.2 * GeV
#saveHistTool = SimG4SaveParticleHistory("saveHistory")
#SimG4Alg("SimG4Alg").outputs += [saveHistTool]
#geantservice.actions = actions


############## Digitization (Merging hits into cells, EM scale calibration)
# EM scale calibration (sampling fraction)
from Configurables import CalibrateInLayersTool
Expand Down Expand Up @@ -202,7 +205,6 @@
createHcalBarrelCells.cells = "HCalBarrelCells"
ApplicationMgr().TopAlg += [createHcalBarrelCells]

# sliding window clustering #FIXME not yet ready for key4hep
#Empty cells for parts of calorimeter not implemented yet
from Configurables import CreateEmptyCaloCellsCollection
createemptycells = CreateEmptyCaloCellsCollection("CreateEmptyCaloCells")
Expand Down Expand Up @@ -249,6 +251,27 @@
createClusters.clusterCells.Path = "CaloClusterCells"
ApplicationMgr().TopAlg += [createClusters]

# Add position to the cells attached to the cluster
createEcalBarrelPositionedCaloClusterCells = CreateCaloCellPositionsFCCee("ECalBarrelPositionedCaloClusterCells")
createEcalBarrelPositionedCaloClusterCells.positionsECalBarrelTool = cellPositionEcalBarrelTool
createEcalBarrelPositionedCaloClusterCells.hits.Path = "CaloClusterCells"
createEcalBarrelPositionedCaloClusterCells.positionedHits.Path = "PositionedCaloClusterCells"

# Dead material correction
from Configurables import CorrectCaloClusters
correctCaloClusters = CorrectCaloClusters("correctCaloClusters")
correctCaloClusters.inClusters = createClusters.clusters.Path
correctCaloClusters.outClusters = "Corrected"+createClusters.clusters.Path
correctCaloClusters.numLayers = [12]
correctCaloClusters.firstLayerIDs = [0]
correctCaloClusters.lastLayerIDs = [11]
correctCaloClusters.readoutNames = [ecalBarrelReadoutNamePhiEta]
correctCaloClusters.upstreamParameters = [[0.09959407679400918, -10.509139028589276, -141.62311185316685, 2.8931723031040435, -397.6783011336018, -317.53288225142427]]
correctCaloClusters.upstreamFormulas = [['[0]+[1]/(x-[2])', '[0]+[1]/(x-[2])']]
correctCaloClusters.downstreamParameters = [[0.002296666086130359, 0.004644766599619741, 1.4031343062273582, -1.8105436592714355, -0.02976924247722723, 12.875501324136625]]
correctCaloClusters.downstreamFormulas = [['[0]+[1]*x', '[0]+[1]/sqrt(x)', '[0]+[1]/x']]
correctCaloClusters.OutputLevel = INFO
ApplicationMgr().TopAlg += [correctCaloClusters]

################ Output
from Configurables import PodioOutput
Expand Down

0 comments on commit d391a3c

Please sign in to comment.