当前位置: 首页>>代码示例>>C++>>正文


C++ TGeoVolume::AddNode方法代码示例

本文整理汇总了C++中TGeoVolume::AddNode方法的典型用法代码示例。如果您正苦于以下问题:C++ TGeoVolume::AddNode方法的具体用法?C++ TGeoVolume::AddNode怎么用?C++ TGeoVolume::AddNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TGeoVolume的用法示例。


在下文中一共展示了TGeoVolume::AddNode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getBeamVisuals

void getBeamVisuals(TGeoManager* geom, TGeoVolume* top, float minZ, float maxZ) {
    TGeoMaterial *matVacuum = new TGeoMaterial("Vacuum", 0,0,0);
    TGeoMedium *Vacuum = new TGeoMedium("Vacuum",1, matVacuum);
    TGeoVolume *xyaxis = geom->MakeBox( "xyaxis", Vacuum, 90., 90., 40. );

    TGeoMaterial *matAl = new TGeoMaterial("Al", 26.98,13,2.7);
    TGeoMedium *Al = new TGeoMedium("Root Material",1, matAl);
    //TGeoVolume *line = geom->MakeTube( "BeamLine", Al, 0, .3, (maxZ - minZ) / 2 + 5);
    TGeoVolume *xaxis = geom->MakeTube( "XAxis", Al, 0, .1, 30.);
    TGeoVolume *yaxis = geom->MakeTube( "YAxis", Al, 0, .1, 30.);
    //TGeoVolume *pipe = geom->MakeTube( "BeamPipe", Al, _piperadius-.05, _piperadius+.05, (maxZ - minZ) / 2 + 5);
    //line->SetLineColor(kRed);
    xaxis->SetLineColor(kBlue);
    yaxis->SetLineColor(kBlue);
    //pipe->SetLineColor(kBlack);

    xyaxis->AddNode(xaxis, 1, new TGeoRotation( "rtyz", 0, 90, 0));
    xyaxis->AddNode(yaxis, 1, new TGeoRotation( "rtxz", 90, 90, 0));
    
    TGeoCombiTrans * pipecenter = new TGeoCombiTrans( *new TGeoTranslation(_pipexcoord, _pipeycoord, 0), *new TGeoRotation());
    //TGeoCombiTrans * linecenter = new TGeoCombiTrans( *new TGeoTranslation(_linexcoord, _lineycoord, 0), *new TGeoRotation());
    //top->AddNode( pipe, 1, pipecenter);
    //top->AddNode( line, 1, linecenter);
    top->AddNode( xyaxis, 1, pipecenter);
}
开发者ID:DesyTau,项目名称:cmssw,代码行数:25,代码来源:visualizationTracker.C

示例2: Show

void Visualizer::Show(){

  std::cout<<"=============================================="<<std::endl;
  std::cout<<"========= Inside Expected SHOW() ============="<<std::endl;
  std::cout<<"=============================================="<<std::endl;

  TGeoVolume *top = gGeoManager->MakeBox("Top", NULL, kInfinity, kInfinity, kInfinity);
  gGeoManager->SetTopVolume(top);
  for(int i = 0 ; i < fVolumes.size() ; i++){
  top->AddNode(std::get<0>(fVolumes[i]), 1 , std::get<1>(fVolumes[i]));

  }

  top->SetLineColor(kGreen);
  gGeoManager->CloseGeometry();
  #ifndef USE_OGL
  top->Draw();
  #else
  top->Draw("ogl"); //to display the geometry using openGL
  #endif
  //
  //TPad::x3d("OPENGL");
  gGeoManager->Export("plane.root");
  //top->Export("planeTop.root");
  //fApp->Run();
}
开发者ID:vatsal512,项目名称:MuonTomography,代码行数:26,代码来源:Visualizer.cpp

示例3: create_tof_bar

