CMS 3D CMS Logo

Functions
GenLumiInfoProduct.cc File Reference
#include <iostream>
#include <algorithm>
#include <map>
#include <utility>
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "SimDataFormats/GeneratorProducts/interface/GenLumiInfoProduct.h"

Go to the source code of this file.

Functions

const bool operator!= (const GenLumiInfoProduct::ProcessInfo &lhs, const GenLumiInfoProduct::ProcessInfo &rhs)
 
const bool operator!= (const GenLumiInfoProduct &lhs, const GenLumiInfoProduct &rhs)
 
const bool operator< (const GenLumiInfoProduct::ProcessInfo &lhs, const GenLumiInfoProduct::ProcessInfo &rhs)
 
const bool operator== (const GenLumiInfoProduct::ProcessInfo &lhs, const GenLumiInfoProduct::ProcessInfo &rhs)
 
const bool operator== (const GenLumiInfoProduct &lhs, const GenLumiInfoProduct &rhs)
 

Function Documentation

◆ operator!=() [1/2]

const bool operator!= ( const GenLumiInfoProduct::ProcessInfo lhs,
const GenLumiInfoProduct::ProcessInfo rhs 
)

Definition at line 17 of file GenLumiInfoProduct.cc.

References GenLumiInfoProduct::ProcessInfo::lheXSec(), and GenLumiInfoProduct::ProcessInfo::process().

17  {
18  bool condition = (lhs.process() != rhs.process()) || (lhs.lheXSec() != rhs.lheXSec());
19  return condition;
20 }

◆ operator!=() [2/2]

const bool operator!= ( const GenLumiInfoProduct lhs,
const GenLumiInfoProduct rhs 
)

Definition at line 31 of file GenLumiInfoProduct.cc.

References GenLumiInfoProduct::getHEPIDWTUP(), GenLumiInfoProduct::getProcessInfos(), mps_fire::i, and jetUpdater_cfi::sort.

31  {
32  std::vector<GenLumiInfoProduct::ProcessInfo> lhsVector = lhs.getProcessInfos();
33  std::vector<GenLumiInfoProduct::ProcessInfo> rhsVector = rhs.getProcessInfos();
34  std::sort(lhsVector.begin(), lhsVector.end());
35  std::sort(rhsVector.begin(), rhsVector.end());
36  unsigned int lhssize = lhsVector.size();
37  unsigned int rhssize = rhsVector.size();
38  bool condition = (lhs.getHEPIDWTUP() != rhs.getHEPIDWTUP()) || (lhssize != rhssize);
39  bool fail = false;
40  if (!condition) {
41  for (unsigned int i = 0; i < lhssize; i++) {
42  if (lhsVector[i] != rhsVector[i]) {
43  fail = true;
44  break;
45  }
46  }
47  }
48  return (condition || fail);
49 }
const std::vector< ProcessInfo > & getProcessInfos() const
const int getHEPIDWTUP() const

◆ operator<()

const bool operator< ( const GenLumiInfoProduct::ProcessInfo lhs,
const GenLumiInfoProduct::ProcessInfo rhs 
)

Definition at line 13 of file GenLumiInfoProduct.cc.

References GenLumiInfoProduct::ProcessInfo::process().

13  {
14  return (lhs.process() < rhs.process());
15 }

◆ operator==() [1/2]

const bool operator== ( const GenLumiInfoProduct::ProcessInfo lhs,
const GenLumiInfoProduct::ProcessInfo rhs 
)

Definition at line 22 of file GenLumiInfoProduct.cc.

References GenLumiInfoProduct::ProcessInfo::accepted(), GenLumiInfoProduct::ProcessInfo::acceptedBr(), GenLumiInfoProduct::ProcessInfo::killed(), GenLumiInfoProduct::ProcessInfo::lheXSec(), GenLumiInfoProduct::ProcessInfo::nPassNeg(), GenLumiInfoProduct::ProcessInfo::nPassPos(), GenLumiInfoProduct::ProcessInfo::nTotalNeg(), GenLumiInfoProduct::ProcessInfo::nTotalPos(), GenLumiInfoProduct::ProcessInfo::process(), GenLumiInfoProduct::ProcessInfo::selected(), and GenLumiInfoProduct::ProcessInfo::tried().

22  {
23  bool condition =
24  (lhs.process() == rhs.process() && lhs.lheXSec() == rhs.lheXSec() && lhs.nPassPos() == rhs.nPassPos() &&
25  lhs.nPassNeg() == rhs.nPassNeg() && lhs.nTotalPos() == rhs.nTotalPos() && lhs.nTotalNeg() == rhs.nTotalNeg() &&
26  lhs.tried() == rhs.tried() && lhs.selected() == rhs.selected() && lhs.killed() == rhs.killed() &&
27  lhs.accepted() == rhs.accepted() && lhs.acceptedBr() == rhs.acceptedBr());
28  return condition;
29 }
FinalStat const & acceptedBr() const
FinalStat const & selected() const
FinalStat const & killed() const
FinalStat const & accepted() const
FinalStat const & tried() const

◆ operator==() [2/2]

const bool operator== ( const GenLumiInfoProduct lhs,
const GenLumiInfoProduct rhs 
)

Definition at line 51 of file GenLumiInfoProduct.cc.

References GenLumiInfoProduct::getHEPIDWTUP(), GenLumiInfoProduct::getProcessInfos(), mps_fire::i, and jetUpdater_cfi::sort.

51  {
52  std::vector<GenLumiInfoProduct::ProcessInfo> lhsVector = lhs.getProcessInfos();
53  std::vector<GenLumiInfoProduct::ProcessInfo> rhsVector = rhs.getProcessInfos();
54  std::sort(lhsVector.begin(), lhsVector.end());
55  std::sort(rhsVector.begin(), rhsVector.end());
56  unsigned int lhssize = lhsVector.size();
57  unsigned int rhssize = rhsVector.size();
58 
59  bool condition = (lhs.getHEPIDWTUP() == rhs.getHEPIDWTUP()) && (lhssize == rhssize);
60  unsigned int passCounts = 0;
61  if (condition) {
62  for (unsigned int i = 0; i < lhssize; i++) {
63  if (lhsVector[i] == rhsVector[i])
64  passCounts++;
65  }
66  }
67  return (condition && (passCounts == lhssize));
68 }
const std::vector< ProcessInfo > & getProcessInfos() const
const int getHEPIDWTUP() const