File indexing completed on 2026-04-07 08:09:56
0001 #pragma once
0002 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
0003
0004 #include <herwigproductionqamodule/HerwigProductionQAModule.h>
0005 #include <fun4all/Fun4AllInputManager.h>
0006 #include <fun4all/Fun4AllServer.h>
0007 #include <fun4all/Fun4AllDstInputManager.h>
0008 #include <fun4all/SubsysReco.h>
0009 #include <phhepmc/Fun4AllHepMCInputManager.h>
0010 #include <string>
0011 #include <format>
0012
0013 R__LOAD_LIBRARY(libfun4all.so);
0014 R__LOAD_LIBRARY(libffamodules.so);
0015 R__LOAD_LIBRARY(libffarawmodules.so);
0016 R__LOAD_LIBRARY(libphhepmc.so);
0017 R__LOAD_LIBRARY(libHerwigProductionQAModule.so);
0018
0019
0020 void RunHerwigProductionQA(int segment, std::string trigger_string, std::string generator, std::string file1, std::string file2="null")
0021 {
0022 Fun4AllServer* se =Fun4AllServer::instance();
0023 std::string output_file = std::format("{0}_{1}-{2:06d}.root", generator, trigger_string, segment);
0024 std::cout<<output_file<<std::endl;
0025 if(file2.find("null") != std::string::npos)
0026 {
0027 Fun4AllHepMCInputManager *in = new Fun4AllHepMCInputManager("in");
0028 se->registerInputManager(in);
0029 in->fileopen(file1);
0030 }
0031 else{
0032 Fun4AllDstInputManager *in_truth = new Fun4AllDstInputManager("in_truth");
0033 Fun4AllDstInputManager *in_jet = new Fun4AllDstInputManager("in_jet");
0034 se->registerInputManager(in_truth);
0035 se->registerInputManager(in_jet);
0036 in_truth->fileopen(file1);
0037 in_jet->fileopen(file2);
0038 }
0039 HerwigProductionQAModule* qa = new HerwigProductionQAModule(generator+trigger_string, output_file);
0040 se->registerSubsystem(qa);
0041 se->run();
0042 qa->Print();
0043 return;
0044 };
0045 #endif