Demo showing H -> ZZ -> 4 mu generated by Pythia.
Requires libPythia6.
#ifndef __RUN_PYTHIA_DISPLAY__
void pythia_display()
{
gROOT->LoadMacro(dir +
"MultiView.C+");
#ifndef R__WIN32
{
Error(
"pythia_display()",
"Could not load 'libPythia6', make sure it is available!");
return;
}
#endif
gROOT->ProcessLine(
"#define __RUN_PYTHIA_DISPLAY__ 1");
gROOT->ProcessLine(
"#include \"pythia_display.C\"");
gROOT->ProcessLine(
"run_pythia_display()");
gROOT->ProcessLine(
"#undef __RUN_PYTHIA_DISPLAY__");
}
#else
#include "TPythia6.h"
#include "TMCParticle.h"
TPythia6 *g_pythia = 0;
class MultiView;
MultiView* gMultiView = 0;
void pythia_next_event();
void pythia_make_gui();
void run_pythia_display()
{
if (g_pythia != 0)
{
Warning(
"pythia_display()",
"Already initialized.");
return;
}
g_pythia = new TPythia6;
TPythia6& P = * g_pythia;
P.SetMSEL(0);
P.SetMSUB(102, 1);
P.SetPMAS(6, 1, 175);
P.SetPMAS(25, 1, 180);
P.SetCKIN(1, 170.0);
P.SetCKIN(2, 190.0);
P.SetMSTP(61, 0);
P.SetMSTP(71, 0);
P.SetMSTP(81, 0);
P.SetMSTP(111, 0);
for (
Int_t i = 210; i <= 288; ++i)
P.SetMDME(i, 1, 0);
P.SetMDME(225, 1, 1);
for (
Int_t i = 174; i <= 189; ++i)
P.SetMDME(i, 1, 0);
P.SetMDME(184, 1, 1);
P.Initialize("cms", "p", "p", 14000);
b->SetMainTransparency(80);
b->SetMainTransparency(80);
gMultiView = new MultiView;
gMultiView->ImportGeomRPhi(fake_geom);
gMultiView->ImportGeomRhoZ(fake_geom);
pythia_make_gui();
pythia_next_event();
}
void pythia_next_event()
{
TPythia6& P = * g_pythia;
P.GenerateEvent();
int nh = P.GetMSTU(72);
for (
Int_t i = 0; i < 7; ++i)
{
TMCParticle&
p = (TMCParticle&)*MC[nh+i];
p.GetFirstChild()-nh-1,
p.GetLastChild()-nh-1,
p.GetPx(),
p.GetPy(),
p.GetPz(),
p.GetEnergy(),
p.GetVx(),
p.GetVy(),
p.GetVz(),
p.GetTime());
if (i == 0)
else if (i <= 2)
}
gMultiView->DestroyEventRPhi();
gMultiView->ImportEventRPhi(top);
gMultiView->DestroyEventRhoZ();
gMultiView->ImportEventRhoZ(top);
}
class EvNavHandler
{
public:
void Fwd()
{
pythia_next_event();
}
void Bck()
{}
};
void pythia_make_gui()
{
{
EvNavHandler *fh = new EvNavHandler;
b->SetToolTipText(
"Go to previous event - not supported.");
b->Connect(
"Clicked()",
"EvNavHandler", fh,
"Bck()");
b->SetToolTipText(
"Generate new event.");
b->Connect(
"Clicked()",
"EvNavHandler", fh,
"Fwd()");
}
}
#endif
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
R__EXTERN TEveManager * gEve
winID h TVirtualViewer3D TVirtualGLPainter p
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
An array of clone (identical) objects.
Specialization of TRootBrowser for Eve.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
virtual void AddElement(TEveElement *el)
Add el to the list of children.
virtual void DestroyElements()
Destroy all children of this element.
Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TG...
void SetLineColor(Color_t col) override
Set the line color.
void AddElement(TEveElement *element, TEveElement *parent=nullptr)
Add an element.
void AddGlobalElement(TEveElement *element, TEveElement *parent=nullptr)
Add a global element, i.e.
TEveBrowser * GetBrowser() const
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
TEveEventManager * GetCurrentEvent() const
A list of tracks supporting change of common attributes and selection based on track parameters.
void SetMarkerStyle(Style_t s) override
Set marker style for the list and the elements.
void SetMarkerColor(Color_t c) override
Set marker color for the list and the elements.
void SetMainColor(Color_t c) override
Set main (line) color for the list and the elements.
void SetMarkerSize(Size_t s) override
Set marker size for the list and the elements.
void MakeTracks(Bool_t recurse=kTRUE)
Regenerate the visual representations of tracks.
TEveTrackPropagator * GetPropagator()
Holding structure for a number of track rendering parameters.
void SetMaxR(Double_t x)
Set maximum radius and rebuild tracks.
void SetMaxZ(Double_t x)
Set maximum z and rebuild tracks.
void SetMagField(Double_t bX, Double_t bY, Double_t bZ)
Set constant magnetic field and rebuild tracks.
Visual representation of a track.
void SetAttLineAttMarker(TEveTrackList *tl)
Set line and marker attributes from TEveTrackList.
virtual void SetStdTitle()
Set standard track title based on most data-member values.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
void MapWindow() override
map window
A composite frame that layout their children in horizontal way.
Defines top level windows that interact with the system Window Manager.
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
virtual Bool_t SetTab(Int_t tabIndex, Bool_t emit=kTRUE)
Brings the composite frame with the index tabIndex to the front and generate the following event if t...
Description of the dynamic properties of a particle.
virtual void SetName(const char *name)
Change (i.e.
void StartEmbedding(Int_t pos=kRight, Int_t subpos=-1) override
Start embedding external frame in the tab "pos" and tab element "subpos".
void SetTabTitle(const char *title, Int_t pos=kRight, Int_t subpos=-1)
Set text "title" of Tab "subpos" in TGTab "pos".
void StopEmbedding(const char *name=nullptr) override
TGTab * GetTabRight() const
TString & ReplaceAll(const TString &s1, const TString &s2)
virtual const char * Getenv(const char *env)
Get environment variable.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.