Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable noise for ALLEGRO ECAL barrel cells #191

Closed
wants to merge 4 commits into from
Closed
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
66 changes: 35 additions & 31 deletions FCCee/FullSim/ALLEGRO/ALLEGRO_o1_v03/run_digi_reco.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
Nevts = -1 # -1 means all events
addNoise = False # add noise or not to the cell energy
dumpGDML = False # create GDML file of detector model
runHCal = True # simulate only the ECAL or both ECAL+HCAL
runHCal = False # simulate only the ECAL or both ECAL+HCAL

# - what to save in output file
#
Expand Down Expand Up @@ -91,7 +91,7 @@

# BDT regression from total cluster energy and fraction of energy in each layer (after correction for sampling fraction)
# not to be applied (yet) for ECAL+HCAL clustering (MVA trained only on ECAL so far)
applyMVAClusterEnergyCalibration = True and not runHCal
applyMVAClusterEnergyCalibration = True and not runHCal and not addNoise # temporarily switched off due to negative cell signals introduced by noise

# calculate cluster energy and barycenter per layer and save it as extra parameters
addShapeParameters = True and not runHCal
Expand Down Expand Up @@ -168,15 +168,16 @@
# which is not performed by ddsim)
# - merge hits into cells according to initial segmentation
ecalBarrelCellsName = "ECalBarrelCells"
createEcalBarrelCells = CreateCaloCells("CreateECalBarrelCells",
doCellCalibration=True,
calibTool=calibEcalBarrel,
addCellNoise=False,
filterCellNoise=False,
addPosition=True,
OutputLevel=INFO,
hits=ecalBarrelReadoutName,
cells=ecalBarrelCellsName)
if not addNoise: # Create ECAL barrel cells without adding noise
createEcalBarrelCells = CreateCaloCells("CreateECalBarrelCells",
doCellCalibration=True,
calibTool=calibEcalBarrel,
addCellNoise=False,
filterCellNoise=False,
addPosition=True,
OutputLevel=INFO,
hits=ecalBarrelReadoutName,
cells=ecalBarrelCellsName)

# - add to Ecal barrel cells the position information
# (good for physics, all coordinates set properly)
Expand Down Expand Up @@ -270,6 +271,7 @@


if addNoise:
#FIXME Input histograms need to be updated to match the new detector geometry of ALLEGRO v3
ecalBarrelNoisePath = "elecNoise_ecalBarrelFCCee_theta.root"
ecalBarrelNoiseRMSHistName = "h_elecNoise_fcc_"
from Configurables import NoiseCaloCellsVsThetaFromFileTool
Expand All @@ -284,28 +286,30 @@
filterNoiseThreshold=0,
numRadialLayers=11,
scaleFactor=1 / 1000., # MeV to GeV
OutputLevel=DEBUG)

# needs to be migrated!
#from Configurables import TubeLayerPhiEtaCaloTool
#barrelGeometry = TubeLayerPhiEtaCaloTool("EcalBarrelGeo",
# readoutName=ecalBarrelReadoutNamePhiEta,
# activeVolumeName="LAr_sensitive",
# activeFieldName="layer",
# activeVolumesNumber=12,
# fieldNames=["system"],
# fieldValues=[4])
OutputLevel=INFO)

# barrel geometry tool is migrated to match ALLEGRO v3 segmentation
from Configurables import TubeLayerModuleThetaMergedCaloTool
barrelGeometry = TubeLayerModuleThetaMergedCaloTool("EcalBarrelGeo",
readoutName=ecalBarrelReadoutName,
activeVolumeName="LAr_sensitive",
activeFieldName="layer",
activeVolumesNumber=11,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We commented in HEP-FCC/k4RecCalorimeter#107 that the activeVolumesNumber property should be dropped

fieldNames=["system"],
fieldValues=[4])

# cells with noise not filtered
# createEcalBarrelCellsNoise = CreateCaloCells("CreateECalBarrelCellsNoise",
# doCellCalibration=False,
# addCellNoise=True,
# filterCellNoise=False,
# OutputLevel=INFO,
# hits="ECalBarrelCellsStep2",
# noiseTool=noiseBarrel,
# geometryTool=barrelGeometry,
# cells=EcalBarrelCellsName)
createEcalBarrelCells = CreateCaloCells("CreateECalBarrelCellsNoise",
doCellCalibration=True,
calibTool=calibEcalBarrel,
addCellNoise=True,
filterCellNoise=False,
noiseTool=noiseBarrel,
addPosition=True,
geometryTool=barrelGeometry,
OutputLevel=INFO,
hits=ecalBarrelReadoutName,
cells=ecalBarrelCellsName)

# cells with noise filtered
# createEcalBarrelCellsNoise = CreateCaloCells("CreateECalBarrelCellsNoise_filtered",
Expand Down