9 static std::vector<unsigned short>
bitsetToVector( std::bitset<LHCInfo::bunchSlots+1>
const & bs ) {
10 std::vector<unsigned short> vec;
12 vec.reserve( bs.count() );
13 for(
size_t i = 0;
i < bs.size(); ++
i ) {
15 vec.push_back( (
unsigned short)
i );
48 switch( particleType ) {
70 return s_particleType;
78 m_floatParams[
BEAM2_VC ] = std::vector<float>();
79 m_floatParams[
BEAM1_RF ] = std::vector<float>();
80 m_floatParams[
BEAM2_RF ] = std::vector<float>();
114 template <
typename T>
const T&
getParams(
const std::vector<T>& params,
size_t index ){
115 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
116 return params[
index];
120 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
121 return params[
index];
124 template <
typename T>
const T&
getOneParam(
const std::vector< std::vector<T> >& params,
size_t index ){
125 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
127 if( inner.empty() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" type="+
typeid(
T).
name()+
" has no value stored.");
132 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
137 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
290 throw std::out_of_range(
"0 not allowed" );
296 throw std::out_of_range(
"0 not allowed" );
432 ,
unsigned short const & bunches2
440 ,
float const & intensity1
441 ,
float const & intensity2
456 ,std::vector<float>
const &
beam1VC 457 ,std::vector<float>
const &
beam2VC 458 ,std::vector<float>
const &
beam1RF 459 ,std::vector<float>
const &
beam2RF 460 ,std::bitset<bunchSlots+1>
const & bunchConf1
461 ,std::bitset<bunchSlots+1>
const & bunchConf2 ) {
496 ss <<
"LHC fill: " << this->
fillNumber() << std::endl
500 <<
"Target bunches at IP5: " <<this->
targetBunches() << std::endl
504 <<
"Crossing angle (urad): " << this->
crossingAngle() << std::endl
505 <<
"Beta star (cm): " << this->
betaStar() << std::endl
506 <<
"Average Intensity for Beam 1 (number of charges): " << this->
intensityForBeam1() << std::endl
507 <<
"Average Intensity for Beam 2 (number of charges): " << this->
intensityForBeam2() << std::endl
508 <<
"Energy (GeV): " << this->
energy() << std::endl
509 <<
"Delivered Luminosity (max): " << this->
delivLumi() << std::endl
510 <<
"Recorded Luminosity (max): " << this->
recLumi() << std::endl
511 <<
"Instantaneous Luminosity: " << this->
instLumi() << std::endl
512 <<
"Instantaneous Luminosity Error: " << this->
instLumiError() << std::endl
516 <<
"Injection scheme as given by LPC: " << this->
injectionScheme() << std::endl
517 <<
"LHC State: " << this->
lhcState() << std::endl
518 <<
"LHC Comments: " << this->
lhcComment() << std::endl
519 <<
"CTPPS Status: " << this->
ctppsStatus() << std::endl
520 <<
"Lumi section: " << this->
lumiSection() << std::endl;
522 ss <<
"Luminosity per bunch (total " << this->
lumiPerBX().size() <<
"): ";
526 ss <<
"Beam 1 VC (total " << this->
beam1VC().size() <<
"): ";
530 ss <<
"Beam 2 VC (total " <<
beam2VC().size() <<
"): ";
534 ss <<
"Beam 1 RF (total " <<
beam1RF().size() <<
"): ";
538 ss <<
"Beam 2 RF (total " <<
beam2RF().size() <<
"): ";
544 ss <<
"Bunches filled for Beam 1 (total " << bunchVector1.size() <<
"): ";
545 std::copy( bunchVector1.begin(), bunchVector1.end(), std::ostream_iterator<unsigned short>( ss,
", " ) );
547 ss <<
"Bunches filled for Beam 2 (total " << bunchVector2.size() <<
"): ";
548 std::copy( bunchVector2.begin(), bunchVector2.end(), std::ostream_iterator<unsigned short>( ss,
", " ) );
571 std::stringstream ss;
572 beamInfo.
print( ss );
bool equals(const LHCInfo &rhs) const
std::string const & lhcState() const
void setBeam1RF(std::vector< float > const &beam1RF)
cond::Time_t const beginTime() const
void setLumiSection(unsigned int const &lumiSection)
unsigned short const bunchesInBeam1() const
void setBeginTime(cond::Time_t const &beginTime)
std::bitset< bunchSlots+1 > const & bunchBitsetForBeam1() const
void print(std::stringstream &ss) const
void setInstLumi(float const &instLumi)
void setEnergy(float const &energy)
FillTypeId const fillType() const
bool isBunchInBeam1(size_t const &bunch) const
LHCInfo * cloneFill() const
void setInstLumiError(float const &instLumiError)
void setParticleTypeForBeam2(ParticleTypeId const &particleType)
unsigned short const targetBunches() const
std::string const & injectionScheme() const
std::bitset< bunchSlots+1 > m_bunchConfiguration1
static std::string particleTypeToString(LHCInfo::ParticleTypeId const &particleType)
void setDelivLumi(float const &delivLumi)
const T & getOneParam(const std::vector< std::vector< T > > ¶ms, size_t index)
void setParams(std::vector< T > ¶ms, size_t index, const T &value)
std::string const & ctppsStatus() const
void setBeam1VC(std::vector< float > const &beam1VC)
std::vector< std::vector< float > > m_floatParams
bool equal(const T &first, const T &second)
void setBunchesInBeam1(unsigned short const &bunches)
void setLhcComment(std::string const &lhcComment)
void setOneParam(std::vector< std::vector< T > > ¶ms, size_t index, const T &value)
std::vector< std::vector< unsigned long long > > m_timeParams
float const delivLumi() const
void setFillNumber(unsigned short lhcFill)
float const crossingAngle() const
float const instLumiError() const
bool is25nsBunchSpacing() const
unsigned long long Time_t
std::string const & lhcComment() const
void setBetaStar(float const &betaStar)
std::vector< float > const & beam1VC() const
T & accessParams(std::vector< T > ¶ms, size_t index)
std::vector< float > const & beam2RF() const
std::ostream & operator<<(std::ostream &os, LHCInfo beamInfo)
unsigned short const bunchesInBeam2() const
bool isBunchInBeam2(size_t const &bunch) const
void setLumiPerBX(std::vector< float > const &lumiPerBX)
void setBunchesInBeam2(unsigned short const &bunches)
std::vector< float > const & beam1RF() const
float const intensityForBeam2() const
void setBeam2RF(std::vector< float > const &beam2RF)
void setLhcState(std::string const &lhcState)
void setBeam2VC(std::vector< float > const &beam2VC)
void setCollidingBunches(unsigned short const &collidingBunches)
std::vector< std::vector< unsigned int > > m_intParams
unsigned int const & lumiSection() const
void setRecLumi(float const &recLumi)
float const instLumi() const
cond::Time_t const endTime() const
static std::string fillTypeToString(LHCInfo::FillTypeId const &fillType)
void setInfo(unsigned short const &bunches1, unsigned short const &bunches2, unsigned short const &collidingBunches, unsigned short const &targetBunches, FillTypeId const &fillType, ParticleTypeId const &particleType1, ParticleTypeId const &particleType2, float const &angle, float const &beta, float const &intensity1, float const &intensity2, float const &energy, float const &delivLumi, float const &recLumi, float const &instLumi, float const &instLumiError, cond::Time_t const &createTime, cond::Time_t const &beginTime, cond::Time_t const &endTime, std::string const &scheme, std::vector< float > const &lumiPerBX, std::string const &lhcState, std::string const &lhcComment, std::string const &ctppsStatus, unsigned int const &lumiSection, std::vector< float > const &beam1VC, std::vector< float > const &beam2VC, std::vector< float > const &beam1RF, std::vector< float > const &beam2RF, std::bitset< bunchSlots+1 > const &bunchConf1, std::bitset< bunchSlots+1 > const &bunchConf2)
void setParticleTypeForBeam1(ParticleTypeId const &particleType)
void setInjectionScheme(std::string const &injectionScheme)
std::vector< float > const & beam2VC() const
std::vector< float > const & lumiPerBX() const
ParticleTypeId const particleTypeForBeam1() const
void setCreationTime(cond::Time_t const &createTime)
void setTargetBunches(unsigned short const &targetBunches)
const T & getParams(const std::vector< T > ¶ms, size_t index)
float const recLumi() const
void setCtppsStatus(std::string const &ctppsStatus)
std::bitset< bunchSlots+1 > const & bunchBitsetForBeam2() const
unsigned short const collidingBunches() const
float const betaStar() const
float const intensityForBeam1() const
float const energy() const
unsigned short const fillNumber() const
void setBunchBitsetForBeam1(std::bitset< bunchSlots+1 > const &bunchConfiguration)
void setBunchBitsetForBeam2(std::bitset< bunchSlots+1 > const &bunchConfiguration)
ParticleTypeId const particleTypeForBeam2() const
void setIntensityForBeam1(float const &intensity)
void setEndTime(cond::Time_t const &endTime)
void setIntensityForBeam2(float const &intensity)
std::bitset< bunchSlots+1 > m_bunchConfiguration2
void setFillType(FillTypeId const &fillType)
cond::Time_t const createTime() const
void setCrossingAngle(float const &angle)
std::vector< unsigned short > bunchConfigurationForBeam2() const
boost::posix_time::ptime to_boost(Time_t iValue)
static std::vector< unsigned short > bitsetToVector(std::bitset< LHCInfo::bunchSlots+1 > const &bs)
std::vector< unsigned short > bunchConfigurationForBeam1() const
std::vector< std::vector< std::string > > m_stringParams
T angle(T x1, T y1, T z1, T x2, T y2, T z2)