def toggleWires(self, product): # Now, either add the drawing process or remove it: if product == 'wire': if 'wire' not in self._keyTable: print "No wire data available to draw" self._drawWires = False return self._drawWires = True self._wireDrawer = datatypes.recoWire(self._geom) self._wireDrawer.setProducer(self._keyTable['wire'][0]) self._process.add_process(self._wireDrawer._process) self.processEvent(True) elif product == 'rawdigit': if 'rawdigit' not in self._keyTable: print "No raw digit data available to draw" self._drawWires = False return print self._keyTable['rawdigit'] self._drawWires = True self._wireDrawer = datatypes.rawDigit(self._geom) self._wireDrawer.setProducer(self._keyTable['rawdigit'][0]) self._process.add_process(self._wireDrawer._process) self.processEvent(True) else: self._wireDrawer = None self._drawWires = False
def toggleWires(self, product, stage=None, subtract_pedestal=True, producers=None): # Now, either add the drawing process or remove it: if stage is None: stage = 'all' if product == 'wire': if 'recob::Wire' not in self._keyTable[stage]: print("No wire data available to draw") self._drawWires = False return self._drawWires = True self._wireDrawer = datatypes.recoWire(self._geom) if producers is not None: producer = producers elif self._geom.name() == 'icarus' and len(self._keyTable[stage]['recob::Wire']) > 3: producer = [self._keyTable[stage]['recob::Wire'][0].fullName(), self._keyTable[stage]['recob::Wire'][1].fullName(), self._keyTable[stage]['recob::Wire'][2].fullName(), self._keyTable[stage]['recob::Wire'][3].fullName()] else: producer = self._keyTable[stage]['recob::Wire'][0].fullName() # self._wireDrawer.setProducer(self._keyTable[stage]['recob::Wire'][0].fullName()) self._wireDrawer.setProducer(producer) self._processer.add_process("recob::Wire",self._wireDrawer._process) self.processEvent(True) elif product == 'rawdigit': if 'raw::RawDigit' not in self._keyTable[stage]: print("No raw digit data available to draw") self._drawWires = False return self._drawWires = True self._wireDrawer = datatypes.rawDigit(self._geom) self._wireDrawer.setSubtractPedestal(subtract_pedestal) if producers is not None: producer = producers elif self._geom.name() == 'icarus' and len(self._keyTable[stage]['raw::RawDigit']) > 3: producer = [self._keyTable[stage]['raw::RawDigit'][0].fullName(), self._keyTable[stage]['raw::RawDigit'][1].fullName(), self._keyTable[stage]['raw::RawDigit'][2].fullName(), self._keyTable[stage]['raw::RawDigit'][3].fullName()] else: producer = self._keyTable[stage]['raw::RawDigit'][0].fullName() self._wireDrawer.setProducer(producer) self._processer.add_process("raw::RawDigit", self._wireDrawer._process) self._wireDrawer.toggleNoiseFilter(self.filterNoise) self.processEvent(True) else: if 'raw::RawDigit' in self._processer._ana_units.keys(): self._processer.remove_process('raw::RawDigit') if 'recob::Wire' in self._processer._ana_units.keys(): self._processer.remove_process('recob::Wire') self._wireDrawer = None self._drawWires = False
def toggleWires(self, product, stage=None): # Now, either add the drawing process or remove it: print("toggleWires: product=", product) if stage is None: stage = 'all' if product == 'wire': if 'recob::Wire' not in self._keyTable[stage]: print("No wire data available to draw") self._drawWires = False return self._drawWires = True self._wireDrawer = datatypes.recoWire(self._detectorConfig) self._wireDrawer.setProducer( self._keyTable[stage]['recob::Wire'][0].fullName()) self._processer.add_process("recob::Wire", self._wireDrawer._process) self.processEvent(True) elif product == 'rawdigit': if 'raw::RawDigit' not in self._keyTable[stage]: print("No raw digit data available to draw") self._drawWires = False return print(" --> in rawdigit block, setting up wireDrawer") self._drawWires = True self._wireDrawer = datatypes.rawDigit(self._detectorConfig) self._wireDrawer.setProducer( self._keyTable[stage]['raw::RawDigit'][0].fullName()) self._processer.add_process("raw::RawDigit", self._wireDrawer._process) self._wireDrawer.toggleNoiseFilter(self.filterNoise) print(" --> in rawdigit block, calling processEvent") self.processEvent(True) else: if 'raw::RawDigit' in self._processer._ana_units.keys(): self._processer.remove_process('raw::RawDigit') if 'recob::Wire' in self._processer._ana_units.keys(): self._processer.remove_process('recob::Wire') self._wireDrawer = None self._drawWires = False