#include <VisReco/VisMETReco/interface/VisCaloMETTwig.h>
Public Member Functions | |
virtual void | onNewEvent (const edm::Event &event, const edm::EventSetup &eventSetup) |
virtual void | update (IgRZRep *rep) |
virtual void | update (IgRPhiRep *rep) |
virtual void | update (IgTextRep *rep) |
virtual void | update (IgLegoRep *rep) |
virtual void | update (Ig3DRep *rep) |
VisCaloMETTwig (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 | |
const std::string | m_friendlyName |
std::vector< edm::Handle < CaloMETCollection > > | m_handles |
const std::string | m_instanceName |
const std::string | m_moduleLabel |
std::string | m_name |
const std::string | m_processName |
std::string | m_text |
Definition at line 19 of file VisCaloMETTwig.h.
VisCaloMETTwig::VisCaloMETTwig | ( | 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 49 of file VisCaloMETTwig.cc.
References createThisTwig(), edm::TypeID::friendlyClassName(), DBSPlugin::get(), and VisTwigFactroyService::registerTwig().
00055 : VisQueuedTwig (state, parent, name), 00056 m_name (name), 00057 m_friendlyName (friendlyName), 00058 m_moduleLabel (moduleLabel), 00059 m_instanceName (instanceName), 00060 m_processName (processName), 00061 m_text ("no info") 00062 { 00063 VisTwigFactroyService *tfService = VisTwigFactroyService::get (state); 00064 if (! tfService) 00065 { 00066 tfService = new VisTwigFactroyService (state); 00067 } 00068 edm::TypeID metCollID (typeid (CaloMETCollection)); 00069 tfService->registerTwig (metCollID.friendlyClassName (), &createThisTwig); 00070 }
void VisCaloMETTwig::onNewEvent | ( | const edm::Event & | event, | |
const edm::EventSetup & | eventSetup | |||
) | [virtual] |
Reimplemented from VisQueuedTwig.
Definition at line 73 of file VisCaloMETTwig.cc.
References arg, e, exception, edm::Event::id(), m_friendlyName, m_handles, m_instanceName, m_moduleLabel, VisQueuedTwig::m_onCmsException, VisQueuedTwig::m_onError, VisQueuedTwig::m_onException, VisQueuedTwig::m_onUnhandledException, m_processName, m_text, VisQueuedTwig::onBaseInvalidate(), and VisQueuedTwig::onNewEvent().
00075 { 00076 // Get debugging dump. 00077 VisQueuedTwig::onNewEvent (event, eventSetup); 00078 00079 m_text = (QString ("Run # %1, event # %2") 00080 .arg (event.id ().run ()) 00081 .arg (event.id ().event ()).latin1 ()); 00082 00083 try 00084 { 00085 if ((! m_friendlyName.empty ()) || (! m_moduleLabel.empty ()) || (! m_instanceName.empty ()) || (! m_processName.empty ())) 00086 { 00087 VisEventSelector visSel (m_friendlyName, m_moduleLabel, m_instanceName, m_processName); 00088 event.getMany (visSel, m_handles); 00089 } 00090 else 00091 { 00092 event.getManyByType (m_handles); 00093 } 00094 } 00095 catch (cms::Exception& e) 00096 { 00097 if (this->m_onCmsException) 00098 this->m_onCmsException (&e); 00099 } 00100 catch (lat::Error &e) 00101 { 00102 if (this->m_onError) 00103 this->m_onError (&e); 00104 } 00105 catch (std::exception &e) 00106 { 00107 if (this->m_onException) 00108 this->m_onException (&e); 00109 } 00110 catch (...) 00111 { 00112 if (this->m_onUnhandledException) 00113 this->m_onUnhandledException (); 00114 } 00115 00116 VisQueuedTwig::onBaseInvalidate (); 00117 }
Reimplemented from VisQueuedTwig.
Definition at line 227 of file VisCaloMETTwig.cc.
References Ig3DBaseRep::clear(), and VisQueuedTwig::update().
00228 { 00229 // Get debugging dump. 00230 VisQueuedTwig::update (rep); 00231 00232 IgQtLock (); 00233 rep->clear (); 00234 }
Reimplemented from VisQueuedTwig.
Definition at line 217 of file VisCaloMETTwig.cc.
References Ig3DBaseRep::clear(), and VisQueuedTwig::update().
00218 { 00219 // Get debugging dump. 00220 VisQueuedTwig::update (rep); 00221 00222 IgQtLock (); 00223 rep->clear (); 00224 }
Reimplemented from VisQueuedTwig.
Definition at line 120 of file VisCaloMETTwig.cc.
References e, exception, i, m_handles, m_name, VisQueuedTwig::m_onCmsException, VisQueuedTwig::m_onError, VisQueuedTwig::m_onException, VisQueuedTwig::m_onUnhandledException, m_text, CaloMET_cfi::met, phi, reco::Particle::phi(), reco::Particle::pt(), IgTextRep::setText(), and VisQueuedTwig::update().
00121 { 00122 // Get debugging dump. 00123 VisQueuedTwig::update (rep); 00124 00125 // Prepare property description. 00126 std::ostringstream text; 00127 text << m_name << " from "; 00128 text << m_text << "<br>"; 00129 00130 text << "<table width='100%' border=1>" 00131 << "<TR align = center>" 00132 << "<TH>Number</TH>" 00133 << "<TH>Et</TH>" 00134 << "<TH>Phi</TH>" 00135 << "</TR>"; 00136 text << setiosflags (std::ios::showpoint | std::ios::fixed); 00137 text.setf (std::ios::right, std::ios::adjustfield); 00138 00139 int nmets = 0; 00140 if (! m_handles.empty ()) 00141 { 00142 try 00143 { 00144 for (std::vector<edm::Handle<CaloMETCollection> >::iterator i = m_handles.begin (), iEnd = m_handles.end (); 00145 i != iEnd; ++i) 00146 { 00147 const CaloMETCollection *met = (*i).product (); 00148 const CaloMET caloMET = met->front (); 00149 Float_t phi = caloMET.phi (); 00150 Float_t et = caloMET.pt (); 00151 00152 text << "<TR align = right>" 00153 << "<TD>" << std::setw (3) << ++nmets << "</TD>" 00154 << "<TD>" << std::setw (5) << std::setprecision (3) << et << "</TD>" 00155 << "<TD>" << std::setw (5) << std::setprecision (3) << phi << "</TD>" 00156 << "</TR>"; 00157 } 00158 } 00159 catch (cms::Exception& e) 00160 { 00161 if (this->m_onCmsException) 00162 this->m_onCmsException (&e); 00163 } 00164 catch (lat::Error &e) 00165 { 00166 if (this->m_onError) 00167 this->m_onError (&e); 00168 } 00169 catch (std::exception &e) 00170 { 00171 if (this->m_onException) 00172 this->m_onException (&e); 00173 } 00174 catch (...) 00175 { 00176 if (this->m_onUnhandledException) 00177 this->m_onUnhandledException (); 00178 } 00179 } 00180 00181 text << "</table>"; 00182 00183 // Send it over. 00184 IgQtLock (); 00185 rep->setText (text.str ()); 00186 }
Reimplemented from VisQueuedTwig.
Definition at line 207 of file VisCaloMETTwig.cc.
References Ig3DBaseRep::clear(), and VisQueuedTwig::update().
00208 { 00209 // Get debugging dump. 00210 VisQueuedTwig::update (rep); 00211 00212 IgQtLock (); 00213 rep->clear (); 00214 }
Reimplemented from VisQueuedTwig.
Definition at line 189 of file VisCaloMETTwig.cc.
References Ig3DBaseRep::clear(), Ig3DBaseRep::node(), and VisQueuedTwig::update().
00190 { 00191 // Get debugging dump. 00192 VisQueuedTwig::update (rep); 00193 00194 IgQtLock (); 00195 rep->clear (); 00196 00197 SoSeparator *sep = new SoSeparator; 00198 00199 SoMaterial *mat = new SoMaterial; 00200 mat->diffuseColor.setValue (1, 0, 0); 00201 sep->addChild (mat); 00202 00203 rep->node ()->addChild (sep); 00204 }
const std::string VisCaloMETTwig::m_friendlyName [private] |
std::vector<edm::Handle<CaloMETCollection> > VisCaloMETTwig::m_handles [private] |
const std::string VisCaloMETTwig::m_instanceName [private] |
const std::string VisCaloMETTwig::m_moduleLabel [private] |
std::string VisCaloMETTwig::m_name [private] |
Reimplemented from IgSimpleTwig.
Definition at line 41 of file VisCaloMETTwig.h.
Referenced by update().
const std::string VisCaloMETTwig::m_processName [private] |
std::string VisCaloMETTwig::m_text [private] |