import ROOT import libPyROOT as _root ROOT.gSystem.Load("libDelphes") ##################################################### ### Definition of the string conversion methods ### ##################################################### def _Event__str__( self ): theString = "Event number %i\n" % self.Number theString += "Read in %f and processed in %f.\n" % (self.ReadTime, self.ProcTime) return theString _root.MakeRootClass( "Event" ).__str__ = _Event__str__ def _LHCOEvent__str__( self ): theString = "Trigger word: %b\n" % self.Trigger return theString _root.MakeRootClass( "LHCOEvent" ).__str__ = _LHCOEvent__str__ def _LHEFEvent__str__( self ): hepmcstr = "Process ID: %i\n" % self.ProcessID hepmcstr += "ScalePDF = %f\n" % self.ScalePDF hepmcstr += "Alpha QED = %f\n" % self.AlphaQED hepmcstr += "Alpha DCQ = %f\n" % self.AlphaQCD hepmcstr += "Event weight = %f\n" % self.Weight return hepmcstr _root.MakeRootClass( "LHEFEvent" ).__str__ = _LHEFEvent__str__ def _HepMCEvent__str__( self ): hepmcstr = "Process ID: %i\n" % self.ProcessID hepmcstr += "Energy scale: %f\n" % self.Scale hepmcstr += "Alpha QED = %f\n" % self.AlphaQED hepmcstr += "Alpha QCD = %f\n" % self.AlphaQCD hepmcstr += "Number of multi parton interactions: %f\n" % self.MPI hepmcstr += """Q-scale used in evaluation of PDFs (in GeV): %f\n""" % self.ScalePDF hepmcstr += """Fraction of beam momentum carried by %i parton ("beam side"): %f\n""" % (self.ID1,self.X1) hepmcstr += """Fraction of beam momentum carried by %i parton ("target side"): %f\n""" % (self.ID2,self.X2) hepmcstr += "PDF (id1, x1, Q) = %f\n" % self.PDF1 hepmcstr += "PDF (id2, x2, Q) = %f\n" % self.PDF2 return hepmcstr _root.MakeRootClass( "HepMCEvent" ).__str__ = _HepMCEvent__str__ def _GenParticle__str__( self ): thestring = "Particle HEP ID number = %d\n" % self.PID thestring += "Particle status: %d\n" % self.Status if self.IsPU: thestring += "That particle is from PU.\n" thestring += "Particle 1st mother: %d\n" % self.M1 thestring += "Particle 2nd mother: %d\n" % self.M2 thestring += "Particle 1st daughter: %d\n" % self.D1 thestring += "Particle last daughter: %d\n" % self.D2 thestring += "(Px,Py,Pz,E) = (%f,%f,%f,%f)\n" % (self.Px,self.Py,self.Pz,self.E) thestring += "(Pt,Eta,Phi) = (%f,%f,%f)\n" % (self.PT,self.Eta,self.Phi) thestring += "Rapidity = %f\n" % self.Rapidity thestring += "Charge: %d\n" % self.Charge thestring += "Mass: %f\n" % self.Mass thestring += "Vertex position: (x,y,z,t) = (%f,%f,%f,%f)\n" % (self.X,self.Y,self.Z,self.T) return thestring _root.MakeRootClass( "GenParticle" ).__str__ = _GenParticle__str__ def _GenParticle_printDecay( self, db, particles, pre="" ): thestring = "%s (%f,%f,%f,%f) (status %d)\n" % (db.GetParticle(self.PID).GetName(),self.Px,self.Py,self.Pz,self.E, self.Status) for daughter in range(self.D1,self.D2+1): if daughter==-1: break if daughter