TGeoVolume* create_tof_bar(Float_t dx, Float_t dy, Float_t dz)
{
  // needed materials
  TGeoMedium* boxVolMed = gGeoMan->GetMedium(BoxVolumeMedium);
  TGeoMedium* airVolMed = gGeoMan->GetMedium(KeepingVolumeMedium);
   
  Float_t width_alux=Pole_Thick_X;
  Float_t width_aluy=Pole_Thick_Y;
  Float_t width_aluz=Pole_Thick_Z;
  
  TGeoVolume* bar = new TGeoVolumeAssembly("Bar");
  TGeoBBox*   bar_alu_box = new TGeoBBox("", dx/2., dy/2., dz/2.);
  TGeoVolume* bar_alu_vol = 
    new TGeoVolume("bar_alu", bar_alu_box, boxVolMed);
  bar_alu_vol->SetLineColor(kGreen); // set line color for the alu box
  bar_alu_vol->SetTransparency(20); // set transparency for the TOF
  TGeoTranslation* bar_alu_trans 
    = new TGeoTranslation("", 0., 0., 0.);
  bar->AddNode(bar_alu_vol, 0, bar_alu_trans);

  TGeoBBox* bar_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
  TGeoVolume* bar_air_vol = 
    new TGeoVolume("bar_air", bar_air_box, airVolMed);
  bar_air_vol->SetLineColor(kYellow); // set line color for the alu box
  bar_air_vol->SetTransparency(70);   // set transparency for the TOF
  TGeoTranslation* bar_air_trans 
    = new TGeoTranslation("", 0., 0., 0.);
  bar_alu_vol->AddNode(bar_air_vol, 0, bar_air_trans);

  return bar;
}
开发者ID:NicolasWinckler,项目名称:CbmRoot,代码行数:31,代码来源:Create_TOF_Geometry_v13_3b.C

示例4: create_tof_pole

TGeoVolume* create_tof_pole()
{
  // needed materials
  TGeoMedium* boxVolMed   = gGeoMan->GetMedium(BoxVolumeMedium);
  TGeoMedium* airVolMed   = gGeoMan->GetMedium(KeepingVolumeMedium);
   
  Float_t dx=Pole_Size_X;
  Float_t dy=Pole_Size_Y;
  Float_t dz=Pole_Size_Z;
  Float_t width_alux=Pole_Thick_X;
  Float_t width_aluy=Pole_Thick_Y;
  Float_t width_aluz=Pole_Thick_Z;
  
  TGeoVolume* pole = new TGeoVolumeAssembly("Pole");
  TGeoBBox*   pole_alu_box = new TGeoBBox("", dx/2., dy/2., dz/2.);
  TGeoVolume* pole_alu_vol = 
    new TGeoVolume("pole_alu", pole_alu_box, boxVolMed);
  pole_alu_vol->SetLineColor(kGreen); // set line color for the alu box
  pole_alu_vol->SetTransparency(20); // set transparency for the TOF
  TGeoTranslation* pole_alu_trans 
    = new TGeoTranslation("", 0., 0., 0.);
  pole->AddNode(pole_alu_vol, 0, pole_alu_trans);

  TGeoBBox* pole_air_box = new TGeoBBox("", dx/2.-width_alux, dy/2.-width_aluy, dz/2.-width_aluz);
  TGeoVolume* pole_air_vol = 
    new TGeoVolume("pole_air", pole_air_box, airVolMed);
  pole_air_vol->SetLineColor(kYellow); // set line color for the alu box
  pole_air_vol->SetTransparency(70); // set transparency for the TOF
  TGeoTranslation* pole_air_trans 
    = new TGeoTranslation("", 0., 0., 0.);
  pole_alu_vol->AddNode(pole_air_vol, 0, pole_air_trans);

  return pole;
}
开发者ID:NicolasWinckler,项目名称:CbmRoot,代码行数:34,代码来源:Create_TOF_Geometry_v13_3b.C

示例5: create_tof_module

