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

Constructor & Destructor Documentation

FWPhotonDetailView::FWPhotonDetailView ( )

Definition at line 27 of file FWPhotonDetailView.cc.

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

Definition at line 33 of file FWPhotonDetailView.cc.

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

34 {
35  m_eveViewer->GetGLViewer()->DeleteOverlayElements(TGLOverlayElement::kUser);
36 
37  if (m_data) m_data->DecDenyDestroy();
38  delete m_builder;
39 }
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 111 of file FWPhotonDetailView.cc.

References reco::Photon::caloPosition(), EcalBarrel, EcalEndcap, reco::Photon::superCluster(), x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by build().

112 {
113  unsigned int subdetId(0);
114  if ( !i->superCluster()->seed()->hitsAndFractions().empty() )
115  subdetId = i->superCluster()->seed()->hitsAndFractions().front().first.subdetId();
116 
117  // points for centroids
118  Double_t x(0), y(0), z(0);
119  TEvePointSet *scposition = new TEvePointSet("sc position");
120  scposition->SetPickable(kTRUE);
121  scposition->SetTitle("Super cluster centroid");
122  if (subdetId == EcalBarrel) {
123  x = i->caloPosition().eta();
124  y = i->caloPosition().phi();
125  } else if (subdetId == EcalEndcap) {
126  x = i->caloPosition().x();
127  y = i->caloPosition().y();
128  }
129  scposition->SetNextPoint(x,y,z);
130  scposition->SetMarkerSize(1);
131  scposition->SetMarkerStyle(4);
132  scposition->SetMarkerColor(kBlue);
133  tList->AddElement(scposition);
134 
135  // points for seed position
136  TEvePointSet *seedposition = new TEvePointSet("seed position");
137  seedposition->SetTitle("Seed cluster centroid");
138  seedposition->SetPickable(kTRUE);
139  if (subdetId == EcalBarrel) {
140  x = i->superCluster()->seed()->position().eta();
141  y = i->superCluster()->seed()->position().phi();
142  seedposition->SetMarkerSize(0.01);
143  } else if (subdetId == EcalEndcap) {
144  x = i->superCluster()->seed()->position().x();
145  y = i->superCluster()->seed()->position().y();
146  seedposition->SetMarkerSize(1);
147  }
148  seedposition->SetNextPoint(x, y, z);
149  seedposition->SetMarkerStyle(2);
150  seedposition->SetMarkerColor(kRed);
151  tList->AddElement(seedposition);
152 }
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
Definition: Photon.cc:59
float float float z
math::XYZPointF caloPosition() const
position in ECAL: this is th SC position if r9&lt;0.93. If r8&gt;0.93 is position of seed BasicCluster taki...
Definition: Photon.h:79
Definition: DDAxes.h:10
void FWPhotonDetailView::build ( const FWModelId id,
const reco::Photon iPhoton 
)
virtual

Implements FWDetailView< reco::Photon >.

Definition at line 44 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, setTextInfo(), FWECALDetailViewBuilder::showSuperCluster(), FWECALDetailViewBuilder::showSuperClusters(), reco::Photon::superCluster(), and FWDetailViewGL< reco::Photon >::viewerGL().

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

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

Referenced by build().

90 {
91  m_infoCanvas->cd();
92  float_t x = 0.02;
93  float y = 0.97;
94  TLatex* latex = new TLatex(x, y, "");
95  const double textsize(0.05);
96  latex->SetTextSize(2*textsize);
97 
98  float h = latex->GetTextSize()*0.6;
99  latex->DrawLatex(x, y, id.item()->modelName(id.index()).c_str() );
100  y -= h;
101 
102  latex->DrawLatex(x, y, Form(" E_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f",
103  photon->et(), photon->eta(), photon->phi()) );
104  y -= h;
105  m_builder->makeLegend(x, y);
106 }
virtual double et() const GCC11_FINAL
transverse energy
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()
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
FWECALDetailViewBuilder * m_builder
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
Definition: DDAxes.h:10

Member Data Documentation

FWECALDetailViewBuilder* FWPhotonDetailView::m_builder
private

Definition at line 40 of file FWPhotonDetailView.h.

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

TEveCaloData* FWPhotonDetailView::m_data
private

Definition at line 39 of file FWPhotonDetailView.h.

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