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
FWElectronDetailView Class Reference

#include <FWElectronDetailView.h>

Inheritance diagram for FWElectronDetailView:
FWDetailViewGL< reco::GsfElectron > FWDetailView< reco::GsfElectron > FWDetailViewBase

Public Member Functions

 FWElectronDetailView ()
 
virtual ~FWElectronDetailView ()
 
- Public Member Functions inherited from FWDetailViewGL< reco::GsfElectron >
 FWDetailViewGL ()
 
virtual void init (TEveWindowSlot *)
 
virtual void setBackgroundColor (Color_t)
 
TGLViewer * viewerGL () const
 
virtual ~FWDetailViewGL ()
 
- Public Member Functions inherited from FWDetailView< reco::GsfElectron >
 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::GsfElectron *i, TEveElementList *tList)
 
void addTrackPointsInCaloData (const reco::GsfElectron *, TEveCaloLego *)
 
virtual void build (const FWModelId &id, const reco::GsfElectron *)
 
Bool_t checkRange (Double_t &, Double_t &, Double_t &, Double_t &, Double_t, Double_t)
 
double deltaEtaSuperClusterTrackAtVtx (const reco::GsfElectron &)
 
double deltaPhiSuperClusterTrackAtVtx (const reco::GsfElectron &)
 
void drawCrossHair (const reco::GsfElectron *, TEveCaloLego *, TEveElementList *)
 
 FWElectronDetailView (const FWElectronDetailView &)
 
const FWElectronDetailViewoperator= (const FWElectronDetailView &)
 
virtual void setTextInfo (const FWModelId &id, const reco::GsfElectron *)
 

Private Attributes

FWECALDetailViewBuilderm_builder
 
TEveCaloData * m_data
 
TLegend * m_legend
 

Additional Inherited Members

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

Detailed Description

Definition at line 31 of file FWElectronDetailView.h.

Constructor & Destructor Documentation

FWElectronDetailView::FWElectronDetailView ( )

Definition at line 39 of file FWElectronDetailView.cc.

39  :
40  m_data(0),
41  m_builder(0),
42  m_legend(0)
43 {
44 }
FWECALDetailViewBuilder * m_builder
FWElectronDetailView::~FWElectronDetailView ( )
virtual

Definition at line 46 of file FWElectronDetailView.cc.

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

47 {
48  m_eveViewer->GetGLViewer()->DeleteOverlayElements(TGLOverlayElement::kUser);
49 
50  delete m_builder;
51  if (m_data) m_data->DecDenyDestroy();
52 }
FWECALDetailViewBuilder * m_builder
FWElectronDetailView::FWElectronDetailView ( const FWElectronDetailView )
private

Member Function Documentation

void FWElectronDetailView::addSceneInfo ( const reco::GsfElectron i,
TEveElementList *  tList 
)
private

Definition at line 365 of file FWElectronDetailView.cc.

References reco::GsfElectron::caloPosition(), funct::cos(), delta, EcalBarrel, EcalEndcap, reco::LeafCandidate::eta(), m_legend, reco::LeafCandidate::phi(), funct::sin(), reco::GsfElectron::superCluster(), funct::tan(), reco::LeafCandidate::theta(), x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by build().

