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"
65 std::vector<DetId> ids;
77 TEveCaloLegoOverlay* overlay =
new TEveCaloLegoOverlay();
78 overlay->SetShowPlane(kFALSE);
79 overlay->SetShowPerspective(kFALSE);
80 overlay->SetCaloLego(lego);
81 overlay->SetShowScales(0);
82 viewerGL()->AddOverlayElement(overlay);
85 viewerGL()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
90 viewerGL()->ResetCamerasAfterNextUpdate();
104 TLatex* latex =
new TLatex(x0, y0,
"");
105 const double textsize(0.05);
106 latex->SetTextSize(2*textsize);
110 float fontsize = latex->GetTextSize()*0.6;
112 latex->DrawLatex(x, y,
id.
item()->modelName(
id.
index()).c_str() );
114 latex->SetTextSize(textsize);
115 fontsize = latex->GetTextSize()*0.6;
117 latex->DrawLatex(x, y, Form(
" p_{T} = %.1f GeV, #eta = %0.2f, #varphi = %0.2f",
118 muon->
pt(), muon->
eta(), muon->
phi()) );
122 latex->DrawLatex(x, y,
" charge = +1");
124 latex->DrawLatex(x, y,
" charge = -1");
130 latex->DrawLatex(x, y,
"ECAL energy in:");
132 latex->DrawLatex(x, y, Form(
" crossed crystalls = %.3f",
135 latex->DrawLatex(x, y, Form(
" 3x3 crystall shape = %.3f",
138 latex->DrawLatex(x, y, Form(
" 5x5 crystall shape = %.3f",
153 Double_t
delta(0.01);
154 TEveStraightLineSet *direction =
new TEveStraightLineSet(
"Direction at vertex");
155 direction->SetPickable(kTRUE);
156 direction->SetTitle(
"Muon direction at vertex");
157 direction->SetPickable(kTRUE);
165 direction->AddLine(
x-delta,y-delta,0,
x+delta,y+delta,0);
166 direction->AddLine(
x-delta,y+delta,0,
x+delta,y-delta,0);
167 direction->SetLineColor(kYellow);
168 direction->SetDepthTest(kFALSE);
169 tList->AddElement(direction);
174 TEveStraightLineSet *ecalposition =
new TEveStraightLineSet(
"ecal position");
175 ecalposition->SetPickable(kTRUE);
176 ecalposition->SetTitle(
"Muon position at ECAL surface");
184 ecalposition->AddLine(
x-delta,y,0,
x+delta,y,0);
185 ecalposition->AddLine(
x,y-delta,0,
x,y+delta,0);
186 ecalposition->AddLine(
x,y,0-delta,
x,y,0+delta);
187 ecalposition->SetLineColor(kRed);
188 ecalposition->SetLineWidth(2);
189 ecalposition->SetDepthTest(kFALSE);
190 tList->AddElement(ecalposition);
193 TEveStraightLineSet *hcalposition =
new TEveStraightLineSet(
"hcal position");
194 hcalposition->SetPickable(kTRUE);
195 hcalposition->SetTitle(
"Muon position at HCAL surface");
203 hcalposition->AddLine(
x-delta,y,0,
x+delta,y,0);
204 hcalposition->AddLine(
x,y-delta,0,
x,y+delta,0);
205 hcalposition->AddLine(
x,y,0-delta,
x,y,0+delta);
206 hcalposition->SetLineColor(kBlue);
207 hcalposition->SetLineWidth(2);
208 hcalposition->SetDepthTest(kFALSE);
209 tList->AddElement(hcalposition);
212 TEveStraightLineSet *
lines =
new TEveStraightLineSet(
"Muon trajectory in ECAL",
"Muon trajectory in ECAL");
213 lines->SetPickable(kTRUE);
229 lines->SetLineColor(kRed);
230 lines->SetDepthTest(kFALSE);
231 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
#define REGISTER_FWDETAILVIEW(_classname_, _name_,...)
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
float emS25
energy deposited in 5x5 ECAL crystal shape around central crystal
virtual ~FWMuonDetailView()
Cos< T >::type cos(const T &t)
tuple reducedEcalRecHitsEB
virtual int charge() const
electric charge
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 double theta() const
momentum polar angle
MuonEnergy calEnergy() const
get energy deposition information
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
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.
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
virtual double phi() const
momentum azimuthal angle