211 if (!strcmp(option,
"") || !strcmp(option,
"Final")) {
212 for (
Int_t i = 0; i<numpart; i++) {
213 if (
HEPEVT.isthep[i] == 1) {
235 }
else if (!strcmp(option,
"All")) {
236 for (
Int_t i = 0; i<numpart; i++) {
274 if (particles == 0)
return 0;
276 clonesParticles.
Clear();
278 if (!strcmp(option,
"") || !strcmp(option,
"Final")) {
279 for (
Int_t i = 0; i<numpart; i++) {
280 if (
HEPEVT.isthep[i] == 1) {
301 }
else if (!strcmp(option,
"All")) {
302 for (
Int_t i = 0; i<numpart; i++) {
338 const Int_t big = 9999;
339 const Int_t inview = 0;
341 if (px > 50 && py > 50) dist = inview;
354 gROOT->MakeDefCanvas();
355 if (
gPad->GetVirtCanvas())
356 gPad->GetVirtCanvas()->SetFillColor(13);
362 if (!strstr(option,
"same")) {
363 if (view) { view->
GetRange(rmin,rmax); rbox = rmax[2];}
369 view =
gPad->GetView();
378 const Int_t kColorProton = 4;
379 const Int_t kColorNeutron = 5;
380 const Int_t kColorAntiProton= 3;
381 const Int_t kColorPionPlus = 6;
382 const Int_t kColorPionMinus = 2;
383 const Int_t kColorKaons = 7;
384 const Int_t kColorElectrons = 0;
385 const Int_t kColorGamma = 18;
389 Int_t nAntiProtons= 0;
391 Int_t nPionMinus = 0;
393 Int_t nElectrons = 0;
397 Int_t i,lwidth,color,lstyle;
403 for (i=0;i<ntracks;i++) {
416 if (lwidth < 1) lwidth = 1;
421 color = kColorNeutron; nNeutrons++;}
422 if (!strcmp(
name,
"p")) { color = kColorProton; nProtons++;}
423 if (!strcmp(
name,
"p bar")) { color = kColorAntiProton; nAntiProtons++;}
424 if (!strcmp(
name,
"pi+")) { color = kColorPionPlus; nPionPlus++;}
425 if (!strcmp(
name,
"pi-")) { color = kColorPionMinus; nPionMinus++;}
426 if (!strcmp(
name,
"e+")) { color = kColorElectrons; nElectrons++;}
427 if (!strcmp(
name,
"e-")) { color = kColorElectrons; nElectrons++;}
428 if (!strcmp(
name,
"gamma")) { color = kColorGamma; nGammas++; lstyle = 3; }
429 if ( strstr(
name,
"K")) { color = kColorKaons; nKaons++;}
441 pt->SetFillColor(42);
446 if (
gPad->GetFillColor() == 10) tcolor = 4;
448 text->SetTextAlign(12);
449 text->SetTextSize(0.025);
450 text->SetTextColor(tcolor);
452 text->SetTextColor(kColorGamma);
text->DrawText(-0.95,-0.52,
"(on screen)");
453 text->SetTextColor(kColorGamma);
text->DrawText(-0.95,-0.57,
"Gamma");
454 text->SetTextColor(kColorProton);
text->DrawText(-0.95,-0.62,
"Proton");
455 text->SetTextColor(kColorNeutron);
text->DrawText(-0.95,-0.67,
"Neutron");
456 text->SetTextColor(kColorAntiProton);
text->DrawText(-0.95,-0.72,
"AntiProton");
457 text->SetTextColor(kColorPionPlus);
text->DrawText(-0.95,-0.77,
"Pion +");
458 text->SetTextColor(kColorPionMinus);
text->DrawText(-0.95,-0.82,
"Pion -");
459 text->SetTextColor(kColorKaons);
text->DrawText(-0.95,-0.87,
"Kaons");
460 text->SetTextColor(kColorElectrons);
text->DrawText(-0.95,-0.92,
"Electrons,etc.");
462 text->SetTextColor(tcolor);
463 text->SetTextAlign(32);
465 snprintf(tcount,12,
"%d",ntracks);
text->DrawText(-0.55,-0.47,tcount);
466 snprintf(tcount,12,
"%d",ninvol);
text->DrawText(-0.55,-0.52,tcount);
467 snprintf(tcount,12,
"%d",nGammas);
text->DrawText(-0.55,-0.57,tcount);
468 snprintf(tcount,12,
"%d",nProtons);
text->DrawText(-0.55,-0.62,tcount);
469 snprintf(tcount,12,
"%d",nNeutrons);
text->DrawText(-0.55,-0.67,tcount);
470 snprintf(tcount,12,
"%d",nAntiProtons);
text->DrawText(-0.55,-0.72,tcount);
471 snprintf(tcount,12,
"%d",nPionPlus);
text->DrawText(-0.55,-0.77,tcount);
472 snprintf(tcount,12,
"%d",nPionMinus);
text->DrawText(-0.55,-0.82,tcount);
473 snprintf(tcount,12,
"%d",nKaons);
text->DrawText(-0.55,-0.87,tcount);
474 snprintf(tcount,12,
"%d",nElectrons);
text->DrawText(-0.55,-0.92,tcount);
476 text->SetTextAlign(12);
477 if (nPionPlus+nPionMinus) {
480 strlcpy(tcount,
"Protons/Pions= inf",31);
482 text->DrawText(-0.45,-0.92,tcount);
484 if (nPionPlus+nPionMinus) {
487 strlcpy(tcount,
"Kaons/Pions= inf",31);
489 text->DrawText(0.30,-0.92,tcount);
499 if (
gPad->GetView()) {
500 gPad->GetView()->ExecuteRotateView(event, px, py);
521 if (i < 0 || i >
n)
return 0;
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
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
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
!display neutrons if true
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.
Float_t fPtCut
!Pt cut. Do not show primaries below
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.
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.