CMS 3D CMS Logo

VisHFDataFrameTwig Class Reference

#include <VisReco/VisHcal/interface/VisHFDataFrameTwig.h>

Inheritance diagram for VisHFDataFrameTwig:

VisQueuedTwig IgSimpleTwig VisEventObserver IgCompoundTwig IgTwig IgRepresentable

List of all members.

Public Member Functions

virtual void onNewEvent (const edm::Event &event, const edm::EventSetup &eventSetup)
virtual void update (IgRZRep *rep)
virtual void update (IgTextRep *rep)
virtual void update (IgLegoRep *rep)
virtual void update (Ig3DRep *rep)
 VisHFDataFrameTwig (IgState *state, IgTwig *parent, const std::string &name="", const std::string &friendlyName="", const std::string &moduleLabel="", const std::string &instanceName="", const std::string &processName="")

Private Attributes

std::vector< HFDataFramem_digis
const std::string m_friendlyName
const std::string m_instanceName
const std::string m_moduleLabel
std::string m_name
const std::string m_processName
std::string m_text


Detailed Description

Definition at line 18 of file VisHFDataFrameTwig.h.


Constructor & Destructor Documentation

VisHFDataFrameTwig::VisHFDataFrameTwig ( IgState state,
IgTwig parent,
const std::string &  name = "",
const std::string &  friendlyName = "",
const std::string &  moduleLabel = "",
const std::string &  instanceName = "",
const std::string &  processName = "" 
)

Definition at line 47 of file VisHFDataFrameTwig.cc.

References createThisTwig(), edm::TypeID::friendlyClassName(), DBSPlugin::get(), and VisTwigFactroyService::registerTwig().

00053     : VisQueuedTwig (state, parent, name),
00054       m_name (name),
00055       m_friendlyName (friendlyName),
00056       m_moduleLabel (moduleLabel),
00057       m_instanceName (instanceName),
00058       m_processName (processName),
00059       m_text ("no info")
00060 {    
00061     VisTwigFactroyService *tfService = VisTwigFactroyService::get (state);
00062     if (! tfService)
00063     {
00064         tfService = new VisTwigFactroyService (state);
00065     }
00066     edm::TypeID digiHitCollID (typeid (HFDigiCollection));
00067     tfService->registerTwig (digiHitCollID.friendlyClassName (), &createThisTwig);
00068 
00069 }


Member Function Documentation

