# active material volume name ecalVolumeName = "LAr_sensitive" # number of active layers to be merged to create cells ecalNumberOfLayersToMerge = [19,71,9] # number of ECAL layers ecalNumberOfLayers = len(ecalNumberOfLayersToMerge) # ECAL bitfield names & values ecalFieldNames = ["system","ECAL_Cryo","bath","EM_barrel"] ecalFieldValues = [5,1,1,1] from Configurables import MergeLayers mergelayers = MergeLayers("MergeLayers", # take the bitfield description from the geometry service readout = ecalReadoutName, # cells in which field should be merged identifier = ecalIdentifierName, volumeName = ecalVolumeName, # how many cells to merge # merge first 19 into new cell (id=0), next 71 into second cell (id=1), ... merge = ecalNumberOfLayersToMerge, OutputLevel = INFO) mergelayers.inhits.Path = "ECalHits" mergelayers.outhits.Path = "mergedECalHits" #Configure tools for calo cell positions from Configurables import CellPositionsDummyTool dummyCells = CellPositionsDummyTool("CellPositions", OutputLevel = INFO) #Configure tools for calo reconstruction from Configurables import CalibrateCaloHitsTool, NoiseCaloCellsFromFileTool, TubeLayerPhiEtaCaloTool calibcells = CalibrateCaloHitsTool("CalibrateCaloHitsTool", invSamplingFraction="5.4") noise = NoiseCaloCellsFromFileTool("NoiseCaloCellsFromFileTool",
doCellCalibration=False, addCellNoise=False, filterCellNoise=False, OutputLevel=INFO, hits="ECalBarrelCellsStep2", cells="ECalBarrelCells") # Create Ecal cells in endcaps # 1. step - merge layer IDs # 2. step - create cells from Configurables import MergeLayers mergelayersEcalEndcap = MergeLayers( "MergeLayersEcalEndcap", # take the bitfield description from the geometry service readout=ecalEndcapReadoutName, # cells in which field should be merged identifier=identifierName, volumeName=volumeName, # how many cells to merge merge=ecalEndcapNumberOfLayersToMerge, OutputLevel=INFO) mergelayersEcalEndcap.inhits.Path = "ECalEndcapHits" mergelayersEcalEndcap.outhits.Path = "mergedECalEndcapHits" createEcalEndcapCells = CreateCaloCells("CreateEcalEndcapCaloCells", doCellCalibration=True, calibTool=calibEcalEndcap, addCellNoise=False, filterCellNoise=False, OutputLevel=INFO) createEcalEndcapCells.hits.Path = "mergedECalEndcapHits" createEcalEndcapCells.cells.Path = "ECalEndcapCells"
geantsim = SimG4Alg("SimG4Alg", outputs=[ "SimG4SaveCalHits/saveECalHits", "InspectHitsCollectionsTool/inspect" ], eventProvider=particle_converter) from Configurables import MergeLayers merge = MergeLayers( "mergeLayers", # common part of the name of the group of volumes to merge volumeName="slice", # corresponding identifier in the readout for the volumes that should be merged identifier="z", # readout - bitfield description from the geometry service readout="ECalHits", # specify how many volumes to merge # if it is a constant number (e.g. merge every second volume with previous one), 'MergeCells' can be used # below: merge first 3k volumes into new one (id=0), next 10k into second one (id=1) and last 3k into third volume (id=2) merge=[3000, 10001, 3000], OutputLevel=DEBUG) merge.DataInputs.inhits.Path = "caloHits" merge.DataOutputs.outhits.Path = "newCaloHits" from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out", filename="testMergeLayers.root") out.outputCommands = ["keep *"]
# active material volume name ecalVolumeName = "LAr_sensitive" # number of active layers to be merged to create cells ecalNumberOfLayersToMerge = [19,71,9] # number of ECAL layers ecalNumberOfLayers = len(ecalNumberOfLayersToMerge) # ECAL bitfield names & values ecalFieldNames = ["system","ECAL_Cryo","bath","EM_barrel"] ecalFieldValues = [5,1,1,1] from Configurables import MergeLayers mergelayers = MergeLayers("MergeLayers", # take the bitfield description from the geometry service readout = ecalReadoutName, # cells in which field should be merged identifier = ecalIdentifierName, volumeName = ecalVolumeName, # how many cells to merge # merge first 19 into new cell (id=0), next 71 into second cell (id=1), ... merge = ecalNumberOfLayersToMerge, OutputLevel = INFO) mergelayers.inhits.Path = "ECalHits" mergelayers.outhits.Path = "mergedECalHits" #Configure tools for calo reconstruction from Configurables import CalibrateCaloHitsTool, NoiseCaloCellsFromFileTool, TubeLayerPhiEtaCaloTool calibcells = CalibrateCaloHitsTool("CalibrateCaloHitsTool", invSamplingFraction="5.4") noise = NoiseCaloCellsFromFileTool("NoiseCaloCellsFromFileTool", noiseFileName="/eos/project/f/fccsw-web/testsamples/fcc_ecalCellNoise_mu1000_3radialLayers_v1.root") ecalgeo = TubeLayerPhiEtaCaloTool("EcalGeo", readoutName = ecalReadoutName,