Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
generate_hepmc_bjet.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file generate_hepmc_bjet.C
2  int flavor = -1,
3  char *output = "",
4  int nevents = 100
5  )
6 {
7  //gSystem->Load("libfun4all.so"); // framework + reco modules
8  //gSystem->Load("libPHPythiaEventGen.so");
9  //gSystem->Load("libPHPythiaJet.so");
10  //gSystem->Load("libPHJetBackgroundSubtract.so");
11  //gSystem->Load("libHFJetAnalyzer.so");
12  //gSystem->Load("libPythiaDumper.so");
13  //gSystem->Load("libPHDetectorResponse.so");
14  //gSystem->Load("libPHPythia.so");
15  //gSystem->Load("libPHPyTrigger.so"); // For PHPyTrigger derived classes
16  //gSystem->Load("libPHPyParticleSelect.so"); // For PHPyParticleSelect derived classes
17  //gSystem->Load("libsimreco.so"); // framework + reco modules
18 
19  gSystem->Load("libPHPythia8.so");
20  gSystem->Load("libfun4all.so");
21  gSystem->Load("libphhepmc.so");
22 
24  rc->set_IntFlag("RUNNUMBER",0);
25 
27  // Server...
29 
31  // Reconstruction Modules...
32 
33  //SubsysReco *sync = new SyncSimreco();
34  //se->registerSubsystem(sync);
35 
36  PHPy8JetTrigger *theTrigger = new PHPy8JetTrigger();
37  //theTrigger->Verbosity(10);
38  theTrigger->SetEtaHighLow(-1, 1);
39  theTrigger->SetJetR(.4);
40  theTrigger->SetMinJetPt(20);
41 
42  PHPythia8* pythia8 = new PHPythia8();
43  // see coresoftware/generators/PHPythia8 for example config
44  if (flavor == 0) pythia8->set_config_file("phpythia8_ljet.cfg");
45  if (flavor == 1) pythia8->set_config_file("phpythia8_cjet.cfg");
46  if (flavor == 2) pythia8->set_config_file("phpythia8_bjet.cfg");
47  pythia8->register_trigger(theTrigger);
48  se->registerSubsystem(pythia8);
49 
50 
51  //PHPythia *phpythia = new PHPythia();
52  //phpythia->ReadConfig( phpythiaconfig );
53  //se->registerSubsystem(phpythia);
54 
55  //PHPyJetParticleAcceptor *inpythia = new PHPyJetParticleAcceptInPerfect(3.0);
56  //PHJetTowerAcceptor *inupgrade = new PHJetTowerAcceptInDetector(2.0);
57 
58  //PHPyJetMaker *PythiaJets_Antikt04 = new PHPyJetMaker("anti-kt",0.4,"PythiaJets_Antikt04",inpythia,"PHPythia");
59  //PythiaJets_Antikt02->SetPtCut(10.0);
60  //se->registerSubsystem(PythiaJets_Antikt04);
61 
62  //PythiaDumper *hfjt = new PythiaDumper();
63  //se->registerSubsystem( hfjt );
64  /*
65  PHMakeTowers *pythiatowermaker = new PHMakeTowers("PythiaTowerMaker","PHPythia","","PythiaTowers");
66  //pythiatowermaker->SetResolutionParameters(0,0,ecal_sqrte,0);
67  //pythiatowermaker->SetResolutionParameters(1,hcal_const,hcal_sqrte,hcal_e);
68  se->registerSubsystem(pythiatowermaker);
69 
70  PHTowerJetMaker *pythiatowerreco2 = new PHTowerJetMaker("anti-kt",0.2,"PythiaTowerJets_Antikt02",inupgrade,"PythiaTowers");
71  //pythiatowerreco2->Verbosity(verbosity+2);
72  pythiatowerreco2->SetPtCut(10.0);
73  se->registerSubsystem(pythiatowerreco2);
74  */
75 
76 
77  //** You can force the generated particles to use a vertex read from a file,
78  //** in place of the default (z=0) value
79  //** this is needed for instance when you want to have matching vertices between
80  //** different types of simulated files, prior to sending that to PISA
81  // se->registerSubsystem( new PHPyVertexShift( "PHPyVertexShift", "./events.txt") );
82 
83  //** You can use dedicated triggers, derived from the PHPyTrigger base class
84  // se->registerSubsystem( new PHPyJPsiMuonTrigger() );
85 
86  //** You can select only particular particles to write out
87  //PHPyParticleSelect *pselect = new PHPyParticleSelect();
88  //se->registerSubsystem( pselect );
89 
90  //** A dummy (null) input is needed for the Fun4All framework
91  Fun4AllDummyInputManager *in1 = new Fun4AllDummyInputManager("DSTin1", "DST");
92  se->registerInputManager(in1);
93 
94 
95  // DST output manager
96  Fun4AllDstOutputManager *dst_output_mgr = new Fun4AllDstOutputManager("PHPYTHIA", "temp.root" );
97  dst_output_mgr->AddNode("Sync");
98  dst_output_mgr->AddNode("PHPythiaHeader");
99  dst_output_mgr->AddNode("PHPythia");
100 
102  hepmc = new Fun4AllHepMCOutputManager("HEPMCOUT", output );
103  /*
104  if (flavor == 0) hepmc = new Fun4AllHepMCOutputManager("HEPMCOUT", "output/hepmc_ljet_10k.txt" );
105  if (flavor == 1) hepmc = new Fun4AllHepMCOutputManager("HEPMCOUT", "output/hepmc_cjet_10k.txt" );
106  if (flavor == 2) hepmc = new Fun4AllHepMCOutputManager("HEPMCOUT", "output/hepmc_bjet_10k.txt" );
107  */
108  se->registerOutputManager( hepmc );
109 
110  //dst_output_mgr->AddNode("PythiaTowers");
111  //dst_output_mgr->AddNode("PythiaJets_Antikt04");
112  //dst_output_mgr->AddNode("PythiaTowerJets_Antikt02");
113 
114  // se->registerOutputManager(dst_output_mgr);
115 
116  // OSCAR output manager
117  // with following output manager, one can write the PHPythia output in an oscar formated output text file
118  // PHPyOscarOutputManager *oscar_manager = new PHPyOscarOutputManager( "OSCAR", oscar_outputname );
119  // se->registerOutputManager(oscar_manager);
120 
121  // run over all events
122  se->run( nevents );
123  se->End();
124 }
125