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;
74 , m_floatParams( FSIZE )
75 , m_timeParams( TSIZE )
76 , m_stringParams( SSIZE )
123 template <
typename T>
const T&
getParams(
const std::vector<T>& params,
size_t index ){
124 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
125 return params[
index];
128 template <
typename T>
const T&
getOneParam(
const std::vector< std::vector<T> >& params,
size_t index ){
129 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
131 if( inner.empty() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" has no value stored.");
136 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
141 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
282 throw std::out_of_range(
"0 not allowed" );
288 throw std::out_of_range(
"0 not allowed" );
420 ,
unsigned short const & bunches2
428 ,
float const & intensity1
429 ,
float const & intensity2
444 ,std::vector<float>
const &
beam1VC 445 ,std::vector<float>
const &
beam2VC 446 ,std::vector<float>
const &
beam1RF 447 ,std::vector<float>
const &
beam2RF 448 ,std::bitset<bunchSlots+1>
const & bunchConf1
449 ,std::bitset<bunchSlots+1>
const & bunchConf2 ) {
484 ss <<
"LHC fill: " << this->
fillNumber() << std::endl
488 <<
"Target bunches at IP5: " <<this->
targetBunches() << std::endl
492 <<
"Crossing angle (urad): " << this->
crossingAngle() << std::endl
493 <<
"Beta star (cm): " << this->
betaStar() << std::endl
494 <<
"Average Intensity for Beam 1 (number of charges): " << this->
intensityForBeam1() << std::endl
495 <<
"Average Intensity for Beam 2 (number of charges): " << this->
intensityForBeam2() << std::endl
496 <<
"Energy (GeV): " << this->
energy() << std::endl
497 <<
"Delivered Luminosity (max): " << this->
delivLumi() << std::endl
498 <<
"Recorded Luminosity (max): " << this->
recLumi() << std::endl
499 <<
"Instantaneous Luminosity: " << this->
instLumi() << std::endl
500 <<
"Instantaneous Luminosity Error: " << this->
instLumiError() << std::endl
504 <<
"Injection scheme as given by LPC: " << this->
injectionScheme() << std::endl
505 <<
"LHC State: " << this->
lhcState() << std::endl
506 <<
"LHC Comments: " << this->
lhcComment() << std::endl
507 <<
"CTPPS Status: " << this->
ctppsStatus() << std::endl
508 <<
"Lumi sections: " << this->
lumiSection() << std::endl;
510 ss <<
"Luminosity per bunch (total " << this->
lumiPerBX().size() <<
"): ";
514 ss <<
"Beam 1 VC (total " << this->
beam1VC().size() <<
"): ";
518 ss <<
"Beam 2 VC (total " <<
beam2VC().size() <<
"): ";
522 ss <<
"Beam 1 RF (total " <<
beam1RF().size() <<
"): ";
526 ss <<
"Beam 2 RF (total " <<
beam2RF().size() <<
"): ";
532 ss <<
"Bunches filled for Beam 1 (total " << bunchVector1.size() <<
"): ";
533 std::copy( bunchVector1.begin(), bunchVector1.end(), std::ostream_iterator<unsigned short>( ss,
", " ) );
535 ss <<
"Bunches filled for Beam 2 (total " << bunchVector2.size() <<
"): ";
536 std::copy( bunchVector2.begin(), bunchVector2.end(), std::ostream_iterator<unsigned short>( ss,
", " ) );
559 std::stringstream ss;
560 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
void setFill(unsigned short const &lhcFill, bool const &fromData)
float const delivLumi() const
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
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
bool const isData() 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)