예제 #1
0
  def createOverlayApplication( self, energy ):
    """ create Overlay Application """
    from ILCDIRAC.Interfaces.API.NewInterface.Applications import OverlayInput
    overlay = OverlayInput()
    overlay.setMachine( 'clic_opt' )
    overlay.setEnergy( energy )
    overlay.setBackgroundType( self._overlayEventType )
    overlay.setDetectorModel( self.detectorModel )
    try:
      overlayEnergy = energyToInt( self.overlayEvents ) if self.overlayEvents else energy
      self.overlayParameterDict().get( overlayEnergy ) ( overlay )
    except TypeError:
      raise RuntimeError( "No overlay parameters defined for %r GeV and %s " % ( energy, self._overlayEventType ) )

    if self.overlayEvents:
      overlay.setUseEnergyForFileLookup( False )

    return overlay
  def createOverlayApplication( self, energy ):
    """ create Overlay Application """
    from ILCDIRAC.Interfaces.API.NewInterface.Applications import OverlayInput
    overlay = OverlayInput()
    overlay.setEnergy(energy)
    overlay.setBackgroundType(self.overlayEventType)
    overlay.setDetectorModel(self.detectorModel)
    try:
      overlayEnergy = energyToInt( self.overlayEvents ) if self.overlayEvents else energy
      self.setOverlayParameters(overlayEnergy, self._machine, overlay)
    except KeyError:
      raise RuntimeError("No overlay parameters defined for %r GeV and %s " % (energy, self.overlayEventType))

    if self.overlayEvents:
      overlay.setUseEnergyForFileLookup( False )

    self._setApplicationOptions("Overlay", overlay)

    return overlay
