Ejemplo n.º 1
0
 def __init__(self, indir, gfile):
     self.indir = indir
     self.gfile = gfile
     print time.time()
     igreader=gampReader(gampFile = open(os.path.join(indir,gfile),'r'))
     self.events = igreader.readGamp()
     print time.time()
     self.eventslist = []
Ejemplo n.º 2
0
            sa1 = (phE - kpE)**2 - (phpx - kppx)**2 - (phpy - kppy)**2 - (phpz - kppz)**2
            s12 = (kpE + kmE)**2 - (kppx + kmpx)**2 - (kppy + kmpy)**2 - (kppz + kmpz)**2
            s23 = (kmE + prE)**2 - (kmpx + prpx)**2 - (kmpy + prpy)**2 - (kmpz + prpz)**2
            sb3 = (.93827 - prE)**2 - (0 - prpx)**2 - (0 - prpy)**2 - (0 - prpz)**2
            slist = [mk, mp, sab, sa1, s12, s23, sb3]
            #print slist
            #print
            self.eventslist.append(slist)
        print time.time()
        return self.eventslist
        
    def toFile(self, outputdir, outputFile):
        f = open(os.path.join(outputdir, outputFile), 'w')
        f.write(str(len(self.events)) + "\n")
        for slist in self.eventslist:
            f.write(str(slist) + "\n")
        f.close()
        
###example
indir = "/home/sbramlett/Documents/"
gfile = "test.gamp"
##print indir
##
igreader=gampReader(gampFile = io.open(os.path.join(indir,gfile),'r'))
profile.run('igreader.readGamp();print')
#slist = gampSlist(indir, gfile)       
#slist.generate()
#print slist.eventslist
#slist.toFile(indir, "eventsSlist.txt")