366 {
367  unsigned int subdetId(0);
368 
369  if ( !i->superCluster()->seed()->hitsAndFractions().empty() )
370  subdetId = i->superCluster()->seed()->hitsAndFractions().front().first.subdetId();
371 
372  // centroids
373  Double_t x(0), y(0), z(0);
374  Double_t delta(0.02);
375  if (subdetId == EcalEndcap) delta = 2.5;
376  TEveStraightLineSet *scposition = new TEveStraightLineSet("sc position");
377  scposition->SetPickable(kTRUE);
378  scposition->SetTitle("Super cluster centroid");
379  if (subdetId == EcalBarrel) {
380  x = i->caloPosition().eta();
381  y = i->caloPosition().phi();
382  } else if (subdetId == EcalEndcap) {
383  x = i->caloPosition().x();
384  y = i->caloPosition().y();
385  }
386  scposition->AddLine(x-delta,y,z,x+delta,y,z);
387  scposition->AddLine(x,y-delta,z,x,y+delta,z);
388  scposition->AddLine(x,y,z-delta,x,y,z+delta);
389  scposition->SetLineColor(kBlue);
390  scposition->SetLineWidth(2);
391  scposition->SetDepthTest(kFALSE);
392  tList->AddElement(scposition);
393 
394  scposition->SetMarkerColor(kBlue);
395  scposition->SetMarkerStyle(2);
396  m_legend->AddEntry(scposition, "Super cluster centroid", "p");
397 
398  // seed position
399  TEveStraightLineSet *seedposition = new TEveStraightLineSet("seed position");
400  seedposition->SetTitle("Seed cluster centroid");
401  seedposition->SetPickable(kTRUE);
402  if (subdetId == EcalBarrel) {
403  x = i->superCluster()->seed()->position().eta();
404  y = i->superCluster()->seed()->position().phi();
405  } else if (subdetId == EcalEndcap) {
406  x = i->superCluster()->seed()->position().x();
407  y = i->superCluster()->seed()->position().y();
408  }
409  seedposition->AddLine(x-delta,y-delta,z,x+delta,y+delta,z);
410  seedposition->AddLine(x-delta,y+delta,z,x+delta,y-delta,z);
411  seedposition->SetLineColor(kRed);
412  seedposition->SetLineWidth(2);
413  seedposition->SetDepthTest(kFALSE);
414  tList->AddElement(seedposition);
415 
416  seedposition->SetMarkerColor(kRed);
417  seedposition->SetMarkerStyle(5);
418  m_legend->AddEntry(seedposition, "Seed cluster centroid", "p");
419 
420  // electron direction (show it if it's within
421  // the area of interest)
422  if ( fabs(i->phi()-i->caloPosition().phi())< 25*0.0172 &&
423  fabs(i->eta()-i->caloPosition().eta())< 25*0.0172 )
424  {
425  TEveStraightLineSet *eldirection = new TEveStraightLineSet("seed position");
426  eldirection->SetTitle("Electron direction at vertex");
427  eldirection->SetPickable(kTRUE);
428  if (subdetId == EcalBarrel) {
429  x = i->eta();
430  y = i->phi();
431  }else{
432  x = 310*fabs(tan(i->theta()))*cos(i->phi());
433  y = 310*fabs(tan(i->theta()))*sin(i->phi());
434  }
435  eldirection->AddLine(x-delta,y-delta,z,x+delta,y+delta,z);
436  eldirection->AddLine(x-delta,y+delta,z,x+delta,y-delta,z);
437  eldirection->SetLineColor(kGreen);
438  eldirection->SetDepthTest(kFALSE);
439  tList->AddElement(eldirection);
440 
441  eldirection->SetMarkerColor(kGreen);
442  eldirection->SetMarkerStyle(5);
443  m_legend->AddEntry(eldirection, "Direction at vertex", "p");
444  }
445 }
dbl * delta
Definition: mlp_gen.cc:36
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual double theta() const GCC11_FINAL
momentum polar angle
float float float z
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:168
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
math::XYZPoint caloPosition() const
Definition: GsfElectron.h:303
Definition: DDAxes.h:10
void FWElectronDetailView::addTrackPointsInCaloData ( const reco::GsfElectron i,
TEveCaloLego *  lego 
)
private

Definition at line 299 of file FWElectronDetailView.cc.

References reco::GsfElectron::caloPosition(), checkRange(), data, reco::GsfElectron::deltaEtaSeedClusterTrackAtCalo(), deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSeedClusterTrackAtCalo(), deltaPhiSuperClusterTrackAtVtx(), EcalBarrel, EcalEndcap, eta(), phi, pos, and reco::GsfElectron::superCluster().

Referenced by build().

