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

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

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 24 of file FWPhotonDetailView.h.

Constructor & Destructor Documentation

FWPhotonDetailView::FWPhotonDetailView ( )

Definition at line 25 of file FWPhotonDetailView.cc.

25 : m_data(nullptr), m_builder(nullptr) {}
FWECALDetailViewBuilder * m_builder
TEveCaloData * m_data
FWPhotonDetailView::~FWPhotonDetailView ( )
override

Definition at line 27 of file FWPhotonDetailView.cc.

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

27  {
28  m_eveViewer->GetGLViewer()->DeleteOverlayElements(TGLOverlayElement::kUser);
29 
30  if (m_data)
31  m_data->DecDenyDestroy();
32  delete m_builder;
33 }
FWECALDetailViewBuilder * m_builder
TEveCaloData * m_data
FWPhotonDetailView::FWPhotonDetailView ( const FWPhotonDetailView )
privatedelete

Member Function Documentation

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

Definition at line 101 of file FWPhotonDetailView.cc.

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

Referenced by build().

101  {
102  // points for centroids
103  Double_t x(0), y(0), z(0);
104  TEvePointSet* scposition = new TEvePointSet("sc position");
105  scposition->SetPickable(kTRUE);
106  scposition->SetTitle("Super cluster centroid");
107 
108  x = i->caloPosition().eta();
109  y = i->caloPosition().phi();
110 
111  scposition->SetNextPoint(x, y, z);
112  scposition->SetMarkerSize(1);
113  scposition->SetMarkerStyle(4);
114  scposition->SetMarkerColor(kBlue);
115  tList->AddElement(scposition);
116 
117  // points for seed position
118  TEvePointSet* seedposition = new TEvePointSet("seed position");
119  seedposition->SetTitle("Seed cluster centroid");
120  seedposition->SetPickable(kTRUE);
121 
122  x = i->superCluster()->seed()->position().eta();
123  y = i->superCluster()->seed()->position().phi();
124  seedposition->SetMarkerSize(0.01);
125 
126  seedposition->SetNextPoint(x, y, z);
127  seedposition->SetMarkerStyle(2);
128  seedposition->SetMarkerColor(kRed);
129  tList->AddElement(seedposition);
130 }
reco::SuperClusterRef superCluster() const override
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:84
void FWPhotonDetailView::build ( const FWModelId id,
const reco::Photon iPhoton 
)
overridevirtual

Implements FWDetailView< reco::Photon >.

Definition at line 38 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().

38  {
39  if (!iPhoton)
40  return;
41 
42  // build ECAL objects
44  id.item()->getEvent(), id.item()->getGeom(), iPhoton->caloPosition().eta(), iPhoton->caloPosition().phi(), 25);
46 
47  if (iPhoton->superCluster().isAvailable())
48  m_builder->showSuperCluster(*(iPhoton->superCluster()), kYellow + 1);
49 
50  TEveCaloLego* lego = m_builder->build();
51  m_data = lego->GetData();
52  m_data->IncDenyDestroy();
53  m_eveScene->AddElement(lego);
54 
55  // add Photon specific details
56  if (iPhoton->superCluster().isAvailable())
57  addSceneInfo(iPhoton, m_eveScene);
58 
59  // draw axis at the window corners
60  TEveCaloLegoOverlay* overlay = new TEveCaloLegoOverlay();
61  overlay->SetShowPlane(kFALSE);
62  overlay->SetShowPerspective(kFALSE);
63  overlay->SetCaloLego(lego);
64  overlay->SetShowScales(true); // temporary
65  viewerGL()->AddOverlayElement(overlay);
66 
67  // set event handler and flip camera to top view at beginning
68  viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
69  FWGLEventHandler* eh = new FWGLEventHandler((TGWindow*)viewerGL()->GetGLWidget(), (TObject*)viewerGL(), lego);
70  viewerGL()->SetEventHandler(eh);
71  viewerGL()->UpdateScene();
72  viewerGL()->CurrentCamera().Reset();
73 
74  viewerGL()->RequestDraw(TGLRnrCtx::kLODHigh);
75 
76  setTextInfo(id, iPhoton);
77 }
void showSuperCluster(const reco::SuperCluster &cluster, Color_t color=kYellow)
TGLViewer * viewerGL() const
const FWEventItem * item()
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
bool isAvailable() const
Definition: Ref.h:537
void setTextInfo(const FWModelId &id, const reco::Photon *) override
def overlay(hists, ytitle, header, addon)
Definition: compare.py:123
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:84
TEveCaloData * m_data
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
void addSceneInfo(const reco::Photon *, TEveElementList *)
const FWPhotonDetailView& FWPhotonDetailView::operator= ( const FWPhotonDetailView )
privatedelete
void FWPhotonDetailView::setTextInfo ( const FWModelId id,
const reco::Photon photon 
)
overridevirtual

Implements FWDetailView< reco::Photon >.

Definition at line 81 of file FWPhotonDetailView.cc.

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

Referenced by build().

81  {
82  m_infoCanvas->cd();
83  float_t x = 0.02;
84  float y = 0.97;
85  TLatex* latex = new TLatex(x, y, "");
86  const double textsize(0.05);
87  latex->SetTextSize(2 * textsize);
88 
89  float h = latex->GetTextSize() * 0.6;
90  latex->DrawLatex(x, y, id.item()->modelName(id.index()).c_str());
91  y -= h;
92 
93  latex->DrawLatex(
94  x, y, Form(" E_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f", photon->et(), photon->eta(), photon->phi()));
95  y -= h;
96  m_builder->makeLegend(x, y);
97 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
double eta() const final
momentum pseudorapidity
double makeLegend(double x0=0.02, double y0=0.95, Color_t clustered1=kGreen+1, Color_t clustered2=kTeal, Color_t supercluster=kYellow)
const FWEventItem * item()
double et() const final
transverse energy
FWECALDetailViewBuilder * m_builder
double phi() const final
momentum azimuthal angle

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