コード例 #1
0
def LArAutoCorrTotalToolDefault(name="LArAutoCorrTotalToolDefault", **kw):
    # call base class constructor
    from AthenaCommon import CfgMgr
    kw['name'] = name
    tool = CfgMgr.LArAutoCorrTotalTool(**kw)

    mlog = logging.getLogger('LArAutoCorrTotalToolDefault::__init__ ')
    mlog.info("entering")

    # do the configuration
    if globalflags.DataSource() == 'data':
        tool.MCSym = False
        tool.IsMC = False
        tool.keyPedestal = "Pedestal"
    else:
        tool.MCSym = True
        tool.IsMC = True

    from AthenaCommon.BeamFlags import jobproperties
    tool.deltaBunch = int(jobproperties.Beam.bunchSpacing() / (25. * ns) + 0.5)

    from LArROD.LArRODFlags import larRODFlags
    if larRODFlags.doOFCMixedOptimization():
        tool.UseMixedOFCOpt = True
        tool.NMinBias = jobproperties.Beam.numberOfCollisions()
        mlog.info(
            "  setup for  Ncollisions %f   deltaBunch %f and OFC *MIXED* optimization"
            % (jobproperties.Beam.numberOfCollisions(),
               jobproperties.Beam.bunchSpacing()))
    else:
        if larRODFlags.doOFCPileupOptimization():
            if larRODFlags.NumberOfCollisions():
                tool.NMinBias = larRODFlags.NumberOfCollisions()
                mlog.info("  setup for  Ncollisions %f   deltaBunch %f" %
                          (larRODFlags.NumberOfCollisions(),
                           jobproperties.Beam.bunchSpacing()))
            else:
                tool.NMinBias = jobproperties.Beam.numberOfCollisions()
                mlog.info("  setup for  Ncollisions %f   deltaBunch %f" %
                          (jobproperties.Beam.numberOfCollisions(),
                           jobproperties.Beam.bunchSpacing()))
        else:
            tool.NMinBias = 0
            mlog.info(
                "  setup for computing total noise autocorrelation without pileup"
            )

    tool.NSamples = larRODFlags.nSamples()
    tool.firstSample = larRODFlags.firstSample()

    from LArRecUtils.LArADC2MeVToolDefault import LArADC2MeVToolDefault
    theADC2MeVTool = LArADC2MeVToolDefault()
    from AthenaCommon.AppMgr import ToolSvc
    ToolSvc += theADC2MeVTool
    tool.ADC2MeVTool = theADC2MeVTool
    return tool
コード例 #2
0
def LArAutoCorrTotalSCToolDefault (name="LArAutoCorrTotalSCToolDefault", **kw):
    # call base class constructor
    from AthenaCommon import CfgMgr
    kw['name'] = name
    tool = CfgMgr.LArAutoCorrTotalTool(**kw)

    mlog = logging.getLogger( 'LArAutoCorrTotalSCToolDefault::__init__ ' )
    mlog.info("entering")

    tool.IsSuperCell = True
    # do the configuration
    if globalflags.DataSource()=='data':
        #return False
        tool.MCSym = False
        tool.IsMC  = False
    else:
        tool.MCSym = False
        tool.IsMC  = True
        tool.keyAutoCorr = "LArAutoCorrSC"
        tool.keyShape = "LArShapeSC"
        tool.keyNoise = "LArNoiseSC"
        tool.keyPedestal = "LArPedestalSC"
        tool.keyfSampl = "LARfSamplSC"

    from AthenaCommon.BeamFlags import jobproperties
    tool.deltaBunch = int(jobproperties.Beam.bunchSpacing()/( 25.*ns)+0.5)                

    from LArROD.LArRODFlags import larRODFlags
    if larRODFlags.doOFCMixedOptimization():
        tool.UseMixedOFCOpt = True
        tool.NMinBias=jobproperties.Beam.numberOfCollisions()
        print ('Number of Ncollisions : ',jobproperties.Beam.numberOfCollisions())
        mlog.info("  setup for  Ncollisions %f   deltaBunch %f and OFC *MIXED* optimization", jobproperties.Beam.numberOfCollisions(), jobproperties.Beam.bunchSpacing())
    else:        
        if larRODFlags.doOFCPileupOptimization():
            if larRODFlags.NumberOfCollisions():
                tool.NMinBias=larRODFlags.NumberOfCollisions()
                mlog.info("  setup for  Ncollisions %f   deltaBunch %f", larRODFlags.NumberOfCollisions(), jobproperties.Beam.bunchSpacing())
            else:
                tool.NMinBias=jobproperties.Beam.numberOfCollisions()
                mlog.info("  setup for  Ncollisions %f   deltaBunch %f", jobproperties.Beam.numberOfCollisions(), jobproperties.Beam.bunchSpacing())
        else:
            tool.NMinBias=0
            mlog.info("  setup for computing total noise autocorrelation without pileup")


    tool.NSamples = larRODFlags.nSamples()
    tool.firstSample = larRODFlags.firstSample()

    from LArRecUtils.LArADC2MeVSCToolDefault import LArADC2MeVSCToolDefault
    theADC2MeVTool = LArADC2MeVSCToolDefault()
    from AthenaCommon.AppMgr import ToolSvc
    ToolSvc += theADC2MeVTool
    tool.ADC2MeVTool = theADC2MeVTool
    if not globalflags.DataSource()=='data':
       from IOVDbSvc.CondDB import conddb
       if ( conddb.isMC and not conddb.folderRequested('/LAR/IdentifierOfl/OnOffIdMap_SC') ) :
           conddb.addFolder("LAR_OFL","<tag>LARIdentifierOflOnOffIdMap_SC-000</tag>/LAR/IdentifierOfl/OnOffIdMap_SC")
       if ( conddb.isMC and not conddb.folderRequested('/LAR/ElecCalibMCSC/fSampl') ) :
           conddb.addFolder("LAR_OFL","<tag>LARElecCalibMCSCfSampl-000</tag>/LAR/ElecCalibMCSC/fSampl")
       if ( conddb.isMC and not conddb.folderRequested('/LAR/ElecCalibMCSC/Pedestal') ) :
           conddb.addFolder("LAR_OFL","<tag>LARElecCalibMCSCPedestal-000</tag>/LAR/ElecCalibMCSC/Pedestal")
       if ( conddb.isMC and not conddb.folderRequested('/LAR/ElecCalibMCSC/Noise') ) :
           conddb.addFolder("LAR_OFL","<tag>LARElecCalibMCSCNoise-000</tag>/LAR/ElecCalibMCSC/Noise")
       if ( conddb.isMC and not conddb.folderRequested('/LAR/ElecCalibMCSC/Shape') ) :
           conddb.addFolder("LAR_OFL","<tag>LARElecCalibMCSCShape-000</tag>/LAR/ElecCalibMCSC/Shape")
       if ( conddb.isMC and not conddb.folderRequested('/LAR/ElecCalibMCSC/AutoCorr') ) :
           conddb.addFolder("LAR_OFL","<tag>LARElecCalibMCSCAutoCorr-000</tag>/LAR/ElecCalibMCSC/AutoCorr")
    return tool
