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 >
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::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 30 of file FWElectronDetailView.h.

Constructor & Destructor Documentation

FWElectronDetailView::FWElectronDetailView ( )

Definition at line 38 of file FWElectronDetailView.cc.

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

Definition at line 45 of file FWElectronDetailView.cc.

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

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

Member Function Documentation

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

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

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

Definition at line 298 of file FWElectronDetailView.cc.

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

Referenced by build().

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

References addSceneInfo(), addTrackPointsInCaloData(), FWECALDetailViewBuilder::build(), reco::GsfElectron::caloPosition(), drawCrossHair(), eta(), reco::LeafCandidate::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().

58 {
59  if( !iElectron ) return;
60  // If SuperCluster reference is not stored,
61  // take eta and phi of a Candidate
62  double eta = 0;
63  double phi = 0;
64  if( iElectron->superCluster().isAvailable() ) {
65  eta = iElectron->caloPosition().eta();
66  phi = iElectron->caloPosition().phi();
67  }
68  else
69  {
70  eta = iElectron->eta();
71  phi = iElectron->phi();
72  }
73 
74  // build ECAL objects
75  m_builder = new FWECALDetailViewBuilder( id.item()->getEvent(), id.item()->getGeom(),
76  eta, phi, 25);
77 
79  if( iElectron->superCluster().isAvailable() )
80  m_builder->showSuperCluster( *(iElectron->superCluster() ), kYellow);
81  TEveCaloLego* lego = m_builder->build();
82  m_data = lego->GetData();
83  m_eveScene->AddElement( lego );
84 
85  m_legend = new TLegend(0.01, 0.01, 0.99, 0.99, 0, "NDC");
86  m_legend->SetTextSize(0.075);
87  m_legend->SetBorderSize(0);
88  m_legend->SetMargin(0.15);
89  m_legend->SetEntrySeparation(0.05);
90 
91  // add Electron specific details
92  if( iElectron->superCluster().isAvailable() ) {
93  addTrackPointsInCaloData( iElectron, lego );
94  drawCrossHair( iElectron, lego, m_eveScene );
95  addSceneInfo( iElectron, m_eveScene );
96  }
97 
98  // draw axis at the window corners
99  if (1)
100  {
101  TEveCaloLegoOverlay* overlay = new TEveCaloLegoOverlay();
102  overlay->SetShowPlane( kFALSE );
103  overlay->SetShowPerspective( kFALSE );
104  overlay->SetCaloLego( lego );
105  overlay->SetShowScales( 1 ); // temporary
106  viewerGL()->AddOverlayElement( overlay );
107  }
108  // set event handler and flip camera to top view at beginning
109  viewerGL()->SetCurrentCamera( TGLViewer::kCameraOrthoXOY );
110  FWGLEventHandler* eh =
111  new FWGLEventHandler( (TGWindow*)viewerGL()->GetGLWidget(), (TObject*)viewerGL(), lego );
112  viewerGL()->SetEventHandler( eh );
113  viewerGL()->ResetCamerasAfterNextUpdate();
114  viewerGL()->UpdateScene(kFALSE);
115  gEve->Redraw3D();
116 
117  setTextInfo( id, iElectron );
118 }
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:182
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:320
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 266 of file FWElectronDetailView.cc.

References eta(), and phi.

Referenced by addTrackPointsInCaloData().

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

Definition at line 121 of file FWElectronDetailView.cc.

References reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx().

Referenced by addTrackPointsInCaloData(), and drawCrossHair().

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

Definition at line 127 of file FWElectronDetailView.cc.

References reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx().

Referenced by addTrackPointsInCaloData(), and drawCrossHair().

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

Definition at line 194 of file FWElectronDetailView.cc.

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

Referenced by build().

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

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

Member Data Documentation

FWECALDetailViewBuilder* FWElectronDetailView::m_builder
private

Definition at line 56 of file FWElectronDetailView.h.

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

TEveCaloData* FWElectronDetailView::m_data
private

Definition at line 55 of file FWElectronDetailView.h.

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

TLegend* FWElectronDetailView::m_legend
private

Definition at line 57 of file FWElectronDetailView.h.

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