ROOT logo
/** 
 * 
 * 
 * @ingroup pwglf_forward_scripts_tests
 */
namespace {
  enum { 
    kSolid        = 0x000, 
    kHollow       = 0x001, 
    kCircle       = 0x002,
    kSquare       = 0x004, 
    kUpTriangle   = 0x006, 
    kDownTriangle = 0x008, 
    kDiamond      = 0x00a,
    kCross        = 0x00c,
    kStar         = 0x00e
  };
  /** 
   * 
   * 
   * @param bits 
   * 
   * @return 
   * @ingroup pwglf_forward_scripts_tests
   */
  Int_t MarkerStyle(UInt_t bits)
  {
    Int_t  base   = bits & (0xFE);
    Bool_t hollow = bits & kHollow;
    switch (base) { 
    case kCircle:       return (hollow ? 24 : 20);
    case kSquare:       return (hollow ? 25 : 21);
    case kUpTriangle:   return (hollow ? 26 : 22);
    case kDownTriangle: return (hollow ? 32 : 23);
    case kDiamond:      return (hollow ? 27 : 33); 
    case kCross:        return (hollow ? 28 : 34); 
    case kStar:         return (hollow ? 30 : 29); 
    }
    return 1;
  }
  /** 
   * 
   * 
   * @param style 
   * 
   * @return 
   * @ingroup pwglf_forward_scripts_tests
   */
  UShort_t MarkerBits(Int_t style) 
  { 
    UShort_t bits = 0;
    switch (style) { 
    case 24: case 25: case 26: case 27: case 28: case 30: case 32: 
      bits |= kHollow; break;
    }
    switch (style) { 
    case 20: case 24: bits |= kCircle;       break;
    case 21: case 25: bits |= kSquare;       break;
    case 22: case 26: bits |= kUpTriangle;   break;
    case 23: case 32: bits |= kDownTriangle; break;
    case 27: case 33: bits |= kDiamond;      break;
    case 28: case 34: bits |= kCross;        break;
    case 29: case 30: bits |= kStar;         break;
    }
    return bits;
  }
  /** 
   * 
   * 
   * @param style 
   * 
   * @return 
   * @ingroup pwglf_forward_scripts_tests
   */
  Int_t FlipHollow(Int_t style) 
  {
    UShort_t bits = MarkerBits(style);
    Int_t ret = MarkerStyle(bits ^ kHollow);
    Info("FlipHollow", "style=%2d -> bits=0x%02x -> mask=0x%02x -> ret=%02d", 
	 style, bits, (bits ^ kHollow), ret);
    return ret;
  }
}

/** 
 * 
 * 
 * @param what 
 * @param base 
 * @param y 
 * @ingroup pwglf_forward_scripts_tests
 */
void DrawOne(const char* what, UShort_t base, Double_t y)
{
  TLatex* l = new TLatex(.07, y, what);
  l->SetTextSize(0.03);
  l->Draw();

  Int_t filled = MarkerStyle(base);
  // Info("DrawOne", "%2d (%16s) -> %d", base, what, style);
  TMarker* p = new TMarker(.35, y, filled);
  p->SetMarkerSize(1.5);
  p->Draw();

  Int_t hollow = MarkerStyle(base|kHollow);
  p = new TMarker(.60, y, hollow);
  p->SetMarkerSize(1.5);
  p->Draw();

  p = new TMarker(.75, y, FlipHollow(filled));
  p->SetMarkerSize(1.5);
  p->Draw();

  p = new TMarker(.85, y, FlipHollow(hollow));
  p->SetMarkerSize(1.5);
  p->Draw();
    
}

//
// EOF
//
 TestMarkers.C:1
 TestMarkers.C:2
 TestMarkers.C:3
 TestMarkers.C:4
 TestMarkers.C:5
 TestMarkers.C:6
 TestMarkers.C:7
 TestMarkers.C:8
 TestMarkers.C:9
 TestMarkers.C:10
 TestMarkers.C:11
 TestMarkers.C:12
 TestMarkers.C:13
 TestMarkers.C:14
 TestMarkers.C:15
 TestMarkers.C:16
 TestMarkers.C:17
 TestMarkers.C:18
 TestMarkers.C:19
 TestMarkers.C:20
 TestMarkers.C:21
 TestMarkers.C:22
 TestMarkers.C:23
 TestMarkers.C:24
 TestMarkers.C:25
 TestMarkers.C:26
 TestMarkers.C:27
 TestMarkers.C:28
 TestMarkers.C:29
 TestMarkers.C:30
 TestMarkers.C:31
 TestMarkers.C:32
 TestMarkers.C:33
 TestMarkers.C:34
 TestMarkers.C:35
 TestMarkers.C:36
 TestMarkers.C:37
 TestMarkers.C:38
 TestMarkers.C:39
 TestMarkers.C:40
 TestMarkers.C:41
 TestMarkers.C:42
 TestMarkers.C:43
 TestMarkers.C:44
 TestMarkers.C:45
 TestMarkers.C:46
 TestMarkers.C:47
 TestMarkers.C:48
 TestMarkers.C:49
 TestMarkers.C:50
 TestMarkers.C:51
 TestMarkers.C:52
 TestMarkers.C:53
 TestMarkers.C:54
 TestMarkers.C:55
 TestMarkers.C:56
 TestMarkers.C:57
 TestMarkers.C:58
 TestMarkers.C:59
 TestMarkers.C:60
 TestMarkers.C:61
 TestMarkers.C:62
 TestMarkers.C:63
 TestMarkers.C:64
 TestMarkers.C:65
 TestMarkers.C:66
 TestMarkers.C:67
 TestMarkers.C:68
 TestMarkers.C:69
 TestMarkers.C:70
 TestMarkers.C:71
 TestMarkers.C:72
 TestMarkers.C:73
 TestMarkers.C:74
 TestMarkers.C:75
 TestMarkers.C:76
 TestMarkers.C:77
 TestMarkers.C:78
 TestMarkers.C:79
 TestMarkers.C:80
 TestMarkers.C:81
 TestMarkers.C:82
 TestMarkers.C:83
 TestMarkers.C:84
 TestMarkers.C:85
 TestMarkers.C:86
 TestMarkers.C:87
 TestMarkers.C:88
 TestMarkers.C:89
 TestMarkers.C:90
 TestMarkers.C:91
 TestMarkers.C:92
 TestMarkers.C:93
 TestMarkers.C:94
 TestMarkers.C:95
 TestMarkers.C:96
 TestMarkers.C:97
 TestMarkers.C:98
 TestMarkers.C:99
 TestMarkers.C:100
 TestMarkers.C:101
 TestMarkers.C:102
 TestMarkers.C:103
 TestMarkers.C:104
 TestMarkers.C:105
 TestMarkers.C:106
 TestMarkers.C:107
 TestMarkers.C:108
 TestMarkers.C:109
 TestMarkers.C:110
 TestMarkers.C:111
 TestMarkers.C:112
 TestMarkers.C:113
 TestMarkers.C:114
 TestMarkers.C:115
 TestMarkers.C:116
 TestMarkers.C:117
 TestMarkers.C:118
 TestMarkers.C:119
 TestMarkers.C:120
 TestMarkers.C:121
 TestMarkers.C:122
 TestMarkers.C:123