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 17 of file FWCaloTowerDetailView.h.

Constructor & Destructor Documentation

◆ FWCaloTowerDetailView()

FWCaloTowerDetailView::FWCaloTowerDetailView ( )

Definition at line 19 of file FWCaloTowerDetailView.cc.

19 : m_data(nullptr), m_builder(nullptr) {}

◆ ~FWCaloTowerDetailView()

FWCaloTowerDetailView::~FWCaloTowerDetailView ( )
override

Definition at line 21 of file FWCaloTowerDetailView.cc.

21 {}

Member Function Documentation

◆ build()

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

Implements FWDetailView< CaloTower >.

Definition at line 26 of file FWCaloTowerDetailView.cc.

26  {
27  if (!iTower)
28  return;
29 
30  // build ECAL objects
31  m_builder =
32  new FWECALDetailViewBuilder(id.item()->getEvent(), id.item()->getGeom(), iTower->eta(), iTower->phi(), 25);
34 
35  TEveCaloLego* lego = m_builder->build();
36  m_data = lego->GetData();
37  m_data->IncDenyDestroy();
38  m_eveScene->AddElement(lego);
39 
40  // draw axis at the window corners
41  TEveCaloLegoOverlay* overlay = new TEveCaloLegoOverlay();
42  overlay->SetShowPlane(kFALSE);
43  overlay->SetShowPerspective(kFALSE);
44  overlay->SetCaloLego(lego);
45  overlay->SetShowScales(true); // temporary
46  viewerGL()->AddOverlayElement(overlay);
47 
48  // set event handler and flip camera to top view at beginning
49  viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
50  FWGLEventHandler* eh = new FWGLEventHandler((TGWindow*)viewerGL()->GetGLWidget(), (TObject*)viewerGL(), lego);
51  viewerGL()->SetEventHandler(eh);
52  viewerGL()->UpdateScene();
53  viewerGL()->CurrentCamera().Reset();
54 
55  viewerGL()->RequestDraw(TGLRnrCtx::kLODHigh);
56 
57  setTextInfo(id, iTower);
58 }

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().

◆ setTextInfo()

void FWCaloTowerDetailView::setTextInfo ( const FWModelId id,
const CaloTower tower 
)
overrideprivatevirtual

Implements FWDetailView< CaloTower >.

Definition at line 60 of file FWCaloTowerDetailView.cc.

60  {
61  m_infoCanvas->cd();
62  float_t x = 0.02;
63  float y = 0.97;
64  TLatex* latex = new TLatex(x, y, "");
65  const double textsize(0.05);
66  latex->SetTextSize(textsize);
67 
68  float h = latex->GetTextSize() * 0.6;
69  latex->DrawLatex(x, y, "ECAL hit detail view centered on tower:");
70  y -= h;
71  latex->DrawLatex(x, y, Form(" %s", id.item()->modelName(id.index()).c_str()));
72  y -= h;
73  latex->DrawLatex(x, y, Form(" E_{T}(em) = %.1f GeV, E_{T}(had) = %.1f GeV", tower->emEt(), tower->hadEt()));
74  y -= h;
75  latex->DrawLatex(x, y, Form(" #eta = %0.2f, #varphi = %0.2f", tower->eta(), tower->phi()));
76  y -= h;
78 }

References h, FWDetailViewBase::item(), m_builder, FWDetailViewGL< CaloTower >::m_infoCanvas, FWECALDetailViewBuilder::makeLegend(), ecalBarrelClusterFastTimer_cfi::modelName, hgcalTowerProducer_cfi::tower, x, and y.

Referenced by build().

Member Data Documentation

◆ m_builder

FWECALDetailViewBuilder* FWCaloTowerDetailView::m_builder
private

Definition at line 28 of file FWCaloTowerDetailView.h.

Referenced by build(), and setTextInfo().

◆ m_data

TEveCaloData* FWCaloTowerDetailView::m_data
private

Definition at line 27 of file FWCaloTowerDetailView.h.

Referenced by build().

FWECALDetailViewBuilder::build
TEveCaloLego * build()
Definition: FWECALDetailViewBuilder.cc:99
DDAxes::y
FWDetailViewGL< CaloTower >::m_eveScene
TEveScene * m_eveScene
Definition: FWDetailViewGL.h:29
FWECALDetailViewBuilder::makeLegend
double makeLegend(double x0=0.02, double y0=0.95, Color_t clustered1=kGreen+1, Color_t clustered2=kTeal, Color_t supercluster=kYellow)
Definition: FWECALDetailViewBuilder.cc:410
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
FWDetailViewGL< CaloTower >::viewerGL
TGLViewer * viewerGL() const
Definition: FWDetailViewGL.h:20
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:3
DDAxes::x
FWCaloTowerDetailView::m_data
TEveCaloData * m_data
Definition: FWCaloTowerDetailView.h:27
FWCaloTowerDetailView::m_builder
FWECALDetailViewBuilder * m_builder
Definition: FWCaloTowerDetailView.h:28
FWDetailViewGL< CaloTower >::m_infoCanvas
TCanvas * m_infoCanvas
Definition: FWDetailViewGL.h:25
FWCaloTowerDetailView::setTextInfo
void setTextInfo(const FWModelId &, const CaloTower *) override
Definition: FWCaloTowerDetailView.cc:60
h
FWECALDetailViewBuilder::showSuperClusters
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
Definition: FWECALDetailViewBuilder.cc:156
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
FWDetailViewBase::item
const FWEventItem * item()
Definition: FWDetailViewBase.h:48
compare.overlay
def overlay(hists, ytitle, header, addon)
Definition: compare.py:123
FWECALDetailViewBuilder
Definition: FWECALDetailViewBuilder.h:22
ecalBarrelClusterFastTimer_cfi.modelName
modelName
Definition: ecalBarrelClusterFastTimer_cfi.py:11
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
FWGLEventHandler
Definition: FWGLEventHandler.h:11
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46