 |
ATLAS Offline Software
|
Go to the documentation of this file.
37 const auto *parentAlg =
dynamic_cast< const INamedInterface*
>(
parent());
46 incidentSvc->addListener(
this,
"EndInputFile", 40);
49 ATH_MSG_DEBUG(
"Creating new xAOD::FileMetaData object to fill");
50 m_info = std::make_unique< xAOD::FileMetaData >();
51 m_aux = std::make_unique< xAOD::FileMetaDataAuxInfo >();
59 return StatusCode::SUCCESS;
65 if (inc.type() ==
"EndInputFile") {
69 ATH_MSG_DEBUG(
"Failed to fill FileMetaData with non-event info");
75 return StatusCode::SUCCESS;
80 return StatusCode::SUCCESS;
85 return StatusCode::SUCCESS;
93 ATH_MSG_DEBUG(
"Not writing empty or incomplete FileMetaData object");
94 return StatusCode::SUCCESS;
101 auto info = std::make_unique<xAOD::FileMetaData>();
102 auto aux = std::make_unique<xAOD::FileMetaDataAuxInfo>();
103 info->setStore(aux.get());
111 float orig_mcProcID = -1;
112 std::vector<uint32_t> orig_runNumbers, orig_lumiBlocks;
115 if (!output->value(
"runNumbers", orig_runNumbers))
117 if (!output->value(
"lumiBlocks", orig_lumiBlocks))
122 ATH_MSG_DEBUG(
"FileMetaData payload replaced in store with content created for this stream");
125 ATH_MSG_DEBUG(
"Event information was not filled, restoring what we had");
128 if (!output->setValue(
"runNumbers", orig_runNumbers))
130 if (!output->setValue(
"lumiBlocks", orig_lumiBlocks))
138 return StatusCode::SUCCESS;
143 return StatusCode::SUCCESS;
153 ATH_MSG_DEBUG(
"Failed to fill FileMetaData with non-event info");
158 return StatusCode::SUCCESS;
170 if (eventInfo &&
sc.isSuccess()) {
194 <<
", runNumbers, or lumiBlockNumbers");
200 return StatusCode::SUCCESS;
212 return StatusCode::SUCCESS;
235 }
catch (std::invalid_argument&
e) {
237 }
catch (std::out_of_range&
e) {
241 std::string dataYear =
m_tagInfoMgr->findTag(
"data_year");
242 if (!dataYear.empty()) {
245 static_cast<uint32_t>(std::stoul(dataYear)));
246 }
catch (std::invalid_argument&
e) {
247 ATH_MSG_DEBUG(
"data year \"" << dataYear <<
"\" tag could not be converted to unsigned long");
248 }
catch (std::out_of_range&
e) {
249 ATH_MSG_DEBUG(
"converted data year value (\"" << dataYear <<
"\") outside unsigned long range");
262 if (simInfo &&
sc.isSuccess()) {
264 for (
const auto& itr : *
payload) {
265 attrList = &(itr.second);
270 bool simFlavourSet{};
271 bool isDataOverlaySet{};
274 std::string
key =
"SimulationFlavour";
275 if (attrList->exists(
key)) {
276 std::string
value = (*attrList)[
key].data< std::string >();
279 if (
value ==
"default")
283 simFlavourSet =
true;
288 std::string
key =
"IsDataOverlay";
289 if (attrList->exists(
key)) {
290 std::string attr = (*attrList)[
key].data< std::string >();
292 isDataOverlaySet =
true;
297 if (!simFlavourSet || !isDataOverlaySet) {
302 <<
". Trying to get them from input metadata store." );
308 if (!simFlavourSet) {
309 std::string orig_simFlavour =
"none";
312 "Could not get xAOD::FileMetaData::simFlavour "
313 "from input metadata "
323 if (!isDataOverlaySet) {
324 bool orig_isDataOverlay =
false;
328 "xAOD::FileMetaData::isDataOverlay from input "
333 << orig_isDataOverlay);
359 return StatusCode::SUCCESS;
371 << std::noboolalpha);
411 const std::string&
value) {
412 if (
value.empty())
return;
427 std::vector<uint32_t>
list;
434 std::sort(
list.begin(),
list.end());
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
This class is a collection of AttributeLists where each one is associated with a channel number....
uint32_t runNumber() const
The current event's run number.
uint32_t mcChannelNumber() const
The MC generator's channel number.
Handle class for recording to StoreGate.
::StatusCode StatusCode
StatusCode definition for legacy code.
uint32_t lumiBlock() const
The current event's luminosity block number.
Class describing the basic event information.
#define ATH_MSG_WARNING(x)
Handle class for reading from StoreGate.