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


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

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


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

示例1: PHGeomFileImport

//! Read in a Geometry file, and output DST and ROOT TGeo files
void
Fun4All_ImportGeom(const string & geom_file = "./sPHENIX.root")
{
  gSystem->Load("libphgeom.so");

  Fun4AllServer *se = Fun4AllServer::instance();
  se->Verbosity(1);
  // just if we set some flags somewhere in this macro
  recoConsts *rc = recoConsts::instance();

  PHGeomFileImport * import = new PHGeomFileImport(geom_file);
  se->registerSubsystem(import);

  // dummy input
  Fun4AllInputManager *in = new Fun4AllDummyInputManager("JADE");
  se->registerInputManager(in);

  // output in DST
  Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT",
      geom_file + "_DST.root");
  se->registerOutputManager(out);

  // run one event as example
  se->run(1);

  PHGeomUtility::ExportGeomtry(se->topNode(),geom_file + "_export.root");

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

}
开发者ID:HaiwangYu,项目名称:coresoftware,代码行数:34,代码来源:Fun4All_ImportGeom.C

示例2: Run_PerformTestMB

void Run_PerformTestMB(char* output = "rpanase.root")
{
  //gSystem->Load("libPerformTestMB.so");
 gSystem->Load("/phenix/plhf/xuq/phenix/flow/PP/install/lib/libPerformTestMB.so");
 // gSystem->Load("libfvtx_subsysreco.so");
    //  gSystem->Load("libmutoo_subsysreco");
   //   gSystem->Load("libfun4allfuncs.so");
  //    gSystem->Load("libfun4allfuncs_muons");
  //    gSystem->Load("libMWGOO");
  //    gSystem->Load("libmutrg");
  //    gSystem->Load("librpc_subsysreco");
 //     gSystem->Load("librpc_muotrackreco");
  //    gSystem->Load("libcompactCNT.so");
  //    gSystem->Load("libCNT.so");
  
Fun4AllServer *se = Fun4AllServer::instance();
se->Verbosity(0);  
  recoConsts *rc = recoConsts::instance();
  rc->set_IntFlag("MPC_RECO_MODE",0x6);

  rc->set_IntFlag("MPC_GAINCORR",0);//add as new

  SubsysReco *mpc_tow = new MpcReco();
  se->registerSubsystem(mpc_tow);
  //SubsysReco *fvtx_tow = new FvtxReadbackDST();
  //se->registerSubsystem(new FvtxReadbackDST());

  SubsysReco *rpana = new PerformTestMB(output);
  se->registerSubsystem(rpana);
}
开发者ID:XuQiao,项目名称:phenix,代码行数:30,代码来源:Run_PerformTestMB.C

示例3: Run_skimtree

void Run_skimtree(char* output = "rpanase.root")
{
// gSystem->Load("libskimtree.so");
 gSystem->Load("/phenix/plhf/xuq/phenix/flow/Run16dAu/install/lib/libskimtree.so");
  
Fun4AllServer *se = Fun4AllServer::instance();
se->Verbosity(0);  
/*
  recoConsts *rc = recoConsts::instance();
  rc->set_IntFlag("MPC_RECO_MODE",0x6);

  rc->set_IntFlag("MPC_GAINCORR",0);//add as new

  SubsysReco *mpc_tow = new MpcReco();
  se->registerSubsystem(mpc_tow);
*/
  se->registerSubsystem(new FvtxReadbackDST());

  SubsysReco *rpana = new skimtree(output);
  se->registerSubsystem(rpana);
}
开发者ID:XuQiao,项目名称:phenix,代码行数:21,代码来源:Run_skimtree.C

示例4: RunBJetModule

