CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes
LumiSummary Class Reference

#include <LumiSummary.h>

Classes

class  HLT
 
class  L1
 

Public Member Functions

float avgInsDelLumi () const
 
float avgInsDelLumiErr () const
 
float avgInsRecLumi () const
 
float avgInsRecLumiErr () const
 
unsigned long long bitzerocount () const
 
void copyHLTData (const std::vector< HLT > &hltdata)
 
void copyL1Data (const std::vector< L1 > &l1data)
 
unsigned long long deadcount () const
 
float deadFrac () const
 
HLT hltinfo (unsigned int idx) const
 
float intgDelLumi () const
 
float intgRecLumi () const
 
bool isProductEqual (LumiSummary const &next) const
 
bool isValid () const
 
L1 l1info (unsigned int idx) const
 
float liveFrac () const
 
unsigned int lsNumber () const
 
short lumiSecQual () const
 
float lumiSectionLength () const
 
 LumiSummary ()
 default constructor More...
 
 LumiSummary (float avginsdellumi, float avginsdellumierr, short lumisecqual, unsigned long long deadcount, unsigned long long bitzerocount, unsigned int lsnumber, const std::vector< L1 > &l1in, const std::vector< HLT > &hltin, unsigned int startorbit, unsigned int numorbit, const std::string &lumiversion)
 set default constructor More...
 
std::string lumiVersion () const
 
size_t nHLTPath () const
 
size_t nTriggerLine () const
 
unsigned int numOrbit () const
 
void setBitZeroCount (unsigned long long bitzerocount)
 
void setDeadCount (unsigned long long deadcount)
 
void setlsnumber (unsigned int lsnumber)
 
void setLumiData (float instlumi, float instlumierr, short lumiquality)
 
void setLumiVersion (const std::string &lumiversion)
 
void setOrbitData (unsigned int startorbit, unsigned int numorbit)
 
unsigned int startOrbit () const
 
void swapHLTData (std::vector< HLT > &hltdata)
 
void swapL1Data (std::vector< L1 > &l1data)
 
 ~LumiSummary ()
 destructor More...
 

Private Attributes

float avginsdellumi_
 
float avginsdellumierr_
 
unsigned long long bitzerocount_
 
unsigned long long deadcount_
 
std::vector< HLThltdata_
 
std::vector< L1l1data_
 
unsigned int lsnumber_
 
short lumisecqual_
 
std::string lumiversion_
 
unsigned int numorbit_
 
unsigned int startorbit_
 

Detailed Description

LumiSummary holds Summary information averaged over all bunch crossings for the given luminosity section LS

Author
Valerie Halyo David Dagenhart Zhen Xie
Version
1st Version June 7 2007
Id:
LumiSummary.h,v 1.20 2012/02/28 15:06:03 xiezhen Exp

Definition at line 21 of file LumiSummary.h.

Constructor & Destructor Documentation

LumiSummary::LumiSummary ( )
inline

default constructor

Definition at line 38 of file LumiSummary.h.

References hltdata_, and l1data_.

38  :
39  lumiversion_("-1"),
40  avginsdellumi_(0.0),
41  avginsdellumierr_(0.0),
42  lumisecqual_(0),
43  deadcount_(0),
44  bitzerocount_(),
45  lsnumber_(0),
46  startorbit_(0),
47  numorbit_(0)
48  {
49  hltdata_.reserve(100);
50  l1data_.reserve(192);
51  }
unsigned long long bitzerocount_
Definition: LumiSummary.h:165
unsigned int startorbit_
Definition: LumiSummary.h:172
unsigned int lsnumber_
Definition: LumiSummary.h:166
std::vector< L1 > l1data_
Definition: LumiSummary.h:170
float avginsdellumierr_
Definition: LumiSummary.h:161
std::string lumiversion_
Definition: LumiSummary.h:157
short lumisecqual_
Definition: LumiSummary.h:163
unsigned int numorbit_
Definition: LumiSummary.h:174
unsigned long long deadcount_
Definition: LumiSummary.h:164
float avginsdellumi_
Definition: LumiSummary.h:159
std::vector< HLT > hltdata_
Definition: LumiSummary.h:168
LumiSummary::LumiSummary ( float  avginsdellumi,
float  avginsdellumierr,
short  lumisecqual,
unsigned long long  deadcount,
unsigned long long  bitzerocount,
unsigned int  lsnumber,
const std::vector< L1 > &  l1in,
const std::vector< HLT > &  hltin,
unsigned int  startorbit,
unsigned int  numorbit,
const std::string &  lumiversion 
)
inline

set default constructor

Definition at line 54 of file LumiSummary.h.

64  :
65  lumiversion_(lumiversion),
66  avginsdellumi_(avginsdellumi),
67  avginsdellumierr_(avginsdellumierr),
68  lumisecqual_(lumisecqual),
70  hltdata_(hltin), l1data_(l1in),
71  startorbit_(startorbit),numorbit_(numorbit)
72  { }
unsigned long long bitzerocount_
Definition: LumiSummary.h:165
unsigned int startorbit_
Definition: LumiSummary.h:172
unsigned long long deadcount() const
Definition: LumiSummary.cc:34
unsigned int lsnumber_
Definition: LumiSummary.h:166
std::vector< L1 > l1data_
Definition: LumiSummary.h:170
float avginsdellumierr_
Definition: LumiSummary.h:161
std::string lumiversion_
Definition: LumiSummary.h:157
short lumisecqual_
Definition: LumiSummary.h:163
unsigned int numorbit_
Definition: LumiSummary.h:174
unsigned long long deadcount_
Definition: LumiSummary.h:164
float avginsdellumi_
Definition: LumiSummary.h:159
std::vector< HLT > hltdata_
Definition: LumiSummary.h:168
unsigned long long bitzerocount() const
Definition: LumiSummary.cc:38
LumiSummary::~LumiSummary ( )
inline

destructor

Definition at line 75 of file LumiSummary.h.

75 {}

Member Function Documentation

float LumiSummary::avgInsDelLumi ( ) const

average inst lumi,delivered, unit Hz/ub, uncalibrated for lumiversion v2

Definition at line 10 of file LumiSummary.cc.

References avginsdellumi_, and lumiversion_.

Referenced by avgInsRecLumi(), intgDelLumi(), and operator<<().

10  {
11  size_t iIndex=lumiversion_.rfind("v");
12  if(iIndex != std::string::npos){//i.e. not "-1" and not "DIP", "-1" and "DIP" lumi are already corrected and unit conversion included in the raw data.
13  return avginsdellumi_*1000.0;
14  }
15  return avginsdellumi_;
16 }
std::string lumiversion_
Definition: LumiSummary.h:157
float avginsdellumi_
Definition: LumiSummary.h:159
float LumiSummary::avgInsDelLumiErr ( ) const

average inst lumi error, empty for lumiversion v2

Definition at line 22 of file LumiSummary.cc.

References avginsdellumierr_.

Referenced by operator<<().

22  {
23  return avginsdellumierr_;
24 }
float avginsdellumierr_
Definition: LumiSummary.h:161
float LumiSummary::avgInsRecLumi ( ) const

avg inst lumi corrected by deadtime

Definition at line 99 of file LumiSummary.cc.

References avgInsDelLumi(), and liveFrac().

Referenced by intgRecLumi(), main(), and operator<<().

99  {
100  return this->avgInsDelLumi() * liveFrac();
101 }
float avgInsDelLumi() const
Definition: LumiSummary.cc:10
float liveFrac() const
Definition: LumiSummary.cc:54
float LumiSummary::avgInsRecLumiErr ( ) const

avg inst lumi error corrected by deadtime

Definition at line 103 of file LumiSummary.cc.

References avginsdellumierr_, and liveFrac().

Referenced by operator<<().

103  {
104  return avginsdellumierr_ * liveFrac();
105 }
float avginsdellumierr_
Definition: LumiSummary.h:161
float liveFrac() const
Definition: LumiSummary.cc:54
unsigned long long LumiSummary::bitzerocount ( ) const

trigger normalization bit count*prescale

Definition at line 38 of file LumiSummary.cc.

References bitzerocount_.

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

38  {
39  return bitzerocount_;
40 }
unsigned long long bitzerocount_
Definition: LumiSummary.h:165
void LumiSummary::copyHLTData ( const std::vector< HLT > &  hltdata)

Definition at line 163 of file LumiSummary.cc.

References hltdata_.

163  {
164  hltdata_.assign(hltdata.begin(),hltdata.end());
165 }
tuple hltdata
Definition: dataDML.py:2362
std::vector< HLT > hltdata_
Definition: LumiSummary.h:168
void LumiSummary::copyL1Data ( const std::vector< L1 > &  l1data)

Definition at line 159 of file LumiSummary.cc.

References l1data_.

159  {
160  l1data_.assign(l1data.begin(),l1data.end());
161 }
std::vector< L1 > l1data_
Definition: LumiSummary.h:170
unsigned long long LumiSummary::deadcount ( ) const