예제 #3
0
class OverlayInputTestCase(unittest.TestCase):
    """ Base class for the OverlayInput test cases
  """
    def setUp(self):
        """set up the objects"""
        self.olin = OverlayInput({})

    def test_setters(self):
        assertEqualsImproved(
            (self.olin.machine, self.olin.prodID,
             self.olin.useEnergyForFileLookup, self.olin.detectorModel,
             self.olin.backgroundEventType), ('clic_cdr', 0, True, '', ''),
            self)
        self.assertFalse(self.olin._errorDict)
        self.olin.setMachine('mytestMachine')
        assertDiracSucceeds(self.olin.setProdID(14983), self)
        self.olin.setUseEnergyForFileLookup(False)
        self.olin.setDetectorModel('mytestDetector')
        self.olin.setBackgroundType('myBackgroundParticle.Testme')
        assertEqualsImproved(
            (self.olin.machine, self.olin.prodID,
             self.olin.useEnergyForFileLookup, self.olin.detectorModel,
             self.olin.backgroundEventType),
            ('mytestMachine', 14983, False, 'mytestDetector',
             'myBackgroundParticle.Testme'), self)
        self.assertFalse(self.olin._errorDict)

    def test_setters_checks(self):
        self.olin.setMachine({'138rj': True})
        self.olin.setProdID([])
        self.olin.setUseEnergyForFileLookup('False')
        self.olin.setDetectorModel(9024)
        self.olin.setBackgroundType(8914)
        assertEqualsImproved(len(self.olin._errorDict['_checkArgs']), 5, self)

    def test_userjobmodules(self):
        with patch.object(self.olin,
                          '_setApplicationModuleAndParameters',
                          new=Mock(return_value=S_OK())):
            assertDiracSucceeds(self.olin._userjobmodules(Mock()), self)

    def test_userjobmodules_fails(self):
        with patch.object(self.olin,
                          '_setApplicationModuleAndParameters',
                          new=Mock(return_value=S_ERROR('bla'))):
            assertDiracFailsWith(self.olin._userjobmodules(Mock()),
                                 'userjobmodules failed', self)

    def test_prodjobmodules(self):
        with patch.object(self.olin,
                          '_setApplicationModuleAndParameters',
                          new=Mock(return_value=S_OK())):
            assertDiracSucceeds(self.olin._prodjobmodules(Mock()), self)

    def test_prodjobmodules_fails(self):
        with patch.object(self.olin,
                          '_setApplicationModuleAndParameters',
                          new=Mock(return_value=S_ERROR('bla'))):
            assertDiracFailsWith(self.olin._prodjobmodules(Mock()),
                                 'prodjobmodules failed', self)

    def test_addparameterstostep_fails(self):
        with patch.object(self.olin,
                          '_addBaseParameters',
                          new=Mock(return_value=S_ERROR('bla'))):
            assertDiracFailsWith(self.olin._addParametersToStep(Mock()),
                                 'failed to set base param', self)

    def test_addparameterstostep(self):
        with patch.object(self.olin,
                          '_addBaseParameters',
                          new=Mock(return_value=S_OK())):
            assertDiracSucceeds(self.olin._addParametersToStep(Mock()), self)

    def test_checkconsistency(self):
        self.olin.pathToOverlayFiles = ''
        self.olin.bxToOverlay = True
        self.olin.numberOfGGToHadronInteractions = 1345
        self.olin.backgroundEventType = 'myTestBGEvt'
        self.olin._jobtype = 'notUser'
        assertDiracSucceeds(self.olin._checkConsistency(), self)
        assertEqualsImproved((self.olin.prodparameters['detectorModel'],
                              self.olin.prodparameters['BXOverlay'],
                              self.olin.prodparameters['GGtoHadInt']),
                             ('', True, 1345), self)

    def test_checkconsistency_nofilesinpath(self):
        self.olin.pathToOverlayFiles = '/my/path/overlay.files'
        with patch(
                'DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient.findFilesByMetadata',
                new=Mock(return_value=S_OK([]))) as fcc_mock:
            assertDiracFailsWith(self.olin._checkConsistency(),
                                 'no files in that path', self)
            fcc_mock.assert_called_once_with({}, '/my/path/overlay.files')

    def test_checkconsistency_no_bunchcrossings(self):
        self.olin.pathToOverlayFiles = ''
        self.olin.bxToOverlay = None
        assertDiracFailsWith(self.olin._checkConsistency(),
                             'number of overlay bunch crossings not defined',
                             self)

    def test_checkconsistency_no_backgroundevts(self):
        self.olin.pathToOverlayFiles = ''
        self.olin.bxToOverlay = True
        self.olin.numberOfGGToHadronInteractions = 0
        assertDiracFailsWith(
            self.olin._checkConsistency(),
            'background events per bunch crossing is not defined', self)

    def test_checkconsistency_no_bgevttype(self):
        self.olin.pathToOverlayFiles = ''
        self.olin.bxToOverlay = True
        self.olin.numberOfGGToHadronInteractions = 1345
        self.olin.backgroundEventType = ''
        assertDiracFailsWith(self.olin._checkConsistency(),
                             'event type is not defined', self)

    def test_checkconsistency_nosignalevtperjob(self):
        self.olin.pathToOverlayFiles = ''
        self.olin.bxToOverlay = True
        self.olin.numberOfGGToHadronInteractions = 1345
        self.olin.backgroundEventType = 'gghad'
        self.olin._jobtype = 'User'
        self.olin.numberOfSignalEventsPerJob = 0
        assertDiracFailsWith(self.olin._checkConsistency(),
                             'signal event per job is not defined', self)

    def test_checkfinalconsistency_simple(self):
        self.olin.pathToOverlayFiles = 'some/path'
        assertDiracSucceeds(self.olin._checkFinalConsistency(), self)

    def test_checkfinalconsistency_noenergy(self):
        self.olin.energy = 0
        assertDiracFailsWith(self.olin._checkFinalConsistency(),
                             'energy must be specified', self)

    def test_checkfinalconsistency_ops_fails(self):
        ops_mock = Mock()
        ops_mock.getSections.return_value = S_ERROR('some_ops_error')
        self.olin._ops = ops_mock
        self.olin.energy = 198
        assertDiracFailsWith(self.olin._checkFinalConsistency(),
                             'could not resolve the cs path', self)

    def test_checkfinalconsistency_machinemissing(self):
        ops_mock = Mock()
        ops_mock.getSections.return_value = S_OK(
            ['allowed_machine_1', 'other_mach'])
        self.olin._ops = ops_mock
        self.olin.machine = 'myTestMachineVeryRare'
        self.olin.energy = 198
        assertDiracFailsWith(
            self.olin._checkFinalConsistency(),
            'machine mytestmachineveryrare does not have overlay data', self)

    def test_checkfinalconsistency_energynotfound(self):
        self.olin.energy = 824
        section_dict = {
            '/Overlay': ['myTestMachineVeryRare'],
            '/Overlay/myTestMachineVeryRare': ['other_energy_tev', '824tev']
        }
        ops_mock = Mock()
        ops_mock.getSections.side_effect = lambda path: S_OK(section_dict[path]
                                                             )
        self.olin._ops = ops_mock
        self.olin.machine = 'myTestMachineVeryRare'
        assertDiracFailsWith(self.olin._checkFinalConsistency(),
                             'no overlay files corresponding to 824gev', self)

    def test_checkfinalconsistency_nodetectormodels(self):
        self.olin.energy = 1000.0
        section_dict = {
            '/Overlay': S_OK(['myTestMachineVeryRare']),
            '/Overlay/myTestMachineVeryRare':
            S_OK(['other_energy_tev', '1tev']),
            '/Overlay/myTestMachineVeryRare/1tev': S_ERROR('bla')
        }
        ops_mock = Mock()
        ops_mock.getSections.side_effect = lambda path: section_dict[path]
        self.olin._ops = ops_mock
        self.olin.machine = 'myTestMachineVeryRare'
        assertDiracFailsWith(self.olin._checkFinalConsistency(),
                             'could not find the detector models', self)

    def test_checkfinalconsistency_detectormodelnotfound(self):
        self.olin.energy = 981324
        section_dict = {
            '/Overlay': ['myTestMachineVeryRare'],
            '/Overlay/myTestMachineVeryRare': ['other_energy_tev', '981.3gev'],
            '/Overlay/myTestMachineVeryRare/981.3tev':
            ['some_other_detector_model', 'neither_this']
        }
        ops_mock = Mock()
        ops_mock.getSections.side_effect = lambda path: S_OK(section_dict[path]
                                                             )
        self.olin._ops = ops_mock
        self.olin.machine = 'myTestMachineVeryRare'
        assertDiracFailsWith(self.olin._checkFinalConsistency(),
                             'no overlay files corresponding to 981.3tev',
                             self)

    def test_checkfinalconsistency_nobkg(self):
        self.olin.detectorModel = 'testDetMod'
        self.olin.energy = 981000
        section_dict = {
            '/Overlay': ['myTestMachineVeryRare'],
            '/Overlay/myTestMachineVeryRare': ['other_energy_tev', '981tev'],
            '/Overlay/myTestMachineVeryRare/981tev': ['testDetMod']
        }
        ops_mock = Mock()
        ops_mock.getSections.side_effect = lambda path: S_OK(section_dict[path]
                                                             )
        self.olin._ops = ops_mock
        self.olin.machine = 'myTestMachineVeryRare'
        with patch.object(inspect.getmodule(OverlayInput),
                          'allowedBkg',
                          new=Mock(return_value=S_ERROR('bkg_test_err'))):
            assertDiracFailsWith(self.olin._checkFinalConsistency(),
                                 'bkg_test_err', self)

    def test_checkfinalconsistency_negativeprodid(self):
        self.olin.detectorModel = 'testDetMod'
        self.olin.energy = 981000
        section_dict = {
            '/Overlay': ['myTestMachineVeryRare'],
            '/Overlay/myTestMachineVeryRare': ['other_energy_tev', '981tev'],
            '/Overlay/myTestMachineVeryRare/981tev': ['testDetMod']
        }
        ops_mock = Mock()
        ops_mock.getSections.side_effect = lambda path: S_OK(section_dict[path]
                                                             )
        self.olin._ops = ops_mock
        self.olin.machine = 'myTestMachineVeryRare'
        with patch.object(inspect.getmodule(OverlayInput),
                          'allowedBkg',
                          new=Mock(return_value=S_OK(-147))):
            assertDiracFailsWith(self.olin._checkFinalConsistency(),
                                 'no proper production id found', self)

    def test_checkfinalconsistency(self):
        self.olin.detectorModel = 'testDetMod'
        self.olin.energy = 981000
        section_dict = {
            '/Overlay': ['myTestMachineVeryRare'],
            '/Overlay/myTestMachineVeryRare': ['other_energy_tev', '981tev'],
            '/Overlay/myTestMachineVeryRare/981tev': ['testDetMod']
        }
        ops_mock = Mock()
        ops_mock.getSections.side_effect = lambda path: S_OK(section_dict[path]
                                                             )
        self.olin._ops = ops_mock
        self.olin.machine = 'myTestMachineVeryRare'
        with patch.object(inspect.getmodule(OverlayInput),
                          'allowedBkg',
                          new=Mock(return_value=S_OK(13987))):
            assertDiracSucceeds(self.olin._checkFinalConsistency(), self)