void RunBJetModule(
		const char* input = "/gpfs/mnt/gpfs02/sphenix/user/yuhw/workspace/BJetTagging/condor/output/0/sim_30GeV_ljet000.root",
		const char* output = "HFtag_ljet.root",//HFtag_ljet.root, HFtag_cjet.root, HFtag_bjet.root
		const bool use_refit_track_vertex = false
		) {

  gSystem->Load("libfun4all.so");
  gSystem->Load("libg4eval.so");

  gSystem->Load("libBJetModule.so");

  Fun4AllServer *se = Fun4AllServer::instance();
  se->Verbosity(0); 

  BJetModule *tm;

  tm = new BJetModule( output );
	if(use_refit_track_vertex) {
		tm->set_trackmap_name("SvtxTrackMapRefit");
		tm->set_vertexmap_name("SvtxVertexMapRefit");
	}

  se->registerSubsystem( tm );

  Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTin");

	TString tstr_input(input);
	if (tstr_input.EndsWith(".root"))
		in->AddFile( input );
	else 
		in->AddListFile( input );

	se->registerInputManager(in);

	se->run( 0 );

	se->End();

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

示例5: Fun4All_EICAnalysis_DIS

int Fun4All_EICAnalysis_DIS(
			    const int nEvents = 100000,
			    const char * inputFile = "../data/phpythia6_e10p250_dis_100k_hepmc.root",
			    const char * outputFile = "eicana_pythia6_e10p250_dis_100k.root"
			    )
{

  bool readdst = true;
  bool readhepmc = false;

  //---------------
  // Load libraries
  //---------------

  gSystem->Load("libfun4all.so");
  gSystem->Load("libphhepmc.so");
  gSystem->Load("libeicana.so");

  //---------------
  // Fun4All server
  //---------------

  Fun4AllServer *se = Fun4AllServer::instance();
  se->Verbosity(0);
  // just if we set some flags somewhere in this macro
  recoConsts *rc = recoConsts::instance();

  //  rc->set_FloatFlag("WorldSizex",1000);
  //  rc->set_FloatFlag("WorldSizey",1000);
  //  rc->set_FloatFlag("WorldSizez",1000);
  //  rc->set_CharFlag("WorldShape","G4Tubs");


  //--------------
  // Analysis modules
  //--------------

  //  DISKinematics *disana = new DISKinematics("testdis.root");
  //  se->registerSubsystem( disana );

  DISKinematics *mcana = new DISKinematics(outputFile);
  se->registerSubsystem( mcana );

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

  /* Read DST Files */
  if ( readdst )
    {
      Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
      hitsin->fileopen(inputFile);
      se->registerInputManager(hitsin);
    }
  /* Read HepMC ASCII files */
  else if ( readhepmc )
    {
      Fun4AllInputManager *in = new Fun4AllHepMCInputManager( "DSTIN");
      se->registerInputManager( in );
      se->fileopen( in->Name().c_str(), inputFile );
    }


  //-----------------
  // Event processing
  //-----------------
  if (nEvents < 0)
    {
      return;
    }
  // if we run the particle generator and use 0 it'll run forever
  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;
    }

  se->run(nEvents);

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

  se->End();
  std::cout << "All done" << std::endl;
  delete se;
  gSystem->Exit(0);
}
开发者ID:kurthill,项目名称:analysis,代码行数:89,代码来源:Fun4All_EICAnalysis_DIS.C

示例6: string

int
Fun4All_TestBeam_ShowerCalib(const int nEvents = 10000000, const char * inputFile =
    "/sphenix/user/jinhuang/Prototype_2017/ShowerCalib/JointEnergyScan1_Neg.lst")
{
  TString s_outputFile = inputFile;
  s_outputFile += "_Ana.root";
  const char * outputFile = s_outputFile.Data();

  //---------------
  // Load libraries
  //---------------
  gSystem->Load("libPrototype3.so");

  //---------------
  // Fun4All server
  //---------------

  Fun4AllServer *se = Fun4AllServer::instance();
  se->Verbosity(1);

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

  // Hits file
  Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
//  hitsin->fileopen(inputFile);
  hitsin->AddListFile(inputFile);
  se->registerInputManager(hitsin);

  gSystem->Load("libProto3ShowCalib.so");
  Proto3ShowerCalib * emcal_ana = new Proto3ShowerCalib(
      string(inputFile) + string("_EMCalCalib.root"));

  emcal_ana->Verbosity(1);
  emcal_ana->LoadRecalibMap( "/phenix/u/jinhuang/links/sPHENIX_work/Prototype_2017/ShowerCalib/ShowerCalibFit_CablibConst.dat");
  se->registerSubsystem(emcal_ana);

  cout << "nEVENTS :" << nEvents << endl;

  //-----------------
  // Event processing
  //-----------------
  if (nEvents < 0)
    {
      return;
    }

  gSystem->ListLibraries();

  se->run(nEvents);

  //-----
  // Exit
  //-----
  gSystem->Exec("ps -o sid,ppid,pid,user,comm,vsize,rssize,time");

  se->End();

  std::cout << "All done" << std::endl;
  delete se;
  gSystem->Exit(0);
}
开发者ID:sPHENIX-Collaboration,项目名称:analysis,代码行数:63,代码来源:Fun4All_TestBeam_ShowerCalib.C

示例7: Fun4All_G4_sPHENIX_photonjet


