CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWCaloTowerDetailView Class Reference

#include <FWCaloTowerDetailView.h>

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

Public Member Functions

void build (const FWModelId &id, const CaloTower *) override
 
 FWCaloTowerDetailView ()
 
 ~FWCaloTowerDetailView () override
 
- Public Member Functions inherited from FWDetailViewGL< CaloTower >
 FWDetailViewGL ()
 
void init (TEveWindowSlot *) override
 
void setBackgroundColor (Color_t) override
 
TGLViewer * viewerGL () const
 
 ~FWDetailViewGL () override
 
- Public Member Functions inherited from FWDetailView< CaloTower >
void build (const FWModelId &iID, const void *iData) override
 
 FWDetailView ()
 
- Public Member Functions inherited from FWDetailViewBase
void build (const FWModelId &)
 
const fireworks::Contextcontext () const
 
const FWEventItemitem ()
 
void setItem (const FWEventItem *x)
 
virtual ~FWDetailViewBase ()
 

Private Member Functions

void setTextInfo (const FWModelId &, const CaloTower *) override
 

Private Attributes

FWECALDetailViewBuilderm_builder
 
TEveCaloData * m_data
 

Additional Inherited Members

- Static Public Member Functions inherited from FWDetailView< CaloTower >
static std::string classRegisterTypeName ()
 
static std::string classTypeName ()
 
- Static Public Member Functions inherited from FWDetailViewBase
static void drawCanvasBox (Double_t *pos, Color_t fillCol, Int_t fillType=0, bool bg=kTRUE)
 
static void drawCanvasDot (Float_t x, Float_t y, Float_t r, Color_t)
 
- Protected Member Functions inherited from FWDetailViewBase
 FWDetailViewBase (const std::type_info &)
 
- Protected Attributes inherited from FWDetailViewGL< CaloTower >
TEveScene * m_eveScene
 
TEveViewer * m_eveViewer
 
TGCompositeFrame * m_guiFrame
 
TCanvas * m_infoCanvas
 

Detailed Description

Definition at line 18 of file FWCaloTowerDetailView.h.

Constructor & Destructor Documentation

FWCaloTowerDetailView::FWCaloTowerDetailView ( )

Definition at line 19 of file FWCaloTowerDetailView.cc.

19  :
20  m_data(nullptr),
21  m_builder(nullptr)
22 {
23 }
FWECALDetailViewBuilder * m_builder
FWCaloTowerDetailView::~FWCaloTowerDetailView ( )
override

Definition at line 25 of file FWCaloTowerDetailView.cc.

26 {
27 }

Member Function Documentation

void FWCaloTowerDetailView::build ( const FWModelId id,
const CaloTower iTower 
)
overridevirtual

Implements FWDetailView< CaloTower >.

Definition at line 32 of file FWCaloTowerDetailView.cc.

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

33 {
34  if(!iTower) return;
35 
36  // build ECAL objects
37  m_builder = new FWECALDetailViewBuilder(id.item()->getEvent(), id.item()->getGeom(),
38  iTower->eta(), iTower->phi(), 25);
40 
41  TEveCaloLego* lego = m_builder->build();
42  m_data = lego->GetData();
43  m_data->IncDenyDestroy();
44  m_eveScene->AddElement(lego);
45 
46  // draw axis at the window corners
47  TEveCaloLegoOverlay* overlay = new TEveCaloLegoOverlay();
48  overlay->SetShowPlane(kFALSE);
49  overlay->SetShowPerspective(kFALSE);
50  overlay->SetCaloLego(lego);
51  overlay->SetShowScales(true); // temporary
52  viewerGL()->AddOverlayElement(overlay);
53 
54  // set event handler and flip camera to top view at beginning
55  viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
56  FWGLEventHandler* eh =
57  new FWGLEventHandler((TGWindow*)viewerGL()->GetGLWidget(), (TObject*)viewerGL(), lego);
58  viewerGL()->SetEventHandler(eh);
59  viewerGL()->UpdateScene();
60  viewerGL()->CurrentCamera().Reset();
61 
62  viewerGL()->RequestDraw(TGLRnrCtx::kLODHigh);
63 
64  setTextInfo(id, iTower);
65 
66 }
FWECALDetailViewBuilder * m_builder
double eta() const final
momentum pseudorapidity
TGLViewer * viewerGL() const
void setTextInfo(const FWModelId &, const CaloTower *) override
const FWEventItem * item()
def overlay(hists, ytitle, header, addon)
Definition: compare.py:121
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
double phi() const final
momentum azimuthal angle
void FWCaloTowerDetailView::setTextInfo ( const FWModelId id,
const CaloTower tower 
)
overrideprivatevirtual

Implements FWDetailView< CaloTower >.

Definition at line 69 of file FWCaloTowerDetailView.cc.

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

Referenced by build().

70 {
71  m_infoCanvas->cd();
72  float_t x = 0.02;
73  float y = 0.97;
74  TLatex* latex = new TLatex(x, y, "");
75  const double textsize(0.05);
76  latex->SetTextSize(textsize);
77 
78  float h = latex->GetTextSize()*0.6;
79  latex->DrawLatex(x, y, "ECAL hit detail view centered on tower:" );
80  y -= h;
81  latex->DrawLatex(x, y, Form(" %s",id.item()->modelName(id.index()).c_str()) );
82  y -= h;
83  latex->DrawLatex(x, y, Form(" E_{T}(em) = %.1f GeV, E_{T}(had) = %.1f GeV",
84  tower->emEt(), tower->hadEt()) );
85  y -= h;
86  latex->DrawLatex(x, y, Form(" #eta = %0.2f, #varphi = %0.2f",
87  tower->eta(), tower->phi()) );
88  y -= h;
89  m_builder->makeLegend(x, y);
90 }
FWECALDetailViewBuilder * m_builder
double eta() const final
momentum pseudorapidity
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
double makeLegend(double x0=0.02, double y0=0.95, Color_t clustered1=kGreen+1, Color_t clustered2=kTeal, Color_t supercluster=kYellow)
double hadEt() const
Definition: CaloTower.h:116
const FWEventItem * item()
double phi() const final
momentum azimuthal angle
double emEt() const
Definition: CaloTower.h:115

Member Data Documentation

FWECALDetailViewBuilder* FWCaloTowerDetailView::m_builder
private

Definition at line 29 of file FWCaloTowerDetailView.h.

Referenced by build(), and setTextInfo().

TEveCaloData* FWCaloTowerDetailView::m_data
private

Definition at line 28 of file FWCaloTowerDetailView.h.

Referenced by build().