예제 #4
0
            overlay.setGGToHadInt(0.0464)  ##When running at 350geV
            overlay.setDetectorModel("CLIC_ILD_CDR500")
        elif energy == 3000.:
            overlay.setBXOverlay(60)
            overlay.setGGToHadInt(3.2)  ##When running at 3TeV
            overlay.setDetectorModel("CLIC_ILD_CDR")
        elif energy == 1400.:
            overlay.setBXOverlay(60)
            overlay.setGGToHadInt(1.3)  ##When running at 1.4TeV
            overlay.setDetectorModel("CLIC_ILD_CDR")
        else:
            print "Overlay CLIC_ILD: No overlay parameters defined for this energy"

    if detectormodel in ILDDetectorModels:
        overlay.setMachine("ilc_dbd")
        overlay.setBackgroundType("aa_lowpt")
        overlay.setBXOverlay(1)
        overlay.setDetectorModel(detectormodel)
        if energy == 250:
            overlay.setGGToHadInt(0.3)

    ##Reconstruction ILD with overlay
    mao = Marlin()
    mao.setDebug()
    mao.setVersion(SOFTWAREVERSION)
    if ild_rec_ov:
        if energy == 500.:
            mao.setSteeringFile("clic_ild_cdr500_steering_overlay.xml")
            mao.setGearFile('clic_ild_cdr500.gear')
        elif energy == 420.:
            mao.setSteeringFile("clic_ild_cdr500_steering_overlay_420.0.xml")