TGeoVolume* create_tof_module(Int_t modType)
{
  Int_t cType = CounterTypeInModule[modType];
  Float_t dx=Module_Size_X[modType];
  Float_t dy=Module_Size_Y[modType];
  Float_t dz=Module_Size_Z[modType];
  Float_t width_aluxl=Module_Thick_Alu_X_left;
  Float_t width_aluxr=Module_Thick_Alu_X_right;
  Float_t width_aluy=Module_Thick_Alu_Y;
  Float_t width_aluz=Module_Thick_Alu_Z;

  Float_t shift_gas_box = (Module_Thick_Alu_X_right - Module_Thick_Alu_X_left)/2;

  Float_t dxpos=CounterXDistance[modType];
  Float_t startxpos=CounterXStartPosition[modType];
  Float_t dzoff=CounterZDistance[modType];
  Float_t rotangle=CounterRotationAngle[modType];

  TGeoMedium* boxVolMed          = gGeoMan->GetMedium(BoxVolumeMedium);
  TGeoMedium* noActiveGasVolMed  = gGeoMan->GetMedium(NoActivGasMedium);

  TString moduleName = Form("module_%d", modType);
  TGeoVolume* module = new TGeoVolumeAssembly(moduleName);

  TGeoBBox* alu_box = new TGeoBBox("", dx/2., dy/2., dz/2.);
  TGeoVolume* alu_box_vol = 
    new TGeoVolume("alu_box", alu_box, boxVolMed);
  alu_box_vol->SetLineColor(kGreen); // set line color for the alu box
  alu_box_vol->SetTransparency(20); // set transparency for the TOF
  TGeoTranslation* alu_box_trans 
    = new TGeoTranslation("", 0., 0., 0.);
  module->AddNode(alu_box_vol, 0, alu_box_trans);

  TGeoBBox* gas_box = new TGeoBBox("", (dx-(width_aluxl+width_aluxr))/2., (dy-2*width_aluy)/2., (dz-2*width_aluz)/2.);
  TGeoVolume* gas_box_vol = 
    new TGeoVolume("gas_box", gas_box, noActiveGasVolMed);
  gas_box_vol->SetLineColor(kYellow); // set line color for the gas box
  gas_box_vol->SetTransparency(70); // set transparency for the TOF
  TGeoTranslation* gas_box_trans 
    = new TGeoTranslation("", shift_gas_box, 0., 0.);
  alu_box_vol->AddNode(gas_box_vol, 0, gas_box_trans);
  
  for (Int_t j=0; j<5; j++){ //loop over counters (modules)
    Float_t zpos;
    if (0 == modType) {
      zpos = dzoff *=-1;
    } else {
      zpos = 0.;
    }
    TGeoTranslation* counter_trans 
      = new TGeoTranslation("", startxpos+ j*dxpos , 0.0 , zpos);

    TGeoRotation* counter_rot = new TGeoRotation();
    counter_rot->RotateY(rotangle);
    TGeoCombiTrans* counter_combi_trans = new TGeoCombiTrans(*counter_trans, *counter_rot);
    gas_box_vol->AddNode(gCounter[cType], j, counter_combi_trans);
  }

  return module;
}
开发者ID:NicolasWinckler,项目名称:CbmRoot,代码行数:60,代码来源:Create_TOF_Geometry_v13_3b.C

示例6: s_intersection

void s_intersection()
{
   gROOT->GetListOfCanvases()->Delete();
   TCanvas *c = new TCanvas("composite shape", "Intersection boolean operation", 700, 1000);

   c->Divide(1,2,0,0);
   c->cd(2);
   gPad->SetPad(0,0,1,0.4);
   c->cd(1);
   gPad->SetPad(0,0.4,1,1);
   
   if (gGeoManager) delete gGeoManager;
   
   new TGeoManager("xtru", "poza12");
   TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7);
   TGeoMedium *med = new TGeoMedium("MED",1,mat);
   TGeoVolume *top = gGeoManager->MakeBox("TOP",med,100,100,100);
   gGeoManager->SetTopVolume(top);

   // define shape components with names
   TGeoBBox *box = new TGeoBBox("bx", 40., 40., 40.); 
   TGeoSphere *sph = new TGeoSphere("sph", 40., 45.);
   // define named geometrical transformations with names
   TGeoTranslation *tr = new TGeoTranslation(0., 0., 45.);
   tr->SetName("tr");
   // register all used transformations
   tr->RegisterYourself();
   // create the composite shape based on a Boolean expression
   TGeoCompositeShape *cs = new TGeoCompositeShape("mir", "sph:tr * bx");

   TGeoVolume *vol = new TGeoVolume("COMP2",cs);
   top->AddNode(vol,1);
   gGeoManager->CloseGeometry();
   gGeoManager->SetNsegments(100);
   top->Draw();
   MakePicture();

   c->cd(2);

   TPaveText *pt = new TPaveText(0.01,0.01,0.99,0.99);

   pt->SetLineColor(1);

   TText *text = pt->AddText("TGeoCompositeShape - composite shape class");

   text->SetTextColor(2);
   pt->AddText("----- Here is an example of boolean intersection operation : A * B");
   pt->AddText("----- A == sphere (with inner radius non-zero), B == box");
   pt->AddText(" ");
   pt->SetAllWith("-----","color",4);
   pt->SetAllWith("-----","font",72);
   pt->SetAllWith("-----","size",0.04);
   pt->SetTextAlign(12);
   pt->SetTextSize(0.044);
   pt->Draw();
   c->cd(1);
}
开发者ID:alcap-org,项目名称:AlcapDAQ,代码行数:57,代码来源:csgdemo.C

示例7: Create_TOF_Geometry_v12a

