ROOT
v6-32
Reference Guide
Loading...
Searching...
No Matches
tracks.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_eve7
3
/// This example display only points in web browser
4
///
5
/// \macro_code
6
///
7
8
#include "
TRandom.h
"
9
#include "
TParticle.h
"
10
#include <
ROOT/REveElement.hxx
>
11
#include <
ROOT/REveScene.hxx
>
12
#include <
ROOT/REveManager.hxx
>
13
#include <
ROOT/REveTrack.hxx
>
14
#include <
ROOT/REveTrackPropagator.hxx
>
15
16
namespace
REX
=
ROOT::Experimental
;
17
18
void
makeTracks
(
int
N_Tracks
,
REX::REveElement
*
trackHolder
)
19
{
20
TRandom
&
r
= *
gRandom
;
21
auto
prop
=
new
REX::REveTrackPropagator
();
22
prop
->SetMagFieldObj(
new
REX::REveMagFieldDuo
(350, 3.5, -2.0));
23
prop
->SetMaxR(300);
24
prop
->SetMaxZ(600);
25
prop
->SetMaxOrbs(6);
26
// Default is kHelix propagator.
27
// prop->SetStepper(REX::REveTrackPropagator::kRungeKutta);
28
29
double
v
= 0.5;
30
double
m
= 5;
31
32
for
(
int
i = 0; i <
N_Tracks
; i++)
33
{
34
auto
p
=
new
TParticle
();
35
36
int
pdg
= 11 * (
r
.Integer(2) > 0 ? 1 : -1);
37
p
->SetPdgCode(
pdg
);
38
39
p
->SetProductionVertex(
r
.Uniform(-
v
,
v
),
r
.Uniform(-
v
,
v
),
r
.Uniform(-
v
,
v
), 1);
40
p
->SetMomentum(
r
.Uniform(-
m
,
m
),
r
.Uniform(-
m
,
m
),
r
.Uniform(-
m
,
m
)*
r
.Uniform(1, 3), 1);
41
auto
track
=
new
REX::REveTrack
(
p
, 1,
prop
);
42
track
->MakeTrack();
43
track
->SetMainColor(
kBlue
);
44
track
->SetName(
Form
(
"RandomTrack_%d"
, i));
45
trackHolder
->AddElement(
track
);
46
}
47
}
48
49
void
tracks
()
50
{
51
auto
eveMng
= REX::REveManager::Create();
52
53
auto
trackHolder
=
new
REX::REveElement
(
"Tracks"
);
54
eveMng
->
GetEventScene
()->
AddElement
(
trackHolder
);
55
makeTracks
(100,
trackHolder
);
56
57
eveMng
->
Show
();
58
}
REveElement.hxx
REveManager.hxx
REveScene.hxx
REveTrackPropagator.hxx
REveTrack.hxx
kBlue
@ kBlue
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
p
winID h TVirtualViewer3D TVirtualGLPainter p
Definition
TGWin32VirtualGLProxy.cxx:51
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
prop
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 prop
Definition
TGWin32VirtualXProxy.cxx:245
TParticle.h
TRandom.h
gRandom
R__EXTERN TRandom * gRandom
Definition
TRandom.h:62
Form
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition
TString.cxx:2489
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
ROOT::Experimental::REveElement
Definition
REveElement.hxx:45
ROOT::Experimental::REveElement::AddElement
virtual void AddElement(REveElement *el)
Add el to the list of children.
Definition
REveElement.cxx:848
ROOT::Experimental::REveMagFieldDuo
REveMagFieldDuo Interface to magnetic field with two different values depending on radius.
Definition
REveTrackPropagator.hxx:80
ROOT::Experimental::REveManager::GetEventScene
REveScene * GetEventScene() const
Definition
REveManager.hxx:184
ROOT::Experimental::REveManager::Show
void Show(const RWebDisplayArgs &args="")
Show eve manager in specified browser.
Definition
REveManager.cxx:1150
ROOT::Experimental::REveTrackPropagator
REveTrackPropagator Calculates path of a particle taking into account special path-marks and imposed ...
Definition
REveTrackPropagator.hxx:113
ROOT::Experimental::REveTrack
REveTrack Track with given vertex, momentum and optional referece-points (path-marks) along its path.
Definition
REveTrack.hxx:40
TParticle
Description of the dynamic properties of a particle.
Definition
TParticle.h:26
TRandom
This is the base class for the ROOT Random number generators.
Definition
TRandom.h:27
eveMng
ROOT::Experimental::REveManager * eveMng
Definition
collection_proxies.C:59
ROOT::Experimental
Definition
RDirectory.hxx:30
v
@ v
Definition
rootcling_impl.cxx:3687
m
TMarker m
Definition
textangle.C:8
makeTracks
void makeTracks(int N_Tracks, REX::REveElement *trackHolder)
Definition
tracks.C:18
tracks
void tracks()
Definition
tracks.C:49
tutorials
eve7
tracks.C
ROOT v6-32 - Reference Guide Generated on Sat Jan 25 2025 04:12:15 (GVA Time) using Doxygen 1.10.0