def configure(self): from CaloRec.CaloRecConf import CaloCellMaker cellMaker = CaloCellMaker("HICaloCellCopier", CaloCellsOutputName="SubtractedCells", OwnPolicy=0) from CaloRec.CaloRecConf import CaloCellFastCopyTool cellCopyTool = CaloCellFastCopyTool("HICellCopyTool") cellCopyTool.InputName = "AllCalo" cellCopyTool.IncludeSamplings = [ "PreSamplerB", "EMB1", "EMB2", "EMB3", "PreSamplerE", "EME1", "EME2", "EME3", "HEC0", "HEC1", "HEC2", "HEC3", "TileBar0", "TileBar1", "TileBar2", "TileGap1", "TileGap2", "TileGap3", "TileExt0", "TileExt1", "TileExt2", "FCal1", "FCal2", "FCal3" ] from AthenaCommon.AppMgr import ToolSvc ToolSvc += cellCopyTool from HIJetRec.HIJetRecConf import HISubtractedCellMakerTool cellSubtrTool = HISubtractedCellMakerTool() from HIJetRec.HIJetRecFlags import HIJetFlags cellSubtrTool.EventShapeKey = HIJetFlags.IteratedEventShapeKey() from HIJetRec.HIJetRecTools import jtm cellSubtrTool.Modulator = jtm.modulator ToolSvc += cellSubtrTool from CaloRec.CaloRecConf import CaloCellContainerFinalizerTool cellFinalizerTool = CaloCellContainerFinalizerTool( "HICaloCellFinalizerTool") ToolSvc += cellFinalizerTool cellMaker.CaloCellMakerToolNames = [ cellCopyTool, cellSubtrTool, cellFinalizerTool ] from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() topSequence += cellMaker return True
shape_name=EventShapeKey, map_tool=theMapTool, **iteration_dict) HIJetFlags.IteratedEventShapeKey = iter1.OutputEventShapeKey modulator1 = iter1.Modulator jtm.modulator = modulator1 #subtraction BEFORE iteration for moment subtr1 = MakeSubtractionTool(iter0.OutputEventShapeKey, moment_name="NoIteration", momentOnly=True, modulator=modulator0, map_tool=theMapTool) #main subtractor subtr2 = MakeSubtractionTool(HIJetFlags.IteratedEventShapeKey(), modulator=modulator1, map_tool=theMapTool) #==========#==========#==========#==========#==========#========== #special addition for egamma #Downstream egamma jo will call SubtractedCellGetter, it assumes that the container pointed to by #HIJetFlags.IteratedEventShapeKey() is defined per layer/per eta bin, which is no longer true w/ above changes #The fix is to define one more container from the seeds above just as in original reconstruction if not HIJetFlags.DoCellBasedSubtraction(): iteration_dict = dict(suffix="iter_egamma") iter_egamma = AddIteration( seed_container=seeds1.OutputContainer, shape_name=jobproperties.HIGlobalFlags.EventShapeKey(), map_tool=theMapTool, useClusters=False,
[subtr1, jtm.HICalibMap[seed_prefix], jtm.jetfilHISeeds], shallow=False) jtm.HIJetRecs += [seeds1] iteration_dict = dict(suffix="iter1") if jetFlags.useTracks() and HIJetFlags.TrackJetSeeds(): iteration_dict['track_jet_seeds'] = HIJetFlags.TrackJetContainerName() iter1 = AddIteration(seed_container=seeds1.OutputContainer, shape_name=EventShapeKey, **iteration_dict) HIJetFlags.IteratedEventShapeKey = iter1.OutputEventShapeKey modulator1 = iter1.Modulator jtm.modulator = modulator1 #apply subtraction to cluster constituents ApplySubtractionToClusters(event_shape_key=HIJetFlags.IteratedEventShapeKey(), cluster_key=ClusterKey, modulator=modulator1, CalculateMoments=True) #subtraction BEFORE iteration for moment subtr1 = MakeSubtractionTool(iter0.OutputEventShapeKey, moment_name="NoIteration", momentOnly=True, modulator=modulator0) #main subtractor subtr2 = MakeSubtractionTool(HIJetFlags.IteratedEventShapeKey(), modulator=modulator1) #put subtraction tool at the FRONT of the jet modifiers list hi_tools = [subtr1, subtr2]
#now iterate seeds1=jtm.addJetCopier("%s_%s1" % (seed_prefix,HIJetFlags.SeedSuffix()),seed_prefix,[subtr1,jtm.HICalibMap[seed_prefix],jtm.jetfilHISeeds],shallow=False) jtm.HIJetRecs+=[seeds1] iteration_dict=dict(suffix="iter1") if jetFlags.useTracks() and HIJetFlags.TrackJetSeeds() : iteration_dict['track_jet_seeds']=HIJetFlags.TrackJetContainerName() iter1=AddIteration(seed_container=seeds1.OutputContainer,shape_name=EventShapeKey,**iteration_dict) HIJetFlags.IteratedEventShapeKey=iter1.OutputEventShapeKey modulator1=iter1.Modulator jtm.modulator=modulator1 from HIJetRec.HIJetRecConf import HIClusterSubtraction cluster_update=HIClusterSubtraction('HIClusterUpdate') cluster_update.ClusterKey="HIClusters" cluster_update.EventShapeKey=HIJetFlags.IteratedEventShapeKey() cluster_update.Subtractor=jtm.HIJetClusterSubtractor cluster_update.Modulator=modulator1 cluster_update.UpdateOnly=True jtm.add(cluster_update) jtm.jetrecs += [cluster_update] jtm.HIJetRecs+=[cluster_update] #subtraction BEFORE iteration for moment subtr2=MakeSubtractionTool(HIJetFlags.IteratedEventShapeKey(),modulator=modulator1) ### #subtracted algorithms #make main jets from unsubtr collections w/ same R, add modifiers for subtraction unsubtr_suffix=HIJetFlags.UnsubtractedSuffix()