CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
LHCInfoCombined Class Reference

#include <LHCInfoCombined.h>

Public Member Functions

float crossingAngle () const
 
bool isCrossingAngleInvalid ()
 
 LHCInfoCombined ()=default
 
 LHCInfoCombined (const LHCInfo &lhcInfo)
 
 LHCInfoCombined (const LHCInfoPerLS &infoPerLS, const LHCInfoPerFill &infoPerFill)
 
 LHCInfoCombined (const edm::EventSetup &iSetup, const edm::ESGetToken< LHCInfoPerLS, LHCInfoPerLSRcd > &tokenInfoPerLS, const edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcd > &tokenInfoPerFill, const edm::ESGetToken< LHCInfo, LHCInfoRcd > &tokenInfo, bool useNewLHCInfo)
 
void print (std::ostream &os) const
 
void setFromLHCInfo (const LHCInfo &lhcInfo)
 
void setFromPerFill (const LHCInfoPerFill &infoPerFill)
 
void setFromPerLS (const LHCInfoPerLS &infoPerLS)
 

Static Public Member Functions

template<class RecordT , class ListT >
static LHCInfoCombined createLHCInfoCombined (const edm::eventsetup::DependentRecordImplementation< RecordT, ListT > &iRecord, const edm::ESGetToken< LHCInfoPerLS, LHCInfoPerLSRcd > &tokenInfoPerLS, const edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcd > &tokenInfoPerFill, const edm::ESGetToken< LHCInfo, LHCInfoRcd > &tokenInfo, bool useNewLHCInfo)
 

Public Attributes

float betaStarX
 
float betaStarY
 
float crossingAngleX
 
float crossingAngleY
 
float energy
 
unsigned short fillNumber
 

Static Public Attributes

static constexpr float crossingAngleInvalid = -1.
 

Detailed Description

Definition at line 21 of file LHCInfoCombined.h.

Constructor & Destructor Documentation

◆ LHCInfoCombined() [1/4]

LHCInfoCombined::LHCInfoCombined ( )
default

◆ LHCInfoCombined() [2/4]

LHCInfoCombined::LHCInfoCombined ( const LHCInfo lhcInfo)

Definition at line 4 of file LHCInfoCombined.cc.

References setFromLHCInfo().

4 { setFromLHCInfo(lhcInfo); }
void setFromLHCInfo(const LHCInfo &lhcInfo)

◆ LHCInfoCombined() [3/4]

LHCInfoCombined::LHCInfoCombined ( const LHCInfoPerLS infoPerLS,
const LHCInfoPerFill infoPerFill 
)

Definition at line 6 of file LHCInfoCombined.cc.

References setFromPerFill(), and setFromPerLS().

6  {
7  setFromPerLS(infoPerLS);
8  setFromPerFill(infoPerFill);
9 }
void setFromPerLS(const LHCInfoPerLS &infoPerLS)
void setFromPerFill(const LHCInfoPerFill &infoPerFill)

◆ LHCInfoCombined() [4/4]

LHCInfoCombined::LHCInfoCombined ( const edm::EventSetup iSetup,
const edm::ESGetToken< LHCInfoPerLS, LHCInfoPerLSRcd > &  tokenInfoPerLS,
const edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcd > &  tokenInfoPerFill,
const edm::ESGetToken< LHCInfo, LHCInfoRcd > &  tokenInfo,
bool  useNewLHCInfo 
)

Definition at line 11 of file LHCInfoCombined.cc.

References edm::EventSetup::getHandle(), setFromLHCInfo(), setFromPerFill(), setFromPerLS(), and HLT_2024v13_cff::useNewLHCInfo.

15  {
16  if (useNewLHCInfo) {
17  edm::ESHandle<LHCInfoPerLS> hLHCInfoPerLS = iSetup.getHandle(tokenInfoPerLS);
18  edm::ESHandle<LHCInfoPerFill> hLHCInfoFill = iSetup.getHandle(tokenInfoPerFill);
19  setFromPerLS(*hLHCInfoPerLS);
20  setFromPerFill(*hLHCInfoFill);
21  } else {
22  edm::ESHandle<LHCInfo> hLHCInfo = iSetup.getHandle(tokenInfo);
23  setFromLHCInfo(*hLHCInfo);
24  }
25 }
void setFromPerLS(const LHCInfoPerLS &infoPerLS)
void setFromPerFill(const LHCInfoPerFill &infoPerFill)
void setFromLHCInfo(const LHCInfo &lhcInfo)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130

