diff --git a/Calorimeter/CaloExample/CaloHiveEx/share/CaloHiveDeps.py b/Calorimeter/CaloExample/CaloHiveEx/share/CaloHiveDeps.py index 4d3c79afa13f9aa63004dd0edbace3cdda521ef3..05a4a3e7054af1716e72a054ba7f75b9530796e1 100644 --- a/Calorimeter/CaloExample/CaloHiveEx/share/CaloHiveDeps.py +++ b/Calorimeter/CaloExample/CaloHiveEx/share/CaloHiveDeps.py @@ -8,58 +8,58 @@ # ### These should be moved to the jobOpts of the individual packages. -xAODMaker__EventInfoCnvAlg.ExtraInputs = [('EventInfo','McEventInfo')] -xAODMaker__EventInfoCnvAlg.ExtraOutputs = [('xAOD::EventAuxInfo','EventInfoAux.'), - ('xAOD::EventInfo','EventInfo') ] +xAODMaker__EventInfoCnvAlg.ExtraInputs = [('EventInfo','StoreGateSvc+McEventInfo')] +xAODMaker__EventInfoCnvAlg.ExtraOutputs = [('xAOD::EventAuxInfo','StoreGateSvc+EventInfoAux.'), + ('xAOD::EventInfo','StoreGateSvc+EventInfo') ] -topSequence.CaloCellMaker.ExtraInputs = [('EventInfo','McEventInfo'), - ('LArRawChannelContainer','LArRawChannels'), - ('TileRawChannelContainer','TileRawChannelCnt')] -topSequence.CaloCellMaker.ExtraOutputs = [('CaloCellContainer','AllCalo'), - ('TileCellContainer','MBTSContainer')] +topSequence.CaloCellMaker.ExtraInputs = [('EventInfo','StoreGateSvc+McEventInfo'), + ('LArRawChannelContainer','StoreGateSvc+LArRawChannels'), + ('TileRawChannelContainer','StoreGateSvc+TileRawChannelCnt')] +topSequence.CaloCellMaker.ExtraOutputs = [('CaloCellContainer','StoreGateSvc+AllCalo'), + ('TileCellContainer','StoreGateSvc+MBTSContainer')] -topSequence.CmbTowerBldr.ExtraInputs = [('CaloCellContainer','AllCalo')] -topSequence.CmbTowerBldr.ExtraOutputs = [('CaloTowerContainer','CombinedTower')] +topSequence.CmbTowerBldr.ExtraInputs = [('CaloCellContainer','StoreGateSvc+AllCalo')] +topSequence.CmbTowerBldr.ExtraOutputs = [('CaloTowerContainer','StoreGateSvc+CombinedTower')] -topSequence.CaloClusterMakerSWCmb.ExtraInputs = [('CaloTowerContainer','CombinedTower')] -topSequence.CaloClusterMakerSWCmb.ExtraOutputs = [('xAOD::CaloClusterContainer','CombinedCluster'), - ('xAOD::CaloClusterAuxContainer','CombinedClusterAux.'), - ('CaloClusterCellLinkContainer','CombinedCluster_links')] +topSequence.CaloClusterMakerSWCmb.ExtraInputs = [('CaloTowerContainer','StoreGateSvc+CombinedTower')] +topSequence.CaloClusterMakerSWCmb.ExtraOutputs = [('xAOD::CaloClusterContainer','StoreGateSvc+CombinedCluster'), + ('xAOD::CaloClusterAuxContainer','StoreGateSvc+CombinedClusterAux.'), + ('CaloClusterCellLinkContainer','StoreGateSvc+CombinedCluster_links')] -topSequence.CaloTopoCluster.ExtraInputs = [('CaloCalibrationHitContainer','LArCalibrationHitActive'), - ('CaloCalibrationHitContainer','LArCalibrationHitDeadMaterial'), - ('CaloCalibrationHitContainer','LArCalibrationHitInactive'), - ('CaloCellContainer','AllCalo')] -topSequence.CaloTopoCluster.ExtraOutputs = [('xAOD::CaloClusterContainer','CaloCalTopoClusters'), - ('xAOD::CaloClusterAuxContainer','CaloCalTopoClustersAux.'), - ('xAOD::CaloClusterContainer','CaloTopoCluster'), - ('xAOD::CaloClusterAuxContainer','CaloTopoClusterAux.'), - ('CaloClusterCellLinkContainer','CaloTopoCluster_links'), - ('CaloClusterCellLinkContainer','CaloCalTopoClusters_links')] +topSequence.CaloTopoCluster.ExtraInputs = [('CaloCalibrationHitContainer','StoreGateSvc+LArCalibrationHitActive'), + ('CaloCalibrationHitContainer','StoreGateSvc+LArCalibrationHitDeadMaterial'), + ('CaloCalibrationHitContainer','StoreGateSvc+LArCalibrationHitInactive'), + ('CaloCellContainer','StoreGateSvc+AllCalo')] +topSequence.CaloTopoCluster.ExtraOutputs = [('xAOD::CaloClusterContainer','StoreGateSvc+CaloCalTopoClusters'), + ('xAOD::CaloClusterAuxContainer','StoreGateSvc+CaloCalTopoClustersAux.'), + ('xAOD::CaloClusterContainer','StoreGateSvc+CaloTopoCluster'), + ('xAOD::CaloClusterAuxContainer','StoreGateSvc+CaloTopoClusterAux.'), + ('CaloClusterCellLinkContainer','StoreGateSvc+CaloTopoCluster_links'), + ('CaloClusterCellLinkContainer','StoreGateSvc+CaloCalTopoClusters_links')] -StreamESD.ExtraInputs = [('CaloCellContainer','AllCalo'), - ('CaloTowerContainer','CombinedTower'), - ('xAOD::CaloClusterContainer','CombinedCluster'), - ('xAOD::CaloClusterContainer','CaloTopoCluster')] +StreamESD.ExtraInputs = [('CaloCellContainer','StoreGateSvc+AllCalo'), + ('CaloTowerContainer','StoreGateSvc+CombinedTower'), + ('xAOD::CaloClusterContainer','StoreGateSvc+CombinedCluster'), + ('xAOD::CaloClusterContainer','StoreGateSvc+CaloTopoCluster')] # # no different calorimeter clusters yet # if useJets: -# topSequence.jetalg4.ExtraInputs = [('xAOD::CaloClusterContainer','CaloTopoCluster')] +# topSequence.jetalg4.ExtraInputs = [('xAOD::CaloClusterContainer','StoreGateSvc+CaloTopoCluster')] # for x in range(0, nJets): # app=str((0.5+x)/10) # app=app.replace('.', 'p') # # because of ParticleJetMap mess -# # algDep["jetalg"+app] = [('xAOD::CaloClusterContainer','CaloTopoCluster')] -# topSequence.getattr("jetalg"+app).ExtraInputs = [('xAOD::JetContainer','AntiKt4EMTopoJets')] -# StreamESD.ExtraInputs += [('xAOD::JetContainer','AntiKt4EMTopoJets')] +# # algDep["jetalg"+app] = [('xAOD::CaloClusterContainer','StoreGateSvc+CaloTopoCluster')] +# topSequence.getattr("jetalg"+app).ExtraInputs = [('xAOD::JetContainer','StoreGateSvc+AntiKt4EMTopoJets')] +# StreamESD.ExtraInputs += [('xAOD::JetContainer','StoreGateSvc+AntiKt4EMTopoJets')] # for x in range(0, nJets): # app=str((0.5+x)/10) # app=app.replace('.', 'p') diff --git a/Control/IOVSvc/src/CondInputLoader.cxx b/Control/IOVSvc/src/CondInputLoader.cxx index 7788811f130ab991b3b0b4963f334c193632c423..f6c11ee564b46fa8a406a4eb6a067ddb93e02e61 100644 --- a/Control/IOVSvc/src/CondInputLoader.cxx +++ b/Control/IOVSvc/src/CondInputLoader.cxx @@ -113,7 +113,9 @@ CondInputLoader::initialize() // } else { // ATH_MSG_DEBUG(" not remapping folder " << id.key()); } - loadCopy.insert(id); + SG::VarHandleKey vhk(id.clid(),id.key(),Gaudi::DataHandle::Writer, + StoreID::storeName(StoreID::CONDITION_STORE)); + loadCopy.emplace(vhk.fullKey()); } // for (auto key : keys) { @@ -153,12 +155,14 @@ CondInputLoader::initialize() sc = StatusCode::FAILURE; str << " ERROR: empty key is not allowed!"; } else { - Gaudi::DataHandle dh(e, Gaudi::DataHandle::Writer, this); - if (m_condSvc->regHandle(this, dh, e.key()).isFailure()) { - ATH_MSG_ERROR("Unable to register WriteCondHandle " << dh.fullKey()); + SG::VarHandleKey vhk(e.clid(),e.key(),Gaudi::DataHandle::Writer, + StoreID::storeName(StoreID::CONDITION_STORE)); + if (m_condSvc->regHandle(this, vhk, e.key()).isFailure()) { + ATH_MSG_ERROR("Unable to register WriteCondHandle " << vhk.fullKey()); sc = StatusCode::FAILURE; } - m_IOVSvc->ignoreProxy(dh.fullKey().clid(), e.key()); + ATH_MSG_DEBUG("Ignoring proxy: " << vhk.key()); + m_IOVSvc->ignoreProxy(vhk.fullKey().clid(), vhk.key()); } } @@ -186,16 +190,15 @@ CondInputLoader::execute() if (m_first) { DataObjIDColl::iterator itr; - for (itr = m_load.begin(); itr != m_load.end(); ) { - // if ( ! m_condStore->contains(itr->clid(), itr->key() ) ){ - if ( ! m_condStore->contains<CondContBase>( itr->key() ) ){ + for (itr = m_load.begin(); itr != m_load.end(); ++itr) { + SG::VarHandleKey vhk(itr->clid(),itr->key(),Gaudi::DataHandle::Reader); + if ( ! m_condStore->contains<CondContBase>( vhk.key() ) ){ ATH_MSG_INFO("ConditionStore does not contain a CondCont<> of " - << *itr + << *itr << " (key: " << vhk.key() << ") " << ". Either a ReadCondHandle was not initialized or " << "no other Algorithm is using this Handle"); - itr = m_load.erase(itr); } else { - ++itr; + m_vhk.push_back(vhk); } } m_first = false; @@ -244,45 +247,43 @@ CondInputLoader::execute() IOVTime t(now.run_number(), now.event_number(), now.time_stamp()); + StatusCode sc(StatusCode::SUCCESS); EventIDRange r; std::string tag; - // for (auto &obj: extraOutputDeps()) { - for (auto &obj: m_load) { - - ATH_MSG_DEBUG( "handling id: " << obj ); + for (auto &vhk: m_vhk) { + ATH_MSG_DEBUG( "handling id: " << vhk.fullKey() << " key: " << vhk.key() ); CondContBase* ccb(0); - if (! m_condStore->retrieve(ccb, obj.key()).isSuccess()) { - ATH_MSG_ERROR( "unable to get CondContBase* for " << obj + if (! m_condStore->retrieve(ccb, vhk.key()).isSuccess()) { + ATH_MSG_ERROR( "unable to get CondContBase* for " << vhk.fullKey() << " from ConditionStore" ); + sc = StatusCode::FAILURE; continue; } - if (ccb->valid(now)) { - ATH_MSG_INFO( " CondObj " << obj << " is still valid at " << now ); - evtStore()->addedNewTransObject(obj.clid(), obj.key()); + ATH_MSG_INFO( " CondObj " << vhk.fullKey() << " is still valid at " << now ); + evtStore()->addedNewTransObject(vhk.fullKey().clid(), vhk.key()); continue; } - - std::string dbKey = m_keyFolderMap[obj.key()]; - if (m_IOVSvc->createCondObj( ccb, obj, now ).isFailure()) { - ATH_MSG_ERROR("unable to create Cond object for " << obj << " dbKey: " + std::string dbKey = m_keyFolderMap[vhk.key()]; + if (m_IOVSvc->createCondObj( ccb, vhk.fullKey(), now ).isFailure()) { + ATH_MSG_ERROR("unable to create Cond object for " << vhk.fullKey() << " dbKey: " << dbKey); - return StatusCode::FAILURE; + sc = StatusCode::FAILURE; + continue; } else { - evtStore()->addedNewTransObject(obj.clid(), obj.key()); + evtStore()->addedNewTransObject(vhk.fullKey().clid(), vhk.key()); } } if (m_dump) { - ATH_MSG_DEBUG(evtStore()->dump()); + ATH_MSG_DEBUG(m_condStore->dump()); } - - return StatusCode::SUCCESS; + return sc; } //----------------------------------------------------------------------------- diff --git a/Control/IOVSvc/src/CondInputLoader.h b/Control/IOVSvc/src/CondInputLoader.h index b66b57a482f2c8649a46994333fa706cbe08f60c..f4e8b8f574e77f7710f62a67c1f5fa2ae216bb71 100644 --- a/Control/IOVSvc/src/CondInputLoader.h +++ b/Control/IOVSvc/src/CondInputLoader.h @@ -73,6 +73,7 @@ class CondInputLoader /// Containers DataObjIDColl m_load; + std::vector< SG::VarHandleKey > m_vhk; bool m_dump; bool m_first { true }; diff --git a/Control/IOVSvc/src/IOVSvc.cxx b/Control/IOVSvc/src/IOVSvc.cxx index 7ba6821ff3625ed7503a98cf7b25e1c72f8d09b3..fa611940d6a6475d39607df9161e81614219ebed 100755 --- a/Control/IOVSvc/src/IOVSvc.cxx +++ b/Control/IOVSvc/src/IOVSvc.cxx @@ -857,10 +857,16 @@ IOVSvc::createCondObj(CondContBase* ccb, const DataObjID& id, IOVRange range; IOpaqueAddress* ioa; std::string tag; + // remove storename from key + std::string sgKey = id.key(); + auto sep = sgKey.find("+"); + if (sep != std::string::npos) { + sgKey.erase(0,sep+1); + } - if (getRangeFromDB(id.clid(), id.key(), t, range, tag, ioa).isFailure()) { + if (getRangeFromDB(id.clid(), sgKey, t, range, tag, ioa).isFailure()) { ATH_MSG_ERROR( "unable to get range from db for " - << id.clid() << " " << id.key() ); + << id.clid() << " " << sgKey ); return StatusCode::FAILURE; } @@ -872,7 +878,7 @@ IOVSvc::createCondObj(CondContBase* ccb, const DataObjID& id, SG::DataProxy* dp(0); SG::DataStore* ds = p_detStore->store(); - dp = p_pps->retrieveProxy(id.clid(), id.key(), *ds); + dp = p_pps->retrieveProxy(id.clid(), sgKey, *ds); if (dp == 0) { ATH_MSG_ERROR ( "Could not get DataProxy from ProxyProviderSvc for " << id );