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::LumiInfo ( )
inline

default constructor

Definition at line 33 of file LumiInfo.h.

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

33  :
35  {
40  }
float totalInstLuminosity_
Definition: LumiInfo.h:178
static const unsigned int numBX
Definition: LumiConstants.h:9
float totalInstLumiStatErr_
Definition: LumiInfo.h:179
float deadtimeFraction_
Definition: LumiInfo.h:177
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:181
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:180
LumiInfo::LumiInfo ( float  deadtimeFraction,
const std::vector< float > &  instLumiByBX 
)
inline

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

Definition at line 46 of file LumiInfo.h.

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

46  :
47  deadtimeFraction_(deadtimeFraction),
48  instLumiByBX_(instLumiByBX)
49  {
53  }
static const unsigned int numBX
Definition: LumiConstants.h:9
void setTotalInstToBXSum()
Definition: LumiInfo.cc:21
float totalInstLumiStatErr_
Definition: LumiInfo.h:179
float deadtimeFraction_
Definition: LumiInfo.h:177
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:181
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:180
LumiInfo::LumiInfo ( float  deadtimeFraction,
const std::vector< float > &  instLumiByBX,
float  totalInstLumi 
)
inline

constructor with fill; if total algo DIFFERS from summing

Definition at line 58 of file LumiInfo.h.

References instLumiStatErrByBX_, LumiConstants::numBX, and totalInstLumiStatErr_.

58  :
59  deadtimeFraction_(deadtimeFraction),
60  totalInstLuminosity_(totalInstLumi),
61  instLumiByBX_(instLumiByBX)
62  {
65  }
float totalInstLuminosity_
Definition: LumiInfo.h:178
static const unsigned int numBX
Definition: LumiConstants.h:9
float totalInstLumiStatErr_
Definition: LumiInfo.h:179
float deadtimeFraction_
Definition: LumiInfo.h:177
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:181
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:180
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 70 of file LumiInfo.h.

71  :
72  deadtimeFraction_(deadtimeFraction),
73  totalInstLuminosity_(totalInstLumi),
74  totalInstLumiStatErr_(totalInstLumiErr),
75  instLumiByBX_(instLumiByBX),
76  instLumiStatErrByBX_(instLumiErrByBX)
77  {
78  }
float totalInstLuminosity_
Definition: LumiInfo.h:178
float totalInstLumiStatErr_
Definition: LumiInfo.h:179
float deadtimeFraction_
Definition: LumiInfo.h:177
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:181
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:180
LumiInfo::~LumiInfo ( )
inline

destructor

Definition at line 83 of file LumiInfo.h.

83 {}

Member Function Documentation

float LumiInfo::getDeadFraction ( ) const
inline

Deadtime fraction

Definition at line 112 of file LumiInfo.h.

References deadtimeFraction_.

Referenced by operator<<().

112 { return deadtimeFraction_; }
float deadtimeFraction_
Definition: LumiInfo.h:177
const std::vector<float>& LumiInfo::getErrorLumiAllBX ( ) const
inline

Returns statistical error of instantaneous luminosity for all bunches

Definition at line 104 of file LumiInfo.h.

References instLumiStatErrByBX_.

104 { return instLumiStatErrByBX_; }
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:181
const std::vector<float>& LumiInfo::getInstLumiAllBX ( ) const
inline

Returns instantaneous luminosity of all bunches

Definition at line 100 of file LumiInfo.h.

References instLumiByBX_.

Referenced by operator<<().

100 { return instLumiByBX_; }
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:180
float LumiInfo::getInstLumiBX ( int  bx) const
inline

Returns instantaneous luminosity of one bunch

Definition at line 108 of file LumiInfo.h.

References instLumiByBX_.

108 { return instLumiByBX_.at(bx); }
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:180
float LumiInfo::getLiveFraction ( ) const
inline

Livetime fraction (1-deadtime frac)

Definition at line 116 of file LumiInfo.h.

References deadtimeFraction_.

116 { return 1-deadtimeFraction_; }
float deadtimeFraction_
Definition: LumiInfo.h:177
float LumiInfo::getTotalInstLumi ( ) const
inline

Returns total instantanious luminosity in hz/uB

Definition at line 92 of file LumiInfo.h.

References totalInstLuminosity_.

Referenced by integLuminosity(), and operator<<().

92 {return totalInstLuminosity_;}
float totalInstLuminosity_
Definition: LumiInfo.h:178
float LumiInfo::getTotalInstStatError ( ) const
inline

Returns statistical error on total instantanious luminosity in hz/uB

Definition at line 96 of file LumiInfo.h.

References totalInstLumiStatErr_.

