CMS 3D CMS Logo

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

#include <FWPhotonDetailView.h>

Inheritance diagram for FWPhotonDetailView:
FWDetailViewGL< reco::Photon > FWDetailView< reco::Photon > FWDetailViewBase

Public Member Functions

virtual void build (const FWModelId &id, const reco::Photon *)
 
 FWPhotonDetailView ()
 
virtual void setTextInfo (const FWModelId &id, const reco::Photon *)
 
virtual ~FWPhotonDetailView ()
 
- Public Member Functions inherited from FWDetailViewGL< reco::Photon >
 FWDetailViewGL ()
 
virtual void init (TEveWindowSlot *)
 
virtual void setBackgroundColor (Color_t)
 
TGLViewer * viewerGL () const
 
virtual ~FWDetailViewGL ()
 
- Public Member Functions inherited from FWDetailView< reco::Photon >
virtual void build (const FWModelId &iID, const void *iData)
 
 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 addSceneInfo (const reco::Photon *, TEveElementList *)
 
 FWPhotonDetailView (const FWPhotonDetailView &)
 
const FWPhotonDetailViewoperator= (const FWPhotonDetailView &)
 

Private Attributes

FWECALDetailViewBuilderm_builder
 
TEveCaloData * m_data
 

Additional Inherited Members

- Static Public Member Functions inherited from FWDetailView< reco::Photon >
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< reco::Photon >
TEveScene * m_eveScene
 
TEveViewer * m_eveViewer
 
TGCompositeFrame * m_guiFrame
 
TCanvas * m_infoCanvas
 

Detailed Description

Definition at line 23 of file FWPhotonDetailView.h.

Constructor & Destructor Documentation

FWPhotonDetailView::FWPhotonDetailView ( )

Definition at line 26 of file FWPhotonDetailView.cc.

26  :
27 m_data(0),
28 m_builder(0)
29 {
30 }
FWECALDetailViewBuilder * m_builder
TEveCaloData * m_data
FWPhotonDetailView::~FWPhotonDetailView ( )
virtual

Definition at line 32 of file FWPhotonDetailView.cc.

References ecaldqm::binning::kUser, m_builder, m_data, and FWDetailViewGL< reco::Photon >::m_eveViewer.

33 {
34  m_eveViewer->GetGLViewer()->DeleteOverlayElements(TGLOverlayElement::kUser);
35 
36  if (m_data) m_data->DecDenyDestroy();
37  delete m_builder;
38 }
FWECALDetailViewBuilder * m_builder
TEveCaloData * m_data
FWPhotonDetailView::FWPhotonDetailView ( const FWPhotonDetailView )
private

Member Function Documentation

void FWPhotonDetailView::addSceneInfo ( const reco::Photon i,
TEveElementList *  tList 
)
private

Definition at line 110 of file FWPhotonDetailView.cc.

References reco::Photon::caloPosition(), REGISTER_FWDETAILVIEW, reco::Photon::superCluster(), x, y, and z.

Referenced by build().

111 {
112 
113  // points for centroids
114  Double_t x(0), y(0), z(0);
115  TEvePointSet *scposition = new TEvePointSet("sc position");
116  scposition->SetPickable(kTRUE);
117  scposition->SetTitle("Super cluster centroid");
118 
119  x = i->caloPosition().eta();
120  y = i->caloPosition().phi();
121 
122  scposition->SetNextPoint(x,y,z);
123  scposition->SetMarkerSize(1);
124  scposition->SetMarkerStyle(4);
125  scposition->SetMarkerColor(kBlue);
126  tList->AddElement(scposition);
127 
128  // points for seed position
129  TEvePointSet *seedposition = new TEvePointSet("seed position");
130  seedposition->SetTitle("Seed cluster centroid");
131  seedposition->SetPickable(kTRUE);
132 
133  x = i->superCluster()->seed()->position().eta();
134  y = i->superCluster()->seed()->position().phi();
135  seedposition->SetMarkerSize(0.01);
136 
137  seedposition->SetNextPoint(x, y, z);
138  seedposition->SetMarkerStyle(2);
139  seedposition->SetMarkerColor(kRed);
140  tList->AddElement(seedposition);
141 }
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
math::XYZPointF caloPosition() const
position in ECAL: this is th SC position if r9<0.93. If r8>0.93 is position of seed BasicCluster taki...
Definition: Photon.h:81
void FWPhotonDetailView::build ( const FWModelId id,
const reco::Photon iPhoton 
)
virtual

Implements FWDetailView< reco::Photon >.

Definition at line 43 of file FWPhotonDetailView.cc.

