88 fTracks->AddAtAndExpand(daughter, index);
100 fTracks->AddAtAndExpand(other, index);
110 if (tmin < 0 || tmin >= tmax || nframes < 1)
117 TList *list =
gPad->GetListOfPrimitives();
120 while ((obj = next())) {
121 if (!strcmp(obj->
ClassName(),
"TGeoTrack"))
144 Double_t end[6] = {0, 0, 0, 0, 0, 0};
146 Double_t dlat = 0, dlong = 0, dpsi = 0;
147 Double_t dd[6] = {0, 0, 0, 0, 0, 0};
150 for (i = 0; i < 3; i++) {
152 end[i + 3] = 20 + 0.9 * end[i + 3];
154 for (i = 0; i < 6; i++) {
155 dd[i] = (end[i] -
start[i]) / 10.;
159 dlong = (-206 - dlong) /
Double_t(nframes);
160 dlat = (126 - dlat) /
Double_t(nframes);
161 dpsi = (75 - dpsi) /
Double_t(nframes);
165 for (i = 0; i < nframes; i++) {
171 for (j = 0; j < 6; j++)
222 for (
Int_t i = 0; i < nd; i++)
231 const Int_t inaxis = 7;
232 const Int_t maxdist = 5;
241 if (px < puxmin - inaxis)
243 if (py > puymin + inaxis)
245 if (px > puxmax + inaxis)
247 if (py < puymax - inaxis)
263 for (i = imin; i < imax; i++) {
272 if (dsegment < dist) {
274 if (dist < maxdist) {
275 gPad->SetSelected(
this);
286 for (
Int_t id = 0;
id < nd;
id++) {
331 TString type = opt(ist, ilast - ist);
334 SetBits(is_default, is_onelevel, is_all, is_type);
363 return (
char *)info.
Data();
372 if (i < 0 || i >= np) {
373 Error(
"GetPoint",
"no point %i, indmax=%d", i, np - 1);
401 if (istart > (np - 2))
404 if (ip < 0 || ip > (np - 2))
409 Int_t k = (ip + 1) << 2;
412 for (i = 0; i < 3; i++)
430 if (strlen(type) && strcmp(type,
GetName()))
434 if (is_default || is_onelevel || is_all)
439 if (!nd || is_default)
442 for (
Int_t i = 0; i < nd; i++) {
446 track->
Paint(option);
463 if (strlen(type) && strcmp(type,
GetName()))
467 if (is_default || is_onelevel || is_all)
472 if (!nd || is_default)
475 for (
Int_t i = 0; i < nd; i++) {
494 if (ip >= 0 && ip < np - 1) {
498 memcpy(local, point, 3 *
sizeof(
Double_t));
514 if (xndc[0] <
gPad->GetX1() || xndc[0] >
gPad->GetX2())
516 if (xndc[1] <
gPad->GetY1() || xndc[1] >
gPad->GetY2())
518 p.
fX =
gPad->XtoPixel(xndc[0]);
519 p.
fY =
gPad->YtoPixel(xndc[1]);
540 Double_t seg[6] = {0., 0., 0., 0., 0., 0.};
546 if (imin >= 0 && imin < np - 1) {
557 gPad->PaintLine3D(&seg[0], &seg[3]);
567 gPad->PaintLine3D(&seg[0], &seg[3]);
570 gPad->PaintLine3D(&seg[0], &seg[3]);
571 for (ip = imin + 1; ip < imax; ip++) {
574 gPad->PaintLine3D(&seg[0], &seg[3]);
579 for (ip = imin + 1; ip < imax; ip++) {
595 gPad->PaintLine3D(&seg[0], &seg[3]);
596 for (ip = imin + 1; ip < np - 2; ip++) {
599 gPad->PaintLine3D(&seg[0], &seg[3]);
603 for (ip = imin + 1; ip < np - 2; ip++) {
610 if (imax < 0 || imax >= (np - 1))
615 for (ip = 0; ip < imax - 1; ip++) {
618 gPad->PaintLine3D(&seg[0], &seg[3]);
621 for (ip = 0; ip < imax - 1; ip++) {
628 gPad->PaintLine3D(&seg[0], &seg[3]);
642 for (ip = imin; ip < imax; ip++) {
653 printf(
" TGeoTrack%6i : %s ===============================\n",
fId,
GetName());
657 printf(
" production vertex : (%g, %g, %g) at tof=%g\n",
x,
y, z, t);
659 printf(
" Npoints =%6i, last : (%g, %g, %g) at tof=%g\n\n", np,
x,
y, z, t);
677 return (imax - imin + 1);
686 Int_t nabove, nbelow, middle, midloc;
690 while (nabove - nbelow > 1) {
691 middle = (nabove + nbelow) / 2;
692 midloc = ((middle - 1) << 2) + 3;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char).
externTGeoManager * gGeoManager
char * Compress(const char *str)
Remove all blanks from the string str.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Int_t DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Using a TBrowser one can browse all ROOT objects.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Returns distance to track primitive for picking.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Event treatment.
virtual void Sizeof3D() const
Returns 3D size for the track.
Int_t Size(Int_t &imin, Int_t &imax)
Return the number of points within the time interval specified by TGeoManager class and the correspon...
Int_t SearchPoint(Double_t time, Int_t istart=0) const
Search index of track point having the closest time tag smaller than TIME.
TVirtualGeoTrack * AddDaughter(Int_t id, Int_t pdgcode, TObject *particle=nullptr) override
Add a daughter track to this.
void SetBits(Bool_t is_default=kTRUE, Bool_t is_onelevel=kFALSE, Bool_t is_all=kFALSE, Bool_t is_type=kFALSE)
Set drawing bits for this track.
Int_t GetPoint(Int_t i, Double_t &x, Double_t &y, Double_t &z, Double_t &t) const override
Get coordinates for point I on the track.
~TGeoTrack() override
Destructor.
void Paint(Option_t *option="") override
Paint this track (and descendents) with current attributes.
void Browse(TBrowser *b) override
How-to-browse for a track.
void PaintCollect(Double_t time, Double_t *box) override
Paint track and daughters.
TGeoTrack()
Default constructor.
void PaintMarker(Double_t *point, Option_t *option="")
Paint current point of the track as marker.
void ResetTrack() override
Reset data for this track.
void PaintTrack(Option_t *option="") override
Paint this track with its current attributes.
TGeoTrack(const TGeoTrack &)=delete
virtual void AnimateTrack(Double_t tmin=0, Double_t tmax=5E-8, Double_t nframes=200, Option_t *option="/*")
Draw animation of this track.
void PaintCollectTrack(Double_t time, Double_t *box) override
Paint just this track.
void Draw(Option_t *option="") override
Draw this track over-imposed on a geometry, according to option.
void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t) override
Add a point on the track.
char * GetObjectInfo(Int_t px, Int_t py) const override
Get some info about the track.
void Print(Option_t *option="") const override
Print some info about the track.
Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TObject()
TObject constructor.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
Abstract class for geometry painters.
virtual void GetViewAngles(Double_t &, Double_t &, Double_t &)
virtual void GrabFocus(Int_t nfr=0, Double_t dlong=0, Double_t dlat=0, Double_t dpsi=0)=0
virtual void AddTrackPoint(Double_t *point, Double_t *box, Bool_t reset=kFALSE)=0
virtual Double_t * GetViewBox()=0
virtual void EstimateCameraMove(Double_t, Double_t, Double_t *, Double_t *)
TVirtualGeoTrack * fParent
void SetParent(TVirtualGeoTrack *parent)
TVirtualGeoTrack(const TVirtualGeoTrack &)=delete
TVirtualGeoTrack * GetDaughter(Int_t index) const
Bool_t IsInTimeRange() const
True if track TOF range overlaps with time interval of TGeoManager.
const char * GetName() const override
Get the PDG name.
Int_t GetNdaughters() const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)