Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evtgenfix #35 #40

Merged
merged 1 commit into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ find_package(EDM4HEP)

add_subdirectory(converter)
add_subdirectory(standalone)
add_subdirectory(examples)
if(BUILD_FRAMEWORK)
add_subdirectory(framework)
endif()
Expand Down
5 changes: 5 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#--- install the default output configuration to the shared directory which will
#--- be picked up by the spack installation as $K4SIMDELPHES

install(FILES edm4hep_output_config.tcl
DESTINATION ${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME})
4 changes: 2 additions & 2 deletions standalone/src/DelphesPythia8EvtGenReader_k4Interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class DelphesPythia8EvtGenReader_k4Interface: public DelphesInputReader {

m_evtgen2= new PythiaEvtGen_Interface(m_pythia.get(), argv[5], argv[6], 1000);
m_evtgen2->add_decays(argv[7], atoi(argv[8]), argv[9]);
m_evtgen2->set_verbose();
m_evtgen2->set_verbose(false);
//m_evtgen2->set_debug();
if(regenerate) m_evtgen2->set_regenerate();

Expand Down Expand Up @@ -201,7 +201,7 @@ class DelphesPythia8EvtGenReader_k4Interface: public DelphesInputReader {
static constexpr const char* m_appName = "DelphesPythia8EvtGen";
std::unique_ptr<Pythia8::Pythia> m_pythia{nullptr};
std::unique_ptr<Pythia8::EvtGenDecays> m_evtgen{nullptr};
PythiaEvtGen_Interface *m_evtgen2;
PythiaEvtGen_Interface *m_evtgen2;
FILE *m_inputFile = 0;
TStopwatch m_readStopWatch, m_procStopWatch;
ExRootTreeWriter *m_treeWriter{nullptr};
Expand Down
12 changes: 7 additions & 5 deletions standalone/src/PythiaEvtGen_Interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,16 @@ void PythiaEvtGen_Interface::decay_signals()
if(debug) std::cout<<"Rand: "<<randomsignal<<std::endl;
int part_index = signal_map[i_sig][randomsignal];
Pythia8::Particle *part = &event[part_index];
//Particle preparation for EvtGen.
//Particle preparation for EvtGen.
EvtId B_i = EvtPDL::getId(sig_names[i_sig] );
if(debug) std::cout<<"EvtID "<<sig_names[i_sig] <<" "<< part_index << std::endl;
EvtVector4R pInit(part->e(), part->px(), part->py(), part->pz() );
if(part->id() != EvtPDL::getStdHep(B_i))
{
if(debug) std::cout<<"We have wrong charge conjugate, changing"<<std::endl;
if(debug) std::cout<<"Changing the name: "<< EvtPDL::name(B_i)<<std::endl;
B_i=EvtPDL::chargeConj(B_i);
}
EvtParticle *Evtpart = EvtParticleFactory::particleFactory( B_i, pInit );
if(debug) std::cout<<"Evtparticle "<<std::endl;
Evtpart->setDiagonalSpinDensity();
Expand All @@ -193,11 +199,7 @@ void PythiaEvtGen_Interface::decay_signals()
if(debug) std::cout<<"Decayed"<<std::endl;
part->tau(Evtpart->getLifetime());
UpdatePythiaEvent(part, Evtpart);


}


}


Expand Down