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


C++ Fun4AllServer::getSubsysReco方法代码示例

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


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

示例1:

void
G4Cmd(const char * cmd)
{
  Fun4AllServer *se = Fun4AllServer::instance();
  PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco("PHG4RECO");
  g4->ApplyCommand(cmd);
}
开发者ID:tkrahulik,项目名称:coresoftware-eic,代码行数:7,代码来源:Fun4All_G4_ePHENIX.C

示例2: DisplayOn

// stupid macro to turn on the geant4 display
// we ask Fun4All for a pointer to PHG4Reco
// using the ApplyCommand will start up the
// G4 cmd interpreter and graphics system
// the vis.mac contains the necessary commands to
// start up the visualization, the next event will
// be displayed. Do not execute this macro
// before PHG4Reco was registered with Fun4All
PHG4Reco * DisplayOn(const char *mac = "vis_prototype3.mac")
{
  char cmd[100];
  Fun4AllServer *se = Fun4AllServer::instance();
  PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco("PHG4RECO");
  g4->InitRun(se->topNode());
  g4->ApplyDisplayAction();
  sprintf(cmd, "/control/execute %s", mac);
  g4->ApplyCommand(cmd);
  return g4;
}
开发者ID:sPHENIX-Collaboration,项目名称:macros,代码行数:19,代码来源:DisplayOn.C

示例3: HepMCNodeReader


//.........这里部分代码省略.........

  //     HitNtuples *hits = new HitNtuples();
  //        hits->AddNode("FEMCABS",0);
  //        hits->AddNode("FEMC",3);
  //        hits->AddNode("FPRESHOWER",1);
  //        hits->AddNode("GEM",2);
  //        hits->AddNode("GEMLIDFRONT",4);
  //        hits->AddNode("GEMLIDBACK",5);
  //    se->registerSubsystem(hits);

  //----------------------
  // Save selected nodes to root file
  //----------------------
    {
      // require offline/analysis/g4analysis_fsphenix

    PHG4DSTReader* ana = new PHG4DSTReader(outputFile);
      if (nEvents > 0 && nEvents < 3)
        ana->Verbosity(2);
      ana->AddNode("GEMSTATION0");
      ana->AddNode("GEMSTATION1");
      ana->AddNode("GEMSTATION2");
      ana->AddNode("GEMSTATION3");
      ana->AddNode("GEMSTATION4");
//      ana->AddNode("TestDetector_0");
      se->registerSubsystem(ana);

    }

  //--------------
  // IO management
  //--------------

  if (readhepmc)
    {
      Fun4AllInputManager *in = new Fun4AllHepMCInputManager("DSTIN");
      se->registerInputManager(in);
      se->fileopen(in->Name(), inputFile);
    }
  else
    {
      // for single particle generators we just need something which drives
      // the event loop, the Dummy Input Mgr does just that
      Fun4AllInputManager *in = new Fun4AllDummyInputManager("JADE");
      se->registerInputManager(in);
    }

  // File Managers
  bool save_dst = false;
  if (save_dst)
    {
      Fun4AllDstOutputManager *dstManager = new Fun4AllDstOutputManager(
          "DSTOUT", "DST.root");
      //FVTX nodes
      dstManager->AddNode("PHG4INEVENT");
      dstManager->AddNode("G4TruthInfo");

      se->registerOutputManager(dstManager);
    }

  //-----------------
  // Event processing
  //-----------------

  if (nEvents == 1)
    {
      PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco("PHG4RECO");
      g4->ApplyCommand("/control/execute eic.mac");
//      g4->StartGui();
      se->run(1);

      se->End();
      std::cout << "All done" << std::endl;
    }
  else
    {
      if (verbosity)
        {
          se->Verbosity(3);
          PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco("PHG4RECO");
          g4->Verbosity(3);
          g4->ApplyCommand("/control/verbose 5");
          g4->ApplyCommand("/run/verbose  5");
          g4->ApplyCommand("/tracking/verbose 5");
        }

      se->run(nEvents);

      se->End();
      std::cout << "All done" << std::endl;
      delete se;
      gSystem->Exit(0);
    }

  //   //-----
  //   // Exit
  //   //-----

  return 0;
}
开发者ID:tkrahulik,项目名称:coresoftware-eic,代码行数:101,代码来源:Fun4All_G4_ePHENIX.C

