3#include <TGeoManager.h>
30 : TGeoTrack(id, pdgcode, parent, particle)
60 cout <<
"BesGeoTrack::CloseInfo, not initialized" << endl;
65 TGeoTrack::AddPoint(
x,
y,z,
t);
74 fMarker->SetMarkerStyle(5);
75 fMarker->SetMarkerColor(kBlack);
77 else if (fType == 2) {
79 fMarker->SetMarkerStyle(2);
80 fMarker->SetMarkerColor(kBlack);
85 fMarker->SetMarkerStyle(4);
86 fMarker->SetMarkerColor(kBlack);
91 fMarker->SetMarkerStyle(4);
92 fMarker->SetMarkerColor(kBlack);
101 Double_t markSizeRatio = 4.0;
103 if (fType == 1 || fType == 2 || fType == 6 || fType == 7) {
104 if (!fMarker)
return dist;
107 Double_t r = sqrt( Double_t((px-cx)*(px-cx) + (py-cy)*(py-cy)) );
108 Double_t markerR = markSizeRatio*fMarker->GetMarkerSize();
109 if (markerR > 50) markerR = 50;
111 if ( fabs(r-markerR) < edge ) dist = 0;
114 else if (fType == 2 || fType == 6 || fType == 7) {
115 Double_t dx =
abs(px-cx), dy =
abs(py-cy);
116 if ( fabs(dx) < edge && fabs(dy) < markSizeRatio*fMarker->GetMarkerSize() ||
117 fabs(dy) < edge && fabs(dx) < markSizeRatio*fMarker->GetMarkerSize() )
123 else return TGeoTrack::DistancetoPrimitive(px, py);
135 if (gPad) gPad->SetCursor(kPointer);
138 Int_t normalWidth = 1, hlWidth = 2;
144 for (Int_t i = 0; i < fHits.GetEntries(); i++) {
154 else if (fType == 1) {
156 for (Int_t i = 0; i < fHits.GetEntries(); i++) {
168 else if (fType == 2) {
170 for (Int_t i = 0; i < fHits.GetEntries(); i++) {
182 else if (fType == 3) {
184 for (Int_t i = 0; i < fHits.GetEntries(); i++) {
197 width = this->GetLineWidth();
198 color = this->GetLineColor();
199 this->SetLineWidth(hlWidth);
202 else if (fType == 1) {
203 fMarker->SetMarkerColor(kMagenta);
205 else if (fType == 2) {
206 fMarker->SetMarkerColor(kMagenta);
208 else if (fType == 3) {
209 width = this->GetLineWidth();
210 color = this->GetLineColor();
211 this->SetLineWidth(hlWidth);
214 else if (fType == 4) {
215 this->SetLineWidth(hlWidth);
218 else if (fType == 6 || fType == 7)
220 fMarker->SetMarkerColor(kViolet);
221 fMarker->SetMarkerStyle(8);
236 for (Int_t i = 0; i < (Int_t)fHits.GetEntries(); i++) {
243 else if (fType == 1) {
244 for (Int_t i = 0; i < fHits.GetEntries(); i++) {
251 else if (fType == 2) {
252 for (Int_t i = 0; i < fHits.GetEntries(); i++) {
259 else if (fType == 3) {
260 for (Int_t i = 0; i < (Int_t)fHits.GetEntries(); i++) {
270 this->SetLineWidth(normalWidth);
273 else if (fType == 1) {
274 fMarker->SetMarkerColor(kBlack);
276 else if (fType == 2) {
277 fMarker->SetMarkerColor(kBlack);
279 else if (fType == 3) {
280 this->SetLineWidth(normalWidth);
283 else if (fType == 4) {
284 this->SetLineWidth(normalWidth);
287 else if (fType == 6 || fType == 7)
289 fMarker->SetMarkerColor(kBlack);
290 fMarker->SetMarkerStyle(4);
299 TGeoTrack::ExecuteEvent(event, px, py);
307 fPolyLine3D =
new TPolyLine3D(GetNpoints());
308 fPolyLine3D->SetBit(kCanDelete);
309 for (Int_t i = 0; i < GetNpoints(); i++)
312 fPolyLine3D->SetPoint(i,
x,
y,z);
314 fPolyLine3D->SetLineWidth(5);
315 fPolyLine3D->SetLineColor(897);
325 fPolyLine3D->Draw(option);
329 for (Int_t i = 0; i < f3DHits.GetEntries(); ++i)
331 TGeoPhysicalNode* pHit = (TGeoPhysicalNode*)f3DHits.At(i);
332 if (pHit) pHit->SetLineColor(kRed);
336 if (!gPad) gGeoManager->GetMasterVolume()->Draw();
337 char *opt1 = Compress(option);
339 Bool_t is_default = kTRUE;
340 Bool_t is_onelevel = kFALSE;
341 Bool_t is_all = kFALSE;
342 Bool_t is_type = kFALSE;
343 if (opt.Contains(
"/D")) {
347 if (opt.Contains(
"/*")) {
351 if (opt.Contains(
"/N")) {
353 Int_t ist = opt.Index(
"/N")+2;
354 Int_t ilast = opt.Index(
"/",ist);
355 if (ilast<0) ilast=opt.Length();
356 TString type = opt(ist, ilast-ist);
357 gGeoManager->SetParticleName(type.Data());
359 SetBits(is_default, is_onelevel, is_all, is_type);
370 TVector3 viewVec(
cos(viewPhi*TMath::DegToRad()),
sin(viewPhi*TMath::DegToRad()), 0);
372 Double_t x1=0.0, y1=0.0, z1=0.0;
373 Double_t dot, dotMin = 1e+20, dotTolerance = 0.01;
374 for (Int_t i = 1; i < GetNpoints(); i++) {
375 GetPoint(i,
x,
y, z,
t);
377 if (
vec.Mag() > 5.0) {
379 dot = fabs(
vec.Dot(viewVec));
380 if ( dot < dotTolerance && dot < dotMin ) {
389 if (dotMin < 1e+20) {
390 BesMarker2D sectionPhi(
"trackPhi",
"trackPhi", x1, y1, z1);
391 sectionPhi.SetMarkerStyle(28);
392 sectionPhi.SetMarkerColor(1);
393 sectionPhi.SetMarkerSize(2);
398 if (fMarker) fMarker->
Paint(option);
399 TGeoTrack::Paint(option);
408 else return TObject::GetObjectInfo(px, py);
double sin(const BesAngle a)
double cos(const BesAngle a)
R__EXTERN BesCursor * gBesCursor
ClassImp(BesGeoTrack) BesGeoTrack
virtual void Draw(Option_t *option="")
virtual void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t)
virtual char * GetObjectInfo(Int_t px, Int_t py) const
virtual void Construct3DLine()
virtual void SetMarker(Double_t x, Double_t y, Double_t z)
virtual void Paint(Option_t *option="")
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual void SetCharge(Int_t charge)
virtual void GetCenterPixel(Int_t &px, Int_t &py)
virtual void SetMarkerSizeMultiple(Int_t input)
virtual void Paint(Option_t *option="")
virtual void SetText(std::vector< TString > infoCon)
virtual void SetPos(Int_t px, Int_t py)
Bool_t GetVisMucHitsGlobal()
Bool_t GetVisMdcHitsGlobal()
Bool_t GetVisEmcHitsBarrel()
Bool_t GetVisEmcHitsGlobal()
virtual void UpdateView(Bool_t resetview=kFALSE)
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Bool_t GetVisEmcHitsWest()
EBESViewType GetViewType()
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Bool_t GetVisTofHitsWest()
Bool_t GetVisTofHitsGlobal()
Bool_t GetVisEmcHitsEast()
Bool_t GetVisTofHitsBarrel()
Bool_t GetVisTofHitsEast()
virtual void SetHighlighted(bool status=true)
virtual bool IsHighlighted()
virtual void SetHighlighted(bool status=true)
virtual bool IsHighlighted()
virtual void SetHighlighted(bool status=true)
virtual bool IsHighlighted()
virtual void SetHighlighted(bool status=true)
virtual bool IsHighlighted()