Explicit call to process IOV meta data from the input meta data store, transferring it to the main meta data store.
Normally, this method is called at the BeginInputFile incident. However, this explicit call allows the transfer to occur during the initialization phase, which occurs before BeginInputFile incident.
595{
596
597 std::scoped_lock guard(
m_mutex );
598
599 ATH_MSG_DEBUG(
"processInputFileMetaData: file name " << fileName);
600
601
602 SG::ConstIterator<IOVMetaDataContainer> cont;
603 SG::ConstIterator<IOVMetaDataContainer> contEnd;
604
606 if (!
sc.isSuccess()) {
607 ATH_MSG_DEBUG(
"processInputFileMetaData: Could not retrieve IOVMetaDataContainer objects from InputMetaDataStore - cannot process input file meta data");
608 return StatusCode::SUCCESS;
609 }
610
611 ATH_MSG_DEBUG(
"processInputFileMetaData: Retrieved from IOVMetaDataContainer(s) from InputMetaDataStore");
612
613
614 unsigned int ncolls = 0;
615 unsigned int ndupColls = 0;
616 for (; cont != contEnd; ++cont) {
618 , cont->folderDescription());
619
620
621
622 std::list<SG::ObjectWithVersion<IOVMetaDataContainer> > allVersions;
624 if (!
sc.isSuccess()) {
627 }
628
629 for (SG::ObjectWithVersion<IOVMetaDataContainer>& obj : allVersions) {
631
632 ATH_MSG_DEBUG(
"processInputFileMetaData: New container: payload size " <<
payload->size() <<
" version key " <<
obj.versionedKey);
633
634
635 if (msgLvl(MSG::VERBOSE)) {
637 ATH_MSG_VERBOSE(
"Before merge, payload minRange for folder " << cont->folderName());
638 if (payloadMaster && payloadMaster->
size()) {
639
642 unsigned int iPayload = 0;
643 for (; itColl != itCollEnd; ++itColl, ++iPayload) {
645 << (*itColl)->size());
646 }
647 }
648 else {
650 }
651 }
652 }
653
654
655 if (msgLvl(MSG::DEBUG)) {
659 std::ostringstream
stream;
660 for (; itColl1 != itCollEnd1; ++itColl1) (*itColl1)->dump(stream);
662 }
663
664
665
666
667 for (SG::ObjectWithVersion<IOVMetaDataContainer>& obj : allVersions) {
671 for (; itColl != itCollEnd; ++itColl) {
672
673
674
675 CondAttrListCollection* coll = new CondAttrListCollection(**itColl);
676
679 }
680
681
683 ATH_MSG_ERROR(
"processInputFileMetaData: Could not modify the payload for folder " << contMaster->
folderName());
684 return StatusCode::FAILURE;
685 }
686
688 if (!contMaster->
merge(coll)) {
689
690 delete coll;
691 ++ndupColls;
693 }
694 else {
695 ++ncolls;
697 }
698
699 }
700 ATH_MSG_DEBUG(
"processInputFileMetaData: Merged together containers for folder " << cont->folderName() <<
" ncoll/ndup "
701 << ncolls << " " << ndupColls);
702
703
705 if (payloadMaster && payloadMaster->
size()) {
706
709 IOVTime lastStop;
710 if ((*itColl)->minRange().start().isTimestamp()) lastStop = IOVTime(0);
711 else lastStop = IOVTime(0,0);
712 bool hasError = false;
713 for (; itColl != itCollEnd; ++itColl) {
714 if ((*itColl)->minRange().start() < lastStop) hasError = true;
715 lastStop = (*itColl)->minRange().stop();
716 }
717 if (hasError) {
718 ATH_MSG_ERROR(
"processInputFileMetaData: error after merge of file meta data. " );
719 ATH_MSG_ERROR(
"processInputFileMetaData: Filename " << fileName);
721 ATH_MSG_ERROR(
"processInputFileMetaData: MinRange for meta data folders ");
722 unsigned int iPayload = 0;
723 itColl = payloadMaster->
begin();
724 for (; itColl != itCollEnd; ++itColl, ++iPayload) {
725 ATH_MSG_ERROR(iPayload <<
" " << (*itColl)->minRange() <<
" " << (*itColl)->size());
726 }
727 }
728 }
729
730
731 if (msgLvl(MSG::VERBOSE)) {
733 ATH_MSG_VERBOSE(
"processInputFileMetaData: After merge, payload minRange ");
734 if (payloadMaster) {
735
738 unsigned int iPayload = 0;
739 for (; itColl != itCollEnd; ++itColl, ++iPayload) {
741 << (*itColl)->size());
742 }
743 }
745 }
746
747
748 if (msgLvl(MSG::DEBUG)) {
749 ATH_MSG_DEBUG(
"processInputFileMetaData: Input payload " << cont->folderName());
750 std::ostringstream streamInp;
753 for (; itColl != itCollEnd; ++itColl) (*itColl)->dump(streamInp);
756 std::ostringstream streamOut;
759 for (; itColl != itCollEnd; ++itColl) (*itColl)->dump(streamOut);
761 }
762 }
763 }
764
765 ATH_MSG_DEBUG(
"processInputFileMetaData: Total number of attribute collections merged together " << ncolls
766 << " Number of duplicate collections " << ndupColls);
767
768
769
770
771
772
773
774
775
776 const EventContext& currentCtx = Gaudi::Hive::currentContext();
777 if (currentCtx.valid()) {
778 constexpr std::array folderNames{"/Digitization/Parameters", "/Simulation/Parameters"};
779 for (std::string_view folderName : folderNames) {
780
781 if (!
m_metaDataStore->contains<IOVMetaDataContainer>(std::string(folderName))) {
782 continue;
783 }
784
785
786
787
788 bool inPayloads = false;
790 if (
key.find(std::string(folderName) +
":") == 0) {
791 inPayloads = true;
792 break;
793 }
794 }
795 if (inPayloads) {
796 ATH_MSG_DEBUG(
"Folder " << folderName <<
" is in Payloads, skipping auto-read from input");
797 continue;
798 }
799
800
801 IOVMetaDataContainer* contMaster = nullptr;
802 if (
m_metaDataStore->retrieve(contMaster, std::string(folderName)).isSuccess() && contMaster) {
804 if (payloadMaster && payloadMaster->
size() > 0) {
805
808 }
809
810
811 if (
m_condStore->contains<CondCont<AthenaAttributeList>>(std::string(folderName))) {
812 ATH_MSG_DEBUG(
"CondCont for " << folderName <<
" already exists, skipping");
813 continue;
814 }
815
816
817 const CondAttrListCollection* coll =
dynamic_cast<const CondAttrListCollection*
>(*(payloadMaster->
begin()));
818 if (coll) {
819
820 CondCont<AthenaAttributeList>*
cc =
nullptr;
821 ServiceHandle<Athena::IRCUSvc> rcuSvc(
"Athena::RCUSvc",
name());
823
827 std::string(folderName));
828 if (!cb) {
829 ATH_MSG_ERROR(
"Failed to create CondCont for " << folderName);
830 return StatusCode::FAILURE;
831 }
832
833 if (
m_condStore->recordObject(cb, std::string(folderName),
true,
false) ==
nullptr) {
834 ATH_MSG_ERROR(
"Failed to record CondCont for " << folderName);
835 return StatusCode::FAILURE;
836 }
837
838
840
841
842 auto itr = coll->
begin();
843 const coral::AttributeList& attrList = itr->second;
844 auto athAttrList = std::make_unique<AthenaAttributeList>(attrList);
845
846
847 IOVRange iovRange = coll->
minRange();
853 EventIDRange
range(start, stop);
854
855
856 ATH_CHECK(
cc->insert(range, std::move(athAttrList), currentCtx));
857
858 ATH_MSG_DEBUG(
"Populated ConditionStore for " << folderName <<
" from file metadata");
859 }
860 }
861 }
862 }
863 }
864
865
867
868 return StatusCode::SUCCESS;
869}
#define ATH_MSG_VERBOSE(x)
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
size_type size() const
size of payload vector
payloadVec::const_iterator const_iterator
const_iterator begin() const
Begin of payload vector.
const_iterator end() const
End of payload vector.
uint32_t event() const noexcept
uint32_t run() const noexcept
const std::string & key() const
Get the key string with which the current object was stored.