Changeset e0c1ff0 in git for examples/geometry.C
- Timestamp:
- Oct 9, 2014, 6:59:37 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 493aa9b
- Parents:
- 7513718
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/geometry.C
r7513718 re0c1ff0 14 14 #include "TGeoCone.h" 15 15 #include "TGeoArb8.h" 16 //#include "../external/ExRootAnalysis/ExRootConfReader.h" 16 //#include "external/ExRootAnalysis/ExRootConfReader.h" 17 //#include "external/ExRootAnalysis/ExRootTreeReader.h" 18 //#include "display/DelphesCaloData.h" 19 //#include "display/DelphesDisplay.h" 20 //#include "classes/DelphesClasses.h" 17 21 #include "TF2.h" 18 22 #include "TH1F.h" 23 #include "TChain.h" 24 #include "TEveElement.h" 25 #include "TEveJetCone.h" 26 #include "TEveTrack.h" 27 #include "TEveTrackPropagator.h" 28 #include "TEveCalo.h" 19 29 #include "TMath.h" 20 30 #include "TSystem.h" 31 #include "TEveManager.h" 32 #include "TEveGeoNode.h" 33 #include "TEveTrans.h" 34 #include "TEveViewer.h" 35 #include "TEveBrowser.h" 36 #include "TRootBrowser.h" 37 #include "TGLViewer.h" 38 #include "TGButton.h" 39 #include "TCollection.h" 40 #include "TClonesArray.h" 41 #include "TGLClip.h" 21 42 22 43 /* … … 131 152 //--- the geometry manager 132 153 geom_ = geom==NULL? gGeoManager : geom; 133 gGeoManager->DefaultColors();154 //gGeoManager->DefaultColors(); 134 155 135 156 //--- define some materials … … 237 258 set< pair<Double_t, Int_t> > caloBinning = caloBinning_[*calorimeters_.begin()]; 238 259 Double_t *etaBins = new Double_t[caloBinning.size()]; // note that this is the eta binning of the first calo 239 unsigned int i = 0;260 unsigned int ii = 0; 240 261 for(set< pair<Double_t, Int_t> >::const_iterator itEtaSet = caloBinning.begin(); itEtaSet != caloBinning.end(); ++itEtaSet) { 241 etaBins[i ++] = itEtaSet.first;262 etaBins[ii++] = itEtaSet->first; 242 263 } 243 264 etaAxis_ = new TAxis(caloBinning.size() - 1, etaBins); … … 456 477 457 478 // initialize the application 458 gSystem->Load("libDelphesDisplay"); 479 gSystem->Load("../libDelphesDisplay"); 480 TGeoManager *geom = new TGeoManager("delphes", "Delphes geometry"); 459 481 TEveManager::Create(kTRUE, "IV"); 460 482 461 483 // build the detector 462 484 Delphes3DGeometry det3D; 463 det3D.readFile(filename,ParticlePropagator, TrackingEfficiency, MuonEfficiency, Calorimeters); 485 //det3D.readFile(configFile,ParticlePropagator, TrackingEfficiency, MuonEfficiency, Calorimeters); 486 det3D.readFile(configFile);//TODO fix this 487 //top->AddNode(det3D.getDetector(true),1); 464 488 gRadius = det3D.getTrackerRadius(); 465 489 gHalfLength = det3D.getTrackerHalfLength(); … … 467 491 gEtaAxis = det3D.getCaloAxes().first; 468 492 gPhiAxis = det3D.getCaloAxes().second; 469 TGeoVolume* top = gGeoManager->GetTopVolume()->FindNode("Delphes3DGeometry_1")->GetVolume(); 493 //TGeoVolume* top = gGeoManager->GetTopVolume()->FindNode("Delphes3DGeometry_1")->GetVolume(); 494 TGeoVolume* top = det3D.getDetector(true); 470 495 TEveElementList *geometry = new TEveElementList("Geometry"); 471 496 TEveGeoTopNode* trk = new TEveGeoTopNode(gGeoManager, top->FindNode("tracker_1")); … … 494 519 muon->UseNodeTrans(); 495 520 geometry->AddElement(muon); 521 gGeoManager->DefaultColors(); 496 522 497 523 // Create chain of root trees … … 555 581 // viewers and scenes 556 582 557 TEveCalo3D *calo = new TEveCalo3D(gCaloData);558 calo ->SetBarrelRadius(gRadius*100.0);559 calo ->SetEndCapPos(gHalfLength*100.0);560 561 gStyle->SetPalette(1, 0);583 TEveCalo3D *calo3d = new TEveCalo3D(gCaloData); 584 calo3d->SetBarrelRadius(gRadius*100.0); 585 calo3d->SetEndCapPos(gHalfLength*100.0); 586 587 //gStyle->SetPalette(1, 0); 562 588 TEveCaloLego *lego = new TEveCaloLego(gCaloData); 563 589 lego->InitMainTrans(); … … 568 594 gDelphesDisplay = new DelphesDisplay; 569 595 gEve->AddGlobalElement(geometry); 570 gEve->AddGlobalElement(calo );596 gEve->AddGlobalElement(calo3d); 571 597 gDelphesDisplay->ImportGeomRPhi(geometry); 572 gDelphesDisplay->ImportCaloRPhi(calo );598 gDelphesDisplay->ImportCaloRPhi(calo3d); 573 599 gDelphesDisplay->ImportGeomRhoZ(geometry); 574 gDelphesDisplay->ImportCaloRhoZ(calo );600 gDelphesDisplay->ImportCaloRhoZ(calo3d); 575 601 gDelphesDisplay->ImportCaloLego(lego); 576 602 gEve->Redraw3D(kTRUE); … … 594 620 delphes_read(); 595 621 596 TEveElement* top = gEve->GetCurrentEvent();622 TEveElement* top = (TEveElement*)gEve->GetCurrentEvent(); 597 623 gDelphesDisplay->DestroyEventRPhi(); 598 624 gDelphesDisplay->ImportEventRPhi(top); … … 622 648 623 649 TEveTrackPropagator *trkProp = gTrackList->GetPropagator(); 624 if(event >= gTreeReader->GetEntries()) return;650 if(event_id >= gTreeReader->GetEntries()) return; 625 651 626 652 // Load selected branches with data from specified event … … 694 720 void Fwd() 695 721 { 696 if (event_id < tree->GetEntries() - 1) {722 if (event_id < gTreeReader->GetEntries() - 1) { 697 723 ++event_id; 698 724 load_event(); … … 763 789 const char* Calorimeters="Calorimeter") 764 790 { 791 792 765 793 gSystem->Load("libGeom"); 766 794 gSystem->Load("../libDelphes"); 795 delphes_event_display("delphes_card_CMS.tcl", "../delphes_output.root"); //TODO propagate parameters 796 return; 797 /* 767 798 TGeoManager *geom = new TGeoManager("delphes", "Delphes geometry"); 768 799 … … 836 867 // load_event(); 837 868 // gEve->Redraw3D(kTRUE); // Reset camera after the first event has been shown. 838 } 839 869 */ 870 } 871
Note:
See TracChangeset
for help on using the changeset viewer.