void Create_TOF_Geometry_v12a() {
  // Load the necessary FairRoot libraries 
  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
  basiclibs();
  gSystem->Load("libGeoBase");
  gSystem->Load("libParBase");
  gSystem->Load("libBase");

  // Load needed material definition from media.geo file
  create_materials_from_media_file();

  // Get the GeoManager for later usage
  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
  gGeoMan->SetVisLevel(7);  

  // Create the top volume 
  /*
  TGeoBBox* topbox= new TGeoBBox("", 1000., 1000., 1000.);
  TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
  gGeoMan->SetTopVolume(top);
  */

  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
  gGeoMan->SetTopVolume(top);
 
  TGeoVolume* tof = new TGeoVolumeAssembly(geoVersion);
  top->AddNode(tof, 1);
  
  for(Int_t counterType = 0; counterType < NumberOfDifferentCounterTypes; counterType++) { 
    gCounter = create_new_counter(counterType);
  }

  for(Int_t moduleType = 0; moduleType < NofModuleTypes; moduleType++) { 
    gModules[moduleType] = create_new_tof_module(moduleType);
  }

  gPole = create_tof_pole();

  position_tof_poles();
  position_inner_tof_modules();
  position_outer_tof_modules();
  

  gGeoMan->CloseGeometry();
  gGeoMan->CheckOverlaps(0.001);
  gGeoMan->PrintOverlaps();
  gGeoMan->Test();

  TFile* outfile = new TFile(FileName,"RECREATE");
  top->Write();
  //gGeoMan->Write();
  outfile->Close();
  //  top->Draw("ogl");
  //top->Raytrace();

}
开发者ID:NicolasWinckler,项目名称:CbmRoot,代码行数:56,代码来源:Create_TOF_Geometry_v12a.C

示例8: if

void KVFAZIALNS2016::BuildFAZIA()
{
   //Build geometry of FAZIASYM
   //All telescopes are : Si(300µm)-Si(500µm)-CsI(10cm)
   //No attempt has been made to implement real thicknesses
   //
   Info("BuildFAZIA", "Compact geometry, %f cm from target",
        fFDist);

   TGeoVolume* top = gGeoManager->GetTopVolume();

   Double_t distance_block_cible = fFDist * KVUnits::cm;
   Double_t thick_si1 = 300 * KVUnits::um;
   TGeoTranslation trans;
   trans.SetDz(distance_block_cible + thick_si1 / 2.);

   KVFAZIABlock* block = new KVFAZIABlock;

   TGeoRotation rot1, rot2;
   TGeoHMatrix h;
   TGeoHMatrix* ph = 0;
   Double_t theta = 0;
   Double_t phi = 0;

   Double_t theta_min = fFThetaMin;//smallest lab polar angle in degrees
   Double_t centre_hole = 2.*tan(theta_min * TMath::DegToRad()) * distance_block_cible;
   Double_t dx = (block->GetTotalSideWithBlindage()) / 2.;

   TVector3 centre;
   for (Int_t bb = 0; bb < fNblocks; bb += 1) {

      if (bb == 1)        centre.SetXYZ(-1 * (dx - centre_hole / 2), -dx - centre_hole / 2, distance_block_cible);
      else if (bb == 2)   centre.SetXYZ(-1 * (dx + centre_hole / 2), dx - centre_hole / 2, distance_block_cible);
      else if (bb == 3)   centre.SetXYZ(-1 * (-dx + centre_hole / 2), dx + centre_hole / 2, distance_block_cible);
      else if (bb == 0)   centre.SetXYZ(-1 * (-dx - centre_hole / 2), -dx + centre_hole / 2, distance_block_cible);
      else if (bb == 4)   centre.SetXYZ(-1 * (-dx - centre_hole / 2), -3 * dx + centre_hole / 2, distance_block_cible); //centre.SetXYZ(-1 * (dx - centre_hole / 2), -3 * dx - centre_hole / 2, distance_block_cible);
      else {
         Warning("BuildFAZIA", "Block position definition is done only for %d blocks", fNblocks);
      }
      theta = centre.Theta() * TMath::RadToDeg();
      phi = centre.Phi() * TMath::RadToDeg();
      printf("BLK #%d => theta=%1.2lf - phi=%1.2lf\n", bb, theta, phi);

      rot2.SetAngles(phi + 90., theta, 0.);
      rot1.SetAngles(-1.*phi, 0., 0.);
      h = rot2 * trans * rot1;
      ph = new TGeoHMatrix(h);
      top->AddNode(block, bb, ph);
   }

   // add telescope for elastic scattering monitoring
//   RutherfordTelescope();
   // Change default geometry import angular range for rutherford telescope
   SetGeometryImportParameters(.25, 1., 1.84);
}
开发者ID:FableQuentin,项目名称:kaliveda,代码行数:55,代码来源:KVFAZIALNS2016.cpp