示例4:

PHG4ParticleGun *get_gun(const char *name = "PGUN")
{
  Fun4AllServer *se = Fun4AllServer::instance();
  PHG4ParticleGun *pgun = (PHG4ParticleGun *) se->getSubsysReco(name);
  return pgun;
}
开发者ID:sPHENIX-Collaboration,项目名称:analysis,代码行数:6,代码来源:Fun4All_G4_LeadBrick.C

示例5: Fun4All_G4_EICIR


//.........这里部分代码省略.........
  //-----------------

  if (pgun)
    {
      /* angle of particle phi:
	 pz = p * cos(psi)
	 px = p * sin(psi) */
      double psi_mrad = 0;

      double ptot = 250*1;

      double vx = 0;
      double vy = 0;
      double vz = 0;

      double px = ptot * sin(psi_mrad / 1000.);
      double py = 0;
      double pz = ptot * cos(psi_mrad / 1000.);

      PHG4ParticleGun*gun = new PHG4ParticleGun();
      gun->set_name("proton");
      gun->set_vtx(vx,vy,vz);
      gun->set_mom(px,py,pz);
      se->registerSubsystem(gun);
    }
  else
    {
      cout << "WARNING: No events being generated!" << endl;
    }

  //---------------------
  // Detector description
  //---------------------

  G4Setup(absorberactive, magfield, TPythia6Decayer::kAll,do_magnet,do_pipe,do_ExtendedIR,magfield_rescale);



  //--------------
  // IO management
  //--------------

  // for single particle generators we just need something which drives
  // the event loop, the Dummy Input Mgr does just that
  Fun4AllInputManager *in = new Fun4AllDummyInputManager( "JADE");
  se->registerInputManager( in );

  //Convert DST to human command readable TTree for quick poke around the outputs
  gROOT->LoadMacro("G4_DSTReader_EICIR.C");

  G4DSTreader_EICIR( outputFile, //
		     /*int*/ absorberactive );

  Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", outputFile);
  //if (do_dst_compress) DstCompress(out);
  se->registerOutputManager(out);

  if (nEvents == 0 && !readhits && !readhepmc)
    {
      cout << "using 0 for number of events is a bad idea when using particle generators" << endl;
      cout << "it will run forever, so I just return without running anything" << endl;
      return;
    }

  if (nEvents < 0)
    {
      PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco("PHG4RECO");
      g4->ApplyCommand("/control/execute vis.mac");
      //g4->StartGui();
      se->run(1);

      se->End();
      std::cout << "All done" << std::endl;

      std::cout << "==== Useful display commands ==" << std::endl;
      cout << "draw axis: " << endl;
      cout << " G4Cmd(\"/vis/scene/add/axes 0 0 0 50 cm\")" << endl;
      cout << "zoom" << endl;
      cout << " G4Cmd(\"/vis/viewer/zoom 1\")" << endl;
      cout << "viewpoint:" << endl;
      cout << " G4Cmd(\"/vis/viewer/set/viewpointThetaPhi 0 0\")" << endl;
      cout << "panTo:" << endl;
      cout << " G4Cmd(\"/vis/viewer/panTo 0 0 cm\")" << endl;
      cout << "print to eps:" << endl;
      cout << " G4Cmd(\"/vis/ogl/printEPS\")" << endl;
      cout << "set background color:" << endl;
      cout << " G4Cmd(\"/vis/viewer/set/background white\")" << endl;
      std::cout << "===============================" << std::endl;
    }
  else
    {
      se->run(nEvents);

      se->End();
      std::cout << "All done" << std::endl;
      delete se;
      gSystem->Exit(0);
    }

}
开发者ID:kurthill,项目名称:analysis,代码行数:101,代码来源:Fun4All_G4_EICIR.C


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