projection_test_prescale.C: Demonstates usage pre-scaling for automatic 2D projections. | Event Display | quad_test.C: Demonstates usage of 2D digit class TEveQuadSet. |
// // Demo showing H -> ZZ -> 4 mu generated by Pythia. // Requires libPythia6. //============================================================================== // Constants. //------------------------------------------------------------------------------ const Double_t kR_min = 240; const Double_t kR_max = 250; const Double_t kZ_d = 300; // Solenoid field along z, in Tesla. const Double_t kMagField = 4; // Color for Higgs, Zs and muons const Color_t kColors[3] = { kRed, kGreen, kYellow }; //============================================================================== // Global variables. //------------------------------------------------------------------------------ class TPythia6; TPythia6 *g_pythia = 0; // Implemented in MultiView.C class MultiView; MultiView* gMultiView = 0; TEveTrackList *gTrackList = 0; //============================================================================== // Forward decalarations of CINT functions. //------------------------------------------------------------------------------ void pythia_next_event(); void pythia_make_gui(); //============================================================================== // Main - pythia_display() //------------------------------------------------------------------------------ void pythia_display() { const TString weh("pythia_display()"); if (g_pythia != 0) { Warning(weh, "Already initialized."); return; } #ifndef G__WIN32 // libPythia6 is a static library on Windoze if (gSystem->Load("libPythia6") < 0) { Error(weh, "Could not load 'libPythia6', make sure it is available!"); return; } #endif gSystem->Load("libEGPythia6"); if (gROOT->LoadMacro("MultiView.C+") != 0) { Error(weh, "Failed loading MultiView.C in compiled mode."); return; } //======================================================================== //======================================================================== // Create an instance of the Pythia event generator ... g_pythia = new TPythia6; TPythia6& P = * g_pythia; P.SetMSEL(0); // full user controll; P.SetMSUB(102, 1); // g + g -> H0 //P.SetMSUB(123, 1); // f + f' -> f + f' + H0 //P.SetMSUB(124, 1); // f + f' -> f" + f"' + H0 P.SetPMAS(6, 1, 175); // mass of TOP P.SetPMAS(25, 1, 180); // mass of Higgs P.SetCKIN(1, 170.0); // range of allowed mass P.SetCKIN(2, 190.0); P.SetMSTP(61, 0); // switch off ISR P.SetMSTP(71, 0); // switch off FSR P.SetMSTP(81, 0); // switch off multiple interactions P.SetMSTP(111, 0); // Switch off fragmentation // Force h0 -> ZZ for (Int_t i = 210; i <= 288; ++i) P.SetMDME(i, 1, 0); P.SetMDME(225, 1, 1); // Force Z -> mumu for (Int_t i = 174; i <= 189; ++i) P.SetMDME(i, 1, 0); P.SetMDME(184, 1, 1); P.Initialize("cms", "p", "p", 14000); //======================================================================== // Create views and containers. //======================================================================== TEveManager::Create(); TEveElementList *fake_geom = new TEveElementList("Geometry"); TEveGeoShape *b; b = new TEveGeoShape("Barell 1"); b->SetShape(new TGeoTube(kR_min, kR_max, kZ_d)); b->SetMainColor(kCyan); b->SetMainTransparency(80); fake_geom->AddElement(b); b = new TEveGeoShape("Barell 2"); b->SetShape(new TGeoTube(2*kR_min, 2*kR_max, 2*kZ_d)); b->SetMainColor(kPink-3); b->SetMainTransparency(80); fake_geom->AddElement(b); gEve->AddGlobalElement(fake_geom); gMultiView = new MultiView; gMultiView->ImportGeomRPhi(fake_geom); gMultiView->ImportGeomRhoZ(fake_geom); gEve->GetBrowser()->GetTabRight()->SetTab(1); gTrackList = new TEveTrackList("Pythia Tracks"); gTrackList->SetMainColor(kYellow); gTrackList->SetMarkerColor(kRed); gTrackList->SetMarkerStyle(4); gTrackList->SetMarkerSize(0.5); gEve->AddElement(gTrackList); TEveTrackPropagator* trkProp = gTrackList->GetPropagator(); trkProp->SetMagField(kMagField); trkProp->SetMaxR(2*kR_max); trkProp->SetMaxZ(2*kZ_d); //======================================================================== //======================================================================== pythia_make_gui(); pythia_next_event(); gEve->Redraw3D(kTRUE); } //============================================================================== // Next event //------------------------------------------------------------------------------ void pythia_next_event() { gTrackList->DestroyElements(); TPythia6& P = * g_pythia; P.GenerateEvent(); int nh = P.GetMSTU(72); // printf("N = %d, Nhard = %d :: NumSec = %d, separators (%d,%d,%d,%d)\n", // P.GetN(), nh, P.GetMSTU(70), P.GetMSTU(71), P.GetMSTU(72), P.GetMSTU(73), P.GetMSTU(74)); // 2->2 hard postfrag final TEveTrackPropagator *trkProp = gTrackList->GetPropagator(); TClonesArray &MC = * (TClonesArray*) P.GetListOfParticles(); for (Int_t i = 0; i < 7; ++i) { TMCParticle& p = * MC[nh+i]; TParticle pb(p.GetKF(), p.GetKS(), 0, 0, p.GetFirstChild()-nh-1, p.GetLastChild()-nh-1, p.GetPx(), p.GetPy(), p.GetPz(), p.GetEnergy(), p.GetVx(), p.GetVy(), p.GetVz(), p.GetTime()); TEveTrack* track = new TEveTrack(&pb, i, trkProp); track->SetName(Form("%s [%d]", pb.GetName(), i)); track->SetStdTitle(); track->SetAttLineAttMarker(gTrackList); if (i == 0) track->SetLineColor(kColors[0]); else if (i <= 2) track->SetLineColor(kColors[1]); gTrackList->AddElement(track); /* printf("%d - %d %d %d %d %d %d\n", i, p.GetKF(), p.GetKS(), 0, 0, p.GetFirstChild()-nh-1, p.GetLastChild()-nh-1); printf("%d - %f %f %f %f\n", i, p.GetPx(), p.GetPy(), p.GetPz(), p.GetEnergy(), printf("%d - %f %f %f %f\n", i, p.GetVx(), p.GetVy(), p.GetVz(), p.GetTime()); */ } gTrackList->MakeTracks(); TEveElement* top = gEve->GetCurrentEvent(); gMultiView->DestroyEventRPhi(); gMultiView->ImportEventRPhi(top); gMultiView->DestroyEventRhoZ(); gMultiView->ImportEventRhoZ(top); gEve->Redraw3D(); } //============================================================================== // GUI stuff //------------------------------------------------------------------------------ class EvNavHandler { public: void Fwd() { pythia_next_event(); } void Bck() {} }; //______________________________________________________________________________ void pythia_make_gui() { // Create minimal GUI for event navigation. TEveBrowser* browser = gEve->GetBrowser(); browser->StartEmbedding(TRootBrowser::kLeft); TGMainFrame* frmMain = new TGMainFrame(gClient->GetRoot(), 1000, 600); frmMain->SetWindowName("XX GUI"); frmMain->SetCleanup(kDeepCleanup); TGHorizontalFrame* hf = new TGHorizontalFrame(frmMain); { TString icondir( Form("%s/icons/", gSystem->Getenv("ROOTSYS")) ); TGPictureButton* b = 0; EvNavHandler *fh = new EvNavHandler; b = new TGPictureButton(hf, gClient->GetPicture(icondir + "GoBack.gif")); b->SetEnabled(kFALSE); b->SetToolTipText("Go to previous event - not supported."); hf->AddFrame(b); b->Connect("Clicked()", "EvNavHandler", fh, "Bck()"); b = new TGPictureButton(hf, gClient->GetPicture(icondir + "GoForward.gif")); b->SetToolTipText("Generate new event."); hf->AddFrame(b); b->Connect("Clicked()", "EvNavHandler", fh, "Fwd()"); } frmMain->AddFrame(hf); frmMain->MapSubwindows(); frmMain->Resize(); frmMain->MapWindow(); browser->StopEmbedding(); browser->SetTabTitle("Event Control", 0); } pythia_display.C:1 pythia_display.C:2 pythia_display.C:3 pythia_display.C:4 pythia_display.C:5 pythia_display.C:6 pythia_display.C:7 pythia_display.C:8 pythia_display.C:9 pythia_display.C:10 pythia_display.C:11 pythia_display.C:12 pythia_display.C:13 pythia_display.C:14 pythia_display.C:15 pythia_display.C:16 pythia_display.C:17 pythia_display.C:18 pythia_display.C:19 pythia_display.C:20 pythia_display.C:21 pythia_display.C:22 pythia_display.C:23 pythia_display.C:24 pythia_display.C:25 pythia_display.C:26 pythia_display.C:27 pythia_display.C:28 pythia_display.C:29 pythia_display.C:30 pythia_display.C:31 pythia_display.C:32 pythia_display.C:33 pythia_display.C:34 pythia_display.C:35 pythia_display.C:36 pythia_display.C:37 pythia_display.C:38 pythia_display.C:39 pythia_display.C:40 pythia_display.C:41 pythia_display.C:42 pythia_display.C:43 pythia_display.C:44 pythia_display.C:45 pythia_display.C:46 pythia_display.C:47 pythia_display.C:48 pythia_display.C:49 pythia_display.C:50 pythia_display.C:51 pythia_display.C:52 pythia_display.C:53 pythia_display.C:54 pythia_display.C:55 pythia_display.C:56 pythia_display.C:57 pythia_display.C:58 pythia_display.C:59 pythia_display.C:60 pythia_display.C:61 pythia_display.C:62 pythia_display.C:63 pythia_display.C:64 pythia_display.C:65 pythia_display.C:66 pythia_display.C:67 pythia_display.C:68 pythia_display.C:69 pythia_display.C:70 pythia_display.C:71 pythia_display.C:72 pythia_display.C:73 pythia_display.C:74 pythia_display.C:75 pythia_display.C:76 pythia_display.C:77 pythia_display.C:78 pythia_display.C:79 pythia_display.C:80 pythia_display.C:81 pythia_display.C:82 pythia_display.C:83 pythia_display.C:84 pythia_display.C:85 pythia_display.C:86 pythia_display.C:87 pythia_display.C:88 pythia_display.C:89 pythia_display.C:90 pythia_display.C:91 pythia_display.C:92 pythia_display.C:93 pythia_display.C:94 pythia_display.C:95 pythia_display.C:96 pythia_display.C:97 pythia_display.C:98 pythia_display.C:99 pythia_display.C:100 pythia_display.C:101 pythia_display.C:102 pythia_display.C:103 pythia_display.C:104 pythia_display.C:105 pythia_display.C:106 pythia_display.C:107 pythia_display.C:108 pythia_display.C:109 pythia_display.C:110 pythia_display.C:111 pythia_display.C:112 pythia_display.C:113 pythia_display.C:114 pythia_display.C:115 pythia_display.C:116 pythia_display.C:117 pythia_display.C:118 pythia_display.C:119 pythia_display.C:120 pythia_display.C:121 pythia_display.C:122 pythia_display.C:123 pythia_display.C:124 pythia_display.C:125 pythia_display.C:126 pythia_display.C:127 pythia_display.C:128 pythia_display.C:129 pythia_display.C:130 pythia_display.C:131 pythia_display.C:132 pythia_display.C:133 pythia_display.C:134 pythia_display.C:135 pythia_display.C:136 pythia_display.C:137 pythia_display.C:138 pythia_display.C:139 pythia_display.C:140 pythia_display.C:141 pythia_display.C:142 pythia_display.C:143 pythia_display.C:144 pythia_display.C:145 pythia_display.C:146 pythia_display.C:147 pythia_display.C:148 pythia_display.C:149 pythia_display.C:150 pythia_display.C:151 pythia_display.C:152 pythia_display.C:153 pythia_display.C:154 pythia_display.C:155 pythia_display.C:156 pythia_display.C:157 pythia_display.C:158 pythia_display.C:159 pythia_display.C:160 pythia_display.C:161 pythia_display.C:162 pythia_display.C:163 pythia_display.C:164 pythia_display.C:165 pythia_display.C:166 pythia_display.C:167 pythia_display.C:168 pythia_display.C:169 pythia_display.C:170 pythia_display.C:171 pythia_display.C:172 pythia_display.C:173 pythia_display.C:174 pythia_display.C:175 pythia_display.C:176 pythia_display.C:177 pythia_display.C:178 pythia_display.C:179 pythia_display.C:180 pythia_display.C:181 pythia_display.C:182 pythia_display.C:183 pythia_display.C:184 pythia_display.C:185 pythia_display.C:186 pythia_display.C:187 pythia_display.C:188 pythia_display.C:189 pythia_display.C:190 pythia_display.C:191 pythia_display.C:192 pythia_display.C:193 pythia_display.C:194 pythia_display.C:195 pythia_display.C:196 pythia_display.C:197 pythia_display.C:198 pythia_display.C:199 pythia_display.C:200 pythia_display.C:201 pythia_display.C:202 pythia_display.C:203 pythia_display.C:204 pythia_display.C:205 pythia_display.C:206 pythia_display.C:207 pythia_display.C:208 pythia_display.C:209 pythia_display.C:210 pythia_display.C:211 pythia_display.C:212 pythia_display.C:213 pythia_display.C:214 pythia_display.C:215 pythia_display.C:216 pythia_display.C:217 pythia_display.C:218 pythia_display.C:219 pythia_display.C:220 pythia_display.C:221 pythia_display.C:222 pythia_display.C:223 pythia_display.C:224 pythia_display.C:225 pythia_display.C:226 pythia_display.C:227 pythia_display.C:228 pythia_display.C:229 pythia_display.C:230 pythia_display.C:231 pythia_display.C:232 pythia_display.C:233 pythia_display.C:234 pythia_display.C:235 pythia_display.C:236 pythia_display.C:237 pythia_display.C:238 pythia_display.C:239 pythia_display.C:240 pythia_display.C:241 pythia_display.C:242 pythia_display.C:243 pythia_display.C:244 pythia_display.C:245 pythia_display.C:246 pythia_display.C:247 pythia_display.C:248 pythia_display.C:249 pythia_display.C:250 pythia_display.C:251 pythia_display.C:252 pythia_display.C:253 pythia_display.C:254 pythia_display.C:255 pythia_display.C:256 pythia_display.C:257 pythia_display.C:258 pythia_display.C:259 pythia_display.C:260 pythia_display.C:261 pythia_display.C:262 pythia_display.C:263 pythia_display.C:264 pythia_display.C:265 pythia_display.C:266 pythia_display.C:267 pythia_display.C:268 pythia_display.C:269 pythia_display.C:270 pythia_display.C:271 pythia_display.C:272 pythia_display.C:273 pythia_display.C:274 pythia_display.C:275 pythia_display.C:276 pythia_display.C:277 |
|