10 #include "TEveStraightLineSet.h"
11 #include "TEvePointSet.h"
12 #include "TEveScene.h"
13 #include "TEveViewer.h"
14 #include "TGLViewer.h"
15 #include "TGLOverlay.h"
18 #include "TEveCaloLegoOverlay.h"
19 #include "TRootEmbeddedCanvas.h"
59 if( !iElectron )
return;
70 eta = iElectron->
eta();
71 phi = iElectron->
phi();
86 m_legend =
new TLegend(0.01, 0.01, 0.99, 0.99, 0,
"NDC");
102 TEveCaloLegoOverlay*
overlay =
new TEveCaloLegoOverlay();
103 overlay->SetShowPlane( kFALSE );
104 overlay->SetShowPerspective( kFALSE );
105 overlay->SetCaloLego( lego );
106 overlay->SetShowScales( 1 );
107 viewerGL()->AddOverlayElement( overlay );
110 viewerGL()->SetCurrentCamera( TGLViewer::kCameraOrthoXOY );
114 viewerGL()->ResetCamerasAfterNextUpdate();
142 TLatex* latex =
new TLatex( x, y,
"" );
143 const double textsize( 0.05 );
144 latex->SetTextSize( 2*textsize );
146 latex->DrawLatex( x, y,
id.
item()->modelName(
id.
index() ).c_str() );
147 y -= latex->GetTextSize()*0.6;
149 latex->SetTextSize( textsize );
150 float lineH = latex->GetTextSize()*0.6;
152 latex->DrawLatex( x, y, Form(
" E_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f",
153 electron->
et(), electron->
eta(), electron->
phi()) );
156 if( electron->
charge() > 0 )
157 latex->DrawLatex( x, y,
" charge = +1" );
159 latex->DrawLatex( x, y,
" charge = -1" );
164 latex->DrawLatex( x, y,
"SuperCluster vs inner state extrapolation" );
171 latex->DrawLatex( x, y,
"SeedCluster vs outer state extrapolation" );
178 latex->DrawLatex( x, y,
"Ref to SuperCluster is not available" );
181 latex->DrawLatex(x, y, TString::Format(
" Tracker driven seed: %s", electron->
trackerDrivenSeed() ?
"YES" :
"NO"));
183 latex->DrawLatex(x, y, TString::Format(
" ECAL driven seed: %s", electron->
ecalDrivenSeed() ?
"YES" :
"NO"));
197 double ymax = lego->GetPhiMax();
198 double ymin = lego->GetPhiMin();
199 double xmax = lego->GetEtaMax();
200 double xmin = lego->GetEtaMin();
210 TEveStraightLineSet *trackpositionAtCalo =
new TEveStraightLineSet(
"sc trackpositionAtCalo");
211 trackpositionAtCalo->SetPickable(kTRUE);
212 trackpositionAtCalo->SetTitle(
"Track position at Calo propagating from the outermost state");
214 trackpositionAtCalo->AddLine(eta, ymin, 0, eta, ymax, 0);
215 trackpositionAtCalo->AddLine(xmin, phi, 0, xmax, phi, 0);
217 trackpositionAtCalo->SetDepthTest(kFALSE);
218 trackpositionAtCalo->SetLineColor(kBlue);
219 tList->AddElement(trackpositionAtCalo);
221 m_legend->AddEntry(trackpositionAtCalo,
"From outermost state",
"l");
227 TEveStraightLineSet *pinposition =
new TEveStraightLineSet(
"pin position");
228 pinposition->SetPickable(kTRUE);
229 pinposition->SetTitle(
"Track position at Calo propagating from the innermost state");
234 pinposition->AddLine(eta, ymax, 0, eta, ymin, 0);
235 pinposition->AddLine(xmin, phi, 0, xmax, phi, 0);
237 pinposition->SetDepthTest(kFALSE);
238 pinposition->SetLineColor(kRed);
239 tList->AddElement(pinposition);
241 m_legend->AddEntry(pinposition,
"From innermost state",
"l");
247 Double_t
eta, Double_t
phi )
249 Bool_t changed = kFALSE;
281 TEveCaloDataVec*
data = (TEveCaloDataVec*)lego->GetData();
282 Double_t em, eM, pm, pM;
283 data->GetEtaLimits(em, eM);
284 data->GetPhiLimits(pm, pM);
285 data->IncDenyDestroy();
286 Bool_t changed = kFALSE;
310 data->AddTower(em, eM, pm, pM);
311 data->FillSlice(2, 0); data->DataChanged();
314 Double_t legoScale = ((eM - em) < (pM - pm)) ? (eM - em) : (pM - pm);
315 lego->InitMainTrans();
316 lego->RefMainTrans().SetScale(legoScale, legoScale, legoScale*0.5);
317 lego->RefMainTrans().SetPos((eM+em)*0.5, (pM+pm)*0.5, 0);
318 lego->ElementChanged(
true);
326 Double_t
x(0),
y(0),
z(0);
327 Double_t
delta(0.02);
329 TEveStraightLineSet *scposition =
new TEveStraightLineSet(
"sc position");
330 scposition->SetPickable(kTRUE);
331 scposition->SetTitle(
"Super cluster centroid");
336 scposition->AddLine(
x-delta,
y,z,
x+delta,
y,z);
337 scposition->AddLine(
x,
y-delta,z,
x,
y+delta,z);
338 scposition->AddLine(
x,
y,z-delta,
x,
y,z+delta);
339 scposition->SetLineColor(kBlue);
340 scposition->SetLineWidth(2);
341 scposition->SetDepthTest(kFALSE);
342 tList->AddElement(scposition);
344 scposition->SetMarkerColor(kBlue);
345 scposition->SetMarkerStyle(2);
346 m_legend->AddEntry(scposition,
"Super cluster centroid",
"p");
349 TEveStraightLineSet *seedposition =
new TEveStraightLineSet(
"seed position");
350 seedposition->SetTitle(
"Seed cluster centroid");
351 seedposition->SetPickable(kTRUE);
356 seedposition->AddLine(
x-delta,
y-delta,z,
x+delta,
y+delta,z);
357 seedposition->AddLine(
x-delta,
y+delta,z,
x+delta,
y-delta,z);
358 seedposition->SetLineColor(kRed);
359 seedposition->SetLineWidth(2);
360 seedposition->SetDepthTest(kFALSE);
361 tList->AddElement(seedposition);
363 seedposition->SetMarkerColor(kRed);
364 seedposition->SetMarkerStyle(5);
365 m_legend->AddEntry(seedposition,
"Seed cluster centroid",
"p");
372 TEveStraightLineSet *eldirection =
new TEveStraightLineSet(
"seed position");
373 eldirection->SetTitle(
"Electron direction at vertex");
374 eldirection->SetPickable(kTRUE);
378 eldirection->AddLine(
x-delta,
y-delta,z,
x+delta,
y+delta,z);
379 eldirection->AddLine(
x-delta,
y+delta,z,
x+delta,
y-delta,z);
380 eldirection->SetLineColor(kGreen + 1);
381 eldirection->SetDepthTest(kFALSE);
382 tList->AddElement(eldirection);
384 eldirection->SetMarkerColor(kGreen);
385 eldirection->SetMarkerStyle(5);
386 m_legend->AddEntry(eldirection,
"Direction at vertex",
"p");
void showSuperCluster(const reco::SuperCluster &cluster, Color_t color=kYellow)
TGLViewer * viewerGL() const
double makeLegend(double x0=0.02, double y0=0.95, Color_t clustered1=kGreen+1, Color_t clustered2=kTeal, Color_t supercluster=kYellow)
virtual void setTextInfo(const FWModelId &id, const reco::GsfElectron *)
virtual ~FWElectronDetailView()
const FWEventItem * item()
Bool_t checkRange(Double_t &, Double_t &, Double_t &, Double_t &, Double_t, Double_t)
virtual double phi() const final
momentum azimuthal angle
#define REGISTER_FWDETAILVIEW(_classname_, _name_,...)
FWECALDetailViewBuilder * m_builder
float deltaEtaSuperClusterTrackAtVtx() const
float deltaPhiSeedClusterTrackAtCalo() const
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
float deltaPhiSuperClusterTrackAtVtx() const
virtual int charge() const final
electric charge
tuple reducedEcalRecHitsEB
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
math::XYZPoint caloPosition() const
virtual void build(const FWModelId &id, const reco::GsfElectron *)
void drawCrossHair(const reco::GsfElectron *, TEveCaloLego *, TEveElementList *)
Geom::Phi< T > phi() const
double deltaEtaSuperClusterTrackAtVtx(const reco::GsfElectron &)
float deltaEtaSeedClusterTrackAtCalo() const
void addSceneInfo(const reco::GsfElectron *i, TEveElementList *tList)
char data[epos_bytes_allocation]
double deltaPhiSuperClusterTrackAtVtx(const reco::GsfElectron &)
bool trackerDrivenSeed() const
virtual double et() const final
transverse energy
virtual double eta() const final
momentum pseudorapidity
void addTrackPointsInCaloData(const reco::GsfElectron *, TEveCaloLego *)
bool ecalDrivenSeed() const