trigger DeadtimeBeamActive count

Definition at line 34 of file LumiSummary.cc.

References deadcount_.

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

34  {
35  return deadcount_;
36 }
unsigned long long deadcount_
Definition: LumiSummary.h:164
float LumiSummary::deadFrac ( ) const
the fraction trigger is not active=

trigger DeadtimeBeamActive/BitZero special values: if trigger data absent for this LS, return deadfraction 1.0 if bitzero=0 return -1.0 meaning no beam

Definition at line 42 of file LumiSummary.cc.

References bitzerocount_, deadcount_, l1data_, and lumiversion_.

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

42  {
43  //definition: deadcount/bitzerocount
44  //if no trigger data, return deadfraction 1.0,mask out this LS
45  //if bitzerocount=0, return -1.0 meaning no beam
46  if(lumiversion_=="DIP"){
47  return float(deadcount_)/float(bitzerocount_);
48  }
49  if (l1data_.size()==0) return 1.0;
50  if (bitzerocount_==0) return -1.0;
51  return float(deadcount_)/float(bitzerocount_);
52 }
unsigned long long bitzerocount_
Definition: LumiSummary.h:165
std::vector< L1 > l1data_
Definition: LumiSummary.h:170
std::string lumiversion_
Definition: LumiSummary.h:157
unsigned long long deadcount_
Definition: LumiSummary.h:164
LumiSummary::HLT LumiSummary::hltinfo ( unsigned int  idx) const

Definition at line 87 of file LumiSummary.cc.

References hltdata_.

Referenced by operator<<().

87  {
88  return hltdata_.at(idx);
89 }
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< HLT > hltdata_
Definition: LumiSummary.h:168
float LumiSummary::intgDelLumi ( ) const

delivered luminosity integrated over LS , unit /ub, uncalibrated for lumiversion v2

Definition at line 18 of file LumiSummary.cc.

References avgInsDelLumi(), and lumiSectionLength().

Referenced by operator<<().

18  {
19  return this->avgInsDelLumi()*float(this->lumiSectionLength());
20 }
float lumiSectionLength() const
Definition: LumiSummary.cc:62
float avgInsDelLumi() const
Definition: LumiSummary.cc:10
float LumiSummary::intgRecLumi ( ) const

recorded luminosity integrated over LS

Definition at line 26 of file LumiSummary.cc.

References avgInsRecLumi(), and lumiSectionLength().

26  {
27  return this->avgInsRecLumi()*float(this->lumiSectionLength());
28 }
float lumiSectionLength() const
Definition: LumiSummary.cc:62
float avgInsRecLumi() const
Definition: LumiSummary.cc:99
bool LumiSummary::isProductEqual ( LumiSummary const &  next) const

Definition at line 107 of file LumiSummary.cc.

References avginsdellumi_, avginsdellumierr_, deadcount_, hltdata_, l1data_, lsnumber_, lumisecqual_, lumiversion_, numorbit_, and startorbit_.

107  {
108  return (avginsdellumi_ == next.avginsdellumi_ &&
109  avginsdellumierr_ == next.avginsdellumierr_ &&
110  lumisecqual_ == next.lumisecqual_ &&
111  deadcount_ == next.deadcount_ &&
112  lsnumber_ == next.lsnumber_ &&
113  startorbit_== next.startorbit_ &&
114  numorbit_==next.numorbit_&&
115  l1data_.size() == next.l1data_.size() &&
116  hltdata_.size() == next.hltdata_.size() &&
117  lumiversion_ == next.lumiversion_ );
118 }
unsigned int startorbit_
Definition: LumiSummary.h:172
unsigned int lsnumber_
Definition: LumiSummary.h:166
std::vector< L1 > l1data_
Definition: LumiSummary.h:170
float avginsdellumierr_
Definition: LumiSummary.h:161
std::string lumiversion_
Definition: LumiSummary.h:157
short lumisecqual_
Definition: LumiSummary.h:163
unsigned int numorbit_
Definition: LumiSummary.h:174
unsigned long long deadcount_
Definition: LumiSummary.h:164
float avginsdellumi_
Definition: LumiSummary.h:159
std::vector< HLT > hltdata_
Definition: LumiSummary.h:168
bool LumiSummary::isValid ( void  ) const

data are valid only if run exists from all sources lumi,trg ,hlt

Definition at line 79 of file LumiSummary.cc.

References avginsdellumi_.

Referenced by operator<<().

