File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,9 @@ using namespace gen;
1111
1212DataCardFileWriter::DataCardFileWriter (const edm::ParameterSet& pset) {
1313 std::string FileName = pset.getParameter <std::string>(" FileName" );
14- std::string Base = std::getenv (" CMSSW_BASE" );
14+ char * tmp = std::getenv (" CMSSW_BASE" );
15+ assert (tmp);
16+ std::string Base (tmp);
1517 Base += " /src/" ;
1618 std::cout << " Writting file:" << Base + FileName << std::endl;
1719 std::ofstream outputFile (Base + FileName);
Original file line number Diff line number Diff line change @@ -301,13 +301,16 @@ void EvtGenInterface::init() {
301301 // Setup evtGen following instructions on http://evtgen.warwick.ac.uk/docs/external/
302302 bool convertPythiaCodes = fPSet ->getUntrackedParameter <bool >(
303303 " convertPythiaCodes" , true ); // Specify if we want to use Pythia 6 physics codes for decays
304- std::string pythiaDir =
304+ char * tmp =
305305 std::getenv (" PYTHIA8DATA" ); // Specify the pythia xml data directory to use the default PYTHIA8DATA location
306- if (pythiaDir.empty ()) {
306+
307+ if (tmp == nullptr ) {
307308 edm::LogError (" EvtGenInterface::~EvtGenInterface" )
308309 << " EvtGenInterface::init() PYTHIA8DATA not defined. Terminating program " ;
309310 exit (0 );
310311 }
312+
313+ std::string pythiaDir (tmp);
311314 std::string photonType (" gamma" ); // Specify the photon type for Photos
312315 bool useEvtGenRandom (true ); // Specify if we want to use the EvtGen random number engine for these generators
313316
Original file line number Diff line number Diff line change @@ -54,6 +54,9 @@ void RivetAnalyzer::beginJob() {
5454 // set the environment, very ugly but rivet is monolithic when it comes to paths
5555 char * cmsswbase = std::getenv (" CMSSW_BASE" );
5656 char * cmsswrelease = std::getenv (" CMSSW_RELEASE_BASE" );
57+ // These should never fail
58+ assert (cmsswbase);
59+ assert (cmsswrelease);
5760 if (!std::getenv (" RIVET_REF_PATH" )) {
5861 const std::string rivetref = string (cmsswbase) +
5962 " /src/GeneratorInterface/RivetInterface/data:" + string (cmsswrelease) +
You can’t perform that action at this time.
0 commit comments