3#include <TGeoManager.h>
30 : TGeoTrack(id, pdgcode, parent, particle)
62 cout <<
"BesGeoTrack::CloseInfo, not initialized" << endl;
67 TGeoTrack::AddPoint(
x,y,z,
t);
77 fMarker->SetMarkerColor(kBlack);
79 else if (
fType == 2) {
82 fMarker->SetMarkerColor(kBlack);
88 fMarker->SetMarkerColor(kBlack);
94 fMarker->SetMarkerColor(kBlack);
103 Double_t markSizeRatio = 4.0;
109 Double_t r = sqrt( Double_t((px-cx)*(px-cx) + (py-cy)*(py-cy)) );
110 Double_t markerR = markSizeRatio*
fMarker->GetMarkerSize();
111 if (markerR > 50) markerR = 50;
113 if ( fabs(r-markerR) < edge ) dist = 0;
117 Double_t dx =
abs(px-cx), dy =
abs(py-cy);
118 if ( fabs(dx) < edge && fabs(dy) < markSizeRatio*
fMarker->GetMarkerSize() ||
119 fabs(dy) < edge && fabs(dx) < markSizeRatio*
fMarker->GetMarkerSize() )
125 else return TGeoTrack::DistancetoPrimitive(px, py);
133 Int_t normalWidth = 2, hlWidth = 3;
140 if (gPad) gPad->SetCursor(kPointer);
148 for (Int_t i = 0; i <
fHits.GetEntries(); i++)
162 for (Int_t i = 0; i <
fClusters.GetEntries(); ++i)
167 aCluster->
fMarker->SetMarkerColor(kViolet);
168 aCluster->
fMarker->SetMarkerStyle(8);
174 else if (
fType == 1) {
176 for (Int_t i = 0; i <
fHits.GetEntries(); i++) {
188 else if (
fType == 2) {
190 for (Int_t i = 0; i <
fHits.GetEntries(); i++) {
202 else if (
fType == 3) {
204 for (Int_t i = 0; i <
fHits.GetEntries(); i++) {
217 width = this->GetLineWidth();
218 color = this->GetLineColor();
222 else if (
fType == 1) {
223 fMarker->SetMarkerColor(kMagenta);
225 else if (
fType == 2) {
226 fMarker->SetMarkerColor(kMagenta);
228 else if (
fType == 3) {
229 width = this->GetLineWidth();
230 color = this->GetLineColor();
234 else if (
fType == 4) {
240 fMarker->SetMarkerColor(kViolet);
256 for (Int_t i = 0; i < (Int_t)
fHits.GetEntries(); i++) {
266 for (Int_t i = 0; i <
fClusters.GetEntries(); ++i)
271 aCluster->
fMarker->SetMarkerColor(kBlack);
272 aCluster->
fMarker->SetMarkerStyle(4);
277 else if (
fType == 1) {
278 for (Int_t i = 0; i <
fHits.GetEntries(); i++) {
285 else if (
fType == 2) {
286 for (Int_t i = 0; i <
fHits.GetEntries(); i++) {
293 else if (
fType == 3) {
294 for (Int_t i = 0; i < (Int_t)
fHits.GetEntries(); i++) {
307 else if (
fType == 1) {
308 fMarker->SetMarkerColor(kBlack);
310 else if (
fType == 2) {
311 fMarker->SetMarkerColor(kBlack);
313 else if (
fType == 3) {
317 else if (
fType == 4) {
323 fMarker->SetMarkerColor(kBlack);
326 else if (
fType == 9) {
337 TGeoTrack::ExecuteEvent(event, px, py);
347 for (Int_t i = 0; i < GetNpoints(); i++)
380 for (Int_t i = 0; i <
f3DHits.GetEntries(); ++i)
382 TGeoPhysicalNode* pHit = (TGeoPhysicalNode*)
f3DHits.At(i);
383 if (pHit) pHit->SetLineColor(kRed);
387 if (!gPad) gGeoManager->GetMasterVolume()->Draw();
388 char *opt1 = Compress(option);
390 Bool_t is_default = kTRUE;
391 Bool_t is_onelevel = kFALSE;
392 Bool_t is_all = kFALSE;
393 Bool_t is_type = kFALSE;
394 if (opt.Contains(
"/D")) {
398 if (opt.Contains(
"/*")) {
402 if (opt.Contains(
"/N")) {
404 Int_t ist = opt.Index(
"/N")+2;
405 Int_t ilast = opt.Index(
"/",ist);
406 if (ilast<0) ilast=opt.Length();
407 TString type = opt(ist, ilast-ist);
408 gGeoManager->SetParticleName(type.Data());
410 SetBits(is_default, is_onelevel, is_all, is_type);
421 TVector3 viewVec(
cos(viewPhi*TMath::DegToRad()),
sin(viewPhi*TMath::DegToRad()), 0);
423 Double_t x1=0.0, y1=0.0, z1=0.0;
424 Double_t dot, dotMin = 1e+20, dotTolerance = 0.01;
425 for (Int_t i = 1; i < GetNpoints(); i++) {
426 GetPoint(i,
x, y, z,
t);
428 if (
vec.Mag() > 5.0) {
430 dot = fabs(
vec.Dot(viewVec));
431 if ( dot < dotTolerance && dot < dotMin ) {
440 if (dotMin < 1e+20) {
441 BesMarker2D sectionPhi(
"trackPhi",
"trackPhi", x1, y1, z1);
442 sectionPhi.SetMarkerStyle(28);
443 sectionPhi.SetMarkerColor(1);
444 sectionPhi.SetMarkerSize(2);
450 TGeoTrack::Paint(option);
459 else return TObject::GetObjectInfo(px, py);
double sin(const BesAngle a)
double cos(const BesAngle a)
R__EXTERN BesCursor * gBesCursor
ClassImp(BesGeoTrack) BesGeoTrack
double abs(const EvtComplex &c)
std::vector< TString > fInfoCon
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)
TPolyLine3D * fPolyLine3D
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 GetVisCgemHitsClusters()
Bool_t GetVisEmcHitsEast()
Bool_t GetVisCgemHitsGlobal()
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()