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"
61 eta = iElectron->
eta();
62 phi = iElectron->
phi();
76 m_legend =
new TLegend(0.01, 0.01, 0.99, 0.99,
nullptr,
"NDC");
91 TEveCaloLegoOverlay *
overlay =
new TEveCaloLegoOverlay();
92 overlay->SetShowPlane(kFALSE);
93 overlay->SetShowPerspective(kFALSE);
94 overlay->SetCaloLego(lego);
95 overlay->SetShowScales(
true);
96 viewerGL()->AddOverlayElement(overlay);
99 viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
102 viewerGL()->ResetCamerasAfterNextUpdate();
124 TLatex *latex =
new TLatex(x, y,
"");
125 const double textsize(0.05);
126 latex->SetTextSize(2 * textsize);
128 latex->DrawLatex(x, y,
id.
item()->modelName(
id.
index()).c_str());
129 y -= latex->GetTextSize() * 0.6;
131 latex->SetTextSize(textsize);
132 float lineH = latex->GetTextSize() * 0.6;
135 x, y, Form(
" E_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f", electron->
et(), electron->
eta(), electron->
phi()));
138 if (electron->
charge() > 0)
139 latex->DrawLatex(x, y,
" charge = +1");
141 latex->DrawLatex(x, y,
" charge = -1");
146 latex->DrawLatex(x, y,
"SuperCluster vs inner state extrapolation");
153 latex->DrawLatex(x, y,
"SeedCluster vs outer state extrapolation");
160 latex->DrawLatex(x, y,
"Ref to SuperCluster is not available");
163 latex->DrawLatex(x, y, TString::Format(
" Tracker driven seed: %s", electron->
trackerDrivenSeed() ?
"YES" :
"NO"));
165 latex->DrawLatex(x, y, TString::Format(
" ECAL driven seed: %s", electron->
ecalDrivenSeed() ?
"YES" :
"NO"));
177 double ymax = lego->GetPhiMax();
178 double ymin = lego->GetPhiMin();
179 double xmax = lego->GetEtaMax();
180 double xmin = lego->GetEtaMin();
188 TEveStraightLineSet *trackpositionAtCalo =
new TEveStraightLineSet(
"sc trackpositionAtCalo");
189 trackpositionAtCalo->SetPickable(kTRUE);
190 trackpositionAtCalo->SetTitle(
"Track position at Calo propagating from the outermost state");
192 trackpositionAtCalo->AddLine(eta, ymin, 0, eta, ymax, 0);
193 trackpositionAtCalo->AddLine(xmin, phi, 0, xmax, phi, 0);
195 trackpositionAtCalo->SetDepthTest(kFALSE);
196 trackpositionAtCalo->SetLineColor(kBlue);
197 tList->AddElement(trackpositionAtCalo);
199 m_legend->AddEntry(trackpositionAtCalo,
"From outermost state",
"l");
205 TEveStraightLineSet *pinposition =
new TEveStraightLineSet(
"pin position");
206 pinposition->SetPickable(kTRUE);
207 pinposition->SetTitle(
"Track position at Calo propagating from the innermost state");
211 pinposition->AddLine(eta, ymax, 0, eta, ymin, 0);
212 pinposition->AddLine(xmin, phi, 0, xmax, phi, 0);
214 pinposition->SetDepthTest(kFALSE);
215 pinposition->SetLineColor(kRed);
216 tList->AddElement(pinposition);
218 m_legend->AddEntry(pinposition,
"From innermost state",
"l");
223 Double_t &em, Double_t &eM, Double_t &pm, Double_t &pM, Double_t
eta, Double_t
phi) {
224 Bool_t changed = kFALSE;
230 }
else if (eta > eM) {
239 }
else if (phi > pM) {
248 TEveCaloDataVec *
data = (TEveCaloDataVec *)lego->GetData();
249 Double_t em, eM, pm, pM;
250 data->GetEtaLimits(em, eM);
251 data->GetPhiLimits(pm, pM);
252 data->IncDenyDestroy();
253 Bool_t changed = kFALSE;
273 data->AddTower(em, eM, pm, pM);
274 data->FillSlice(2, 0);
278 Double_t legoScale = ((eM - em) < (pM - pm)) ? (eM - em) : (pM - pm);
279 lego->InitMainTrans();
280 lego->RefMainTrans().SetScale(legoScale, legoScale, legoScale * 0.5);
281 lego->RefMainTrans().SetPos((eM + em) * 0.5, (pM + pm) * 0.5, 0);
282 lego->ElementChanged(
true);
288 Double_t
x(0),
y(0),
z(0);
289 Double_t
delta(0.02);
291 TEveStraightLineSet *scposition =
new TEveStraightLineSet(
"sc position");
292 scposition->SetPickable(kTRUE);
293 scposition->SetTitle(
"Super cluster centroid");
298 scposition->AddLine(
x - delta,
y, z,
x + delta,
y, z);
299 scposition->AddLine(
x,
y - delta, z,
x,
y + delta, z);
300 scposition->AddLine(
x,
y, z - delta,
x,
y, z + delta);
301 scposition->SetLineColor(kBlue);
302 scposition->SetLineWidth(2);
303 scposition->SetDepthTest(kFALSE);
304 tList->AddElement(scposition);
306 scposition->SetMarkerColor(kBlue);
307 scposition->SetMarkerStyle(2);
308 m_legend->AddEntry(scposition,
"Super cluster centroid",
"p");
311 TEveStraightLineSet *seedposition =
new TEveStraightLineSet(
"seed position");
312 seedposition->SetTitle(
"Seed cluster centroid");
313 seedposition->SetPickable(kTRUE);
318 seedposition->AddLine(
x - delta,
y - delta, z,
x + delta,
y + delta, z);
319 seedposition->AddLine(
x - delta,
y + delta, z,
x + delta,
y - delta, z);
320 seedposition->SetLineColor(kRed);
321 seedposition->SetLineWidth(2);
322 seedposition->SetDepthTest(kFALSE);
323 tList->AddElement(seedposition);
325 seedposition->SetMarkerColor(kRed);
326 seedposition->SetMarkerStyle(5);
327 m_legend->AddEntry(seedposition,
"Seed cluster centroid",
"p");
333 TEveStraightLineSet *eldirection =
new TEveStraightLineSet(
"seed position");
334 eldirection->SetTitle(
"Electron direction at vertex");
335 eldirection->SetPickable(kTRUE);
339 eldirection->AddLine(
x - delta,
y - delta, z,
x + delta,
y + delta, z);
340 eldirection->AddLine(
x - delta,
y + delta, z,
x + delta,
y - delta, z);
341 eldirection->SetLineColor(kGreen + 1);
342 eldirection->SetDepthTest(kFALSE);
343 tList->AddElement(eldirection);
345 eldirection->SetMarkerColor(kGreen);
346 eldirection->SetMarkerStyle(5);
347 m_legend->AddEntry(eldirection,
"Direction at vertex",
"p");
void showSuperCluster(const reco::SuperCluster &cluster, Color_t color=kYellow)
void setTextInfo(const FWModelId &id, const reco::GsfElectron *) override
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)
const FWEventItem * item()
Bool_t checkRange(Double_t &, Double_t &, Double_t &, Double_t &, Double_t, Double_t)
void build(const FWModelId &id, const reco::GsfElectron *) override
#define REGISTER_FWDETAILVIEW(_classname_, _name_,...)
FWECALDetailViewBuilder * m_builder
~FWElectronDetailView() override
float deltaEtaSuperClusterTrackAtVtx() const
float deltaPhiSeedClusterTrackAtCalo() const
float deltaPhiSuperClusterTrackAtVtx() const
tuple reducedEcalRecHitsEB
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
math::XYZPoint caloPosition() const
void drawCrossHair(const reco::GsfElectron *, TEveCaloLego *, TEveElementList *)
double deltaEtaSuperClusterTrackAtVtx(const reco::GsfElectron &)
float deltaEtaSeedClusterTrackAtCalo() const
void addSceneInfo(const reco::GsfElectron *i, TEveElementList *tList)
double et() const final
transverse energy
char data[epos_bytes_allocation]
double deltaPhiSuperClusterTrackAtVtx(const reco::GsfElectron &)
bool trackerDrivenSeed() const
void addTrackPointsInCaloData(const reco::GsfElectron *, TEveCaloLego *)
constexpr char Electron[]
double phi() const final
momentum azimuthal angle
SuperClusterRef superCluster() const override
reference to a SuperCluster
int charge() const final
electric charge
bool ecalDrivenSeed() const
double eta() const final
momentum pseudorapidity