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_.

◆ 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.

44  : deadtimeFraction_(deadtimeFraction), instLumiByBX_(instLumiByBX) {
48  }

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

◆ 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.

54  : deadtimeFraction_(deadtimeFraction), totalInstLuminosity_(totalInstLumi), instLumiByBX_(instLumiByBX) {
57  }

References instLumiStatErrByBX_, LumiConstants::numBX, and totalInstLumiStatErr_.

◆ 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) {}

◆ ~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.

105 { return deadtimeFraction_; }

References deadtimeFraction_.

◆ 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.

97 { return instLumiStatErrByBX_; }

References instLumiStatErrByBX_.

Referenced by CorrPCCProducer::endLuminosityBlock().

◆ getInstLumiAllBX()

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

Returns instantaneous luminosity of all bunches

Definition at line 93 of file LumiInfo.h.

93 { return instLumiByBX_; }

References instLumiByBX_.

Referenced by CorrPCCProducer::endLuminosityBlock().

◆ getInstLumiBX()

float LumiInfo::getInstLumiBX ( int  bx) const
inline

Returns instantaneous luminosity of one bunch

Definition at line 101 of file LumiInfo.h.

101 { return instLumiByBX_.at(bx); }

References l1GtPatternGenerator_cfi::bx, and instLumiByBX_.

◆ getLiveFraction()

float LumiInfo::getLiveFraction ( ) const
inline

Livetime fraction (1-deadtime frac)

Definition at line 109 of file LumiInfo.h.

109 { return 1 - deadtimeFraction_; }

References deadtimeFraction_.

◆ getTotalInstLumi()

float LumiInfo::getTotalInstLumi ( ) const
inline

Returns total instantanious luminosity in hz/uB

Definition at line 85 of file LumiInfo.h.

85 { return totalInstLuminosity_; }

References totalInstLuminosity_.

Referenced by integLuminosity().

◆ getTotalInstStatError()

float LumiInfo::getTotalInstStatError ( ) const
inline

Returns statistical error on total instantanious luminosity in hz/uB

Definition at line 89 of file LumiInfo.h.

89 { return totalInstLumiStatErr_; }

References totalInstLumiStatErr_.

◆ 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.

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 }

References instLumiByBX_.

Referenced by setTotalInstToBXSum().

◆ integLuminosity()

float LumiInfo::integLuminosity ( ) const

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

Definition at line 16 of file LumiInfo.cc.

16 { return getTotalInstLumi() * lumiSectionLength(); }

References getTotalInstLumi(), and lumiSectionLength().

Referenced by recordedLuminosity().

◆ 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.

27  {
28  return (deadtimeFraction_ == next.deadtimeFraction_ && instLumiByBX_ == next.instLumiByBX_);
29 }

References deadtimeFraction_, instLumiByBX_, and GetRecoTauVFromDQM_MC_cff::next.

◆ lumiSectionLength()

float LumiInfo::lumiSectionLength ( ) const

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

Definition at line 22 of file LumiInfo.cc.

22  {
23  // numorbits (262144)*numBX/orbit (3564)*bx spacing (24.95e-09)
25 }

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

Referenced by integLuminosity().

◆ recordedLuminosity()

float LumiInfo::recordedLuminosity ( ) const

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

Definition at line 20 of file LumiInfo.cc.

20 { return integLuminosity() * (1 - deadtimeFraction_); }

References deadtimeFraction_, and integLuminosity().

◆ setDeadFraction()

void LumiInfo::setDeadFraction ( float  deadtimeFraction)
inline

Set the deadtime fraction

Definition at line 118 of file LumiInfo.h.

118 { deadtimeFraction_ = deadtimeFraction; }

References deadtimeFraction_.

◆ 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.

35  {
36  instLumiStatErrByBX_.assign(errLumiByBX.begin(), errLumiByBX.end());
37 }

References instLumiStatErrByBX_.

Referenced by RawPCCProducer::globalEndLuminosityBlockProduce().

◆ 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.

31  {
32  instLumiByBX_.assign(instLumiByBX.begin(), instLumiByBX.end());
33 }

References instLumiByBX_.

Referenced by RawPCCProducer::globalEndLuminosityBlockProduce().

◆ setTotalInstLumi()

void LumiInfo::setTotalInstLumi ( float  totalLumi)
inline

Set total instantanious luminosity in hz/uB

Definition at line 122 of file LumiInfo.h.

122 { totalInstLuminosity_ = totalLumi; }

References totalInstLuminosity_.

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

◆ 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.

126 { totalInstLumiStatErr_ = statError; }

References totalInstLumiStatErr_.

Referenced by RawPCCProducer::globalEndLuminosityBlockProduce().

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

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

LumiConstants::numBX
static const unsigned int numBX
Definition: LumiConstants.h:8
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
LumiInfo::deadtimeFraction_
float deadtimeFraction_
Definition: LumiInfo.h:167
LumiInfo::setTotalInstLumi
void setTotalInstLumi(float totalLumi)
Definition: LumiInfo.h:122
LumiConstants::numOrbits
static const unsigned int numOrbits
Definition: LumiConstants.h:7
LumiInfo::totalInstLuminosity_
float totalInstLuminosity_
Definition: LumiInfo.h:168
LumiConstants::bxSpacingExact
static const float bxSpacingExact
Definition: LumiConstants.h:9
LumiInfo::getTotalInstLumi
float getTotalInstLumi() const
Definition: LumiInfo.h:85
LumiInfo::integLuminosity
float integLuminosity() const
Definition: LumiInfo.cc:16
LumiInfo::lumiSectionLength
float lumiSectionLength() const
Definition: LumiInfo.cc:22
LumiInfo::totalInstLumiStatErr_
float totalInstLumiStatErr_
Definition: LumiInfo.h:169
LumiInfo::setTotalInstToBXSum
void setTotalInstToBXSum()
Definition: LumiInfo.cc:18
LumiInfo::instLumiByBX_
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170
LumiInfo::instLumiStatErrByBX_
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:171
LumiInfo::instLuminosityBXSum
float instLuminosityBXSum() const
Definition: LumiInfo.cc:8
GetRecoTauVFromDQM_MC_cff.next
next
Definition: GetRecoTauVFromDQM_MC_cff.py:31