11 #include "TEveStraightLineSet.h"
12 #include "TEvePointSet.h"
13 #include "TEveScene.h"
14 #include "TEveViewer.h"
15 #include "TGLViewer.h"
17 #include "TEveCaloLegoOverlay.h"
18 #include "TRootEmbeddedCanvas.h"
59 std::vector<DetId> ids;
71 TEveCaloLegoOverlay*
overlay =
new TEveCaloLegoOverlay();
72 overlay->SetShowPlane(kFALSE);
73 overlay->SetShowPerspective(kFALSE);
74 overlay->SetCaloLego(lego);
75 overlay->SetShowScales(
false);
76 viewerGL()->AddOverlayElement(overlay);
79 viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
83 viewerGL()->ResetCamerasAfterNextUpdate();
95 TLatex* latex =
new TLatex(x0, y0,
"");
96 const double textsize(0.05);
97 latex->SetTextSize(2 * textsize);
101 float fontsize = latex->GetTextSize() * 0.6;
103 latex->DrawLatex(x, y,
id.
item()->modelName(
id.
index()).c_str());
105 latex->SetTextSize(textsize);
106 fontsize = latex->GetTextSize() * 0.6;
109 x, y, Form(
" p_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f", muon->
pt(), muon->
eta(), muon->
phi()));
113 latex->DrawLatex(x, y,
" charge = +1");
115 latex->DrawLatex(x, y,
" charge = -1");
120 latex->DrawLatex(x, y,
"ECAL energy in:");
122 latex->DrawLatex(x, y, Form(
" crossed crystalls = %.3f", muon->
calEnergy().
em));
124 latex->DrawLatex(x, y, Form(
" 3x3 crystall shape = %.3f", muon->
calEnergy().
emS9));
126 latex->DrawLatex(x, y, Form(
" 5x5 crystall shape = %.3f", muon->
calEnergy().
emS25));
139 Double_t
delta(0.01);
140 TEveStraightLineSet* direction =
new TEveStraightLineSet(
"Direction at vertex");
141 direction->SetPickable(kTRUE);
142 direction->SetTitle(
"Muon direction at vertex");
143 direction->SetPickable(kTRUE);
151 direction->AddLine(
x - delta, y - delta, 0,
x + delta, y + delta, 0);
152 direction->AddLine(
x - delta, y + delta, 0,
x + delta, y - delta, 0);
153 direction->SetLineColor(kYellow);
154 direction->SetDepthTest(kFALSE);
155 tList->AddElement(direction);
161 TEveStraightLineSet* ecalposition =
new TEveStraightLineSet(
"ecal position");
162 ecalposition->SetPickable(kTRUE);
163 ecalposition->SetTitle(
"Muon position at ECAL surface");
171 ecalposition->AddLine(
x - delta, y, 0,
x + delta, y, 0);
172 ecalposition->AddLine(
x, y - delta, 0,
x, y + delta, 0);
173 ecalposition->AddLine(
x, y, 0 - delta,
x, y, 0 + delta);
174 ecalposition->SetLineColor(kRed);
175 ecalposition->SetLineWidth(2);
176 ecalposition->SetDepthTest(kFALSE);
177 tList->AddElement(ecalposition);
180 TEveStraightLineSet* hcalposition =
new TEveStraightLineSet(
"hcal position");
181 hcalposition->SetPickable(kTRUE);
182 hcalposition->SetTitle(
"Muon position at HCAL surface");
190 hcalposition->AddLine(
x - delta, y, 0,
x + delta, y, 0);
191 hcalposition->AddLine(
x, y - delta, 0,
x, y + delta, 0);
192 hcalposition->AddLine(
x, y, 0 - delta,
x, y, 0 + delta);
193 hcalposition->SetLineColor(kBlue);
194 hcalposition->SetLineWidth(2);
195 hcalposition->SetDepthTest(kFALSE);
196 tList->AddElement(hcalposition);
199 TEveStraightLineSet*
lines =
new TEveStraightLineSet(
"Muon trajectory in ECAL",
"Muon trajectory in ECAL");
200 lines->SetPickable(kTRUE);
216 lines->SetLineColor(kRed);
217 lines->SetDepthTest(kFALSE);
218 tList->AddElement(lines);
TGLViewer * viewerGL() const
double pt() const final
transverse momentum
double makeLegend(double x0=0.02, double y0=0.95, Color_t clustered1=kGreen+1, Color_t clustered2=kTeal, Color_t supercluster=kYellow)
Sin< T >::type sin(const T &t)
const FWEventItem * item()
float emS9
energy deposited in 3x3 ECAL crystal shape around central crystal
~FWMuonDetailView() override
#define REGISTER_FWDETAILVIEW(_classname_, _name_,...)
void setTextInfo(const FWModelId &, const reco::Muon *) override
double theta() const final
momentum polar angle
float emS25
energy deposited in 5x5 ECAL crystal shape around central crystal
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
void addSceneInfo(const reco::Muon *i, TEveElementList *tList)
FWECALDetailViewBuilder * m_builder
math::XYZPointF hcal_position
bool isEnergyValid() const
MuonEnergy calEnergy() const
get energy deposition information
void build(const FWModelId &id, const reco::Muon *) override
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
void setColor(Color_t color, const std::vector< DetId > &detIds)
DetId ecal_id
DetId of the central ECAL crystal.
double phi() const final
momentum azimuthal angle
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
int charge() const final
electric charge
double eta() const final
momentum pseudorapidity