From 4e9cd012790c6e2e932c4ee897e18675ede45e2d Mon Sep 17 00:00:00 2001 From: Joerg Behr Date: Thu, 15 Aug 2013 10:17:48 +0200 Subject: [PATCH] bug fix: configured run range dependence was ignored in TkModuleGroupSelector. everything was associated to the first IOV. --- .../src/TkModuleGroupSelector.cc | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Alignment/CommonAlignmentAlgorithm/src/TkModuleGroupSelector.cc b/Alignment/CommonAlignmentAlgorithm/src/TkModuleGroupSelector.cc index b7b39c58c1b57..470a403526eb5 100644 --- a/Alignment/CommonAlignmentAlgorithm/src/TkModuleGroupSelector.cc +++ b/Alignment/CommonAlignmentAlgorithm/src/TkModuleGroupSelector.cc @@ -3,8 +3,8 @@ * * \author Joerg Behr * \date May 2013 - * $Revision: 1.4 $ - * $Date: 2013/05/31 14:50:52 $ + * $Revision: 1.5 $ + * $Date: 2013/06/19 08:33:03 $ * (last update by $Author: jbehr $) */ @@ -270,17 +270,20 @@ int TkModuleGroupSelector::getParameterIndexFromDetId(unsigned int detId, const std::vector &runs = runRange_.at(iAlignableGroup); const unsigned int id0 = firstId_.at(iAlignableGroup); const edm::RunNumber_t refrun = referenceRun_.at(iAlignableGroup); - // assuming runs is never empty (checked in createModuleGroups(..)) - if (runs[0] > run) { - throw cms::Exception("BadConfig") - << "@SUB=TkModuleGroupSelector::getParameterIndexFromDetId:\n" - << "Run " << run << " not foreseen for detid ('"<< detId <<"')" - << " in module group " << iAlignableGroup << "."; - } + + unsigned int iovNum = 0; for ( ; iovNum < runs.size(); ++iovNum) { - if (run >= runs[iovNum]) break; + if (runs[iovNum] > run) break; } + if (iovNum == 0) { + throw cms::Exception("BadConfig") << "@SUB=TkModuleGroupSelector::getParameterIndexFromDetId:\n" + << "Run " << run << " not foreseen for detid '"<< detId <<"'" + << " in module group " << iAlignableGroup << "."; + } else { + --iovNum; + } + //test whether the iov contains the reference run if(refrun > 0) { //if > 0 a reference run number has been provided if(iovNum+1 == runs.size()) {