CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
GenLumiInfoProduct Class Reference

#include <GenLumiInfoProduct.h>

Classes

struct  FinalStat
 
struct  ProcessInfo
 
struct  XSec
 

Public Member Functions

 GenLumiInfoProduct ()
 
 GenLumiInfoProduct (const int id)
 
 GenLumiInfoProduct (const GenLumiInfoProduct &other)
 
const int getHEPIDWTUP () const
 
const std::vector< ProcessInfo > & getProcessInfos () const
 
virtual bool isProductEqual (const GenLumiInfoProduct &other) const
 
virtual bool mergeProduct (const GenLumiInfoProduct &other)
 
void setHEPIDWTUP (const int id)
 
void setProcessInfo (const std::vector< ProcessInfo > &processes)
 
void swap (GenLumiInfoProduct &other)
 
virtual ~GenLumiInfoProduct ()
 

Private Attributes

int hepidwtup_
 
std::vector< ProcessInfointernalProcesses_
 

Detailed Description

Definition at line 10 of file GenLumiInfoProduct.h.

Constructor & Destructor Documentation

GenLumiInfoProduct::GenLumiInfoProduct ( )

Definition at line 87 of file GenLumiInfoProduct.cc.

References internalProcesses_.

87  :
88  hepidwtup_(-1)
89 {
90  internalProcesses_.clear();
91 
92 }
std::vector< ProcessInfo > internalProcesses_
GenLumiInfoProduct::GenLumiInfoProduct ( const int  id)

Definition at line 94 of file GenLumiInfoProduct.cc.

References internalProcesses_.

94  :
95  hepidwtup_(id)
96 {
97  internalProcesses_.clear();
98 }
std::vector< ProcessInfo > internalProcesses_
GenLumiInfoProduct::GenLumiInfoProduct ( const GenLumiInfoProduct other)

Definition at line 100 of file GenLumiInfoProduct.cc.

100  :
101  hepidwtup_(other.hepidwtup_),
103 {
104 }
std::vector< ProcessInfo > internalProcesses_
GenLumiInfoProduct::~GenLumiInfoProduct ( )
virtual

Definition at line 106 of file GenLumiInfoProduct.cc.

107 {
108 }

Member Function Documentation

const int GenLumiInfoProduct::getHEPIDWTUP ( ) const
inline

Definition at line 24 of file GenLumiInfoProduct.h.

References hepidwtup_.

Referenced by GenXSecAnalyzer::endLuminosityBlock(), operator!=(), and operator==().

const std::vector<ProcessInfo>& GenLumiInfoProduct::getProcessInfos ( ) const
inline
bool GenLumiInfoProduct::isProductEqual ( const GenLumiInfoProduct other) const
virtual

Definition at line 144 of file GenLumiInfoProduct.cc.

145 {
146  return ((*this) == other);
147 }
bool GenLumiInfoProduct::mergeProduct ( const GenLumiInfoProduct other)
virtual

Definition at line 110 of file GenLumiInfoProduct.cc.

References GenLumiInfoProduct::ProcessInfo::addOthers(), getProcessInfos(), mps_fire::i, triggerObjects_cff::id, internalProcesses_, GenLumiInfoProduct::ProcessInfo::lheXSec(), edmIntegrityCheck::processes, GenLumiInfoProduct::XSec::value(), and x.

Referenced by GenXSecAnalyzer::endLuminosityBlock().

111 {
112  std::map<int, ProcessInfo> processes;
113 
114  for(unsigned int i = 0; i < getProcessInfos().size(); i++) {
115  int id = getProcessInfos()[i].process();
116  ProcessInfo &x = processes[id];
117  x=getProcessInfos()[i];
118  }
119 
120  // the two GenLuminInfoProducts may not have the same number
121  // of processes
122  for(unsigned int i = 0; i < other.getProcessInfos().size(); i++) {
123  int id = other.getProcessInfos()[i].process();
124  ProcessInfo &x = processes[id];
125  if(x.lheXSec().value()>0)
126  x.addOthers(other.getProcessInfos()[i]);
127  else
128  x = other.getProcessInfos()[i];
129  }
130 
131  internalProcesses_.resize(processes.size());
132  unsigned int i = 0;
133  for(std::map<int, ProcessInfo>::const_iterator iter = processes.begin();
134  iter != processes.end(); ++iter, i++)
135  internalProcesses_[i]=iter->second;
136  return true;
137 }
const std::vector< ProcessInfo > & getProcessInfos() const
std::vector< ProcessInfo > internalProcesses_
void GenLumiInfoProduct::setHEPIDWTUP ( const int  id)
inline
void GenLumiInfoProduct::setProcessInfo ( const std::vector< ProcessInfo > &  processes)
inline

Definition at line 30 of file GenLumiInfoProduct.h.

References internalProcesses_, and edmIntegrityCheck::processes.

Referenced by GenXSecAnalyzer::endRun().

void GenLumiInfoProduct::swap ( GenLumiInfoProduct other)

Definition at line 139 of file GenLumiInfoProduct.cc.

References hepidwtup_, internalProcesses_, and std::swap().

139  {
142 }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< ProcessInfo > internalProcesses_

Member Data Documentation

int GenLumiInfoProduct::hepidwtup_
private

Definition at line 155 of file GenLumiInfoProduct.h.

Referenced by getHEPIDWTUP(), setHEPIDWTUP(), and swap().

std::vector<ProcessInfo> GenLumiInfoProduct::internalProcesses_
private