![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include "CoralBase/Attribute.h"
14 #include "CoralBase/AttributeListSpecification.h"
15 #include "GaudiKernel/ConcurrencyFlags.h"
36 return StatusCode::SUCCESS;
43 if (writeALineHandle.isValid()) {
44 ATH_MSG_DEBUG(
"CondHandle " << writeALineHandle.fullKey() <<
" is already valid."
45 <<
". In theory this should not be called, but may happen"
46 <<
" if multiple concurrent events are being processed out of order.");
47 return StatusCode::SUCCESS;
54 if (writeBLineHandle.isValid()) {
55 ATH_MSG_DEBUG(
"CondHandle " << writeBLineHandle.fullKey() <<
" is already valid."
56 <<
". In theory this should not be called, but may happen"
57 <<
" if multiple concurrent events are being processed out of order.");
58 return StatusCode::SUCCESS;
63 std::unique_ptr<ALineContainer> writeALineCdo{std::make_unique<ALineContainer>()};
64 std::unique_ptr<BLineContainer> writeBLineCdo{std::make_unique<BLineContainer>()};
71 if (!inStream.good()) {
73 return StatusCode::FAILURE;
79 ATH_CHECK(writeALineHandle.record(std::move(writeALineCdo)));
80 ATH_CHECK(writeBLineHandle.record(std::move(writeBLineCdo)));
82 return StatusCode::SUCCESS;
92 if (!readHandle.isValid()){
94 return StatusCode::FAILURE;
96 ATH_MSG_INFO(
"Attach new dependency from <"<<readHandle.key()<<
"> to the A & B lines. IOV: "<<readHandle.getRange());
100 return StatusCode::SUCCESS;
108 if (!readHandle.isValid()){
110 return StatusCode::FAILURE;
122 return StatusCode::FAILURE;
125 data = *(
static_cast<const std::string*
>((atr[
"data"]).addressOfData()));
132 lines = j[
"corrections"];
140 return StatusCode::SUCCESS;
147 for (
auto& corr :
lines.items()) {
151 const std::string stationType =
line[
"typ"];
157 if (stationType[0] ==
'M') {
163 }
else if (stationType[0] ==
'S') {
170 }
else if (stationType[0] ==
'T') {
182 id =
m_idHelperSvc->tgcIdHelper().elementID(stationType, stEta, stPhi);
183 }
else if (stationType[0] ==
'C') {
189 }
else if (stationType.substr(0, 3) ==
"BML" && std::abs(
stationEta) == 7) {
204 newALine.setParameters(
line[
"svalue"],
line[
"zvalue"],
line[
"tvalue"],
206 auto aLineInsert = writeALineCdo.insert(newALine);
207 if (newALine && !aLineInsert.second) {
209 <<
" because "<<(*aLineInsert.first)<<
" has been added before");
213 if (
line.find(
"bz") ==
line.end()) {
221 newBLine.setIdentifier(
id);
224 auto bLineInsert = writeBLineCdo.insert(newBLine);
225 if (newBLine && !bLineInsert.second){
227 <<
" because "<<(*bLineInsert.first)<<
" has been added before.");
230 return StatusCode::SUCCESS;
234 bool loadBLines)
const {
237 constexpr std::string_view
delimiter{
"\n"};
241 for (
const std::string& blobline :
lines) {
243 constexpr std::string_view
delimiter{
":"};
249 return StatusCode::FAILURE;
253 if (
type[0] ==
'#') {
264 if (
type.compare(0, 4,
"Corr") == 0) {
265 constexpr std::string_view
delimiter{
" "};
267 if (
tokens.size() != 25) {
269 return StatusCode::FAILURE;
311 return StatusCode::SUCCESS;
char data[hepevt_bytes_allocation_ATLAS]
constexpr uint8_t stationPhi
station Phi 1 to 8
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
void setIdentifier(const Identifier &id)
Setters and getters for the Athena Identifier.
MuonAlignmentCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override
virtual StatusCode initialize() override
#define ATH_MSG_VERBOSE(x)
An algorithm that can be simultaneously executed in multiple threads.
void setParameters(float bz, float bp, float bn, float sp, float sn, float tw, float pg, float tr, float eg, float ep, float en)
Cast the parameter to an unsigned int
bool readBlobAsString(const coral::Blob &, std::string &)
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< bool > m_newFormat2020
std::set< ALinePar, std::less<> > ALineContainer
SG::WriteCondHandleKey< ALineContainer > m_writeALineKey
SG::WriteCondHandleKey< BLineContainer > m_writeBLineKey
double atof(std::string_view str)
Converts a string into a double / float.
StatusCode attachDependencies(const EventContext &ctx, SG::WriteCondHandle< ALineContainer > &alines, SG::WriteCondHandle< BLineContainer > &blines) const
Attaches the dependencies of the Alignment keys onto the A & Bline container.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::ReadCondHandleKeyArray< CondAttrListCollection > m_alignKeys
StatusCode loadDataFromLegacy(const std::string &data, nlohmann::json &json, bool loadBLines) const
Load the Alignment data from the legacy format where the channels are parsed line wise The data is th...
StatusCode initialize(bool used=true)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Gaudi::Property< std::string > m_readFromJSON
Load the alignment parameters from a JSON file.
StatusCode parseDataFromJSON(const nlohmann::json &lines, ALineContainer &writeALineCdo, BLineContainer &writeBLineCdo) const
Parse the JSON blob to fill the A & B Line containers.
#define ATH_MSG_WARNING(x)
ChanAttrListMap::const_iterator const_iterator
int stationPhiTGC(std::string_view stName, int fi, int zi_input)
Converts the AMDB phi index to the Identifier phi Index.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
std::set< BLinePar, std::less<> > BLineContainer
constexpr uint8_t stationEta
1 to 3
StatusCode loadCoolFolder(const EventContext &ctx, const SG::ReadCondHandleKey< CondAttrListCollection > &key, ALineContainer &writeALineCdo, BLineContainer &writeBLineCdo) const
Retrieves the alignment parameters from a COOL folder.
void addDependency(const EventIDRange &range)