Skip to content
Snippets Groups Projects
Commit 447f6676 authored by Tamara Vazquez Schroeder's avatar Tamara Vazquez Schroeder Committed by Atlas Nightlybuild
Browse files

Merge branch 'FixHepMCWeightSvc-21.0' into '21.0'

Attempted fix for ATLASSIM-3482: If there is only one attributeList, then just…

See merge request !6163

Former-commit-id: a705c7fb
parent dead11b5
No related branches found
No related tags found
8 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!28528Revert 63f845ae,!27054Atr20369 210,!26342Monopole: Handle fractionally charged particles
File mode changed from 100755 to 100644
...@@ -75,15 +75,23 @@ StatusCode HepMCWeightSvc::loadWeights() { ...@@ -75,15 +75,23 @@ StatusCode HepMCWeightSvc::loadWeights() {
//only look a the first one, assuming it exists, and within that only look at the first channel; //only look a the first one, assuming it exists, and within that only look at the first channel;
if(! (cont->payloadContainer()->size()>0 && cont->payloadContainer()->at(0)->size()>0) ) return StatusCode::FAILURE; if(! (cont->payloadContainer()->size()>0 && cont->payloadContainer()->at(0)->size()>0) ) return StatusCode::FAILURE;
//need to retrieve the EventStreamInfo to get at the channel number
const EventStreamInfo* esi = 0; int chanNum(0);
CHECK( inputMetaStore->retrieve(esi) ); //if there is only one collection of weights, then we just load that one
if(esi->getEventTypes().size() == 0) return StatusCode::FAILURE; if(cont->payloadContainer()->at(0)->size()==1) {
int chanNum = esi->getEventTypes().begin()->mc_channel_number(); chanNum = cont->payloadContainer()->at(0)->chanNum(0);
if(chanNum==0) { } else {
//perhaps channel number not set yet, use the first run number instead ATH_MSG_DEBUG("Multiple /Generation/Parameters attributeLists found ... using EventStreamInfo to determine which to use");
if(esi->getRunNumbers().size()==0) return StatusCode::FAILURE; //need to retrieve the EventStreamInfo to get at the channel number
chanNum = *esi->getRunNumbers().begin(); const EventStreamInfo* esi = 0;
CHECK( inputMetaStore->retrieve(esi) );
if(esi->getEventTypes().size() == 0) return StatusCode::FAILURE;
chanNum = esi->getEventTypes().begin()->mc_channel_number();
if(chanNum==0) {
//perhaps channel number not set yet, use the first run number instead
if(esi->getRunNumbers().size()==0) return StatusCode::FAILURE;
chanNum = *esi->getRunNumbers().begin();
}
} }
const coral::Attribute& attr = cont->payloadContainer()->at(0)->attributeList(chanNum)["HepMCWeightNames"]; const coral::Attribute& attr = cont->payloadContainer()->at(0)->attributeList(chanNum)["HepMCWeightNames"];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment