本文整理汇总了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);
}
示例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;
}
示例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;
}
示例4:
PHG4ParticleGun *get_gun(const char *name = "PGUN")
{
Fun4AllServer *se = Fun4AllServer::instance();
PHG4ParticleGun *pgun = (PHG4ParticleGun *) se->getSubsysReco(name);
return pgun;
}
示例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);
}
}