An example hook on how to set detector attributes can be found here .
A more general example for adding any arbitrary number of detectors in the MG is':
class gh_pre_scan(Macro): param_def = [ ] def run(self): mg_name = self.getEnv( 'ActiveMntGrp') self.mg = PyTango.DeviceProxy( mg_name) self.mglist = self.mg.ElementList self.detector_list = [] for elm in self.mglist: if elm.find('p100') != -1 or elm.find('p300') != -1 or elm == 'eiger' != -1 or elm == 'lmbd' != -1: self.detector_list.append(elm) try: detectorName = self.getEnv('2Ddetector') if detectorName not in self.detector_list and detectorName in self.mglist: self.detector_list.append(detectorName) except: pass pilatusRoot = "/gpfs/current/raw" for dect in self.detector_list: try: HasyUtils.prepareDetectorAttrs( self, name = dect, rootDir = pilatusRoot) except: self.output( "gh_pre_scan: prepareDetectors return error for detector" % dect) return True