'file:Detector/DetFCChhTrackerTkLayout/compact/Tracker.xml', 'file:Detector/DetFCChhECalInclined/compact/FCChh_ECalBarrel_withCryostat.xml', 'file:Detector/DetFCChhHCalTile/compact/FCChh_HCalBarrel_TileCal.xml', 'file:Detector/DetFCChhHCalTile/compact/FCChh_HCalExtendedBarrel_TileCal.xml', 'file:Detector/DetFCChhCalDiscs/compact/Endcaps_coneCryo.xml', 'file:Detector/DetFCChhCalDiscs/compact/Forward_coneCryo.xml' ], OutputLevel=WARNING) ecalBarrelNoisePath = "/eos/project/f/fccsw-web/testsamples/elecNoise_ecalBarrel_50Ohm_traces2_2shieldWidth.root" ecalEndcapNoisePath = "/eos/project/f/fccsw-web/testsamples/elecNoise_emec_50Ohm_2shieldWidth_6layers.root" ecalBarrelNoiseHistName = "h_elecNoise_fcc_" ecalEndcapNoiseHistName = "h_elecNoise_fcc_" from Configurables import CreateVolumeCaloPositions, RedoSegmentation, NoiseCaloCellsFlatTool positionsExtHcal = CreateVolumeCaloPositions("positionsExtHcal", OutputLevel=INFO) positionsExtHcal.hits.Path = hcalExtBarrelCellsName positionsExtHcal.positionedHits.Path = "HCalExtBarrelPositions" resegmentExtHcal = RedoSegmentation( "ReSegmentationExtHcal", # old bitfield (readout) oldReadoutName=hcalExtBarrelReadoutName, # specify which fields are going to be altered (deleted/rewritten) oldSegmentationIds=["module", "row"], # new bitfield (readout), with new segmentation newReadoutName=hcalExtBarrelReadoutPhiEtaName, debugPrint=10, OutputLevel=INFO, inhits="HCalExtBarrelPositions", outhits="newHCalExtBarrelCells")
samplingFraction=[0.15] * 118, readoutName="EMECPhiEta", layerFieldName="layer") from Configurables import CreateCaloCells createcellsBarrel = CreateCaloCells("CreateCaloCellsBarrel", doCellCalibration=True, calibTool=calibcellsBarrel, addCellNoise=False, filterCellNoise=False, OutputLevel=DEBUG) createcellsBarrel.hits.Path = "ECalBarrelHits" createcellsBarrel.cells.Path = "ECalBarrelCellsNoPhi" # Retrieve phi positions from centres of cells from Configurables import CreateVolumeCaloPositions positionsEcalBarrel = CreateVolumeCaloPositions("positionsEcalBarrel", OutputLevel=INFO) positionsEcalBarrel.hits.Path = "ECalBarrelCellsNoPhi" positionsEcalBarrel.positionedHits.Path = "ECalBarrelPositions" from Configurables import RedoSegmentation resegmentEcal = RedoSegmentation("ReSegmentationEcalBarrel", oldReadoutName='ECalBarrelEta', oldSegmentationIds=['eta'], newReadoutName='ECalBarrelPhiEta') resegmentEcal.inhits.Path = "ECalBarrelPositions" resegmentEcal.outhits.Path = "ECalBarrelCells" createcellsEndcap = CreateCaloCells("CreateCaloCellsEndcap", doCellCalibration=True, calibTool=calibcellsEndcap, addCellNoise=False, filterCellNoise=False, OutputLevel=DEBUG)
actions="SimG4FullSimActions") # Geant4 algorithm # Translates EDM to G4Event, passes the event to G4, writes out outputs via tools # and a tool that saves the calorimeter hits from Configurables import SimG4Alg, SimG4SaveCalHits savetool = SimG4SaveCalHits("saveHits", readoutNames=["ECalHitsEta"]) savetool.positionedCaloHits.Path = "PositionedHits" savetool.caloHits.Path = "Hits" geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveCalHits/saveHits"], OutputLevel=DEBUG) from Configurables import CreateVolumeCaloPositions positions = CreateVolumeCaloPositions("positions", OutputLevel=VERBOSE) positions.hits.Path = "Hits" positions.positionedHits.Path = "Positions" # PODIO algorithm from Configurables import PodioOutput out = PodioOutput("out", OutputLevel=DEBUG) out.outputCommands = ["keep *"] out.filename = "positions_ecalInclinedSim.root" #CPU information from Configurables import AuditorSvc, ChronoAuditor chra = ChronoAuditor() audsvc = AuditorSvc() audsvc.Auditors = [chra] geantsim.AuditExecute = True
# sampling fraction obtained using SamplingFractionInLayers from DetStudies package samplingFraction = [0.12125] + [0.14283] + [0.16354] + [0.17662] + [0.18867] + [0.19890] + [0.20637] + [0.20802], readoutName = "ECalBarrelEta", layerFieldName = "layer") from Configurables import CreateCaloCells createcells = CreateCaloCells("CreateCaloCells", doCellCalibration=True, calibTool=calibcells, addCellNoise=False, filterCellNoise=False, OutputLevel=DEBUG) createcells.hits.Path="ECalBarrelHits" createcells.cells.Path="ECalBarrelCellsNoPhi" # Retrieve phi positions from centres of cells from Configurables import CreateVolumeCaloPositions positionsEcalBarrel = CreateVolumeCaloPositions("positionsEcalBarrel", OutputLevel = INFO) positionsEcalBarrel.hits.Path = "ECalBarrelCellsNoPhi" positionsEcalBarrel.positionedHits.Path = "ECalBarrelPositions" from Configurables import RedoSegmentation resegmentEcal = RedoSegmentation("ReSegmentationEcalBarrel", oldReadoutName = 'ECalBarrelEta', oldSegmentationIds = ['eta'], newReadoutName = 'ECalBarrelPhiEta') resegmentEcal.inhits.Path = "ECalBarrelPositions" resegmentEcal.outhits.Path = "ECalBarrelCells" out = PodioOutput("out", filename="output_ecalInclinedDigi_test.root", OutputLevel=DEBUG) out.outputCommands = ["keep *"]
savecaltool.positionedCaloHits.Path = "positionedCaloHits" savecaltool.caloHits.Path = "caloHits" from Configurables import SimG4SingleParticleGeneratorTool pgun = SimG4SingleParticleGeneratorTool("SimG4SingleParticleGeneratorTool", saveEdm=True, particleName="e-", energyMin=50000, energyMax=50000, etaMin=2, etaMax=2) geantsim = SimG4Alg("SimG4Alg", outputs=["SimG4SaveCalHits/saveECalHits"], eventProvider=pgun) from Configurables import CreateVolumeCaloPositions positions = CreateVolumeCaloPositions("positions", OutputLevel=VERBOSE) positions.hits.Path = "caloHits" positions.positionedHits.Path = "caloPositions" # PODIO algorithm from Configurables import FCCDataSvc, PodioOutput podiosvc = FCCDataSvc("EventDataSvc") out = PodioOutput("out") out.outputCommands = ["keep *"] out.filename = "positions_ecalEndcapSim.root" # ApplicationMgr from Configurables import ApplicationMgr ApplicationMgr( TopAlg=[geantsim, positions, out], EvtSel='NONE',
OutputLevel=DEBUG, hits="HCalHits", cells="HCalCells") createExtHcells = CreateCaloCells("CreateExtHCaloCells", doCellCalibration=True, calibTool=calibHcells, addCellNoise=False, filterCellNoise=False, OutputLevel=DEBUG, hits="ExtHCalHits", cells="ExtHCalCells") # additionally for HCal from Configurables import CreateVolumeCaloPositions positions = CreateVolumeCaloPositions("positions", OutputLevel=VERBOSE) positions.hits.Path = "HCalCells" positions.positionedHits.Path = "HCalPositions" positionsExt = CreateVolumeCaloPositions("positionsExt", OutputLevel=VERBOSE) positionsExt.hits.Path = "ExtHCalCells" positionsExt.positionedHits.Path = "ExtHCalPositions" from Configurables import RedoSegmentation resegment = RedoSegmentation( "ReSegmentation", # old bitfield (readout) oldReadoutName=hcalReadoutName, # specify which fields are going to be altered (deleted/rewritten) oldSegmentationIds=["eta", "phi"], # new bitfield (readout), with new segmentation
addCellNoise=False, filterCellNoise=False, OutputLevel=DEBUG, hits="ECalHits", cells="ECalCells") createHcells = CreateCaloCells("CreateHCaloCells", doCellCalibration=True, calibTool=calibHcells, addCellNoise = False, filterCellNoise = False, OutputLevel = DEBUG, hits="HCalHits", cells="HCalCells") # additionally for HCal from Configurables import CreateVolumeCaloPositions positions = CreateVolumeCaloPositions("positions", OutputLevel = VERBOSE) positions.hits.Path = "HCalCells" positions.positionedHits.Path = "HCalPositions" from Configurables import RedoSegmentation resegment = RedoSegmentation("ReSegmentation", # old bitfield (readout) oldReadoutName = hcalReadoutName, # specify which fields are going to be altered (deleted/rewritten) oldSegmentationIds = ["eta","phi"], # new bitfield (readout), with new segmentation newReadoutName = newHcalReadoutName, debugPrint = 10, OutputLevel = DEBUG, inhits = "HCalPositions", outhits = "newHCalCells")
# Create cells from Configurables import CreateCaloCells # -> ECal barrel # 1. step - merge hits into cells with default Eta segmentation createEcalBarrelCellsStep1 = CreateCaloCells("EcalBarrelCellsStep1", doCellCalibration=True, calibTool=calibEcalBarrel, addCellNoise=False, filterCellNoise=False) createEcalBarrelCellsStep1.hits.Path = "ECalBarrelHits" createEcalBarrelCellsStep1.cells.Path = "ECalBarrelCellsStep1" # 2. step - rewrite the cellId using the Phi-Eta segmentation (remove 'module') # 2.1. retrieve phi positions from centres of cells from Configurables import CreateVolumeCaloPositions positionsEcalBarrel = CreateVolumeCaloPositions("positionsEcalBarrel") positionsEcalBarrel.hits.Path = "ECalBarrelCellsStep1" positionsEcalBarrel.positionedHits.Path = "ECalBarrelPositions" # 2.2. assign cells into phi bins from Configurables import RedoSegmentation resegmentEcalBarrel = RedoSegmentation("ReSegmentationEcalBarrel", oldReadoutName='ECalBarrelEta', oldSegmentationIds=['module'], newReadoutName='ECalBarrelPhiEta', inhits="ECalBarrelPositions", outhits="ECalBarrelCellsStep2") # 3. step - merge cells in the same phi bin createEcalBarrelCells = CreateCaloCells( "CreateECalBarrelCells", doCellCalibration=False, # already calibrated in step 1 addCellNoise=False,
############################################################################################################## # Fill empty collections for un-used Calo systems from Configurables import CreateEmptyCaloCellsCollection createemptycells = CreateEmptyCaloCellsCollection("CreateEmptyCaloCells") createemptycells.cells.Path = "emptyCaloCells" ############################################################################################################ ####### RESEGMENT HCAL ############# ############################################################################################################ from Configurables import CreateVolumeCaloPositions, RedoSegmentation, CreateCaloCells # Create cells in HCal # 2. step - rewrite the cellId using the Phi-Eta segmentation # 3. step - merge new cells corresponding to eta-phi segmentation # Hcal barrel cell positions posHcalBarrel = CreateVolumeCaloPositions("posBarrelHcal", OutputLevel=INFO) posHcalBarrel.hits.Path = inputCellCollectionHCalBarrel posHcalBarrel.positionedHits.Path = "HCalBarrelPositions" # Use Phi-Eta segmentation in Hcal barrel resegmentHcalBarrel = RedoSegmentation( "ReSegmentationHcal", # old bitfield (readout) oldReadoutName="HCalBarrelReadout", # specify which fields are going to be altered (deleted/rewritten) oldSegmentationIds=["module", "row"], # new bitfield (readout), with new segmentation newReadoutName="BarHCal_Readout_phieta", inhits="HCalBarrelPositions", outhits="HCalBarrelCellsStep2")
activeFieldName = hcalIdentifierName, readoutName = hcalBarrelReadoutName, fieldNames = hcalFieldNames, fieldValues = hcalFieldValues, OutputLevel = INFO) createHcalBarrelCells =CreateCaloCells("CreateHCalBarrelCells", geometryTool = hcalgeo, doCellCalibration = False, addCellNoise = True, filterCellNoise = False, noiseTool = noiseHcal, OutputLevel = INFO) createHcalBarrelCells.hits.Path ="HCalBarrelCells" createHcalBarrelCells.cells.Path ="HCalBarrelCellsNoise" # additionally for HCal from Configurables import CreateVolumeCaloPositions positionsHcalNoise = CreateVolumeCaloPositions("positionsHcalNoise") positionsHcalNoise.hits.Path = "HCalBarrelCellsNoise" positionsHcalNoise.positionedHits.Path = "HCalBarrelPositionsNoise" from Configurables import RedoSegmentation resegmentHcalNoise = RedoSegmentation("ReSegmentationHcalNoise", # old bitfield (readout) oldReadoutName = hcalBarrelReadoutName, # # specify which fields are going to be altered (deleted/rewritten) # oldSegmentationIds = ["eta","phi"], # new bitfield (readout), with new segmentation newReadoutName = hcalBarrelPhiEtaReadoutName, debugPrint = 10, OutputLevel = INFO, inhits = "HCalBarrelPositionsNoise", outhits = "newHCalBarrelCellsNoise")
OutputLevel=INFO) # clusters are needed, with deposit position and cellID in bits rewriteHCalEC.inhits.Path = prefix + "HCalEndcapCells" rewriteHCalEC.outhits.Path = "newHCalEndcapCells" ############################################################################################################## ####### RESEGMENT HCAL ############# ############################################################################################################## from Configurables import CreateVolumeCaloPositions, RedoSegmentation, CreateCaloCells # Create cells in HCal # 2. step - rewrite the cellId using the Phi-Eta segmentation # 3. step - merge new cells corresponding to eta-phi segmentation # Hcal barrel cell positions posHcalBarrel = CreateVolumeCaloPositions("posBarrelHcal") posHcalBarrel.hits.Path = hcalCells posHcalBarrel.positionedHits.Path = "HCalBarrelPositions" # Use Phi-Eta segmentation in Hcal barrel resegmentHcalBarrel = RedoSegmentation( "ReSegmentationHcal", # old bitfield (readout) oldReadoutName=hcalBarrelReadoutName, # specify which fields are going to be altered (deleted/rewritten) oldSegmentationIds=["module", "row"], # new bitfield (readout), with new segmentation newReadoutName=hcalBarrelReadoutNamePhiEta, inhits="HCalBarrelPositions", outhits="HCalBarrelCellsStep2") createHcalBarrelCells = CreateCaloCells("CreateHCalBarrelCells", doCellCalibration=False,