References addSceneInfo(), FWECALDetailViewBuilder::build(), reco::Photon::caloPosition(), edm::Ref< C, T, F >::isAvailable(), FWDetailViewBase::item(), m_builder, m_data, FWDetailViewGL< reco::Photon >::m_eveScene, compare::overlay(), setTextInfo(), FWECALDetailViewBuilder::showSuperCluster(), FWECALDetailViewBuilder::showSuperClusters(), reco::Photon::superCluster(), and FWDetailViewGL< reco::Photon >::viewerGL().

44 {
45  if(!iPhoton) return;
46 
47  // build ECAL objects
48  m_builder = new FWECALDetailViewBuilder(id.item()->getEvent(), id.item()->getGeom(),
49  iPhoton->caloPosition().eta(), iPhoton->caloPosition().phi(), 25);
51 
52  if ( iPhoton->superCluster().isAvailable() )
53  m_builder->showSuperCluster(*(iPhoton->superCluster()), kYellow + 1);
54 
55  TEveCaloLego* lego = m_builder->build();
56  m_data = lego->GetData();
57  m_data->IncDenyDestroy();
58  m_eveScene->AddElement(lego);
59 
60  // add Photon specific details
61  if( iPhoton->superCluster().isAvailable() )
62  addSceneInfo(iPhoton, m_eveScene);
63 
64  // draw axis at the window corners
65  TEveCaloLegoOverlay* overlay = new TEveCaloLegoOverlay();
66  overlay->SetShowPlane(kFALSE);
67  overlay->SetShowPerspective(kFALSE);
68  overlay->SetCaloLego(lego);
69  overlay->SetShowScales(1); // temporary
70  viewerGL()->AddOverlayElement(overlay);
71 
72  // set event handler and flip camera to top view at beginning
73  viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
74  FWGLEventHandler* eh =
75  new FWGLEventHandler((TGWindow*)viewerGL()->GetGLWidget(), (TObject*)viewerGL(), lego);
76  viewerGL()->SetEventHandler(eh);
77  viewerGL()->UpdateScene();
78  viewerGL()->CurrentCamera().Reset();
79 
80  viewerGL()->RequestDraw(TGLRnrCtx::kLODHigh);
81 
82  setTextInfo(id, iPhoton);
83 }
bool isAvailable() const
Definition: Ref.h:577
void showSuperCluster(const reco::SuperCluster &cluster, Color_t color=kYellow)
TGLViewer * viewerGL() const
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
const FWEventItem * item()
def overlay(hists, ytitle, header, addon)
Definition: compare.py:119
FWECALDetailViewBuilder * m_builder
math::XYZPointF caloPosition() const
position in ECAL: this is th SC position if r9<0.93. If r8>0.93 is position of seed BasicCluster taki...
Definition: Photon.h:81
TEveCaloData * m_data
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
void addSceneInfo(const reco::Photon *, TEveElementList *)
virtual void setTextInfo(const FWModelId &id, const reco::Photon *)
const FWPhotonDetailView& FWPhotonDetailView::operator= ( const FWPhotonDetailView )
private
void FWPhotonDetailView::setTextInfo ( const FWModelId id,
const reco::Photon photon 
)
virtual

Implements FWDetailView< reco::Photon >.

Definition at line 88 of file FWPhotonDetailView.cc.

References reco::LeafCandidate::et(), reco::LeafCandidate::eta(), h, diffTreeTool::index, FWDetailViewBase::item(), m_builder, FWDetailViewGL< reco::Photon >::m_infoCanvas, FWECALDetailViewBuilder::makeLegend(), ecalBarrelClusterFastTimer_cfi::modelName, reco::LeafCandidate::phi(), x, and y.

Referenced by build().

89 {
90  m_infoCanvas->cd();
91  float_t x = 0.02;
92  float y = 0.97;
93  TLatex* latex = new TLatex(x, y, "");
94  const double textsize(0.05);
95  latex->SetTextSize(2*textsize);
96 
97  float h = latex->GetTextSize()*0.6;
98  latex->DrawLatex(x, y, id.item()->modelName(id.index()).c_str() );
99  y -= h;
100 
101  latex->DrawLatex(x, y, Form(" E_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f",
102  photon->et(), photon->eta(), photon->phi()) );
103  y -= h;
104  m_builder->makeLegend(x, y);
105 }
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)
virtual double eta() const final
momentum pseudorapidity
const FWEventItem * item()
virtual double phi() const final
momentum azimuthal angle
virtual double et() const final
transverse energy
FWECALDetailViewBuilder * m_builder

Member Data Documentation

FWECALDetailViewBuilder* FWPhotonDetailView::m_builder
private

Definition at line 41 of file FWPhotonDetailView.h.

Referenced by build(), setTextInfo(), and ~FWPhotonDetailView().

TEveCaloData* FWPhotonDetailView::m_data
private

Definition at line 40 of file FWPhotonDetailView.h.

Referenced by build(), and ~FWPhotonDetailView().