Skip to content

Commit eccc003

Browse files
authored
helper to get nominal L3 field (#7506)
1 parent f2fc331 commit eccc003

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

  • DataFormats/Parameters/include/DataFormatsParameters

DataFormats/Parameters/include/DataFormatsParameters/GRPObject.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class GRPObject
8282
void setL3Current(o2::units::Current_t v) { mL3Current = v; }
8383
void setDipoleCurrent(o2::units::Current_t v) { mDipoleCurrent = v; }
8484
void setFieldUniformity(bool v) { mUniformField = v; }
85+
int8_t getNominalL3Field();
8586
/// getter/setter for data taking period name
8687
const std::string& getDataPeriod() const { return mDataPeriod; }
8788
void setDataPeriod(const std::string v) { mDataPeriod = v; }
@@ -158,14 +159,17 @@ class GRPObject
158159
bool mUniformField = false; ///< uniformity of magnetic field
159160
float mBeamEnergyPerZ = 0.f; ///< beam energy per charge (i.e. sqrt(s)/2 for pp)
160161

162+
int8_t mNominalL3Field = 0; //!< Nominal L3 field deduced from mL3Current
163+
bool mNominalL3FieldValid = false; //!< Has the field been computed (for caching)
164+
161165
int mBeamAZ[beamDirection::NBeamDirections] = {0, 0}; ///< A<<16+Z for each beam
162166

163167
int mRun = 0; ///< run identifier
164168
int mFill = 0; ///< fill identifier
165169
std::string mDataPeriod = ""; ///< name of the period
166170
std::string mLHCState = ""; ///< machine state
167171

168-
ClassDefNV(GRPObject, 5);
172+
ClassDefNV(GRPObject, 6);
169173
};
170174

171175
//______________________________________________
@@ -176,6 +180,18 @@ inline float GRPObject::getBeamZ2A(beamDirection b) const
176180
return a ? getBeamZ(b) / static_cast<float>(a) : 0.f;
177181
}
178182

183+
//______________________________________________
184+
inline int8_t GRPObject::getNominalL3Field()
185+
{
186+
// compute nominal L3 field in kG
187+
188+
if (mNominalL3FieldValid == false) {
189+
mNominalL3Field = std::lround(5.f * mL3Current / 30000.f);
190+
mNominalL3FieldValid = true;
191+
}
192+
return mNominalL3Field;
193+
}
194+
179195
} // namespace parameters
180196
} // namespace o2
181197

0 commit comments

Comments
 (0)