CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
GenLumiInfoProduct.cc File Reference
#include <iostream>
#include <algorithm>
#include <map>
#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

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

Definition at line 15 of file GenLumiInfoProduct.cc.

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

16 { bool condition = (lhs.process() != rhs.process()) ||
17  (lhs.lheXSec() != rhs.lheXSec());
18  return condition;
19 }
const bool operator!= ( const GenLumiInfoProduct lhs,
const GenLumiInfoProduct rhs 
)

Definition at line 33 of file GenLumiInfoProduct.cc.

References cmsPerfPublish::fail(), GenLumiInfoProduct::getHEPIDWTUP(), GenLumiInfoProduct::getProcessInfos(), i, and python.multivaluedict::sort().

34 {
35  std::vector<GenLumiInfoProduct::ProcessInfo> lhsVector = lhs.getProcessInfos();
36  std::vector<GenLumiInfoProduct::ProcessInfo> rhsVector = rhs.getProcessInfos();
37  std::sort(lhsVector.begin(),lhsVector.end());
38  std::sort(rhsVector.begin(),rhsVector.end());
39  unsigned int lhssize=lhsVector.size();
40  unsigned int rhssize=rhsVector.size();
41  bool condition= (lhs.getHEPIDWTUP() != rhs.getHEPIDWTUP()) ||
42  (lhssize != rhssize);
43  bool fail=false;
44  if(!condition)
45  {
46  for(unsigned int i=0; i<lhssize; i++){
47  if(lhsVector[i] != rhsVector[i])
48  {
49  fail=true;
50  break;
51  }
52 
53  }
54 
55  }
56  return (condition || fail);
57 
58 }
const std::vector< ProcessInfo > & getProcessInfos() const
int i
Definition: DBlmapReader.cc:9
const int getHEPIDWTUP() const
const bool operator< ( const GenLumiInfoProduct::ProcessInfo lhs,
const GenLumiInfoProduct::ProcessInfo rhs 
)

Definition at line 12 of file GenLumiInfoProduct.cc.

References GenLumiInfoProduct::ProcessInfo::process().

13 { return (lhs.process() < rhs.process()); }
const bool operator== ( const GenLumiInfoProduct::ProcessInfo lhs,
const GenLumiInfoProduct::ProcessInfo rhs 
)

Definition at line 21 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()
25  && lhs.nPassPos() == rhs.nPassPos() && lhs.nPassNeg() == rhs.nPassNeg()
26  && lhs.nTotalPos() == rhs.nTotalPos() && lhs.nTotalNeg() == rhs.nTotalNeg()
27  && lhs.tried() == rhs.tried() && lhs.selected() == rhs.selected()
28  && lhs.killed() == rhs.killed() && lhs.accepted() == rhs.accepted()
29  && lhs.acceptedBr() == rhs.acceptedBr());
30  return condition;
31 }
const bool operator== ( const GenLumiInfoProduct lhs,
const GenLumiInfoProduct rhs 
)

Definition at line 61 of file GenLumiInfoProduct.cc.

References GenLumiInfoProduct::getHEPIDWTUP(), GenLumiInfoProduct::getProcessInfos(), i, and python.multivaluedict::sort().

62 {
63  std::vector<GenLumiInfoProduct::ProcessInfo> lhsVector = lhs.getProcessInfos();
64  std::vector<GenLumiInfoProduct::ProcessInfo> rhsVector = rhs.getProcessInfos();
65  std::sort(lhsVector.begin(),lhsVector.end());
66  std::sort(rhsVector.begin(),rhsVector.end());
67  unsigned int lhssize=lhsVector.size();
68  unsigned int rhssize=rhsVector.size();
69 
70  bool condition= (lhs.getHEPIDWTUP() == rhs.getHEPIDWTUP()) &&
71  (lhssize == rhssize);
72  unsigned int passCounts=-999;
73  if(condition)
74  {
75  for(unsigned int i=0; i<lhssize; i++){
76  if(lhsVector[i] == rhsVector[i])
77  passCounts++;
78  }
79  }
80  return (condition && (passCounts==lhssize));
81 
82 }
const std::vector< ProcessInfo > & getProcessInfos() const
int i
Definition: DBlmapReader.cc:9
const int getHEPIDWTUP() const