300 {
301  unsigned int subdetId(0);
302 
303  if ( !i->superCluster()->seed()->hitsAndFractions().empty() )
304  subdetId = i->superCluster()->seed()->hitsAndFractions().front().first.subdetId();
305 
306  TEveCaloDataVec* data = (TEveCaloDataVec*)lego->GetData();
307  Double_t em, eM, pm, pM;
308  data->GetEtaLimits(em, eM);
309  data->GetPhiLimits(pm, pM);
310  data->IncDenyDestroy();
311  Bool_t changed = kFALSE;
312  // add cells in third layer if necessary
313 
314  // trackpositionAtCalo
315  {
316  double eta = i->superCluster()->seed()->position().eta() -
318  double phi = i->superCluster()->seed()->position().phi() -
320 
321  if (subdetId == EcalBarrel)
322  {
323  if (checkRange(em, eM, pm, pM, eta, phi))
324  changed = kTRUE;
325  }
326  else if (subdetId == EcalEndcap) {
327  TVector3 pos;
328  pos.SetPtEtaPhi(i->superCluster()->seed()->position().rho(),eta, phi);
329  if (checkRange(em, eM, pm, pM, pos.X(), pos.Y()))
330  changed = kTRUE;
331 
332  }
333  }
334  // pinposition
335  {
336  double eta = i->caloPosition().eta() - deltaEtaSuperClusterTrackAtVtx(*i);
337  double phi = i->caloPosition().phi() - deltaPhiSuperClusterTrackAtVtx(*i);
338  if (subdetId == EcalBarrel)
339  {
340  if (checkRange(em, eM, pm, pM, eta, phi))
341  changed = kTRUE;
342  }
343  else if (subdetId == EcalEndcap) {
344  TVector3 pos;
345  pos.SetPtEtaPhi(i->caloPosition().rho(), eta, phi);
346  if (checkRange(em, eM, pm, pM, pos.X(), pos.Y()))
347  changed = kTRUE;
348  }
349  }
350  if (changed)
351  {
352  data->AddTower(em, eM, pm, pM);
353  data->FillSlice(2, 0); data->DataChanged();
354 
355  lego->ComputeBBox();
356  Double_t legoScale = ((eM - em) < (pM - pm)) ? (eM - em) : (pM - pm);
357  lego->InitMainTrans();
358  lego->RefMainTrans().SetScale(legoScale, legoScale, legoScale*0.5);
359  lego->RefMainTrans().SetPos((eM+em)*0.5, (pM+pm)*0.5, 0);
360  lego->ElementChanged(true);
361  }
362 }
Bool_t checkRange(Double_t &, Double_t &, Double_t &, Double_t &, Double_t, Double_t)
T eta() const
float deltaPhiSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:237
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:168
math::XYZPoint caloPosition() const
Definition: GsfElectron.h:303
double deltaEtaSuperClusterTrackAtVtx(const reco::GsfElectron &)
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:234
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
double deltaPhiSuperClusterTrackAtVtx(const reco::GsfElectron &)
Definition: DDAxes.h:10
void FWElectronDetailView::build ( const FWModelId id,
const reco::GsfElectron iElectron 
)
privatevirtual

Implements FWDetailView< reco::GsfElectron >.

Definition at line 58 of file FWElectronDetailView.cc.

References addSceneInfo(), addTrackPointsInCaloData(), FWECALDetailViewBuilder::build(), reco::GsfElectron::caloPosition(), drawCrossHair(), reco::LeafCandidate::eta(), eta(), edm::Ref< C, T, F >::isAvailable(), FWDetailViewBase::item(), m_builder, m_data, FWDetailViewGL< reco::GsfElectron >::m_eveScene, m_legend, phi, reco::LeafCandidate::phi(), setTextInfo(), FWECALDetailViewBuilder::showSuperCluster(), FWECALDetailViewBuilder::showSuperClusters(), reco::GsfElectron::superCluster(), and FWDetailViewGL< reco::GsfElectron >::viewerGL().