示例9: s_difference

void s_difference()
{
   gROOT->GetListOfCanvases()->Delete();
   TCanvas *c = new TCanvas("composite shape", "Difference boolean operation", 700, 1000);

   c->Divide(1,2,0,0);
   c->cd(2);
   gPad->SetPad(0,0,1,0.4);
   c->cd(1);
   gPad->SetPad(0,0.4,1,1);
   
   if (gGeoManager) delete gGeoManager;
   
   new TGeoManager("xtru", "poza12");
   TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7);
   TGeoMedium *med = new TGeoMedium("MED",1,mat);
   TGeoVolume *top = gGeoManager->MakeBox("TOP",med,100,100,100);
   gGeoManager->SetTopVolume(top);

   // define shape components with names
   TGeoTorus *tor = new TGeoTorus("tor", 45., 15., 20., 45., 145.); 
   TGeoSphere *sph = new TGeoSphere("sph", 20., 45., 0., 180., 0., 270.);
   // create the composite shape based on a Boolean expression
   TGeoCompositeShape *cs = new TGeoCompositeShape("mir", "sph - tor");

   TGeoVolume *vol = new TGeoVolume("COMP3",cs);
   top->AddNode(vol,1);
   gGeoManager->CloseGeometry();
   gGeoManager->SetNsegments(60);
   top->Draw();
   MakePicture();

   c->cd(2);

   TPaveText *pt = new TPaveText(.01, .01, .99, .99);

   pt->SetLineColor(1);

   TText *text = pt->AddText("TGeoCompositeShape - composite shape class");

   text->SetTextColor(2);

   pt->AddText("----- It's an example of boolean difference: A - B");
   pt->AddText("----- A == part of sphere (0-180, 0-270), B == partial torus (45-145)");
   pt->AddText(" ");
   pt->SetAllWith("-----","color",4);
   pt->SetAllWith("-----","font",72);
   pt->SetAllWith("-----","size",0.04);
   pt->SetTextAlign(12);
   pt->SetTextSize(0.044);
   pt->Draw();
   c->cd(1);
}
开发者ID:alcap-org,项目名称:AlcapDAQ,代码行数:53,代码来源:csgdemo.C

示例10: ATTPC_d2He

void ATTPC_d2He() {
  // Load the necessary FairRoot libraries 
  //gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
  //basiclibs();
  //gSystem->Load("libGeoBase");
  //gSystem->Load("libParBase");
  //gSystem->Load("libBase");

  // Load needed material definition from media.geo file
  create_materials_from_media_file();

  // Get the GeoManager for later usage
  gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
  gGeoMan->SetVisLevel(7);  

  // Create the top volume 

  TGeoVolume* top = new TGeoVolumeAssembly("TOP");
  gGeoMan->SetTopVolume(top);
 
  TGeoMedium* gas   = gGeoMan->GetMedium(MediumVacuum);
  TGeoVolume* tpcvac = new TGeoVolumeAssembly(geoVersion);
  tpcvac -> SetMedium(gas);
  top->AddNode(tpcvac, 1);
  
  gModules = create_detector();

  //position_detector();
 
  cout<<"Voxelizing."<<endl;
  top->Voxelize("");
  gGeoMan->CloseGeometry();

  //add_alignable_volumes();

  gGeoMan->CheckOverlaps(0.001);
  gGeoMan->PrintOverlaps();
  gGeoMan->Test();

  TFile* outfile = new TFile(FileName,"RECREATE");
  top->Write();
  outfile->Close();

  TFile* outfile1 = new TFile(FileName1,"RECREATE");
  gGeoMan->Write();
  outfile1->Close();

    top->Draw("ogl");
  //top->Raytrace();

}
开发者ID:ATTPC,项目名称:ATTPCROOTv2,代码行数:51,代码来源:ATTPC_d2He.C

示例11: makeGeom

