def init_display(self): self.display = Display(['xy', 'yz']) self.gdetector = GDetector(self.detector) self.display.register(self.gdetector, layer=0, clearable=False) self.is_display = True
from heppy.display.geometry import GDetector from heppy.display.pfobjects import GTrajectories display_on = True detector = cms logging.basicConfig(level='WARNING') logger = logging.getLogger('Simulator') logger.addHandler(logging.StreamHandler(sys.stdout)) for i in range(1): if not i % 100: print i simulator = Simulator(detector, logger) # particles = monojet([211, -211, 130, 22, 22, 22], math.pi/2., math.pi/2., 2, 50) particles = [ # particle(211, math.pi/2., math.pi/2., 100), particle(211, math.pi / 2 + 0.5, 0., 40.), # particle(130, math.pi/2., math.pi/2.+0., 100.), # particle(22, math.pi/2., math.pi/2.+0.0, 10.) ] simulator.simulate(particles) if display_on: display = Display(['xy', 'yz', 'ECAL_thetaphi', 'HCAL_thetaphi']) gdetector = GDetector(detector) display.register(gdetector, 0) gtrajectories = GTrajectories(simulator.ptcs) display.register(gtrajectories, 1) display.draw()
def init_display(self): '''Set up the display''' self.display = Display(self.cfg_ana.projections, self.cfg_ana.screennames) self.gdetector = GDetector(self.cfg_ana.detector) self.display.register(self.gdetector, layer=0, clearable=False)