79  {
80  return avginsdellumi_>0;
81 }
float avginsdellumi_
Definition: LumiSummary.h:159
LumiSummary::L1 LumiSummary::l1info ( unsigned int  idx) const

Definition at line 83 of file LumiSummary.cc.

References l1data_.

Referenced by operator<<().

83  {
84  return l1data_.at(idx);
85 }
std::vector< L1 > l1data_
Definition: LumiSummary.h:170
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
float LumiSummary::liveFrac ( ) const

the fraction trigger is active= 1-deadfraction special values: if deadfraction<0(no beam) livefraction=0

Definition at line 54 of file LumiSummary.cc.

References deadFrac().

Referenced by avgInsRecLumi(), avgInsRecLumiErr(), and operator<<().

54  {
55  //1-deadfraction
56  //else if deadfraction<0 meaning no beam, live fraction=0
57  //
58  if (deadFrac()<0) return 0;
59  return 1-deadFrac();
60 }
float deadFrac() const
Definition: LumiSummary.cc:42
unsigned int LumiSummary::lsNumber ( ) const

Definition at line 67 of file LumiSummary.cc.

References lsnumber_.

Referenced by operator<<().

67  {
68  return lsnumber_;
69 }
unsigned int lsnumber_
Definition: LumiSummary.h:166
short LumiSummary::lumiSecQual ( ) const

Definition at line 30 of file LumiSummary.cc.

References lumisecqual_.

Referenced by operator<<().

30  {
31  return lumisecqual_;
32 }
short lumisecqual_
Definition: LumiSummary.h:163
float LumiSummary::lumiSectionLength ( ) const

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

Definition at line 62 of file LumiSummary.cc.

References numorbit_.

Referenced by intgDelLumi(), and intgRecLumi().

62  {
63  //numorbits*3564*24.95e-09
64  return numorbit_*3564.0*24.95e-9;
65 }
unsigned int numorbit_
Definition: LumiSummary.h:174
std::string LumiSummary::lumiVersion ( ) const
lumi data version.

special values: "-1" means not all lumi,trigger,hlt data exist, therefore invalid

Definition at line 120 of file LumiSummary.cc.

References lumiversion_.

Referenced by operator<<().

120  {
121  return lumiversion_;
122 }
std::string lumiversion_
Definition: LumiSummary.h:157
size_t LumiSummary::nHLTPath ( ) const

Definition at line 95 of file LumiSummary.cc.

References hltdata_.

Referenced by operator<<().

95  {
96  return hltdata_.size();
97 }
std::vector< HLT > hltdata_
Definition: LumiSummary.h:168
size_t LumiSummary::nTriggerLine ( ) const

Definition at line 91 of file LumiSummary.cc.

References l1data_.

Referenced by operator<<().

91  {
92  return l1data_.size();
93 }
std::vector< L1 > l1data_
Definition: LumiSummary.h:170
unsigned int LumiSummary::numOrbit ( ) const

Definition at line 75 of file LumiSummary.cc.

References numorbit_.

Referenced by operator<<().

75  {
76  return numorbit_;
77 }
unsigned int numorbit_
Definition: LumiSummary.h:174
void LumiSummary::setBitZeroCount ( unsigned long long  bitzerocount)

Definition at line 138 of file LumiSummary.cc.

References bitzerocount(), and bitzerocount_.

Referenced by ExpressLumiProducer::writeProductsForEntry(), and LumiProducer::writeProductsForEntry().

138  {
140 }
unsigned long long bitzerocount_
Definition: LumiSummary.h:165
unsigned long long bitzerocount() const
Definition: LumiSummary.cc:38
void LumiSummary::setDeadCount ( unsigned long long  deadcount)

Definition at line 134 of file LumiSummary.cc.

References deadcount(), and deadcount_.

Referenced by ExpressLumiProducer::writeProductsForEntry(), and LumiProducer::writeProductsForEntry().

134  {
136 }
unsigned long long deadcount() const
Definition: LumiSummary.cc:34
unsigned long long deadcount_
Definition: LumiSummary.h:164
void LumiSummary::setlsnumber ( unsigned int  lsnumber)

Definition at line 142 of file LumiSummary.cc.

References lsnumber_.

Referenced by ExpressLumiProducer::writeProductsForEntry(), and LumiProducer::writeProductsForEntry().

142  {
143  lsnumber_=lsnumber;
144 }
unsigned int lsnumber_
Definition: LumiSummary.h:166
void LumiSummary::setLumiData ( float  instlumi,
float  instlumierr,
short  lumiquality 
)

Definition at line 128 of file LumiSummary.cc.

