00001
00002
00003 #include "VisReco/VisEcal/interface/VisEcalRecHitTwig.h"
00004 #include "VisReco/VisEcal/interface/VisEcalSubdetector.h"
00005 #include "VisFramework/VisFrameworkBase/interface/VisTwigFactroyService.h"
00006 #include "VisFramework/VisFrameworkBase/interface/VisEventSelector.h"
00007 #include "VisFramework/VisEventSetup/interface/VisEventSetupService.h"
00008 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00009 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00010 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00011 #include "FWCore/Framework/interface/Event.h"
00012 #include "Iguana/Models/interface/IgTextRep.h"
00013 #include "Iguana/GLModels/interface/Ig3DRep.h"
00014 #include "Iguana/GLModels/interface/IgLegoRep.h"
00015 #include "Iguana/GLModels/interface/IgRPhiRep.h"
00016 #include "Iguana/GLModels/interface/IgRZRep.h"
00017 #include "Iguana/Framework/interface/IgRepSet.h"
00018 #include "Iguana/Inventor/interface/IgSbColorMap.h"
00019 #include "Iguana/Inventor/interface/IgSoCrystalHit.h"
00020 #include "Iguana/Inventor/interface/IgSoCircularHist.h"
00021 #include "Iguana/Inventor/interface/IgSoRectColHist.h"
00022 #include "Iguana/Inventor/interface/IgSoTower.h"
00023 #include "Iguana/Studio/interface/IgDocumentData.h"
00024 #include "Iguana/Studio/interface/IgQtAppStatusBarService.h"
00025 #include "Iguana/Studio/interface/IgQtLock.h"
00026 #include <Inventor/nodes/SoMaterial.h>
00027 #include <Inventor/nodes/SoSeparator.h>
00028 #include <qapplication.h>
00029 #include <qstring.h>
00030 #include <classlib/utils/DebugAids.h>
00031 #include <algorithm>
00032 #include <iostream>
00033 #include <iomanip>
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 namespace
00044 {
00045 VisQueuedTwig *
00046 createThisTwig (IgState *state, IgTwig *parent,
00047 const std::string &name,
00048 const std::string &friendlyName,
00049 const std::string &modLabel,
00050 const std::string &instanceName,
00051 const std::string &processName)
00052 {
00053 IgTwig *rootTwig = IgDocumentData::get (state)->root ();
00054 IgTwig *eventTwig = 0;
00055 eventTwig = rootTwig->lookup ("/Objects/CMS Event and Detector/ECAL Event/Rec Hits");
00056
00057 if (! eventTwig)
00058 eventTwig = parent;
00059
00060 return new VisEcalRecHitTwig (state, eventTwig, "[N/A] Ecal RecHits (" + name + ")",
00061 friendlyName, modLabel, instanceName, processName);
00062 }
00063 }
00064
00065
00066
00067
00068 VisEcalRecHitTwig::VisEcalRecHitTwig (IgState *state, IgTwig *parent,
00069 const std::string &name ,
00070 const std::string &friendlyName ,
00071 const std::string &moduleLabel ,
00072 const std::string &instanceName ,
00073 const std::string &processName ,
00074 unsigned colour )
00075 : VisQueuedTwig (state, parent, name),
00076 m_name (name),
00077 m_friendlyName (friendlyName),
00078 m_moduleLabel (moduleLabel),
00079 m_instanceName (instanceName),
00080 m_processName (processName),
00081 m_binning (state, lat::CreateCallback (this, &VisEcalRecHitTwig::twigChanged)),
00082 m_scale (state, lat::CreateCallback (this, &VisEcalRecHitTwig::twigChanged)),
00083 m_cut (state, lat::CreateCallback (this, &VisEcalRecHitTwig::twigChanged)),
00084 m_escale (state, lat::CreateCallback (this, &VisEcalRecHitTwig::twigChanged)),
00085 m_annotation (state, lat::CreateCallback (this, &VisEcalRecHitTwig::twigChanged)),
00086 m_rMax (state, lat::CreateCallback (this, &VisEcalRecHitTwig::twigChanged)),
00087 m_text ("no info"),
00088 m_recHits (500),
00089 m_rgba (colour)
00090 {
00091 VisTwigFactroyService *tfService = VisTwigFactroyService::get (state);
00092 if (! tfService)
00093 {
00094 tfService = new VisTwigFactroyService (state);
00095 }
00096 edm::TypeID recHitCollID (typeid (EcalRecHitCollection));
00097 tfService->registerTwig (recHitCollID.friendlyClassName (), &createThisTwig);
00098 }
00099
00100 void
00101 VisEcalRecHitTwig::twigChanged (void)
00102 { IgRepSet::invalidate (this, SELF_MASK); }
00103
00104 void
00105 VisEcalRecHitTwig::onNewEvent (const edm::Event &event,
00106 const edm::EventSetup &eventSetup)
00107 {
00108
00109 VisQueuedTwig::onNewEvent (event, eventSetup);
00110
00111 m_recHits.clear ();
00112
00113 m_text = (QString ("Run # %1, event # %2")
00114 .arg (event.id ().run ())
00115 .arg (event.id ().event ()).latin1 ());
00116
00117 std::vector<edm::Handle<EcalRecHitCollection> > rechits;
00118 try
00119 {
00120 QApplication::setOverrideCursor (Qt::waitCursor);
00121 if (IgQtAppStatusBarService *sbar = IgQtAppStatusBarService::get (state ()))
00122 sbar->setMessage ("Retrieving an EcalRecHitCollection...");
00123
00124 if ((! m_friendlyName.empty ()) || (! m_moduleLabel.empty ()) || (! m_instanceName.empty ()) || (! m_processName.empty ()))
00125 {
00126 VisEventSelector visSel (m_friendlyName, m_moduleLabel, m_instanceName, m_processName);
00127 event.getMany (visSel, rechits);
00128 }
00129
00130 if (IgQtAppStatusBarService *sbar = IgQtAppStatusBarService::get (state ()))
00131 sbar->setMessage ("EcalRecHitCollection done.");
00132 QApplication::restoreOverrideCursor ();
00133 }
00134 catch (cms::Exception& e)
00135 {
00136 e.append (" from VisEcalRecHitTwig::onNewEvent ");
00137 e.append (this->name ());
00138
00139 if (this->m_onCmsException)
00140 this->m_onCmsException (&e);
00141 }
00142 catch (lat::Error &e)
00143 {
00144 if (this->m_onError)
00145 this->m_onError (&e);
00146 }
00147 catch (std::exception &e)
00148 {
00149 if (this->m_onException)
00150 this->m_onException (&e);
00151 }
00152 catch (...)
00153 {
00154 if (this->m_onUnhandledException)
00155 this->m_onUnhandledException ();
00156 }
00157
00158 if (! rechits.empty ())
00159 {
00160 for (std::vector<edm::Handle<EcalRecHitCollection> >::iterator i = rechits.begin (), iEnd = rechits.end (); i != iEnd; ++i)
00161 {
00162 const EcalRecHitCollection& c = *(*i);
00163 QString sizeStr = (QString ("%1").arg (c.size ()));
00164 QString nameStr = QString (this->name ());
00165 int ib = nameStr.find ("[");
00166 int ie = nameStr.find ("]");
00167 nameStr.replace (ib + 1, ie - 1, sizeStr);
00168 this->name (nameStr);
00169 for (std::vector<EcalRecHit>::const_iterator ci = c.begin (), ciEnd = c.end (); ci != ciEnd; ++ci)
00170 {
00171 m_recHits.push_back (*ci);
00172 }
00173 }
00174 }
00175
00176 VisQueuedTwig::onBaseInvalidate ();
00177
00178 if (IgQtAppStatusBarService *sbar = IgQtAppStatusBarService::get (state ()))
00179 sbar->setMessage (QString (m_text));
00180 }
00181
00182 void
00183 VisEcalRecHitTwig::update (IgTextRep *rep)
00184 {
00185
00186 VisQueuedTwig::update (rep);
00187
00188
00189 std::ostringstream text;
00190 text << this->name () << " from ";
00191 text << m_text << "<br>";
00192
00193 if (m_friendlyName.empty () && m_moduleLabel.empty () && m_instanceName.empty () && m_processName.empty ())
00194 {
00195 text << "Please, select the branches of this Twig for more information.";
00196 }
00197 else
00198 {
00199 text << "Displayed only above " << m_cut.value () << " GeV:<br>";
00200
00201 text << "<table width='100%' border=1>"
00202 << "<TR align = center>"
00203 << "<TH>Number</TH>"
00204 << "<TH>Energy</TH>"
00205 << "<TH>Time</TH>"
00206 << "<TH>Eta</TH>"
00207 << "<TH>Phi</TH>"
00208 << "</TR>";
00209 text << setiosflags (std::ios::showpoint | std::ios::fixed);
00210 text.setf (std::ios::right, std::ios::adjustfield);
00211
00212 int nDigis = 0;
00213 if (! m_recHits.empty ())
00214 {
00215 VisEventSetupService *esService = VisEventSetupService::get (state ());
00216 ASSERT (esService);
00217
00218 try
00219 {
00220 for (std::vector<EcalRecHit>::const_iterator i = m_recHits.begin (), iEnd = m_recHits.end (); i != iEnd; ++i)
00221 {
00222 float energy = (*i).energy ();
00223 if (energy > m_cut.value ())
00224 {
00225 const GlobalPoint& pos = esService->getCellPosition ((*i).detid ());
00226 float eta = pos.eta ();
00227 float phi = pos.phi ();
00228
00229 text << "<TR align = right>"
00230 << "<TD>" << std::setw (3) << nDigis++ << "</TD>"
00231 << "<TD>" << std::setw (5) << std::setprecision (3) << energy << "</TD>"
00232 << "<TD>" << std::setw (5) << std::setprecision (3) << (*i).time () << "</TD>"
00233 << "<TD>" << std::setw (5) << std::setprecision (3) << eta << "</TD>"
00234 << "<TD>" << std::setw (5) << std::setprecision (3) << phi << "</TD>"
00235 << "</TR>";
00236 }
00237 }
00238 }
00239 catch (cms::Exception& e)
00240 {
00241 e.append (" from VisHBHERecHitTwig::update(IgTextRep*) ");
00242 e.append (this->name ());
00243
00244 if (this->m_onCmsException)
00245 this->m_onCmsException (&e);
00246 }
00247 catch (lat::Error &e)
00248 {
00249 if (this->m_onError)
00250 this->m_onError (&e);
00251 }
00252 catch (std::exception &e)
00253 {
00254 if (this->m_onException)
00255 this->m_onException (&e);
00256 }
00257 catch (...)
00258 {
00259 if (this->m_onUnhandledException)
00260 this->m_onUnhandledException ();
00261 }
00262 }
00263
00264 text << "</table>";
00265 }
00266
00267
00268 IgQtLock ();
00269 rep->setText (text.str ());
00270 }
00271
00272 void
00273 VisEcalRecHitTwig::update (Ig3DRep *rep)
00274 {
00275
00276 VisQueuedTwig::update (rep);
00277
00278 IgQtLock ();
00279
00280 rep->clear ();
00281
00282 SoSeparator *sep = new SoSeparator;
00283
00284 SoMaterial *mat = new SoMaterial;
00285 float rgbcomponents [4];
00286 IgSbColorMap::unpack (m_rgba, rgbcomponents);
00287 mat->diffuseColor.setValue (SbColor (rgbcomponents));
00288 sep->addChild (mat);
00289
00290 if (! m_recHits.empty ())
00291 {
00292 VisEventSetupService *esService = VisEventSetupService::get (state ());
00293 ASSERT (esService);
00294
00295 try
00296 {
00297 for (std::vector<EcalRecHit>::const_iterator i = m_recHits.begin (), iEnd = m_recHits.end (); i != iEnd; ++i)
00298 {
00299 float energy = (*i).energy ();
00300 if (energy > m_cut.value ())
00301 {
00302 const CaloCellGeometry::CornersVec& corners = esService->getCorners ((*i).detid ());
00303 ASSERT (corners.size () == 8);
00304
00305 IgSoCrystalHit *crystalHit = new IgSoCrystalHit;
00306 crystalHit->energy.setValue (energy);
00307 crystalHit->scale.setValue (m_escale.value ());
00308 crystalHit->relativeWidth.setValue (1.0);
00309 crystalHit->drawCrystal.setValue (false);
00310 crystalHit->drawHit.setValue (true);
00311
00312 crystalHit->front1.setValue (corners [3].x () / 100.0, corners [3].y () / 100.0, corners [3].z () / 100.0);
00313 crystalHit->front2.setValue (corners [2].x () / 100.0, corners [2].y () / 100.0, corners [2].z () / 100.0);
00314 crystalHit->front3.setValue (corners [1].x () / 100.0, corners [1].y () / 100.0, corners [1].z () / 100.0);
00315 crystalHit->front4.setValue (corners [0].x () / 100.0, corners [0].y () / 100.0, corners [0].z () / 100.0);
00316
00317 crystalHit->back1.setValue (corners [7].x () / 100.0, corners [7].y () / 100.0, corners [7].z () / 100.0);
00318 crystalHit->back2.setValue (corners [6].x () / 100.0, corners [6].y () / 100.0, corners [6].z () / 100.0);
00319 crystalHit->back3.setValue (corners [5].x () / 100.0, corners [5].y () / 100.0, corners [5].z () / 100.0);
00320 crystalHit->back4.setValue (corners [4].x () / 100.0, corners [4].y () / 100.0, corners [4].z () / 100.0);
00321
00322 sep->addChild (crystalHit);
00323 }
00324 }
00325 }
00326 catch (cms::Exception& e)
00327 {
00328 e.append (" from VisEcalRecHitTwig::update(Ig3DRep*) ");
00329 e.append (this->name ());
00330
00331 if (this->m_onCmsException)
00332 this->m_onCmsException (&e);
00333 }
00334 catch (lat::Error &e)
00335 {
00336 if (this->m_onError)
00337 this->m_onError (&e);
00338 }
00339 catch (std::exception &e)
00340 {
00341 if (this->m_onException)
00342 this->m_onException (&e);
00343 }
00344 catch (...)
00345 {
00346 if (this->m_onUnhandledException)
00347 this->m_onUnhandledException ();
00348 }
00349 }
00350
00351 rep->node ()->addChild (sep);
00352 }
00353
00354 void
00355 VisEcalRecHitTwig::update (IgLegoRep *rep)
00356 {
00357
00358 VisQueuedTwig::update (rep);
00359
00360 IgQtLock ();
00361
00362 rep->clear ();
00363
00364 SoSeparator *sep = new SoSeparator;
00365
00366 try
00367 {
00368 if (! m_recHits.empty ())
00369 {
00370 VisEventSetupService *esService = VisEventSetupService::get (state ());
00371 ASSERT (esService);
00372
00373 for (std::vector<EcalRecHit>::const_iterator i = m_recHits.begin (), iEnd = m_recHits.end (); i != iEnd; ++i)
00374 {
00375 float energy = (*i).energy ();
00376 if (fabs (energy) > m_cut.value ())
00377 {
00378 const GlobalPoint& pos = esService->getCellPosition ((*i).detid ());
00379
00380 float eta = pos.eta ();
00381 float phi = pos.phi ();
00382 (phi < 0.0) ? phi = 2 * M_PI + phi : phi;
00383
00384 IgSoTower *tower = new IgSoTower;
00385 tower->position = SbVec2f (phi, eta);
00386 tower->scaleFactor = m_scale.value ();
00387 tower->etaWidth = 0.0174;
00388 tower->phiWidth = 0.0174;
00389 tower->energy = energy;
00390 tower->emFraction = 1;
00391 sep->addChild (tower);
00392 }
00393 }
00394 }
00395 }
00396 catch (cms::Exception& e)
00397 {
00398 e.append (" from VisEcalRecHitTwig::update(IgLegoRep *) ");
00399 e.append (this->name ());
00400
00401 if (this->m_onCmsException)
00402 this->m_onCmsException (&e);
00403 }
00404 catch (lat::Error &e)
00405 {
00406 if (this->m_onError)
00407 this->m_onError (&e);
00408 }
00409 catch (std::exception &e)
00410 {
00411 if (this->m_onException)
00412 this->m_onException (&e);
00413 }
00414 catch (...)
00415 {
00416 if (this->m_onUnhandledException)
00417 this->m_onUnhandledException ();
00418 }
00419
00420 rep->node ()->addChild (sep);
00421 }
00422
00423 void
00424 VisEcalRecHitTwig::update (IgRPhiRep *rep)
00425 {
00426
00427 VisQueuedTwig::update (rep);
00428
00429 IgQtLock ();
00430
00431 rep->clear ();
00432
00433 SoSeparator *sep = new SoSeparator;
00434 SoSeparator *posSep = new SoSeparator;
00435 SoSeparator *negSep = new SoSeparator;
00436 sep->addChild (posSep);
00437 sep->addChild (negSep);
00438
00439 SoMaterial *mat = new SoMaterial;
00440 mat->ambientColor.setValue (1.0, 0.0, 153.0 / 255.0);
00441 mat->diffuseColor.setValue (1.0, 0.0, 153.0 / 255.0);
00442 mat->specularColor.setValue (1.0, 0.0, 153.0 / 255.0);
00443 mat->emissiveColor.setValue (1.0, 0.0, 153.0 / 255.0);
00444 posSep->addChild (mat);
00445
00446 SoMaterial *negMat = new SoMaterial;
00447 negMat->ambientColor.setValue (51.0 / 255.0, 1.0, 102.0 / 255.0);
00448 negMat->diffuseColor.setValue (51.0 / 255.0, 1.0, 102.0 / 255.0);
00449 negMat->specularColor.setValue (51.0 / 255.0, 1.0, 102.0 / 255.0);
00450 negMat->emissiveColor.setValue (51.0 / 255.0, 1.0, 102.0 / 255.0);
00451 negSep->addChild (negMat);
00452
00453 int nbrOfBins = 360;
00454 int binNumber;
00455
00456 std::vector<float> bufferPositive (nbrOfBins);
00457 std::vector<float> bufferNegative (nbrOfBins);
00458 try
00459 {
00460 if (! m_recHits.empty ())
00461 {
00462 VisEventSetupService *esService = VisEventSetupService::get (state ());
00463 ASSERT (esService);
00464
00465 float radius = 1.29;
00466
00467 for (std::vector<EcalRecHit>::const_iterator i = m_recHits.begin (), iEnd = m_recHits.end (); i != iEnd; ++i)
00468 {
00469 float energy = (*i).energy ();
00470 if (energy > m_cut.value ())
00471 {
00472 if (VisEcalSubdetector::subDetName ((EcalSubdetector)((*i).id ().subdetId ())) == "EcalBarrel")
00473 {
00474 const GlobalPoint& pos = esService->getCellPosition ((*i).detid ());
00475 float phi = pos.phi ();
00476
00477 (phi < 0) ? phi = 2 * M_PI + phi : phi;
00478
00479 binNumber = (int) floor (phi / (2 * M_PI / nbrOfBins));
00480
00481 if (binNumber >= 0 && binNumber < nbrOfBins)
00482 if (m_binning.value () == "project")
00483 {
00484 if ((energy > 0.0) && (energy > bufferPositive [binNumber]))
00485 bufferPositive [binNumber] = energy;
00486 else if ((energy < 0.0) && (energy < bufferNegative [binNumber]))
00487 bufferNegative [binNumber] = energy;
00488 }
00489 else
00490 (energy > 0.0) ? bufferPositive [binNumber] += energy : bufferNegative [binNumber] += energy;
00491 }
00492 }
00493 }
00494
00495 std::vector<float>::const_iterator first = bufferPositive.begin ();
00496 std::vector<float>::const_iterator last = bufferPositive.end ();
00497
00498 if (*max_element (first, last) > 0.0)
00499 {
00500 IgSoCircularHist *recHits = new IgSoCircularHist;
00501 recHits->minRadius = radius;
00502 recHits->maxRadius = m_rMax.value ();
00503 recHits->scaleFactor = m_escale.value ();
00504 recHits->numberOfBins = nbrOfBins;
00505 recHits->energies.setValues (0, nbrOfBins, &bufferPositive [0]);
00506 recHits->logScale = false;
00507 recHits->showAnnotations = m_annotation.value ();
00508 recHits->layer = 5.5;
00509 posSep->addChild (recHits);
00510 }
00511
00512 std::vector<float>::const_iterator nfirst = bufferNegative.begin ();
00513 std::vector<float>::const_iterator nlast = bufferNegative.end ();
00514
00515 if (fabs(*max_element (nfirst, nlast)) > 0.0)
00516 {
00517 IgSoCircularHist *negRecHits = new IgSoCircularHist;
00518 negRecHits->minRadius = radius;
00519 negRecHits->maxRadius = -1;
00520 negRecHits->scaleFactor = m_escale.value ();
00521 negRecHits->numberOfBins = nbrOfBins;
00522 negRecHits->energies.setValues (0, nbrOfBins, &bufferNegative [0]);
00523 negRecHits->logScale = false;
00524 negRecHits->showAnnotations = m_annotation.value ();
00525 negRecHits->layer = 5.0;
00526
00527 negSep->addChild (negRecHits);
00528 }
00529 }
00530 }
00531 catch (cms::Exception& e)
00532 {
00533 e.append (" from VisEcalRecHitTwig::update (IgRPhiRep*) ");
00534 e.append (this->name ());
00535
00536 if (this->m_onCmsException)
00537 this->m_onCmsException (&e);
00538 }
00539 catch (lat::Error &e)
00540 {
00541 if (this->m_onError)
00542 this->m_onError (&e);
00543 }
00544 catch (std::exception &e)
00545 {
00546 if (this->m_onException)
00547 this->m_onException (&e);
00548 }
00549 catch (...)
00550 {
00551 if (this->m_onUnhandledException)
00552 this->m_onUnhandledException ();
00553 }
00554
00555 rep->node ()->addChild (sep);
00556 }
00557
00558 void
00559 VisEcalRecHitTwig::update (IgRZRep *rep)
00560 {
00561
00562 VisQueuedTwig::update (rep);
00563
00564 IgQtLock ();
00565
00566 rep->clear ();
00567
00568 SoSeparator *sep = new SoSeparator;
00569 SoMaterial *mat = new SoMaterial;
00570 mat->ambientColor.setValue (1.0, 0.0, 153.0 / 255.0);
00571 mat->diffuseColor.setValue (1.0, 0.0, 153.0 / 255.0);
00572 mat->specularColor.setValue (1.0, 0.0, 153.0 / 255.0);
00573 mat->emissiveColor.setValue (1.0, 0.0, 153.0 / 255.0);
00574 sep->addChild (mat);
00575
00576 VisEventSetupService *esService = VisEventSetupService::get (state ());
00577 ASSERT (esService);
00578
00579 unsigned binNumber = 0;
00580 const unsigned nBinsZ = 85*2;
00581 const unsigned nBinsR = 39*2;
00582 const unsigned nbrOfBins = 2 * (nBinsZ + nBinsR);
00583 const float radiusR = 1.29f;
00584 const float radiusZ = 3.17f;
00585 const float barrelMaxEta = 1.479f;
00586 const float beamPipeTheta = 5.7f * M_PI / 180.f;
00587 const float endcapMaxTheta = 25.464f * M_PI / 180.f;
00588
00589 std::vector<float> energies (nbrOfBins * 2);
00590 try
00591 {
00592 if (! m_recHits.empty ())
00593 {
00594 for (std::vector<EcalRecHit>::const_iterator i = m_recHits.begin (), iEnd = m_recHits.end (); i != iEnd; ++i)
00595 {
00596 float energy = (*i).energy ();
00597 if (energy > m_cut.value ())
00598 {
00599 binNumber = esService->getBinNumber ((*i).detid (), nBinsR, nBinsZ, radiusR, radiusZ, barrelMaxEta, beamPipeTheta, endcapMaxTheta);
00600
00601 if (binNumber < nbrOfBins)
00602 {
00603 if (m_binning.value () == "project")
00604 (energies[binNumber] > energy) ? energies[binNumber] : energies[binNumber] = energy;
00605 else
00606 energies[binNumber] += energy;
00607 }
00608 else
00609 {
00610 std::cerr << "Bin number (" << binNumber << ") exceeds the number of bins (" << nbrOfBins << ")"<< std::endl;
00611 }
00612 }
00613 }
00614
00615 if (*max_element (energies.begin (), energies.end ()) > 0.0)
00616 {
00617 IgSoRectColHist* hist = new IgSoRectColHist;
00618 hist->radiusR = radiusR;
00619 hist->radiusZ = radiusZ;
00620 if (m_rMax.value () > 0) hist->maxDist = m_rMax.value ();
00621 hist->numR = nBinsR;
00622 hist->numZ = nBinsZ;
00623 hist->energies.setValues (0, energies.size(), &energies [0]);
00624 hist->logScale = false;
00625 hist->layer = -6.0;
00626 hist->scaleFactor = m_escale.value ();
00627 hist->barrelMaxEta = barrelMaxEta;
00628 hist->beamPipeTheta = beamPipeTheta;
00629 hist->endcapMaxTheta = endcapMaxTheta;
00630
00631 std::vector<SbColor> colors (4);
00632 colors[0] = SbColor (1.0, 0.0, 153.0 / 255.0);
00633 colors[1] = SbColor (1.0, 1.0, 153.0 / 255.0);
00634 colors[2] = SbColor (51.0 / 255.0, 1.0, 102.0 / 255.0);
00635 colors[3] = SbColor (51.0 / 255.0, 0.0, 102.0 / 255.0);
00636
00637 hist->faceColors.setValues (0, colors.size (), &colors[0]);
00638 sep->addChild (hist);
00639 }
00640 }
00641 }
00642 catch (cms::Exception& e)
00643 {
00644 e.append (" from VisEcalRecHitTwig::update(IgRZRep*) ");
00645 e.append (this->name ());
00646
00647 if (this->m_onCmsException)
00648 this->m_onCmsException (&e);
00649 }
00650 catch (lat::Error &e)
00651 {
00652 if (this->m_onError)
00653 this->m_onError (&e);
00654 }
00655 catch (std::exception &e)
00656 {
00657 if (this->m_onException)
00658 this->m_onException (&e);
00659 }
00660 catch (...)
00661 {
00662 if (this->m_onUnhandledException)
00663 this->m_onUnhandledException ();
00664 }
00665 rep->node ()->addChild (sep);
00666 }