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 GenLumiInfoProduct &other)
 
 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/3]

GenLumiInfoProduct::GenLumiInfoProduct ( )

Definition at line 70 of file GenLumiInfoProduct.cc.

70 : hepidwtup_(-1) { internalProcesses_.clear(); }

References internalProcesses_.

◆ GenLumiInfoProduct() [2/3]

GenLumiInfoProduct::GenLumiInfoProduct ( const int  id)

Definition at line 72 of file GenLumiInfoProduct.cc.

72 : hepidwtup_(id) { internalProcesses_.clear(); }

References internalProcesses_.

◆ GenLumiInfoProduct() [3/3]

GenLumiInfoProduct::GenLumiInfoProduct ( const GenLumiInfoProduct other)

Definition at line 74 of file GenLumiInfoProduct.cc.

75  : hepidwtup_(other.hepidwtup_), internalProcesses_(other.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.

25 { return hepidwtup_; }

References hepidwtup_.

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

◆ getProcessInfos()

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

Definition at line 26 of file GenLumiInfoProduct.h.

26 { return internalProcesses_; }

References internalProcesses_.

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

◆ isProductEqual()

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

Definition at line 111 of file GenLumiInfoProduct.cc.

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

References trackingPlots::other.

◆ mergeProduct()

bool GenLumiInfoProduct::mergeProduct ( const GenLumiInfoProduct other)
virtual

Definition at line 79 of file GenLumiInfoProduct.cc.

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 }

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

Referenced by ExternalGeneratorFilter::streamEndLuminosityBlockSummary().

◆ setHEPIDWTUP()

void GenLumiInfoProduct::setHEPIDWTUP ( const int  id)
inline

Definition at line 30 of file GenLumiInfoProduct.h.

30 { hepidwtup_ = id; }

References hepidwtup_, and triggerObjects_cff::id.

◆ setProcessInfo()

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

◆ swap()

void GenLumiInfoProduct::swap ( GenLumiInfoProduct other)

Definition at line 106 of file GenLumiInfoProduct.cc.

106  {
107  std::swap(hepidwtup_, other.hepidwtup_);
108  internalProcesses_.swap(other.internalProcesses_);
109 }

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

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
mps_fire.i
i
Definition: mps_fire.py:428
DDAxes::x
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
GenLumiInfoProduct::getProcessInfos
const std::vector< ProcessInfo > & getProcessInfos() const
Definition: GenLumiInfoProduct.h:26
trackingPlots.other
other
Definition: trackingPlots.py:1464
GenLumiInfoProduct::hepidwtup_
int hepidwtup_
Definition: GenLumiInfoProduct.h:167
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
dqmiodatasetharvest.processes
processes
Definition: dqmiodatasetharvest.py:190
GenLumiInfoProduct::internalProcesses_
std::vector< ProcessInfo > internalProcesses_
Definition: GenLumiInfoProduct.h:168