本文整理汇总了C++中Fun4AllServer::End方法的典型用法代码示例。如果您正苦于以下问题:C++ Fun4AllServer::End方法的具体用法?C++ Fun4AllServer::End怎么用?C++ Fun4AllServer::End使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fun4AllServer
的用法示例。
在下文中一共展示了Fun4AllServer::End方法的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
//.........这里部分代码省略.........
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 ,
/*bool*/ do_hcalout_twr
);
}
// Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", outputFile);
// if (do_dst_compress) DstCompress(out);
// se->registerOutputManager(out);
//-----------------
// Analysis Module
//-----------------
AnaSvtxTracksForGenFit *ana = new AnaSvtxTracksForGenFit();
ana->set_filename( outputFile );
se->registerSubsystem( ana );
//-----------------
// 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);
}
示例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
//.........这里部分代码省略.........
se->registerSubsystem(jt);
HFJetTruthTrigger * jt = new HFJetTruthTrigger(
"HFJetTruthTrigger.root",5 , "AntiKt_Truth_r04");
// jt->Verbosity(HFJetTruthTrigger::VERBOSITY_MORE);
se->registerSubsystem(jt);
HFJetTruthTrigger * jt = new HFJetTruthTrigger(
"HFJetTruthTrigger.root",5 , "AntiKt_Truth_r02");
// jt->Verbosity(HFJetTruthTrigger::VERBOSITY_MORE);
se->registerSubsystem(jt);
}
}
// HF jet analysis moudle
if (gSystem->Load("libslt") == 0)
{
if (do_jet_reco)
{
SoftLeptonTaggingTruth * slt = new SoftLeptonTaggingTruth(
"AntiKt_Truth_r07");
se->registerSubsystem(slt);
SoftLeptonTaggingTruth * slt = new SoftLeptonTaggingTruth(
"AntiKt_Truth_r04");
// slt->Verbosity(1);
se->registerSubsystem(slt);
SoftLeptonTaggingTruth * slt = new SoftLeptonTaggingTruth(
"AntiKt_Truth_r02");
se->registerSubsystem(slt);
}
}
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 ,
/*bool*/ do_hcalout_twr
);
}
Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", outputFile);
if (do_dst_compress) DstCompress(out);
se->registerOutputManager(out);
//-----------------
// 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);
{
gSystem->Load("libqa_modules");
QAHistManagerDef::saveQARootFile(string(outputFile) + "_qa.root");
if (gSystem->Load("libslt") == 0)
{
SoftLeptonTaggingTruth::getHistoManager()->dumpHistos(
string(outputFile) + "_slt.root");
}
}
//-----
// 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);
}
示例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
//.........这里部分代码省略.........
//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);
//! embedding ID for the event
//! positive ID is the embedded event of interest, e.g. jetty event from pythia
//! negative IDs are backgrounds, .e.g out of time pile up collisions
//! Usually, ID = 0 means the primary Au+Au collision background
//in->set_embedding_id(2);
}
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 (pileup_collision_rate > 0)
{
// pile up simulation.
// add random beam collisions following a collision diamond and rate from a HepMC stream
Fun4AllHepMCPileupInputManager *pileup = new Fun4AllHepMCPileupInputManager("HepMCPileupInput");
se->registerInputManager(pileup);
const string pileupfile("/sphenix/sim/sim01/sHijing/sHijing_0-12fm.dat");
pileup->AddFile(pileupfile); // HepMC events used in pile up collisions. You can add multiple files, and the file list will be reused.
//pileup->set_vertex_distribution_width(100e-4,100e-4,30,5);//override collision smear in space time
//pileup->set_vertex_distribution_mean(0,0,0,0);//override collision central position shift in space time
pileup->set_collision_rate(pileup_collision_rate);
double time_window_minus = -35000;
double time_window_plus = 35000;
if (do_svtx)
{
// double TPCDriftVelocity = 6.0 / 1000.0; // cm/ns, which is loaded from G4_SVTX*.C macros
time_window_minus = -105.5 / TPCDriftVelocity; // ns
time_window_plus = 105.5 / TPCDriftVelocity; // ns;
}
pileup->set_time_window(time_window_minus, time_window_plus); // override timing window in ns
cout << "Collision pileup enabled using file " << pileupfile << " with collision rate " << pileup_collision_rate
<< " and time window " << time_window_minus << " to " << time_window_plus << endl;
}
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_pstof,
/*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);
// if (do_dst_compress) DstCompress(out);
// se->registerOutputManager(out);
//-----------------
// 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);
}
示例11: 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);
}
}
示例12: Fun4All_G4_EICDetector_LQ_reference
//.........这里部分代码省略.........
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,
/*bool*/ do_FGEM,
/*bool*/ do_EGEM,
/*bool*/ do_FHCAL,
/*bool*/ do_FHCAL_twr,
/*bool*/ do_FEMC,
/*bool*/ do_FEMC_twr,
/*bool*/ do_EEMC,
/*bool*/ do_EEMC_twr
);
}
Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", outputFile);
if (do_dst_compress) DstCompress(out);
se->registerOutputManager(out);
//-----------------
// 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);
}
示例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
//.........这里部分代码省略.........
// see coresoftware/generators/PHPythia8 for example config
pythia8->set_config_file("phpythia8.cfg");
se->registerSubsystem(pythia8);
}
else if (runpythia6)
{
gSystem->Load("libPHPythia6.so");
PHPythia6 *pythia6 = new PHPythia6();
pythia6->set_config_file( pythia6configfile );
se->registerSubsystem(pythia6);
}
else if (runhepgen)
{
gSystem->Load("libsHEPGen.so");
sHEPGen *hepgen = new sHEPGen();
hepgen->set_datacard_file("config/hepgen_eic_dvcs.data");
hepgen->set_momentum_electron(-10);
hepgen->set_momentum_hadron(250);
se->registerSubsystem(hepgen);
}
else if (runsartre)
{
// see coresoftware/generators/PHSartre/README for setup instructions
// before running:
// setenv SARTRE_DIR /opt/sphenix/core/sartre-1.20_root-5.34.36
gSystem->Load("libPHSartre.so");
PHSartre* mysartre = new PHSartre();
// see coresoftware/generators/PHSartre for example config
mysartre->set_config_file("config/sartre_ep.cfg");
// particle trigger to enhance forward J/Psi -> ee
//PHSartreParticleTrigger* pTrig = new PHSartreParticleTrigger("MySartreTrigger");
//pTrig->AddParticles(-11);
//pTrig->SetEtaHighLow(4.0,1.4);
//pTrig->SetEtaHighLow(1.0,-1.1); // central arm
//pTrig->PrintConfig();
//mysartre->register_trigger((PHSartreGenTrigger *)pTrig);
se->registerSubsystem(mysartre);
}
/* Write DST output file */
if ( do_DSTOutput )
{
Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", outputFile);
se->registerOutputManager(out);
}
/* write DSTReader human readable output tree */
if (do_DSTReader)
{
// load HepMCNodeReader
HepMCNodeReader *hr = new HepMCNodeReader();
se->registerSubsystem(hr);
// load module to access truth particle information
PHG4Reco* g4Reco = new PHG4Reco();
PHG4TruthSubsystem *truth = new PHG4TruthSubsystem();
g4Reco->registerSubsystem(truth);
se->registerSubsystem( g4Reco );
// save a comprehensive evaluation file
PHG4DSTReader* ana = new PHG4DSTReader(string(outputFile) + string("_DSTReader.root"));
ana->set_save_particle(true);
ana->set_load_all_particle(false);
ana->set_load_active_particle(true);
ana->set_save_vertex(true);
se->registerSubsystem(ana);
}
/* Write HepMC ASCII output */
else if ( do_ASCIIOutput )
{
Fun4AllHepMCOutputManager *asciiout = new Fun4AllHepMCOutputManager("HEPMCOUT",outputFile);
se->registerOutputManager(asciiout);
}
//-----------------
// Event processing
//-----------------
if (nEvents <= 0 && !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;
}
else
{
se->run(nEvents);
se->End();
std::cout << "All done" << std::endl;
delete se;
gSystem->Exit(0);
}
}
示例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();
}