Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:20

0001 #include <algorithm>
0002 #include <iostream>
0003 #include <iomanip>
0004 #include <string>
0005 #include <cctype>
0006 #include <vector>
0007 #include <memory>
0008 #include <cmath>
0009 #include <cstring>
0010 
0011 #include <xercesc/dom/DOM.hpp>
0012 #include <xercesc/parsers/XercesDOMParser.hpp>
0013 #include <xercesc/sax/HandlerBase.hpp>
0014 
0015 #include "FWCore/Utilities/interface/Exception.h"
0016 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0017 
0018 #include "SimDataFormats/GeneratorProducts/interface/LesHouches.h"
0019 
0020 #include "GeneratorInterface/LHEInterface/interface/LHERunInfo.h"
0021 
0022 #include "XMLUtils.h"
0023 
0024 XERCES_CPP_NAMESPACE_USE
0025 
0026 static int skipWhitespace(std::istream &in) {
0027   int ch;
0028   do {
0029     ch = in.get();
0030   } while (std::isspace(ch));
0031   if (ch != std::istream::traits_type::eof())
0032     in.putback(ch);
0033   return ch;
0034 }
0035 
0036 namespace lhef {
0037 
0038   LHERunInfo::LHERunInfo(std::istream &in) {
0039     in >> heprup.IDBMUP.first >> heprup.IDBMUP.second >> heprup.EBMUP.first >> heprup.EBMUP.second >>
0040         heprup.PDFGUP.first >> heprup.PDFGUP.second >> heprup.PDFSUP.first >> heprup.PDFSUP.second >> heprup.IDWTUP >>
0041         heprup.NPRUP;
0042     if (!in.good())
0043       throw cms::Exception("InvalidFormat") << "Les Houches file contained invalid"
0044                                                " header in init section."
0045                                             << std::endl;
0046 
0047     heprup.resize();
0048 
0049     for (int i = 0; i < heprup.NPRUP; i++) {
0050       in >> heprup.XSECUP[i] >> heprup.XERRUP[i] >> heprup.XMAXUP[i] >> heprup.LPRUP[i];
0051       if (!in.good())
0052         throw cms::Exception("InvalidFormat") << "Les Houches file contained invalid data"
0053                                                  " in header payload line "
0054                                               << (i + 1) << "." << std::endl;
0055     }
0056 
0057     while (skipWhitespace(in) == '#') {
0058       std::string line;
0059       std::getline(in, line);
0060       comments.push_back(line + "\n");
0061     }
0062 
0063     if (!in.eof())
0064       edm::LogInfo("Generator|LHEInterface")
0065           << "Les Houches file contained spurious"
0066              " content after the regular data (this is normal for LHEv3 files for now)."
0067           << std::endl;
0068 
0069     init();
0070   }
0071 
0072   LHERunInfo::LHERunInfo(const HEPRUP &heprup) : heprup(heprup) { init(); }
0073 
0074   LHERunInfo::LHERunInfo(const HEPRUP &heprup,
0075                          const std::vector<LHERunInfoProduct::Header> &headers,
0076                          const std::vector<std::string> &comments)
0077       : heprup(heprup) {
0078     std::copy(headers.begin(), headers.end(), std::back_inserter(this->headers));
0079     std::copy(comments.begin(), comments.end(), std::back_inserter(this->comments));
0080 
0081     init();
0082   }
0083 
0084   LHERunInfo::LHERunInfo(const LHERunInfoProduct &product) : heprup(product.heprup()) {
0085     std::copy(product.headers_begin(), product.headers_end(), std::back_inserter(headers));
0086     std::copy(product.comments_begin(), product.comments_end(), std::back_inserter(comments));
0087 
0088     init();
0089   }
0090 
0091   LHERunInfo::~LHERunInfo() {}
0092 
0093   void LHERunInfo::init() {
0094     for (int i = 0; i < heprup.NPRUP; i++) {
0095       Process proc;
0096       proc.setProcess(heprup.LPRUP[i]);
0097       proc.setHepRupIndex((unsigned int)i);
0098       processes.push_back(proc);
0099     }
0100 
0101     std::sort(processes.begin(), processes.end());
0102   }
0103 
0104   void LHERunInfo::initLumi() {
0105     processesLumi.clear();
0106     for (int i = 0; i < heprup.NPRUP; i++) {
0107       Process proc;
0108       proc.setProcess(heprup.LPRUP[i]);
0109       proc.setHepRupIndex((unsigned int)i);
0110       proc.setLHEXSec(heprup.XSECUP[i], heprup.XERRUP[i]);
0111       processesLumi.push_back(proc);
0112     }
0113 
0114     std::sort(processesLumi.begin(), processesLumi.end());
0115   }
0116 
0117   bool LHERunInfo::operator==(const LHERunInfo &other) const { return heprup == other.heprup; }
0118 
0119   void LHERunInfo::count(int process, CountMode mode, double eventWeight, double brWeight, double matchWeight) {
0120     std::vector<Process>::iterator proc = std::lower_bound(processes.begin(), processes.end(), process);
0121     if (proc == processes.end() || proc->process() != process)
0122       return;
0123 
0124     std::vector<Process>::iterator procLumi = std::lower_bound(processesLumi.begin(), processesLumi.end(), process);
0125     if (procLumi == processesLumi.end() || procLumi->process() != process)
0126       return;
0127 
0128     switch (mode) {
0129       case kAccepted:
0130         proc->addAcceptedBr(eventWeight * brWeight * matchWeight);
0131         proc->addAccepted(eventWeight * matchWeight);
0132         procLumi->addAcceptedBr(eventWeight * brWeight * matchWeight);
0133         procLumi->addAccepted(eventWeight * matchWeight);
0134         [[fallthrough]];
0135       case kKilled:
0136         proc->addKilled(eventWeight * matchWeight);
0137         procLumi->addKilled(eventWeight * matchWeight);
0138         if (eventWeight > 0) {
0139           proc->addNPassPos();
0140           procLumi->addNPassPos();
0141         } else {
0142           proc->addNPassNeg();
0143           procLumi->addNPassNeg();
0144         }
0145         [[fallthrough]];
0146       case kSelected:
0147         proc->addSelected(eventWeight);
0148         procLumi->addSelected(eventWeight);
0149         if (eventWeight > 0) {
0150           proc->addNTotalPos();
0151           procLumi->addNTotalPos();
0152         } else {
0153           proc->addNTotalNeg();
0154           procLumi->addNTotalNeg();
0155         }
0156         [[fallthrough]];
0157       case kTried:
0158         proc->addTried(eventWeight);
0159         procLumi->addTried(eventWeight);
0160     }
0161   }
0162 
0163   LHERunInfo::XSec LHERunInfo::xsec() const {
0164     double sigSelSum = 0.0;
0165     double sigSum = 0.0;
0166     double sigBrSum = 0.0;
0167     double err2Sum = 0.0;
0168     double errBr2Sum = 0.0;
0169     int idwtup = heprup.IDWTUP;
0170     for (std::vector<Process>::const_iterator proc = processes.begin(); proc != processes.end(); ++proc) {
0171       unsigned int idx = proc->heprupIndex();
0172 
0173       if (!proc->killed().n())
0174         continue;
0175 
0176       double sigma2Sum, sigma2Err;
0177       sigma2Sum = heprup.XSECUP[idx] * heprup.XSECUP[idx];
0178       sigma2Err = heprup.XERRUP[idx] * heprup.XERRUP[idx];
0179 
0180       double sigmaAvg = heprup.XSECUP[idx];
0181 
0182       double fracAcc = 0;
0183       double ntotal = proc->nTotalPos() - proc->nTotalNeg();
0184       double npass = proc->nPassPos() - proc->nPassNeg();
0185       switch (idwtup) {
0186         case 3:
0187         case -3:
0188           fracAcc = ntotal > 0 ? npass / ntotal : -1;
0189           break;
0190         default:
0191           fracAcc = proc->selected().sum() > 0 ? proc->killed().sum() / proc->selected().sum() : -1;
0192           break;
0193       }
0194 
0195       if (fracAcc <= 0)
0196         continue;
0197 
0198       double fracBr = proc->accepted().sum() > 0.0 ? proc->acceptedBr().sum() / proc->accepted().sum() : 1;
0199       double sigmaFin = sigmaAvg * fracAcc;
0200       double sigmaFinBr = sigmaFin * fracBr;
0201 
0202       double relErr = 1.0;
0203 
0204       double efferr2 = 0;
0205       switch (idwtup) {
0206         case 3:
0207         case -3: {
0208           double ntotal_pos = proc->nTotalPos();
0209           double effp = ntotal_pos > 0 ? (double)proc->nPassPos() / ntotal_pos : 0;
0210           double effp_err2 = ntotal_pos > 0 ? (1 - effp) * effp / ntotal_pos : 0;
0211 
0212           double ntotal_neg = proc->nTotalNeg();
0213           double effn = ntotal_neg > 0 ? (double)proc->nPassNeg() / ntotal_neg : 0;
0214           double effn_err2 = ntotal_neg > 0 ? (1 - effn) * effn / ntotal_neg : 0;
0215 
0216           efferr2 = ntotal > 0
0217                         ? (ntotal_pos * ntotal_pos * effp_err2 + ntotal_neg * ntotal_neg * effn_err2) / ntotal / ntotal
0218                         : 0;
0219           break;
0220         }
0221         default: {
0222           double denominator = pow(proc->selected().sum(), 4);
0223           double passw = proc->killed().sum();
0224           double passw2 = proc->killed().sum2();
0225           double failw = proc->selected().sum() - passw;
0226           double failw2 = proc->selected().sum2() - passw2;
0227           double numerator = (passw2 * failw * failw + failw2 * passw * passw);
0228 
0229           efferr2 = denominator > 0 ? numerator / denominator : 0;
0230           break;
0231         }
0232       }
0233       double delta2Veto = efferr2 / fracAcc / fracAcc;
0234       double delta2Sum = delta2Veto + sigma2Err / sigma2Sum;
0235       relErr = (delta2Sum > 0.0 ? std::sqrt(delta2Sum) : 0.0);
0236 
0237       double deltaFin = sigmaFin * relErr;
0238       double deltaFinBr = sigmaFinBr * relErr;
0239 
0240       sigSelSum += sigmaAvg;
0241       sigSum += sigmaFin;
0242       sigBrSum += sigmaFinBr;
0243       err2Sum += deltaFin * deltaFin;
0244       errBr2Sum += deltaFinBr * deltaFinBr;
0245     }
0246 
0247     XSec result(sigBrSum, std::sqrt(errBr2Sum));
0248 
0249     return result;
0250   }
0251 
0252   void LHERunInfo::statistics() const {
0253     double sigSelSum = 0.0;
0254     double sigSum = 0.0;
0255     double sigBrSum = 0.0;
0256     double errSel2Sum = 0.0;
0257     double err2Sum = 0.0;
0258     double errBr2Sum = 0.0;
0259     double errMatch2Sum = 0.0;
0260     unsigned long nAccepted = 0;
0261     unsigned long nTried = 0;
0262     unsigned long nAccepted_pos = 0;
0263     unsigned long nTried_pos = 0;
0264     unsigned long nAccepted_neg = 0;
0265     unsigned long nTried_neg = 0;
0266     int idwtup = heprup.IDWTUP;
0267 
0268     LogDebug("LHERunInfo") << " statistics";
0269     LogDebug("LHERunInfo") << "Process and cross-section statistics";
0270     LogDebug("LHERunInfo") << "------------------------------------";
0271     LogDebug("LHERunInfo") << "Process\t\txsec_before [pb]\t\tpassed\tnposw\tnnegw\ttried\tnposw\tnnegw \txsec_match "
0272                               "[pb]\t\t\taccepted [%]\t event_eff [%]";
0273 
0274     for (std::vector<Process>::const_iterator proc = processes.begin(); proc != processes.end(); ++proc) {
0275       unsigned int idx = proc->heprupIndex();
0276 
0277       if (!proc->selected().n()) {
0278         LogDebug("LHERunInfo") << proc->process() << "\t0\t0\tn/a\t\t\tn/a";
0279         continue;
0280       }
0281 
0282       double sigma2Sum, sigma2Err;
0283       sigma2Sum = heprup.XSECUP[idx] * heprup.XSECUP[idx];
0284       sigma2Err = heprup.XERRUP[idx] * heprup.XERRUP[idx];
0285 
0286       double sigmaAvg = heprup.XSECUP[idx];
0287 
0288       double fracAcc = 0;
0289       double ntotal = proc->nTotalPos() - proc->nTotalNeg();
0290       double npass = proc->nPassPos() - proc->nPassNeg();
0291       switch (idwtup) {
0292         case 3:
0293         case -3:
0294           fracAcc = ntotal > 0 ? npass / ntotal : -1;
0295           break;
0296         default:
0297           fracAcc = proc->selected().sum() > 0 ? proc->killed().sum() / proc->selected().sum() : -1;
0298           break;
0299       }
0300 
0301       double fracBr = proc->accepted().sum() > 0.0 ? proc->acceptedBr().sum() / proc->accepted().sum() : 1;
0302       double sigmaFin = fracAcc > 0 ? sigmaAvg * fracAcc : 0;
0303       double sigmaFinBr = sigmaFin * fracBr;
0304 
0305       double relErr = 1.0;
0306       double relAccErr = 1.0;
0307       double efferr2 = 0;
0308 
0309       if (proc->killed().n() > 0 && fracAcc > 0) {
0310         switch (idwtup) {
0311           case 3:
0312           case -3: {
0313             double ntotal_pos = proc->nTotalPos();
0314             double effp = ntotal_pos > 0 ? (double)proc->nPassPos() / ntotal_pos : 0;
0315             double effp_err2 = ntotal_pos > 0 ? (1 - effp) * effp / ntotal_pos : 0;
0316 
0317             double ntotal_neg = proc->nTotalNeg();
0318             double effn = ntotal_neg > 0 ? (double)proc->nPassNeg() / ntotal_neg : 0;
0319             double effn_err2 = ntotal_neg > 0 ? (1 - effn) * effn / ntotal_neg : 0;
0320 
0321             efferr2 = ntotal > 0 ? (ntotal_pos * ntotal_pos * effp_err2 + ntotal_neg * ntotal_neg * effn_err2) /
0322                                        ntotal / ntotal
0323                                  : 0;
0324             break;
0325           }
0326           default: {
0327             double denominator = pow(proc->selected().sum(), 4);
0328             double passw = proc->killed().sum();
0329             double passw2 = proc->killed().sum2();
0330             double failw = proc->selected().sum() - passw;
0331             double failw2 = proc->selected().sum2() - passw2;
0332             double numerator = (passw2 * failw * failw + failw2 * passw * passw);
0333 
0334             efferr2 = denominator > 0 ? numerator / denominator : 0;
0335             break;
0336           }
0337         }
0338         double delta2Veto = efferr2 / fracAcc / fracAcc;
0339         double delta2Sum = delta2Veto + sigma2Err / sigma2Sum;
0340         relErr = (delta2Sum > 0.0 ? std::sqrt(delta2Sum) : 0.0);
0341         relAccErr = (delta2Veto > 0.0 ? std::sqrt(delta2Veto) : 0.0);
0342       }
0343       double deltaFin = sigmaFin * relErr;
0344       double deltaFinBr = sigmaFinBr * relErr;
0345 
0346       double ntotal_proc = proc->nTotalPos() + proc->nTotalNeg();
0347       double event_eff_proc = ntotal_proc > 0 ? (double)(proc->nPassPos() + proc->nPassNeg()) / ntotal_proc : -1;
0348       double event_eff_err_proc = ntotal_proc > 0 ? std::sqrt((1 - event_eff_proc) * event_eff_proc / ntotal_proc) : -1;
0349 
0350       LogDebug("LHERunInfo") << proc->process() << "\t\t" << std::scientific << std::setprecision(3)
0351                              << heprup.XSECUP[proc->heprupIndex()] << " +/- " << heprup.XERRUP[proc->heprupIndex()]
0352                              << "\t\t" << proc->accepted().n() << "\t" << proc->nPassPos() << "\t" << proc->nPassNeg()
0353                              << "\t" << proc->tried().n() << "\t" << proc->nTotalPos() << "\t" << proc->nTotalNeg()
0354                              << "\t" << std::scientific << std::setprecision(3) << sigmaFinBr << " +/- " << deltaFinBr
0355                              << "\t\t" << std::fixed << std::setprecision(1) << (fracAcc * 100) << " +/- "
0356                              << (std::sqrt(efferr2) * 100) << "\t" << std::fixed << std::setprecision(1)
0357                              << (event_eff_proc * 100) << " +/- " << (event_eff_err_proc * 100);
0358 
0359       nAccepted += proc->accepted().n();
0360       nTried += proc->tried().n();
0361       nAccepted_pos += proc->nPassPos();
0362       nTried_pos += proc->nTotalPos();
0363       nAccepted_neg += proc->nPassNeg();
0364       nTried_neg += proc->nTotalNeg();
0365       sigSelSum += sigmaAvg;
0366       sigSum += sigmaFin;
0367       sigBrSum += sigmaFinBr;
0368       errSel2Sum += sigma2Err;
0369       err2Sum += deltaFin * deltaFin;
0370       errBr2Sum += deltaFinBr * deltaFinBr;
0371       errMatch2Sum += sigmaFin * relAccErr * sigmaFin * relAccErr;
0372     }
0373 
0374     double ntotal_all = (nTried_pos + nTried_neg);
0375     double event_eff_all = ntotal_all > 0 ? (double)(nAccepted_pos + nAccepted_neg) / ntotal_all : -1;
0376     double event_eff_err_all = ntotal_all > 0 ? std::sqrt((1 - event_eff_all) * event_eff_all / ntotal_all) : -1;
0377 
0378     LogDebug("LHERunInfo") << "Total\t\t" << std::scientific << std::setprecision(3) << sigSelSum << " +/- "
0379                            << std::sqrt(errSel2Sum) << "\t\t" << nAccepted << "\t" << nAccepted_pos << "\t"
0380                            << nAccepted_neg << "\t" << nTried << "\t" << nTried_pos << "\t" << nTried_neg << "\t"
0381                            << std::scientific << std::setprecision(3) << sigBrSum << " +/- " << std::sqrt(errBr2Sum)
0382                            << "\t\t" << std::fixed << std::setprecision(1) << (sigSum / sigSelSum * 100) << " +/- "
0383                            << (std::sqrt(errMatch2Sum) / sigSelSum * 100) << "\t" << std::fixed << std::setprecision(1)
0384                            << (event_eff_all * 100) << " +/- " << (event_eff_err_all * 100);
0385   }
0386 
0387   LHERunInfo::Header::Header() : xmlDoc(nullptr) {}
0388 
0389   LHERunInfo::Header::Header(const std::string &tag) : LHERunInfoProduct::Header(tag), xmlDoc(nullptr) {}
0390 
0391   LHERunInfo::Header::Header(const Header &orig) : LHERunInfoProduct::Header(orig), xmlDoc(nullptr) {}
0392 
0393   LHERunInfo::Header::Header(const LHERunInfoProduct::Header &orig)
0394       : LHERunInfoProduct::Header(orig), xmlDoc(nullptr) {}
0395 
0396   LHERunInfo::Header::~Header() {
0397     if (xmlDoc)
0398       xmlDoc->release();
0399   }
0400 
0401   static void fillLines(std::vector<std::string> &lines, const char *data, int len = -1) {
0402     const char *end = len >= 0 ? (data + len) : nullptr;
0403     while (*data && (!end || data < end)) {
0404       std::size_t len = std::strcspn(data, "\r\n");
0405       if (end && data + len > end)
0406         len = end - data;
0407       if (data[len] == '\r' && data[len + 1] == '\n')
0408         len += 2;
0409       else if (data[len])
0410         len++;
0411       lines.push_back(std::string(data, len));
0412       data += len;
0413     }
0414   }
0415 
0416   static std::vector<std::string> domToLines(const DOMNode *node) {
0417     std::vector<std::string> result;
0418     DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(XMLUniStr("Core"));
0419     std::unique_ptr<DOMLSSerializer> writer(((DOMImplementationLS *)(impl))->createLSSerializer());
0420 
0421     std::unique_ptr<DOMLSOutput> outputDesc(((DOMImplementationLS *)impl)->createLSOutput());
0422     assert(outputDesc.get());
0423     outputDesc->setEncoding(XMLUniStr("UTF-8"));
0424 
0425     XMLSimpleStr buffer(writer->writeToString(node));
0426 
0427     const char *p = std::strchr((const char *)buffer, '>') + 1;
0428     const char *q = std::strrchr(p, '<');
0429     fillLines(result, p, q - p);
0430 
0431     return result;
0432   }
0433 
0434   std::vector<std::string> LHERunInfo::findHeader(const std::string &tag) const {
0435     const LHERunInfo::Header *header = nullptr;
0436     for (std::vector<Header>::const_iterator iter = headers.begin(); iter != headers.end(); ++iter) {
0437       if (iter->tag() == tag)
0438         return std::vector<std::string>(iter->begin(), iter->end());
0439       if (iter->tag() == "header")
0440         header = &*iter;
0441     }
0442 
0443     if (!header)
0444       return std::vector<std::string>();
0445 
0446     const DOMNode *root = header->getXMLNode();
0447     if (!root)
0448       return std::vector<std::string>();
0449 
0450     for (const DOMNode *iter = root->getFirstChild(); iter; iter = iter->getNextSibling()) {
0451       if (iter->getNodeType() != DOMNode::ELEMENT_NODE)
0452         continue;
0453       if (tag == (const char *)XMLSimpleStr(iter->getNodeName()))
0454         return domToLines(iter);
0455     }
0456 
0457     return std::vector<std::string>();
0458   }
0459 
0460   namespace {
0461     class HeaderReader : public CBInputStream::Reader {
0462     public:
0463       HeaderReader(const LHERunInfo::Header *header) : header(header), mode(kHeader), iter(header->begin()) {}
0464 
0465       const std::string &data() override {
0466         switch (mode) {
0467           case kHeader:
0468             tmp = "<" + header->tag() + ">";
0469             mode = kBody;
0470             break;
0471           case kBody:
0472             if (iter != header->end())
0473               return *iter++;
0474             tmp = "</" + header->tag() + ">";
0475             mode = kFooter;
0476             break;
0477           case kFooter:
0478             tmp.clear();
0479         }
0480 
0481         return tmp;
0482       }
0483 
0484     private:
0485       enum Mode { kHeader, kBody, kFooter };
0486 
0487       const LHERunInfo::Header *header;
0488       Mode mode;
0489       LHERunInfo::Header::const_iterator iter;
0490       std::string tmp;
0491     };
0492   }  // anonymous namespace
0493 
0494   const DOMNode *LHERunInfo::Header::getXMLNode() const {
0495     if (tag().empty())
0496       return nullptr;
0497 
0498     if (!xmlDoc) {
0499       XercesDOMParser parser;
0500       parser.setValidationScheme(XercesDOMParser::Val_Auto);
0501       parser.setDoNamespaces(false);
0502       parser.setDoSchema(false);
0503       parser.setValidationSchemaFullChecking(false);
0504 
0505       HandlerBase errHandler;
0506       parser.setErrorHandler(&errHandler);
0507       parser.setCreateEntityReferenceNodes(false);
0508 
0509       try {
0510         std::unique_ptr<CBInputStream::Reader> reader(new HeaderReader(this));
0511         CBInputSource source(reader);
0512         parser.parse(source);
0513         xmlDoc = parser.adoptDocument();
0514       } catch (const XMLException &e) {
0515         throw cms::Exception("Generator|LHEInterface")
0516             << "XML parser reported DOM error no. " << (unsigned long)e.getCode() << ": "
0517             << XMLSimpleStr(e.getMessage()) << "." << std::endl;
0518       } catch (const SAXException &e) {
0519         throw cms::Exception("Generator|LHEInterface")
0520             << "XML parser reported: " << XMLSimpleStr(e.getMessage()) << "." << std::endl;
0521       }
0522     }
0523 
0524     return xmlDoc->getDocumentElement();
0525   }
0526 
0527   std::pair<int, int> LHERunInfo::pdfSetTranslation() const {
0528     int pdfA = -1, pdfB = -1;
0529 
0530     if (heprup.PDFGUP.first >= 0) {
0531       pdfA = heprup.PDFSUP.first;
0532     }
0533 
0534     if (heprup.PDFGUP.second >= 0) {
0535       pdfB = heprup.PDFSUP.second;
0536     }
0537 
0538     return std::make_pair(pdfA, pdfB);
0539   }
0540 
0541   const bool operator==(const LHERunInfo::Process &lhs, const LHERunInfo::Process &rhs) {
0542     return (lhs.process() == rhs.process());
0543   }
0544 
0545   const bool operator<(const LHERunInfo::Process &lhs, const LHERunInfo::Process &rhs) {
0546     return (lhs.process() < rhs.process());
0547   }
0548 
0549 }  // namespace lhef