IAP GITLAB

Commit 59dfcd09 authored by Ralf Ulrich's avatar Ralf Ulrich

added OutputPolicyNone and some further cosmetics

git-svn-id: https://devel-ik.fzk.de/svn/mc/crmc/trunk@4572 c7a5e08c-de06-0410-9364-b41cf42a0b17
parent fdc3368f
......@@ -27,7 +27,7 @@ MESSAGE(STATUS "source ${PROJECT_SOURCE_DIR}")
MESSAGE(STATUS "binary ${PROJECT_BINARY_DIR}")
MESSAGE(STATUS "build ${CMAKE_BINARY_DIR}")
## The version number
## The version number. Only nummeric PLEASE!
SET (CRMC_VERSION_MAJOR 1)
SET (CRMC_VERSION_MINOR 5)
SET (CRMC_VERSION_PATCH 3)
......@@ -234,7 +234,7 @@ INCLUDE_DIRECTORIES ("${HepMC_INCLUDE_DIRS}")
INCLUDE_DIRECTORIES ("${Boost_INCLUDE_DIRS}")
INCLUDE_DIRECTORIES ("${ROOT_INCLUDE_DIR}")
# the executable
ADD_EXECUTABLE(crmc src/crmcMain.cc src/CRMC.cc src/CRMCinterface.cc src/CRMCoptions.cc src/OutputPolicyROOT.cc src/OutputPolicyHepMC.cc src/OutputPolicyLHE.cc src/CRMCtrapfpe.c)
ADD_EXECUTABLE(crmc src/crmcMain.cc src/CRMC.cc src/CRMCinterface.cc src/CRMCoptions.cc src/OutputPolicyROOT.cc src/OutputPolicyHepMC.cc src/OutputPolicyLHE.cc src/OutputPolicyNone.cc src/CRMCtrapfpe.c)
# linking of modules
TARGET_LINK_LIBRARIES (crmc ${HepMC_LIBRARIES})
......
......@@ -5,6 +5,7 @@
#include <OutputPolicyROOT.h>
#include <OutputPolicyHepMC.h>
#include <OutputPolicyLHE.h>
#include <OutputPolicyNone.h>
#include <iomanip>
#include <iostream>
......@@ -154,3 +155,4 @@ CRMC<OutputPolicy>::finish()
template class CRMC<OutputPolicyROOT>;
template class CRMC<OutputPolicyHepMC>;
template class CRMC<OutputPolicyLHE>;
template class CRMC<OutputPolicyNone>;
......@@ -37,6 +37,8 @@ class CRMC : public OutputPolicy {
bool run();
bool finish();
CRMCinterface& GetInterface() { return fInterface; }
private:
const CRMCoptions& fCfg;
......@@ -50,10 +52,12 @@ class CRMC : public OutputPolicy {
#include <OutputPolicyROOT.h>
#include <OutputPolicyHepMC.h>
#include <OutputPolicyLHE.h>
#include <OutputPolicyNone.h>
typedef CRMC<OutputPolicyROOT> CRMC2ROOT;
typedef CRMC<OutputPolicyHepMC> CRMC2HepMC;
typedef CRMC<OutputPolicyLHE> CRMC2LHE;
typedef CRMC<OutputPolicyNone> CRMC2NONE;
#endif
......@@ -32,6 +32,9 @@ class CRMCoptions {
std::string ParticleName(const int pid) const;
void SetProjectileMomentum(const double p) { fProjectileMomentum = p; }
void SetTargetMomentum(const double p) { fTargetMomentum = p; }
protected:
bool fError;
......
......@@ -196,11 +196,11 @@ OutputPolicyHepMC::FillEvent(const CRMCoptions& cfg, const int nEvent)
case 4: sig_id = 103; break;
case -4: sig_id = 104; break;
default: cerr << "Signal ID not recognised for setting HEPEVT" << endl;
}
}
fEvtHepMC->set_signal_process_id(sig_id);
if(fEvtHepMC->vertices_begin()!=fEvtHepMC->vertices_end())
fEvtHepMC->set_signal_process_vertex(*(fEvtHepMC->vertices_begin()));
fEvtHepMC->set_signal_process_vertex(*(fEvtHepMC->vertices_begin()));
//DEBUG OUTPUT
/* for (HepMC::GenEvent::particle_const_iterator p = fEvtHepMC->particles_begin(); p != fEvtHepMC->particles_end(); ++p)
......
#include <OutputPolicyNone.h>
#include <CRMCoptions.h>
#include <CRMCinterface.h>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <stdlib.h>
#include <string>
#include <CRMCconfig.h> //cmake generated
using namespace std;
OutputPolicyNone::OutputPolicyNone()
{
}
void
OutputPolicyNone::InitOutput(const CRMCoptions& cfg)
{
}
void
OutputPolicyNone::FillEvent(const CRMCoptions& cfg, const int nEvent)
{
//#ifdef HEPMC_HAS_CROSS_SECTION
// set cross section information for this event
//None::GenCrossSection theCrossSection;
//theCrossSection.set_cross_section(double(gCRMC_data.sigineaa)*1e9); //required in pB
//fEvtNone->set_cross_section(theCrossSection);
//#endif
}
void
OutputPolicyNone::CloseOutput(const CRMCoptions& cfg)
{
}
void
OutputPolicyNone::PrintTestEvent(const CRMCoptions& cfg)
{
/*
cout << "\n >> Test output <<\n\n"
<< " Total Cross Section (mb): " << gCRMC_data.sigtot << "\n"
<< " Elastic Cross Section (mb): " << gCRMC_data.sigela << "\n"
<< " Inel. Cross Section (mb) : " << gCRMC_data.sigine << "\n" ;
if(cfg.fProjectileId>1 || cfg.fTargetId>1)
cout << " Inel. AA Cross Section (mb): " << gCRMC_data.sigineaa << "\n"
<< " Elastic AA Cross Section (mb): " << gCRMC_data.sigelaaa << "\n"
<< " Total AA Cross Section (mb): " << gCRMC_data.sigtotaa << "\n" ;
*/
}
#ifndef _OutputPolicyNone_h_
#define _OutputPolicyNone_h_
class CRMCoptions;
class OutputPolicyNone {
public:
OutputPolicyNone();
void InitOutput(const CRMCoptions& cfg);
void FillEvent(const CRMCoptions& cfg, const int nEvent);
void CloseOutput(const CRMCoptions& cfg);
private:
void PrintTestEvent(const CRMCoptions& cfg);
};
#endif
......@@ -3,8 +3,11 @@
#include <OutputPolicyROOT.h>
#include <OutputPolicyHepMC.h>
#include <OutputPolicyLHE.h>
#include <OutputPolicyNone.h>
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
......@@ -20,6 +23,35 @@ main(int argc, char **argv)
return 2;
}
/*
ofstream out("out.dat");
CRMCoptions cfgCpy = cfg;
for (int i=0; i<50; ++i) {
const double labE = std::pow(10., 1 + 0.5 * i); // [GeV]
cfgCpy.SetProjectileMomentum(labE);
cfgCpy.SetTargetMomentum(0.);
CRMC2NONE crmc(cfgCpy);
crmc.init();
double xsigtot=0,xsigine=0,xsigela=0,xsigdd=0,xsigsd=0,
xsloela=0,xsigtotaa=0,xsigineaa=0,xsigelaaa=0;
crmc.GetInterface().crmc_xsection(xsigtot,xsigine,xsigela,xsigdd,xsigsd,
xsloela,xsigtotaa,xsigineaa,xsigelaaa);
out << labE << " " << xsigtot<< " " <<xsigine<< " " <<xsigela<< " " <<xsigdd<< " " <<xsigsd<< " " <<
xsloela<< " " <<xsigtotaa<< " " <<xsigineaa<< " " <<xsigelaaa << endl;
}
out.close();
return 0;
*/
switch(cfg.GetOutputMode()) {
case CRMCoptions::eROOT:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment