Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include <CoralBase/Blob.h>
23 std::stringstream folderStr{};
25 folderStr<<
" **** "<<
key.fullKey()<<std::endl;
27 ATH_MSG_INFO(
"Read the parametrized NSW uncertainties from COOL: "<<std::endl<<folderStr.str());
29 ATH_MSG_FATAL(
"Neither an extrenal JSON nor a COOL folder were defined. Please check");
30 return StatusCode::FAILURE;
34 return StatusCode::SUCCESS;
40 if (writeHandle.isValid()) {
41 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid."
42 <<
". In theory this should not be called, but may happen"
43 <<
" if multiple concurrent events are being processed out of order.");
44 return StatusCode::SUCCESS;
47 std::unique_ptr<NswErrorCalibData> writeCdo = std::make_unique<NswErrorCalibData>(
m_idHelperSvc.get());
52 if (!inStream.good()) {
54 return StatusCode::FAILURE;
62 if (!readHandle.isValid()) {
63 ATH_MSG_FATAL(
"Failed to load NSW error calibration folder from "<<
key.fullKey());
64 return StatusCode::FAILURE;
67 itr != readHandle->end(); ++itr) {
74 return StatusCode::FAILURE;
77 data = *(
static_cast<const std::string*
>((atr[
"data"]).addressOfData()));
84 ATH_CHECK(writeHandle.record(std::move(writeCdo)));
85 return StatusCode::SUCCESS;
91 for (
auto& corr :
lines.items()) {
94 const std::string stationType =
line[
"station"];
97 const int multilayer =
line[
"multilayer"];
101 if (stationType[0] ==
'M') {
109 }
else if (stationType[0] ==
'S') {
113 sTgcIdHelper::sTgcChannelTypes::Strip, 1
125 <<multilayer<<
", "<<
gasGap);
126 return StatusCode::FAILURE;
132 const std::string modelName =
line[
"modelName"];
133 std::vector<double> modelPars =
line[
"modelPars"];
136 <<
"model name: "<<modelName<<
" author: "<<
static_cast<int>(
author));
145 return StatusCode::SUCCESS;
char data[hepevt_bytes_allocation_ATLAS]
constexpr uint8_t stationPhi
station Phi 1 to 8
virtual StatusCode execute(const EventContext &) const override
Helper struct to store different error calibrations for a certain channel range & also for seperate C...
SG::WriteCondHandleKey< NswErrorCalibData > m_writeKey
#define ATH_MSG_VERBOSE(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
An algorithm that can be simultaneously executed in multiple threads.
StatusCode parseDataFromJSON(const nlohmann::json &lines, NswErrorCalibData &errorCalibData) const
Load the Jitter constants from the JSON format.
bool readBlobAsString(const coral::Blob &, std::string &)
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadCondHandleKeyArray< CondAttrListCollection > m_readKeysDb
AthROOTErrorHandlerSvc * svc
StatusCode storeConstants(const Identifier &gasGapId, ErrorConstants &&newConstants)
StatusCode initialize(bool used=true)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
ChanAttrListMap::const_iterator const_iterator
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
NswUncertDbAlg(const std::string &name, ISvcLocator *svc)
Gaudi::Property< std::string > m_readFromJSON
Use an external JSON file to load the Jitter constants from.
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
constexpr uint8_t stationEta
1 to 3
virtual StatusCode initialize() override