|
ATLAS Offline Software
|
Go to the documentation of this file.
27 return StatusCode::SUCCESS;
32 if (writeHandle.isValid()) {
33 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid."
34 <<
". In theory this should not be called, but may happen"
35 <<
" if multiple concurrent events are being processed out of order.");
36 return StatusCode::SUCCESS;
39 std::unique_ptr<ALineContainer> writeCdo{std::make_unique<ALineContainer>()};
42 if (!readHandle.isValid()) {
44 return StatusCode::FAILURE;
46 writeHandle.addDependency(readHandle);
53 itr != readHandle->end(); ++itr) {
61 return StatusCode::FAILURE;
64 data = *(
static_cast<const std::string*
>((atr[
"data"]).addressOfData()));
72 lines = j[
"corrections"];
81 if (!inStream.good()) {
83 return StatusCode::FAILURE;
92 ATH_CHECK(writeHandle.record(std::move(writeCdo)));
93 ATH_MSG_INFO(
"Saved successfully internal CSC alignment "<<
m_writeKey.fullKey()<<
" with validity range "<<writeHandle.getRange());
94 return StatusCode::SUCCESS;
100 constexpr std::string_view
delimiter{
"\n"};
103 for (
const std::string& blobline :
lines) {
105 constexpr std::string_view
delimiter {
":"};
110 return StatusCode::FAILURE;
114 if (
'#' ==
type[0]) {
118 if (
type.compare(0, 4,
"Corr") == 0) {
125 constexpr std::string_view
delimiter{
" "};
127 if (
tokens.size() != 12) {
128 ATH_MSG_FATAL(
"Invalid length in string retrieved from DB in folder. String length is "
130 return StatusCode::FAILURE;
154 if (
line.empty())
continue;
157 return StatusCode::SUCCESS;
162 for (
auto& corr :
lines.items()) {
167 const int jff =
line[
"jff"];
168 const int jzz =
line[
"jzz"];
170 const int jlay =
line[
"jlay"];
171 const std::string stationType =
line[
"typ"];
172 newILine.setAmdbId(stationType, jzz, jff,
job);
175 bool is_valid{
false};
176 if (stationType[0] ==
'C') {
178 constexpr
int chamberLayer = 2;
179 if (
job != 3)
ATH_MSG_WARNING(
"job = " <<
job <<
" is not 3 => chamberLayer should be 1 - not existing ! setting 2");
180 id =
m_idHelperSvc->cscIdHelper().channelID(stationType, jzz, jff, chamberLayer, jlay, 0, 1, is_valid);
184 ATH_MSG_ERROR(
"There is a non CSC chamber in the list of CSC internal alignment parameters.");
185 return StatusCode::FAILURE;
187 newILine.setIdentifier(
id);
189 newILine.setParameters(
line[
"tras"],
line[
"traz"],
line[
"trat"],
192 const auto insertItr = writeCdo.insert(newILine);
193 if (!insertItr.second) {
194 ATH_MSG_FATAL(
"Could not insert "<<newILine<<
" as "<<(*insertItr.first)<<
" has already been safed before" );
195 return StatusCode::FAILURE;
199 return StatusCode::SUCCESS;
char data[hepevt_bytes_allocation_ATLAS]
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
virtual StatusCode execute(const EventContext &ctx) const override
CscILinesCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
StatusCode loadDataFromLegacy(const std::string &data, nlohmann::json &json) const
Load the Alignment data from the legacy format where the channels are parsed line wise The data is th...
Gaudi::Property< bool > m_newFormat2020
An algorithm that can be simultaneously executed in multiple threads.
StatusCode parseDataFromJSON(const nlohmann::json &lines, ALineContainer &writeCdo) const
Parse the JSON blob to fill the I Line container.
bool readBlobAsString(const coral::Blob &, std::string &)
::StatusCode StatusCode
StatusCode definition for legacy code.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::set< ALinePar, std::less<> > ALineContainer
SG::WriteCondHandleKey< ALineContainer > m_writeKey
double atof(std::string_view str)
Converts a string into a double / float.
Gaudi::Property< std::string > m_readFromJSON
Load the alignment parameters from a JSON file.
StatusCode initialize(bool used=true)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
#define ATH_MSG_WARNING(x)
ChanAttrListMap::const_iterator const_iterator
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
virtual StatusCode initialize() override
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey