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

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().

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

Definition at line 35 of file GenLumiInfoProduct.cc.

References cmsPerfPublish::fail(), GenLumiInfoProduct::getHEPIDWTUP(), GenLumiInfoProduct::getProcessInfos(), and mps_fire::i.

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

Definition at line 14 of file GenLumiInfoProduct.cc.

References GenLumiInfoProduct::ProcessInfo::process().

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

Definition at line 23 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().

24 {
25  bool condition=
26  (lhs.process() == rhs.process() && lhs.lheXSec() == rhs.lheXSec()
27  && lhs.nPassPos() == rhs.nPassPos() && lhs.nPassNeg() == rhs.nPassNeg()
28  && lhs.nTotalPos() == rhs.nTotalPos() && lhs.nTotalNeg() == rhs.nTotalNeg()
29  && lhs.tried() == rhs.tried() && lhs.selected() == rhs.selected()
30  && lhs.killed() == rhs.killed() && lhs.accepted() == rhs.accepted()
31  && lhs.acceptedBr() == rhs.acceptedBr());
32  return condition;
33 }
FinalStat const & tried() const
FinalStat const & killed() const
FinalStat const & accepted() const
FinalStat const & acceptedBr() const
FinalStat const & selected() const
const bool operator== ( const GenLumiInfoProduct lhs,
const GenLumiInfoProduct rhs 
)

Definition at line 63 of file GenLumiInfoProduct.cc.

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

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