#include <iostream>
#include "TGeoManager.h"
#include "TGeoNode.h"
#include "TEveGeoNode.h"
#include "TEveGeoShape.h"
#include "TEveManager.h"
#include "TFile.h"
#include "TGLViewer.h"
#include "AliEveHltGeometry.h"
ClassImp(AliEveHltGeometry)
using namespace std;
AliEveHltGeometry::AliEveHltGeometry() {
}
AliEveHltGeometry::~AliEveHltGeometry() {
}
TEveGeoShape * AliEveHltGeometry::CreateGentleGeometry( Bool_t register_as_global) {
TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo.root");
TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
f.Close();
TEveElement* elTRD = gsre->FindChild("TRD+TOF");
elTRD->SetRnrState(kFALSE);
TEveElement* elHMPID = gsre->FindChild("HMPID");
elHMPID->SetRnrState(kFALSE);
TEveElement* elPHOS = gsre->FindChild("PHOS");
elPHOS->SetRnrState(kTRUE);
elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE);
elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE);
if (register_as_global) {
gEve->AddGlobalElement(gsre);
}
return gsre;
}
TEveGeoTopNode * AliEveHltGeometry::CreateEmcalGeometry(TGeoManager * manager) {
if(gGeoManager) cout << "have the manager"<<endl;
else cout << "we don't "<<endl;
TGeoVolume * volume = manager->GetTopVolume();
if(!volume) cout << "no volume"<<endl;
TGeoNode * gEMCALNode = manager->GetTopVolume()->FindNode("XEN1_1");
TEveGeoTopNode* emcal_re = new TEveGeoTopNode(gGeoManager, gEMCALNode);
emcal_re->SetVisLevel(1);
for(Int_t i = 4; i < 11; i++) {
emcal_re->FindChild(Form("SMOD_%d", i))->SetRnrState(kFALSE);
}
emcal_re->FindChild("SM10_1")->SetRnrState(kFALSE);
emcal_re->FindChild("SM10_2")->SetRnrState(kFALSE);
gEve->AddGlobalElement(emcal_re);
return emcal_re;
}
TEveGeoShape* AliEveHltGeometry::geom_gentle_rphi() {
TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root");
TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
f.Close();
TEveElement* elPHOS = gsre->FindChild("PHOS");
elPHOS->SetRnrState(kTRUE);
elPHOS->FindChild("PHOS_4")->SetRnrState(kFALSE);
elPHOS->FindChild("PHOS_5")->SetRnrState(kFALSE);
return gsre;
}
TEveGeoShape* AliEveHltGeometry::geom_gentle_rhoz() {
TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root");
TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
f.Close();
return gsre;
}
TEveGeoShape* AliEveHltGeometry::geom_gentle_trd() {
TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_trd.root");
TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle TRD");
TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
gEve->AddGlobalElement(gsre);
f.Close();
Int_t sm = 0;
gsre->SetRnrSelf(kFALSE);
for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i) {
TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
lvl1->SetRnrSelf(kFALSE);
for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j) {
TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
if ( sm == 0 || sm == 1 || sm == 7 || sm == 8 || sm == 9 || sm == 10 || sm == 17 )
lvl2->SetRnrSelf(kTRUE);
else
lvl2->SetRnrSelf(kFALSE);
lvl2->SetMainColor(3);
lvl2->SetMainTransparency(80);
++sm;
}
}
return gsre;
}
TEveGeoShape* AliEveHltGeometry::geom_gentle_muon(Bool_t updateScene) {
TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo_muon.root");
TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle MUON");
TEveGeoShape* gsre = TEveGeoShape::ImportShapeExtract(gse);
gEve->AddGlobalElement(gsre);
f.Close();
gsre->SetRnrSelf(kFALSE);
DrawDeep(gsre);
if ( updateScene ) {
TGLViewer* v = gEve->GetDefaultGLViewer();
v->UpdateScene();
}
return gsre;
}
void AliEveHltGeometry::DrawDeep(TEveGeoShape *gsre) {
for (TEveElement::List_i i = gsre->BeginChildren(); i != gsre->EndChildren(); ++i) {
TEveGeoShape* lvl = (TEveGeoShape*) *i;
lvl->SetRnrSelf(kFALSE);
if (!lvl->HasChildren()) {
lvl->SetRnrSelf(kTRUE);
lvl->SetMainColor(3);
lvl->SetMainTransparency(50);
}
DrawDeep(lvl);
}
}
AliEveHltGeometry.cxx:100 AliEveHltGeometry.cxx:101 AliEveHltGeometry.cxx:102 AliEveHltGeometry.cxx:103 AliEveHltGeometry.cxx:104 AliEveHltGeometry.cxx:105 AliEveHltGeometry.cxx:106 AliEveHltGeometry.cxx:107 AliEveHltGeometry.cxx:108 AliEveHltGeometry.cxx:109 AliEveHltGeometry.cxx:110 AliEveHltGeometry.cxx:111 AliEveHltGeometry.cxx:112 AliEveHltGeometry.cxx:113 AliEveHltGeometry.cxx:114 AliEveHltGeometry.cxx:115 AliEveHltGeometry.cxx:116 AliEveHltGeometry.cxx:117 AliEveHltGeometry.cxx:118 AliEveHltGeometry.cxx:119 AliEveHltGeometry.cxx:120 AliEveHltGeometry.cxx:121 AliEveHltGeometry.cxx:122 AliEveHltGeometry.cxx:123 AliEveHltGeometry.cxx:124 AliEveHltGeometry.cxx:125 AliEveHltGeometry.cxx:126 AliEveHltGeometry.cxx:127 AliEveHltGeometry.cxx:128 AliEveHltGeometry.cxx:129 AliEveHltGeometry.cxx:130 AliEveHltGeometry.cxx:131 AliEveHltGeometry.cxx:132 AliEveHltGeometry.cxx:133 AliEveHltGeometry.cxx:134 AliEveHltGeometry.cxx:135 AliEveHltGeometry.cxx:136 AliEveHltGeometry.cxx:137 AliEveHltGeometry.cxx:138 AliEveHltGeometry.cxx:139 AliEveHltGeometry.cxx:140 AliEveHltGeometry.cxx:141 AliEveHltGeometry.cxx:142 AliEveHltGeometry.cxx:143 AliEveHltGeometry.cxx:144 AliEveHltGeometry.cxx:145 AliEveHltGeometry.cxx:146 AliEveHltGeometry.cxx:147 AliEveHltGeometry.cxx:148 AliEveHltGeometry.cxx:149 AliEveHltGeometry.cxx:150 AliEveHltGeometry.cxx:151 AliEveHltGeometry.cxx:152 AliEveHltGeometry.cxx:153 AliEveHltGeometry.cxx:154 AliEveHltGeometry.cxx:155 AliEveHltGeometry.cxx:156 AliEveHltGeometry.cxx:157 AliEveHltGeometry.cxx:158 AliEveHltGeometry.cxx:159 AliEveHltGeometry.cxx:160 AliEveHltGeometry.cxx:161 AliEveHltGeometry.cxx:162 AliEveHltGeometry.cxx:163 AliEveHltGeometry.cxx:164 AliEveHltGeometry.cxx:165 AliEveHltGeometry.cxx:166 AliEveHltGeometry.cxx:167 AliEveHltGeometry.cxx:168 AliEveHltGeometry.cxx:169 AliEveHltGeometry.cxx:170 AliEveHltGeometry.cxx:171 AliEveHltGeometry.cxx:172 AliEveHltGeometry.cxx:173 AliEveHltGeometry.cxx:174 AliEveHltGeometry.cxx:175 AliEveHltGeometry.cxx:176 AliEveHltGeometry.cxx:177 AliEveHltGeometry.cxx:178 AliEveHltGeometry.cxx:179