References avginsdellumi_, avginsdellumierr_, and lumisecqual_.

Referenced by ExpressLumiProducer::writeProductsForEntry(), and LumiProducer::writeProductsForEntry().

128  {
129  avginsdellumi_=instlumi;
130  avginsdellumierr_=instlumierr;
131  lumisecqual_=lumiquality;
132 }
float avginsdellumierr_
Definition: LumiSummary.h:161
short lumisecqual_
Definition: LumiSummary.h:163
float avginsdellumi_
Definition: LumiSummary.h:159
void LumiSummary::setLumiVersion ( const std::string &  lumiversion)

Definition at line 124 of file LumiSummary.cc.

References lumiversion_.

Referenced by ExpressLumiProducer::writeProductsForEntry(), and LumiProducer::writeProductsForEntry().

124  {
125  lumiversion_=lumiversion;
126 }
std::string lumiversion_
Definition: LumiSummary.h:157
void LumiSummary::setOrbitData ( unsigned int  startorbit,
unsigned int  numorbit 
)

Definition at line 146 of file LumiSummary.cc.

References numorbit_, and startorbit_.

Referenced by ExpressLumiProducer::writeProductsForEntry(), and LumiProducer::writeProductsForEntry().

146  {
147  startorbit_=startorbit;
148  numorbit_=numorbit;
149 }
unsigned int startorbit_
Definition: LumiSummary.h:172
unsigned int numorbit_
Definition: LumiSummary.h:174
unsigned int LumiSummary::startOrbit ( ) const

Definition at line 71 of file LumiSummary.cc.

References startorbit_.

Referenced by operator<<().

71  {
72  return startorbit_;
73 }
unsigned int startorbit_
Definition: LumiSummary.h:172
void LumiSummary::swapHLTData ( std::vector< HLT > &  hltdata)

Definition at line 155 of file LumiSummary.cc.

References hltdata_.

Referenced by LumiProducer::writeProductsForEntry().

155  {
156  hltdata_.swap(hltdata);
157 }
tuple hltdata
Definition: dataDML.py:2362
std::vector< HLT > hltdata_
Definition: LumiSummary.h:168
void LumiSummary::swapL1Data ( std::vector< L1 > &  l1data)

Definition at line 151 of file LumiSummary.cc.

References l1data_.

Referenced by LumiProducer::writeProductsForEntry().

151  {
152  l1data_.swap(l1data);
153 }
std::vector< L1 > l1data_
Definition: LumiSummary.h:170

Member Data Documentation

float LumiSummary::avginsdellumi_
private

Definition at line 159 of file LumiSummary.h.

Referenced by avgInsDelLumi(), isProductEqual(), isValid(), and setLumiData().

float LumiSummary::avginsdellumierr_
private

Definition at line 161 of file LumiSummary.h.

Referenced by avgInsDelLumiErr(), avgInsRecLumiErr(), isProductEqual(), and setLumiData().

unsigned long long LumiSummary::bitzerocount_
private

Definition at line 165 of file LumiSummary.h.

Referenced by bitzerocount(), deadFrac(), and setBitZeroCount().

unsigned long long LumiSummary::deadcount_
private

Definition at line 164 of file LumiSummary.h.

Referenced by deadcount(), deadFrac(), isProductEqual(), and setDeadCount().

std::vector<HLT> LumiSummary::hltdata_
private

Definition at line 168 of file LumiSummary.h.

Referenced by copyHLTData(), hltinfo(), isProductEqual(), LumiSummary(), nHLTPath(), and swapHLTData().

std::vector<L1> LumiSummary::l1data_
private
unsigned int LumiSummary::lsnumber_
private

Definition at line 166 of file LumiSummary.h.

Referenced by isProductEqual(), lsNumber(), and setlsnumber().

short LumiSummary::lumisecqual_
private

Definition at line 163 of file LumiSummary.h.

Referenced by isProductEqual(), lumiSecQual(), and setLumiData().

std::string LumiSummary::lumiversion_
private

Definition at line 157 of file LumiSummary.h.

Referenced by avgInsDelLumi(), deadFrac(), isProductEqual(), lumiVersion(), and setLumiVersion().

unsigned int LumiSummary::numorbit_
private

Definition at line 174 of file LumiSummary.h.

Referenced by isProductEqual(), lumiSectionLength(), numOrbit(), and setOrbitData().

unsigned int LumiSummary::startorbit_
private

Definition at line 172 of file LumiSummary.h.

Referenced by isProductEqual(), setOrbitData(), and startOrbit().