#include <VisReco/VisMuonDT/interface/VisDTDigiTwig.h>
Public Member Functions | |
void | annotate (bool flag) |
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) |
VisDTDigiTwig (IgState *state, IgTwig *parent, const std::string &name="", const std::string &friendlyName="", const std::string &moduleLabel="", const std::string &instanceName="", const std::string &processName="", unsigned color=0x66ff0000, int wheel=10, int sector=0) | |
Private Member Functions | |
void | addDescription (SoSeparator *separator, const std::pair< DTLayerId, DTDigi > &digi) |
SoSeparator * | addText (const std::pair< DTLayerId, DTDigi > &digi) |
void | addWire (SoSeparator *separator, const std::pair< DTLayerId, DTDigi > &digi) |
Transform and add the wire to the scene graph. | |
Private Attributes | |
bool | m_annotate |
std::vector< std::pair < DTLayerId, DTDigi > > | m_digis |
const std::string | m_friendlyName |
const std::string | m_instanceName |
int | m_layer |
const std::string | m_moduleLabel |
edm::ESHandle< DTGeometry > | m_pDD |
const std::string | m_processName |
unsigned | m_rgba |
int | m_sector |
std::string | m_text |
int | m_wheel |
Definition at line 25 of file VisDTDigiTwig.h.
VisDTDigiTwig::VisDTDigiTwig | ( | IgState * | state, | |
IgTwig * | parent, | |||
const std::string & | name = "" , |
|||
const std::string & | friendlyName = "" , |
|||
const std::string & | moduleLabel = "" , |
|||
const std::string & | instanceName = "" , |
|||
const std::string & | processName = "" , |
|||
unsigned | color = 0x66ff0000 , |
|||
int | wheel = 10 , |
|||
int | sector = 0 | |||
) |
Definition at line 61 of file VisDTDigiTwig.cc.
References createThisTwig(), edm::TypeID::friendlyClassName(), DBSPlugin::get(), and VisTwigFactroyService::registerTwig().
00071 : VisQueuedTwig (state, parent, name + QString (" (Superlayer # %1)").arg (layer).latin1 ()), 00072 : VisQueuedTwig (state, parent, name), 00073 m_text ("no info"), 00074 m_friendlyName (friendlyName), 00075 m_moduleLabel (moduleLabel), 00076 m_instanceName (instanceName), 00077 m_processName (processName), 00078 // m_layer (layer), 00079 m_rgba (color), 00080 m_wheel (wheel), 00081 m_sector (sector), 00082 m_annotate (false) 00083 { 00084 // m_rgba = 0x66ff0000; 00085 VisTwigFactroyService *tfService = VisTwigFactroyService::get (state); 00086 if (! tfService) 00087 { 00088 tfService = new VisTwigFactroyService (state); 00089 } 00090 edm::TypeID dtDigisID (typeid (DTDigiCollection)); 00091 tfService->registerTwig (dtDigisID.friendlyClassName (), &createThisTwig); 00092 }
void VisDTDigiTwig::addDescription | ( | SoSeparator * | separator, | |
const std::pair< DTLayerId, DTDigi > & | digi | |||
) | [private] |
Definition at line 678 of file VisDTDigiTwig.cc.
References angle(), VisTrackingGeometry::createRotation(), label, m_pDD, DTLayer::specificTopology(), GeomDet::surface(), Surface::toGlobal(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by addText().
00679 { 00680 // position of the wafer's center 00681 // float posx = det->surface ().position ().x () / 100.0; // cm -> m 00682 // float posy = det->surface ().position ().y () / 100.0; // cm -> m 00683 // float posz = det->surface ().position ().z () / 100.0; // cm -> m 00684 00685 // float angle; 00686 // SbVec3f axis; 00687 // createRotation (det, axis, angle); 00688 00689 // SoTransform *transform = new SoTransform; 00690 // transform->translation.setValue (posx, posy, posz); 00691 // transform->rotation.setValue (axis, angle); 00692 00693 Surface::GlobalPoint cpos (0.0, 0.0, 0.0); 00694 00695 const DTLayer *layer = m_pDD->layer (digi.first); 00696 00697 const GeomDetUnit *det = m_pDD->idToDetUnit (digi.first); 00698 int wireNumber = digi.second.wire (); 00699 00700 // Position of the wire in the Layer's reference frame 00701 float localXPos = layer->specificTopology ().wirePosition (wireNumber); 00702 LocalPoint localPos (localXPos, 0, 0); 00703 // Position of the wire in the CMS's ref.frame 00704 cpos = layer->surface ().toGlobal (localPos); 00705 00706 float posx = cpos.x () / 100.0; // cm -> m 00707 float posy = cpos.y () / 100.0; // cm -> m 00708 float posz = cpos.z () / 100.0; // cm -> m 00709 00710 float angle; 00711 SbVec3f axis; 00712 VisTrackingGeometry::createRotation (det, axis, angle); 00713 00714 SoTransform *transform = new SoTransform; 00715 transform->translation.setValue (posx, posy, posz); 00716 transform->rotation.setValue (axis, angle); 00717 00718 // int wireNumber = digi.second.wire (); 00719 00720 QString label = QString ("%1").arg (wireNumber); 00721 SoSeparator *labelSep = new SoSeparator; 00722 SoText2 *cLabel = new SoText2; 00723 cLabel->string = label.latin1 (); 00724 labelSep->addChild (cLabel); 00725 00726 separator->addChild (transform); 00727 separator->addChild (labelSep); 00728 }
Definition at line 646 of file VisDTDigiTwig.cc.
References addDescription(), DTLayer::chamber(), DTChamber::id(), m_pDD, m_sector, m_wheel, DTChamberId::sector(), and DTChamberId::wheel().
Referenced by update().
00647 { 00648 SoSeparator *sep = new SoSeparator; 00649 SoMaterial *mat = new SoMaterial; 00650 SoDrawStyle *style = new SoDrawStyle; 00651 style->style = SoDrawStyle::LINES; 00652 sep->addChild (mat); 00653 sep->addChild (style); 00654 00655 // Surface::GlobalPoint cpos (0.0, 0.0, 0.0); 00656 00657 const DTLayer *layer = m_pDD->layer (digi.first); 00658 00659 const DTChamber* chamber = layer->chamber(); 00660 const DTChamberId chamberId = chamber->id(); 00661 00662 bool draw = true; 00663 ((m_sector == 0) || (m_sector == chamberId.sector()) && draw) ? draw = true : draw = false; 00664 ((m_wheel == 10) || (m_wheel == chamberId.wheel()) && draw) ? draw = true : draw = false; 00665 00666 if (draw) 00667 { 00668 SoSeparator* separator = new SoSeparator; 00669 addDescription (separator, digi); 00670 sep->addChild (separator); 00671 } 00672 00673 return sep; 00674 }
void VisDTDigiTwig::addWire | ( | SoSeparator * | separator, | |
const std::pair< DTLayerId, DTDigi > & | digi | |||
) | [private] |
Transform and add the wire to the scene graph.
Definition at line 599 of file VisDTDigiTwig.cc.
References angle(), DTTopology::cellHeight(), DTTopology::cellLenght(), DTTopology::cellWidth(), DTLayer::chamber(), VisTrackingGeometry::createRotation(), DTChamber::id(), m_pDD, m_sector, m_wheel, DTChamberId::sector(), DTLayer::specificTopology(), GeomDet::surface(), Surface::toGlobal(), DTChamberId::wheel(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by update().
00600 { 00601 Surface::GlobalPoint cpos (0.0, 0.0, 0.0); 00602 00603 const DTLayer *layer = m_pDD->layer (digi.first); 00604 00605 const DTChamber* chamber = layer->chamber(); 00606 const DTChamberId chamberId = chamber->id(); 00607 00608 bool draw = true; 00609 ((m_sector == 0) || (m_sector == chamberId.sector()) && draw) ? draw = true : draw = false; 00610 ((m_wheel == 10) || (m_wheel == chamberId.wheel()) && draw) ? draw = true : draw = false; 00611 if (draw) 00612 { 00613 const GeomDetUnit *det = m_pDD->idToDetUnit (digi.first); 00614 int wireNumber = digi.second.wire (); 00615 00616 // Position of the wire in the Layer's reference frame 00617 float localXPos = layer->specificTopology ().wirePosition (wireNumber); 00618 LocalPoint localPos (localXPos, 0, 0); 00619 // Position of the wire in the CMS's ref.frame 00620 cpos = layer->surface ().toGlobal (localPos); 00621 00622 float posx = cpos.x () / 100.0; // cm -> m 00623 float posy = cpos.y () / 100.0; // cm -> m 00624 float posz = cpos.z () / 100.0; // cm -> m 00625 00626 float angle; 00627 SbVec3f axis; 00628 VisTrackingGeometry::createRotation (det, axis, angle); 00629 00630 SoTransform *transform = new SoTransform; 00631 transform->translation.setValue (posx, posy, posz); 00632 transform->rotation.setValue (axis, angle); 00633 00634 SoCube *cube = new SoCube; 00635 cube->width = layer->specificTopology ().cellWidth () / 100.0; // cm -> m 00636 cube->height = layer->specificTopology ().cellLenght () / 100.0; // cm -> m 00637 cube->depth = layer->specificTopology ().cellHeight () / 100.0; // cm -> m 00638 00639 separator->addChild (transform); 00640 separator->addChild (cube); 00641 } 00642 }
Definition at line 591 of file VisDTDigiTwig.cc.
References m_annotate.
00592 { 00593 m_annotate = flag; 00594 }
void VisDTDigiTwig::onNewEvent | ( | const edm::Event & | event, | |
const edm::EventSetup & | eventSetup | |||
) | [virtual] |
Reimplemented from VisQueuedTwig.
Definition at line 95 of file VisDTDigiTwig.cc.
References arg, c, e, exception, edm::EventSetup::get(), i, edm::Event::id(), m_digis, m_friendlyName, m_instanceName, m_moduleLabel, VisQueuedTwig::m_onCmsException, VisQueuedTwig::m_onError, VisQueuedTwig::m_onException, VisQueuedTwig::m_onUnhandledException, m_pDD, m_processName, m_text, VisQueuedTwig::onBaseInvalidate(), VisQueuedTwig::onNewEvent(), p, and range.
00097 { 00098 // Get debugging dump. 00099 VisQueuedTwig::onNewEvent (event, eventSetup); 00100 00101 m_digis.clear (); 00102 m_text = (QString ("Run # %1, event # %2") 00103 .arg (event.id ().run ()) 00104 .arg (event.id ().event ()).latin1 ()); 00105 00106 std::vector<edm::Handle<DTDigiCollection> > digiCollections; 00107 try 00108 { 00109 if ((! m_friendlyName.empty ()) || (! m_moduleLabel.empty ()) || (! m_instanceName.empty ()) || (! m_processName.empty ())) 00110 { 00111 VisEventSelector visSel (m_friendlyName, m_moduleLabel, m_instanceName, m_processName); 00112 event.getMany (visSel, digiCollections); 00113 } 00114 else 00115 { 00116 event.getManyByType (digiCollections); 00117 } 00118 } 00119 catch (cms::Exception& e) 00120 { 00121 if (this->m_onCmsException) 00122 this->m_onCmsException (&e); 00123 } 00124 catch (lat::Error &e) 00125 { 00126 if (this->m_onError) 00127 this->m_onError (&e); 00128 } 00129 catch (std::exception &e) 00130 { 00131 if (this->m_onException) 00132 this->m_onException (&e); 00133 } 00134 catch (...) 00135 { 00136 if (this->m_onUnhandledException) 00137 this->m_onUnhandledException (); 00138 } 00139 00140 try 00141 { 00142 eventSetup.get<MuonGeometryRecord> ().get (m_pDD); 00143 } 00144 catch (cms::Exception& e) 00145 { 00146 if (this->m_onCmsException) 00147 this->m_onCmsException (&e); 00148 } 00149 catch (lat::Error &e) 00150 { 00151 if (this->m_onError) 00152 this->m_onError (&e); 00153 } 00154 catch (std::exception &e) 00155 { 00156 if (this->m_onException) 00157 this->m_onException (&e); 00158 } 00159 catch (...) 00160 { 00161 if (this->m_onUnhandledException) 00162 this->m_onUnhandledException (); 00163 } 00164 00165 if (! digiCollections.empty ()) 00166 { 00167 std::vector<edm::Handle<DTDigiCollection> >::iterator i; 00168 std::vector<edm::Handle<DTDigiCollection> >::iterator iEnd; 00169 for (i = digiCollections.begin (), iEnd = digiCollections.end (); i != iEnd; ++i) 00170 { 00171 const DTDigiCollection& c = *(*i); 00172 // Loop over the DetUnits with digis 00173 // for (DTDigiCollection::const_iterator dgi = c.begin (); 00174 // dgi != c.end (); ++dgi) 00175 // { 00176 // m_digi.push_back (*dgi); 00177 // } 00178 DTDigiCollection::DigiRangeIterator detUnitIt; 00179 DTDigiCollection::DigiRangeIterator detUnitItEnd; 00180 for (detUnitIt = c.begin (), detUnitItEnd = c.end (); detUnitIt != detUnitItEnd; ++detUnitIt) 00181 { 00182 const DTLayerId& id = (*detUnitIt).first; 00183 00184 const DTDigiCollection::Range &range = (*detUnitIt).second; 00185 00186 // Loop over the digis of this DetUnit 00187 for (DTDigiCollection::const_iterator digiIt = range.first; 00188 digiIt != range.second; 00189 ++digiIt) 00190 { 00191 std::pair< DTLayerId, DTDigi > p; 00192 p.first = id; 00193 p.second = (*digiIt); 00194 m_digis.push_back (p); 00195 } // for digis in layer 00196 } // for layers 00197 } 00198 } 00199 00200 VisQueuedTwig::onBaseInvalidate (); 00201 }
Reimplemented from VisQueuedTwig.
Definition at line 508 of file VisDTDigiTwig.cc.
References addWire(), Ig3DBaseRep::clear(), e, exception, IgSbColorMap::hsv2rgb(), i, edm::ESHandle< T >::isValid(), m_digis, VisQueuedTwig::m_onCmsException, VisQueuedTwig::m_onError, VisQueuedTwig::m_onException, VisQueuedTwig::m_onUnhandledException, m_pDD, m_rgba, Ig3DBaseRep::node(), IgSbColorMap::pack(), IgSbColorMap::rgb2hsv(), IgSbColorMap::unpack(), and VisQueuedTwig::update().
00509 { 00510 // Get debugging dump. 00511 VisQueuedTwig::update (rep); 00512 IgQtLock (); 00513 rep->clear (); 00514 00515 if ((! m_digis.empty ()) && m_pDD.isValid ()) 00516 { 00517 SoSeparator *sep = new SoSeparator; 00518 00519 00520 float rgbcomponents [4]; 00521 float hsvcomponents [4]; 00522 float wrgbcomponents [4]; 00523 IgSbColorMap::unpack (m_rgba, rgbcomponents); 00524 IgSbColorMap::rgb2hsv (rgbcomponents, hsvcomponents); 00525 hsvcomponents [2] *= 0.5; 00526 IgSbColorMap::hsv2rgb (hsvcomponents, wrgbcomponents); 00527 IgSbColorMap::pack (wrgbcomponents); 00528 00529 SoSeparator *wsep = new SoSeparator; 00530 SoMaterial *wmat = new SoMaterial; 00531 wmat->ambientColor.setValue (SbColor (wrgbcomponents)); 00532 wmat->diffuseColor.setValue (SbColor (wrgbcomponents)); 00533 wmat->specularColor.setValue (SbColor (wrgbcomponents)); 00534 wmat->emissiveColor.setValue (SbColor (wrgbcomponents)); 00535 wsep->addChild (wmat); 00536 00537 SoDrawStyle *wdrawStyle = new SoDrawStyle; 00538 wdrawStyle->style = SoDrawStyle::LINES; 00539 wdrawStyle->lineWidth.setValue (1.0); 00540 wsep->addChild (wdrawStyle); 00541 sep->addChild (wsep); 00542 00543 SoSeparator *fsep = new SoSeparator; 00544 SoMaterial *fmat = new SoMaterial; 00545 fmat->ambientColor.setValue (SbColor (rgbcomponents)); 00546 fmat->diffuseColor.setValue (SbColor (rgbcomponents)); 00547 fmat->specularColor.setValue (SbColor (rgbcomponents)); 00548 fmat->emissiveColor.setValue (SbColor (rgbcomponents)); 00549 fsep->addChild (fmat); 00550 SoDrawStyle *fdrawStyle = new SoDrawStyle; 00551 fdrawStyle->style = SoDrawStyle::FILLED; 00552 fsep->addChild (fdrawStyle); 00553 sep->addChild (fsep); 00554 00555 try 00556 { 00557 for (std::vector<std::pair<DTLayerId, DTDigi> >::const_iterator i = m_digis.begin (), iEnd = m_digis.end (); i != iEnd; ++i) 00558 { 00559 SoSeparator* separator = new SoSeparator; 00560 addWire (separator, *i); 00561 wsep->addChild (separator); 00562 fsep->addChild (separator); 00563 } 00564 } 00565 catch (cms::Exception& e) 00566 { 00567 if (this->m_onCmsException) 00568 this->m_onCmsException (&e); 00569 } 00570 catch (lat::Error &e) 00571 { 00572 if (this->m_onError) 00573 this->m_onError (&e); 00574 } 00575 catch (std::exception &e) 00576 { 00577 if (this->m_onException) 00578 this->m_onException (&e); 00579 } 00580 catch (...) 00581 { 00582 if (this->m_onUnhandledException) 00583 this->m_onUnhandledException (); 00584 } 00585 00586 rep->node ()->addChild (sep); 00587 } 00588 }
Reimplemented from VisQueuedTwig.
Definition at line 420 of file VisDTDigiTwig.cc.
References addText(), addWire(), Ig3DBaseRep::clear(), e, exception, IgSbColorMap::hsv2rgb(), i, edm::ESHandle< T >::isValid(), m_annotate, m_digis, VisQueuedTwig::m_onCmsException, VisQueuedTwig::m_onError, VisQueuedTwig::m_onException, VisQueuedTwig::m_onUnhandledException, m_pDD, m_rgba, Ig3DBaseRep::node(), IgSbColorMap::pack(), IgSbColorMap::rgb2hsv(), IgSbColorMap::unpack(), and VisQueuedTwig::update().
00421 { 00422 // Get debugging dump. 00423 VisQueuedTwig::update (rep); 00424 00425 IgQtLock (); 00426 rep->clear (); 00427 00428 if ((! m_digis.empty ()) && m_pDD.isValid ()) 00429 { 00430 SoSeparator *sep = new SoSeparator; 00431 00432 float rgbcomponents [4]; 00433 float hsvcomponents [4]; 00434 float wrgbcomponents [4]; 00435 IgSbColorMap::unpack (m_rgba, rgbcomponents); 00436 IgSbColorMap::rgb2hsv (rgbcomponents, hsvcomponents); 00437 hsvcomponents [2] *= 0.5; 00438 IgSbColorMap::hsv2rgb (hsvcomponents, wrgbcomponents); 00439 IgSbColorMap::pack (wrgbcomponents); 00440 00441 SoSeparator *wsep = new SoSeparator; 00442 SoMaterial *wmat = new SoMaterial; 00443 wmat->ambientColor.setValue (SbColor (wrgbcomponents)); 00444 wmat->diffuseColor.setValue (SbColor (wrgbcomponents)); 00445 wmat->specularColor.setValue (SbColor (wrgbcomponents)); 00446 wmat->emissiveColor.setValue (SbColor (wrgbcomponents)); 00447 wsep->addChild (wmat); 00448 00449 SoDrawStyle *wdrawStyle = new SoDrawStyle; 00450 wdrawStyle->style = SoDrawStyle::LINES; 00451 wdrawStyle->lineWidth.setValue (1.0); 00452 wsep->addChild (wdrawStyle); 00453 sep->addChild (wsep); 00454 00455 SoSeparator *fsep = new SoSeparator; 00456 SoMaterial *fmat = new SoMaterial; 00457 fmat->ambientColor.setValue (SbColor (rgbcomponents)); 00458 fmat->diffuseColor.setValue (SbColor (rgbcomponents)); 00459 fmat->specularColor.setValue (SbColor (rgbcomponents)); 00460 fmat->emissiveColor.setValue (SbColor (rgbcomponents)); 00461 fsep->addChild (fmat); 00462 SoDrawStyle *fdrawStyle = new SoDrawStyle; 00463 fdrawStyle->style = SoDrawStyle::FILLED; 00464 fsep->addChild (fdrawStyle); 00465 sep->addChild (fsep); 00466 00467 try 00468 { 00469 for (std::vector<std::pair<DTLayerId, DTDigi> >::const_iterator i = m_digis.begin (), iEnd = m_digis.end (); i != iEnd; ++i) 00470 { 00471 SoSeparator* separator = new SoSeparator; 00472 addWire (separator, *i); 00473 wsep->addChild (separator); 00474 fsep->addChild (separator); 00475 if (m_annotate) 00476 { 00477 sep->addChild (addText (*i)); 00478 } 00479 } 00480 } 00481 catch (cms::Exception& e) 00482 { 00483 if (this->m_onCmsException) 00484 this->m_onCmsException (&e); 00485 } 00486 catch (lat::Error &e) 00487 { 00488 if (this->m_onError) 00489 this->m_onError (&e); 00490 } 00491 catch (std::exception &e) 00492 { 00493 if (this->m_onException) 00494 this->m_onException (&e); 00495 } 00496 catch (...) 00497 { 00498 if (this->m_onUnhandledException) 00499 this->m_onUnhandledException (); 00500 } 00501 00502 rep->node ()->addChild (sep); 00503 } 00504 }
Reimplemented from VisQueuedTwig.
Definition at line 204 of file VisDTDigiTwig.cc.
References DTLayer::chamber(), e, exception, i, DTChamber::id(), edm::ESHandle< T >::isValid(), m_digis, VisQueuedTwig::m_onCmsException, VisQueuedTwig::m_onError, VisQueuedTwig::m_onException, VisQueuedTwig::m_onUnhandledException, m_pDD, m_sector, m_text, m_wheel, DTChamberId::sector(), IgTextRep::setText(), VisQueuedTwig::update(), and DTChamberId::wheel().
00205 { 00206 // Get debugging dump. 00207 VisQueuedTwig::update (rep); 00208 00209 // Prepare property description. 00210 std::ostringstream text; 00211 text << "Total " << m_digis.size () << " DT digis from"; 00212 text << " Cosmic run: " << m_text << "<br>"; 00213 00214 text << "<table width='100%' border=1>" 00215 << "<TR align = center>" 00216 << "<TH>Number</TH>" 00217 << "<TH>Wheel</TH>" 00218 << "<TH>Station</TH>" 00219 << "<TH>Sector</TH>" 00220 << "<TH>SL</TH>" 00221 << "<TH>Layer</TH>" 00222 << "<TH>Cell</TH>" 00223 << "<TH>number</TH>" 00224 << "<TH>countsTDC</TH>" 00225 << "</TR>"; 00226 text << setiosflags (std::ios::showpoint | std::ios::fixed); 00227 text.setf (std::ios::right, std::ios::adjustfield); 00228 00229 if ((! m_digis.empty ()) && m_pDD.isValid ()) 00230 { 00231 int nDigis = 0; 00232 try 00233 { 00234 for (std::vector<std::pair<DTLayerId, DTDigi> >::const_iterator i = m_digis.begin (), iEnd = m_digis.end (); i != iEnd; ++i) 00235 { 00236 const DTLayer *layer = m_pDD->layer ((*i).first); 00237 00238 bool draw = true; 00239 const DTChamber *chamber = layer->chamber (); 00240 const DTChamberId chamberId = chamber->id (); 00241 00242 ((m_sector == 0) || (m_sector == chamberId.sector ()) && draw) ? draw = true : draw = false; 00243 ((m_wheel == 10) || (m_wheel == chamberId.wheel ()) && draw) ? draw = true : draw = false; 00244 00245 if (draw) 00246 { 00247 int wireNumber = (*i).second.wire (); 00248 int layerIdDg = (*i).first.layer(); 00249 int slayerIdDg = (*i).first.superlayerId().superLayer(); 00250 int sectorIdDg = (*i).first.superlayerId().chamberId().sector(); 00251 int stationIdDg = (*i).first.superlayerId().chamberId().station(); 00252 int wheelIdDg = (*i).first.superlayerId().chamberId().wheel(); 00253 00254 text << "<TR align = right>" 00255 << "<TD>" << std::setw (3) << nDigis++ << "</TD>" 00256 << "<TD>" << wheelIdDg << "</TD>" 00257 << "<TD>" << stationIdDg << "</TD>" 00258 << "<TD>" << sectorIdDg << "</TD>" 00259 << "<TD>" << slayerIdDg << "</TD>" 00260 << "<TD>" << layerIdDg << "</TD>" 00261 << "<TD>" << std::setw (6) << std::setprecision (3) << wireNumber << "</TD>" 00262 << "<TD>" << std::setw (5) << std::setprecision (3) << (*i).second.number () << "</TD>" 00263 << "<TD>" << std::setw (5) << std::setprecision (3) << (*i).second.countsTDC () << "</TD>" 00264 << "</TR>"; 00265 } 00266 } 00267 } 00268 catch (cms::Exception& e) 00269 { 00270 if (this->m_onCmsException) 00271 this->m_onCmsException (&e); 00272 } 00273 catch (lat::Error &e) 00274 { 00275 if (this->m_onError) 00276 this->m_onError (&e); 00277 } 00278 catch (std::exception &e) 00279 { 00280 if (this->m_onException) 00281 this->m_onException (&e); 00282 } 00283 catch (...) 00284 { 00285 if (this->m_onUnhandledException) 00286 this->m_onUnhandledException (); 00287 } 00288 } 00289 00290 text << "</table>"; 00291 00292 IgQtLock (); 00293 rep->setText (text.str ()); 00294 }
Reimplemented from VisQueuedTwig.
Definition at line 361 of file VisDTDigiTwig.cc.
References Ig3DBaseRep::clear(), Ig3DBaseRep::node(), and VisQueuedTwig::update().
00362 { 00363 // Get debugging dump. 00364 VisQueuedTwig::update (rep); 00365 00366 IgQtLock (); 00367 rep->clear (); 00368 00369 SoSeparator *sep = new SoSeparator; 00370 // SoSeparator *posSep = new SoSeparator; 00371 // SoSeparator *negSep = new SoSeparator; 00372 00373 // SoMaterial *mat = new SoMaterial; 00374 // mat->diffuseColor.setValue (0.0, 0.0, 1.0); 00375 // posSep->addChild (mat); 00376 00377 // SoMaterial *negMat = new SoMaterial; 00378 // negMat->diffuseColor.setValue (1.0, 0.0, 0.0); 00379 // negSep->addChild (negMat); 00380 00381 // sep->addChild (posSep); 00382 // sep->addChild (negSep); 00383 00384 // try 00385 // { 00386 // for (std::vector<std::pair<DTLayerId, DTDigi> >::const_iterator i = m_digis.begin (), iEnd = m_digis.end (); i != iEnd; ++i) 00387 // { 00388 // int et = (*i).second.countsTDC (); 00389 // if (et > 0) 00390 // { 00391 // // FIXME: add a sensible rep here. 00392 // } 00393 // } 00394 // } 00395 // catch (cms::Exception& e) 00396 // { 00397 // if (this->m_onCmsException) 00398 // this->m_onCmsException (&e); 00399 // } 00400 // catch (lat::Error &e) 00401 // { 00402 // if (this->m_onError) 00403 // this->m_onError (&e); 00404 // } 00405 // catch (std::exception &e) 00406 // { 00407 // if (this->m_onException) 00408 // this->m_onException (&e); 00409 // } 00410 // catch (...) 00411 // { 00412 // if (this->m_onUnhandledException) 00413 // this->m_onUnhandledException (); 00414 // } 00415 00416 rep->node ()->addChild (sep); 00417 }
Reimplemented from VisQueuedTwig.
Definition at line 297 of file VisDTDigiTwig.cc.
References addWire(), Ig3DBaseRep::clear(), e, exception, i, edm::ESHandle< T >::isValid(), m_digis, VisQueuedTwig::m_onCmsException, VisQueuedTwig::m_onError, VisQueuedTwig::m_onException, VisQueuedTwig::m_onUnhandledException, m_pDD, m_rgba, Ig3DBaseRep::node(), IgSbColorMap::unpack(), and VisQueuedTwig::update().
00298 { 00299 // Get debugging dump. 00300 VisQueuedTwig::update (rep); 00301 00302 IgQtLock (); 00303 rep->clear (); 00304 00305 if ((! m_digis.empty ()) && m_pDD.isValid ()) 00306 { 00307 SoSeparator *sep = new SoSeparator; 00308 00309 SoMaterial *mat = new SoMaterial; 00310 float rgbcomponents [4]; 00311 IgSbColorMap::unpack (m_rgba, rgbcomponents); 00312 mat->diffuseColor.setValue (SbColor (rgbcomponents)); 00313 sep->addChild (mat); 00314 00315 SoDrawStyle *drawStyle = new SoDrawStyle; 00316 drawStyle->pointSize = 3.0; 00317 drawStyle->style = SoDrawStyle::LINES; 00318 drawStyle->lineWidth.setValue (2.0); 00319 sep->addChild (drawStyle); 00320 00321 try 00322 { 00323 for (std::vector<std::pair<DTLayerId, DTDigi> >::const_iterator i = m_digis.begin (), iEnd = m_digis.end (); i != iEnd; ++i) 00324 { 00325 SoSeparator* separator = new SoSeparator; 00326 addWire (separator, *i); 00327 sep->addChild (separator); 00328 // if (m_annotate) 00329 // { 00330 // sep->addChild (addText ()); 00331 // } 00332 00333 } 00334 } 00335 catch (cms::Exception& e) 00336 { 00337 if (this->m_onCmsException) 00338 this->m_onCmsException (&e); 00339 } 00340 catch (lat::Error &e) 00341 { 00342 if (this->m_onError) 00343 this->m_onError (&e); 00344 } 00345 catch (std::exception &e) 00346 { 00347 if (this->m_onException) 00348 this->m_onException (&e); 00349 } 00350 catch (...) 00351 { 00352 if (this->m_onUnhandledException) 00353 this->m_onUnhandledException (); 00354 } 00355 00356 rep->node ()->addChild (sep); 00357 } 00358 }
bool VisDTDigiTwig::m_annotate [private] |
std::vector< std::pair<DTLayerId, DTDigi> > VisDTDigiTwig::m_digis [private] |
const std::string VisDTDigiTwig::m_friendlyName [private] |
const std::string VisDTDigiTwig::m_instanceName [private] |
int VisDTDigiTwig::m_layer [private] |
Definition at line 63 of file VisDTDigiTwig.h.
const std::string VisDTDigiTwig::m_moduleLabel [private] |
edm::ESHandle<DTGeometry> VisDTDigiTwig::m_pDD [private] |
Definition at line 68 of file VisDTDigiTwig.h.
Referenced by addDescription(), addText(), addWire(), onNewEvent(), and update().
const std::string VisDTDigiTwig::m_processName [private] |
unsigned VisDTDigiTwig::m_rgba [private] |
int VisDTDigiTwig::m_sector [private] |
std::string VisDTDigiTwig::m_text [private] |
int VisDTDigiTwig::m_wheel [private] |