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


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

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


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

示例1: AnalyzeTree

void  AnalyzeTree()
{
  gSystem->Load("libmytree.so");
  Fun4AllServer *se = Fun4AllServer::instance();
  Fun4AllInputManager *in1 = new Fun4AllDstInputManager("DSTIN1");
  se->registerInputManager(in1);
  se->fileopen("DSTIN1","mytree.root");
  SubsysReco *mytree = new AnalyzeSimpleTree();
  se->registerSubsystem(mytree);
  se->run(100);
  se->End();
  se->dumpHistos();
  delete se;
}
开发者ID:sPHENIX-Collaboration,项目名称:tutorials,代码行数:14,代码来源:AnalyzeTree.C

示例2: Fun4All_G4_sPHENIX


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

  if (do_jet_reco)
    {
      gROOT->LoadMacro("G4_Jets.C");
      Jet_Reco();
    }
  //----------------------
  // Simulation evaluation
  //----------------------

  if (do_svtx_eval) Svtx_Eval("g4svtx_eval.root");

  if (do_cemc_eval) CEMC_Eval("g4cemc_eval.root");

  if (do_hcalin_eval) HCALInner_Eval("g4hcalin_eval.root");

  if (do_hcalout_eval) HCALOuter_Eval("g4hcalout_eval.root");

  if (do_jet_eval) Jet_Eval("g4jet_eval.root");



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

  if (readhits)
    {
      // Hits file
      Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
      hitsin->fileopen(inputFile);
      se->registerInputManager(hitsin);
    }
  if (do_embedding)
    {
      if (embed_input_file == NULL)
        {
          cout << "Missing embed_input_file! Exit";
          exit(3);
        }

      Fun4AllDstInputManager *in1 = new Fun4AllNoSyncDstInputManager("DSTinEmbed");
      //      in1->AddFile(embed_input_file); // if one use a single input file
      in1->AddListFile(embed_input_file); // RecommendedL: if one use a text list of many input files
      se->registerInputManager(in1);
    }
  if (readhepmc)
    {
      Fun4AllInputManager *in = new Fun4AllHepMCInputManager( "DSTIN");
      se->registerInputManager( in );
      se->fileopen( in->Name().c_str(), 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 );
    }

  //temp lines for QA modules
    {
开发者ID:sPHENIX-Collaboration,项目名称:analysis,代码行数:66,代码来源:Fun4All_G4_sPHENIX.C

示例3: 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

示例4: Fun4All_G4_sPHENIX_photonjet


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


  gSystem->Load("libPhotonJet.so");
  PhotonJet *photjet = new PhotonJet(outputFile);
  
  photjet->Set_Isocone_radius(3);
  photjet->set_cluspt_mincut(0.5); //this is just total cluster pt
  photjet->set_directphotonpt_mincut(5); //this is the direct photon min pt
  photjet->set_jetpt_mincut(5.);
  photjet->use_trigger_emulator(1);
  photjet->use_tracked_jets(0);
  photjet->set_eta_lowhigh(-1,1);
  photjet->use_isocone_algorithm(0);
  photjet->set_jetcone_size(4);
  photjet->use_positioncorrection_CEMC(1);
  photjet->set_AA_collisions(0);
  se->registerSubsystem(photjet);





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

  if (readhits)
  {
    //meta-lib for DST objects used in simulation outputs
    gSystem->Load("libg4dst.so");

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

  if (do_embedding)
  {
    if (embed_input_file == NULL)
    {
      cout << "Missing embed_input_file! Exit";
      exit(3);
    }

    //meta-lib for DST objects used in simulation outputs
    gSystem->Load("libg4dst.so");

    Fun4AllDstInputManager *in1 = new Fun4AllNoSyncDstInputManager("DSTinEmbed");
    //      in1->AddFile(embed_input_file); // if one use a single input file
    in1->AddListFile(embed_input_file);  // RecommendedL: if one use a text list of many input files
    se->registerInputManager(in1);
  }

  if (readhepmc)
  {
    //meta-lib for DST objects used in simulation outputs
    gSystem->Load("libg4dst.so");

    Fun4AllHepMCInputManager *in = new Fun4AllHepMCInputManager("HepMCInput_1");
    se->registerInputManager(in);
    se->fileopen(in->Name().c_str(), inputFile);
    //in->set_vertex_distribution_width(100e-4,100e-4,30,0);//optional collision smear in space, time
    //in->set_vertex_distribution_mean(0,0,1,0);//optional collision central position shift in space, time
    // //optional choice of vertex distribution function in space, time
    //in->set_vertex_distribution_function(PHHepMCGenHelper::Gaus,PHHepMCGenHelper::Gaus,PHHepMCGenHelper::Uniform,PHHepMCGenHelper::Gaus);
开发者ID:sPHENIX-Collaboration,项目名称:analysis,代码行数:67,代码来源:Fun4All_G4_sPHENIX_photonjet.C

示例5: Fun4All_G4_sPHENIX_AnaGenFit


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

  //---------
  // Jet reco
  //---------

  if (do_jet_reco)
  {
    gROOT->LoadMacro("G4_Jets.C");
    Jet_Reco();
  }
  //----------------------
  // Simulation evaluation
  //----------------------

  if (do_svtx_eval) Svtx_Eval("g4svtx_eval.root");

  if (do_cemc_eval) CEMC_Eval("g4cemc_eval.root");

  if (do_hcalin_eval) HCALInner_Eval("g4hcalin_eval.root");

  if (do_hcalout_eval) HCALOuter_Eval("g4hcalout_eval.root");

  if (do_jet_eval) Jet_Eval("g4jet_eval.root");

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

  if (readhits)
  {
    // Hits file
    Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
    hitsin->fileopen(inputFile);
    se->registerInputManager(hitsin);
  }
  if (readhepmc)
  {
    Fun4AllInputManager *in = new Fun4AllHepMCInputManager( "DSTIN");
    se->registerInputManager( in );
    se->fileopen( in->Name().c_str(), 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 );
  }

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

    G4DSTreader( outputFile, //
                 /*int*/ absorberactive ,
                 /*bool*/ do_svtx ,
                 /*bool*/ do_preshower ,
                 /*bool*/ do_cemc ,
                 /*bool*/ do_hcalin ,
                 /*bool*/ do_magnet ,
                 /*bool*/ do_hcalout ,
                 /*bool*/ do_cemc_twr ,
                 /*bool*/ do_hcalin_twr ,
                 /*bool*/ do_magnet  ,
开发者ID:haggerty,项目名称:analysis,代码行数:67,代码来源:Fun4All_G4_sPHENIX_AnaGenFit.C

示例6: Fun4All_G4_sPHENIX


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

  if (do_hcalout_cell) HCALOuter_Cells();

  //-----------------------------
  // CEMC towering and clustering
  //-----------------------------

  if (do_cemc_twr) CEMC_Towers();
  if (do_cemc_cluster) CEMC_Clusters();

  //-----------------------------
  // HCAL towering and clustering
  //-----------------------------
  
  if (do_hcalin_cell) HCALInner_Towers();
  if (do_hcalin_cell) HCALInner_Clusters();

  if (do_hcalout_cell) HCALOuter_Towers();
  if (do_hcalout_cell) HCALOuter_Clusters();

  //--------------
  // SVTX tracking
  //--------------

  if (do_svtx_track) Svtx_Reco();

  //----------------------
  // Simulation evaluation
  //----------------------

  if (do_svtx_eval) Svtx_Eval("g4svtx_eval.root");

  if (do_cemc_eval) CEMC_Eval("g4cemc_eval.root");

  if (do_hcalin_cell) HCALInner_Eval("g4hcalin_eval.root");

  if (do_hcalout_cell) HCALOuter_Eval("g4hcalout_eval.root");

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

  if (readhits)
    {
      // Hits file
      Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
      hitsin->fileopen(inputFile);
      se->registerInputManager(hitsin);
    }
  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 );
    }

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

      G4DSTreader( outputFile, //
          /*int*/ absorberactive ,
          /*bool*/ do_svtx ,
          /*bool*/ do_preshower ,
          /*bool*/ do_cemc ,
          /*bool*/ do_hcalin ,
          /*bool*/ do_magnet ,
          /*bool*/ do_hcalout ,
          /*bool*/ do_cemc_twr ,
          /*bool*/ do_hcalin_twr ,
          /*bool*/ do_magnet  ,
          /*bool*/ do_hcalout_twr
          );
    }

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

  //-----------------
  // Event processing
  //-----------------
  se->run(nEvents);

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

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

示例7: 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

示例8: Fun4All_G4_EICDetector_LQ_reference


//.........这里部分代码省略.........
  // Simulation evaluation
  //----------------------
  
  
  if (do_svtx_eval) Svtx_Eval(directory+"g4svtx_p"+pbeam+"_e"+ebeam+"_"+n+"events_eval.root");
  
  if (do_cemc_eval) CEMC_Eval(directory+"g4cemc_p"+pbeam+"_e"+ebeam+"_"+n+"events_eval.root");

  if (do_hcalin_eval) HCALInner_Eval(directory+"g4hcalin_p"+pbeam+"_e"+ebeam+"_"+n+"events_eval.root");

  if (do_hcalout_eval) HCALOuter_Eval(directory+"g4hcalout_p"+pbeam+"_e"+ebeam+"_"+n+"events_eval.root");

  if (do_jet_eval) Jet_Eval(directory+"g4jet_p"+pbeam+"_e"+ebeam+"_"+n+"events_eval.root");

  if (do_fwd_jet_eval) Jet_FwdEval(directory+"g4fwdjet_p"+pbeam+"_e"+ebeam+"_"+n+"events_eval.root");
  
  if(do_lepto_analysis){
    gROOT->LoadMacro("G4_Lepto.C");
    G4_Lepto(directory+"LeptoAna_p"+pbeam+"_e"+ebeam+"_"+n+"events");
  }
  

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

  if (readhits)
    {
      // Hits file
      Fun4AllInputManager *hitsin = new Fun4AllDstInputManager("DSTin");
      hitsin->fileopen(inputFile);
      se->registerInputManager(hitsin);
    }
  if (readhepmc)
    {
      Fun4AllInputManager *in = new Fun4AllHepMCInputManager( "DSTIN");
      se->registerInputManager( in );
      se->fileopen( in->Name().c_str(), 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 );
    }

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

      G4DSTreader_EICDetector( outputFile, //
                               /*int*/ absorberactive ,
                               /*bool*/ do_svtx ,
                               /*bool*/ do_cemc ,
                               /*bool*/ do_hcalin ,
                               /*bool*/ do_magnet ,
                               /*bool*/ do_hcalout ,
                               /*bool*/ do_cemc_twr ,
                               /*bool*/ do_hcalin_twr ,
                               /*bool*/ do_magnet  ,
                               /*bool*/ do_hcalout_twr,
开发者ID:sPHENIX-Collaboration,项目名称:analysis,代码行数:67,代码来源:Fun4All_G4_EICDetector_LQ_reference.C


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