def GetSubtractorTool(**kwargs): useClusters = False if 'useClusters' in kwargs.keys(): useClusters = kwargs['useClusters'] elif HIJetFlags.DoCellBasedSubtraction(): useClusters = False else: useClusters = True if useClusters: if not hasattr(jtm, "HIJetClusterSubtractor"): HIJetClusterSubtractorTool = CompFactory.HIJetClusterSubtractorTool jtm.add(HIJetClusterSubtractorTool("HIJetClusterSubtractor")) return jtm.HIJetClusterSubtractor else: if not hasattr(jtm, "HIJetCellSubtractor"): HIJetCellSubtractorTool = CompFactory.HIJetCellSubtractorTool jtm.add(HIJetCellSubtractorTool("HIJetCellSubtractor")) return jtm.HIJetCellSubtractor
theSubtrTool.unlock() theSubtrTool.UseSamplings = False theSubtrTool.lock() if is_mc_or_overlay: for theCalibTool in jtm.HICalibMap.values(): theCalibTool.unlock() theCalibTool.IsData = False theCalibTool.CalibSequence = 'EtaJES' theCalibTool.lock() #Import the map tool - it will have to harvest configuration along the path from HIEventUtils.HIEventUtilsConf import HIEventShapeMapTool theMapTool = HIEventShapeMapTool() if not HIJetFlags.DoCellBasedSubtraction(): #Make new event shape at tower level from HIGlobal.HIGlobalConf import HIEventShapeMaker from HIGlobal.HIGlobalConf import HIEventShapeFillerTool #EventShapeKey set to point to weighted container, can remove code on L16 EventShapeKey = jobproperties.HIGlobalFlags.EventShapeKey() + 'Weighted' ESAlg_W = HIEventShapeMaker("ESAlg_W") ESAlg_W.OutputContainerKey = EventShapeKey ESAlg_W.UseCaloCell = False ESAlg_W.InputTowerKey = "HIClusters" #Hack needed because ES algorithm requires a summary tool, this disables it from HIEventUtils.HIEventUtilsConf import HIEventShapeSummaryTool SummaryTool = HIEventShapeSummaryTool("SummaryTool2") SummaryTool.SubCalos = jobproperties.HIGlobalFlags.SummarySubCalos()