ROOT
Version master
v6.36
v6.34
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
▼
Functional Parts
►
Core ROOT classes
►
std Extension classes
►
Parallelized classes
►
The Geometry Package
►
Graphics
►
Event display with ROOT7
►
GUI
►
Web Widgets
►
Web Display
►
Histogram Library
►
Input/Output Library
►
Math
►
N-D parametric functions
►
VecOps
►
Monte Carlo
►
HTTP server
►
PROOF
►
TMVA
►
RooFit
►
Dataframe
►
RNTuple-related classes
►
ROOT7 classes
►
Tree Library
►
TreePlayer Library
▼
Tutorials
►
Data analysis tutorials
►
Event generation tutorials
►
Experimental API tutorials
►
Geometry tutorials
►
Histograms tutorials
►
HTTP tutorials
►
IO tutorials
►
Machine Learning tutorials
►
Math tutorials
►
RooFit packages tutorials
▼
Visualisation tutorials
▼
Event display tutorials
alice_esd.C
alice_esd_html_summary.C
alice_esd_split.C
alice_vsd.C
annotation.C
arrow.C
arrow_standalone.C
assembly.C
box.C
boxset.C
boxset_cones.C
calo_detail.C
calorimeters.C
camera_restore.C
compound.C
csgdemo.C
geom_alias.C
geom_alice_its.C
geom_alice_tpc.C
geom_atlas.C
geom_atlas_playback.C
geom_cms.C
geom_cms_playback.C
geom_cms_stereo.C
geom_default.C
geom_lhcb.C
glplot.C
glplot_geom.C
hierarchical_scene.C
histobrowser.C
jetcone.C
lineset.C
MultiView.C
overlay_palette.C
pack.C
paramlist.C
pointset.C
projection.C
projection_prescale.C
quadset.C
run_alice_esd.C
run_alice_esd_split.C
selection_sigs.C
show_extract.C
SplitGLView.C
text.C
track.C
triangleset.C
view3ds.C
window_manager.C
►
Event display for ROOT 7 tutorials
►
Geometry tutorials
►
Graphs tutorials
►
Graphics tutorials
►
GUI tutorials
►
Image tutorials
►
OpenGL tutorials
►
Tutorials specific to Mac/Cocoa
►
TWebCanvas tutorials
►
Webgui tutorials
►
Legacy tutorials
demos.C
demos.py
demoshelp.C
demoshelp.py
hsimple.C
hsimple.py
rootlogoff.C
rootlogon.C
►
Python interface
►
R Interface for Statistical Computing
►
Namespaces
►
All Classes
►
Files
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
jetcone.C File Reference
Tutorials
»
Visualisation tutorials
»
Event display tutorials
Detailed Description
Demonstrates usage of
TEveJetCone
class.
const
char
*
esd_geom_file_name
=
"http://root.cern/files/alice_ESDgeometry.root"
;
TEveVector
GetTEveVector
(
Float_t
eta,
Float_t
phi);
void
geomGentleTPC
();
void
jetcone
()
{
TEveManager::Create
();
using namespace
TMath
;
TRandom
r
(0);
// -- Set Constants
Int_t
nCones
= 10;
Int_t
nTracks
= 200;
Float_t
coneRadius
= 0.4;
Float_t
length
= 300.;
// -- Define palette
auto
pal
=
new
TEveRGBAPalette
(0, 500);
// -----------------------------------------------------------------------
// -- Line sets
// -----------------------------------------------------------------------
// -- Define cone center
auto
axis =
new
TEveStraightLineSet
(
"Cone Axis"
);
axis->SetLineColor(
kGreen
);
axis->SetLineWidth(2);
auto
tracksXYZ
=
new
TEveStraightLineSet
(
"StraightLinesXYZ"
);
tracksXYZ
->SetLineColor(
kRed
);
tracksXYZ
->SetLineWidth(2);
auto
tracksEtaPhi
=
new
TEveStraightLineSet
(
"StraightLinesEtaPhi"
);
tracksEtaPhi
->SetLineColor(
kYellow
);
tracksEtaPhi
->SetLineWidth(2);
auto
tracksSeedEtaPhi
=
new
TEveStraightLineSet
(
"StraightLinesEtaPhiSeed"
);
tracksSeedEtaPhi
->SetLineColor(
kBlue
);
tracksSeedEtaPhi
->SetLineWidth(2);
// -----------------------------------------------------------------------
// -- Draw track distribution in XYZ in TPC Volume +/-250, +/-250, +/-250
// -----------------------------------------------------------------------
for
(
Int_t
track
= 0;
track
<
nTracks
;
track
++) {
Float_t
trackX
=
r
.Uniform(-250.0, 250.0);
Float_t
trackY
=
r
.Uniform(-250.0, 250.0);
Float_t
trackZ
=
r
.Uniform(-250.0, 250.0);
Float_t
trackR
= Sqrt(
trackX
*
trackX
+
trackY
*
trackY
+
trackZ
*
trackZ
);
TEveVector
trackDir
(
trackX
/
trackR
,
trackY
/
trackR
,
trackZ
/
trackR
);
TEveVector
trackEnd
=
trackDir
*
length
;
tracksXYZ
->AddLine(0., 0., 0.,
trackEnd
.fX,
trackEnd
.fY,
trackEnd
.fZ);
}
// -----------------------------------------------------------------------
// -- Draw track distribution in eta phi in TPC Volume +/-0.9, {0, 2Pi}
// -----------------------------------------------------------------------
for
(
Int_t
track
= 0;
track
<
nTracks
;
track
++) {
Float_t
trackEta
=
r
.Uniform(-0.9, 0.9);
Float_t
trackPhi
=
r
.Uniform(0.0, TwoPi());
TEveVector
trackDir
(
GetTEveVector
(
trackEta
,
trackPhi
));
TEveVector
trackEnd
=
trackDir
*
length
;
if
(
trackEta
>
coneRadius
||
trackEta
< -
coneRadius
)
tracksEtaPhi
->AddLine(0., 0., 0.,
trackEnd
.fX,
trackEnd
.fY,
trackEnd
.fZ);
else
tracksSeedEtaPhi
->AddLine(0., 0., 0.,
trackEnd
.fX,
trackEnd
.fY,
trackEnd
.fZ);
}
// -----------------------------------------------------------------------
// -- Draw cones
// -----------------------------------------------------------------------
for
(
Int_t
iter = 0; iter <
nCones
; ++iter) {
// -- Get Random ( eta ,phi )
Float_t
coneEta
=
r
.Uniform(-0.9, 0.9);
Float_t
conePhi
=
r
.Uniform(0.0,
TwoPi
());
// -- Primary vertex as origin
TEveVector
coneOrigin
(0.0, 0.0, 0.0);
// -- Get Cone Axis - axis line 10% longer than cone height
TEveVector
coneAxis
(
GetTEveVector
(
coneEta
,
conePhi
));
coneAxis
*=
length
* 1.1;
axis->AddLine(0., 0., 0.,
coneAxis
.fX,
coneAxis
.fY,
coneAxis
.fZ);
// -- Draw jet cone
auto
jetCone
=
new
TEveJetCone
(
"JetCone"
);
jetCone
->SetPickable(
kTRUE
);
jetCone
->SetCylinder(250., 250.);
if
((
jetCone
->AddCone(
coneEta
,
conePhi
,
coneRadius
)) != -1)
gEve
->
AddElement
(
jetCone
);
}
// -----------------------------------------------------------------------
// -- Add cone axis
gEve
->
AddElement
(axis);
// -- Add lines
// gEve->AddElement(tracksXYZ);
gEve
->
AddElement
(
tracksSeedEtaPhi
);
gEve
->
AddElement
(
tracksEtaPhi
);
// -- Load TPC geometry
geomGentleTPC
();
gEve
->
Redraw3D
(
kTRUE
);
return
;
}
//___________________________________________________________________________
TEveVector
GetTEveVector
(
Float_t
eta,
Float_t
phi)
{
using namespace
TMath
;
TEveVector
vec
((
Float_t
)
Cos
((
Double_t
)phi) /
CosH
((
Double_t
)eta), (
Float_t
)
Sin
((
Double_t
)phi) /
CosH
((
Double_t
)eta),
(
Float_t
)
TanH
((
Double_t
)eta));
return
vec
;
}
//__________________________________________________________________________
void
geomGentleTPC
()
{
// Simple geometry
TFile::SetCacheFileDir
(
"."
);
TFile
*
geom
=
TFile::Open
(
esd_geom_file_name
,
"CACHEREAD"
);
if
(!
geom
)
return
;
TEveGeoShapeExtract
*
gse
= (
TEveGeoShapeExtract
*)
geom
->Get(
"Gentle"
);
TEveGeoShape
*
gsre
=
TEveGeoShape::ImportShapeExtract
(
gse
, 0);
geom
->Close();
delete
geom
;
gEve
->
AddGlobalElement
(
gsre
);
TEveElement
*
elTRD
=
gsre
->FindChild(
"TRD+TOF"
);
elTRD
->SetRnrState(
kFALSE
);
TEveElement
*
elPHOS
=
gsre
->FindChild(
"PHOS"
);
elPHOS
->SetRnrState(
kFALSE
);
TEveElement
*
elHMPID
=
gsre
->FindChild(
"HMPID"
);
elHMPID
->SetRnrState(
kFALSE
);
}
Int_t
int Int_t
Definition
RtypesCore.h:45
Float_t
float Float_t
Definition
RtypesCore.h:57
kFALSE
constexpr Bool_t kFALSE
Definition
RtypesCore.h:94
Double_t
double Double_t
Definition
RtypesCore.h:59
kTRUE
constexpr Bool_t kTRUE
Definition
RtypesCore.h:93
kRed
@ kRed
Definition
Rtypes.h:66
kGreen
@ kGreen
Definition
Rtypes.h:66
kBlue
@ kBlue
Definition
Rtypes.h:66
kYellow
@ kYellow
Definition
Rtypes.h:66
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
gEve
R__EXTERN TEveManager * gEve
Definition
TEveManager.h:243
r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Definition
TGWin32VirtualXProxy.cxx:168
length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Definition
TGWin32VirtualXProxy.cxx:245
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TEveElement
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition
TEveElement.h:36
TEveGeoShapeExtract
Globally positioned TGeoShape with rendering attributes and an optional list of daughter shape-extrac...
Definition
TEveGeoShapeExtract.h:21
TEveGeoShape
Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TG...
Definition
TEveGeoShape.h:24
TEveGeoShape::ImportShapeExtract
static TEveGeoShape * ImportShapeExtract(TEveGeoShapeExtract *gse, TEveElement *parent=nullptr)
Import a shape extract 'gse' under element 'parent'.
Definition
TEveGeoShape.cxx:367
TEveJetCone
Draws a jet cone with leading particle is specified in (eta,phi) and cone radius is given.
Definition
TEveJetCone.h:24
TEveManager::AddElement
void AddElement(TEveElement *element, TEveElement *parent=nullptr)
Add an element.
Definition
TEveManager.cxx:527
TEveManager::AddGlobalElement
void AddGlobalElement(TEveElement *element, TEveElement *parent=nullptr)
Add a global element, i.e.
Definition
TEveManager.cxx:543
TEveManager::Create
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
Definition
TEveManager.cxx:887
TEveManager::Redraw3D
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Definition
TEveManager.h:168
TEveRGBAPalette
A generic, speed-optimised mapping from value to RGBA color supporting different wrapping and range t...
Definition
TEveRGBAPalette.h:25
TEveStraightLineSet
Set of straight lines with optional markers along the lines.
Definition
TEveStraightLineSet.h:39
TEveVectorT< Float_t >
TFile
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition
TFile.h:131
TFile::Open
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Definition
TFile.cxx:4131
TFile::SetCacheFileDir
static Bool_t SetCacheFileDir(std::string_view cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
Sets the directory where to locally stage/cache remote files.
Definition
TFile.cxx:4674
TRandom
This is the base class for the ROOT Random number generators.
Definition
TRandom.h:27
TMath
TMath.
Definition
TMathBase.h:35
TMath::CosH
Double_t CosH(Double_t)
Returns the hyperbolic cosine of x.
Definition
TMath.h:616
TMath::TanH
Double_t TanH(Double_t)
Returns the hyperbolic tangent of x.
Definition
TMath.h:622
TMath::Cos
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition
TMath.h:598
TMath::Sin
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition
TMath.h:592
TMath::TwoPi
constexpr Double_t TwoPi()
Definition
TMath.h:44
vec
Definition
civetweb.c:1855
Author
Jochen Thaeder
Definition in file
jetcone.C
.
tutorials
visualisation
eve
jetcone.C
ROOT master - Reference Guide Generated on Tue Apr 22 2025 16:25:07 (GVA Time) using Doxygen 1.10.0