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 &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)
 
const bool operator== (const GenLumiInfoProduct::ProcessInfo &lhs, const GenLumiInfoProduct::ProcessInfo &rhs)
 

Function Documentation

◆ operator!=() [1/2]

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

Definition at line 31 of file GenLumiInfoProduct.cc.

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 }

References goodZToMuMu_cfi::condition, GenLumiInfoProduct::getHEPIDWTUP(), GenLumiInfoProduct::getProcessInfos(), and mps_fire::i.

◆ operator!=() [2/2]

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

Definition at line 17 of file GenLumiInfoProduct.cc.

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

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

◆ operator<()

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

Definition at line 13 of file GenLumiInfoProduct.cc.

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

References GenLumiInfoProduct::ProcessInfo::process().

◆ operator==() [1/2]

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

Definition at line 51 of file GenLumiInfoProduct.cc.

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 }

References goodZToMuMu_cfi::condition, GenLumiInfoProduct::getHEPIDWTUP(), GenLumiInfoProduct::getProcessInfos(), and mps_fire::i.

◆ operator==() [2/2]

const bool operator== ( const GenLumiInfoProduct::ProcessInfo lhs,
const GenLumiInfoProduct::ProcessInfo rhs 
)
mps_fire.i
i
Definition: mps_fire.py:355
GenLumiInfoProduct::ProcessInfo::killed
const FinalStat & killed() const
Definition: GenLumiInfoProduct.h:102
GenLumiInfoProduct::ProcessInfo::lheXSec
const XSec & lheXSec() const
Definition: GenLumiInfoProduct.h:93
GenLumiInfoProduct::ProcessInfo::acceptedBr
const FinalStat & acceptedBr() const
Definition: GenLumiInfoProduct.h:104
GenLumiInfoProduct::ProcessInfo::nPassPos
unsigned int nPassPos() const
Definition: GenLumiInfoProduct.h:95
GenLumiInfoProduct::ProcessInfo::nTotalPos
unsigned int nTotalPos() const
Definition: GenLumiInfoProduct.h:97
GenLumiInfoProduct::getProcessInfos
const std::vector< ProcessInfo > & getProcessInfos() const
Definition: GenLumiInfoProduct.h:26
GenLumiInfoProduct::ProcessInfo::tried
const FinalStat & tried() const
Definition: GenLumiInfoProduct.h:100
GenLumiInfoProduct::ProcessInfo::selected
const FinalStat & selected() const
Definition: GenLumiInfoProduct.h:101
GenLumiInfoProduct::ProcessInfo::accepted
const FinalStat & accepted() const
Definition: GenLumiInfoProduct.h:103
GenLumiInfoProduct::ProcessInfo::nPassNeg
unsigned int nPassNeg() const
Definition: GenLumiInfoProduct.h:96
goodZToMuMu_cfi.condition
condition
Definition: goodZToMuMu_cfi.py:37
GenLumiInfoProduct::ProcessInfo::nTotalNeg
unsigned int nTotalNeg() const
Definition: GenLumiInfoProduct.h:98
GenLumiInfoProduct::getHEPIDWTUP
const int getHEPIDWTUP() const
Definition: GenLumiInfoProduct.h:25
GenLumiInfoProduct::ProcessInfo::process
int process() const
Definition: GenLumiInfoProduct.h:92