void makeGeom()
{
  //--- Definition of a simple geometry
  //   gSystem->Load("libGeom");
   new TGeoManager("genfitGeom", "GENFIT geometry");
   gROOT->Macro("../../geometry/media.C");


   TGeoMedium *air = gGeoManager->GetMedium("air");
   assert(air!=NULL);
   TGeoMedium *vacuum = gGeoManager->GetMedium("vacuum");
   assert(vacuum!=NULL);
   TGeoMedium *sil = gGeoManager->GetMedium("silicon");
   assert(sil!=NULL);

   TGeoVolume *top = gGeoManager->MakeBox("TOPPER", air, 500., 500., 500.);
   gGeoManager->SetTopVolume(top); // mandatory !
   
   TGeoVolume *slab = gGeoManager->MakeBox("slab", sil, 5., 5., .012);
   top->AddNode(slab, 1, new TGeoTranslation(0.,0., 0.3));
   top->AddNode(slab, 2, new TGeoTranslation(0.,0., 0.6));
   top->AddNode(slab, 3, new TGeoTranslation(0.,0., 0.9));
   top->AddNode(slab, 4, new TGeoTranslation(0.,0., 1.2));
   top->AddNode(slab, 5, new TGeoTranslation(0.,0., 1.5));
   //   top->AddNode(slab, 6, new TGeoTranslation(0.,0., 1.8));


   //--- close the geometry
   gGeoManager->CloseGeometry();

   //--- draw the ROOT box
   gGeoManager->SetVisLevel(10);
   //top->Draw("ogl");
   TFile *outfile = TFile::Open("genfitGeom.root","RECREATE");
   gGeoManager->Write();
   outfile->Close();
}
开发者ID:wuchen1106,项目名称:genfitCR,代码行数:37,代码来源:makeGeom.C

示例12: Draw3D

void Draw3D(AliITSOnlineCalibrationSPDhandler *h){

  TGeoHMatrix m2t[240];
  for(Int_t imod=0; imod<240; imod++){
    int vid = AliITSAlignMille2Module::GetVolumeIDFromIndex(imod);
    AliITSAlignMille2Module::SensVolMatrix(vid,&m2t[imod]);
  }

  delete gGeoManager;

  new TGeoManager("SPD","active");

  TGeoMaterial *vacuum = new TGeoMaterial("vacuum",0,0,0);
  TGeoMedium *none = new TGeoMedium("Vacuum",0,vacuum);
  TGeoVolume *top = gGeoManager->MakeBox("TOP",none,500,500,500);
  gGeoManager->SetTopVolume(top);

  TGeoVolume *ladder = gGeoManager->MakeBox("ladder",none,0.6375,0.001/2,3.48);

  Int_t nActive[2]={0,0};
  for(Int_t imod=0; imod<240; imod++){
    TGeoRotation *rot  = new TGeoRotation();
    rot->SetMatrix(m2t[imod].GetRotationMatrix());
    TGeoCombiTrans *matrix = new TGeoCombiTrans(m2t[imod].GetTranslation()[0],m2t[imod].GetTranslation()[1],m2t[imod].GetTranslation()[2],rot);
    if((40960-h->GetNrBad(imod))>0) {
      top->AddNode(ladder,imod,matrix);
      if(imod<80) nActive[0]++;
      else nActive[1]++;
    }
  }

  printf("  \n\n   Number of Active SPD modules (->Total)  : inner %i (80) outer %i (160) \n\n\n",nActive[0],nActive[1]);
  gGeoManager->CloseGeometry();
  top->Draw("ogl");
  gPad->GetView()->ShowAxis();

}
开发者ID:alisw,项目名称:AliRoot,代码行数:37,代码来源:ShowSPDConfiguration.C

示例13: create_gfi_geo


//.........这里部分代码省略.........
  thx = -106.700000;    phx = 0.000000;
  //   thx = 106.700000;    phx = 0.000000;
  thy = 90.000000;    phy = 90.000000;
  thz = -16.700000;    phz = 0.000000;
  TGeoRotation *pMatrix5 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
  TGeoCombiTrans*
  pMatrix4 = new TGeoCombiTrans("", dx,dy,dz,pMatrix5);
  
  
  // World definition
  TGeoVolume* pWorld = gGeoManager->GetTopVolume();
  pWorld->SetVisLeaves(kTRUE);
  
  
  
  
  // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY
  // Shape: GFIBoxWorld type: TGeoBBox
  dx = 29.00000;
  dy = 29.00000;
  dz = 0.050000;
  TGeoShape *pGFIBoxWorld = new TGeoBBox("GFIBoxWorld", dx,dy,dz);
  // Volume: GFILogWorld
  TGeoVolume*
  pGFILogWorld = new TGeoVolume("GFILogWorld",pGFIBoxWorld, pMed2);
  pGFILogWorld->SetVisLeaves(kTRUE);
  
  // Global positioning
  
  TGeoCombiTrans *pGlobal1 = GetGlobalPosition(pMatrix2);
  TGeoCombiTrans *pGlobal2 = GetGlobalPosition(pMatrix4);
    
  TGeoVolumeAssembly *pw1 = new TGeoVolumeAssembly("GFI");
  pWorld->AddNode(pw1, 0);
    
  pw1->AddNode( pGFILogWorld, 0, pGlobal1 );
  pw1->AddNode( pGFILogWorld, 1, pGlobal2 );
  
  
  
  // Shape: GFIBox type: TGeoBBox
  dx = 25.000000;
  dy = 25.000000;
  dz = 0.050000;
  TGeoShape *pGFIBox = new TGeoBBox("GFIBox", dx,dy,dz);
  // Volume: GFILog
  TGeoVolume*
  pGFILog = new TGeoVolume("GFILog",pGFIBox, pMed35);
  pGFILog->SetVisLeaves(kTRUE);
  pGFILogWorld->AddNode(pGFILog, 0, pMatrix6);
  
  // Shape: UpFrame type: TGeoBBox
  dx = 29.000000;
  dy = 2.000000;
  dz = 0.050000;
  TGeoShape *pUpFrame = new TGeoBBox("UpFrame", dx,dy,dz);
  // Volume: logicUpFrame
  TGeoVolume*
  plogicUpFrame = new TGeoVolume("logicUpFrame",pUpFrame, pMed21);
  plogicUpFrame->SetVisLeaves(kTRUE);
  pGFILogWorld->AddNode(plogicUpFrame, 0, pMatrix8);
  // Shape: DownFrame type: TGeoBBox
  dx = 29.000000;
  dy = 2.000000;
  dz = 0.050000;
  TGeoShape *pDownFrame = new TGeoBBox("DownFrame", dx,dy,dz);