void VisHFDataFrameTwig::onNewEvent ( const edm::Event event,
const edm::EventSetup eventSetup 
) [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 72 of file VisHFDataFrameTwig.cc.

References arg, edm::SortedCollection< T, SORT >::begin(), c, edm::SortedCollection< T, SORT >::end(), i, edm::Event::id(), IgRepSet::invalidate(), m_digis, m_friendlyName, m_instanceName, m_moduleLabel, m_processName, m_text, VisQueuedTwig::onBaseInvalidate(), and IgTwig::SELF_MASK.

00074 {
00075     VisQueuedTwig::onBaseInvalidate ();
00076     m_digis.clear ();
00077 
00078     m_text = (QString ("Run # %1, event # %2")
00079               .arg (event.id ().run ())
00080               .arg (event.id ().event ()).latin1 ());
00081     
00082 // FIXME: We may need the CaloGeometry later...
00083 //     if (! m_done)
00084 //     {
00085 //      try
00086 //      {
00087 //          eventSetup.get<CaloGeometryRecord> ().get (m_pDD);
00088 //          m_done = true;
00089 //      }
00090 //      catch (...) 
00091 //      {
00092 //      }
00093 //     }
00094 
00095     std::vector<edm::Handle<HFDigiCollection> > digis;
00096     try
00097     {
00098         if ((! m_friendlyName.empty ()) || (! m_moduleLabel.empty ()) || (! m_instanceName.empty ()) || (! m_processName.empty ()))
00099         {
00100             VisEventSelector visSel (m_friendlyName, m_moduleLabel, m_instanceName, m_processName);
00101             event.getMany (visSel, digis);
00102         }
00103         else
00104         {
00105             event.getManyByType (digis);
00106         }
00107     }
00108     catch (...) 
00109     {
00110     }
00111     if (! digis.empty ())
00112     {
00113         for (std::vector<edm::Handle<HFDigiCollection> >::iterator i = digis.begin (), iEnd = digis.end (); i != iEnd; ++i) 
00114         {
00115             const HFDigiCollection& c = *(*i);
00116             for (std::vector<HFDataFrame>::const_iterator idigi = c.begin (), idigiEnd = c.end (); 
00117                  idigi != idigiEnd; ++idigi)
00118             {
00119                 m_digis.push_back (*idigi);
00120             }
00121         }
00122     }
00123     
00124     IgRepSet::invalidate (this, SELF_MASK);
00125 }

void VisHFDataFrameTwig::update ( IgRZRep rep  )  [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 191 of file VisHFDataFrameTwig.cc.

References Ig3DBaseRep::clear(), Ig3DBaseRep::node(), and VisQueuedTwig::update().

00192 {
00193     // Get debugging dump.
00194     VisQueuedTwig::update (rep);
00195 
00196     IgQtLock ();
00197     rep->clear ();
00198 
00199     SoSeparator *sep = new SoSeparator;
00200     
00201     rep->node ()->addChild (sep);
00202 }

void VisHFDataFrameTwig::update ( IgTextRep rep  )  [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 128 of file VisHFDataFrameTwig.cc.

References i, m_digis, m_name, m_text, IgTextRep::setText(), VisHcalSubdetector::subDetName(), and VisQueuedTwig::update().

00129 {
00130     // Get debugging dump.
00131     VisQueuedTwig::update (rep);
00132 
00133     // Prepare property description.
00134     std::ostringstream  text;
00135     text << m_name << " from ";
00136     text << m_text << "<br>";
00137 
00138     text << "<table width='100%' border=1>"
00139          << "<TR align = center>"
00140          << "<TH>Number</TH>"
00141          << "<TH>Subdetector</TH>"
00142          << "<TH>ietaAbs</TH>"
00143          << "<TH>ieta</TH>"
00144          << "<TH>iphi [rad]</TH>"
00145          << "<TH>Depth</TH>"
00146          << "</TR>";
00147     text << setiosflags (std::ios::showpoint | std::ios::fixed);
00148     text.setf (std::ios::right, std::ios::adjustfield);
00149     
00150     int nDigis = 0;
00151     try 
00152     {
00153         for (std::vector<HFDataFrame>::const_iterator i = m_digis.begin (), iEnd = m_digis.end (); i != iEnd; ++i) 
00154         {
00155             text << "<TR align = right>"
00156                  << "<TD>" << std::setw (3) << nDigis++ << "</TD>"
00157                  << "<TD>" << std::setw (2) << VisHcalSubdetector::subDetName ((*i).id ().subdet ()) << "</TD>"
00158                  << "<TD>" << std::setw (5) << std::setprecision (3) << (*i).id ().ietaAbs () << "</TD>"
00159                  << "<TD>" << std::setw (6) << std::setprecision (3) << (*i).id ().ieta () << "</TD>"
00160                  << "<TD>" << std::setw (5) << std::setprecision (3) << (*i).id ().iphi () << "</TD>"
00161                  << "<TD>" << std::setw (5) << std::setprecision (3) << (*i).id ().depth() << "</TD>"
00162                  << "</TR>";
00163         }
00164     }
00165     catch (...)
00166     {
00167         text << "No " << m_name << " HF digis.<br>";
00168     }
00169     text << "</table>";
00170     
00171     // Send it over.
00172     IgQtLock ();
00173     rep->setText (text.str ());
00174 }

void VisHFDataFrameTwig::update ( IgLegoRep rep  )  [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 205 of file VisHFDataFrameTwig.cc.

References Ig3DBaseRep::clear(), Ig3DBaseRep::node(), and VisQueuedTwig::update().

00206 {
00207     // Get debugging dump.
00208     VisQueuedTwig::update (rep);
00209 
00210     IgQtLock ();
00211     rep->clear ();
00212     
00213     SoSeparator *sep = new SoSeparator;
00214     
00215     rep->node ()->addChild (sep);
00216 }

void VisHFDataFrameTwig::update ( Ig3DRep rep  )  [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 177 of file VisHFDataFrameTwig.cc.

References Ig3DBaseRep::clear(), Ig3DBaseRep::node(), and VisQueuedTwig::update().

00178 {
00179     // Get debugging dump.
00180     VisQueuedTwig::update (rep);
00181 
00182     IgQtLock ();
00183     rep->clear ();
00184 
00185     SoSeparator *sep = new SoSeparator;
00186     
00187     rep->node ()->addChild (sep);
00188 }


Member Data Documentation

std::vector<HFDataFrame> VisHFDataFrameTwig::m_digis [private]

Definition at line 45 of file VisHFDataFrameTwig.h.

Referenced by onNewEvent(), and update().

const std::string VisHFDataFrameTwig::m_friendlyName [private]

Definition at line 40 of file VisHFDataFrameTwig.h.

Referenced by onNewEvent().

const std::string VisHFDataFrameTwig::m_instanceName [private]

Definition at line 42 of file VisHFDataFrameTwig.h.

Referenced by onNewEvent().

const std::string VisHFDataFrameTwig::m_moduleLabel [private]

Definition at line 41 of file VisHFDataFrameTwig.h.

Referenced by onNewEvent().

std::string VisHFDataFrameTwig::m_name [private]

Reimplemented from IgSimpleTwig.

Definition at line 39 of file VisHFDataFrameTwig.h.

Referenced by update().

const std::string VisHFDataFrameTwig::m_processName [private]

Definition at line 43 of file VisHFDataFrameTwig.h.

Referenced by onNewEvent().

std::string VisHFDataFrameTwig::m_text [private]

Definition at line 44 of file VisHFDataFrameTwig.h.

Referenced by onNewEvent(), and update().


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