12 #include <boost/date_time/posix_time/posix_time.hpp>
14 #include <boost/iostreams/tee.hpp>
15 #include <boost/iostreams/stream.hpp>
21 #define __millisecondsTime__ boost::posix_time::microsec_clock::local_time().time_of_day().total_milliseconds()
31 std::string toString(
int a) {
39 typedef boost::iostreams::tee_device<std::ostream, std::ofstream> TeeDevice;
40 typedef boost::iostreams::stream<TeeDevice> TeeStream;
58 std::ofstream* __temp_logFile__ =
new std::ofstream();
63 TeeDevice __temp_tee_device(*ostreams::terminal, *__temp_logFile__);
68 std::cout.rdbuf(__temp_logFile__->rdbuf());
82 std::cout.rdbuf(__temp_logFile__->rdbuf());
114 std::string addVMCDir(
const char* _str) {
115 static std::string workingDir = getenv(
"VMCWORKDIR");
116 return (workingDir + _str);
119 std::string
EvtGenPDL = addVMCDir(
"/pgenerators/EvtGen/EvtGen/Private/evt.pdl");
120 std::string
EvtGenDecFile = addVMCDir(
"/pgenerators/EvtGen/EvtGen/Private/DECAY.DEC");
127 bool evt_gen_ids_are_loaded =
false;
136 throw std::runtime_error(
"EvtGen is not loaded yet.");
138 if (evt_gen_ids_are_loaded)
144 evt_gen_ids_are_loaded =
true;
151 EvtExternalGenList genList;
152 EvtAbsRadCorr* radCorrEngine = genList.getPhotosModel();
153 std::list<EvtDecayBase*> extraModels = genList.getListOfModels();
159 radCorrEngine, &extraModels);
169 evt_gen->readUDecay(dec_file_name);
178 pdf =
new Pythia8::CTEQ6pdf(2212, 1, getenv(
"PYTHIA8DATA"));
180 pythia =
new Pythia8::Pythia(getenv(
"PYTHIA8DATA"));
183 pythia->readString(
"ProcessLevel:all = off");
185 pythia->readString(
"20443:mayDecay = off");
186 pythia->readString(
"445:mayDecay = off");
187 pythia->readString(
"443:mayDecay = off");
190 pythia->particleData.addParticle(
201 pythia->readString(
"9920443:mayDecay = off");
208 bool chigen_is_initialized =
false;
212 if (!chigen_is_initialized)
221 chigen_is_initialized =
true;
228 __chigen_cout__ <<
" Initializing with seed " << __seed__ <<
"." << std::endl;
260 throw std::runtime_error(std::string(
"Unknown particle id: ") + toString(pdgId));
#define __millisecondsTime__
bool isPWaveCharmonia(int pdgCode)
void ensure_chigen_is_initialized()
bool isCharmonia(int pdgCode)
void ensure_evt_gen_is_inialized()
bool suppress_pandaroot_cout
#define __chigen_direct_cout__
std::ostream * chigen_cout
Pythia8::Rndm * pythia_random_engine
EvtId pdgId2EvtId(int pdgId)
void read_dec_file(char *dec_file_name)
basic_ostream< char, char_traits< char > > ostream
std::ostream * tee_stream
double elapsedTimeSeconds()
ChiGenRandomEngine * random_engine
std::string EvtGenChiDecFile
std::string EvtGenDecFile
void initialize_streams()