开发者ID:MohammadAlTurany,项目名称:R3BRoot,代码行数:67,代码来源:create_gfi_geo.C

示例14: create_mtof_geo


//.........这里部分代码省略.........
  dz = 761.870346;
  
  // Rotation:
  thx = -106.700000;    phx = 0.000000;
  thy = 90.000000;    phy = 90.000000;
  thz = -16.700000;    phz = 0.000000;
  
  /*    dx = -171.1;
   dy = 2.400000;
   dz = 548.95;
   // dz = 0.;
   // Rotation:
   thx = -121.000000;    phx = 0.000000;
   thy = 90.000000;    phy = 90.000000;
   thz = -31.000000;    phz = 0.000000;*/
  
  TGeoRotation *pMatrix3 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
  TGeoCombiTrans*
  pMatrix2 = new TGeoCombiTrans("", dx,dy,dz,pMatrix3);
  
  /*
   // TRANSFORMATION MATRICES
   // Combi transformation:
   dx = 151.000000;
   dy = 0.000000;
   dz = 758.000000;
   // Rotation:
   thx = 106.700000;    phx = 0.000000;
   thy = 90.000000;    phy = 90.000000;
   thz = 16.700000;    phz = 0.000000;
   TGeoRotation *pMatrix3 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
   TGeoCombiTrans*
   pMatrix2 = new TGeoCombiTrans("", dx,dy,dz,pMatrix3);
   */
  
  // Shape: World type: TGeoBBox
  TGeoVolume* pWorld = gGeoManager->GetTopVolume();
  pWorld->SetVisLeaves(kTRUE);
  
  // Create a global Mother Volume
  /*
   dx = 200.000000;
   dy = 200.000000;
   dz = 200.000000;
   TGeoShape *pBoxWorld = new TGeoBBox("mTofBoxWorld", dx,dy,dz);
   TGeoVolume*
   pWorld  = new TGeoVolume("mTofBoxLogWorld",pBoxWorld, pMed2);
   pWorld->SetVisLeaves(kTRUE);
   TGeoCombiTrans *pGlobalc = GetGlobalPosition();
   
   // add the sphere as Mother Volume
   pAWorld->AddNode(pWorld, 0, pGlobalc);
   */
  
  
  // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY
  // Shape: mTOFBox type: TGeoBBox
  dx = 24.000000;
  dy = 24.000000;
  //dz = 0.250000;	//wrong: should be 0.5->1cm total
  dz = 0.500000;
  
  /*   dx = 94.450000;  //TFW size
   dy = 73.450000;
   dz = 0.500000;*/
  
  TGeoShape *pmTOFBox = new TGeoBBox("mTOFBox", dx,dy,dz);
  // Volume: mTOFLog
  TGeoVolume *
  pmTOFLog = new TGeoVolume("mTOFLog",pmTOFBox, pMed34);
  pmTOFLog->SetVisLeaves(kTRUE);
  
  TGeoVolumeAssembly *pmTof = new TGeoVolumeAssembly("mTOF");
  TGeoCombiTrans *t0 = new TGeoCombiTrans("t0");
  pmTof->AddNode(pmTOFLog, 0, t0);
  
  TGeoCombiTrans *pGlobal = GetGlobalPosition(pMatrix2);
  if (pGlobal){
    pWorld->AddNode(pmTof, 0, pGlobal);
  }else{
    pWorld->AddNode(pmTof, 0, pMatrix2);
  }
  
  
