CMS 3D CMS Logo

VisCMSMagFieldContent.cc

Go to the documentation of this file.
00001 //<<<<<< INCLUDES                                                       >>>>>>
00002 
00003 #include "VisReco/VisMagneticField/interface/VisCMSMagFieldContent.h"
00004 #include "VisReco/VisMagneticField/interface/VisCMSMagFieldTwig.h"
00005 #include "VisFramework/VisFrameworkBase/interface/VisEventProcessorService.h"
00006 #include "Iguana/Studio/interface/IgQtLock.h"
00007 #include "Iguana/Framework/interface/IgRepSet.h"
00008 #include "Iguana/Studio/interface/IgDocumentData.h"
00009 #include "Iguana/Studio/interface/IgQtAppStatusBarService.h"
00010 #include <classlib/utils/Callback.h>
00011 
00012 //<<<<<< PRIVATE DEFINES                                                >>>>>>
00013 //<<<<<< PRIVATE CONSTANTS                                              >>>>>>
00014 //<<<<<< PRIVATE TYPES                                                  >>>>>>
00015 //<<<<<< PRIVATE VARIABLE DEFINITIONS                                   >>>>>>
00016 //<<<<<< PUBLIC VARIABLE DEFINITIONS                                    >>>>>>
00017 //<<<<<< CLASS STRUCTURE INITIALIZATION                                 >>>>>>
00018 
00019 IG_DEFINE_STATE_ELEMENT (VisCMSMagFieldContent, "Data/Reco/CMS Magnetic Field");
00020 
00021 //<<<<<< PRIVATE FUNCTION DEFINITIONS                                   >>>>>>
00022 //<<<<<< PUBLIC FUNCTION DEFINITIONS                                    >>>>>>
00023 //<<<<<< MEMBER FUNCTION DEFINITIONS                                    >>>>>>
00024 
00026 VisCMSMagFieldContent::VisCMSMagFieldContent (IgState *state)
00027     : VisContent (state, s_key, MAIN_THREAD,
00028                   lat::CreateCallback (this, &VisCMSMagFieldContent::init))
00029 {
00030 }
00031 
00034 void
00035 VisCMSMagFieldContent::init (void)
00036 {
00037     // FIXME: need to document model registration + browsing support
00038     IgQtLock ();
00039 
00040     IgTwig *rootTwig = IgDocumentData::get (state ())->root ();
00041     IgTwig *topTwig = 0;
00042 
00043     topTwig = rootTwig->lookup ("CMS Event and Detector");
00044     if (!topTwig) topTwig = new IgSimpleTwig (rootTwig, "CMS Event and Detector");
00045     
00046     IgTwig *annotations = 0;
00047     annotations = topTwig->lookup ("Annotations");
00048     
00049     if (! annotations)
00050         annotations = new IgSimpleTwig (topTwig, "Annotations");
00051     
00052     VisCMSMagFieldTwig *magFieldTwig = new VisCMSMagFieldTwig (annotations, state ());
00053 
00054     if (VisEventProcessorService *procService = VisEventProcessorService::get (state ())) 
00055     {
00056         (*procService)->postProcessEventSignal().connect (sigc::mem_fun (magFieldTwig, &VisCMSMagFieldTwig::onNewEvent));
00057     }
00058     else
00059         if (IgQtAppStatusBarService *sbar = IgQtAppStatusBarService::get (state ()))
00060         {
00061             sbar->setMessage ("ERROR: EventProcessor initialisation failed.");
00062         }
00063     
00064     IgRepSet::invalidate (rootTwig, IgTwig::SELF_MASK | IgTwig::STRUCTURE_MASK);
00065 }

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