12 #include "TEveStraightLineSet.h"
13 #include "TEvePointSet.h"
14 #include "TEveScene.h"
15 #include "TEveViewer.h"
16 #include "TGLViewer.h"
18 #include "TEveCaloLegoOverlay.h"
19 #include "TRootEmbeddedCanvas.h"
41 m_eveViewer->GetGLViewer()->DeleteOverlayElements(TGLOverlayElement::kUser);
66 std::vector<DetId> ids;
78 TEveCaloLegoOverlay* overlay =
new TEveCaloLegoOverlay();
79 overlay->SetShowPlane(kFALSE);
80 overlay->SetShowPerspective(kFALSE);
81 overlay->SetCaloLego(lego);
82 overlay->SetShowScales(0);
83 viewerGL()->AddOverlayElement(overlay);
86 viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
91 viewerGL()->ResetCamerasAfterNextUpdate();
105 TLatex* latex =
new TLatex(x0, y0,
"");
106 const double textsize(0.05);
107 latex->SetTextSize(2*textsize);
111 float fontsize = latex->GetTextSize()*0.6;
113 latex->DrawLatex(x, y,
id.
item()->modelName(
id.
index()).c_str() );
115 latex->SetTextSize(textsize);
116 fontsize = latex->GetTextSize()*0.6;
118 latex->DrawLatex(x, y, Form(
" p_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f",
119 muon->
pt(), muon->
eta(), muon->
phi()) );
123 latex->DrawLatex(x, y,
" charge = +1");
125 latex->DrawLatex(x, y,
" charge = -1");
131 latex->DrawLatex(x, y,
"ECAL energy in:");
133 latex->DrawLatex(x, y, Form(
" crossed crystalls = %.3f",
136 latex->DrawLatex(x, y, Form(
" 3x3 crystall shape = %.3f",
139 latex->DrawLatex(x, y, Form(
" 5x5 crystall shape = %.3f",
154 Double_t
delta(0.01);
155 TEveStraightLineSet *direction =
new TEveStraightLineSet(
"Direction at vertex");
156 direction->SetPickable(kTRUE);
157 direction->SetTitle(
"Muon direction at vertex");
158 direction->SetPickable(kTRUE);
166 direction->AddLine(
x-delta,y-delta,0,
x+delta,y+delta,0);
167 direction->AddLine(
x-delta,y+delta,0,
x+delta,y-delta,0);
168 direction->SetLineColor(kYellow);
169 direction->SetDepthTest(kFALSE);
170 tList->AddElement(direction);
175 TEveStraightLineSet *ecalposition =
new TEveStraightLineSet(
"ecal position");
176 ecalposition->SetPickable(kTRUE);
177 ecalposition->SetTitle(
"Muon position at ECAL surface");
185 ecalposition->AddLine(
x-delta,y,0,
x+delta,y,0);
186 ecalposition->AddLine(
x,y-delta,0,
x,y+delta,0);
187 ecalposition->AddLine(
x,y,0-delta,
x,y,0+delta);
188 ecalposition->SetLineColor(kRed);
189 ecalposition->SetLineWidth(2);
190 ecalposition->SetDepthTest(kFALSE);
191 tList->AddElement(ecalposition);
194 TEveStraightLineSet *hcalposition =
new TEveStraightLineSet(
"hcal position");
195 hcalposition->SetPickable(kTRUE);
196 hcalposition->SetTitle(
"Muon position at HCAL surface");
204 hcalposition->AddLine(
x-delta,y,0,
x+delta,y,0);
205 hcalposition->AddLine(
x,y-delta,0,
x,y+delta,0);
206 hcalposition->AddLine(
x,y,0-delta,
x,y,0+delta);
207 hcalposition->SetLineColor(kBlue);
208 hcalposition->SetLineWidth(2);
209 hcalposition->SetDepthTest(kFALSE);
210 tList->AddElement(hcalposition);
213 TEveStraightLineSet *
lines =
new TEveStraightLineSet(
"Muon trajectory in ECAL",
"Muon trajectory in ECAL");
214 lines->SetPickable(kTRUE);
230 lines->SetLineColor(kRed);
231 lines->SetDepthTest(kFALSE);
232 tList->AddElement(lines);
virtual void build(const FWModelId &id, const reco::Muon *)
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)
Sin< T >::type sin(const T &t)
const FWEventItem * item()
float emS9
energy deposited in 3x3 ECAL crystal shape around central crystal
virtual double theta() const GCC11_FINAL
momentum polar angle
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
float emS25
energy deposited in 5x5 ECAL crystal shape around central crystal
virtual ~FWMuonDetailView()
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
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
MuonEnergy calEnergy() const
get energy deposition information
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
virtual int charge() const GCC11_FINAL
electric charge
virtual void setTextInfo(const FWModelId &, const reco::Muon *)
void setColor(Color_t color, const std::vector< DetId > &detIds)
DetId ecal_id
DetId of the central ECAL crystal.
#define REGISTER_FWDETAILVIEW(_classname_, _name_)
virtual float pt() const GCC11_FINAL
transverse momentum
math::XYZPointF ecal_position
Trajectory position at the calorimeter.