//  AddSensitiveVolume(pmTOFLog);
//  fNbOfSensitiveVol+=1;
  
  
  
  // ---------------   Finish   -----------------------------------------------
  gGeoMan->CloseGeometry();
  gGeoMan->CheckOverlaps(0.001);
  gGeoMan->PrintOverlaps();
  gGeoMan->Test();

  TFile* geoFile = new TFile(geoFileName, "RECREATE");
  top->Write();
  geoFile->Close();
  // --------------------------------------------------------------------------
}
开发者ID:bl0x,项目名称:R3BRoot,代码行数:101,代码来源:create_mtof_geo.C

示例15: create_tof_geo


//.........这里部分代码省略.........
    Int_t nel, numed;



    // TRANSFORMATION MATRICES
    // Combi transformation:
    dx = -417.359574; //Justyna
    dy = 2.400000;    //Justyna
    dz = 960.777114;  //Justyna

    //    dx = -421.33683; //Christoph
    //    dy = 2.12;    //Christoph
    //    dz = 958.387337;  //Christoph

    /*    dx = -171.1;  //position directrly (15cm) after DCH2
     dy = 2.400000;
     dz = 548.95;*/
    // dz = 0.;
    /*   // Rotation:
     thx = -121.000000;    phx = 0.000000;
     thy = 90.000000;    phy = 90.000000;
     thz = -31.000000;    phz = 0.000000;*/  //this

    //   TGeoRotation *pMatrix3 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);  //this
    TGeoRotation *gRot = new TGeoRotation();
    gRot->RotateX(0.);
    gRot->RotateY(-31.000000);
    gRot->RotateZ(0.);

    TGeoCombiTrans*
    //   pMatrix2 = new TGeoCombiTrans("", dx,dy,dz,pMatrix3);  //this
    pMatrix2 = new TGeoCombiTrans("", dx,dy,dz,gRot);  //this







    /* PREVIOUS!!!
     // TRANSFORMATION MATRICES
     // Combi transformation:
     dx = 419.700000;
     dy = 0.000000;
     dz = 952.400000;
     // dz = 0.;
     // Rotation:
     thx = 121.000000;    phx = 0.000000;
     thy = 90.000000;    phy = 90.000000;
     thz = 31.000000;    phz = 0.000000;
     TGeoRotation *pMatrix3 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
     TGeoCombiTrans*
     pMatrix2 = new TGeoCombiTrans("", dx,dy,dz,pMatrix3);
     */

    //Top Volume
    TGeoVolume* pWorld = gGeoManager->GetTopVolume();
    pWorld->SetVisLeaves(kTRUE);


    TGeoVolumeAssembly *ptof = new TGeoVolumeAssembly("TOF");


    // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY
    // Shape: TOFBox type: TGeoBBox
    dx = 94.450000;
    dy = 73.450000;
    dz = 0.500000;
    TGeoShape *pTOFBox = new TGeoBBox("TOFBox", dx,dy,dz);
    // Volume: TOFLog
    TGeoVolume*
    pTOFLog = new TGeoVolume("TOFLog",pTOFBox, pMed34);
    pTOFLog->SetVisLeaves(kTRUE);

    TGeoCombiTrans *t0 = new TGeoCombiTrans("t0");
    ptof->AddNode(pTOFLog, 0, t0);

    TGeoCombiTrans *pGlobal = GetGlobalPosition(pMatrix2);
    if (pGlobal) {
        pWorld->AddNode(ptof, 0, pGlobal);
    } else {
        pWorld->AddNode(ptof, 0, pMatrix2);
    }

//  AddSensitiveVolume(pTOFLog);
//  fNbOfSensitiveVol+=1;



    // ---------------   Finish   -----------------------------------------------
    gGeoMan->CloseGeometry();
    gGeoMan->CheckOverlaps(0.001);
    gGeoMan->PrintOverlaps();
    gGeoMan->Test();

    TFile* geoFile = new TFile(geoFileName, "RECREATE");
    top->Write();
    geoFile->Close();
    // --------------------------------------------------------------------------
}
开发者ID:vadimr3b,项目名称:R3BRoot,代码行数:101,代码来源:create_tof_geo_s318.C


注:本文中的TGeoVolume::AddNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。