本文整理汇总了C++中Fun4AllServer::run方法的典型用法代码示例。如果您正苦于以下问题:C++ Fun4AllServer::run方法的具体用法?C++ Fun4AllServer::run怎么用?C++ Fun4AllServer::run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fun4AllServer
的用法示例。
在下文中一共展示了Fun4AllServer::run方法的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);
}
示例2: analy3corr
void analy3corr(int nEvents=0, int iseg){
gSystem->Load("libfun4all.so");
gSystem->Load("librecal.so");
gSystem->Load("libfvtx_subsysreco.so");
gSystem->Load("/gpfs/mnt/gpfs02/phenix/plhf/plhf1/xuq/phenix/flow/Run4AuAu/install/lib/libRidgedAuRun16.so");
Fun4AllServer *se = Fun4AllServer::instance();
int nfile = 1;
int ifile = 0;
char cntfile[1000];
char dstevefile[1000];
char mwgfile[1000];
// ifstream cntlist("cnt.lst");
// ifstream dstevelist("dst_eve.lst");
ifstream commonlist("common.lst");
TString out=Form("output_3corr_%d.root",iseg);
Fun4AllDstInputManager *in = new Fun4AllDstInputManager("CNT","DST");
se->registerInputManager(in);
while (commonlist.getline(cntfile, 500)){
if(ifile>=iseg*nfile&&ifile<(iseg+1)*nfile){
cout<<ifile<<" "<<cntfile<<endl;
in->AddFile(Form("/phenix/prod/phnxreco/DSTFiles/run4/run4AuAu_Central_200GeV_v01_pro66/run_0000112400_0000112500/CNT_MinBias/CNT_MinBias_%s",cntfile));
}
ifile++;
}
int ifile=0;
ifstream commonlist("common.lst");
Fun4AllDstInputManager *in = new Fun4AllDstInputManager("DST","DST");
se->registerInputManager(in);
while (commonlist.getline(dstevefile, 500)){
if(ifile>=iseg*nfile&&ifile<(iseg+1)*nfile){
cout<<ifile<<" "<<dstevefile<<endl;
in->AddFile(Form("/phenix/prod/phnxreco/DSTFiles/run4/run4AuAu_Central_200GeV_v01_pro66/run_0000112400_0000112500/DST_EVE_MinBias/DST_EVE_MinBias_%s",dstevefile));
}
ifile++;
}
MasterRecalibratorManager *mr = new MasterRecalibratorManager("MASTERRECALIBRATORMANAGER");
mr->FillHistos(0);
se->registerSubsystem(mr);
//FVTX cluster/track
FvtxReadbackDST *fvtx_readback_dst = new FvtxReadbackDST();
se->registerSubsystem( fvtx_readback_dst );
RidgedAuRun16 *rpana = new RidgedAuRun16(out.Data());
se->registerSubsystem(rpana);
se->run(nEvents);
se->End();
}
示例3: 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;
}
示例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();
}
示例5: Fun4All_JetAna
void Fun4All_JetAna(const int nevnt = 0, const char *inputfile = "/sphenix/sim/sim01/tutorials/myjetanalysis/G4sPHENIX_Pythia8.root")
{
gSystem->Load("libmyjetanalysis");
gSystem->Load("libg4dst");
Fun4AllServer *se = Fun4AllServer::instance();
MyJetAnalysis *myJetAnalysis = new MyJetAnalysis("AntiKt_Tower_r04","AntiKt_Truth_r04","myjetanalysis.root");
// myJetAnalysis->Verbosity(0);
// change lower pt and eta cut to make them visible using the example
// pythia8 file
myJetAnalysis->setPtRange(1,100);
myJetAnalysis->setEtaRange(-1.1,1.1);
se->registerSubsystem(myJetAnalysis);
Fun4AllInputManager *in = new Fun4AllDstInputManager("DSTin");
in->fileopen(inputfile);
se->registerInputManager( in );
se->run(nevnt);
se->End();
delete se;
gSystem->Exit(0);
}
示例6: 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
//.........这里部分代码省略.........
示例7: 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);
}
示例8: Fun4All_G4_sPHENIX
int Fun4All_G4_sPHENIX(
const int nEvents = 10000,
const char * inputFile = "/sphenix/sim//sim01/production/2016-07-21/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0_8GeV-0002.root",
const char * outputFile = "G4sPHENIXCells.root",
const char * embed_input_file = "/sphenix/sim/sim01/production/2016-07-12/sHijing/spacal2d/G4Hits_sPHENIX_sHijing-0-4.4fm.list"
)
{
//===============
// 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
//
// In case reading production output, please double check your G4Setup_sPHENIX.C and G4_*.C consistent with those in the production macro folder
// E.g. /sphenix/sim//sim01/production/2016-07-21/single_particle/spacal2d/
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 = true;
const bool runpythia6 = false;
// And
// Further choose to embed newly simulated events to a previous simulation. Not compatible with `readhits = true`
// In case embedding into a production output, please double check your G4Setup_sPHENIX.C and G4_*.C consistent with those in the production macro folder
// E.g. /sphenix/sim//sim01/production/2016-07-21/single_particle/spacal2d/
const bool do_embedding = false;
//======================
// What to run
//======================
bool do_bbc = false;
bool do_pipe = false;
bool do_svtx = false;
bool do_svtx_cell = false;
bool do_svtx_track = false;
bool do_svtx_eval = false;
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 = true;
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 = 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("libg4calo.so");
gSystem->Load("libg4eval.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 = "0"; // 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
//---------------
//.........这里部分代码省略.........
示例9: 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);
}
示例10: Fun4All_G4_sPHENIX_photonjet
int Fun4All_G4_sPHENIX_photonjet(
const int nEvents = 5,
const char *inputFile = "hepmc_pythia.dat",
const char *outputFile = "G4sPHENIX.root",
const char *embed_input_file = "/sphenix/data/data02/review_2017-08-02/sHijing/fm_0-4.list")
{
// Set the number of TPC layer
const int n_TPC_layers = 40; // use 60 for backward compatibility only
//===============
// 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
//
// In case reading production output, please double check your G4Setup_sPHENIX.C and G4_*.C consistent with those in the production macro folder
// E.g. /sphenix/sim//sim01/production/2016-07-21/single_particle/spacal2d/
const bool readhits = false;
// Or:
// read files in HepMC format (typically output from event generators like hijing or pythia)
const bool readhepmc = true; // read HepMC files
// Or:
// Use pythia
const bool runpythia8 = false;
const bool runpythia6 = false;
//
// **** And ****
// Further choose to embed newly simulated events to a previous simulation. Not compatible with `readhits = true`
// In case embedding into a production output, please double check your G4Setup_sPHENIX.C and G4_*.C consistent with those in the production macro folder
// E.g. /sphenix/data/data02/review_2017-08-02/
const bool do_embedding = false;
// Besides the above flags. One can further choose to further put in following particles in Geant4 simulation
// Use multi-particle generator (PHG4SimpleEventGenerator), see the code block below to choose particle species and kinematics
const bool particles = false && !readhits;
// or gun/ very simple single particle gun generator
const bool usegun = false && !readhits;
// Throw single Upsilons, may be embedded in Hijing by setting readhepmc flag also (note, careful to set Z vertex equal to Hijing events)
const bool upsilons = false && !readhits;
// Event pile up simulation with collision rate in Hz MB collisions.
// Note please follow up the macro to verify the settings for beam parameters
const double pileup_collision_rate = 0; // 100e3 for 100kHz nominal AuAu collision rate.
//======================
// What to run
//======================
bool do_bbc = true;
bool do_pipe = true;
bool do_svtx = true;
bool do_svtx_cell = do_svtx && true;
bool do_svtx_track = do_svtx_cell && true;
bool do_svtx_eval = do_svtx_track && false;
bool do_pstof = false;
bool do_cemc = true;
bool do_cemc_cell = do_cemc && true;
bool do_cemc_twr = do_cemc_cell && true;
bool do_cemc_cluster = do_cemc_twr && true;
bool do_cemc_eval = do_cemc_cluster && false;
bool do_hcalin = true;
bool do_hcalin_cell = do_hcalin && true;
bool do_hcalin_twr = do_hcalin_cell && true;
bool do_hcalin_cluster = do_hcalin_twr && true;
bool do_hcalin_eval = do_hcalin_cluster && false;
bool do_magnet = true;
bool do_hcalout = true;
bool do_hcalout_cell = do_hcalout && true;
bool do_hcalout_twr = do_hcalout_cell && true;
bool do_hcalout_cluster = do_hcalout_twr && true;
bool do_hcalout_eval = do_hcalout_cluster && false;
//! forward flux return plug door. Out of acceptance and off by default.
bool do_plugdoor = false;
bool do_global = true;
bool do_global_fastsim = true;
bool do_calotrigger = true && do_cemc_twr && do_hcalin_twr && do_hcalout_twr;
bool do_jet_reco = true;
bool do_jet_eval = do_jet_reco && true;
// HI Jet Reco for p+Au / Au+Au collisions (default is false for
// 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
//.........这里部分代码省略.........
示例11: 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
//---------------------
//.........这里部分代码省略.........
示例12: Fun4All_G4_EICDetector_LQ_reference
int Fun4All_G4_EICDetector_LQ_reference(
string n="1093",
string ebeam="20",
string pbeam="250",
//string inputFile,
string inputFile="/direct/phenix+u/spjeffas/LQGENEP/TestOut.1093event.root",
string output="",
const char * outputFile = "G4EICDetector.root"
)
{
// Set the number of TPC layer
const int n_TPC_layers = 40; // use 60 for backward compatibility only
//Get parameter variables from parameter file
int nEvents;
stringstream geek(n);
geek>>nEvents;
string directory = "/direct/phenix+u/spjeffas/leptoquark/output/"+output+"/";
//===============
// 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
//
// In case reading production output, please double check your G4Setup_sPHENIX.C and G4_*.C consistent with those in the production macro folder
// E.g. /sphenix/sim//sim01/production/2016-07-21/single_particle/spacal2d/
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:
// read files in EICTree format generated by eicsmear package
const bool readeictree = true;
// Or:
// Use Pythia 8
const bool runpythia8 = false;
// Or:
// Use Pythia 6
const bool runpythia6 = false;
// Or:
// Use HEPGen
const bool runhepgen = false;
// Or:
// Use Sartre
const bool runsartre = false;
// Besides the above flags. One can further choose to further put in following particles in Geant4 simulation
// Use multi-particle generator (PHG4SimpleEventGenerator), see the code block below to choose particle species and kinematics
const bool particles = false && !readhits;
// or gun/ very simple single particle gun generator
const bool usegun = false && !readhits;
// Throw single Upsilons, may be embedded in Hijing by setting readhepmc flag also (note, careful to set Z vertex equal to Hijing events)
const bool upsilons = false && !readhits;
//======================
// What to run
//======================
// sPHENIX barrel
bool do_bbc = true;
bool do_pipe = true;
bool do_svtx = true;
bool do_svtx_cell = do_svtx && true;
bool do_svtx_track = do_svtx_cell && true;
bool do_svtx_eval = do_svtx_track && true;
bool do_pstof = false;
bool do_cemc = true;
bool do_cemc_cell = true;
bool do_cemc_twr = true;
bool do_cemc_cluster = true;
bool do_cemc_eval = true;
bool do_hcalin = true;
bool do_hcalin_cell = true;
bool do_hcalin_twr = true;
bool do_hcalin_cluster = true;
bool do_hcalin_eval = true;
bool do_cemc_cell = do_cemc && true;
bool do_cemc_twr = do_cemc_cell && true;
bool do_cemc_cluster = do_cemc_twr && true;
bool do_cemc_eval = do_cemc_cluster && true;
bool do_hcalin = true;
bool do_hcalin_cell = do_hcalin && true;
//.........这里部分代码省略.........
示例13: 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();
//.........这里部分代码省略.........
示例14: 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)
//.........这里部分代码省略.........
示例15: analyPerf
void analyPerf(int nEvents=0, int iseg){
gSystem->Load("libfun4all.so");
gSystem->Load("librecal.so");
gSystem->Load("libfvtx_subsysreco.so");
gSystem->Load("/gpfs/mnt/gpfs02/phenix/plhf/plhf1/xuq/phenix/flow/Run16dAu/install/lib/libPerformTestMB.so");
Fun4AllServer *se = Fun4AllServer::instance();
int nfile = 10;
int ifile=0;
char cntfile[1000];
char dstevefile[1000];
// ifstream cntlist("cnt.lst");
// ifstream dstevelist("dst_eve.lst");
ifstream commonlist("common.lst");
TString out=Form("output/output_perform_alltrig_%d.root",iseg);
Fun4AllDstInputManager *in = new Fun4AllDstInputManager("CNT");
se->registerInputManager(in);
while (commonlist.getline(cntfile, 500)){
if(ifile>=iseg*nfile&&ifile<(iseg+1)*nfile){
cout<<ifile<<" "<<cntfile<<endl;
if(strstr(cntfile,"0000454"))
in->AddFile(Form("/phenix/prod/online_production/run16_online_ca/run_0000454000_0000455000/CNT/CNT_%s",cntfile));
if(strstr(cntfile,"0000455"))
in->AddFile(Form("/phenix/prod/online_production/run16_online_ca/run_0000455000_0000456000/CNT/CNT_%s",cntfile));
if(strstr(cntfile,"0000456"))
in->AddFile(Form("/phenix/prod/online_production/run16_online_ca/run_0000456000_0000457000/CNT/CNT_%s",cntfile));
}
ifile++;
}
int ifile=0;
ifstream commonlist("common.lst");
Fun4AllDstInputManager *in = new Fun4AllDstInputManager("DST");
se->registerInputManager(in);
while (commonlist.getline(dstevefile, 500)){
if(ifile>=iseg*nfile&&ifile<(iseg+1)*nfile){
cout<<ifile<<" "<<dstevefile<<endl;
if(strstr(dstevefile,"0000454"))
in->AddFile(Form("/phenix/prod/online_production/run16_online_ca/run_0000454000_0000455000/DST_EVE/DST_EVE_%s",dstevefile));
if(strstr(dstevefile,"0000455"))
in->AddFile(Form("/phenix/prod/online_production/run16_online_ca/run_0000455000_0000456000/DST_EVE/DST_EVE_%s",dstevefile));
if(strstr(dstevefile,"0000456"))
in->AddFile(Form("/phenix/prod/online_production/run16_online_ca/run_0000456000_0000457000/DST_EVE/DST_EVE_%s",dstevefile));
}
ifile++;
}
MasterRecalibratorManager *mr = new MasterRecalibratorManager("MASTERRECALIBRATORMANAGER");
mr->FillHistos(0);
se->registerSubsystem(mr);
//FVTX cluster
//FvtxReadbackDST *fvtx_readback_dst = new FvtxReadbackDST();
//se->registerSubsystem( fvtx_readback_dst );
PerformTestMB *rpana = new PerformTestMB(out.Data());
se->registerSubsystem(rpana);
se->run(nEvents);
se->End();
}