Fork me on GitHub

Changeset 493aa9b in git


Ignore:
Timestamp:
Oct 10, 2014, 10:10:54 PM (10 years ago)
Author:
Christophe Delaere <christophe.delaere@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
c4d879d
Parents:
e0c1ff0
Message:

First working version

Many features are still missing, but that version provides the minimal
features in EventDisplay and in addition: event control and transluscent
geometry.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/geometry.C

    re0c1ff0 r493aa9b  
    157157   TGeoMaterial *matVacuum = new TGeoMaterial("Vacuum", 0,0,0);
    158158   TGeoMaterial *matAl = new TGeoMaterial("Al", 26.98,13,2.7); // placeholder
     159   matVacuum->SetTransparency(85); //TODO: tune
     160   matAl->SetTransparency(85); //TODO: tune
    159161
    160162   //--- define some media
     
    188190   confReader->ReadFile(configFile);
    189191
    190    tk_radius_ = confReader->GetDouble(Form("%s::Radius",ParticlePropagator), 1.0)*100;          // tk_radius
    191    tk_length_ = confReader->GetDouble(Form("%s::HalfLength",ParticlePropagator), 3.0)*100;      // tk_length
     192   tk_radius_ = confReader->GetDouble(Form("%s::Radius",ParticlePropagator), 1.0)*100.;         // tk_radius
     193   tk_length_ = confReader->GetDouble(Form("%s::HalfLength",ParticlePropagator), 3.0)*100.;     // tk_length
    192194   tk_Bz_     = confReader->GetDouble("ParticlePropagator::Bz", 0.0);                           // tk_Bz
    193195
     
    491493   gEtaAxis = det3D.getCaloAxes().first;
    492494   gPhiAxis = det3D.getCaloAxes().second;
     495
     496
     497/*
     498   // make the top container volume -> designed to contain a "big" detector (ATLAS)
     499   TGeoVolume *top = geom->MakeBox("TOP", 0, 1500, 1500, 2300);
     500   geom->SetTopVolume(top);
     501
     502   // build the detector
     503   top->AddNode(det3D.getDetector(true),1);
     504   geom->CloseGeometry();
     505
     506   gGeoManager->DefaultColors();
     507
     508   TGeoVolume* top = gGeoManager->GetTopVolume()->FindNode("Delphes3DGeometry_1")->GetVolume();
     509
     510   TEveGeoTopNode* trk = new TEveGeoTopNode(gGeoManager, top->FindNode("tracker_1"));
     511   trk->SetVisLevel(6);
     512   gEve->AddGlobalElement(trk);
     513
     514   TEveGeoTopNode* calo = new TEveGeoTopNode(gGeoManager, top->FindNode("Calorimeter_barrel_1"));
     515   calo->SetVisLevel(3);
     516   gEve->AddGlobalElement(calo);
     517   calo = new TEveGeoTopNode(gGeoManager, top->FindNode("Calorimeter_endcap_1"));
     518   calo->SetVisLevel(3);
     519   calo->UseNodeTrans();
     520   gEve->AddGlobalElement(calo);
     521   calo = new TEveGeoTopNode(gGeoManager, top->FindNode("Calorimeter_endcap_2"));
     522   calo->SetVisLevel(3);
     523   calo->UseNodeTrans();
     524   gEve->AddGlobalElement(calo);
     525
     526   TEveGeoTopNode* muon = new TEveGeoTopNode(gGeoManager, top->FindNode("muons_barrel_1"));
     527   muon->SetVisLevel(4);
     528   gEve->AddGlobalElement(muon);
     529   muon = new TEveGeoTopNode(gGeoManager, top->FindNode("muons_endcap_1"));
     530   muon->SetVisLevel(4);
     531   muon->UseNodeTrans();
     532   gEve->AddGlobalElement(muon);
     533   muon = new TEveGeoTopNode(gGeoManager, top->FindNode("muons_endcap_2"));
     534   muon->SetVisLevel(4);
     535   muon->UseNodeTrans();
     536   gEve->AddGlobalElement(muon);
     537
     538*/
     539
     540
    493541   //TGeoVolume* top = gGeoManager->GetTopVolume()->FindNode("Delphes3DGeometry_1")->GetVolume();
    494    TGeoVolume* top = det3D.getDetector(true);
     542   //TGeoVolume* top = det3D.getDetector(true);
     543   TGeoVolume* top = det3D.getDetector(false); //TODO: can this be set in the GUI?
     544   geom->SetTopVolume(top);
    495545   TEveElementList *geometry = new TEveElementList("Geometry");
    496546   TEveGeoTopNode* trk = new TEveGeoTopNode(gGeoManager, top->FindNode("tracker_1"));
     
    519569   muon->UseNodeTrans();
    520570   geometry->AddElement(muon);
    521    gGeoManager->DefaultColors();
     571   //gGeoManager->DefaultColors();
    522572
    523573   // Create chain of root trees
     
    576626   TEveTrackPropagator *trkProp = gTrackList->GetPropagator();
    577627   trkProp->SetMagField(0.0, 0.0, -gBz);
    578    trkProp->SetMaxR(gRadius*100.0);
    579    trkProp->SetMaxZ(gHalfLength*100.0);
     628   trkProp->SetMaxR(gRadius);
     629   trkProp->SetMaxZ(gHalfLength);
    580630
    581631   // viewers and scenes
    582632
    583633   TEveCalo3D *calo3d = new TEveCalo3D(gCaloData);
    584    calo3d->SetBarrelRadius(gRadius*100.0);
    585    calo3d->SetEndCapPos(gHalfLength*100.0);
     634   calo3d->SetBarrelRadius(gRadius);
     635   calo3d->SetEndCapPos(gHalfLength);
    586636
    587637   //gStyle->SetPalette(1, 0);
     
    699749    eveJetCone->SetMainTransparency(60);
    700750    eveJetCone->SetLineColor(kYellow);
    701     eveJetCone->SetCylinder(gRadius*100.0 - 10, gHalfLength*100.0 - 10);
     751    eveJetCone->SetCylinder(gRadius - 10, gHalfLength - 10);
    702752    eveJetCone->SetPickable(kTRUE);
    703753    eveJetCone->AddEllipticCone(jet->Eta, jet->Phi, jet->DeltaEta, jet->DeltaPhi);
     
    793843   gSystem->Load("libGeom");
    794844   gSystem->Load("../libDelphes");
     845
    795846   delphes_event_display("delphes_card_CMS.tcl", "../delphes_output.root"); //TODO propagate parameters
    796    return;
     847   make_gui();
     848   load_event();
     849   gEve->Redraw3D(kTRUE); // Reset camera after the first event has been shown.
     850
     851   // EClipType not exported to CINT (see TGLUtil.h):
     852   // 0 - no clip, 1 - clip plane, 2 - clip box
     853   TGLViewer *v = gEve->GetDefaultGLViewer();
     854   Double_t plane[4] = { 0., 1., 0., 0. };
     855   //v->GetClipSet()->SetClipState(1,plane);
     856   //v->GetClipSet()->SetClipType(1);
     857   //v->ColorSet().Background().SetColor(kMagenta+4);
     858   //v->SetGuideState(TGLUtil::kAxesEdge, kTRUE, kFALSE, 0);
     859   v->RefreshPadEditor(v);
     860   v->CurrentCamera().RotateRad(-1.2, 0.5);
     861   v->DoDraw();
     862
    797863/*
    798864   TGeoManager *geom = new TGeoManager("delphes", "Delphes geometry");
     
    863929   v->CurrentCamera().RotateRad(-1.2, 0.5);
    864930   v->DoDraw();
    865 
    866    make_gui();
    867    // load_event();
    868    // gEve->Redraw3D(kTRUE); // Reset camera after the first event has been shown.
    869    */
    870 }
    871 
     931*/
     932}
     933
Note: See TracChangeset for help on using the changeset viewer.