Member Function Documentation

◆ createLHCInfoCombined()

template<class RecordT , class ListT >
LHCInfoCombined LHCInfoCombined::createLHCInfoCombined ( const edm::eventsetup::DependentRecordImplementation< RecordT, ListT > &  iRecord,
const edm::ESGetToken< LHCInfoPerLS, LHCInfoPerLSRcd > &  tokenInfoPerLS,
const edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcd > &  tokenInfoPerFill,
const edm::ESGetToken< LHCInfo, LHCInfoRcd > &  tokenInfo,
bool  useNewLHCInfo 
)
static

Definition at line 63 of file LHCInfoCombined.h.

References edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), setFromLHCInfo(), setFromPerFill(), setFromPerLS(), and HLT_2024v13_cff::useNewLHCInfo.

Referenced by CTPPSInterpolatedOpticalFunctionsESSource::produce(), and CTPPSBeamParametersFromLHCInfoESSource::produce().

68  {
69  LHCInfoCombined lhcInfoCombined;
70  if (useNewLHCInfo) {
71  LHCInfoPerLS const& lhcInfoPerLS = iRecord.get(tokenInfoPerLS);
72  LHCInfoPerFill const& lhcInfoPerFill = iRecord.get(tokenInfoPerFill);
73  lhcInfoCombined.setFromPerLS(lhcInfoPerLS);
74  lhcInfoCombined.setFromPerFill(lhcInfoPerFill);
75  } else {
76  LHCInfo const& lhcInfo = iRecord.get(tokenInfo);
77  lhcInfoCombined.setFromLHCInfo(lhcInfo);
78  }
79  return lhcInfoCombined;
80 }
void setFromPerLS(const LHCInfoPerLS &infoPerLS)
void setFromPerFill(const LHCInfoPerFill &infoPerFill)
void setFromLHCInfo(const LHCInfo &lhcInfo)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

◆ crossingAngle()

float LHCInfoCombined::crossingAngle ( ) const

Definition at line 46 of file LHCInfoCombined.cc.

References crossingAngleInvalid, crossingAngleX, and crossingAngleY.

Referenced by CTPPSLHCInfoPlotter::analyze(), CTPPSProtonReconstructionEfficiencyEstimatorData::analyze(), LHCInfoProducer::globalBeginLuminosityBlockProduce(), isCrossingAngleInvalid(), and CTPPSProtonProducer::produce().

46  {
47  if (crossingAngleX == 0. && crossingAngleY == 0.) {
48  return crossingAngleInvalid;
49  }
50  if (crossingAngleX != 0. && crossingAngleY != 0.) {
51  edm::LogWarning("LHCInfoCombined") << "crossingAngleX and crossingAngleY are both different from 0";
52  return crossingAngleInvalid;
53  }
55 }
static constexpr float crossingAngleInvalid
Log< level::Warning, false > LogWarning

◆ isCrossingAngleInvalid()

bool LHCInfoCombined::isCrossingAngleInvalid ( )

Definition at line 58 of file LHCInfoCombined.cc.

References crossingAngle(), crossingAngleInvalid, and MillePedeFileConverter_cfg::e.

58  {
59  float comparisonTolerance = 1e-6;
60  return fabs(crossingAngle() - crossingAngleInvalid) <= comparisonTolerance;
61 }
float crossingAngle() const
static constexpr float crossingAngleInvalid

◆ print()

void LHCInfoCombined::print ( std::ostream &  os) const

Definition at line 63 of file LHCInfoCombined.cc.

References betaStarX, betaStarY, crossingAngleX, crossingAngleY, and energy.

Referenced by operator<<().

