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"
76 m_legend =
new TLegend(0.01, 0.01, 0.99, 0.99,
nullptr,
"NDC");
91 TEveCaloLegoOverlay *
overlay =
new TEveCaloLegoOverlay();
93 overlay->SetShowPerspective(kFALSE);
99 viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
102 viewerGL()->ResetCamerasAfterNextUpdate();
110 return electron.deltaEtaSuperClusterTrackAtVtx();
114 return electron.deltaPhiSuperClusterTrackAtVtx();
124 TLatex *latex =
new TLatex(
x,
y,
"");
125 const double textsize(0.05);
126 latex->SetTextSize(2 * textsize);
129 y -= latex->GetTextSize() * 0.6;
131 latex->SetTextSize(textsize);
132 float lineH = latex->GetTextSize() * 0.6;
139 latex->DrawLatex(
x,
y,
" charge = +1");
141 latex->DrawLatex(
x,
y,
" charge = -1");
144 if (
electron->superCluster().isAvailable()) {
146 latex->DrawLatex(
x,
y,
"SuperCluster vs inner state extrapolation");
148 latex->DrawLatex(
x,
y, TString::Format(
" #Delta#eta_{in} = %.3f",
electron->deltaEtaSuperClusterTrackAtVtx()));
149 latex->DrawLatex(
x2,
y, TString::Format(
"#Delta#varphi_{in} = %.3f",
electron->deltaPhiSuperClusterTrackAtVtx()));
153 latex->DrawLatex(
x,
y,
"SeedCluster vs outer state extrapolation");
156 latex->DrawLatex(
x,
y, TString::Format(
" #Delta#eta_{out} = %.3f",
electron->deltaEtaSeedClusterTrackAtCalo()));
157 latex->DrawLatex(
x2,
y, TString::Format(
" #Delta#varphi_{out} = %.3f",
electron->deltaPhiSeedClusterTrackAtCalo()));
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();
185 const double eta =
i->superCluster()->seed()->position().eta() -
i->deltaEtaSeedClusterTrackAtCalo();
186 const double phi =
i->superCluster()->seed()->position().phi() -
i->deltaPhiSeedClusterTrackAtCalo();
188 TEveStraightLineSet *trackpositionAtCalo =
new TEveStraightLineSet(
"sc trackpositionAtCalo");
189 trackpositionAtCalo->SetPickable(kTRUE);
190 trackpositionAtCalo->SetTitle(
"Track position at Calo propagating from the outermost state");
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");
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;
258 double eta =
i->superCluster()->seed()->position().eta() -
i->deltaEtaSeedClusterTrackAtCalo();
259 double phi =
i->superCluster()->seed()->position().phi() -
i->deltaPhiSeedClusterTrackAtCalo();
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");
295 x =
i->caloPosition().eta();
296 y =
i->caloPosition().phi();
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);
315 x =
i->superCluster()->seed()->position().eta();
316 y =
i->superCluster()->seed()->position().phi();
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");
331 if (fabs(
i->phi() -
i->caloPosition().phi()) < 25 * 0.0172 &&
332 fabs(
i->eta() -
i->caloPosition().eta()) < 25 * 0.0172) {
333 TEveStraightLineSet *eldirection =
new TEveStraightLineSet(
"seed position");
334 eldirection->SetTitle(
"Electron direction at vertex");
335 eldirection->SetPickable(kTRUE);
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");