19 void gtime2(Int_t nsteps = 200, Int_t np=5000) {
20 if (np > 5000) np = 5000;
22 Double_t cosphi[5000], sinphi[5000], speed[5000];
24 Double_t xmin = 0, xmax = 10, ymin = -10, ymax = 10;
25 TGraphTime *g =
new TGraphTime(nsteps,xmin,ymin,xmax,ymax);
26 g->SetTitle(
"TGraphTime demo 2;X;Y");
28 Double_t phi,fact = xmax/Double_t(nsteps);
30 speed[i] = r.Uniform(0.5,1);
31 phi = r.Gaus(0,TMath::Pi()/6.);
32 cosphi[i] = fact*speed[i]*TMath::Cos(phi);
33 sinphi[i] = fact*speed[i]*TMath::Sin(phi);
34 Double_t rc = r.Rndm();
36 if (rc > 0.3) color[i] = kBlue;
37 if (rc > 0.7) color[i] = kYellow;
39 for (s=0;s<nsteps;s++) {
41 Double_t xx = s*cosphi[i];
42 if (xx < xmin)
continue;
43 Double_t yy = s*sinphi[i];
44 TMarker *m =
new TMarker(xx,yy,25);
45 m->SetMarkerColor(color[i]);
46 m->SetMarkerSize(1.5 -s/(speed[i]*nsteps));
49 g->Add(
new TPaveLabel(.70,.92,.98,.99,Form(
"shower at %5.3f nsec",3.*s/nsteps),
"brNDC"),s);