73 fPointsSize(other.fPointsSize),
74 fNpoints(other.fNpoints),
75 fPoints(other.fPoints)
131 if (tmin<0 || tmin>=tmax || nframes<1)
return;
137 TList *list =
gPad->GetListOfPrimitives();
140 while ((obj =
next())) {
156 box[0] = box[1] = box[2] = 0;
157 box[3] = box[4] = box[5] = 100;
166 for (i=0; i<3; i++) {
167 start[i+3] = 20 + 1.3*start[i+3];
168 end[i+3] = 20 + 0.9*end[i+3];
170 for (i=0; i<6; i++) {
171 dd[i] = (end[i]-start[i])/10.;
173 memcpy(box, start, 6*
sizeof(
Double_t));
175 dlong = (-206-dlong)/
Double_t(nframes);
176 dlat = (126-dlat)/
Double_t(nframes);
181 for (i=0; i<nframes; i++) {
185 for (j=0; j<6; j++) box[j]+=dd[j];
234 for (
Int_t i=0; i<nd; i++)
244 const Int_t inaxis = 7;
245 const Int_t maxdist = 5;
255 if (px < puxmin - inaxis)
return dist;
256 if (py > puymin + inaxis)
return dist;
257 if (px > puxmax + inaxis)
return dist;
258 if (py < puymax - inaxis)
return dist;
261 if (!view)
return dist;
269 if (imax>np-1) imax=np-1;
270 for (i=imin;i<imax;i++) {
279 if (dsegment < dist) {
282 gPad->SetSelected(
this);
288 gPad->SetSelected(
this);
294 if (!nd)
return dist;
296 for (
Int_t id=0;
id<nd;
id++) {
299 if (dist<maxdist)
return 0;
336 if (ilast<0) ilast=opt.
Length();
340 SetBits(is_default, is_onelevel, is_all, is_type);
368 return (
char*)info.
Data();
378 Error(
"GetPoint",
"no point %i, indmax=%d", i, np-1);
405 if (istart>(np-2))
return (np-1);
407 if (ip<0 || ip>(np-2))
return ip;
413 Double_t ddt = fPoints[k+3]-fPoints[j+3];
414 for (i=0; i<3; i++) point[i] = fPoints[j+i] +(fPoints[k+i]-fPoints[j+i])*dt/ddt;
431 if (strlen(type) && strcmp(type,
GetName())) match_type=
kFALSE;
434 if (is_default || is_onelevel || is_all)
PaintTrack(option);
438 if (!nd || is_default)
return;
440 for (
Int_t i=0; i<nd; i++) {
444 track->
Paint(option);
461 if (strlen(type) && strcmp(type,
GetName())) match_type=
kFALSE;
468 if (!nd || is_default)
return;
470 for (
Int_t i=0; i<nd; i++) {
482 if (!painter)
return;
487 if (ip>=0 && ip<np-1) {
489 else memcpy(local, point, 3*
sizeof(
Double_t));
504 if (xndc[0] <
gPad->GetX1() || xndc[0] >
gPad->GetX2())
return;
505 if (xndc[1] <
gPad->GetY1() || xndc[1] >
gPad->GetY2())
return;
506 p.
fX =
gPad->XtoPixel(xndc[0]);
507 p.
fY =
gPad->YtoPixel(xndc[1]);
534 Double_t seg[6] = {0.,0.,0.,0.,0.,0.};
540 if (imin>=0 && imin<np-1) {
551 gPad->PaintLine3D(&seg[0], &seg[3]);
553 gPad->PaintLine3D(start, end);
561 gPad->PaintLine3D(&seg[0], &seg[3]);
564 gPad->PaintLine3D(&seg[0], &seg[3]);
565 for (ip=imin+1; ip<imax; ip++) {
568 gPad->PaintLine3D(&seg[0], &seg[3]);
573 for (ip=imin+1; ip<imax; ip++) {
589 gPad->PaintLine3D(&seg[0], &seg[3]);
590 for (ip=imin+1; ip<np-2; ip++) {
593 gPad->PaintLine3D(&seg[0], &seg[3]);
597 for (ip=imin+1; ip<np-2; ip++) {
604 if (imax<0 || imax>=(np-1))
return;
608 for (ip=0; ip<imax-1; ip++) {
611 gPad->PaintLine3D(&seg[0], &seg[3]);
614 for (ip=0; ip<imax-1; ip++) {
621 gPad->PaintLine3D(&seg[0], &seg[3]);
635 for (ip=imin; ip<imax; ip++) {
646 printf(
" TGeoTrack%6i : %s ===============================\n",
fId,
GetName());
650 printf(
" production vertex : (%g, %g, %g) at tof=%g\n", x,
y,z,t);
652 printf(
" Npoints =%6i, last : (%g, %g, %g) at tof=%g\n\n", np,x,
y,z,t);
669 return (imax-imin+1);
678 Int_t nabove, nbelow, middle, midloc;
682 while (nabove-nbelow > 1) {
683 middle = (nabove+nbelow)/2;
684 midloc = ((middle-1)<<2)+3;
685 if (time ==
fPoints[midloc])
return middle-1;
686 if (time <
fPoints[midloc]) nabove = middle;
687 else nbelow = middle;
void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add object with name to browser.
virtual void SetLineWidth(Width_t lwidth)
Int_t GetNdaughters() const
Bool_t IsInTimeRange() const
True if track TOF range overlaps with time interval of TGeoManager.
double dist(Rotation3D const &r1, Rotation3D const &r2)
virtual void GetViewAngles(Double_t &, Double_t &, Double_t &)
TGeoVolume * GetMasterVolume() const
char * Compress(const char *str)
Remove all blanks from the string str.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
virtual Double_t * GetViewBox()=0
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
virtual void PaintCollectTrack(Double_t time, Double_t *box)
Paint just this track.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
void SetParticleName(const char *pname)
virtual void Print(Option_t *option="") const
Print some info about the track.
virtual void Draw(Option_t *option="")
draw top volume according to option
virtual void PaintCollect(Double_t time, Double_t *box)
Paint track and daughters.
virtual void Draw(Option_t *option="")
Draw this track overimposed on a geometry, according to option.
void ToLower()
Change string to lower-case.
const char * GetParticleName() const
Int_t GetEntriesFast() const
virtual void Modify()
Change current line attributes if necessary.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
virtual void Paint(Option_t *option="")
Paint this track (and descendents) with current attributes.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
virtual void ResetTrack()
Reset data for this track.
const char * Data() const
virtual TVirtualGeoTrack * AddDaughter(Int_t id, Int_t pdgcode, TObject *particle=0)
Add a daughter track to this.
static const double x2[5]
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
virtual void GrabFocus(Int_t nfr=0, Double_t dlong=0, Double_t dlat=0, Double_t dpsi=0)=0
virtual void Sizeof3D() const
Returns 3D size for the track.
virtual void SetMarkerColor(Color_t mcolor=1)
TGeoTrack & operator=(const TGeoTrack &)
Assignment operator. NOT TO BE CALLED.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TGeoVolume * GetTopVolume() const
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Event treatment.
virtual void PaintTrack(Option_t *option="")
Paint this track with its current attributes.
virtual void SetLineColor(Color_t lcolor)
Using a TBrowser one can browse all ROOT objects.
virtual void Modify()
Change current marker attributes if necessary.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Returns distance to track primitive for picking.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
virtual void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t)
Add a point on the track.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
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...
virtual void AnimateTrack(Double_t tmin=0, Double_t tmax=5E-8, Double_t nframes=200, Option_t *option="/*")
Draw animation of this track.
ClassImp(TGeoTrack) TGeoTrack
*-*-*-*-*-*-*-*-*-*-*Tracks default constructor*-*-*-*-*-*-*-*-* *-* ========================== ...
Bool_t TestBit(UInt_t f) const
virtual void EstimateCameraMove(Double_t, Double_t, Double_t *, Double_t *)
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Get some info about the track.
virtual void SetMarkerSize(Size_t msize=1)
static const double x1[5]
R__EXTERN TGeoManager * gGeoManager
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
void Browse(TBrowser *b)
How-to-browse for a track.
TVirtualGeoTrack & operator=(const TVirtualGeoTrack &)
Assignment operator. NOT TO BE CALLED.
Int_t DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
Compute distance from point px,py to a line.
Bool_t IsAnimatingTracks() const
void SetTminTmax(Double_t tmin=0, Double_t tmax=999)
Set time cut interval for drawing tracks.
Mother of all ROOT objects.
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y, Double_t &z, Double_t &t) const
Get coordinates for point I on the track.
TVirtualGeoTrack * GetDaughter(Int_t index) const
void SetAnimateTracks(Bool_t flag=kTRUE)
virtual void AddTrackPoint(Double_t *point, Double_t *box, Bool_t reset=kFALSE)=0
virtual ~TGeoTrack()
Destructor.
Int_t SearchPoint(Double_t time, Int_t istart=0) const
Search index of track point having the closest time tag smaller than TIME.
virtual const char * GetName() const
Get the PDG name.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
TVirtualGeoTrack * fParent
Bool_t GetTminTmax(Double_t &tmin, Double_t &tmax) const
Get time cut for drawing tracks.
void PaintMarker(Double_t *point, Option_t *option="")
Paint current point of the track as marker.
void SetParent(TVirtualGeoTrack *parent)
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.
void MasterToTop(const Double_t *master, Double_t *top) const
Convert coordinates from master volume frame to top.