59 {
60  if( !iElectron ) return;
61  // If SuperCluster reference is not stored,
62  // take eta and phi of a Candidate
63  double eta = 0;
64  double phi = 0;
65  if( iElectron->superCluster().isAvailable() ) {
66  eta = iElectron->caloPosition().eta();
67  phi = iElectron->caloPosition().phi();
68  }
69  else
70  {
71  eta = iElectron->eta();
72  phi = iElectron->phi();
73  }
74 
75  // build ECAL objects
76  m_builder = new FWECALDetailViewBuilder( id.item()->getEvent(), id.item()->getGeom(),
77  eta, phi, 25);
78 
80  if( iElectron->superCluster().isAvailable() )
81  m_builder->showSuperCluster( *(iElectron->superCluster() ), kYellow);
82  TEveCaloLego* lego = m_builder->build();
83  m_data = lego->GetData();
84  m_eveScene->AddElement( lego );
85 
86  m_legend = new TLegend(0.01, 0.01, 0.99, 0.99, 0, "NDC");
87  m_legend->SetTextSize(0.075);
88  m_legend->SetBorderSize(0);
89  m_legend->SetMargin(0.15);
90  m_legend->SetEntrySeparation(0.05);
91 
92  // add Electron specific details
93  if( iElectron->superCluster().isAvailable() ) {
94  addTrackPointsInCaloData( iElectron, lego );
95  drawCrossHair( iElectron, lego, m_eveScene );
96  addSceneInfo( iElectron, m_eveScene );
97  }
98 
99  // draw axis at the window corners
100  if (1)
101  {
102  TEveCaloLegoOverlay* overlay = new TEveCaloLegoOverlay();
103  overlay->SetShowPlane( kFALSE );
104  overlay->SetShowPerspective( kFALSE );
105  overlay->SetCaloLego( lego );
106  overlay->SetShowScales( 1 ); // temporary
107  viewerGL()->AddOverlayElement( overlay );
108  }
109  // set event handler and flip camera to top view at beginning
110  viewerGL()->SetCurrentCamera( TGLViewer::kCameraOrthoXOY );
111  FWGLEventHandler* eh =
112  new FWGLEventHandler( (TGWindow*)viewerGL()->GetGLWidget(), (TObject*)viewerGL(), lego );
113  viewerGL()->SetEventHandler( eh );
114  viewerGL()->ResetCamerasAfterNextUpdate();
115  viewerGL()->UpdateScene(kFALSE);
116  gEve->Redraw3D();
117 
118  setTextInfo( id, iElectron );
119 }
void showSuperCluster(const reco::SuperCluster &cluster, Color_t color=kYellow)
virtual void setTextInfo(const FWModelId &id, const reco::GsfElectron *)
const FWEventItem * item()
bool isAvailable() const
Definition: Ref.h:276
T eta() const
FWECALDetailViewBuilder * m_builder
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:168
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
math::XYZPoint caloPosition() const
Definition: GsfElectron.h:303
void drawCrossHair(const reco::GsfElectron *, TEveCaloLego *, TEveElementList *)
void addSceneInfo(const reco::GsfElectron *i, TEveElementList *tList)
void addTrackPointsInCaloData(const reco::GsfElectron *, TEveCaloLego *)
Definition: DDAxes.h:10
Bool_t FWElectronDetailView::checkRange ( Double_t &  em,
Double_t &  eM,
Double_t &  pm,
Double_t &  pM,
Double_t  eta,
Double_t  phi 
)
private

Definition at line 267 of file FWElectronDetailView.cc.

References eta(), and phi.

Referenced by addTrackPointsInCaloData().

269 {
270  Bool_t changed = kFALSE;
271 
272  //check eta
273  if (eta < em)
274  {
275  em = eta;
276  changed = kTRUE;
277  }
278  else if (eta > eM)
279  {
280  eM = eta;
281  changed = kTRUE;
282  }
283 
284  // check phi
285  if (phi < pm)
286  {
287  pm = phi;
288  changed = kTRUE;
289  }
290  else if (phi > pM)
291  {
292  pM = phi;
293  changed = kTRUE;
294  }
295  return changed;
296 }
T eta() const
Definition: DDAxes.h:10
double FWElectronDetailView::deltaEtaSuperClusterTrackAtVtx ( const reco::GsfElectron electron)
private

Definition at line 122 of file FWElectronDetailView.cc.

References reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx().

Referenced by addTrackPointsInCaloData(), and drawCrossHair().

123 {
124  return electron.deltaEtaSuperClusterTrackAtVtx();
125 }
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:233
double FWElectronDetailView::deltaPhiSuperClusterTrackAtVtx ( const reco::GsfElectron electron)
private

Definition at line 128 of file FWElectronDetailView.cc.

References reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx().

Referenced by addTrackPointsInCaloData(), and drawCrossHair().

129 {
130  return electron.deltaPhiSuperClusterTrackAtVtx();
131 }
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:236
void FWElectronDetailView::drawCrossHair ( const reco::GsfElectron i,
TEveCaloLego *  lego,
TEveElementList *  tList 
)
private

Definition at line 195 of file FWElectronDetailView.cc.