63  {
64  os << "Crossing angle x (urad): " << crossingAngleX << std::endl
65  << "Crossing angle y (urad): " << crossingAngleY << std::endl
66  << "Beta star x (m): " << betaStarX << std::endl
67  << "Beta star y (m): " << betaStarY << std::endl
68  << "Energy (GeV): " << energy << std::endl;
69 }

◆ setFromLHCInfo()

void LHCInfoCombined::setFromLHCInfo ( const LHCInfo lhcInfo)

Definition at line 27 of file LHCInfoCombined.cc.

References LHCInfo::betaStar(), betaStarX, betaStarY, LHCInfo::crossingAngle(), crossingAngleX, crossingAngleY, energy, LHCInfo::energy(), fillNumber, and LHCInfo::fillNumber().

Referenced by createLHCInfoCombined(), and LHCInfoCombined().

27  {
28  crossingAngleX = lhcInfo.crossingAngle();
29  crossingAngleY = 0;
30  betaStarX = lhcInfo.betaStar();
31  betaStarY = lhcInfo.betaStar();
32  energy = lhcInfo.energy();
33  fillNumber = lhcInfo.fillNumber();
34 }
float const energy() const
Definition: LHCInfo.cc:190
unsigned short const fillNumber() const
Definition: LHCInfo.cc:158
float const betaStar() const
Definition: LHCInfo.cc:184
float const crossingAngle() const
Definition: LHCInfo.cc:182
unsigned short fillNumber

◆ setFromPerFill()

void LHCInfoCombined::setFromPerFill ( const LHCInfoPerFill infoPerFill)

Definition at line 41 of file LHCInfoCombined.cc.

References energy, LHCInfoPerFill::energy(), fillNumber, and LHCInfoPerFill::fillNumber().

Referenced by createLHCInfoCombined(), and LHCInfoCombined().

41  {
42  energy = infoPerFill.energy();
43  fillNumber = infoPerFill.fillNumber();
44 }
float const energy() const
unsigned short const fillNumber() const
unsigned short fillNumber

◆ setFromPerLS()

void LHCInfoCombined::setFromPerLS ( const LHCInfoPerLS infoPerLS)

Definition at line 35 of file LHCInfoCombined.cc.

References LHCInfoPerLS::betaStarX(), betaStarX, LHCInfoPerLS::betaStarY(), betaStarY, LHCInfoPerLS::crossingAngleX(), crossingAngleX, LHCInfoPerLS::crossingAngleY(), and crossingAngleY.

Referenced by createLHCInfoCombined(), and LHCInfoCombined().

35  {
36  crossingAngleX = infoPerLS.crossingAngleX();
37  crossingAngleY = infoPerLS.crossingAngleY();
38  betaStarX = infoPerLS.betaStarX();
39  betaStarY = infoPerLS.betaStarY();
40 }
float const betaStarY() const
Definition: LHCInfoPerLS.cc:21
float const crossingAngleX() const
Definition: LHCInfoPerLS.cc:15
float const crossingAngleY() const
Definition: LHCInfoPerLS.cc:17
float const betaStarX() const
Definition: LHCInfoPerLS.cc:19

Member Data Documentation

◆ betaStarX

float LHCInfoCombined::betaStarX

◆ betaStarY

float LHCInfoCombined::betaStarY

Definition at line 53 of file LHCInfoCombined.h.

Referenced by print(), setFromLHCInfo(), and setFromPerLS().

◆ crossingAngleInvalid

constexpr float LHCInfoCombined::crossingAngleInvalid = -1.
static

◆ crossingAngleX

float LHCInfoCombined::crossingAngleX

Definition at line 50 of file LHCInfoCombined.h.

Referenced by crossingAngle(), print(), setFromLHCInfo(), and setFromPerLS().

◆ crossingAngleY

float LHCInfoCombined::crossingAngleY

Definition at line 51 of file LHCInfoCombined.h.

Referenced by crossingAngle(), print(), setFromLHCInfo(), and setFromPerLS().

◆ energy

float LHCInfoCombined::energy

◆ fillNumber

unsigned short LHCInfoCombined::fillNumber

Definition at line 55 of file LHCInfoCombined.h.

Referenced by CTPPSLHCInfoPlotter::analyze(), setFromLHCInfo(), and setFromPerFill().