FairRoot/PandaRoot
geoconvert.C
Go to the documentation of this file.
1 
2 // #include<>
3 // #include<>
4 // #include<>
5 // #include<>
6 // #include<>
7 // #include<>
8 // #include<>
9 // #include<>
10 // #include<>
11 // #include<>
12 
14 {
15 
16  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
17  basiclibs();
18 
19  gSystem->Load("libGeoBase");
20  gSystem->Load("libParBase");
21  gSystem->Load("libBase");
22  gSystem->Load("libField");
23  gSystem->Load("libGen");
24  gSystem->Load("libPassive");
25  gSystem->Load("libPndData");
26 // gSystem->Load("libStt1");
28 // gSystem->Load("libMuo");
29 // gSystem->Load("libEmc");
30  gSystem->Load("libMvd");
31 // gSystem->Load("libDrc");
32 
33  gSystem->Load("libGeom.so");
34 
35  TFile* file = new TFile("../../../geometry/MVD_20a.root");
36 // TFile* outfile = new TFile("../../../geometry/MVD_20a_vol.root","RECREATE");
37  TGeoManager *geoMan = (TGeoManager*) file->Get("CADtoROOT");
38 
39 // TFile* file = new TFile("../data/mvdevalg4.root");
40 // TGeoManager *geoMan = (TGeoManager*) file->Get("FAIRGeom");
41 
42 // TCanvas* c1 = new TCanvas("c1", "", 100, 100, 1100, 1100);
43 // c1->SetFillColor(10);
44 
45  // Number of folded geo levels; 8 for mvd.
46  // Try to change the number and to see how the geometry changes.
47 // geoMan->SetVisLevel(180);
48 // geoMan->DefaultColors();
49  TGeoVolume* topvol = geoMan->GetMasterVolume();
50  //topvol->Draw("ogl");
51 // outfile->cd();
52 // topvol->Write();
53  epandnode(topvol->GetNode());
54  topvol->Export("../../../geometry/MVD_20a_vol.root","TOP","recreate");
55 
56 std::cout<<"------------------------------"<<std::endl;
57 std::cout<<"------------------------------"<<std::endl;
58 std::cout<<"------------------------------"<<std::endl;
59 
60 // geoMan->GetListOfVolumes()->Print();
61  return 0;
62 }
63 
64 int expandnode(TGeoNode* fN)
65 {
66  TGeoVolume *v1=fN->GetVolume();
67  TObjArray *NodeList=v1->GetNodes();
68  for (Int_t Nod=0; Nod<NodeList->GetEntriesFast();Nod++) {
69  TGeoNode *fNode =(TGeoNode *)NodeList->At(Nod);
70  if(fNode->GetNdaughters()>0) expandnode(fNode);
71  TGeoVolume *v= fNode->GetVolume();
72  TGeoMedium* med1=v->GetMedium();
73  if(!med1){
74  std::cout<<" -W- WARNING in PndMvdDetector::ExpandNode()! "
75  <<"\tThe volume "<<v->GetName()<<"in\n"
76  <</*gGeoManager->GetPath()<<*/"\nHas no medium information. It is forced now to LEAD"
77  <<std::endl;
78 // v->SetMaterial("lead");
79  }
80  }
81  return 0;
82 }
83 
84 
85 
basiclibs()
TFile * file
TGeoManager * geoMan
__m128 v
Definition: P4_F32vec4.h:4
TGeoVolume * topvol
int expandnode(TGeoNode *fN)
Definition: geoconvert.C:64
TVector3 v1
Definition: bump_analys.C:40
int geoconvert()
Definition: geoconvert.C:13