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 11 of file GenLumiInfoProduct.h.

Constructor & Destructor Documentation

◆ GenLumiInfoProduct() [1/3]

GenLumiInfoProduct::GenLumiInfoProduct ( )

Definition at line 70 of file GenLumiInfoProduct.cc.

References internalProcesses_.

70 : hepidwtup_(-1) { internalProcesses_.clear(); }
std::vector< ProcessInfo > internalProcesses_

◆ GenLumiInfoProduct() [2/3]

GenLumiInfoProduct::GenLumiInfoProduct ( const int  id)

Definition at line 72 of file GenLumiInfoProduct.cc.

References internalProcesses_.

72 : hepidwtup_(id) { internalProcesses_.clear(); }
std::vector< ProcessInfo > internalProcesses_

◆ GenLumiInfoProduct() [3/3]

GenLumiInfoProduct::GenLumiInfoProduct ( const GenLumiInfoProduct other)

Definition at line 74 of file GenLumiInfoProduct.cc.

75  : hepidwtup_(other.hepidwtup_), internalProcesses_(other.internalProcesses_) {}
std::vector< ProcessInfo > internalProcesses_

◆ ~GenLumiInfoProduct()

GenLumiInfoProduct::~GenLumiInfoProduct ( )
virtual

Definition at line 77 of file GenLumiInfoProduct.cc.

77 {}

Member Function Documentation

◆ getHEPIDWTUP()

const int GenLumiInfoProduct::getHEPIDWTUP ( ) const
inline

Definition at line 25 of file GenLumiInfoProduct.h.

References hepidwtup_.

Referenced by operator!=(), and operator==().

25 { return hepidwtup_; }

◆ getProcessInfos()

const std::vector<ProcessInfo>& GenLumiInfoProduct::getProcessInfos ( ) const
inline

Definition at line 26 of file GenLumiInfoProduct.h.

References internalProcesses_.

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

26 { return internalProcesses_; }
std::vector< ProcessInfo > internalProcesses_

◆ isProductEqual()

bool GenLumiInfoProduct::isProductEqual ( const GenLumiInfoProduct other) const
virtual

Definition at line 111 of file GenLumiInfoProduct.cc.

References trackingPlots::other.

111 { return ((*this) == other); }

◆ mergeProduct()

bool GenLumiInfoProduct::mergeProduct ( const GenLumiInfoProduct other)
virtual

Definition at line 79 of file GenLumiInfoProduct.cc.

References getProcessInfos(), mps_fire::i, l1ctLayer2EG_cff::id, internalProcesses_, trackingPlots::other, dqmiodatasetharvest::processes, and x.

Referenced by ExternalGeneratorFilter::streamEndLuminosityBlockSummary().

79  {
80  std::map<int, ProcessInfo> processes;
81 
82  for (unsigned int i = 0; i < getProcessInfos().size(); i++) {
83  int id = getProcessInfos()[i].process();
84  ProcessInfo& x = processes[id];
85  x = getProcessInfos()[i];
86  }
87 
88  // the two GenLuminInfoProducts may not have the same number
89  // of processes
90  for (unsigned int i = 0; i < other.getProcessInfos().size(); i++) {
91  int id = other.getProcessInfos()[i].process();
92  ProcessInfo& x = processes[id];
93  if (x.lheXSec().value() > 0)
94  x.addOthers(other.getProcessInfos()[i]);
95  else
96  x = other.getProcessInfos()[i];
97  }
98 
99  internalProcesses_.resize(processes.size());
100  unsigned int i = 0;
101  for (std::map<int, ProcessInfo>::const_iterator iter = processes.begin(); iter != processes.end(); ++iter, i++)
102  internalProcesses_[i] = iter->second;
103  return true;
104 }
const std::vector< ProcessInfo > & getProcessInfos() const
std::vector< ProcessInfo > internalProcesses_

◆ setHEPIDWTUP()

void GenLumiInfoProduct::setHEPIDWTUP ( const int  id)
inline

◆ setProcessInfo()

void GenLumiInfoProduct::setProcessInfo ( const std::vector< ProcessInfo > &  processes)
inline

◆ swap()

void GenLumiInfoProduct::swap ( GenLumiInfoProduct other)

Definition at line 106 of file GenLumiInfoProduct.cc.

References hepidwtup_, internalProcesses_, trackingPlots::other, and edm::swap().

106  {
107  std::swap(hepidwtup_, other.hepidwtup_);
108  internalProcesses_.swap(other.internalProcesses_);
109 }
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:112
std::vector< ProcessInfo > internalProcesses_

Member Data Documentation

◆ hepidwtup_

int GenLumiInfoProduct::hepidwtup_
private

Definition at line 167 of file GenLumiInfoProduct.h.

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

◆ internalProcesses_

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