References reco::GsfElectron::caloPosition(), reco::GsfElectron::deltaEtaSeedClusterTrackAtCalo(), deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSeedClusterTrackAtCalo(), deltaPhiSuperClusterTrackAtVtx(), EcalBarrel, EcalEndcap, eta(), m_legend, phi, pos, reco::GsfElectron::superCluster(), SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

Referenced by build().

196 {
197  unsigned int subdetId( 0 );
198 
199  if( !i->superCluster()->seed()->hitsAndFractions().empty() )
200  subdetId = i->superCluster()->seed()->hitsAndFractions().front().first.subdetId();
201 
202  double ymax = lego->GetPhiMax();
203  double ymin = lego->GetPhiMin();
204  double xmax = lego->GetEtaMax();
205  double xmin = lego->GetEtaMin();
206 
207  // draw crosshairs for track intersections
208 
209  {
210  const double eta = i->superCluster()->seed()->position().eta() -
212  const double phi = i->superCluster()->seed()->position().phi() -
214 
215  TEveStraightLineSet *trackpositionAtCalo = new TEveStraightLineSet("sc trackpositionAtCalo");
216  trackpositionAtCalo->SetPickable(kTRUE);
217  trackpositionAtCalo->SetTitle("Track position at Calo propagating from the outermost state");
218  if (subdetId == EcalBarrel)
219  {
220  trackpositionAtCalo->AddLine(eta, ymin, 0, eta, ymax, 0);
221  trackpositionAtCalo->AddLine(xmin, phi, 0, xmax, phi, 0);
222  }
223  else if (subdetId == EcalEndcap)
224  {
225  TVector3 pos;
226  pos.SetPtEtaPhi(i->superCluster()->seed()->position().rho(), eta, phi);
227  trackpositionAtCalo->AddLine(pos.X(), ymin, 0, pos.X(), ymax, 0);
228  trackpositionAtCalo->AddLine(xmin, pos.Y(), 0, xmax,pos.Y(),0);
229  }
230  trackpositionAtCalo->SetDepthTest(kFALSE);
231  trackpositionAtCalo->SetLineColor(kBlue);
232  tList->AddElement(trackpositionAtCalo);
233 
234  m_legend->AddEntry(trackpositionAtCalo, "From outermost state", "l");
235  }
236  //
237  // pin position
238  //
239  {
240  TEveStraightLineSet *pinposition = new TEveStraightLineSet("pin position");
241  pinposition->SetPickable(kTRUE);
242  pinposition->SetTitle("Track position at Calo propagating from the innermost state");
243  Double_t eta = i->caloPosition().eta() - deltaEtaSuperClusterTrackAtVtx(*i);
244  Double_t phi = i->caloPosition().phi() - deltaPhiSuperClusterTrackAtVtx(*i);
245 
246  if (subdetId == EcalBarrel)
247  {
248  pinposition->AddLine(eta, ymax, 0, eta, ymin, 0);
249  pinposition->AddLine(xmin, phi, 0, xmax, phi, 0);
250  }
251  else if (subdetId == EcalEndcap)
252  {
253  TVector3 pos;
254  pos.SetPtEtaPhi(i->caloPosition().rho(), eta, phi);
255  pinposition->AddLine(pos.X(),ymin, 0, pos.X(), ymax, 0);
256  pinposition->AddLine(xmin, pos.Y(), 0, xmax, pos.Y(), 0);
257  }
258  pinposition->SetDepthTest(kFALSE);
259  pinposition->SetLineColor(kRed);
260  tList->AddElement(pinposition);
261 
262  m_legend->AddEntry(pinposition, "From innermost state", "l");
263  }
264 }
T eta() const
float deltaPhiSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:237
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:168
math::XYZPoint caloPosition() const
Definition: GsfElectron.h:303
double deltaEtaSuperClusterTrackAtVtx(const reco::GsfElectron &)
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:234
double deltaPhiSuperClusterTrackAtVtx(const reco::GsfElectron &)
Definition: DDAxes.h:10
const FWElectronDetailView& FWElectronDetailView::operator= ( const FWElectronDetailView )
private
void FWElectronDetailView::setTextInfo ( const FWModelId id,
const reco::GsfElectron electron 
)
privatevirtual

Implements FWDetailView< reco::GsfElectron >.

Definition at line 134 of file FWElectronDetailView.cc.