96 {return totalInstLumiStatErr_;}
float totalInstLumiStatErr_
Definition: LumiInfo.h:179
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_.

Referenced by setTotalInstStatError(), and setTotalInstToBXSum().

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

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

Definition at line 17 of file LumiInfo.cc.

References getTotalInstLumi(), and lumiSectionLength().

Referenced by operator<<(), recordedLuminosity(), and setTotalInstStatError().

17  {
19 }
float getTotalInstLumi() const
Definition: LumiInfo.h:92
float lumiSectionLength() const
Definition: LumiInfo.cc:29
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 34 of file LumiInfo.cc.

References deadtimeFraction_, and instLumiByBX_.

Referenced by setTotalInstStatError().

34  {
35  return (deadtimeFraction_ == next.deadtimeFraction_ &&
36  instLumiByBX_ == next.instLumiByBX_);
37 }
float deadtimeFraction_
Definition: LumiInfo.h:177
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:180
float LumiInfo::lumiSectionLength ( ) const

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

Definition at line 29 of file LumiInfo.cc.

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

Referenced by integLuminosity(), and setTotalInstStatError().

29  {
30  // numorbits (262144)*numBX/orbit (3564)*bx spacing (24.95e-09)
32 }
static const unsigned int numOrbits
Definition: LumiConstants.h:8
static const unsigned int numBX
Definition: LumiConstants.h:9
static const float bxSpacingExact
Definition: LumiConstants.h:10
float LumiInfo::recordedLuminosity ( ) const

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

Definition at line 25 of file LumiInfo.cc.

References deadtimeFraction_, and integLuminosity().

Referenced by operator<<(), and setTotalInstStatError().

25  {
27 }
float integLuminosity() const
Definition: LumiInfo.cc:17
float deadtimeFraction_
Definition: LumiInfo.h:177
void LumiInfo::setDeadFraction ( float  deadtimeFraction)
inline

Set the deadtime fraction

Definition at line 126 of file LumiInfo.h.

References deadtimeFraction_.

126 { deadtimeFraction_ = deadtimeFraction; }
float deadtimeFraction_
Definition: LumiInfo.h:177
void LumiInfo::setErrorLumiAllBX ( std::vector< float > &  errLumiByBX)

Set statistical error of instantaneous luminosity for all bunches

Definition at line 43 of file LumiInfo.cc.

References instLumiStatErrByBX_.

Referenced by setTotalInstStatError().

43  {
44  instLumiStatErrByBX_.assign(errLumiByBX.begin(),errLumiByBX.end());
45 }
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:181
void LumiInfo::setInstLumiAllBX ( std::vector< float > &  instLumiByBX)

Set statistical error of instantaneous luminosity for all bunches

Definition at line 39 of file LumiInfo.cc.

References instLumiByBX_.

Referenced by setTotalInstStatError().

39  {
40  instLumiByBX_.assign(instLumiByBX.begin(), instLumiByBX.end());
41 }
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:180
void LumiInfo::setTotalInstLumi ( float  totalLumi)
inline

Set total instantanious luminosity in hz/uB

Definition at line 130 of file LumiInfo.h.

References totalInstLuminosity_.

Referenced by setTotalInstToBXSum().

130 { totalInstLuminosity_=totalLumi;}
float totalInstLuminosity_
Definition: LumiInfo.h:178
void LumiInfo::setTotalInstStatError ( float  statError)
inline

Set statistical error on total instantanious luminosity in hz/uB

Definition at line 134 of file LumiInfo.h.

References instLuminosityBXSum(), integLuminosity(), isProductEqual(), lumiSectionLength(), GetRecoTauVFromDQM_MC_cff::next, recordedLuminosity(), setErrorLumiAllBX(), setInstLumiAllBX(), setTotalInstToBXSum(), and totalInstLumiStatErr_.

134 { totalInstLumiStatErr_=statError;}
float totalInstLumiStatErr_
Definition: LumiInfo.h:179
void LumiInfo::setTotalInstToBXSum ( )

Resets totalInstLuminosity_ to be the sum of instantaneous luminosity

Definition at line 21 of file LumiInfo.cc.

References instLuminosityBXSum(), and setTotalInstLumi().

Referenced by LumiInfo(), and setTotalInstStatError().

21  {
23 }
void setTotalInstLumi(float totalLumi)
Definition: LumiInfo.h:130
float instLuminosityBXSum() const
Definition: LumiInfo.cc:8

Member Data Documentation

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

Definition at line 181 of file LumiInfo.h.

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

float LumiInfo::totalInstLuminosity_
private

Definition at line 178 of file LumiInfo.h.

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

float LumiInfo::totalInstLumiStatErr_
private

Definition at line 179 of file LumiInfo.h.

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