30 likes | 173 Views
Geometry Proposal. HighLevel API. R E C O. LowLevel API. XML HL Desc. Drivers. TGeom. Other DetCond. GDML lcdd. Cnv. ROOT file. Event Display. Geant4. HepMC I/O proposal. Implementation of a class with the same interface as IO_GenEvent ( ascii I/O)
E N D
Geometry Proposal HighLevel API REC O LowLevel API XML HL Desc. Drivers TGeom OtherDetCond GDMLlcdd Cnv ROOT file Event Display Geant4 LC Software Framework -- P. Mato/CERN
HepMC I/O proposal • Implementation of a class with the same interface as IO_GenEvent (ascii I/O) • Add this class to ROOT + the dictionaries for HepMC classes namespace HepMC { class IO_ROOT : public HepMC::IO_BaseClass { public: IO_ROOT(conststd::string& filename = "hepmc.root",std::ios::openmode mode = std::ios::out); virtual ~IO_ROOT(); virtual void write_event(constHepMC::GenEvent*); virtual boolfill_next_event(HepMC::GenEvent*); }; } LC Software Framework -- P. Mato/CERN
HepMC I/O example • A little example in Python • Added some nice ‘pythonizations’ import ROOT ios_in = getattr(ROOT.ios,'in') # 'in' is a reserved Python token ios_out = getattr(ROOT.ios,'out') HepMC = ROOT.HepMC def isFinal(p) : if not p.end_vertex() and p.status() == 1 : return True return False for evt in HepMC.IO_ROOT('testIOGenEvent.root', ios_in): for p in evt.particles() : if isFinal(p) : print p LC Software Framework -- P. Mato/CERN