diff --git a/Control/AthenaBaseComps/src/AthFilterAlgorithm.cxx b/Control/AthenaBaseComps/src/AthFilterAlgorithm.cxx index 312403758b8c425afc32218dd3177a14ed3f8cb9..7b3bc0f84bddb92f7451ce03c927d6b98775ad7e 100644 --- a/Control/AthenaBaseComps/src/AthFilterAlgorithm.cxx +++ b/Control/AthenaBaseComps/src/AthFilterAlgorithm.cxx @@ -28,7 +28,7 @@ AthFilterAlgorithm::AthFilterAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) : ::AthAlgorithm( name, pSvcLocator ), m_cutID ( 0 ), - m_cutFlowSvc("CutFlowSvc/CutFlowSvc", name) + m_cutFlowSvc("FileCutFlowSvc/FileCutFlowSvc", name) { // // Property declaration diff --git a/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx b/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx index bdd681cc347fb1d1bd1a0740aa2eb28d14c78f14..61fda39f63e9b24e66e5df0026f2af25fabc1511 100644 --- a/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx +++ b/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx @@ -186,6 +186,9 @@ StatusCode BookkeeperTool::endInputFile() ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpCompleteBookAux)); } } + else { + ATH_MSG_INFO("Found no tmp collection in output store " << outputMetaStore()->dump()); + } if (!m_cutflowTaken) { if (addCutFlow().isFailure()) { @@ -255,145 +258,6 @@ BookkeeperTool::finalize() return StatusCode::SUCCESS; } -/* -StatusCode -BookkeeperTool::updateContainer( xAOD::CutBookkeeperContainer* contToUpdate, - const xAOD::CutBookkeeperContainer* otherCont ) { - ATH_MSG_DEBUG("calling updateContainer(...)" ); - ATH_MSG_DEBUG("Have container to update with size=" << contToUpdate->size() - << ", and other container with size=" << otherCont->size() ); - - // Create an vector of indices of all the newly transferred CutBookkeepers - std::vector< std::size_t > newEBKIndices; - // Loop through otherCont. - // If element already in contToUpdate, update event counts, otherwise create new element - for ( std::size_t i=0; i<otherCont->size(); ++i ) { - const xAOD::CutBookkeeper* otherEBK = otherCont->at(i); - ATH_MSG_VERBOSE("Looping through otherCont at index " << i); - ATH_MSG_VERBOSE("Have otherEBK with: name=" << otherEBK->name() - << ", cycle=" << otherEBK->cycle() - << ", nAcceptedEvents=" << otherEBK->nAcceptedEvents() - << ", inputStream=" << otherEBK->inputStream() ); - - - // Loop through the container to be updated (contToUpdate) and see if we find a match - bool foundEBKToUpdate(false); - for ( std::size_t j=0; j<contToUpdate->size(); ++j ) { - xAOD::CutBookkeeper* ebkToUpdate = contToUpdate->at(j); - // Check if they are identical, if so, update; else add otherEBK - if ( otherEBK->isEqualTo(ebkToUpdate) ) { - ebkToUpdate->setPayload( ebkToUpdate->payload() + otherEBK->payload() ); - foundEBKToUpdate = true; - break; - } - } // End: Inner loop over contToUpdate - if (!foundEBKToUpdate) { - xAOD::CutBookkeeper* newEBK = new xAOD::CutBookkeeper(); - if ( newEBK->usingPrivateStore() ) { newEBK->releasePrivateStore(); } - newEBK->makePrivateStore(otherEBK); - contToUpdate->push_back( newEBK ); - std::size_t ebIdx = newEBK->index(); - newEBKIndices.push_back(ebIdx); - } - } // End: Outer loop over contToUpdate - - // Now, we still need to fix the cross-referencing of the newly added CutBookkkeepers - for ( std::size_t i=0; i<newEBKIndices.size(); ++i ) { - std::size_t otherIndex = newEBKIndices.at(i); - xAOD::CutBookkeeper* ebkToModify = contToUpdate->at(otherIndex); - - // Parent check - if ( ebkToModify->hasParent() ) { - const xAOD::CutBookkeeper* oldParent = ebkToModify->parent(); - xAOD::CutBookkeeperContainer::iterator matchIter = std::find( contToUpdate->begin(), - contToUpdate->end(), - oldParent ); - // If we found it, we can modify - if ( matchIter != contToUpdate->end() ) { - ATH_MSG_VERBOSE("Updating ElementLink to parent"); - ebkToModify->setParent( *matchIter ); - } - // If we didn't find it, we need to add it - else { - ATH_MSG_VERBOSE("Adding new parent"); - xAOD::CutBookkeeper* newEBK = new xAOD::CutBookkeeper(); - if ( newEBK->usingPrivateStore() ) { newEBK->releasePrivateStore(); } - newEBK->makePrivateStore(oldParent); - contToUpdate->push_back( newEBK ); - ebkToModify->setParent( newEBK ); - } - } // Done fixing parent - - // Children check - for ( std::size_t oldIdx=0; oldIdx<ebkToModify->nChildren(); ++oldIdx ) { - const xAOD::CutBookkeeper* oldEBK = ebkToModify->child(oldIdx); - xAOD::CutBookkeeperContainer::iterator matchIter = std::find( contToUpdate->begin(), - contToUpdate->end(), - oldEBK ); - // If we found it, we can modify - if ( matchIter != contToUpdate->end() ) { - ATH_MSG_VERBOSE("Updating ElementLink to child"); - ebkToModify->addChild( *matchIter ); - } - // If we didn't find it, we need to add it - else { - ATH_MSG_VERBOSE("Adding new child"); - xAOD::CutBookkeeper* newEBK = new xAOD::CutBookkeeper(); - if ( newEBK->usingPrivateStore() ) { newEBK->releasePrivateStore(); } - newEBK->makePrivateStore(oldEBK); - contToUpdate->push_back( newEBK ); - ebkToModify->addChild( newEBK ); - } - } // Done fixing children - - // Used others check - for ( std::size_t oldIdx=0; oldIdx<ebkToModify->nUsedOthers(); ++oldIdx ) { - const xAOD::CutBookkeeper* oldEBK = ebkToModify->usedOther(oldIdx); - xAOD::CutBookkeeperContainer::iterator matchIter = std::find( contToUpdate->begin(), - contToUpdate->end(), - oldEBK ); - // If we found it, we can modify - if ( matchIter != contToUpdate->end() ) { - ATH_MSG_VERBOSE("Updating ElementLink to usedOther"); - ebkToModify->addUsedOther( *matchIter ); - } - // If we didn't find it, we need to add it - else { - ATH_MSG_VERBOSE("Adding new usedOther"); - xAOD::CutBookkeeper* newEBK = new xAOD::CutBookkeeper(); - if ( newEBK->usingPrivateStore() ) { newEBK->releasePrivateStore(); } - newEBK->makePrivateStore(oldEBK); - contToUpdate->push_back( newEBK ); - ebkToModify->addUsedOther( newEBK ); - } - } // Done fixing used others - - // Siblings check - for ( std::size_t oldIdx=0; oldIdx<ebkToModify->nSiblings(); ++oldIdx ) { - const xAOD::CutBookkeeper* oldEBK = ebkToModify->sibling(oldIdx); - xAOD::CutBookkeeperContainer::iterator matchIter = std::find( contToUpdate->begin(), - contToUpdate->end(), - oldEBK ); - // If we found it, we can modify - if ( matchIter != contToUpdate->end() ) { - ATH_MSG_VERBOSE("Updating ElementLink to sibling"); - ebkToModify->addSibling( *matchIter ); - } - // If we didn't find it, we need to add it - else { - ATH_MSG_VERBOSE("Adding new sibling"); - xAOD::CutBookkeeper* newEBK = new xAOD::CutBookkeeper(); - if ( newEBK->usingPrivateStore() ) { newEBK->releasePrivateStore(); } - newEBK->makePrivateStore(oldEBK); - contToUpdate->push_back( newEBK ); - ebkToModify->addSibling( newEBK ); - } - } // Done fixing siblings - } // Done fixing all cross references - return StatusCode::SUCCESS; -} -*/ - StatusCode BookkeeperTool::addCutFlow() { @@ -417,6 +281,9 @@ StatusCode BookkeeperTool::addCutFlow() ATH_CHECK(this->updateContainer(completeBook,fileCompleteBook)); } } + else { + ATH_MSG_INFO("No cutflow container " << m_cutflowCollName); + } return StatusCode::SUCCESS; } diff --git a/Event/EventBookkeeperTools/python/CutFlowHelpers.py b/Event/EventBookkeeperTools/python/CutFlowHelpers.py index 7755a5a6bc71e0bd72bb8c8506c623166f03ccb6..af1d33cc527cd294c9595e7654a10e6f00d100e0 100644 --- a/Event/EventBookkeeperTools/python/CutFlowHelpers.py +++ b/Event/EventBookkeeperTools/python/CutFlowHelpers.py @@ -63,8 +63,8 @@ def CreateCutFlowSvc( svcName="CutFlowSvc", athFile=None, seq=None, addAlgInPlac import AthenaCommon.CfgMgr as CfgMgr if not hasattr(svcMgr,"CutFlowSvc"): svcMgr += CfgMgr.CutFlowSvc() svcMgr.CutFlowSvc.InputStream = inputStreamName - #if not hasattr(svcMgr,"FileCutFlowSvc"): svcMgr += CfgMgr.FileCutFlowSvc() - #svcMgr.FileCutFlowSvc.InputStream = inputStreamName + if not hasattr(svcMgr,"FileCutFlowSvc"): svcMgr += CfgMgr.FileCutFlowSvc() + svcMgr.FileCutFlowSvc.InputStream = inputStreamName # Make sure MetaDataSvc is ready if not hasattr(svcMgr,'MetaDataSvc'): @@ -75,7 +75,7 @@ def CreateCutFlowSvc( svcName="CutFlowSvc", athFile=None, seq=None, addAlgInPlac from EventBookkeeperTools.EventBookkeeperToolsConf import BookkeeperTool # Standard event bookkeepers - inname = "CutBookkeepers" + inname = "FileBookkeepers" outname = "FileBookkeepers" cutflowtool = BookkeeperTool(outname, InputCollName = inname, diff --git a/Event/EventBookkeeperTools/src/FileCutFlowSvc.cxx b/Event/EventBookkeeperTools/src/FileCutFlowSvc.cxx index 2ae79d1e48848eb6ad39a90fe8cf556f97f3c671..806c2575eb83760899899c3c0c41e556f493e934 100644 --- a/Event/EventBookkeeperTools/src/FileCutFlowSvc.cxx +++ b/Event/EventBookkeeperTools/src/FileCutFlowSvc.cxx @@ -311,18 +311,6 @@ FileCutFlowSvc::addEvent( CutIdentifier cutID ) double evtWeight=1.0; - const xAOD::EventInfo* evtInfo = 0; - StatusCode sc = m_eventStore->retrieve(evtInfo); - if ( sc.isFailure() || NULL == evtInfo ) { - ATH_MSG_WARNING("Could not retrieve EventInfo from StoreGate "); - evtWeight=-1000.; - } else { - // Only try to access the mcEventWeight is we are running on Monte Carlo, duhhh! - if ( evtInfo->eventType(xAOD::EventInfo::IS_SIMULATION) ) { - evtWeight = evtInfo->mcEventWeight(); - } - } - addEvent(cutID,evtWeight); return;