236 }
else if (!strcmp(
option,
"All")) {
275 if (particles == 0)
return 0;
277 clonesParticles.
Clear();
302 }
else if (!strcmp(
option,
"All")) {
339 const Int_t big = 9999;
340 const Int_t inview = 0;
342 if (px > 50 &&
py > 50) dist = inview;
355 gROOT->MakeDefCanvas();
356 if (
gPad->GetVirtCanvas())
357 gPad->GetVirtCanvas()->SetFillColor(13);
363 if (!strstr(
option,
"same")) {
370 view =
gPad->GetView();
379 const Int_t kColorProton = 4;
380 const Int_t kColorNeutron = 5;
381 const Int_t kColorAntiProton= 3;
382 const Int_t kColorPionPlus = 6;
383 const Int_t kColorPionMinus = 2;
384 const Int_t kColorKaons = 7;
385 const Int_t kColorElectrons = 0;
386 const Int_t kColorGamma = 18;
390 Int_t nAntiProtons= 0;
392 Int_t nPionMinus = 0;
394 Int_t nElectrons = 0;
398 Int_t i,lwidth,color,lstyle;
404 for (
i=0;
i<ntracks;
i++) {
411 if (vx*vx+vy*vy+vz*vz >
rbox*
rbox)
continue;
417 if (lwidth < 1) lwidth = 1;
422 color = kColorNeutron; nNeutrons++;}
423 if (!strcmp(
name,
"p")) { color = kColorProton; nProtons++;}
424 if (!strcmp(
name,
"p bar")) { color = kColorAntiProton; nAntiProtons++;}
425 if (!strcmp(
name,
"pi+")) { color = kColorPionPlus; nPionPlus++;}
426 if (!strcmp(
name,
"pi-")) { color = kColorPionMinus; nPionMinus++;}
427 if (!strcmp(
name,
"e+")) { color = kColorElectrons; nElectrons++;}
428 if (!strcmp(
name,
"e-")) { color = kColorElectrons; nElectrons++;}
429 if (!strcmp(
name,
"gamma")) { color = kColorGamma; nGammas++; lstyle = 3; }
430 if ( strstr(
name,
"K")) { color = kColorKaons; nKaons++;}
442 pt->SetFillColor(42);
447 if (
gPad->GetFillColor() == 10) tcolor = 4;
449 text->SetTextAlign(12);
450 text->SetTextSize(0.025);
451 text->SetTextColor(tcolor);
453 text->SetTextColor(kColorGamma);
text->DrawText(-0.95,-0.52,
"(on screen)");
454 text->SetTextColor(kColorGamma);
text->DrawText(-0.95,-0.57,
"Gamma");
455 text->SetTextColor(kColorProton);
text->DrawText(-0.95,-0.62,
"Proton");
456 text->SetTextColor(kColorNeutron);
text->DrawText(-0.95,-0.67,
"Neutron");
457 text->SetTextColor(kColorAntiProton);
text->DrawText(-0.95,-0.72,
"AntiProton");
458 text->SetTextColor(kColorPionPlus);
text->DrawText(-0.95,-0.77,
"Pion +");
459 text->SetTextColor(kColorPionMinus);
text->DrawText(-0.95,-0.82,
"Pion -");
460 text->SetTextColor(kColorKaons);
text->DrawText(-0.95,-0.87,
"Kaons");
461 text->SetTextColor(kColorElectrons);
text->DrawText(-0.95,-0.92,
"Electrons,etc.");
463 text->SetTextColor(tcolor);
464 text->SetTextAlign(32);
466 snprintf(tcount,12,
"%d",ntracks);
text->DrawText(-0.55,-0.47,tcount);
467 snprintf(tcount,12,
"%d",ninvol);
text->DrawText(-0.55,-0.52,tcount);
468 snprintf(tcount,12,
"%d",nGammas);
text->DrawText(-0.55,-0.57,tcount);
469 snprintf(tcount,12,
"%d",nProtons);
text->DrawText(-0.55,-0.62,tcount);
470 snprintf(tcount,12,
"%d",nNeutrons);
text->DrawText(-0.55,-0.67,tcount);
471 snprintf(tcount,12,
"%d",nAntiProtons);
text->DrawText(-0.55,-0.72,tcount);
472 snprintf(tcount,12,
"%d",nPionPlus);
text->DrawText(-0.55,-0.77,tcount);
473 snprintf(tcount,12,
"%d",nPionMinus);
text->DrawText(-0.55,-0.82,tcount);
474 snprintf(tcount,12,
"%d",nKaons);
text->DrawText(-0.55,-0.87,tcount);
475 snprintf(tcount,12,
"%d",nElectrons);
text->DrawText(-0.55,-0.92,tcount);
477 text->SetTextAlign(12);
478 if (nPionPlus+nPionMinus) {
481 strlcpy(tcount,
"Protons/Pions= inf",31);
483 text->DrawText(-0.45,-0.92,tcount);
485 if (nPionPlus+nPionMinus) {
488 strlcpy(tcount,
"Kaons/Pions= inf",31);
490 text->DrawText(0.30,-0.92,tcount);
500 if (
gPad->GetView()) {
501 gPad->GetView()->ExecuteRotateView(event, px,
py);
Option_t Option_t TPoint TPoint const char text
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Using a TBrowser one can browse all ROOT objects.
void Clear(Option_t *option="") override
Clear the clones array.
static TDatabasePDG * Instance()
static function
The interface to various event generators.
virtual TParticle * GetParticle(Int_t i) const
Returns pointer to primary number i;.
Int_t GetNumberOfParticles() const
Return the number of particles in the stack.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to objects in event.
virtual void SetViewRadius(Float_t rbox=1000)
Set lower and upper values of the view range.
~TGenerator() override
Event generator default destructor.
virtual void GenerateEvent()
must be implemented in concrete class (see eg TPythia6)
Bool_t fShowNeutrons
Pt cut. Do not show primaries below.
virtual Int_t ImportParticles(TClonesArray *particles, Option_t *option="")
It reads the /HEPEVT/ common block which has been filled by the GenerateEvent method.
virtual void SetPtCut(Float_t ptcut=0)
Set Pt threshold below which primaries are not drawn.
TObjArray * fParticles
display neutrons if true
void Browse(TBrowser *b) override
browse generator
void Draw(Option_t *option="") override
Insert one event in the pad list.
void Paint(Option_t *option="") override
Paint one event.
virtual void ShowNeutrons(Bool_t show=1)
Set flag to display or not neutrons.
virtual void SetViewRange(Float_t xmin=-10000, Float_t ymin=-10000, Float_t zmin=-10000, Float_t xmax=10000, Float_t ymax=10000, Float_t zmax=10000)
Set lower and upper values of the view range.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
friend class TClonesArray
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Description of the static properties of a particle.
Description of the dynamic properties of a particle.
TParticlePDG * GetPDG(Int_t mode=0) const
Returns a pointer to the TParticlePDG object using the pdgcode.
A Pave (see TPave) with text, lines or/and boxes inside.
Base class for several text objects.
static TView * CreateView(Int_t system=1, const Double_t *rmin=nullptr, const Double_t *rmax=nullptr)
Create a concrete default 3-d view via the plug-in manager.
virtual void GetRange(Float_t *min, Float_t *max)=0
virtual void SetRange(const Double_t *min, const Double_t *max)=0
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.