CMS 3D CMS Logo

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

#include <LumiInfo.h>

Public Member Functions

float getDeadFraction () const
 
const std::vector< float > & getErrorLumiAllBX () const
 
const std::vector< float > & getInstLumiAllBX () const
 
float getInstLumiBX (int bx) const
 
float getLiveFraction () const
 
float getTotalInstLumi () const
 
float getTotalInstStatError () const
 
float instLuminosityBXSum () const
 
float integLuminosity () const
 
bool isProductEqual (LumiInfo const &next) const
 
 LumiInfo ()
 
 LumiInfo (float deadtimeFraction, const std::vector< float > &instLumiByBX)
 
 LumiInfo (float deadtimeFraction, const std::vector< float > &instLumiByBX, float totalInstLumi)
 
 LumiInfo (float deadtimeFraction, const std::vector< float > &instLumiByBX, float totalInstLumi, const std::vector< float > &instLumiErrByBX, float totalInstLumiErr)
 
float lumiSectionLength () const
 
float recordedLuminosity () const
 
void setDeadFraction (float deadtimeFraction)
 
void setErrorLumiAllBX (std::vector< float > &errLumiByBX)
 
void setInstLumiAllBX (std::vector< float > &instLumiByBX)
 
void setTotalInstLumi (float totalLumi)
 
void setTotalInstStatError (float statError)
 
void setTotalInstToBXSum ()
 
 ~LumiInfo ()
 

Private Attributes

float deadtimeFraction_
 
std::vector< float > instLumiByBX_
 
std::vector< float > instLumiStatErrByBX_
 
float totalInstLuminosity_
 
float totalInstLumiStatErr_
 

Detailed Description

LumiInfo has been created by merging the content of the old LumiSummary and LumiDetails classes to streamline the lumi information. Many old member variables have been removed.

Author
Valerie Halyo David Dagenhart Zhen Xie Paul Lujan
Version
1st Version June 7 2007, merged September 10 2014
October 2017 by Chris Palmer and Sam Higginbotham for PCC projects

Definition at line 28 of file LumiInfo.h.

Constructor & Destructor Documentation

◆ LumiInfo() [1/4]

LumiInfo::LumiInfo ( )
inline

default constructor

Definition at line 33 of file LumiInfo.h.

References instLumiByBX_, instLumiStatErrByBX_, LumiConstants::numBX, totalInstLuminosity_, and totalInstLumiStatErr_.

33  : deadtimeFraction_(0) {
38  }
float totalInstLuminosity_
Definition: LumiInfo.h:168
static const unsigned int numBX
Definition: LumiConstants.h:8
float totalInstLumiStatErr_
Definition: LumiInfo.h:169
float deadtimeFraction_
Definition: LumiInfo.h:167
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:171
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170

◆ LumiInfo() [2/4]

LumiInfo::LumiInfo ( float  deadtimeFraction,
const std::vector< float > &  instLumiByBX 
)
inline

constructor with fill; if total algo is the same as summing

Definition at line 43 of file LumiInfo.h.

References instLumiStatErrByBX_, LumiConstants::numBX, setTotalInstToBXSum(), and totalInstLumiStatErr_.

44  : deadtimeFraction_(deadtimeFraction), instLumiByBX_(instLumiByBX) {
48  }
static const unsigned int numBX
Definition: LumiConstants.h:8
void setTotalInstToBXSum()
Definition: LumiInfo.cc:18
float totalInstLumiStatErr_
Definition: LumiInfo.h:169
float deadtimeFraction_
Definition: LumiInfo.h:167
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:171
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170

◆ LumiInfo() [3/4]

LumiInfo::LumiInfo ( float  deadtimeFraction,
const std::vector< float > &  instLumiByBX,
float  totalInstLumi 
)
inline

constructor with fill; if total algo DIFFERS from summing

Definition at line 53 of file LumiInfo.h.

References instLumiStatErrByBX_, LumiConstants::numBX, and totalInstLumiStatErr_.

54  : deadtimeFraction_(deadtimeFraction), totalInstLuminosity_(totalInstLumi), instLumiByBX_(instLumiByBX) {
57  }
float totalInstLuminosity_
Definition: LumiInfo.h:168
static const unsigned int numBX
Definition: LumiConstants.h:8
float totalInstLumiStatErr_
Definition: LumiInfo.h:169
float deadtimeFraction_
Definition: LumiInfo.h:167
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:171
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170

◆ LumiInfo() [4/4]

LumiInfo::LumiInfo ( float  deadtimeFraction,
const std::vector< float > &  instLumiByBX,
float  totalInstLumi,
const std::vector< float > &  instLumiErrByBX,
float  totalInstLumiErr 
)
inline

constructor with fill; if total algo DIFFERS from summing and adding including stats

Definition at line 62 of file LumiInfo.h.

