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)
 
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/2]

GenLumiInfoProduct::GenLumiInfoProduct ( )

Definition at line 70 of file GenLumiInfoProduct.cc.

References internalProcesses_.

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

◆ GenLumiInfoProduct() [2/2]

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

GenLumiInfoProduct::~GenLumiInfoProduct ( )
virtual

Definition at line 74 of file GenLumiInfoProduct.cc.

74 {}

Member Function Documentation

◆ getHEPIDWTUP()

const int GenLumiInfoProduct::getHEPIDWTUP ( ) const
inline

Definition at line 24 of file GenLumiInfoProduct.h.

References hepidwtup_.

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

24 { return hepidwtup_; }

◆ getProcessInfos()

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

Definition at line 25 of file GenLumiInfoProduct.h.

References internalProcesses_.

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

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

◆ isProductEqual()

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

Definition at line 108 of file GenLumiInfoProduct.cc.

References trackingPlots::other.

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

◆ mergeProduct()

bool GenLumiInfoProduct::mergeProduct ( const GenLumiInfoProduct other)
virtual

Definition at line 76 of file GenLumiInfoProduct.cc.

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

Referenced by ExternalGeneratorFilter::streamEndLuminosityBlockSummary().

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

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

103  {
104  std::swap(hepidwtup_, other.hepidwtup_);
105  internalProcesses_.swap(other.internalProcesses_);
106 }
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 164 of file GenLumiInfoProduct.h.

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

◆ internalProcesses_

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