예제 #5
0
class OverlayInputTestCase( unittest.TestCase ):
  """ Base class for the OverlayInput test cases
  """
  def setUp(self):
    """set up the objects"""
    self.olin = OverlayInput( {} )

  def test_setters( self ):
    assertEqualsImproved( ( self.olin.machine, self.olin.prodID, self.olin.useEnergyForFileLookup,
                            self.olin.detectorModel, self.olin.backgroundEventType ),
                          ( 'clic_cdr', 0, True, '', '' ), self )
    self.assertFalse( self.olin._errorDict )
    self.olin.setMachine( 'mytestMachine' )
    assertDiracSucceeds( self.olin.setProdID( 14983 ), self )
    self.olin.setUseEnergyForFileLookup( False )
    self.olin.setDetectorModel( 'mytestDetector' )
    self.olin.setBackgroundType( 'myBackgroundParticle.Testme' )
    assertEqualsImproved( ( self.olin.machine, self.olin.prodID, self.olin.useEnergyForFileLookup,
                            self.olin.detectorModel, self.olin.backgroundEventType ),
                          ( 'mytestMachine', 14983, False, 'mytestDetector', 'myBackgroundParticle.Testme' ),
                          self )
    self.assertFalse( self.olin._errorDict )

  def test_setters_checks( self ):
    self.olin.setMachine( { '138rj' : True } )
    self.olin.setProdID( [] )
    self.olin.setUseEnergyForFileLookup( 'False' )
    self.olin.setDetectorModel( 9024 )
    self.olin.setBackgroundType( 8914 )
    assertEqualsImproved( len( self.olin._errorDict['_checkArgs'] ), 5, self )

  def test_userjobmodules( self ):
    with patch.object(self.olin, '_setApplicationModuleAndParameters', new=Mock(return_value=S_OK())):
      assertDiracSucceeds( self.olin._userjobmodules( Mock() ), self )

  def test_userjobmodules_fails( self ):
    with patch.object(self.olin, '_setApplicationModuleAndParameters', new=Mock(return_value=S_ERROR('bla'))):
      assertDiracFailsWith( self.olin._userjobmodules( Mock() ), 'userjobmodules failed', self )

  def test_prodjobmodules( self ):
    with patch.object(self.olin, '_setApplicationModuleAndParameters', new=Mock(return_value=S_OK())):
      assertDiracSucceeds( self.olin._prodjobmodules( Mock() ), self )

  def test_prodjobmodules_fails( self ):
    with patch.object(self.olin, '_setApplicationModuleAndParameters', new=Mock(return_value=S_ERROR('bla'))):
      assertDiracFailsWith( self.olin._prodjobmodules( Mock() ), 'prodjobmodules failed', self )

  def test_addparameterstostep_fails( self ):
    with patch.object(self.olin, '_addBaseParameters', new=Mock(return_value=S_ERROR('bla'))):
      assertDiracFailsWith( self.olin._addParametersToStep( Mock() ), 'failed to set base param', self )

  def test_addparameterstostep( self ):
    with patch.object(self.olin, '_addBaseParameters', new=Mock(return_value=S_OK())):
      assertDiracSucceeds( self.olin._addParametersToStep( Mock() ), self )

  def test_checkconsistency( self ):
    self.olin.pathToOverlayFiles = ''
    self.olin.bxToOverlay = True
    self.olin.numberOfGGToHadronInteractions = 1345
    self.olin.backgroundEventType = 'myTestBGEvt'
    self.olin._jobtype = 'notUser'
    assertDiracSucceeds( self.olin._checkConsistency(), self )
    assertEqualsImproved(
      ( self.olin.prodparameters['detectorModel'], self.olin.prodparameters['BXOverlay'],
        self.olin.prodparameters['GGtoHadInt'] ),
      ( '', True, 1345 ), self )

  def test_checkconsistency_nofilesinpath( self ):
    self.olin.pathToOverlayFiles = '/my/path/overlay.files'
    with patch('DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient.findFilesByMetadata', new=Mock(return_value=S_OK([]))) as fcc_mock:
      assertDiracFailsWith( self.olin._checkConsistency(), 'no files in that path', self )
      fcc_mock.assert_called_once_with( {}, '/my/path/overlay.files' )

  def test_checkconsistency_no_bunchcrossings( self ):
    self.olin.pathToOverlayFiles = ''
    self.olin.bxToOverlay = None
    assertDiracFailsWith( self.olin._checkConsistency(), 'number of overlay bunch crossings not defined', self )

  def test_checkconsistency_no_backgroundevts( self ):
    self.olin.pathToOverlayFiles = ''
    self.olin.bxToOverlay = True
    self.olin.numberOfGGToHadronInteractions = 0
    assertDiracFailsWith( self.olin._checkConsistency(), 'background events per bunch crossing is not defined',
                          self )

  def test_checkconsistency_no_bgevttype( self ):
    self.olin.pathToOverlayFiles = ''
    self.olin.bxToOverlay = True
    self.olin.numberOfGGToHadronInteractions = 1345
    self.olin.backgroundEventType = ''
    assertDiracFailsWith( self.olin._checkConsistency(), 'event type is not defined', self )

  def test_checkconsistency_nosignalevtperjob( self ):
    self.olin.pathToOverlayFiles = ''
    self.olin.bxToOverlay = True
    self.olin.numberOfGGToHadronInteractions = 1345
    self.olin.backgroundEventType = 'gghad'
    self.olin._jobtype = 'User'
    self.olin.numberOfSignalEventsPerJob = 0
    assertDiracFailsWith( self.olin._checkConsistency(), 'signal event per job is not defined',
                          self )

  def test_checkfinalconsistency_simple( self ):
    self.olin.pathToOverlayFiles = 'some/path'
    assertDiracSucceeds( self.olin._checkFinalConsistency(), self )

  def test_checkfinalconsistency_noenergy( self ):
    self.olin.energy = 0
    assertDiracFailsWith( self.olin._checkFinalConsistency(), 'energy must be specified', self )

  def test_checkfinalconsistency_ops_fails( self ):
    ops_mock = Mock()
    ops_mock.getSections.return_value=S_ERROR('some_ops_error')
    self.olin._ops = ops_mock
    self.olin.energy = 198
    assertDiracFailsWith( self.olin._checkFinalConsistency(), 'could not resolve the cs path', self )

  def test_checkfinalconsistency_machinemissing( self ):
    ops_mock = Mock()
    ops_mock.getSections.return_value=S_OK( [ 'allowed_machine_1', 'other_mach' ] )
    self.olin._ops = ops_mock
    self.olin.machine = 'myTestMachineVeryRare'
    self.olin.energy = 198
    assertDiracFailsWith( self.olin._checkFinalConsistency(),
                          'machine mytestmachineveryrare does not have overlay data', self )

  def test_checkfinalconsistency_energynotfound( self ):
    self.olin.energy = 824
    section_dict = { '/Overlay' : [ 'myTestMachineVeryRare' ],
                     '/Overlay/myTestMachineVeryRare' : [ 'other_energy_tev', '824tev' ] }
    ops_mock = Mock()
    ops_mock.getSections.side_effect=lambda path: S_OK( section_dict[path] )
    self.olin._ops = ops_mock
    self.olin.machine = 'myTestMachineVeryRare'
    assertDiracFailsWith( self.olin._checkFinalConsistency(),
                          'no overlay files corresponding to 824gev', self )

  def test_checkfinalconsistency_nodetectormodels( self ):
    self.olin.energy = 1000.0
    section_dict = { '/Overlay' : S_OK( [ 'myTestMachineVeryRare' ] ),
                     '/Overlay/myTestMachineVeryRare' : S_OK( [ 'other_energy_tev', '1tev' ] ),
                     '/Overlay/myTestMachineVeryRare/1tev' : S_ERROR('bla') }
    ops_mock = Mock()
    ops_mock.getSections.side_effect=lambda path: section_dict[path]
    self.olin._ops = ops_mock
    self.olin.machine = 'myTestMachineVeryRare'
    assertDiracFailsWith( self.olin._checkFinalConsistency(),
                          'could not find the detector models', self )

  def test_checkfinalconsistency_detectormodelnotfound( self ):
    self.olin.energy = 981324
    section_dict = { '/Overlay' : [ 'myTestMachineVeryRare' ],
                     '/Overlay/myTestMachineVeryRare' : [ 'other_energy_tev', '981.3gev' ],
                     '/Overlay/myTestMachineVeryRare/981.3tev' : [ 'some_other_detector_model',
                                                                   'neither_this' ] }
    ops_mock = Mock()
    ops_mock.getSections.side_effect=lambda path: S_OK( section_dict[path] )
    self.olin._ops = ops_mock
    self.olin.machine = 'myTestMachineVeryRare'
    assertDiracFailsWith( self.olin._checkFinalConsistency(),
                          'no overlay files corresponding to 981.3tev', self )

  def test_checkfinalconsistency_nobkg( self ):
    self.olin.detectorModel = 'testDetMod'
    self.olin.energy = 981000
    section_dict = { '/Overlay' : [ 'myTestMachineVeryRare' ],
                     '/Overlay/myTestMachineVeryRare' : [ 'other_energy_tev', '981tev' ],
                     '/Overlay/myTestMachineVeryRare/981tev' : [ 'testDetMod' ] }
    ops_mock = Mock()
    ops_mock.getSections.side_effect=lambda path: S_OK( section_dict[path] )
    self.olin._ops = ops_mock
    self.olin.machine = 'myTestMachineVeryRare'
    with patch.object(inspect.getmodule(OverlayInput), 'allowedBkg', new=Mock(return_value=S_ERROR('bkg_test_err'))):
      assertDiracFailsWith( self.olin._checkFinalConsistency(), 'bkg_test_err', self )

  def test_checkfinalconsistency_negativeprodid( self ):
    self.olin.detectorModel = 'testDetMod'
    self.olin.energy = 981000
    section_dict = { '/Overlay' : [ 'myTestMachineVeryRare' ],
                     '/Overlay/myTestMachineVeryRare' : [ 'other_energy_tev', '981tev' ],
                     '/Overlay/myTestMachineVeryRare/981tev' : [ 'testDetMod' ] }
    ops_mock = Mock()
    ops_mock.getSections.side_effect=lambda path: S_OK( section_dict[path] )
    self.olin._ops = ops_mock
    self.olin.machine = 'myTestMachineVeryRare'
    with patch.object(inspect.getmodule(OverlayInput), 'allowedBkg', new=Mock(return_value=S_OK(-147))):
      assertDiracFailsWith( self.olin._checkFinalConsistency(), 'no proper production id found', self )

  def test_checkfinalconsistency( self ):
    self.olin.detectorModel = 'testDetMod'
    self.olin.energy = 981000
    section_dict = { '/Overlay' : [ 'myTestMachineVeryRare' ],
                     '/Overlay/myTestMachineVeryRare' : [ 'other_energy_tev', '981tev' ],
                     '/Overlay/myTestMachineVeryRare/981tev' : [ 'testDetMod' ] }
    ops_mock = Mock()
    ops_mock.getSections.side_effect=lambda path: S_OK( section_dict[path] )
    self.olin._ops = ops_mock
    self.olin.machine = 'myTestMachineVeryRare'
    with patch.object(inspect.getmodule(OverlayInput), 'allowedBkg', new=Mock(return_value=S_OK(13987))):
      assertDiracSucceeds( self.olin._checkFinalConsistency(), self )