67  : deadtimeFraction_(deadtimeFraction),
68  totalInstLuminosity_(totalInstLumi),
69  totalInstLumiStatErr_(totalInstLumiErr),
70  instLumiByBX_(instLumiByBX),
71  instLumiStatErrByBX_(instLumiErrByBX) {}
float totalInstLuminosity_
Definition: LumiInfo.h:168
float totalInstLumiStatErr_
Definition: LumiInfo.h:169
float deadtimeFraction_
Definition: LumiInfo.h:167
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:171
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170

◆ ~LumiInfo()

LumiInfo::~LumiInfo ( )
inline

destructor

Definition at line 76 of file LumiInfo.h.

76 {}

Member Function Documentation

◆ getDeadFraction()

float LumiInfo::getDeadFraction ( ) const
inline

Deadtime fraction

Definition at line 105 of file LumiInfo.h.

References deadtimeFraction_.

105 { return deadtimeFraction_; }
float deadtimeFraction_
Definition: LumiInfo.h:167

◆ getErrorLumiAllBX()

const std::vector<float>& LumiInfo::getErrorLumiAllBX ( ) const
inline

Returns statistical error of instantaneous luminosity for all bunches

Definition at line 97 of file LumiInfo.h.

References instLumiStatErrByBX_.

Referenced by CorrPCCProducer::endLuminosityBlock().

97 { return instLumiStatErrByBX_; }
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:171

◆ getInstLumiAllBX()

const std::vector<float>& LumiInfo::getInstLumiAllBX ( ) const
inline

Returns instantaneous luminosity of all bunches

Definition at line 93 of file LumiInfo.h.

References instLumiByBX_.

Referenced by CorrPCCProducer::endLuminosityBlock().

93 { return instLumiByBX_; }
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170

◆ getInstLumiBX()

float LumiInfo::getInstLumiBX ( int  bx) const
inline

Returns instantaneous luminosity of one bunch

Definition at line 101 of file LumiInfo.h.

References nano_mu_digi_cff::bx, and instLumiByBX_.

101 { return instLumiByBX_.at(bx); }
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170

◆ getLiveFraction()

float LumiInfo::getLiveFraction ( ) const
inline

Livetime fraction (1-deadtime frac)

Definition at line 109 of file LumiInfo.h.

References deadtimeFraction_.

109 { return 1 - deadtimeFraction_; }
float deadtimeFraction_
Definition: LumiInfo.h:167

◆ getTotalInstLumi()

float LumiInfo::getTotalInstLumi ( ) const
inline

Returns total instantanious luminosity in hz/uB

Definition at line 85 of file LumiInfo.h.

References totalInstLuminosity_.

Referenced by integLuminosity().

85 { return totalInstLuminosity_; }
float totalInstLuminosity_
Definition: LumiInfo.h:168

◆ getTotalInstStatError()

float LumiInfo::getTotalInstStatError ( ) const
inline

Returns statistical error on total instantanious luminosity in hz/uB

Definition at line 89 of file LumiInfo.h.

References totalInstLumiStatErr_.

89 { return totalInstLumiStatErr_; }
float totalInstLumiStatErr_
Definition: LumiInfo.h:169

◆ instLuminosityBXSum()

float LumiInfo::instLuminosityBXSum ( ) const

Returns the sum of the instantaneous luminosity in Hz/uB, which not always the same as totalInstLuminosity_.

Definition at line 8 of file LumiInfo.cc.

References instLumiByBX_, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

Referenced by setTotalInstToBXSum().

8  {
9  float totLum = 0;
10  for (std::vector<float>::const_iterator it = instLumiByBX_.begin(); it != instLumiByBX_.end(); ++it) {
11  totLum += *it;
12  }
13  return totLum;
14 }
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170

◆ integLuminosity()

float LumiInfo::integLuminosity ( ) const

Integrated (delivered) luminosity (in ub^-1)

Definition at line 16 of file LumiInfo.cc.

References getTotalInstLumi(), and lumiSectionLength().

Referenced by recordedLuminosity().

16 { return getTotalInstLumi() * lumiSectionLength(); }
float lumiSectionLength() const
Definition: LumiInfo.cc:22
float getTotalInstLumi() const
Definition: LumiInfo.h:85

◆ isProductEqual()

bool LumiInfo::isProductEqual ( LumiInfo const &  next) const

This method checks if all the essential values of this LumiInfo are the same as the ones in the LumiInfo given as an argument.

Definition at line 27 of file LumiInfo.cc.

References deadtimeFraction_, instLumiByBX_, and GetRecoTauVFromDQM_MC_cff::next.

27  {
28  return (deadtimeFraction_ == next.deadtimeFraction_ && instLumiByBX_ == next.instLumiByBX_);
29 }
float deadtimeFraction_
Definition: LumiInfo.h:167
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170

