/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Attributes
GtHepMCDumper Class Reference

GtHepMCDumper - simple text dump of the HepMCEvents. More...

#include <GtHepMCDumper.h>

List of all members.

Public Member Functions

 GtHepMCDumper (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~GtHepMCDumper ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()

Private Attributes

std::string m_tesLoc
 Property: "Location" of HepMCEvents in TES.
bool m_standardDumper
 Property: "StandardDumper" boolean, if true use HepMC's dumper, else (default) use hand written one.

Detailed Description

GtHepMCDumper - simple text dump of the HepMCEvents.

Definition at line 9 of file GtHepMCDumper.h.


Constructor & Destructor Documentation

GtHepMCDumper::GtHepMCDumper ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 10 of file GtHepMCDumper.cc.

    : GaudiAlgorithm(name,pSvcLocator)
{
    declareProperty("Location",m_tesLoc = DayaBay::GenHeaderLocation::Default,
                    "Location in TES of HepMCEvents");
    declareProperty("StandardDumper",m_standardDumper=false,
                    "Use standard HepMC dumper (def=false)");
}
GtHepMCDumper::~GtHepMCDumper ( ) [virtual]

Definition at line 18 of file GtHepMCDumper.cc.

{
}

Member Function Documentation

StatusCode GtHepMCDumper::initialize ( ) [virtual]

Definition at line 21 of file GtHepMCDumper.cc.

{
    return this->GaudiAlgorithm::initialize();
}
StatusCode GtHepMCDumper::execute ( ) [virtual]

Definition at line 28 of file GtHepMCDumper.cc.

{
    DayaBay::GenHeader* header = 0;
    try {
        header = get<DayaBay::GenHeader>(m_tesLoc);
    }
    catch (const GaudiException& eg) {
        fatal() << "Failed to get GenHeader from TES at " << m_tesLoc << endreq;
        return StatusCode::FAILURE;
    }

    const TimeStamp& reftime = header->timeStamp();

    info () << "Generator: " << header->generatorName() 
            << " @ reference time: " << reftime
            << " made:" << endreq;
    if (m_standardDumper) {
        header->event()->print();
        return StatusCode::SUCCESS;
    }

    GenEvent* event = header->event();
    if (!event) {
        info() << "\nEvent #(unknown), the GenEvent must be pruned"
               << endreq;
        return StatusCode::SUCCESS;
    }
    info() << "\nEvent #" << event->event_number() 
           << " signal_process_id=" << event->signal_process_id() << ", " 
           << event->vertices_size() << " vertices\n";
    GenEvent::vertex_iterator vit, vdone = event->vertices_end();
    for (vit=event->vertices_begin(); vit != vdone; ++vit) {
        GenVertex* vtx = *vit;
        info() << "\t#" << vtx->id() << " bc="<< vtx->barcode() << " @ x=(" 
               << vtx->position().x()/CLHEP::cm << ","
               << vtx->position().y()/CLHEP::cm << ","
               << vtx->position().z()/CLHEP::cm << ","
               << vtx->position().t()/CLHEP::second << ") [cm,cm,cm,second] (abstime="
               << vtx->position().t()/CLHEP::second + (double)reftime << ")\n"
               << "\t " << vtx->particles_in_size() << " IN particles:\n";
        GenVertex::particles_in_const_iterator piit, pidone = vtx->particles_in_const_end();
        for (piit=vtx->particles_in_const_begin(); piit != pidone; ++piit) {
            const GenParticle* part = *piit;
            info() << "\t\tPDGID=" << part->pdg_id() << " P=("
                   << part->momentum().x() << ","
                   << part->momentum().y() << ","
                   << part->momentum().z() << ","
                   << part->momentum().t() << ")\n";
        }
        info() << "\t " << vtx->particles_out_size() << " OUT particles:\n";
        GenVertex::particles_out_const_iterator poit, podone = vtx->particles_out_const_end();
        for (poit=vtx->particles_out_const_begin(); poit != podone; ++poit) {
            const GenParticle* part = *poit;
            info() << "\t\tPDGID=" << part->pdg_id() << " P=("
                   << part->momentum().x() << ","
                   << part->momentum().y() << ","
                   << part->momentum().z() << ","
                   << part->momentum().t() << ")\n";
        }

    } // loop over vertices
    info() << endreq;

    return StatusCode::SUCCESS;
}
StatusCode GtHepMCDumper::finalize ( ) [virtual]

Definition at line 93 of file GtHepMCDumper.cc.

{
    return this->GaudiAlgorithm::finalize();
}

Member Data Documentation

std::string GtHepMCDumper::m_tesLoc [private]

Property: "Location" of HepMCEvents in TES.

Definition at line 19 of file GtHepMCDumper.h.

Property: "StandardDumper" boolean, if true use HepMC's dumper, else (default) use hand written one.

Definition at line 23 of file GtHepMCDumper.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:18:51 for GenTools by doxygen 1.7.4