References reco::LeafCandidate::charge(), reco::GsfElectron::deltaEtaSeedClusterTrackAtCalo(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSeedClusterTrackAtCalo(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), reco::GsfElectron::ecalDrivenSeed(), reco::LeafCandidate::et(), reco::LeafCandidate::eta(), getHLTprescales::index, edm::Ref< C, T, F >::isAvailable(), FWDetailViewBase::item(), m_builder, FWDetailViewGL< reco::GsfElectron >::m_infoCanvas, m_legend, FWECALDetailViewBuilder::makeLegend(), reco::LeafCandidate::phi(), reco::GsfElectron::superCluster(), reco::GsfElectron::trackerDrivenSeed(), x, and detailsBasic3DVector::y.

Referenced by build().

135 {
136  m_infoCanvas->cd();
137 
138  float_t x = 0.02;
139  float_t x2 = 0.52;
140  float y = 0.95;
141 
142  TLatex* latex = new TLatex( x, y, "" );
143  const double textsize( 0.05 );
144  latex->SetTextSize( 2*textsize );
145 
146  latex->DrawLatex( x, y, id.item()->modelName( id.index() ).c_str() );
147  y -= latex->GetTextSize()*0.6;
148 
149  latex->SetTextSize( textsize );
150  float lineH = latex->GetTextSize()*0.6;
151 
152  latex->DrawLatex( x, y, Form( " E_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f",
153  electron->et(), electron->eta(), electron->phi()) );
154  y -= lineH;
155  // summary
156  if( electron->charge() > 0 )
157  latex->DrawLatex( x, y, " charge = +1" );
158  else
159  latex->DrawLatex( x, y, " charge = -1" );
160  y -= lineH;
161 
162  if( electron->superCluster().isAvailable() ) {
163  // delta phi/eta in
164  latex->DrawLatex( x, y, "SuperCluster vs inner state extrapolation" );
165  y -= lineH;
166  latex->DrawLatex( x, y, TString::Format(" #Delta#eta_{in} = %.3f", electron->deltaEtaSuperClusterTrackAtVtx()) );
167  latex->DrawLatex( x2, y, TString::Format("#Delta#varphi_{in} = %.3f", electron->deltaPhiSuperClusterTrackAtVtx()) );
168  y -= lineH;
169 
170  // delta phi/eta out
171  latex->DrawLatex( x, y, "SeedCluster vs outer state extrapolation" );
172  y -= lineH;
173 
174  latex->DrawLatex( x, y, TString::Format(" #Delta#eta_{out} = %.3f", electron->deltaEtaSeedClusterTrackAtCalo()) );
175  latex->DrawLatex( x2, y, TString::Format(" #Delta#varphi_{out} = %.3f", electron->deltaPhiSeedClusterTrackAtCalo()) );
176  y -= 2*lineH;
177  } else {
178  latex->DrawLatex( x, y, "Ref to SuperCluster is not available" );
179  }
180 
181  latex->DrawLatex(x, y, TString::Format(" Tracker driven seed: %s", electron->trackerDrivenSeed() ? "YES" : "NO"));
182  y -= lineH;
183  latex->DrawLatex(x, y, TString::Format(" ECAL driven seed: %s", electron->ecalDrivenSeed() ? "YES" : "NO"));
184  y -= lineH;
185 
186  y = m_builder->makeLegend( 0.02, y );
187  y -= lineH;
188 
189  m_legend->SetY2(y);
190  m_legend->Draw();
191  m_legend = 0; // Deleted together with TPad.
192 }
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()
bool isAvailable() const
Definition: Ref.h:276
FWECALDetailViewBuilder * m_builder
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:233
float deltaPhiSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:237
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:168
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:236
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
virtual int charge() const GCC11_FINAL
electric charge
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:234
bool trackerDrivenSeed() const
Definition: GsfElectron.h:173
Definition: DDAxes.h:10
bool ecalDrivenSeed() const
Definition: GsfElectron.h:172

Member Data Documentation

FWECALDetailViewBuilder* FWElectronDetailView::m_builder
private

Definition at line 54 of file FWElectronDetailView.h.

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

TEveCaloData* FWElectronDetailView::m_data
private

Definition at line 53 of file FWElectronDetailView.h.

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

TLegend* FWElectronDetailView::m_legend
private

Definition at line 55 of file FWElectronDetailView.h.

Referenced by addSceneInfo(), build(), drawCrossHair(), and setTextInfo().