◆ lumiSectionLength()

float LumiInfo::lumiSectionLength ( ) const

lumi section length in seconds = numorbits*3564*25e-09

Definition at line 22 of file LumiInfo.cc.

References LumiConstants::bxSpacingExact, LumiConstants::numBX, and LumiConstants::numOrbits.

Referenced by integLuminosity().

22  {
23  // numorbits (262144)*numBX/orbit (3564)*bx spacing (24.95e-09)
25 }
static const unsigned int numOrbits
Definition: LumiConstants.h:7
static const unsigned int numBX
Definition: LumiConstants.h:8
static const float bxSpacingExact
Definition: LumiConstants.h:9

◆ recordedLuminosity()

float LumiInfo::recordedLuminosity ( ) const

Recorded (integrated) luminosity (in ub^-1) (==integLuminosity * (1-deadtimeFraction))

Definition at line 20 of file LumiInfo.cc.

References deadtimeFraction_, and integLuminosity().

20 { return integLuminosity() * (1 - deadtimeFraction_); }
float deadtimeFraction_
Definition: LumiInfo.h:167
float integLuminosity() const
Definition: LumiInfo.cc:16

◆ setDeadFraction()

void LumiInfo::setDeadFraction ( float  deadtimeFraction)
inline

Set the deadtime fraction

Definition at line 118 of file LumiInfo.h.

References deadtimeFraction_.

118 { deadtimeFraction_ = deadtimeFraction; }
float deadtimeFraction_
Definition: LumiInfo.h:167

◆ setErrorLumiAllBX()

void LumiInfo::setErrorLumiAllBX ( std::vector< float > &  errLumiByBX)

Set statistical error of instantaneous luminosity for all bunches

Definition at line 35 of file LumiInfo.cc.

References instLumiStatErrByBX_.

Referenced by RawPCCProducer::globalEndLuminosityBlockProduce().

35  {
36  instLumiStatErrByBX_.assign(errLumiByBX.begin(), errLumiByBX.end());
37 }
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:171

◆ setInstLumiAllBX()

void LumiInfo::setInstLumiAllBX ( std::vector< float > &  instLumiByBX)

Set statistical error of instantaneous luminosity for all bunches

Definition at line 31 of file LumiInfo.cc.

References instLumiByBX_.

Referenced by RawPCCProducer::globalEndLuminosityBlockProduce().

31  {
32  instLumiByBX_.assign(instLumiByBX.begin(), instLumiByBX.end());
33 }
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170

◆ setTotalInstLumi()

void LumiInfo::setTotalInstLumi ( float  totalLumi)
inline

Set total instantanious luminosity in hz/uB

Definition at line 122 of file LumiInfo.h.

References totalInstLuminosity_.

Referenced by RawPCCProducer::globalEndLuminosityBlockProduce(), and setTotalInstToBXSum().

122 { totalInstLuminosity_ = totalLumi; }
float totalInstLuminosity_
Definition: LumiInfo.h:168

◆ setTotalInstStatError()

void LumiInfo::setTotalInstStatError ( float  statError)
inline

Set statistical error on total instantanious luminosity in hz/uB

Definition at line 126 of file LumiInfo.h.

References totalInstLumiStatErr_.

Referenced by RawPCCProducer::globalEndLuminosityBlockProduce().

126 { totalInstLumiStatErr_ = statError; }
float totalInstLumiStatErr_
Definition: LumiInfo.h:169

◆ setTotalInstToBXSum()

void LumiInfo::setTotalInstToBXSum ( )

Resets totalInstLuminosity_ to be the sum of instantaneous luminosity

Definition at line 18 of file LumiInfo.cc.

References instLuminosityBXSum(), and setTotalInstLumi().

Referenced by LumiInfo().

float instLuminosityBXSum() const
Definition: LumiInfo.cc:8
void setTotalInstLumi(float totalLumi)
Definition: LumiInfo.h:122

Member Data Documentation

◆ deadtimeFraction_

float LumiInfo::deadtimeFraction_
private

◆ instLumiByBX_

std::vector<float> LumiInfo::instLumiByBX_
private

◆ instLumiStatErrByBX_

std::vector<float> LumiInfo::instLumiStatErrByBX_
private

Definition at line 171 of file LumiInfo.h.

Referenced by getErrorLumiAllBX(), LumiInfo(), and setErrorLumiAllBX().

◆ totalInstLuminosity_

float LumiInfo::totalInstLuminosity_
private

Definition at line 168 of file LumiInfo.h.

Referenced by getTotalInstLumi(), LumiInfo(), and setTotalInstLumi().

◆ totalInstLumiStatErr_

float LumiInfo::totalInstLumiStatErr_
private

Definition at line 169 of file LumiInfo.h.

Referenced by getTotalInstStatError(), LumiInfo(), and setTotalInstStatError().