コード例 #3
0
def LArOFCToolDefault(name="LArOFCToolDefault", **kw):
    # call base class constructor
    from AthenaCommon import CfgMgr
    kw['name'] = name
    tool = CfgMgr.LArOFCTool(**kw)

    mlog = logging.getLogger('LArOFCToolDefault::__init__ ')
    mlog.info("entering")
    mlog.warning("The LArOFCTool is deprecated! Use LArOFCCondAlg!")

    # do the configuration
    if globalflags.DataSource() == 'data':
        tool.MCSym = False
        tool.IsMC = False
        tool.FromDatabase = True
    else:
        tool.MCSym = True
        tool.IsMC = True
        tool.FromDatabase = False
        from LArROD.LArRODFlags import larRODFlags

        tool.firstSample = larRODFlags.firstSample()

        tool.useHighestGainAutoCorr = larRODFlags.useHighestGainAutoCorr()

        if larRODFlags.doOFCMixedOptimization(
        ):  # kept for backward compatibility

            tool.UseDelta = 1  # only EMECIW/HEC/FCAL
            from AthenaCommon.BeamFlags import jobproperties
            tool.DeltaBunch = int(jobproperties.Beam.bunchSpacing() /
                                  (25. * ns) + 0.5)
            mlog.info("  OFC *MIXED* optimization")

        else:

            tool.UseDelta = larRODFlags.UseDelta()

            if (larRODFlags.UseDelta() == 0):
                mlog.info("  Standard OFC optimization computation")

            elif (larRODFlags.UseDelta() == 1):
                mlog.info(
                    "  OFC optimization asking for no average shift as extra constraint only in EMECIW/HEC/FCAL"
                )
                from AthenaCommon.BeamFlags import jobproperties
                tool.DeltaBunch = int(jobproperties.Beam.bunchSpacing() /
                                      (25. * ns) + 0.5)

            elif (larRODFlags.UseDelta() == 2):
                mlog.info(
                    "  OFC optimization asking for no average shift as extra constraint everywhere"
                )
                from AthenaCommon.BeamFlags import jobproperties
                tool.DeltaBunch = int(jobproperties.Beam.bunchSpacing() /
                                      (25. * ns) + 0.5)

            elif (larRODFlags.UseDelta() == 3):
                mlog.info(
                    "  OFC optimization asking for no average shift as extra constraint only in EMECIW/HEC/FCAL1+high eta FCAL2-3"
                )
                from AthenaCommon.BeamFlags import jobproperties
                tool.DeltaBunch = int(jobproperties.Beam.bunchSpacing() /
                                      (25. * ns) + 0.5)

            else:
                tool.UseDelta = 0  ### avoid unforseed options

        ###
        #tool.Dump = True

    from LArRecUtils.LArAutoCorrTotalToolDefault import LArAutoCorrTotalToolDefault
    theAutoCorrTool = LArAutoCorrTotalToolDefault()
    from AthenaCommon.AppMgr import ToolSvc
    ToolSvc += theAutoCorrTool
    tool.AutoCorrTool = theAutoCorrTool
    return tool