//.........这里部分代码省略.........
  // single particle / p+p-only simulations, or for p+Au / Au+Au
  // simulations which don't particularly care about jets)
  bool do_HIjetreco = false && do_cemc_twr && do_hcalin_twr && do_hcalout_twr;

  bool do_dst_compress = false;

  //Option to convert DST to human command readable TTree for quick poke around the outputs
  bool do_DSTReader = false;
  //---------------
  // Load libraries
  //---------------

  gSystem->Load("libfun4all.so");
  gSystem->Load("libg4detectors.so");
  gSystem->Load("libphhepmc.so");
  gSystem->Load("libg4testbench.so");
  gSystem->Load("libg4hough.so");
  gSystem->Load("libg4eval.so");

  // establish the geometry and reconstruction setup
  gROOT->LoadMacro("G4Setup_sPHENIX.C");
  G4Init(do_svtx, do_pstof, do_cemc, do_hcalin, do_magnet, do_hcalout, do_pipe, do_plugdoor, n_TPC_layers);

  int absorberactive = 1;  // set to 1 to make all absorbers active volumes
  //  const string magfield = "1.5"; // if like float -> solenoidal field in T, if string use as fieldmap name (including path)
  const string magfield = "/phenix/upgrades/decadal/fieldmaps/sPHENIX.2d.root";  // if like float -> solenoidal field in T, if string use as fieldmap name (including path)
  const float magfield_rescale = -1.4 / 1.5;                                     // scale the map to a 1.4 T field

  //---------------
  // Fun4All server
  //---------------

  Fun4AllServer *se = Fun4AllServer::instance();
  se->Verbosity(0);
  // just if we set some flags somewhere in this macro
  recoConsts *rc = recoConsts::instance();
  // By default every random number generator uses
  // PHRandomSeed() which reads /dev/urandom to get its seed
  // if the RANDOMSEED flag is set its value is taken as seed
  // You ca neither set this to a random value using PHRandomSeed()
  // which will make all seeds identical (not sure what the point of
  // this would be:
  //  rc->set_IntFlag("RANDOMSEED",PHRandomSeed());
  // or set it to a fixed value so you can debug your code
  //  rc->set_IntFlag("RANDOMSEED", 12345);

  //-----------------
  // Event generation
  //-----------------

  if (readhits)
  {
    // Get the hits from a file
    // The input manager is declared later

    if (do_embedding)
    {
      cout << "Do not support read hits and embed background at the same time." << endl;
      exit(1);
    }
  }
  else
  {
    // running Geant4 stage. First load event generators.

    if (readhepmc)
开发者ID:sPHENIX-Collaboration,项目名称:analysis,代码行数:67,代码来源:Fun4All_G4_sPHENIX_photonjet.C

示例8: Fun4All_G4_sPHENIX_AnaGenFit

int Fun4All_G4_sPHENIX_AnaGenFit(
  const int nEvents = 10000,
  const char * inputFile = "/gpfs02/phenix/prod/sPHENIX/preCDR/pro.1-beta.5/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_e-_eta0_16GeV.root",
  const char * outputFile = "AnaSvtxTracksForGenFit.root"
)
{
  //===============
  // Input options
  //===============

  // Either:
  // read previously generated g4-hits files, in this case it opens a DST and skips
  // the simulations step completely. The G4Setup macro is only loaded to get information
  // about the number of layers used for the cell reco code
  const bool readhits = false;
  // Or:
  // read files in HepMC format (typically output from event generators like hijing or pythia)
  const bool readhepmc = false; // read HepMC files
  // Or:
  // Use particle generator
  const bool runpythia8 = false;
  const bool runpythia6 = false;

  //======================
  // What to run
  //======================

  bool do_bbc = true;

  bool do_pipe = true;

  bool do_svtx = true;
  bool do_svtx_cell = true;
  bool do_svtx_track = true;
  bool do_svtx_eval = true;

  bool do_preshower = false;

  bool do_cemc = false;
  bool do_cemc_cell = false;
  bool do_cemc_twr = false;
  bool do_cemc_cluster = false;
  bool do_cemc_eval = false;

  bool do_hcalin = false;
  bool do_hcalin_cell = false;
  bool do_hcalin_twr = false;
  bool do_hcalin_cluster = false;
  bool do_hcalin_eval = false;

  bool do_magnet = false;

  bool do_hcalout = false;
  bool do_hcalout_cell = false;
  bool do_hcalout_twr = false;
  bool do_hcalout_cluster = false;
  bool do_hcalout_eval = false;

  bool do_global = false;
  bool do_global_fastsim = false;

  bool do_jet_reco = false;
  bool do_jet_eval = false;

  bool do_dst_compress = false;

  //Option to convert DST to human command readable TTree for quick poke around the outputs
  bool do_DSTReader = false;
  //---------------
  // Load libraries
  //---------------

  gSystem->Load("libfun4all.so");
  gSystem->Load("libg4detectors.so");
  gSystem->Load("libphhepmc.so");
  gSystem->Load("libg4testbench.so");
  gSystem->Load("libg4hough.so");
  gSystem->Load("libcemc.so");
  gSystem->Load("libg4eval.so");
  gSystem->Load("libAnaSvtxTracksForGenFit.so");

  // establish the geometry and reconstruction setup
  gROOT->LoadMacro("G4Setup_sPHENIX.C");
  G4Init(do_svtx, do_preshower, do_cemc, do_hcalin, do_magnet, do_hcalout, do_pipe);

  int absorberactive = 1; // set to 1 to make all absorbers active volumes
  //  const string magfield = "1.5"; // if like float -> solenoidal field in T, if string use as fieldmap name (including path)
  const string magfield = "/phenix/upgrades/decadal/fieldmaps/sPHENIX.2d.root"; // if like float -> solenoidal field in T, if string use as fieldmap name (including path)
  const float magfield_rescale = 1.4 / 1.5; // scale the map to a 1.4 T field

  //---------------
  // Fun4All server
  //---------------

  Fun4AllServer *se = Fun4AllServer::instance();
  se->Verbosity(0);
  // just if we set some flags somewhere in this macro
  recoConsts *rc = recoConsts::instance();
  // By default every random number generator uses
  // PHRandomSeed() which reads /dev/urandom to get its seed
//.........这里部分代码省略.........
开发者ID:haggerty,项目名称:analysis,代码行数:101,代码来源:Fun4All_G4_sPHENIX_AnaGenFit.C

示例9: Fun4All_MCEventGen

int Fun4All_MCEventGen(
                       const int nEvents = 100,
                       const char * outputFile = "G4MCEventGen.root"
                       )
{
  //===============
  // Input options
  //===============

  // read files in HepMC format (typically output from event generators like hijing or pythia)
  const bool readhepmc = false; // read HepMC files

  // read files in EICTree format generated by eicsmear package
  const bool readeictree = false;

  // Use particle generator Pythia 8
  const bool runpythia8 = false;

  // Use particle generator Pythia 6
  const bool runpythia6 = true;
  const char * pythia6configfile = "config_pythia6/phpythia6_ep.cfg";

  // Use particle generator HEPGen
  const bool runhepgen = false;

  // Use particle generator Sartre
  const bool runsartre = false;

  // Other options
  const bool do_dst_compress = true;

  // Option to save DST output file (for later use with Genat4 simulation)
  const bool do_DSTOutput = true;

  // Option to convert DST to human command readable TTree for quick poke around the outputs
  const bool do_DSTReader = false;

  // Option to save events in ASCII HepMC format
  const bool do_ASCIIOutput = false;


  //---------------
  // Load libraries
  //---------------
  gSystem->Load("libfun4all.so");
  gSystem->Load("libphhepmc.so");
  gSystem->Load("libg4detectors.so");
  gSystem->Load("libg4eval.so");

  //---------------
  // Fun4All server
  //---------------
  Fun4AllServer *se = Fun4AllServer::instance();
  se->Verbosity(0); // uncomment for batch production running with minimal output messages
  // se->Verbosity(Fun4AllServer::VERBOSITY_SOME); // uncomment for some info for interactive running

  // just if we set some flags somewhere in this macro
  recoConsts *rc = recoConsts::instance();
  // By default every random number generator uses
  // PHRandomSeed() which reads /dev/urandom to get its seed
  // if the RANDOMSEED flag is set its value is taken as seed
  // You can either set this to a random value using PHRandomSeed()
  // which will make all seeds identical (not sure what the point of
  // this would be:
  //  rc->set_IntFlag("RANDOMSEED",PHRandomSeed());
  // or set it to a fixed value so you can debug your code
  // rc->set_IntFlag("RANDOMSEED", 12345);

  /* Set world parameters in reco consts */
  rc->set_FloatFlag("WorldSizex", 1000.);
  rc->set_FloatFlag("WorldSizey", 1000.);
  rc->set_FloatFlag("WorldSizez", 1000.);
  rc->set_CharFlag("WorldShape", "G4Tubs");


  //-----------------
  // Event generation
  //-----------------

  if (readhepmc)
    {
    }
  else if (readeictree)
    {
      // this module is needed to read the EICTree style records into our G4 sims
      ReadEICFiles *eicr = new ReadEICFiles();
      eicr->OpenInputFile("data/eictree_milou_dvcs_10x250.root");

      se->registerSubsystem(eicr);
    }
  else if (runpythia8)
    {
      gSystem->Load("libPHPythia8.so");

      PHPythia8* pythia8 = new PHPythia8();
      // see coresoftware/generators/PHPythia8 for example config
      pythia8->set_config_file("phpythia8.cfg");
      se->registerSubsystem(pythia8);
    }
  else if (runpythia6)
//.........这里部分代码省略.........
开发者ID:sPHENIX-Collaboration,项目名称:analysis,代码行数:101,代码来源:Fun4All_MCEventGen.C

示例10: Form

void
phhijing(const int nevents = 10, const int outputnameindex = 0)
{ 
  TString temp = Form("phhijing_pp_%d.root",outputnameindex);
  //TString temp = Form("/phenix/scratch/xuq/Hijing/phhijing_dAu_%d.root",outputnameindex);
  //TString temp = Form("./phhijing_He3Au_%d.root",outputnameindex);
  char *outputname = temp.Data();
  gSystem->Load("libfun4allfuncs.so");	// framework + reco modules
  gSystem->Load("libsimreco.so");	// framework + reco modules
  loadLib("/direct/phenix+plhf/xuq/phenix/MCgen/event_gen/lib/lib/libPHHijing");

  recoConsts *rc = recoConsts::instance();
  rc->set_IntFlag("RUNNUMBER",0);

  /////////////////////////////////////////////////////////////////
  //  Server...
  Fun4AllServer *se = Fun4AllServer::instance();
  se->Verbosity(0);

  /////////////////////////////////////////////////////////////////
  //  Reconstruction Modules...
  
  SubsysReco *sync = new SyncSimreco();
  se->registerSubsystem(sync);

  PHHijing* ss = new PHHijing();
  //  ss->SetSeed(99);
  //ss->SetOscarOut("pythia.osc");	// Set this to write to an oscar file
  //ss->SetSeed(1999);			// Set your own seed, otherwise, defaults to seed = time

  se->registerSubsystem(ss);

  // Example: Turn off all B and D decays
/*
  ss->SetDecay(411,0);
  ss->SetDecay(-411,0);
  ss->SetDecay(421,0);
  ss->SetDecay(-421,0);
  ss->SetDecay(431,0);
  ss->SetDecay(-431,0);
  
  ss->SetDecay(511,0);
  ss->SetDecay(-511,0);
  ss->SetDecay(521,0);
  ss->SetDecay(-521,0);
  ss->SetDecay(531,0);
  ss->SetDecay(-531,0);
*/

  //** Here you could put a module to trigger on selected events
  //** Select only one of the trigger types below
  //PHPyTrigger *phpytrigger = new PHPyTrigger();
  //phpytrigger->SetTrigger( PHPyTrigger::CHIC_MUONARM );
  //phpytrigger->SetTrigger( PHPyTrigger::PI0_CENTARM );
  //phpytrigger->SetEThreshold( 2.0 );
  //se->registerSubsystem(phpytrigger);
  //PHPyTrigger* trigger = new PHFvtxTrigger();
  //se->registerSubsystem(trigger);

  Fun4AllDummyInputManager *in1 = new Fun4AllDummyInputManager("DSTin1", "DST");
  se->registerInputManager(in1);

  TString OUTPUT = outputname;
  Fun4AllDstOutputManager *dst_output_mgr  = new Fun4AllDstOutputManager("PHHIJING",OUTPUT.Data());
  dst_output_mgr->AddNode("Sync");
  dst_output_mgr->AddNode("PHHijingHeader");
  dst_output_mgr->AddNode("PHHijing");
  se->registerOutputManager(dst_output_mgr);

  se->run(nevents);  // run over all events
  se->End();
}
开发者ID:XuQiao,项目名称:phenix,代码行数:72,代码来源:phhijing.C

示例11: HepMCNodeReader

//! ePHENIX simulation loading script
//! \param[in] nEvents Number of events to run. If nEvents=1, then a event display will be shown
//! \param[in] outputFile output for G4DSTReader
//! \param[in] inputFile HepMC input files, not activated by default
int
Fun4All_G4_ePHENIX( //
//        int nEvents = 0, //
    //    int nEvents = 1, //
    int nEvents = 2, //
//    int nEvents = 100000, //
    const char * outputFile = "G4ePHENIX.root", //
    const char * inputFile = "MyPythia.dat" //
    )
{
  //---------------
  // Load libraries
  //---------------

  const bool readhepmc = false; // read HepMC files
  const int absorberactive = 1; // set to 1 to make all absorbers active volumes
  const bool verbosity = false; // very slow but very detailed logs
//  const bool verbosity = true; // very slow but very detailed logs

  gSystem->Load("libg4testbench.so");
  gSystem->Load("libfun4all.so");
  gSystem->Load("libcemc.so");
  gSystem->Load("libg4eval.so");

  gROOT->LoadMacro("G4Setup_ePHENIX.C");

  G4Init(); // initialize layer numbers for barrel

  //---------------
  // Fun4All server
  //---------------

  Fun4AllServer *se = Fun4AllServer::instance();
  se->Verbosity(0);

  //-----------------
  // Event generation
  //-----------------
  if (readhepmc)
    {
      // this module is needed to read the HepMC records into our G4 sims
      // but only if you read HepMC input files
      HepMCNodeReader *hr = new HepMCNodeReader();
      se->registerSubsystem(hr);
    }
  else
    {
      // The PHG4ParticleGun runs the same particle(s) in
      // every event

      PHG4ParticleGun *gun = new PHG4ParticleGun();
//          gun->set_name("geantino+");
//      gun->set_name("chargedgeantino");
      gun->set_name("mu-");
//      gun->set_name("pi-"); // e,pi,mu,p,gamma
      //    gun->set_vtx(0,12.09,200);
      gun->set_vtx(0, 0, 0);
//        gun->set_mom(0, 0, 10);
      gun->set_mom(1.12641e-16, 1.83962, 13.6021);
//      se->registerSubsystem(gun);

      PHG4ParticleGenerator *gen = new PHG4ParticleGenerator();

      //      gen->set_seed(TRandom3(0).GetSeed());
      gen->set_seed(1234);
//      gen->set_name("geantino");
      gen->set_name("mu-");
//      gun->set_name("pi-"); // e,pi,mu,p,gamma
      gen->set_vtx(0, 0, 0);
      gen->set_z_range(0, 0);
//      gen->set_eta_range(3.5, 3.5);
      gen->set_eta_range(-4, 4);
      gen->set_phi_range(TMath::Pi() / 2, TMath::Pi() / 2);
      gen->set_mom_range(1.0, 50.0);
      gen->Verbosity(1);
//      se->registerSubsystem(gen);
//
      //! high Q2 250x10 GeV pythia file from Kieran
      ReadEICFiles *eic = new ReadEICFiles();
      const char *infile =
          "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/display/pythia.ep.250x010.10000000events.seed679586890.root";
      eic->OpenInputFile(infile);
      eic->SetFirstEntry(565);
      se->registerSubsystem(eic);

    }
  //---------------------
  // Detector description from loaded macro
  //---------------------

  G4Setup(absorberactive, -1);
//  G4Setup_Sandbox(absorberactive, -1);

//  MaterialScan();
  //----------------------
  // Simulation evaluation
//.........这里部分代码省略.........
开发者ID:tkrahulik,项目名称:coresoftware-eic,代码行数:101,代码来源:Fun4All_G4_ePHENIX.C

示例12: Fun4All_G4_LeadBrick

int Fun4All_G4_LeadBrick(const int nEvents = 10, const char *outfile = NULL)
{
  gSystem->Load("libfun4all");
  gSystem->Load("libg4detectors");
  gSystem->Load("libg4testbench");
  gSystem->Load("libg4eval");

  ///////////////////////////////////////////
  // Make the Server
  //////////////////////////////////////////
  Fun4AllServer *se = Fun4AllServer::instance();
  se->Verbosity(1);

  // particle gun
  PHG4ParticleGun *gun = new PHG4ParticleGun("PGUN");
  //  gun->set_name("anti_proton");
  gun->set_name("proton");
  //  gun->set_name("mu-");
  //  gun->set_name("proton");
  gun->set_vtx(0, 0, -100);
  gun->set_mom(0, 0, 120);
  se->registerSubsystem(gun);

  // Fun4All G4 module
  PHG4Reco *g4Reco = new PHG4Reco();
  // no magnetic field
  g4Reco->set_field(0);
  // size of the world - every detector has to fit in here
  g4Reco->SetWorldSizeX(200);
  g4Reco->SetWorldSizeY(200);
  g4Reco->SetWorldSizeZ(200);
  // shape of our world - it is a box
  g4Reco->SetWorldShape("G4BOX");
  // this is what our world is filled with
  g4Reco->SetWorldMaterial("G4_AIR");
  // Geant4 Physics list to use
  g4Reco->SetPhysicsList("FTFP_BERT");

  // our block "detector", size is in cm
  double xsize = 200.;
  double ysize = 200.;
  double zsize = 400.;
  PHG4BlockSubsystem *box = new PHG4BlockSubsystem("LeadBrick");
  box->set_double_param("size_x", 20);
  box->set_double_param("size_y", 20);
  box->set_double_param("size_z", 10);
  box->set_double_param("place_z", 0);         // shift box so we do not create particles in its center and shift by 10 so we can see the track of the incoming particle
  box->set_string_param("material", "G4_Pb");  // material of box
  box->SetActive(0);                           // if it is an active volume - save G4Hits
  g4Reco->registerSubsystem(box);

  for (int stave = 0; stave < 4; ++stave)
  {
    box = new PHG4BlockSubsystem("MVTX", stave);
    box->SuperDetector("MVTX");
    box->set_double_param("size_x", 2);
    box->set_double_param("size_y", 1);
    box->set_double_param("size_z", 50e-4);              // 50us
    box->set_double_param("place_z", 10 * (stave + 1));  // shift box so we do not create particles in its center and shift by 10 so we can see the track of the incoming particle
    box->set_string_param("material", "G4_Si");          // material of box
    box->SetActive(1);                                   // it is an active volume - save G4Hits
    g4Reco->registerSubsystem(box);
  }

  PHG4TruthSubsystem *truth = new PHG4TruthSubsystem();
  g4Reco->registerSubsystem(truth);

  se->registerSubsystem(g4Reco);

  ///////////////////////////////////////////
  // Output
  ///////////////////////////////////////////

  // save a comprehensive  evaluation file
  PHG4DSTReader *ana = new PHG4DSTReader(
      string("LeadBrick_DSTReader.root"));
  ana->set_save_particle(true);
  ana->set_load_all_particle(false);
  ana->set_load_active_particle(true);
  ana->set_save_vertex(true);
  ana->AddNode("LeadBrick");
  ana->AddNode("MVTX");
  se->registerSubsystem(ana);

  // input - we need a dummy to drive the event loop
  Fun4AllInputManager *in = new Fun4AllDummyInputManager("JADE");
  se->registerInputManager(in);

  // a quick evaluator to inspect on hit/particle/tower level

  if (nEvents > 0)
  {
    se->run(nEvents);
    // finish job - close and save output files
    se->End();
    std::cout << "All done" << std::endl;

    // cleanup - delete the server and exit
    delete se;
    gSystem->Exit(0);
//.........这里部分代码省略.........
开发者ID:sPHENIX-Collaboration,项目名称:analysis,代码行数:101,代码来源:Fun4All_G4_LeadBrick.C

示例13: Fun4All_G4_EICIR

int Fun4All_G4_EICIR(
		     const int nEvents = 1,
		     const char * inputFile = "/gpfs02/phenix/prod/sPHENIX/preCDR/pro.1-beta.5/single_particle/spacal1d/fieldmap/G4Hits_sPHENIX_e-_eta0_16GeV.root",
		     const char * outputFile = "G4EICIR.root"
		     )
{
  //===============
  // Input options
  //===============

  // Use particle gun
  const bool pgun = true;

  //======================
  // What to run
  //======================

  bool do_pipe = false;

  bool do_magnet = true;

  // Extended IR
  bool do_ExtendedIR = true;

  //---------------
  // Load libraries
  //---------------

  gSystem->Load("libfun4all.so");
  gSystem->Load("libg4detectors.so");
  gSystem->Load("libphhepmc.so");
  gSystem->Load("libg4testbench.so");
  gSystem->Load("libg4hough.so");
  gSystem->Load("libcemc.so");
  gSystem->Load("libg4eval.so");

  // establish the geometry and reconstruction setup
  gROOT->LoadMacro("G4Setup_EICIR.C");
  G4Init(do_magnet,do_pipe,do_ExtendedIR);

  int absorberactive = 0; // set to 1 to make all absorbers active volumes
  //  const string magfield = "1.5"; // if like float -> solenoidal field in T, if string use as fieldmap name (including path)
  const string magfield = "/phenix/upgrades/decadal/fieldmaps/sPHENIX.2d.root"; // if like float -> solenoidal field in T, if string use as fieldmap name (including path)
  const float magfield_rescale = 1.4/1.5; // scale the map to a 1.4 T field

  //---------------
  // Fun4All server
  //---------------

  Fun4AllServer *se = Fun4AllServer::instance();
  //se->Verbosity(100); // uncomment for batch production running with minimal output messages
  se->Verbosity(Fun4AllServer::VERBOSITY_SOME); // uncomment for some info for interactive running
  // just if we set some flags somewhere in this macro
  recoConsts *rc = recoConsts::instance();
  // By default every random number generator uses
  // PHRandomSeed() which reads /dev/urandom to get its seed
  // if the RANDOMSEED flag is set its value is taken as seed
  // You can either set this to a random value using PHRandomSeed()
  // which will make all seeds identical (not sure what the point of
  // this would be:
  //  rc->set_IntFlag("RANDOMSEED",PHRandomSeed());
  // or set it to a fixed value so you can debug your code
  // rc->set_IntFlag("RANDOMSEED", 12345);

  //-----------------
  // Event generation
  //-----------------

  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
  //---------------------

//.........这里部分代码省略.........
开发者ID:kurthill,项目名称:analysis,代码行数:101,代码来源:Fun4All_G4_EICIR.C

示例14: Fun4All_G4_EICDetector_LQ_reference


//.........这里部分代码省略.........
  // Compress DST files
  bool do_dst_compress = false;

  //Option to convert DST to human command readable TTree for quick poke around the outputs
  bool do_DSTReader = false;

  //---------------
  // Load libraries
  //---------------

  gSystem->Load("libfun4all.so");
  gSystem->Load("libg4detectors.so");
  gSystem->Load("libphhepmc.so");
  gSystem->Load("libg4testbench.so");
  gSystem->Load("libg4hough.so");
  gSystem->Load("libg4calo.so");
  gSystem->Load("libg4eval.so");
  gSystem->Load("libeicana.so");

  // establish the geometry and reconstruction setup
  gROOT->LoadMacro("G4Setup_EICDetector.C");
  G4Init(do_svtx,do_cemc,do_hcalin,do_magnet,do_hcalout,do_pipe,do_FGEM,do_EGEM,do_FEMC,do_FHCAL,do_EEMC,do_DIRC,do_RICH,do_Aerogel,n_TPC_layers);

  int absorberactive = 0; // set to 1 to make all absorbers active volumes
  //  const string magfield = "1.5"; // if like float -> solenoidal field in T, if string use as fieldmap name (including path)
  const string magfield = "/phenix/upgrades/decadal/fieldmaps/sPHENIX.2d.root"; // if like float -> solenoidal field in T, if string use as fieldmap name (including path)
  const float magfield_rescale = 1.4/1.5; // scale the map to a 1.4 T field

  //---------------
  // Fun4All server
  //---------------

  Fun4AllServer *se = Fun4AllServer::instance();
  se->Verbosity(0); // uncomment for batch production running with minimal output messages
  // se->Verbosity(Fun4AllServer::VERBOSITY_SOME); // uncomment for some info for interactive running

  // just if we set some flags somewhere in this macro
  recoConsts *rc = recoConsts::instance();
  // By default every random number generator uses
  // PHRandomSeed() which reads /dev/urandom to get its seed
  // if the RANDOMSEED flag is set its value is taken as seed
  // You can either set this to a random value using PHRandomSeed()
  // which will make all seeds identical (not sure what the point of
  // this would be:
  //  rc->set_IntFlag("RANDOMSEED",PHRandomSeed());
  // or set it to a fixed value so you can debug your code
  // rc->set_IntFlag("RANDOMSEED", 12345);

  //-----------------
  // Event generation
  //-----------------

  if (readhits)
    {
      // Get the hits from a file
      // The input manager is declared later
    }
  else if (readhepmc)
    {
      // this module is needed to read the HepMC records into our G4 sims
      // but only if you read HepMC input files
      HepMCNodeReader *hr = new HepMCNodeReader();
      se->registerSubsystem(hr);
    }
  else if (readeictree)
    {
开发者ID:sPHENIX-Collaboration,项目名称:analysis,代码行数:67,代码来源:Fun4All_G4_EICDetector_LQ_reference.C

示例15: saSpinAnalyzer

void
Fun4FVTX_RecoDST_SpinAna(
		int nEvents = 0, //
//		char *input_file = "picoDST_test.list",
		char *input_file = "picoDST.list", //
		bool doControlData = true,
		bool use_bbc_cut = true,
		char *dst_file = NULL //
		)
{

	// load libraries
	gSystem->Load("libmutoo_subsysreco.so");
	gSystem->Load("libfun4all.so");
	gSystem->Load("librecal.so");
	gSystem->Load("libfun4allfuncs.so");
	gSystem->Load("liblpc.so");
	gSystem->Load("libcompactCNT.so");
	gSystem->Load("libfun4allfuncs_muons");
	gSystem->Load("libMWGOO");
	gSystem->Load("libmutrg");
	gSystem->Load("libSvxDstQA.so");
	gSystem->Load("libpicodst_object.so");
	gSystem->Load("/gpfs/mnt/gpfs02/phenix/spin/spin3/liuld/codefile/spinAnalyser/install/lib/libspin_analyzer.so");
		
	ifstream readfile;
	string file_name;
	string s1,s2;
	readfile.open(input_file,ios::in);
	getline(readfile,file_name);
	size_t ipos = file_name.find(".");
	s1 = file_name.substr(ipos-6,6);
	cout <<" ========================="<<s1<<endl;

	///////////////////////////////////////////
	// Make the Server
	//////////////////////////////////////////

	Fun4AllServer *se = Fun4AllServer::instance();
	se->Verbosity(0);

	//! load a QA text file marking good run and good corssings
	//saModLoadSpinInfo * mspin = new saModLoadSpinInfo("SpinInfoWithAdditionalQA");
	//mspin -> load_crossing_flag("spinQA.txt");
	//saSpinAnalyzer * sa = new saSpinAnalyzer("SpinAnalyzer", mspin);

	//! use the database
	saSpinAnalyzer * sa = new saSpinAnalyzer("SpinAnalyzer");

	sa->set_auto_save_hist(
			string(s1) + string("_") + string("hist.root"));
	sa->Verbosity(0);

	saModuleJpsiAN *samodule = new saModuleJpsiAN("saModuleJpsiAN",doControlData);
	samodule->set_use_bbc_cut(use_bbc_cut);
	samodule->verbosity = 0;
	sa->RegisterModule(samodule);

	//saModuleDimuonJpsiHaiwang *samodule = new saModuleDimuonJpsiHaiwang("saModuleDimuonJpsiHaiwang",doControlData);
	//samodule->set_use_bbc_cut(use_bbc_cut);
	//samodule->verbosity = 0;
	//sa->RegisterModule(samodule);

	se->registerSubsystem(sa);

	///////////////////////////////////////////
	// DST
	//////////////////////////////////////////
	if (dst_file)
	{
		std::cout << "registering Fun4AllDstOutputManager" << std::endl;

		Fun4AllDstOutputManager *dstManager = new Fun4AllDstOutputManager(
				"DSTOUT", string(input_file) + string("_") + string(dst_file));

		dstManager->AddNode("saEventProperty");
		dstManager->AddNode("SimpleDimuonFlag");
		dstManager->AddNode("Sync");
		dstManager->AddNode("TrigLvl1");

		dstManager->AddNode("DiMuonContainer");
		dstManager->AddNode("RunHeader");

		dstManager->AddEventSelector("SpinAnalyzer");
		se->registerOutputManager(dstManager);
	}
	///////////////////////////////////////////
	// Analyze the Data.
	//////////////////////////////////////////

	gSystem->ListLibraries();

	Fun4AllDstInputManager *in = new Fun4AllDstInputManager("DSTin");
	//in->fileopen(input_file);
	in->AddListFile(input_file);
//	in->AddListFile(dst_file);
	se->registerInputManager(in);

	se->run(nEvents);
	se->End();
//.........这里部分代码省略.........
开发者ID:liulandiao,项目名称:SpinAnalyser,代码行数:101,代码来源:Fun4FVTX_RecoDST_SpinAna.C


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