CMS 3D CMS Logo

VisG4EventTwig.cc

Go to the documentation of this file.
00001 //<<<<<< INCLUDES                                                       >>>>>>
00002 
00003 #include "VisSimulation/VisSimBase/interface/VisG4EventTwig.h"
00004 #include "SimG4Core/Notification/interface/BeginOfEvent.h"
00005 #include "Iguana/Models/interface/IgTextRep.h"
00006 #include <qapplication.h>
00007 #include <G4Event.hh>
00008 #include <sstream>
00009 
00010 //<<<<<< PRIVATE DEFINES                                                >>>>>>
00011 //<<<<<< PRIVATE CONSTANTS                                              >>>>>>
00012 //<<<<<< PRIVATE TYPES                                                  >>>>>>
00013 //<<<<<< PRIVATE VARIABLE DEFINITIONS                                   >>>>>>
00014 //<<<<<< PUBLIC VARIABLE DEFINITIONS                                    >>>>>>
00015 //<<<<<< CLASS STRUCTURE INITIALIZATION                                 >>>>>>
00016 //<<<<<< PRIVATE FUNCTION DEFINITIONS                                   >>>>>>
00017 //<<<<<< PUBLIC FUNCTION DEFINITIONS                                    >>>>>>
00018 //<<<<<< MEMBER FUNCTION DEFINITIONS                                    >>>>>>
00019 
00020 VisG4EventTwig::VisG4EventTwig (IgState *state, IgTwig *parent)
00021     : VisQueuedTwig (state, parent, "Event"),
00022       m_event (0)
00023 { //init (); 
00024 }
00025 
00026 void
00027 VisG4EventTwig::update (IgTextRep *rep)
00028 {
00029     // Get debugging dump.
00030     VisQueuedTwig::update (rep);
00031     
00032     // Prepare property description.
00033     const G4Event       *event = m_event;
00034     std::ostringstream  text;
00035 
00036     text << "<table width='100%'><tr><td>Event Nr</td><td>";
00037 
00038     if (event)
00039         text << event->GetEventID ();
00040     else
00041         text << "(no event)";
00042 
00043     text << "</td></tr></table>" << '\0';
00044 
00045     // Send it over.
00046     qApp->lock ();
00047     rep->setText (text.str ());
00048     qApp->unlock (false);
00049 }
00050 
00051 void
00052 VisG4EventTwig::update (const BeginOfEvent *event)
00053 {
00054     // Let base class do the hard work
00055     // onBaseUpDate ();
00056     
00057     // recover G4 pointer
00058     m_event = (*event) ();
00059 }

Generated on Tue Jun 9 17:50:29 2009 for CMSSW by  doxygen 1.5.4