HepMC2DOT - Convert HepMC ASCII files to DOT graphs

Build Status Code Coverage Docs Status

The hepmc2dot.py scripts converts ASCII files generated by HepMC::IO_GenEvent to the common DOT graph format. It is tested only for Python 2.7 at this point.

HepMC is a High Energy Physics package for storing Monte Carlo event records. These records can typically be represented in a tree structure, where particles are edges and interaction vertices are nodes.

The official HepMC documentation is at: http://hepmc.web.cern.ch/hepmc/

Usage

Convert HepMC ASCII file hepmcfile.txt to DOT graph and store there result in dotfile.dot:

hepmc2dot.py hepmcfile.txt dotfile.dot

Source

The source repository is on GitHub.

Table of Contents

hepmc2dot module

class hepmc2dot.HepDotWriter(dotfile)[source]

Bases: object

Generates a dot file representing the given particles, interaction vertices and events

add_outgoing_particle(raw_hepmc_line)[source]
close()[source]

Terminates the currently open event and closes the output file.

start_new_event(raw_hepmc_line)[source]
start_new_vertex(raw_hepmc_line)[source]
hepmc2dot.convert(hepmc_file, dot_file)[source]

Converts the given HepMC::IO_GenEvent formatted file into a DOT formatted file

hepmc2dot.main(argv)[source]

Parses the given command line arguments and runs the conversion from the specified input HepMC::IO_GenEvent to the specified DOT output file

test package

Submodules

test.test_hepmc2dot module

class test.test_hepmc2dot.Test_convert(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]
tearDown()[source]
test_emptyHepMCFile_expectEmptyDotFile()[source]
test_eventTwoVerticesWithOneConnectingParticleAndOneParticleWithoutEndVertex_expectSameRepresentationInDot()[source]
test_eventTwoVerticesWithOneConnectingParticleAndTwoParticlesWithoutEndVertices_expectSameRepresentationInDot()[source]
test_eventTwoVerticesWithOneConnectingParticle_expectSameRepresentationInDot()[source]
test_eventWithOneHepMCVertex_expectOneEventWithOneVertexInDot()[source]
test_oneEmptyHepMCEvent_expectOneEmptyDotDigraph()[source]
test_oneVertexTwoOutgoingParticlesWithoutEndVertices_expectSameRepresentationInDot()[source]
test_oneVertexWithOutgoingParticleWithoutEndVertex_expectSameRepresentationInDot()[source]
test_unknownDataAndOneEmptyEventInHepMCFile_expectOneEmptyDotDigraph()[source]
test_unknownDataInHepMCFile_expectEmptyDotFile()[source]
class test.test_hepmc2dot.Test_get_dot_particle(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_finalStateParticle_expectDummyEndVertex()[source]
test_floatEnergy_expectEnergyRounding()[source]
test_stringArguments_expectAutomaticConversion()[source]
class test.test_hepmc2dot.Test_get_dot_vertex(methodName='runTest')[source]

Bases: unittest.case.TestCase

assert_get_vertex(expected_dot, *args, **kwargs)[source]
test_dummyVertexNegativeID_expectDummyVertexNameAndEmptyLabel()[source]
test_dummyVertex_expectDummyVertexNameAndEmptyLabel()[source]
test_longFloatingPointRZ_expectRoundedRZ()[source]
test_nagativeVertexID_expectPositiveDotVertexNameAndNegativeIDInLabel()[source]
test_positiveVertexID_expectPositiveDotVertexNameAndPositiveIDInLabel()[source]
test_scaleProvided_expectScaledPosition()[source]
test_scaledDummy_expectScaledPosition()[source]
test_strVtxArguments_expectAutomaticConversion()[source]
class test.test_hepmc2dot.Test_get_node_name(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_dummyVertex_expectDummyNodeName()[source]
test_negativeBarcode_expectPositiveNumInNodeName()[source]
test_positiveBarcode_expectPositiveNumInNodeName()[source]
test_strArguments_expectAutomaticConversion()[source]
class test.test_hepmc2dot.Test_main_withTemporaryFilesFixture(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]
tearDown()[source]
test_complexHepMCFile_expectCorrespondingDotFileContents()[source]
test_emptyHepMCFile_expectEmptyDotFile()[source]
test_nonExistingHepMCFile_expectIOError()[source]
test_nonExistingHepMCNorDotFiles_expectIOError()[source]
class test.test_hepmc2dot.Test_main_withoutTemporaryFilesFixture(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_noArgumentsProvided_expectSystemExit()[source]
test_onlyOneArgumentProvided_expectSystemExit()[source]

Module contents

Indices and tables