pythia_display.C: Demo showing H -> ZZ -> 4 mu generated by Pythia. | Event Display | show_extract.C: Helper script for showing of extracted / simplified geometries. |
// @(#)root/eve:$Id: quad_test.C 26876 2008-12-12 14:45:40Z matevz $ // Author: Matevz Tadel // Demonstates usage of 2D digit class TEveQuadSet. TEveQuadSet* quad_test(Float_t x=0, Float_t y=0, Float_t z=0, Int_t num=100, Bool_t register=kTRUE) { TEveManager::Create(); TRandom r(0); gStyle->SetPalette(1, 0); TEveRGBAPalette *pal = new TEveRGBAPalette(0, 130); TEveFrameBox *box = new TEveFrameBox(); box->SetAAQuadXY(-10, -10, 0, 20, 20); box->SetFrameColor(kGray); TEveQuadSet* q = new TEveQuadSet("RectangleXY"); q->SetOwnIds(kTRUE); q->SetPalette(pal); q->SetFrame(box); q->Reset(TEveQuadSet::kQT_RectangleXY, kFALSE, 32); for (Int_t i=0; i<num; ++i) { q->AddQuad(r.Uniform(-10, 9), r.Uniform(-10, 9), 0, r.Uniform(0.2, 1), r.Uniform(0.2, 1)); q->QuadValue(r.Uniform(0, 130)); q->QuadId(new TNamed(Form("QuadIdx %d", i), "TNamed assigned to a quad as an indentifier.")); } q->RefitPlex(); TEveTrans& t = q->RefMainTrans(); t.RotateLF(1, 3, 0.5*TMath::Pi()); t.SetPos(x, y, z); if (register) { gEve->AddElement(q); gEve->Redraw3D(kTRUE); } Info("quad_test", "use alt-left-mouse to select individual digits."); return q; } TEveQuadSet* quad_test_emc(Float_t x=0, Float_t y=0, Float_t z=0, Int_t num=100) { TEveManager::Create(); TRandom r(0); gStyle->SetPalette(1, 0); TEveQuadSet* q = new TEveQuadSet("EMC Supermodule"); q->SetOwnIds(kTRUE); q->Reset(TEveQuadSet::kQT_RectangleXZFixedDimY, kFALSE, 32); q->SetDefWidth(8); q->SetDefHeight(8); for (Int_t i=0; i<num; ++i) { q->AddQuad(r.Uniform(-100, 100), r.Uniform(-100, 100)); q->QuadValue(r.Uniform(0, 130)); q->QuadId(new TNamed(Form("Cell %d", i), "Dong!")); } q->RefitPlex(); TEveTrans& t = q->RefMainTrans(); t.SetPos(x, y, z); gEve->AddElement(q); gEve->Redraw3D(); return q; } TEveQuadSet* quad_test_circ() { TEveManager::Create(); TRandom rnd(0); gStyle->SetPalette(1, 0); Float_t R = 10, dW = 1, dH = .5; TEveFrameBox *box = new TEveFrameBox(); { Float_t frame[3*36]; Float_t *p = frame; for (Int_t i = 0; i < 36; ++i, p += 3) { p[0] = 11 * TMath::Cos(TMath::TwoPi()*i/36); p[1] = 11 * TMath::Sin(TMath::TwoPi()*i/36); p[2] = 0; } box->SetQuadByPoints(frame, 36); } box->SetFrameColor(kGray); TEveQuadSet* q = new TEveQuadSet("Pepe"); q->SetFrame(box); q->Reset(TEveQuadSet::kQT_HexagonXY, kFALSE, 32); for (Float_t r = R; r > 2; r *= 0.8) { Int_t maxI = 2.0*TMath::Pi()*r / 2; for (Int_t i = 0; i < maxI; ++i) { Float_t x = r * TMath::Cos(TMath::TwoPi()*i/maxI); Float_t y = r * TMath::Sin(TMath::TwoPi()*i/maxI); q->AddHexagon(x, y, rnd.Uniform(-1, 1), rnd.Uniform(0.2, 1)); q->QuadValue(rnd.Uniform(0, 130)); } } q->RefitPlex(); TEveTrans& t = q->RefMainTrans(); t.RotateLF(1, 3, 0.5*TMath::Pi()); gEve->AddElement(q); gEve->Redraw3D(); return q; } TEveQuadSet* quad_test_hex(Float_t x=0, Float_t y=0, Float_t z=0, Int_t num=100, Bool_t register=kTRUE) { TEveManager::Create(); TRandom r(0); gStyle->SetPalette(1, 0); { TEveQuadSet* q = new TEveQuadSet("HexagonXY"); q->Reset(TEveQuadSet::kQT_HexagonXY, kFALSE, 32); for (Int_t i=0; i<num; ++i) { q->AddHexagon(r.Uniform(-10, 10), r.Uniform(-10, 10), r.Uniform(-10, 10), r.Uniform(0.2, 1)); q->QuadValue(r.Uniform(0, 120)); } q->RefitPlex(); TEveTrans& t = q->RefMainTrans(); t.SetPos(x, y, z); if (register) { gEve->AddElement(q); gEve->Redraw3D(); } } { TEveQuadSet* q = new TEveQuadSet("HexagonYX"); q->Reset(TEveQuadSet::kQT_HexagonYX, kFALSE, 32); for (Int_t i=0; i<num; ++i) { q->AddHexagon(r.Uniform(-10, 10), r.Uniform(-10, 10), r.Uniform(-10, 10), r.Uniform(0.2, 1)); q->QuadValue(r.Uniform(0, 120)); } q->RefitPlex(); TEveTrans& t = q->RefMainTrans(); t.SetPos(x, y, z); if (register) { gEve->AddElement(q); gEve->Redraw3D(); } } return q; } TEveQuadSet* quad_test_hexid(Float_t x=0, Float_t y=0, Float_t z=0, Int_t num=100, Bool_t register=kTRUE) { TEveManager::Create(); TRandom r(0); gStyle->SetPalette(1, 0); { TEveQuadSet* q = new TEveQuadSet("HexagonXY"); q->SetOwnIds(kTRUE); q->Reset(TEveQuadSet::kQT_HexagonXY, kFALSE, 32); for (Int_t i=0; i<num; ++i) { q->AddHexagon(r.Uniform(-10, 10), r.Uniform(-10, 10), r.Uniform(-10, 10), r.Uniform(0.2, 1)); q->QuadValue(r.Uniform(0, 120)); q->QuadId(new TNamed(Form("Quad with idx=%d", i), "This title is not confusing.")); } q->RefitPlex(); TEveTrans& t = q->RefMainTrans(); t.SetPos(x, y, z); if (register) { gEve->AddElement(q); gEve->Redraw3D(); } } // This show another way of getting notified about // secondary selection hit. The callback function and the // setting of it must be done in compiled code. gROOT->ProcessLine(".L quad_test_callback.cxx+"); quad_test_set_callback(q); return q; } void quad_test_hierarchy(Int_t n=4) { TEveManager::Create(); gStyle->SetPalette(1, 0); TEveRGBAPalette* pal = new TEveRGBAPalette(20, 100); pal->SetLimits(0, 120); TEveFrameBox* box = new TEveFrameBox(); box->SetAABox(-10, -10, -10, 20, 20, 20); box->SetFrameColor(33); TEveElementList* l = new TEveElementList("Parent/Dir"); l->SetTitle("Tooltip"); // l->SetMainColor(3); gEve->AddElement(l); for (Int_t i=0; i<n; ++i) { TEveQuadSet* qs = quad_test_hexid(0, 0, 50*i, 50, kFALSE); qs->SetPalette(pal); qs->SetFrame(box); gEve->AddElement(qs, l); } gEve->Redraw3D(); } quad_test.C:1 quad_test.C:2 quad_test.C:3 quad_test.C:4 quad_test.C:5 quad_test.C:6 quad_test.C:7 quad_test.C:8 quad_test.C:9 quad_test.C:10 quad_test.C:11 quad_test.C:12 quad_test.C:13 quad_test.C:14 quad_test.C:15 quad_test.C:16 quad_test.C:17 quad_test.C:18 quad_test.C:19 quad_test.C:20 quad_test.C:21 quad_test.C:22 quad_test.C:23 quad_test.C:24 quad_test.C:25 quad_test.C:26 quad_test.C:27 quad_test.C:28 quad_test.C:29 quad_test.C:30 quad_test.C:31 quad_test.C:32 quad_test.C:33 quad_test.C:34 quad_test.C:35 quad_test.C:36 quad_test.C:37 quad_test.C:38 quad_test.C:39 quad_test.C:40 quad_test.C:41 quad_test.C:42 quad_test.C:43 quad_test.C:44 quad_test.C:45 quad_test.C:46 quad_test.C:47 quad_test.C:48 quad_test.C:49 quad_test.C:50 quad_test.C:51 quad_test.C:52 quad_test.C:53 quad_test.C:54 quad_test.C:55 quad_test.C:56 quad_test.C:57 quad_test.C:58 quad_test.C:59 quad_test.C:60 quad_test.C:61 quad_test.C:62 quad_test.C:63 quad_test.C:64 quad_test.C:65 quad_test.C:66 quad_test.C:67 quad_test.C:68 quad_test.C:69 quad_test.C:70 quad_test.C:71 quad_test.C:72 quad_test.C:73 quad_test.C:74 quad_test.C:75 quad_test.C:76 quad_test.C:77 quad_test.C:78 quad_test.C:79 quad_test.C:80 quad_test.C:81 quad_test.C:82 quad_test.C:83 quad_test.C:84 quad_test.C:85 quad_test.C:86 quad_test.C:87 quad_test.C:88 quad_test.C:89 quad_test.C:90 quad_test.C:91 quad_test.C:92 quad_test.C:93 quad_test.C:94 quad_test.C:95 quad_test.C:96 quad_test.C:97 quad_test.C:98 quad_test.C:99 quad_test.C:100 quad_test.C:101 quad_test.C:102 quad_test.C:103 quad_test.C:104 quad_test.C:105 quad_test.C:106 quad_test.C:107 quad_test.C:108 quad_test.C:109 quad_test.C:110 quad_test.C:111 quad_test.C:112 quad_test.C:113 quad_test.C:114 quad_test.C:115 quad_test.C:116 quad_test.C:117 quad_test.C:118 quad_test.C:119 quad_test.C:120 quad_test.C:121 quad_test.C:122 quad_test.C:123 quad_test.C:124 quad_test.C:125 quad_test.C:126 quad_test.C:127 quad_test.C:128 quad_test.C:129 quad_test.C:130 quad_test.C:131 quad_test.C:132 quad_test.C:133 quad_test.C:134 quad_test.C:135 quad_test.C:136 quad_test.C:137 quad_test.C:138 quad_test.C:139 quad_test.C:140 quad_test.C:141 quad_test.C:142 quad_test.C:143 quad_test.C:144 quad_test.C:145 quad_test.C:146 quad_test.C:147 quad_test.C:148 quad_test.C:149 quad_test.C:150 quad_test.C:151 quad_test.C:152 quad_test.C:153 quad_test.C:154 quad_test.C:155 quad_test.C:156 quad_test.C:157 quad_test.C:158 quad_test.C:159 quad_test.C:160 quad_test.C:161 quad_test.C:162 quad_test.C:163 quad_test.C:164 quad_test.C:165 quad_test.C:166 quad_test.C:167 quad_test.C:168 quad_test.C:169 quad_test.C:170 quad_test.C:171 quad_test.C:172 quad_test.C:173 quad_test.C:174 quad_test.C:175 quad_test.C:176 quad_test.C:177 quad_test.C:178 quad_test.C:179 quad_test.C:180 quad_test.C:181 quad_test.C:182 quad_test.C:183 quad_test.C:184 quad_test.C:185 quad_test.C:186 quad_test.C:187 quad_test.C:188 quad_test.C:189 quad_test.C:190 quad_test.C:191 quad_test.C:192 quad_test.C:193 quad_test.C:194 quad_test.C:195 quad_test.C:196 quad_test.C:197 quad_test.C:198 quad_test.C:199 quad_test.C:200 quad_test.C:201 quad_test.C:202 quad_test.C:203 quad_test.C:204 quad_test.C:205 quad_test.C:206 quad_test.C:207 quad_test.C:208 quad_test.C:209 quad_test.C:210 quad_test.C:211 quad_test.C:212 quad_test.C:213 quad_test.C:214 quad_test.C:215 quad_test.C:216 quad_test.C:217 quad_test.C:218 quad_test.C:219 quad_test.C:220 quad_test.C:221 quad_test.C:222 quad_test.C:223 quad_test.C:224 quad_test.C:225 quad_test.C:226 quad_test.C:227 quad_test.C:228 quad_test.C:229 quad_test.C:230 quad_test.C:231 quad_test.C:232 quad_test.C:233 quad_test.C:234 quad_test.C:235 quad_test.C:236 quad_test.C:237 quad_test.C:238 quad_test.C:239 quad_test.C:240 quad_test.C:241 quad_test.C:242 quad_test.C:243 quad_test.C:244 quad_test.C:245 quad_test.C:246 quad_test.C:247 quad_test.C:248 |
|