Skip to content

Commit

Permalink
Merge pull request #46402 from iarspider/iarspider-patches-20241017-1
Browse files Browse the repository at this point in the history
[LLVM Analyzer][Generators] Cleanup LLVM analyzer warnings
  • Loading branch information
cmsbuild authored Nov 27, 2024
2 parents 5434ccd + e06f9ae commit 1b7e817
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ using namespace gen;

DataCardFileWriter::DataCardFileWriter(const edm::ParameterSet& pset) {
std::string FileName = pset.getParameter<std::string>("FileName");
std::string Base = std::getenv("CMSSW_BASE");
char* tmp = std::getenv("CMSSW_BASE");
assert(tmp);
std::string Base(tmp);
Base += "/src/";
std::cout << "Writting file:" << Base + FileName << std::endl;
std::ofstream outputFile(Base + FileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,16 @@ void EvtGenInterface::init() {
//Setup evtGen following instructions on http://evtgen.warwick.ac.uk/docs/external/
bool convertPythiaCodes = fPSet->getUntrackedParameter<bool>(
"convertPythiaCodes", true); // Specify if we want to use Pythia 6 physics codes for decays
std::string pythiaDir =
char* tmp =
std::getenv("PYTHIA8DATA"); // Specify the pythia xml data directory to use the default PYTHIA8DATA location
if (pythiaDir.empty()) {

if (tmp == nullptr) {
edm::LogError("EvtGenInterface::~EvtGenInterface")
<< "EvtGenInterface::init() PYTHIA8DATA not defined. Terminating program ";
exit(0);
}

std::string pythiaDir(tmp);
std::string photonType("gamma"); // Specify the photon type for Photos
bool useEvtGenRandom(true); // Specify if we want to use the EvtGen random number engine for these generators

Expand Down
3 changes: 3 additions & 0 deletions GeneratorInterface/RivetInterface/plugins/RivetAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ void RivetAnalyzer::beginJob() {
//set the environment, very ugly but rivet is monolithic when it comes to paths
char* cmsswbase = std::getenv("CMSSW_BASE");
char* cmsswrelease = std::getenv("CMSSW_RELEASE_BASE");
// These should never fail
assert(cmsswbase);
assert(cmsswrelease);
if (!std::getenv("RIVET_REF_PATH")) {
const std::string rivetref = string(cmsswbase) +
"/src/GeneratorInterface/RivetInterface/data:" + string(cmsswrelease) +
Expand Down

0 comments on commit 1b7e817

Please sign in to comment.