CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

FWCaloTowerDetailView Class Reference

#include <FWCaloTowerDetailView.h>

Inheritance diagram for FWCaloTowerDetailView:
FWDetailViewGL< CaloTower > FWDetailView< CaloTower > FWDetailViewBase

List of all members.

Public Member Functions

 FWCaloTowerDetailView ()
virtual ~FWCaloTowerDetailView ()

Private Member Functions

virtual void build (const FWModelId &id, const CaloTower *)
virtual void setTextInfo (const FWModelId &, const CaloTower *)

Private Attributes

FWECALDetailViewBuilderm_builder
TEveCaloData * m_data

Detailed Description

Definition at line 19 of file FWCaloTowerDetailView.h.


Constructor & Destructor Documentation

FWCaloTowerDetailView::FWCaloTowerDetailView ( )

Definition at line 19 of file FWCaloTowerDetailView.cc.

                                            :
m_builder(0)
{ 
}
FWCaloTowerDetailView::~FWCaloTowerDetailView ( ) [virtual]

Definition at line 24 of file FWCaloTowerDetailView.cc.

{
}

Member Function Documentation

void FWCaloTowerDetailView::build ( const FWModelId id,
const CaloTower iTower 
) [private, virtual]

Implements FWDetailView< CaloTower >.

Definition at line 31 of file FWCaloTowerDetailView.cc.

References FWECALDetailViewBuilder::build(), reco::LeafCandidate::eta(), FWDetailViewBase::item(), m_builder, m_data, FWDetailViewGL< CaloTower >::m_eveScene, reco::LeafCandidate::phi(), setTextInfo(), FWECALDetailViewBuilder::showSuperClusters(), and FWDetailViewGL< CaloTower >::viewerGL().

{
   if(!iTower) return;

   // build ECAL objects
   m_builder = new FWECALDetailViewBuilder(id.item()->getEvent(), id.item()->getGeom(),
                                           iTower->eta(), iTower->phi(), 25);
   m_builder->showSuperClusters();
   
   TEveCaloLego* lego = m_builder->build();
   m_data = lego->GetData();
   m_data->IncDenyDestroy();
   m_eveScene->AddElement(lego);

   // draw axis at the window corners
   TEveCaloLegoOverlay* overlay = new TEveCaloLegoOverlay();
   overlay->SetShowPlane(kFALSE);
   overlay->SetShowPerspective(kFALSE);
   overlay->SetCaloLego(lego);
   overlay->SetShowScales(1); // temporary
   viewerGL()->AddOverlayElement(overlay);

   // set event handler and flip camera to top view at beginning
   viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
   FWGLEventHandler* eh =
      new FWGLEventHandler((TGWindow*)viewerGL()->GetGLWidget(), (TObject*)viewerGL(), lego);
   viewerGL()->SetEventHandler(eh);
   viewerGL()->UpdateScene();
   viewerGL()->CurrentCamera().Reset();

   viewerGL()->RequestDraw(TGLRnrCtx::kLODHigh);

   setTextInfo(id, iTower);

}
void FWCaloTowerDetailView::setTextInfo ( const FWModelId id,
const CaloTower tower 
) [private, virtual]

Implements FWDetailView< CaloTower >.

Definition at line 68 of file FWCaloTowerDetailView.cc.

References CaloTower::emEt(), reco::LeafCandidate::eta(), h, CaloTower::hadEt(), getHLTprescales::index, FWDetailViewBase::item(), m_builder, FWDetailViewGL< CaloTower >::m_infoCanvas, FWECALDetailViewBuilder::makeLegend(), reco::LeafCandidate::phi(), x, and detailsBasic3DVector::y.

Referenced by build().

{
   m_infoCanvas->cd();
   float_t x = 0.02;
   float y = 0.97;
   TLatex* latex = new TLatex(x, y, "");
   const double textsize(0.05);
   latex->SetTextSize(textsize);

   float h = latex->GetTextSize()*0.6;
   latex->DrawLatex(x, y, "ECAL hit detail view centered on tower:" );
   y -= h;
   latex->DrawLatex(x, y, Form(" %s",id.item()->modelName(id.index()).c_str()) );
   y -= h;
   latex->DrawLatex(x, y, Form(" E_{T}(em) = %.1f GeV, E_{T}(had) = %.1f GeV",
                               tower->emEt(), tower->hadEt()) );
   y -= h;
   latex->DrawLatex(x, y, Form(" #eta = %0.2f, #varphi = %0.2f",
                               tower->eta(), tower->phi()) );
   y -= h;
   m_builder->makeLegend(x, y);
}

Member Data Documentation

Definition at line 30 of file FWCaloTowerDetailView.h.

Referenced by build(), and setTextInfo().

TEveCaloData* FWCaloTowerDetailView::m_data [private]

Definition at line 29 of file FWCaloTowerDetailView.h.

Referenced by build().