CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

 FWCaloTowerDetailView ()
 
virtual ~FWCaloTowerDetailView ()
 
- Public Member Functions inherited from FWDetailViewGL< CaloTower >
 FWDetailViewGL ()
 
virtual void init (TEveWindowSlot *)
 
virtual void setBackgroundColor (Color_t)
 
TGLViewer * viewerGL () const
 
virtual ~FWDetailViewGL ()
 
- Public Member Functions inherited from FWDetailView< CaloTower >
 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

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

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

Constructor & Destructor Documentation

FWCaloTowerDetailView::FWCaloTowerDetailView ( )

Definition at line 19 of file FWCaloTowerDetailView.cc.

19  :
20 m_builder(0)
21 {
22 }
FWECALDetailViewBuilder * m_builder
FWCaloTowerDetailView::~FWCaloTowerDetailView ( )
virtual

Definition at line 24 of file FWCaloTowerDetailView.cc.

25 {
26 }

Member Function Documentation

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

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

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

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

69 {
70  m_infoCanvas->cd();
71  float_t x = 0.02;
72  float y = 0.97;
73  TLatex* latex = new TLatex(x, y, "");
74  const double textsize(0.05);
75  latex->SetTextSize(textsize);
76 
77  float h = latex->GetTextSize()*0.6;
78  latex->DrawLatex(x, y, "ECAL hit detail view centered on tower:" );
79  y -= h;
80  latex->DrawLatex(x, y, Form(" %s",id.item()->modelName(id.index()).c_str()) );
81  y -= h;
82  latex->DrawLatex(x, y, Form(" E_{T}(em) = %.1f GeV, E_{T}(had) = %.1f GeV",
83  tower->emEt(), tower->hadEt()) );
84  y -= h;
85  latex->DrawLatex(x, y, Form(" #eta = %0.2f, #varphi = %0.2f",
86  tower->eta(), tower->phi()) );
87  y -= h;
88  m_builder->makeLegend(x, y);
89 }
FWECALDetailViewBuilder * m_builder
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:85
const FWEventItem * item()
virtual double eta() const
momentum pseudorapidity
Definition: DDAxes.h:10
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
virtual double phi() const
momentum azimuthal angle
double emEt() const
Definition: CaloTower.h:84

Member Data Documentation

FWECALDetailViewBuilder* FWCaloTowerDetailView::m_builder
private

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