CMS 3D CMS Logo

VisCMSMagFieldTwig Class Reference

#include <VisReco/VisMagneticField/interface/VisCMSMagFieldTwig.h>

Inheritance diagram for VisCMSMagFieldTwig:

IgSimpleTwig IgCompoundTwig IgTwig IgRepresentable

List of all members.

Public Member Functions

bool fieldProxy (IgSbField *&field, SbBox3f &worldbox)
IgSoFieldPlanegetFieldPlane ()
void onNewEvent (const edm::Event &event, const edm::EventSetup &eventSetup)
 VisCMSMagFieldTwig (IgTwig *parent, IgState *state)

Private Attributes

bool m_done
bool m_fieldDone
IgSoFieldPlanem_fieldPlane
VisCMSMagFieldm_fieldProxy
edm::ESHandle
< VolumeBasedMagneticField
m_pSetup


Detailed Description

Definition at line 26 of file VisCMSMagFieldTwig.h.


Constructor & Destructor Documentation

VisCMSMagFieldTwig::VisCMSMagFieldTwig ( IgTwig parent,
IgState state 
)

Definition at line 31 of file VisCMSMagFieldTwig.cc.

References Ig3DFieldPlanesCategory::addOne(), DBSPlugin::get(), m_fieldPlane, and IgControlCategory::registerMe().

00032     : IgSimpleTwig (parent, "Magnetic Field", true, false, true),
00033       m_fieldProxy (new VisCMSMagField),
00034       m_fieldPlane (new IgSoFieldPlane),
00035       m_done (false),
00036       m_fieldDone (false)
00037 {
00038     Ig3DFieldPlanesCategory *fieldPlanesCategory = Ig3DFieldPlanesCategory::get (state);
00039     if (! fieldPlanesCategory)
00040         fieldPlanesCategory = new Ig3DFieldPlanesCategory (state);
00041     fieldPlanesCategory->registerMe (state);
00042     m_fieldPlane->ref ();
00043     fieldPlanesCategory->addOne (m_fieldPlane);
00044 }


Member Function Documentation

bool VisCMSMagFieldTwig::fieldProxy ( IgSbField *&  field,
SbBox3f &  worldbox 
)

Definition at line 67 of file VisCMSMagFieldTwig.cc.

References m_fieldDone, m_fieldProxy, and VisCMSMagField::valid().

00068 {
00069     // Get the current magnetic field
00070     // FIXME: Need to convert the cm to m somewhere.
00071     // The field is using cm.
00072     if (m_fieldProxy->valid ())
00073     {
00074         field = m_fieldProxy;
00075         //world dimensions: cube with each side 18+18 meters long
00076         SbBox3f world (-18.0,  // Xmin
00077                        -18.0,  // Ymin
00078                        -18.0,  // Zmin
00079                         18.0,  // Xmax
00080                         18.0,  // Ymax
00081                         18.0); // Zmax
00082         worldbox = world;
00083         m_fieldDone = true;
00084     }
00085     else
00086         field = 0;
00087     
00088     return field != 0;
00089 }

IgSoFieldPlane * VisCMSMagFieldTwig::getFieldPlane (  ) 

Definition at line 63 of file VisCMSMagFieldTwig.cc.

References m_fieldPlane.

00064 { return m_fieldPlane; }

void VisCMSMagFieldTwig::onNewEvent ( const edm::Event event,
const edm::EventSetup eventSetup 
)

Definition at line 47 of file VisCMSMagFieldTwig.cc.

References IgRepSet::invalidate(), LFfwvis, LOG, m_done, m_fieldProxy, IgSimpleTwig::name(), IgTwig::SELF_MASK, VisCMSMagField::setField(), and GsfMatrixTools::trace().

Referenced by VisCMSMagFieldContent::init().

00049 {
00050     LOG (1, trace, LFfwvis, "VisCMSMagFieldTwig[" << name ()
00051          << "]::onNewEvent()\n");
00052 
00053     if (! m_done)
00054     {
00055         m_fieldProxy->setField (eventSetup);
00056         m_done = true;
00057     }
00058 
00059     IgRepSet::invalidate (this, SELF_MASK);
00060 }


Member Data Documentation

bool VisCMSMagFieldTwig::m_done [private]

Definition at line 44 of file VisCMSMagFieldTwig.h.

Referenced by onNewEvent().

bool VisCMSMagFieldTwig::m_fieldDone [private]

Definition at line 45 of file VisCMSMagFieldTwig.h.

Referenced by fieldProxy().

IgSoFieldPlane* VisCMSMagFieldTwig::m_fieldPlane [private]

Definition at line 43 of file VisCMSMagFieldTwig.h.

Referenced by getFieldPlane(), and VisCMSMagFieldTwig().

VisCMSMagField* VisCMSMagFieldTwig::m_fieldProxy [private]

Definition at line 42 of file VisCMSMagFieldTwig.h.

Referenced by fieldProxy(), and onNewEvent().

edm::ESHandle<VolumeBasedMagneticField> VisCMSMagFieldTwig::m_pSetup [private]

Definition at line 41 of file VisCMSMagFieldTwig.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:35:09 2009 for CMSSW by  doxygen 1.5.4